Calculating international postage with USPS Forever stamps

I just spent ages trying to work this out, so here’s a quick post to remind myself should it ever come up again:

  • The current value of a Forever stamp is 49 cents at time of writing (check current value with this search
  • The USPS have an online calculator to work out postage values located here
    • To send a post card (with a value of $0) it costs $1.20 per card, or 3x Forever stamps
    • To send a rectangular letter (i.e. birthday card) weighing 1ox or less (with a value of $0) it costs $1.20 per letter, or 3x Forever stamps

You can legally use multiple Forever stamps on a single item of post to ensure that the postage cost is covered.

Read More

PHPStorm (IntelliJ) and Xmonad

Another quick one as I’m sure I’ll need to do this on another machine.

When launching PHPStorm, I was presented with a grey box that did nothing. I realised that it was probably related to the fact that I’m running XMonad.

After a quick Google, I came across the the tried and tested setWMName "LG3D" that I’ve used previously (to make Source games run under Steam). Unfortunately, this wasn’t working for PHPStorm because I’m also using XMonad.Hooks.EwmhDesktops which nullifies the effect of setWMName.

This issue existing because Xmonad is a non-reparenting window manager, and we need to inform Java of that.

You can either specify the environment variable when launching phpstorm:


Or you can have it loaded into the environment automatically. I did this by adding the following to ~/.profile


Read More

Build CentOS 5 generic RPM on CentOS 6

I’ve been trying to build a generic RPM (PHP code only, nothing linked) that installs on CentOS 5 and CentOS 6. We used to do this on CentOS 5, but when we moved our build box to CentOS6 we started to see errors that looked the the following:

rpmlib(FileDigests) is needed by my-example-project-1.2.3-1.noarch
rpmlib(PayloadIsXz) is needed by my-example-project-1.2.3-1.noarch

This is because the RPM was built on CentOS 6, which uses a new compression algorithm that CentOS 5 doesn’t know about.

To make your RPM CentOS 5 and CentOS 6 compatible, add the following to your spec file below the Requires section.

%define _source_filedigest_algorithm md5
%define _binary_filedigest_algorithm md5
%define _source_payload w0.gzdio
%define _binary_payload w0.gzdio

This makes your RPM CentOS 5 compatible

Read More