Meandering Soul

This day is done, I'm going home.
eFranes Penguin Avatar

When reinstalling helps

22
Apr 2014

Today I learned about brew reinstall. This command allows to reinstall the currently installed version of a package. Now, why would that be useful? Because sometimes things go wrong. In my case, the installation of the latest PHP 5.6 release went wrong somewhere. Since I am generally bad at reading log messages, I did not notice that until I actually needed it working.

At first, it threw tons of errors at me of which I thought they originated from the code I was trying to execute - wrong. Then I realized that I might not have updated all the extensions I needed. Also wrong. Then I fooled around a bit and stumbled across homebrews reinstall command. It took a few cups of coffee for

1
brew reinstall php56

to finish but that’s okay. It magically worked again.

Literally only minutes later was it when I discovered that my imagemagick installation was not compiled with webp support. Having learned about reinstall I could solve that problem without a stack overflow marathon.

1
brew reinstall imagemagick --with-webp

Another cup of coffee.

  • Published on April 22, 2014
  • 181 words

Chrome cleanup

30
Nov 2013

Google Chrome’s automatic updating is very much awesome. But it has one big disadvantage for people like me who don’t like unused junk on their hard disks. And old versions of programs belong to unused junk. Fortunately, there is an easy way to remove all old versions of Chrome (works for the default and the beta/dev channels, people using the canary channel simply have to swap out the application name):

Using the Finder

Navigate to Applications and select “Show Package Contents” on Google Chrome. You should be presented with something along the lines of the below picture.

Navigate to the Contents/Versions directory. In there, you can delete all directories except the one with the highest number - that’s the version you’re currently on.

Using the Terminal

On a command prompt, enter

1
2
3
4
[[ $(ls /Applications/Google\ Chrome.app/Contents/Versions \
| wc -l) -gt 1 ]] && \
rm -rf $(ls /Applications/Google\ Chrome.app/Contents/Versions \
| sort | sed \'$ 0\')

If you’re unsure, which version your Chrome is currently running on, simply open a new tab and navigate to

1
chrome://version
  • Published on November 30, 2013
  • 186 words

Code listings

21
Oct 2013

This may be common knowledge to almost everyone but I only recently discovered the nl tool from GNU coreutils. Now, as long as the code listings to be done are to be published online - woah, that was some weird language - there’s plenty of options to get them to have line numberings. GitHub’s Gists do that. Almost all the syntax highlighting plugins for all the publishing platforms do that. So well. But there are situations where there is no such thing. At least not as conveniently available. Let’s say you’re writing a paper in TeX and need to embed a piece of code including line numberings. There is probably some kind of weird tex sorcery around that would do that for you. But there’s also nl available via any* unix-y command line. Give that  a stream of text, get a stream with line endings back. Quick. Easy. Awesome.

  • Published on October 21, 2013
  • 149 words