Tony's ramblings on Open Source Software, Life and Photography

Twitter Rant / Feature Need

I just had an epiphany. I want twitter to implement a threshold setting in my account above which I don't get notified of new followers.

For instance,

I get followed by "JennyFreeLaptop23434".

I get an email letting me know...

But, with a follower threshold setting on notifications, I could set in MY account a threshold of "10:1" and since Jenny is following 253,530 people and only has 5 followers, I can safely assume that Jenny is a spammer. And if Jenny is following more than 10 people for every follower, don't bother letting me know she's (he's?) following me too.

Just a thought...


Using Bridged Networking For KVM / QEMU (and how to install)

There's so many different HOWTO's on the Internet regarding using bridged networking for kvm virtual machines. Unfortunately most are completely out of date, wrong or just don't apply to Ubuntu's implementation.

Believe it or not, it's not very hard. KVM/QEMU will automatically create the "tap" interface (actually it names them vnetX) and will even create a new MAC address for it. All we have to do is put our primary ethernet adapter into promiscuous mode and create a bridge device.

Both steps are easily done by editing /etc/network/interfaces. No additional scripts are needed if you're using static IP addresses.

Here's an example setup for preparing the host machine. This assumes you have one physical card in the machine (eth0) and that you want to access your host machine using

# The loopback network interface
auto lo
iface lo inet loopback

# Create our bridge interface using a static IP address on the network
auto br0
iface br0 inet static
        pre-up ifconfig eth0 down
        pre-up ifconfig eth0 promisc up
        pre-up brctl addbr br0
        pre-up brctl addif br0 eth0
        bridge_fd 9
        bridge_hello 2
        bridge_maxage 12
        bridge_stp off


I Have A Need For Speed

Ah, the speed of fiber Internet. 9.2 Megabit throughput... What a pain to get working properly, at least while trying not to inconvenience my customers. I'm a bit surprised that my outbound is so slow though... Gonna have to talk to them about that.


Load Multiple Image Formats Into Cairo Surfaces (Python)

This drove me up the wall trying to figure it out, but loading jpg's or tiff's into a Cairo surface with Python really isn't all that hard.

The trick is to load it into a gtk.gdk.pixbuf first. here's an example:

pixbuf = gtk.gdk.pixbuf_new_from_file(filename)
x = pixbuf.get_width()
y = pixbuf.get_height()
''' create a new cairo surface to place the image on '''
surface = cairo.ImageSurface(0,x,y)
''' create a context to the new surface '''
ct = cairo.Context(surface)
''' create a GDK formatted Cairo context to the new Cairo native context '''
ct2 = gtk.gdk.CairoContext(ct)
''' draw from the pixbuf to the new surface '''
''' surface now contains the image in a Cairo surface '''

Of course you could bypass stamping it onto a Cairo surface entirely and just use the original pixmap for most things, but for doing affine translations I needed an actual surface and not a context to one. Otherwise you have to remember what is accessible through gdk and what is a native Cairo surface.

With a little bit of pipe magic, you can even do image manipulation externally before loading it, and never have to create a temp file:

import subprocess


Run Ubuntu Off A USB Stick

If you do a lot of Ubuntu installations, or you like to always carry a copy with you so you can use Linux wherever you are, installing Ubuntu on a USB stick really isn't all that hard.

Simply use Synaptic to install "usb-creator". Download an image of Ubuntu that you want to run from the USB drive, keeping it in an ISO image file. From the System+Administration menu you'll see "Create A USB Startup Disk." Choose the ISO file you downloaded as the source image, and pick your empty USB stick as the destination.

If you chose "Stored in reserved extra space" you can literally run Ubuntu from the stick and any changes you make or files you create will be stored on there as well - in my case my Wireless setup is remembered from boot to boot, and any files I save in my home directory are still there next time.

It's a great way to show off Linux to someone who has never seen it - simply keep it on your keyring and you're always ready to run Linux. It's a great way to carry PC and network diagnostic utilities with you as well.


Photo Browser Alpha Video

Well, the thumbnail browser for my photography workflow application is complete. The next step is to finish designing the UI around it, and then link it with a database, etc. to keep track of photos.

Here's a video of it in action. Keep in mind this is early Alpha. It loads in thumbnails and rotates and reflects them on the fly. The farther and faster you drag your mouse over the images, the faster they go, and they continue to spin and slow down after you let go.

Working On A Photo Manager

I'm working on a photo manager for Linux with a kinetic scrolling feature in Python. So far so good. The thumbnails are actually being rendered, tilted and reflected by my code. Unfortunately Python can't do perspective transforms, only sheers, so you get a bit of a top-down view.

Another Senior Portrait

Whitley Senior Portrait shotHere's another "Senior Portrait" for Whitley. I'm loving the new 50mm Prime lens. I was afraid it would be cropped too close for portrait work, and it almost is, but it's working out rather nicely.

It was blowing cold and about 15 degrees for this shot, so we didn't tarry and only got the one really usable shot out of the 30 or so taken. Lit with sunlight filtered through the trees behind me and over my left shoulder. No reflector was needed, because the snow did nicely to provide a nice all around soft fill.

First I used LightZone for Linux to do the RAW conversion and relight the image, reducing the shadows on her face and add a high-key effect. Then I used Gimp to do a bit of reconstruction of her hair due to some wild strands blowing in the wind, and softened up her skintone and brightened her eyes. I also prefer to use Gimp for the final image sharpening.


Ubuntu "Karmic Koala" to include Eucalyptus

Some people may not know, but Canonical, the company that manages development of the open-source Linux based operating system "Ubuntu", tags their releases a couple of ways. First, the release number is determined by the month and year it's released. For instance, Ubuntu 8.10 was released in October of 2008. They also tag an animal name with each release: "Gutsy Gibbon", "Hoary Hedgehog", "Intrepid Ibex", "Jaunty Jackalope" (due in April) and now "Karmic Koala" for October.

The kismet part is that "Karmic Koala" will be the first release to include Eucalyptus, which one can only hope was not named specifically for the Ubuntu release.

Eucalyptus is an open-source cloud computing platform that allows you to build your own cloud infrastructure similar to Amazon's EC2. With it, you can dynamically assign resources as your computing needs grow and shrink.

One of the big fears of cloud computing has been what happens when the cloud goes down? What if a fiber line is cut and your office can't reach Amazon's or Google's servers anymore? What if Amazon wakes up and decides one day they don't want to host cloud applications anymore? With Eucalyptus you can have your own cloud, running in your own datacenter.


The New Lens

Annika High KeyI've been playing around with my new 50mm prime lens. For portrait it seems that about F5 is perfect to give a well blurred background while still sharp on the subject. Here's a test shot of Annika at the park.

Unfortunately it was extremely cold that day, after just having a nice week in the 60's it was about 33 degrees so we only stayed at the park a few minutes. This was the best of the shots.

The Olympus Zuiko Digital F/2.0 is a sweet little prime lens. Being "prime" means that it doesn't zoom. Ever. It's locked in at 50mm - which on the Olympus 4/3 system is equivalent to a 100mm lens on any other camera. This photo was taken at around 6 feet from the subject. This lens will also do macro photography, i.e. flowers, bugs, dust mites, etc. lol.

This shot was taken at F/5.0 which seems to be the sweet spot for portrait photography with this lens. It will go all the way out to F/2.0 but the depth of field drops off significantly.