Installing WebSphere MQ 7.5 on Ubuntu 12.04LTS

An item on my mental To Do list for some time has been getting WebSphere MQ installed on Ubuntu. I don’t use it in a production environment, therefore an IBM PartnerWorld Software Access agreement gets me the software for a year, and a virtual machine with Ubuntu circumvents the need to buy Red Hat Enterprise Linux.
With many things I do that could potentially turn out complicated or non-trivial, I document the entire process. I’m assuming you’re running a 64-bit version of Ubuntu 12.04LTS at this point, and that you’ve also read Quick Beginnings for Linux on IBM’s site.
First, install the ‘rpm’, ‘pax’ and ‘default-jre’ packages. IBM distribute MQ as a set of RPMs, and I decided to install these rather than rebuild them as .deb files.
Next, create /etc/sysctl.d/50-webspheremq.conf with the following:
kernel.msgmni=1024
kernel.shmmni=4096
kernel.shmmax=73834496
kernel.shmall=2097152
kernel.sem=500 256000 250 1024
fs.file-max=32768
net.ipv4.tcp_keepalive_time=500

Make these changes live by running sudo sysctl -p.
Run sudo ./mqlicence.sh, read and agree to the licence.
‘crtmqpmg’ expects to find ‘pax’ in /usr/bin, so create symbolic link to ‘pax’ by running sudo ln -s /bin/pax /usr/bin/pax, then create /usr/lib64 using sudo mkdir /usr/lib64 as the installation process will want to write files in there.
Create a set of MQ packages by running ./crtmqpkg $ID, where $ID is an installation identifier, such as ‘dev’ or ‘prod’. This may take some time. When it’s finished, change to /var/tmp/mq_rpms/$ARCH and install the following RPMs using the command sudo rpm -ivh --nodeps --force-debian:

  • MQSeriesRunTime
  • MQSeriesServer
  • MQSeriesSDK
  • MQSeriesClient
  • MQSeriesJava
  • MQSeriesSamples
  • MQSeriesGSKit
  • MQSeriesMan

Set this MQ installation as default using sudo /opt/mqm/bin/setmqinst -i -p /opt/mqm, then run dspmqver to verify the installation is correct.
Finally, add your user in to the ‘mqm’ group by running sudo addgroup $USER mqm. Log out and log in for these changes to take effect.

VirtualBox is too clever

I have a desktop machine connected to a Gigabit Ethernet switch, plugged in to my Cisco 1801 router. The switch is dumb and doesn’t support VLAN tagging, which is fine as I have everything in a single VLAN.
My desktop machine works fine with IPv6, however when I brought up a virtual machine on VirtualBox, IPv6 breaks for that particular VM. “ip addr show” tells me that it’s autoconfigured three IPv6 addresses, each on separate subnets – one of them correct, two wrong (but valid on other subnets here).
What’s going on? It turns out I’d set the port to my GigE switch up as a trunk port, with the native VLAN being the user access VLAN, and two other VLANs allowed. What this does is to send frames in VLAN 4 on to the wire untagged, and any untagged frames received automatically drop in to VLAN 4. However, any broadcast frames from VLANs 5 and 6 are sent on to the wire with an 802.1q header – and VirtualBox, being very clever, seems to pass these up to the virtual machine without their 802.1q headers.
I may file a bug – that’s too clever 🙂

SSL Certificate error whilst using rvm

Given that I have a lovely clean install of Ubuntu 11.10, I decided to use rvm to manage by Ruby installation. The only problem with that is the SSL certificate beginrescueend.com uses isn’t known to Ubuntu.
I’ve seen a post advocating using -k to ignore CA certificate validation, but that’s not the right thing to do. It works, but only by defeating a security mechanism.
Cut to the chase – how to get around it:

  • Read the error message curl produces, which suggests visiting http://curl.haxx.se/docs/sslcerts.html
  • From there, download cacert.pem and copy this to your home directory
  • Create ~/.curlrc, with the single line cacert = ~/cacert.pem
  • Test using curl https://rvm.beginrescueend.com/ > /dev/null – the CA error should not appear

Ubuntu 11.10 for Productive People

