Uninstalling the IBM Bluemix CLI on Mac OSX

This weekend I was playing around with the IBM Bluemix platform at the SpaceApps Challenge in Glasgow.

The tools provided made deploying the team’s Node.js application fairly simple but now it’s time to clean up — I don’t want to have a bunch of stuff I don’t have a use for kicking around on my Mac.

Getting shot of the Cloud Foundry CLI application was easy (not least because they provide instructions but also because it’s easy to put the cf binary somewhere useful and just bin it when you’re done) but the BlueMix CLI itself was more tricky (they use an installer .pkg; there didn’t seem to be any clear uninstallation instructions). So here’s what I’ve worked out from extracting the installer .pkg and poking around in the postinstall script:

Delete the bluemix binary by running:
sudo rm -rvf /usr/local/Bluemix/
sudo rm -v /usr/local/bin/bluemix
sudo rm -v /usr/local/bin/bx

From /etc/profile, remove:
### Added by the Bluemix CLI
source /usr/local/Bluemix/bx/bash_autocomplete

From ~/.bashrc, remove:
### Added by the Bluemix CLI
source /usr/local/Bluemix/bx/bash_autocomplete

From ~/.zshrc, remove:
### Added by the Bluemix CLI
source /usr/local/Bluemix/bx/zsh_autocomplete

Some of these may not exist — the installer script does at least check whether they do before appending to them.

Both cf and bluemix store config data in the home directory (in ~/.cf and ~/.bluemix respectively) — if you don’t care about keeping that, it should be safe to delete too.

RIAT 2014

The 2014 Royal International Air Tattoo was last July; I intended to post this rather less than 4 months after the fact1 but it got stuck in my procrastination pile.

I had a three day ticket (Friday to Monday) which included, on the Friday, access to the pit area where the display teams2 parked their aircraft when they weren’t on display.

The photos I’ve gotten3 around to processing and uploading to Flickr:

The weather was very good, which is always a plus when you’re wandering around a field all day. Saturday was scorching hot and Sunday was cloudy with a little rain. However on Friday, it was cloudy but still more than sunny enough for me to get quite sunburned4:

By the time I got home I was peeling lots.

  1. I might even have settled for doing it before tickets for 2015 went on sale []
  2. Frecce Tricolori, Red Arrows, Breitling Jet Team, Patrouille de France and Patrouille Suisse []
  3. Out of around 4500 images — every time I dig through the pile I find another few worth bothering with []
  4. Protip: sun cream needs to be used to be effective… []

Happy Homes

Last weekend (Friday 21st-Sunday 23rd Mar 2014) I went to the second Open Glasgow hackathon, which was based on the theme of Energy. Every one of the four events carries a £20,000 prize for the winning team to develop their idea to commercial application.
I have a fair bit of past experience of working in the subject so was particularly interested to see what ideas came out of it but a five-figure grant to implement an idea definitely helped!

The structure was a bit different from what I was expecting; the organisers seem to be going through a process to find a structure that works best.
On Friday evening, everyone was expected to turn up having thought of an idea and go through a process of “speed dating” it: explaining your idea to another person in a fixed amount of time, listening to them explain their idea and negotiating to assign points to the two ideas up to a combined maximum of seven points. After five iterations of this, if your idea had at least twenty points you had the chance to pitch your idea to the crowd and they had the option of joining a team to work on your idea. Ideas which recruited a team smaller than four were culled.

This filtered out some of the poorly considered ideas but the surviving concepts seemed a bit homogeneous — of the nine surviving concepts the majority were variations on a theme of using the provided data1 on electricity consumption and applying some analysis, which was a bit disappointing — I’d heard more different ideas pitched but they hadn’t survived the process. Speaking to some of the other participants, they agreed with this also.

The idea I pitched, titled Happy Homes (or Happy Buildings), fitted into the common theme too: trying to put a face2 to energy consumption with the theory being that this might be more accessible than the standard graphs and numbers.
After working out “normal” electricity usage for Glasgow City Council buildings this could be compared to current use, with “abnormal” usage represented with either a sad (above normal) or happy (below normal) face. From that point it would be trivial to replace the provided data with input data from a Current Cost or smart meter, for a more domestic application.

