Tracker server moved
September 22nd, 2011The Tracker resides now on a Rackspace server in the U.K. Should you notice any problems, please contact me.
The Tracker resides now on a Rackspace server in the U.K. Should you notice any problems, please contact me.
If your apache2 process suddenly crashes and refuses to restart, you can explore the option of semaphore resources running out. When I have such a situation, my /var/log/apache2/error.log gets a line like this at every start attempt:
[Sun Aug 28 06:25:20 2011] [crit] (28)No space left on device: mod_rewrite: could not create rewrite_log_lock
Configuration Failed
Check how many semaphores are in use:
ipcs -s | wc -l
In case the number seems high, you can free up all the semaphores using the following command in bash:
for x in `ipcs -s | awk ‘{print $2}’ `; do ipcrm -s $x; done
I wanted to use my displayless Linux server for torrent downloading. However, I’m not using X as a remote desktop for the box, so I wanted to have a web GUI where I could add torrents and have a script browse RSS feeds automatically for new episodes of my favourite shows. I came up with Aria2c, which has an XML interface for managing torrents.
So I created a python script which reads a feeds.txt file for show names and fetches the listings from eztv.it and if any new episodes are available, sends the torrents to Aria2c for downloading. Then I made a django app, which provides GUI access for adding torrents and monitoring the download queue. Items can also be removed from the queue but there are no other functionality at this time.
If you’re interested in the code and if you’d even like to start developing it with me, get in contact through Dotner.
Check out the ultimately cool mind mapping web application called Mindmeister. It gives you roughly the same functionality as MindManager (minus visual templates), but enables collaboration and has a quite responsive user interface.
The following changes have been deployed in production today.
New Features
Bug Fixes
The following fixes have been deployed in production today.
Also, the code should load faster now. If you notice any difference, I’d like to hear about it.
This release was deployed in production on March 10th, 2009.
New Features
Improved Usability
Security
This Tracker version will become available for production use during February 2009.
The new features and functionality
Bug fixes
Visual and usability improvements
Some earlier features I may not have mentioned much anywhere
Riddle me this; What is the worlds smallest keyboard, with only one key, which gives you a different result every time you press it? It’s Yubikey from Yubico. Yubikey is an authentication token, which acts as a USB keyboard. You can use the Yubikey to output a one-time password to a password field of a system which supports this.
Check it out, it’s cool.

Django and python make it a breeze to build and run automatic regression tests. In 1-2 days you can easily build 50 test cases which cover the basic functionality of your application, and make sure no view or model has been broken. The test cases can be divided into three groups:
Here’s how to do it. You start by adding a tests.py file in your application directory. The Django default test runner will execute the runTest() method for every TestCase derived class when you run manage.py test. Here’s an example tests.py. Django has specific test functions to log you in and out of the standard authentication framework, but this example is using it’s own authentication functionality.
from django.test import *
import doctest
class ViewTests(TestCase):
def runTest(self):
c = Client()
# Try to get private content prior to login
response = c.get('/projects/')
self.assertRedirects(response, '/login/?next=/projects/')
# Attempt login using the wrong password
response = c.post('/login/',
{'login': 'eki', 'pass': 'wrongpassword'})
self.assertContains(response,
'Please check your user ID and password')
# Use proper credentials
response = c.post('/login/?next=/projects/',
{'login': 'eki', 'pass': 'helloworld'})
self.assertRedirects(response, '/projects/')
# Now fetch each of the basic pages
response = c.get('/projects/')
self.assertContains(response, 'Example project')
response = c.get('/users/')
self.assertContains(response, 'Erkki Tapola')
This is the mechanism for testing views. Next, you can add doctests to your models.py. Doctest is a very handy notation for test cases to be executed from the command line python. Essentially you just run a test case on the command line and cut and paste the command and it’s output to your class or function documentation. For example:
def get_base_dir(path):
"""
>>> get_base_dir('/first/second')
'first'
>>> get_base_dir('first/second')
'second'
"""
items = string.split(path, '/')
return items[1]
The Django test runner runs doctests from models.py automatically, but if you want it to execute doctest cases from other files than models.py as well, you can add a TestCase class to tests.py for that purpose:
class ModuleTests(TestCase):
def runTest(self):
def mytestmod(m):
result = doctest.testmod(m)
print str(result[1]) + ' test cases ran in ' + str(m)
self.assertEqual(result[0], 0)
print "\nRunning test cases for individual modules\n"
print 80*'*'
for x in [tracker.main.util, tracker.main.projects]:
mytestmod(x)
print 80*'*' + "\n"
When you’re finished with your test cases and able to run them all using manage.py test, you can connect your cool new test suite to svn using the pre-commit hook. This way you can make sure that the code changes are verified prior to commit. Here’s what you do on Linux:
I should probably write this in python to make it platform independent. This unix shell command will find any manage.py from the subdirectories of your current location and use it for running tests. If any manage.py returns an error, the commit will be cancelled. This addition will not influence projects which doesn’t contain a manage.py, but if there is one, then the tests must pass.
A similar hooking mechanism exists in cvs and probably most other version control systems.
You can check out the article on Testing Django
applications for a comprehensive tutorial.