Following on from my blog post, “Dumbed Down Ubuntu”, I’ve spent the past 24 hours trying other distributions with varying levels of success.
From reading Mark Shuttleworth’s blog, I’ve found strong feelings out there on Ubuntu’s default user interface. I agree with some of them – that the new Ubuntu UI is not aimed at a certain demographic of people who are power users. Having installed Ubuntu 11.04 for a friend of mine, she loved the Unity interface, and I left her to it.
I’ve played with Fedora 15 and Linux Mint 11, but neither quite worked the way I wanted them to. A specific show-stopper in Fedora’s case was Spotify’s lack of RPM. For Linux Mint, it felt like a reskinned Ubuntu. One really interesting thing I foudn is thatZalman have really cool SATA enclosure which can act as a CD-ROM drive for ISO files, and that’s on my shopping list.
After trying Ubuntu in VirtualBox, and deciding to persevere with taming the UI, I came across a handful of steps to get the interface back to something that people like me will use. Here’s how:

  1. Install Ubuntu 11.10
  2. Install Gnome using apt-get install gnome
  3. Remove the scrollbar eye-candy using apt-get remove overlay-scrollbar
  4. Log in, but select Gnome (Classic) from the gear icon next to your username
  5. Install the Gnome Tweak Tool using apt-get install gnome-tweak-tool, select Fonts and set the text scaling factor to 0.8, and Hinting to ‘slight’, then under Theme, set the GTK+ them to Ambiance, the Icon theme to Gnome and Cursor theme to Adwaita (if they aren’t already)
  6. Alt-Right Click on the bar at the top of the screen, select Properties, Background, and set a solid colour of opaque #3F3E39
  7. Alt-Right Click on the bar again, and select New Panel. Alt-Right Click on the bar at the bottom, then add a Workspace Switcher and a Window List in the bottom right and bottom left corners

Ta-da. That’s a user interface that I’m more than happy to use, and importantly, one I think lots of other non-novices will enjoy using.
Something I forgot in my original post is to say how much I value choice. I tried using Windows over a decade ago as a desktop machine, but quickly became irritated with the way it worked. Slackware served me fine, Debian was great, and I started to use Ubuntu several years after that. I’ve tried a beta of Ubuntu 11.10, and I didn’t like it, so went and tried – for free – two other distributions. Neither quite did it for me, so I came back to square one and found out how to mould Ubuntu’s interface to the way I like it.
I hope some of you find my experiences useful, particularly how to tame the UI.

Dumbed Down Ubuntu

Whilst I am in full support of making computers accessible to everyone, I don’t believe that everyone should have to use them in the same way.
I’ve been an Ubuntu user for, I reckon, three years, and Debian for years before that. In that time, it’s been great to use – install, get on with doing what I do, minimal fuss. But like Windows, the people behind Ubuntu just had to make the user interface ‘easier’ and ‘better’, but they’ve done it at the expense of power-user functionality.
I am a power-user, I know what I’m doing. I don’t think it’s elitist to want to have a UI that lets me get on with my work, one that doesn’t have graphical elements fading on and off the page gently whilst you’re trying to work. One where you can grab the bottom left or right hand corners of a window to resize it, or even one where the close, minimise and maximise windows are in the same place all the time. Ubuntu is no longer that.
I can’t quite put my finger on what’s changed, but it no longer feels efficient. One of the bigger gripes I have is the ‘thingy’ on the left with the large icons. I don’t know the name of it, but it has a set of hideously large icons which come on-screen when I hover near them, and disappear after. I don’t want that – I want to be able to throw a handful of icons in the bar at the top of the screen, and access anything else via a drop-down menu.
I want decent scrollbars back, like in Chrome – not a control that appears outside the window when I hover my mouse in a specific place. My Terminal window is easy to re-size using the top left and top right corners, but next to impossible to resize at the bottom left and right – that’s the way I want to re-size my windows.
Apparently, I can Install the ‘Classic’ desktop in Ubuntu 11.10, but with plenty of caveats. Having done that, my desktop looks even less usable.
Sorry, Ubuntu – I think I’ll revert back to Debian, at least until you’ve sorted yourself out.

The HP ProLiant MicroServer

I bought a couple of HP ProLiant MicroServers this week. They arrived on Friday, along with two Remote Access cards and four 4Gb sticks of memory from Crucial.
I can honestly say that I’m impressed. HP are offering £100 cashback on these servers until 31st August, £238 from dabs.com, so really £138. For that, you get a 250Gb SATA disk, a rather lean 1.3GHz AMD Neo processor, in a small box that can easily be tucked in the corner somewhere. Add the Remote Access Card, and you have a headless server – admittedly it requires a bit of fiddling to set up, but I have plenty of server-side experience.
The machine has four slots for SATA disks, and installing them is straightforward. Bolts and a Torx wrench
PXE booting both boxes was no trouble, and they both have Ubuntu 11.04 running on them without issue.
Specs are here.

Three is not a magic number

When I moved from Orange to 3 in February, I was full of praise for them – and they’ve been generally excellent. £15 a month for their SIM Only 300 – 1 month plan, which is loads less than I paid on Orange for lots more data. I have a MiFi for Internet access when I’m out and about, handy for the commute to my new office which is about 90 minutes.
And that’s where the problem happened. At my desk, I get no 3 signal whatsoever. If I move outside, it’s fine – but at my desk, nada. I can’t move desks, there’s no chance of using UMA in the office as 3 don’t offer it, and my mobile is useless at the place I spent 8 hours a day.
I made the decision to move to giffgaff purely on the excellent O2 coverage at my workplace. Nothing else mattered. giffgaff sent me a SIM within a day or two, which I activated online last night. I called 3 this afternoon to get a PAC so I could port my number over. Here’s some bullet point which represent the half-hour long struggle.

  • Call up, press the buttons for ‘thinking of leaving’, get plunged in to a silent abyss. Twice.
  • Call up, press the buttons for ‘phone or network problem’, get through to a chap in India who is difficult to understand.
  • I tell him I want a PAC – no more details – he asks why, and steers me through a troubleshooting process in which he checks coverage at my location and tells me there’s good signal. I tell him I get no signal at my desk. He tells me there’s a good signal in the area. I tell him my phone’s useless if I can’t use it at my desk.
  • He suggests my phone may be at fault (repeatedly putting me on silent hold without saying anything, and it’s only perseverance on my part that keeps me on the line), and I tell him my phone’s fine, and that I want a PAC because I have no signal at my desk. He asks if I can try my SIM in another phone, and I tell him my phone is not faulty, that I’m not going to waste time trying my SIM in another phone, and I want my PAC.
  • He tells me he can’t issue a PAC, but he’ll put me through to somebody who can. That other person asks why I want to leave, I tell him I have no signal at my desk – he checks on their website, and tells me there is good signal. I repeatedly tell him I have no signal at my desk.
  • He asks who I’m moving to – and I tell him I get five bars of signal on giffgaff (O2). He asks how much I’m paying and what the bundle is, and then asks me if I’d stay if they reduced the price. I tell him that even if he gave me the same bundle for free, if I can’t use it at my desk, it’s not worth having.
  • He suggests that he could put in a request for them to make their network better in my location, and I tell him I can’t wait for them to possibly do something, at some time, which might help, and that I want to move.
  • At this point, he finally gets the hint and tells me they’ll text me a PAC within 24 hours. It arrives an hour or two later whilst I’m outside, and I arrange my number porting with giffgaff for tomorrow.

Apart from 3’s shockingly poor callcentre, they were a better provider than Orange. Thanks, 3 – you’ve served me well over the past few months and I’d find it hard to come up with anything but minor niggles over your service… but please – sort your callcentre out. They’re your representatives.

Refactoring

Having written a CIF parser, TSDBExplorer, I found that although the parsing code was correct (thanks, Test Driven Development!), it’s hideously slow.
Using exactly the same set of tests and test data, I’m refactoring a chunk of the code. Whilst it’s quite demotivating to find the majority of your unit tests suddenly failing, being able to review each one and make it pass is absolutely great. I’ve definitely found the right way to code.
To anyone who isn’t a full-time programmer and who “just wants to get on and write code” – how many times have you suffered because you’ve “just got on with it” rather than writing tests and making them pass? Give Test Driven Development a try…

[Test|Behaviour] Driven Development

Whichever option you choose, I am a convert.
Previous projects of mine were met with a “*sigh* I suppose I need to write some tests, but I want to get on with the code”. TSDB Explorer is the first codebase I’ve written where the majority of code existed only after the unit tests. I have to say, it’s many times more robust, and I’m going to continue the trend in TubeHorus.
Part of me is delighted too at rcov and its “Here’s how much of your code is covered by tests”. There’s a definite warm feeling to be had when you’ve covered nearly all your code with tests, although as @bobtfish said – “That just shows you that your bugs are within your unit tests”. But I can always write more of them to make sure I don’t re-introduce bugs.

Open Source, Open Data

I’ve had a rethink about source code hosting. CVS is dead in the water, Subversion requires online connectivity, and I’m starting to use git with vigour. Hey, offline commits are perfect for coding on the train! (As an aside, I gave up trying to get WiFi access on a train to Leicester on Saturday, and didn’t even bother trying on Sunday coming back). Github is where it’s at – although despite today being World IPv6 Day, they don’t appear to have access over IPv6 natively.
The code for TSDB Explorer is up and out there and being actively worked on, as is TubeHorus, which is in a lesser working state. I anticipate getting around to putting TransportHacker‘s code on Github in the next week or so.
On another note, I’d like to thank the people at Network Rail who’ve been so helpful in talking to me about some of the data sets they hold. Whilst I’m not in a position to let the cat out of the bag yet, I am pretty excited about what’s coming in the next few weeks. Time to investigate Amazon EC2 I think… this may take some horsepower.