Feb 04

Problems moving a JIRA installation from Windows to Linux

If your JIRA install is broken and you are getting many messages in your atlassian-jira.log after doing a restore of your mysql db from a Windows server to a Linux server it’s possible you may have the problem I encountered today.

In the logs I saw many messages indicating that mysql had failed to to make inserts. Googling around many people were suggesting that this was due to mysql running out of connections, but I was seeing these from startup, so that was probably not the cause here.


2013-01-30 13:00:29,574 main ERROR [module.propertyset.ofbiz.OFBizPropertySet] Error setting value in PropertySet
org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:OSPropertyEntry][id,null][entityId,1][propertyKey,com.atlassian.activeobjects.admin.ActiveObjectsPluginToTablesMapping]
[type,6][entityName,jira.properties] (SQL Exception while executing the following:INSERT INTO propertyentry (ID, ENTITY_NAME, ENTITY_ID, PROPERTY_KEY, propertytype) VALUES (?, ?, ?, ?, ?) (Column '
ID' cannot be null))

On Windows mysql identifiers (tables, alias, etc.) are, by default, not case sensitive and in linux the opposite is true. My problems mainly came when JIRA was trying to generate new IDs for objects being inserted into the database. The sequence_value_item table was being called by SEQUENCE_VALUE_ITEM, which mysql on the ubuntu server I was using, could not find.

For a quick fix stick the following in your mysql my.cnf

# Somewhere in the [mysqld] section

This will make all identifiers in queries non case sensitive for all databases on the mysql server. You can also do this per db, but I’ll leave that to you if you want to that.

Oct 11

Windows 7 – “Setup was unable to create a new system partition”

Just a quick post here.

I was trying to install Windows 7 on a brand new SSD on an AMD A75 based motherboard with A10-5700 processor. After banging my head off it trying to do diskpart clean and zeroing sectors, switching to legacy IDE mode for the SATA controller, loading AHCI SATA drivers and unplugging the dvd drive the solution was: DON’T USE A USB3.0 KEY AS THE INSTALLATION MEDIA

Switching to a USB2.0 key for installation solved the issue and I was able to install as normal.

Aug 31

Bacon Jam

I actually made this quite a while ago, shamelessly stolen from Not Quite Nigella


Let’s see if I can remember what I used:

  • 20 rashers of bacon (Smoked)
  • 1 onion, finely chopped
  • About half a bulb of garlic, minced
  • A good heaped tablespoon of brown sugar (some might call this 2 spoons)
  • Some Chilula chipotle hot sauce (smokey tasty)
  • 1/2 a cup of maple syrup (maybe a little more, maybe more like a 1/2 mug)
  • 1 cup of coffee
  • 1/4 of a cup of cider vinegar


It’s pretty easy:

  • Fry all the bacon
  • Put the fried bacon into a pot with the onion and garlic on a medium heat, give it about 10 minutes until the onion is nice and soft
  • Add everything else to the pot and bring to a simmer
  • Leave the pot open and keep it at a low simmer for around 2 hours (You may have to add a little water if it starts to look too dry)
  • You should end up with a sticky mess, put it in a food processor and whizz to your desired consistency
  • Eat on toast, with eggs, anywhere where you might use a chutney

May 21

Windows Server 2008, on Xen 4, on Debian 6

There’s not a lot of information on the net about this particular configuration so I thought I’d put a post together that gathers what information there is, what worked for me and what didn’t. Read the rest of this entry »

Sep 18

Black Screen of SNES

I have a load of old consoles lying around, including a SNES with a pile of games I picked up cheaply after the N64 released. While all the games worked perfectly 15 years ago, trying them again now, some would do nothing other than display a black screen when the console was powered up. Figuring that the ROM chips were probably fine I guessed it was most likely the interface between the SNES and the cartridge that was at fault.

Taking apart one of the games I was presented with this:

PCB from Super Bomberman 2 cartridge, non-working

As you can see there’s quite a lot of dirt/corrosion on the contacts of the PCB. I tried removing the dirt with some cotton buds + IPA but it was fairly stubborn so I ended up giving the contacts (just the contacts leave the rest of the PCB alone) a very light sanding with some 1000 grit sandpaper (probably wet and dry, I just found a small piece of it in the top of my toolbox). I wouldn’t recommend using anything coarser as you may damage the tracks.

As an aside, grit is the measurement of “roughness” of sandpaper and polishing compounds. It refers to the maximum number of holes per inch in a mesh that will still allow the compound/grit through. So the larger the number, the finer the grit.

So after a little sanding I got this:

Shiny Bomberman 2 PCB

Putting it back into its case and putting it into the SNES, success! Super Bomberman 2 lives again! Opening the cartridges isn’t really necessary but I thought I’d do it to get some better pictures of the board.

Sympathetic Dreamcast

As a show of support for its black screening older friend, my Dreamcast decided to start rebooting itself a few seconds after starting up, or whilst loading games. This, again, was down to corrosion of contacts. The power supply in the Dreamcast is internal and uses a pin header plus sprung contacts to transfer the power to the console’s main board.

Removing the power supply and again lightly sanding the pins fixed the problem. Hooray! Although that does mean I now have to finish the Nomad Soul…

Jul 19

Manual Headlight Level Adjuster for the RX8

Note, before you start cutting wires in your car: the internals of the headlight auto levelling system are unknown to me I’m treating it as a “black box” (how convenient that it is actually a black box) and just looking at the inputs and outputs and making assumptions about how it works. I accept no responsibility if you cause damage to your car, yourself or others from doing things detailed in this post.

Background on HID lights

All 231BHP versions of the RX8 (in the UK at least) have high intensity discharge headlights (HIDs).

One of the requirements for using HIDs in a car is that the car must have some sort of auto-levelling system to ensure that when the car is loaded unevenly front to rear that the difference in height front to back does not cause the lights to point too far up, potentially dazzling other motorists.

The RX8 does this by having actuators in the headlight unit to angle the beam up and down. To sense the suspension load at the front and rear it has 2 sensors, one on the left front suspension, another on the rear left suspension assembly.

So what’s the problem?

So you may be thinking why do you want to manually adjust the lights then? Surely this is a safety feature?

The sensors are, essentially, potentiometers (variable resistors) attached via a linkage to the suspension. They have a wiper that moves along a carbon track the ends of which are connected to power and ground.

It costs £400to make this? Really?

By reading the voltage from the wiper connection on the front and rear sensors the auto-levelling control unit can work out if one end of the car is higher than the other and adjust the headlight angle accordingly.

The problem is that the sensors that are used, corrode and wear out. This wouldn’t be so much of a problem but Mazda want around £400 per sensor! For a variable resistor?!

So there we have it:

  1. Give £800 to Mazda for some new sensors
  2. Attempt to repair the sensors (if you’re lucky you may be able to dismantle the sensors, give them a good clean, replace contact springs and they might start working again)
  3. Go manual

How to do it

Fortunately Mazda have made this quite simple to do as the headlight auto levelling control unit is in the cabin and not, for example say, part of the ECU, or in some inaccessible location.

The control unit lives just to the left of the glove box, to get best access to it, remove the glove box, this involves gently bending in the side of the glove box when it’s open to allow the end stops out, once that’s done you should just be able to lift the glove box out (there is also a soft opening mechanism, but mine died quite some time ago, as far as I know you can just unclip it from the glove box.


The auto levelling control unit is the black box that says “Auto Leveling Unit” on it. It has one connector with 24 pins, the details of which you can see below:

This is as seen from the cable side of the connector

From the RX8 wiring diagrams the cables we care about are :

  • P – Black with a Green Stripe – Ground for sensors
  • C – Black with an Orange Stripe – Power for sensors
  • I – White with an Orange Stripe – Rear Sensor wiper output
  • K – Black with a Blue Stripe – Front Sensor wiper output

So what we want to do is tell the auto levelling unit that the front suspension is at its neutral position all the time and we want to be able to adjust the “rear position” to make the unit think the boot is either lightly or heavily loaded to make it adjust the headlight level accordingly.

So here’s a simple little circuit to do just that, you will need:

  • 2 x 4.7k Resistors
  • 2 x 1k Resistors
  • 1 x 10k Linear Potentiometer

What you need to build

R3 and R4 are there to change the range output by the potentiometer, as the auto levelling control unit most likely flags a fault if the voltage is zero or maximum (implying a short or open circuit somewhere).

So simply build it up in whatever fashion you desire (do make sure to insulate the parts from each other) and put it on a long enough wire to locate the potentiometer somewhere you can get at it, I think the ashtray would make a fine home.

Before starting the install, disconnect the negative battery lead. Installing it is a matter of cutting back a bit of the massive amount of insulation tape on the cable to the auto levelling unit connector then cutting the 4 wires detailed above (check twice, cut once). Strip a short length on each of the 4 cables from the connector (insulate the other ends, they are not used, they’re just connected to your broken sensors) and then either solder, or use terminal blocks to connect your contraption.

Jul 07

Got an RX8? Replace your coils!

I own a Mazda RX8. It’s quite an unusual car in many ways, but it’s most unique feature is probably its engine. The engine is a Wankel rotary type, this means that instead of pistons and a crank it has an eccentric shaft (essentially a crank) about which two rotors rotate, each in its own elipsoid chamber. Anyway I wont go into the details of it here this video explains it much better and is jolly spiffing since it’s from the 60s:

Anyway, the engine requires oil in the combustion chamber(s) to lubricate the rotors. Petrol dissolves the oil and which can lead to the rotors failing and you being left with a large bill. But what does this have to do with ignition coils?

The Problem

Due to the way rotary engines operate the coils are worked very hard. At 9000rpm the coils and spark plugs are sparking 150 times a second. This leads to them running rather hot which causes the insulation on the coil to break down which means a shorter path for the electricity to arc to where it’s not supposed to (somewhere other than the spark gap of the plug). Eventually the coil will fail and stop providing enough voltage to the spark plug, which means the spark plug is going to stop sparking.

  • Less sparks = Less petrol being burned.
  • Less petrol being burned = More petrol on the rotor
  • More petrol on the rotor = Less oil on the rotor
  • Less oil on the rotor = More engine wear
  • More engine wear = Less happy owner


Change your coils regularly, at the same frequency as your spark plugs (about every 3 years). My car had 28,000 miles on the clock and was just over 5 years old when I changed mine. They are fairly easy to change yourself, the main pain is removing the airbox and bellows to get at them, once that’s out of the way it’s just the matter of getting them connected up to the right leads.

They are very expensive from Mazda UK. Happily, however, you can buy a set of 4 of them from Rotary FX for the same price as Mazda UK will charge you for a single coil.

What mine looked like

All 4 looked like the picture below, 2 of them had failed completely when tested with a multimeter(both trailing plug coils). Since the replacement there’s not a lot of difference at low revs but higher up the rev range the difference is a lot more noticeable.

Yuck, white spot on the coil where it has overheated

Jul 07

Using Shift Registers to expand your output

Shift registers are fantastically useful little chips to use when you need a few more I/O pins than your microcontroller offers you.

They essentially allow you to turn 3 output pins into 8. So let’s have a look at a fairly normal shift register chip the ON MC74HC595A:

Logical layout from the datasheet


The inputs we’re interested in if we want to use this to expand the output of our microcontroller are:

  • The Serial Data line
  • The Shift Clock
  • The Latch Clock

Now you may be thinking what about the Reset line, what about Output Enable? Well we don’t really need to use these.

  • Reset: Each time we shift data into the shift register we’ll be doing 8-bits at a time “overwriting” the previous values so reset isn’t really very valuable to us (we’d much rather that extra I/O pin on our uC). You’ll notice that the Reset line is an inverted input (see the little circle at the end of the line?) so we want our chip to always be not in the reset state so we just tie that pin high (to 5V in the case of this chip).
  • Output Enable: We want the chip to always have its outputs enabled. I’m guessing you’d rather have an extra uC I/O line than worry about the tiny amount of time at start up when the shift register has not been fed any values and so all its output are on. The line is again an inverted input so it’s really not Enable so we tie it to ground to have our outputs always on.

How do you work this thing?

Well it’s pretty simple, whenever the chip detects a rising edge (i.e. from ground to +5V) on its shift clock input it shifts the bits current stored in the shift register along one (so the highest bit drops off the end to be lost forever) and the lowest bit of the shift register becomes whatever the serial data input line is currently set at. So we fill up our shift register one bit at a time until we have all 8 bits, once all of our new 8-bits are into the shift register we want to send a rising edge to the latch input, this will transfer the bits in the shift register onto our output pins (QA-QH) on the chip.

So in in pseudo code:

ShiftRegisterPort = 8bit value we want on the output of our shift register
  uC Shift Clock Pin = 0;
  uC Serial Data Pin = RegisterPort Bit (7-bit);
  uC Shift Clock Pin = 1;
uC Shift Clock Pin = 0;
uC Latch Clock Pin = 1;
uC Latch Clock Pin = 0;

The timing diagram looks a bit like this:

Rough timing for writing to the chip

That’s it

And that’s pretty much it. If you are not too fussy about the state of your outputs you can even run this from 2 pins by tying the shift and latch clock lines together, this does give you a ripple effect as the bits are output as they are shifted into the shift register. If you do this you also have to clock 9 times (with the last data bit being ignored) as otherwise the 8th data bit is not latched from the shift register. For slowly changing outputs,  this could work quite well, however if you want to do PWM, for example, then you don’t really want your outputs rippling all the time as values are shifted along.