Skip to content

Instantly share code, notes, and snippets.

philipithomas /
Created Feb 28, 2017
Staffjoy Elastic Beanstalk Deploy Script
AWSEBDockerrunVersion: "1",
Authentication: {
Bucket: "staffjoy-deploy",
Key: "docker.cfg"
Image: {
Name: "staffjoy/app:TAG",
Update: "true"
philipithomas /
Created Jul 24, 2016 — forked from cecilemuller/
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two modes when you don't want Certbot to edit your configuration:

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80) to renew certificates.

In the following, we're setting up to be served from /var/www/mydomain, and challenges will be served from /var/www/letsencrypt.

View gist:c50e20f2978013cac85d
# Goal: write Julia logs to disk and also print to standard out.
# In the process, prepend environment info (staffjoy-scheduler-stage)
# This works in vagrant / dev
/usr/bin/julia -p 2 -e 'import Manager; Manager.run_server()' 2>&1 | awk -v env=$ENV '{ print "staffjoy-scheduler-" env, $0; }' | tee -a scheduler.log
# In docker, the awk fails. The environment variable is defined.
# This is all that works in docker:
/usr/bin/julia -p 2 -e 'import Manager; Manager.run_server()' 2>&1 | tee -a scheduler.log
@api.route('/blog', methods=['GET'])
def blog_xml():
return requests.get("").text
philipithomas / docker_knapsack.jl
Last active Aug 29, 2015
Docker Container Scheduling as a Knapsack Problem in Julia/JuMP
View docker_knapsack.jl
using JuMP
using Cbc
We pass in the variable "pools" in this format that goes through a separate
pre-processing script that pipes JSON to a Julia JSON loader.
"awesome-pool-prod": {
philipithomas /
Last active May 17, 2017
Whitelist AWS Health Check IPs in Cloudflare
import requests
import netaddr
ranges = [
philipithomas / Stack trace
Created Sep 1, 2014
Failing dictionary keys as variables
View Stack trace
ERROR: key not found: "x"
in getindex at dict.jl:615
in getindex at no file
in include at /Applications/
in include_from_node1 at loading.jl:128
in process_options at /Applications/
in _start at /Applications/ (repeats 2 times)
while loading /path/to/file/test.jl, in expression starting on line 239
View gist:f383ad65f948dc7a9a6a
Version: Keybase OpenPGP v0.3.1

Keybase proof

I hereby claim:

  • I am philipithomas on github.
  • I am philipithomas ( on keybase.
  • I have a public key whose fingerprint is 2742 E1F6 F4F3 38D4 C541 73EC FE01 51EC 38D8 9319

To claim this, I am signing this object: