Just a thought

Archive for April, 2009

Typewriter Vs Computer | Windows Vs Linux

Posted by stringofthoughts on April 30, 2009

Windows Vs Linux seems like a never ending debate. I prefer Linux but I do use windows for playing games. Although now with Crossover office it’s possible to play PC games on Linux. So now Linux is getting better and better. I always ask my friends to switch to Linux and use open source softwares but they are too much of windows fan and stupid. I mean one of ’em don’t even mind virus as long as everything is done peacefully with double click. That’s his arguments that in windows you can do everything by just double click where as in Linux you need use shell and you need to remember commands and seems like too much work. There was a time when it was true. Most of the task required the use of CLI (Command Line Interface) but now things have changed. With Ubuntu and Gnome the desktop is more user friendly than ever but people are still reluctant to use it. The most important feature of Linux, security, is often overlooked because of a slight confusing desktop. A new user don’t see the security features of Linux right away what he really sees is how it looks. Earlier it looked kind of dry but today with Compiz nothing can even come close to possibilities the way we cam tweak our desktop.

To me this looks very similar to the time when computer came and started to take over typewriters. Using a typewriter was very easy Put the paper in and go ahead. Nothing can be easier than this. Then slowly computers starts to replace typewriters. There must have been challenges to educate people with the concepts of files, directories, saving, moving . copying , where exactly the file is inside the system. What a shame we need a external printer to print. It is so hard. How do you connect computer and printer. There are so many wires. Come on ….. This is way to much work. I’m gonna stick to my typewriter. But then computers + printers started to print multiple copies in minutes it caught everybody attention. No need to type again and again. No need to keep track of fat files biting dust on old shelves. Magical things were happening and slowly people realized the importance of computer and look at ’em now. A five year old could computer like a toy.

Windows Vs Linux is quite similar to Typewriter Vs Computer but in software domain. There are unimaginable things you can do in Linux, something windows can’t even dream of. In the present world the most important thing is securing your data. Why do you think government organizations mostly use Unix/Linux ( because it’s free and they don’t wanna spend funds ๐Ÿ˜› )? Linux is a blessing for education, embedded sector, computing, it’s everywhere.ย  People are just started to get to know it and I’m very sure someday It’s gonna replace windows completely. It is similar to the computer( + Internet) which has changed our life. The same thing is happening again with Linux ( + Open source) and it’s gonna change the world again. A world with freedom. A world with Quality tested softwares by millions of users. A world of sharing which will bring true harmony to the world.

Posted in Linux | Leave a Comment »

Daughters for sale

Posted by stringofthoughts on April 30, 2009

Selling daughters for money…… What a shame, How could someone do something like that … This is the kind of thoughts that to our mind when we read about such news reports. Recently another case surfaced but this was a little different this time the child was Rubina, yes the Oscar child. Google it you ‘d find tonnes of links. This incident of Rubina is very common to hundreds of other cases that people read about with morning tea and forget by the time they reach office. It just became top news for obvious reason.

Most of the people who comment that these incidents are awful and blames everything on parents, don’t and can’t really put themselves on such situations. Not that I agree these incidents are ordinary but people do awful things in desperate situations. I’m ruling out greedy people in this post because there is no second guess that those people are pure evil.

People who are generally convicted in such cases live below poverty line. If you ever go a slum you’ll see these people live the nightmare we so called educated and civilised people can’t even imagine. They don’t ‘ve the life , education , social and family relations like others. What i’m trying to say here that the act of selling child is not a sudden decision it’s a result situations and events of their past. They are also human. They wants certain things life like anyone else and they also make mistakes.

Let’s look at the expenses specially for a girl child. Lot of initial expenses are quite the same for a boy and girl child. Starting from pregnancy mother needs special care then medical/hospital charges, then handling a new born till she becomes 5yrs old, now school charges, teenager’s constant request for new stuffs, School/college is mainly out of the picture for a girl child in these areas then comes the most difficult time, marriage. It takes a heavy financial toll on girls family. Although dowry cases are reduced in India but it still exists in dark corners of country. Just Imagine what kind of society and family will they be marrying off their daughter. It’s the same society among the same people who live in similar situation. For a boys family sometimes this is like lottery and this is also the result of the way they ‘ve lived their lives. They didn’t ‘ve a lot and now they have a chance to get things. Social stigma of husband leaving the wife makes wife’s family agree to their terms which is mainly money and other items.

