Archive for the 'Uncategorized' Category

Printing Greenhopper Cards From Jira

In an attempt to keep a better historical log of our work, my company switched from a whiteboard and 3×5 cards to Greenhopper on top of JIRA. However, we wanted to keep the whiteboard for ambient information and as a location for morning scrum. Greenhopper doesn’t support a way of printing 3×5 cards so what follows is a very convoluted set of instructions that have gotten up 80% of the way there.

Greasemonkey

Greenhopper has a way of printing story cards but the only available layout is a two column setup that doen’t handle page breaks nicely causing cards to be cut between pages. The following greasemonkey script will force a page break after each card.

function addGlobalStyle(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css;
    head.appendChild(style);
}

addGlobalStyle('.issueCard {page-break-after: always;}');

Include this script on the following url pattern:

http://jira.locamoda.com/secure/Print.jspa*

Printing in Firefox

Ideally you could print directly from firefox to the 3×5 card but with my setup (FF 3.6 on OS X 10.6) Firefox wont accept 3×5 as a valid page size. To get around this create a 4.5 x 7.5 paper size by going to File -> Page Setup and select Manage Custom Sizes… under Paper Size. With that paper size selected, navigate to the Planning Board view in Greenhopper and click the printer icon next to your current sprint. Turn off all the headers and footers and click preview, not print.

Printing in Preview

In preview you are able to create a 3×5 paper size. Choose Print from the File menu and you  will see a Paper Size drop down in the print dialog. Select Manage Custom Sizes…, just like in the Page Setup dialog in Firefox, and create a paper size of 3×5. With that paper size selected click the scale radio button and scale up to 125%. Finally, load your printer with 3×5 cards and click print. You should end up with prints that fill most of a 3×5 card.

Simple Interrupt Driven Multitasking with scripts

Compiling. Searching. Downloading with wget. They take a long time and are kind of boring to stare at. You have two choices. Choice one is to follow the xkcd model:

xkcd comic about wasting time compiling

xkcd comic about wasting time compiling

But once in a while, you actually have some other stuff to do. Maybe if you had a few minutes you could go a few emails closer to Inbox Zero or you could go watch something to make you smarter or go read something. Either way, if you’re like me and that guy from Momento and you try to do something else useful while your computer is working you will immediate forget that it was off doing your bidding and you will stumble across the idle terminal hours/days later.

Here’s a really quick solution. Put this script in your path somewhere.

#!/bin/bash

if [ $(uname) = "Darwin" ] ; then
  # osascript doesn't allow you to interact with the UI so just raise the terminal
  osascript < /dev/null 2>&1
elif [ $(uname) = "Linux" ] ; then
  zenity --title "Finished" --info --text "I'm done doing what you asked." > /dev/null 2>&1
elif [ $(uname) = "Cygwin" ] ; then
  echo "Left as an exercise for the reader. Helpful hints may be found at http://store.apple.com and http://ubuntu.com"
else
  echo "Unknown platform: $(uname)"
  exit 1
fi

I call it fin like that classy word at the end of old movies.

Then when you start a long running command run it like this:
bash$ go-search-my-whole-harddrive.sh ; fin
or
bash$ compile-my-kernel.sh ; fin

Then, when your thing is done, whether it worked or not, you will get some sort of indication that its done and you can get back to what you were doing.

I have really started to love this little script the last few days. One thing though, make sure that the other thing you start to do while waiting is an easily interruptable task or your brain will explode when the indication pops up. No one likes brain explosions.