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 [[ $# -ne 5 ]]; then | |
echo -e "\nUsage: sync [SSH KEY PATH] [SSH_USER] [REMOTE HOST] [LOCAL DIR/FILE] [REMOTE DIR/FILE]\n" | |
exit 1 | |
fi | |
if [[ ! -e $4 ]]; then | |
echo -e "\nError: '$4' does not exist." | |
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
# This Vagrant file shoud default to VirtualBox | |
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'virtualbox' | |
# Install bosh cli in jumpbox - This script will be skipped if the pre-provisioned box is used | |
bosh_cli_install_script = <<SCRIPT | |
set -x | |
# Proxy server #.#.#.#:# if any | |
PROXY="" |
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 | |
[ "$1" = "-d" ] && debug=on || debug=off | |
# Make working directory | |
export wrkdir=/tmp/wrkdir.$$ | |
mkdir -p ${wrkdir} | |
# Clean up function | |
clean_up() | |
{ |
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 ] || [ -z $2 ]; then | |
echo -e "\nusage: ./ostest.sh <start> <end> [ <image> <user> <key_pair> <private_network> <public_network> ]\n" | |
echo -e " Runs tests numbered from <start> to <end>. Arguments <image>, <user>, <key_pair>," | |
echo -e " <private_network> and <public_network> are optional but must provided as one. If" | |
echo -e " they are not provided then 'cirros-0.3.3', 'cirros', '$(whoami)' 'private01' and " | |
echo -e " 'public01' will be used.\n" | |
exit 1 | |
fi |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.define "esx" do |esx| | |
esx.vm.box = "mevansam/vmware-esxi6-vc" | |
esx.vm.hostname = "esxbox" | |
esx.vm.synced_folder ".", "/vagrant", disabled: true |
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 | |
for device in $(VBoxManage list hostonlyifs | awk '/^Name:/ { print $2 }'); do \ | |
ipaddress=$(VBoxManage list hostonlyifs | grep -A 3 "$device" | awk '/IPAddress:/ { print $2 }'); \ | |
VBoxManage hostonlyif ipconfig $device --ip $ipaddress; \ | |
sudo ifconfig $device down; \ | |
sudo ifconfig $device up; \ | |
echo "Restarted $device with ip $ipaddress."; \ | |
done |
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
# COMMON OPENSTACK ENVS | |
export OS_USERNAME=admin | |
export OS_PASSWORD=0p3n5tack | |
export OS_TENANT_NAME=admin | |
export OS_AUTH_URL=https://192.168.60.200:5000/v2.0 | |
export OS_REGION_NAME=kvm_vbox | |
export SERVICE_ENDPOINT="https://192.168.60.200:35357/v2.0" | |
export SERVICE_TOKEN=0c4a1365e0bbb7e2e02543a2b932cfed |
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 | |
set -x | |
if [ ! -e "openrc" ]; then | |
echo "Unable to find an 'openrc' with the openstack environment." | |
exit 1 | |
fi | |
source openrc |
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
require "set" | |
require "highline" | |
# | |
# Prints a 2-d array as a table formatted to terminal size | |
# | |
def print_table(table, format = true, cols = nil) | |
# Apply column filter | |
unless cols.nil? |