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.
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.
defaults write com.apple.Finder AppleShowAllFiles TRUE
Stop Steve Jobs hiding files from you.
svn log -v -r 1178
Where revision number is 1178. For more svn info read the online subversion book.
svn log | sed -n ‘/pxg/,/—–$/ p’
The above code will show all entries in the log for the user pete.
ls -lt
Or you can flip reverse it:
ls -ltr
:%s/pete//gn
In the above example we are looking for the number of matches for the word “pete”.
pwd -P
Use the physical flag luke!
sudo /Library/StartupItems/MySQLCOM/MySQL stop
defaults write com.apple.dock no-glass -boolean YES; killall Dock
PHP monitor server log
Occasionally you'll be working on a webserver and not have SSH access to it. Below is a simple script I've written that reads a server log (in this case the error log) and outputs a portion of it to a webpage.
Obviously in a production environment you'd want to add some sort of password protection to such a script.
/* Pete Graham */