Skip to content

Instantly share code, notes, and snippets.

View Xunnamius's full-sized avatar
🐕

Bernard Xunnamius

🐕
View GitHub Profile
@Xunnamius
Xunnamius / fake-news-blocker.js
Created January 18, 2025 16:34
Block fake news from appearing on currentstatus.io (a tampermonkey script)
// ==UserScript==
// @name Fake News Blocker
// @namespace http://tampermonkey.net/
// @version 2024-04-04
// @description try to take over the world!
// @author You
// @match https://currentstatus.io/
// @icon https://www.google.com/s2/favicons?sz=64&domain=currentstatus.io
// @grant none
// ==/UserScript==
@Xunnamius
Xunnamius / colortest.py
Last active January 14, 2025 10:32 — forked from justinabrahms/colortest.py
Small utility to test terminal support for 256-color output. Updated for Python 3.
#!/usr/bin/env python
# Ported to Python from http://www.vim.org/scripts/script.php?script_id=1349
print("Color indexes should be drawn in bold text of the same color.")
print()
colored = [0] + [0x5f + 40 * n for n in range(0, 5)]
colored_palette = [
"%02x/%02x/%02x" % (r, g, b)
for r in colored
@Xunnamius
Xunnamius / gh-prune-upstream-tags.sh
Last active November 24, 2024 15:07
Clean up any tag mess when fetching from upstream when you're operating on a downstream fork
# Clean up the mess of tags that came in from upstream
git push upstream --delete $(git ls-remote --tags upstream | grep "YOUR_TAG_PREFIX_HERE.*[^}]$" | cut -f 2)
# Depending on the use case and tag format, other forms may be more appropriate, e.g.:
git tag --delete $(git ls-remote --tags upstream | cut -f 2 | cut -f 3 -d /)
# Stop git from pulling tags from upstream in the future
git config remote.upstream.tagopt --no-tags
@Xunnamius
Xunnamius / gh-renovate-old-style-tags-into-scoped-tags.sh
Last active November 10, 2024 03:46
Takes the old-style "v$version" tags and creates aliases to the same commits using monorepo-safe scoped tags (e.g. "my-package@$version" and "@my/package@$version"
#! /bin/sh
# Note that gh! is an alias for gh
# v1.0.0 is the old-style tag, @package/[email protected] is the monorepo-safe version
git tag -m 'alias => v1.0.0' '@package/[email protected]' 'v1.0.0^{}'
@Xunnamius
Xunnamius / gh-cleanup-release-tags.sh
Last active November 24, 2024 15:32 — forked from joejordanbrown/gh-cleanup-releases-tags.sh
GitHub cli - delete all releases and tags in a repo
#! /bin/sh
# Note that gh! is an alias for gh
for release in $(gh! release list 2>/dev/null | awk '{print $1}'); do
if gh! release delete $release -y | cat; then
echo '✓ Deleted release' $release
else
echo '⤫ FAILED to delete release' $release
fi
done
@Xunnamius
Xunnamius / no-msnbc-navbar.js
Created May 2, 2024 22:41
Regain control by popping the shaka player video element out of the Next.js app that MSNBC uses to stream their live content.
// ==UserScript==
// @name Remove the trash from MSNBC navbar
// @namespace http://tampermonkey.net/
// @version 2024-01-27
// @description try to take over the world!
// @author You
// @match https://*.msnbc.com/*
// @exclude https://*.msnbc.com/sigma.html*
// @noframes
// @icon https://www.google.com/s2/favicons?sz=64&domain=msnbc.com
@Xunnamius
Xunnamius / cloudflare.conf
Last active April 7, 2025 06:23
Fail2ban action.d for Cloudflare meant to replace the version that ships with fail2ban currently. This updated version of the action uses Cloudflare's 2023 v4 API (free tier WAF + free tier WAF lists) to ban hostile IPs.
# This version works with CF WAF (using zone rulesets) and obsoletes previous
# versions. This works will all CF account types. This action depends on curl
# and jp and will add/remove IPs from the $known_hostile_ips list. Creating the
# WAF rules need only be done once per zone. Creating the list need only be done
# once per account.
#
# Author: Bernard Dickens III (Xunnamius)
#
# Inspired by work from: Mike Rushton
# https://github.com/fail2ban/fail2ban/blob/master/config/action.d/cloudflare.conf
@Xunnamius
Xunnamius / pz_sp_mod_order.md
Last active February 10, 2024 23:58
Mod load order for Project Zomboid 41

You can skip combing through these settings and copying them over one-by-one if you instead place/overwrite the saved_modlists.txt and modmanager-mods.txt files into your C:\Users\(your username)\Zomboid\Lua folder. When you next start the game, load the "Essential" mod preset in the game's Mods menu for a Single Player game. Load the "Multiplayer" mod preset if you're playing on my server.

These mods are listed in ascending order of priority, meaning mod #1 must have lowest relative priority (i.e. nearest the top of your mod load order list) and will have any conflicting code be overridden by the mods that come after it.

For map mods, however, this is reversed! The map mod that loads first claims its cells first, meaning it has the highest priority. This is why St. Bernard's Hill is the last map mod in its block but Common Sense is

@Xunnamius
Xunnamius / pz_sp_recommendations.md
Last active April 8, 2023 03:21
Recommendations for Project Zomboid 41

These suggestions assume you've enabled ALL mods from this collection.

Generic Suggestions

  • Consider giving Project Zomboid more memory. If you do this, you might also need to raise the ProjectZomboid64.exe process priority in Windows to prevent the game from being killed by the OS.

  • Set the Save Our Stations mod settings to "reliable" Edit the SteamLibrary\steamapps\workshop\content\108600\2398274461\mods\Save Our Station - Core\media\lua\shared\SWWS_Config.lua file (wherever you have it located) and change the following two lines to the listed values: ... What this will do is make the "breakdown" events about 4x less likely to happen, so they'll happen every couple months instead of every couple weeks.

  • Ensure 2X texture size option is enabled or some mods will not function properly

@Xunnamius
Xunnamius / pz_sp_changelog.md
Last active May 12, 2023 09:40
A list of changes between versions of this Project Zomboid collection

Only the addition and subtraction of mods will be listed here. To see how each gist changed, check out their respective "Revisions" tab.

  • [05/12/2023] Added several mods: Improvized Silencers by Maxwell218, Improved Muzzle Flash, WeBuildZ: Barricade, Gun Stock Attack [READ DESC], Cheval de frise, Barricade Hurt Zombies, Easy Engine Rebuild, AutoMechanics, CorpseStudy (fork / remake by ttr), Radial Menu API, Visible Generator Range, Generator Time Remaining, Nepenthe's Colored Battery Status, Cookie Tile Pack (To Be Continued), Simon MDs Tiles
  • [03/17/2023] Added Generator's magazine without RNG because my character has been alive for 5 months and I still can't find a f@#$ing generator manual.
  • [03/10/2023] Added Big Noise Generator and Long Range Remote mods
  • [03/08/2023] Added [How Strong Is That W