14:48 30/07/2008

clifoo 3: display the 10 largest files or folders in current folder

in

snoopy log$ du -sm * | sort -nr | head

11:33 04/06/2008

clifoo 3: use ssh and tar for secure transfer

in

The following will transfer a folder called openbsd_test from snoopy to droopy. The transfer will be secure by ssh and compressed/decompressed on the fly by tar and gzip. The decompression is redirected to /srv/vmware/ to prevent filling up my home directory.

snoopy vmware$ tar -zcf - openbsd_test/ | ssh droopy tar -zxvf - -C /srv/vmware/

11:09 22/04/2008

clifoo 2 - mass but selective svn add

Recursively add all current files and folders not maintained in svn, to the repository:

snoopy$ svn status | grep '^?' | awk '{print $2}' | xargs svn add

15:15 02/04/2008

clifoo 1 - ssh and loops

ssh "eats" standard input when run in a shell loop:

tom@snoopy:~$ while read host
> do
> ssh $host cat /etc/issue.net
> done << EOF
> snoopy
> droopy
> pluto
> EOF
Debian GNU/Linux lenny/sid

-n prevents this annoying default behaviour
tom@snoopy:~$ while read host
> do
> ssh -n $host cat /etc/issue.net
> done << EOF
> snoopy
> droopy
> pluto
> EOF
Debian GNU/Linux lenny/sid
Debian GNU/Linux 4.0
Debian GNU/Linux 4.0

Syndicate content