Simple Open Graph v 2.4

Introducing Simple Open Graph version 2.4!

After several years of letting the Simple Open Graph plugin sit, I decided to pick it back up and add some new features and clean up some of the underlying code. Here’s what’s changed:

New Features:

  • Ability to set default og:type & og:description in the settings page
  • Ability to override og:type and og:description with custom fields by using og_type and og_description respectively
  • The ability to use the WordPress uploader/Media browser to select default og:image

I also cleaned up some of the old code to make it prettier and more efficient. You can view everything in SVN if you’d like.

I have several other new features in the works. If you have any feature requests, please let me know!

FrootVPN with DD-WRT

I stumbled across FrootVPN the other day. I like connecting to VPNs for certain activities, but sometimes I don’t like doing it on my local machine (if that makes sense). I’d much rather connect to a separate wireless network and have the router handle the VPN connection for me. Since I have a spare WRT54GL running DD-WRT in my basement connected to the rest of my rack, I though I’d give it a try. After some trial and error, I was able to get everything working. With your DD-WRT router IP as your default gateway, everything will get routed over your FrootVPN connection. Here’s the steps I took below:

1) Make sure your router’s date/time is correct. (This is important. You’ll get certificate errors if you’re way off)
2) Download the OpenVPN config file from the FrootVPN site
3) Enable SSH/Telnet
4) Copy the OpenVPN file you downloaded from the FrootVPN site to /tmp/openvpncl/frootvpn.conf
5) Open the frootvpn file and append
6) Edit /tmp/openvpncl/user.conf and put your username on one line and your password on the other. It should look like this:

7) Run this:
iptables -t nat -I POSTROUTING -o tun0 -j MASQUERADE
8) Run this command to start OpenVPN with your FrootVPN config file:
openvpn --config /tmp/openvpncl/frootvpn.conf

If everything works like it should, you should see output like this:

If you get that, hit to see if you’re getting routed over the VPN. If you are, hit ^c to quit then run this to daemonize OpenVPN:
openvpn --config /tmp/openvpncl/frootvpn.conf --daemon

Rename Logical Volume

The other day I acquired a unique issue. We had to re-install the OS on a server and then attach the old drives to retrieve the data. Sometimes this isn’t an issue, sometimes it is. In this case, both logical volumes had the same name. I re-named the second logical volume with this command:

vgrename T0Xg9i-11uz-Am7t-VbEj-sfhj-0WC6-PZSYhO VolGroup0

The syntax is like this:

vgrename UID NewName

After that, I was able to mount the second LV and the customer was able to retrieve their data.

Manually Update Munin

I’ve been setting up Munin on my own network and don’t always want to wait for the cron job to run. You can run these 2 commands to update Munin manually:

su - munin --shell=/bin/bash

Install ImageMagick for PHP

We got asked to install the ImageMagick extension for PHP quite often. It’s pretty simple, but I figured I’d write down how I do it. Most of the commands are straight forward. If you have any questions, please feel free to ask.

# yum list | grep ImageMagick | awk '{print $1}' > imagick
# yum install `cat imagick | xargs`
# pecl install imagick
# echo "" >> /etc/php.ini

Now you see IMagick in php:

# php -i | grep imagick
imagick module => enabled
imagick module version => 3.1.2
imagick classes => Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator

You’ll need to re-start PHP-FPM/Apache to apply the install.

Mail to Non-existent Users

I once had the need to change the default mail handling setting Plesk for several thousand domains. Doing all of this through the GUI is stupid and would take hours. This particular customer wanted emails rejected if the recipient didn’t exist. Perfectly reasonable. We ran the following queries:

mysql> use psa;
mysql> select,Parameters.value from domains,Parameters,DomainServices where DomainServices.type='mail' and Parameters.value in ('catch','reject','bounce') and and order by Parameters.value,;
mysql> UPDATE Parameters SET value='reject' WHERE parameter='nonexist_mail';

