Tuesday, June 16, 2009

Virtual Serial Port

How did I start to play around with it? It all began when a friend of mine was asking me for a favour to help him develop a simple software to communicate to another software thru serial port. My laptop doesn't have a serial port (of course, unless it was a very very old laptop) and I only have one usb to serial converter.

My first idea is to buy another usb to serial converter and a null modem cable to connect 2 laptops, thereby I can test the serial communication. Another idea is to use my old desktop (I have one and lent it to someone and actually forgot about it until I need it) but I don't think it is easy to do.
Then today at the office, asking my friend and he gave me one brilliant solution called VIRTUAL SERIAL PORT. I never heard it until today and my oh my... it is the solution to my problem (Thanks Adhi).

Googling around and I found one free driver (http://com0com.sourceforge.net/). Easy to install and I think I don't need to setup anything more, unless I need to configure another serial port pair. One thing lacking is the GUI to configure the ports. Anyway, it's free and open source, I couldn't be happier.

Friday, June 05, 2009

Turning Toshiba Satellite illumination led off

The first time I got my Toshiba M300 (actually it's not mine, it's my office's), I love to see all the LEDs light up the laptop.



Not until a week that it already bored me to see my laptop lights up as if it was a festival. Then to my dismay, I found out that turning off the LEDs wasn't easy (I did manage to turn it off though).
My colleague buying the same laptop as mine, also find it difficult and he did ask me how.

Today, someone asked me (she's using toshiba also) how to turn the LED off and gladly I told her and write in this post on the how to.

1. Press fn button and click on the rightmost button


2. Click on the HWSetup button


3. Go to Illumination tab and select Off and click OK. You're done.

MD5 hash

This morning I read a blog discussing about how to keep a secure password. The usual way to store a password is first to hash it using MD5 hash and store it in a db. The benefit of using MD5 is you cannot do a reverse-hash.

Here's how you code it in Java :

MessageDigest md = java.security.MessageDigest.getInstance("MD5");
md.update("your password here");
byte[] hashed= md.digest();


To convert it in hex, here's the code (actually I got it from here):



One more tips, for better security, you might consider to add salt before hashing the password to make it less vulnerable. The changes looks like this :

md.update("The salt" + "your password here");

"The salt" here should be created dynamically and stored it along with the hashed password to be used later.


An excellent post on secure password scheme could be found here.