Monthly Archives July 2010

MySQL: Dump DB with todays date in filename

mysqldump -uUSER_NAME -pPASSWORD DB_NAME > DB_NAME_`date +%Y%m%d%H%M%S`.sql
I love a good dump me. This will dump schema and data.

OS X: Show all files

defaults write com.apple.Finder AppleShowAllFiles TRUE
Stop Steve Jobs hiding files from you.

svn: list files changed in a revision

svn log -v -r 1178
Where revision number is 1178. For more svn info read the online subversion book.

svn: show commits for particular user

svn log | sed -n ‘/pxg/,/—–$/ p’
The above code will show all entries in the log for the user pete.

Linux: List files by time

ls -lt
Or you can flip reverse it:
ls -ltr

Vim: Find number of matches in a file

:%s/pete//gn
In the above example we are looking for the number of matches for the word “pete”.

Linux: pwd show real location (not symlink)

pwd -P
Use the physical flag luke!

OS X: Stop MySQL

sudo /Library/StartupItems/MySQLCOM/MySQL stop

OS X: Remove 3D Dock

defaults write com.apple.dock no-glass -boolean YES; killall Dock