Useful stuff

Here's a few things that I've made over the years that I've found useful, and who knows, someone else might too! Hey, I might even update some of these occasionally...

UWU, the Uncomplicated Web Uploader (1.0)

UWU, the Uncomplicated Web Uploader, is a simple portal for uploading files to a server through a web browser. A server administrator may then access and manage those files. UWU requires Python 3. A standalone server for private/trusted networks can be run without any other prerequisites. For permanent and/or public installations, UWU also requires a secure web server with CGI enabled.

UWU operates with the concept of spaces. Each space essentially corresponds to a folder on the server, and a set of quotas for the contents within that folder. To upload a file, the user must enter the name of a configured space and its corresponding key, which is like a password but assigned by the administrator (and not as secure).

By design, UWU does not support viewing the existing contents of spaces (neither the list of files nor their respective contents). In a sense, the transfer is “one way only”.

Download UWU. Posts about it can be found here. For the latest development version, clone the git repository here.

cdbak (1.2.0)

I like having a tangible music CD collection, for a few reasons, but at the same time I also like not losing my music data in the event that CDs degrade. So I wrote a pair of scripts to archive and restore music CDs, preserving as much of the original CD's layout as possible. Backup files are compressed using flac for the audio session and gzip for any subsequent sessions. These can then be put on your favourite backup medium (e.g. burnt to a DVD) and later recovered in the event that the original is scratched, snapped, or eaten by microbes.

Download cdbak.

alphatools (1.4)

Many years ago I wrote pair of programs, collectively known as alphatools, that process two non-alpha-mapped images to produce one or two alpha-mapped images. The intended purpose was to take computer-generated imagery and transform it to transparent sprites that could be used in games I was making. One program, mergealpha, takes a pair of images, where one image has a black background and the other a white background, and computes a new image with valid alpha channel that accurately reflects transparency information. The other program, mergecloth, does the same but with the addition that a player colour changes in the original image pair, and at the output a second image is produced that consists of a player-colour overlay (which can be adjusted easily, e.g. with a simple multiply filter). Both are console programs, both work on png files, and both need libpng. They haven't been tested in a while, so your mileage may vary.

Since writing these I've learned quite a bit more about how linear and nonlinear/perceptual/gamma colour spaces differ. This page has a nice summary of the issue. The alphatools programs assume linear colour spaces are used, whereas your images are more likely in a nonlinear space (e.g., sRGB) by default.

Download alphatools.