Skip to content

Instantly share code, notes, and snippets.

View solarce's full-sized avatar

Brandon Burton solarce

View GitHub Profile
@solarce
solarce / ec2.tf
Last active February 4, 2022 04:04
terraform.io example template for ec2 instance with tags
# The various ${var.foo} come from variables.tf
# Specify the provider and access details
provider "aws" {
region = "${var.aws_region}"
access_key = "${var.aws_access_key}"
secret_key = "${var.aws_secret_key}"
}
@solarce
solarce / terraform_ec2_clash_2014-10-19-1725.log
Last active August 29, 2015 14:07
terraform_ec2_clash_2014-10-19-1725.log -- crash from trying to use user_data with a map
2014/10/20 00:23:52 Detected home directory from env var: /root
2014/10/20 00:23:52 [DEBUG] Discoverd plugin: aws = /opt/terraform/terraform-provider-aws
2014/10/20 00:23:52 [DEBUG] Discoverd plugin: cloudflare = /opt/terraform/terraform-provider-cloudflare
2014/10/20 00:23:52 [DEBUG] Discoverd plugin: consul = /opt/terraform/terraform-provider-consul
2014/10/20 00:23:52 [DEBUG] Discoverd plugin: digitalocean = /opt/terraform/terraform-provider-digitalocean
2014/10/20 00:23:52 [DEBUG] Discoverd plugin: dnsimple = /opt/terraform/terraform-provider-dnsimple
2014/10/20 00:23:52 [DEBUG] Discoverd plugin: google = /opt/terraform/terraform-provider-google
2014/10/20 00:23:52 [DEBUG] Discoverd plugin: heroku = /opt/terraform/terraform-provider-heroku
2014/10/20 00:23:52 [DEBUG] Discoverd plugin: mailgun = /opt/terraform/terraform-provider-mailgun
2014/10/20 00:23:52 [DEBUG] Discoverd plugin: null = /opt/terraform/terraform-provider-null
# The various ${var.foo} come from variables.tf
# Specify the provider and access details
provider "aws" {
region = "${var.aws_region}"
access_key = "${var.aws_access_key}"
secret_key = "${var.aws_secret_key}"
}
@solarce
solarce / ruby_custom_string_interpol.plist
Created October 21, 2014 01:07
Add this to a .tmTheme, e.g. SpaceCadet.tmTheme to get custom highlighting for interpolated strings in ruby source code
<dict>
<key>name</key>
<string>Embedded Ruby Source</string>
<key>scope</key>
<string>string source.ruby.embedded.source</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#D01F1E</string>
</dict>
@solarce
solarce / SpaceCadet.solarce.tmTheme
Last active August 29, 2015 14:07
Customized copy of SpaceCadet.tmTheme, aka SpaceCade.solarce.tmTheme. I use it with sublimetext2. Included a custom color for "string source.ruby.embedded.source" which is what matches interpolated strings in Ruby code
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>author</key>
<string>Alex Ross</string>
<key>comment</key>
<string>Created by Alex Ross</string>
<key>name</key>
<string>SpaceCadet</string>
@solarce
solarce / terraform_apply.rb
Created October 29, 2014 19:54
example of ruby code to help drive terraform apply
#!/usr/bin/ruby
# terraform/lib/terraform.rb
require_relative 'aws'
$terraform_dir = "/opt/terraform"
$terraform_templates = "/opt/terraform_templates"
$terraform_bin = "#{$terraform_dir}/terraform"
def set_terraform_variables(network_zone, instance_name, cluster_name)
@solarce
solarce / kafka_zk.rb
Created October 31, 2014 19:34
example of using chef-search to populate zookeeper IPs for kafka
zookeeper_service_name = "lookout-zk"
zk_ips = []
log("no OVERRIDE found for zookeeper ips, autodiscovering.")
search(:node, "name:#{zookeeper_service_name}-#{mytag}-*").each do |n|
zk_ips << "#{n[:ipaddress]}:2181"
end
log("ZOOKEEPER IPS: #{zk_ips.inspect}")
node.override[:kafka][:broker][:zookeeper][:connect] = zk_ips.join(",")
@solarce
solarce / filesystems.sh
Created November 2, 2014 04:38
output show md raid1 boot, zfs raid1 /, and btrfs raid1 for docker
### mounts
[root@digderidoo ~]# mount
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
dev on /dev type devtmpfs (rw,nosuid,relatime,size=16022440k,nr_inodes=4005610,mode=755)
run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
zroot on / type zfs (rw,relatime,xattr,noacl)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
@solarce
solarce / gist:1471db076c878c9c226e
Last active August 29, 2015 14:08
docker.service failing to start on Arch Linux
3 root@malachi ~ # systemctl start docker.service :(
root@malachi ~ # systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled)
Active: failed (Result: exit-code) since Wed 2014-11-05 20:08:15 EST; 5s ago
Docs: http://docs.docker.com
Process: 5311 ExecStart=/usr/bin/docker -d -H fd:// (code=exited, status=1/FAILURE)
Main PID: 5311 (code=exited, status=1/FAILURE)
Nov 05 20:08:15 malachi docker[5311]: 2014/11/05 20:08:15 docker daemon: 1.3.1 4e9bbfa; execdriver: native; graphdriver:
@solarce
solarce / PKGBUILD
Last active August 29, 2015 14:09
A quick attempt at a PKGBUILD file for https://github.com/cloudflare/cfssl
# Maintainer: Brandon Burton [email protected]
pkgname=cfssl
pkgver=git
pkgrel=1
pkgdesc="SSL PKI Toolkit from CloudFlare"
arch=('x86_64' 'i686')
url="https://github.com/cloudflare/cfssl"
license=('BSD')
depends=('go')