Archive for January, 2008

David letterman on Bill Gates retirement

This one is funny, especially if you have used Windows 95 :-)

Barcamp2 at Cochin

I will be attending the second barcamp organized at cochin (Thrikkakara Campus) on 3rd February. I will not be presenting anything, but just want to listen. Hopefully a lot geeks are going to turn up there. I know a couple of them through their blogs.

If you are geek, don’t miss this event. It is an ideal platform to meet other geeks (as you know finding geeks in Kerala is not easy :-) ) You can register for the event here.

Wondering what a barcamp is? Here is wikipedia for the rescue.

Anand on why “less is more”

Anand has done an interesting post on the principle why “less is more”.  He is talking from his consulting experience, but it doesn’t limit to consulting alone.  I can relate to him. Especially this one,

Third, you’ve got to be brave enough to shut up, or say “I don’t know”. Initially, this was tough for me, but I learnt from a friend. I always thought him not-so-smart, but honest. He’d ask, “But why?” and when I’d explain, he’d say, “I don’t understand it.” After two hours of trying to get him to understand, I’d realise that I was the one who never got it in the first place. After a while, I got into the habit of being very prepared before I explained anything to him.

Saying “I don’t know” doesn’t make people think less of you, I’ve found. I know a lot of people disagree with me. One of the most consistent feedbacks I’ve received in the first half of any project or firm I’ve been in is, “He should speak up.” Dammit, I don’t have anything to say! If I know something, I’ll say it. If not, I’ll shut up. Now, despite this feedback, no one’s quite objected to me. And in the second half, they’re always amazed at how much I’ve improved based on the feedback.

The feedback had nothing to do with it, of course. I just happen to know more in the second half of a project.

Using unnecessary buzz words and bloating a proposal document is all too common now in software industry. Sometimes it goes upto the extend that it makes me sick. Yesterday I was watching CNBC and one senior manager of a software company was saying - “this strategic acquisition of rival will position us to provide holistic support to our clients” or something like that…

Installing tomcat 6.0 on MediaTemple dedicated server

In the last post, I looked at how Java can be configured on MediaTemple CentOS server. This post will show you how you can install Tomcat on your server.

1. Download and extract tomcat 6.0 binary distribution. Get the URL of the tar.gz file from http://tomcat.apache.org/download-60.cgi. From the ssh console download using wget.

wget http://apache.deathculture.net/tomcat/tomcat-6/v6.0.14/bin/apache-tomcat-6.0.14.tar.gz

Now use the following commands to extract the files.
gunzip -d apache-tomcat-6.0.14.tar.gz
tar -xvf apache-tomcat-6.0.14.tar

2. set JAVA_HOME variable to point to your Java installation.For this you need to login as root. Create or edit a java.sh inside /etc/profile.d. Add the following line in java.sh.

export JAVA_HOME=/usr/java/jdk1.6.0_04

3. Start tomcat from bin folder. Login again to SSH using your non root user id.  The startup script for tomcat is in [tomcatdir]/bin. Change to bin and then execute,

./startup.sh

Voila! You should see the tomcat server running at www.yourdomain.com:8080/

To shutdown you can use ./shutdown.sh, but for some reason I am not able to execute it. So currently the only way to stop is to kill the Java process from SSH. Update: I got shutdown.sh working by adding -Xmx4m as JVM parameter in catalina.sh for “stop” block of code.

Now my next task is to get Struts2 sample application running on this…

Installing Java 1.6 (JDK6.0) on MediaTemple dedicated virtual server (dv)

I recently bought a dedicated virtual hosting service on MediaTemple. The idea was to use this server for all my future projects in J2EE and Ruby on Rails. For $50/month, this service is not exactly cheap, but I am yet to find an alternative VPS host (I am planning to evaluate SliceHost sometime in future)

By default, the server comes with Ruby 1.8.5, but not Java compiler. My first task was to install latest JDK (1.6) on the VPS server.

All dedicated virtual servers hosted by MediaTemple comes with a CentOS installation. You can check that by running the following command on SSH terminal.

cat /etc/redhat-release

I got CentOS release 4.5 (Final) on the console.

Now before you can install Java, you need to know the password of “root” user in your server. For this, create a new support request and ask MediaTemple to set your root password of your choice.

Now comes the second problem. How do you download Java binaries onto your server? One option is to download JDK on to your machine and then upload it to server. Since the file size is more than 60MB, I didn’t want to use this method.

What you need is the ability to download J2SE 1.6 rpm binaries directly to your dedicated server. The Linux command “wget” is the ideal tool for this. But what is the URL to download?

