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 __future__ import print_function | |
# Displays all the policies associated to IAM username | |
# Useful for reviewing IAM user rights | |
# Requirements: | |
# | |
# Environmental variables: | |
# AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY | |
# python: |
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 __future__ import print_function | |
import requests | |
import json | |
import ipaddr #py2 | |
#import ipaddress #py3 | |
import sys | |
import pprint |
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 __future__ import print_function | |
import requests | |
import json | |
import ipaddr | |
import sys | |
from blessings import Terminal | |
import re | |
import string |
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 __future__ import print_function | |
import boto3 | |
from pygments import highlight, lexers, formatters | |
from botocore.exceptions import ClientError | |
iam = boto3.resource('iam') | |
s3 = boto3.client('s3') |
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 | |
ip=${1} | |
zones=$(aws route53 list-hosted-zones | jq '.HostedZones[] | .Id' | awk -F"/" '{print $3}' | tr -d '"') | |
for zone in ${zones} | |
do | |
aws route53 list-resource-record-sets --hosted-zone-id=${zone} | jq '.ResourceRecordSets[] | select(.ResourceRecords[0].Value == "'${ip}'")' | |
done |
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 | |
printf "%-20s %10s %10s %14s\n" "Process" "Ulimit" "Used" "% Ulimit Used" | |
length=62 | |
printf -v line '%*s' "$length" | |
echo ${line// /-} | |
# gather proceses to list from all of /var/run/ | |
for f in $(find /var/run/ -type f -name "*.pid" | sort) | |
# gather processes to list from monit | |
#for f in $(grep pidfile /etc/monit.d/* | awk '{print $6}' | sort) |
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
#add local to existing ansible hosts, to get variable from your hosts | |
[local] | |
127.0.0.1 | |
[app] | |
test1 app_name=app1 | |
test2 app_name=app2 |
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 __future__ import print_function | |
import json | |
import re | |
from easyprocess import EasyProcess | |
import pandas as pd | |
more = True | |
page_size = 25 | |
offset = 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 | |
# USAGE: > gen_certs.sh <root cert name> <server cert name> <client cert name> | |
if [ "$#" -ne 3 ]; then | |
echo "Illegal arguments, USAGE: > gen_certs.sh <root cert name> <server cert name> <client cert name>" | |
exit 1 | |
fi | |
mkdir testca | |
cd testca | |
mkdir certs private |
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 __future__ import print_function | |
import sys | |
from collections import defaultdict | |
filename = sys.argv[1] | |
queries = defaultdict(lambda: defaultdict(float)) | |
totals= defaultdict(float) | |
with open(filename) as f: | |
for line in f.readlines(): |
OlderNewer