Skip to content

Instantly share code, notes, and snippets.

@sykesm
sykesm / bosh-lite-admin
Last active October 26, 2015 12:35
bosh-lite-scripts
#!/bin/sh
# CF_TRACE=true cf curl -X POST -H "Content-Type: application/json" -d '{"name":"beta","non_basic_services_allowed":true,"total_services":15,"total_routes":300,"memory_limit":4096,"trial_db_allowed":true}' /v2/quota_definitions
CF=/usr/local/bin/cf
$CF api --skip-ssl-validation api.10.244.0.34.xip.io || exit 1
$CF auth admin admin || exit 1
$CF create-org playground || exit 1
$CF target -o playground || exit 1
@sykesm
sykesm / Vagrantfile
Last active August 29, 2015 14:07
Vagrantfile to bring up bosh cli and bosh-life; useful for windows users
Vagrant.configure('2') do |config|
config.vm.define "cli" do |cli|
cli.vm.box = 'hashicorp/precise64'
cli.vm.provision :shell, privileged: true, inline: $APT
cli.vm.provision :shell, privileged: false, inline: $RUBY
cli.vm.provision :shell, privileged: false, inline: $CF
end
config.vm.define "bosh-lite" do |bosh|
@sykesm
sykesm / main.go
Created December 9, 2014 20:22
Race on asynch close
package main
import (
"bytes"
"errors"
"io"
"io/ioutil"
"os"
)
@sykesm
sykesm / ssh.go
Created February 27, 2015 01:45
Spike on ssh plugin for cli
package main
import (
"fmt"
"io"
"os"
"os/signal"
"strconv"
"strings"
"syscall"
@sykesm
sykesm / ssh_proxy.go
Created February 27, 2015 11:38
Outline for a simple SSH proxy
package proxy
import (
"io"
"net"
"os"
"sync"
"github.com/pivotal-golang/lager"
"github.com/tedsuo/ifrit"
#!/usr/bin/env ruby
require 'optparse'
require 'rubygems'
require 'nats/client'
def command_available?(cmd)
`command -v #{cmd} >/dev/null 2>&1`
$?.success?
end
@sykesm
sykesm / ssh.go
Created May 26, 2015 18:55
Super-simple start of an ssh plugin for the cli
package main
import (
"fmt"
"io"
"os"
"os/signal"
"strconv"
"strings"
"syscall"
@sykesm
sykesm / staging_task.json
Created September 4, 2015 13:55
What a staging task looks like
{
"rootfs": "preloaded:rabbit_hole",
"env": [
{
"name": "LANG",
"value": "en_US.UTF-8"
}
],
"action": {
"timeout": {
@sykesm
sykesm / docker-cluster.sh
Created January 5, 2016 17:37
docker-overlay.sh
#!/bin/bash
set -e -x
# Create the key-value store
docker-machine create -d vmwarefusion mh-keystore
docker $(docker-machine config mh-keystore) run -d -p "8500:8500" -h "consul" progrium/consul -server -bootstrap
# Create the swarm master
docker-machine create -d vmwarefusion --vmwarefusion-cpu-count=2 \
@sykesm
sykesm / Vagrantfile
Created January 7, 2016 17:24
ducati overlay goo
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
config.vm.provider "virtualbox" do |vb|