The problem with Java download is that there is no direct link available for download. In order to force license display and acceptance, Sun uses a hidden redirect to the actual download. You need to find this URL.

For MediaTemple installation, select Java download which is “jdk-6u4-linux-i586-rpm.bin” from the list at http://developers.sun.com/downloads/. Using Firefox, start the download. Immediately pause the download and then righ click on the “resume” link to get the actual download link.

Paste the URL in a text editor and then quote it by adding double quotes at the beginning and at the end of the URL.

Now from the SSH terminal, type the following.

wget <quoted url from text editor> -O j.bin

This will download the Java binary as j.bin in the current folder. Now change to super user mode by typing sudo su.

Make the j.bin executable for using the command chmod a+x j.bin and execute it by ./j.bin. Accept license terms and continue. You will get the Java installed on the MediaTemple DV server.

But you are not there yet! Following is the error I got when I ran “java -version” on the command prompt.

Error occurred during initialization of VM
Could not reserve enough space for object heap
*** glibc detected *** free(): invalid pointer: 0xb7e71280 ***
Aborted

On CentOS you need to do something more to get Java installed. You need to set a link to Java. Execute the following from the root privileges. Change jdk1.6.0_04 to your version of JDK download.

/usr/sbin/alternatives –install /usr/bin/java java /usr/java/jdk1.6.0_04/bin/java 1

After this I was able to get a sample Java program running on the MediaTemple dedicated server. Now the next step is to install Tomcat App server. That is for another day….

Build your next pc under $500 (Rs. 20000)

I recently got a brand new pc assembled. Prices have been steadily dropping for pc components and it is possible to assemble a good system under Rs. 20000 ($500) in India. In other places it should be cheaper. Check out the following specifications and price. I am not an ‘expert in bargaining’ and if you are smart enough you should get the components less than the price indicated.

1. Motherboard - ASUS M2A-VM HDMI - Rs. 4000 ($100)
This is one of the first motherboards to support HDMI. This means you can play HD-DVD or Blue-rays discs. Comes with integrated ATI Radeon X1250 DDR2 800 graphics.Another important feature is that you get dual monitor support - DVI-D and RGB. You can also with the DVI version (without HDMI) and it is cheaper by about $15.

2. Processor - AMD X2 4800+ - Rs. 3500 ($85)
This is a medium range dual core processor from AMD. Depending on your budget you can choose 4200+, 4400+, 4800+ or 5200+. Price difference among 4xxx range is rather small and hence I prefer 4800+

3. Harddisk - Seagate 80GB SATA - Rs. 1500 ($40)
I normally don’t need even 80GB since I plan to use this PC exclusively for programming and related stuff. Don’t go for higher capacity disks unless you really need it in next one year. Another option is 160GB SATA which costs around Rs.300 ($8) extra.

4. RAM - 1GB DDR2 800 (2 nos) - Rs. 2200 ($55)
These days you need atleast 2GB of RAM. So go for two 1GB DDR2 800 modules. If you are into real multitasking with eclipse in one monitor and radrails in another, you can probably go for four 1GB modules. The motherboard supports it!

5. Cabinet with SMPS - 500W Mini- Rs. 1500 ($40)
Go for a 500W mini cabinet. There are too many in the market. Go with the one which has better warrant terms.

6. LCD Monitor - 19″ WideScreen - Rs. 8000 ($200)
Here your options are between a 17″ and 19″ inch LCD screens. I think it is better to go for 19″ considering the small price difference (around 10% extra). Here some of the choices are samsung, LG, viewsonic etc. Buy it after comparing the lcd monitors since each one has his own preferences. It may be a good idea to go with the one which has integrated speakers (if you not music crazy!)

7. Keyboard,Mouse and DVD Drive - Rs. 2000 ($50)
Again too many choices to list here. Go with a medium model which is good enough for regular use.

So total price = Rs. 22700 ($565). Oops! We started with a budget of Rs. 20000. Now here comes your bargaining skills. When you are buying all these together you might be able to reduce Rs. 700 atleast. Then change your monitor to a 17″ and AMD X2 processor to 4200+. Now you have an excellent desktop pc under $500! :-)

You can get almost all the items in this list from Amazon. Those are listed below. Of course, you cannot bargain with a Website :-)


Changing spamming tactics

I had submitted this blog to a couple of free web directories. The end result is that I don’t have much of traffic, but I do get plenty of spam comments. Now recently it has reached a new milestone of 100 spam comments per day.

I think spam study will be a fascinating field. Most of the spam is auto generated, but I do get occassional manual spam. If I have a post on “ruby”, the comment will be something like “your ruby knowledge is amazing!”, flattering indeed!

Then there is a kind of spam message no one is going to approve. These are long comments and most of them contains over 10 links! These guys seem to survive on blogs which are not moderated.

I had even some comments pleading not to delete them.

Now you would be wondering why I am writing a post on blog spam? Well, today I got a reason - I got a gem among the comments that needed moderation. Check out the following screenshot.

Best spam comment I have received

This is guy is telling me not to delete the message and he says “the money from spam will go to help hungry children in uganda”! Funny that he calls the message as spam :-)

I don’t know whether this tactic will work. Ok. This might work. After all, even in India nigerian spammers are able to cheat some innocent (read: greedy) guys.

On war and god

Most of us don’t think that we will probably die tommorrow. But it is quite different for soldiers who are on the battle field. I had always thought that someone must be really stupid to join to an army.

Today I came across this blog post written by Andrew Olmsted. He was killed on January 3rd,2008 in Iraq. This blog post was written earlier by him and was to be published in case he dies in the war. It is a very touching post and the following paragraph struck me most,

Soldiers cannot have the option of opting out of missions because they don’t agree with them: that violates the social contract. The duly-elected American government decided to go to war in Iraq. (Even if you maintain President Bush was not properly elected, Congress voted for war as well.) As a soldier, I have a duty to obey the orders of the President of the United States as long as they are Constitutional. I can no more opt out of missions I disagree with than I can ignore laws I think are improper. I do not consider it a violation of my individual rights to have gone to Iraq on orders because I raised my right hand and volunteered to join the army. Whether or not this mission was a good one, my participation in it was an affirmation of something I consider quite necessary to society. So if nothing else, I gave my life for a pretty important principle; I can (if you’ll pardon the pun) live with that.

There are a lot of people who blame George Bush for the war. But the reality is that he is a democratically elected president and had the majority support in US for going ahead with the war. The soldiers who fight the Iraqi war are just doing their duty.

People die every day due to diseases, accidents and due to old age. But people also die due to human stupidity. There cannot be a better example for human stupidity than Iraqi war. For any conflict, war must be the last choice, not the first!

Personally I don’t believe in God. But most of the time I strongly wish that there is a God who values goodness in men and who punishes those who perpetrates violence and war.

There is no hope and no justice if there is no God.

Hurray! : I won 1 million euro lottery!

Today is my lucky day. I just won the Europe national lottery for one million euros. Here is the mail I got,

Sir/Madam,

CONGRATULATIONS: YOU WON 1,000,000.00.

We are pleased to inform you of the result of Europe National Lottery which was held on the 15th, March 2007. Your e-mail address attached
to e-ticket number: 834509819, with Prize Number: 237359446 drew a prize of 1,000,000.00 (One Million Euros).

This lucky draw came first in the 2nd Category of the Sweepstake. You will receive the sum of 1,000,000.00 (One Million Euros) from
our authorized bank.Because of some mix-up with sweepstake prizes, including the time limited placed on the payment of your prize: 1,000,000.00,
we advice that you keep all information about this prize confidential until your funds: 1,000,000.00 have been transferred to you by our bank.

You must adhere to this instruction, strictly, to avoid any delay with the release of your funds to your person. This program has
been abused severally in past, so we are doing our best to forestall further occurrence of false claims. This sweepstake was conducted
under the watchful eyes of 8,000 spectators. Your e-mail address was selected and came out first by a e-ballot draw from over
250,000 e-mail addresses (personal and corporate e-mail addresses).

This program is sponsored by CFI Networks to compensate faithful internet suffers around the globe. Congratulations for becoming
one of the few lucky winners.With your permission, your e-mail will also be included in the next sweepstake of 5Million.

You must claim your prize: 1,000,000.00 not later than 14-days from the moment you receive this e-mail.
In order to avoid unnecessary delays with your claim from the bank. please contact them immediately,
and quote your winning and personal information to the Bank in all your correspondence with the paying bank.

<< contact information deleted >>

Congratulations.
Angelic Van Theiry.(Mrs)
Coordinator.Europe Million Lottery Internation

But I still don’t understand why the mail is addressed to “undisclosed-recipients”. :-)

Jokes apart, these things are increasingly becoming dangerous. I have got “genuine looking” mails from ICICI, HDFC and Paypal asking for complete details including ATM pin, internet user id et. The “from id” is forged and the URL text looks genuine. The fake site URL also is very similar and they copy the exact branding! What is more problematic is that they even bypass gmail’s spam protection.

