Pushover notifications for SSH logins

Curious to know when a user logs into your server successfully via SSH? Using Pushover notifications you can have something like this.

Pushover

Fortunately, tying together PAM and Pushover is painless.

Log into Pushover and register an application. Spruce things up with a relevant icon and make note of the application’s API token and your user key.

Next, grab this small script and place it somewhere on the server. I put mine here, /etc/ssh/pam-pushover.sh. Edit the script and insert your API token and user key like so,
PUSHOVER_APPTOKEN="<YOUR_APP_TOKEN>"
PUSHOVER_USERKEY="<YOUR_USER_KEY>"

Make sure the script is executable
chmod +x /etc/ssh/pam-pushover.sh

Add the following line to /etc/pam.d/sshd
# Notify Pushover on successful login
session optional pam_exec.so seteuid /etc/ssh/pam-pushover.sh

Upon next successful login your Pushover client should be greeted with a nice notification. Also, since this is a PAM configuration, with minimal modification you could extend this to samba, sudo, etc.

MonoTorrent Gtk# Interface Summer Wrap-up

Since my last public update around midterm, the gtk-sharp interface has shaped into a fairly nice and usable client. Over the last week I implemented a RSS manager which turned out pretty well, and squashed the remaining known bugs. Although I was unable to implement all the deliverables originally planned, I feel the ones which were implemented are the most beneficial to the general user. Features not present for the “pencils down” date were addins support, and a tracker manager.

Here is a video demonstrating the current state of the gtk# interface.

Download high resolution ogg theora video

Although today at 19:00 UTC Summer of Code 2007 officially ends, my desire to continue development on the interface does not. Post SoC, my first focus will be to complete implementing Mono.Addins support and have RSS and tracker support as optional addins. If there are features you specifically would like to see, your comments and suggestions are greatly appreciated.

Lastly I’d just like to thank Google and everyone at Mono for allowing me to have the opportunity to work on this, I’ve had an amazing summer!

MonoTorrent Gtk# Interface Update

Finally an update to this log, conveniently before midterm evaluations! I have updated the midterm deliverables page to reflect the current status of the project, but for those who love visuals here is a screenshot showing off the interface in action.

Monsoon

As of posting, most basic functionality is complete. As listed in the midterm deliverables there are still some outstanding features not yet working. Missing is, UPnP support, a persistent interface between sessions, restoring individual torrent settings between sessions, viewing pieces, creating and setting labels, and also a small handful of helper features(auto add from directory, move data once download is complete, etc).

Regarding viewing pieces, to my knowledge, currently there is nothing like a piece bar available in gtk-sharp. This is going to be needed to illustrate torrent availability/pieces, as well as a file’s download progress. Although at the moment I’m not sure what creating a custom widget like this entails.

After adding filtering support to my TreeView, drag n’ drop broke. This was due to the TreeModelFilter not supporting the TreeDragDest interface. I am having a hard time solving this problem. The following Gtk warning has some suggestions,

Gtk-WARNING **: You must override the default 'drag_drop' handler on GtkTreeView when using models that don't support the GtkTreeDragDest interface and enabling drag-and-drop. The simplest way to do this is to connect to 'drag_drop' and call g_signal_stop_emission_by_name() in your signal handler to prevent the default handler from running. Look at the source code for the default handler in gtktreeview.c to get an idea what your handler should do. (gtktreeview.c is in the GTK source code.) If you're using GTK from a language other than C, there may be a more natural way to override default handlers, e.g. via derivation.

I’m sure this is an easy solution, but as I am new to gtk-sharp, I’m quite lost! I’ve tried creating a stub by overiding OnDragDrop in my TreeView but that of course stopped DragDataReceived from working. It suggests a call to g_signal_stop_emission_by_name() (through a P/Invoke?) but I’m guessing that would be the same as creating a stub. Lastly I derived TreeModelFilter and implemented the interface but at runtime I received a cannot override exception.

Other then the above problems, development has been great. Alan’s MonoTorrent library is great to work with.

Accepted to Google Summer of Code 2007

Now that the dust has settled over a busy semester I am happy to announce that I was accepted to participate in the Google Summer of Code 2007. This summer I will have the privilege to write a MonoTorrent Gtk# interface for the Mono Project. My mentor will be a former Summer of Code student and author of the MonoTorrent library, Alan McGovern.

This year Google accepted over 900 students across the globe from around 6200 applications. To say the least, I am quite honoured to have the opportunity to work on this project and hope people enjoy it! :) Over the summer this weblog will be a journal of my progress as well as status reports. If you are interested in the development of the Gtk# MonoTorrent client then this the place to lurk.

I’d also like to congratulate Armando Diaz-Jagucki on having his proposal accepted to the XMPP Standards Foundation.