Meandering Soul

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

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