Thursday, November 6, 2008

MCabber: a command-line-only multi-protocol IM client

Command-line geeks, its time to stay focused on your terminals and not switch to X back-and-forth when chatting with your buddies.
mcabber is a small Jabber console client.
mcabber includes features such as SSL support, MUC (Multi-User Chat) support, history logging, command completion, OpenPGP encryption, OTR (Off-the-Record Messaging) support and external action triggers.

As you can see MCabber is just a Jabber client. So you can not use it to connect to your favorite IM servers like MSN, Yahoo!, GTalk,...

However, you can use it to connect to these networks with little effort. All you have to do is to install OpenFire (or any Jabber server software) and enable the GatewayIM plugin. From its name, this plugin enables you to connect to other IM networks. Just create an account on your Jabber server through its nice web interface and configure it with other networks login information. Next, let MCabber connect to your server and do everything you love.

To install MCabber on Debian/Ubuntu just type:

sudo apt-get install mcabber

Before you connect with the server, you have to configure MCabber first. The only mandatory configuration is server address, port, username (jid format: username@servername, you can know the servername from OpenFire admin console) and password. You can start with the example configuration file by copying it to your home directory:

cd $HOME
mkdir -p .mcabber/histo
zcat /usr/share/doc/mcabber/examples/mcabberrc.example.gz > .mcabber/mcabberrc

So far, I have been talking about everything old! Anything cool here?

A great functionality of MCabber is that you can write an external script in any language and let it handle IM events like message received, buddy logged in, ...
I have wrote a bash script which plays some nice sounds (got them from Pidgin) on some events, so that you don't have to poll mcabber "window" to watch for new messages! You can download the script from here.

Update: The script now "says" the jid of the buddy logging in/out! However, you need to install festival before you can use this feaute:

sudo apt-get install festival

Don't forget to turn on execution bit or it won't be able to run.

chmod u+x $HOME/.mcabber/

Don't also forget to edit mcabberrc to tell it to use that script for handling events

set events_command = /your/home/directory/.mcabber/


Saturday, November 1, 2008

Building a no-X version of HTK on Linux

The Hidden Markov Model Toolkit (HTK) is a portable toolkit for building and manipulating hidden Markov models. HTK is primarily used for speech recognition research although it has been used for numerous other applications including research into speech synthesis, character recognition and DNA sequencing. HTK is in use at hundreds of sites worldwide.
Quoted from the HTK website.

HTK is a free/open-source piece of software. It builds on Linux, Solaris, IRIX, HPUX, Mac OS/X, Windows NT, 2000, XP and FreeBSD.

The problem:
If you tried to build HTK on a command-line-only Linux machine (no X installed), it will give build errors. You may face this situation if you need to run your experiments on a hosted solution that has no GUI to exploit its CPU/memory power. The problem happens because there is a single tool that requires graphical user interface: HSLab.

HSLab is an interactive label editor for manipulating speech label files. An example of using HSLab would be to load a sampled waveform file, determine the boundaries of the speech units of interest and assign labels to them. HSLab is the only tool in the HTK package which makes use of the graphics library HGraf.
In most cases you will not need this tool in your regular experiments. So if this is your case, you can disable it so that the rest of HTK would build successfully.

The solution:
I assume you are using the latest version of HTK (3.4). Disabling HSLab comes in 2 steps:
  1. Remove HSLab target from file HTKTools/Makefile in line 48.
  2. Remove HGraph from object dependancy in file HTKLib/Makefile lines 49 and 78.
If you have no idea how to make this, you can download my 2 patches and place them in HTK src directory. Run the following commands to patch the makefiles and make/install HTK:

# change directory to htk src path, then:
patch HTKLib/Makefile HTKLib.Makefile.patch
patch HTKTools/Makefile HTKTools.Makefile.patch
sudo make install

Now the whole HTK installs with no problems.
Enjoy :)