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/ruby | |
require 'json' | |
require 'term/ansicolor' | |
require 'optparse' | |
require 'httparty' | |
require 'set' | |
include Term::ANSIColor |
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 'xmlsimple' | |
require 'pp' | |
# Table widths will be padded in multiples of 10, so that small increases in maximum length will not always | |
# modify every line of the table (by increasing the width of the column) | |
PAD_MULTIPLE=10 | |
# Map one or more hashes to strings within a table row by composing a string from the values in the hash. Fields |
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 | |
red='\e[0;31m' | |
green='\e[0;32m' | |
NC='\e[0m' | |
set -e | |
function usage { | |
echo Enable/Disable routing all traffic through VPN, and |
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 | |
#Determine IP of calling user | |
ssh_ip=`echo $SSH_CLIENT | awk '{ print $1}'` | |
if [ "$1" == "kill" ]; then | |
echo "Simulating network disconnection by dropping traffic from all hosts except $ssh_ip..." | |
#Default Policy to DROP all incoming traffic |
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 | |
function usage { | |
echo "Shutdown and boot Digital Ocean droplets remotely, and simulate network disconnection" | |
echo | |
echo "Usage: $0 <kill/boot/killnet/resumenet> node1 [node2] [node3] [node...]" | |
exit 1 | |
} | |
# Get settings and node IDs from files |
NewerOlder