Apr 18

The MatDuino – project ideas

Hmm, maybe I shouldn’t call it the MatDuino. But I need a name for this project.

It stems from my recent musings about how wireless devices in the home, specifically #IoT devices, are subject to so many more potential problems than wired devices.

Things that got me thinking recently:

  • Numerous comments on my YouTube videos about how I should consider using the ESP8266 instead of Arduinos wired into my network, each one I have rebutted;
  • Reading this article on the Automated Home site, which is on the subject of inconvenience and security of 2018 Smarthome devices, not really wireless – but my thoughts went off at a tangent;
  • This great video by Jon Oxer of SuperHouse.TV, who argues “wired over wireless every time”
  • This chat on openHAB community which started out as “can someone recommend an RGBW device”, ending up with the inevitable “hmm, you should probably build your own, given what you need”
  • Finally, culminating in my Yale Home Alarm being jammed from 8am this morning. This refers to the connection between wireless sensors and the bridge, which I understand works on 433MHz RF. Thanks to @PenTestPartners for writing this superb article on the subject: Alarm Systems Alarmingly Insecure, Oh the Irony

I have always loved the combination of Arduino Nano and Funduino (the W5100 network breakout board) for connected devices in the home. I’m talking about everything in the DIY #homeautomation home, for example RGBW strip drivers connected to the network, PIR sensors, temp / humidity sensors, etc.

I find housing both boards in a single enclosure is cumbersome and really takes away from the “nano” feel. My rule of thumb is: can you fit it in an electrical backbox? Yes, then we can start embedding low voltage things around the home (assuming you’re designing your house from scratch – I am).

Similarly I love the Mega for its vast IO count, and likewise one of these things with a W5100 breakout board in a wall backbox is a bit too tight for space.

Enter: the MatDuino. (Better names on a postcard please.)

The MatDuino, and the MegaMatDuino are two boards that exist in my mind – but are next on my project list – with the following design decisions:

  • Based on ATmega328 and ATmega2560 respectively. I’d be using the TQFP package, not the DIP – small is the name of the game!
    • So yeh, need to learn to solder uber-small things
  • PoE networking.
    • Will trade things like the onboard serial for PoE network using WIZnet W5500 or W5100. (Which to use? Does Arduino support W5500 in the default Ethernet library? I need compatibility with libraries, more than newness, on this one.)
  • No serial / TTL onboard, but instead, the smallest 4-pin interface practicable, which we can plug a cheap USB TTL programmer into, for bulk programming of boards (i.e. sensors across the home)
    • This saves space usually taken up by the Nano’s CH340 chip and the micro USB port, and the Mega’s chip and humongous USB port! (WHY ARDUINO, WHY?!)
  • The board will expose as much IO as humanly possible. This means we will use serial TX/RX (i.e. we can use Pin 1 in our projects) as long as we add a tiny SMD toggle switch to isolate this pin during upload of sketches
  • No interfaces for wireless – just pure IO for sensors, displays, etc.
  • The thing should be really quite small. First version won’t be too small, as it needs to work. After that, we miniaturise.
  • Oh, did I mention PoE? You know I’m crazy about including a Silvertel PoE chip so we can have 802.3af powering our projects. Take two bottles into the shower? Not me! We need one cable powering these things in the home, and it’s going to be the same one as the one we already need for a wired network device, dammit.
  • Some kind of header layout that allows for adding top-boards. I’m thinking, my wall MQTT wall control panel (ATmega2560), my yet-to-be-built multisensor (ATmega328), and whatever else. Flexible form factor for these devices should be supported.

Anyone else interested in this build?

Sep 17

Review of Crunch Accounting

Crunch Accounting provides me with an amazing accountancy service and superb web app for me to manage my everyday business accounts.

Yesterday I went on one of my regular “diversions” down an online rabbit hole, and ended up on the website of accountingreviews.co.uk who seem to provide detailed reviews of accountancy software and services.

I was surprised to see quite a bit of negativity towards my own accountant, Crunch, both in the main article (a review of Crunch) and an almost suspicious amount of scathing responses in the comments section. Experiences here seemed to be genuine, although there was a general lack of detail, citing “poor customer service” and other generic negativity.

As the internet warrior I am* I set about to try and provide a balanced view, so I posted on the website accountingreviews.co.uk. Scroll down to read my review / comment.

I checked back a day later to find my comment had been removed.

Then I looked to see who runs the site, and it’s a competitor product called Pandle.

* /mild sarcasm

The owners of this site purport to put an “independent” view across. On their about page they state:

“Whilst the website obviously helps promote our wonderful cloud bookkeeping software, it’s also a valuable resource for people looking for choice and information about different packages.

We use independent reviewers for our reviews, to give their opinions on each of the products to help potential users make a more informed decision to select the package that fits them.”

I wouldn’t for one minute wish to suggest that this website is claiming to provide independent reviews, whilst at the same time moderating (removing) any comments that place their competitors in a good light, subtly crafting a negative advertisement against competitor products.

