Killing IM with killall and taskkill

I’ve stated before how I am fortunate to be in a position where I typically work on a Linux, OSX, and Windows desktops on regular basis. Depending on what I am doing and my location I might spend a good amount of time on any of these systems. For the most part, my life style makes this pretty easy. I live in “the cloud” a lot for things like email and even documents. I keep things standard complaint and use tools that are typically cross-platformed or have counterparts on other platforms. This has afforded me some great freedoms and have allowed me to unchain myself and not be too dependent on any one solution. Instead my life has become one of preference and knowledge.

However, with everything there has always been pain points, one for me has been IM. While yes, it no longer matters which platform I am on at any given time I am still able to access my Yahoo, AIM, MSN, Gtalk accounts, the issue comes into play when I move from one machine to another and forget to sign out of IM on the previous machine. Some of the IM services alert you when you are logged onto one accounts from multiple systems and allows you to decide what to do, like AIM which gives you an option to send it a command to log you out of your previous session. Some just don’t care, like Gtalk which doesn’t seem to be concerned with how many times and from how many locations you are logged in, I don’t particularly like this approach. Then there are services like Yahoo that just get upset and decides to log you out from one of your accounts, couple that with IM clients that battle to keep their connection like Trillian and you can end up in a situation where you can’t log into your account because another is already logged in and wont let go.

I’ve come up with a few approaches that have made this situation somewhat manageable. On my Linux and OSX box this is pretty simple, there is a command line command called ‘killall‘ that comes to the rescue. With the line ‘killall pidgin’ or ‘killall Adium’ my IM clients on Linux and OSX respectively, end. Add the ability to ssh into these systems and if I forget to log out I simple do a quick ssh connection to these boxes, run my command and I am done. Furthermore, I typically have a good idea when I wont be at those computers, so with that information and the killall command, I am able to add crontab entries to automatically run my command. So for example, I know at 3AM I don’t want to be up IM’ing with anyone so I run that command at that time in case I left my IM client running before going to bed. I also know Monday through Friday I am typically at work and in my office around 8AM so I run that command on my home systems at that time too in case I left the house without logging out. The command ends up looking like this in crontab, 00 03,08 * * * /usr/bin/killall Adium > /dev/null 2>&1 Worse case scenario, I ssh back to the system and manually run the command. Its a great system and works like a charm.

At work the story is a little different. First off, the system I run IM on is a Windows machine which doesn’t have the cool ability to just SSH to and even if I did install an SSH server on the machine it is located behind a corporate firewall so I wouldn’t be able to get it anyways from the outside. I do have the ability to log in via VPN but that is a lot of work to log into the corporate VPN and RDP to my desktop just to turn off an IM client. Windows also doesn’t really have crontab, it does have a “scheduler” which acts kind of acts like crontab but that coupled with the fact that Windows doesn’t really have the same powerful command line tools that Linux and OSX have makes this simple task a little tougher to accomplish.

I have come up with a solution however, there’s a command on my Windows XP called ‘taskkill‘, I am not sure if this command is available on all Windows platform but it is on mine so I use it. Now with this command, I am able to write a small batch file that has the one line in it like this taskkill /f /im trillan.exe. When ran this behaves very much like killall on my other machines. I then use the Windows built in scheduler to run this batch file every day, Monday through Friday, at 6:30 PM because if I am still at work at this time, I am done talking to people and need to finish up work and get home. Now for whatever reason, this doesn’t always work or maybe I leave work early and need to get on IM at home. Because of the before mention firewall issue, its not as easy as just SSH to the box and running the command manually. So I had to come up with a solution to reach into my computer at work from outside to kill my IM if needed. To do this I created an Outlook rule. Since I almost always run Outlook 100% of the time when my work laptop is on, so Outlook seemed like the best vehicle for this effort.

To accomplish this, in Outlook I’ve defined a rule that looks for emails from specific senders (for example my personal email address), looks for a specific subject line (like “Turn off IM”), and checks for something special in the body (example “Trillian”). If all these conditions are meant, then it runs my aforementioned batch job and kills Trillian.

That’s about it, that’s how I manage my IM needs that run of various different OS in various different environment during various different times and allows me to stay unchained, mobile, and free. Hope you found some of this information helpful.

Sorry, comments for this entry are closed at this time.

The Flickr API returned error code #100: Invalid API Key (Key has invalid format)