Friday, March 10, 2006

IPCS remove semaphores

If you get an error message saying
"HTTPD dead but PID exists", your disk space is either full or all IPCS semaphores have been used up.

ipcs -s | awk ' $3 == "apache" {print $2, $3}' | awk '{ print $1}' | while read i; do ipcrm sem $i; done

Clean up ipcs semaphores

Thursday, March 09, 2006

Remove blank / empty lines PHP [29]

I found this great implementation to remove blank (empty lines) from a string at PHP web site.

function removeEmptyLines($string)
return preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $string);