Tips and Tricks - 1

So, I decided to start a new post type, namely Tips and Tricks.

These will constitute random — as in not pertaining to a particular topic — tips. But, are short enough, that they do not warrant full individual posts. Mainly the things which I have recently discovered, or had long forgotten :P. But also, the things which I regularly use and think can be useful for others.

So, let's start with the first post of this kind.

*Drum Roll*

1. Bash

1.1 Overriding aliases temporarily

Most shell users are probably familiar of aliases. Interacting with a shell becomes extremely convenient using aliases.

Now, sometimes we name our aliases after the actual commands themselves. For example, I have an alias rm='rm -iv'.

But, what if I wanted to run the original command?

One way to do that is by specifying the full path to the binary. But, there is an easier way to do the same. Simply prepend a slash before the alias, and the unaliased command will run instead. Example:

$ \rm

Continue Reading...

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.

Continue Reading...

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.

Continue Reading...

Mozilla, get rid of spaces from Firefox installers

Today I chanced upon an old bug report for Firefox, that I had reported about a year back.

Well, it's more of a "Feature Request" than a "Bug Report".

Anyway, here's the bug report in question:

https://bugzilla.mozilla.org/show_bug.cgi?id=782902

So, what's the issue?

The *issue* at hand is that the Firefox installers for Windows and OS X have spaces in the filenames. I absolutely despise filenames with spaces, perhaps only after coming to the world of Linux. Any sysadmin would admit that filenames with spaces are an absolute pain to work with. One mistake, and poof, there goes your important file. Sure, there is shell quoting to work around that, but still it is a very unpleasant experience working with such files.

Also, I personally feel that filenames which don't contain spaces and instead use underscores, hyphens, or dots look much neater and are easier to work with.

Since the Firefox installer for Linux uses a hyphen instead of a space in the filename, why a similar naming convention is not applied for the Windows and OS X installers is beyond me.

Continue Reading...

Interesting Links - June 2013

Here are some of the things I found interesting in June.

Linux:

  • Whonix is a privacy oriented distro, which uses virtualization (in a very interesting way) to achieve its goals.
  • Red Hat opts for GNOME 3's Classic Mode by default. Red Hat's Denise Dumas said — "the last thing we want to do is disrupt our customers' workflows". I guess it is OK to disrupt your users' (read: non-customers') workflow.
  • Tails 0.19 has been released without any major changes. You should still upgrade, though.
  • The debian multimedia repository's domain was grabbed by someone unknown to its maintainers, and as a result users have been warned to remove the repo from their sources.list file.
  • If you hate the default git log output, here's a way to make it better. Read the comments on that page for more suggestions.

Privacy:

  • The EFF guys have come up with a very nice and interactive animation explaining, how Tor works.

Continue Reading...

NewsFox Review

With Google Reader slated to be taken off life support on 1st July 2013, people are rushing to find alternatives. Due to this, some old feed aggregator services have seen massive bumps in terms of number of users, while many more new services are springing up, hoping to get a share of the pie.

So, why is Google killing Reader?

They claim that the user base is declining, implying that not many people are interested in Reader. But with so much opposition coming from the users (you can search the web to get an idea), one has to wonder if this really is the cause. In my humble opinion — and that of many others — promoting Google Plus seems to be the real reason.

That said, I personally am not affected by this change. Why, you may ask? This is because I never used Google Reader in the first place. In fact, I have never used a web based feed reader/aggregator. Instead, I use NewsFox.

What is NewsFox?

NewsFox is an old school, three-paned feed reading addon for Firefox.

Below are the primary reasons I use NewsFox:

  • Firstly, I don't prefer web based feed aggregators as that involves maintaining yet another online account, and these days we are already overwhelmed with innumerable online accounts. Also, by using web based feed readers, we are exposed to the same privacy issues that exist with the usage of Google Search, Facebook, etc.
  • Secondly, I believe that a feed reader should be tightly integrated with the web browser, as the content ultimately leads us to web pages. There are many desktop based feed readers, but they open the feed contents in a browser anyway. Some do have integrated web renderers, but they aren't comparable to full-fledged web browsers.
  • Lastly, of all the browser based feed readers, I like NewsFox the best. An honourable mention goes to Opera's integrated feed reader, but I only use Opera occasionally, so it can never replace NewsFox for me.

This article intends to serve as a review, as well as a tutorial, for NewsFox. So, let's get started!

Continue Reading...

Why aria2 is awesome

A short post with some words of praise for aria2.

Today I was on an extremely bad network, but I needed to download some important packages (wicd + deps) for my Arch Linux machine.

I did:

# pacman -S wicd-gtk

The packages were just 1.17 MiB in size, so I hoped that the download would go well.

Unfortunately, pacman — the package manager for Arch Linux — didn't like the network at all and the download kept failing with messages such as:

error: failed retrieving file 'wpa_supplicant-2.0-4-i686.pkg.tar.xz' from ftp5.gwdg.de : Resolving timed out after 10000 milliseconds

And

error: failed retrieving file 'wpa_supplicant-2.0-4-i686.pkg.tar.xz' from ftp5.gwdg.de : Operation too slow. Less than 1 bytes/sec transferred the last 10 seconds

pacman uses curl for downloading, if I am not mistaken, so maybe it's curl's fault. Anyway, I decided to give aria2 a try.

Continue Reading...