Maybe Get Some Coffee

I got this message when I was rebuilding my father-in-law’s 2007 iMac. It happened at one point when I was trying to install on OS on the boot drive.

This might be the most realistic time-to-complete estimate I’ve ever seen in an Apple installer:

(I haven’t talked about that computer. I got it a couple of years ago and I’ve been meaning to upgrade it, just like I did with our own 2007 iMac. The only difference from that upgrade plan was I only used a 1 TB drive for the boot drive. The use case is to back up some computers at work, so I added a 4 TB external drive. I would have prefered making it internal, so I could use the SATA connection rather than a USB 2.0 external drive. But … sigh. Apple. There isn’t really room for another drive (yes, I know about replacing the Superdrive with in internal drive) but beyond that, getting at the drive, in case it fails and needs replacing is so incredibly hard, that I decided I could live with slow backups.)

Bash / Zsh customization

AAPL changed the default shell from bash to zsh in either Mojave or Catalina. I ignored that, since nothing they’ve done lately betrays any understanding of Unix. But even after I moved back to bash using chsh, my Mac keeps reminding me that I’m doing it wrong. So I thought to myself: what if I did migrate to zsh? Or, rather, what’s keeping me from doing it? (Aside from AAPL being the ones to recommend it, I mean.)

Well, I know bash syntax pretty well, and I’ve got a bunch of shell scripts I wouldn’t want to find the bash-isms in. But OSX still includes bash, so running a shell script in bash is as simple as putting the right shebang up top. Assuming you have shell initialization working.

I do have it working. I think. I never know for sure. It’s a baling wire and chewing gum contraption, I admit.

The problem is that bash initialization is impossible to figure out. And even if you do figure it out, then you have to figure out what /etc/profile and /etc/bashrc and who-knows-what are invoking and in what order.

But if I don’t figure it out, I’ll always be to afraid to find out if zsh is worth using. Fortunately, I have a handy guide I can use to get a zsh initialization working.

Early Impressions of the New Administration

Watching speeches by the new president reminds me so much of Star Trek (the Original Series). Specifically this episode:

Note: I am not not NOT saying that anyone in the administration, much less the president, espouses the tenets of nationalism-socialism. (“Say what you will about them, but at least it’s an ethos.”) If you’d seen the episode, you’d know that. And if you haven’t seen it, maybe you should before you make inferences.

(I wonder if that episode could be aired today. The iconography seems so triggering by modern standards.)

Trump’s Exit

I don’t think what Trump said was a high crime or misdemeanor. But I do wish he would leave office. In fact, I wish he would leave office, and then Mike Pence would also leave office. I’d like Nancy Pelosi to take over the presidency, per the constitution, and run out the clock on the 2016-2020 term. It would give her a historic first (female president).

Kennedy-Johnson 1960

John F. Kennedy was elected after a campaign critical of the Eisenhower-Nixon administration’s “Missile Gap,” aided by a friendly press and voting irregularities in Chicago. As it turned out, the gap was illusory, but his campaign required Kennedy to govern as a cold war hawk. The Bay of Pigs invasion was followed by the Cuban Missile Crisis. The situation in Viet Nam also worsened, especially after the CIA-sponsored coup against Diem.

Way back in 1957, then-President Eisenhower had federalized the National Guard to enforce court-ordered desegregation in Arkansas. But Kennedy, perhaps because he owed his victory in part to pro-segregation southern Democrats, was slow to enforce the law. Not until the middle of Kennedy’s third year in office did his administration move to a stronger pro-Civil Rights position.

Kennedy did not finish his first term. He was replaced by Lyndon Johnson, who won election in 1964 but who was so unpopular both within and outside his party that he did not seek re-election in 1968.

Wuhan Coronavirus COVID-19

This bothers me: if people can test negative and then go into quarantine for 8 days, and only then test positive, that argues for continued extreme social distancing until better treatment and/or a vaccine is developed.

But this also bothers me. If even the left (albeit the British left) can see the problems that accrue from continued lockdown—which accrue primarily to those at the bottom of the ladder, then what should we do?

And there’s this from Nassim Taleb. I can live with a society where people wear masks whenever they think they might be sick, or that a substantial fraction of the people they encounter might be sick.

It would be nice, too, if we had some level of widespread agreement on what we’re trying to accomplish, and what can be allowed to supercede it.

However, there is one inconvenient truth that cannot be disputed: more black Americans have been killed by three months of coronavirus than the number who have been killed by cops and vigilantes since the turn of the millennium.

Thomas Chatterton Williams in the Guardian

I’m so old, I can remember when the goal was the flatten the curve. But we live in an era where everything has to be politicized, even epidemiology.

Diff Tools, Redux

Some time ago, I mentioned here how I like to use colordiff. Well, on a Mac I actually prefer Apple’s FileMerge GUI diff tool, which is is part of the Xcode command line tools, and accessible from the command line as opendiff.)

I recently discovered diffy, which is similar to colordiff, but offers a -split option that gives you the side-by-side effect of opendiff.

Even more interesting to me, however, is diffr, which is a “diff postprocessor” that shows the differences within a specific line. You run diff -u ... | diffr to see what you want.

Thousands of words worth of pictures:

plain old diff
colordiff (aliased to diff because duh)
diffy -s split
diff -u … | diffr
FileMerge, invoked from the command line

Update: I appear to have been wrong. Evidently, opendiff is part of Xcode proper, not the command line tools. Which means I won’t be using it in general, because it’s freaking huge.

File renaming tools

Long ago, I wrote a utility (brename) that renames a set of files based on a supplied pattern. (Imagine you had an arbitrary set of JPEGs and you wanted to pretend they all came from a digital camera with names like IMG_0001, IMG_0002, etc. – that’s my favorite use case for brename. It’s really more of a re-numbering than a renaming tool.)

I also have a tool I call pmv (an alias for Larry Wall’s perl rename tool (version 3.0.1.2 from August of 1990, which was something like this “fork” of version 4.2 I found here)). I use pmv when what I want to do is more complicated than brename will permit. (Interestingly, the version of perl rename I use will force filename case changes on Macs, which like to pretend that ABC.txt and abc.txt aren’t different names, while the newer version won’t.)

But I recently stumbled across also mmv. It’s like the perl rename tool but with error checking beforehand. The downside is that you can’t (easily?) limit the application of your pattern to some set of files. It’s like coming up with a rename expression s/before/after/ and applying it to *. (Not only that, but from reading the man page leads me to think it’s over-eager to apply that pattern not just to * but to **.)

And what about renameutils? I have something like its qmv. The idea is you print a list of filenames and bring it into the editor for a human to fix there. (Way back in the 80’s I used an awk command to do this; it was something like this:

$ ls -1 *.c | awk '{printf("mv %20s %s\n",$1,$1);}' > list ; $EDITOR list

The only problem with qmv is that the “plan” you create isn’t saved. Typically, the files I want to rename (especially when there’s more than a few, when qmv should shine) are backed up somewhere else, and I’d prefer to apply the same plan to the backup folder, rather than copying the (same) files there and then deleting the originals.