Making a staging database with sed
Quick one - thought was was cute and useful. I take a copy of live databases once in a while for use in the staging environments, but some apps have references to the live url in the there (Wordpress does this and makes all its redirects using it, making it particularly difficult to test in staging).
This is a simple little way to change all the urls in the db as you clone it: