1. Diff against another branch in Bazaar

    bzr diff -r branch:../path/to/branch > ~/changes.diff

  2. Listing directory sizes from a terminal

    To get a list of directory sizes (only the parent folders):

    du -h —max-depth=1

  3. Batch export svg to pdf

    If you have a directory full of Inkscape svg files and want to convert them all to pdfs you can use the following command:

    for i in $(find . -name ‘*.svg’) ; do j=$(basename $i .svg) ; inkscape -zf $i -A $j.pdf ; done

  4. Exposing object keys in python

    A helpful debugging tip for Python if you’re stuck trying to find out what attributes an object has is to use:

     

    obj.__dict__.keys()

  5. The elevator pitch

    Here are my notes from watching this video: http://vimeo.com/14465385, where Adeo Ressi gives feedback on a few startup elevator pitches. I found it quite insightful and Adeo is hilarious. Hopefully these notes are helpful for future reference.

    • State the problem your startup will solve.
    • Tell a story through your pitch (only tell one story).
    • What is your business/product (e.g. a website or mobile app)?
    • Try and say your name a couple of times, say the company name maybe three or four times.
    • The goal of every pitch should be very clear (e.g. to raise money or get feedback).
    • When there is a big unknown in the product, address it (e.g. how will it make money?).
    • End with a call to action.

  6. Launchpad makefile error

    If you’re trying to set up Launchpad you might run into this error:

    ERROR: Site local-vostok does not exist!
    make: *** [enable-apache-launchpad] Error 1
    ERROR: Unable to install apache config appropriately

    One way around it is to edit ”lp-branches/devel/Makefile”. Replace any instances of “vosok” with “vostok” then re-run “./rocketfuel-setup” and you should be good to go. There may be a better way and I’m sure a fixed makefile is on its way, but until then this should get you by.

    Hopefully this will help some lost googlers.