Water People

Posted: 2020-03-07 16:48   |  More posts about art code music

I'm very fond of Liz Harris's art — so much so that I have a small canvas print of the cover for the Grouper single "Water People" hanging in my living room. The cover looks like this:

This morning, having spent the last few days on sick leave from work, it caught my eye and I decided to relieve my boredom by attempting to recreate it in code. One naive solution is simple:

  • Draw a square - a "segment" - containing 7 inner squares, with an equal amount of spacing between each, and diagonal lines from the top-left to the bottom-right and bottom-left to top-right.
  • Repeat this N times from left to right, ensuring segments are visibly stacked towards the center, to draw a row.
  • Repeat this N times from top to bottom, ensuring rows are visibly stacked towards the middle, to draw the full canvas.
  • Draw two lines that span the entire height and width of the drawn area, meeting in the center, forming a cross.

I've never ever done any graphics programming before and have a questionable grasp of mathematics, so I was pleased with the result after an hour's hacking, regardless of how trivial the problem is. You can see it here:

The code (~50 lines) can be viewed on github and requires no dependencies to run (apart from the graphics.py library, which is checked in to the repo.) Its parameters (e.g. padding, number of segments per row, etc.) can easily be played around with.

After many years of programming professionally, it is nice to create something inefficient and functionally useless but aesthetically pleasing — just for the sake of creating something.


Gelber Sack ICS Calendars Back Online

Posted: 2014-06-17 22:38   |  More posts about code

A while ago, responsibility for the rubbish collection in Stuttgart changed hands, from SITA Deutschland to Schaal-Müller, rendering useless the ICS calendars service I'd recently launched.

The data required to provide automatically-updating ICS calendars is now back online, and so this evening I spent some time redesigning my scraper and getting the service back up and running. You'll need to unsubscribe from your previously subscribed ICS calendar URL and follow the instructions on my Gelber Sack page to add your new calendar.

Hopefully it'll last somewhat longer this time :)


zzzz.io: A free dynamic DNS service

Posted: 2014-06-17 22:35   |  More posts about code dyndns

I released zzzz.io last week. It's a free DynDNS alternative - sign up, get an easy-to-remember subdomain, and point it to the IP of your choice. If needs be, you can update the IP as it changes.

It's been a great success so far, with over 1000 people signing up within the first few hours. If you might find it useful, give it a try!


Gelber Sack ICS Calendars Offline

Posted: 2014-01-11 17:42   |  More posts about code

It has come to my attention that SITA Deutschland has removed all data for Stuttgart Gelber Sack collections from their website. This is the data that I used to create the ICS Calendars distributed through this website.

Unfortunately, this means that these ICS calendars will remain empty until I find an alternative solution. I offer my apologies for this, but sadly it's something completely out of my control.

If you have any suggestions as to an alternative data source, please contact me.


Big Picture Cataloguer 1.0

Posted: 2013-11-14 21:02   |  More posts about code photography

Many years ago, I wrote the Big Picture Cataloguer - a little tool for downloading Boston.com's fantastic Big Picture photojournalism series and tagging each image with its appropriate caption.

It's proved to be my most popular tool so far, with over 10,000 downloads so far. Unfortunately, it was also my buggiest, having been coded while hungover on a particularly drunken weekend. Plenty of users have contacted me in the mean time with support questions, and I'd always meant to clean up the code and add tests, but never quite got around to it.

This year, I finally managed to get around to it and I'm now happy to release Big Picture Cataloguer 1.0.

Click here for a Windows executable.

For OS X and Linux users, you can find the source code here. Be warned: the pyexiv2 module is unfortunately extremely difficult to get up and running (on OS X, at least). Feel free to fork this to use a friendlier image metadata library!



ICS Calendars for Stuttgart Gelber Sack Collections

Posted: 2013-10-27 13:22   |  More posts about code

Something I finished months ago but have only just gotten around to making public now is a service that provides ICS calendars for plastic rubbish collections in Stuttgart (the so called Gelber Sack Abholtermine).

The Problem

On the surface, the motivation is this: it's a pain to have to remember when your rubbish is going to be collected, an even greater pain to miss a collection and have sacks of rubbish accumulating on your balcony. Wouldn't it be great if your phone reminded you automatically, the night before?

"But," I hear you say, "you can already do this! Just download the Gelber Sack app, key in your information, and you're set!"

Unfortunately, it's not that simple. Without wanting to step on anyone's toes, the Gelber Sack App is, in a word, shit:

  • Here is a screenshot of it reminding me of a collection 4 days late:

  • The app also went through a period where it would pop up noticiations for all collections in the past few months:

  • This would cause your phone to flip out every time you turned it on, vibrating and ringing for about 5 seconds at a time. Great.

  • It occured to me that there's absolutely no need for a "Gelber Sack App". You've already got an app on your phone for this purpose - it's called Calendar. Why install another app, which may or may not work depending on how it's feeling, and uses the battery when running in the background?

It was this last point that led me to create this service.

The Solution

All good Calendar applications (Google Calendar and iCal included) have support for importing external calendars in the ICS format. So, you can add your facebook events to Google Calendar and have your calendar automatically update when you accept an invitation to an event on facebook. Why not do the same with Gelber Sack collections?

