Skip to content

Instantly share code, notes, and snippets.

View Kodiologist's full-sized avatar

Kodi Arfer Kodiologist

View GitHub Profile
@Kodiologist
Kodiologist / zephyr_breeze.py
Created December 21, 2023 19:33
Zephyr Breeze, a Ponyvania cheater
#!/usr/bin/env python3
'Zephyr Breeze, a Ponyvania cheater.'
# This program is in the public domain.
# It's tested on the Windows build of Ponyvania v2.0.2.
# Call it with the option `--help` for usage.
import re, subprocess
from pathlib import Path
from tempfile import TemporaryDirectory
@Kodiologist
Kodiologist / example.parquet
Last active July 24, 2023 16:52
Example of writing and reading a Parquet file with XIS temperature predictions
# UPDATE: Instead of using this script, you should probably
# use http://web.archive.org/web/2021id_/https://modis.ornl.gov/files/modis_sin.kmz
#!/usr/bin/env python3
"""
Draw the shapes of tiles used by Moderate Resolution Imaging
Spectroradiometer (MODIS) satellite products. The output is a TSV file
with the shapes as well-known text (WKT) that can be read into QGIS.
"""
@Kodiologist
Kodiologist / rotp_race_rename.py
Created November 4, 2022 18:31
Rename races in Remnants of the Precursors
#!/usr/bin/env python3
# (Requires Python 3.8 or later.)
#
# This script edits a JAR distribution of Remnants of the Precursors
# to rename the game's races. Edit `replacements` below to set
# the new names, or comment out a line to leave that race alone.
# Only English names are changed.
#
# This script was tested with RotP version 1.04.
#
@Kodiologist
Kodiologist / journalctl-bad-boot.txt
Created July 31, 2022 12:50
Example `journalctl` logs for an Ask Ubuntu question
Jul 31 08:42:06 Frost kernel: Linux version 5.15.0-43-generic (buildd@lcy02-amd64-076) (gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #46-Ubuntu SMP Tue Jul 12 10:30:17 UTC 2022 (Ubuntu 5.15.0-43.46-generic 5.15.39)
Jul 31 08:42:06 Frost kernel: Command line: BOOT_IMAGE=/boot/vmlinuz-5.15.0-43-generic root=UUID=2634c2da-e3dc-4f9b-9a95-db104146b26f ro quiet splash vt.handoff=7
Jul 31 08:42:06 Frost kernel: KERNEL supported cpus:
Jul 31 08:42:06 Frost kernel: Intel GenuineIntel
Jul 31 08:42:06 Frost kernel: AMD AuthenticAMD
Jul 31 08:42:06 Frost kernel: Hygon HygonGenuine
Jul 31 08:42:06 Frost kernel: Centaur CentaurHauls
Jul 31 08:42:06 Frost kernel: zhaoxin Shanghai
Jul 31 08:42:06 Frost kernel: x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
Jul 31 08:42:06 Frost kernel: x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
@Kodiologist
Kodiologist / smarttemplate4_crack.py
Last active August 22, 2021 12:52
Remove the license check from SmartTemplate4
#!/usr/bin/env python3
# (Requires Python 3.8 or later.)
#
# Remove the license check from the Thunderbird add-on SmartTemplate4:
# https://github.com/RealRaven2000/SmartTemplate4
# This script is up to date as of SmartTemplate4 version 3.7.
#
# Usage: python3 smarttemplate4_crack.py INPUT_XPI_PATH OUTPUT_PATH
import sys, re
@Kodiologist
Kodiologist / cata_weather.hy
Last active October 19, 2019 18:06
Compare Cataclysm DDA's weather to real weather
; Compare a debug weather log generated by Cataclysm DDA to real
; data from the NOAA dataset Local Climatological Data (LCD).
; The data is downloaded automatically.
;
; Dependencies:
; - pandas
; - matplotlib
; - metpy
; - https://github.com/Kodiologist/Kodhy
@Kodiologist
Kodiologist / mune.py
Created August 25, 2019 14:50
Madey Upy Namey Emulator (MUNE)
#!/usr/bin/env python3
"""
A simple implementation of the Madey Upy Namey Emulator (MUNE;
https://homebrewery.naturalcrit.com/share/rkmo0t9k4Q ).
Usage examples:
$ python3 -i mune.py
@Kodiologist
Kodiologist / embedder.py
Last active June 12, 2019 15:54 — forked from Matjaz-B/embedder.py
Embed images into an HTML document with data URIs
#!/usr/bin/env python3
"""
Embed images into an HTML document
"""
import base64, mimetypes, re, sys
## from https://gist.github.com/jsocol/1089733
def img_to_data(path):
"""Convert a file (specified by a path) into a data URI."""
@Kodiologist
Kodiologist / citibank_extra.pl
Created November 22, 2016 21:21
Citibank.com scraping: XYZ_Extra, XXX_Extra
# Compute the values of the extra fields XXX_Extra and
# XYZ_Extra. This requires munging some deliberately
# obfuscated code.
#
# Sometimes XXX_Extra and XYZ_Extra aren't provided (hence the
# "if"), in which case we don't need them.
my %extra_fields;
if ($body =~ m{
<script \s type="text/javascript"> \x0d \x0a
(function .+?)