Archives 2013

Monday, 23rd December 2013 - 22:40:04

ZVS Driver First Attempt 2

I had a crack at making a ZVS (zero voltage switching) driver for a flyback transformer I pulled of a monitor board. No Joy. I have one MOSFET wired backward =/ I just noticed in the diagram I was following that the bottom of the two MOSFETs was flipped vertically to make the diagram look neater...

Saturday, 14th December 2013 - 16:41:01

Python Logo

Just wrote a multi threaded SNMP tool for fetching SNMP from over 170 cPanel hosts doing 20 requests in parallel. This is my first multi-thteaded python script. It uses python threads and zeromq to hand out jobs, receive results and to control the worker threads.

Much faster than the old for loop.

Now I wish the new elasticsearch box would arrive so I can dump the data in there!

Friday, 13th December 2013 - 11:04:35

Prototype Node

Today I built some prototype RS485 nodes for a project I am working on with a mate. Each RS485 node is going to be equipped with a pic micro controller to do any logic or to connect with peripheral sensors. At the stage the pic16f88 because it has all the goodies like built in USART and ADC etc. I may make a different version with a 40 pin pic either a big DIP one or a QFN or something.

The nodes will be auto-terminating. So when you add a node to the end of the bus, it will terminate the line and tell the node before it to stop terminating the bus.

I tried out a new technique using enamelled copper wire for these prototypes.

Sunday, 1st December 2013 - 15:28:00

PHP Files Indexed

145,755,658 lines of PHP indexed for searching as part of a migration project I am contributing to. Once I get some spare time at work (hah!) I may use the data to try and detect some nasty code - eg some compromised sites and such.

The old classic code injection technique. When an attacker adds this to your PHP it's basically open slather for them to execute whatever code they POST or GET to c_id.


I see this type of thing the most in wordpress installs. People don't keep wordpress (AND i'ts plugins / themes) up to date and then suffer the consequences - typically this sort of attack is not targetted, it's an automated tool which will probe wordpress installs for vunerabilities until it finds one it can comromise.

Sunday, 24th November 2013 - 12:05:38

Index All The Things!

#elasticsearch =)

Tuesday, 20th November 2013 - 09:00:00


More Elasticsearch training today. Yesterdays session was very interesting. Lots of new bricks to build new toys with =)

Sunday, 15th November 2013 - 17:59:11

Miniature Bigmouthed Cats

My shipment of miniature big mouthed cats has arrived from element14.

Thursday, 14th November 2013 - 18:44:00

Chainable Dual Triac Board

Just ordered a run of 20 PCBs. Chainable Dual Channel triac boards for turning mains (240V) devices on and off with a micro controller. This is an identical circuit to my existing design, but it is fit on a 50mm x 50mm board so that I could get them made at seeedstudio.

Monday, 11th November 2013 - 22:05:24


The GR211 nixie tube socket PCBs that I designed have arrived! 

They came out excellent. I was worried for two reasons. The footprint for the GR211 and the SOT-23 transistors were untested. I created cusom libraries in Eagle to deal with the unusal transistor that I selected, which can handle up to 300V and for the tube. The tube took some figuring out because its datasheet has the footprint from bottom, rather than the top. I ended up screen grabbing the scanned datasheet and mirroring and flipping it as if it was viewed from the top, I could then create the footprint in eagle - which are traditionally viewed from the top.

Click through to the gallery for photos of the GR211 tube running in the socket.

Thursday, 7th November 2013 - 19:48:46

Coles Portugese Chicken

Cooked some of that Coles portugese chicken on the BBQ tonight. It was on special. The normal price is a bit ludicrous.

Tastes great though. 

Thursday, 7th November 2013 - 17:14:40


The beer I brewed a few weeks ago seems to have turned out well. No off flavors or anything introduced by the old ingredients. One thing though, it's bitter as hell because I used the entire remainder of my hops in the last two batches. I was expecting the hops to have degraded in bitterness, but no... I haven't tried the dark yet.

Tuesday, 5th November 2013 - 17:08:40

Busy MySQL

This boys and girls is what a really big, really busy MySQL box looks like. 32GB RAM, 32 Cores. 6 SSD RAID.

Friday, 1st November 2013 - 16:56:00

Dungeons and Dragons 1E

Didn't realise I had a 1E DND book... Cool. Now to re-hide it until the kids can treat books nicely =)

Thursday, 31st October 2013 - 22:40:43


Cute little "tube" amp. This is a kit from eBay that I purchased from an Australian Seller just as a PCB.

Sunday, 27th October 2013 - 09:24:04


Definitely don't put Coke in the Coke machine, that would be stupid... =/

Sunday, 10th October 2013 - 08:49:45

Suspend All The cPanel Accounts

Don't you love the smell of spam in the morning...

Friday, 25th October 2013 - 13:47:27


Bottling day today.

Thursday, 24th October 2013 - 11:04:19


Element 14 order arrived with 300V capable SOT-23 transistors for my tube sockets as well as other goodies.

Saturday, 5th October 2013 - 20:13:55

Tap Seat Void

Went around to all the sinks in the house and did maintenance, changed tap washers etc. The seat on this bathroom vanity is toast though. It has a massive void in it. I couldn't work out why it still didn't seal with a new washer. I could not get my finger in there flat to feel the seat but I could detect the void with my fingernail. The photo shows the void in the seat after a very light pass with the seat cutter. The initial pass was just to visually identify the void.

Sunday, 29th September 2013 - 08:42:47

3642 At Central

There was a nice suprise waiting at central today on the way into work. 3642 was sitting at platform 1.

Friday, 27th September 2013 - 18:00:00


I brewed today after a long while. Managed to use up all the old ingredients in two batches so I can start from scratch with fresh yeast and fresh ingredients.

Suprisingly after more than a year of storage, the grain yielded a pretty good amount of sugar and the yeast was actually alive. I was expecting either the yeast be toast or the grain to under-yield.

Friday, 20th September 2013 - 13:11:04


Cleaned up the fermenter fridge in preparation for the brew day next week!

Sunday, 15th September 2013 - 08:03:46


Came into work this morning to be greeted by OpenNMS sprewing alerts about one of the cPanel machines. Somehow they managed to get over 100,000 emails in the queue. Spam of course.

Friday, 30th August 2013 - 17:07:23


Today I fitted a new set of bearings to the bench grinder. It runs great now. Very smooth.

Wednesday, 28th August 2013 - 21:55:30


Just got home from work. Interesting day - very busy. I changed out one of the core switches today. Very nice piece of kit. The job is a little nerve racking as you must be quite careful of the surrounding connections. Knocking one of those out or kinking a fiber cable and breaking the filaments means very sad times.

I had to push the switch out of the back of the rack, due to patching on the front side. This meant extracting the switch on the front size 80-100mm and then removing the ears on the sides. It was then able to slide to the rear of the rack.

The core switch is a HP Procurve 48 port gig switch. It's got 4 gig fiber uplinks. The other really cool part is the module in the back. The HP J9049. This module allows you two CX4 stacking ports as well as two 10gig GBIC slots.

Wednesday, 21st August 2013 - 08:19:17


The lab has expanded somewhat. I now have two layer 3 switches, one with POE for Asterisk work and a new HP 48 port. I also have some loaner firewalls to play with Juniper NS5-GT. I've got VTP going over the cisco switches for vlan management, the HP doesn't talk VTP unfortunately. All of the uplinks, other than to the dumb gig switch are dot1q trunks which carry the vlans between switches.

The Junipers will be serving DHCP and either NATting or Routing for a few vlans which will sit behind the ESXi hosts, more as a learning tool rather than doing anything useful.

I am now hunting down some mini-GBICs for the HP so that I can link the POE switch at gigabit speeds.