To use this service, simply visit this page (available in both German and English), enter your post code, select the street you live on, and you'll be presented with a URL for an ICS calendar which you can just copy and paste into the calendar software of your choice. Then, make sure this external calendar is also synced to your phone's calendar application, turn on notifications (I have mine set to 2 hours before, so I'm notified at 10PM the night before) and you'll never miss another rubbish collection!

For the nerds...

Source code for the application which scrapes the SITA Deutschland website and generates the ICS files is available on github here.

To avoid hammering SITA's servers, this program uses an extremely liberal (5-second) pause between each HTTP request.


dyndns autologin

Posted: 2013-07-03 17:24   |  More posts about code

Got this email just now:

If you would like to maintain your free Dyn account, you must log into your account once a month. Note that using an update client will no longer suffice for this monthly login. You will still continue to get email alerts every 30 days if your email address is current. Failure to login once per month will result in expiration and loss of your hostname.

dyndns-autologin is a tiny script that will automatically login to your DynDNS account to prevent this happening.



xltronic Vibes

Posted: 2013-05-17 00:15   |  More posts about music

Years ago, when xltronic.com was a thriving community of electronic music nerds, something like xltronic Vibes was possible: a series of albums of music produced by xltronic members, mixed together, often with an overarching theme.

Such collaborations are pretty much impossible nowadays. The website has been dying a slow and miserable death in the past few years and the community is now as good as non-existant. To make matters worse, the old Vibes series has disappeared from the site.

So, here is a mirror of all of the Vibes albums I managed to collect over the years. If anyone has any that are missing, please get in touch, so they don't disappear from the internet forever.

Personal favourites are definitely #10 and #19.


Shout-out to hipsters

Posted: 2013-05-10 16:28   |  More posts about music live music

Had the chance to see Mac Demarco live in Munich a few days ago. My expectations were so high I was almost certain I'd come away disappointed, but I left completely blown away.

Demarco's studio albums are fairly mellow. When playing live, however, the tempo is jumped up and plenty more distortion and general madness is thrown in to the mix.

Here's a video of the band playing in the Pitchfork headquarters. An excellent performance all around: funny banter, awesome music and really tight playing.


Set list

  • The Stars Keep On Calling My Name
  • Cooking Up Something Good
  • Rock And Roll Night Club
  • Ode To Viceroy
  • Freaking Out The Neighborhood
  • My Kind of Woman
  • Baby's Wearing Blue Jeans
  • Jam:
    • She's Really All I Need
    • Take Five (Dave Brubeck Quartet)
    • Break Stuff (Limp Bizkit)
    • Blackbird (The Beatles)
    • She's Really All I Need (Reprise)
  • Still Together


ahye - a screenshot and image server

Posted: 2012-12-10 22:47   |  More posts about code

The problem

You want to share a screenshot of a part of your screen with a friend or colleague. While this is a little less convoluted on OS X, on Windows or Linux you will typically:

  • Press the print screen key
  • Open an image editor
  • Paste the contents of the clipboard
  • Crop the image so that only the relevant section is visible
  • Save this image as a new file
  • Close the image editor
  • Send the image file to your friend
  • Delete this file from your computer

By any measure, a very long, drawn-out procedure - not to mention the fact that your friend also has to accept the file transfer, find the file and open it, before deleting it, so as their Downloads folder or Desktop doesn't get cluttered.

Gyazo is a service that sprang up to solve this problem. Just run the program, select the area of your screen to take a screenshot of, and suddenly you're taken to the image hosted on the gyazo servers. The URL is also automatically copied to the clipboard, allowing the user to simply paste this URL to whomever they're collaborating with.

Sounds great! However, there are two main problems with using gyazo:

  • It is absolutely plastered in ads
  • Your screenshot now resides on someone else's server

The solution

ahye is a compact image server written in python to address this. It has two main features:

  • Compatibility with gyazo screenshooter clients (which are open source, and so can be used with any ahye server)
  • An additional web interface for uploading and mirroring images

Trying it out

If you would like to try ahye out without installing it, you can use a test server I've set up.

WARNING - This server is for experimental purposes only. I cannot guarantee any images saved to it will persist after a few minutes. If you like how ahye works, please set up and use your own server.

In order to use this test server, you can:

Setting up your own ahye server

Getting started with ahye is rather simple. In the next few days, I'll be also publishing a Chef cookbook that can be used to deploy ahye, but until then you can:

  • git clone git://github.com/kopf/ahye.git
  • pip install -r requirements.txt
  • python runserver.py
  • Download the gyazo client of your choice for your OS - there are a few listed in the repo's README
  • Make a small alteration to point the client to your server

Web interface

As mentioned above, ahye also provides a web interface for uploading and mirroring images. Simply visit the your ahye server in a browser and drag your image(s) into the browser window to upload it.

In order to mirror an image, simply append the URL of the image to your ahye server's url. So, let's say your ahye server is located at http://ahye.myweb.com, and you want to mirror the file http://i.imgur.com/EHWlL.jpg, you just have to go to http://ahye.myweb.com/http://i.imgur.com/EHWlL.jpg and your ahye server will automatically rehost the image and redirect you to its own copy.

If the URL to be mirrored has already been downloaded by the ahye server, it will be served without being re-downloaded and re-saved.

The future

ahye is far from perfect. It is designed - on purpose - as a literal 'black hole' for images: image histories or per-user images are both features beyond the scope of this project. The web interface is also a little clunky, with the jQuery fileupload plugin not being used to its fullest.

That being said, it is a tool that I and my colleagues at work use daily to make our lives easier. It does its job great, and it provides good peace-of-mind that I'm not going to accidentally save a segment of my credit card number somewhere where I can't delete it. (True story - this was the impetus for ahye)

So, give it a try, and if you're an open source developer yourself, please don't hesitate to fork and contribute!