Skip to content

Instantly share code, notes, and snippets.

jftuga /
Last active May 18, 2024 10:23
Dump all Python variables
-John Taylor
Dumps both global and local Python variables and their values
import json
import re
jftuga /
Created May 9, 2024 14:41
Batch create S3 objects
# create a number of objects in the given S3 bucket
set -euo pipefail
jftuga /
Last active November 13, 2023 13:16
How to Update Firmware on Ubuntu or Debian
jftuga /
Last active February 15, 2024 21:32
Debian 12 Packages
jftuga /
Created August 26, 2023 18:05
update Pi-hole docker version
CONTAINER=$(docker ps --format "{{.ID}}" --filter name=${IMAGE})
if [ "${#CONTAINER}" -ne "${LENGTH}" ] ; then
echo "No running container for image: ${IMAGE}"
exit 1

Code Golf Challenge

  • Write a program that counts down from 10 (and can either end at 0|1) -- your choice
  • Prints one number per line
  • Can optionally accept a command-line argument
  • No looping constructs are allowed, such a for and while
  • Make it as short as possible, but still readable
  • Please reply with your own solutions, include the programming language
    • Include instructions on how to compile && run
jftuga /
Created March 7, 2023 02:56
Python Decorator
# source:
def currency(fn):
def wrapper(*args, **kwargs):
result = fn(*args, **kwargs)
return f'${result}'
return wrapper
jftuga /
Last active September 2, 2023 14:39
Big vs Small

The biggest of the big vs the smallest of the small

Comparing the highlighted sentences in each article


Hercules–Corona Borealis Great Wall

  • The Hercules–Corona Borealis Great Wall or simply the Great Wall is the largest known structure in the observable universe, measuring approximately 10 billion light-years in length (the observable universe is about 93 billion light-years in diameter).


jftuga /
Created January 19, 2023 15:57
create boto3 tags from dict
import json
def create_boto3_tags(all_tags:dict) -> list:
boto3_tags = []
for tag in all_tags:
for key, val in tag.items():
boto3_tags.append({"Key": key, "Value": val})
return boto3_tags
jftuga /
Last active October 31, 2023 21:17
Homebrew packages

Must Have

  • brew install bash bat bfs fzf htop jq ripgrep shellcheck tmux ugrep xz


  • brew tap common-fate/granted
  • brew install granted


  • TBD