The first query just shows domains and their current settings. The second query updates the Parameters table/nonexist_mail value and sets it to “reject”.

Thankfully, we only had to do this a few times. I know this is compatible with Plesk 9. I haven’t tested it on 10 or 11.

H/T: (Query 23!)

PHP Password Generator

Sometimes I need to generate passwords on the fly and I don’t want to leave the command line to do it. I used to use the utility, but it changed recently to Norton Identity Safe and I’m not a huge fan. In my frustration, I hacked together a little PHP script (after looking at the HTTP headers) to query the API. I thought I’d share it:

$json_url ="";	 	 
$json = file_get_contents($json_url);	 	 
$data = json_decode($json);	 	 
echo $data->passwords[0]->value;	 	 
echo "\n";	 	 

Now, I just curl the URL to the php file and get a password! It looks like this:

[root@ispeakl33t ~]# curl

The URL in the code will generate one, 12 character password that includes numbers, letters, mixed case characters, punctuation, and no similar characters (like O and 0). You can change the values in the URL to meet your needs.

Just thought I’d pass this along.

Install DNSCrypt CentOS

Every now and then I get the itch to do something weird, like encrypt my DNS traffic just for the heck of it. I configured BIND on a vm and then have it forwarding requests to the DNSCrypt proxy on a different port. DNSCrypt, by default, uses OpenDNS to resolve queries, but you can override it. Here’s how you install everything (I’m not covering the BIND config):

1: Install Development tools:
yum groupinstall "Development Tools"

2: Install libsodium.
Download the tarball here:
Extract it and run:
make && make install

3: CentOS/RHEL/Fedora don’t include /usr/local/lib when it looks for shared libraries, so we need to run this next:
echo /usr/local/lib > /etc/

  1. Run ldconfig

  2. Download DNSCrypt-Proxy here:

6: Untar and run
make && make install

At this point, everything is installed. I added a user, dnscrypt, to run the dnscrypt-proxy daemon with the following flags:

dnscrypt-proxy --daemonize --local-address= --user=dnscrypt

If you don’t define local-address, it will listen on Since BIND is already there, I bumped it up a port. The other flags are self explanitory.

If you want named to forward to the proxy, you can change your forwarders to:
forwarders { port 54; };

More info is available here: and here and here too

Setup Ghost on CentOS

GhostWhen I first heard about the Ghost platform I was ecstatic. It’s pretty, it’s simple, and it’s fast – 3 things that I really like about a blogging platform. I love WordPress, but I like new things too. Installing it is fun. Here’s the steps I took:

  1. Install NPM:
    yum install npm
  2. Download the source code. You can sign up on the site or clone the git repo here:
  3. Extract it somewhere on your server
  4. Install it:
    npm install --production

This will start the app on port 2368, but won’t daemonize it.

To daemonize it:

  1. Run:
    npm install -g forever
  2. Copy config.example.js to config.js and edit your settings.
  3. Followed by:
    NODE_ENV=production forever start index.js

At this point, Ghost is running, but it’s still on 2368 unless you changed it. If you’re running Apache on port 80, you can use it as a reverse proxy. I created a quick VirtualHost to accomplish this:

<VirtualHost *:80>
ProxyRequests off
ProxyPass /

If you’re running Debian or Ubuntu, you can check instructions for installing Ghost here.

I’ve posted this on my Ghost site as well. You can view it here

Change MySQL Table Engine

I had an issue this morning with a database server. It has 32Gb of RAM and 24 available cores, but the load was in excess of 200. After addressing a few issues with maximum connection values in MySQL and Apache, we realized that the tables in the datbase in question were all using the MyISAM engine. This isn’t a bad thing necessarily, but the way this database is being used, InnoDB is a more appropriate engine. To convert the tables over, we ran the following command:

mysql> ALTER TABLE Table_Name_Goes_Here ENGINE = InnoDB;

This is usually a quick process, but if your tables are big, it will take some time.

After this change, the load dropped to .5 and everything began to run smoothly.

A few resources: