Last active
October 26, 2015 12:35
-
-
Save sykesm/d4d48d41ca3c390a1772 to your computer and use it in GitHub Desktop.
bosh-lite-scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
$CF create-space -o playground test || exit 1 | |
$CF target -o playground -s test || exit 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
uaac target uaa.10.244.0.34.xip.io | |
uaac token client get admin -s admin-secret | |
uaac client update admin --authorities "password.write clients.write clients.read scim.read uaa.admin clients.secret scim.write" | |
uaac token delete | |
uaac token client get admin -s admin-secret | |
cf auth admin admin | |
cf create-user $1 $2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export PGPASSWORD=admin | |
psql -h 10.244.0.30 -U ccadmin -w -p 5524 ccdb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'json' | |
require "nats/client" | |
def command_available?(cmd) | |
`command -v #{cmd} >/dev/null 2>&1` | |
$?.success? | |
end | |
messages = [] | |
NATS.start(:uri => 'nats://nats:[email protected]:4222', :autostart => true) do | |
inbox = NATS.create_inbox | |
sub_id = NATS.subscribe(inbox) do |message, _, sub| | |
messages << Yajl::Parser.parse(message) | |
end | |
NATS.timeout(sub_id, 1, :expected => 1024) { NATS.stop } | |
NATS.publish('vcap.component.discover', '', inbox) | |
end | |
messages.each do |msg| | |
if command_available?("underscore") && $stdout.tty? | |
puts `echo '#{msg.to_json}' | underscore pretty` | |
else | |
puts JSON.pretty_generate(msg) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z $1 ]; then | |
TOPIC='>' | |
else | |
TOPIC=$1 | |
fi | |
nats-sub $TOPIC -s nats://nats:[email protected]:4222 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PRETTY_PRINT="cat" | |
if [ -t 1 -a $(tput colors) -ge "0" ]; then | |
if [ -n "$(type -t underscore)" ]; then | |
PRETTY_PRINT="underscore pretty" | |
elif [ -n "$(type -t json_pp)" ]; then | |
PRETTY_PRINT="json_pp" | |
fi | |
elif [ -n "$(type -t underscore)" ]; then | |
PRETTY_PRINT="underscore print" | |
fi | |
curl -s $1 | $PRETTY_PRINT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment