CodeWiki : UsefulOneLiners

WikiHome :: List Pages :: Login
cmantito.com

Revision [356]

Most recent edit made on 2009-03-12 23:33:26 by cmantito

Additions:
rsync -va --exclude=*.m4v --exclude=*.m4p --rsh=ssh Music/iTunes\ Library/iTunes\ Music kevin@192.168.x.x:Music/


Deletions:
rsync -va --exclude=*.m4v --rsh=ssh Music/iTunes\ Library/iTunes\ Music kevin@192.168.x.x:Music/




Revision [355]

Edited on 2009-03-12 23:30:15 by cmantito

Additions:
Sync my iTunes library FROM the MacBook TO the Linux box's Banshee library:
rsync -va --exclude=*.m4v --rsh=ssh Music/iTunes\ Library/iTunes\ Music kevin@192.168.x.x:Music/




Revision [188]

Edited on 2008-10-19 13:27:59 by cmantito

Additions:
Simple BASH forkbomb >:)
:()(:|:&);:




Revision [187]

The oldest known version of this page was edited on 2008-10-19 11:29:03 by cmantito

Information


Useful one-liners for various things, I like to keep a repository of them for quick reference. Maybe you'll find some useful too.



One-liners


If you have a couple dozen DSCxxxx.jpg photos that you need to be renamed sequentially (or any file for that matter), like I often do, this'll do..
(change $c.jpg to whatever extension the files should end in, you can also apply arguments to ls -1 as necessary.)
f=$(ls -1); c=0; for i in $f; do mv $i $c.jpg; c=$(echo $c + 1 | bc); done


Strip large chunks of pesky comments from dist-default sample config files:
cat httpd.conf | perl -e 'while($a=<STDIN>){if($a !~ /^\s*#/){if($a ne "\n"){print $a;}}}' >httpd.conf.nocomments

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki