Computers

FFS, Emacs!


I’ve been running a few releases behind on GNU Emacs, because the last time I upgraded, they removed the count-lines-region function, for no apparent reason.

Unfortunately, I recently upgraded with Homebrew, and the latest dumbfuckery to ruin my day is making non-regexp searches match on one or more Unicode whitespace characters when you type a literal space character. This includes newlines.

As a result, out of the box it is no longer possible to find either an errant space, or multiple spaces where there should only be one. You need to Google and discover how to shut it off in your .emacs file:

(setq isearch-lax-whitespace nil)
(setq search-whitespace-regexp nil)

My new favorite programming font


I have a hate/tolerate relationship with so-called “programmer’s fonts”. Let me count the ways they suck, in no particular order:

  1. Not fixed-width. Blech.
  2. Too-narrow set width (ranging between condensed and crushed).
  3. Inconsistent weight/color between alpha, numeric, and punctuation. The creator of Fira Code actually managed to make \ and / different weights!
  4. Twee punctuation.
  5. Failure to adequately distinguish 0O, l1, etc.
  6. Dotted zero instead of slashed (so that 00 is staring at you; Hack takes this one step further, for an Eye-Of-Sauron effect).
  7. Inconsistent centerline for special chars (^>~*+=-})]|\/#$%&@).
  8. Special-char centerline inconsistent with digits.
  9. - not same length as + and = (surprisingly common!).
  10. Five-lobed asterisk, even worse when it’s upside-down.
  11. Poor rendering either on or off high-DPI displays.
  12. Special Dishonorable Mention to Monofur for having lower-case digits, seemingly-random centerlines, twee punctuation, and a generally obnoxious character design.