These incidents against girls child also exist in middle and even higher class of society. Sometimes even the women in family consider a girl child bad luck. Selling daughters is just where people have shortage of money. In some cases they commit suicide or they family commits suicide in other cases they sell daughters/babiesย  and the worst I ‘ve read is when a teenager daughter was raped because her father couldn’t pay the debt. It’s a f**ked up society. During Tsunami I read reports of mothers selling their babies for merely Rs 2000 ( $40). Sad but if you think about they didn’t really have a choice. There is nothing to eat, no home , no cloths can you imagine taking care of a baby in such conditions. I know a lot of people will disagree but it’s desperate move and situation must have gone out of control for someone to take such steps. so we can’t judge any of these.

You know people see these as such heinous crime but people have been giving away child for adoption for a long time.ย  There are cases where adopted children are abused.ย  Surrogacy would be wrong to some people. They might feel how could you give away a child you carried. But selling daughter sounds really bad doesn’t it. For an actual transaction mostly parents are told that their daughter will taken care of (something like adoption) and if she is young then proposal could be in the disguise of marriage proposal either way family and parents most of the times see this as a win-win situation. Their daughter is going to a better place and they are getting financial support. Really if you look through their eyes it seems like a very good offer.ย  So why not ?

Saving these girls and prosecuting guilty greedy people is important and my whole point of this post is that people are desperate and they’ll do anything to survive.ย  Nobody knows what they would do unless they are subjected to such situations.We are no one to judge anyone.

Posted in India | Leave a Comment »

Package installation after re/new install (Ubuntu)

Posted by stringofthoughts on April 29, 2009

Re installation is a headache but what’s more painful is the package installation all over again. You had a lot of softwares installed in your system and now you have to do it all over again. Funny thing is sometimes it’s hard to remember all the softwares. I did this after my every new and re-install and it’s very time consuming and more frustrating. But, with Linux you learn new things everyday, which is why Linux is so much fun to use. I recently learned that I could avoid all this by a few simple commands :).

$ sudo dpkg –get-selections > myPackages

This will make a list of all the installed package in your system and store it in a file. Nice ๐Ÿ™‚ now we ‘ve a complete list of packages that we’d need after say re-install.

Re-install the system and use this command to get everything back the way it was without wasting any time and getting frustrated.ย  (Make sure you keep myPackages in some other drive before re-installation :P)

$ sudo dpkg –set-selections < myPackages && sudo apt-get dselect-upgrade

This takes the packages from list and installs just like it was before re-install.

See how easy things are in Linux when you know exactly how to use it.

Posted in Linux, tips 'n tricks | 2 Comments »

Epiphany : The ultimate GNOME browser

Posted by stringofthoughts on April 28, 2009

The first time i saw epiphany browser when i installed Debian Lenny on my system. I didn’t know anything about this browser. I thought may be it’s just like lots of other available browsers. Later when i installed Ubuntu 8.10 the default browser i had was Mozilla firefox. I don’t think mozilla needs any description. It’s one of the best browser. I use only firefox when I’m in windows and it works awesome but in Linux it’s a different story. My experience with firefox in Linux is not very satisfctory. There is a font issue and then there is a major issue of CPU usage. I can’t say about others but firfox takes a lot of CPU , sometimes even above 90% . It practically hangs the system. Font issue was solved by installing msttcorefonts. Then I searched for linux browsers and i got the name Epiphany. I remembered it from Debian so I thought this should be good it’s default browser for Debian. So I installed epiphany and my first reaction was woo …. what the #@!& . The browser was simple but it had no controls, nothing. No forward backward buttons , no refresh or stop and no address bar ๐Ÿ™‚ . I was like … what kind of browser is this.ย  So i uninstalled it.

