Author Archives: noodles

Disable SSLv2 in Webmin

I’ve been battling with Webmin trying to get SSLv2 turned off so I can comply with Hackersafe/McAfee Secure.

I managed to do it this morning, this is how I did it:

– Upgrade to version 1.430
– Webmin -> Webmin Configuration -> SSL Encryption
– Enter HIGH:-SSLv2:-aNULL into the Allowed SSL Ciphers field (new as of 1.430)
– Restart Webmin

You can check that SSLv2 is disabled by running this from the shell/command line:
openssl s_client -connect localhost:10000 -ssl2

If you get lines like these, SSLv2 is disabled:
419:error:1407F0E5:SSL routines:SSL2_WRITE:ssl handshake failure:s2_pkt.c:428:
420:error:1406D0B8:SSL routines:GET_SERVER_HELLO:no cipher list:s2_clnt.c:450:

SiXXs down?

For some reason seems to be down. I’m unable to connect my IPV6 tunnels to their PoP’s or connect to their website. Does anyone have any idea why they’re offline?

Update: Seems to be back up now. It’s safe to restart your aiccu now

iPhone 3G and Linksys WAG54G v3 incompatibility

For some reason the iPhone 3G will not connect to this wireless router. There has been talk that this is fixed in the latest firmware but as of writing this it is not fixed in the latest AU/NZ firmware (1.00.23).

I found a temporary solution for the problem though. If you limit your router to 802.11B only then the iPhone will connect without a problem. As soon as it’s changed to mixed network or 802.11G only then it will fail to connect.

Update: I’ve found that the AU firmware from the AU linksys site works fine on the NZ WAG54Gv3. I’m using 1.00.46 and the iPhone 3G now connects under 802.11G without a problem.

New postcodes compulsory for bulk mailers

Tv3 reported on this the other night, but I can’t find a link to the video clip. Apparently from July 1st, 2008 postcodes must be used when sending bulk mail to receive discounts. This is to force bulk mailers to move over to the new system which can be read easier by NZ Post.

According to the news clip residentual mail may also be affected by this change over. Mail can be lost in the mail system for months if the wrong/old postcode is used. Examples were given where there are ~18 Beach Rd’s in Auckland. Using the correct postcode allows mail sorters to send your letter to the right one.

More information here:

DNS Stuff/DNS Report Alternative

Recently started charging for all their services and have doubled their prices. I know they’re a business, but this move will force people away from their site onto other services.

So I’ve been looking for an alternative to for a while and came across this:
It seems to have similar reports and is good for debugging your DNS setup.

Postcode Database V2 updated

As a few people have pointed out in the comments there was an error in the initial release of the V2 postcode database, the suburb data had been lost along the way.

I’ve fixed the problem and updated the bzip2 and gzip files. I’ve also removed the mssql version as it never worked anyway. I’m not sure if the problem affects the csv version and I don’t have time to look at it now.


Optimized vBulletin (Part 2)

