Pages

Thursday 26 September 2019

Raspberry Pi 4 cooling

A lot of people seem to be saying that the Pi 4 runs too hot, and needs cooling. I thought of passive cooling, and started sawing up an old heat sink into small Pi-sized pieces, but that turned out to be more work than I'd thought. You can buy a Pi 4 set of four heat sinks on eBay for 99p. It's just aluminium with fins.

Then I thought, wait. I have innumerable small fans. I pulled out a 60 cm wide by 25 cm deep fan, because that seemed to be about the right size, blue-tacked it to the Pi (I didn't have any bolts that were long enough and thin enough),  then realised it needs 12 volts, and the Pi can only supply 3.3 or 5.

Not a problem. The way I power Pis, is by taking wires from the 12 volt power supply of a PC (usually a PC nearby), and running that over a power-over-ethernet cable to wherever the Pi is. Then I feed the 12 volts (more like 10 or 11 by the time it's run over all that wire) and use a voltage stepper-downer (eBay, £1) to take it to 5.5 volts, which I feed into the Pi.

So I took that 12 volts feed, and fed it onto the fan. The fan is almost silent (I can hear it if I get really close to it and listen really carefully) and brought the Pi temperature down from 56C to 39C. Which means that I can now try to overclock it!

Sunday 22 September 2019

Democracy

Imagine a system of government where important issues are voted on, but once that vote is done, the issue can never be revisited. Imagine a situation where if the Nationalist Social British Worker's Party is voted into power, it can never be voted out again.

Imagine a situation where the electorate, once it has spoken, is not allowed to change its mind when the situation changes, or they discover that things are not happening as promised.

Imagine that, when some people who want to change things, are told "No, we voted on that years ago, so it has to be like that from now on."

And then imagine how it feels when, people who want change and are willing to have a democratic vote for change, are told "No, we had a vote on that once before, so we can't have a vote again, even though we have now found information that has led us to change our minds"

When the General Election happens (probably in the next few months), I will be voting Liberal Democrat. I haven't forgotten their past incompetence, but that is insignificant compared to the appalling mess that is Tory, Labour, UKIP or Brexit. Because they've found a way out of the mess that those parties got us into, and the way out is simple.

Revoke article 50. End the nightmare of Brexit, and we can dump the way that one single issue has dominated politics to the exclusion of all other issues, and get back to tackling all the other issues in this country.



Friday 20 September 2019

Deal or no deal?

I've started seeing the advertising. "Prepare for a no-deal Brexit."

I've also seen that a no-deal Brexit would be illegal, since Parliament passed a law to say so.

So I'm supposed to prepare for something illegal?

I checked out the government's web site. They're saying that if there's no deal, then I'm bound by the VAT laws of the EU.

Wait, what? What happened to "clean break"? What happened to "Take back control"? I'm being told that, if there is no deal (which would be illegal) then I have to register with the VAT authorities of an EU country (I can choose which) so that I can pay VAT on digital sales to EU countries, to the EU country who made the purchase.

I really don't understand this. Canada (for example) has a VAT (they call it GST), but no-one has ever suggested that I have to send money to Canada for sales made to Canadians. Likewise every other foreign country. So, under no-deal (which is illegal), the EU becomes 27 foreign countrues. Why do I have to obey their tax laws?

But, maybe this won't happen, since no-deal is illegal.

I shall have to consult my accountant, and get a written opinion. That way, if they're wrong, I can point the finger at the accountant.

On October 31st, something might or might not happen. If it happens, no-one knows what the result will be. If it doesn't happen, no-one knows what the result will be.

I'm as ready as I'll ever be. Are you?

Thursday 19 September 2019

This email appeared in 3 known data breaches.

Firefox gave me this warning.



Evite is an email greeting card site. I've never used this, but I'm guessing that someone sent me an e-card, which gave them my email address.

Moneybookers I have used, but not for a very, very long time, and with a very long password, and they aren't saying that was collected.

Verifications.io? That web site doesn't exist, and I've never used it in the past.

Another of my email addresses was compromised at LinkedIn. I already knew about that, because I've been getting spam claiming that they know my password, and giving the password that I used there a long time ago.

You can check your email address at https://monitor.firefox.com/scan




Make sure that you don't use the same password on different web sites.

Saturday 14 September 2019

50 followers!

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:
raspi-config
apt-get update
apt-get install network-manager -y
        Then I used nmtui change ip to 10.11.0.37
        Then I edited /etc/ssh/sshd_config to allow rootlogin
reboot

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.
mysql
CREATE DATABASE db;
use db; 
UPDATE mysql.user SET authentication_string = PASSWORD('****') where user = 'db' AND Host = 'localhost';
GRANT ALL PRIVILEGES ON *.* TO 'db'@'localhost' IDENTIFIED BY 'db';
exit






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.