TurnKey Linux Virtual Appliance Library

Programming insight that helped unblock me

I'm finding a big part of the context switch involved in getting back to a high level of productivity on my programming is relearning old lessons.

In particular one of the most important lessons is to figure out how to systematically break down different goals into separate steps in a way that allows you to concentrate your full brain power on each of those steps in succession rather than trying to get it all done at once.

To Lisp or not to Lisp, that is the question.

Musings on Lisp by a routinely Pythonic programmer

Last week I did some maintenance on various Python projects I haven't touched in years (literally), and I was surprised by how easy, almost trivial it was to reorient myself and make the necessary changes.

That observation came at the right time because I've been reading up on Lisp dialects for a while now and questioning whether or not I should be programming in Lisp instead. Lisp enthusiasts (converts?) certainly make persuasive arguments, typically advocating Lisp as the one-true-language with near religious zeal.

TKLPatch summer contest summary: let the judging begin!

It all started with a happy accident

I have a confession to make. This contest, which is directly fueling the largest expansion of the TurnKey library since the project started, is a happy accident. It wasn't something we planned. It wasn't on our summer todo list. It was just one of those unexpected, spontaneous ideas that light up the inside of your brain like a flash bulb, and demand you take action. Or else! (you won't get any sleep)

Back in June we had just launched the TurnKey Hub and were getting ready to focus all our energies on releasing TKLBAM. I logged into PayPal and noticed our donated beer budget had a sad little beer belly. It was just sitting there, giving me an accusing look. I felt guilty. Surely all those people who donated expected we would put these funds to better use. That's when it hit me. It was too much to buy beer, but not so much that we couldn't risk it all on a fun experiment...

I talked it over with Alon and on an impulse we decided to do a contest, but not just any contest. A wild and wet summer open source bonanza! With ponies!

What happened next took us both by surprise.

Django settings.py for development and production

So you developed a Django web application and now need to deploy it into production, but still need to actively continue development (bugfixes, tweaks, adding and testing new features, etc.)

In your development environment you probably had debugging enabled, performance settings disabled, used SQLite as your database, and other settings that make development easier and faster. 

But in production you need to disable debugging, enable performance, and use a real database such as MySQL or PostgreSQL, etc.

TurnKey Appliance Development Contest: An Open Source Summer Bonanza!

Over the last few months donations have been trickling in and gradually piling up. Since there's a limit to how much beer we can reasonably drink we've been brainstorming ideas for using that money to help the project.

Django navigation bar (active link highlighting)

Every web application needs a navigation bar. Common practice is to indicate to the user where he or she is, and is usually implemented by using a visual aid such as a bold type-face, different color or an icon.
 
I wanted an elegant, generic, extendable solution to "highlight" a link on the navigation bar without hardcoding URLs, using ifequals, or using template block inheritance by specifying a navbar block on each and every template (you'd be surprised, but the above mentioned are recommend often).

Automatic batch editing of Drupal nodes and CCK file fields

In a previous post I explained why we decided to convert most of the images on this site from PNG to JPG and how we used ImageMagick to batch it.

What I didn't get into is how we updated Drupal, our CMS,  to point to all these newly converted files. Manually uploading and updating nearly two hundred new images through a web form is time consuming and boring. Finding a non labor intensive solution can also be time consuming... but so much more interesting!

Once you know how, it's not really that difficult.

Optimizing Django: tricks for faster page loads

By reducing the file size of your CSS, JavaScript and images, as well as the number of unnecessary browser requests made to your site, load time of your applications pages can be drastically reduced, not to mention the load on your server.

Yahoo have created a list of the 35 best practices to speed up your website, a recommended read for any web developer. I wanted to summarize a few I recently implemented in a Django application.

In a nutshell:

Two simple tricks for better shell script error handling

Psssst. Hey you... yeah you. Word on the street is your shell scripts don't do any error handling. They just chug happily along even when everything is broken.

Because a lowly shell shell script doesn't need any error handling right? WRONG!

CSS cheat sheet

While reading CSS books and experimenting I found it helpful to take notes and put together a cheat sheet for quick reference. I figured others might find it useful so I'm sharing. I've also uploaded a simple PDF version.