Few weeks later again because of CPU usage problem in firefox I again installed Epiphany and this time i was in for a treat. Epiphany is so customizable and simple i couldn’t believe it.ย  For a new user after starting epiphany go to customize toolbar (View -> Toolbars -> Customize toolbars)

epiphany

Here the first this you do is Add a New Toolbar and close it. Then go to (View -> Toolbars -> show toolbar). Again Open this Toolbox editor (View -> Toolbars -> Customize toolbars) and simple drag the control buttons out from Toolbox editor to the newly created toolbar. Arrange it the way you want, keep the controls you want.ย  It doesn’t ‘ve a Goggle search bar but you don’t need it, just tye whatever you want to search in the address bar and enter. Address bar itself works as Goggle search bar.

The fonts in Epiphany is much better than firefox. Although I did tweak some settings like font size etc. Epiphany doesn’t ‘ve any proxy settings it uses the system proxy setting which you can set from (System -> Preferences -> Network Proxy).ย  If you have flash-nonfree support installed the youtube works like a charm. The main satisfaction that i got from it was the CPU usage compared to mozilla. Epiphany is much lighter and takes very CPU.

So now I’ve switched completely to Epiphany. No more mozilla in Linux for me ๐Ÿ™‚

Posted in Uncategorized | Leave a Comment »

Booting Linux from NTloader (Windows bootloader)

Posted by stringofthoughts on April 27, 2009

Hmm …. The first thing comes to mind when you see a topic like this one is why? why would anyone wanna do that ? Grub is way to awesome than NTloader and also NTloader is not designed to load anything but windows. Well lets just say for the sake of learning and a tip for very highly unlikely situation where you ‘ve a dual boot system and GRUB is not able to boot windows. In such a situation you can modify NTloader and boot Linux from windows boot loader and yes it’s true. I didn’t believe it myself at first, that’s why it’s so much fun learning new stuffs.

so here is what you ‘ll do. Assuming you ‘ve windows on /dev/sda1 and Linux on /dev/sda5. Linux and windows could be on separate disks.

$ sudo mount /dev/sda1 /mnt

$ sudo dd if=/dev/sda5 of=/mnt/ubuntu.bin bs=512 count=1

the dd command is a low-level copying tool. It copies a file and covert and format the data according to the options like bs and count in the above command. The command copies first 512 bytes to a file named ubuntu.bin .

Next you need to modify boot.ini . Assuming user has XP installed on his system.

$ sudo nano /mnt/boot.ini

and at the end of the file but in the new line (don’t leave a blank line in between) add this

C:\ubuntu.bin=”Ubuntu”

Save the file. Now you need to change the HDD priority and make the first boot device the disk which has XP installed in it. This time instead of booting directly inti windows it should show a menu with ubuntu as an option. Try booting ubuntu. If everything is fine change /boot/grub/menu.lst. There is a line #hiddenmenu change it to hiddenmenu (Just remove #).

That should do it. ๐Ÿ™‚

Posted in Linux, tips 'n tricks | Leave a Comment »

Booting XP from second drive

Posted by stringofthoughts on April 27, 2009

I’ve 2 IDE disks in my computer. I used to have all my OS installed in one disk and use the other one as data disk. The problem was when say gurb fails or HDD fails i loose both OS simultaneously and that’s not a good situation cuz life without computer and internet sucks. So I installed Linux on one drive and XP on other but now there was another problem. See Linux was in my master drive and XP on slave drive. The problem with XP is that it need to be in the primary disk to be booted. So it can’t be booted from grub just by chainloading NTloader. The other option was to modify NTloader to boot linux from it, but the catch here is NTloader is not designed to boot anything but windows (typical behavior of Microsoft, thinks windows is the only OS). So for past 6 months i’ve been switching HDD priority in BIOS to boot into the OS i want. It’s not a very good way to go but it worked for me. Initialy it was a little annoying but later it became a habit.

Recently i found out that it’s possible to boot XP from the second drive using grub as primary bootloder. I’ll explain. My 2 IDE drives are connected to Primary IDE channel. Disk1 say (hd0) is Master drive and has linux+grub installed in it. Disk2 say (hd1) is slave drive with windows XP and it’s bootloader installed.

Disk1 (hd0) Linux Master_drive
Disk2 (hd1) Windows Slave_drive

From sudo fdisk -l I got windows installed in (hd1,0)

I added these lines to /boot/grub/menu.lst

title Microsoft Windows XP Professional
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1,0)
makeactive
chainloader +1

I’ll explain the commands. For windows to boot it should be on the primary disk. Map command virtually switches the primary and secondary disks. Something that we do physically by changing the jumper settings or putting drives in cable select mode.

map (hd0) (hd1) // mapping primary disk hd0 to secondary hd1
map (hd1) (hd0) // mapping secondary disk hd1 to primary hd0

Remark :: map command doesn’t work if your SATA drive needs special drivers.

After these commands now the slave drive with windows XP is the primary drive. rootnoverify (hd1,0) sets the GRUB’s root device, makeactive sets the active flag in the partition (hd1 in this case), chainload loads windows bootloader.

This is also possible with two SATA disks but if your system has one SATA and one IDE then i can’t say it would work. This was the problem posted on ubuntu forum from where i learnt about booting windows from second drive but it didn’t work for 1 SATA and 1 IDE drive.

Posted in Linux, tips 'n tricks | Leave a Comment »

Tasksel (Bundled software installation, Piece of cake)

Posted by stringofthoughts on April 19, 2009

A friend of mine needed help in web design, he asked me so I started looking for LAMP bundle in ubuntu. Earlier I had worked on XAMPP in WinXP. I couldn’t find the package lamp.deb or lamp-server.deb something like that but i did find something interesting, Tasksel . Tasksel is awesome. It groups software packages by tasks and provides easy way to install all the packages needed for that task, for example in LAMP software bundle we need Apache, MySQL and PHP so we ‘ll need to install all these packages separately, but not with Tasksel. Another example is say DNS server. I have no idea what packages are needed to install a DNS server, but using tasksel i just choose to install DNS server and it takes care of everything else. Pretty cool huh!

Tasksel is an integral part of debian so I’m gonna give another example of usefulness of Tasksel. suppose you want to install debian but all you ‘ve is first CD or may be you want to install in very short time. This is what you can do ๐Ÿ™‚ . Do a basic debian installation (No desktop environment, installation time is very short) now you do

$ sudo tasksel

tasksel

from the menu just choose whatever desktop environment you like XFCE, GNOME, KDE . The available task list is available as you see in the screenshot. you can get the installed list by

$ sudo tasksel –list-tasks

If you want to see the packages bundled in the task

$ sudo tasksel –tasks-packages <task name>

Another interesting thing i found was that tasksel is also included in Ubuntu and you can do the same thing by apt-get if you know the tasks name :). like say we want to install a lamp-server (LAMPLinux, Apache, MySQL, PHP)

$ sudo apt-get install lamp-server^

Don’t forget the carrot (^) at the end.

Who says installing software is difficult in Linux ๐Ÿ˜€


Posted in Linux | 1 Comment »

Auto mount windows drives at startup (Ubuntu 8.10)

Posted by stringofthoughts on April 16, 2009

I have been trying to do auto mount of drives at start up but in ubuntu there is a lot of problems in mounting drives from command line. It works by all means but there is so many problems like mounting drives in /mnt directory. When your mount point is in /mnt ( or any other directory in / like /windows) mounted drives disappears from the side bar.

The other thing that i wanted was to retain the nice right click unmount facility available in ubuntu. But when the drives are mounted from command line then right click -> unmount doesn’t work.

This really helps if the mount point is same as the label of the drive. It helps in understanding where are the files are like if you have a drive labeled “Movies” you would like a mount point like /mnt/Movies or /media/Movies but if there are many drives then making all these mount points is really tiresome.

The script I ‘ve written does everything for you and it also retain the nice right click facility provided by ubuntu.

Download the script from here mount_win_drives . ( This script is only tested on Ubuntu 8.10.ย  Download link for new version is at the end of the post )

It’s a doc file so make a file “mount_win_drives.sh” and copy paste the content of doc file in it and save it. Now your script file is ready. Do the following steps.

1) copy mount_win_drives.sh to /etc/init.d

$ sudo chmod +x mount_win_drives.sh

