Pages

Thursday, 23 June 2022

New meter

New meter

In March 2021 I was asked by EDF, my electricity supplier, to read the meter. I tried, but the display had failed. I reported this back to them, and they said I needed a new meter.

Fair enough, I thought. But the next 15 months led to no new meter. Twice I had to cancel their proposed visit because I was in hospital, once they came with the Wrong Sort of Meter (two phase instead of three) and another time, the installed just didn't turn up.

But on 21 June, a man arrived with the right sort of meter.

He said it would take an hour of no electricity. I got ready for this by poering down all my computers, because my UPSes wouldn't run that long. THen he made the changeover, and I had power back - he took less than half an hour, because there were no complications.

But I haven't had free electricity for 15 months. With the faulty meter back at base, they'll try to get a reading from it - failing that they'll "estimate" my consumption.

So then I powered the computers back on. I expected at least one failure - that's what you get when a whole bunch of computers are powered off then on. But everything worked just fine!



Wednesday, 22 June 2022

Double VAT

Double VAT

Each quarter, I need to work out how much VAT to pay. It's a very complex calculation. I need to work out how much I've received from each EU country, and apply their particular VAT rate, and when all that's worked out, I need to visit the Irish tax website to report the numbers and pay the VAT owed.

Now that we've left the EU, do I still need to pay the EU this tax? I dn't know - I don't really understand how this ought to work.

For the UK, I need to total UK sales each day, list the VAT-registered purchases, report both numbers and pay VAT at 20% on the difference.

Obviously, I've automated this as much as I can. Each day when I do the billings, I append to a file totallog.txt what the sales are. This is done by the same routine that displays the summary totals.

Yesterday, I wasn't sure if I'd done that last part, so I had a look at totallog.txt to see if it was recorded there. What I saw was scary. What I saw was that every day, since May 3rd, the totals had been recorded twice.

I checked my program. It only recorded this once. How did it appear twice? I used Google to see if there were any clues there - no luck. I added some code to alert me if the output print was called more than once - it wasn't.

Eventually, I found the problem.  I opened the totallog.txt twice, once for appending the banked amounts, once for recording the eu and non-eu numbers. But I hadn't closed the file in between doing these, so with the file twice-opened, it was being appended to twice.

This mistake would have doubled my VAT bill. I'm glad I found it before it fed into my next quarter VAT returns.

 



Thursday, 19 May 2022

Ancient computers

Ancient computers

It was 1984, and I was establishing myself as some sort of PC guru. I was writing for most of the PC magazines, and for the IBM PC User Group newsletter, and for the stockbroker that was my day job (my best article was "The bus has no driver", which countered the idea that economies are run by some elite person or group; in this case, the Saudi oil minister).

I realised that I was spending an hour commuting, each way, and those hours weren't productive. So when I saw the NEC PC-8201a, I thought, I can use this on the train.

It's small, A4 sized, and fitted nicely in my briefcase. It ran off four AA batteries (and I kept a spare set handy, It had 28kb of usable memory, which was enough for two articles.

It cost me £137, because I got it as a dealer from Pete and Pam (later P&P Distribution) and it was a fantastic bargain. The keyboard is a good, full-travel keyboard, the cursor control are the most logical I've ever seen. The only drawback was the screen, which was 40 columns wide and 8 deep, but I could live with that.

I'd spend the commute writing an article using the TEXT editor, download it to a PC using the TELCOM program. On the PC, I would spell-check it, reformat it to 78 columns, and print it out. Yes, in that days, even PC magazines didn't have computers, and needed printed text.

I still have that PC8201a. I got it out recently, and it didn't work. I opened up the battery case, and one of the traces was badly corroded, so I bypassed it with a bit of wire, and that made the battery case work. Then I struggled to get the NEC working, because I'd forgotten that there's an on/off switch on the side.

Now it works perfectly.

Bill Gates told me that the Basic for that computer was the last Basic that he wrote himself.

The next computer was the Sinclair Z88, which also ran off AA batteries, and had an 80 column screen. But that screen was hard to read, the keyboard was terrible, and I hardly used it. It didn't work when I tried it recently.

Then Amstrad brought out the PC100, another nice A4-sized computer using AA batteries. I got one for each of my daughters, but I don't think they ever used them. Now when I tested them, one worked perfectly, the other didn't.

Another nice buy was the Psion series 3a. This was a pocket sized computer that ran Dos. The other good thing about it is that it had a built-in database, and you could put your contact details into it, including phone number. Then you could phone the contact, and the Psion would emit the touch-tone signals to your phone, and you didn't need to dial. OK, not as slick as today's smartphones, but this was 35 years ago, and portable phones barely existed.

Another pocket size computer was the Toshiba Libretta. That came with Windows 95. I got it because I thought I'd use it for powerpoint presentations. In practice, it really wasn't very useful.

I also had another battery powered computer, but I don't remember the name, it wasn't useful at all, and it's probably buried somewhere ni a cardboard box. Its distinguishing feature was that it use 1 1.2 inch floppy disks.

If someone asked me to recommend a portable, battery-powered computer to be used as a writing system, I would definitely go for the NEC. They are still available on eBay, but at twice the price I paid.  runner up would be the Tandy 100, or TRS-80 100. Same machine, but an inferior keyboard layout.  The Olivetti M10 is the same. But they aren't commonly available.

Second would be the Amstrad, which you can get on eBay for £60 or so.



Sunday, 10 April 2022

Facebook hello

Facebook hello

For no apparent reason, Facebook has restored my account




Tuesday, 5 April 2022

Disk failure

Disk failure

I got my first warning, when part of an important file, that was text-only, became corrupt and had binary stuff in it. I was able to replace the binary from a backup.

Then it happened again. And again. I'm so glad that I use a flat-file text-only database.

This is an important computer, it's the one I do billings from, and is therefore inside the innermost bastion of my firewall. That turned out to be a big problem later.

I used the SMART system, which tells me how many bad sectors there are on the drive, and it was large - and growing fast. This disk was on the verge of failing.

So, first I built a replacement computer. I used an Intel motherboard (I bought a job lot of these a few years ago, and they're great) with the CPU an E7500 dual processor running at 2.93 GHz. I put in 8gb of memory, and an 80gb 2.5 inch drive.

Next, to configure it, I used a 192.168.2.2 ip address, because that's in the range I use for "inside", the innermost bastion. That meant that I couldn't connect it to the usual 10.x.x.x range, it had to connect to the "inside". But the switch that is fed by the "inside" is way across the room, so I cleverly put a switch between the firewall "inside" and the switch across the room. Everything still worked. So I took a feed from the new switch.

That should work, right?

But it didn't. And I still don't know why.

I tried lots of things, such as replacing the new switch, and many others that didn't work.

Eventually, I did a "hail Mary" (an American football term for a desperation move) and slung a 10m cable from the old switch right across the room to the new server, and to my utter astonishment, it worked!

So I loaded up the new server, partly from the failing old one and partly from the backup, installed apache (latest version, and configuring that led to much grief).

Eventually, I got everything working, put the new server in the place where the failing server was, and everything is OK now.





Monday, 4 April 2022

Fetchmail follies


Fetchmail follies

First, I'll explain my email system. It's complicated.

To tell other computers where to send email for me, we use the DNS (Domain Name Service) system. In that, an MX (Mail eXchange) record tells other computers where to send my email. There are two main servers, mail2 and mail1. The MX record tell the priority. So, mail is sent to mail2, unless mail2 isn't working, in which case it goes to mail1. Both are Raspberry Pis, version 1, vintage 2012. I also retreive email from several AOL and Gmail accounts.

Mail1 gets spam, nearly everything. Because it shouldn't be used unless mail2 isn't working. I take advantage of this by setting up a bunch of MX records with even lower priority as spam traps.

But I don't want to visit both computers, so I set up fetchmail, to visit each in turn and use the IMAP protocol to collect unread mail and put it on my email reading computer., xantl. To read mail I use pine or alpine, a text-only reader. That means that I don't have to worry about unpleasant surprises that you can get in web-based readers.

When it gets to xantl, it passes through my mail spam filter,sorting the mail.

So what went wrong? Suddenly, fetchmail stopped fetching mail from mail2 and mail1. I hadn't made any recent changes. This happened a few weeks ago.

So I tried fetchmail -vvv (verbose) but that told me nothing useful.

I tried reinstalling fetchmail. i tried installing fetchmail on another computer. I tried reinstalling dovecot (the IMAP server) on the pis. nothing worked. I tried updating OpenSSL - no joy.

I tried using .forward on mail1, but that didn't help. and all this while, I was reading an dealing with emal on mail2 and mail1.

I tried changing the MX records to a different computer. No use.

Then I did what I should have done in the first place. Google is a great resource, but I also have a file where I keep a record of past problems and thier solitions, and I found this gem.

 To see what fetchmail is doing:
fetchmail -Nvvvd0 --nosyslog

So I did that, and it told that the problem was that fetchmail couldn't negotiate a secure channel with mail1. But I don't need a secure channel because the whole network is secured.


So I added 

 sslproto '' 

to the .fetchmailrc, telling fetchmail not to use secure sockets.

And everything worked!

I think this happened because fetchmail updated itself without telling me. The fact that a couple of weeks of Googling turned up nothing, makes me think that I'm the only person who has ever had this problem. There can't be many people using fetchmail release 6.4.23 to retreive mail from 10 year old Raspberry Pis.



Monday, 7 March 2022

Facebook farewell

Facebook farewell

 I logged in to Facebook, the first time for ages, and I got this:

 

xxxx, Login approval needed
We've noticed a login from a browser, device or location you don't usually use. We need to confirm that it was you before you can get back on Facebook. Learn more

xxxx xxxxxxx Facebook
 
Choose how to confirm that this is your account
 
Complete a few steps to confirm that this is your account
 
 
 
 
So I clicked on continue. After several seconds I got:


 
 
 
Choose an option
How do you want to confirm that this account is yours? You can try any of these options more than once. Learn more