Skip to content

Instantly share code, notes, and snippets.

View gergo-dryrun's full-sized avatar

Gergo Debreczeni gergo-dryrun

  • Zurich, Switzerland
View GitHub Profile
@gergo-dryrun
gergo-dryrun / parse_ou.py
Created May 11, 2021 18:32
Dump policies/OU/accounts from a root
from collections import defaultdict
import datetime
import json
import boto3
class DateTimeEncoder(json.JSONEncoder):
def default(self, z):
if isinstance(z, datetime.datetime):
# download codebuild output artifacts, unzip and CD to the processing_time directory
activity_types_str=$(ls | cut -d '-' -f1 | uniq)
activity_types=($activity_types_str)
for activity_type in "${activity_types[@]}"
do
echo ""
nr_tasks=$(ls ${activity_type}* | wc -l)
echo "Total${activity_type} tasks executed ${nr_tasks}"
echo "Aggregated time taken for the short ${activity_type} tasks (In seconds)";
@gergo-dryrun
gergo-dryrun / namespace.sh
Last active March 2, 2021 12:54
print out tuple of (AWS Service IAM namespace, AWS Service full name)
git clone https://github.com/boto/botocore.git
find botocore/botocore/data -name service-*.json | xargs cat | jq -r '(if (.metadata.signingName | length) > 0 then .metadata.signingName else .metadata.endpointPrefix end) + " " + .metadata.serviceFullName' | sort | uniq
@gergo-dryrun
gergo-dryrun / README.md
Created January 7, 2018 21:21 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed


@gergo-dryrun
gergo-dryrun / yaml
Created November 20, 2017 09:55
nested-fn-calls.yaml
      ManagedPolicyName:
        Fn::Sub:
          - prefix-${StackIdSanitised}
          - StackIdSanitised:
              Fn::Select:
                - 2
                - Fn::Split:
                  - /
                  - !Ref AWS::StackId
@gergo-dryrun
gergo-dryrun / policy.yaml
Created March 19, 2017 17:37
Chaining FN::Sub/Select/Split/Ref
LambdaRolePolicies:
Type: AWS::IAM::Policy
Properties:
PolicyName: es-http-permissions
PolicyDocument:
Version: 2012-10-17
Statement:
-
Effect: Allow
Action: