Skip to content

Instantly share code, notes, and snippets.

View brianredbeard's full-sized avatar

redbeard brianredbeard

View GitHub Profile
@brianredbeard
brianredbeard / delete_vpc.py
Created August 28, 2017 18:03
Trying out something to delete annoying VPCs
#!/usr/bin/env python
import boto3
import logging
import sys
from pprint import pprint
from time import sleep
import botocore.exceptions
@brianredbeard
brianredbeard / get_token.md
Last active October 3, 2022 02:18
aws, sts, and bash

About

AWS provides a mechanism for temporarily assuming another role within their API system. While it is not a technically hard process it can be convoluted and hard to understand. This document aims to both make it easier to follow along with as well as give an in depth explanation of some of the underpinnings of the Bourne Again Shell (aka BASH) which can make this easier to utilize on a day to day basis.

Explanation

Below is an overexplained version of the following process:

  1. Using credentials stored in ~/.aws/credentials as a "profile" which are then understood by the AWS command line tools
  2. Using those AWS credentials, temporarily assume a role using the AWS Security Token Service (STS) to get temporary
@brianredbeard
brianredbeard / ifcfg-br0
Last active April 23, 2017 19:26
network configs for a vm-bridge on fedora
# /etc/sysconfig/network-scripts/ifcfg-br0
UUID=1d0ce809-703f-452b-910a-50267d8da44f
TYPE=Bridge
NM_CONTROLLED=yes
BOOTPROTO=none
NAME=br0
DEVICE=br0
ONBOOT=yes
TYPE=Ethernet
STP=no
@brianredbeard
brianredbeard / upgrade_unifi.sh
Last active September 21, 2016 02:17 — forked from stevejenkins/upgrade_unifi.sh
Easy UniFi Controller Upgrade Script for Unix/Linux Systems
#!/bin/sh
# upgrade_unifi.sh
# Easy UniFi Controller Upgrade Script for Unix/Linux Systems
# by Steve Jenkins (stevejenkins.com)
# Version 2.0
# Last Updated July 2, 2016
# REQUIREMENTS
# 1) Assumes you already have any version of UniFi Controller installed
@brianredbeard
brianredbeard / 00_popcorn_tofu.md
Last active April 23, 2024 23:57
Wheatsville Popcorn Tofu and Cashew Tamari Dressing

Popcorn Tofu

As reverse engineered from Wheatsville Co-op, Austin, TX

About

After a bit of hunting far and wide I have achieved success. For anyone who's been to Wheatsville Co-op in Austin, Texas knows that it's the bomb. It's received enough of a following that it has it's own Facebook page. The problem is that it's a closely guarded secret with only sparse smatterings of it to be found. At one point I found a recipe in a book

#!/usr/bin/env bash
set -e
# Set default values
: ${GENTOO_ARCH:=amd64}
: ${GENTOO_PROFILE:=""}
: ${GENTOO_PORTAGE:=no}
# Check for Gentoo profile, if there if a profile, add a "-"
if [ "${GENTOO_PROFILE}x" != "x" ]; then
@brianredbeard
brianredbeard / generate_etcd_dropins.sh
Last active December 16, 2015 23:59
Generation of etcd dropins based on a list of ip addresses
#!/bin/bash
#
# usage: ./generate_etcd.sh 10.240.0.14 10.240.0.12 10.240.0.13
# output is in /tmp
for ipaddr in "$@"
do
let count+=1
peerlist="${peerlist},infra${count}=http://${ipaddr}:2380"
done
@brianredbeard
brianredbeard / gist:dea1337f34cfdd76326f
Last active August 29, 2015 14:20
sample cloud-config for DO
#cloud-config
coreos:
units:
- name: etcd.service
command: restart
- name: fleet.service
command: restart
etcd:
@brianredbeard
brianredbeard / gin_and_tonic.md
Last active December 10, 2021 16:54
Tonic Recipe
@brianredbeard
brianredbeard / halfass.sh
Created February 3, 2015 01:46
half assed password tool. this gives you 20 randomized alpha number passwords with NATO phonetics and no confusing characters
alias passthing="curl -s -L 'https://secure.pctools.com/guides/password/?length=13&phonetic=on&alpha=on&mixedcase=on&numeric=on&nosimilar=on&quantity=20&generate=true#password_generator' | grep \"<tr><td valign=top nowrap style='border: 1px solid #c5c5c7;padding-top:3px;padding-bottom:3px'><b>\" | sed -r 's/<tr><td valign=top nowrap style=.border: 1px solid #c5c5c7;padding-top:3px;padding-bottom:3px.><b>([[:alnum:]]+)<.b><.td><td valign=top style=.border: 1px solid #c5c5c7;padding-top:3px;padding-bottom:3px.><i>([-a-zA-Z \(\)]+)<.i><.td><.tr>/\1 \2/g'"