Skip to content

Instantly share code, notes, and snippets.

View miketheman's full-sized avatar

Mike Fiedler miketheman

View GitHub Profile
from unittest.mock import patch
import boto3
from botocore.stub import Stubber
# create an ssm client
ssm = boto3.client("ssm")
# create an sqs client
sqs = boto3.client("sqs")
miketheman /
Last active December 22, 2022 19:20
Add a bunch of AWS Heroes (and some other folks, too) to a Mastodon list.
Add users to a Mastodon instance list.
from os import environ
from pathlib import Path
from mastodon import Mastodon
from mastodon.errors import MastodonNotFoundError, MastodonServiceUnavailableError
miketheman / Makefile
Created November 22, 2021 17:32
Makefile with targets to generate static renderings from PlantUML sources
View Makefile
DIAGRAMS := $(wildcard *.puml */*puml)
SVGS := $(DIAGRAMS:.puml=.svg)
PNGS := $(DIAGRAMS:.puml=.png)
all: $(SVGS) $(PNGS)
%.png: %.puml
plantuml -tpng "$<"
%.svg: %.puml
miketheman /
Last active March 20, 2021 23:22 — forked from benkehoe/
Single sourcing a python package version using importlib.metadata.version()
# importlib.metadata is present in Python 3.8 and later
import importlib.metadata as importlib_metadata
except ImportError:
# use the shim package importlib-metadata pre-3.8
import importlib_metadata as importlib_metadata
__version__ = importlib_metadata.version(__package__ or __name__)
except importlib_metadata.PackageNotFoundError:
miketheman / hypermail.rb
Created December 12, 2020 21:20
Sample Homebrew forumla for Hypermail
View hypermail.rb
class Hypermail < Formula
desc "Hypermail is a free (GPL) program to convert email from Unix mbox format to html."
homepage ""
url ""
sha256 "f97995b9bb1ece888968467cdad05e3daa7662ff3e3a5739e378b4f3adeb26c6"
license "GPL-2.0"
depends_on "bison" => :build
depends_on "gcc"
View main.dart
flip(inputInt) {
return inputInt = 1 - inputInt;
void main() {
miketheman /
Last active June 4, 2020 20:44
Mike's Super Janky Manual GitHub Vuln Alert Query

How To


  • GitHub account with admin-level rights to repos, possibly even org-level admin.
  • Command Line familiarity
  • jq tool

Note: Commands have been written assuming a macOS machine, they may work on other platforms, but I haven't tested those.

miketheman /
Created February 14, 2020 14:39
A simple script to enable GitHub's Data Services & Vulnerability Scanning on a given Organization's Repositories
from github import Github
org = gh.get_organization('SET_ORG_NAME_HERE')
repos = org.get_repos()
for repo in repos:
if repo.archived:
miketheman / main.dart
Last active January 18, 2020 15:02
round duration to closer second, for a countdown clock -
View main.dart
void main() {
Duration duration = new Duration(minutes: 1, seconds: 59, milliseconds: 99);
// Rounds Duration to seconds based on milliseconds
// This is semi-equivalent to a non-existing `Duration.ceil(milliseconds)`
Duration secondRounder(Duration duration) {
int roundedDuration;