Skip to content

Instantly share code, notes, and snippets.

View brentley's full-sized avatar

Brent Langston brentley

View GitHub Profile
@pamolloy
pamolloy / README.md
Last active January 23, 2024 07:28
Ubiquiti USG configuration for Wireguard

Download the latest ugw3 package from https://github.com/Lochnair/vyatta-wireguard/releases and install it on your USG using dpkg -i wireguard-ugw3-<version>.deb.

cd /config/auth
umask 077
mkdir wireguard
cd wireguard
wg genkey > wg_private.key
wg pubkey < wg_private.key > wg_public.key
@ccampanale
ccampanale / vaultsealmanager.sh
Created December 10, 2015 19:31
Bash shell script to check seal status for local vault server and attempt to unseal using keys secured in vault secret store. Supports HA Vault clusters with TLS with unseal keys stored as secrets in vault (see code). Relies on registered service vault.service.consul, in place DNS configuration, and a single unsealed vault instance in your clust…
#!/bin/bash
export vault=/usr/local/bin/vault
export VAULT_TOKEN=$(cat /root/.vault-token)
vault_cacert='-ca-cert=/path/to/your/ca.pem'
local_vault="-address=https://$(hostname -f):8200"
unsealed_vault="-address=https://$(getent hosts $(dig +short vault.service.consul | tail -n 1) | awk '{ print $2 }'):8200"
leader_vault="-address=https://$($vault status $vault_cacert $unsealed_vault 2> /dev/null | grep Leader | awk '{ print $2 }' | sed 's/^http\(\|s\):\/\///g'):8200"
vault_read="$vault read $vault_cacert $leader_vault"
vault_unseal="$vault unseal $vault_cacert $local_vault"
@crazed
crazed / gist:0cae1dc0e2d95da0cf5f
Created October 23, 2015 16:01
lint-ansible.py
#!/usr/bin/env python
import os
import re
import sys
import ansible.errors
import ansible.utils.template
import ansiblelint
import ansiblelint.utils
import jinja2
@viesti
viesti / filters.py
Created September 17, 2015 13:10
Ansible filter plugin to create rules fo ec2_group
def make_rules(hosts, ports, proto):
return [{"proto": proto,
"from_port": port,
"to_port": port,
"cidr_ip": host} for host in hosts for port in map(int, ports.split(","))]
class FilterModule(object):
def filters(self):
return {'make_rules': make_rules}
@eeertekin
eeertekin / backend-architectures.md
Last active September 23, 2019 09:21 — forked from ngocphamm/backend-architectures.md
Backend Architectures
# Description:
# Executes a taskDeploy command for spinning up task instances
#
# Dependencies:
# None
#
# Configuration:
# HUBOT_DEPLOY_SCRIPT_LOCATION
# HUBOT_DEPLOY_USER
# HUBOT_DEPLOY_KEY
@afair
afair / gist:3803895
Last active August 7, 2023 07:43
PostgreSQL and Pgpool Architecture

Hey! I saw this has been indexed by the search engines. It is a first draft of a post I ended up publishing on my blog at: Scaling PostgreSQL With Pgpool and PgBouncer

Thanks for stopping by!

PostgreSQL and Pgpool Architecture