Skip to content

Instantly share code, notes, and snippets.

View sepulworld's full-sized avatar
🤘

Zane Williamson sepulworld

🤘
View GitHub Profile
# This is the default .slate file.
# If no ~/.slate file exists this is the file that will be used.
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
# Resize Bindings
bind right:alt resize +10% +0
bind left:alt resize -10% +0
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'tpope/vim-fugitive'
Bundle 'tpope/vim-markdown'
Bundle 'vim-scripts/FuzzyFinder'
@sepulworld
sepulworld / keybase.md
Created June 25, 2016 14:42
keybase.md

Keybase proof

I hereby claim:

  • I am sepulworld on github.
  • I am zanewilliamson (https://keybase.io/zanewilliamson) on keybase.
  • I have a public key whose fingerprint is 0A3E C1FE 6EE7 C501 0D7B 27BB F9A3 AD35 CC6E 0286

To claim this, I am signing this object:

@sepulworld
sepulworld / aptly-cli-docker.sh
Last active October 19, 2016 17:06
Docker Aptly-cli run
alias aptly-cli='\
docker run \
-v ~/.config/aptly-cli/aptly-cli.conf:/etc/aptly-cli.conf \
-it --rm --name=aptly-cli \
sepulworld/aptly-cli'
@sepulworld
sepulworld / service-watchdog.service
Created September 2, 2016 18:30
Watchdog systemd unit
[Unit]
Description=service-watchdog for custom app, report to aws autoscaling group
Requires=fetch-tweets.service
After=fetch-tweets.service
[Service]
User=root
ExecStart=/usr/local/bin/service-watchdog fetch-tweets us-west-2
[Install]
@sepulworld
sepulworld / example_aws_iam_policy_asg_access.tf
Created September 2, 2016 18:35
Autoscaling Group policy access
resource "aws_iam_policy" "AutoScaleGroupAccess" {
name = "AutoScaleGroup-${var.service_name}-${var.environment}"
description = "Autoscaling Group Access ${var.service_name}-${var.environment}"
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
@sepulworld
sepulworld / service-watchdog.sh
Created September 2, 2016 19:01
Service-watchdog
#!/bin/bash
# First arg should be the systemd service to watch
# Requires cloud-utils apt package and pip awscli
# Requires IAM access to IAM action autoscaling:SetInstanceHealth
EC2_INSTANCE_ID=$(ec2metadata --instance-id)
PROCESS_CHECK=$1
REGION=$2
while :
@sepulworld
sepulworld / asg.tf
Last active September 2, 2016 19:35
Terraform ASG and Launch Config
resource "aws_launch_configuration" "lc" {
lifecycle { create_before_destroy = true }
image_id = "${var.ami_version}"
instance_type = "${var.instance_type}"
iam_instance_profile = "${var.service_name}-${var.environment}"
key_name = "${var.key_name}"
security_groups = ["${aws_security_group.sg1.id}"]
user_data = "user-data.sh"
@sepulworld
sepulworld / tfenv.rb
Created September 11, 2016 21:33
Chef to setup tfenv on Jenkins
execute 'apt-get update'
package ['unzip']
git '/var/lib/jenkins/tfenv' do
repository 'https://github.com/kamatama41/tfenv.git'
revision 'master'
action :sync
user 'jenkins'
group 'jenkins'
curl 127.0.0.1:9292/tfsoa/add_tf_state -H "Content-Type: application/json" -X \
POST -d '{"role_arn": "arn:aws:iam::357170183134:role/s3read","s3_bucket_name": "terraform-autozane-remote-state","s3_bucket_key": "autozane_kafka_awslogs_cloudwatch/promotion/Terraform"}'
curl 127.0.0.1:9292/tfsoa/add_tf_state -H "Content-Type: application/json" -X \
POST -d '{"role_arn": "arn:aws:iam::357170183134:role/s3read","s3_bucket_name": "terraform-autozane-remote-state","s3_bucket_key": "autozane_aptly_awslogs_cloudwatch/promotion/Terraform"}'
curl 127.0.0.1:9292/tfsoa/add_tf_state -H "Content-Type: application/json" -X \
POST -d '{"role_arn": "arn:aws:iam::357170183134:role/s3read","s3_bucket_name": "terraform-autozane-remote-state","s3_bucket_key": "golang-app-dev/promotion/Terraform"}'
curl 127.0.0.1:9292/tfsoa/add_tf_state -H "Content-Type: application/json" -X \