It survived both stages of the pitching process and five of us built a working prototype, plotting a map of the locations available, simulating the current power consumption and doing the comparison to “normality” to decide which face to show.
This was done using Node.js to construct an API, backed by MySQL, and a web front-end (using the Hackathon Starter) which plotted the locations on a map. One of the team members built an Android app which showed a similar visualisation.

We didn’t win but it was still a good weekend. The winning concept appeared broadly similar but focussed more on the idea of encouraging action — notifications would be sent out to responsible parties (caretakers, etc.) if consumption fell outside “normal” so that they could check that, for example, lights hadn’t been left on.

As far as future development goes, one  significant functional requirement would be getting automated data ingestion working. I’d experimented with adding D3.js-based graphs on the Sunday afternoon but didn’t have enough time to get them integrated with the Jade templates the front end used.
I’m also inclined to re-implement the server-side components in Rails — Node.js was good enough for getting a working prototype built in the short time available but I want to experiment with Resque or delayed_job.

  1. there were significant volumes of data provided and a strong suggestion that the winning idea had to use some of it []
  2. if I got £1 every time I said that, I’d have more than the £20,000 prize []

3: no ID check to disable a SIM?

Last week I ordered an iPhone 5. It uses a nano-SIM rather than the micro-SIM the 4S does so, on the advice of 3’s customer service people:

I went into a 3 shop to get one.

My date of birth and postcode were taken and I was handed a new nano-SIM. The packet includes a URL to have the SIM activated (with the proviso that when the new one is activated, the old one will stop working) but since I wouldn’t get the new phone till (at least) Friday, there shouldn’t be any rush to activate it…

This morning, my phone was showing “No Service” and switching it on and off again didn’t fix it. When I got to the office, I tried logging into 3’s attempt at a portal but my login was rejected because I apparently had the wrong SIM number.
When I got home tonight I put the nano-SIM (in the included micro-SIM adapter) into my 4S and lo and behold it works, with my old number.

So it seems that 3 cancelled my old SIM and activated a new one, identifying me only by my date of birth and postcode. It shouldn’t be hard to see how that neither uniquely identifies me nor does knowing those two pieces of information prove that I am who I say I am!

Looking at my Flickr stats, I discovered that this photo had been pinched by some cycling blog:

At least they’ve linked back to the photo on Flickr. What gets me is, I think it’s a pretty shit photo!

Second photo-related thing today. According to Shutterstock, this is a trademarked artwork and I need to get a release:

It’s a robin Christmas tree decoration. Trademark, really?

VP2

After my (now out of warranty) OS WMR100 crapping out one too many times:

  • loads of signal issues, mainly affecting the anemometer but occasionally also the rain gauge and external temperature sensor. The console is currently balanced at an angle on a glass because it was the only way to get a reliable signal and the pole is in a less than ideal location (but at the edge of the usable range) so the anemometer’s readings suck.
  • the console would, on average every 3 months, stop streaming data on the USB port and the only way to get it going again was a reset. The console doesn’t store archive data so while nothing is being streamed nothing is being logged.
  • general accuracy: the radiation shield on the temperature sensor is awful so there is a large (and unpredictable) over-reading in strong sunshine.

I finally gave in and bought a Davis Vantage Pro2. Since it’s cheaper (by about £300!) to buy the UV and solar radiation sensors with the station than separately, I went for the Plus model, the only difference being that they’re included.
The whole thing costs an arm and a leg but Davis do seem to have an excellent reputation and it is a very nice piece of kit1.

