Currently we are all stuck in front of webcams, at least half the time. I do have a laptop—a gift from a kind friend—and it does get used, but the rest of the time I am sitting before two old monitors (one of which recently had to be repaired) and a lovely cherry keyboard: and no webcam. No matter: I’ve a cheapo usb-thing and it works fine. I’ve also an old phone handset from an 80s landline wired into two 3.5mm jacks—it had an electret microphone and works fine. It gets laughs on zoom, but it’s easier to pick up and put down than a headset, and I can hear if anyone’s creeping up behind me.
[Read More]Notes of various kinds for things which have taken a while to work out, or strike me as particularly noteworthy.
PdfJam: for more than just pdfs
Can we take a moment to remark on how wonderfully useful PdfJam is? Behind the scenes it’s just LaTeX. Thus you might be surprised to notice that
pdfnup --nup 1x1 --paper a5paper --no-landscape image.png
Is an excellent way to turn an image—say, a bunch of screenshots of a page which you concatenated with
convert image1.png image2.png image3.png -append image.png
Into (say) an a5 pdf, ready to be turned into a full-length pdf with
[Read More]Compiling KiCAD/WxWidgets
Since this has, alongside other things, occupied a whole day, I
thought I’d put it up here in case anyone else tries. Back in the day
KiCAD had a python scripting console. Currently that would be very
useful: but it’s implemented with gtk2, and everything ships with
wxwidgets compiled against gtk3. So we have to compile wxwidgets,
which is fairly straightforward: get the
sources
compile—except it’s not a ./configure, make, make install job:
rather a python script calls other python scripts, and so on. And of
course there was a problem: a function whose argument might not be a
char buffer throws a format-security error, and the whole thing won’t
work. Normally we’d just edit the GCC flags and set
-Wno-format-security
, but how to do that here? I spent ages ag-ing
around the sources trying to find out where the python code actually
called gcc, and was about to give up. Then I thought of environment
variables. In fish (which is not quite bash-compatible) we do:
'Off and on again' remotely
The internet in Durham, which was allowing me to use the workstation there remotely, has gone down; support tell me to ’turn it off and on again’. But obviously I can’t do that remotely. Ah well, it wasn’t really needed. But what if it were? I’ve run servers over unreliable wifi links with good uptime before, with a failsafe script which rebooted everything if it couldn’t ping the gateway for too long—and looking at the logs, sometimes it was needed. But I can’t reboot the router (and though I’ll replace it, there’s little opensource DSL firmware, so I’m never going to be able to reboot the modem). So what we need is the remote equivalent of pulling the plug out and putting it back in again. I have a few of those Poor Man’s Rasberry Pi boards lying around; one could surely be made to pulse a relay if it can’t ping after a while? But the only relays I have (mainly rescued from a faulty boiler) are designed for industrial 24v DC. I hunted for a while and then gave up on finding any 12v relays. Isn’t there a circuit called a voltage doubler? As usual, SM0VPO has some information. I was going to use a 555 timer, but that shamed me: I can still build a discrete multivibrator—it was one of the first circuits I ever built, after all. But first off the relay inline in an extension cord. Here I made a completely daft error: the box is about 100% too long, because I thought the cable exit grommets went the other way round. But anyhow, here is how to make a box out of hardboard, that most intractable thing:
[Read More]Poor Man's Raspberry Pi
Embedded Linux is currently all the rage with little boards like the Pi running a full-fledged Debian just to flash a few LEDs. Now certainly, the Pi would find uses here, but it’s hardly cheap. What is cheap—or even free—is defunct wireless routers. They, too, are embedded systems running Linux. Unlike the Pi they have on-board wifi and an ethernet switch; the cpu isn’t usually too bad either. I also picked a few up for £0.99 on Ebay. Here’s one:
[Read More]