I must admit the original review on the blog of this Crunch did seem detailed, but glossed over a lot of points and tended towards being negative towards Crunch, rather than checking facts or being rigorous in any way. See my comment below for further detail / rebuttals.

Anyway, as my comment there was deleted, I thought it only fair to make my comments public on a website that I run, so it will say online forever 🙂

Review below (mysteriously disappeared from the accountingreviews.co.uk run by competitor company Pandle)

For the sake of balance, here’s my view. I run a small limited company providing photography and IT services. 3 years ago I was looking for a cloud based accountancy firm, a one-stop-shop. A web designer friend of mine recommend two or three (based on his mates’ comments), I did the research, and I went with Crunch.

I’m extremely impressed by the software which bridges the gap between standard accountancy software (which also means you need to hire an accountant) and the accountant themselves.

For me, an all-in-one service providing software and accountancy services is like gold-dust, and the review above does not recognise this. Instead it tries to shoe-horn web app into the category of other accountancy applications. It’s a different service altogether.

The comment “overpriced compared to other options available” needs citation. I suspect the reason there is no example is that the other apps being referred to often don’t combine accountancy and support under one roof. So yes – not a fair comparison.

For example, you can’t simply say “A small amount of reports (5 in total), although there are some graphs on the different tabs of the web app.” … that’s complete rubbish. Pretty much every page on the site (which, by the way, is perfectly logical and easy to navigate) has snippets of relevant, context sensitive information that constitutes a report. Take the homepage for example. 1) a useful timeline summary showing various HMRC deadlines such as VAT payment / submission, corporation tax deadline, companies house filing deadlines, etc. (How many accountancy applications have that? None, because this is information specific to your business as well as up-to-date HMRC changes etc.) 2) Your tax liabilities are shown on the front page, so you know what your running totals are, and so it’s easy to make sure you don’t withdraw too much money or make silly decisions. 3) Sales and expenses totals for the period are shown. Invoices are split into drafts, outstanding, and overdue. Do those count in your “only 5 reports” comment? Doubt it. And that’s just on the front page of the app.

The additions in red are clearly designed to draw the reader to the conclusion that Crunch are mischievous in some way, but actually they don’t provide a good balanced view, in my opinion.

Secondly, how many accountancy apps let you do the reconciliation with your bank statements which are automatically loaded into the app itself? Maybe some do – but I suspect the cost (probably high?) of this certainly hasn’t been factored into the comparison presented here.

The review above expresses unfounded scepticism about whether the expenses app is a novelty or actually useful. I use the iphone app almost daily. It works a charm, and it means I don’t have to ensure receipts are kept in a safe place, and I don’t have to spend hours at the end of each quarter inputting receipts. This is a superb service, my receipts get attached to new expense entries (which are added under the relevant cost code depending on what the receipt was for) and I can access them online later. I am hugely surprised that this was dismissed as a novelty! It’s a MASSIVE time saver.

How many applications allow you to schedule late payment reminders, based on whether someone has actually paid you or not?

I just don’t recognise the negative comments made in the discussion here. Having dealt with Crunch quite a bit over the last few years, none of it adds up to me.

Look, it’s fine if you don’t like Crunch as a service. But I think this could be a question of expectations.

All I’d say is: if you are interested in going with Crunch, don’t dismiss it based on the review and comments on this page. As a business owner you should probably be used to assessing options in an independent manner. So therefore treat everything here (including my comments!) with healthy scepticism.

Nobody asked me to write this comment, in fact I called Crunch today about something unrelated and had to call them back, so google for their number, and was sidetracked looking at their google reviews, then came here and was compelled to write.

May 17

Mailbird 2.0 Review

I’d like to consider myself a child of the modern world, but … email. I’m a slave to it. I have a number of different enterprises that I run and look after, I administer 7 of my own Google Apps Domains not to mention looking after a few more for my clients (schools) who have typically many hundreds of email accounts per domain.

For a small business owner, customer communications are absolutely critical to my livelihood, and so choosing the right email client is important for me.

Back in the earlier days of Windows, there were really only two products for Windows users. Outlook and Outlook Express. The latter was laughable, and so I was a great lover of Outlook with its enterprise features like Public Folders, shared resources, meeting requests, etc. I loved Outlook XP when they introduced “Outlook Today” – somehow this was the pinnacle of technological progress being able to see my calendar and my emails and my task list all in a friendly view.

Then came Gmail and I never looked back. In comparison, Outlook felt bloated and slow – probably because email demands have increased over the years and we expect to keep mailboxes of 15GB and more, with everything instantly accessible.

But webmail was lacking in some ways. Firstly the hassle of multiple sign-ins, and the fact that I couldn’t keep multiple calendars from different accounts (yes I know this is a bizarre thing to need…)

