Monthly Archives: May 2013

Clean apc cache

cli

php -r 'apc_clear_cache();apc_clear_cache("user");apc_clear_cache("opcode");'

web

curl -s --user username:password "apc.php?CC=1&OB=1" > /dev/null
curl -s --user username:password "apc.php?CC=1&OB=2" > /dev/null
curl -s --user username:password "apc.php?CC=1&OB=3" > /dev/null
curl -s --user username:password "apc.php?CC=1&OB=4" > /dev/null

Find out current path on a shell script

path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)

Kill process by name

kill `ps -ef | grep process_name | grep -v grep | awk ‘{print $2}’`
Page 1 of 11