Programs and other stuff

Open-Source Projects on Bitbucket:

{{bitbucket:simongreenhill,sortby:name,sortdir:asc}}

Posts here relating to code

  • Simple webserver file alteration monitoring using integrit.

    This shows us once again, that any software you run on your website needs to be kept up-to-date immediately, but what shocked me was that so many people out there running websites and are not watching them for file changes. They had no idea that their sites had been hacked until they went and looked for it.

  • Shell script to start/stop Crashplan.

  • r8spermute.

    This is a small program to assess how robust divergence times are based on the calibrations given to the program r8s.

  • Query PubMed for citation information using a DOI and Python.

    Here's a simple little script to query PubMed for a Digitial Object Identifier (a DOI)

  • python-nexus - a generic nexus (.nex, .trees) reader for python.

  • Protecting MySQL from SQL Injection Attacks with PHP..

    This is intended as a brief guide to protecting your MySQL database from SQL injection attacks. Unfortunately, a large amount of the code that I've seen written by people on forums, and in countless crappy PHP tutorials lurking around on the net, and in the many websites that display the "magic breeding slashed-quote" show that many people just do not understand what's going on and how to protect themselves against SQL injection attacks.

  • Processing mod_security audit logs with logwatch.

    This is a quick and dirty LogWatch script to process mod_security audit logs. I had a google, and couldn't find any released scripts, so here's my one.

  • process a url query string in PHP.

    A PHP function to parse a url and extract its arguments.

  • genbank-download.

    genbank-download is a small script to download nucleotide sequences from genbank using an accession number.

  • Django Middleware Games.

    I was fascinated by Andrew Wooster's Fun With HTTP Headers post and I decided that Django should do something cool with its HTTP headers too. So, I banged these middlewares together to add a simple (and utterly useless) X-Djazzified-By and X-Now-Playing response header to all pages served by Django. Just a subtle way of showing your Django-fanship.

  • benchmarking .htaccess performance.

    One of the common tips to increasing Apache performance is to turn off the per-directory configuration files (aka .htaccess files) and merge them all into your main Apache server configuration file (httpd.conf). Jeremy raised an interesting question about when the performance loss caused by using many htaccess files is offset by the ease of maintenance. He's arguing - and I agree - that it makes sense to keep the configuration locally inside .htaccess files, despite the performance loss as these are easier to maintain....