Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am neilbartley on github.
  • I am neilbartley (https://keybase.io/neilbartley) on keybase.
  • I have a public key whose fingerprint is 2041 40FF BD8F 36BB 8349 1C6A B056 C472 21FA 83CE

To claim this, I am signing this object:

@neilbartley
neilbartley / gist:e5dcda09076ae444e677bb3fc26ea296
Created November 29, 2016 14:32
onename GitHub public verification
Verifying that "neilbartley.id" is my Blockstack ID. https://onename.com/neilbartley
#!/bin/bash
#
# This script will mount /Users in the boot2docker VM using NFS (instead of the
# default vboxsf). It's probably not a good idea to run it while there are
# Docker containers running in boot2docker.
#
# Usage: sudo ./boot2docker-use-nfs.sh
#
@neilbartley
neilbartley / cve_2016_6316_workaround.rb
Last active November 17, 2017 20:42
Temporary (upgrade to Rails 4.2.7.1 / 5.0.0.1) workaround for CVE-2016-6316 (see: https://groups.google.com/forum/#!topic/rubyonrails-security/I-VWr034ouk). Only tested with Rails 4.1. Place in config/initializers.
if Rails::VERSION::MINOR < 2 && Rails::VERSION::MAJOR >= 4
module ActionView
module Helpers
module TagHelper
private
def tag_option(key, value, escape)
value = value.join(" ") if value.is_a?(Array)
value = ERB::Util.h(value) if escape
%(#{key}="#{value.gsub(/"/, '&quot;'.freeze)}")
@neilbartley
neilbartley / traefik.toml
Created October 21, 2018 11:18
Calming App Jams with Træfik - traefik.toml
debug = false
logLevel = "ERROR"
defaultEntryPoints = ["https", "http"]
# https://docs.traefik.io/configuration/entrypoints/
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect] # https://docs.traefik.io/configuration/entrypoints/#redirect-http-to-https
@neilbartley
neilbartley / reverse-proxy-stack.yml
Last active October 24, 2018 21:53
Calming App Jams with Træfik
version: '3.4'
services:
traefik:
# Use the apline image, its lovely and small - 22MB!
image: traefik:1.7.3-alpine
# This just exposes the ports to the host, the host firewall is configured separately
ports:
- "443:443" # Expose HTTPS port (and available externally)
@neilbartley
neilbartley / commands.txt
Last active October 24, 2018 22:15
Calming App Jams with Træfik - commands
# Created a server on DigitalOcean (anywhere will do). Just ensured it had docker installed.
# Setup DNS entries for proto[1234].neil.bar pointing at the server.
# Connected to the server.
# Server has ports locked down. Open up the ones we need.
ufw allow 80/tcp
ufw allow 443/tcp
# Wouldn't normally open this one up but its handy for this demo.
ufw allow 8080/tcp
@neilbartley
neilbartley / hsb-stack.yml
Last active October 26, 2018 11:11
Calming App Jams with Træfik
version: '3.4'
services:
hsb:
image: 123456789012.dkr.ecr.eu-west-1.amazonaws.com/hairy-slackbot:deploy-20181015-0935-e583d12
command: bundle exec puma -p 3000
# This links to the network created in the proxy (træfik) stack
networks:
- traefik_traefik
@neilbartley
neilbartley / proto1-stack.yml
Last active October 26, 2018 11:11
Calming App Jams with Træfik
version: '3.4'
services:
proto1:
image: 123456789012.dkr.ecr.eu-west-1.amazonaws.com/prototoype:deploy-20181019-1050-a127c89
command: bundle exec puma -p 9292
# This links to the network created in the proxy (traefik) stack
networks:
- traefik_traefik