Next on the agenda 3 x cisco routers and all the serial crap to go with them.

Sunday, 18th August 2013 - 19:40:57


I managed to track down a newer image with crypto (k) for my Cisco 2950T. So I upgraded it today, rolled the keys and enabled SSH.

Saturday, 10th August 2013 - 22:15:42


I managed to get Asterisk up with FreePBX. Compiled from source - the rpms don't play nice with the current version of FreePBX. It takes a damn long time to build from source on an Atom machine... Next job is to hook up the SPA3102 as an analogue extension and a pstn trunk.

Saturday, 10th August 2013 - 10:20:48


Bought a pair of HP 2650 switches on eBay - very cheap. Unfortunately they weren't packed very well, so the front bezel and GBIC slot on one of the switches are smashed. The seller was very good though. They partially refunded. These are layer 3 capable and should do well sitting behind my ESXi hosts.

Tuesday, 8th August 2013 - 22:50:35


I had a bit of a mess around with the new POE switch and the 7940 handsets tonight. I spun up a pre-made Elastix VM which is a CentOS distro with FreePBX and Asterisk integrated - and a bunch of other stuff to make life easier.

Sunday, 4th August 2013 - 08:22:31


I scored a Cisco WS-C3550-24PWR-SMI on eBay.

Once it arrived I gave it a quick test with a Panasonic VOIP handset, the handset was power cycling its self on and off and this was appearing on the console of the switch:

%ILPOWER-3-CONTROLLER_PORT_ERR: Controller port error, Interface Fa0/9 : Power given, but link is not up

I thought to myself, damn, the POE is stuffed on this switch... However after some reading, I discovered that the switch is actually pre-802.3af standard. The IOS image above a certain versino, however, has been fixed so that the switch can provide power to compliant devices. The reason the pana didn't work correctly is because it doesn't boot and bring the link 'up' fast enough for the switch. The switch hits a timeout and turns off the POE on that port. The timeout can be adjusted like this:

power inline delay shutdown 20 initial 300

The switch looks like it's had a hard life though! It came pretty poorly wrapped - but it made it through in-tact. The thing is full of dust.

Sunday, 28th July 2013 - 21:00:44


I scored some second hand Cisco 7940 and 7960 handsets to start experimenting with Asterisk. They look very good for the price.

Thursday, 25th July 2013 - 15:18:27


Had a bit of fun today with my site after discovering nearly 2000 spam comments. Thankfully the comments go through an approval system first before they are visisble.

I also threw django-grappelli on for a pretty admin area. It looks quite neat.

By adding a newer jQuery and jQuery-UI to the admin section I also broke the Zinnia tag autocomplete. I rectified this by replacing the autocomplete_tags.js which utilised Jörn Zaefferer's jQuery plugin with code to call jQuery UI autocomplete.

Thursday, 25th July 2013 - 08:00:30


Some of the brewing gear got justified today in the blackout as we could enjoy hot coffee in the morning with no power.

Monday, 22nd July 2013 - 21:53:48

Ooops thats not the anode

Oops. This is what the tube looks like if you get the pin mixed up. But be cautious - as this can damage the tube. In this case the decimal point is being used as the anode instead of the actual anode.

Thursday, 11th July 2013 - 17:55:19

GR-211 Nixie Running

Wow, that tube looks awesome running.

I set up the improvised high voltage supply to 250V DC per the data sheet and then dug about for about half an hour to try and find a 22K resistor which was 1W or larger. No joy, but I did manage to find some resistors that match the tube. Some 12K 2% resistors, they look like maybe 2W. Put them in series and we get 24K, or 23.5K in ths case because they aren't in spec (although now that I think of it, they probably are - just, It's about 500ohms out, the 2% gives you 240 ohms leeway each)

With that in place I measured the short circuit current at 8mA. I adjusted it down a bit further to get the current down and ended up with just over 6mA and just over 180V under load.

