Skip to content

Instantly share code, notes, and snippets.

View gcallsen's full-sized avatar

Gilman Callsen gcallsen

View GitHub Profile

Keybase proof

I hereby claim:

  • I am gcallsen on github.
  • I am gcallsen (https://keybase.io/gcallsen) on keybase.
  • I have a public key ASBWlyEkUg1KiD2xQAk0i4KFe9mv8T9ypElNbmhDwUNlPQo

To claim this, I am signing this object:

@gcallsen
gcallsen / worker-up.sh
Created August 18, 2016 19:54
Simple example of an entry point that starts the health_check.py server as a background process
#!/bin/bash
# Set the Python path
#
READLINK=$(command -v greadlink || command -v readlink || die "...Error: readlink is not in your path! Are you in the right virtualenv?")
DIRNAME=$(dirname $0)
PYTHONPATH=$($READLINK -f $DIRNAME/..)
echo "Starting healthcheck server as background process ..."
CONTAINER_IP=$(curl -s http://rancher-metadata/2015-12-19/self/container/primary_ip)
@gcallsen
gcallsen / health_check.py
Last active October 5, 2016 21:21
A simple python TCP Server that can be used for Health Checks
import socket
import os
import time
class HealthCheckServer(object):
""" Simple TCP server to allow for TCP health checks.
"""
def __init__(self, ip='0.0.0.0', port=12345, handle_method=None,
@gcallsen
gcallsen / foobar.py
Created January 8, 2016 15:28
foo test
@data_dashboard_bp.route('/', defaults={'path': ''})
@data_dashboard_bp.route('/<path:path>')
def index(path):
context_variables = {
'current_path': path
}
return render_template('index.html', **context_variables)