This weekend I caught a real gem of a documentary at the Exploratorium’s Imagine Science Film Festival. Capucine, a chronicle of the first monkey film maker, left me reeling and eager for more from Luis Nieto. Enjoy!

Sexy Sunday Selecta

Fresh off the decks is a sultry new mix just in time for the sweaty days of summer. Get down, y’all.

Gleitz - Sexy Sunday Selecta (42:13)

Pool Party!

West Virginia

This weekend brought me back to my hometown of Morgantown, West Virginia. It was wonderfully nostalgic to be back and I took note of a couple items I’ve been missing since moving to California:

  • Large, long thunderstorms
  • Lush, rolling green hills
  • Pepperoni Rolls
  • A combination ice cream parlor and gun range
  • Fireflies
  • Swimming in the lake
Above the clouds #nofilter

Above the clouds #nofilter

#JustAmericaThings #USAUSA

#JustAmericaThings #USAUSA

Automatic App Deployment with “git push”

When deploying pet projects on remote servers, I dislike the extra step of logging into the remote machine to execute a git pull (and perhaps a server reload) every time I push new code. Sure there’s Jenkins and all sorts of bazooka-like solutions, but this is a knife fight. Poking around an old PHP repo, I found a nifty line of code that will update your app via a URL endpoint.

<?php `git pull`;

Drop that into secret-update-url.php and now all you have to do is visit to get the latest version of your code on the site. Going a step further, you can set up a webhook to have Github hit the URL for you.

Once I had dreamed the impossible dream in PHP, I wanted to have the same power with Python. Here’s a Flask route that accomplishes the same task:

@app.route('/secret-update-url', methods=['POST'])
def github_hook():
        data = json.loads(request.form['payload'])
        site_url = '' # replace me
        site_branch = 'master'
        data_url = data.get('repository', {}).get('url')
        data_branch = data.get('ref')
        if data_url == site_url and site_branch in data_branch:
  "Code change detected. Restarting now...")
            os.system('git pull')
            # if you're using Flask,
            with open('/path/to/', 'r') as f:
                pid = int(
                os.kill(pid, signal.SIGHUP)
    except ValueError:
        log.error("Unable to parse Github payload")
    return 'ok'

This code is a little more robust than the PHP example, checking to see if we’re on the right branch before issuing the git pull. If you’re using gunicorn as an HTTP server you’ll find that simply pulling new code is not enough — you also have to restart the server to see the changes. Assuming you’re starting gunicorn with the -p flag, the code above will read the PID and kill the process, causing the server to restart.

Finally, here’s how to accomplish the task in Node using the handy connect-githubhook package.

var express = require('express'),
    cgh = require('connect-githubhook'),
    sites = {'/secret-update-url': {url: '',
                                    branch: 'master'},
    app = express.createServer();

var handler = function(repo, payload) {
    console.log('Code change detected. Restarting now...');
    setTimeout(function() {
    }, 1000);

app.use(express.bodyParser()); //required
app.use(cgh(sites, handler));


Voila! Easy code pulls and server restarts for PHP, Python, and Node. Note that there isn’t any authentication on the /secret-update-url so code up a little auth before thinking about using this for production knife fights.

Life on the wild frontier

Life on the wild frontier

The Maze and Canyonlands

Nestled within the Canyonlands of Utah, The Maze is one of America’s most dangerous hikes. It’s also one of the most gorgeous hiking spots you can find.

Arches National Park

A historical reenactment in Salt Lake City

Harbin Hot Springs

If you’re looking to step outside the confines of a modern, clothed lifestyle, look no further than the restorative springs, grounds, and hiking trails of Harbin Hot Springs. Certainly a fine spot to get in touch with your inner goddess and/or spirit animal.

Be sure to check out the hiking trail to the Tea House!