Grab the feed

School is a twelve-year jail sentence where bad habits are the only curriculum truly learned.

John Taylor Gatto

Recent comments

How to setup Apache, mod_python and a reverse proxy to Lighttpd for Django on Ubuntu

I'll Django for food

Update: I don't recommend this setup anymore. Use the improved setup of Django with nginx, Apache and mod_wsgi.

It's October 2008 and there's no doubt now that serious web development requires working with frameworks, software that allows us, lazy coders, to forget about repetitive tasks and focus on the specifics of each project, the stuff that makes them truly unique.

It's pretty obvious too that Django, the Python based web framework, is attracting more developers and companies lately. Guido is a googler since 2005 and the recently launched Google App Engine uses Python and Django. Seriously, there's not a better time to jump into the Django train (no pun intended RoR guys).

Experienced programmers can start writing Django applications quickly thanks to the excellent documentation and the free Django book. I've also read and can recommend Practical Django Projects, by James Bennett, part of the Django team, and Learning Website Development with Django, by Ayman Hourieh, a very smart and young Google engineer.

Django is really a web framework for perfectionists with deadlines. I'm very near to one and have almost finished coding what will be my first Django based application for Facebook. Yes, I've got a few articles about that coming soon as well.

So, everything looks great under the Sun on Djangoland? Well, there's something that bothered me since I started a few months ago: deployment on a production environment. The documentation and most books get us up and running quickly with the included development server and then just refer us to the recommended Apache and mod_python settings for more.

Unfortunately, specially if you're used to the common Linux, Apache, MySQL and PHP setup, like I was, you may be need more detailed instructions and that's why I decided to write this tutorial on how to setup Apache, mod_python and a reverse proxy to Lighttpd for Django.

Opera 9.50b2 for Linux 64 bits

Opera, a nice browser

Opera is a great browser and the latest beta offers nice features, including a few tools for web developers.

I'm not sure why the 64 bits version for Linux is hidden on Opera's site but anyway, if you're looking for it get it here: Opera 9.50b2 for Linux 64 bits. It's Opera's FTP server.

How To Add Eye Candy To Ubuntu With Avant Window Navigator

A few days ago I visited a store selling Apple products at Lima (for those who may ask: It is not a real Apple store, sadly). I really like Apple, I own an iPod classic, recently got a pink Nano for Yesenia and am thinking about upgrading to a Touch soon.

At the store real everyday people, you know, the ungeek kind, stared at the MacBooks amid wows and fascinated looks and I guess mostly due to the nice effects Leopard offers. I am pretty sure many of these curious would-be-Apple-customers couldn't care less about the Core 2 Duo processor, video resolution and the polycarbonate shell (which it's quite nice) that MacBooks have.

Well, if eye candy is what most users are looking for these days let's give them a little with Ubuntu, without having to spend a grand in a new MacBook or, which is worst, having to install Vista. Let's focus in what impresses most users meeting a Mac: the Dock.

Apple Mac OS X Dock

Install Avant Window Navigator on Ubuntu

Avant Window Navigator is a dock-like navigation bar for Linux. It replaces your typical panels, contains launchers for your applications, tracks open windows and supports a few nice plugins that will make your desktop look cooler because, let's face it, a few of us, Linux dudes, want a desktop as cool as the one Mac guys have.

Avant Window Navigator

I ran my tests on a laptop and a desktop, both of them running Ubuntu 8.04 (Hardy Heron) 64 bits. As far as I know there are no different versions for 32 and 64 bits so these instructions should work for both architectures.

The short version: Just run
sudo apt-get install avant-window-navigator

The problem with this approach is that Hardy doesn't include the awn-extras (applets) package, and this is where most of the fun it's, hence I recommend taking a few more steps.

If this is all you want then jump to finishing touches below, if not, then keep reading.

