Saturday, 14 September 2019


I've reached 50 followers. That's about four dozen more than I expected when I started this blog. And 1.5 million page views. Wow.

So what is the purpose of this blog. It's kind of like a journal, in which I post things that I've done, things that have happened, thoughts that I've thought

So thanks to the 48 unexpected followers, and here's to the next 50!

Raspberry Pi 4 workstation

I've been using a Raspberry Pi 3 for a couple of years now as a workstation, but only as multiple terminals, plus a bit of Googling. When the Pi 4 came out, at first I couldn't get hold of one, but after a while they became easily available.

You can get them in 1gb, 2gb and 4gb.  But you can't upgrade. The cost is £35, £45 and £55, so I got the 4gb version. I also got the recommended power supply (I can try it out later with my own power supplies). My own? I'll just explain that.

I use standard PC power supplies (and in some cases, they are powering an ordinary computer). I take the 12 volt line, and feed that into the ethernet cable, using a POE adaptor. Ethernet cables are 8 wires, but only four of them are used. So this uses the other four to carry power. Then I feed that 12 volts (which will have dropped a bit by the time it arrives where it's needed) into a little card that drops that 12v to what the Pi wants, which is about 5 volts (or maybe 5.5). This means that I don't need lots of Pi power supplies; that little card is very cheap. And it means I don't have a big overhead in the power conversion.

I set up a 64gb SD card using the latest Raspbian, Buster (I only recently found out that the various versions are named after Toy Story characters). But then I hit the first problem - I only have HDMI cables, and the Pi 4 uses mini HDMI. So on Ebay, I bought a little converter from HDMI to mini HDMI.

I plugged in a USB keyboard and USB mouse, and powered up. To my great happiness, the Pi 4 was immediately driving my Acer et430k monitor giving me 43 inches of 3840 by 2160 loveliness. I was half-expecting to do a lot of messing about for that, but it "just worked".

The USB keyboard is rubbish - what do you expect for £4? But I was able to replace that with one of my beautiful big IBM keyboards (you can still get them, they're about £100, but if you do a lot of typing, and like a positive clicky keyboard, it is perfection). That has a PS/2 interface, but I have a converter for that, and that worked first time too!

But the sound didn't work. The HDMI interface should feed sound into the monitor, and it wasn't working. I haven't given up on that yet; I feel that the problem is at the monitor end. But I do want sound! So I used the audio output on the Pi 4, and fed that into a pair of powered speakers. And that worked first time too!

So then I added Firefox, and xfe (the file manager that I like), and Nedit (my favourite editor). A slight problem there; most of my computers are Fedora, and I know how to add software to those using yum. But the Pi 4 is using Raspbian, a derivative of Debian, and that uses apt-get. I think all the packages I want are probably available, but the names are slightly different. Google gets me there.

And printing. I have three printers, my Old Faithful HP Laserjet 6p, which I've had for 25 years. That was very easy to set up because I use Jetdirect, an ethernet-to-parallel converter. The Dell was easy too, because it is natively a network printer, and the Samsung took a bit of messing about to get that working with the Pi 4.

Networking can be done using the built-in Wifi, or the Gigabit ethernet port. At first, I used the Wifi, but it didn't play youtube smoothly. So I used a speed tester on it. I found that my various Wifi access points were giving me 5mbps, 7, 10 and 20, with the 20 running off the TP link. But with a wired connection I got 60 mbps, which is about what I'd expect, because my link to the internet is 100 mbps. Roll on Gigabit broadband!

So what's the point of all this?

The Raspberry Pi 4 takes about 2 amps at 5 volts, which is 10 watts. When I put my hand above it, I can feel that it's slightly warm. But that is replacing a full size computer that was pulling about 150 watts. And it isn't just the cost of the electricity. It's the heat. All that 150 watts comes out as heat, which isn't a problem in winter, but we had a really really hot summer this year, and even opening the window didn't help, because it was hotter outside than inside. But next year, when the hot weather arrives, I can power off all my computers in the office except the Pi.

Thursday, 5 September 2019

Setting up a phpBB forum

phpBB is one of the more commonly used forum software packages. I used it on a Linux Fedora box, and it was fairly easy to set up.

But I wanted to move the whole thing to a Raspberry Pi, as part of my electricity economy drive. I had a Pi 2 that wasn't being used, and that has 1 gb of memory, so that was my intention.

First, I tried to set it up with Fedora. That's not what most people use on a pi, but I thought it might be easier since I was moving the phpBB from a Fedora box.

Fedora version 30 is available for the pi (and version 29). But when I set it up, I discovered that it occupies a couple of gb, and there seemed to be no way to tell it to use the whole 64gb on the SD card. It said that it did; the partition was expanded to 64gb, but the partition wasn't being fully used. It was only after I realised that, since it was using the xfs file system, you can't use fsck to fix it, you have to use the xfs equivalent, "xfs_growfs /". And that expanded it to 64gb, but really the install process should have done that for me.

And then I found that there were four processes running continuously, which meant that the loading of the pi was 4, and that was before I was running anything.

And when I installed PHP, it gave me version 7.3.8, and phpBB won't use such a recent version of PHP, and at that point I gave up on Fedora on the pi.

So, on to Raspbian, which is what most people use on the pi. I tried the latest version of Raspbian first, "Buster". That didn't work, because it also gave me a too-recent version for PHP, so I tried using the previous version , "Stretch". Whatever happened to good old-fashioned version numbers?

I had a lot of false start with that too, but I eventually got it to work. Here's hw.

First, I installed Raspbian Lite. Then:
apt-get update
apt-get install network-manager -y
        Then I used nmtui change ip to
        Then I edited /etc/ssh/sshd_config to allow rootlogin

Then I installed some more stuff:

apt-get -y install rdate
apt-get -y install rsync
apt-get -y install dcfldd
apt-get -y install apache2
apt-get -y install php7.0
apt-get -y install php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0-xsl
apt-get -y install mysql-server
apt-get -y install libxml2-dev
apt-get -y install php-xml

Then I added a user, and edited the apache configuration, so it would run using https.
And then I copied over the ssl certificates

And now phpBB
bunzip2 phpBB-3.2.7.tar.bz2
tar -xf phpBB-3.2.7.tar
rm phpBB-3.2.7.tar

Then, as root, I created the database.
use db; 
UPDATE mysql.user SET authentication_string = PASSWORD('****') where user = 'db' AND Host = 'localhost';

Then I could do the install of phpBB, which was only what really needed to be done, because I was going to copy the already-existing phpBB. So to do that, on the old forum, I did a backup. I copied the file to the raspberry, and tried to do a restore.

It didn't work.

So I tried to do a backup of the newly created database, and that worked, and I tried to restore that backup, and the restore didn't work.

Oh, great. Millions of people are using this system, and if you do a backup, you can't do a restore.

So I googled some more.

cd /home/rd/pub/phpBB3/includes/acp
acp_database.php on line 219
line 219 incorrectly tries to reference "extensions", instead of "extension"
So I edited that line, and then the restore worked.

I would estimate that doing this job took about a week, and it should have taken an hour. Partly because there are so many things that don't work as they should, and partly because there are so many things that don't work with each other.

But, I got it done in the end.

So now I can try out my new Raspberry Pi 4, which I want to use as a workstation with a 4K monitor.

Friday, 30 August 2019

When Brexit happens, what happens to VAT?

We're being told to prepare for a no-deal Brexit, and my current thinking is that the most likely scenario is that we will blunder out on October 31 with no deal. So, I'm trying to prepare.

Currently, when I sell to a customer in Germany, I charge him VAT at the rate of 19% (that being the German rate, other countries each have their own VAT rate). I send that tax to Germany once per quarter, via a thing called the "Union VAT MOSS" scheme.

So the first question is, do I charge German customers VAT in the event of a no-deal Brexit. I phoned HMRC on 0300 200 3700. I spoke to a guy there who knew VAT, but not Brexit, and he said "It depends". So I interrupted him and said "No, it doesn't, I'm talking about a no-deal Brexit, so it doesn't depend on a deal". So then he said, "If there's no deal, then UK businesses have no obligation to charge VAT to EU customers. It's just like Canada or China. I think." He wasn't certain; he's had no official guidance on this. But he thinks there will be a hotline for this sort of question (and that will be saturated as soon as it opens) and a web site.

The second question is more complicated. On October 31, the "Union VAT MOSS" scheme ends. But I will have dutifully charged EU members VAT until October 31. I'm next due to pay VAT just after December 31st, so I wont be able to pay my EU VAT via the "Union VAT MOSS" scheme.

I'll have to join  the "non-Union VAT MOSS" scheme, which means I have to sign up at some foreign country (maybe Germany, or Ireland?) in order to pay that remaining month of VAT. Wouldn't it be nice if the "Union VAT MOSS" scheme stayed open until, say, January 31 2020? But I doubt if anyone has made any plan for this.

So, I have no idea, neither does HMRC, nor does anyone else.

And what about the other EU countries. What will happen when I suddenly stop sending them the VAT that I've been sending them each quarter. Will they start sending me letters asking for their money, money which I don't think they are due? Are they ready for the change on October 31?


Monday, 19 August 2019

Angie's disk

I found a 5 1/4 inch floppy labelled "Angie's disk", so I wondered what was on it. But none of my computers have 3 1/2 inch diskette drives, let alone 5 1/4.

I went up to the attic, and heaved down an ancient AST 386 with both kinds of diskette drive; I remember this computer well, at the time is was my best computer, used for compiling Doctor Solomon's Antivirus Toolkit. But it needed a mono monitor, not one of the VGAs that we use today.

So I went to the shed and dug out a couple of monitors. One was labelled as not working (so why did I keep it?) and the other had a label that had deteriorated with time and was unreadable. Sure enough, neither of them worked.

Back up to the attic, where I had another mono monitor stashed away, this one labelled as "working". Hurrah! And when I connected it to the AST, it all worked.

Except that the AST had been unused so long, the cmos battery was dead and it had lost its setup. I opened it up, and some genius had written the number of cylinders, heads and sectors on the case of the hard drive. So I set it up for that, and it booted up to Dos.

All the files on the hard drive were still there, dated 27 years ago. And the floppy drives worked, so I was able to see what was on the diskettes.

There was Alley Cat, which had been a favourite game of both the girls (but it needed CGA), there were several other games thatneeded CGA, but there were a few that worked on my mono monitor, such as "Funnels and buckets", a game for exercising your mental arithmetic.

But there wasn't anything there that is likely to work on a modern computer, plus both girls seem to have defected to the Apple camp.

So, with a sigh, I put the computer and monitor away.

You never know when you might need a 27 year old computer and monitor.

Wednesday, 14 August 2019

Hurrah for DOS

I have a Western Digital 200 gb drive that I suspect of being bad, so I wanted to test it. The Seagate drive test didnt help, nor the Maxtor. Obviously, I need a Western Digital drive test.

Google to the rescue; I easily found DOSDLG.exe. But it has to run under Dos.

So I burned it to a CD, and burned Freedos to a CD. I booted from the Freedos CD, and swapped the CDs.

Freedos thought that the Freedos CD was still in place.

Several minutes later, I decided that I wasn't going to be able to change its mind. And I couldn't add the WD diags to that CD, because it was burned as an iso.

So I dug out an old 3 1/2 floppy drive (remember those?) to connect to the test computer, and I found an old bootable Dos disk, and that booted up OK.

But then that didn't recognised the CD drive which had the WD diags on. So I thought, OK, I have to copy the WD Diags to a floppy, but I don't have a working computer with a floppy drive; I stopped using floppies yonks ago. So, I thought, no problem, I'll take a computer apart and add a floppy drive.

This was getting ridiculous. You know the situation where you're trying to solve a small problem, but to do that you have to solve a bigger problem, which entails solving an even bigger problem ...

So I stopped and had a think.


So I formatted a USB drive to FAT-32, and installed Dos on it using Rufus.exe (find it with Google). Then I copied the WD diags program to it. I told the test computer to boot from the USB drive, which it did, and then I was able to run the WD diagnostics program.


Saturday, 3 August 2019

Rsync trick

I was trying to rsync from one computer to another. The destination was Fedora 30, the current version. The source was fedora 1, a ten year old version. And rsync complained about a protocol mismatch, and much googling, trial-and-error and brain-sweat didn't give me an answer.

So I played a trick on it. I used nfs to mount an export from the old computer, to a temporary directory on the new computer. Then I could rsync just fine, because as far as rsync was concerned, it was from Fedora 30 to Fedora 30.