Skip to content

Instantly share code, notes, and snippets.

@huyby
huyby / parsing-apache-logs.md
Created November 20, 2013 13:34
Examples of parsing Apache logs

Get list of referrers in an apache access log (combined) for a specific request

sudo grep "something" * | awk '{print $11}' | grep -o "http://[^\"/]*" | sort | uniq

@huyby
huyby / zf-strip-require_once.md
Created November 20, 2013 13:29
Comment out 'require_once' in Zend Framwork

OSX

$ find . -name '.php' -not -wholename '/Loader/Autoloader.php' -not -wholename '*/Application.php' -print0 | xargs -0 sed -i -E 's/(require_once)/// \1/g'

@huyby
huyby / remove-svn-folders
Created November 20, 2013 13:26
Recursively remove .svn folders
$ find . -name ".svn" -exec rm -rf {} \;
OR
$ find . -name ".svn" -delete