Skip to content

Instantly share code, notes, and snippets.

View turnipsoup's full-sized avatar
🍎

Jeremy Heckt turnipsoup

🍎
View GitHub Profile
@rogerallen
rogerallen / us_state_abbrev.py
Last active January 6, 2026 15:06
A Python Dictionary to translate US States to Two letter codes
# United States of America Python Dictionary to translate States,
# Districts & Territories to Two-Letter codes and vice versa.
#
# Canonical URL: https://gist.github.com/rogerallen/1583593
#
# Dedicated to the public domain. To the extent possible under law,
# Roger Allen has waived all copyright and related or neighboring
# rights to this code. Data originally from Wikipedia at the url:
# https://en.wikipedia.org/wiki/ISO_3166-2:US
#
@juanplopes
juanplopes / rsa.py
Last active July 14, 2023 17:35
RSA by example
from random import randint
#----Step 1
# First, choose two random primes.
# In real world, they should be really big primes (hundreds of digits).
p, q = 41, 47
#----Step 2
# From them we have n=p*q and phi(n)=(p-1)*(q-1).
@haskaalo
haskaalo / tarcheatsheet.md
Last active January 29, 2026 04:31
Tar usage / Tar Cheat Sheet

Tar Usage / Cheat Sheet

Compress a file or directory

e.g: tar -czvf name-of-archive.tar.gz /path/to/directory-or-file

  • -c: Create an archive.
  • -z: Compress the archive with gzip.
  • -v: makes tar talk a lot. Verbose output shows you all the files being archived and much.
  • -f: Allows you to specify the filename of the archive.
@turnipsoup
turnipsoup / index.html
Created April 23, 2018 15:53
phone-number-cleaner
<head>
<title>Phone Number Cleaner</title>
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</head>
<div class='main-holder text-center'>
@turnipsoup
turnipsoup / hanoi.go
Created February 14, 2020 20:39
The hanoi problem recursion solver from this computerfile video (but ported to Go): https://www.youtube.com/watch?v=8lhxIOAfDss&t=629s
package main
import (
"fmt"
"os"
"strconv"
)
func main() {
total_discs, _ := strconv.Atoi(os.Args[1])
@satmandu
satmandu / make_current_arm64_rpi_kernel_debs.sh
Last active September 25, 2024 03:44
Make arm64 deb packages for the offical Raspberry Pi Foundation arm64 kernels, tested with ubuntu 23.04
#!/bin/bash -x
# make_arm64_rpi_kernel_debs.sh
# Builds arm64 debian packages from the CURRENT rpi firmware repository kernel which is installed by:
# sudo rpi-update
# This runs on an arm64 host with arm64 compilation tools...
# or with some sort of cross-compilation setup.
# Debs are put in $workdir/build
#
# This will NOT work in Raspbian unless you have an arm64 compilation
# environment setup. Appears to work on
@turnipsoup
turnipsoup / rsa_solver.py
Last active June 30, 2020 23:27
RSA Solver
# Sources
# https://stackoverflow.com/questions/4643647/fast-prime-factorization-module
# https://stackoverflow.com/questions/49856115/inverse-of-a-powa-b-n-function-in-python-decryption-code
# Solutions on cryptohack.org
## Imports
import binascii
import base64
from Crypto.Util.number import inverse, bytes_to_long, long_to_bytes
from sympy.ntheory import factorint
@turnipsoup
turnipsoup / pihole-docker-compose.yaml
Last active February 12, 2021 19:47
Script for running and updating a Pihole docker container. You use the same script the first time you start it up as well.
version: "3"
# More info at https://github.com/pi-hole/docker-pi-hole/ and https://docs.pi-hole.net/
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
ports:
- "53:53/tcp"
- "53:53/udp"
@turnipsoup
turnipsoup / ps5-finder.py
Created June 23, 2021 14:41
Script we used to alert us if the PS5 was in stock. You need a Discord webhook.
import requests, logging
import pandas as pd
import bs4 as bs
logging.basicConfig(filename="./ps5search.log", level=logging.INFO, format="%(asctime)s|%(levelname)s|%(message)s")
# Define the base URL and the webhook URL
stock_url = "https://www.nowinstock.net/videogaming/consoles/sonyps5/"
webhook_url = "<Discord_Webhook_URL>"
@iosifnicolae2
iosifnicolae2 / Readme.md
Last active December 7, 2025 19:52
Youtube is Boring

How To Make Youtube Less Boring

Tutorial: https://www.youtube.com/watch?v=hIqMrPTeGTc
Paste the below code in your browser console (F12 > Console):

/**
 * YouTube "Not Interested" Automation Script
 *
 * This script marks all videos in the YouTube feed as "Not interested".
 *
 * Usage: