Skip to content

Instantly share code, notes, and snippets.

View andyspicer's full-sized avatar

Andy Spicer andyspicer

View GitHub Profile
@andyspicer
andyspicer / onchange.sh
Created October 22, 2016 02:45 — forked from senko/onchange.sh
Watch current directory and execute a command if anything in it changes
#!/bin/bash
#
# Watch current directory (recursively) for file changes, and execute
# a command when a file or directory is created, modified or deleted.
#
# Written by: Senko Rasic <[email protected]>
#
# Requires Linux, bash and inotifywait (from inotify-tools package).
#
# To avoid executing the command multiple times when a sequence of
@andyspicer
andyspicer / gist:209635a1869a957c72e16ae1d5b4b9a5
Created October 30, 2016 00:00 — forked from dweeber/gist:3748975
Bash script uses vcgencmd on Raspberry Pi with bc to calculate F value of Temp
#!/bin/bash
######################################################################
# Raspberry Pi
#
# Gross Script by Dweeber (Kevin Reed) <[email protected]>
# V1.0 2012-09-19
#
# Use the vcgencmd to obtain the Temp of the SOC
# then calculates the F value using bc.
#
@andyspicer
andyspicer / pedantically_commented_playbook.yml
Created November 14, 2016 15:06 — forked from marktheunissen/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@andyspicer
andyspicer / service-checklist.md
Created November 14, 2016 15:07 — forked from marktheunissen/service-checklist.md
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
#!/usr/bin/env bash
# Script to reverse engineer the build of a given Debian / Ubuntu server
# I do this all the time: take an existing server, create a Bash / Ansible / Puppet / Chef
# built script, to allow Continuous Depoyment.
# It's tedious, but this script will give you the basics to get started.
# Make sure you have "sudo" access to get all the details.
# setup folders
@andyspicer
andyspicer / install.sh
Last active December 23, 2017 21:17 — forked from mkubenka/install.sh
OpenVPN Access Server Letsencrypt
#!/bin/sh
apt-get -y install git bc
git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
mkdir /etc/letsencrypt

Keybase proof

I hereby claim:

  • I am andyspicer on github.
  • I am andyspicer (https://keybase.io/andyspicer) on keybase.
  • I have a public key ASDoIGGW0SpapXFqAryeupqbK7RYObU3ev-0M_I-2Kx6mwo

To claim this, I am signing this object:

@andyspicer
andyspicer / docker-swarm-ports.md
Created August 14, 2017 04:17 — forked from BretFisher/docker-swarm-ports.md
Docker Swarm Port Requirements, both Swarm Mode 1.12+ and Swarm Classic, plus AWS Security Group Style Tables

Docker Swarm Mode Ports

Starting with 1.12, Docker Swarm Mode is a built-in solution with built-in key/value store. Easier to get started, and fewer ports to configure.

Inbound Traffic for Swarm Management

  • TCP port 2377 for cluster management & raft sync communications
  • TCP and UDP port 7946 for "control plane" gossip discovery communication
  • UDP port 4789 for "data plane" VXLAN overlay network traffic

AWS Security Group Example

AWS Tip: You should use Security Groups in AWS's "source" field rather then subnets, so SG's will all dynamically update when new nodes are added.

;; Credit: Duncan Halliday https://members.iracing.com/jforum/posts/list/1925/3552959.page#11764145
;; FFB UP
#IfWinActive, ahk_exe iRacingSim64DX11.exe
6Joy23::
IfWinExist ahk_exe irFFB.exe
{
WinActivate
Sleep, 100 ;