Skip to content

Instantly share code, notes, and snippets.

View gmr's full-sized avatar
:octocat:
🐘 🐇 🐍

Gavin M. Roy gmr

:octocat:
🐘 🐇 🐍
View GitHub Profile
2017/11/29 14:20:09.628249 [INFO] envconsul v0.7.2 (a508c43)
2017/11/29 14:20:09.629523 [INFO] (runner) creating new runner (once: false)
2017/11/29 14:20:09.630590 [DEBUG] (runner) final config: {"Consul":{"Address":"127.0.0.1:8500","Auth":{"Enabled":false,"Username":"","Password":""},"Retry":{"Attempts":12,"Backoff":1000000000,"MaxBackoff":120000000000,"Enabled":true},"SSL":{"CaCert":"","CaPath":"","Cert":"","Enabled":false,"Key":"","ServerName":"","Verify":true},"Token":"","Transport":{"DialKeepAlive":30000000000,"DialTimeout":30000000000,"DisableKeepAlives":false,"IdleConnTimeout":90000000000,"MaxIdleConns":100,"MaxIdleConnsPerHost":2,"TLSHandshakeTimeout":10000000000}},"Exec":{"Command":"/usr/local/bin/test-script.sh","Enabled":true,"Env":{"Blacklist":[],"Custom":["CUSTOM_ENV_VAR=FOUND","PATH=$PATH:/etc/myapp/bin"],"Pristine":false,"Whitelist":[]},"KillSignal":15,"KillTimeout":5000000000,"ReloadSignal":null,"Splay":5000000000,"Timeout":0},"KillSignal":2,"LogLevel":"debug","MaxStale":60000000000,"PidFile"
@gmr
gmr / example.vcl
Last active September 21, 2017 18:39
director autodirector_ random {
{
.backend = F_us_east_1_assets_aweberstage_com;
.weight = 100;
}{
.backend = F_us_west_1_assets_aweberstage_com;
.weight = 100;
}
}
@gmr
gmr / rmq-sorted-definitions.py
Created March 24, 2017 19:14
Script for dumping RabbitMQ definitions with deterministic sorting
#!/usr/bin/env python3
import argparse
import json
import requests
import sys
def dict_list_key(item):
if 'vhost' in item and 'name' in item:
return item['vhost'], item['name']
@gmr
gmr / vpc.yaml
Last active November 4, 2022 13:59
Demonstration CloudFormation YAML template for creating a VPC
AWSTemplateFormatVersion: '2010-09-09'
Description: VPC Network Stack
Metadata: {}
Mappings: {}
Conditions: {}
Outputs: {}
Parameters:
CidrBlock:
AllowedPattern: '((\d{1,3})\.){3}\d{1,3}/\d{1,2}'
Default: 10.0.0.0/16
# -*- coding: utf-8 -*-
import datetime
import decimal
from os import path
import pickle
import re
import requests
import time
from email import utils
@gmr
gmr / tdns.py
Last active April 28, 2016 22:19
"""
tdns
====
An asynchronous Tornado pycares DNS client wrapper, exporting the full API.
"""
from tornado import concurrent
from tornado import ioloop
import pycares
=CRASH REPORT==== 7-Apr-2016::20:48:03 ===
crasher:
initial call: gen:init_it/6
pid: <0.10417.0>
registered_name: []
exception exit: killed
in function gen_server2:terminate/3
in call from whereis/1
ancestors: [<0.10415.0>,rabbit_direct_client_sup,rabbit_sup,<0.5073.0>]
messages: []
=CRASH REPORT==== 12-Apr-2016::15:32:10 ===
crasher:
initial call: gen:init_it/6
pid: <0.18441.212>
registered_name: []
exception exit: killed
in function gen_server2:terminate/3
in call from whereis/1
ancestors: [<0.18431.212>,rabbit_direct_client_sup,rabbit_sup,
<0.5079.0>]
@gmr
gmr / entrypoint.sh
Last active December 30, 2015 15:48
Docker entrypoint bash script that enables 12FA style environment variable configuration for apps using S3 for storage of the environment variables.
#!/bin/sh
# Docker Entrypoint for running an application after using AWS instance data and
# the aws cli to fetch and source environment variable configuration from S3.
#
# tldr Required Environment Variables
#
# - CONFIG_S3_BUCKET: The name of the S3 bucket where the config lives
# - SERVICE: The name of the service for retrieving the config
#
# or
@gmr
gmr / mikkoo.sql
Last active December 23, 2015 17:45
CREATE SCHEMA mikkoo;
CREATE TABLE mikkoo.audit (
message_id UUID NOT NULL,
event_id BIGINT NOT NULL,
queue TEXT NOT NULL,
exchange TEXT NOT NULL,
routing_key TEXT NOT NULL,
payload TEXT NOT NULL,
content_type TEXT,