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
$ eksctl create cluster -f eksctl-test.yaml -v 4 | |
2022-01-05 11:50:27 [▶] role ARN for the current session is "arn:aws:sts::[REDACTED AWS-ACCOUNT ID]:assumed-role/[REDACTED SESSION-NAME] | |
2022-01-05 11:50:27 [ℹ] eksctl version 0.77.0 | |
2022-01-05 11:50:27 [ℹ] using region us-east-2 | |
2022-01-05 11:50:27 [▶] determining availability zones | |
2022-01-05 11:50:28 [ℹ] setting availability zones to [us-east-2c us-east-2b us-east-2a] | |
2022-01-05 11:50:28 [▶] VPC CIDR (192.168.0.0/16) was divided into 8 subnets [192.168.0.0/19 192.168.32.0/19 192.168.64.0/19 192.168.96.0/19 192.168.128.0/19 192.168.160.0/19 192.168.192.0/19 192.168.224.0/19] | |
2022-01-05 11:50:28 [ℹ] subnets for us-east-2c - public:192.168.0.0/19 private:192.168.96.0/19 | |
2022-01-05 11:50:28 [ℹ] subnets for us-east-2b - public:192.168.32.0/19 private:192.168.128.0/19 | |
2022-01-05 11:50:28 [ℹ] subnets for us-east-2a - public:192.168.64.0/19 private:192.168.160.0/19 |
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
import os | |
import json | |
import time | |
from datetime import datetime | |
from github import ( | |
Github, UnknownObjectException, GithubException, RateLimitExceededException | |
) | |
RATE_LIMIT_COUNT = 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
from github import Github, GithubException | |
import json | |
from datetime import datetime | |
import os | |
def main(token): | |
g = Github(token) | |
alphagov = g.get_organization('alphagov') |
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
cat repos.json | \ | |
jq '.[]|.full_name' | \ | |
xargs -I REPO | |
curl -X POST \ | |
-H "Content-Type: application/json" \ | |
-H "Authorization: token ${GITHUB_TOKEN}" \ | |
-d '{"organization": "alphagov-mirror"}' \ | |
https://api.github.com/repos/REPO/forks |
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
# Step 1 | |
curl -v https://api.github.com/orgs/alphagov/repos | |
# Copy the 'rel="last"' value from this section | |
# < Link: <https://api.github.com/organizations/596977/repos?page=2>; rel="next", <https://api.github.com/organizations/596977/repos?page=44>; rel="last" | |
# i.e. '44' | |
for i in {1..44}; do curl "https://api.github.com/organizations/596977/repos?page=$i" >> repos.json; done | |
cat repos.json| jq '.[]|.html_url' -r | xargs -I REPO git clone REPO && sleep 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
# | |
# Find all the security groups that use a particular CIDR_TO_FIND and update | |
# them with a new ingress rule allowing access from CIDR on ports 0->65535 | |
# | |
# DESCRIPTION can also be set to describe the new rule. | |
# | |
# If DRY_RUN is set to true the security groups will be searched for but not | |
# updated. | |
# |
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 usage | |
# # Get the data: | |
# $ python3 aws-iam-crawl.py > iam.json | |
# | |
# # Group summary | |
# $ cat iam.json| jq '.groups | map({"members": (._users|length), "policies": ((._inline_policies|length) + (._attached_policies|length)), "inline_policies": (._inline_policies|length), "name": .GroupName}) | sort_by(.members)[] ' -c | |
# | |
# # User summary (basically the same) | |
# $ cat iam.json| jq '.users | map({"groups": (._groups|length), "policies": ((._inline_policies|length) + (._attached_policies|length)), "inline_policies": (._inline_policies|length), "name": .UserName}) | sort_by(.groups)[] ' -c |
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
# | |
# Recommended use | |
# python3 aws-action-test.py ec2:create-instance > arns.json | |
# | |
# This is pretty slow but I think it hits most main things in AWS | |
# | |
import boto3 | |
from sys import argv |
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
import boto3 | |
from sys import argv | |
def get_name(aws_obj): | |
names = list(tag['Value'] for tag in aws_obj['Tags'] if tag['Key'] == 'Name') | |
if len(names) != 1: | |
# print('No name for object: {}'.format(aws_obj)) | |
return '--unknown--' |
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
Total Entries = 184 | |
Errors = 20 | |
Used Entries = 164 | |
Min = 15 min | |
Max = 180 min | |
Average = 52 min | |
---------------------------------------- | |
Duration (min) | Count | |
30 | 48 | |
60 | 38 |
NewerOlder