Deploying clortho with ansible and venv

I have started using Ansible to manage the few services that I still have running around here. I want to deploy clortho to a user on the system I use for serving up movies to my Roku players . I need to copy the source, setup a venv with the dependencies (aiohttp ), and setup a systemd unit to make sure it is started at boot time.

As of Python 3.3 the core library includes support for venv , and Python 3.4 added default installation of pip so that now the only support you need on a target system is the core Python 3.4 build. Everything else can be done inside a venv.

clortho - A simple key/value server

clortho is a very simple key/value server written using python 3.4 and aiohttp

key namespace is per-client IP address, and there is no authentication. It supports direct connections from clients, and the X-Forwarded-For header for use with proxies. I shouldn’t have to mention that running this on an open network isn’t a good idea.

Get a key value by requesting http://server/keystore/<key>:

curl http://server/keystore/louis

If the key has been set it will return a 200 status with the value. If the key is not set it will return a 404 and a message:

Automatic Backup of Files to S3 and Glacier

Automatic backups are important, especially when it comes to irreplaceable data like family photos. I have used s3cmd to maintain my website’s static files for a while now, and it was simple to use it to push my 100GB+ archive of photos over to S3. But I needed an automated way to update it with any new photos that my wife or I may take. The sync protocol really isn’t what you want – there should be no need to re-examine all the files that have already been archived. You really only want to copy over new ones added since the last update.

Chat with Tor and socat

It is easy to setup a simple chat over Tor using the socat utility. To receive incoming messages you first need to setup a Tor hidden service . Add this to the end of your /etc/tor/torrc file:

HiddenServiceDir /var/lib/tor/hidden-chat/
HiddenServicePort 2330 127.0.0.1:2330

After restarting Tor check the /var/lib/tor/hidden-chat/hostname file for your hidden service .onion address.

Use socat to setup a listener on port 2330, now incoming connections to ADDRESS.onion:2330 will show up on your terminal. Run this on the system where you setup the hidden service.

Xmonad on a MacBook Pro with Fedora 19

For years I have dual booted my Macbook with Fedora. Things have always almost worked, but never quite as smoothly as they do under OSX. Typically the problems are with the trackpad, wireless drivers and heat control – The fans on my MBP didn’t want to kick on at the point I’d like them to and Fedora just runs hotter than OSX does for the same workflow.

With F19 things are somewhat better, the following xorg config file dropped into /etc/X11/xorg.conf.d/ sets up the trackpad fairly well.

Reliable Wireless Temperatures

Freezer Temperatures

The temperature sensors that I use to drive the freezer graph are in my garage, which doesn’t have an easy way to run wires to the server room. I have a WRT54GL running DD-WRT configured as a bridge to the rest of my network. The problem with this is that the connection isn’t always reliable. I used to have a simple script that read the temps and fed them to my main mysql server, but the connection would frequently drop and it would lose the temperature data.

NASCAR Countdown for iPhone

NASCAR Countdown for iPhone

The NASCAR Countdown app displays a countdown to the next NASCAR race, the name of the race and the television network carrying the race. On the flip side all of the races for the season are listed, and tapping on one of them will go to the nascar.com website for that track. The application now includes all of the Sprint Cup, Nationwide Series and Camping World Truck races.

/images/nascar-iphone/Screenshot-front.png /images/nascar-iphone/Screenshot-flip.png
Requirements
  • iPhone or iPod
Release Notes
  • v1.0 Initial release
  • v1.1 Added Nationwide and Camping World Truck races. Added date of next race above the countdown. Added details to the list of races.
  • v1.5 Updated for 2012 Season
  • v1.6 Fixed a couple uninitialized variables. Hopefully fixing the crashes that some users were seeing.

Crash Reports

Moving a BackupPC Pool

I have been using BackupPC to automatically back up the systems on my LAN for years now. It started out with a 3x250GB RAID5 as the storage pool and when I ran out of space on that I added another disk to bring it up to about 700GB. BackupPC does an excellent job of pooling common files together so that they don’t take up extra space. This is especially useful if you are backing up system files on multiple systems running the same OS release.

New MovieLandmarks Update

Movie Landmarks is back online. I think this is the 5th iteration of the project that I originally started back in 2006. It started out as a PHP app, morphed into a python wsgi application. It was always backed by a mysql db with lots of interactive features. For this redesign I've dropped all of that extra stuff and simplified things.

I threw out the database and replaced it with a couple of python dictionaries holding the landmark information and another with the movie data. I use Python to create the JSON and html files use for the site. This only needs to be run when I add new landmarks or movies.