Category: Technology

  • Second last CS3216 blog, lah!

    OK, Prof. Ben is chasing me for a blog and since I’m sitting here (at work, at this hour) waiting on a colleague, I shall write a short entry. I realized I haven’t been blogging for a while and my 105% honest excuse is that my manager went to Sungei Gedong Chalet (a.k.a. Reservist) so I was busy as hell covering some of his work.

    So here comes the second last blog entry. Aheem… (clears throat)

    I’d love to thank my wife, mother, father, etc. and of course Prof. Ben for inviting me to attend this class out of nowhere. I truly enjoyed my time and learnt a lot of things. Actually, I joined the class with the aim to learn anything, or what Prof would call “random stuff“, not to develop Facebook apps. I’ve actually had enough of Facebook apps back in 2007 where I worked in a small company dealing with some very first Facebook applications being made out of Singapore, although building an app for others and building an app for yourself is a different thing altogether.

    So what have I really learnt? I’ve learnt that my English sucks after four years of being bombarded by Singlish in the local workforce. I’m actually struggling to write a proper blog entry every time.

    I’ve also learnt that I’ve lost touch with the geek world. I didn’t even know what Google Wave was. I’ve never heard of Prezi, and I’ve never heard of DropBox. There’s probably about 100 other things I’ve never heard of that I found out during these 13 weeks.

    I’ve also found out that damn NUS students can talk and present! Sorry lah, but to the outside world NUS students are either like nerds or CMI. 😛

    I’ve also found out that a year 1 freshie can actually learn ActionScript 3 build a Flash game within 1 week.

    So there are super things that people can do that you’ve never thought was possible. But, now I know the power to create lies within, and I finally kicked myself in the ass and learnt how to build stuff in Flash. So, yes, I picked up a new language. Programming language, not French.

    I also face new challenges trying to get things done. I think it’s a little different everywhere. Back in Polytechnic, it was either nobody cares, or maybe I cared too much. Yufen once said doing project a with me gave her “满足感多多,成就感少少” (great sense of satisfaction, no sense of achievement. Did I translate right?) because I practically wrote most of the code and we’ll all get an ‘A’. 😛

    Then at work you could K people ‘cos they either deliver the goods or get fired. It was the root of all evil at work. $$$

    Then in NUS it was also different – everybody cared too much, but was too busy. Like Prof. Ben said, this is not the typical NUS class. OK, I buy his explanation.

    So anyway, CS3216 is a weird class, but I guess it’s weird in the right way.

    Back to work…

  • Advertising as a Monetization Idea

    I was chatting with a few folks who made the pitch last Friday and it seems a lot of people think selling ads is the only way to make money.

    While Google probably made close to $100m in Singapore selling advertising alone, I still think citing pure advertising as a form of  monetization is an extremely bad idea.

    Advertising is an extremely crowded space. Search engines are doing it, news portals are doing it, forums are doing it, social networks are doing it, so where do you stand in this crowd, especially if you’re a new startup?

    Instead of looking to sell advertisements for money, think of how you can monetize your strengths such as selling a service or  selling data and statistics for market intelligence, or even being acquired by another company.

    Think about it…

  • The Business of Search and Advertising

    Phew. I’m finally back from graveyard work, showered and waiting for my hair to dry. I’ll blog while my memory’s fresh. If I go to sleep now, I’ll wake up with only half of what I was thinking the night before.

    Chewy gave a very interesting talk at NUS today. It gave me new perspectives of the CPC/CPA advertising scene but I have my thoughts decided to blog them so everybody can discuss. I’ll be sending Chewy an e-mail so he can comment as well.

    I totally agree that search is a place where money can be made. When Google went offline for two hours in the middle of last year, the Internet literally died together with them. Imagine the world without search today. (Food for thought.)

    The local consumer industry’s probably not as competitive as in the US, but they certainly have found ways to suck your money without the need to spend more money on advertising. I mean, as a business, isn’t that fantastic? 😛

    I think Singapore’s a weird economy. Here’s why I think so:

    We don’t really have much choices. When Chewy said that Singapore’s the richest country in Southeast Asia, well, maybe we are in terms of raw GDP per capita, but I’m not entirely sure if we’re equally rich when taking real costs of living into account. The way PPP is calculated just isn’t fair. I mean WTF is a Big Mac Index? It’s almost like a currency conversion against US$! PPP needs to take into account other living standards and not just a “basket of goods” plus a Big Mac — stuff like a house or a car for example. It’s not like in the US where I could choose to live far out and buy a house cheap, I don’t really have a choice! Punggol is as far as you can get! Half a million for a HDB flat? Forget it!

    We’re materialistic. So when Chewy brought up the point about Taxi queues, I’m not surprised. It’s a matter of how people perceive the value of money. I’m sure there are times you think to yourself, “OK, I can afford to wait. I don’t need to spend $3. I’ll stand in line.” Singaporeans are a materialistic bunch of people who’d rather spend money on goods for showing off than for services that convenience them.

    We’re suaku. I tune in to News Radio 93.8 when I drive and there’s this programme called Talk Back or something like that where people call in and debate some topic, like “do you think Taxis are expensive in Singapore?”. Sometimes it just drives me nuts listening to what people complain about here. I can only conclude that we’re very suaku.

    That much about what I think is the state of Singapore’s consumers, I’ll move on to the part on advertising.

    The current CPC/CPA advertising does indeed encourage competition, but this type of advertising (price war) is unhealthy for businesses. It turns consumers away from the real value of a product (or brand) and focuses on price instead. If the industry worked this way, there wouldn’t be Bread Talk or Apple and business would fight themselves to death and create more disparities of wealth.

    If you looked at PC hardware in Sim Lim, the stores there basically compete on nothing but price. Same probably goes for shoes at Queenway. If they wanted to win the sales, they simply cut the price. Plain and simple? Not so. At the end of the day they basically do more work for less and customers don’t even remember the stores’ name. So now goes back to the question on my TV purchase. If Chewy asked me why I didn’t go to Sim Lim to buy my TV, my answer would be that I trusted Harvey Norman (or Best Denki/Challenger) more than the dodgy stores at Sim Lim. That’ was why I decided to take a walk at Harvey Norman (instead of Best Denki/Challenger) which was nearer to my home.

    Any business who’s looking for long term growth needs to build its’ brand. And by branding it doesn’t mean a colorful logo or a fancy yodel. A brand is something people have an affiliation to and builds royalty over time. Unfortunately though, brand building has to start when a consumer is unaware, and that’s where the CPM advertising and Search Engine Optimization (SEO) guys come in to screw around with generic algorithmic search results.

    Although I’d believe that that there’s potential for CPC/CPA to aid in building brands, this is still an area that’s untapped. CPC/CPA isn’t necessarily positive for brand building. Some people may perceive advertisers as scammy or desperate, for example.  I’m also sure that most people don’t plan and search online to buy everything. Some purchases are made on impulse, especially small value items like little earrings. Females 14 to 25 years of age should be familiar with such a buying pattern. 😛

  • 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

  • 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