# cmus - Get file size of currently playing song

This is a simple Bash script to show the file size of the song being currently played by cmus.

#!/usr/bin/env bash

# show size and filename


# Git - Compare and edit different revisions of a file using Vim

Say, you want to open a copy of a file (under a git repository) and use it as a reference while making changes to the original file. This can be done easily using a number of methods.

One such method is (after you are inside the git repository):

(assuming the file is README.rst)
\$ cat README.rst | vim -


You'll probably need to set the filetype, as Vim does not detect the filetype through stdin for many formats. Then do :split README.rst inside Vim, and you have a reference as well as an editable copy of the same file.

##### But, what if you had modified README.rst without committing the changes?

In such a case, you can use git difftool, which will open the committed and uncommitted files in the diff tool of your choice. I prefer vimdiff.

# Interesting Links - July 2013

Many interesting things (some saddening) took place in July. Some of those are mentioned in the following sections.

Linux / FOSS:

• The official Ubuntu Forums were hacked. They did the right thing by immediately acknowledging the hack. But the overall handling of the situation has left a sour taste in my mouth. Reasons:
• First they took several days to send notifications out to the users by email.
• After finally restoring the forums after about a week, they are now requiring everyone to register with Ubuntu One and that account will be tied with the forums account.
• Feel that the BusyBox is lacking in some places? Toybox is a BSD-licensed alternative for that.
• Slackware is now 20 years old!.
• The H — often regarded as one of the few decent open source related publications — has gone the way of the Dodo. They cited lack of profit as the reason. I had read articles published on The H a few times in the past, but only recently had I started visiting it regularly. Too bad, that didn't last for long.