This file contains hidden or 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 sys | |
import time | |
import random | |
import shutil | |
import subprocess | |
import webbrowser | |
import pyfiglet | |
import getpass | |
import signal |
This file contains hidden or 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
REPO_URL ?= https://github.com/example/your-repo.git | |
TARGET_DIR ?= ./module | |
MODULE_LOCATION := $(abspath $(TARGET_DIR)) | |
.PHONY: clone | |
clone: | |
@git clone $(REPO_URL) $(TARGET_DIR) | |
.PHONY: plan | |
plan: export MODULE_LOCATION=$(MODULE_LOCATION) |
This file contains hidden or 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
#!/usr/bin/env python3 | |
import argparse | |
import glob | |
import os | |
import pandas as pd | |
def extract_columns(directory): | |
# Define the recursive search pattern for .xlsx files | |
file_pattern = os.path.join(directory, '**', '*.xlsx') | |
xlsx_files = [f for f in glob.glob(file_pattern, recursive=True) |
This file contains hidden or 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 | |
import datetime | |
def main(): | |
# Set the region and calculate the threshold date (60 days ago) | |
region = "us-east-1" | |
now = datetime.datetime.utcnow() | |
threshold_date = now - datetime.timedelta(days=60) | |
# List to hold resources created in the past 60 days |
This file contains hidden or 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
#!/usr/bin/env python3 | |
import socket | |
import ssl | |
import argparse | |
import requests | |
from cryptography import x509 | |
from cryptography.hazmat.backends import default_backend | |
from cryptography.x509.oid import ExtensionOID | |
def get_certificate(hostname, port=443, timeout=5, ca_bundle=None): |
This file contains hidden or 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 pandas as pd | |
import glob | |
import os | |
from openpyxl import load_workbook | |
from openpyxl.worksheet.table import Table, TableStyleInfo | |
def extract_account(policy_arn): | |
""" | |
Extracts the account number from a PolicyArn string. | |
Expected format: arn:aws:iam::<Account_ID>:policy/... |
This file contains hidden or 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
#!/usr/bin/env python3 | |
import os | |
import glob | |
import argparse | |
from datetime import datetime | |
import pandas as pd | |
import re | |
class CSVCombiner: | |
def __init__(self, csv_folder, output_folder, write_csv=False): |
This file contains hidden or 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 logging | |
import discord | |
from discord.ext import commands | |
import requests | |
# Setting up logging | |
logger = logging.getLogger(__name__) | |
logging.basicConfig(level=logging.ERROR) # You can change the level if needed |
This file contains hidden or 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
#!/bin/bash | |
# Export all resources to JSON format | |
aws ec2 describe-instances --output json > instances.json | |
aws rds describe-db-instances --output json > dbs.json | |
aws s3api list-buckets --output json > buckets.json | |
# add more AWS resource types as needed | |
# Use Graphviz to visualize resource relationships | |
pip install graphviz |
This file contains hidden or 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
name: Purge untagged images | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
env: | |
GHCR_REGISTRY: ghcr.io | |
GHCR_REPOSITORY: your_username/your_repository |
NewerOlder