Penzilla crushes blog

Atomic penguin schedules solid day of destruction

Installing Xcode 3 on Lion

Much thanks to AnatomicWax!

Just reposting here:

  • Mount the Xcode 3.2.6 DMG
  • Open Terminal
  • Enter the command: export COMMAND\_LINE\_INSTALL=1
  • Enter the command: open “/Volumes/Xcode and iOS SDK/Xcode and iOS SDK.mpkg”

And on a related note, when I screwed up experimenting with Xcode3 and 4 removing them became an issue: This mac developer tip worked like a charm though:

sudo <Xcode>/Library/uninstall-devtools --mode=all

Setting up a new macbook for work

First day at the new job and I’m setting up a new macbook pro (macbookpro 8,2) for work.

Here’s a list of things I’m doing to setup this machine as a reference for future installations:

* Ran “Software Update”
* Installed XCode (3.x because it’s free and is included on your install media) and X11
* Installed Chrome
* Installed Firefox
* Installed Opera

Break for lunch, frustrating phone call with fifth third bank, and reset my MCS account passwords…

* After debating using macports, fink, or homebrew decided to give homebrew a try.
* brew install python (which installs readline, gdbm, and python2.7.1).
* Added /usr/local/share/python to PATH
* easy_install pip
* pip install virtualenv virtualenvwrapper mercurial
* hg clone etc
* cd etc && ./
* Added path customizations for homebrew to ~/.bashrc
* brew install emacs –cocoa –with-x
* ln -s /usr/local/Cellar/emacs/23.3/ /Applications/
* brew install subversion
* Didn’t find grep in the default homebrew (they include system duplicates by default) but apparently you can just point homebrew at a recipe on some random site and it’ll install it… Not sure I’m happy with this but that’s probably the reason homebrew runs as a non-root user… Basically you can do: sudo brew install
* generated an ssh key: ssh-keygen -t rsa -b 4096
* brew install ssh-copy-id
* enabled sshd in the sharing control panel
* ssh-copy-id msteder@localhost
* sent authorized keys files to systems guys for setup on the MCS resources.
* brew install wget
* brew install proctools
* brew install openssl
* Installed Dropbox
* Installed

I think that may be just about enough setup for today. I’m thinking next steps are going to be installing AWS tools like s3cmd, boto, etc.


I'm not sure if this is sarcastic or not. :-) I didn't expect it myself obviously. And I think if it were a more publish or perish driven group I wouldn't be here. The team here is responsible for
Michael Tobis
Back at UC - now there's a surprise…

While editing a source file in Emacs with DOS line endings I’ve got a little voice in the back of my head buzzing that I should really convert those line endings…

Anyway, I found a painless way to do that conversion within Emacs:

M-x set-buffer-file-coding-system
At the prompt enter: “unix” 

Whoa, Whey Bread!

After making yogurt (or cheese) you’re going to have a bunch of a golden liquid called whey.  I’m a big fan of homemade bread so when I heard that you could use whey to enhance bread I decided I needed to try it the next time I made yogurt.

The benefits of using whey for making bread are a better rising time, better crusts and flavor, and a firmer texture.

I made my first batch earlier in the week and we ate it so quickly that I didn’t get a chance to take pictures.  I’ll try to make some more later on and post pictures this time.

I found that the crust and texture of this bread was excellent and it rose very nicely in a fairly short period of time.

Here’s the recipe I’m trying this time:

  • 3/4 cup whey
  • 1 packets dry active yeast (3 teaspoons)
  • 3 tablespoons sugar
  • 3 tablespoons butter, melted
  • 2 teaspoons salt
  • 1 egg
  • 2-3 cups all-purpose flour (approximately)
The above makes one loaf.  Simply scale things up by the number of loaves you’d like to make.  (2 loaves would be 1 and 1/2 cups whey, 2 packets yeast, etc).

  1. Proof the yeast:  Heat the your whey to 110 F and add your yeast.  Cover with a cloth and let sit while you prep the other ingredients.
  2. In a mixing bowl add half of your flour, the butter, sugar, and salt.
  3. Add the eggs
  4. Add the warm proofed yeast
  5. Mix until it forms a dough ball.  If the mixture is too wet to form a ball add a little flour until things start to stay together.
  6. Flour a cutting board or some other surface and turn the dough ball out onto it.
  7. Knead the dough for 5-10 minutes
  8. Grease a large bowl with butter or oil and place the dough in the bowl.  Turn it a few times to cover in oil.
  9. Cover the bowl with a cloth and set the bowl in a warm place to rise for 1 to 2 hours.
  10. Punch the dough down and divide into loaves. 
  11. Cover loaves and allow them to rise for another hour.
  12. Heat oven to 425 F and cook for 20-25 minutes.
  13. Remove from the oven and turn out onto backing rack to cool
  14. Enjoy!

I too have had a good experience adding yogurt bacteria to the dough. A great way of getting a faux sourdough without having to keep a pet alive.

