Friday, March 6, 2009

TCP Header.

Learn this for if you are into networking.


0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Source Port | Destination Port |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Acknowledgment Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Data | |U|A|P|R|S|F| |
| Offset| Reserved |R|C|S|S|Y|I| Window |
| | |G|K|H|T|N|N| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum | Urgent Pointer |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Options | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| data |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

TCP Header Format

Note that one tick mark represents one bit position.

Details http://tools.ietf.org/html/rfc793#section-3.1

Monday, December 29, 2008

Mood Swing

Monday
Monday monster is here, it will hunt you down, drag u by your feet, slap an early morning bath, throw u inside the cubical cell and strap u the electric chair. u can prey forgiveness but it wont listen. suffer my baby all week long. ;(

Tuesday
I was dragged, pushed, eaten and labored by Monday monster. Tuesday daemon is pinging me back.

Friday, October 17, 2008

Ubuntu - Auto mounting HDD at boot

After fidlling lot with Ubuntu finally here the sequence to auto mount HDD partitions and make them behave properly.

1. Open /etc/fstab. Add these lines.
 
/dev/sda2 /media/Vista ntfs-3g defaults,user,exec,uid=1000,gid=100,umask=000 0 0
 /dev/sda3 /media/SOFTWARE vfat defaults,user,exec,uid=1000,gid=100,umask=000 0 0


2. Make the corresponding directories in /media ( remember to mount the HDD partitions in the /media not the traditional /mnt else Ubuntu wont show it as HDD ).

3. Test the fstab success
 sudo mount -a


4. To find all the drives entries use fdisk or blkid
 sudo blkid


That's it, next reboot all partitions will be auto mounted.

Saturday, October 11, 2008

iMac defeated

Finally tweaked ubuntu to defeat the display superiority of Mac. It aint so easy since Ubuntu is as ugly as anything can be. Unfortunately connonical didnt realize that users "look" at the monitor, so looks should be pleasant. But no big deal, not everything should be done by them lets fix it.

Simply install avant-window-manager and conky to get the look.

Installation guides.
http://www.quicktweaks.com/2008/04/11/three-little-things-to-make-your-ubuntu-desktop-beautiful-and-productive/
http://www.quicktweaks.com/2008/09/27/gmail-weather-beauty-right-on-your-ubuntu-desktop/

For Mac-user's envy here's the screenshot.

Mplayer

Well sometime linux can be frustrating and when it comes to mplayer nothing can me more worse. After lots of head banging i found a simple and elegant way to do it. Simply type in the following commands and mplayer will be up n running.

1. Add mplayer repositories. For that open /etc/apt/sources.list and augment these two line.
 deb http://archive.ubuntu.com/ubuntu dapper multiverse
 deb-src http://archive.ubuntu.com/ubuntu dapper multiverse


2. Run these two commands.
 sudo apt-get update
 sudo apt-get install mplayer


3. Run Mplayer, If all goes fine you can have a gala time. But for it was not so. Mplayer took lots of loading time while disabling screensaver. I read that a conflict b/w comfiz and mplayer. So simply goto mplayer>right click>preference>misc and uncheck "Disable screensaver" stuff.

4. In case mplayer not finding video out device. open ~/.mplayer/config and search for line "vo".
Simply add the output device name like xv. Finally your mplayer conf should have something like "vo=xv". To list all supported device type `mplayer -vo help` that will list you out all the option..
 mplayer -vo help


5. Worst, mplayer's got dumb. Simply mplayer>Right click>preference>Audio Tab select "pulseAudio".

Hope this helps

Tuesday, July 29, 2008

Working with DVD/CD Images in Linux

PowerIso is a cool utility to decompress/Change format of .daa .iso images. I tried it on 2.4GB file and it worked cool for me

PowerISO Download site (http://www.poweriso.com/download.htm)

Installation Command
 tar -xvf poweriso.tar.gz
 sudo cp poweriso /usr/bin
 sudo chmod 755 /usr/bin/poweriso

Simple convertion command (.daa to .iso)
  poweriso convert input.daa -o out.iso -ot iso

Mounting ISO Images to folder
 sudo mkdir /mnt/test
 sudo mount -o loop -t iso9660 out.iso /mnt/test