Skip to content

Instantly share code, notes, and snippets.

@jftuga
jftuga / update_firmware_from_ubuntu_or_debian.md
Last active November 13, 2023 13:16
How to Update Firmware on Ubuntu or Debian
@jftuga
jftuga / debian.md
Last active February 15, 2024 21:32
Debian 12 Packages
@jftuga
jftuga / update_pihole_block_lists.sh
Created August 26, 2023 18:05
update Pi-hole docker version
#!/bin/bash
IMAGE=pihole
LENGTH=12
LOG="${0%.*}.log"
CONTAINER=$(docker ps --format "{{.ID}}" --filter name=${IMAGE})
if [ "${#CONTAINER}" -ne "${LENGTH}" ] ; then
echo "No running container for image: ${IMAGE}"
exit 1
fi

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
jftuga / python_decorator.py
Created March 7, 2023 02:56
Python Decorator
# source: https://www.pythontutorial.net/advanced-python/python-decorators/
def currency(fn):
def wrapper(*args, **kwargs):
result = fn(*args, **kwargs)
return f'${result}'
return wrapper
@currency
@jftuga
jftuga / big_vs_small.md
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

Big

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).

Small

@jftuga
jftuga / create_boto3_tags.py
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
jftuga / homebrew_packages1.md
Last active October 31, 2023 21:17
Homebrew packages

Must Have

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

granted

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

jenkins-cli

  • TBD
@jftuga
jftuga / programming_languages_that_natively_support_128_bit_integers.md
Last active December 16, 2022 12:03
Programming languages that natively support 128 bit integers

what programming languages natively support 128 bit integers

2022-12-16

ChatGPT answer:

There are several programming languages that natively support 128-bit integers. Here is a list of some of them:

  • C and C++: C and C++ support 128-bit integers through the __int128 data type, which is defined in the <stdint.h> header file.
  • Java: Java supports 128-bit integers through the java.math.BigInteger class, which can represent integers of any size.
  • Python: Python supports 128-bit integers through the int data type, which can represent integers of any size.
@jftuga
jftuga / bash_strict_mode.md
Created November 28, 2022 13:19 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation