Higher Logic notes on screwing with tech…

System Commands

Some linux commands are useful as a button, but I could never bring myself to remember them. In no particular order :D

# SSH to multiple boxes and run commands same commands at the same time
cssh server1 server2 server3 server4
csshX server1 server2 server3 server4 #osx friendly version

# Awesome system utility to travel back in time and see what went wrong
atop -r /var/log/atop/atop_20090324 -p -b 22:00 #what happened @10pm

# What is your pesky server up to?
iftop -B -i ethX

# What/who/why... holding onto my stuff?
lsof -i udp:8085
lsof -u user
lsof -p pid

# Got your RAID on battery backup and don't need the periodic file system checks?
tune2fs -c 0 -i 0 # disable interval checks

# Want some colours when tailing your logs?
apt-get install loco
apt-get install lwatch

# Just what type of RAM modules does your server really have?
dmidecode --type memory

# Grep for multiple patterns with 'or' logic
egrep 'yy|xx' testgrep.txt

# Creating CD/DVD images then burn them
mkisofs -o /tmp/cd.iso /tmp/directory/
cdrecord dev=/dev/cdrom driveropts=burnfree -v -data cd_image.iso
growisofs -dvd-compat -Z /dev/hdc=dvd.iso

# Grab all of those pesky ruby processes
killall -s -6 ruby

# Label those annoying USB stick/HDDs
sudo mlabel -i /dev/sda1 -s ::
sudo mlabel -i /dev/sda1 ::NEW_LABEL
#remount it

# Set your custom prompt
export PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'

Comments (0) Trackbacks (0)

No comments yet.

Leave a comment

No trackbacks yet.