i love cli

February 26, 2007

fun command line:

for f in  `cat  /usr/local/apache/logs/suexec_log | cut -d” ” -f 6 | cut -d”/” -f1 | cut -d”(” -f2 | sort | uniq` ; do grep $f  /usr/local/apache/logs/suexec_log | wc -l; echo -n $f; done   | sort | tr -s ‘ ‘ | sort +1 -n

tells you who is running the most su_exec’d stuff.

(if you cut and paste this from the blog you’ll need to fix up the quotes – wordpress screws them up somehow in when copy and pasting)

Do you want to make your mysql 5.x server super duper slow? Want to anger all your users and loose clients? Of course you do!

No problem, chmod 0 any database dir. Now run “show databases”, slow isn’t it?

As far as I can tell mysql 4.o.x doesn’t do this (don’t run any 4.1.x to test those). Sometimes when I needed to quickly disable a problem database I’d chmod 0 the database dir. Never had a problem in the past but it is killing a recent 5.x install.