Brad's Blog

Published: 2010-07-14

PyGraphviz on OS X (SL) with virtualenv

Mac OS Python X graphviz virtualenv

There's this cool project called django-extensions that (among other things) adds a lot of commands to django's manage.py offerings. One of which is ./manage.py graph_models [appname] which will generate a nice graph displaying the relationships among all of your Models. This comand needs pyGraphViz, though, and I was a little disappointed when i discovered I couldn't install pyGraphViz with pip install pygraphviz. (ok, a lot disappointed). I eventually got this working, and here's how ...


Published: 2010-02-25

Building PIL on OS X: Snow Leopard

Mac OS PIL Python X homebrew virtualenv

There are several places online that discuss problems installing PIL on Mac OS X Snow LeopardThis is how I got it to work.Install lib jpeg using homebrew (which is super-aweseome!) brew intall jpeg.This installs the library into /usr/local/Cellar/jpeg/7Install libfreetype the old-fashioned way (./configure, make, sudo make install). I used freetype-2.1.10.pre-20050511.Download, unpack PIL (I used Imaging-1.1.6). I had to make the following changes to setup.pyFREETYPE_ROOT = "/usr/local"JPEG_ROOT ...


Published: 2010-01-14

Resize the iTunes Window

Mac Programming applescript iTunes

My Macbook Pro is my main machine. At the office, I connect it to a 20" Cinema display. At home, I connect it to a 24" Samsung Monitory (Model 2494SW Glossy Black, which I really like, btw.)There's a down-side to all this, though. I mostly just notice it with iTunes. When I'm working on the laptop without an external monitor, my iTunes window is larger than my screen :( Unfortunately, clicking the Maximize button doesn't do what ...


Published: 2009-09-30

Mercurial installation woes on Mac OS X

Mac OS Python X hg mercurial

I started using mercurial around version 1.2, and I'm pretty sure I used the Mac OS X installer (from http://mercurial.berkwood.com/) to install 1.2.1. This placed hg in /Library/Frameworks/Python.framework/Versions/Current/bin/.Now, I've decided to upgrade to 1.3.1, and I again grab the Mac OS X installer (again from http://mercurial.berkwood.com/), which installs hg in /usr/local/bin/.Ok, but my path is set up ...


Published: 2008-09-05

Recursively Renaming files

Linux Mac Programming

My hosting provider offers PHP4 and PHP5. Unfortunately, all files ending in .php get interpreted by PHP4, while all files ending in .php5 get interpreted by PHP5. So, how do I quickly change all of my files that end in .php to .php5?Do a google search for "recursively rename files", and you might run across this:http://seal-7.blogspot.com/2006/12/recursively-rename-files-with-regex-one.htmlSo, to accomplish my task, I use the following:find . -type f -print0 | xargs -0 rename ...


Published: 2008-08-08

The Apple Dock is a Mirror!

Fun Mac

I guess I'm still a relatively new Mac User, but I consider myself fairly technical and probably more savvy that your typical Mac user (though there are a lot of mac users who are far more savvy than I!)Imagine my surprise when, while working tonight, I discovered that the Dock in Leopard is a Mirror! Yes, I'd noticed the reflection of the Icons, but tonight, I actually saw my cursor (in Terminal) moving as I typed... that ...


Published: 2008-06-25

Mac OS X, Python, and Fink: Playing Nicely Together

Fink Mac OS Python X

Since upgrading to Leopard, I've been using Mac's default install of Python (which is 2.5.1). For the most part it's worked well for me, namely because I've installed additionaly packages either using Mac installers or through easy_install. I recently needed to install python-ldap which didn't work using easy_install. So, I turned to Fink.Unfortunately, Fink wanted to install it's own version of python (2.5.2) as well. (I say unfortunately only ...


Published: 2007-03-05

Mac mini disassembly

Hardware Mac

I've been a mac user since my wife bought me a Min in 2005. During that time I've enjoyed being a Mac user, but until now I've not performed a lobotomy on my little mac. I finally decided to upgrad to 1Gb of Ram, and thanks to NewEgg, this was fairly inexpensive. Also, thanks to Russel Beattie and smashsworld.com, I found it fairly easy to get into the mini.Though I only upgraded the RAM, I ...