Updated November 20, 2004
Created November 20, 2004


Autogenerated Site Map
Search this Site!:
Search this site powered by FreeFind
Having fun with spaces in the filename or directory name? Here's your answer:
find . -type f -name '*jpg' | grep " " | while read REPLY; do
     tar -cf - "$REPLY" | (cd /tmp/jpg && tar -xvf -)
done
Want to copy all jpgs to 1 directory without overwriting:
find . -type f | while read REPLY; do
     cp -a "$REPLY" /tmp/jpg/`echo $REPLY \
       | sed -e 's/ /_/g' -e 's/\//_/g' -e 's/^\._//'`
done
Want a changing background:
# Sequence through all pics in 1 dir, not random, you can 
# pick the starting point by setting COUNT outside the
# while loop. Choose from centered, stretched, scaled and 
# wallpaper.  Issues are that not all pics work great
# with just 1 setting.  See the hacks link below for a 
# working perl script that works randomly.
COUNT=0
while :; do
     COUNT=`expr $COUNT + 1`
     gconftool-1 -t string -s /desktop/gnome/background/picture_filename \
       /tmp/jpg/`ls | head -$COUNT | tail -1` /desktop/gnome/background/picture_options centered
     sleep 1
done
Note, you will have trouble changing your background with the background changer (right click on desktop) after running gconftool. Setting default background does work, but you can't choose your own. Probably a logout, login would fix that. Just a word of caution before you get too carried away.
http://gnome-hacks.jodrell.net/hacks.html?id=6

Got a windows screensaver that has some nice pictures you like? Want to make them your background?
scripts/screensaver-stripper-jpg.sh

Rotate a jpg - I create a rotate90, rotate180 and rotate270 for the following:
#!/bin/sh
for X in $*; do
        DIRNAME=`dirname $X`
        BASENAME=`basename $X`
        mkdir -p $DIRNAME/convert
        mv -i $DIRNAME/$BASENAME $DIRNAME/convert/$BASENAME \
        && jpegtran -trim -rotate 90 $DIRNAME/convert/$BASENAME > $DIRNAME/$BASENAME \
        && touch -r $DIRNAME/convert/$BASENAME $DIRNAME/$BASENAME
done
mkdir regulardir
rsync -avx --progress -e "ssh user@domain.com ssh root@192.168.0.3" --include "*/" --include "*jpg" --include "*JPG" --exclude "*" ":/sourcedir" regulardir/
mkdir viewdir
find regulardir/ -type f | while read; do ln -s "../$REPLY" "viewdir/`echo $REPLY | sed -e 's/\//_/g'`"; done
Search this Site!:
Search this site powered by FreeFind

Homepage: http://www.cpqlinux.com
Site Map: http://www.cpqlinux.com/sitemap.html