Monday, April 17, 2006

Indian Railways Web Site

Today I visited the Indian Railways web site to look up berth availability on a train from Bhubaneswar to Hyderabad. The web site itself is pretty stupid but it works, at least most of the time. Anyway, I found the information I was looking for and then spent some time lookin at emails. I had left the railways page open in a FireFox tab. I came back to it with the intention of closing the tab and somehow pressed the Ctrl key. Guess what happened? I got a message box saying "Sorry, you do not have permission to press this key."

Sorry, you do not have permission to press this key
(click to see full size image)

Who designs these things? The Indian railways has done a good job in getting the ticket reservation, seat availability, ticket tracking and other functionality online. They also have e-tickets that you can print out and carry (with photo ID) instead of the normal paper ticket. But their web sites suck. There are too many advertisements. The layout and navigation sucks. And the error messages are funny to say the least. At least after you get over the initial shock!

In this case I suppose somebody is trying to be clever and prevent users from viewing the HTML code or something like that.

(Update - 8.53 pm)

I am not able to get the message box again! Tried a number of times but it hasn't happened again. Luckily I took a screen shot the first time!

Monday, April 10, 2006

Mamli & Iraq

Oh my God! There is a place in Iraq called Mamli! For those of you who don't know this, Mamli is my daughter's pet name!

I was going through the web server logs today and came accross a referlink from Google with Mamli as the search term. Needless to say I was a bit surprised because to us Mamli is just a cute sound byte and does not really mean anything. It was gratifying to note that my web site was the first link with Mamli as the search item. Anyway, a little bit of scrolling later I realized that Mamli is actually the name of a place in Iraq!



I must research this more!



Another link! - Mamli
google map

Tuesday, April 04, 2006

Thingamablog & Dynamic Lists etc

One gripe I have always had with blogging tools like TAMB is the fact that the templates are essentially static. So when I edit one of my lists, say the favorites links list, then the entire blog has to be republished. This is particularly true of TAMB.

Yesterday I finally decided to try and make this a more dynamic process.

I used a separate JavaScript file to store my links and used document.write() to dynamically populate the page HTML at run time in the browser. Now if I wish to add a new link to my list I just have to edit the JavaScript file and upload it to the website. Voila! Dynamic lists! Or as close as it gets

My Javascript file looks like this:

//
// Dump my Favorite Links into the sidebar.
//
function whatHo_FavLinks( ) {
document.write('<div class="sidetitle">Favorite Links</div>' ) ;
document.write('<div class="side"> ' ) ;
document.write('<a href="http://www.satpathy.in/">Satpathy Home Page</a><br>' ) ;
document.write('<a href="http://sermonsonstone.blogspot.com/">Oracle Book Club Blog</a><br>' ) ;
document.write('<a href="http://pupu1972.blogspot.com/">Sandip Blog</a><br>' ) ;
document.write('<a href="http://tanushreep.blogspot.com/">rideo, ergo sum</a><br>' ) ;
document.write('<a href="http://rakeshkumar.wordpress.com/">Rakeshs Place</a><br>' ) ;
document.write('</div>' ) ;
}

Now I am not a JavaScript expert. Just know enough to hack something together. Anyway the whole thing works.

Opps. I forgot the TAMB template part. In the templates files I have to call my JavaScript function whatHo_FavLinks() in the place I want the favorite links to go. To do this I created a Custom Tag in TAMB and inserted that into my templates.

An Inexpensive Home Surveillance System

I have been remotely monitoring my home for about a year now. I started with a small setup covering a single room and now have a complete system that covers all the main spaces in my home. Both my wife and I have access to the images when we are at work and this gives us a great sence of security. Also, all images from the system are archived on the home computer's hard disk for later viewing. Knowing what is happening at home with your kids and the maid while you are away at work is worth the money and effort invested in putting up a surveillance system. This post describes how I setup my system. It is fairly straight forward. But I did have my share of teething trouble :-)

My setup is fairly inexpensive and does not require high end surveillance gear. You can have a system up and running for a few thousand rupees.

Home Surveillance from Work
Images from my Home Surveillance System



Components:
  • Webcams: I have three cams running
  • USB Cables: I use a mix of passive and active extension cables. More about this latter.
  • A PC with a broadband Internet Connection: I use Iqara's "Unlimited" plan. It is useful is you have a static IP.
  • Software on the Home PC: You need a Web Server & Web Cam software. I use Apache
    Tomcat
    for the server and VisionGS.

How much does it cost?
  • Webcams: About Rs. 1000/- per cam.
  • USB Cables: Passive cables (5 meters) come for about Rs. 150/-. Active cables cost about Rs. 1300/- each.
  • Webcam Software: About $ 30/-. Credit card payments in Indian Rupees will typically attract a 3% fee.
  • Internet Connection: Rs. 880/- per month for Iqara's Unlimited plan.
Setup:

The first thing to do is setup your webcam(s). Most cams come with a driver CD. The drivers for the cheaper cams are not so good and are liable to crash at times. So the better cams like the ones from Frontech (Rs 1000/-), Logitech (Rs. 2000/- and more), though more expensive, are a better deal. The high end cams will need active USB extension cables because their power requirements are higher and a passive cable just doesn't work. Okay, back to the process; connect your cam(s), install the drivers and test the cam. You should be able to view full motion video from the cam. Now disconnect the cam and connect it back via the extension cable. Check that everything is working fine.

The next thing to do is to install the VisionGS software. VisionGS is the capture & upload part of the system. This is the piece that connects to your cam, captures an image periodically and uploads it ti whereever you specify (locall hard disk or FTP server). Installation is fairly straightforward. The application is easy to use and you can default most of the settings. After installing VisionGS, create a WebCam in it and set it to use your newly installed cam. Leave all settings alone for the time being. Just make sure you can see the full motion video from the cam.

Now comes the tricky part. If you have a static IP address then you can choose to run a web server on your home PC. Otherwise you will have to upload your cam images to a remote web server via FTP. If you have your own web site this is fairly easy to do. However if you don't then you will have to hunt around for a service that allows FTP upload.

Let us assume that you have a static IP. In this case download and install Tomcat. You can also use Apache Web Server, IIS or any other system you like. I use Tomcat because I like it; it is easy to use; it is free; it is stable; and I use Tomcat for other programming tasks too. Once you have your web server running, create a context to host your cam images.

Go back to VisionGS and open the settings dialog for your Cam. This has a long list of settings but the ones we are interested in are:
  • Capture/Upload: Here you specify the duration between captures
  • Archive: You need this only if you decide to archive images on your hard disk or a FTP server.
  • Location: Here you specify where you want VisionGS to put the captured images. Locally on your hard disk (web server's folder) or via FTP to a remote web server.
  • FTP Server & FTP Account: You need these only if you are sending images to a FTP server.
VisionGS Settings Dialog
The VisionGS Device Settings Dialog

VisionGS has a whole host of other neat features that you can use but for the sake of this article we will restrict ourselves to only the basic ones as described above.

Now that you have your webcam, the capture software and the web server installed, you are ready to test the system.

Fire up your browser and point it at your web server. If everything is working fine then you should see the image from your cam. Note that you will have to keep refreshing the page manually to see the updates.

In order to have the images refresh automatically we need to do a little more work. The first screen shot above shows a small Java viewer program that I wrote for my own use. However you can also achieve the same result using plain vanilla HTML & JavaScript. I use two HTML files to view the cam images: A "Launcher" page and a "Viewer" page. This is what the HTMl
Viewer looks like:

HTML Cam Viewer

HTML Cam Viewer

I have uploaded a couple of sample files that you can use to get started. They are available here. You will need to unzip the file to get at the launcher and viewer code. The HTML code is fairly straightforward and you can edit the required parts to point at your cam image. Note the meta tag to refresh the cam viewer. It looks like this:

<META HTTP-EQUIV="REFRESH" CONTENT="20"
Note that this code will refresh the page every 20 seconds.

These HTML files do not need to be on your web server. You can run them off your local hard disk at work. Putting them on the server does mean that you can access them from any Internet enabled PC.

Thats all there is to it!

I hope this post will help you setup an inexpensive home surveillance system of your own.

(Posted via Thinga Web)



Monday, April 03, 2006

Consumer Online Resources & Empowerment Center

The Consumer Online Resources & Empowerment Center or CORE Center is the one of the best thing that has happened to Indians of late. This web site is maintained by the Ministry of Consumer Affairs, a Govt. of India dept. They are really really good. I had heard reports of their effectiveness before and I recently experienced it first hand.

Those of you who have read earlier posts on this blog must have seen my rants against ICICIDirect.com, ICICI's web based stock trading setup. These guys are pathetic; with a capital P. Anyway, I finally reached breaking point and filed a complaint with CORE. Received an email acknowledgement in minutes from the website. Then 3 days later (March 30, 2006) I received another email from them. They had sent a letter to ICICIDirect with a copy to me. A very stern letter. Polite but stern. They gave ICICIDirect a fortnight to make amends.

And boy, did it work? I received a letter from ICICIDirect on April 1 asking me for some additional information that they need to complete the process I had requested via a letter dated January 13 2006 :-) It was apparent from the contents and tone of their letter that after they heard from CORE they had dug out my Jan 13th letter from wherever they had consigned it.

Needless to say, I have sent the missing data and am waiting to see what happens next.

SAY NO TO BAD SERVICE! If you have paid for it then you deserve the very best. If your service or product is faulty and the provider is trying to pull a fast one then go to CORE. These people are good!

I will post about developments on the ICICIDirect complaint as events unfold.

(Posted via Thinga Web)