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 | |
#resp=$(aws ec2 describe-instances | jq '.Reservations[].Instances[] | select(.Tags[].Value=="$EC2_Name") | .InstanceId + " " + .State.Name' | |
EC2_Name=$1 | |
resp=$(aws ec2 describe-instances | jq '.Reservations[].Instances[] | select(contains({Tags: [{Key: "Name"}, {Value: "$EC2_Name"}]}) ) | .InstanceId + " " + .State.Name' | sed 's/"//g') | |
respArray=($resp) | |
if test "${respArray[1]}" == "stopped" | |
then | |
echo "Starting EC3..." | |
aws ec2 start-instances --instance-ids ${respArray[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
#!/bin/bash | |
# Docker entrypoint file to set the user's uid to an id that can write to | |
# a specific directory. Note: entrypoint must be run as root | |
# | |
# Usage: | |
# Set MAIN_USERNAME to the username that you want the container to run as | |
# Set MAIN_DIRECTORY to the directory that you want the user to be able to write | |
MAIN_USERNAME=username | |
MAIN_DIRECTORY=/home/username/project |
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 | |
# | |
# Copyright (c) 2016, Thurston Stone | |
DEBUG=0 | |
SUBDIRECTORY_OK=Yes | |
OPTIONS_KEEPDASHDASH= | |
OPTIONS_STUCKLONG=t | |
# Would be nice to have examples, but rev-parse sees '*' as a symbol to hide everything afterwards |
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 failOnError { | |
RETVAL=$1 | |
ErrorText=$2 | |
if [[ $RETVAL -ne 0 ]]; then | |
echo $2 | |
exit $RETVAL | |
fi | |
} |
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
Sub UpdateQueryData(DataSyncSheetName, _ | |
QueryTableName, _ | |
PrimaryKeyHeaderText, _ | |
PrimaryKeyColumn, _ | |
FirstExtraDataColumn, _ | |
LastExtraDataColumn, _ | |
MainSheetName) | |
' Assumptions: | |
' * External Data has a header row | |
' * External Data starts on A1 |
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 | |
# Usage: git settimes [-v] | |
SAVE_IFS=$IFS | |
VERBOSE="False" | |
if [[ $1 == "-v" ]]; then | |
VERBOSE="True" | |
fi | |
IFS=$(echo -en "\n\b") | |
for FILE in $(git ls-files) | |
do |
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 | |
# Clones as usual but creates local tracking branches for all remote branches. | |
# To use, copy this file into the same directory your git binaries are (git, git-flow, git-subtree, etc) | |
clone_output=$((git clone "$@" ) 2>&1) | |
retval=$? | |
echo $clone_output | |
if [[ $retval != 0 ]] ; then | |
exit 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 python | |
#from https://gist.github.com/tstone2077/6106950 | |
#__doc__ = | |
""" | |
OriginalAuthor: Thurston Stone | |
Description: Kick off a Jenkins Job programmatically. | |
Usage: run 'python StartJenkinsJob.py --help' for details. | |
Known Issues: | |
-c|--cause does not seem to work yet |
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
# vim: set fileencoding=utf-8 | |
import argparse | |
import logging | |
import os | |
import sys | |
import json | |
# ------------------- | |
__doc__ = """ |
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
""" | |
OriginalAuthor: tstone2077@gmail.com | |
Description: Basic sed functionality in python | |
Usage: pysed -h for help | |
""" | |
cmd_desc=""" | |
Basic sed functionality in python | |
""" | |
cmd_usage=""" |
NewerOlder