Pither.com / Simon
Articles tagged with "technology"

Slow LVS-NAT responses

I recently had to investigate an LVS-NAT (via ldirectord) system that appeared to be adding a significant delay to many requests that were passing through it.

The HTTP requests I was looking at were taking around 600ms (with a very large variance) to complete via the director machine, instead of a consistent 35ms when made directly to one of the …

full article


Migrating Chef to a new server

The Opscode wiki only provides some rather vague and incomplete hints for migrating Chef to a new server. Below is what I actually did and it worked for me. This is all running on Debian Squeeze and using Chef 0.10.8 from the Opscode provided Debian packages.

On the new server:

apt-get install chef-server
/etc/init.d/chef-server-webui stop …

full article



Convert an OpenVZ VM to KVM

I administer (mostly through SEOSS) quite a few OpenVZ virtual machines and I recently wanted to create a clone of one onto a local system for some testing. Unfortunately I didn't have an OpenVZ machine locally, so decided I'd have a go at migrating the OpenVZ virtual to a local KVM instance. The process I went through is below.

Create …

full article


Ticket sales (PayPal, Jasper Reports, Barcodes) with Grails

Please see Part 1 for the start of this series and links to all parts.

For the SupaJam ticket outlet, we didn't need anything too fancy, just enough to present people with a couple of ticket types to choose from and a way to pay for them. Of course we still had the extra requirement of collecting a real name …

full article



grails-mail patch for envelopeFrom (VERP)

I have previously written about setting envelope senders when sending email in grails and following comments made on that post I did actually get around to submitting a patch to the plugin.

However a change to that patch was suggested and before I managed to implement it, the mail plugin underwent a fairly large refactoring which meant I needed to …

full article


Grails multi-version launch script

Note: The latest version of the script below is on github.

I work with grails quite a lot these days. I have about 5 plugins and over 10 projects that I currently work on frequently. Fairly inevitably they use an assortment of grails versions. Manually chopping and changing command lines to execute different versions gets pretty tedious.

The solution - have …

full article


Custom (private) DTD in HTTPBuilder XML response

The Groovy HTTPBuilder library is extremely useful for interacting with all sorts of things, including remote web services that send back XML responses. In these cases HTTPBuilder will automatically use Groovy's XmlSlurper to parse the response and give you back a GPathResult to make navigating the XML super easy.

However today I've been trying to parse XML that's returned (from …

full article


Resize iframe from within

I recently needed to dynamically resize an iframe based on the size of it's content. This needed to be done for each page loaded within the iframe (as they are of varying length) to avoid an extra level of scrollbars appearing.

You can skip ahead to see the finished product here: Sutton Footprint Calculator. The details of the solution I …

full article


Backport rsnapshot 1.3.1 to Lenny

I recently needed a version of rsnapshot that included LVM snapshot support. Unfortunately the version included with Debian Lenny doesn't include this, so I had to create a quick backport.

This is a very quick record of what I did.

Install useful build scripts:

aptitude install devscripts

Create somewhere to store our downloads and built files:

mkdir build-dir
cd build-dir …

full article


Envelope senders for Grails mail plugin (Spring Java Mail)

I would have expected the desire to set a specific envelope sender address for mails from a web-app to be fairly common. However finding information on how to do it with the Grails mail plugin (ie Spring mail (wrappers for JavaMail)) proved much harder than I expected.

In fact, I ended up reading the source code!

It turns out that …

full article



Groovy mail shot

A simple mail shot script in groovy...

Runs on Debian Lenny with just a standard openjdk-6-jdk installed, groovy 1.7.2 added by hand and everything else pulled in by Grape.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 …

full article



Regex search and replace in Excel

Just imagine that you have a list (a long list) of names in a spreadsheet (no, it's not suitable for export and processing as a CSV) that are unhelpfully in the wrong format. In my case they looked like "FredBloggs" instead of "Fred, Bloggs".

If you happen to be using a decent, open spreadsheet this is easy to fix as …

full article


Grails 1.2.0 (or 1.2.1 snapshot) upgrade

Following the recent release of Grails 1.2.0 I've attempted to upgrade a few of the projects I work on. Some of these attempts have gone better than others.

For one of the simpler ones I only hit two problems.

  1. Combining Acegi with Enum's defined in the same source file as domain objects no longer works. The grails bug …

full article




Writing HTML email is unpleasant!

Unfortunately I must admit that a nicely formatted HTML email looks rather better and more catchy as a newsletter than a simple string of plain text. This goes against my general email preference, but even I have relented in recent times and started allowing my mail client to display HTML email (although I still never send it)!

So with this …

full article