Drunk pilots??

Every year we hear news about drunk drivers running over pedestrians after parties. Hence, the new year celebrations is one such event during which the police have to be extra vigilant to see if the drinking and driving laws are prohibited.

But I read something in the newspapers today that really scared me. According to this news report in Times of India, pilots and cabin crew have been found drunk in pre-flight medical checks. Yes, you heard me right. Pilots.. the ones who fly planes with the responsibility and safety of hundred of so passengers in their hands. One pilot even managed to dodge the medical examiners and slip into the cockpit! How could any professional person be so careless??

Unfortunately, the airlines are not mentioned. They say they belong to three private Indian carriers,  one of them is a low cost one. But just think about it for a few seconds and you come to an answer. How many full service (that is, not low cost) private Indian carriers are there?  Jet-Sahara and Kingfisher-Deccan are the 2 major ones. I am not trying to convey the message that these 2 airline companies had (atleast on one instance) pilots reporting to duty drunk (and I think there is one or two more full service airline companies here), but this is what I think after reading this news article.

I am just glad I only go to Muscat during vacations, on Emirates airlines, and hence I don’t need to fly on these airlines.

Why use Twitter??

In the last few days, I have become addicted to Twitter! I knew about it for a long time, but I never bothered making an account and actively twittering.. I mean, its just a stupid application that lets you set a status message, right?
No, like most other social applications, Twitter may seem completely pointless unless you start using it properly. You can let all your friends know what you are up to from their website, IM, or other services that use their API.
I can chat from my phone, so I can easily twitter on the move. They also have a mobile website. And for users in UK and USA, you can also use SMS! (I know, they have an international number too, but you wouldn’t send an international SMS to update your status would you?)
You can connect to other friends by following their updates, meaning all their updates will appear on your page, and similarly your friends can follow you. If you are concerned about privacy, you can control who follows your tweets by making your updates private. And finally, you can use Twitter badges in social networks and your sites or blogs to display your status!
I know, it may still sound a bit silly (just a status message?!).. But its the fastest and easiest way to let everyone know what you are doing. Your twitter friends(who can also receive email and SMS notifications if they want to, by the way), your website visitors, and your friends in your social network.
If only they had a local SMS facility in India, it would help in making SMS communities and make communicating even more easier.

Site down.. and back again

If you are a regular reader of this blog, you may have noticed that the last 3 posts have mysteriously disappeared. Here is what happened.. My host x10hosting.com had problems with MySQL and I decided to shift elsewhere. Thank god for ZoneEdit and their instant DNS changes. Before I could take a complete backup of wordpress, the database server went off. So the blog’s state now is what is was a couple of months ago. I think the database server is back on x10hosting, but I am too lazy to import those 3 posts and 1 comment! So, listing out the updates again:
Jagtesh, Sid, and I have started a new technology blog TechBol.
As you can see, I got a new theme and some new plugins. I am giving Akimset a shot as I am sick of manually deleting all the spam comments.
Nothing else worth mentioning apart from this :-)

Configuring wvdial for Internet access in fedora, using a cell phone or a normal modem

This post is dedicated to those poor lost souls who made their way to this blog while they were searching google for “configure wvdial for internet in fedora 7″ and “configure airtel internet in linux”. Hence the big “search engine friendly” post title!

The Basics

First of all, the simple basics.. Most of Linux’s powerful tools exist in the command line, technically known as the “shell”. Fedora refers this as terminal for some complicated reasons, so I will use that term here. For those of you who don’t know, vi is the text editor to use in Linux. You can open any file in the terminal by typing vi followed by the filename.
So, in this case, you would type “vi /etc/wvdial.conf” in the terminal. Press “i” to start inserting text. Press ESC and then “:wq” to save and quit the text editor. If this doesn’t make any sense to you or if you are scared of the terminal, you can use the GUI based text editor that came with your Linux distribution. Try looking somewhere in the Accessories Menu. Also, you will be required to log in the “root” account to modify some of the configuration files. The “root” account is basically the Linux system administrator account. If you are not carefully, you can completely mess up your Linux installation when you are logged in this account, so its safer to use a normal user account for “normal” usage. Don’t worry, if you stick to what I have said here, nothing will go wrong.To login the root account, type “su” in the terminal. Enter your root password when prompted.

