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 |
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 | |
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
#!/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
#!/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
# Sample data | |
data = [] | |
data[0] = '00101000110001100000000000001000 00001000011111111001000000001100 00001101100000001000000000000000 00000000000000000000010001111111' | |
data[1] = '00101000110001100000000000001000 00001000011111111001000000001100 00000011100000001000000000000000 00000000000000000000010001110111' | |
data[2] = '00101000110001100000000000001000 00001000011111111001000000001100 00001101100011001000000000000000 00001011111110010000010011111010' | |
data[3] = '00101000110001100000000000001000 00001000011111111001000000001100 00001101100000001000100000000000 00000000000000000000010001110111' | |
data[4] = '00101000110001100000000000001000 00001000011111111001000000001100 00001101000000000000100000000000 00000000000000000000010000001111' | |
# Checksum function |
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 Enable or disable CNTLM proxy settings in the current terminal | |
echo | |
echo Usage: | |
echo | |
echo "source proxy <on / off>" | |
} |
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
/* | |
* IRrecord: record and play back IR signals as a minimal | |
* An IR detector/demodulator must be connected to the input RECV_PIN. | |
* An IR LED must be connected to the output PWM pin 3. | |
* A button must be connected to the input BUTTON_PIN; this is the | |
* send button. | |
* A visible LED can be connected to STATUS_PIN to provide status. | |
* | |
* The logic is: | |
* If the button is pressed, send the IR code. |
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 "Manage nginx sites" | |
echo | |
echo "Usage:" | |
echo | |
echo "ng pull" | |
echo "ng push" | |
echo "ng list" |
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 | |
yum install -y java-1.7.0-openjdk | |
cat > /etc/yum.repos.d/ElasticSearch-1.0.repo <<- EOF | |
[elasticsearch-1.0] | |
name=Elasticsearch repository for 1.0.x packages | |
baseurl=http://packages.elasticsearch.org/elasticsearch/1.0/centos | |
gpgcheck=1 | |
gpgkey=http://packages.elasticsearch.org/GPG-KEY-elasticsearch |
OlderNewer