Thursday, May 28, 2009

Dealwaiter

Dealwaiter is the web equivalent of what a waiter does at a restaurant. It waits for orders from you and fetches once it is available. But unlike the tired, human waiter at the restaurant who can get frustrated, demoralized or even offended, Dealwaiter allows you search for your items as long as you want and as hard as you must.

dealwaiter Dealwaiter allows you to enter the search items that you are on the lookout for. As the name says, the site will notify you if it finds any deal that is worth mentioning. Currently, it searches Amazon, ZeroDayDeals, Slickdeals and Fatwallet every ten minutes or so.

Moreover, Dealwaiter notifies you not only through email, but also through Twitter, the micro-blogging revolution service. It allows your searches to be as long as 1 year.

Are you waiting for something to purchase ? Head over to Dealwaiter, have a try.

Labels:

Wednesday, May 27, 2009

Mouse Genome Project Laid to Rest

Scientists have successfully completed and laid down the gene mapping project of the common mouse which was underway for the past ten years. The mouse is the most common of all laboratory animals used by humans in developing aids and cures for diseases. Now, with the gene sequence accurately mapped, chances of developing novel and effective medications are high given that the mouse shares 75% of our genetic code. Mouse

The genetic sequence consists of the full description of the genetic material contained in the nucleus of a cell. A sort of instruction booklet on how to recreate the basic cell of the animal from DNA sequences. The mouse, Mus musculus, is the second mammal to have been mapped completely after homo sapiens.

The mouse is most commonly used for understanding the evolution of human illness. Researches over the past decades on the animal has lead to vast advances in treatment of cancer, rabies and diabetes. Scientists have been able to identify more than 20,000 protein sequences for the mouse, of which about 5,000 evolved after the common ancestors of humans and mice went separate ways.

The details of the work have been published by an International team of scientists in the open access journal, PLoS Biology

Wednesday, May 20, 2009

The Arrogance of Power

Does power corrupt ?

Yes, in big way.

Vellupillai Prabhakaran, fought for a cause in the Sri Lankan soil. He was very much unlike Bin Laden or Dawood Ibrahim who wanted to terrorize the world and make the most out of it. In fact, India sympathized the cause of Prabhakaran and his militant organization, the LTTE, until Rajiv Gandhi was assassinated at Sriperumbudur on 21st May, 1991. The assassination of the young, charismatic leader opened up the paths to defeat and subsequent death of Prabhakaran yesterday.

The British, at the height of their power, in India and Sri Lanka used to get Tamilans from India to Sri Lanka to work in the plantations. When the British colonial rule ended in Sri Lanka, two different ethnic groups had formed, the Sinhalese and the Tamils. The Sinhalese being the dominant group is said to have constantly tested the pride of the Sri Lankan Tamils.

Prabhakaran rose to power in the 1970s when "Revolution only comes through the barrel of a gun" was the motto all over. He fought for the tamils, established the militant organization LTTE(Liberation Tigers of Tamil Elam) and demanded for a seperate tamil home land(elam) within Sri Lanka. Though what he stood for were just causes, the path he adopted for its fulfillment were lamentable.

The LTTE assassinated those who stood in its way, even moderate tamil groups. This forced a way of extremism for all elam related activities of Tamil. In other words, diplomacy was never an option for either the LTTE or Prabhakaran. The call for a seperate "tamil elam" was so strong in Sri Lanka that it even spread waves of protest and anguish against the Sinhalese in India. Politicians such as Vaiko even made a future out of it. Prabhakaran was a hero in the minds of the tamils. He was the one factor that glowed like stars in the darkest of situations. He was the factor that untied the tamils world wide. Sympathy turned into empathy and funds began flowing. The gears of the most organised militant group ever formed began to turn.

LTTE is infamous for many of their tactics. They had a system of parallel government with Prabhakaran being the "President and the Prime Minister" for the "Tamil Elam". Their military forces had divisions into army, navy and airforce, just like any modern nation. But what seperated the LTTE from ULFA or the Khalistan Movement was the Black Tigers. A sect of specially trained soldiers who are ready to embrace death as a weapon for assassination of high profile figures. The LTTE introduced to the world the concepts of modern human bomb. Given that they were able to assassinate Rajiv Gandhi, the Prime Minister of India and Ranasinghe Premadasa, the President of Sri Lanka, one can easily estimate the sheer effectiveness and lethality of a Black Tiger attack.

