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 | |
# Slack notification script, for use by Nagios or other similar monitoring systems. | |
# | |
# Author: Justin Miller | |
# Github: github.com/colebrooke | |
# | |
# Usage: | |
# | |
# ./nagios_notify_slack.sh <SLACKCHANNEL> |
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
# example: python find_username_by_access_key.py <your_key> | |
import sys, boto3 | |
TARGET_ACCESS_KEY = sys.argv[1] | |
client = boto3.client('iam') | |
paginator = client.get_paginator('list_users') | |
response_iterator = paginator.paginate( | |
PaginationConfig={ | |
'MaxItems': 150, |
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 | |
# quick script to start a docker swarm | |
# Justin Miller | |
# 14-02-17 | |
# pre-requisites: | |
# set up public key authentication on all nodes | |
# ensure docker-engine 1.13 is installed and can be used by the admin user |
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 | |
# Justin Miller 12/01/17 | |
# Script to calculate the human readable size of S3 buckets | |
# The script uses cloudwatch metrics. These may need time to update if you've added data to a bucket within 24hrs. | |
# It happily DOES NOT need to travese potentially millions of files to calculate your S3 bucket sizes. | |
# | |
# Usage: | |
# ./ls-s3-sizes.sh | |
# | |
# TODO: Could be further parameterised depending on usage requirements. |
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 | |
# Justin Miller 08/04/16 | |
# Setup auditd | |
# command example: | |
# aureport --tty | |
# | |
# to view root commands: | |
# ausearch -ue 0 | |
# to view user commands: | |
# ausearch -ua <userid> |