20061229

classful addressing

00000000 - 01111111 = class A = 1.xxx.xxx.xxx - 126.xxx.xxx.xxx
10000000 - 10111111 = class B = 128.xxx.xxx.xxx - 191.255.xxx.xxx
11000000 - 11011111 = class C = 192.xxx.xxx.xxx - 223.255.255.xxx
11100000 - 11101111 = class D = 224.xxx.xxx.xxx - 239.x.x.x
11110000 = 11110111 = class E = 240.xxx.xxx.xxx - 247.x.x.x

20061218

Safe kill procedure

kill pid (sends a TERM, wait 5 seconds)
kill pid (yes, try again, wait 5 seconds)
kill -INT pid (wait for it)
kill -INT pid (damn, still not dead?)
kill -KILL pid (same thing as -9)
kill -KILL pid (something is wrong)


If the process is still running, then stop sending it signals. It's either stuck in I/O wait or it's Defunct. 'ps auxw | grep processname', if you see it's in state D, then kill its parent process (the 3rd column of 'ps -ef' is the parent pid). If it's in I/O wait, then you have a deeper system problem. Most home users will never have this problem.

Credit to Hawkwind

20061217

tar and gz/bz2 in a line

tar -cf - file_to_pack1 file_to_pack2 ... | gzip -c > packed_files.tar.gz

tar -czf packed_files.tgz file_to_pack1 file_to_pack2 ...