Skip to content

Instantly share code, notes, and snippets.

View sangeth's full-sized avatar

Robert O'Farrell sangeth

View GitHub Profile
## Terminal :: Retrieve a Postgresql dump from a remote server
ssh user@host "pg_dump db_name | gzip" | gunzip > db_name.sql
## Terminal :: Replace deprecated concat-binding with concat
grep -Rl "concat\(.*binding\)" * --exclude=*.{svn,log,svn-base} | \
xargs sed -e 's/concat(\(.*\),binding)/concat \1/g' -i .tmp
## Subversion :: Remove unversioned files from working copy
svn status --no-ignore | grep '^\?' | sed 's/^\? //' | xargs rm -rf
## Terminal :: Recursively remove tmp files
find . -name "*.tmp" -exec rm -rf {} \;
## Terminal :: Search for and replace text in a file
grep -Rl "locals\[" * --exclude=*.{svn,log,svn-base} | \
xargs sed -e 's/locals\[/local_assigns\[/g' -i .tmp