Skip to content

Instantly share code, notes, and snippets.

Mat Schaffer matschaffer

Block or report user

Report or block matschaffer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View reindex_year.yaml
actions:
1:
action: reindex
description: Reindex 2017 indices to single index
options:
wait_interval: 9
max_wait: -1
request_body:
source:
index: REINDEX_SELECTION
@matschaffer
matschaffer / get_solution_stack_name.sh
Last active Feb 7, 2019
A script for pulling an elasticbeanstalk solution name for a given runtime version
View get_solution_stack_name.sh
#!/usr/bin/env bash
set -euo pipefail
MINOR_VERSION=$(awk -F. '{print $1 "." $2}' $(dirname $0)/../.ruby-version)
NAME_FILTER="{\"Type\":\"PlatformName\",\"Operator\":\"begins_with\",\"Values\":[\"Puma with Ruby ${MINOR_VERSION}\"]}"
VERSION_FILTER='{"Type":"PlatformVersion","Operator":"=","Values":["latest"]}'
PLATFORM_ARN=$(
aws elasticbeanstalk list-platform-versions \
View bottles.rb
class Bottles
def word_part(n)
case n
when 0
"no more bottles"
when 1
"1 bottle"
else
"#{n} bottles"
end
@matschaffer
matschaffer / api_demo.py
Created Aug 7, 2018
A python example uploading and submitting a safecast drive
View api_demo.py
import sys
import requests
import os
endpoint = os.environ.get("SAFECAST_API", "https://api.safecast.org")
api_key = os.environ.get("SAFECAST_API_KEY")
if len(sys.argv) != 2:
print("Usage: {} <LOGFILE>".format(sys.argv[0]), file=sys.stderr)
@matschaffer
matschaffer / Makefile
Created Apr 13, 2018
Terraform makefile
View Makefile
SHELL = /bin/bash
terraform_opts ?=
terraform_plan_opts ?=
.PHONY: help
help::
@echo
@echo Infrastructure management using Terraform.
@echo
@matschaffer
matschaffer / .gitignore
Last active Nov 22, 2017
A demo tree for basic ECE installation on GCP
View .gitignore
.terraform
*.tfstate*
terraform.tfvars
bootstrap-secrets.json
View renderer-571673.log
[06/02/17, 15:15:44:796] error: WebView: Renderer crash occurred in webView: {"src":"https://REDACTED.slack.com/messages"}
[06/02/17, 15:15:44:797] info: Store: RELOAD
{ everything: true }
View thingie.tf
# happy comment
resource "foo" "bar" {
}
// red angry comment
resource "foo" "bar" {
}
@matschaffer
matschaffer / Makefile
Last active Oct 29, 2016
terraform makefile base
View Makefile
include ../../../common/Makefile.base
View gist:a3707be5bdc6de60fbbd50710d4f4644
data "aws_vpc" "common" {
filter {
name = "tag:Name"
values = ["common"]
}
}
data "aws_subnet" "common" {
count = "${var.availability_zone_count}"
vpc_id = "${data.aws_vpc.common.id}"
You can’t perform that action at this time.