Skip to content

Instantly share code, notes, and snippets.

View AndrewFarley's full-sized avatar

Farley Farley (yes, really) AndrewFarley

  • New Plymouth, New Zealand
View GitHub Profile
@AndrewFarley
AndrewFarley / minimum_serverless_iam_policy_for_deployment.json
Last active September 26, 2017 19:56
Minimum IAM Policy/Role Permissions to deploy Serverless.com (assuming you pre-created the deployment bucket)
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"cloudformation:Describe*",
"cloudformation:List*",
"cloudformation:Get*",
"cloudformation:PreviewStackUpdate",
provider "aws" {
region = "eu-west-1"
}
# These are inputs we need to define
variable "domain" {
default = "mydomain.com"
}
# For every VPC in here we'll associate with our internal zone
variable "vpcs" {
@AndrewFarley
AndrewFarley / prepare_repo_for_usage.py
Created February 6, 2018 22:13
Prepare a terraform directory for remote state properly in a way that is re-usable and shareable between developers, and is usable multiple times in the same region (via a different env name) and different times on different azs (because of the bucket/key naming scheme)
#!/usr/bin/env python
'''
This simple helper creates a S3 bucket for remote state usage, and
then creates a .tf file with the remote state information. This
is great for when team/pair developing on the same environment and
helps allow a stack to be able to be used on multiple accounts, or
many times on the same account (depending on the uniqueness of the
region, stack name, or env name)
Written by Farley <farley@neonsurge.com> <farley@olindata.com
@AndrewFarley
AndrewFarley / tf
Created August 11, 2016 19:34 — forked from MrPink/tf
Elasticache replication group with Cloudformation and controlled by Terraform
resource "template_file" "cf" {
vars {
cluster_name = "${var.cluster_name}"
csg_name = "${aws_elasticache_subnet_group.default_redis_sg.name}"
cluster_internal_sg_id = "${module.ecs-cluster.cluster_internal_sg_id}"
}
template = <<STACK
{
"Resources" : {
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDdSnRT/tSeI6C1/B9oguf6YM9mk/OMJkPK3gT61RPhGneCrxIB5UOxZ3eo37SkeC+cLzimiUy6FZYFL+xr2Bj+ZGi4L5TGTwQaIsQobt6kY11ph3S+o7osg/5SlzgaFvLbHFt/3g2WCNR1baZ/jwJoErjQsb364tyeVrFn6+lnX62eAAol+ewJicvXrde9MUYz9kcCt8V9Ly1jgwHme46ikSUqYbV+f5H3ijm4MZTvk5lTDg2uWo6awM4SMHfwDqz0ktk8Y1rsLqihfWB8cmBBavCqNrHckiZMgx4fZUY3mB1PbYSIVl0qc/zgKXMC9trjV2jqckoehAF3XBVhwd8z farley@thedragon2
@AndrewFarley
AndrewFarley / TaranisXLiteSimpleAnimatedGUI
Created May 19, 2018 12:35
A simple GUI / Screen for a Taranis X-Lite with animation and everything you'll ever need on it for whoopin'
-- The model name
local modelName = "Unknown"
-- I'm using 8 NiMH Batteries, which is 1.1v low, and ~1.325v high
local lowVoltage = 6.6
local currentVoltage = 8.4
local highVoltage = 8.4
-- For our timer tracking
local timerLeft = 0
local maxTimerValue = 0

Keybase proof

I hereby claim:

  • I am AndrewFarley on github.
  • I am farleyfarley (https://keybase.io/farleyfarley) on keybase.
  • I have a public key whose fingerprint is 00A1 B493 ECE1 1838 2348 51EC 4C9F 2F01 1DF0 D96A

To claim this, I am signing this object:

@AndrewFarley
AndrewFarley / all_aws_managed_policies.json
Created May 21, 2018 16:37 — forked from gene1wood/all_aws_managed_policies.json
A list of all AWS managed policies and they're policy documents as well as a short script to generate the list
{
"AWSAccountActivityAccess": {
"Arn": "arn:aws:iam::aws:policy/AWSAccountActivityAccess",
"AttachmentCount": 0,
"CreateDate": "2015-02-06T18:41:18+00:00",
"DefaultVersionId": "v1",
"Document": {
"Statement": [
{
"Action": [
@AndrewFarley
AndrewFarley / macos-recovery-server.md
Created May 25, 2018 10:29
Fixing "The recovery server could not be contacted" in MacOS High Sierra

I was trying to reinstall High Sierra on an older MacBook Air using internet recovery and I kept on getting an error message when trying to reinstall High Sierra.

The recovery server could not be contacted

It appears that this has to do with the time on the machine not being synchronized, so when the MacBook tries to reach out to the recovery server the certificates do not validate and we get this useless error message.

To fix this.

  1. Open up a Terminal from the utilities menu
  2. Enter the following command
@AndrewFarley
AndrewFarley / autossh.service
Created May 30, 2018 08:44 — forked from thomasfr/autossh.service
Systemd service for autossh
[Unit]
Description=Keeps a tunnel to 'remote.example.com' open
After=network.target
[Service]
User=autossh
# -p [PORT]
# -l [user]
# -M 0 --> no monitoring
# -N Just open the connection and do nothing (not interactive)