TurnKey Linux Virtual Appliance Library

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:

PNG vs JPG: 6 simple lessons you can learn from our mistakes

Page load times are important. Amazon insiders estimate that every 100 ms increase in latency costs Amazon roughly %1 of profit.

Simply put: visitors hate slow sites, so don't make them wait.

Unfortunately, many web sites, including this one up until recently, are slowed down by inefficiently encoded images. Note that there are many other components to page load times and if you're looking to optimize your web site you should analyze and understand all of them. But today we're just going to focus on the images.

TinyMCE vs CKEditor: battle of titans! (of WYSIWYG editing)

Or: a quick review of the reasons we chose CKEditor over TinyMCE.

By default, content management systems such as Drupal (which we're using for this web site) expect users to format their posts with HTML markup. This can be inconvenient and deter casual contribution from members of the community who aren't completely comfortable with HTML.

Javascript-based WYSIWYG (What-You-See-Is-What-You-Get) editors to the rescue!

Automating EC2 instance setup with user-data scripts

I recently published ec2metadata which provides a simple CLI and Python interface to the metadata of an Amazon EC2 instance. In that post I mentioned that "one of the most useful pieces of data is user-data, which can be used to pass configuration information or even initialization scripts to the instance upon launch".

I received a couple of responses by email asking for more information, so here it is.

EBSmount: Automatically mount EBS devices on Amazon EC2

The 2 most annoying things about Amazon EBS (Elastic Block Storage) I have found, is that there is no support to auto-attach an EBS on instance launch, and the need to manually mount an EBS when it's attached.

If the above annoys you as well, you're in luck! The first annoyance has been solved in the TurnKey Hub (private beta soon to be announced - request an invite here), and the second, well, is solved by EBSmount.

Upgrading FCKeditor to CKeditor

I just finished upgrading the WYSIWYG editor on the web site from FCKEditor to CKEditor, which is FCKEditor's less offensively named successor.


  • A noticeably faster, more lightweight code-base which was rewritten from the ground up.

  • Full-screen mode works beautifully now. I love how this instantly removes all the clutter and lets me focus on the content I'm editing without being distracted by the rest of the web site.

Self signed and trusted SSL certificates

Keeping it simple, HTTPS is a combination of the HTTP and SSL/TLS protocols, which provides encryption while authenticating the server. The main idea is to create a secure channel over an insecure network, ensuring "reasonable" protection from eavesdroppers and man-in-the-middle attacks.

HTTPS assumes that special CA (Certificate Authority) certificates are pre-installed in web browsers. If your SSL certificate is not signed by one of these CA's, the browser will display a warning:

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!

Qemu + KVM is the future of open source virtualization

Open source virtualization has been evolving dramatically over the last few years. Incumbent proprietary platforms such as VMWare still hold the throne in many areas but open source competitors are gaining ground fast on their way to ubiquity. Things are a-changing in the land of virtualization.

Right now we have three contenders to the (open source) throne battling it out for supremacy:

  • Xen: backed by Citrix
  • VirtualBox: backed by Oracle/Sun
  • KVM: backed by RedHat