Blog Archive for August 26, 2011

Extracting PDF pages with pdftk

August 26, 2011

I need to pull out three pages from one of my larger drum books. I did this using pdftk

$ pdftk A=Vol2.pdf cat A19-21 output Percussion360-Part2_5.pdf
  • Vol2.pdf is the source filename
  • I wanted to extract pages 19 to 21
  • Percussion360-Part2_5.pdf is the output filename

References

Tags: pdftk pdf

Installing Graphite 0.9.8 on Debian

August 26, 2011

Here's the steps I took to install Graphite 0.9.8 on Debian.

First of all we need to install dependencies in a virtualenv:

# apt-get install libcairo2-dev
# apt-get install python-cairo
# exit
$ mkvirtualenv graphite
$ easy_install twisted
$ easy_install django
$ easy_install gunicorn

Next, we need to download the …

Tweepy Print Account Status

August 26, 2011

On my brass band directory site, I wanted to show the latest tweet if the band had a twitter account.

Here's the tweepy code that gets hold of the user's latest status:

def _get_twitter_status(pTwitterAccountName):
    """
    Get hold of this twitter users's latest status
    """
    lStatus = "" …

Django Registration

August 26, 2011

I'm using django-registration and I wanted to add a checkbox to the registration form which would indicate whether the user registering was a teacher or not. This value would then be stored on the user profile.

I took the opportunity to work out how to do this without modifying the …