Reading Malayalam Websites in Ubuntu (non unicode ones)

Unicode fonts are the best for publishing Malayalam (my native language) content on the web. But many of the popular regional sites such as Malayala Manorama and Deepika still use custom fonts which works on ISO encoding.

In Windows, these fonts are automatically supported. When it comes to Ubuntu, what you see is a jumbled set of characters. Following set of instructions will help you reading Deepika in firefox. Follow a similar procedure for other sites.

1. Install the custom font. For Deekipa, Malayalam font can be downloaded from http://www.deepika.com/font.htm. Download this to a folder and then using terminal go to the folder. Now copy the font to /usr/share/fonts,

sudo cp mlkr0ntt_TTF.ttf /usr/share/fonts

2. Refresh the Ubuntu font cache. For that run the following command,

sudo fc-cache -fv

3. Close all firefox sessions and reopen firefox. Go to www.deepika.com. Now from the firefox menu select the following,

View => Character Encoding => Western (ISO-8859-1)

Now you should be able to see some Malayalam characters!

Installing Adobe flash player on Ubuntu 7.10

These days flash player is a must have plugin for browsers. Without it you cannot a lot of video sharing sites such as YouTube. By default Ubuntu doesn’t come with flash player since the Adobe flash player is proprietary. So I did,

jayson@jayson-desktop:~$ sudo apt-get install flashplugin-nonfree

Everything went smooth till the last step where I got,

Download done.
md5sum mismatch install_flash_player_9_linux.tar.gz
The Flash plugin is NOT installed.

It turns out that Ubuntu does a MD5 checksum check on the packages it install. Unfortunately Adobe changed the flash player installer sometime in December. So what to do?

The solution is to manually install flash player. Ensure that you close all the browser windows before doing this.

# get the flash player tar
wget http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_9_linux.tar.gz

# extract the tar file
tar xvf install_flash_player_9_linux.tar.gz

# run the installer
cd install_flash_player_9_linux
./flashplayer-installer

# specify the firefox folder during installation
/usr/lib/firefox

Thatz it. Now you can watch flash videos on Ubuntu!
This also shows why it may be better for your grandma to stick with Windows! :-)

Migrating from Windows to Ubuntu

I recently uninstalled Windows from all my machines and installed Ubuntu on them. There are two reasons for this,

1. I don’t want to buy a new Windows license whenever I buy a new machine. I already have spent over Rs. 10K on Windows licenses and is not ready to pay again!

2. Ubuntu supports all my hardware out of the box! Even WiFi cards(NetGear) and WiFi adaptors (Dlink DWL-G122)  are supported when you boot Ubuntu.

It has been a smooth transition. One of the things that I enjoy a lot is the Pidgin IM client. Now I can login to all my IM accounts at once. Hence I got in touch with old friends on some of my old IM accounts!

Here is quick re-cap of what I did,

  • Booted using the latest ubuntu release - 7.10.
  • Deleted all existing partitions on my 80GB disk.
  • Created a root partition of 6.5GB and a swap partition of 1GB. I kept these partitions below 8GB since on M2N-MX motherboard, grub is having problems booting from a partition over 8GB!
  • Installed the following software using apt-get - Java 1.6, Aptana IDE, unrar, Lyx, Ruby1.8.6 and Rails2.

I am back!

It is almost 3 months since I wrote anything on this blog! I almost forgot that I had this blog :-) It is another year and let me restart this blog. You see, that is my new year resolution :-)

I have been exploring couple of new stuff recently. I have been neck deep in Ruby and Ruby on Rails. Ruby is a very compact and expressive language. More importantly, the code you write in Ruby style automatically appears elegant.

On the rails, I have mixed feelings. From the initial look, rails looks a lot more productive than say J2EE. But when it comes to a large project development, I don’t see much of a difference. The productivity in Web applications is more dependent on your team than the technology you choose! :-)

Talking about productivity, another tool I have been exploring is the Yahoo’s User Interface toolkit (YUI). This is a great way to add AJAX capabilities to your Web application. I have been developing server side components based on these and it turned out be real good. The documentation is pretty good but there is still scope for improvement.

On the J2EE front, the new Struts framework (Struts2) is getting stable. I think the upcoming version 2.1 is perfectly suited for any Web application you are planning in future. One feature of Struts2 is the out of the box support for portlets. If you are planning on a large enterprise application suite, portlets is the way to go.