Skip to content

Instantly share code, notes, and snippets.

View rowanu's full-sized avatar

rowan rowanu

View GitHub Profile
@ustayready
ustayready / gpt.py
Created January 16, 2023 23:49
CloudGPT - Use ChatGPT to analyze AWS policies for vulnerabilities
import openai
import boto3
import json
import time
from typing import Dict, List
openai.api_key = '### SET YOUR OPENAPI API KEY HERE ###'
session = boto3.session.Session()
client = session.client('iam')
@kapilt
kapilt / arn_db.json
Last active February 28, 2023 00:29
all aws resource arns
{
"a4b": {
"profile": "arn:{Partition}:a4b:{Region}:{Account}:profile/{Resource_id}",
"room": "arn:{Partition}:a4b:{Region}:{Account}:room/{Resource_id}",
"device": "arn:{Partition}:a4b:{Region}:{Account}:device/{Resource_id}",
"skillgroup": "arn:{Partition}:a4b:{Region}:{Account}:skill-group/{Resource_id}",
"user": "arn:{Partition}:a4b:{Region}:{Account}:user/{Resource_id}",
"addressbook": "arn:{Partition}:a4b:{Region}:{Account}:address-book/{Resource_id}",
"conferenceprovider": "arn:{Partition}:a4b:{Region}:{Account}:conference-provider/{Resource_id}",
"contact": "arn:{Partition}:a4b:{Region}:{Account}:contact/{Resource_id}",
@Linch1
Linch1 / tokenPriceApi.js
Last active March 17, 2024 08:02
Retrive the price of any bsc token from it's address without using external service like poocoin/dextools
let pancakeSwapAbi = [
{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"getAmountsOut","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},
];
let tokenAbi = [
{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},
];
const Web3 = require('web3');
/*
Required Node.js
@iann0036
iann0036 / gist:b473bbb3097c5f4c656ed3d07b4d2222
Last active February 28, 2024 19:39
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
#!/bin/bash
# This is a script that unsubscribes an email address from AWS junk mail.
# If the script breaks it might be the magic numbers that needs to change.
# Send the form while tracing the request in your browser to find the new values.
# https://pages.awscloud.com/communication-preferences
unsubscribe_aws_email() {
curl "https://pages.awscloud.com/index.php/leadCapture/save2" \
-H "Accept: application/json" \
@buggy
buggy / index.ts
Created December 3, 2019 02:28
Generate SAM Project Using Amplify Transformers
import * as fs from "fs";
import * as yaml from "js-yaml";
import GraphQLTransform from "graphql-transformer-core";
import DynamoDBModelTransformer from "graphql-dynamodb-transformer";
import ModelAuthTransformer from "graphql-auth-transformer";
import ModelConnectionTransformer from "graphql-connection-transformer";
import SearchableModelTransformer from "graphql-elasticsearch-transformer";
import VersionedModelTransformer from "graphql-versioned-transformer";
import FunctionTransformer from "graphql-function-transformer";
@wolfeidau
wolfeidau / cognito.yml
Last active January 28, 2020 04:22
Cognito CFN stack with domain verification
AWSTemplateFormatVersion: 2010-09-09
Description: 'authentication: Resources for hosting authentication using AWS Cognito, a @wolfeidau template'
Parameters:
AppName:
Description: Name of application, used in signup emails and naming of aws resources.
Type: String
AllowedPattern: '^[a-zA-Z0-9]*$'
@wolfeidau
wolfeidau / sam.md
Created May 9, 2018 16:57
Install sam from scratch on osx with homebrew.

To setup sam local on an OSX system which is using homebrew.

Check if pip installed.

pip --version

If this returns.

@stevenringo
stevenringo / reinvent-2017-youtube.md
Created December 3, 2017 23:01
Links to YouTube recordings of AWS re:Invent 2017 sessions

| Title | Description