Blog Archives

Instant Nagios Starter by Michael Guthrie

With a growing number of servers at Wherewolf I needed to find a monitoring solution that was usable not just by the hard-core neckbeards, but by the junior devs as well. In the months since my last mid-sized server monitoring setup,

Posted in Uncategorized Tagged with: , , ,

Nagios Core Administration Cookbook by Tom Ryder has been released!

Nagios is a server monitoring tool that can check anything you can imagine, and this book is here to show you how. From setting up your first “off-the-shelf” ping style checks through to writing your own plugins, this is the

Posted in Uncategorized Tagged with: , , , , , , , ,

Rename spaces to underscores

How to rename files with spaces to use the underscore character instead .. or any other web friendly character. I’ve just been handed a zip full of files, and want to host them, but they’ve all got nice pretty spaces

Posted in bash 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 domainname.com to www.domainname.com

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: , , , , , ,

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: , ,

Using IP Tables to quickly block an IP address

To block an offending (DOS/Spam/Password hacking attempts etc) IP address from connecting to your server, use iptables. xx.xx.xx.xx is ip address of remote. iptables -A INPUT -s xx.xx.xx.xx -j DROP To undo: iptables -D INPUT -s xx.xx.xx.xx -j DROP

Posted in iptables Tagged with: , ,

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

Apache SSL won’t start with following error message: … waiting (98)Address already in use: make_sock: could not bind to address 0.0.0.0:443 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: , ,

Running PNGCrush on a recursive directories

One easy way of reducing website load time is by optimizing your images, which is what PNGCrush does. PNG graphics are often more bloated than they need to be so using PNGCRUSH should be obvious. Basic usage flags don’t allow for recursive

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

RewriteEngine to change URLs with Apache and .htaccess – 4 easy and common examples

The RewriteEngine modification of the URL allows for many tricks such as readable URLs and maintaining links after site redevelopment. There are many good reasons to clean up URLs into something readable, including having the customer/client remember the link, being

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