Category: Uncategorized


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.

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

BOOTMGR-error

Two days before i was changing my -inx operating system in my laptop…i was changing the os from ubuntu to fc11..my 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 option..in 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 tool..so 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…

screen1

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

screen2

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…