Archive for the ‘General’ Category

Task Management with Hiveminder and Perl

Saturday, March 13th, 2010

This is how I manage my tasks with Hiveminder on a weekly basis and the Perl script that helps me do it. I don’t really expect the Perl script to be useful to anyone as-is but portions of it may be useful to others, as well as the general work flow, so I’ve decided to share them.

At Linode we have a wiki page where we list 5 or more tasks we wish to accomplish during the week. There is a heading for each employee and below the heading we place our tasks. Throughout the week we can add additional tasks or mark existing ones as done.

I’ve used Hiveminder for some time. When we started the weekly task lists at Linode I found that taking a few minutes to figure out which tasks I wish to complete in the coming week works quite well for me. I started marking these tasks with the ‘week’ tag in Hiveminder. I quickly ended up writing a perl script, week.pl, to help me manage hem.

My Weekly Workflow

First thing Monday morning I run:

$ week.pl report

This prints a report with two sections. The first section lists tasks that currently have the ‘week’ tag with a line through the task ID if it is completed. This gives me a nice summary of what I planned on accomplishing the previous week and how I did. The second section lists all of my tasks currently visible in Hiveminder. I hide tasks that I know I’m not going to work on in the next few weeks so this list is usually no more than 20 or 30 items.

Sample report Image

I take this report into the Monday morning meeting with me. During the meeting, I’ll glance over this list and select items for the upcoming week. I also use this page to take notes on during the meeting, writing down any new tasks that come up in the meeting.

After the meeting, I add any new tasks generated in the meeting that I won’t be working on this week to Hiveminder.

$ todo.pl braindump

todo.pl comes from App::Todo, a command line Hiveminder interface. The braindump command launches $EDITOR where I add new tasks, one per line. The braindump syntax allows for specifying tags, setting priorities, and other things as well.

Next, I prepare the task list for the upcoming week:

$ week.pl edit
Carry over the following tasks?
bring about world peace (y or n) [default y] y
write some awesome pre
do some other cool stuff
create practical cold fusion (y or n) [default y] n
return library book

The edit command iterates over each task tagged with ‘week’ if the task is not marked completed. It prompts whether or not I wish to carry the task over to this week (leave the tag). Any tasks marked completed have the tag removed automatically.

$ week.pl add
Created:
        #YRVK write an awesome report for Tom [week dev]
        #YRVL test some new stuff for deployment [week admin]

The add command works the same as todo.pl’s braindump command except the ‘week’ tag is automatically applied to the newly created tasks. The full braindump syntax is available for specifying other properties of the tasks.

$ week.pl update https://path.to.trac/wiki/Tasks/2010-03-15
Sup dawg, I heard you like tasks so I did ur shit for you

The update command grabs my tasks tagged with ‘week’ and formats them one per line started with ‘ * ‘, a wiki bullet list. It grabs the current wiki page, finds my heading, substitutes the formatted task list under the heading, and submits the change. It also stores the path given in the YAML config file.

$week.pl go

This opens the stored URL for this week’s tasks wiki page in my default browser, allowing me to confirm week.pl did what it’s supposed to.

Later in the week once I’ve done something:

$ week.pl done tom
#YH7T bring about world peace [dev week]
#YRVL test some new stuff for deployment [week admin]
[DONE] #YRVK write an awesome report for Tom [week dev]

This retrieves the task(s) tagged ‘week’ that are not marked completed containing the given string. If there was only one match, the script marks it as done and then outputs the current state of tasks tagged ‘week’.

$ week.pl update
Sup dawg, I heard you like tasks so I did ur shit for you

Same as update before, except when no URL is given, the URL is read from the configuration file. This way I only need to worry about the URL once per week, the first time I update for the week.

Conclusion

So there you have it. If you are also using Hiveminder, maybe aspects of my work flow will make sense for you and pieces of the Perl script may be useful. If you aren’t using Hiveminder, maybe you will be inspired to check it out. I use michael@thegrebs.com on Hiveminder in case you feel the need to assign me a task or wish to gift me another year of Hiveminder Pro ;)

week.pl

Comic Genius

Tuesday, September 29th, 2009

This guy is a comic genius! Sheer hilarity.

WebService::MobileMe uploaded to the CPAN

Sunday, July 26th, 2009

Just a quick post to announce a new perl module I uploaded to the CPAN the other day. It’s still to be considered alpha quality as it is lacking error checking and other such necessary stuffs but is working for me.

Usage looks like:

use WebService::MobileMe;

my $mme = WebService::MobileMe->new(
    username => 'yaakov', password => 'HUGELOVE' );