For years now I’ve been using the Windows 8.1 and Windows 10 Mail client and in the most part I’ve found it excellent. But… lacking.

There’s no native access to Gmail contacts or Calendar (although it is possible to view your Gmail calendar now). It’s a very well designed interface, but it lacks configurability, such as using different views, specifying exactly how much of the last 15 years of email I’d like to download, advanced email signatures, and I always need to revert back to Gmail web interface to search my email archive. For years I’ve kept my eyes out for a new mail client.

Enter… Mailbird 2.0. The feature set was attractive:

  • A “coming of age” email client
  • All the obvious things like multiple account support
  • A really nice integration with Google Calendar and contacts
  • Unified email inbox (this has become important to me)
  • Quick, batch archiving of emails in multiple accounts (Outlook 2016 is missing this!)
  • Touchscreen support
  • Some other great integrations: a Whatsapp sidebar, Moo.do, and loads of other apps
  • Identity support, i.e. advanced multiple email signatures

As soon as I downloaded it, I loved it so I purchased it within a few hours and I’ve been running it for a couple of weeks now.

Here’s my review.


First things first. It’s fast. Searching is fast, the UI doesn’t hang randomly as I’ve come to expect from Outlook, and I love the keyboard shortcut support. I really like multiple selecting emails in the unified view and hitting E to archive them into their respective archive folders. Getting to “inbox zero” is a big thing for me, as I feel like I am sinking under email sometimes, so this is good.


An email client must not crash. Ever. Having put Mailbird 2.0 through its paces with my 10 email accounts ranging from Gmail to Office 365, each with gigabytes of mail, attachments, folders, tags, etc., I’m pretty happy on the reliability aspect.


The application supports two view styles: the traditional Outlook style reading pane at the bottom right with email list above it, and the newer style email list on the left:

I’m a configurability nerd, and I like a little more control. Whilst I can drag panes to make them bigger and smaller, it’s not amazing in this respect. But – life is too short, and it does what I need so I’m happy here.

Email signatures

Excellent support for advanced signatures. With one exception, which you may consider minor but to some it’s very important. It doesn’t allow attaching images to the signature. You can link to images online, but not attach.

Some email purists might consider this a good thing: attaching a file to every email you send makes email bigger, and takes up more storage space, increases bandwidth use, etc. For me it’s a small price to pay to ensure the signature appears correctly on the screen, as most clients block linked images by default.

I raised this with Mailbird support, their first response was that attaching images to a signature could create a security flaw as a trojan might inject a virus into the signature. I responded by saying that they should probably consider disallowing email attachments altogether in that case, not just to signatures. They responded well and said they would consider this for future developments.

Core reading and writing functionality

The main look and feel of the interface is similar to Outlook in that you can double-click on an email in the inbox list and a new window will open.

However Mailbird has this quick “in-line” email compose view:

This is the default way of responding to an email, if you hit R for reply or use the button over the email in the preview pane:

This inline view is the biggest problem with Mailbird.

To date I’ve lost a few emails, and been confounded by what to press and where, when you need to change the recipients, subject, or anything else.

Here are the problems:

  • If you “reply to all”, it only shows the primary recipient at the top, i.e. the person who sent the email. That’s fine, because at the bottom it lists all recipients

  • Now what if I want to change the recipients? You would click on the little double arrow at the bottom, wouldn’t you? No. That switches between “reply” and “reply to all”
  • So you’d click on the names at the bottom, right? No. That does nothing.
  • So you’d click on the same line as the green name at the top, right? No. That collapses the inline view and the whole email and you have to start again.
  • So you’d click on the little arrow on the right at the top? No, that brings up a context menu for the original email, which is completely useless when you want to do something with the email you are writing.
  • Ok so you click on the green name at the top. That shows what I need:

  • Let’s say you’ve gone ahead and spent 30 minutes writing a response to your email. Can you see where I’m going with this…
  • You click on a name at the top to remove it (you don’t need to CC yourself in do you?)
  • Right-click – no option to remove recipient
  • Click and press delete – woah. You just lost the email you wrote. There’s an option to “UNDO” that pops up at the bottom, but when you press it, it just un-deletes the original email, it doesn’t restore your draft!


There are a few other things that bug me about the inline view, which make it very difficult to use in my opinion. This aspect lacks polish.

Most importantly, I should never lose a draft. Ever. This is a big problem for me.

Searching is fast but I can’t do powerful searches (date ranges, field searches).

The client uses screen space very efficiently.

I’m unable to specify views. For example I can’t show unread emails. If you need to get to Inbox Zero, this makes it hard work as you’d have to search through hundreds of emails to find that one unread email to mark it as read!

I can click quickly between huge mailboxes without any lag. This is excellent.




May 16

On the Microsoft Pro-EU position – how not to write a letter