The long version: The smart AWN developers have a few repositories with everything you need to get the whole dock experience on Edgy, Feisty, Gutsy and Hardy.

  1. Start by visiting the archive, choosing your Ubuntu version and copying the right entries.
  2. Open your sources.list file:

    sudo vi /etc/apt/sources.list

  3. Add the entries (I'm using the ones for Hardy), I suggest a comment as well, save and close:

    # awn
    deb http://ppa.launchpad.net/awn-testing/ubuntu hardy main
    deb-src http://ppa.launchpad.net/awn-testing/ubuntu hardy main

  4. Update your list of packages:

    sudo apt-get update

  5. Install the following packages:

    sudo apt-get install libawn0-trunk
    sudo apt-get install libawn-dev-trunk
    sudo apt-get install awn-manager-trunk
    sudo apt-get install awn-extras-applets-trunk
    sudo apt-get install avant-window-navigator-trunk

Finishing touches

Now you need to enable your new dock, you'll find the launcher, labeled Avant Window Navigator, under Accesories in Ubuntu's main menu.

Avant Window Navigator

  1. Right-click on an empty spot of the dock (it can be a little tricky, try a few different places on the sides) and choose Preferences to tweak the look and behavior as you need it and activate a few plugins.
  2. Drag some application launchers from Ubuntu's menu and drop them on the dock.
  3. Now disable the gnome panels by going to Sessions > Current Session and removing gnome-panel from the list of running applications. Finally click on Apply.
  4. To confirm everything works as expected press Ctrl + Alt + Backspace and login back.

Avant Window Navigator is a really funny application, it enhances your experience in the Linux desktop and isn't hard to install. Now I have more real state on my screen, enjoy the way my pidgin buddies jump and can hear a few wows from my visitors at home without having to get a Mac (even if I'll get one sometime just for the fun of it).

Avant Window Navigator

Install OpenVPN on Ubuntu, Hulu Outside the US and Network Security

Some days ago I started using Hulu, the new video star online, but, like many, I found the restriction imposed to users outside the United States, I live in Peru, rather annoying.

Hulu series and films

I started looking for solutions and found a few which I tested during one week. In this article I'll tell you about each and will guide you on setting up the one I think is the most convenient: your own VPN setup running on Ubuntu.

Your Options To Get Hulu Outside The US

Google quickly told me that using a virtual private network (VPN) with a server in the US would fit the bill for this problem. My connection would go thru the VPN and Hulu will see me as coming from a US based IP.

Hotspot Shield is perhaps the most known free VPN application for doing this these days, I tried it and it worked. Quite easy setup and I was using Hulu in just a couple of minutes.

The bad news? Hotspot Shield has a bandwidth limit per month, some say it's 10 Gb., shows ads and does not work in Linux. I really hate having to boot a Windows box just for using one application (World of Warcraft and iTunes are very special exceptions).

So, Hotspot Shield is option 1.

After a little more searching I found two paid services that offered Linux support: HotSpotVPN (afiliado) and WiTopia (both affiliate links). I tried HotSpotVPN, US$ 8.88 for one month of service, in Windows XP and it worked as advertised but they never replied to my email asking for instructions on setting up my Ubuntu laptop.

WiTopia has a US$ 39.99 per year plan, that's a really good price, but I didn't have enough funds in Paypal at the time and couldn't try. However I've read really good feedback about it.

That's option 2.

But a VPN is not good only for accessing limited-to-US-residents services like Hulu or Pandora (yeah, I missed that one too), it's much more. We'll learn about it while we review option 3: building our own VPN setup.

Ok, so let's see how to install OpenVPN on Ubuntu Gutsy.

Everex CloudBook, A New Ultra Portable Coming

Everex announced in CES 2008 that its new ultra portable: CloudBook, will be available at Walmart, and I think probably in many other online stores, on January 25th and will cost US$ 399.

Everex CloudBook

Samantha, Beatriz's Eee PC, Is Here

Some weeks ago I told you I had ordered our first Asus Eee PC. Today I'm glad to announce that the little toy is already at home. And even if I had named it Silfen, Beatriz decided to change that to Samantha.

I haven't had much time to play with it but I can tell you that the Eee PC is smaller than it looks on pics, works wonderfully and I really like it. A complete analysis is on its way.

Beatriz and Asus Eee PC

Take a look at more pictures of our new Eee PC.

My First Asus Eee 4G Galaxy Black On Its Way

Asus Eee PC BlackI'm a weak, very weak, man. I couldn't resist the avalanche of so many good reviews or the fear of the already reduced stock of Asus Eee PC at Amazon completely vanishing, a la Kindle, until 2008.

So, I've ordered my first Asus Eee 4G Galaxy a few hours ago. It's the black model with 512 Mb. RAM, upgradable, unlike the Surf ones, and solid state disk of 4 Gb.

I'm counting the seconds (days actually) until this new family member arrives but it already has a name: Silfen. By the way, a very special prize for the guy or gal who can tell where that name comes from.

Now, watch out for the review when the new toy is here.

Is Your Ubuntu Gutsy Gibbon Running Too Slow?

Some days ago I noticed Woodcarver, the workstation where I spend most of my time, running too slow. A quick look at top found the problem: trackerd, the daemon used by Meta Tracker.

