Sunday, February 17, 2008

How to make a good password?

One time you will need to create a strong password, or a strong random number to be used as a key. The geek inside your brains will think furiously trying to avoid considering the random keystrokes on a keyboard as random. Well, here is a way to create a random password. A very random password that you will not be able to memorize, that you will need to store it somewhere, and therefore easily lose all the security gained by creating this password.

You need a working Linux shell, with the commands dd and uuencode:
dd: reads device files. A device file can be a hard drive, a webcam, any thinkable hardware, or even /dev/random, that gathers some random bits from the physical components of your computer.
uuencode: translates the binary streams into ASCII (or into base64 encoding, whatever it is).
The secret weapon here is |. This vertical bar is typed by Shift+\ on a US keyboard. It simply redirects the standard output from one program to be the standard input in another program.

In a shell, type this command:
dd if=/dev/random bs=1 skip=128 count=64 2> /dev/null | uuencode -
You will simply end up by some random characters:

mohamed@hp:~/Desktop$ dd if=/dev/random bs=1 skip=128 count=64 2> /dev/null | uuencode -
begin 644 -
MYX:E]D%;N68RRW4#KFPJ1U7"`3RIA&J^&/AB6T&#Q;_S5P'W_Q&2Q!Q#R*^"
3:GP0)@U1\4;>I@<4IW)#CC]430``
`
end
mohamed@hp:~/Desktop$

That is a good place to get your password from. /dev/random collects random bits from your hardware. dd skips 128 character of them and passes 64 character to uuencode that puts them into ASCII. Of course you can change skip or count, but take care, reading too much from /dev/random will drain the queue it has been collecting and therefore will result into stopping the program until enough randomness is collected. bs means block size, which means a block is 1 byte in this specific example. Finally, what is 2>/dev/null? dd will output a message on stderr that will probably interfere with uuencode. This redirects the stderr of dd to disappear.

You can enjoy seeing randomness from your machine by this command:
dd if=/dev/random bs=1 skip=0 count=2048 2> /dev/null | uuencode -
Executing this command too many times will drain /dev/random. Then you will see the random lines coming one after another, taking a lot of time to be generated.

Saturday, February 16, 2008

My Linux Story

It is the time to tell how me and Linux had such a romantic story, I turned to be this person using Linux all the time and advising everybody else to use it. My first memories about Linux is that my elder brother ran Linux on the PC for university needs. It was just striking to see that something works "Windows", in my point of view. But I simply could not grasp it: Where is the Computer? I can not find the "My Computer" icon or any similar stuff.

Anyway, I spent a few more Windows years. I had a newer Pentium 4 PC running Windows normally till the hard drive crashed. Windows successfully took over the boot but never completed. I could not fix it. I could not format or repartition the drive, or even reinstall Windows. I just realized that the problem is about the hard drive. I asked one of my dearest friends what to do to retrieve my data, or how to fix the problem. He gave me a couple of CDs. One of them was the Simply Mepis 6.0 live CD. The other was Ubuntu 6.06.1 live CD. To my great amazement, it worked! Well, not really, as it crashed sometimes (kernel panics) because of the corrupt hard drive, but who cares? It works! For the first time in weeks I saw it working. With the help of my brother, I knew how to mount partitions, tar archives and do some ftp. Wonderful, after that all of my data were safe. I bought a new hard disk, and for a few months I continued to be the same Windows guy.

But the long waited day came. It was near the end of the semester, exactly a year ago. My PC caught a virus. I was so sure it is because I saw a process with its user as my network neighbour PC's name. I was furious. It is unbelievable that my neighbour's viruses were allowed to be run on my PC just because I have a network cable and Windows. Another factor in my decision was the release of Windows Vista with 1GB memory as a minimum requirement. Or at least 2GB as I am a so called developer. So, they simply decided I am not eligible to use Windows anymore. It was by the beginning of the vacation that I decided to ultimately depend on Linux.

After a few questions here and there, I downloaded Kubuntu 6.10 Live CD. I ran it, checked that everything worked perfectly. Then began the installation, the hardest point to me was partitioning the drives manually and setting the mount points (very unusual for a Windows user). But if you read the second paragraph, you would have known that I mounted partitions before. So, the installation ran smoothly. One point I would like to mention is that I was worried that resizing the windows partition may ruin my data. But, after being impressed by the live CD show, I said, "Open Source is never buggy in a harmful manner". I did a resize, and that was it.

A few days of hacking with Kubuntu, asking people how to do such and such, I was familiar with it. In less than four weeks I screwed it a few times. But finally, I was on a reliable operating system that I understand.

Months after, I noticed that Kubuntu is slow (not to mention how Windows was), so I tried Ubuntu 7.04. It was a lot faster. Besides, it was the first time to see a cube and such wonderful effects with Beryl.

Now I am on my new laptop, with Ubuntu 7.10, having compiz-fusion running all the time, with all features working perfectly, thanks to Ubuntu Forums. I can comfortably say now that I am not lacking any functionality. I have not turned on a windows for a complete month, and I needn't. My new Laptop (with 2GB memory) needs at least 7 minutes to run Vista, and that is simply a waste of time. It shuts down in 3 minutes. That is, if I started Vista three times a day, I am wasting 2% of my life waiting my computer. Not even counting the amount of time due to the fact that Windows runs slowly. However, the latest Ubuntu starts in exactly one minute, and turns off in a half. And it perfectly does the job.

Now I have more than 30 Linux CDs. The distributions I have are Ubuntu, Kubuntu, Xubuntu, Gobuntu, Fedora, openSUSE, DSL (damn small linux), Mandrake, Simply MEPIS and Debian. And here goes the golden rule to fully depend on Linux:

Believe it or not, it is definitely doable in Linux, you just didn't search enough. Grasping the main ideas of Linux took me less than two weeks, just because I kept running it, and I did not return to MS Windows after the first failure.

Friday, February 15, 2008

Have a real experience of chatting

Warning: If you are a Linux user, you probably don't need to read the following.

I was amazed recently that one of my friends doesn't know an alternative of MSN messenger. The stranger fact is that he also keeps Google Talk running. If you are looking for a memory efficient, lightweight (processor efficient), and space efficient instant messenger, you have reached the right place.

Out of this result list I will pick Pidgin, my favorite instant messenger. It works on all platforms, may be used to be portable, and it really does the job. You can assign it to login with more than one account. it works with any thinkable type of accounts you have. MSN, Google, AIM, IRC, XMMP and Yahoo are the only types I can recognize from its list.

It has the default options to be available, offline or away. But, it is way better than that. You can click the status combo box to add a "status" option. A status can be, for example, online at a Google account, Chatty at the other Google account having a special message, Offline at AIM, Invisible at MSN, and Available at the other MSN having a different message. You can make as many status options as you like and describe them by names. You can have some accounts with saved passwords and ones without. Everything is doable through a very intuitive graphical user interface. A few clicks and you will really customize your instant messenger to work through a single lightweight window. Just give it a try. It even has a spelling checker. The reason warning Linux users reading this is that almost all Linux instant messengers are similar in this extensible functionality.

Anyway, I should leave you with at least one warning. Pidgin does not run audio / video chats, at least for the time being.

What to blog about?

Well, isn't the time suitable to blog? Having just finished my exams, I should post a couple of posts in this one year old, though still empty, blog. So, what to blog about? I will begin by some how-tos. It happened to me a lot that I wondered how to. Typing a how to question in Google led me many times to a blog. No wonder that there are many how-tos on the web, especially if I started writing some.