Skillett.com

Are magic quotes on?

One way to check if magic_quotes is running is to run get_magic_quotes_gpc(). It will return a 1 if it is on, or a 0 if it is off. You can use this result to print out the magic_quotes status, or to decided if you should run another function, such as addslashes. Read...

Changing Linux User Passwords

I had reason to go looking for this today, having not done it in a long, long time (thanks to the delightful cPanel interface). To change a password on behalf of a user, first sign on or “su” to the “root” account. Then type, “passwd...

Exim Cheats again!

One of my servers was subjected to a SPAM attack again yesterday (via PHP using an insecure php mail() call I suspect). Thankfully the user was tracked down quickly and suspended. Leaving some 10,000 messages on the queue!! Digging out the Exim Cheatsheet that I...

Hands on with an Exim Cheatsheet!

A couple of days ago I had reason to get really hands on, down and dirty with Exim my MTA. The basic problem being that for some absolutely unknown reason a couple of clients messages were stuck on the queue and not able to be delivered to me. They were failing with...

Linux Search and Replace

Sed can be a pain in the butt, so thanks to Shooter.net I’ve recently been changing files with perl using the following code: perl -pi -e ‘s/search/replace/g’ *.text -p Assumes an input loop around the script. It reads each line of the file and...

Linux File Permissions

rwxrwxrwx 777 Read, Write and Execute permissions for all users. rwxr-xr-x 755 Read and Execute permissions for all users. The file’s owner also has Write permission. rwxr-x – – – 750 Read and Execute permissions for the files owner and the...