• ssh -o 'StrictHostKeyChecking=yes' log in to a host and ignore the complaint about it now knowing the host key signature
  • gnused --in-place=_old 's/assert(/b_assert(/g' *.php - replace assert( with b_assert( in all php files in current directory
  • find . -name entries -exec gnused --in-place=_old "s/svn:\/\/10\.8\.0\.1\(.*\)/svn:\/\/10\.1\.0\.41\1/" {} \; - fix all subversion directories to point to a new server

John's email scanner

rm applications.out
LIST=`grep -L jayates * | xargs grep -l jschmidt`

for blah in $LIST
do
   sed -n '/Name:/,$p' $blah  >> applications.out
   echo "__________________________________________________" >> applications.out
done

script to scan mail logs for missed email

# get all IDs from the mail logs that have a bounce
LIST=`less maillog* | grep 'bounced' | awk '{print $6}' | grep -oi "[a-z0-9]*" | sort | uniq`

# walk through them, grepping for all email addresses
for this in $LIST
do
   FOUND=`grep $this maillog.* | egrep -o '[^ <]+\@[^ >]+' | grep -v message-id | grep -iv "aw-confirm@eBay.com" | grep -iv "jayates1@gmail.com" | grep -iv "walshes@gmail.com" | grep -iv "member@ebay.com" | grep -iv "aw-confrim" | grep -iv "bounced@godaddy.com" | grep -iv "boxaroo"`

   if [ -n "$FOUND" ]
   then
      echo "$this - $FOUND"
   fi
done

xargs example

Find all PNG files that are interlaced, then convert them to non-interlaced. Note the -I xxx part of xargs - this means substitute the incoming stuff piped into xargs there. The {} business does not work at least on our machine, despite what Wikipedia says

find *.PNG -exec file {} \; | grep -v "non-" | awk -F : '{print $1}' | xargs -I xxx mogrify -interlace none xxx

Adding an extension to a bunch of files

for i in `ls`; do mv $i $i.jpg; done

on the Mac

  • port upgrade installed - upgrade all packages installed with the port system

Ripping DVDs on the Mac

  • use drutil status to find the device name of the CD-ROM
  • unmount by doing diskutil unmountDisk /dev/disk1
  • rip by doing dd if=/dev/disk1 of=file.iso bs=2048
  • test by doing hdid file.iso

  • burn on Linux growisofs -dvd-compat -Z /dev/hdc=/share/junk/FC-5-x86_64-DVD.iso
-- MattWalsh - 31 Jul 2007
Topic revision: r10 - 15 Sep 2008 - JohnYates
 
This site is powered by the TWiki collaboration platformCopyright © 2008-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback