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

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.


Categories:

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 '''
ct2.set_source_pixbuf(pixbuf,0,0)
ct2.paint()
''' 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
  

Categories:

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.


Categories:

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.


Categories:

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.


Categories:

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.


Categories:

The Future Of Computing Is Not A Screen

Every so often some blogger who has little understanding of either technology or history will come along and make some futurist post about the future of computing. The latest to draw my ire is Jason Perlow.

Now, don't get me wrong, I'm not bashing Jason's perspective - I'm just disagreeing with it.

Jason puts forth the following premise:

In the not so far off future, computing for most of us will be reduced to remotely delivered subscriber services, running on cheap, commodity high-definition display units.

So far so good, Jason. He says "most of us", and who is the average computer user in the United States today? The person who uses Facebook, checks mail and lives on Youtube. Most people are already running thinclients in that regard and just haven't downgraded their hardware. I think about 40% or more of users could actually have someone secretly change their computer to Linux and they'd simply think Microsoft updated their "theme".

Unfortunately Jason goes on to state:


Categories:

Configuring OpenVPN on Ubuntu 8.04 LTS

For me, setting up an OpenVPN server on Ubuntu Server was orders of magnitude easier than trying to use a commercial ipsec utility. Here's the steps to take to set up an Ubuntu 8.04 (Hardy) server.

First, be aware this setup makes a few assumptions. First, no bridging of networks is done which means no broadcast traffic and no multicast. I believe most people won't use those, so I'm not even going to try to explain how to make that work - I'm going for a quick and easy setup. Second, the server is on the Internet with a static IP address - or at least has a DNS entry somewhere so that computers on the outside can locate it. Your typical home network won't have a static IP, but with some of the "dynamic DNS" website / utilities, you can get around that restriction.

I'm also not going to try to deal with firewall issues in this HOWTO. If you can disable your firewall and everything works, then get your firewall working afterwards. The best advice I can give there is to allow all traffic to/from the "tun0" (or tun1 or tun2... whatever) device that the VPN creates, and allow incoming traffic on the Internet facing adapter (eth0?) to the TCP or UDP port you configure your server to listen on. It's really not that complicated for a basic setup.

First, become root (sudo su -) and then install the following:

apt-get install openvpn dnsmasq openssl

Categories: