Sajjad's Blog

Sunday 31st July 2005

Horrific Perl

Perl has been driving me crazy lately. I'm having to test, debug and develop somebody else's code, which itself isn't fun, and it being in Perl, plus having to test it mostly on Windows and IE just turns the whole experience into a horrible nightmare.

My search for Perl developers has been fruitless so far. You would think that the (once?) most widely used language on the web would be a pretty common skill, but all I found was one person with the right experience and he was on the other side of the country.

The good part? Seeing the fruits of going through such an experience. It's just more satisfying if you've had to suffer a lot.

Posted at 00:05am PKT Comments(1) |

Wednesday 27th July 2005

Riding the Motorway on a Wheelchair

It's been a while since my last entry though there's been a lot to blog about. I've been so busy with work that there's hardly been much time for sleep. Though I can't guarantee more regular posts, I'll try to write what I can. To kick things off, here's an amusing story:

http://news.bbc.co.uk/2/hi/europe/4719819.stm
"German lorry drivers were shocked to find themselves sharing the autobahn with an 80-year-old in a wheelchair, ...... He took to the hard shoulder in an electric chair capable of speeds of 6-10 km/h (4-6mph), ..... The police spokeswoman explained that he had wanted to do a little shopping."

Posted at 11:48am PKT Comments(12) |

Monday 11th July 2005

Internet Link Restored

Almost two weeks after the undersea cable problem that crippled the country's international bandwidth, things are back in full swing. The issue was resolved sometime Friday morning and the link was fully operational (after testing) by noon the same day.

It's hard to say how much losses businesses have suffered during this period. A lot of businesses, based entirely or mostly on the net, have sprung up recently. Call centers, airlines and banks rely on it quite heavily and even the provided satellite backups could hardly provide half of the required bandwidth.

Nadir Minhas, my ex-boss and a good friend of mine and the owner of a classy broadband cafe here in Islamabad, was mentioned in this Yahoo News article which states how badly his business suffered:

http://news.yahoo.com/news?tmpl=story&u=/050630/481/isl10106301407

Though we're used to frequent local outages (due to power failures, faulty lines etc.) that cause at most a few hours of disruptance, it is the first time I've seen it on this scale and for this long. As I said earlier, it would take a failure like this before better redundancy is provided. Now, at least two backup links are being setup, another undersea link and one over land through India.

I hope this doesn't cause too much of a setback for the booming industries here. It looks like it might have been for the better in the long run because of the backup links coming up. Might also lower the costs enough for people like me to afford unlimited data transfers. Something I dearly miss these days.

Posted at 20:29pm PKT Comments(1) |

Saturday 2nd July 2005

The Hottest Days

While in other places, people were celebrating the Summer Solstice and complaining about temperatures of 30°C+, we in Pakistan were going through something much hotter. Islamabad used to be the coolest major city in Pakistan and was a nice summer retreat until about 15 years ago. Since then, summers have steadily gotten hotter and drier. It must be all the new construction, that's taking the place of trees, and increasing road traffic that's causing this.

According to Yahoo Weather, the current temperature is way down to 33°C and "feels like" 36°C. On the 23rd June, the actual temperature was at least 45°C and felt like 51°C+. No worries for a person like me who takes pleasure in braving the extremes, but it was hell for some of my friends.

I wanted to post about three kittens I recently rescued, but didn't have the time so I'll mention them here. These very young kittens were abandoned by someone at a rubbish dump over a month ago when the fourth one died. Sohaib, Nadir and I rescued them, had them washed and disinfected and after a few days, I took them home to my sister.

They were settling down pretty well, but during the heat wave, they stopped feeding properly and started losing weight. I was really saddened when my sister told me that one of the smaller two, the really cute grey one that we loved the most had died. The other small, loved one (with pink patches on its white coat) died the very next day and we couldn't do anything about it. The larger one, is doing well, though it seems to have a poor eyesight and isn't as affectionate as it's deceased siblings.

Good news is, the recent rains and thunderstorms have taken away a lot of the heat. Plus, I've managed to find a few swimming pools after a 2 year break from swimming. Shaukat Spa in F-6 is ok, but I prefer the one at Hot Shots in F-9. Might also join the nice gym they have there.

Posted at 17:19pm PKT Comments(2) |

Thursday 30th June 2005

Pakistan's Internet Link Cut

Pakistan's only fiber-optic link to the rest of the world was cut Monday night and we've been suffering for three whole days now. The whole country's traffic is going through a backup satellite link which is fully choked at the moment.

Though international communication is still possible, it is terribly slow. A test email I sent to my Gmail address took about 4 hours to deliver and even plain-text browsing is very slow.

