We have a lot of side responsibilities at the small NFP I work for. You know when you’re the only person that is good at doing something so you do it even if it’s not technically your job? That kind of thing.

I do a lot of the maintenance and “fiddling” with our WordPress website. I quite like it. Recently I have hit upon an extremely therapeutic activity: managed 404s.

We have a plugin to manage redirections for missing pages. I don’t exactly want to get to zero 404s but I do want to catch and redirect those I can to meaningful places. Even if it is a 410 response.

The really fun part is the plugin supports regular expressions. When I first started working with the plugin my efforts were limited to basic wildcard matches. Now I have even started with optional groups and substitutions. I’m by no means an expert but it is a great learning enviroment.

Today I have come up with a solution I am quite proud of. For some reason, our developer set the versions on our CSS and JS files to randomise occasionally. I assume this is for some sort of caching purposes. Anyway, this can generate some harmless 404s that I don’t want to be logged.

Using the regular expression 101 website I created this solution. Not much point explaining it here as the site does that very well. Any 404 that matches this pattern is excluded from the 404 logs, which helps me spot meaningful 404s much quicker.

Very pleased

Classy PHP stock image

Today I wrote my first PHP code for deployment. I’m super proud!  I need to caveat that, though.

When I say “wrote” I mean I found some code online that did half of what I wanted to do. Then I found some code that did the other half of what I wanted to do. Then I put them together. Then I looked at existing code to see how my code needed to work. Once that was working, I adapted it to include a feature that no-one else seemed to have thought of. And, of course, I tested it all in production.

What is it? Just a few lines to add images to an RSS feed generated by WordPress. Already implemented by many a plugin but I like do some things my own way.

I discovered Linux in about 2001. Weirdly, I was in Tanzania at the time and didn’t have a PC of my own to install it on. That had to wait until 2003, when, as a postgrad on a tight budget, I bought a cheap, ex-corporate Dell Latitude laptop. It had one USB 1.0 port and no built-in ethernet. Yes, it was a longtime ago.

A truly amazing range of laptops, they had a modular drive system, which meant I was able to get a zip drive relatively easily. And that was important because at the time you needed a SCSI card on a desktop to connect to most Zip drives. And I needed Zip for my GIS course. Big files.

Laptops, at that time, also relied heavily on PCMCIA cards for commuincations, be that 56k fax/modems, ethernet or, gasp, wireless.

I imagine most people have their “hardware geek” phase a little earlier than I did. Over the course of 2003/4 I had a fantastic time shopping on eBay for bargain laptop drive modules and various comms cards. They all had to be Linux compatible so lots of careful research was required.

Fast forward to today. Well, I still have loads of this stuff, including the PCMCIA cards shown. I haven’t had a laptop that would support them for about two years. Why have a kept them?

Mainly, I convinced myself that they had some value to someone. Until recently, I had no idea why. Then I started thinking about why I was finding it so hard to get rid of them.

I realised that I felt that, somewhere, there was someone that would get as much pleasure from fiddling with this tech as I did in 2003. At the very least I thought by keeping them I might at some time recapture that “golden” time in my life.

In reality, these things are technologically worthless and ten a penny on eBay and my personal circumstances have changed beyond recognition. I barely have time to write this blog, let alone tinker with ancient technology for hours on end. Also, even if I had the time and the hardware to fettle with, I don’t know if I’d even enjoy it! I have moved on in so many ways.

So, now I know why they were important to me, I do need to let them go. They’re a physical reminder of time that can’t be recaptured and shouldn’t be. It’s better to remember that time fondly, than imagine it might some day come back.

And, besides, if such hazy days did return, in say, 25 years, they’ll be way better things to tinker with!

My wife and I have been working hard to de-clutter our house. In lay-person’s terms, that means “getting rid of stuff we don’t need.” A very large part of this process has been inspired by The Minimalists and their podcast. It was my wife that first stumbled across these guys and I genuinely think they have changed both of our attitudes to “stuff”.

When we moved to our current home we bought a whole load of stuff that, when we came to unpacking, we just didn’t know what to do with. It all just sat in the largest spare bedroom. There was a lot of it. This is surprising considering we came from a 1.5 bed flat in London. To this day I have no idea where we kept it all.