my $location = $mme->locate;
print < <"EOT";
    As of $location->{date}, $location->{time}, Yaakov was at
    $location->{latitude}, $location->{longitude} (plus or minus
    $location->{accuracy} meters).
EOT
$mme->sendMessage( message => 'Hi Yaakov!', alarm => 1 );

The online documentation is available via search.cpan.org.

Git Web: http://git.thegrebs.com/?p=WebService-MobileMe
Git Clone: http://git.thegrebs.com/git/WebService-MobileMe

YAPC|10

Monday, June 1st, 2009

I will be at YAPC|10 in Pittsburgh the end of June. Here’s a schedule of the talks I plan to attend. There are a few holes not because the talks at those time suck but because they rock so hard I can’t decide which I want to attend.

Playing a Tone Through an Arduino Connected Piezo

Monday, March 23rd, 2009

I’m working on a top secret project, all I’ll say is it involves the Arduino, Twitter, and the refrigerator, and needed to play a tone through a piezo connected to the Arduino. I looked around and the closest I could find was a tutorial that included code to play a melody.

This wasn’t quite what I wanted and the playTone function expects the notes and timing to be in global variables which makes the baby jesus cry. The premise was simple though. Take the period and divide by two then bring the output high then low for this amount of time, repeat to make up the desired duration.

int pinSpeaker = 10;

void setup () {
    pinMode(pinSpeaker, OUTPUT);
}

void loop () {
    playTone(750, 500);
    delay(750);
}

// duration in mSecs, frequency in hertz
void playTone(long duration, int freq) {
    duration *= 1000;
    int period = (1.0 / freq) * 1000000;
    long elapsed_time = 0;
    while (elapsed_time < duration) {
        digitalWrite(pinSpeaker,HIGH);
        delayMicroseconds(period / 2);
        digitalWrite(pinSpeaker, LOW);
        delayMicroseconds(period / 2);
        elapsed_time += (period);
    }
}

This simple sketch plays a 500Hz tone for 750 mSec, pauses 750 mSec and repeats. To use it in your sketch simply define pinSpeaker and set it for output, copy playTone to your sketch and call it with the duration in milliseconds and the frequency in hertz.

pitz prepares to rock my socks

Sunday, February 22nd, 2009

Matt Wilson must be spying on my dialogs in sekrit IRC channels. After setting up Task this evening I mentioned there being several project ticketing systems, like Ditz, that store data in the RCS. I was lamenting the fact that there wasn’t any of these systems written in anything other than ruby that I was aware of.

Reading my RSS feeds before bed, I found “My new ticket tracking system is now vaporware” from Matt Wilson’s blog talking about Pitz, his soon to exist Python implementation of Ditz.

Please take a few moments to read over the feature set and example commands on the Pitz site and let Matt know about any ideas/suggestions you may have.

~/.bashrc Perl Module Version Tip

Friday, January 9th, 2009

I often need to quickly check the version of a perl module currently installed. A while back I got tired of running:

$ perl -MPOE::Filter -E 'say $POE::Filter::VERSION'
1.2357

So I added a quick function to .bashrc:

pm-vers () {
    perl -M$1 -e "print \$$1::VERSION, \"\n\""
}

Now I just run:

$ pm-vers POE::Filter
1.2357

git diff and white space

Wednesday, January 7th, 2009

So I’m getting ready to make a commit to wxperl and I run a

git diff

to check on changes and git yelled at me that I had some trailing white space. Well it didn’t yell but it hi-lighted the white space in red. Way awesome!

git-diff-trailing-white-space

Net::Abuse::Utils v0.10 Released

Sunday, December 28th, 2008

I just released Net::Abuse::Utils v0.10 to CPAN. If you can’t wait, grab it here.

If you haven’t heard of this module before, see this online example of some of the data that can be returned. Online docs are available as well at search.cpan.org.

From the Changes file:

  • New get_domain function that converts host name to domain name
  • Memoize support though commented out by default, enable by
    uncommenting the following two lines in lib/Net/Abuse/Utils.pm
    # use Memoize;
    # memoize(‘_return_rr’);
    A future version will likely allow Memoization via an export tag.

The get_domain function is fairly spiffy taking a host name like ‘michael.thegrebs.com’ and turning it into the domain name, ‘thegrebs.com’, but with proper recognition of second level zones like .co.uk.

The Memoization support is weak and I almost removed it but decided to leave it in but commented out for this release. It speeds up batch processing of large quantities of requests fairly well. Processing a days worth of spam used to take an average of 5 minutes and is now down to a minute and a half. This is quite a bit more increase than I expected as I am using bind with heavy local caching.

There were a few more changes mostly related to distribution related stuff, see git for the full gory details.

Not a horribly significant release but it’s been a while since the last one and I wanted to get get_domain out there.