Jul 14 2009

sendxmpp in Lenny

sendxmpp in Debian Lenny doesn’t work properly with Pidgin or Adium. I don’t know if it’s a libpurple problem or a sendxmpp problem. sendxmpp can talk to Psi ok. Upgrading sendxmpp to the version in Sid fixes the problem. The difference seems to be that now sendxmpp is sending messages of type “chat” instead of type “message” or “normal” (by default—now you can specify which message type to use). But Psi can send “message” messages to libpurple clients ok, so it doesn’t seem to be quite that simple.


Apr 24 2009

Crunch Time

I’ve been writing my dissertation in earnest for a couple of months now, for some definition of in earnest. As expected, things have come up to slow the process down—research that after closer scrutiny needed refinement, job hunting, sickness (my family and then I got the flu), presenting at a conference (remotely), some procrastination and writer’s block, and a general inability to write faster than is humanly possible. Just in case you were wondering, the rule of thumb to multiply coding estimates by 3 applies to writing as well.

That said, I’m still on track to graduate in August and making good progress. But because I don’t want that to change, and because I don’t know how the next few months will pan out with the job hunt and potential on-site interviews, I am going into super crunch mode. It’s like when they tried to make Knight Rider more exciting by modifying the car by adding extra drag so it would go faster. But not as glamorous.

This means that during the day when I should be working I won’t be haunting the usual haunts: IRC, Instant Messenger, email. I will of course check my email at least a few times a day, but when I’m writing my MUA will be closed. I will keep at least Jabber (Google Talk) online, set as away, as I have done previously. All this is not because I want to hide from you but because I want to minimize the event-based distraction mode I sometimes find myself in—constantly jumping between IRC, IM, email, social networks, RSS, etc. looking for the next communication task. If you do need to contact me urgently don’t hesitate to hit me up where you find me, or in the worst case talk to Erin, who will know how to get ahold of me.

While I’m on the subject, I’ll bore you with the methodology I’m employing in the never-ending battle against procrastination. First and most importantly, I have a goal to write 15 minutes every day, as a bare minimum. Even on otherwise-unproductive days (whatever the reason) I can squeeze in 15 minutes which means at least a little progress. More importantly, it means my mind keeps engaged on the problem and my dissertation doesn’t get swapped out. I’ve been doing this since January and it has made a huge difference in my productivity. I highly recommend it to anyone. For more information, check out the workshop homepage, read the summary, or grab the book. Or just write 15 minutes a day and let your success speak for itself.

15 minutes a day is great, but when you’re writing a dissertation and nothing else, it’s not sufficient. So I’ve had to kick it up a notch. Eddie Jung has some good advice: “Don’t get distracted. Keep starting. That’s all.” We’ve already talked about the public face of my efforts to not get distracted. I also have a plan for doing the “keep starting” part, which is I think the hardest part. Once I’m started and in the zone, you could be screaming my name in IRC or calling me on the phone and I won’t even notice let alone be distracted. So I think it boils down to “Keep starting. That is all.”

So how does one keep starting something that is frequently uninviting? “Just do it,” I can hear you say. That’s easy for a construction worker or someone doing something physical, but it’s hard for those of us who work with our brains, especially creative work. Because the very instrument we are trying to bring to bear is the instrument that is so easily distracted.

I like the metaphor of a train getting started. It’s big, it’s heavy, and at first the wheels spin and things move very slowly. Some glorious days, I wake up already rolling down the tracks. Maybe I went to sleep at the top of a hill, I don’t know, but I’m off and running before I’ve finished rubbing my eyes and the day is an outstanding success. Other days I sit down and keep trying to start without ever starting.

My plan to keep starting is to set up a ritual. A personal algorithm, if you will, for beginning to write. Just as the dog turns around three times before lying down to sleep. It has to be something that I can consciously do to trigger myself to begin writing. It has to be a trigger, and facilitate writing. It has to be portable—I have to be able to do it on my couch, in my “office” (the rocking chair in the kid’s room), at school in my real office, in the library (sometimes when I’m having a hard time focusing going to the library for a change of scenery helps), a café (ditto, but close to home), or just about anywhere. It has to be quick, like turning around three times and not like doing 30 minutes of yoga and upside-down meditation or something.

I have no idea if it will work, but here’s what I came up with: prep, timer, visualize. By prep I mean close my email client, IRC, etc., get situated, and get my water bottle filled if necessary. Minimize distractions and optimize the environment. By timer I mean grab my timer and set it for 15 minutes or whatever minumum chunk of time I feel up to. When the timer goes off, I can take a short break if I need to. It’s my sanity escape hatch—you can do anything for 15 minutes, even write. It’s also my distraction safety net—if the timer goes off and I am not writing, I got distracted and it’s time to start over. The visualization step is to close my eyes and engage my brain on the task, and not open my eyes until I have an action to perform. With my eyes closed, none of my distractions can reach me even if they made it through the cracks.

I have high hopes for my new plan. I know some parts work already, and I’m optimistic about the rest. I think it’s simple enough to actually work. Maybe my sharing it with you will inspire you to refine your process a little bit.

How do you avoid distractions and keep starting?


May 17 2007

Jabber Call Notification

I can’t believe I never thought of this before. It’s the ultimate in couch potatoism.

We don’t use the phone much. When it rings, the house fills with moaning and groaning because nobody wants to answer it, but we often don’t dare ignore it because we don’t know who it is. As I usually have my laptop with me, or at least in sight, I realized (with the idea coming from a client who wants me to do some Jabber integration) that the perfect solution is to have Asterisk send me a notification via Jabber with the caller ID.

It’s very simple. I use the sendxmpp program to
do the heavy lifting. Here’s the
Batphone script:

#!/usr/bin/ruby

## Configuration
# sendxmpp config file has to be mode 600 and owned by the asterisk user
CONFIG="~fugalh/telephony/.sendxmpprc"
RESOURCE="Asterisk"
RECIPIENTS="hans@fugal.net erin@fugal.net"

require 'agi'
agi = AGI.new
IO.popen("sendxmpp -r #{RESOURCE} -f #{CONFIG} #{RECIPIENTS}", "w") {|f|
  f.puts "Incoming call from #{agi.env['callerid']}"
}

As much as I love Batphone, it’s almost as easy to do with a shell script:

#!/bin/sh

# sendxmpp config file needs to be mode 600 and owned by the asterisk user
CONFIG=~fugalh/telephony/.sendxmpprc
RESOURCE=Asterisk
RECIPIENTS="hans@fugal.net erin@fugal.net"

# this snippet from http://yakko.cs.wmich.edu/~drclaw/asterisk/cidname/
declare -a array
while read -e ARG && [ "$ARG" ] ; do
    array=(` echo $ARG | sed -e 's/://'`)
    export ${array[0]}=${array[1]}
done

echo "Incoming call from $agi_callerid" | \
    sendxmpp -r $RESOURCE -f $CONFIG $RECIPIENTS

If you are lucky enough to get agi_calleridname set as well, you obviously
might like to integrate that information into your message too. Here’s the Asterisk dialplan snippet:

exten => s,1,AGI(/home/fugalh/telephony/jabber.agi)
exten => s,n,Dial(SIP/sipura&SIP/hans,30)
; ...