< | >

Hacker's Diary

A rough account of what I did with Emacs recently.

June 30
I've had a hacky little plugin for the office laptop for ages which detects that I've plugged in an external USB keyboard - using three different product/vendor codes, although I can't quite recall why three since there's the ancient Kensington in the office and the slightly less ancient Dell at home - and then manually remaps a few keys. This is because Apple's native keyboard setup, in its wisdom, only provides a single control for swapping around the Alt and Windows keys when mapping to Option and Command, and this single option means the right-hand keys aren't laid out correctly. I recently got a new office Mac, and this little plugin worked just fine with the minor exception that the half-dozen lines of Objective C it uses won't work when compiled on Apple silicon, but oddly the x86 binary works just fine. However, the new Mac threw up another problem: the key to the left of 'z' is '~/`', but the Mac insisted that for the outboard keyboard this was '§/±' and there was no immediately apparent pointy-clicky way to set it otherwise. So yesterday I tried to figure out how to fix this as part of my hack, which uses hidutil to remap the keys, but nothing in the documentation seemed to reveal what the magic keycode for the '§/±' key was. I eventually resorted to a loop which remapped a keycode to 'z', then I pressed the key, and if it produced a 'z' I knew I'd found the right one, and if not it'd move onto the next keycode. After a couple of minutes I had both keycodes, added them to the script, and presto, all I have to do now is stop trying to compensate for the fact that these keys were incorrectly mapped for the last, er, couple of months.

(Of course, that was too easy. I subsequently discovered that it's now reporting different keycodes to XRDP depending on which keyboard I use. This might be an artifact of tweaking the settings while XRDP was running, or it might require further consideraton.)

("Why are you using XRDP, Waider?" is a whole other saga that I'm not getting into.)

Added a touchscreen LCD to the DVD-ripping Raspberry Pi. Well, it's a LCD screen right now. Apparently setting it up as a touchscreen is not something that magically happens, and it doesn't come with any documentation. I see a previous version from the same manufacturer required you to cable a USB port on the screen to one of the USB ports on the Pi, without actually supplying a cable to do so. Cheeky. Anyway, as a simple LCD screen it's allowing me to monitor what my hideous script is up to (currently: identifying any rips where I managed to lose the langauge tags along the way).

June 29
Sleeping Dogs was a decent piece of work. We kinda figured it out before the big reveal, but it was a good reveal nonetheless.

Converted a part of my hideous DVD-ripping scripting from "run loop to collect data, then process" to "yield from loop to caller", and much to my surprise it not only worked first time, but it worked the way I'd intended it to.

June 28
Master Gardner is slow and thoughtful, but not boring. I will admit I expected more reckoning, but when it came to that it was actually pretty restrained.

June 26
Swallowing my distaste and using mplayer to do the initial extraction and then feeding the result to my working pipeline results in ... streams losing their language tags. WTF? I'll need to figure out where these are getting dropped, because it has a knock-on impact: if the audio stream isn't tagged with the language. the TV's player defaults to an audio stream that may not be the right one - it may be an audio commentary, for example, or an entirely other language.

June 23
Recovering some of the duff DVD rips and trying to do so repeatably if I can, but there are definitely a few holdouts and it's a bit annoying that multiple tools are required to handle what is essentially the same process. The touted promise of open source is that if one person solves a problem, everyone gets to benefit from the solution, but that runs hard into unmaintained software, divergent views of how a task should be broken down resulting in any integration of other code being a non-starter, egos who don't want to deal in code they didn't write themselves, etc. and the net result is waves hands in all directions.

June 22
Muzzle was a bit dopey, really. Not much by way of a story, no real plot twists despite various hinting, fairly silly ending. I've seen worse, and it had its moments, but I wouldn't exactly recommend it.

June 21
Shutter Island: it's funny that the trailer seems to portay this more as a horror movie than a thriller movie, or at least that was my take; it's pretty much straight-up psychological thriller. Much as with The Bookshop I'm not exactly happy with it because it works out pretty grimly in the end, regardless of how you interpret it.

June 17
Manually verifying a few of the videos and I'm seeing a couple of cases where the TV firmware is clearly at fault: the current movie is 1m23s into what the TV claims is a 4s video... there are a few cases so far where I've ripped the wrong title, possibly through mixing up discs again.

Also I still haven't figured out the subtitles thing.

June 16
My understanding of DVD construction is, despite doing some research in the course of my current ripping yarn adventure, somewhat sketchy still, but I think one of my disks has a wacky sort of copy protection on it that effectively amounts to multiple copies of the same movie, with all but one of them pointing at an unreadable block on the disk. It's all made up of pointers, so it doesn't mean they've put 100 copies of the movie on the disc, just two - one with the bad block, and one without - and the navigation data points to one or the other as appropriate. Now, this is based on observation and theory, and I've not yet checked the resulting (successful) rip, but if this is the case it's an interesting (if somewhat futile) copy-protection system: a pirate - yaaaar! - tries to do a bit-level copy of the disc and can't because of the deliberate insertion of unreadable blocks, so they then resort to using the navigation files to pick out the "good" blocks only to be stymied by the fact that their 4GB disk is producing 400GB of data. I dunno.

And of course all this is so much wasted effort since it's been overtaken by streaming services anyway.

June 15
The Bookshop is one of those stories where, oh, spoilers, the expected denoument never arrives, and horrible people get away with being horrible. You don't even get the satisfaction of them feeling guilty about being horrible because they clearly don't. I don't much enjoy this sort of thing; I expect my escapism to right the wrongs of the world (possibly through blowing up things, driving fast cars, or throwing out witty dialogue). OH WELL.

June 14
Lost track of things here for a bit. Still slowly ripping DVDs; a few of the more recent ones are TV series and I've not yet decided how best to auto-rip them.

I am sure there are internet fora dedicated to fighting over Anatomy of a Fall, specifically with respect to what actually happened. It's excellently done, and it's interesting to see how in a court everyone behaves as if every single person acts as a rational being with perfect recollection and logical movitations for their actions. You kinda want to ask these people if they know any, you know, humans.

Also I think the blood spatter evidence from the defence is compelling. FIGHT ME.

Also yes I did notice the gender split in who agreed with the prosecution and who agreed with the defence.

June 7
Steve Jobs was disappointing: it simply didn't have a story. Three half-hour segments from Jobs' business life and a definite leaning into portraying him as an unmitigated asshole, all of which was done so much better in the other Steve Jobs movie, and that actually had a storyline to follow. Waste of talent and time.

June 6
Our internet radio appears to have lost the ability to stream. This may or may not be related to the fact that favourites on the device are managed by some sort of third-party site which has gone through some issues. Plus, I don't know how long it's been like this because it's also a perfectly capable FM radio, and that's what we've relied on. I am tempted to poke it with the various hacking toys but at the same time I've got more than enough half-finished projects to play with.

June 1
I've had Split Second on my to-watch list for so long I can't recall why I put it there, and having watched it I definitely have no idea. It's sort of Predator meets Blade Runner meets ... I dunno, Lethal Weapon with a side order of is-it-or-isn't-it occult. I think they basically asked Rutger Hauer to tear up any scenery he happened to be near, edited it together, and called it a movie.

previous month | current month| next month