Category Archives: Life

installing eyeD3

I keep thinking I should learn the basics of Python programming. But I never seem to get around to it.

Today I needed to know how to install a program written in Python, because Homebrew used to include eyeD3 and today it didn’t. Here’s what I ended up doing:

$ sudo easy_install pip   # because pip isn’t installed

$ sudo pip install eyeD3

then it says that won’t work because libmagic isn’t installed. But fortunately, Homebrew provides that (whatever it is). So try again:

$ brew install libmagic

$ sudo pip install eyeD3

P.S. eyeD3 is the best command-line ID3 tag editor I’ve found. It is the only thing I’ve found that allows you to install album art from the command line. (See my earlier post.)

 

Mini Magick

I just discovered MiniMagick. It is exactly what I was looking for in a ruby-language wrapper for ImageMagick.

I’ve been using ImageMagick forever. Like, more than 20 years foreer. Maybe 30 years;  I don’t know when it was first developed, or how old it was when I discovered it.

Some of the time, I use ImageMagick from the command line: just convert a file or montage a couple of them, or whatever. But sometimes, I do the same three things to an image and expect to do it over and over again for multiple images, I’ll write a shell script.

Writing shell scripts is hard. (Like, do you use trap? Of course you don’t.)

Writing Ruby is easy. But the only Ruby wrapper for ImageMagick I knew about was RMagick, which is big and complex and the first couple of times I tried to use it I had build problems (this was back before gems and github).

So there I was. Use bash and keep it simple, or use ruby with some crazy backtick `convert foo.png foo.jpg` shell escape there instead of doing it right.

But MiniMagick is just a well-designed wrapper around those backticks. Kudos!

Pandoc for Word Document conversion

I just discovered pandoc. Well, I first bookmarked it in 2008, and again in 2016, so I guess I rediscovered it. But what I mean is that I finally discovered what to use it for: converting Word files to Markdown. It’s dead easy:

$ pandoc -f docx -t markdown sample.docx > sample.md

I’ve been using Antiword for years to convert Word 2006 (DOC) files to text, but it doesn’t do DOCX, and, instead of producing Markdown or something more neutral, it tries to recreate the DOC experience in text by centering lines, etc. Not complaining: it gets me plain text and I can take it from there, but Markdown is a big improvement. DOCX is even better, since, apart from pandoc, the only way I knew to read those at the command line was via Libre/OpenOffice:

$ libreoffice –headless –convert-to “txt:Text (encoded):UTF8” sample.docx > sample.txt

(I see — now, when it is too late — that there is also code to do this in ruby: antiword-xp-rb. I hope that’s an awesome tool, but it took me 9 years to figure out what to do with pandoc so don’t wait for me to tell you.)

Avocado News

The Smithsonian has news for market timers:

Americans devour 7 pounds of avocado per person each year, compared to 1 pound on average back in 1989. Per capita consumption of avocados has tripled since the early 2000s, according to the USDA. Yet nearly all of these avocados—some 95 percent in the U.S. and about 80 percent worldwide—are of a single variety: the ubiquitous Hass. That’s especially crazy because … the pebbly, black-skinned Hass didn’t even exist a century ago.

Also this, which makes me wince to consider:

…mammoths and giant ground sloths would gobble the fruit whole and then travel long distances, before pooping out the seed and thus dispersing the trees.

Things I Did After Installing 17.04

Here in one place is my list of things to do after installing a new operating system.

$ sudo apt update
$ sudo apt upgrade
$ sudo apt install ssh

Then try to ssh into the computer. If needed, apply the fix to Zeroconf / Avahi / NSSwitch.conf.

Next:

$ sudo apt install git
$ sudo apt install colordiff
$ sudo apt install libreadline-dev
$ sudo apt install vim vim-gtk3
$ sudo sudo apt-get --purge --reinstall install ttf-mscorefonts-installer

Then I got things ready for ruby. I prefer rbenv:

$ sudo apt install libssl-dev zlib1g-dev # needed for ruby
$ sudo apt install sqlite3 sqlite3-pcre
$ cd ; git clone git://github.com/sstephenson/rbenv.git .rbenv
$ git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
$ rbenv install -l
$ rbenv install 2.4.1 # (as of April 28, 2017)
$ hash -r # rehash your environment

P.S. if later on you want a later version of ruby, the way you update the list of installable ruby’s is:

$ cd ~/.rbenv/plugins/ruby-build ; git pull

Then use gdebi to install Google Chrome.

$ sudo apt install gdebi
$ apt install chromium-browser chromium-codecs-ffmpeg chromium-codecs-ffmpeg-extra
$ apt install telegram-desktop

I’d love to be able to pre-populate Dropbox from a local backup when I setup a new computer. But I’m not smart enough, I guess.

$ sudo apt install antiword wv jhead
$ sudo apt install imagemagick poppler-utils

The Senate and SCOTUS — A Modest Proposal

Since the nomination of Merrick Garland has been held up all year, and is at this point likely dead, President Trump may nominate as many as three (even 4?) Justices to the Supreme Court.

The Senate, of course, must approve those nominations. Historically, this would have been subject to a 60-vote requirement to overcome any minority-party filibuster. But retiring Senate Minority Leader Harry Reid eliminated that precedent, and, indeed, even two weeks ago sought to permanently “nuke the filibuster.” We may therefore expect that even a bare majority in the GOP-held Senate could approve each of those nominees.

Perhaps today Democrats can better see the folly of Harry Reid. Even some Republicans are uneasy at the prospect of President Trump’s SCOTUS picks.

I believe that Senate Majority Leader Mitch McConnell should, in the interest of national unity, allow the Democrats to restore to the Senate the historic protection of the filibuster.

He should announce that he will, in this session, schedule hearings for Merrick Garland on the condition that each member of the Senate — every single one, without exception — go to the floor of the Senate, and make a public pledge of support for the filibuster, along the lines of: “I solemnly renounce and abjure the disastrous and demagogic policies of Harry Reid which so gravely imperiled the historic safeguard that is the filibuster, and put our republic in jeopardy of descending into the ugliest form of mob rule.”

Since no Senate can bind a future Senate, this show of support for the filibuster will be necessary at the start of each term. Incoming Senators should be required to make the same pledge in January. Without such a show of national unity and resolve, McConnell should declare the filibuster dead and delete it across the board from all Senate rules.

Would this be humiliating for Democrats? Absolutely. So it might tempt the Republicans, who, otherwise, will want to wait for Trump’s nominee and those who will come later.

But swallowing their pride would be good for Democrats. Being (sort of) generous in victory would be good for Republicans. And restoring a strong filibuster would be good for the country, and not only in the area of SCOTUS nominees.

If nothing else, the election of President Trump and a GOP Senate should teach us that it is dangerous to take power into our own hands that we would be terrified to see in the hands of our political opponents.