Skip to content

Instantly share code, notes, and snippets.

Avatar
🧡

Mat Schaffer matschaffer

🧡
View GitHub Profile
@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}"
@matschaffer
matschaffer / haproxy.log
Created May 16, 2016
haproxy log & mtail script with buckets
View haproxy.log
2016-05-10T08:13:03+00:00 localhost haproxy[21]: 192.168.99.1:52177 [10/May/2016:08:12:58.762] http-in webapp-http/webapp 0/0/0/5003/5003 200 185 - - ---- 1/1/1/1/0 0/0 "GET / HTTP/1.1"
2016-05-10T08:13:03+00:00 localhost haproxy[21]: 192.168.99.1:52178 [10/May/2016:08:12:58.916] http-in webapp-http/webapp 0/0/0/5002/5002 200 185 - - ---- 0/0/0/0/0 0/0 "GET / HTTP/1.1"
2016-05-10T08:49:25+00:00 localhost haproxy[21]: 192.168.99.1:53129 [10/May/2016:08:49:20.815] http-in webapp-http/webapp 161/0/1/5006/5168 200 185 - - ---- 0/0/0/0/0 0/0 "GET / HTTP/1.1"
2016-05-10T08:49:32+00:00 localhost haproxy[21]: 192.168.99.1:53131 [10/May/2016:08:49:27.270] http-in webapp-http/webapp 163/0/0/5005/5168 200 185 - - ---- 0/0/0/0/0 0/0 "GET / HTTP/1.1"
2016-05-16T00:30:59+00:00 localhost haproxy[20]: Proxy http-in started.
2016-05-16T00:32:42+00:00 localhost haproxy[20]: Proxy http-in started.
2016-05-16T00:32:56+00:00 localhost haproxy[21]: 192.168.99.1:52781 [16/May/2016:00:32:51.524] http-in webapp-http/webapp 175/0/1/50
View histogram_idea.mtail
$tt <= 1 {
haproxy_frontend_total_time_milliseconds_bucket[$frontend_name][".001"]++
}
$tt <= 2 {
haproxy_frontend_total_time_milliseconds_bucket[$frontend_name][".002"]++
}
$tt <= 3 {
haproxy_frontend_total_time_milliseconds_bucket[$frontend_name][".003"]++
}
$tt <= 5 {
@matschaffer
matschaffer / bastion.config
Last active Feb 12, 2016
ebextensions config to make an app into a viable bastion host - handy if you have an "admin" app aside from your main app
View bastion.config
option_settings:
aws:elb:loadbalancer:
SecurityGroups:
- (ID of externally created security group with controlled SSH inbound access)
ManagedSecurityGroup: (same SG as above)
aws:elb:listener:22:
ListenerProtocol: TCP
InstanceProtocol: TCP
InstancePort: 22
aws:elb:policies:
View .gitconfig
[alias]
outdated = "!f() { bash -c 'diff -u <(git branch --no-merged master) <(git branch --contains master) | egrep \"^- \"'; }; f"
update = "!f() { set -e; git checkout $1; git rebase master; git push -f origin $1; git checkout -; }; f"