According to this BBC article, it would have taken upto 24 hours just for the repair crew to reach the submarine cable from UAE (Pakistan doesn't have the required tech to repair it). The rumour is, it might not be fixed till the next weekend.

Even a few days of downtime is an eternity in Internet time and I shudder to think how much loss businesses and the country have suffered because of this and will continue to suffer. Considering that Pakistan is becoming more and more Net-savvy and is trying to attract major outsourcing projects, a single point of failure really is inexcusable.

Land links through neighbouring countries (Iran, Afghanistan, China and India) might not be possible to deploy due to political or geographical reasons (Pakistan is surrounded by deserts, huge mountain ranges and inhospitable terrain), but they could always have another undersea cable. Unfortunately, it usually takes a failure like this before something concrete is put in place.

Posted at 15:44pm PKT Comments |

Thursday 16th June 2005

VHS vs Digital

I was just reading this discussion on Slashdot about how VHS technology will not become obsolete anytime soon (and here I was thinking that it's already dead). I had one of those rare realizations about how far things have come in Pakistan (or at least in the major cities of Pakistan).

From the discussion, it seems that most American households still have VCRs and are reluctant to get rid of VHS. The opposite seems to be true here. I must have watched maybe just one or two movies on VHS since I got here and the last time I used a VCR myself was while in Japan. OTOH, I've watched countless DVDs and VCDs and not just on my own PC.

Pretty much everyone I know has at least one PC and that too at least good enough to play a video CD. Either that or they've replaced their VCR with a DVD player. You might argue that most of the people I know are tech-savvy, but that isn't exactly true these days. Besides myself, there isn't anyone in our family directly related to IT (I doubt anyone really understands my work), yet a wedding video we recently received from relatives in Karachi (relatives who aren't even remotely related to computers), was on a video CD.

I guess there are a few explanations for this difference. One is the availability of cheap (mostly pirated) media. You can pick up a movie on VCD for roughly Rs.60 (~USD 1) from almost any corner shop and a DVD for about twice that while VHS is mostly confined to select video shops and doesn't offer as much choice. Blank CDs can be bought in bulk really cheaply though DVD-R/DVD-RW hasn't come down in price enough to be more common.

The other is the openness to this type of change, or attention to details and inner workings in general, that Pakistanis posess. You can't succeed here without knowing exactly what is going on around you. Even for things as simple as getting a mobile connection or having your car repaired, you have to be a part of the process and know what's happening. Less common though still present is the "monkey see, monkey do" mentality. If your friend just got a new DVD player, you have to get one that's better.

If it wasn't for the affordability factor, I'm sure things would be even further ahead. Price is one major cause for DVD writers not being more common. I would get one for backups if they were less expensive, though haven't checked the prices for a while. Maybe it is time.

Posted at 01:28am PKT Comments(2) |

Saturday 11th June 2005

Vim's Built-in Encryption

I just discovered this great feature of Vi. Previously, I was managing sensitive information by using shell scripts which decrypted PGP encrypted files and piped the output to Vi. It then reencrypted the data and overwrote the originals if I had made any changes.

It seems that Vim has a built-in function to encrypt files. Though the encryption isn't nearly as strong as PGP, it's better than simply storing sensitive information in plain text files.

Simply starting vim with "vi -x <filename>" will mark the data for encryption and prompt for a new key. Encryption can also be set on an open file with ":X". Nifty.

Posted at 20:09pm PKT Comments(1) |

Monday 23rd May 2005

Seizure Robots and Website Design

You probably already know about these coma inducing contraptions. The Simpson's fell victim to them on their trip to Japan and other references can be found all over the net, but here's the link again (WARNING! potentially lethal):

http://www.seizurerobots.com/

Somewhat related, it might be interesting for web designers/developers to note how different cultural preferences can be. Tim pointed out a long time ago how most US/European corporate websites went for a neat, professional look while Japanese sites like to add lots of colorful animations and flashy lights, much like the above mentioned site. I remember one (big) client who insisted on having a hit counter, something you won't normally find on a professional website.

The situation is similar here in Pakistan. Though most local sites I've seen aren't as nauseus and irritating, they tend to use a heavy dose of Flash, images and Java applets despite bandwidth being as precious as it is. There is little interest in the use of CSS and it is considered too elaborate for anything but the biggest sites.

I've been working on a totally new layout for the iinix site and am trying to keep it as simple as possible, but it is tough. Quite a few people have recommended that I use flash or lots of javascript, but the furthest I will go is maybe add more images. No tables (unless it's tabular data), no Flash and no popups.

Posted at 18:16pm PKT Comments |

Sunday 22nd May 2005

Vi Cheat Sheet Bib

Via Stuart's post on a mailing list, a vi reference bib for the baby geek:

http://www.cafepress.com/geekcheat.11507926
"The reference chart is printed upside-down so the baby geek can easily read the commands (if they can read) while wearing the bib!"

It could be a hint (Stuart's birthday is coming up soon), though I hope it's not for Zen. He's almost 10 months old and if he still requires a cheatsheet, then his daddy has some explaining to do. ;)

Posted at 22:49pm PKT Comments |

Friday 20th May 2005

My Google

Google now has an option for a personalised page where you can view your favorite stocks, news sites, weather info and a lot more:

http://www.google.com/ig

I occasionally use My Yahoo for the latest stock quotes and it does have a lot more functionality, but Google's page is much simpler and customizable. If they add a few more things, such as RSS viewing and a bookmarks option, I'll definitely start using it a lot.

Posted at 20:17pm PKT Comments |

OpenID - A distributed and open single ID system

OpenID allows you to authenticate yourself to sites that support OpenID without having to remember or maintain dozens of separate logins. It's basically meant for blogging sites that require authentication for leaving comments (such as LiveJournal), but should be made to work on any site.

The main advantages over other methods, such as Microsoft's Passport, are that it is open, distributed and not under the control of a single entity.

Doesn't look like it will be easy to setup on your own site, but I'll give it a try. These days, I let Firefox store all my authentication data, but when using different systems or after system cleanups, I have to try to find out what username/password I had entered which is tedious and time-consuming. There really is a need for a simpler, more global mechanism and OpenID might be it.

Posted at 04:03am PKT Comments |

Tuesday 17th May 2005

Margalla Hiking

Around this time last year, I ventured to start daily jogging in a park near my office in I-8 since I had stopped almost all physical activities for quite a while. This was going pretty well when I realised I'll be spending more time in ETC. I was even happier since I heard a lot of people there regularly went for hiking in the evenings, though it turned out that that was before everyone got busy. By the time I was there, they had stopped going altogether.

After a long bout of procrastination, yesterday I brought along my hiking boots and shorts to the office and decided it was now or never. In the evening, I grabbed Majed and just went straight to Trail No. 3, the base of which is about 5-10 minutes drive from the office. Apparently, it's a pretty popular trail and there's even a legend about Buddha stopping here for meditation during his travels to this region.

Despite being in quite an unfit state, we decided to take the nearly verticle "fireline" path instead of the main winding one. Bad idea. Very soon both of us were out of breath and Majed was having trouble controlling his legs. Though he didn't reach the hut at the top, I made it and was rewarded with an astonishing view of Islamabad at sunset and a great feeling of accomplishment. The ride, or more like rush, back down was bumpy and more dangerous, but still fun. Quite a few times, I I had trouble keeping myself from slipping on the loose stones.

I hope this becomes a regular thing and am trying to entice more people to join. Will have to find a tougher path soon. See ya at the top.

Posted at 23:55pm PKT Comments |

Thursday 12th May 2005

More on SSH and potential exploits

The Linux Gazette has an article about The Potential for an SSH Worm. A brief and interesting read if you're managing servers remotely (and I sincerely hope you're using SSH to do that).

I've played a lot with SSH and though haven't experienced a single compromise through it, I still don't trust the default settings much. The first thing I do after setting up a server is disable direct root login through SSH (by setting "PermitRootLogin" to "no" in sshd_config). It creates an extra layer of security and makes accountability easier (may be worth mentioning that Bash 3 has a history timestamp feature which further eases this).

Next, I change the default port (tcp 22) that the SSH daemon runs on. Though some people might not agree with this, it would deter such things as worms and automated breakin attempts. Other things you can do to increase security include using the "AllowUsers" option to limit the accounts that can login and from which IPs/networks. Here is an example:

AllowUsers      sajjad eggs@172.16.123.123 eggs@172.17.*.* spam@172.17.134.31

This example allows user "sajjad" to connect from anywhere. User "eggs" can connect only from the IP 172.16.123.123 and the 172.17.0.0/24 subnet. User "spam" can only connect from the IP address 172.17.134.31. All other users will not be able to login, even with the correct password/key.

Another useful thing is to disable password logins altogether and stick to using SSH keys which makes brute-force password attacks useless. I used to do this by just creating a user, copying the key of the allowed user to "~/.ssh/authorized_keys2" and not setting its password. However, newer (and maybe very old) SSH versions treat an account as locked if the shadow password file contains the default '!' or '!!' for the password field. Replacing these with '*' should allow you to login through SSH without allowing any password authentication (local or remote).

Lastly, you can use iptables (or an external firewall) to restrict access to allowed IP addresses or networks. This would prevent attackers coming in from other IPs from accessing the running SSH daemon and exploiting a newly discovered vulnerability. Combine all these together and you have a virtually unbreakable server.

Note: The above have settings have been tested on OpenSSH (upto version 3.9p1) and may not be available on other versions.

Posted at 02:03am PKT Comments |

Friday 6th May 2005

Beam me some Metallica, Scotty

Here's something that might come in handy when you want to punish one of your minions by making him listen to your singing without driving the others to rebellion. Naeem sent me this story about a soundless sound system, developed by Elwood Norris, an inventor who has also developed a flying scooter.

It claims that the "hyper sonic" sound can be "pointed" to any person, something like a torch light, without anyone but the person hearing it in their head. Sounds far-fetched doesn't it? That's why I'll group it together with the perpetual motion machine invented by a Japanese musician and Dean Kamen's overhyped "it" until I try it out myself.

Skepticism aside, I would like to see if this sounds anything like the other voices in my head. Can already imagine the possibilities of such a device. Much better and focused LAN gaming, power honks that teach those road hogs a lesson without annoying other drivers, speaker or mobile phones that preserve privacy without the need for bluetooth or other handsfree devices.

Posted at 19:10pm PKT Comments |

Previous Month's Entries
Next Month's Entries