Skip to content

Instantly share code, notes, and snippets.

View zfouts's full-sized avatar
🤡
CLOWNIN' AROUND

Zach zfouts

🤡
CLOWNIN' AROUND
View GitHub Profile
@zfouts
zfouts / rickpocolypse.py
Created May 28, 2025 05:28
AI generated rick roll annoyer 9000
import os
import sys
import time
import random
import shutil
import subprocess
import webbrowser
import pyfiglet
import getpass
import signal
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)
@zfouts
zfouts / arn.py
Last active April 10, 2025 13:59
#!/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)
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
#!/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):
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/...
#!/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):
@zfouts
zfouts / oxforddictionary.py
Created December 7, 2023 22:36
Discord cog for Oxford Dictionary
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
@zfouts
zfouts / gist:3bafb7e4a8d83e923d7026b77a30ccae
Created March 14, 2023 16:07
Visualize AWS Resources
#!/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
@zfouts
zfouts / cleanup.yml
Created February 11, 2023 11:57
GitHub Action for purging untagged images >7 days old.
name: Purge untagged images
on:
schedule:
- cron: '0 0 * * *'
env:
GHCR_REGISTRY: ghcr.io
GHCR_REPOSITORY: your_username/your_repository