Skip to content

Instantly share code, notes, and snippets.

View PatMyron's full-sized avatar
☁️
cfn-lint / tflint maintainer emeritus

Pat Myron PatMyron

☁️
cfn-lint / tflint maintainer emeritus
  • https://www.linkedin.com/in/patrickmyron/
  • USA
View GitHub Profile
@iann0036
iann0036 / gist:b473bbb3097c5f4c656ed3d07b4d2222
Last active April 28, 2024 11:47
List of expensive / long-term effect AWS IAM actions
route53domains:RegisterDomain
route53domains:RenewDomain
route53domains:TransferDomain
ec2:ModifyReservedInstances
ec2:PurchaseHostReservation
ec2:PurchaseReservedInstancesOffering
ec2:PurchaseScheduledInstances
rds:PurchaseReservedDBInstancesOffering
dynamodb:PurchaseReservedCapacityOfferings
s3:PutObjectRetention
@z0ph
z0ph / findings.txt
Last active December 17, 2021 00:17
AWS Access Analyzer - Policy Validation of 837 AWS Managed Policies.
==> Validation of: ./policies/TagGovernancePolicy
==> Finding: [
{
"findingDetails": "Using ForAllValues qualifier with the single-valued condition key organizations:ServicePrincipal can be overly permissive. We recommend that you remove ForAllValues:.",
"findingType": "SECURITY_WARNING",
"issueCode": "FORALLVALUES_WITH_SINGLE_VALUED_KEY",
"learnMoreLink": "https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-reference-policy-checks.html#access-analyzer-reference-policy-checks-security-warning-forallvalues-with-single-valued-key",
"locations": [
{
"path": [
@tekin
tekin / .gitattributes
Last active July 9, 2024 20:31
An example .gitattributes file that will configure custom hunk header patterns for some common languages and file formats. See https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more for more details.
# Stick this in your home directory and point your Global Git config at it by running:
#
# $ git config --global core.attributesfile ~/.gitattributes
#
# See https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more for more details
*.c diff=cpp
*.h diff=cpp
*.c++ diff=cpp
*.h++ diff=cpp
@IanColdwater
IanColdwater / twittermute.txt
Last active July 2, 2024 02:25
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@0penBrain
0penBrain / commitCount.sh
Last active July 6, 2024 13:46
The simplest way to get commit count of a GitHub repository through the API
curl -I -k "https://api.github.com/repos/:owner/:repo/commits?per_page=1" | sed -n '/^[Ll]ink:/ s/.*"next".*page=\([0-9]*\).*"last".*/\1/p'
### And that's all !
# I saw many fighting with finding first commit SHA or similar fancy thing.
# Here we just rely on the GH API, asking commits at 1 per page and parsing the last page number in the header of the reply (whose body only holds the last commit !)
# So this is robust and bandwidth efficient. :)
# If one want the commit count of a specific SHA, just use :
curl -I -k "https://api.github.com/repos/:owner/:repo/commits?per_page=1&sha=:sha" | sed -n '/^[Ll]ink:/ s/.*"next".*page=\([0-9]*\).*"last".*/\1/p'
@0xdabbad00
0xdabbad00 / grab.sh
Created May 16, 2019 02:54
Script to get all versions of all AWS managed policies
#!/bin/bash
# Use the AWS CLI to collect all versions of all AWS managed policies. Example files:
# APIGatewayServiceRolePolicy.v1
# APIGatewayServiceRolePolicy.v2
# APIGatewayServiceRolePolicy.v3
# Usage: ./grab.sh
# Note that the following policies do not exist and create zero byte files:
@0xdabbad00
0xdabbad00 / gist:d05b752c84712781c7ec7c040585bf3a
Last active January 16, 2021 23:14
AWS services per region using botocore endpoints
cat botocore/data/endpoints.json | jq -cr '.partitions[0].services | keys[] as $k | .[$k] | .endpoints|to_entries[]| .key +"\t"+ $k' | sort | cut -f1 | uniq -c | sort -nr | sed 's/^ *\([0-9][0-9]*\) /\1 /' | grep -v fips
126 us-east-1
116 us-west-2
115 eu-west-1
101 ap-southeast-2
100 ap-northeast-1
97 eu-central-1
95 us-east-2
a4b
account
acm
acm-pca
amplify
apigateway
application-autoscaling
appstream
appsync
artifact
@0xdabbad00
0xdabbad00 / CloudFormation_resources.txt
Last active May 28, 2019 15:46
CloudFormation resources. Found via: git clone --depth=1 https://github.com/awsdocs/aws-cloudformation-user-guide.git; cd aws-cloudformation-user-guide; grep -h "# AWS::" doc_source/aws-* | sed 's/# //' | sed 's/<.*//' | sort | uniq
AWS::AmazonMQ::Broker
AWS::AmazonMQ::Configuration
AWS::ApiGateway::Account
AWS::ApiGateway::ApiKey
AWS::ApiGateway::Authorizer
AWS::ApiGateway::BasePathMapping
AWS::ApiGateway::ClientCertificate
AWS::ApiGateway::Deployment
AWS::ApiGateway::DocumentationPart
AWS::ApiGateway::DocumentationVersion