Notes on Encrypted /home directory, post install.

I decided to encrypt the /home directory on a notebook, post install, as I was going to take it out of the house. There's nothing too important on it, but I probably should look after my ssh keys at least! The laptop is a low end Dell, running Mint (based on Ubuntu). It has a slightly odd configuration in that I have the /home partition mounted separately.

OK, so the first thing I did was to copy the big files onto a separate, non-encrypted partition. I did this for two reasons. Firstly the encryption process creates a copy of your home directory which you can roll back to. This means in your /home partition you need enough room for two copies of your home dir. I didn't. Secondly, the encryption process obviously encrypts each file as it goes. I thought by moving out the large files (Music and Videos directories basically), that this would speed up the encryption process.

Read more

mysql not starting – errno: 24 – Too many open files

This was a really strange one and might be peculiar to debian servers. I was trying to change a couple of mysql default settings, so after editing the config file, I restarted mysql on a webserver and it didn't come back up again. There were a bunch of errors in the /var/log/mysql.log saying "errno: 24 – Too many open files". And in fact mysql was so busy pumping these errors out, that it didn't have time to do any databasing on the files it was able to open.

After a bit of experimentation (read 'panic'), I discovered that rebooting the server started mysql up fine, but doing a 'service mysql restart' produced the file errors, so I rebooted and left it running while I investigated.

Read more

Installing Viber 32 bit on Linux, under wine.

I've seen a few posts about doing this, which should be a relatively simple matter. Install wine, download the Viber installer, and then run 'wine ViberSetup.exe' from a command prompt. And it should be that simple. Except it wasn't in my case, and none of the guides acknowledged any issues. So here, for the internet … Read more

WordPress Multi Site (WPMU) close all old posts script.

I'd previously closed all comments on posts over 30 days old, across all 700 blogs on the installation, so I was dismayed to be getting comment spam still. How was it sneaking in? After looking through my logs for POST comments I pulled out a bunch of likely looking pages.

grep wp-comments-post access.log

OK so it seemed that although all the WP Posts were locked down, some Pages and some Media posts were still not locked down — the 30 day expiry thing must only apply to Posts. Grrr. The internet revealed no easy way to fix this so I looked in the database and crafted a query which would do this for me on one table …

UPDATE `wp_1_posts` SET `comment_status` = "closed", `ping_status` = "closed" WHERE `post_modified` < "2013-10-31 11:59:59"

Read more

WordPress Multisite Blog Mass Removal Script

I was moving a WPMU site to a new server and saw that the database had grown to about 250Mb, and there were about 700 blogs running on the server. I used a few database queries to pull out a list of which blogs I wanted to delete — basically any which had a creation date and last update date the same, and any with only one post etc — at which point I had a list of 300 blog IDs. So was I going to manually delete them all? Nope, I did what any sensible person did, and wrote a script to do it.

Read more