I wrote in a previous post that I have a gut feeling about the EU referendum. In fact I have a gut feeling about most things, which is all the more reason I like to subject myself to criticism. Come and knock spots off me, show me how I’m wrong. In fact I’ll go out to seek the counter argument. I’m opinionated, but I’m not entrenched. It’s entirely likely I may rebut everything I find – or everything you say – but at least give me the opportunity to do so and to have the debate. The debate is just as important as the outcome.

Which is why the media coverage of the referendum has been so frustrating to date. It hasn’t been a debate about the issues, rather one about the rhetoric of the debate. The debate is about the debate.

Anyway I’m not complaining about media representation here, I’m angry about something completely different.

You may have heard in the news that Microsoft wrote an email to their employees and business network urging them to vote to stay in the EU.

Well, it wasn’t really an “urge”, because it had nothing compelling in it whatsoever.

I suppose if you’re a huge organisation, for PR purposes you can’t possibly go too far down the road of siding with one political movement over another. Unless it’s taking a stand against outright evil, it’s best to be safe.

Here are my notes on the Microsoft Email. Michel Van der Bel, you have let me down, you have let your team down, but most of all you have let yourself down:


In the interests of balance, here’s a letter from a small online bookshop based in Lincoln that I received with a shipment last week. Forget the different political positions that Microsoft and Anybook.biz have for a second; this letter is refreshingly different from Microsoft’s letter in the following ways

a) It’s very specific about the industry they are in, rather than the business itself

b) It is laden with statements of fact. While these need fact-checking, at least there is something to pin an argument on

c) it is direct, and it says how it will affect consumers as well as the business


May 16

On Empathy, and the Referendum to Leave the EU


Many months ago and early on in the unfolding story of the British referendum to leave the EU, it was common to hear the electorate – at least presented by the media – decrying “we feel that neither side has really come up with a good enough list of reasons to” [delete as appropriate]: leave / stay in the EU.

As the months have worn on, this narrative of voters’ views presented by the media hasn’t changed, and we are still hearing that people aren’t being armed with the information they need.

Yesterday’s episode of The Today Programme was a case in point; a voter discussion group put together by global market research firm Kantar said “I just need a list of Pros and Cons for me to make up my mind”. The same message came through loud and clear from others in this research group, yet only one of the members of the group had actually picked up the leaflet that was delivered through their door and read it.

Yes this was a government leaflet which presented information from one side. But isn’t one-sided evidence a fantastic entry point for the inquisitive mind to learn about both sides’ arguments? There’s nothing like an outrageous statement from one camp to make you try and disprove it. All the better if that opening gambit is harder to disprove, as it can lead you down all kinds of other avenues of enquiry.

When my friends and family tell me they are not sure which way to vote, I ask further questions to determine whether they are like me, somewhere “In The Middle” as opposed to very much not like me “On The Fence”. Because lazy I am not, and un-engaged I refuse to be.

(Note, I’m “somewhere in the middle”, not bang in the middle, and I definitely have a gut feeling from which I will not depart.)

Being “In the Middle” doesn’t mean I am not decisive on an issue. It certainly doesn’t mean I blow whichever way the wind is blowing. It just means that I know there are Pros and Cons and although the decision is important, I consider it “swings and roundabouts”. I may be better-off in one way, and worse-off in another.

The best analogy I have for the decision – and the tone of the debate – is if my firm were deciding to switch suppliers for a major contract. Despite going to tender, and assimilating hundreds of pages of technical information about service provision, there are still unknowns. (Known ones, and unknown ones…) Colleagues will be battling out the detail, suppliers will be making false claims, it’s our job as the ones making the decision to decide on the criteria for a decision. Once that’s done, you weed out the rubbish claims and work through the good ones. There’s no right or wrong – just different.

I have sympathy with voters who feel frustrated by politicians. Perhaps deep down inside they too know there’s no right or wrong, and when politicians present their side as a matter of morality or patriotism, it turns us off. It’s not wrong to move your services from EON to Scottish Power, and we immediately switch off when someone tells us it’s something we should be scared about. Likewise we switch off to those trying to bait us by telling us the outcome is certain when we know there can be no certainty.

When I hear that people are “On The Fence”, this is what makes me shout at the radio. Of course we don’t know what the UK will look like outside of the EU, we can never have a full picture of 21st Century UK outside of the EU.

Some say “look at Norway”. No, this is Britain, it’s entirely different. Some say “the UK will be returned to pre-Cold War days”. No, this is the 21st Century, and we haven’t just fought a world war. Also Britain didn’t “join the EU”, it was an alliance member of the Council of Europe after the war and was a formative influence, since which time much has changed. Britain joined the EEC much later in the 70s.

History was my weakest subject at school, but I remember being taught the definition of Empathy. This is a pretty good version: the imaginative projection of a subjective state into an object so that the object appears to be infused with it.