The Manual Pages

Secondly, it will help if you read the wvdial.conf and the wvdial documentation. This tutorial will make more sense. Type “man wvdial” and “man wvdial.conf” in the terminal. Infact, you can type “man” followed by any command or system configuration filename to get its complete description and usage.

For phone modems connected with data cable or normal internal modems
If you are using an inbuilt modem or even a mobile cable modem, you need to fine the modem’s device file path. Use the command “wvdialconf /etc/wvdial.conf” in the terminal and carefully observe the output. You will get the modem’s device file path. It should be something like “/dev/tty0″ or “/dev/ttyACM0″ or “/dev/ttyUSB0″. If you are using a data cable and a phone, chances are it will be one of the latter two. The thing is that each device(or everything rather) in Linux is treated as a file. For wvdial to use your modem, it needs the device’s file path.

For phone modems connected with Bluetooth

If you are using a phone connected with Bluetooth, the procedure is slightly longer. First of all, you need to get the Bluetooth MAC address for your phone. MAC stands for media access protocol and has nothing to do with either Apple Computers or MacDonalds burgers. Basically, every hardware device connected in a network is assigned a unique MAC address. Your LAN card also has one. Your Bluetooth dongle/inbuilt Bluetooth adapter has one. Your Bluetooth has one, and so does your phone. This address basically “recognizes” your device hardware on the network. To find this MAC address of your phone, type the following command in the terminal.
hcitool scan
You will get a list of all Bluetooth devices in range. Needless to say, your phone’s Bluetooth must be switched on and must be in discoverable mode. Your computer’s Bluetooth dongle, if external, must be plugged in; or switched on, if internal.
Now, type in the following command to bind your phone with the “rfcomm” file. Just type the following command to do so, replacing the <Address> with your phone’s Bluetooth MAC address…. without the brackets, the entire thing, with the “:” symbols in between.
rfcomm bind 0 <Address> 1
This basically binds your phone’s Bluetooth with /dev/rfcomm0 file. If you have done something like this before, there is a good chance that the above command may not work… or it may not work for other reasons too. It will give an error message if it doesn’t work. If it is already binded to another Bluetooth address, you can try another rfcomm file: rfcomm bind 7 <Address> 1 . Else, you need to create the rfcomm file by typing mknod /dev/rfcomm0 c 216 0. This doesn’t apply to you if your first bind rfcomm command worked!

Editing the wvdial.conf file

Like I said earlier, it will help if you have read the wvdial.conf documentation using “man wvdial.conf”. It will make the following process much more understandable and easier. If you are a bit clever, you might have guessed what to do already after reading this file.
For phone with data cable connection, or internal modem
Luckily, there is an inbuilt tool which will scan your computer and set up your wvdial.conf file. Bluetooth needs more configuration, but it will work fine with an internal or data cable connection. Type the following:
wvdialconf /etc/wvdial.conf
This will scan all the modem device files with all the port speeds. You will get something like this:

ttyS0<*1>: ATQ0 V1 E1 — failed with 2400 baud, next try: 9600 baud
ttyS0<*1>: ATQ0 V1 E1 — failed with 9600 baud, next try: 115200 baud
ttyS0<*1>: ATQ0 V1 E1 — and failed too at 115200, giving up.
ttyS1<*1>: ATQ0 V1 E1 — failed with 2400 baud, next try: 9600 baud
ttyS1<*1>: ATQ0 V1 E1 — failed with 9600 baud, next try: 115200 baud
ttyS1<*1>: ATQ0 V1 E1 — and failed too at 115200, giving up.
ttyS2<*1>: ATQ0 V1 E1 — failed with 2400 baud, next try: 9600 baud
ttyS2<*1>: ATQ0 V1 E1 — failed with 9600 baud, next try: 115200 baud
ttyS2<*1>: ATQ0 V1 E1 — and failed too at 115200, giving up.
ttyS3<*1>: ATQ0 V1 E1 — failed with 2400 baud, next try: 9600 baud
ttyS3<*1>: ATQ0 V1 E1 — failed with 9600 baud, next try: 115200 baud
ttyS3<*1>: ATQ0 V1 E1 — and failed too at 115200, giving up.
WvModem<*1>: Cannot get information for serial port.
ttyACM0<*1>: ATQ0 V1 E1 — OK
ttyACM0<*1>: ATQ0 V1 E1 Z — OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 — OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 — OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 — OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 — OK
ttyACM0<*1>: Modem Identifier: ATI — Nokia
ttyACM0<*1>: Speed 4800: AT — OK
ttyACM0<*1>: Speed 9600: AT — OK
ttyACM0<*1>: Speed 19200: AT — OK
ttyACM0<*1>: Speed 38400: AT — OK
ttyACM0<*1>: Speed 57600: AT — OK
ttyACM0<*1>: Speed 115200: AT — OK
ttyACM0<*1>: Speed 230400: AT — OK
ttyACM0<*1>: Speed 460800: AT — OK
ttyACM0<*1>: Max speed is 460800; that should be safe.
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 — OK
Found an USB modem on /dev/ttyACM0.
Modem configuration written to /etc/wvdial.conf.
ttyACM0<Info>: Speed 460800; init “ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0″

