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:

#!/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 / slack-rails-application.yml
Last active November 11, 2018 12:04
Excerpt of Slack configuration in application.yml
SLACK_WEBHOOK_URL: "https://hooks.slack.com/services/BLAH/BLAH/BLAH"
SLACK_WEBHOOK_CHANNEL: "#events_test"
@neilbartley
neilbartley / bespoke_slackbot_service.rb
Last active August 26, 2019 07:32
Implementation of a simple Slack integration for sending bespoke notifications
class BespokeSlackbotService
NAME_AND_ICON = {
username: 'Bespoke Bot',
icon_emoji: ':bat:'
}
GOOD = 'good'
WARNING = 'warning'
DANGER = 'danger'
@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 / gist:e5dcda09076ae444e677bb3fc26ea296
Created November 29, 2016 14:32
onename GitHub public verification
Verifying that "neilbartley.id" is my Blockstack ID. https://onename.com/neilbartley
@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 / 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 / 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