Category Archives: Technology

Bash Completion Problem

I have this problem and can’t figure out what causes it. Once in awhile (more recently the past month or so, unless I’m imagining it) my bash autocomplete adds a trailing slash when it doesn’t belong there.

Just like in this 10-year old StackExchange article. Which doesn’t seem to solve the problem.

Q: if I have to learn about bash completion anyway, should I learn how to do my own bash completion scripts? Because I’ve found that tab to expand is about as smart as I want it to be. (I’m always frustrated on my Linux system because the default there is to notice what the command is and only offer to expand certain compatible filetypes.) Here are two places to get started:

Q: I’ve moved (back) to MacPorts in the past year. Is that the problem? I don’t think so, since I’m still using the /bin/bash that comes with Mac OSX. (See here to fix that.)



Blogging again?

Bandwhich demonstrates how little I understand networking. I don’t even know if I have to be superuser to sniff an interface. A friend wrote something not unlike Sniffglue and made a business of it, back in the olden days.

The Pew survey has a list of striking findings from 2019. Rather than striking, I’d say most of them are, “Yeah, I can believe that.”

Why isn’t this seen as a “both and” rather than an “either or?” Conservatives appreciate the importance of science even as they distrust scientists.

Although self-identifying political conservatives in the United States show high levels of distrust toward the scientific community, they are far from abandoning science as a valid epistemology and a field in which crucial cultural contests might be won. This insight—that audiences are able to partition scientific beliefs and attitudes according to cultural preferences—has been most fully appreciated in the context of conservative Protestants. Scientifically knowledgeable religious conservatives have been able to effectively partition their knowledge and attitudes in ways that maintain a broad recognition of the legitimacy of scientific endeavor while selectively rejecting the science and, more importantly the scientists, that contradict particular religious (e.g., creationist) or political (e.g., climate science) identities and worldviews; impinge on areas perceived as outside their purview, like public policy or morality; or, in the case of scientists specifically, are perceived as personally hostile toward religion.

Scott Alexander’s Adversarial Collaboration Contest included an entry by Alexander, “Is Eating Meat a Net Harm?” It was predicated on the assumption that humans are capable of eating meat, or not, with no health consequences. The evidence of the past 8,000 years, and certainly the last 100 years, argues that this is not a settled issue. For example, consider these two articles: Stangle: Impossible burgers are made of what? and Reduction in red meat consumption to ‘increase death and disease’. (The articles’ publishers have obvious conflicts of interest; however, the point of adversarial collaboration is that neither party pretends to have a neutral outlook.)

rubocop and rufo

I’ve been writing in the Ruby language since sometime in 2002, but if I was looking for a job, I don’t know enough to call myself a ruby programmer. I don’t know rails or anything of the other cool things people do with ruby. I’ve learned to use gems, but haven’t bothered to learn how to write them myself.

But I’m not opposed to learning. I just haven’t gotten around to it yet.

Or so I thought. Then I ran into rubocop, which is a sort of linter and style cop. Those can be helpful, so I thought I’d give it a try. And it’s mostly good. Except it’s opinionated, and some of their opinions are wrong. For example:

  • the indentation should be four spaces, not two as they suggest
  • parallel assignment is the bomb, despite what they say
  • I use double quotes (") pretty much everywhere I’m not forced to use single quotes ('). They want to save time for the compiler, I guess.
  • You need space inside parentheses (although I will grant the extra whitespace is less important with syntax highlighting than without it).
  • And if I’m declaring a RE that’s so complicated I’m using /x flag, then don’t tell me to use /.../ instead of %r<...>.
  • And speaking of which, go ahead and use $1 and $' when retrieving the results of an RE match. (In moderation.) Honestly, this is a tie. Go ahead and use named groups if you want to.

But you can’t fight city hall. If some younglings want to make Ruby over in the style of Python, well, that’s a crying shame. Ruby is supposed to occupy the perfect spot between Perl and Python. But these kids today! If they’re on your lawn, you might as well go along with their misguided project. And that brings us to rufo, the ruby reformatter. You can use it to do like 10% of the things that rubocop whinges about.

Xcode and Bandwidth Caps

For a long time, I’ve been in the habit of installing Xcode on Macs, even though I wasn’t developing software. (Partly because I wasn’t sure what I needed to run Fink/MacPorts/Homebrew, and partly because I think FileMerge is pretty sweet, even if it’s the last thing on this list of features.) But lately, the typical Xcode update is like 7 GB, and I just don’t need it. 

7.6 GB worth of awesomeness. :-/

So I wanted to know how to get rid of these monstrous downloads. And I found out. First, you get rid of Xcode. But that’s only step one:

$ cc
xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist
Use sudo xcode-select --switch path/to/Xcode.app to specify the Xcode that you wish to use for command line developer tools, or use xcode-select --install to install the standalone command line developer tools.
See man xcode-select for more details.

So, next, you have to get rid of the command line tools and reinstall them:

$ rm -rf /Library/Developer/CommandLineTools
$ xcode-select --install

UPDATE: When that doesn’t work, you read further down that page and find the correct answer:

$ sudo xcode-select -s /Library/Developer/CommandLineTools

Setting Up a Mac

Fixing mouse scroll direction, key bindings, setting up Exposé spaces, etc.

Installing Keynote, Numbers, and Pages plus any software previously purchased from the App Store.

Installing replacement browsers: Chrome, Firefox, and Brave, along with Xee and iTerm2 and Skim.

Installing MacPorts, then software starting with ImageMagick. Imagemagick because it’s a good test of everything working properly.

$ sudo port install imagemagick +graphviz -x11

Then adding some of my favorite utilities

$ sudo port install antiword bat colordiff exiftool jhead lame sox tree xz

$ sudo port install ffmpeg -x11

$ sudo port install nnn ranger

Then install software development languages: go, rust, and ruby. Follow them with some CLI utilities written in those languages:

$ cargo install broot cw du-dust dutree exa fd hexyl \
just lsd pastel ripgrep sd

$ go get -u github.com/gokcehan/lf

Another Old Computer

I picked up a new old computer. This one’s a Macbook Pro: the 17in model from early 2011. It’s pretty sweet.

The first screen I saw after logging in
About this Mac after upgrading to the last supported MacOSX.

It’s a behemoth. I can see how the modern Apple could never ship monsters like this. But it’s got a good, big screen and the HD is tolerably easy to upgrade.

And don’t overlook that super-useful ExpressCard/34 port, okay?

More of those CLI Utilities

I’ve found some more CLI utilities (via this thread) that look like they’re worth further investigation.

  • Zola, a static site generator
  • fd (a/k/a fd-find), an “80% replacement” for find; see also fselect
  • xsv, a tool for working with CSV files
  • broot, another disk analysis/tree replacement
  • sd, a sed replacement
  • cw, a wc replacement
  • hors, a combination of lynx and the technical web (which I couldn’t build on my Linux system because it’s running gcc instead of clang). (Ditto ‘bat’ btw.)
  • lolcate, a locate/updatedb replacement

I’m intrigued by topgrade but a little terrified of actually using it.

And I found the indispensable utility called genact.