Skip to content

Instantly share code, notes, and snippets.

@pjaudiomv
pjaudiomv / generate_pdf_report.py
Created January 2, 2026 16:23
Generate a PDF report from audit_duplicate_keys_results.json
#!/usr/bin/env python3
"""
Generate a PDF report from audit_duplicate_keys_results.json
This script reads the JSON output from audit_duplicate_format_keys.py
and generates a formatted PDF report.
Usage:
python3 generate_pdf_report.py # Use default input file
python3 generate_pdf_report.py audit_duplicate_keys_results.json
@pjaudiomv
pjaudiomv / audit_duplicate_format_keys.py
Last active January 2, 2026 16:01
Audit BMLT servers to find duplicate format keys in the same language
#!/usr/bin/env python3
"""
Audit BMLT servers to find duplicate format keys in the same language.
This script checks all servers and reports formats that have the same key_string
in the same language (e.g., two formats with key "B" in English).
Usage:
python3 audit_duplicate_format_keys.py # Audit all servers
python3 audit_duplicate_format_keys.py 102 # Audit only server with id=102
@pjaudiomv
pjaudiomv / audit_meetings.py
Created January 1, 2026 16:11
Audit BMLT servers to find meetings with orphaned service body references
#!/usr/bin/env python3
"""
Audit BMLT servers to find meetings with orphaned service body references.
This script checks all servers in serverList.json and reports meetings that
reference service body IDs that no longer exist in the server's service body list.
Usage:
python3 audit_meetings.py # Audit all servers
python3 audit_meetings.py 102 # Audit only server with id=102
@pjaudiomv
pjaudiomv / BMLT_Semantic_API_Documentation.md
Created September 4, 2025 11:01
BMLT Semantic API Documentation

BMLT Semantic API Documentation

Overview

The BMLT (Basic Meeting List Tool) Semantic API provides a comprehensive interface for retrieving meeting data from BMLT root servers. This API uses a switcher= parameter to specify different operations and returns data in JSON or CSV format.

Base URL Structure

All API calls follow this pattern:

@pjaudiomv
pjaudiomv / ec2-token.sh
Created November 12, 2024 18:46
aws token v2
export TOKEN=$(curl -sL -X PUT -H "X-aws-ec2-metadata-token-ttl-seconds: 21600" http://169.254.169.254/latest/api/token)
curl -sL -X GET -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/
@pjaudiomv
pjaudiomv / docker-compose.yml
Created June 23, 2024 00:24
WordPress with SMTP using mailpit for local dev
services:
wordpress:
depends_on:
- db
- mailpit
image: wordpress:6.5.3-php8.3-apache
restart: always
ports:
- 8080:80
- 7443:443
@pjaudiomv
pjaudiomv / parse-tfstate.py
Created April 24, 2024 18:58
Terragrunt to Terraform migration. Useful for migrating lots of statefiles down to a single statefile
#!/usr/bin/env python3
import argparse
import json
import subprocess
from collections import defaultdict
# IE.
# parse-state -o terragrunt.tfstate -n terraform.tfstate -m ec2_bastion
def parse_args():
@pjaudiomv
pjaudiomv / custom-field-keys.py
Last active December 27, 2023 00:36
BMLT Servers with Custom Field Keys
import urllib3
import json
standard_keys = ['id_bigint', 'worldid_mixed', 'service_body_bigint', 'weekday_tinyint', 'venue_type', 'start_time', 'duration_time', 'time_zone', 'formats', 'lang_enum', 'longitude', 'latitude', 'meeting_name', 'location_text', 'location_info', 'location_street', 'location_city_subsection', 'location_neighborhood', 'location_municipality', 'location_sub_province', 'location_province', 'location_postal_code_1', 'location_nation', 'comments', 'train_lines', 'bus_lines', 'phone_meeting_number', 'virtual_meeting_link', 'virtual_meeting_additional_info', 'root_server_uri', 'format_shared_id_list']
req = urllib3.PoolManager().request("GET", 'https://aggregator.bmltenabled.org/main_server/api/v1/rootservers')
root_servers = json.loads(req.data.decode())
root_servers = sorted(root_servers, key=lambda k: k['name'])
for root in root_servers:
root_info = json.loads(root['serverInfo'])
available_keys = root_info['available_keys'].split(',')
@pjaudiomv
pjaudiomv / aws-assumerole.sh
Last active December 4, 2024 15:07
Get EC2 Assume Role STS Creds and set them locally - useful for testing ec2 role or when you have ssh access to an ec2 but no aws credential accesss
#!/usr/bin/env bash
# Fetches AWS credentials from a EC2 IAM role and configures them locally for multiple profiles.
# Script expects input parameter to be a named Host in your SSH config, then sets AWS creds name using that Host name.
#
# Configuration
# Check for SSH_CONFIG_FILE env var then default to users home dir
SSH_CONFIG_FILE="${SSH_CONFIG_FILE:-$HOME/.ssh/config}"
readarray -t ssh_hosts < <(grep 'Host ' "$SSH_CONFIG_FILE" | awk '{print $2}' | sort -u)
# ANSI color codes for pretty output
@pjaudiomv
pjaudiomv / get-all-images.sh
Last active April 9, 2024 16:14
Get All Images in a Cluster
#!/usr/bin/env bash
normalize_image_name() {
local name="$1"
local registry
if [[ "$name" == *\/* ]]; then
registry=${name%%/*}
if ! [[ "$registry" == *.* || "$registry" == localhost:[0-9]* ]]; then
name="docker.io/${name}"
fi