The majority of my stuff falls into two clear categories. One is stuff I kept “just in case.” The second is sentimental knickknacks. So, things that I might one day need or things that I might one day want to look back at. Will that one day ever come?

On the first category, The Minimalists have a simple rule. If it can be replaced for less than $20 in less than 20 minutes, get rid of it. This might seem like a horrible path to disposable consumerism but really it’s the opposite. Once you have this maxim fixed in mind, it stops you buying things “just in case” too.

By far the biggest volume of “just in case” stuff I have is PC hardware and equipment. Some of the stuff is at least 15 years old and so completely obsolete but I’m having hard time letting go of it. This has been really frustrating. I look at it, I know it’s basically junk, but I just can’t bring myself to do it.

So, rather than set myself the goal of getting rid of it I’ve instead decided to focus on WHY I don’t want to get rid. I’ll use this blog to look at just a few of the items I find it hard to let go of and try to capture why it’s important to me. With that done, I hope I’ll then take the next step.

I’ve never done much work with groups in PivotTables but I have used PivotTables a lot. One thing I like do is make a simple PivotTable and chart and copy this sheet multiple times, editing as appropriate. I then link charts in Word to the data in Excel. This makes it easy to go back and make modifications

I’ve been working on a sheet this morning and, to my horror, have discovered that my previous efforts are being altered as I update subsequent efforts. It’s a bit like that scene in Labyrinth where Sarah discovers her lipstick marks have been changed. Of course, when you are working on lots of charts your memory plays tricks on you so I had to actually CHECK that this was really happening.

It really was.

A quick Google reveals that:

To help improve performance and reduce the size of your workbook, Excel automatically shares the PivotTable data cache between two or more PivotTable reports that are based on the same cell range or data connection

Usually this isn’t a problem unless you use, for example, grouping. In that case it does the grouping in the shared cache, thereby updating all your previous tables and charts. “Your mother is a fragging aardvark,” indeed!

This article explains how to unshare the cache but I don’t want a separate cache for each chart so I’ll settle for unlinking and embedding the charts in Word instead.

I’ve been creating Office Themes and colour palettes for our team so we can have a more consistent visual brand on throw away documents.  Why? Because throw away documents have a habit of either a) becoming a standard document or b) finding their way into broader circulation.

I’ve had a lot of success with this when it comes to Word and Excel but just now I wanted to get the colour palette in Outlook sorted.

I managed to go all round the houses on it but it’s actually extremely simple.

  1. Exit Outlook completely
  2. Go to %appdata%\Microsoft\Templates
  3. Right-click on “NormalEmail” and choose “Open” NOT “New”
  4. Edit the Theme and Theme Colours (even applying already established Themes/Colours)
  5. Hit save and close

Simple.

Found a new annoyance in Excel. I am analysing some data in Excel that’s been extracted from CiviCRM. Most of the data was submitted via webform. I easily managed to pull the URL out of the data to view the original webform submission. However, clicking the link in Excel I get an error:

Microsoft Excel Error
Unable to open URL. Cannot download the information you requested.

A quick Google brings me to this site. Of course, you need to be an authenticated user to view the web form but Excel is unable to authenticate so it just fails. Well, in reality it just sees a 404 and tells you the link is broken. Once Excel makes this decision it won’t pass the URL to the browser to open. Great.

So, another quick Google about stopping Excel validating links brings me to Stack Exchange. Of course, I can’t comment on SE due to their chicken/egg “reputation” rules so the only option I have for drawing these two threads together is this blog post.  Hope it helps!

It’s been a long time since I hosted and ran any websites. Back in the day I did the forum administration for Arch Linux and had great fun playing with phpBB patches and CSS. In one of my previous jobs I had to set up an online directory application site for the Tower Hamlets Family Information Service. That was quite fun and I learned a lot. Unfortunately, none of my work remains today. Now, rather than having a landing page for the directory, the application is mainly accessed via forms embedded in the main Tower Hamlets website. You can see the total lack of TLC on the results pages. This is how it looked when we launched in 2010:
[vimeo 13852075 w=640 h=480]
Of course, the overall look of the site has completely changed but even for 10 years ago I think it looks better than the current offer.

