979Batch Rename Files with rename

Batch renaming files on the command line, in this case screenshot to more descriptive names:

brew install rename

Dry run:

rename -n -e 's/Screen Shot/w2_OpenSCAD/' -z  *.jpg

Replace, remove the -n flag:

rename -e 's/Screen Shot/w2_OpenSCAD/' -z  *.jpg

-z does sanitize the file name, replacing empty spaces with _.

849Resetting brew

From http://codesandnotes.com/how-to-reset-homebrew/
Recently I had some trouble updating my Homebrew install and while I do like digging into the perfect solution sometimes an easy fix is all you need. These commands will overwrite your local brew with the latest from Git and do a hard reset on your local install, essentially clearing everything. Copy and run these lines in your shell one after another. If it says ‘remote origin already exists’, just continue.
# change to your brew directory
cd `brew --prefix`

# same as
cd /usr/local

# hard reset git
git remote add origin https://github.com/mxcl/homebrew.git
git fetch origin
git reset --hard origin/master