Author: Justin Lee

  • Kids CMI? Maybe Parents also CMI

    This is in response to a thread I read at MummySG. (BTW, I’m reading the forum because I found posts related to noisy neighbours.)

    Hi, have to get this off my chest. ytd was with hubby and baby at BHG Bugis. after using the nursing room to nurse daughter, we proceed to the elevator to go to the first floor to go to liang seah st to meet friends for dinner.

    As the elevator just left thus there is no one so we r standing beside the door(not blocking) with dear daughter in her stroller sleeping. then came 3 teenagers(gers in most pro 14 or 16) standing behind us. when the elevator going to reach one of them kept pushing me wanting to get in first. my hubby who saw that told them” sorry we r also going in can wait for a while(cos need to push stroller in , somemore elevator have not even reach yet.”

    in the elevator one of them say to the one who was being told”hey he scolded you ?” then she replied”aiya you knw singaporean, kiasu want to go in first.” Wa, my hubby heard that hot , cos they r the one who want to rush in first. he scolded back” dont know who kiasu, keep pushing my wife wanting to rush in front to go in. yourself not singaporean is it.” 3 of them stared at my hubby and of cos we stared them back . then comethe best pt, they got off at lvl 2 n one of them actually scolded softly but i heard “Bas****” CAN you IMAGINE THAT! if not becos im standing inside ,i will go st8 out n ask them,”who you scolding BAS****, BI***. they think i got baby i good to bully or like those ‘chi xiang mother’?sorry, too bad IM NOT as im military trained, those who dont show respect will get it from me(in workplace.)nowadays the teenager REALLY CANNOT MAKE IT

    I think there’s two sides to the problem. OK, the teens described here CMI, but why so?

    I was at the basement of Century Square Tampines one afternoon with my colleagues. We were at the AXS machine paying our bills. I went first.

    For those who aren’t familiar with that area, the AXS machine is in the lift lobby of the basement.

    There was this little boy running around and he was hammering on things and creating a ruckus which was already annoying enough. Just when I was about to key in my account number, he came around and poked at my keyboard. I was furious and held his hand and shoved him away. Not exactly very harsh, but not gentle either (because I was already annoyed).

    I was done with my payment and my colleagues went next. Same thing happened and my colleagued shoved the kid aside.

    I was really angry and I said loudly, “whose kid is this har?” No response.

    All these while there’s a couple waiting for the lift, with a pram and a sleeping baby.

    Then when the lift came, the father turned around and said, “come boy, let’s go!

    I was like, ?!!!

    So the kid was running around, poking at others using the AXS machine and behing shoved away, they just didn’t freaking care. Even when somebody exclaimed whose kid was that, they didn’t care?

    I was very angry and told the parents straight in the face as they entered the lift that they “better learn to take care of (their) kid”, in full view of all the lift passengers but they didn’t seem like they cared.

    So really, the problem we’re seeing now is contributed by the poor upbringing of these kids. It’s a social problem and unfortunately cannot be solved unless we start looking at how we handle our kids.

  • Noisy Neighbours in Singapore

    If you’re wondering, wow, I’m writing a blog at this hour, well that’s because I’ve been awoken at 6AM+ this morning by my neighbour upstairs.

    I had to resort to hammering the ceiling with my fists last night to get them to shut up. That was 1:30AM. Yes, read carefully, my fists. I stood on a stool and hammered the ceiling. This proves that HDB flats are constructed so badly these days. The ceiling vibrated just as it did with the stomping and running upstairs. My flat’s 8 year old BTW. I don’t think my parent’s flat (closing 30 years now) are like that.

    I’m thinking if calling the cops doesn’t work and (according to many online forums) even going to CMC, MP and even court doesn’t work, what works?

    The government loves to take reactive approaches and maybe I should create something to make it happen. It’s called the “I sabo your neighbours, you sabo my neighbours” portal. I am fully committed to funding this portal as long as it brings me peace. I will start putting a plan to get this done. All comments welcome.

  • Tweaking a CF/Flash Linux System

    This is a follow up to my post on Building a CF Card Disk Home Server. I made some simple tweaks so that the system would work faster and more reliably.

    Just to answer JJ’s question on the speed of the CF disk, it’s not faster than a regular hard drive, but that could be due to my cheap CF card. If you’re willing to spend a bit lot more for a faster CF card, it should match the read speeds of regular hard drives, though write speeds may still be lacking.

    So, the focus here is to tweak the system for a CF/flash drive. There are two key differences from hard drives to consider.

    • Flash disks have no problem with random access while hard drives are best accessed sequentially.
    • Flash disks have much more limited write cycles than hard drives.

    With these differences in mind, I picked out the following things to optimize.

    • Encourage random access. This is easily done by changing the default I/O schedulers (e.g. cfq or anticipatory) that buffer I/O requests so that hard drives can process them sequentially. Buffering is not useful for flash disks at all. The best scheduler for random access drives is the noop scheduler, which simply just a n00b (pun intended) FIFO queue. To use it, edit /etc/grub.conf and append elevator=noop at the end of the kernel line, e.g.

      title CentOS (2.6.18-164.11.1.el5)
      root (hd0,0)
      kernel /vmlinuz-2.6.18-164.11.1.el5 ro root=/dev/hda3 elevator=noop
      initrd /initrd-2.6.18-164.11.1.el5.img

    • Discourage swapping to disk. Since the CF disk is slow and has limited write cycles, I reduced the swapping to disk by editing /etc/sysctl.conf and adding a line vm.swappiness=0 at the end.
    • Don’t track file access. Tracking file access means writing the last accessed time to disk every time a file is read, i.e. one write operation for every read. Disable tracking of file access by adding the noatime,nodiratime options to mount points in /etc/fstab, e.g.

      /dev/hda3 / ext3 defaults,noatime,nodiratime 1 1
      /dev/hda1 /boot ext3 defaults,noatime,nodiratime 1 2

    • Don’t write unnecessary files (such as logs) to disk. If you need logs for debugging only while the system is running, mount them as tmpfs. I mounted /tmp and /var/log/httpd (Apache logs) as tmpfs by adding two entries to /etc/fstab as show below.

      tmpfs /tmp tmpfs defaults 0 0
      tmpfs /var/log/httpd tmpfs defaults 0 0

    Anyway, for the curious, here’s the speed of my CF drive. Modern SATA drives can get as much as 60MB/s, PATA drives a little slower around 30-40MB/s.

    # hdparm -t /dev/hda
    /dev/hda:
    Timing buffered disk reads: 58 MB in 3.05 seconds = 19.04 MB/sec

  • Remix of Namewee’s famous CNY Song

    Here’s a remix of Namewee’s famous CNY song that I wrote out of boredom:

    Namewee’s CNY Remix (MIDI, 5Kb)

    For those with old Nokia’ish phones and polyphonic ringtones, you can use the MIDI below.

    If you wish to get your band and a volunteer 唢呐 player, by all means. Here’s the score (click to enlarge) 😛

  • The Beauty of CLI

    While Apple has successfully proven to the world that a well designed Graphical User Interface (GUI) can indeed provide better user experience, the beauty of a good Command Line Interface (CLI) shouldn’t be forgotten either.

    A GUI works well in consumer environments (e.g. SOHO routers), but enterprises and service providers work a little differently.

    I work in a service provider environment and have seen quite a fair bit of “high end” technology products. (These are usually appliance or black box hardware, like firewalls, routers, load balancers, DPIs, etc.) My observation is that while a lot of them have a great solution to an engineering problem, they actually create a management problem. Why? Because of the lack of a proper CLI or a proper management tool.

    There’s only so much a GUI can do to manage something as complicated as, say, a firewall. Check out the screenshots below taken from Mac OS X and Windows XP. They’re surprisingly complicated and not exactly useful. FYI, clicking on the [+] button on the Mac brings you to a file browser; I was expecting a form with IP address, port numbers and protocols.

    Windows XP Firewall Configuration
    Mac OS X Firewall Configuration

    So, how do I add a rule to allow my custom app running on UDP port 15,233? How do I tell the firewall to stop processing further rules if I see a certain TOS marked packet? These aren’t use cases for consumer firewalls, but in enterprises, rules like these are very common.

    Firewalls are actually simple examples of GUI gone wrong. However, there are way more complicated devices than firewalls around, such as load balancers, DPIs and all sorts of routing gear. The problem gets multiplied many folds when there are tens, hundreds or even thousands of these configurations to manage on multiple machines.

    While a fancy GUI gets you through a sales pitch with the higher management folks, it’s really a PITA for the guys (like me) running the show. There’s a certain beauty in CLIs that GUIs cannot emulate. One if them is duplication. It is extremely difficult to duplicate mouse clicks and menu navigation, not to mention getting around errors. Imagine you have 1,000 Windows XP machines. You need to add a new firewall rule to allow your users to access a new mail server. Without Active Directory, you’d have one hell of a time… clicking.

    The other pain of working in enterprise datacenters is the lack of remote access (thanks to NAT and VPN crap) or an actual monitor console. Many engineers run around with a laptop and a RS232 serial cable. That’s all that’s needed to manage a device on the run.

    So if you’re going to build something for the enterprise, particularly appliances/black box devices, please focus some effort on building a proper CLI or centralized management. Learn from the experts – there’s a reason why guys like Cisco, Juniper and Extreme are industry leaders.

  • Building a CF Card Disk Home Server

    Thought I would recycle some old systems in my house, so I dug up an ancient Book PC (Micro ATX?) running Celeron 1GHz with 128MB RAM and decided to do away with the risky hard drive that was generating lots of heat and rebuilt it with a CF card.

    Celeron 1GHz, 128MB RAM

    I got myself several IDE to CF adapters off eBay and also two unbranded 4GB CF cards. Flash disks are getting quite affordable recently and this is a good way to repurpose an ancient machine without having to spend a bomb on SSDs (and maybe a SATA controller).

    IDE (PATA) to CF

    Installed CentOS and I’m off for several hours of Yum update. I’ll turn this into a home development box and print server. No X11 (GUI) on this thing. 128MB is no longer enough to do these fancy stuff on modern distros.

    Good old Socket 7

    One thing though, I’m looking for a more efficient and low profile heat sink/fan combo for Socket 7/370. I can’t find anywhere that sells these stuff now… at least not for a decent price.

    P.S. Due to an ordering error I have two four extra IDE (PATA) to CF adapters. If you’d love to have them, please drop me a message and I’ll happily pass them to you. The wife while (true) { nags(); }takes revenge at my historical archive of  computer hardware, such as the CPU Hall of Fame below by buying more shoes and bags.

    My CPU Hall of Fame