And even when I like the idea of having a desktop search engine I haven't really needed it yet, it seems I'm kinda organized.

I read in Ubuntu Forums that we still have some bugs in the software, at least in versions 0.6.2 and 0.6.3, thus trackerd eats too much memory and CPU during indexing.

I know it's possible to configure Meta Tracker from System > Preferences >Indexing Preferences but I didn't have much time to run tests and opted for a quick sudo apt-get remove tracker. Everything is running normally now.

So, if you notice Ubuntu Gutsy Gibbon too slow, take a look at top, trackerd could be devouring your resources.

If anybody has suggestions to keep trackerd running without a big impact on performance we'd like to know them.

Read This If You Can't Access Some Websites From Ubuntu Gutsy Gibbon

Once I fixed my wireless connection problem with Ubuntu Gutsy Gibbon I had to figure out why one website was not loading: Campaign Monitor.

I found a few articles mentioning the IPv6 problems with Ubuntu Gutsy Gibbon, tried the suggested fixes but still had the problem. The IPv6 issue causes slow connections, but there's a connection at the end, I couldn't even connect, my browser was timing out.

It wasn't a problem related to DNS resolution either, I was already using OpenDNS.

After a huge headache and lots of sweating I found bug 59331: a change in kernel 2.6.17 (Gutsy runs 2.6.22-14) caused many websites to stop loading.

One user reported one website not loading and giving the same error I had with Campaign Monitor, the site was Ohio State University.

If you've read till here and you can't load either site, Campaign Monitor and Ohio State University, I'm almost sure you have the same problem I had, keep reading for the solution.

You need to disable tcp_window_scaling following these steps:

  • sudo vi /etc/sysctl.conf
  • Add the line: net.ipv4.tcp_window_scaling = 0
  • sudo sysctl -p

Update: It seems that disabling window_scaling is too drastic, instead you can add these lines to sysctl.conf:

net.ipv4.tcp_wmem = 4096 16384 131072
net.ipv4.tcp_rmem = 4096 87380 174760

And then run sudo sysctl -p to activate the change.

After the change I could access Ohio State University and thought my problem with Campaign Monitor should be fixed too, I was wrong. In my laptop I was able to access Campaign Monitor site but not their members and API site, which runs at a subdomain, and my desktop couldn't even see their home page.

I needed to read a comment by Michael Doube, in the discussion of bug 59331, to get the definitive fix:

An alternative solution is to install Firestarter, which I think works by using this iptables line: sudo iptables -t mangle -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS -clamp-mss-to-pmtu

So I did that, installed Firestarter:

sudo apt-get install firestarter

Then I opened Firestarter from Applications > Internet, followed the instructions to enable the firewall and got the change in TCP.

Neat! Campaign Monitor's site is loading now and I can continue with my job. Not bad for almost 8 hours lost in this damn thing.

I hope Canonical releases a bugfix soon, there are many users, and I guess many websites too, having this problem.

Some additional data: It seems the problem is not an Ubuntu problem after all, but something related to some routers not conrrectly working when used with some Linux kernels, anyway, Ubuntu and other distributions should find a workaround while routers manufacturer fix their hardware or release updated firmware.

Ubuntu Gutsy Gibbon: How To Enable Your Wireless Connection On Boot

After upgrading to Ubuntu 7.10 and use it for a few days I've started finding some issues related to my Internet connection.

The most annoying one is that my wireless connection is disabled on boot, this happened just in one of my desktops, I had to manually run /etc/init.d/networking restart every time I started a session.

Today I've found the solution, it's called wicd and replaces Gnome's Network Manager.

To install wicd follow these steps:

  1. sudo apt-get remove network-manager-gnome network-manager
  2. Download and install the .deb file from the wicd download page.
  3. Run /opt/wicd/tray.py & to start wicd applet.
  4. Open wicd settings by clicking on the applet. The button to save your changes is not that obvious, you must click on connect (which doesn't look like a button) on the Network section. Take a look at /opt/wicd/data/wireless-settings.conf to confirm your changes are saved.
  5. To get the applet on every boot go to System > Preferences > Sessions and click on Remember currently running applications in Session Options.
  6. Reboot to confirm the applet and your connection are working. If your Internet connection is not ready for certains applications you may need to reduce order, I use 40, for /opt/wicd/tray.py in the Current Session section at System > Preferences > Sessions.

I still have some issues with DNS resolution, they seem to be related to IPv6 as reported in many sites, and for some reason I can't load Campaign Monitor, so, if you run Gutsy and find the solution please let me know.

Good luck!