Search
Categories
Tag Archives: Oneliners
Turn off Caps Lock Key in Linux
1$ setxkbmap -option ctrl:nocaps You can add this to your ~/.bash_profile to make it constant. —.bash_profile— export PATH xmodmap -e “remove lock = Caps_Lock” —.bash_profile— To reset caps lock. enter: 1$ setxkbmap -option
Backup and restore
backup tar cvpzf /place/to/backup/user/backup-`date ‘+%Y%m%d’`.tar.gz /home/user –exclude=/home/user/.Trash restore tar xvpfz backup+++++date+++++.tgz -C /
Netcat examples
echo -e ‘GET / HTTP/1.0\r\n\r\n’ | nc -w 8 www.tic.ch 80 HTTP/1.1 400 Bad Request Content-Type: text/html Date: Fri, 23 Nov 2007 11:12:11 GMT Connection: close Content-Length: 39
Find identical files
OUTF=rem-duplicates.sh; echo “#! /bin/sh” > $OUTF; find “$@” -type f -print0 | xargs -0 -n1 md5sum | sort –key=1,32 | uniq -w 32 -d –all-repeated=separate | sed -r ‘s/^[0-9a-f]*( )*//;s/([^a-zA-Z0-9./_-])/\\\1 /g;s/(.+)/#rm \1/’ >> $OUTF; chmod a+x $OUTF; ls -l $OUTF … Continue reading