Skip to content

Instantly share code, notes, and snippets.

View drnic's full-sized avatar
🏆
Platinum Status Level

Dr Nic Williams drnic

🏆
Platinum Status Level
View GitHub Profile
@drnic
drnic / stannis.yml
Created August 20, 2015 16:07
t2.micro/t2.small erroring
compilation:
cloud_properties:
instance_type: m3.medium
network: agent1
reuse_compilation_vms: true
workers: 6
director_uuid: 6f4651e3-2fe6-4ce8-851c-xxxxxxxx
jobs:
- instances: 1
name: agent
@drnic
drnic / slack-from-repo.out
Created July 18, 2015 14:00
dynamic slack message demo
This static message came from a Gist

Keybase proof

I hereby claim:

  • I am drnic on github.
  • I am drnic (https://keybase.io/drnic) on keybase.
  • I have a public key whose fingerprint is 579B 1C80 9EDB CBED 8B86 9BDC 0B92 A265 A092 1641

To claim this, I am signing this object:

@drnic
drnic / nats.sh
Created June 17, 2015 14:46
Target current BOSH's current CF manifest and run nats CLI on its nats configuration
#!/bin/bash
# Assumes using nats CLI from https://github.com/soutenniza/nats/releases
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
cd $DIR/..
bosh_target=$(cat .bosh_config | yaml2json | jq -r ".target")
manifest=$(cat .bosh_config | yaml2json | jq -r ".deployment[\"$bosh_target\"]")
mbus=$(cat $manifest | yaml2json | jq -r '.properties.nats | "nats://\(.user):\(.password)@\(.address):\(.port)"')
@drnic
drnic / manifest_use_dns.rb
Created June 5, 2015 19:06
Convert a BOSH manifest using Static IP networks into using DHCP "dynamic" networking + DNS hostnames - extracted from bosh-workspace
#!/usr/bin/env ruby
manifest = ARGV[0]
domain_name = ARGV[1] || "microbosh"
def err(msg)
$stderr.puts(msg)
exit 1
end
@drnic
drnic / Gemfile
Last active August 29, 2015 14:22
Script to recreate docker containers to fix the host port to the current dynamically assigned port
source "https://rubygems.org"
gem "docker-api"
@drnic
drnic / rebind-apps.rb
Created May 22, 2015 22:12
Rebind all applications for a Cloud Foundry service
#!/usr/bin/ruby
require 'rubygems'
require 'json'
require 'pp'
# for the #sh helper
require "rake"
require "rake/file_utils"
include FileUtils
## PREREQ: Using CF cli tools, make sure you've logged in as a user (admin) who can see all orgs/spaces
@drnic
drnic / concourse.yml
Created May 20, 2015 04:58
LB + 2 ATC
---
name: concourse
director_uuid: <%= `bosh status --uuid` %>
releases:
- name: concourse
version: latest
- name: garden-linux
version: latest
$ fly -t tutorial execute -c task_hello_world.yml
2015/05/05 10:18:52 bad response when creating pipe: &{301 Moved Permanently 301 HTTP/1.1 1 1 map[Date:[Tue, 05 May 2015 17:18:52 GMT] Content-Length:[0] Content-Type:[text/plain; charset=utf-8] Location:[/api/v1/pipes] Set-Cookie:[ATC-Authorization=Basic Og==; Path=/; Expires=Tue, 05 May 2015 17:19:52 UTC]] 0x208736f00 0 [] false map[] 0x208716a90 <nil>}
HTTP/1.1 301 Moved Permanently
Content-Length: 0
Content-Type: text/plain; charset=utf-8
Date: Tue, 05 May 2015 17:18:52 GMT
Location: /api/v1/pipes
Set-Cookie: ATC-Authorization=Basic Og==; Path=/; Expires=Tue, 05 May 2015 17:19:52 UTC
jobs:
- name: bad
public: true
serial: true
plan:
- put: unknown