Blog Archives

MySQL Latin1 to UTF8 conversion

Many people think it’s as simple as doing a mysqldump->sed->mysql command (or clicking Change->Collation in PhpMyAdmin) but that only changes the encoding for NEW data, while leaving the old data intact and possibly coming out dirty. Luckily there is a

Posted in bash, Database, linux, servers Tagged with: , , , , , , , , , ,

Nagios Core Administration Cookbook by Tom Ryder

As the number of servers I maintain grows, so does the need for a decent monitoring solution. Enter the recently published book “Nagios Core Administration Cookbook” by Tom Ryder. Nagios is the big tool for monitoring, letting you monitor (and

Posted in linux

Arch linux wireless suspend on HP Pavilion DM1 with Alfa rtl8187 1000mW

Running Arch linux on my little HP Pavilion DM1 netbook with an Alfa rtl8187 1000mW external wifi card has a few problems with suspend. For starters, the driver (module) needs to be reinitialised upon return. This can be done by

Posted in linux, WiFi Tagged with: , , , , , , , ,

Vim as Man page viewer

Linux man pages are gold, and much quicker than googling, but I hate having to learn yet another interface for what is just a text flatfile that’s a bit to big to fit on a single 80 x 24 character

Posted in bash, linux, vim Tagged with: , , , , , ,

Silent Disco – Streaming Live Audio over WiFi

I’ve just finished building a Silent Disco over WiFi system for use in the Christchurch Body Festival – Silent Disco, giving guests the opportunity of using their own smartphone for receiving the audio signal rather than fragile (yet expensive) speciality

Posted in linux Tagged with: , , , , , , , , , , , , , , , , ,

2Degrees 3G datastick with Arch Linux

Here’s how I got my New Zealand 2Degrees USB 3G cellular datastick modem working under ArchLinux. The unit is actually a “Huawei Mobile Broadband Model E1552” that has multiple USB modes. The main USB mode being the data functionality but

Posted in linux Tagged with: , , , , , , , , , , , , , , , , ,

Increase file upload maximum size in PHP

Networks are such a stack relying on many many things working together to get the end result you’re after. To increase the maximum size of a form uploaded file in PHP you need to increase both the upload_max_filesize AND the

Posted in apache, linux Tagged with: , , , , , , , , , , , , , , ,

Tracking your /etc with git version control software – and make apt-get do it automagically

Linux computers (mostly) use /etc to store config files. From server software like Apache, PHP, ProFTPd and OpenVPN through to X11 and Mutt, they all keep their config files in /etc. User config files are mostly kept in /home/$username/ so

Posted in bash, linux Tagged with: , , , , , ,

Redirect to

To redirect (rewrite) a subdomainless site to the www prefixed one with apache, use mod_rewrite. This must be enabled in Apache’s conf file, and allowed to override the defaults with AllowOverride in the relevant directory section. Line 5 checks to

Posted in .htaccess, apache, linux Tagged with: , , , , , ,

Archlinux /srv/http vs Debian /var/www

Link the two Debian and quite a few other older systems still use /var/www as the default root directory for serving web content, while Arch uses /srv/http. /var does get a bit cluttered these days, but to save the mental

Posted in apache, linux Tagged with: , , , , , , , ,

Google Apps mail ( & Gmail) on the commandline with Mutt

After getting sick of the bloat and overhead of Thunderbird, Outlook, OSX’s Mail and the other usual suspects, after a weekend of playing around with various clients I am now using Mutt on my primary lappy as my primary email.

Posted in email, linux Tagged with: , , , ,

SSH works, but file copy utilities fail

The symptoms vary across OS’s and connection utilities/programs but in essence it’s the same. Connecting to a remote filesystem via SSH fails with no good error message. Transmit on Mac mounting the drive is no better than Nautilus on Linux

Posted in linux, ssh Tagged with: , , , , , , , ,

Recursive unzipping many zip and rar files in many folders.

So I have a directory with ~100 folders, each containing atleast 1 zip/rar file that needs extraction. No point in keeping the zip/rar file afterwards either so remove it. find . -name "*.zip" -exec unzip {} \; -exec /bin/rm {}

Posted in bash, compression, linux Tagged with: , , , , , , ,

Patterns missing in Inkscape’s PDF output

Vector path patterns that display on screen are missing in the final PDF output. The Pattern ‘zero point’ must be set so the are no negative repetitions of the pattern with node tool. Set the ‘X’ at bottom left of

Posted in Inkscape, linux, PDF Tagged with: , , ,

Finding the install date of a linux system

Easy was to find install date of system is as follows: sudo passwd -S bin bin P 09/19/2010 -1 -1 -1 -1

Posted in linux Tagged with: , ,

I’m still running out of space

A server has no space! Where has it all gone? I want to see a list of where the disk usage is. Linux has a built in function du but that’s rather limited sometimes. du -mxS / | sort -n

Posted in linux Tagged with: , , ,

I’d like my linux box to email me when it’s hard drive is full.

I’d like my linux box to email me when it’s hard drive is full. It could be my webserver, my home file server full of movies and music, or even my netbook after getting a bit hit of Dropbox files.

Posted in linux Tagged with: , , , ,

Making IPTables survive a reboot – Saving and Restoring

By default Ubuntu / Debian do NOT save any IPTables settings when shutting down. I think the thought behind this is that if you screw up a config, then a restart will save you. In some instances, such as a

Posted in iptables, linux Tagged with: , ,

Apache SSL won’t start – make_sock: could not bind to address

Apache SSL won’t start with following error message: … waiting (98)Address already in use: make_sock: could not bind to address no listening sockets available, shutting down It would be nice to have Apache2 state, in plain english, “Sorry, that

Posted in apache, linux Tagged with: , ,