Archive

Archive for the ‘Hacking’ Category

IPv6

March 11th, 2010

The past few weeks have been jam packed with academics and post-grad job hunting, so I’ve had little time to play around with technology. This week, in a few hours of time, I deployed IPv6 in my school research lab, the research lab webcam, and my colocated server (this blog). My domain name, compbrain.net, now has both an A record and an AAAA record. I’ve noticed that machines with 6to4 IPv6 addresses tend to pick the IPv4 A record over the IPv6 alternative when both records are available.

Thanks to Hurricane Electric’s IPv6 Tunnel Broker, setting up these IPv6 networks was fairly painless. The only real exception here was in my dorm room, as our residential network filters inbound ICMP (inbound anything from the public net really) and prevents Hurricane Electric from allowing a tunnel to be created. To work around that, i’m using 6to4 on my DD-WRT powered WRT310N. The DD-WRT docs have a decent writeup on 6to4 available here.

Will Hacking , , ,

Fireplace Temperature Sensing

January 9th, 2010

Currently it is quite cold in New England, Google says about 28F in my home town. Our house has a wood burning stove in the basement that we like to keep burning so the room is about 70F. With the help of some python from Mikal Still, and some left over one-wire serial experiments, I have a working prototype to keep an eye on the fireplace performance.

A bit of Python polls owserver using a SWIG module and commits the read temperature value to a MySQL database. I munged some of Mikal’s graph server code to simply post the chartserver URL to appengine so it could be hosted for the world to see.

Will Hacking , , ,

qmmp

December 6th, 2009

I’ve gotten to rather like qmmp. It offers a nice balance of simplicity and functionality, and has the added benefit of being modeled visually after my favourite windows based media player, winamp. To make this style more complete, i’ve added the official Winamp base skin.

QMMP with Winamp base skin

QMMP with Winamp base skin

The classic skin came from here. Just download the .zip and place it in ~/.qmmp/skins, open up the settings, make the switch, and you’re good to go.

Will Hacking , , , ,

UPDATE: Cups class physical destination

December 5th, 2009

Not that long ago I was searching for a way to find the printer a job sent to a CUPS class printed to. After poking around on the cups.org forums, Michael Sweet responded with information about the “job-actual-printer-uri” IPP attribute.

The code is something like:

self.cups = cups.Connection()

def getActualPrinter(self, jobid):
job_attributes = self.cups.getJobAttributes(jobid)
return job_attributes['job-actual-printer-uri']

Now with the added code, I’ve added physical destination to the CCIS print queue viewer. We have several queues that all point to the same printer (name-simplex, name-duplex, etc all point to name). The same code for identifying destination on print classes also works for these cases.

Print Queue Viewer

CCIS Print Queue Viewer

Will Hacking ,

Cups class physical destination

October 28th, 2009

Dear Lazyweb,

If one creates a print class in CUPS, is it possible to query for the destination printer within that class that a job was actually sent to? There seems to be very little documentation on this sort of thing…

Will Hacking , ,

Sharp LC32DA5U 720p with Intel Graphics

October 5th, 2009

We’ve got a Sharp LC32DA5U in our dorm connected to a homebuilt PC from Frys. Recently we upgraded to Ubuntu Karmic and the latest SVN releases of XBMC. In order to get a reasonable resolution out of the TV/PC combination we needed this little xrandr script to set the resolution before xbmc starts up. The modelines for this TV are not easy to track down, so here they are in script form for future reference.

#!/bin/bash
# This one leaves a vertical stripe on the left
#MODELINE="74.250 1280 1320 1376 1650 720 722 728 750 +HSync +VSync"
# This one seems to actually work
MODELINE="74.250 1280 1390 1430 1650 720 725 730 750 +HSync +VSync"
xrandr --newmode 1280x720 $MODELINE
xrandr --addmode DVI1 1280x720
xrandr --output DVI1 --mode 1280x720

Will Hacking , , ,

gflags for Ubuntu

August 26th, 2009

If you are looking for the excellent Google gflags python module as an Ubuntu package, look no farther. It is available from my PPA: https://launchpad.net/~compbrain/+archive/ppa

A quick how-to install is included below.

$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E5C2D9CD
$ sudo sh -c 'echo "deb http://ppa.launchpad.net/compbrain/ppa/ubuntu jaunty main" > /etc/apt/sources.list.d/compbrainppa.list'
$ sudo apt-get update && sudo apt-get install python-gflags

Will Hacking , ,

Nginx PHP5 Fastcgi

July 30th, 2009

Quick note for myself and anyone else looking to replace lighttpd or apache2 with nginx for serving php (ala wordpress):
http://frankkumro.com/2009/01/03/ubuntu-nginx-and-php5/

Will Hacking , , ,

Fix a Broken AVI Seek Table/Index

July 29th, 2009

Recently I was given a video by a friend in AVI format that caused trouble when playing it on my Neuros OSD. When I watched the video on my laptop with mplayer, everything was fine, but when you tried to seek with the Neuros it reported a video 16 minutes in length instead of the full hour it should have been. Poking around the internet I found the following solution: Use mencoder to rebuild the AVI index, and write it out to a new copy of the video.


$ mencoder -forceidx input.avi -o output.avi -oac copy -ovc copy
$ mv output.avi input.avi

After that, the new input.avi should be playable, and seeking should work properly again.

Will Hacking , , , ,

nginx redirector

July 28th, 2009

Today at school we finally fixed a nit that had been bothering me since about the time I arrived. For historical reasons our college mail server holds the A record for the college domain name. For that reason, attempts to access http://ccs.neu.edu instead of http://www.ccs.neu.edu ended up displaying an error page.

Since the primary purpose of the server in question is to handle e-mail, no webserver was installed. After stumbling upon http://aleksandarsavic.com/nginx-redirect-wwwexamplecom-requests-to-examplecom-or-vice-versa/ I whipped up a 6 line config for nginx, and deployed it on the machine. nginx is lightweight enough to be installed specifically for this purpose without making a drastic impact on the machines other tasks.

Here is our config:
## Redirector for ccs.neu.edu
server {
listen 80;
server_name ccs.neu.edu;
access_log /var/log/nginx/access.log;
rewrite ^(.*) http://www.ccs.neu.edu$1 permanent;
}

Will Hacking , ,