Since the whole point was to get at the data from the console I needed some way of getting the console connected to a computer. The console has an “expansion” port, which is serial with a rearranged pin configuration and the official answer is that you need WeatherLink, which connects to the expansion port and gives a serial/USB/IP connection2, which feels like a colossal scam: the USB and serial versions are “only” (!) £75 if bought with a station3 and the IP version is £316; bought separately those prices go up to £210 and £372 respectively!
Other than the obvious financial reason, it’s beyond me why the expansion port can’t just be serial (better still, USB; it is 2012 after all) by default.

The next step is getting something useful from the serial interface. Davis are very open about the serial protocol, which is nice considering the deficiencies in WeatherLink, and there are a load of different implementations of more or less the same thing such as VProWeather and VantagePro. WView can deal with a VP2 as well.

  1. If I had to make a relatively minor criticism about the “sensor suite” the rain gauge’s “debris screen” could be better (in fact, it’s one of the things that OS might possibly have got right): it just sits at the bottom of the rain collector and will quite likely get lost; it also doesn’t do a particularly good job of keeping small leaves out []
  2. With some software that looks like it escaped from the 80s thrown in []
  3. I just bought a weather station costing in the high-£££ and you want another £75 for a cable with a rewired serial port on one end and a USB port on the other? []

Fruit machine

Partly out of my own curiosity and partly because a friend is planning to buy herself/be bought one as a birthday present, I’ve been playing around with the idea of an Apple laptop.

Along the way, I’ve noticed a few interesting things.

Macbook – bit old?

Firstly, the MacBook seems ridiculously underpowered low-spec compared to its 13″ Pro cousin and, at least with Higher Education discount, doesn’t seem to be as much cheaper as it is lower-specced. The differences:

[table id=1 /]

There’s also a collection of other bits missing from the MacBook:

  • Thunderbolt and Firewire 800 (no real loss in most cases, I’d suggest)
  • SDXC slot (useful if you have a camera that uses SD cards)
  • FaceTime HD camera (I’ve never used the webcam on any of my laptops, someone probably does).

Before someone goes all [citation-needed] on those claimed differences between the CPUs and GPUs, Geekbench source and forum post with NotebookCheck graphics benchmark.

Now fair enough, there’s a difference of £130-150 between the two and the weight and thickness differences are arguably minute, but you’re still getting a slower CPU, less memory and a smaller hard drive (you could argue that either CPU is more than powerful enough for most people but it’s been claimed OSX Lion wants at least 2GB, you don’t really want to be at the minimum; just about everyone seems to be able to fill disk space with video, music and crap).

Adding the missing 2GB of RAM and getting a bigger hard disk in a Macbook costs a total of £121 (£80 for the RAM alone1) retail and £103.20 (£68.40/£34.80) in the HE store, bringing the Macbook price up to £808.40 or £988 retail. That’s still including the other differences I’ve already mentioned.

Given all of this, it’s probably no surprise that they’ve been listed as “Don’t Buy! – Updates Soon” for a while now.

HE Software – huh?

After that, the really strange thing:

Tweet about iWork Price

At the non-discount prices, iWork is £72 whether you buy it separately or as a build option.

Similarly for MS Office Home and Student 2011,

How does that make any sense?

  1. yes, you could get RAM cheaper elsewhere; that’s beside the point []

I did what?!

The weekend before last I did the unthinkable and bought one of those fruity tablet things – for what it matters, the 16 GB WiFi model1.

It bought it from the store in Glasgow and it has to be said that the “experience”2 was remarkably good. I’d reserved one online to collect on a Saturday and it was obviously going to be pretty busy but despite being warned I might need to wait it took a few minutes at most to find someone who was free. The person I got was partcularly helpful and all told I spent around an hour in there.

The actual collection process was a faff about. She needed to find a free computer and go to some webpage3 to get one of their stockroom imps to bring it out before we go and wait for them at the location specified then finally it’s to be paid for4.

