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.
¶
Posted 09 July 2010
† Pete
§
‡
°
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”.
¶
Posted 09 July 2010
† Pete
§
‡
°
Tagged: vim
pwd -P
Use the physical flag luke!
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.
PLAIN TEXT
PHP:
$no_lines = 25;
$filename = $_SERVER['DOCUMENT_ROOT']."/../logs/error.log";
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
fclose($handle);
$contents [...]
Everyone hates spam, I hate it even more than most people. If you put an email address on a website, as a mailto hyperlink, then it's likely that spam bots will find this address and start sending annoying emails.
One way to get around this is to use a clever technique which I discovered over at [...]