We’ve just launched a new site at Healthwatch Bucks and I’ve been making a few tweaks today because our developer is literally moving to France this weekend. He’s put in a major shift on it this week and we’re really grateful for his efforts!

My favourite tweaks of the day were manually editing an SVG file (with a text editor) to change the colour and finding out how to resize it as a background img. Seems quite simple looking back now but where you’re starting from near zero everything seems like a challenge!

I had a devil of time trying to do this yesterday. The first time through it all seemed fine until I added the certificate to the Windows Cert store. It went in under “Other People,” not “Personal” and I couldn’t select it to sign my emails. Figuring I’d done something wrong I revoked the cert and applied again. And again. And again. Then I found a great tip that suggested I check to see if the Private Key for my cert was found. It wasn’t. So I started looking into how where my Private Key even was…

Turns out the Comodo site plain doesn’t work with Chrome. Probably the permissions are too restrictive. I tried with IE and suddenly it all made sense and it worked just fine first go.

What I really wanted was a certificate that would let me sign a PDF, I’m not really that interested in signing my mails. Sadly the template used by Comodo doesn’t seem to be set up in the idle way for document signing but it still works!

I’m running Arch Linux ARM on my Pi and I just had WAY too much trouble getting distcc working.

First, my most idiotic mistake was not having distcc installed on the master (the Pi). I know how that happened. I was going to install and decided to -Syu first, then forgot.

Secondly, I was trying to get it to work using the makepkg method, as opposed to the standalone method. What’s the difference? That brings me to…

Thirdly, the guides I was using aren’t great.

What you need to know

If you are trying to cross-compile using distcc on a Raspberry Pi you will almost certainly end up here: https://archlinuxarm.org/wiki/Distcc_Cross-Compiling

Note the warning at the top: “This guide will appear vague and incomplete if you aren’t sure what you’re doing. This is intentional.” That’s rubbish. It’s just very badly written. The only knowledge of “compilation and toolchain components” needed to understand this guide is that the toolchain needs to be installed/built on the client. That’s it.

Once you’ve read the dire warning you are directed here: https://archlinuxarm.org/wiki/Distributed_Compiling

Don’t go there now. The rest of the page is about setting the client up, finish that first.

The biggest problem with this guide is it doesn’t adequately explain just how much of the guide you can skip if you use WarheadsSE’s distccd-alarm package. The fact that WarheadsSE doesn’t explain this in README on his github doesn’t help either. Basically, WarheadsSE’s pkg does everything.

As explained in the guide, WarheadsSE’s pkg builds a toolchain for each ARM architecture and puts them into separate packages. So, build his pkg on your client machine (X86_64 only) and install the pkg for the toolchain you need. For me and my Pi it’s ARMv6l hard.

This package automatically creates the symlinks described in the “Make nice with distcc” section. Further more, it creates it’s own conf file at /etc/conf.d/distccd-armv6h (obviously depending on your ARM architecture). This contains the correct $PATH variable and is sourced automatically when distcc is run on the master. No need to edit /etc/conf.d/distccd at all. You will have to set the allowed hosts in /etc/conf.d/distccd-armv6h, though.

Next, read the recommended guide to setting up the master (https://archlinuxarm.org/wiki/Distributed_Compiling). At the bottom you’ll move to configuring the client but the other guide has already taken you through that step. All that remains is to start the systemd service on the client.

Troubleshooting

I tried to troubleshoot using the makepkg build method. What’s that? Well, it’s the only method explained in the Arch Linux ARM guides. It basically means you use makepkg to run distcc. This is what you want to do in the long run but the error handling is rubbish. So, instead, go and have a look at this guide: https://wiki.archlinux.org/index.php/Distcc

This guide explains how to run distcc without makepkg aka “Standalone” method. Short version:

1) add your client IP address to /etc/distcc/hosts on the master
2) create file on the client called hello_world.cpp and paste this into it:
// 'Hello World!' program

#include <iostream>

int main()
{
std::cout << "Hello World!" << std::endl;
return 0;
}

3) run this distcc g++ -c hello_world.cpp

Now you can see what distcc is trying to do. For me it showed that connection to the client was refused. Obviously (duh) I needed to open a port in my firewall on my client. With that done it just built.

Now you can go back to using makepkg -A.