Some middle-aged guy on the Internet; Seen a lot of it and occasionally regurgitate it, trying to be amusing and informative.

Lurked Digg until v4.

Commented on Reddit (same name… at the moment) until it went full Musk.

Now I’m here.

Other Adjectives: Neurodivergent; Nerd; Broken; British; Ally; Leftish

  • 0 Posts
  • 122 Comments
Joined 2 years ago
cake
Cake day: June 12th, 2023

help-circle
  • The Robustness Principle may seem like little more than a suggestion, but it is the foundation on which many successful things are based.

    To boil it down to meme-level old-school Torvaldsry: Assume everyone else is a f–king idiot who can barely do what they’re supposed to and expect to parse their files / behaviour / trash accordingly.

    If you do not do this, you are, without doubt, one of those f–king idiots everyone else is having to deal with. If you do do this, it does not guarantee that you are not a f–king idiot. Awareness is key.

    Examples where this works: Web browser quirks mode; Driving a car; Measure twice, cut once. This latter one is special because it reveals that often, the f–king idiot you’re trying to deal with is yourself.

    Assume everyone else is worse.

    Fun corollary: In altering his behaviour towards f–king idiots people who should know better, Linus has learned to apply the robustness principle to interpersonal communication.


  • One might exist already: lzlib.

    I admit I haven’t done a great deal of research, so maybe there are problems, but I’ve found that lzip tends to do better at compression than xz/lzma and, to paraphrase its manual, it’s designed to be a drop-in replacement for gzip and bzip2. It’s been around since at least 2009 according to the copyright messages.

    That said, xz is going to receive a lot of scrutiny from now on, so maybe it doesn’t need replacing. Likewise, anything else that allows random binary blobs into the source repository is going to have the same sort of scrutiny. Is that data really random? Can it be generated by non-obfuscated plain text source code instead? etc. etc.


  • Technically, it’s inherited from older, non-x86 systems that had a dedicated ‘Compose’ key on the keyboard. Here’s a picture of a Sun Microsystems UK-layout keyboard; take a look at the bottom right of the main section: Link to a wiki hosting the image

    (These keyboards also had the Sun (looks like a diamond) key well before Microsoft decided they’d like a Windows key on every keyboard. But then lots of other non-Microsoft computers did that. Apples, Commodores, etc.)

    Note that the tiny circle on the key is a light which comes on when the key is engaged and goes off when the composition is complete. The Caps-, Num- and Scroll Lock keys also have built-in lights. For that reason, some people will use Scroll Lock on PC keyboards, especially if the Compose-emulation is able to toggle the Scroll Lock light in the same way.

    (Even though I used similar keyboards many, many years ago, I’m not actually sure if the key has the light in it or whether the light is under the key and the circle is merely a window, but that’s not really important right now.)


  • If I remember correctly, clicking distro links on Distrowatch causes Distrowatch to increase its ranking of that distro, so it’s theoretically possible that MX Linux is only at the top because people who don’t use it and haven’t heard of it think “wtf is MX Linux?”, click the link and push its rank ever higher.

    Urban Dictionary (not Linux related nor particularly SFW, but bear with me) had a similar problem with their table of “popular definitions” links. (They eventually took them off the site.)

    If memory serves (for a second time), some of the links went to non-existent definitions, but those links looked like the only way to reach those definitions, so people clicked them, increasing their popularity and keeping them in the list. Along comes another visitor, “oh what’s this”, repeat ad nauseam.





  • That started out as a fictional implementation in the turn-of-the-century webcomic User Friendly (main site died a while back, unfortunately), and then someone decided that it would be fun to implement it for real.

    The one in the comic was deliberately created to be evil. Not sure about the real-world implementation.




  • Perl:

    Just another Perl hacker, (sic)

    This was coined by Randall Schwartz on Usenet a very long time ago. The comma has become part of it despite it originally being necessary for the English sentence it first appeared in.

    Part of being a Perl aficionado is to write a japh script, that is a Perl script that prints out the above line, comma and all. The more obfuscated it is, the better. Another part is to not write code like that in production, at least not without comments explained what the heck the symbol soup is doing.

    “(Perl) Wizard” has been applied to those who are notably proficient, thought that’s usually a title bestowed by others.

    The self-deprecating alternative is “funny character(s)” for both the symbols that appear all over Perl code as well as those who use them (I think this one was coined by Perl creator Larry Wall himself).



  • Over the top tone: “Pretty sure that won’t compile. $EVAL_ERROR modulo what you get from the filehandle called = isn’t an lvalue that can be put through the Goatse operator that I’m aware of.”

    But seriously(?), I’m almost certain that’s not how that would be parsed. = isn’t a valid bareword, so Perl would choke on the spaceship operator not being a term… I think.

    After testing… It’s worse. I think it’s parsing <> as the glob operator and = as a filespec.

    For those who don’t know Perl:

    Because of its appearance, <=> really is called the spaceship operator (at least, when it can be parsed as an operator and not whatever happened above).

    =()= by comparison has unofficially been called Goatse. If you don’t know what Goatse is, find out at your own risk. If you do know, you can see why this particular pseudo-operator was given that name.

    And if you’re still reading, =()= is a pseudo-operator because it’s not actually parsed as part of the syntax. It’s literally an assignment operator = followed by an empty list () followed by another assignment operator =, providing list context to the outside of the equals signs that wouldn’t otherwise be there.

    [Why are you still still reading?] Context is important in Perl. If a function returns a list of values (which is something Perl functions can do) and you try to store the result in a scalar variable, replacing the usual = with =()= will store the number of elements returned rather than the last element of the list.


  • Call me lazy if you like, but I use GNOME terminal. Comes as standard with my distro. Does what I need. Supports fonts that aren’t pixel fonts and has various look and feel tweaks accessible by GUI if I really want to get in there. I do that once after every fresh install and it’s been a while since then.

    Given that I loved a bit of Quake back in the day, you’d think I’d like drop down terminals like ddterm and Guake (which might not work on Wayland?), but weirdly no. I like it in a box I can move around.

    I also keep the ancient xterm installed just in case and for when I get nostalgic for the old pixel fonts, but it’s not exactly my go-to.


  • Could be an instance of BSD where (so I hear) PIDs are assigned randomly from the unused numbers, or else the system has massive process churn going on elsewhere and the old timer is from a previous cycle of consecutive PIDs.

    Some systems still have /proc/sys/kernel/pid_max set to something around 32768, so wrapping back to 0 can happen fairly often.

    Given all the PIDs in the comic seem pretty low, it might even be as low as 1024 wherever this is.

    (Yes, I know I’m taking this way too seriously.)


  • The find command could be your friend for getting a full depth count. Something like:

    find /path/name/here/ | wc -l
    
    

    Or just:

    find . | wc -l
    
    

    for the current directory.

    There’s also a command called locate (often with another letter in front, but accessible by just that word) which maintains a database of filenames on a system that can be used, provided it’s installed and has built that database.

    Pro: Faster than churning the disk every time with find. (Though disk cache can help alleviate some of this).

    Cons: Can get out of date with a changing filesystem. Harder to search for relative paths like .

    locate -r '^/path/name/here/' | wc -l
    
    

    … would be roughly equivalent to the first find example.


  • Cinnamon’s Nemo (GUI) file manager shows folder item count in the List View’s “Size” column rather than a byte value. It started as a fork of Nautilus (now GNOME Files), so that and its descendents may also have the same feature.

    The equivalent GNOME gio list command line command doesn’t seem to do this.

    It wouldn’t be too hard to whip something up in Python, Perl etc. if you can’t or don’t want to install anything else for some reason.

    e.g.

    perl -wle '$a=$ARGV[0];opendir D, defined $a && -d $a?$a:".";@x=readdir D; print -2+@x'
    
    

    is a Perl incantation that will return the number of entries in the current directory, or the supplied directory if that’s added as a parameter after the command.

    The -2 in there subtracts the count for . and ... That’s off by one for the root directory where there’s no “…” but that’s rare and I didn’t want to add too much for a quick proof of concept.


  • Personal project a while ago. Had an idea in my head that I needed to rewrite using a particular language feature but had been putting it off because I couldn’t quite wrap my head around the implementation details.

    Eventually decide to sit down and plug away at it. Find the code already uses the language feature.

    I had either written it with that language feature in the first place or had been back at some time I don’t remember and done the work I didn’t think I was capable of doing.

    I could still be convinced that it was done by pixies or the whatever might be the programming equivalent of shoemaker elves.



  • At a guess, it’s because the function of preserving file dates and times is more likely than setting the port to something other than the default, so it gets the lowercase character, whereas ssh doesn’t do anything with files so the port option gets the lowercase character.

    The inconsistency is annoying though. I wonder if they could make ssh’s -p option case insensitive so -P works across the board. (Maybe -P is reserved for some unknown future purpose?)

    A work-around would be introducing long options and having --port be the option’s long name across all the commands, but then, that comes with its own problems.