Skip to content

Instantly share code, notes, and snippets.

View ianblenke's full-sized avatar
🎯
Focusing

Ian Blenke ianblenke

🎯
Focusing
View GitHub Profile
@ianblenke
ianblenke / gist:8aac408c3096a5256998
Created February 13, 2015 21:07
Find the CoreOS etcd leader
docker pull realguess/jq > /dev/null 2>&1 ; curl -sL http://127.0.0.1:7001/v2/admin/machines | docker run -i realguess/jq jq 'map(select(.state == "leader")) | .[].clientURL'
@ianblenke
ianblenke / nxlog.conf
Created February 20, 2015 22:59
nxlog directly to elasticsearch
## This is a sample configuration file. See the nxlog reference manual about the
## configuration options. It should be installed locally and is also available
## online at http://nxlog.org/nxlog-docs/en/nxlog-reference-manual.html
## Please set the ROOT to the folder your nxlog was installed into,
## otherwise it will not start.
#define ROOT C:\Program Files\nxlog
define ROOT C:\Program Files (x86)\nxlog
@ianblenke
ianblenke / gist:67e82cc95e924b961d32
Created February 23, 2015 16:37
loading virtio drivers in windows recovery
for %f in (d:\win7\x86\*.inf) do drvload %f
dism /image:c:\ /add-driver /Driver:D:\win7\x86\ /recurse
dism /image:E:\ /add-driver /Driver:D:\win7\x86\ /recurse
@ianblenke
ianblenke / Makefile
Last active August 29, 2015 14:16
Download the latest list of AWS AMIs for CoreOS by channel and virtualization (pv or hvm)
curl http://alpha.release.core-os.net/amd64-usr/current/coreos_production_ami_all.json
curl http://beta.release.core-os.net/amd64-usr/current/coreos_production_ami_all.json
curl http://stable.release.core-os.net/amd64-usr/current/coreos_production_ami_all.json
@ianblenke
ianblenke / gist:7404ec5c4c39010dcfa9
Last active August 29, 2015 14:16
Installing deis 1.3.1 locally on a coreos node with deisctl
#!/bin/bash
# http://deis.io/get-deis/
set -eo pipefail
[[ -n "$SSH_AUTH_SOCK" ]] || ( echo Make sure you have your ssh agent forwarded; false )
if fleetctl list-units | grep deis ; then
echo "Deis units are already in fleet"
else
# This ssh chicanery is probably overkill, so long as we have SSH_AUTH_SOCK access to an ssh-agent with private key trust to the machines
# Trust all of the member coreos machine's hostkeys
(fleetctl list-machines -fields=ip -no-legend | xargs -l1 -i% ssh-keyscan -t ed25519 % 2>/dev/null; cat ~/.ssh/known_hosts ) | sort | uniq > ~/.ssh/known_hosts
@ianblenke
ianblenke / gist:039239d856554a213032
Last active August 29, 2015 14:16
Building a custom deis-router image and using it
git config --global push.default simple
git clone [email protected]:ianblenke/deis ianblenke-deis
cd ianblenke-deis/router
git checkout -b ianblenke/router
cd router
cp -pR ../Godeps .
docker build -t router-build .
docker cp `docker run -d router-build`:/nginx.tgz image/
docker cp `docker run -d router-build`:/go/bin/boot image/bin/
docker build -t deis/router:ianblenke image
@ianblenke
ianblenke / Makefile
Created February 26, 2015 05:28
Download Bonjour.msi from iTunes 12 for Windows
Bonjour.msi: iTunesSetup.exe
which 7z || \
( which brew && brew install p7zip || \
which apt-get && sudo apt-get -y install p7zip || \
which choco && choco install 7zip )
7z x iTunesSetup.exe
touch $@
iTunesSetup.exe:
curl -o iTunesSetup.exe 'https://secure-appldnld.apple.com/itunes12/031-17457.20150218.FFCRg/iTunesSetup.exe'
@ianblenke
ianblenke / myapp.tf
Last active August 29, 2015 14:16
An older translation of the Deis CloudFormation template into TerraForm syntax
variable "aws_access_key" {
description = "The AWS_ACCESS_KEY_ID to use"
}
variable "aws_secret_key" {
description = "The AWS_SECRET_ACCESS_KEY to use"
}
provider "aws" {
access_key = "${var.aws_access_key}"
@ianblenke
ianblenke / gist:323fbbf2607500736443
Created March 1, 2015 07:56
Update the discovery URL in a CoreUS user-data file
eval sed -i -e "'s%discovery: .*\$%discovery: $(echo -n $(curl -sL https://discovery.etcd.io/new))%'" user-data
@ianblenke
ianblenke / dies.cloud-init
Created March 3, 2015 21:08
Alias dies to deis
#cloud-config
write_files:
- path: /etc/profile.d/dies.sh
permissions: 0644
owner: root
content: |
alias dies=deis