I stumbled onto visidata. I’ve got tons of csv files and the ability to view them quickly at the command line is a huge win. But this thing is amazing. Csv files are the tiny tip of a huge iceberg.
Update: I’m reminded of the xsv tool, which I discovered and promptly forgot.
I’m not a python person. But some interesting CLI utilities are written in python, including eyeD3 and visidata.
Enter pipx – it creates little (huge?) pip sandboxes for your different utilities, so you don’t have to worry about one breaking if you need to upgrade the other.
Installation isn’t hard if you’re comfortable using pip, but I’m not a python person, so I used port install pipx.
I’ve got this folder called vast/todo/t.temp that’s got a 100 GB of stuff from old computers in it. Typically, I just copy stuff there and tell myself I’ll get back to it. There are 61,287 files, none less than a year old, and (as of now) only 5 of those 60-thousand files are less than 2 years old.
How will I ever “get back to” making sense of all that junk? Enter duff – the CLI duplicate file finder. Just say:
Back in the day, I would use antiword to extract the text from a Word .DOC file. But it only understands DOC. Over the years, more and more Word files have been using the “open” (ha ha) DOCX format, which antiword doesn’t read. So I found Pandoc, which does much, much more.
$ pandoc -i some.docx -t plain > some.txt
There’s also a convert-to-Markdown option:
$ pandoc -i some.docx -t markdown > some.md
I find, however, that the Markdown produced by docx2md is more to my liking. It’s less cluttered, as it doesn’t aim at fidelity to the Word document’s formatting to the same degree as pandoc, but only the basics.
To install pandoc you can use the Macports version, but lately, I’ve found it easier simply to install the official binary Mac OSX PKG.
I used to use homebrew, but before that I used MacPorts. (And long, long, before that, fink.) The past year or two I’ve come back to MacPorts. But I forget what the commands are. (Honestly, I get them confused with apt, but that’s a separate problem.)
The usual thing to do is to search and then install:
port search whatever
port info whatever
port variants whatever
port install whatever +somevariant
The other thing is to update the stuff you’ve already installed
(This bug is perhaps unrelated to a separate problem — honestly, a bug — wherein someone decided it would be a good idea to change the file’s “modification” time every time a song was played. This is an idea so stupid I simply cannot imagine how anyone thought it was clever.)
Since the gem ecosystem keeps changing, and since I don’t write new programs very often, here’s a list of my favorite gems for developing command-line interface tools.
Option parsing gem: slop. (Since micro-optparse looks moribund; see here.) But (looking at programs I’ve written) I also seem to like trollop, a/k/a optimist. But I also like the fine-grained control of OptionParser.
Debugging output (not the same as logging): pastel
Wrapper for ImageMagick: About a decade ago, I couldn’t get RMagick (rubymagick?) to compile and I’ve never gotten around to checking back. For awhile I used %x<convert ...> or whatever, but now, if I’m working with images, I’ve sometimes found mini-magick helpful.
Proper Capitalization of Text Strings That Are Titles: titleize.
Parsing Biblical references (e.g., Romans 8:39 and Genesis 12:1-4): pericope.
Plus Kramdown and HAML and SASS (which is no longer written in Ruby).
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.
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.)
The second book in this very occasional series is … well, any of Heinlein’s juveniles. The cover is from the final book in the series, Have Space Suit, Will Travel (1958). It features bug-eyed monsters, space pirates, and a plucky hero who saves the earth from alien invaders over Labor Day weekend and still makes it back in time to get a free-ride scholarship at M.I.T. and throw a milkshake at the antagonist. Plus, we are taught a handy mnemonic for the order of the nine planets (see below) and a parable about frogs that isn’t the one about boiling them slowly. (Sorry for all the spoilers, but you’ve had 62 years.)
For this posting of my #2 fiction book, I could have picked any one of the series. They’re all great (except, I guess, Rocket Ship Galileo, the first). I mean, they were great when I first read them, starting in junior high school, when the science was only a little bit dated. (Venus had turned out not to have swamps, for example, and Mars never had canals. Jupiter’s EM environment would probably make Ganymede a poor place to farm.) Starting in 1953, after a few books set in our solar system, Heinlein got wise and set his stories somewhere more romantic.
But despite that, the juveniles are still great. Honestly, they’re better than most of Heinlein’s non-YA fiction. Practically all of it. Especially if you see Starship Troopers as the YA fiction that it ought to have been.
What are you waiting for? Get started! For a complete list, see the wikipedia article (search “heinlein juvenile”). But you’ll need to get them new. We never put the old ones back into circulation.