I’m just trying out a new method to optimize vBulletin’s front end scripts and CSS. It’s still a work in progress but these are the results I have seen on my test site (

Without GZIP

Base VB (v3.6.8)

vbulletin_global.js – 43.8KB
vbulletin_menu.js – 17.8KB
vbulletin_read_marker.js – 6.7KB
vbulletin_md5.js – 9.6KB

JS total – 77.9KB

css – 5.7KB

Using minify

vbulletin_global.js – 23KB
vbulletin_menu.js – 10.4KB
vbulletin_read_marker.js – 3.3KB
vbulletin_md5.js – 6KB

JS total – 42.7 (45.1% savings)

css – 4.1K (28% savings)


Base VB (v3.6.8)

vbulletin_global.js – 12.5KB
vbulletin_menu.js – 4.7KB
vbulletin_read_marker.js – 2KB
vbulletin_md5.js – 3.3KB

JS total – 22.5KB

css – 1.3KB

Using minify and GZIP

vbulletin_global.js – 6.9KB
vbulletin_menu.js – 2.7KB
vbulletin_read_marker.js – 1KB
vbulletin_md5.js – 2.1KB

JS total – 12.7KB

This is an extra 43.5% savings on top of GZIP. A total of 65.2KB (83.7%) savings from the original.

css – 1.1KB

An extra 15.3% savings on top of GZIP. A total of 4.6KB (80.7%) savings from the original.

This is a huge improvement over the original file sizes and speeds up rendering of the page quite a bit. The new method doesn’t require you to download JS replacements for each version of vB, instead it works off the existing files. Hopefully this will silence the people who complained about copyright/piracy issues with me distributing the JS files (even though they’re distributed to every browser that downloads the page).

I’m also looking at some other ways to speed up rendering as much as possible. Stay tuned for downloads and a full write up.

New Zealand Postcode Database (V2)

I’ve done a bit of work on the database, added a bit of information and corrected mistakes.

Thanks to Owen and others for help with the data.

If you find this data useful, please donate.

What’s new in V2

  • More accurate
  • Added GPS co-ordinates
  • Added PO Boxes and Private Bags
  • Added Rural postcodes
  • Removed regions (as some datasources labeled a city/town as one region and others differed.)

I’ve also taken the opportunity to include CSV and MSSQL formats, as well as MySQL.


I originally created the database as I needed street and suburb data for a project I was doing. No one else was stupid enough to spend that much time on it, so I took it on. NZ Post still has their PAF data, but are unlikely to release a free database of the postcodes.

Original Post
More info on NZ Addresses


nzpostcodes_v2.sql.gz (655KB)
nzpostcodes_v2.sql.bz2 (445KB)

CSV (1.07MB)

All efforts have been made to ensure that there are no errors, but there are no guarantees, if you need 100% accurate data please buy NZ Post’s PAF data.

[UPDATE 20/04/08]
As a few people have pointed out, there was no suburb data in the MySQL database version of the postcode database. This has now been fixed. Sorry about the problems and how long it’s taken me to get around to fixing it.

vBulletin JS Min

I realized today that vBulletin’s Javascript was just too bulky and didn’t really need to be, especially when you have no plans to customize it yourself. So I grabbed all the packages of 3.6.x and minimized all the Javascript. In most cases the Javascript files are 50% of the original, which saves bandwidth and speeds up the loading of your forum.


  • Backup all the .js files from the clientscript directory under your forum root.
  • Copy the files from zip file that matches your version of vBulletin into the clientscript directory.
  • Done!


vBulletin 3.6.0
vBulletin 3.6.1
vBulletin 3.6.2
vBulletin 3.6.3
vBulletin 3.6.4
vBulletin 3.6.5
vBulletin 3.6.6
vBulletin 3.6.7PL1
vBulletin 3.6.8

Multiple versions of IE on one PC

I’m always getting grief from my managers about not testing in IE6, which is hard when IE7 is installed on all machines these days. I recently found a little install tool which allows you to run multiple versions of IE on the same machine. It doesn’t fully install IE, just the dll’s and uses dll redirection to trick windows into running an older version of IE.

Although it’s not perfect, it’s a lot easier than running a virtual PC for each version.

The install can be found here:

Monitoring Apache with LARRD and Big Brother

I managed to figure out how to monitor Apache with Big Brother and LARRD. As it’s not very well documented I thought I’d share it with everyone.

First set your apache server to display status in the apache httpd.conf:


SetHandler server-status
Order deny,allow
Deny from all
Allow from

ExtendedStatus On

Setting extended status to On does slow down the server a little bit, but it’s usually not noticeable. Remember to limit access to the status page to just the IP where your Big Brother server is monitoring from.

Add apache to @DATALIST in

Then in your (under the larrd directory) you’ll need to hardcode the servers you want to monitor.

%host_h = (
‘server01’ => {
port => “80”,
url => “”,

The first part of the host_h array is to identify which server to attach the RRD file with. In this instance I’m monitoring a server called server01 and the website I have setup with the server-status page is If your host is a FQDN (fully qualified domain name) then you can omit the full url and just have /server-status?auto and Big Brother will work out the URL.

With any luck you’ll have 4 new graphs on your trends/LARRD page.

Google Sitemap Generator

I was dissapointed when I saw the current Google sitemap generators available, so I wrote one.

– Generates Google sitemaps
– Generates Yahoo! sitemaps
– Generates plain text sitemap
– Splits sitemaps up into smaller files (as per Google’s instructions)
– Creates sitemap index file
– Pings Google/Yahoo!

This is the first release, so there’s probably some bugs in there somewhere. Please let me know if you find any. There are some examples in the zip file.

To best use the classes, set the variables on the page you call the class from, rather than editing the class file (so changes aren’t lost when you upgrade).


$sitemap = new Google_Sitemap();
$sitemap->doPing = false;
$sitemap->gzip = false;
$sitemap->baseurl = “”;


Version 0.2 – 14/05/2007

Fixed problem with script using too much memory when trying to sitemap hundreds of thousands of pages.

MySQL and Redhat Enterprise Linux 4

I ran into some problems with MySQL on RHEL 4 when SELinux was enabled. When starting MySQL it would come up with this:

Starting MySQL...................................[FAILED]

And the following in /var/log/messages:

[code]Dec 1 14:02:52 searchdev kernel: audit(1164934972.432:5): avc: denied { append } for pid=3071 comm=”mysqld” name=”searchdev.err” dev=sda6 ino=1687755 scontext=root:system_r:mysqld_t tcontext=root:object_r:var_lib_t tclass=file[/code]

All fixed though thanks to this page:

Double byte and PHP (unicode problems)

A while back I ran into a problem with PHP, how can I read in files that have double byte (unicode) characters and display them in a form that any browser can read. Most programming languages don’t handle these characters very well, and end up with non sense instead of passing through the correct text.

This function should be able to strip out any unicode characters from text and return them as html entities (something none of the core PHP functions are able to do).

function removeuni($content){
preg_match_all(“/[\x{90}-\x{3000}]/u”, $content, $matches);

foreach($matches[0] as $match){
$content = str_replace($match, mb_convert_encoding($match, “HTML-ENTITIES”,”UTF-8″), $content);

return $content;

Good code ruined?

I happened across a really neat site the other day, called Some of you might recall a similar scheme going on a while back called perl golf – well this is the same idea.

The deal is, there is a load of challenges set, and you have to write and submit the code to supply the required output of the challenge. However, there is one snag – you have to write it in as little code as possible. It has you really thinking laterally – outside of ways you might normally think of writing code, which I personally find fantastic (and depressing, realising how little shorthand I know!)

There is currently four languages you can submit in – PHP, Perl, Ruby and Python. Suggest that you hardcore execution-time monkies take a look at it and get scoring.

Colorado Sheriffs To WarDrive For Safety

The Sheriff’s Department in Douglas County, Colorado says it’s going to start warning computer users that their networks may be vulnerable to hackers. It plans on equipping its patrol cars with devices that detect unprotected computer networks, and distributing brochures to computer users in vulnerable areas, instructing them on how to password protect their networks.

More info here