Latest Entries »

Fork Bomb !!!!!

Just try this on your linux machine at your own risk….

# :(){ :|: & };:

It’s actually a shell function, look closely and it’s an unnamed function

:() with the body enclosed in {}.

The statement ‘:|:’ makes a call to the function itself and pipes the output to another function call—thus we are calling the function twice.

& puts all processes in the background and hence you can’t kill any process. Finally ‘;’ completes the function definition and the last ‘:’ initiates a call to this unnamed function. So it recursively creates processes and eventually your system will hang. This is one of the most dangerous Linux commands and may cause your computer to crash!
Remedy: How to avoid a fork bomb? Of course, by limiting the process limit; you need to edit /etc/security/limits.conf. Edit the variable nproc to user_name hard nproc 100. You require root privileges to modify this file.


You can install any linux straight from the iso image rather than burning it into a CD/DVD and then installing.. This is how you do this

Before starting, There are mainly two things needed to install an -inx flavoured os . one is a kernal (will be vmlinuz in case of ubuntu) and another is a RAM disk or initial root file system (initrd.gz in the case of ubuntu)

Step 1:  Download the iso file from website and store the image file in a    directory

# mkdir ubuntu

#  cp <image file which youhave downloaded> ubuntu

Step 2: Extract the kernal file and RAM disk file from the iso image and store in the directory. You can use any archive manager present in the os. Better use File Roller. These file will be in the /casper/ directory.

Step 3: Add an entry to your grub i.e. in the file /boot/grub/menu.lst

title Ubuntu Install
root (hd4,0)  //Here replace hd4 with your hard disk partition
kernel /ubuntu/vmlinuz
initrd /ubuntu/initrd.img

Step 4: Save and Reboot. The option for installing will come on your grub. And
When You start installing you have to select the source as Hard Disk.

My MINIX-3 Experiments – I

This weekend, while  I was reading my copy of LINUX JOURNAL (July issue) I stumbled upon a wonderful article about Mini – Unix or MINIX as it is commonly called. Although I had an idea of this OS during my college days especially while I was studying Operating Systems, I didn’t got a chance to get a hands-on experience of this wonderful small OS. Before giving you the details about the installation and other things, I will give a small introduction of MINIX’s history.

MINIX is developed by Andrew S Tanenbaum, as a  teaching  tool. This was written in C programming language and is believed to be the inspiration for Linus Torvalds to write Linux Kernel.  Although it started as a teaching tool, MINIX-3 has grown to be a full fledged OS with many features as that of UNIX. Okay enough of theory stuff and let me show you how I installed in my Dell Laptop (Inspiron 1525).

Before installing you need MINIX-3 iso image to be downloaded from this website.

Try for the latest version. MINIX-3 executes the device drivers and other modules in seperate user spaces. So if one module crashes it wont affect the entire OS contrary to the other OSes.

After downloading, You have two options either to create a partition and install MINIX-3 in it or use some Virtual Machines or emulators for installing. Anyway I went for the second one..because I already have four OS in my laptop and I don’t want to burden my lappy with a new one.

So I first installed Qemu in my Ubuntu 10.04 LTS (Lucid Lynx).. You can get the source of Qemu from the website . But it is better to install using Synaptic package Manager or apt-get


Before installing MINIX-3, we need to configure Qemu for a new Virtual machine configuration. The new configuration specifies how much hard disk space you need to allocate for the new VM, how big your VM should be etc. So in the terminal give this command

# qemu-img create minix.img 2G

This will create a VM of size 2 Giga Byte. This size is not mandatory as 2GB. You can change according to your HDD space and user will. MINIX-3 basic version will only take 64MB. Anyway allocating 2GB is good since you need to install extra softwares.


After creating the image, you can start installing MINIX-3 from the image which you have downloaded.

# qemu -localtime -net user -net nic -m 256 -cdrom <Type here the name of MINIX-3 image file (.iso) which you have downloaded earlier> -hda minix.img -boot d

This will install MINIX-3 into the minix.img file which you have created earlier using Qemu.

Here –boot d command will boot from the cdrom which in turn we have mapped with the iso image of MINIX-3.

After this you can start the installation.. Installation process will be dealt in next posting..till then Happy Programming.

Pretty simple…create a folder “.fonts” in your home directory…do remember the dot(.) before the directory name…and fire this command

$sudo fc-cache -fv

that’s it ..

happy programming


Two days before i was changing my -inx operating system in my laptop…i was changing the os from ubuntu to laptop also had windows vista in another partition….every thing went well till the booting time…when i entered into fc11it was working perfectly okay except my bluetooth headset which it was not able to detect…thats okay for me coz i already have the solution for that..(that will be my topic for the next blog)…

But when i tried to enter into windows it was showing some error “BOOTMGR is missing… Press Ctrl+Alt+Del to restart” eventhough i press the much famed ctrl+alt+del key combination it was not helping my cause…i.e. it still showed the error…

i tried my hand with reinstalling the windows vista…it also didn’t help…but in turn made my -inx partition as free space….

so after numerous attempt i was possible to find the solution for this…

if that problem occurs don’t panic…

there are mainly two methods to get rid of the problem

1) boot your computer with windows vista recovery/installation CD and go to repair options…then click on the command prompt the command prompt type “bootrec /fixboot” or “bootrec /rebuidbcd”

2) if the problem still persists as in my case…just boot up into the -inx which ever u have installed..

in the console type ‘fdisk -l’ you should see just like the picture given below..

fdisk -l

just check for the partition having “*” as you can see in my case one will be windows and one will be for linux…here get the partition number for linux (i.e. just count from the first partition starting from 0) …

check your ‘/boot/grub/menu.lst’ for the corresponding windows entry…check whether the partition  number is correct as per the value calculated by you…

that’s it…

Happy Programming….N’Joy…

while working in network programming (linux), i stumbled upon a command line -nix based tool named “tcpdump”. tcpdump is a common packet analyser that allows the user to intercept and display TCP/IP and other packets being transmitted or received over a network to which the computer is attached.

After I used it for the first time, i became so obsessed with tcpdump that i began to intercept all the packets travelling through my network, for fun..haha…

So lets start and share some of the functionalities i observed during the usage of the tool…

As I have already told you, this is a command based open a gnome-terminal and shoot the command

# tcpdump -i eth0 (as the symbol in terminal indicates you should be in root)

so if i am correct you should see this screen…


As you can see that it is listing all the packets received by you in your computer..

just take a close watch on that. The big number followed by the ip address is the port number and the symbol ‘>’ denotes the source ip address from where the packets have come. This tool will even list the data carried by each packets for this see the last part of each line.

Next, if you want more interactive viewing of the packets retreived just type

# tcpdump -i eth0 -x

you will get a screen similar to this one


here you can see the hex value of data in the packets each 16-bits grouped as column.

There are a lot of options that can be used with the tcpdump so that we can filter the particular data from a source or to a particular destination as well as from or to a particular port number…

here are some of the example

# tcpdump -i eth0 -x -p ip src <ipaddress>

will give packets having source address <ipaddress>

#tcpdump -i eth0 -x -p ip dst <ipaddress>

will list all the packets bearing the destination address <ipadress>

#tcpdump -i eth0 -x -p ip src <ipaddress1> and dst <ipaddress2>

will list all the packets bearing the src address as ipadress1 and dst address as ipaddress2

#tcpdump -i wlan0 -x

will lists all the packets if you are using wifi connection

#tcpdump -i eth0 -x port 6666

will lists all packets from port number 6666

#tcpdump -i eth0 -xmulticast/broadcast

will lists all the packets having multicast/broadcast address

#tcpdump -i eth0 -x less 120

#tcpdump -i eth0 -x greater 90

will lists all the pavkets having length more than 90 bytes

thats all ….for more updates and more options check the man page of tcpdump….

Happy Coding…N’Joy…