For an extra bold flavor, you can leave double ferment dough overnight. Then just pound down the resulting swollen bubbly mass one more time and rise once more. Maybe even slow rise over a day or so in the fridge or someplace cool.

Once, I think one of my overnight batches started going alcoholic. It had very strong fumes coming from it in the morning. Once I baked it, it had an earthy, molasses tasting type of character. Held its moisture almost as good as a sourdough.

French Press Coffee Recipe

I figured I’d just post this as a reminder to myself.

Today I tried this french press recipe and I thought it turned out pretty well.

Ratio of coffee to water: 1/16

So that’s:

  • 64 grams coffee to 32 oz water
  • 2 oz coffee to 32 oz water
  • 1/2 oz coffee to 8oz water

And then it’s a very simple procedure:

  1. Boil water.
  2. Grind beans.
  3. Throw beans in french press
  4. Steadily pour in hot water (you’re looking for a temp between 195F and 205F)
  5. Allow to steep 3-4 minutes


It was quite strong :-) I think maybe the water was a little too hot and draw out too much of the harsher coffee flavors. However, since I don't mind a little extra bitter coffee (I like Starbucks :-P) it was still pretty good imo.
Carolyn Van Slyck
So how strong does this coffee turn out? You mentioned that it was pretty strong this morning… :-)

Homemade Yogurt

I love yogurt. In an effort to prove my devotion to the creamy and tangy Greek yogurt that I adore I’ve started to make my own.

Aside from some time and attention, yogurt is not that difficult to make and the homemade stuff is quite delicious and the leftover whey is very useful in bread making as I’ll try to show later on.

First here’s what you need:

Yogurt making stuff!

  • 1 Gallon Milk (Any kind of real milk, skim to whole, the fat percentage matters but you’ll be able to make reasonable yogurt with any of them).
  • 1 container yogurt with active live cultures (6 to 8oz)
  • 1 6-8 quart pot
  • 1 metal or plastic spoon
  • instant read probe thermometer with an operating range between 80 and 200 degrees F.
  • 1 6-8 quart plastic container with lid
Prep time:

You’ll need to be actively involved in the yogurt making for about an hour but then you’ll pitch the yogurt and setup a nice warm place and let it sit for anywhere from 6 - 12 hours. 

  1. At milk to your pot and add your thermometer.  Turn on your stove to medium high heat and stir occasionally (every 5 - 10 minutes) until the temperature reaches 180 degrees F.
  2. While the milk is heating you’ll want to prepare your sink with a couple inches of water and ice so that you can quickly cool the milk and prevent the milk from continuing to heat to much past 180 F on the stove.
  3. After the milk reaches 180F pour the milk into your plastic container.  Transfer your probe and loosely cover the container with your lid.
  4. Place the plastic container in your sink to cool to around 112F.  The milk can be hotter or cooler (90 - 120F) but staying close to this number and keeping your mixture around this temperature will ensure your yogurt bacteria stay happy.  If the milk is too hot when you add your starter there is a good chance you’ll kill the yogurt so you should err on the cool side.
  5. Once you’ve reached a reasonably cool temp around 112F, go ahead and add the container of yogurt.  Stir the yogurt into the milk.
  6. Once again cover the plastic container with the lid and insert your probe thermometer.
  7. Find a warm place to keep the yogurt and place it there.  Cover with a towel or blanket to help keep it’s temperature consistent.
  8. Allow the yogurt bacteria to incubate in a warm environment (again, around 112F) for anywhere from 4 to 12 hours (yes, you can leave it overnight).  I turn on my stove to it’s lowest setting and place the yogurt on top covered in a towel which seems to work quite nicely and maintains a reasonable temp of 110 F
  9. You can taste test the yogurt to see how tangy it is and the longer you let the yogurt ferment the tangier it will be.  Remember that the texture will be somewhat off until the yogurt is allowed to set in the refrigerator.  
  10. I prefer really tangy yogurt so I will most likely let the yogurt sit 10-12 hours.
  11. At the end of this period, stir the yogurt, cover, and place in the refrigerator until cool.  The stirring and refrigeration help to put the bacteria back to sleep and puts the fermentation process on hold.  And of course I should mention that this is the perfect time to add vanilla or agave nectar to sweeten or flavor your yogurt.  
  12. Once the yogurt has cooled enjoy the yogurt or strain the hell out of it to make thick and delicious Greek style yogurt or, if you prefer, cream cheese. 
I plan to strain this next batch so I’ll cover that simple process next.  I strongly suggest that you strain your yogurt.  While the yogurt you have above is tasty, it’ll be much more decadent if you go ahead and strain it.

On the stove, notice the nice froth here at 180F

Cooling down in the sink

Fermenting on the stove warm and cozy under a towel


Thanks!! :)
Thanks for the tips, KoI. I really like the idea of not using such high heat and since I really prefer strained yogurt I'll have to give straining without cooling a try.

I find it really quite cool how many different techniques people can use to produce yogurt. I appreciate your ideas because I am hoping to find a recipe that is minimal effort and produces awesome yogurt.
I don't have a thermometer so I inoculate at the maximum temperature I can indefinitely immerse my finger in the milk.

I started out heating the milk to high temperatures and then trying to cool it down with ice before it started scorching.
I found you can skip this step.

The milk bacteria seem to work just fine with the yogurt culture. Furthermore, milk loses most of its flavor when it's heated to high temperature. I think a lot more stuff than just the bacteria gets broken down.
Works well to heat the milk up very gently and only to inoculation temperature.
This can take an hour or longer with a two gallon batch, but I just do other things while checking back on it periodically.

Since even whole milk is a bit lacking in character, I find yogurt also benefits from some heavy cream. About a half pint to a pint per gallon makes it extra rich.

I find a grainy texture usually results only when the yogurt is strained a bit prematurely, before curd and whey have completely separated. I find it comes out a bit grainy like a farmers cheese at less than 7 hours. I've fermented for as long as 24 hours and still gotten decent batches. Best to err on the side of tartness.

No need to cool the yogurt before straining. Just as well to let it continue developing even in your strainer. Not to mention it will strain faster when warm.

The yogurt doesn't go completely dormant when refrigerated. The bacteria still slowly does its work. Probably best to wait until serving before adding sweeteners. Easily digestible, naked sugars make it easy for new organisms to move in or ones already there to proliferate out of control.

Posting with Apache Bench

Because it took me a disproportionate amount of time to figure this out the second time I’m writing it down:

ab -n 1000 -c 25 -p -T “application/x-www-form-urlencoded” “https:/

The trick is specifying -p <postfile> and -T <content-type for post file data>.

The postfile above looks like:


All as one long url encoded line.

Encoding the post data is really quite easy to do in python:

import urllib
pv = {"key1":"value",
      "key2":"another value"}
print urllib.urlencode(pv)


super thanks, saved my day !

Tutorial Correction: File IO

8 years ago, thinking I knew a lot about Python, I wrote up this Python tutorial and presented it to some folks at my school in an effort to learn Python better and evangelize my favorite programming language.

After all this time I think I’ve learned a lot more about Python but the more I learn the more I realize how unprepared I was to write this tutorial.  Basically, what I’m saying is that I made some mistakes.

Since making mistakes is the way software gets done I suppose it isn’t the end of the world but I digress…

Today I’m correcting a mistake in the Python tutorial about buffered / non-buffered IO.

Basically, 2002-me made the mistake of assuming that all file operations were unbuffered because the heavily customized gentoo environment he was writing all the tutorial stuff on at the time was defaulting to unbuffered IO.  This is a pretty big oversight that makes some tutorial examples non-functional for folks out there with an operating system that buffers IO by default (Mac OS X, probably other BSDs, I’m sure some flavors of Linux, etc).

Anyway, I’ve updated the tutorial page here with better info about why that example works the way it does, the way to make it work if your platform defaults to buffered IO, and the right way (hint: with keyword) to write your program so that it doesn’t rely on the corner case my linux platform example relies on.

Asynchronous Access to My Desktop Pictures

I’ve been working a lot with Twisted lately so I thought people might appreciate a fun example of how one could download a bunch of files quickly using asynchronous IO.

Anyway, this script currently grabs a ton of nice hi resolution National Geographic photos. Enjoy! (Download the python file directly)

#!/usr/bin/env python

import os
from twisted.internet import defer, reactor, task
from twisted.python import log
from twisted.web import client

URLS = ["""""",

def generateDownloadArgs(urls):
    for url in urls:
        for x in xrange(1, 27):
            nurl = url % (x,)
            path = os.path.basename(nurl)
            yield nurl, path

def parallel(iterable, count, callable, *args, **named):
    coop = task.Cooperator()
    work = (callable(elem, *args, **named) for elem in iterable)
    return defer.DeferredList([coop.coiterate(work) for i in xrange(count)])

def handleError(x):
    """Any error reporting or error handling we want to do"""

def handleSuccess(x):
    """Anything extra we want to do on a successful download"""

def download((url, fileName)):
    d = client.downloadPage(url, fileName)
    return d

if __name__=="__main__":
    finished = parallel(generateDownloadArgs(URLS), 10, download)
    finished.addCallback(lambda ignore: reactor.stop())

Emacs on Centos 5

Attempting to follow my install directions on a centos VM I found I was missing a bunch of things.  So here’s a quick brain dump of packages you can install to make emacs compile without too much trouble.
  • yum -y groupinstall “Development Tools”
  • yum -y install gtk+-devel gtk2-devel
  • yum -y install libXpm-devel
  • yum -y install libpng-devel
  • yum -y install giflib-devel
  • yum -y install libtiff-devel libjpeg-devel
  • yum -y install ncurses-devel
  • yum -y install gpm-devel dbus-devel dbus-glib-devel dbus-python
  • yum -y install GConf2-devel pkgconfig
  • yum -y install libXft-devel
  • cd ~/Emacs/emacs-build
  • ~/Emacs/emacs-bzr/configure –prefix=/usr/local –without-selinux –with-x-toolkit=gtk
You may not need to build without selinux, YMMV.