Author archives: timd

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

IMG_20130609_153045.jpg

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 match_obj.group(3) is not None:
lexer_string = match_obj.group(3).lower()
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
__CONFIG (CP_OFF & CCPMX_RB0 & DEBUG_ON & WRT_OFF & CPD_OFF & LVP_OFF & BOREN_ON & MCLRE_ON & PWRTE_OFF & WDTE_OFF & FOSC_HS);

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
movwf OPTION_REG
bcf STATUS,RP0
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

IMG_20130606_200944.jpg

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

twitterbird

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;

count
-------
62479

(1 row)

EDIT:

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

Django

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

FreePCB

I received my PCB today from http://dangerousprototypes.com/ 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.