Next I quadruple checked the datasheet to ensure I had the right pin for the Anode and applied the 180V to the Anode. Then I grounded each Cathode and watched the digit light up. You can see in the photo the number 5 lit.

Sunday, 7th July 2013 - 00:50:47

GR-211 Nixie Tube

Wooo! A Nixie Tube. =) Thanks Dave!

This is one of the larger Nixies, it's a GR-211. It has a 170V 5mA strike voltage. We didn't get a chance to try it during the BBQ.

Friday, 05th July 2013 - 15:23:57

400V DC Isolated Supply

In anticipation of my mate bringing a Nixie tube over to look at I knocked up a quick variable high voltage supply.

It has a massive unloaded voltage of 418V in the photo.

Saturday, 29th June 2013 - 20:53:33

Oils a bit Overdue

Changed the oil in the car. It's long overdue as you can see by the photo - it doesn't stink yet, but it's pretty dirty.

Friday, 28th June 2013 - 11:34:28

Cutting Shelf

I built some mrore shelving in the shed. We've had this coffee table hanging around in the shed for ages. So I made it into something useful. First I trimmed the lip from around the longer sides, then I set up the panel saw attachment for the Triton MK3 Table Saw and cut the table in half giving me two nice sgelves to use.

Friday, 28th June 2013 - 10:17:15

Cable Hanger Filled

Today I made some cable hangers out of recycled pine playpen secions. This project turned out much better than I anticipated.

It was just a matter of running the play pen section rail up against the table saw to give the length of peg required. I then made a vertical part and "hook" shape to go over a rafter.

Tuesday, 25th June 2013 - 12:02:54

Raspberry Pis

I managed to convince the boss that it'd be better to use Raspberry Pis behind each of our monitoring screens rather than one large PC with one or more multi-port graphics cards. I've prepped an image so that the Pis don't switch off automatically and I've also changed their HDMI driver mode to 2 - so that we can do audio down the HDMI. Other than that - there are a few modifications to xinit files for the pi user to get the browser to come up fullscreen on startup. Fun little project!

Friday, 21st June 2013 - 16:42:00

4.0mm2 Is Not Big Enough

I scored some very heavy duty 3 phase mains cable which I thought might be suitable for my high current transformer project - but upon inspection it's not going to be. It's 4mm2 cable, I'm thinking I need at least 50mm2.

Friday, 14th June 2013 - 15:49:42

Table Saw Lap Joints 1

Had some luck today making some half-lap joints on the table saw using 2" x 4" and 2" x 3" timber. I was inspired after watching a bunch of Jay Bates' woodworking videos on Youtube. He tends to create a lot of 2" x 4" projects with half-laps.

Wednesday, 12th June 2013 - 17:38:41

Some New Cisco ASR 1002-X with 10G

Sweet new kit at work. Cisco ASR (Aggregated Services Router) with 6 gig interfaces and a 10 gig interface.

Monday, 9th June 2013 - 18:02:34


I spent some time stripping paint off and sanding some boards from an old set of shelves with the intent of using them on a small project. When I got all of the paint off I was surprised that it wasn't pine or something like that - it actually looks like maple. So it's really too nice to use for the project I prepared it for.

I started by screwing the boards to a long aluminium straight edge and ripping one side on the table saw. The boards were bowed and not straight, but mostly flat. From there I found a width that matched both of my boards and ripped the other side off, using the newly cut edge against the fence. This way both pieces were exactly the same width.

Then if was onto the work bench for a sanding. This is the first time I'd used my 4" belt sander hand held, it's normally sitting in a jig to use it as a vertical belt sander / linisher. With 40 grit paper on this thing is hard to control! Once the paint was off, I sanded the sequence up to a fine unmarked paper which feels like it's maybe 240 or so. This is the finest I had on hand.

Typically the wood I buy is already sanded, probably to 400. This was good practice anyway. I've always been keen to rip, joint and thickness plane my own lumber.