For a long time, I’ve been using Anonymous Pro, hand-edited to fix its centerline problem, but the new winner is Office Code Pro, which suffers only from a slightly-twee %, a slightly-italic $, a five-lobed *, and an ever-so-slight centerline offset for braces, parens, and the v-bar (most easily seen in the -{| combo).

It is hands-down the cleanest, most usable fixed-width font I’ve ever found, fixing almost every problem with its parent, Adobe’s free Source Code Pro. Pity the repo just has the compiled fonts rather than the source diffs, because I’d love to fork it and fix those last few niggling flaws.

Bash path maintenance


I’m a little OCD about my $PATH

cleanpath () {
    local path p result
    local -A seen
    PATH=${PATH//::/:}
    IFS=":" read -r -a path <<< "$PATH"
    for p in "${path[@]}"; do
        if [ -z "${seen[$p]}" ]; then
            result="$result:$p"
            seen["$p"]=1
        fi
    done
    PATH=${result:1}
}

more...

This... is wrong tool; never use this.


This was more a challenge than a solution to some need:

#!/bin/bash

while read l && read n <&3 ; do
    echo $n "$l"
done 3< <(hexdump -v -e '/4 "%u\n"' < /dev/urandom) | 
    sort -n | cut -d' ' -f2-
exit 0

And, yes, B5 is now on Amazon Prime, and I just watched “War Without End”.

Headline News


“Microsoft saves sinking ship; passengers leap to their deaths.”

Dear Adobe,


I just got email touting the new “Adobe XD CC” app, which promises:

“The future of experience design. No experience required.”

This sounds like exactly what happened when Apple set fire to their decades of usability studies and sucked on a pistol Boldly Invented New Paradigms.

Cherry-picking


Several years ago, the personally-owned MacBook Pro (Togetsukyō) that I used for work went flaky, and I didn’t feel like spending the three grand or so that it would take to buy a fully-tricked-out replacement. So I had my boss buy me the best he could get approved, which was the 13-inch model with 16 GB of RAM and a 512GB SSD. I named it Hello!Party, inspired by Scott’s ‘favorite’ song, and carefully downsized onto the smaller SSD.

It served me well for three years, but around the same time AppleCare gave out, so did the right-side USB port. So he ordered me a new one, and the approval process didn’t require so many compromises, so I ended up with the 15-inch touchbar model with 16 GB and a 1 TB SSD, which I named Macchi: it’s not headless, but it’s formidably proportioned. Apart from the mind-bogglingly terrible keyboard and the mostly-just-annoying touchbar, it’s a spiffy thing, and the extra space gives plenty of room for VMware Fusion virtuals.

But there was a problem: a bunch of data from Tog never fit onto H!P, and was only available in an archive on the house server, a refurbished Mini named Melwin. I’d also decided to keep a cleaner separation between work and home, so I had two accounts on H!P, one with all my work stuff, one with personal email, iTunes, Yojimbo, etc. For more fun, H!P was bound to our AD domain, so the work account had funky permissions. For even more fun, when I got Macchi, I only moved the work account, so I had to carry H!P if I wanted access to personal stuff.

Ten days ago, I noticed that Apple’s refurbished store had just gotten a new batch of 12-inch MacBooks in stock, which seemed like the perfect opportunity to clean up my personal/work accounts once and for all. Buying refurbs directly from Apple is actually the best way to get a reliable machine with a full warranty, as clearly explained by the folks at MacRumors. Brand new hardware is a crap shoot (especially models released in the past 3-4 months), and no one else’s refurbs are eligible for AppleCare. It’s got a Core i7, 16 GB of RAM, and a 512GB SSD, and I kept the name Hello!Party.

TL/DR, I’ve spent the last three days figuring out how to merge the best bits from multiple accounts on three machines to create a fully-populated personal account where everything actually works and has the correct ownership, while stripping out the last of the personal stuff from the current work machine.

(well, the naughty personal stuff, for sure; unlike most of the people who certified that they’d read the employee handbook this year, I actually read the employee handbook…)

Side note: after I scrubbed and reinstalled the 13-inch MBP, the right-side USB port seems to work again. Sigh.

Old NAS blues...


One thing I’m doing with the new Synology NAS is making sure that everything is successfully migrated from my ancient Infrant ReadyNAS NV+.

There are two basic reasons for this:

  1. The NV+ uses a non-standard power supply, and both of the ones we had at the office eventually burned out, requiring a temporary swap of mine until the data could be retrieved and migrated elsewhere. Mine’s still good, but if it goes…

  2. While the firmware has been updated to cope with the most famous SMB security hole, it’s otherwise an ancient version of Debian on a custom SPARC chip, and even with the RAM upgraded to 1GB, it’s painfully slow at serving up files. It has decent write speeds, but when it comes time to get your terabyte of data back off, it takes forever, especially if you’ve got lots of little files.

I figure the copies should finish by the weekend. Maybe. On the bright side, it’s so slow that the Synology has plenty of bandwidth left to handle copies of every other old drive in the house…

Update

After letting it chug along overnight, it’s averaging a steady 2 MB/s. With 500 GB to go, that’s just about 3 more days. This is so ridiculous that I had to double-check that it really is getting a full-duplex gigabit connection and not falling back to something like 10-megabit/half. No, it’s not the network; it’s just that mind-bogglingly slow. When this is all done, I’m going to reset it to factory defaults and do some testing.

Screw it, it’s sneakernet time!

I grabbed a spare 1TB USB drive, formatted it as EXT3, mounted it on the old ReadyNAS, and told it to back up the largest of the volumes (301 GB). It’s rapidly catching up to the aborted rsync job. As a bonus, the built-in backup job uses Perl. 😜

Finished!

The 301 GB sneakernet finished considerably faster than the rsync job, and my other ReadyNAS just took a few hours, so I now have all my eggs in one basket.

And my basket is now running: find . -not -name '.*' -type f -size +4096 -print0 | xargs -0 md5sum to figure out just how much duplication there is in the ~6 TB of files (not counting the 2 TB of Acronis, SuperDuper, and Time Machine images…). I figure there will be at least six copies of this video:

Update: nine copies of it. 😊

“Need a clue, take a clue,
 got a clue, leave a clue”