Skip to content

Instantly share code, notes, and snippets.

View crunchywelch's full-sized avatar
💭
floundering around crying and clutching my things

Aaron Welch crunchywelch

💭
floundering around crying and clutching my things
View GitHub Profile
@crunchywelch
crunchywelch / cloud-config.yml
Last active April 1, 2016 22:11
This is a basic example of userdata to pootstrap into an etcd cluster
#cloud-config
coreos:
etcd2:
# generate a new token for each unique cluster from https://discovery.etcd.io/new?size=3
# specify the initial size of your cluster with ?size=X
discovery: https://discovery.etcd.io/<token>
# multi-region and multi-cloud deployments need to use $public_ipv4
advertise-client-urls: http://$private_ipv4:2379,http://$private_ipv4:4001
initial-advertise-peer-urls: http://$private_ipv4:2380
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAo2AptpeHO53KoVwfnOG+aHUQkXlE0Y4GUmtLdP2ofV+GnJsEnmbQNi0FRQT4qeHmdKH2caYbQh275QB8e6ROJdgEO97AaHCJ2XaGI8Eq3AqIfzuUE2lDW2k1ck/94GXVTCzDNtBf5FVVP51RxlxNgSSwkBRh2SoiezoOr/uClGoBvEM0tSDChVINkl4Sq73hVeOc2gT+ehag9kx+hv4FMvrMTJJ5WvdBwfKaWniQWcsOE61ae4vaPPMs9a8wyQ3gC9m8Y7Nsi8ylJYpC+wPzwVm/TZUaVe58r8N2kecgPMUhUD9ySwMOnIOGn4zZxcRJR4vTzbOhwQ3wImqugajpCw== welch@tzara
package main
import (
"os"
"fmt"
"flag"
"errors"
"github.com/packethost/packngo"
)
provider "packet" {
auth_token = "${var.packet_api_key}"
}
resource "packet_device" "dcos_bootstrap" {
hostname = "${format("mesos-bootstrap-%02d.example.com", count.index + 1)}"
operating_system = "coreos_beta"
plan = "${var.dcos_bootstrap_plan}"
variable "packet_api_key" {
default = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
variable "packet_project_id" {
default = "xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
variable "packet_facility" {
default = "ewr1"
git checkout --orphan latest_branch
git add -A
git commit -am "commit message"
git branch -D master
git branch -m master
git push -f origin master
source: http://stackoverflow.com/questions/13716658/how-to-delete-all-commit-history-in-github
#!/bin/bash
echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" > /etc/apt/sources.list.d/docker.list && \
echo "deb https://clusterhq-archive.s3.amazonaws.com/ubuntu/14.04/$(ARCH)" > /etc/apt/sources.list.d/flocker.list && \
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys F76221572C52609D && \
apt-get update && \
apt-get -y install --force-yes docker-engine clusterhq-flocker-node clusterhq-flocker-docker-plugin && \
service flocker-control start && ufw allow flocker-control-api && ufw allow flocker-control-agent
#!/bin/bash
echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" > /etc/apt/sources.list.d/docker.list && \
echo "deb https://clusterhq-archive.s3.amazonaws.com/ubuntu/14.04/\$(ARCH) /" > /etc/apt/sources.list.d/flocker.list && \
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys F76221572C52609D && \
apt-get update && \
apt-get -y install --force-yes docker-engine clusterhq-flocker-node clusterhq-flocker-docker-plugin && \
grep -q '^flocker-control-api' /etc/services && \
#!/bin/bash
echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" > /etc/apt/sources.list.d/docker.list && \
echo "deb https://clusterhq-archive.s3.amazonaws.com/ubuntu/14.04/\$(ARCH) /" > /etc/apt/sources.list.d/flocker.list && \
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys F76221572C52609D && \
apt-get update && \
apt-get -y install --force-yes docker-engine clusterhq-flocker-node clusterhq-flocker-docker-plugin && \
service flocker-dataset-agent start && service flocker-container-agent start && service flocker-docker-plugin restart
LOCALIP=`curl -sSL https://metadata.packet.net/2009-04-04/meta-data/local-ipv4`
deb [arch=amd64] http://mirror.ewr1.packet.net/ubuntu trusty main universe
deb [arch=amd64] http://mirror.ewr1.packet.net/ubuntu trusty-updates main universe
deb [arch=amd64] http://mirror.ewr1.packet.net/ubuntu trusty-security main universe