Friday, January 30, 2009

init: change the default runlevel

simply edit /etc/inittab

amanda: how to recover files from backup server

amrecover -s localhost
sethost <dns>
listdisk
setdisk <select>
ls, cd... whatever else you need
setdate <date> is also handy

Wednesday, January 21, 2009

linux: use last command to show last logged in users

The 'last' command can be used to show the last logged in users as well as where they logged in from and for how long, as well as any reboots that might have occurred, and the currently running kernel

link: excellent ssh port forwarding examples

http://www.securityfocus.com/infocus/1816

bash: sequence to display open network connections

~#

Typing this in at the bash prompt will display the connections in use by the current client session

Wednesday, January 14, 2009

bash: one line loop

for file in $(cat masterblocklist.txt); do nslookup $file | grep "name ="; done

Monday, January 12, 2009

awk: find longest 10 lines in a file

awk '{print length, $O}' * | sort -nr | head -10