So when I learn that the reason my friends are “On The Fence” is that they haven’t been presented with a clear set of Pros and Cons, I want to shout “get a grip and stop blaming your lack of understanding on a lack of evidence”. It’s EMPATHY that is required to work out whether you want to stay in a situation in which you have no experience of not being. The story of Europe unfolded over the course of decades and you won’t find hard evidence of what it will be like if we left. Arguably we need to apply just as much empathy in working out what would happen as a result of staying in the EU, as we can’t possibly know what’s going to hit us in the coming years. Either way, decisions are best made with empathy, not facts.

My suspicion is that some voters hide behind their lack of engagement in the political process by demanding facts from politicians, when they should really be taking-on the decision for themselves.

For this is the beauty of democracy: the freedom to make your own mind up. In a representative democracy, it isn’t the responsibility of our leaders to educate us in the facts.

So I have a low tolerance for voters who, when it comes to voting day, recoil and stay with what they know because they never got off the fence. That’s just damned lazy.

I’ll give you a few days during which time you can say you’re “on the fence”. After that, I’ll say outrageously illiberal things like “you shouldn’t be allowed to vote”.

Jan 16

Dynamic DNS using Linode and local powershell script

After noip.com and dyndns.org shut their doors to all but non-paying customers, I spent many years without being able to reliably access my home network from outside. Of course, it was always possible to do without dynamic DNS by making a note of the current IP address and use this for as long as the address stayed the same, but sods law I would *really* need to access home the day that the router was upgraded remotely or the address expired or whatever.

Over these years I looked at various options, and almost settled on installing BIND9 and using nsupdate on a remote machine and writing a script on the local network to check-in periodically.

This seemed like a good option because I already pay monthly for a linux VPS so there was no extra outlay. Deep down, though, I knew it was overly complicated and would probably break someday because I don’t have the time to maintain my VPS in a “mission critical” way, or I’d rebuild the server and forget it took me 4 hours to setup the solution, thus ending up not having it for another 6 months because I couldn’t be bothered to go through the effort again.

Turns out there was much more of a tidy solution for me. I use Linode.com to host my VPS, and I also use its excellent DNS manager control panel for all of my domains. Sure, you can use the DNS manager of your domain registrar and create A records and the like to point to your Linode’s IP, but it’s so much nicer pointing your NS servers to Linode and managing all your DNS settings from Linode. The interface is designed beautifully, the account security is top-notch, not to mention there’s a very sweet iPhone app that makes creating records / cloning zones a breeze.

I digress. My solution involves creating a Linode API key, pulling-out the domain and resource IDs from Linode, then having a powershell script which runs on a local Windows box update these when it detects a change of address.

I won’t bother going in to the former as you can work that out, but the latter is certainly something worth sharing here.

After nicking the IPChangeNotify powershell script from somewhere on the web, I discovered a whole load of reliability weaknesses, which I’ve pretty much accounted for. Without further ado, here’s the spec of my updated script and solution as a whole

  • relies on Windows task scheduler
  • (ironically) uses dyndns IP address checker at http://checkip.dyndns.com/
  • if for some reason the above doesn’t respond in a timely manner, it waits, tries again, waits, etc.
  • updates are of course made securely, over https
  • email notifications telling you a whole load of useful info such as:
    • how many attempts it took to discover the ip address
    • number of milliseconds it took to discover the address (for fun / to help diagnose problems)
    • old ip address
    • new ip address if changed
    • response from Linode API to confirm that the A record was updated
    • email subject based on change / success / failure to allow for sensible rules in Gmail
  • write-out the IP address to Dropbox (added bonus – you get a little Windows notification when this text file is changed) – just in case something goes wrong and you can’t be bothered to sift through notification emails

All you need to make this work is:

  • a Linode account
  • Windows machine on your local network that stays on all the time
  • the below script

(Apologies for the godawful formatting, but it should copy/paste okay!)

$scriptpath = $MyInvocation.MyCommand.Definition
[string]$dir = Split-Path $scriptpath
set-location $dir

$oldip = gc .\ip.txt
Write-Host “IP stored in Dropbox: $oldip”
Write-Host “Getting current IP…”

$firststartTime = get-date
$webpage = (New-Object net.webclient).downloadstring(“http://checkip.dyndns.com”)
$firstendTime = get-date
$timetogetpage = ($firstendTime – $firststartTime).TotalSeconds
$currentip = $webpage -replace “[^\d\.]”
Write-Host $currentip
Write-Host “That took” $timetogetpage “seconds”

if ($timetogetpage -le 2) {
$triestext = “(on first attempt)”
} else {
$triestext = “, not on the first attempt:`n`nTry 1 ($currentip) = $timetogetpage`n”
$tries = 1
while ($timetogetpage -gt 2) {
Write-Host “Let’s try again”
$subsequentstartTime = get-date
$webpage = (New-Object net.webclient).downloadstring(“http://checkip.dyndns.com”)
$subsequentendTime = get-date
$timetogetpage = ($subsequentendTime – $subsequentstartTime).TotalSeconds
$currentip = $webpage -replace “[^\d\.]”
$triestext = $triestext + “Try $tries ($currentip) = $timetogetpage `n”
Write-Host “Try $tries ($currentip) = $timetogetpage”

$smtpServer = “smtp.gmail.com”
$sender = “sender-email@gmail.com”
$users = “recipient-email@gmail.com”, “anotheruser@gmail.com”
$subject = “”

# change the below to match the ID of the given record
# change api_key and domainid below to match your Linode.com API key and ID of the domain

if ($timetogetpage -lt 3) {
if ($oldip -eq $currentip) {
# Discovery success – IP stayed the same (ideal case)
$subject = $subject + “IP address found: $currentip. No change! (discovery took $timetogetpage seconds)”
$body = “Old IP = $oldip`nNew IP = $currentip`n`nNo change!`n`nDiscovery took $timetogetpage seconds $triestext”
Write-Host “Not updating the file” -ForegroundColor Gray

} else {
# Discovery success – IP changed (important case)
$subject = $subject + “IP change detected: $currentip. Discovery took $timetogetpage seconds”
$body = “Old IP = $oldip`nNew IP = $currentip`n`nWe updated the DNS!`n`nDiscovery took $timetogetpage seconds $triestext”
$currentip | Out-File .\ip.txt -Force
Write-Host “New IP saved in file is: $currentip” -ForegroundColor Green

Write-Host “Updating DNS…”
$updatewebpage = (New-Object net.webclient).downloadstring($updateurl)
$body = $body + “`n`nOutput of the DNS Update service:`n`n$updatewebpage”
if ($updatewebpage -like “*Invalid*”) {
$body = $body + “`n`nLinode response: DID NOT UPDATE. Check Linode.com.”
} else {
$body = $body + “`n`nLinode response: UPDATED”
Write-Host “Output of the DNS update service: $updatewebpage”

} else {
# Discovery failed
$subject = $subject + “IP address kept as $currentip (discovery failed and took $timetogetpage seconds)”
$body = “Old IP = $oldip`nNew IP = $currentip`n`nI’m suspicious, discovery took $timetogetpage seconds $triestext”
Write-Host “IP address supposedly found, but it took $timetogetpage seconds” -ForegroundColor Red
Write-Host “Keeping the current IP: $currentip” -ForegroundColor Red

# Finally send the email
Write-Host “Sending an email now…” -ForegroundColor Green
foreach ($user in $users) {
Write-Host “Sending email notification to $user” -ForegroundColor Green
$smtp = New-Object Net.Mail.SmtpClient($smtpServer, 587)
$smtp.EnableSsl = $true
$smtp.Credentials = New-Object System.Net.NetworkCredential(“sender-email@gmail.com”, “email-password”);
$smtp.Send($sender, $user, $subject, $body)





Sep 15

My KeePass to LastPass Migration Woes!


This blog post details the technical difficulties faced when trying to migrate from using KeePass to LastPass. KeePass has been an excellent password companion for the last 6 years and I’ve been using MiniKeePass for iOS, loading my password safe from Dropbox quite happily. But since starting to use a Chromebook I’ve been increasingly frustrated in this area. There are a few Chrome extensions that provide access to KeePass. CKP has 4.5 stars in the Chrome app store, but I’ve found this browser extension clunky and annoying to say the least. Manual search in CKP doesn’t work properly and despite the good reviews overall the experience in my opinion is poor. Not to mention it only gives read-only access to the password safe.

So I finally bit the bullet and decided to migrate to LastPass, after months of frustration trying to access my password safe from ChromeOS.

Here I document my migration woes, for no other reason than to provide help to anyone who might be googling for this info!

The import

LastPass supports importing from KeePass. You have to export to XML then upload the XML. Sounds simple, but fraught with the following problems.

Tip #1: use Firefox. Don’t question this, just install Firefox and run the import in Firefox. This solves a lot of issues.

Tip #2: if you used folders in KeePass, consider exporting each folder as a separate XML file. If you export the whole database, the result is that *all* your folders will be in a top-level folder. There’s no obvious way to change this later.

Problem: import process hangs


  • My KeePass database had a folder structure. As per Tip #2 above, split up your export into different XML files, one per top-level folder. To do this, right click on your folder in KeePass and there’s your option to export
  • The process can still hang, and I scoured the XML file for possible issues, however I learned after much trial and error that the hanging was random and not related to strange characters. Delete the folder that may or may not have been imported into LastPass by right-clicking on the folder in the web interface. Again – don’t attempt this in any other browser than Firefox, results are highly unreliable in Chrome! Then simply re-attempt to import. For me at least, it worked on the second or third try.

Problem: Items are imported as note ITEMS, not website ITEMS

I used KeePass to store credentials for websites, banking, etc., as well as other personal info like driver’s licence info etc.

LastPass stores items as different object types. Anything you import that had something in the URL field in KeePass will be stored into a website item. Anything else will become a “Secure Note” of type “General”.

So if you’re like me and didn’t really bother putting anything in the URL field in some / many / all of your entries in KeePass, you’ll need to do the following.


What you need to do is edit your XML file before importing to give the URL field some value. I gave mine this: http:/0 as if you accidentally attempt to launch the website we don’t want LastPass attempting to send your credentials to a website that actually exists like www.null.com (yes, it exists…)

To do the above, using Sublime Text Editor:

  • Remove leading whitespace from the XML file, otherwise the following step won’t work. Press Ctrl-H to find and replace, click the Regex button, and use this string ^[^\S\r\n]+ and make sure nothing is typed into the replace box. Replace all to remove leading spaces / tabs
  • You now want to find and replace all instances of the URL field where it’s blank, but not where it’s not. Find multiline string

<Value />



Use Ctrl-Enter to split the lines in the find and replace fields.

Now hit Replace, save the file, and try the import. This time you should notice the icon next to all items is not the purple pen (secure note), but the white box (website).

Jul 15

OLED from BuyDisplay.com – Mat’s Hookup Guide

Here’s a quick hookup guide and sketch to get the ER-OLEDM032-1W display to work with Arduino. We are going to use the u8g library to drive the OLED.

The ER-OLEDM032-1W is a 256×64 graphic OLED module costing $26.56. White on black. I bought mine from eBay although the Chinese brand BuyDisplay.com sells them directly.


There are two versions of the display, one including the integrated PCB (above) and one without. We want the above one, with integrated PCB. Make sure you purchase the one with the M in the part number.

Here’s a link to the data sheet.

About the part number:

  • ER stands for “East Rising” the manufacturer
  • OLED stands for OLED: “organic light emitting diode”
  • The M stands for “module”. I think. They do two versions, the one with driver board (adapter board) which is this one, and one without the driver board which doesn’t have that M. Confusingly they call the one without a driver board module an OLED module as well. Either I’m wrong or their naming convention is confusing. Or both. Either way you probably want the one with the M, it has an integrated PCB.
  • The 032 stands for 3.2 inch, corner to corner
  • Not sure what the 1 stands for, they all seem to have it
  • The W stands for white, they have other colours (yellow, green blue)

To use the display with u8g library and Arduino you must swap the tiny resistor on the back in position R18 to the position R19. Do this with a steady hand, some really good tweezers and a soldering iron.

ER-OLEDM032-1W Display hookup
swap 0 ohm resistor from R18 to R19 on rear of display
1> gnd
2> 3.3 OR 5 ok
4> level conv – arduino 4 (clock)
5> level conv – arduino 5 (data)
7-13> gnd
14> level conv – arduino 7 (command data select i.e. D/S)
15> reset – this needs to be connected to +5v
16> level conv – arduino 6 (chip select)

For the level converter I used this very cheap module, a clone of something by Adafruit: http://www.ebay.co.uk/itm/Pop-IIC-I2C-Logic-Level-Converter-Bi-Directional-Module-5V-to-3-3V-For-Arduino-/381311755120?hash=item58c7f3a370

And here’s a sketch. I ripped this from a larger sketch I have been working on and haven’t tested it, but it should all be about right.

#include "U8glib.h"

#define oledClock 4 // OLED
#define oledData 5 // OLED
#define chipSelect 6 // OLED
#define commandDataSelect 7 // OLED

U8GLIB_NHD31OLED_2X_GR u8g(oledClock, oledData, chipSelect, commandDataSelect);

void setup()
// Setup U8G
if ( u8g.getMode() == U8G_MODE_R3G3B2 ) u8g.setColorIndex(255); // white
else if ( u8g.getMode() == U8G_MODE_GRAY2BIT ) u8g.setColorIndex(3); // max intensity
else if ( u8g.getMode() == U8G_MODE_BW ) u8g.setColorIndex(1); // pixel on
else if ( u8g.getMode() == U8G_MODE_HICOLOR ) u8g.setHiColorByRGB(255,255,255);



/* --------------- */
void drawControl(void) {

** insert logic to draw different things here, e.g. as follows **

// Draw current room light level
if (showlightlevel == 1) {
u8g.drawStr(178, 30, "Currently");
if (lux < 20) {
sprintf (buff, "%i%s", lux, " (dark)");
} else if (lux < 100) {
sprintf (buff, "%i%s", lux, " (med dark)");
} else if (lux < 400) {
sprintf (buff, "%i%s", lux, " (med bright)");
} else if (lux < 10000) {
sprintf (buff, "%i%s", lux, " (bright)");
u8g.drawStr(178, 40, buff);

void loop()
u8g.firstPage(); // START U8G
do { // START U8G
drawControl(); // START U8G

** insert the rest of your sketch that does stuff **

} // END U8G
while( u8g.nextPage() ); // END U8G

Jul 15

From Russia With Cash – barking up the wrong tree

I have no links with estate agents in my life. I don’t like them, I don’t dislike them. As a portrait photographer or in any other capacity, I’ve never had one as a client myself.

Channel 4 last night aired a documentary called “From Russia With Cash”.

It featured secretly-filmed property viewings by a fictional character called Boris who stole money from the Russian government and tried to buy a multi-million pound property for his blonde mistress. Estate agents from the following firms were filmed: Winkworth, Marsh and Parsons, Domus Nova, Chard, Bective Leslie Marsh.

A sexy title, and a very exciting premise for someone like me who cares deeply about the housing crisis we are facing in the UK, specifically the abnormal levels of investment that are seen to push-out genuine buyers (not just financial investment buyers) who want to make their homes in London.

The buyers I’m talking about want to live here perhaps because they want to be near family, perhaps because their job brings them here, or perhaps they have lived here all their lives and want to settle – to live in a property they own. Or maybe they just want a piece of London if they can possibly afford it. We all know they probably can’t.

Within 10 minutes of watching it became apparent the premise of the documentary was flawed. It was aimed squarely at exposing the inherent corruption in the estate agency business. Or so I thought.

Whilst the estate agents in question hardly showed visible outrage or shock on their faces when the fictional buyer looking around said he would be using stolen money, neither did they show any evidence whatsoever of wrongdoing. Read on – I’m not playing ball from estate agents. I’ve no reason to. The reason I’m angry by this documentary is that it was a great opportunity to properly explore and expose the real problems in the industry as a whole. Or indeed in problems with the housing market itself.

The documentary was punctuated by snippets from QCs who spoke hypothetically and said nothing that was untrue, and nothing one might disagree with. There were other narrators who said things such as “just plain wrong” without going into any detail as to why these secretly-filmed agents were wrong. Indeed the after-game statements from the agents themselves were very strong indeed and in my opinion almost completely vindicated their behaviours.

Most of the estate agents came right out and said words to the effect that they were not qualified to advise on issues of money laundering. Some of the estate agents went on to say that this would be done according to the law by legal professionals once the transaction proceeds.

True, some of them said “you will need a good lawyer, I can recommend one”. But does this really class as unethical?

Estate agents are low hanging fruit.

All this documentary showed was that estate agents essentially smiled and nodded during the viewings. There was not a jot of evidence to suggest the agents even considered the viewings to be credible let alone that they might end in a transaction. Of course they didn’t close it off – they are hoping for a sale. That’s what an estate agent does. Should they have laughed out loud at fictional “Boris” and said “no way mate, we aren’t going to help you”? Indeed if they had thought he was credible, what’s to say he didn’t have a car full of Russian men with guns waiting around the corner? A silly suggestion, but my point is that of course the estate agents smiled and nodded. I would too. It was a charade.

Did the secretly recorded conversations on the phone with the fictional character’s agent show any unlawful or wrong behaviour? What I heard were agents explaining that at this stage they wouldn’t be asking questions.

I’m really gutted that Channel 4 have totally missed the point with this. There was nothing to suggest that money laundering law was broken, as explained by a number of the statements given by the estate agents after being contacted for comment. Amusingly Channel 4 chose to show these perfectly reasonable statements in black and white – the irony.

Domus Nova stated “No offer was made and therefore no transaction was in prospect.”

They said “we recorded the viewing on our AML [anti money laundering] log despite not having any ID information from the fake buyer and requested that an offer was made through solicitors registered in England and Wales.”

Sorry Channel 4 – I’m with Domus Nova on that one!

Another agent stated that they have a regulatory duty to perform anti money laundering procedure on the seller with whom they have a relationship, but not a potential buyer who hasn’t even made a formal offer. Just someone fictional who shot the breeze.

Channel 4 – you used to make groundbreaking documentaries. This was far from interesting let alone groundbreaking.

Never let facts get in the way of a good story, that’s what I say.

Again I say, I’ve no reason to defend the profession of estate agents. Again I say: I don’t have a single estate agent friend nor do I have any business connections with estate agents. I am an active campaigner in local community group issues and the hyperlocal movement, and wholeheartedly support the #ReclaimLondon movement.

The reason I’m annoyed by this is that this television programme only served to divert discussion away from the issues that face real London wannabe homeowners.

May 15

Assembled MQTT Lightswitch – version 1

Really quick post showing latest progress of the fancy light switch.

What do you think? A bit too colourful? It is a bit colourful for my liking. On the other hand the colours do add meaning to the buttons:

blue = presets (obvious)
red = all off (haven’t added this to display yet, you can see below there’s a nice space for the words ALL OFF)
green = cycle modes (light, music, heating, weather forecast, electric blanket mode, etc.)

So yes – useful to tell the babysitter “just press green button to change music”.

Lots of revisions to make to the design. I’ll keep you updated!

(Of course, the whole thing fits in a 47mm wall box with fancy screwless brushed chrome metal faceplate on top of it!)