$ ruby scripts/diff.rb scripts/v224.yml scripts/v225.yml
compilation.cloud_properties.availability_zone: __stub__eu-west-1a != __stub__eu-west-1b
compilation.cloud_properties.instance_type.c3.large: only in 1
compilation.network: only in 2
jobs.consul_z1.networks.cf1.static_ips.10.0.10.39: only in 1
This file contains 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 'yaml' | |
filename = ARGV[0] | |
path = ARGV[1] | |
def get(hash, path_array) | |
unless path_array.empty? | |
get(hash[path_array[0]], path_array[1..-1]) |
This file contains 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
require "net/http" | |
require "uri" | |
require "json" | |
def print_router_routes(name, ip) | |
uri = URI.parse("http://#{ip}:8080/routes") | |
http = Net::HTTP.new(uri.host, uri.port) | |
request = Net::HTTP::Get.new(uri.request_uri) | |
request.basic_auth("router_user", "router_password") |
This file contains 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 bash | |
# Install globally using https://coderwall.com/p/jp7d5q/create-a-global-git-commit-hook | |
# The checks are simple and can give false positives. Amend the hook in the specific repository. | |
if git rev-parse --verify HEAD >/dev/null 2>&1 | |
then | |
against=HEAD | |
else | |
# Initial commit: diff against an empty tree object |
This file contains 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 | |
set -x | |
GATEWAY=52.48.251.177 | |
TMP_DIR=/tmp/flow_log | |
VM_LIST_FILE=${TMP_DIR}/vm_list.txt | |
IPTABLES_INSTALL_OUTPUT="iptables -A OUTPUT -m state --state NEW -j LOG --log-prefix '[flow-logs-output] '" | |
IPTABLES_INSTALL_INPUT="iptables -A INPUT -m state --state NEW -j LOG --log-prefix '[flow-logs-input] '" | |
IPTABLES_REMOVE_OUTPUT="iptables -D OUTPUT -m state --state NEW -j LOG --log-prefix '[flow-logs-output] '" | |
IPTABLES_REMOVE_INPUT="iptables -D INPUT -m state --state NEW -j LOG --log-prefix '[flow-logs-input] '" |
This file contains 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 | |
dirs=$@ | |
base_dir=$(pwd) | |
rm -rf merged | |
mkdir merged | |
for dir in ${dirs}; do | |
echo Processing ${dir}... |
This file contains 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 | |
set -eu | |
NAME=$1 | |
UAA_ENDPOINT=https://... | |
UAA_ADMIN_CLIENT_PASS=xxxxx | |
PASSWORD=test | |
echo "Creating user ${NAME}" | |
uaac --trace target "${UAA_ENDPOINT}" |
This file contains 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 'json' | |
orgs = JSON.load(`cf curl /v2/organizations`)["resources"] | |
quotas = JSON.load(`cf curl /v2/quota_definitions`)["resources"] | |
orgs_reserved_memory = 0 | |
apps_reserved_memory = 0 | |
allocated_services = 0 |
This file contains 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
require 'loggregator_emitter' | |
require 'net/http' | |
require 'json' | |
nats_ip = '10.0.16.11' | |
nats_monitor_port = 4333 | |
metron_port = 3457 | |
@http = Net::HTTP.new(nats_ip, nats_monitor_port) | |
@get_varz = Net::HTTP::Get.new('/varz') |
This file contains 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 | |
SCRIPT_NAME="$0" | |
usage() { | |
cat <<EOF | |
Creates a set of tokens assuming the given role. Use "me" as role to simply generate a new session token for your user. | |
Usage: | |
$SCRIPT_NAME <role name> [duration in seconds] |
OlderNewer