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 | |
COMMAND='puppet parser validate' | |
TEMPDIR=`mktemp -d` | |
echo "### Attempting to validate puppet files... ####" | |
# See https://www.kernel.org/pub/software/scm/git/docs/githooks.html#pre-receive | |
oldrev=$1 | |
newrev=$2 |
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/python | |
''' Used to troubleshoot Google Compute Engine slow disk throughput ''' | |
''' Adjust block device readahead to optimize throughput via ''' | |
''' $ blockdev [/dev/sda] --setra $((1024*1024*8)) ''' | |
import sys | |
import os | |
import datetime |
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/python | |
import sys, subprocess, json, os | |
if __name__ == "__main__": | |
key_path='[PATH_TO_PRIVATE_KEY]' | |
proc = subprocess.Popen("azure vm list --json", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
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 python | |
import sys, subprocess, json, os | |
from pprint import pprint | |
if __name__ == "__main__": | |
if 'AWS_SSH_KEY_FILE' in os.environ: | |
key_path = os.environ['AWS_SSH_KEY_FILE'] | |
else: |
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
if [ "$1" == "" ] || [ "$2" == "" ] || [ "$3" == "" ]; then | |
echo "" | |
echo "Usage: ./create_cert_databag.sh [DATABAG_NAME] [SSL_CERT] [SSL_KEY [SSL_CA_CHAIN]]" | |
echo "" | |
exit 1 | |
fi | |
DATABAG_NAME=$1 | |
SSL_CERT=$2 |
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 | |
# Comments: | |
# 1. You must add execution rights to this file (chmod u+x pre-commit) | |
# 2. You need to have the 'jq' package installed to parse the json | |
echo -e "\n#### Validating chef environment files ####" | |
if git-rev-parse --verify HEAD >/dev/null 2>&1; 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
#!/usr/bin/python | |
import sys,json,hashlib | |
try: | |
with open(sys.argv[1], 'r') as content_file_orig: | |
content_original = content_file_orig.read() | |
json_orig = json.loads(content_original) | |
except Exception, e: | |
print "Error loading JSON file {0}! Please check it's validity.".format(sys.argv[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
#!/bin/bash | |
OUTPUT=`lsof -X -c logstash- | egrep -v '\.logstash-forwarder' | egrep -E '[0-9]+r\s+REG' | awk '{print $9}'` | |
case "$1" in | |
'json') | |
FILES=`printf ",\"%s\"" \${OUTPUT[@]}` | |
echo "{\"open_files\": [${FILES:1:${#FILES}-1}]}" | |
;; | |
*) | |
for F in "$OUTPUT" |
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 | |
OUTPUT=`lsof -X -c $1 | egrep -v '\.logstash-forwarder' | egrep -E '[0-9]+r\s+REG' | awk '{print $9}'` | |
case "$2" in | |
'json') | |
FILES=`printf ",\"%s\"" \${OUTPUT[@]}` | |
echo "{\"open_files\": [${FILES:1:${#FILES}-1}]}" | |
;; | |
*) | |
for F in "$OUTPUT" |
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 [[ "$1" == "" || "$2" == "" || "$3" == "" || "$4" == "" ]]; then | |
echo "Usage: pull-cloudtrail [CONFIG] [BUCKET_NAME] [ACCOUNT_NUMBER] [REGION]" | |
exit 1 | |
fi | |
YEAR=`date +%Y` | |
MONTH=`date +%m` | |
DAY=`date +%d` |
OlderNewer