Skip to content

Instantly share code, notes, and snippets.

View gjohnson's full-sized avatar

Garrett Johnson gjohnson

View GitHub Profile
@larkintuckerllc
larkintuckerllc / schema.sql
Last active September 3, 2019 10:14
authorization
CREATE TABLE profiles (
id SERIAL NOT NULL,
name VARCHAR(256) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE permission_sets (
id SERIAL NOT NULL,
name VARCHAR(256) NOT NULL,
PRIMARY KEY (id)
// Copyright 2016 Google Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
// Command caption reads an audio file and outputs the transcript for it.
package main
import (
"fmt"
"io"
@apparentlymart
apparentlymart / Terraform-State-Ideas.md
Last active December 24, 2022 17:10
Terraform State Integrity Issues

Issues with Terraform State Management

The idea of "state" is the lynchpin of Terraform, and yet Terraform's workflow is fraught with gotchas that can lead to the loss or destruction of state. This doc is a set of notes about issues I've encountered, what caused them, and in many cases ideas about how to improve Terraform to avoid or reduce the chances of them.

Each of these scenarios has occured at least within my team. Each time one of these occurs it erodes people's confidence in Terraform, giving it a reputation for being fragile and unforgiving of errors. This this document is not written just to criticize but rather to identify ways in which the situation could be improved.

@ryancurrah
ryancurrah / vault_module.py
Created December 18, 2015 01:25
SaltStack Module and Renderer for HashiCorp Vault
# -*- coding: utf-8 -*-
'''
Execution module to work with HashiCorp's Vault
:depends: - python-requests
In order to use an this module, a profile must be created in the master
configuration file:
Token example:
@ejholmes
ejholmes / docker_maid.sh
Created October 27, 2015 18:32
Docker maid
#!/bin/sh
log() {
echo "=== [`date`] $*" >> /var/log/docker_maid.log
}
[ ! -S /var/run/docker.sock ] && (echo "Error: /var/run/docker.sock not available, bailing."; exit 1)
CONTAINERS=$(docker ps -q -a --filter "status=exited")
if [ ! -z "$CONTAINERS" ]
@rf
rf / convert.js
Last active May 20, 2016 18:15
Symbolicate linux perf output of a node program using the v8 log
var fs = require('fs');
var infile = process.argv[2];
if (!infile) return console.log("need infile");
var data = fs.readFileSync(infile, 'utf8').split('\n');
var outlines = [];
data.forEach(function(item) {