TurnKey Linux Virtual Appliance Library

Transcend the Drupal documentation, use the source Luke!

During the first few months of my Drupal experience I looked for answers to any issues that came up first in the official documentation, then on Google. It's a big Drupal world out there so more often then not I would find someone had come across exactly the same issue before and I could just parrot the solution without necessarily understanding why it worked.

Pythonic attribute magic (property, customized attribute access)

Many languages encourage programmers to use a getter/setter pattern.

Like this:

Tips for the Object Oriented Programming novice

The following is written for programmers who don't really understand object oriented programming yet. They probably understand the language semantics, but don't really understand how to use them correctly.

If you find yourself misusing object oriented semantics that probably means you don't have the skills to develop good software. This is a problem because bad software is much harder to develop and even harder to maintain.

Unix buffering delays output to stdout, ruins your day

Let's say you have the following program:

cat>example.py<<'EOF'
#!/usr/bin/python
import time
while True:
    print 'hello world'
    time.sleep(1)
EOF

chmod +x ./example.py

If you run this program from a terminal, it will print hello world every second.

But redirect the output to a file and something different happens:

./example.py > output &
tail -f output

You won't see any output! (At least not for a long while)

Two simple ways a script can detect if it's online

I didn't want installation of one of TurnKey's components to freeze up too long if it was installed offline so I looked for a nice way to detect that without bringing in additional dependencies.

Two methods stood out...

  1. ping Google DNS servers: one second constant delay, regardless if you're online or off:

configuring libresolv to timeout DNS queries to unreachable nameservers more quickly when offline

When I go offline I pull my network cable. This causes DNS queries to take forever to resolve. Actually 40 seconds but it feels like forever.

StdTrap: a magical Pythonic mechanism for intercepting console output

As a programmer I believe less is more. Good code is small, simple and elegant and many times favorable to larger, noisier code that does the same. It's not just about aesthetics either. Making code small and beautiful makes it easier to read, and easier to understand. Which is guaranteed to make it work better. Trust me on this.

How Foodsoft inspired me to rewrite the TKLDev documentation

A couple of weeks ago I was corresponding with @wvengen, a free software developer from the Netherlands who has been using TKLDev to package Foodsoft into a ready-to-use Foodsoft in a box solution that can be easily deployed to manage your own non-profit Food Coop.

TurnKey 13.0 ready for community development

Want to roll your own Debian Wheezy based images? You're in luck because we just finished upgrading TurnKey's build chain, including new versions of TKLDev and TurnKey Core ready for download.

Using Comet to update web application data in real time?

Recently I've been looking into a powerful but complex web application technology we're considering using in future versions of the Hub.

The problem: how do we update a browser view when a background process updates the database?

A few examples of places in the Hub where this comes up...