Wednesday, March 19, 2008

Arthur C. Clarke: The Odyssey Concludes

As most you have already heard, Sir Arthur C. Clarke, the British/Sri Lankan writer and visionary passed way this morning in Apollo Hospital. Clarke who was a house hold name in Sri Lanka was living in the country from 1956. It is said that the souther sea is what brought Clarke here. It is a know fact that he really liked the places like Unawatuna, Roomassala, etc.

Clarke was a worldwide known person for his famous work like the Odyssey series (2001, 2010, 2061, 3001) and Rendezvous with Rama, Fountains of Paradise, The Deep Range, etc. and also for inspirational visionary work. For me, "The Deep Range" is the favourite, not at any rate because of the Sri Lankan connection in the book, but because of the illustration of Ocean and creatures it creates. I'll always keep re-reading it to experience that wonderful feeling of being in the Ocean. This is also the book where Clarke points that we could look into the sea before going to walk among the stars.

Sir Clarkes passing away remarks the end of the reign of "The Big Three" (Issac Asimov, Arthur C. Clarke and Robert A. Heinlein) of science fiction. I'll not get into the details of his contributions to the world, Sci-Fi, non-fiction or other. For a start you can read the Wikipedia page I linked above. I just wanted to say that he and his work was inspirational for a number of generations and it will remain so.

Here are some links I found on the Net reporting his death:
Slashdot: Arthur C. Clarke Is Dead At 90
The Associate Press: Writer Arthur C. Clarke Dies at 90
Washington Post: Arthur C. Clarke; Sci-Fi Writer Foresaw Mankind's Possibilities
BBC: Writer Arthur C Clarke dies at 90
LA Times: The passing of a legend: Arthur C. Clarke
National Post: Sci-fi giant Arthur C. Clarke dead at 90
Bloomberg: Arthur C. Clarke, Author of `2001: A Space Odyssey,' Dies at 90

With generations of people whos been inspired by his work, the Clarke mark will be visible in future than it did in past. Whenever we look into the stars, whenever we unravel the mysteries of the deep see, whenever we take steps as a race and whenever a LOLCat meows about stars :) we'll remember him.

PS: A side note. When people in US and similar areas heard that Clarke died on Wednesday, it was still Tuesday for them. So as one person in Slashdot said "He even died tomorrow". Well, he lived the future, and died in future.

Tuesday, March 18, 2008

Google Summer of Code 2008 Mentor Organization List Announced

Summer is going to be upon us very soon and it looks certainly awesome. As usual Google is brightening it up. Google Summer of Code or more lovingly called GSoC or SoC has been announced for the fourth consecutive run! (Meanwhile let's hope lives would be better for the people affected by the forces of nature in past few days.)

Google Summer of Code is a student program where university (BSc, MSc, etc.) students can work for an Open Source software project for 3 months under Google sponsorship. I was one of the lucky students last year (but had to resign due to a couple of domestic bereavements). This years program is announced and I hope at least a few excellent coders will be interested in this news. Please convey this news to relevant students, while I check out any interesting project for me. :) And remember last year about a 20 add students were selected from Sri Lanka. So don't think you don't have any chance. You just have to be enthusiastic, skilled (in coding) and could allocate time (which I know by experience is important).

Google Summer of Code is one of the best ways to get industry level experience, make connections with a lot of important programmers and projects in the world, contribute to Open Source projects where thousands of people will be using your code. To top it off Google is paying each selected student a stipend of $4,500 which is over LKR4.5 lakhs.

Google Summer of Code, running for the fourth consecutive year is now announced and will accept student application between 24-31 March. Any interested student can see the list of mentoring organizations and their suggested ideas in
Actually, those ideas are just suggestions and students are welcome to propose their own ideas.

This year 175 Open Source projects are there for the students to work with. Students will find familiar names among them like Apache, Google, Nmap, Fedora, Debian, GCC, PostgreSQL, MySQL, PHP, Git :) , Subversion, Pidgin, Adium, Python, Django, GIMP, OpenMoko, GNOME, KDE, Vim, FFMpeg, VideoLAN, Samba, Sahana, WordPress, Pentaho, OLPC. etc. Please note that this is not about developing applications using those, but developing those themselves. GSoC selection is a very competitive process and good skills in development is required.

will answer your burning questions about the particulars like how to apply, eligibility criteria and etc. So please get SoC to the attention and encourage students with strong programming skills to apply.

Wednesday, March 12, 2008

No! I Will NOT contribute 5 Cents to that Sick Child!

I'm sick of Chain e Mails.

I'm so sick of emails some people send me (oh, how much I feel like calling them offensive and degrading names!) saying that "Please forward this e mail if you have a heart" or "Please forward this message to everyone you know" or "Please help to save a life" and might contain a poem named "Slow Dance" or something. They claim they are so authentic (yeah, and I'm Superman in disguise). It might be something else like "forward this 100 time and it will bring you fortune. This is REAL! This worked for me" or "Fwd:FWD: Worst Virus Ever: Be careful !!!". The last one I got was named "Fwd: Pleeeeease forward costs nothing 2 u.". Costs nothing?!!! It costs my patience, my nerves, my bandwidth, my time and sometime my sense also when I notice the sender is sometimes an IT student!

I won't mind promoting a cause which I know of and I could verify, like the fund raiser to support a university student who was dying from a cancer. But all the other things which no one can verify the validity (which is the common case) are not going to pass though me.

To make it clear I'll just say: "Those mails are hoaxes, so stop spamming!". Give some thought on these points. Pleeeeeeeeeeeeeese! ;)

1. E mail systems were never designed to track E mails.

E mail which is explained in gory technical details in RFCs, 2822, 2045 through 2049 were never designed with a facility to track the emails sent. Later facilities were added to support delivery receipts and return receipts. But this is just for the servers. This means that as far as I know Microsoft, AOL or any other (unless of course they are employing Hana Gitelman) *cannot* track any emails you send.

So our genius Spammer friends out there will next time tell you that your e mail provider is donating this project, instead of AOL. You are warned. If you are convinced that it is the case, please re-read the privacy statement of your e mail service provider and contact them if necessary.

2. There's no reliable way I know of which can track data across the Internet

Internet had a vast number of server interconnected in some means. I guess all of you remember that basic introduction. So,... when you send a mail, that piece of data travels thought this forest of servers, through numerous nodes and so on. Some servers strip data from that, some add to that. So don't expect that there's a reliable technique to track e mail. So what ever some mails claim, it is not effective up to my knowledge.

3. Some of the things are known Hoax mails/chain mails

I know most of you don't care, but some of these cases are well documented on the Internet/WWW as known junk. Next time when you receive such a mail, do a little background search and see for your self.

Next time you feel like forwarding a mail about Amy Bruce, Craig Sheldon or whoever it is, Stop! Most of the people who forward do not even think of checking a little about these claims. Most organizations have warning pages about chain mails. For example Make-A-Wish has a page saying that Amy (Amrita, etc., etc.) Bruce chain mail is a known hoax.

4. You are helping Spammers!

I once got a chain mail which had over 2000 e mail addresses in it. Yes! over 2000. Some were wide open to read. Some were hidden in the header. However, should a spammer get his/her hand on that mail (which I'm pretty sure of) he/she will have another 2000+ e mail adresses to their database. Just imagine the number of e mail addresses passing in the Internet in pure text format!

It is believed that most of these chain mails originate from professional spammers. :) And I've seen some locally originated stuff too. Whatever the cause may be, it'll still be for spammers advantage.

5. You are offending/harming others

By including your friends e mail addresses in a spam mail list, you are doing a harm to them. Then you are also affecting their productivity, time, bandwidth, etc. You also expose them to phishing and other forms of scams, and also could carry malware like trojans, worms, spyware, etc. If you don't listen to any other reason, at least stop because of this security concern. Need I say anything more? You know the pain for yourself.

6. You are harming yourself

By continuously sending chain mails, you are not only jeopardizing your friends, but also damaging your credibility and reputation. Your email address will shortly enter blacklists and it would be very hard to earn the credibility. For example there are guys that I completely ignore when I check mails or better, completely filter out. Me doing this might not hurt you, but it will when Google does that.

Some of these mails will tell a heart touching story of a sick child, sick husband or someone like that and mention something like "AOL and Microsoft will track this e mail and contribute 5 cents per every message you forward". Else it might me like "Dialog is offering brand new free Nokia phones, forward this 100 times to qualify for a N95 draw." Sounds familiar? It should be. I doubt some of you have even been forwarding such mails. If so please give up in the name of real people suffering from your spam.

I know most (if not all) of the people who send me these kind of emails have a good intention of supporting an innocent soul. But I'm so sorry to tell you that there are jerks you are feeding upon your good human soul. So please stop, now. You are not helping anyone. No you are not donating anything when you forward those mail. For make the point clear, no one is tracking how many times you send that e mail. So stop hitting forward button in vain.

If you are not ready to take my word for it try Googling to be ashamed of continuing chain mails. For those who are too lazy to click on that link, I'll list a few things you should see.

Your mails will not be tracked, will not be counted, will not help, will not bring good luck, will not win you prices, will not do any good.

Drop spamming your friends today!

Tuesday, March 11, 2008

Howto setup a MySQL Connector/J 5.1 for Tomcat on Linux

Again, I'm not switching to Java. :) For clarity, I'm helping one of my online buddies to setup and use Ruby even as I write this. This work was something I had to do for a Rails project which used JSPs and stuff with a MySQL database over JDBC. The application setup was quite interesting calling JSPs to work with a Rails webapp.

Actually the following things are found on the Internet. I cannot remember all the sources I looked at, but one was the MySQLs own documentation and Apache Tomcat documentations. So if this works (which in my case did), credit should not be mine. :)

Here's the setup.
  • GNU/Linux (in my case CentOS 5, although should work with any Linux distro)
  • Apache Tomcat (5.5.25, should work with Tomcat 5.5 range)
  • Sun JDK (1.6.0_04)
  • MySQL (5.0.22)
  • MySQL Connector/J (5.1)

1. I assume that Java is setup (See my previous post for more details on setting up Java manually), and your MySQL is running on the same host on port 3306. Please replace your actual settings if they are different.

2. First, lets set up Apache Tomcat 5.5.
If you already have Tomcat up and running, feel free to skip to step 2.
You can download it from ( For my case I downloaded Apache Tomcat version 5.5.25 (Eg: apache-tomcat-5.5.25.tar.gz).

Extract the downloaded archive to get the tomcat (Eg: tar xzvf apache-tomcat-5.5.25.tar.gz). This will give a directory with a name similar to apache-tomcat-5.5.25.

Move this directory to a place where you'd run it as the Tomcat server.
Eg: cp -R ~/apache-tomcat-5.5.25 /var/tomcat

Now set the variables, CATALINA_HOME, JAVA_HOME, JDK_HOME. One way of doing this is by adding those to /etc/profile file (Eg: sudo vi /etc/profile).
Eg: Add these lines to the end of /etc/profile:

To make sure it takes effect, you can log out and log in, or just close the terminal and start a new thing.

Then you can start the Tomcat server by running the script which comes with Tomcat. Shutdown script is called They are in the bin directory of your Tomcat directory.
Eg: $/var/tomcat/bin/

2. Now lets move to Connector/J setup. Download MySQL Connector/J from ( In my case I downloaded version 5.1. You'll get a .tar.gz file
Eg: mysql-connector-java-5.1.5.tar.gz

This writeup assumes this connector version. It is the latest as of this writing, but if the version differs, the following configuration instruction may not work.

3. Extract the connector.tar.gz archive to get a .jar file, which is the actual connector.
Eg: tar xzvf mysql-connector-java-5.1.5.tar.gz

This will most probably create a directory with a name something like mysql-connector-java-5.1.5. In that you'll find a directory structure where the .jar file (Eg: mysql-connector-java-5.1.5-bin.jar) will be in the topmost level.

4. Copy the .jar file (Eg: mysql-connector-java-5.1.5-bin.jar) to your $CATALINA_HOME/common/lib (i.e: common/lib directory within your Tomcat directory.)
Eg: sudo cp ~/mysql-connector-java-5.1.5/mysql-connector-java-5.1.5-bin.jar /var/tomcat/common/lib/

5. Create a context configuration file for Tomcat.
Create a configuration file in your $CATALINA_HOME/conf/ which has the file name apps-yourapp.xml
Eg: If your applications name is myapp then,
$ vi /var/tomcat/conf/apps-myapp.xml

6. Enter the things found here or in this file. When you copy and paste these code, please remember to replace values for Context path, docBase, Resource name, ResourceParams name, username, password and url with your values.

Eg: If your application is located under /var/tomcat/webapps/myapp and it's accesible via http://yourdomain.tld/myapp then your Context path would be "/myapp" (where it's accessible in URL) and docBase would be "webapps/myapp" (where it's available on file system).

7. Restart your Tomcat can now you are good to go. In your Java code you can use the JDBC connection in something like:
Connection conn = DriverManager.getConnection("jdbc:mysql://yourdomain.tld/my_database?" + "user=myuser&password=mypassword");

Monday, March 10, 2008

Howto Setup Sun Java on Linux Manually

I'm not switching to Java. :) But this particular thing is something I've answered several times. So instead of repeating it every time, I'll put the details here and point others here. Installing Sun's Java (JDK and JRE) manually, without using something like yum, apr-get, urpm, etc. seems to be something many desktop (or whatever) Linux users want. For example they want to run certain applications like NetBeans, FrostWire, etc. which require a JRE to be available. This tutorial is going to take you through the steps you need to setup a working JRE/JDK on a Linux system. You may as well take this idea and tune it for your non-Linux environments like Solaris, *BSD.

Note: This howto assumes you have 'sudo' configured for you. If you don't have 'sudo' configured, you'll have to either use 'su' or login as root to use the commands I have provided with 'sudo' at the beginning. Please replace file names and paths in this howto with your own values.

1. First download the JRE/JDK from Sun ( For the rest of the tutorial I'll use JRE 6 Update 2, but even if you want to setup JDK it's still the same steps. The selection of the package is your choice. Remember, the .bin (not -rpm.bin) file can be used on virtually any Linux distribution, given they have fairly up to date components and correct architecture (Eg: x86, x86_64, etc.).

You can get the JRE as a Linux self extracting file (.bin) or a RPM archive (-rpm.bin) file at the moment. Even if they change these things, I think they'll still provide the archive (not the package).
Eg: jre-6u2-linux-i586.bin

2. After you complete your download, go to the directory you have it on disk.
Eg: $ cd ~/skyeye/Desktop/ if you have it on your desktop

3. Change the permissions so that you can execute the file
Eg: $ chmod a+x ./jre-6u2-linux-i586.bin

4. Execute it
Eg: $ ./jre-6u2-linux-i586.bin

5. You'll have to go through the Sun's license notice and accept it to use the JRE/JDK. After this the package will extract and you will have a directory
Eg: ./jre1.6.0_02 if/ you downloaded the .bin file, or you'll have a jre1.6.0_02-i586.rpm file if you downloaded the -rpm.bin file.

6. If you now have a .rpm file, you only have use rpm (Eg: rpm -U) or a relevant utility (Eg: yum localinstall)
Eg: $ sudo rpm -Uvh jre1.6.0_02-i586.rpm

You are done. Contgratz!

But if you downloaded the .bin in the first place, please proceed from step 7.

7. Move your new JRE/JDK directory where people can access
Eg: $ sudo mv ./jre1.6.0_02 /opt/

8. Add the path to the bin directory within your JRE/JDK directory, to your systems $PATH. Use your preferred editor to edit the relevant configuration file to set the PATH persistently. If you are going to add it to the system wide PATH so that anyone can get it, edit /etc/profile. If you just want it for you, edit your .bashrc (~/.bashrc). As you may have guessed this is for the setups using GNU Bash. If you use a different shell, the lines in step 9 might need to be changed. Luckily almost all mainstream Linux distributions use Bash as the default shell.
Eg: $ sudo vi /etc/profile

9. Add the following lines after everything (replace /opt/jre1.6.0_02/bin with your JRE bin path)

export PATH

save (write to) the file and exit. Now, next time you log in, you'll have a Sun JRE ready for you. What step 9 exactly does is, add the path of the Java bin directory to the system PATH variable at the beginning.

That's all. See, not that difficult. But of course, if you are using modern distributions like Ubuntu, Fedora, Debian, etc. you don't have to go through all these. Sun Java packages are usually available through the repositories. Just use your favorite package management software (Eg: Synaptic, YumEx, apt-get, yum, etc.) to install it.