Skip to content

Instantly share code, notes, and snippets.

View lkysow's full-sized avatar
👋

Luke Kysow lkysow

👋
View GitHub Profile
@lkysow
lkysow / instructions.md
Created May 25, 2022 18:48
Consul: Up & Running - Vagrant on M1 Mac/Apple Silicon Instructions
@lkysow
lkysow / main.tf
Created March 4, 2018 06:51
Medium - Static site using Terraform - Root Domain
resource "aws_s3_bucket" "root" {
bucket = "${var.root_domain_name}"
acl = "public-read"
policy = <<POLICY
{
"Version":"2012-10-17",
"Statement":[
{
"Sid":"AddPerm",
"Effect":"Allow",
@lkysow
lkysow / main.tf
Last active March 4, 2018 07:26
Medium - Static site using Terraform - DNS
// We want AWS to host our zone so its nameservers can point to our CloudFront
// distribution.
resource "aws_route53_zone" "zone" {
name = "${var.root_domain_name}"
}
// This Route53 record will point at our CloudFront distribution.
resource "aws_route53_record" "www" {
zone_id = "${aws_route53_zone.zone.zone_id}"
name = "${var.www_domain_name}"
@lkysow
lkysow / main.tf
Created March 4, 2018 06:49
Medium - Static site using Terraform - CloudFront
resource "aws_cloudfront_distribution" "www_distribution" {
// origin is where CloudFront gets its content from.
origin {
// We need to set up a "custom" origin because otherwise CloudFront won't
// redirect traffic from the root domain to the www domain, that is from
// runatlantis.io to www.runatlantis.io.
custom_origin_config {
// These are all the defaults.
http_port = "80"
https_port = "443"
@lkysow
lkysow / main.tf
Created March 4, 2018 06:48
Medium - Static site using Terraform - ACM
// Use the AWS Certificate Manager to create an SSL cert for our domain.
// This resource won't be created until you receive the email verifying you
// own the domain and you click on the confirmation link.
resource "aws_acm_certificate" "certificate" {
// We want a wildcard cert so we can host subdomains later.
domain_name = "*.${var.root_domain_name}"
validation_method = "EMAIL"
// We also want the cert to be valid for the root domain even though we'll be
// redirecting to the www. domain immediately.
@lkysow
lkysow / main.tf
Created March 4, 2018 06:46
Medium - Static site using Terraform - S3
resource "aws_s3_bucket" "www" {
// Our bucket's name is going to be the same as our site's domain name.
bucket = "${var.www_domain_name}"
// Because we want our site to be available on the internet, we set this so
// anyone can read this bucket.
acl = "public-read"
// We also need to create a policy that allows anyone to view the content.
// This is basically duplicating what we did in the ACL but it's required by
// AWS. This post: http://amzn.to/2Fa04ul explains why.
policy = <<POLICY
@lkysow
lkysow / main.tf
Last active March 4, 2018 06:46
Medium - Static site using Terraform - Initial Setup
// This block tells Terraform that we're going to provision AWS resources.
provider "aws" {
region = "us-east-1"
}
// Create a variable for our domain name because we'll be using it a lot.
variable "www_domain_name" {
default = "www.runatlantis.io"
}
@lkysow
lkysow / linkerd-null-pointer.md
Last active April 17, 2017 22:17
linkerd-null-pointer

Linkerd 0.9.0

-XX:+AggressiveOpts -XX:+CMSClassUnloadingEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled -XX:+CMSScavengeBeforeRemark -XX:InitialHeapSize=33554432 -XX:MaxHeapSize=2147483648 -XX:MaxNewSize=697933824 -XX:MaxTenuringThreshold=6 -XX:OldPLABSize=16 -XX:+PrintCommandLineFlags -XX:+ScavengeBeforeFullGC -XX:-TieredCompilation -XX:+UseCMSInitiatingOccupancyOnly -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+UseStringDeduplication 
Apr 17, 2017 9:47:38 PM com.twitter.finagle.http.HttpMuxer$$anonfun$4 apply
INFO: HttpMuxer[/admin/metrics.json] = com.twitter.finagle.stats.MetricsExporter(<function1>)
Apr 17, 2017 9:47:38 PM com.twitter.finagle.http.HttpMuxer$$anonfun$4 apply
INFO: HttpMuxer[/admin/per_host_metrics.json] = com.twitter.finagle.stats.HostMetricsExporter(<function1>)
I 0417 21:47:38.732 UTC THREAD1: linkerd 0.9.0 (rev=a3f5854916e1796b4096512318ee36d55825999d) built at 20170222-135643
I 0417 21:47:38.915 
{
"goalTreeString": "{\"branches\":{\"master\":{\"target\":\"C4\",\"id\":\"master\",\"remoteTrackingBranchID\":null},\"hoot\":{\"target\":\"C3\",\"id\":\"hoot\",\"remoteTrackingBranchID\":null}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"},\"C2\":{\"parents\":[\"C1\"],\"id\":\"C2\"},\"C3\":{\"parents\":[\"C2\"],\"id\":\"C3\"},\"C4\":{\"parents\":[\"C1\",\"C3\"],\"id\":\"C4\"}},\"tags\":{},\"HEAD\":{\"target\":\"master\",\"id\":\"HEAD\"}}",
"solutionCommand": "git checkout master;git merge hoot --no-ff",
"startTree": "{\"branches\":{\"master\":{\"target\":\"C1\",\"id\":\"master\",\"remoteTrackingBranchID\":null},\"hoot\":{\"target\":\"C3\",\"id\":\"hoot\",\"remoteTrackingBranchID\":null}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"},\"C2\":{\"parents\":[\"C1\"],\"id\":\"C2\"},\"C3\":{\"parents\":[\"C2\"],\"id\":\"C3\"}},\"tags\":{},\"HEAD\":{\"target\":\"hoot\",\"id\
{
"goalTreeString": "%7B%22branches%22%3A%7B%22master%22%3A%7B%22target%22%3A%22C1%22%2C%22id%22%3A%22master%22%2C%22remoteTrackingBranchID%22%3Anull%7D%2C%22mybranch%22%3A%7B%22target%22%3A%22C6%22%2C%22id%22%3A%22mybranch%22%2C%22remoteTrackingBranchID%22%3Anull%7D%2C%22friend%22%3A%7B%22target%22%3A%22C5%22%2C%22id%22%3A%22friend%22%2C%22remoteTrackingBranchID%22%3Anull%7D%7D%2C%22commits%22%3A%7B%22C0%22%3A%7B%22parents%22%3A%5B%5D%2C%22id%22%3A%22C0%22%2C%22rootCommit%22%3Atrue%7D%2C%22C1%22%3A%7B%22parents%22%3A%5B%22C0%22%5D%2C%22id%22%3A%22C1%22%7D%2C%22C2%22%3A%7B%22parents%22%3A%5B%22C1%22%5D%2C%22id%22%3A%22C2%22%7D%2C%22C3%22%3A%7B%22parents%22%3A%5B%22C2%22%5D%2C%22id%22%3A%22C3%22%7D%2C%22C4%22%3A%7B%22parents%22%3A%5B%22C1%22%5D%2C%22id%22%3A%22C4%22%7D%2C%22C5%22%3A%7B%22parents%22%3A%5B%22C4%22%5D%2C%22id%22%3A%22C5%22%7D%2C%22C2%27%22%3A%7B%22parents%22%3A%5B%22C5%22%5D%2C%22id%22%3A%22C2%27%22%7D%2C%22C3%27%22%3A%7B%22parents%22%3A%5B%22C2%27%22%5D%2C%22id%22%3A%22C3%27%22%7D%2C%22C6%22%3