Development

Installing psycopg2 on Mac 10.6.4 Snow Leopard

Setting up Django for use with Postgres 8.3. Django uses psycopg2 (or psycopg depending on what you choose). To the best of my knowledge psycopg2 v2.2.2 is the most stable version of the code.

easy_install "psycopg2=2.2.2"

Then edit your settings.py file for Django.

DATABASE_ENGINE = ‘postgresql_psycopg2’

Psycopg2 Error

The easy_install for psycopg2 didn’t work immediately because easy_install could not find pg_config and caused compile process failed. To fix the problem I needed my environment to have access to Postgres 8.3 pg_config. The default MacPorts install of Postgres 8.3 drops pg_config and other key files into /opt/local/lib/postgresql83/bin/ .

To allow your easy_install environment to see pg_config, simply symbolically link it to your ~/bin directory. It does not have to be ~/bin. It could be any directory on your environment path. Just pick something easy.

# symbolic link from MacPorts install of postgres to a path on my home dir.
ln -s /opt/local/lib/postgresql83/bin/pg_config ~/bin/pg_config

I edited my .bash_profile so that the files in ~/bin is always on my environment path.

# set PATH so it includes user’s private bin if it exists
if [ -d ~/bin ] ; then
    PATH=~/bin:"${PATH}"
fi
 
if [ -f /opt/local/etc/bash_completion ]; then
    . /opt/local/etc/bash_completion
fi

Ubuntu tips

Ubuntu kills me some time. Especially GNOME. Inspired by co-workers who have successfully put together some impressive gaming rigs, I thought I would renew my request for a half decent (low-powered) home theater PC (HTPC)

Problem: GNOME Desktop settings conflict.

First, GNOME wouldn’t start because I had some old GNOME setup files in the way. These instructions will help you remove old GNOME configurations. Then when you restart GNOME will assume it is your first login and create a new default desktop environment for you.

http://linuxfud.wordpress.com/2007/02/14/how-to-reset-ubuntugnome-settin...

Next problem: Missing Video Drivers and Display configurations.

I’m using an old VIA EPIA M1000 mini-ITX Motherboard / Mainboard. The EPIA M1000 motherboard has a built-in graphics chip that is not plug-and-play with Ubuntu 10.10 Maverick as far as I can tell. It takes a little research. This mainboard has a CLE266 video chipset requiring Unichrome drivers. I have no idea what this means.

Ubuntu documentation reveals built-in support for Unichrome chipsets but you still have to do a little work to make it functional.

(https://help.ubuntu.com/community/OpenChrome)

I had to add this to my xorg.conf file to get setup the driver.

Section "Device"
	Identifier	"VIA CLE266"
	Driver		"via"
	Option "ActiveDevice" 	"LCD"
	#Option "ActiveDevice" 	"CRT,TV"
	#Option "TVType" 	"NTSC"
	#Option "TVOutput"	"Composite"
	Option "DisableIRQ"
	Option "EnableAGPDMA"	"true"
EndSection
 
Section "DRI"
    Group     0
    Mode    0666
EndSection

This section is to identify my antiquated monitor (a 15-inch flat screen circa 2002)

Section "Monitor"
	Identifier	"ViewSonic"
	ModelName "ViewSonic VG150"
	Option		"DPMS" "true"
	HorizSync	30 – 62
	VertRefresh	50 – 75
	Modeline "640×480" 25.175 640 664 760 800 480 491 493 525 #60Hz
	Modeline "800×600" 40.12 800 848 968 1056 600 601 605 628 #60Hz
	Modeline "1024×768" 75 1024 1048 1184 1328 768 771 777 806 -hsync -vsync
	Modeline "1024×768" 85 1024 1056 1152 1360 768 784 787 823
EndSection

For a deeper understanding of the xorg.conf file, this is a good resource. http://www.linux.com/archive/feed/118108

There is a “gtf” command to determine “Modeline” information above. I never knew that! (http://idolinux.blogspot.com/2010/08/perfect-video-resolution-on-hdtv.html)

$: gtf x y refresh

Some keywords I needed to find the necessary info:

VIA EPIA M1000 
Ubuntu 10.10 Maverick Meerkat
CLE266 unichrome driver
man openchrome
man xorg.conf

Django RSS feed aggregators

The plan — integrate RSS feeds into my crappy car website. Re-syndicating many feeds from Autoblog.com (List of feeds)

Example

On the Toyota page of my site, display snippets from the Toyota feed.

Resources

Mark Pilgrim’s Feed Parser

Django Reader

Aggregator

How-To customize Aggregator

Syndicate content