She went through setting up email, a quick demo of some of the features (things like the multitasking bar weren’t immediately obvious if I hadn’t RTFM) and a few suggestions (things like http://ipad.tvcatchup.com/ and saving a bookmark of the user guide to the home screen). All basic stuff, but it was nice to get that introduction rather than “here it is, give us your money, go away”. Vertical integration FTW, I suppose.

On to the device itself – in general I’m surprised to say I actually quite like it! Beforehand, I’d been researching the return policy and, at least subconsciously, expecting I’d hate it and want to get rid.

If I had to change one thing it would be the screen – a higher resolution would make text a lot nicer to read. On the other hand, no other device does any better (for example, the Motorola Xoom: near enough the same pixel density albeit at a different aspect ratio).
I still don’t get why you’d want to watch videos on it (besides the sort of casual YouTube browsing that works on a phone). The screen’s AR is just wrong and although it doesn’t eat up battery power quite like I expected it to, it just seems like a bad idea. I know some people do it, though.

One real surprise, having used (and written apps for) an Android phone, is the size of apps. The storage space appears to be contiguous (rather than internal/external but built in/SD like on Android) so it seems less of an issue for iOS apps to be much bigger. For example, I’ve got Angry Birds installed on both devices: on Android, the app is <20MB (dropping to ~2MB if the "move to SD" option is used) whereas the iOS version is ~50MB. There are video cookbook apps which are coming on for 1GB! The title's partly inspired by the reaction I've had from some people -- someone described it as a "dirty little secret" , another seems to have gone running5 saying I'd "abandoned my principles" (?!). One last thing – 670MB software update, for a point release (4.3.2), what the hell?

  1. I didn’t see much point paying the extra for 3G; I have a phone that will work as a wifi hotspot and a tablet’s not something I can see me taking out of the house *that* often anyway []
  2. Not the best term; I’m exchanging money for a product not getting married []
  3. I hope it was internal, not that I can recall the address either way []
  4. What happened to the combined iPhone/card reader devices? This was a standard PIN pad []
  5. To her mother of all people...long story! []

Gunk Dunc

Every other year, Duncan Smeed holds “Gunk Dunc” — having water, wet sponges and the titular “gunk” chucked at him — to raise money for Comic Relief.

Some photos were taken1:

IMG_4152 IMG_4153 IMG_4180-Edit IMG_4280 IMG_4476 IMG_4311-Edit IMG_4504-Edit

Although after tipping this2:

IMG_4394-Edit

some payback was had:

IMG_4419 IMG_4431 IMG_4434 IMG_4436

…and £770 was raised. All very good fun!

  1. 500, circa 6GB’s worth! []
  2. gelatine, Irn Bru, custard powder, Bovril, food colouring, cornflour, golden syrup []

New kit

I upgraded to an OS WMR100: about as close to a proper weather station as it gets. As well as measuring temperature and humidity like the RMS300, it also has wireless wind and rain gauges, the option for a UV sensor and sufficiently improved range that putting the sensors outdoors is feasible.

Finding a suitable place to put the outdoor parts1 was awkward but generally it all works.
There are a few issues: the signal from the wind gauge can be quite flaky2 and the cover on the temperature sensor is plastic so quite poor at stopping the sun getting through.
Ideally, the two would be in separate places so that one could be in clear space and the other shaded.

Like before, I use the WMR100 USB client to get data from the console and dump it in a text file then parse it but store data in PostgreSQL and use matplotlib to draw graphs rather than rrdtool for both.

The combination has some advantages3. It’s a huge dataset to deal with4 so a lot of work had to be done to get processing fast enough to be usable.
Lots of time was spent with the Python profiler and PG query analyzer, adding table indexes and looking for slow code.

Data also goes to Weather Underground – they do a load of analysis and graph drawing that I haven’t get around to.

  1. the temperature sensor and wind gauge are designed to be mounted on a (included) pole; the rain gauge is meant to sit close to ground level with screws to make sure it’s level; both should be in open space []
  2. the console is well inside range though there are walls which will affect that []
  3. rrdtool doesn’t really work for rain data; mpl is a lot more customizable although the documentation sucks []
  4. a month’s worth of wind speed/direction data is 192k data points if every measurement is received, there are roughly 4 million lines in data.log right now and it grows at a rate of 19 thousand lines a day []