Skip to content

Instantly share code, notes, and snippets.

View networkprogrammer's full-sized avatar

Bobin Joseph networkprogrammer

View GitHub Profile
@networkprogrammer
networkprogrammer / autossh.service
Created October 16, 2017 22:10 — forked from thomasfr/autossh.service
Systemd service for autossh
[Unit]
Description=Keeps a tunnel to 'remote.example.com' open
After=network.target
[Service]
User=autossh
# -p [PORT]
# -l [user]
# -M 0 --> no monitoring
# -N Just open the connection and do nothing (not interactive)
locals {
# supply your locals here
private_subnet_ids = [
"subnet-a",
"subnet-b"
]
vpc_id= "vpc-id"
}
module "nlb" {
@networkprogrammer
networkprogrammer / AWS_CrossAccount_CrossRegion_Multiprocessing.py
Created January 14, 2023 00:48 — forked from jonrau1/AWS_CrossAccount_CrossRegion_Multiprocessing.py
This Python script provides a mechanism to retrieve all AWS Accounts from AWS Organizations and get all opted-in Regions from the EC2 DescribeRegions API and provide them to STS and Boto3 Sessions to create multiple thread-safe Boto3 Clients for the purpose of parallelized asset collection in your entire AWS Organization. This also provides a wa…
import os # For environmental variables when running in CodeBuild, Fargate, Lambda, etc.
import boto3 # Because you need it lol
import botocore # For Error Handling
import json # To parse "stringified" JSON Policy documents
import time # to create Unix timestamps for DynamoDB TTL
import multiprocessing
import hashlib # To create unique IDs for places where AWS doesn't have them
from botocore.config import Config
# Boto3 Client Configuration for retries. AWS Defaults to 4 Max Attempts in "Normal Mode"