What turned the tamils against Prabhakaran ? By the India-Sri Lanka Accord of 1987 which sought an end to the Civil war in Sri Lanka, India send a peace keeping mission, the IPKF(Indian Peace Keeping Force) to Sri Lanka. By the accord, the Sri Lankan armay were to withdraw into their barracks and the tamil extremists to disarm, after which an interim administrative council would be set up and later tamils given equal status in the country. But the irony is that the mission became violent as soon as it was deployed. The LTTE refused to disarm and began a series of fightings with the Indian Soldiers. When Premadasa was elected as the President of Sri Lanka, he asked the IPKF to withdraw. Although Rajiv Gandhi did not relent, the end of his office signalled the end of IPKF. The new Prime Minister elect V. P. Singh considered the mission a big failure and withdrew all the forces from the island nation.

LTTE retaliated with the assassination of Rajiv Gandhi. This sole act of terrorism turned the Indian mindset. Prabhakaran and the LTTE became another of the extremist groups fighting without a cause. Moreover the monopolized leadership and heavy funds had begun to change Prabhakaran. The power and money corrupted him. He relentlessly attacked The Sri Lankan government, breaking pacts and promises.

When Mahinda Rajapakse was elected to power in 2008 and with the assassination of the Sri Lankan external affairs minister, the government launched a full fledged military offensive against LTTE. This resulted in the disruption of organization and the death of its founding leader Prabhakaran and his son, Charles Anthony. All the senior leadership of LTTE was killed and it is believed that they are out of action.

Prabhakaran is survived by his wife, a son and a daughter.

Will history repeat? Only the wheel of time will tell

Monday, May 18, 2009

Right Click, Send to USB in Nautilus

I did this script on Ubuntu 9.04. So any mentions of installation etc. will be specific to Ubuntu. Before I describe the guts of doing it, let me tell you straight that this feature has already been implemented in Ubuntu 9.04, Jaunty Jackalope. I did this script based on a question I found on linux.com
On to the script, then:

First, you have to install Nautilus Actions Configurations Package. It allows easy and graphical editing of Nautilus' right click menus.
sudo apt-get install nautilus-actions
Next, create the file copy.sh and save it in a location of your preference. For the purpose of this example, I'll use /home/bob/.

Here's the listing for copy.sh

#!/bin/bash
#First, get the name of the device as in sdb, sdc etc
name=`dmesg|grep removable|awk '{print $5}'|sed -e 's/\[\([a-z][a-z]*\)\]/\1/'|sort|uniq`

#Select only those devices which are mounted
name=`mount | grep -Z "$name" | awk '{print $1}'`

if [ ! $name ]; then
exit 1;
fi

#Find the mount points of mounted devices
#ie, if there exists a removable drive
mpoint=`mount | grep "$name" | awk '{print $3}'`

#Find the number of devices
num_device=`for FN in $name; do echo $FN; done | wc -l`

#Display a selection menu if there are multiple devices present
if [ $num_device -gt 1 ]; then
for FN in $mpoint;
do
string=$string" FALSE "$FN;
num_device=$((num_device-1))
done
selection=`zenity --title "Select a USB Device" --text "Please Choose one of the following USB Devices to send the selection to" --list --radiolist --column "Select" --column "Mount Point" $string`;
else
#else copy to the available device
selection=$mpoint;
fi

#For each of the selected files, copy them
for FILE in "$@"
do
/bin/cp -r $FILE $selection;
done

Make code executable chmod +x /home/bob/copy.sh

Now, having saved copy.sh/home/bob/, open up Nautilus Actions Configuration from System->Preferences->Nautilus Actions Configuration. Click on Add. In the "Add a New Action" Window that pops up, fill in the details of the menu item. Like Label, the tooltip - The piece of text that you see at the bottom of Nautilus once you highlight the label and an optional icon.

In the Profiles section, highlight "Main" and click on Edit. In the Path text box, enter the full path to copy.sh, ie, in this case /home/bob/copy.sh. In the parameters tab, enter %M. To know more about parameters, click on Legends to get a pop up. The pop up can be closed by clicking on Legends again.


In the Conditions tab, under "Appears if selection contains", select "Both". Check the option "Appears if Selection has multiple files and folders". Click on OK and you are done.

To see the option in the right-click menu, you will have to kill all instances of Nautilus running killall -HUP nautilus, or log out and login again.

I tested the script with only a single USB. It should work for multiple ones too if plugged in together. On the occasion that multiple Removable Disks are present, the script will ask for a selection from the user.

Labels: ,

Sunday, May 10, 2009

Crazy Chatting with Chatbot::ELIZA

Chatbot::Eliza is a perl module that implements the famous ELIZA program created by Joseph Weizenbaum.

Chatbot::Eliza has a object type structure, which enables it to hook up with any interface. A very trivial command line implementation of the bot would take up only four lines of code and it goes like this :

#!/usr/bin/perl
use Chatbot::Eliza;
$bot = new Chatbot::Eliza("Jack", "");
$bot->command_interface();

This will initiate a new bot talking with you on the command line. Our bot, Jack in this case, would begin with the classic question: "Please tell me whats bothering you?". And you know what happens next. The mindless ramblings of the bot.

When I first saw this module, the only interesting use I found of it is to hook it up with my gmail account. Since then, a lot of my contacts have talked with either Ms. Jill or Mr. Jack.

Connecting to GTalk with Perl is a trivial issue. It requires a few perl modules such as

  • IO::Socket::SSL (>=0.81 ?)

  • XML::Stream

  • Net::XMPP

  • Authen::SASL



Use the CPAN commandline shell to install them. Enter the command line shell by typing

perl -MCPAN -e shell

Now install the modules one by one using the command

install module_name

And of course you also need the Chatbot::Eliza module.
With all the requisite modules installed, you are ready to connect your bot with GTalk.
Here's the listing I used for the Eliza-gmail-chatter:


#!/usr/bin/perl -w

use strict;
use Net::XMPP;
use Chatbot::Eliza;

my $bot = new Chatbot::Eliza("Jill","");
my $message;
my $body;
my $JID;
my $userid;
my $username = "xxxxxxxxxxxxxxxx"; #Supply your gmail username here
my $password = "xxxxxxxxxxxxxxxx"; #Supply your gmail password here
my $resource = "ChatBot";

my $hostname = 'talk.google.com';
my $port = 5222;
my $componentname = 'gmail.com';
my $connectiontype = 'tcpip';
my $tls = 1;

my $Connection = new Net::XMPP::Client();

$Connection->SetCallBacks(message=>\&doit);

my $status = $Connection->Connect(
hostname => $hostname, port => $port,
componentname => $componentname,
connectiontype => $connectiontype, tls => $tls);

if (!(defined($status))) {
print "ERROR: XMPP connection failed.\n";
print " ($!)\n";
exit(0);
}

# Change hostname
my $sid = $Connection->{SESSION}->{id};
$Connection->{STREAM}->{SIDS}->{$sid}->{hostname} = $componentname;

# Authenticate
my @result = $Connection->AuthSend(
username => $username, password => $password,
resource => $resource);

if ($result[0] ne "ok") {
print "ERROR: Authorization failed: $result[0] - $result[1]\n";
exit(0);
}
$Connection->PresenceSend();
$body = $bot->{initial}->[0];
$Connection->MessageSend(to=>"xxxxxxxxxxxx\@gmail.com",body=>$body); #Supply your contact's
#gmail id here
undef $userid;
while (1) {
$Connection->Process();
if (defined ($userid)) {
$Connection->MessageSend (to=>"xxxxxxxxxxx\@gmail.com", body=>$body); #Supply your contact's
#gmail id here
print "Me(as the chatbot) (to $userid): ", $body, "\n";
}
}
sub doit
{
my ($SID, $Mess) = @_;
$JID = new Net::XMPP::JID($Mess->GetFrom());
$userid = $JID->GetUserID();
print $userid, " : " , $Mess->GetBody(), "\n";
$body=$bot->transform($Mess->GetBody());
}


You can have a laugh riot from your terminal watching your contact talking with the Chatbot. Make sure that you inform the contact later about who talked.

Chatbot::Eliza has a peculiar effect of making not wanting to talk with her ever again.

Try it for yourself.
Happy Chattin' Fun !

Labels: , ,

Friday, May 8, 2009

Quitting Microsoft

Quitting the Microsoft Windows platform and moving on to greener, finer pastures is a lot like quitting smoking. Once you begin it, once you understand its clumsy user interface (which is highly restricted), once you get around easily with a "Aha....!", there is no going back. Not unless you are extremely committed to it.

Most of the average Joes out there know that the Wintel platform they are using taxes them heavily, both economically and productively, but merely disposes them as daily hurdles of a computer user. The computer hangs once in a while. They begin the 3-step process to recover it :
Step 1: Press Ctrl-Alt-Del. Three finger salute!
Step 2: Bang on the cabinet. BAM! Boom! "Ey ey.. What a Fu*king thing ???"
Step 3: Press the reset button.
Maybe it is a gift, or maybe it is programmed so, whatever you do, the third step gets you right back to what you were doing before the computer hung. You can enjoy almost an hour of freedom and work until the cycle repeats.

Everybody knows it, but tolerates with it. Has it got something to do with human psychology? The majority of us are happy to voice our opinions from within a crowd, but are silent when asked personally for an opinion. Does the same thing happen here too? Are you using Windows because your parents, friends and neighbors are using it? Are you using it because you are not technically savvy enough?

The latter is a more common problem. People believe to be technically incompetent, thus branding a lot many things too geeky and among them the GNU/Linux system. What one needs to understand is that computer skills are acquired, not inherent. Thus everyone has an equal chance of acquiring the skills. By everyone, I meant all those who have access to the Internet. The Internet, the connection of networks of computers holds enormous resources to get anyone upto speed on any existing technology.

Thus in my opinion, quitting Windows takes only the time needed to understand the basics of installing another operating system, be it GNU/Linux, Mac OSX or even the obscure Plan 9 from Bell Labs! We are living in an age of information explosion. Why bind ourselvers to the slavery of proprietary, monopolistic companies when we have the freedom of choice, expression and code just an install away ?

To quote Karl Marx, "The proliterates have nothing to lose, but their chains!". (Read the proliterates as Internet browsing guys!!)

Comments ??

Labels: ,

Tuesday, May 5, 2009

gnokii and Nokia 3110c

Ever wondered how to use your phone with GNU/Linux as you use it with Nokia Mobile Suite in Windows ? Ever wanted to backup contact books, appoinments, sms and all other personal things the easy way in a GNU/Linux environment ?

If you do wonder, friend, you are foreign to gnokii.
gnokii provides tools and a user space driver for use with mobile phones under various operating systems operating systems. It allows you to communicate with the phone over a serial cable, usb, IR or even bluetooth. gnokii also provides the functionality to manipulate the phone over this connection.

Why did I chose Nokia 3110c ?
The primary reason is that it is the phone that I own. Another reason is that this particular phone uses a DKU-2 cable. DKU-2 is nothing other than a fancy name for the common USB to mini-USB cable ! I was interested in USB devices working with GNU/Linux, I guess.

Hoping that you are competant enough to install gnokii either from source or from your distro's custom repositories, let us proceed to the juicy part. As with all good things free, the first thing that you will need on a fresh installation of gnokii is a good configuration file, aptly named .gnokiirc

Fire up your favorite text editor (mine is Vim) and type in the configuration details.
Here's how my config file looks like

[global]
port = /dev/ttyACM0
model = 3110c
initlength = default
connection = dku2libusb
use_locking = yes
serial_baudrate = 19200
smsc_timeout = 10
bindir = /usr/local/sbin/


The port determines which port the PC uses for connecting with the phone. On connecting the phone with the PC and selecting "Nokia Mode" a new node is created by the system in /dev. You can use the output of dmesg command to determine the port.
On issuing the dmesg command on a terminal, you will see an output similar to

.........
[ 1671.313624] cdc_acm 3-1:1.1: ttyACM0: USB ACM device
..........

Use the port value obtained thus. But normally, as I have seen in a number of systems, the default port will be /dev/ttyACM0.

Next up is the model name which is 3110c in this case.

initlength controls the number of characters sent to the phone during initialisation. Either "default" or a positive integer value is allowed. If it seems like the connection takes a long time, you can retry, entering a smaller positive value for initlength. But in most cases the value "default" will suffice.

connection determines the type of connection. With DKU-2 cable and the libusb driver, use a value of dku2libusb. It will work fine.

Leave the other options as they are seen. The serial_baudrate determines the speed at which serial communication takes place. The use_locking allows a type of flagging facility, disabling other operations while one is taking place. The smsc_timeout option determines the time to wait before a SMS send via the PC is acknowledged by the phone. The bindir is the path to various gnokiid libraries. For a default installation, the libraries are found at /usr/local/sbin. Change the value if you chose to install the libraries elsewhere.

With gnokii installed and .gnokiirc setup, connect the phone to the PC. When asked to choose the mode in the phone, choose "Nokia Mode".

How do you verify whether your phone is properly detected ? Open up a terminal and issue the following command

gnokii --identify
You will see the list of messages being sent back and forth between the PC and the phone

......................
......................
Received model RM-237
IMEI : XXXXXXXXXXXXX
Manufacturer : Nokia
Found model "RM-237"
Model : 3110c
Product name : RM-237
Revision : V 07.21
Serial device: closing device

This communication gives you the phone model, your IMEI number and the firmaware version you are using. If they are showing up correctly, you have successfully connected your phone with gnokii.

There are a lot of manipulations possible with gnokii. You can send sms, make voice calls etc. With some clever scripts and imagination, you can turn your phone into a remote management center !

Labels: , ,