Posts by simontatham@hachyderm.io
(DIR) Post #AZzZ8kdSsDd468LSzo by simontatham@hachyderm.io
2023-09-21T10:32:25Z
1 likes, 4 repeats
Greetings everyone! #introductionsI'm Simon Tatham, free software developer based in Cambridge, UK. Best known for PuTTY and a collection of puzzle games; various other things largish and smaller. Mostly tend to start my own projects rather than joining existing ones. (I think just because that's my idea of fun.)This is my first time dipping my toe into short-form social media. (I was never on the birdsite.) Probably expecting to post random tech musings, with occasional maths.
(DIR) Post #Aa8ULs8fXLPpml18a0 by simontatham@hachyderm.io
2023-09-25T18:59:57Z
1 likes, 1 repeats
Linux sometimes reports a USB peripheral as "Generic Mass Storage Device".Suddenly strikes me: isn't that a pretty good description of a black hole?
(DIR) Post #Aaf5Hg6kbASj2SpBJI by simontatham@hachyderm.io
2023-10-11T13:14:55Z
0 likes, 0 repeats
Ugh:1. Somebody emails me a Word file with a spacey file name 'Some Document.docx'2. Buggy MUA escapes the space when deciding on the file name to save it as, so now it's called 'Some\ Document.docx'3. libreoffice assumes '\' in its argv[1] must be intended as a path separator, helpfully translates it into '/', and then fails to open the file because 'Some' isn't a directory.Team effort there – no *two* of those together would have caused a failure. It took all three!
(DIR) Post #AcKd8LtfJhmktmzuMK by simontatham@hachyderm.io
2023-11-30T09:28:55Z
1 likes, 0 repeats
Very confused just now to print the number 0.1999999 using the printf %a format (hex floating point) and get something like 0x1.999999p-3. My first thought was that somehow it was accidentally still printing in decimal! But no, those two numbers really are equal (in the limit as you add more nines), by a silly coincidence.That's almost as confusing as the time I accidentally printed a baud rate in hex and didn't notice, because 38400 == 0x9600, so it still looked plausible.
(DIR) Post #AcwHLE1v4NDJMucuHo by simontatham@hachyderm.io
2023-12-18T15:30:39Z
0 likes, 2 repeats
We've just released #PuTTY version 0.80! This is a SECURITY UPDATE, fixing the newly discovered 'Terrapin' #vulnerability, aka CVE-2023-48795, in some widely used #SSH protocol extensions.The release is available in the usual place, at https://www.chiark.greenend.org.uk/~sgtatham/putty/Full information on the vulnerability is at https://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/vuln-terrapin.htmlWe urge users to upgrade, and also upgrade #OpenSSH servers. A fix is needed at both ends of the connection to eliminate the vulnerability.#TerrapinAttack
(DIR) Post #AhFo5XIHXe6wQrNvwu by simontatham@hachyderm.io
2024-04-25T16:12:29Z
3 likes, 1 repeats
In bash, writing ${var?} instead of just ${var} or $var means if var isn't defined then bash will throw an error and _not_ execute your command, instead of expanding it to "" and carrying on.mv file1 file2 $subdir # oops, I overwrote file2mv file1 file2 ${subdir?} # error message instead of disasterMy favourite use of this is for example commands in documentation, with placeholders for the user to fill in. Then it's OK if a user accidentally copy-pastes it _without_ filling them in!
(DIR) Post #AhuogIGc3nUDVy8MiW by simontatham@hachyderm.io
2024-05-15T12:22:40Z
0 likes, 0 repeats
@christianp depending on your needs, I actually wonder if something sold as a computer monitor might be a good answer! If you can live with all its inputs being HDMI, then a monitor could handle those just as well as an official telly, and wouldn't want Internet.It wouldn't directly receive broadcast TV signals, of course, so you'd need a secondary bodge for that (maybe via an HDHomeRun).At least some monitors come with remote controls, and some have OK speakers (like my last Philips).
(DIR) Post #AimykAtHbgtDUso7TE by simontatham@hachyderm.io
2024-06-10T10:34:08Z
1 likes, 3 repeats
'mkdir -p' lets you make a deeply nested subdirectory like a/b/c/d, making all the intermediate directories on the way to it. So if even 'a' doesn't exist, it'll make that, then a/b, etc.But you can also get it to make multiple _non_-nested directories, because it accepts '..' in the path and doesn't treat it specially:$ mkdir -p alpha/../beta/../gamma$ lsalpha beta gamma$
(DIR) Post #AioAKzvUd0uqrOYv5M by simontatham@hachyderm.io
2024-06-10T18:52:40Z
1 likes, 0 repeats
New maths-related blog post!"Beyond the wall: working with aperiodic tilings using finite-state transducers"https://www.chiark.greenend.org.uk/~sgtatham/quasiblog/aperiodic-transducers/A look at some things you can do by applying regular language theory to the substitution systems of the Penrose, hat and spectre tilings, kicked off by a mysterious crash in some code last year.Perhaps a highlight: how one particular pair of almost identical instances of the hat tiling (shown here) _nearly_ made my algorithm not work at all.
(DIR) Post #Aj25oGtoVz5aEJDfqy by simontatham@hachyderm.io
2024-06-10T11:31:38Z
0 likes, 0 repeats
@neijatolf I'm going to have to get better at leaving space in my toots to make it clear whether I'm suggesting a useful tip, or being amused by a weird edge case.This was a 'weird edge case' toot. It's not a helpful pro tip!Perhaps the worst effect of 'mkdir -p' permitting this syntax is that you can bamboozle other people's shell scripts into making unrelated directories as a side effect of their intended behaviour. I wonder if there are any actual security holes arising from that.
(DIR) Post #Al3mWCp0IIkMrDZPOq by simontatham@hachyderm.io
2024-08-17T12:50:18Z
0 likes, 0 repeats
If you put the same pipe on a process's stdout and stderr, you get all its output interleaved in the order it wrote it (after stdio buffering).If you use two pipes, you can tell which output went where.But what if you want separation _and_ ordering?You can _almost_ do it by making two AF_UNIX datagram sockets connected to the same peer. Then recvfrom() gives you a chunk of data _and_ tells you which socket it was written to.But you lose the ability to detect EOF, which is a show-stopper!
(DIR) Post #Alr34EdbARyULcWJEG by simontatham@hachyderm.io
2024-09-10T05:11:56Z
0 likes, 0 repeats
@bascule that reminds me of the time I noticed in a web server log that occasionally clients would get a 404 after requesting a bizarre URL of the formhttps://[hostname]/0.000000E+00username/which, after some headscratching, I realised was because they had started withhttps://[hostname]/~username/and then %-escaped the tildehttps://[hostname]/%7Eusername/and then accidentally used that as a printf format string, which took %7E to be a floating-point format directive!