Looks like I'll go off to Bunnings at some stage and get some pine for the job and keep this unexpectedly nice wood for something else!

Sunday, 9th June 2013 - 08:01:35

Pygments Python Syntax Hilighter

Up early this morning (noisy kids).

I enabled the PowerShell and Shell-Session lexers in Pygments:

Import-Csv -Path New-VMs.csv | `
ForEach-Object {
New-VM -VMHost $_.VMHost -Name $_.Name -Template $_.Template -Datastore $_.Datastore

[timd@fedorabox ~]$ yum install eric
Loaded plugins: fastestmirror, langpacks, refresh-packagekit
You need to be root to perform this command.

update wiki_wikipage set article = replace(article,'</code>','{/code}');

Saturday, 8th June 2013 - 12:17:13

Pygments Python Syntax Hilighter

Today I looked at an issue I was having with the syntax hilighting on my site. The way it currently existed, you needed to exit the blog entry html directly to get code in the post using a <code> tag. I've now switched to code in square brackets. This means that the you can add code snippets in the GUI editor, however, TinyMCE comes along and says "I'm helping" and replaces all of your spaces with nbsp and all of your carriage returns with break tags. So, I've found you need to reverse that with a replace prior to parsing the code in pyments. The end result is pulling a bunch of stuff out, parsing and hilighting, then putting it back.

Pygments Python Syntax Hilighter Rules!

        lexer_string = ''
if is not None:
lexer_string =
if lexer_string in ['c','cpp','c++','cpplexer']:
lexer = CppLexer()
elif lexer_string in ['py','python','pythonlexer']:
lexer = PythonLexer()

#include <htc.h>
#define _XTAL_FREQ 20000000

void putc(unsigned char dt);
void led_digit(unsigned char digit, unsigned char position);
void led_readouts(void);
void led_integer(unsigned int number);
void led_raw(unsigned char raw);
void led_hold(void);
unsigned int get_adc(unsigned char chan);

    bcf       STATUS,RP1
bsf STATUS,RP0 ; Select Bank 1 of data memory
movlw 0xD7
bcf INTCON,GIE ; Disable all interrupts.

Friday, 7th June 2013 - 21:36:27

Cisco 857W ADSL Router

Decommissioned the old Cisco 857 ADSL router and the Linksys SPA3102 ATA/Router today. The new cable box has both router/wireless and also incorporates an ATA.

I'd still like to put together an Elastix system at some point and use the SPA3102 as a voip to copper bridge/trunk (piggiebacked on the current ATA).

Thursday, 6th June 2013 - 21:33:29


Today I put some extra NICs I bought from eBay about a month ago into my ESXi hosts giving them 4 ports each. The photo is a patching to play with vlans and vlan trunking between the Cisco switch and the vmware virtual switches.

Monday, 3rd June 2013 - 21:01:45

Loot 2

My order from Rockby Electronics arrived today. Lots of Triacs for new mains switching goodness. Some LM35Z temperature sensors as well as some RJ45 connectors with inbuilt magnetics and some SOT-223 NPN transistors to make the minimum order.

Sunday, 2nd June 2013 - 09:20:49

Second Winter Has Come

Day 62 in don't starve. This game is addictive! The second winter has arrived just as a dog attack arrived too unfortunately.

Saturday, 1st June 2013 - 12:10:47


Ooops. I's got a big bug in my twitter API code for the site =/

$ psql
Type "help" for help.

=# select count(id) from mytweets_mytweet;


(1 row)


It turns out that I was relying on a DB constraint that didn't make it through the server migration - so the code was just jamming records in after each Twitter API GET. The insert is wrapped in a try/catch so that it will not bail when there is an integrity error (duplicate keys). With the field not set with a unique constraint - the code just keeps happily sticking records in there... All good now.

Saturday, 1st June 2013 - 00:21:46


I've spent today hacking in some new features for the gallery. Unfortunately, not public facing. Just stuff to assist in uploading photos.

The most comprehensive change is the new photo selector and having a stockphoto (django module) photo attached to all blog posts. There was some messing about with column types and casting and alterting tables in postgres to make it play nice. The field for an article image used to be just a character varying field, it's now an integer field with a proper foreign key relationship to the stockphoto module.

In the admin section, there is now a nice jquery-ui based dialog for selecting from group to gallery to photo and updating the field. This is much better for photos because the standard django select widget is not up to the task. I mean it works fine, but you really don't want to have to choose through a list of "IMG_1235.jpg" etc etc - you really want a thumb.

Getting this custom functionality was just a matter of overriding the admin template for that app by creating an <app>/templates/<app>/<model>/change_form.html/. Secondly, the forms.Widget widget is wrapped so that we can append whatever we want in the admin section - in my case just a text box and a "browse" button. The real work is done in jquery code in the template.

Sadly, updating jquery-ui has borked a few things like tag autocompletion.

Friday, 31st May 2013 - 13:32:19


I received my PCB today from FreePCB Drawer

Saturday, 25th May 2013 - 13:20:56

Too Pretty to Use!

This new saw blade is too pretty to use. I got it for my birthday last year, but the poor table saw hasn't had any use - so I haven't changed it.

Wednesday, 17th April 2013 - 11:08:29

24TB Array

The guys were setting up a DAS today in the office to go out to a secondary data center for backup. 24TB - wish it was mine =)

Friday, 5th April 2013 - 22:35:00

You are doing it wrong!

You're doing it wrong! Bit of an oops...

Thursday, 4th April 2013 - 18:46:20

4 Way Power Rail

I've recently set up an ESXi lab with 3 servers. The problem with enterprise servers in a home environment is the noise and the power consumtion - obviously you are not going to want to have a rack full of gear running 24/7 at home. The other issue is the standby power consumption at ~100W each when they are powered down. Some of them have components that run even when the system is off.

The solution: Turn them off after a session in the lab experimenting or studying. Then unplug them.

My servers are in a shed away from the house - so I don't really want to go out there at the end of a session at 12:00AM or when it's raining or whatever. The same goes for powering the lab on.

You may recognise these parts from other projects I've built. The Fermentation Controller was designed to control up to 4 mains devices with triacs. The Fermentation Controller was to be controlled with a parallel interface (which of course nothing has now). The Fermentation Controller consists of two dual triac boards which will switch up to 10A each at mains. They will not be working too hard in their new job controlling only a max of about ~1KW across the 3 servers under load. The brains of the power rail is the TG Watchdog. This is an RS232 controlled board which allows you to toggle it's four outputs using a terminal emulator. This can also be wrapped with an expect script or py-expect etc etc to make it more friendly or automate it.

Saturday, 30th March 2013 - 23:36:14


Did well today - major cleanup in the yard. All this rain and sunshine has made the grass go wild. It's now under control.

Today after lots of collecting and eBaying I have 3 systems ready to go for a VMWare Lab. I've got two ESXi nodes and an NFS/iSCSI server.

I've started with openfiler, but it does not seem to like a partition > 2TB. It keeps shitting it's self for some reason. I'm on my 3rd reinstall so far, it refuses to make a PV out of the remaining 2T of unpartitioned space on the disk, even after I manually partitioned the disk during install.

It's pulling about 700W idle at the moment, so with the power consumption and the noise, they are not staying on!

Friday, 4th January 2013 - 22:57:21


Had a great day out in the shed today. Wrote a bit of code, played with a bit of electronics =)

I started working on a solar charger which will charge a(n) SLA battery(ies). I have 4 small panels which I can make use of for this. The idea is that it logs the incoming voltage and current off the panels. It will allow me to play with the ADCs a bit and also learn a bit about opamps - I plan on using a shunt resistor on the high side with an op amp configured in differential mode to determine the voltage drop and therefore the current.

I may eventually use this to run a small 60W server if it has the guts.

Monthly archives