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 ...

20061122

Permission denied (publickey).

00:53:52 ssh myuser@my.domain.net
Permission denied (publickey).


If this happen, set value for ChallengeResponseAuthentication to yes.

ChallengeResponseAuthentication yes

20061121

Upgrade debian

To upgrade, change references in /etc/apt/sources.list from stable to unstable:

deb http://debian.crosslink.net/debian/ unstable main non-free contrib
deb-src http://debian.crosslink.net/debian/ unstable main non-free contrib


Then run:

# apt-get update
Get:1 http://debian.crosslink.net unstable/main Packages [1931kB]
Get:2 http://debian.crosslink.net unstable/main Release [82B]
....


Then you can upgrade by:

apt-get -u dist-upgrade

source http://www.linuxmigration.com/quickref/debian/gen.html

osx : change sshd service port

sudo perl -pi -e 's!^(ssh\s+) \d+/!$1 2200/!' /etc/services # changes it to port 2200

credit to the author.

mount linux nfs server on mac

Linux:
--------
add an export entry to /etc/exports
/local *(ro,insecure)

export the filesystems
# exportfs -r (optional: remove entries deleted from /etc/exports)
# exportfs -a

Darwin (OS X) :
-------------------
Add an entry to netinfo. This can be done from the command line or from netinfo. See http://deaddog.duch.udel.edu/~frey/...arwinAndNFS.pdf

In netinfo, under the /mounts directory, add the following:



name remoteServer:/remoteMountPoint (this is the directory under /mounts)
vfstype nfs
dir /mount_point
opts -b net -P -s

After saving netinfo, restart NFS:

sudo killall -HUP nfsiod nfsd mountd automount

from bsdforums.org

20061117

Search files for spesific string

grep -rH [string] [dir_to_search]

eg: grep -rH WebKitHistoryAgeInDaysLimit ~/Library