Skip to content

Instantly share code, notes, and snippets.

View darron's full-sized avatar
🎯
Focusing

darron froese darron

🎯
Focusing
View GitHub Profile
@philips
philips / users.md
Last active April 5, 2023 14:17
Kubernetes Third-Party Resource Users
#!/bin/bash
#
# vault-ec2-auth.sh
# Authenticates an EC2 instance to Hashicorp Vault
#
# configuration stored in environment variables in /etc/vault/client.conf
# expected configuration (defaults are selected below if none is specified):
# VAULT_ADDR = url of vault server
# VAULT_ROLE = role name to authenticate as
@lewisd32
lewisd32 / iptableflip.sh
Created April 15, 2015 18:20
Snippet of Unbounce script for restarting HAProxy with zero downtime
echo "Flipping tables! (╯°□°)╯︵ ┻━┻"
num_rules=3
real=3 # exposed to the ELB as port 443
test=4 # used to install test certs for domain verification
health=5 # used by the ELB healthcheck
blue_prefix=855
green_prefix=866
@vgeshel
vgeshel / function.js
Last active February 9, 2022 09:19
AWS Lambda function for forwarding SNS notifications to Slack
console.log('Loading function');
const https = require('https');
const url = require('url');
// to get the slack hook url, go into slack admin and create a new "Incoming Webhook" integration
const slack_url = 'https://hooks.slack.com/services/...';
const slack_req_opts = url.parse(slack_url);
slack_req_opts.method = 'POST';
slack_req_opts.headers = {'Content-Type': 'application/json'};
@dysinger
dysinger / coreos-kubernetes-vpc-playbook.yml
Created November 14, 2014 21:40
CoreOS Kubernetes AWS VPC Playbook
---
- connection: local
hosts: 127.0.0.1
tasks:
- local_action:
description: Kubernetes Security Group
module: ec2_group
name: kubernetes
region: '{{ aws.region }}'
rules:
@bketelsen
bketelsen / ddagent.json
Last active August 29, 2015 14:07
DataDog agent as privileged Pod with Service - collects info on host, and all docker containers. Accepts statsd on port 8125 on every machine.
{
"id": "ddagent",
"kind": "ReplicationController",
"apiVersion": "v1beta1",
"desiredState": {
"replicas": 3,
"replicaSelector": {"name": "ddagent"},
"podTemplate": {
"desiredState": {
"manifest": {
@gmr
gmr / consul.lua
Created July 14, 2014 17:03
Dynamic Nginx upstream nodes using Consul
module("resty.consul", package.seeall)
_VERSION = '0.1.0'
function service_nodes(service)
local http = require "resty.http"
local json = require "cjson"
local hc = http:new()
local upstream = ""
#!/bin/bash
# Usage:
# $ ./heroku-deploy.sh <app name> <git repo url> <heroku api key>
APP="$1"
REPO="$2"
APIKEY="$3"
echo "-----> Creating application $APP"
curl -u ":$APIKEY" -d "app[name]=$APP" -X POST https://api.heroku.com/apps -s > /dev/null
anonymous
anonymous / gist:4496942
Created January 9, 2013 21:04
#
# PRODUCTION
#
production:
adapter: mysql2
encoding: utf8
reconnect: false
database: gitlabhq_production
pool: 5
username: <%= ENV['PROD_DB_USER'] %>