아이러브커피
OWENCOUTTS
Walking in the clouds...

How I Irssi

Background

At Mozilla, we work as an extremely distributed community. Communication can be a challenge at times. One of the main tools we use is IRC. Although I loved the simplicity of communicating over IRC, the GUI clients that were available for mac all had a set of issues that I found rather annoying.

  • Wireless Drops, IRC Disconnects: Part of the reality of working on a laptop is that you sometimes get disconnected. On IRC this means that you miss potentially valuable conversations. I wanted a solution that separates being connected to the internet to being connected to IRC.
  • Portability: I often work from different computers. I hated having to connect multiple times and have some stupid nick like ocoutts|macbook or ocoutts_. I wanted to be able to open the same connection from any computer.

Irssi was able to solve all the problems that I had with the GUI clients. The portability issue was solved by running it on a remote server. Although it took some ramp-up time to get used to all the command line actions, the usability hit was ultimately well worth it.

Usage

This solution has the following dependencies on the remote server

At Mozilla all committers have access to the “People” server that provides both of these.

Once you have all your dependencies setup the first step is to put your Irssi Config under ~/.irssi/config. This is a link to a basic config for mozilla IRC that you can alter to your needs

You want to run irssi within screen so it doesn’t die when you’re ssh connection dies. Run the following commands:

$ ssh remoteserver
$ screen
$ irssi

You should now have your IRC connection up and running within screen. Now close that terminal. Open another tab and run the following commands:

$ ssh remoteserver
$ screen -raAd

You should now be reconnected to your original IRC connection. On your local computer you can add a script to open IRC. Lets call it open_irc.sh Here is an example:

#!/bin/bash
ssh -t remoteserver screen -raAd

Notifications (for mac)

Irc is really hard to use if you don’t get pinged on notifications. I followed this guide, i’ll reiterate the important steps:

$ ssh remoteserver
$ mkdir -p ~/.irssi/scripts/autorun/
$ cd ~/.irssi/scripts/autorun/
$ wget http://goo.gl/FcHi3

fnotify is a script that pipes data whenever events such as a mention or a PM occur. These events occur on the remote server but we want to have them display on the local computer. To get this working we need to tail the fnotify server and output those results to growl.

First, you need to install growlnotify. Growlnotify is on the .dmg image in the extras folder. The instructions for how to install growl notify can be found on the growl website.

Once you’ve installed growlnotify you can sanity check it by running the following command:

$ growlnotify -t "Weather" -m "Sunny with double rainbows"

Remember open_irc.sh? We want to add support for notifications to that. You can download my open_irc.sh file here. Make sure you change ssh people to whatever the name of your server is.

Any questions? Any problems? Need help? Don’t hesitate to shoot me an email me at owen@owencoutts.com