Projects
-
Madcow
Madcow is an extensible python IRC bot with support for SILC and AIM. It is fully customizable and has a simple API for creating modules that extend its functionality. Madcow ships with modules that emulate classic Infobot behavior and many other fun or useful utilities. -
Life
Conway's Game of Life cellular automaton written in Python. (Not a serious implementation, more for fun. You should check out Golly.) -
Insub
AKA "gay.pl". A suite of text filters that can be chained together to produce various ASCII art outputs. For example, a rainbow-colored, upside-down cowsay speaking figlet. Supports output in ANSI, mIRC, HTML, BBCode. It runs from the command line or as an IRSSI module. Also in FreeBSD ports and MacPorts. -
TagLib
Python library to read/write/manipulate metadata on audio files. Supports MP3 (id3v1/id3v2), FLAC/OGG (VorbisComment), IFF (WAVE/AIFF), and MP4 (m4a/m4r/etc). -
Droplet
OSX application that sits on your desktop, allowing you to drop files onto it to upload it via HTTP post. Includes a sample daemon to listen on destination and save dropped files. -
VidConvert
A command-line front-end for mencoder for doing batch conversions, has various presets for generating "divx" compatible video, view-anywhere mpeg1, and DVD-compliant mpeg2 suitable for VOB encapsulation. Handles basic needs such as autocropping, rescaling, calculating bitrate for a target size. There are better GUI front-ends to mencoder/mplayer, this is mostly meant for doing common tasks on a server where using a GUI isn't an option. -
PyFiglet
pyfiglet is a full port of the FIGlet specification (http://www.figlet.org/) into pure python. It has full support for the FIGlet specification, including smushing and kerning. PyFiglet takes ASCII text and renders it in ASCII art fonts. It can be used on the commandline or as an Object Oriented driver library in your own programs. -
RunPTY
RunPTY provides a library of PTY-related functions similar to subprocess.Popen, suitable for tricking UNIX applications that were meant to be run interactively. Includes Expect functionality, an SSH login wrapper, Rsync constructor, and various helper utilties such as getting a password from the user with echo off, finding a binary in the user path, clearing the screen, etc. -
ImageView
wxPython application for OSX 10.5 for viewing large image collections. A work in progress and mostly just something I made to learn wxPython with, this is beta quality at best. I found it useful though. -
iTunes Cleaner
Scans iTunes music library for orphaned files and possible duplicate songs by heavily normalizing their names and comparing them. Also looks for orphaned files that were removed from the library XML but kept on disc. -
py-insub
This is a complete rewrite of the original Insub filter suite into Python. It features significant improvements to the basic architecture, rewrites of all previously third party dependencies (cowsay, figlet, etc), full unicode support, and more. It is currently classified as in development as there are a number of portions that are not complete yet, but progress so far is available in SVN.
Stuff
-
Frosty
-
Using MPlayer to make iPhone/iPod compatible video
mencoder -quiet INPUT -o OUTPUT.mp4 -of lavf -lavfopts format=mp4 -oac faac -faacopts mpeg=4:object=2:raw:br=ABITRATE -channels 2 -srate 44100 -af resample=44100:0:2 -ovc x264 -x264encopts global_header:level=30:cabac=0:ref=2:mixed-refs=1:analyse=all:me=umh:no-fast-pskip=1:bitrate=VBITRATE -vf pullup,softskip,CROP,SCALE,hqdn3d=2:1:2,harddup -ofps 24000/1001
- INPUT = Input file
- OUTPUT = Output file
- ABITRATE = Bitrate of the audio stream, 128 is good enough for normal quality, 64 is more appropriate for cutting down on size.
- VBITRATE = Bitrate of the video stream. 1500 is high enough to encode without any loss in quality, but you probably want something more like 400 if you care about the size of the file, which you should if you're putting it on an iphone.
- CROP = This is the crop filter, which will remove black bars and make sure the video is constrained to 16x16 macroblocks. The best way to come up with this value is to run mencoder -ovc raw -oac pcm INPUT -o /dev/null -vf cropfilter
- SCALE = This filter is for scaling down the resolution. This is too complex to dicuss here, so if you don't know what to do, just ommit this value.
-
Making PIL and wxPython work on Snow Leopard at the same time
The dilemna: wxPython's builtin image support sucks, especially for resizing. You'd like to use PIL, but you get "The _imaging C module is not installed". If you googled for this error, you probably got a bunch of instructions that lead you to build a new libjpeg/libz and recompile. This is all great if you are using 64bit (x86_64) Python (the default). Unfortunately, wxPython does not have 64bit support at this time. To get around this problem, run Python in 32bit mode by setting the environment variable:
VERSIONER_PYTHON_PREFER_32_BIT=yes
Note: You must run /usr/bin/python for the architecture versioner to work. MacPorts python or running the python2.6 binary directly will always get you x86_64.Now you need for PIL's C extensions to be built for 32bit architecture. This means you *also* need a libz.dylib and libjpeg.dylib built for 32bit. I've outlined the steps for this below:
mkdir tmp cd tmp wget http://www.zlib.net/zlib-1.2.3.tar.gz wget http://quirkysoft.googlecode.com/files/jpegsrc.v6b.tar.gz wget http://effbot.org/downloads/Imaging-1.1.6.tar.gz tar xvfz zlib-1.2.3.tar.gz cd zlib-1.2.3/ CC="gcc -m32 -arch i386" ./configure --shared --prefix=/usr/local make sudo make install cd .. tar xvfz jpegsrc.v6b.tar.gz cd jpeg-6b/ cp /usr/share/libtool/config/config.sub . cp /usr/share/libtool/config/config.guess . CC="gcc -m32 -arch i386" ./configure --enable-shared --enable-static # add this to the bottom of the Makefile (Leading whitespace on second and third lines must be tabs, not spaces):
maclib: $(LIBOBJECTS) $(LIBTOOL) --mode=link $(CC) -dynamiclib -o libjpeg.dylib \ $(LIBOBJECTS) -install_name /usr/local/lib/libjpeg.dylibmake maclib sudo cp libjpeg.dylib /usr/local/lib/ cd .. tar xvfz Imaging-1.1.6.tar.gz cd Imaging-1.1.6/ sudo CC="gcc -m32" LDFLAGS="-L/usr/local/lib" ARCHFLAGS="-arch i386" python setup.py install
Contact
- Email: cjones@gruntle.org
- AIM: seejayunderscore
- Facebook: seejayunderscore