Recent posts

A fairytail about Ruby on Rails, Heroku and migrating data to a new database schema

Since I like testing new stuff, and this website serves me very well as a nice small guinea pig for any kind of experimentation (mostly trying out web frameworks and different deployment options), I ended up needing to migrate website’s data to a new database schema. And this time I switched from Play Framework 1.2 to Ruby on Rails 3.2. Of course, I could have modified my models to use the old schema, but that would be less interesting and probably not worth the hassle for a not-critical-so-let’s-have-fun application.

Speed up and clean up Gajim's history

After a few years of using Gajim, the history of all messages, statuses, etc. can grow up to quite large size. In my case the logs.db file consumed 128MB of disk space.

Searching through the conversation history (in the Conversation History window) can take up to few seconds for each query. And after removing and adding various XMPP/Jabber (or Facebook Chat) accounts, there’s a lot of unnecessary Jabber IDs left in the database.

So let’s take a look at how to speed things up and remove unnecessary data form logs.db (but whether it will work for you or not, substantially depends on how you’ve been using Gajim and what you keep in Gajim’s history).

Volume change notifications in Openbox

If you’re here, you probably want to know how to configure notifications for volume change actions, just like it is in most of current less-geeky GNU/Linux distributions and window managers.

So if you press the volume up/volume down button, you want to see some notification with a beautiful icon and current volume percentage, like this: Volume notification

And if you press the mute button you are expecting something comparable to: Muted volume notification

Use "cd" from within a Bash script

Why the need of this?

Let’s assume you want to write a script that would allow you to navigate faster between your most frequently used directories. And let’s take my everyday problems as an example. I have a similar directory structure:


Every time I want to cd to one of these directories I have to write something like:

cd ~/studies/semester4/subject2

which is a little pain in the arse if I have to do this many times (and I have to). And no, using Nautilus or Thunar or Dolphin or any other graphical tool doesn’t help - clicking is still slower than writing.

Openbox on Arch: file associations

Configuring file associations is easy if you’re using a full-featured desktop environment, such as KDE, Gnome or Xfce. In such case, xdg-open delegates the task of opening file to kde-open, gnome-open or exo-open, depending on the environment. But with Openbox and similar environments it’s not that easy.

It’s likely that when you click on a just downloaded PDF file, it opens in Firefox and not in Evince or Okular (or your any PDF-reader of choice), because xdg-open defaults to Firefox.

One possible solution is to install a part of KDE, Gnome or Xfce environment, and use one of the *-open family. But we’ll try a more “pure” solution.