As you can read, it has found the modem in the “/dev/ttyACM0″ file, working at 460800. If your phone doesn’t support 3G or Edge, you might get a lower speed.
Edit the “/etc/wvdial.conf” to make some changes like editing your username, password and phone number to dial. For Airtel mobile office or other GPRS/Edge users, the phone number is *99# or *99***1#. Airtel mobile office users, the username and password is empty, syou can enter ” ” in both fields. Your file may look something like this:

[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = USB Modem
ISDN = 0
New PPPD = yes
Phone = *99#
Modem = /dev/ttyACM0
Username = munim
Password = mydumbpassword
Baud = 460800

Now, all you have to do is to type “wvdial” in the terminal to get connected. If you are using Fedora, you will have to edit the resolv.conf file to edit the DNS server addresses to use the Internet, which I will explain after the Bluetooth explanation. But if you are on Ubuntu, you can open your browser and surf the Internet. Leave the terminal window open and press Ctrl+c in this window to disconnect after surfing.

For Bluetooth connections
You have your rfcomm device file ready. You might have to do the binding command each time you restart your Linux OS, depending on distribution. Open your “/etc/wvdial.conf” file using vi or any text editor. Delete everything there, if there is anything. Type the following, replacing the proper username and password and phone number, and the rfcomm file path if its different.

[Modem0]
Modem = /dev/rfcomm0
Baud = 230400
SetVolume = 0
DialCommand = ATDT
FlowControl = Hardware(CRTSCTS)

[Dialer GPRS]
Username = munim
Password = mydumbpassword
Phone = *99***1#
Mode = 1
Inherits = Modem0

[Dialer Defaults]
Modem = /dev/rfcomm0
Baud = 230400
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ISDN = 0
Modem Type = Analog Modem
Phone = *99***1#
Username = munim
Password = mydumbpassword

If you are a Linux guru, you might realize that one of the above section is not exactly needed. But according to what I have read in some forum, this works perfectly for most distributions. I don’t know.. I might be wrong. If you are not a guru, type the whole thing down. It won’t hurt a lot.

Now, to connect, type “wvdial GPRS” in the terminal. If you are using Fedora, you will have to edit the resolv.conf file to edit the DNS server addresses to use the Internet, which I will explain soon. But if you are on Ubuntu or something else, you can open your browser and surf the Internet. Leave the terminal window open and press Ctrl+c in this window to disconnect after surfing.

Editing the resolv.conf file

This only applies to users of Fedora, or probably any other distribution who can surf after connecting successfully. After type wvdial and connecting, note down the DNS nameservers’ IP addresses in the output. For Airtel mobile office users, it will be 202.56.250.5 and 202.56.250.6. It might have changed, but this is what it was at the time of writing this post. Don’t take chances, note down the DNS nameservers IP address. Now, open the “/etc/resolv.conf” file using vi in another terminal window or any other text editor. Create it if it doesn’t exist. Type the following, replacing with the DNS nameservers IP addresses you noted.

nameserver 202.56.250.5
nameserver 202.56.250.6

Save the file and exit. You must be able to use the Internet now.

Please note:
Don’t close the terminal window after starting “wvdial”! Leave it open when you are surfing. You can shift it to another workspace if you want to. After you finish using the Internet, press Ctrl+c to disconnect and then you can close the terminal window after you return to the prompt.

I hope you liked my first “HOW-TO” and it helped you access the Internet on your Linux OS. If you have any questions, you can email me at munim2020 at gmail or leave a comment here.

Fedora 7.. a nice suprise

I just installed Fedora 7 in my computer. My HDD’s partitions didn’t allow this originally(because I had no free space and no partition which I could afford to delete) but partition magic came to the rescue.
Anyway, I decided to install Fedora rather than my favorite Ubuntu, because Fedora came with the DVD and more bundled applications while Ubuntu comes with a CD and I have to download most of the applications I need. Which wouldn’t be a problem if I had a decent internet connection. Which I don’t. A new version of Ubuntu is coming out in 5 days but I decided to go for Fedora 7.
As usual with all Linux-based Os’s, I had to disable my AGP graphics card. (If you don’t know why this happens and if you reply back saying that there is a solution to this problem, you are not a regular reader of my blog!)
There were a couple of things which really surprised me. First of all, bluetooth support. My dongle comes with Bluesoleil software (probably pirated) and I can’t get it to work in vista. But in Fedora, the dongle just worked when I plugged it in. I didn’t need to install anything! The second thing is desktop effects. Like I said, I use my onboard graphics card in Linux OS’s. I had tried using “Desktop effects” in Gnome in Ubuntu Feisty Fawn, but it said my adapter is not compatible. In Fedora, it just works! How is this possible?? My onboard card.. an intel 865 integrated chip! And all these smooth effects! Anyway, this is probably a new version of Gnome which supports older cards for desktop effects.
I had tried using internet in Fedora before and I had failed. After a quick internet search, I found out that you need to set up the DNS servers in resolv.conf unlike Ubuntu where the basic wvdial configuration is enough. Using my phone as a modem through bluetooth was simple enough after going through a couple of How-To’s on the internet. The only frustrating part was I had to restart and use Windows XP to access internet, and go back to Fedora to try out what I just read. But it worked after a couple of restarts.
There are one or two issues though. The first package list download for “Add-remove programs” took a very long time.. too long for someone with a slow internet connection. Or maybe something went wrong with the internet connectivity, which is not uncommon in Airtel Mobile Office Edge connections. The blogging tool I downloaded (BloGTK) doesn’t support Wordpress, the most popular blogging platform!
Anyway, I am thinking of making a  better front-end (maybe GUI) for bluetooth using all those commands. Using the shell commands was not that hard, but a casual user would not have the patience of going through the procedure.
That’s it for now!

Sanitizing database inputs!

xkcd is my favorite geek comic strip. Check this one out:
EDIT: Sorry.. The comic strip doesn’t fit in this space very well.. You have to go the website to view it. Link

Hahahaha! ROFL!(literally!) This guy is amazing!

Does Google love blogs a bit too much??

I was correct. The thing I was talking about in the last post (about Google loving blogs) struck me again. Apparently, Google crawled this site after I published that post. And according to Google analytics, some poor soul looking for “Wordpress theme” on Google search came to my site. Wordpress theme! That’s not even a rare keyword. There must be plenty of sites having lists of wordpress themes. And yet, Google loves blogs so much, that they decided to show up this newly created, not so popular blog(i.e. on this location..) which has little to do with wordpress themes. Only because my latest, “freshly-published” post has something mentioned about wordpress themes.
I am not exactly hating this.. but does Google give too much importance to freshly updated blogs in their search results? I would not be too happy to come across some random dude’s blog like this one when I looking for “Wordpress themes”.

Actually, I have been doing some other thinking about search engines lately (totally unrelated to its love of blogs). One friend of mine has published a paper about Semantic Query Optimization in ACM (which will appear in their mags in a couple of months). We also talked about how beneficial it is to optimize a search result by looking into the search history of the user. Of course, this leads to privacy issues about search engines storing your results. In fact, I heard that Google desktop does something like this. Not too sure though.
If you didn’t get what I am talking about, consider the following situation. Suppose you go to a search engine and search for “Apple”, you get results of some sites selling the fruit. If you had searched for “Steve Jobs” before this query, the search engine can take this into consideration and show the results of the computer company before the results about the fruit. This is using search history effectively to optimize results. Of course, you may want to get information about the computer company after you were looking for websites about the fruit. This is where the “age” of the history comes into picture. If you were looking for Steve Jobs just before looking for Apple, chances are you are looking for the computer company rather than the fruit. If it was an hour ago, it may not necessarily mean that you are looking for the computer company. But there still is a small chance that you are, and this can be a tiny factor in the results. But this doesn’t mean that “long-term” history can be simply ignored. If I regularly search for Mac software or information about the company or the life of Steve Jobs, the search engine can “learn” from this history and give the computer company a slight edge over the fruit in the search results when compared to someone who searches about fruit salads or healthy eating!

Design complete!

I have spent the last 4 days looking for the perfect theme for my just-shifted-to-wordpress blog. It’s hard to search for blog themes on Google because it will even show up newly created blogs with no good collection of themes to speak of, since Google loves blogs. Finally, Andreas Viklund’s theme came to the rescue. I must admit this theme is perhaps the best one I have ever seen. I installed one plug-in for now: Sociable for bookmarking. For tracking visitors, I decided to use Google Analytics. It may seem like using a nuclear station to power a light bulb, but I wanted to try it out!
And now, I can finally start blogging in peace. Next post, coming really soon.

Domain registeration takes 3 days…

I hate banks.. I don’t know what it is about them. But I don’t know anything about getting basic stuff done in a bank.

Even though you have a large number of domain name registrars who will register a domain name for you on the Internet, it is useless if you don’t have a credit card. I decided to get a domain name for this blog and my web site. By the way, I am keeping the name secret for now. It was a stroke of genius and I don’t want anyone else to take it before it is registered. I have to fill out a form and then send a DD or a check via snail mail. Only after they get the DD/check will they register a domain name for me. This takes at least 2 days. In today’s Internet age! In the last 4 years, I have used snail mail about 5-6 times, and all the times it had something to do with money transfer.
And don’t get started about bank deposit. Those guys at HDFC refuse to accept cash, they want a check. If I had a check, I would send it to the payee directly! They won’t even issue DD’s to anyone else other than their account holders.
After that, I went to State Bank of Mysore and I asked the teller if they accept cash for DD applications. She said Yes and handed me a form to fill out. After filling out all the details and handing it over to her, she says its already past the closing time so she can’t do anything with it now. I go so pissed off that I felt like throwing the form at her face, but I kept my cool.
After that, I went to the good old Union Bank extension counter at our college campus. These guys have really improved service recently and now give ATM cards to new account holders in 2 days. It used to take them 2 months a couple of years ago. After handing yet another form to the teller, she politely told me that the processing fee is Rs 61! After that, I had to wait for 20 minutes to get the DD. And then, I had to find a courier office to send it to the registrar. Since it was already late in the afternoon, DD will reach the registrar’s office tomorrow evening. And the domain will get registered day after tomorrow!

But anyway, one must always look at what we can learn from experiences like these. What I have learned:

  • Credit cards are damn useful. Even if they charge freakishly high interest rates if you pay the bills late and can make you bankrupt if you are not disciplined with spending, they are only way to pay for something on the internet. No paypal for Indian users. Hmm, online banking? I have to check it out.
  • HDFC is a good bank for its (rich) customers. But absolutely useless for everyone else. I don’t know but probably the same applies to other big private banks like ICICI.
  • State Banks close at 2:30 sharp. And I mean SHARP as a razor blade.
  • The next time I go to my bank (which is about 11 km away from where I stay), I will get a check book. It’s not the best.. But its makes life a little bit easier.

As for the domain name, I will probably shift this blog to a host with Wordpress. Haven’t decided yet.. Wait and see.

Website re-launched!

I launched my website (yes.. again!). A couple of days ago, when I was reading through the stats of my blog(yes I am jobless), I noticed that I got a few referrals from my old website. I had completely forgotten about this website. I thought I might give it a facelift and some fresh content, when I realized that the FTP and the file manager for that host doesn’t work properly. Fortunately, I found this amazing host which gives 250mb disk space and 100gb bandwidth. The best part is that they guarantee that the servers will be up at least till 2012. So it won’t like those occasions where you lost your web space because your host just disappeared into thin air! Apart from all this, they give domain hosting, php, mysql, ruby scripting support, mysql database support, and no ads! Sounds to good to be true? Check it out for yourself! The link