Skip to content

Dear /dev/null, II

tl;dr: 302 → Pelican (URL not yet known)

It's time to simplify my web presence. This massive ball of 4yo PHP with an unknown number of security risks should go, given how "much" I've been posting over the years. (Heh is anyone even reading this? I'll never know because I've already CSS-disabled the comments form. :-D)

I do like the idea of Pelican for static blogging, for dumping some content with more depth than Twitter every now and then. Sadly I couldn't figure out how to have it import my S9Y posts, so let's instead resort to recursive wget. Added benefit: Preserves all URLs, no dead links \o/ Just in case some of this may actually still be useful some day.

... if high quality blogs and RSS readers were still a thing, that would be nice though. Maybe one day I'll go expore..

PS: On the topic of quality: The "Preview" button in S9Y appears to be the Publish button or something, and I ended up with 7 drafts of this post published in random order. O_o Also, the delete button isn't actually working.

Puppet 4 on Debian 9 Stretch with nginx (with Puppet 3 agents if needed)

As part of upgrading my machines from Jessie to Stretch, I finally had to pick up Puppet 4. My hosts running testing were trying to do so for a while already, but since Puppet requires the master to be newer than the agents, I've always just had a pinning rule in place to stick all machines to Puppet 3.x.

It's been quite the operation and I'm not done yet, but let me write down some of my findings for others to maybe use. As always, there are many different ways to achieve this goal, there are existing docs, but they're all outdated in one way or another. (As surely this one will be in a year.)

Continue reading "Puppet 4 on Debian 9 Stretch with nginx (with Puppet 3 agents if needed)"

Dear /dev/null,

That's what weblogs are these days, it seems. :-( And I've just lost way too much time getting this quality PHP software to run on my new webserver.

All it is for me at this point is a place to post random small projects I've worked on. Something fun (ADS-B-related) will hopefully appear soon...

selphy.go - Linux client for Canon Selphy CP-900 photo printer

Last month I ran into a Canon Selphy CP-900 photo printer. It's a pretty neat device, prints pictures with pretty good quality. It even worked out of the box in Linux, but only via USB, and by it pretending to be an ordinary printer. This can have pretty ugly results.

The CP-900, as the first one in the Selphy series, can also take print jobs over WiFi. The nice thing is, other than it being wireless, that the WiFi protocol is just a pretty simple JPEG file transfer mechanism. Just giving the printer a JPEG and have it figure out layout/crop/etc seems to give somewhat nicer results. But of course, only Windows/OSX/smartphone clients are available. Fortunately, after some staring at wireshark, I managed to create a new client for it.

For extra fun, it's written in Go. My first time using the language, and I quite like it. It means the tool is very easy to build, and there are no special dependencies at all, as the Go base libraries already have everything I need.

To try it:
bzr branch http://wilmer.gaa.st/selphy/
And yes, I'm still using bzr. Deal with it. :-)

T-4 days...

Counting down and thinking "next week this time ..." for a while already. Predictably, I've only been able to do a fraction of all the things I wanted to do in the previous post. Me spraining my ankle and ending up on crutches a few weeks ago definitely didn't help with that. :>

The one-way flight will be on Thursday, giving us a whole Friday + a weekend before work starts. Hoping to get stuff like opening a UK bank account done quickly, so I can then figure out the cheapest way to transfer money there; I'll miss the perks of living in a Euro country...

Do you hear that, Doug? I'm coming to London!

Yes, London. You know: fish, chips, cup 'o tea, bad food, worse weather, Mary fucking Poppins... LONDON. Or as I said it on Twitter last week already, I'll be subtracting 309 from my international dialing code.

My team is moving to London over the next months, and I'm moving with it. It's been five years already since I landed here in Ireland by now, longer than I ever expected when I arrived. Living in the UK instead of in Ireland will be a nice change. It's still off the European continent, but with directs flights to home for both of us we'll feel like we're much closer. And I expect there are more advantages that will offset living in what is also a heavily congested city.

I'll still be doing the same work, just in a different location for various practical reasons. The move will happen somewhere halfway the next quarter, so we're slowly starting preparations. Besides packing and cancelling utilities/services/etc, that also means experiencing Ireland as a tourist. After living here for five years, I've still not seen the Giant's Causeway, the Cliffs of Moher and some other stuff ... so should give that a shot now!

I might be posting here a little bit more over the next while. :-)

uhat, using your joystick's hat switch in Linux flight simulators

So I have this fun hobby for a while already, flying.. I have around 50 hours logged by now in the US + Ireland, which means I can more or less land safely now, on my own. In fact I had my first solo in October last year which was an absolutely amazing experience. But sometimes weather just doesn't work with me here in Ireland (either too windy or too cloudy) and instead I go "flying" with X-Plane on my machine at home.

Now X-Plane is a pretty neat simulator, and as long as you use it with a real yoke/stick and not keyboard/mouse, it seems like a useful way to practice. But there's one way in which a flight simulation projected on a single screen, no matter its size, just doesn't beat sitting in a cockpit: the inability to look around in any direction by, you know, just turning your head. Instead, joysticks often have this hat switch on the top to look around. Unfortunately in Linux, the joystick driver gets told that the hat switch is a mini-joystick that the user can move up/down, left/right. Instead of just representing it as four separate buttons (which is what they really are anyway, hardware-wise). X-Plane and apparently other flight simulators can't use this, they need buttons.

This week I wrote uhat to solve this problem. It'll listen to joystick events and if you move the hat switch axes, it will generate button events on a separate virtual joystick device. There's a similar tool called jhat, which generates keyboard events instead, but I never really liked the idea of my joystick pretending to be a keyboard and hoped there were a better way to do this. A week ago I found my answer in uinput. It's poorly documented, but fortunately very simple to figure out. It looks like uinput is just a fairly 1:1 translation of the input subsystem kernel interface into a character device.

It works like a charm for me, with the udev rule I don't even have to think about it, udev will just start it for me when I plug in my joystick. Hugely enjoying X-Plane 10 again. :-D

Debian, dmcrypt and SSD TRIMming

Spent an hour or so this morning wondering how to get my Debian initramfs to activate my LUKS-encrypted partition with --allow-discards. I know it's less secure, but as long as wrenches are still cheap I'm fine with sub-standard security if it means my hardware will perform better for longer. :-)

The trick is to add a flag "discard" to your crypttab, like this:

CODE:
wilmer@peer:~$ cat /etc/crypttab
sda2_crypt /dev/sda2 none luks,discard


And then of course rebuild your initramfs (update-initramfs -u) and reboot, etc.

You do need cryptsetup 1.4 or higher for this to work. I had to manually install that package (only twenty or so days old) from sid on my testing laptop.