Before updating the runlevel just run the script to check it’s working alright. You might see error msgs if the drives are already mounted.

$ sudo ./mount_win_drives.sh

If it’s working, update the runlevel to make it work at startup.

$ sudo update-rc.d -f mount_win_drives.sh start 99 2 3 4 5 .

That’s all. The next time you’ll boot your drives will be already mounted and ready to use and the right click utility of gnome-mount / gnome-unmout t is also working perfectly .

Have fun ๐Ÿ™‚

I’ve modified the existing script to work with any debian based linux distro. The older version was only tested in Ubuntu 8.10.

Download the new script from here mount_win_drives_new .

Posted in Linux, tips 'n tricks | 6 Comments »

Adding / Removing Shell scripts (Ubuntu 8.10)

Posted by stringofthoughts on April 16, 2009

I’ve been trying to add a auto mount script to mount all my window drives at startup. After searching for a while and testing few test scripts I finally found out how to add scripts at startup and how to remove scripts.

Adding a script

First of all write a script :), say test.sh and put it in the directory /etc/init.d . Next we need to make it executable so.

$ sudo chmod +x test.sh

You can check if the script is working by issuing

$ sudo ./test.sh

Assuming the script is working as expected, to make the script run at startup / reboot.

$ sudo update-rc.d -f test.sh start 99 2 3 4 5 . // Run at startup

$ sudo update-rc.d -f test.sh start 1 0 6 . // Run at reboot

Just a reminder there is dot (.) at the end of command.ย  Don’t forget that ๐Ÿ™‚ . Now you are done adding a script to run at startup.

Removing a script.

Just a reminder for new users, don’t just go to /etc/init.d and delete the script file ๐Ÿ™‚ that wouldn’t help and may cause you trouble. We need a nice little app called rcconf ( Debian runlevel configurtion tool)

$ sudo apt-get install rcconf

then run rcconf (only root can run rcconf)

$ sudo rcconf

rcconf1The inteface is very simple. It lists the scripts so all you need to do is find out where is your script and toggle “*” using space barย  and then select OK. That’s all. The script is now removed but still present in the directory /etc/init.d but you can safely delete it now.

Posted in Linux, tips 'n tricks | 7 Comments »

Guns don’t kill people … :)

Posted by stringofthoughts on April 7, 2009

Guns don’t kill people, people kill people. This is what someone who is in favor of guns might say :).ย  Well i agree with this to some extent but here what i think guns do. If there were no guns and someone depressed, angry and just wants the world to feel his pain. What would he do ? He might use his hands or say a bat/stick or knife but you know he might be able to hurt 2 may be 3 people like this before cops come in and also it’s kinda hard to commit suicide with a bat :P.ย  Now put a 9mm or a sub-machine gun in his hand.ย  The number of victims increases drastically and it’s way to easy to commit suicide with a gun. Gun works here as a catalyst and consumes a lot more innocent lives.

The first time I ever heard about a civilian shoot out out was the Columbine high school incident. Before this i don’t think i could even imagine something like this happening inside civilian world. The most amazing thing that I found in that documentary by Michael Moore was the number of people dying of gunshot in US. It was 11,127. So many things i found funny in that documentary. Guns at bank ๐Ÿ™‚ , Bullets in barber shop and then at the end I was shocked to find out that they used to sell guns and bullets in K-Mart. I mean come on that was like the height of irresponsibility.

There were people in the documentary who were saying it’s their right to carry a weapon, it’s American to carry a weapon. I don’t understand it. May be it’s the power thing. A gun in the hand makes you feel powerful. Is that the reason or what ? I would never know. One thing i know for sure that US now can’t get rid of it’s gun control problem because they have let it spread beyond control. I can’t believe carrying a gun is a part of their constitution :P.

Look around you what’s happening now. People on the verge of breakdown , recession , depression they just want to vent their anger on to the world on to the society. In such fragile situation guns and bullets are lying around :|. Probably not a good idea :). Recently so many incidents were reported. People walking down the street getting shot, attending classes or shopping. I think if you are in US you never know when might get shot.

Posted in World | Leave a Comment »