Archive for January, 2011

Recombining files with their “._*” AppleDouble counterpart

Friday, January 28th, 2011

Just incase you ever need to rejoin a “._*AppleDouble resource fork file back with its data forkĀ use FixupResourceForks to create a normally forkedĀ AppleSingle file. This can happen when you move files from a volume that does not support resource forks, which is just about anything that isn’t HFS+, back to a supported volume. FixupResourceForks is installed along with the Xcode Tools, but informal testing shows the binary will work without the tools installed.

Finding the Location and Version of WordPress Installs

Sunday, January 9th, 2011

We provide hosting for clients and friends, along with management of a few servers. Even though we don’t control what people install, we try to make sure that everyone remembers to keep software installations up-to-date. This is especially important for WordPress. Its not that WordPress is insecure, its wildly popular, and thats what makes it a prime target for exploitation.

To aid in this cause I use a non-intrusive method of locating the WordPress version file and extracting the version number from it so clients can be notified if they are running an out-of-date installation of WordPress. This is done by using the find command and searching for “version.php” within the path of “wp-includes” and then running grep to search for “$wp_version =“. The complete command looks like this:

find / -name 'version.php' -path '*wp-includes/*' -print -exec grep '$wp_version =' {} \; -exec echo '' \;

It’s best to narrow down where to search if possible, instead of starting at root (e.g. /). In the case of cPanel, user directories are usually stored in “/home". Running the command will output something like this:

/home/user/public_html/wp-includes/version.php
$wp_version = '3.0.1';

Now if I could just come up with a quick way to automate nagging them to update.