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
# ==[ printSlack ]============================================================= | |
# Function to send output from the commandline to Slack. | |
# | |
# @parameter string $LEVEL INFO/ERROR/WARNING message. Changes emoji | |
# @parameter string $MESSAGE Message to send to slack. | |
printSlack() | |
{ | |
SLACK_HOSTNAME=${SLACK_HOSTNAME-'oops.slack.com'}; | |
SLACK_TOKEN=${SLACK_TOKEN-'oops'}; | |
SLACK_CHANNEL=${SLACK_CHANNEL-'#devops'}; |
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
#$1,2 = files containing x=y style key-values | |
#sort, awk, grep friendly | |
#Duplicate keys are not handled | |
function kvdiff() { | |
tmpfile=`mktemp` | |
OLD_IFS=$IFS; | |
IFS=$'\n' | |
declare -A left; | |
declare -A right; |
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
# Variables | |
FOO=here | |
FOO="here" # equivalent, always use quotes | |
BAR=$FOO | |
BAR="$FOO" | |
BAR="${FOO}" | |
BAR='$FOO' # single quotes, does not evaluate the variable |
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 [ $# -lt 2 ]; then | |
echo "Usage: send.bash USER_NAME MESSAGE [DATA ... DATA]" | |
exit 1 | |
fi | |
USER=$1 | |
MESSAGE=$2 | |
if [ $# -ge 3 ]; then |
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 | |
LOCAL_DB="" | |
REMOTE_DB="" | |
LOCAL_USER="root" | |
LOCAL_PASS="" | |
REMOTE_USER="root" | |
REMOTE_PASS='' |
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
for x in {0..9}{0..9}{0..9}{0..9}; do | |
echo UoMYTrfrBFHyQXmg6gzctqAwOmw1IohZ $x | nc localhost 30002 | egrep -v "Exiting|Wrong|I am"; | |
echo "Try $x"; | |
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
#!/usr/bin/env bash | |
# upgrade starcluster | |
#### | |
mute_run () | |
{ | |
$* >/dev/null 2>&1 | |
} | |
cecho () | |
{ |
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
#!/usr/bin/env bash | |
echo '================================================================================' | |
echo 'PRE-COMMIT: CHECKING FILE SIZES' | |
echo '================================================================================' | |
# constant that you want to check sizes against | |
SIZE_LIMIT=$(( 1048576 * 64 )) | |
# $1 - filetype |
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 | |
# generate a number of files with random sizes in a range | |
min=1 # min size (MB) | |
max=10 # max size (MB) | |
nofiles=20 # number of files | |
for i in `eval echo {1..$nofiles}` | |
do | |
dd bs=1M count=$(($RANDOM%max + $min)) if=/dev/urandom of=./files/file$i |
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
_ | |
_._ _..._ .-', _.._(`)) | |
'-. ` ' /-._.-' ',/ | |
) \ '. | |
/ _ _ | \ | |
| a a / | | |
\ .-. ; | |
'-('' ).-' ,' ; | |
'-; | .' | |
\ \ / |
NewerOlder