Sajjad's Blog

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(4) |

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(158) |

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):

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:
"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:

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@ eggs@172.17.*.* spam@

This example allows user "sajjad" to connect from anywhere. User "eggs" can connect only from the IP and the subnet. User "spam" can only connect from the IP address 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 |

Tuesday 19th April 2005

The bright side of Pakistan

Someone sent me a link to this news blog with comments along the lines of "no strikes, agitation, long marches or bad news. Just good news". It really is nice to see something positive about this country:

Something I've noticed since coming here is that things have improved a lot and are constantly improving in most places. Though it might not be best to let your guard down, the security situation is much better and there haven't been any big incidents in a while.

At least in and around the big cities, there's lots of development going on. There is cut-throat competition between mobile carriers which has made communications very easy. Technology is fast becoming affordable for the masses and the quality of IT professionals seems to be improving. There's even talk of an "Internet City" though it must still be in initial stages.

Just hope the traffic situation improves soon.

Posted at 14:56pm PKT Comments(1) |

Saturday 16th April 2005

English words derived from Persian

Wikipedia is a siren that lures you deep into a maze of interesting articles and causes all productivity to drop to zero. It should be blocked by all self-respecting enterprises that want to get anything done. I happened to open it today after Stuart posted a link and ended up wandering to my favorite subject, Languages, and spending hours just reading all this stuff.

Now to bore you with my great interest in languages. I also love to study history and a recent historical movie prompted me to learn more about Persia and Persian. Here is one Wikipedia article about English words that were influenced or derived from Persian, some via Urdu:

Urdu borrows heavily from Persian so there is a lot of relation between these three languages. Here are some examples that I never even thought about until now, though the origin of some is questionable:

  • Aubergine - "bengan" in Urdu
  • Checkmate - from Persian "shh mt". In Urdu "shamat" means "trouble"
  • Chess - an abbreviation of "shh-mt"?
  • Julep - from "gulab" for rose in both Urdu and Farsi
  • Lemon - "limoon" in Urdu
  • Orange - from Persian "narang", "narangi" in Urdu
  • Scimitar - from Persian/Urdu "shimshir", though more commonly called "talwar" in Urdu
  • Spinach - from Persian "isfanaj", "ispanak" or "aspanakh". "Palak" in Urdu
  • Sugar - "shakar" in Urdu
  • Typhoon - "tufan" in Urdu/Persian, though ancestry may be far-eastern

I used to think that it was the other way around. That Urdu borrowed a lot from English, but didn't think Persian was involved. I also started compiling a list of words that have the same sounds in Urdu and English, but different meanings. Should put up a language page someday.

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

Tuesday 5th April 2005

The Suicidal Mobile

These days, I carry two phones with me. The multi-function Samsung x600, that I bought almost a year ago, and a very cheap, but long lasting Motorola that I usually only use to receive/make calls. One is so I can continue to use my reliable and high quality (though costly) Ufone number and the other is to take advantage of the low call rates of PakTel. The Ufone connection is a pre-paid one so there is no monthly fee for it, nor any extras like free minutes or free SMSs. With PakTel however, I have a monthly package that includes lots of free minutes and about 150 free SMSs. It's quality however, is atrocious and I can hardly talk to anyone from inside my house and certain other areas.

But this post isn't about my mobile service. It's about this morning's incident. The last few days of unrest and sleepless nights at the office finally caught up with me and I had a severe headache this morning. It was past noon that I started to feel a bit better and could start getting ready to go out.

I've developed a habit of taking my phone into the bathroom, just in case somebody important, like the President, calls. I usually put the phone high up on a shelf in the corner and that's what I did this morning with the Samsung. Half-way through my shower, Majed called from the office and the phone started it's usual vibration dance. But then it did something I didn't expect. It dived off the shelf, skipped off the bathroom sink, disengaged it's battery and crashed onto the steaming wet floor.

But the mobile's battery had other plans. My bathroom isn't that big, but the shelf is in one corner, while the urm ... toilet seat is in the exact opposite one. That was what the battery decided would be a good landing spot. Unfortunately, it didn't take into account the murky abyss at the bottom and promptly disappeared down the drain.

At first, I stood scratching my head, wondering what had actually happened. Then quickly picked up the phone and wiped it off as best as I could. The thought of reaching into the abyss to retrieve the battery did cross my mind, but it was immediately dropped and I got a brand new one this evening. It needed replacing anyway. I put the phone on the unsheltered car's dashboard and let the sun bake it for a while.

To my relief, the phone turned on using the new battery and seems to be ok, though I'm charging it in off mode to dry out any remaining moisture. It might be time to sell it and get a new, flashy one, but I'll still have to get the camera fixed before that.

Posted at 23:35pm PKT Comments |

Previous Month's Entries
Next Month's Entries