Growl

From RedBrick Wiki
Jump to: navigation, search

OK. Growl is a notification protocol that talks to a service on your local machine and makes nice little bubbles pop up when certain events occur.

For a WTF IS GOING ON bit scroll to the bottom.

[Screenshot]

I basically wanted to be told when someone hilights my nick or PMs me in weechat (there're probably similar scripts for IRSSI, but fuck that heap of shit)

I'm using a nice little program in ubuntu called mumble for my notifications. Get it [here].

Once you've installed and launch it an icon should appear over there beside your clock.

- Right click it and choose preferences.
- Enable network notifications.
- Set a password.

You may need to forward UDP port 9887 to your local machine on your router.

On your local machine you're gonna have to install socat:

sudo apt-get install socat

Once that's done you need to start socat locally:

socat TCP-LISTEN:PORT,reuseaddr,fork UDP:127.0.0.1:9887 &

Then log into redbrick with a port redirect going on:

ssh USER@login.redbrick.dcu.ie -R PORT:127.0.0.1:PORT

Once you've logged into redbrick another instance of socat needs to be launched (I'm told committee require permission for network services to be run, but since when has anyone ever given a shit about these things??????????????????/) tsocks is in there thanks to DCU's proxy.

I run this inside a screen instance before launching weechat. If weechat's already running you can just do ctrl+z to suspend it, run the following command and then run 'fg' to bring weechat back from the dead.

tsocks socat UDP-LISTEN:9887,reuseaddr,fork TCP:127.0.0.1:9996 &

Everything's ready to go now, so just launch weechat (my build of dev version 0.2.7 is available at /home/associat/d/dregin/weechat/bin/weechat-curses)

Depending on the version of weechat you're running do either:

For 0.2.7

wget http://www.mysticcoders.com/tools/downloads/growl-net-notify.pl -O ~/.weechat/perl/autoload/growl-net-notify.pl

OR for 0.2.6

wget http://www.mysticcoders.com/tools/downloads/growl-net-notify-0.2.6.pl -O ~/.weechat/perl/autoload/growl-net-notify-0.2.6.pl

Load the plugin with:

/perl load growl-net-notify.pl

OR

/perl load growl-net-notify-0.2.6.pl
/help growl
/growl setup YOUR_IP YOUR_LOCAL_PASSWORD PORT


So... WTF is all this shit doing????

BASICALLY.

- Mumble waits for notifications from localhost... The problem is that weechat is running remotely on a redbrick server in DCU.
- SSH -R is sending messages from the redbrick server back to our localhost.
- Socat listens for message from redbrick (the SSH -R bit in step 2 there) to the port that Mumble is listening to on localhost.
- On redbrick the weechat script is sending it's growl notifications to localhost
- The socat instance on redbrick is listening for shit (growl notifications) on localhost and sending it to the port that SSH -R above is looking 
  for.. Thus actually sending it backwards through our SSH connection to our localhost where mumble gets it and pops up a nice little notification box.

This is what it looks like

weechat ---> socat on redbrick ---> SSH -R ---> socat on localhost ---> mumble