Skip to content

Instantly share code, notes, and snippets.

View Xunnamius's full-sized avatar
🐕

Bernard Xunnamius

🐕
View GitHub Profile
@Xunnamius
Xunnamius / cloudflare.conf
Last active November 12, 2023 20:35
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 / stream-chain.js
Last active April 28, 2023 10:42
Playing around with node streams and the stream-chain package
x = require('stream-json')
chain = require('stream-chain').chain
callbacks = [];
writable = new stream.Writable({
objectMode: true,
write(c, _e, cb) {
console.log('_write');
callbacks.push([c, cb]);
@Xunnamius
Xunnamius / stream-json.mjs
Last active April 28, 2023 10:10
Playing around with node streams and the stream-json package
/* eslint-disable no-console */
import { setTimeout as delay } from 'node:timers/promises';
import { Readable, Writable } from 'node:stream';
import { createWriteStream, renameSync } from 'node:fs';
import { writeFile } from 'node:fs/promises';
import { randomBytes } from 'node:crypto';
import { default as StreamFork } from 'stream-fork';
import { default as StreamChain } from 'stream-chain';
import { default as StreamJson } from 'stream-json';
import { default as StreamJsonDisassembler } from 'stream-json/Disassembler.js';
@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
@Xunnamius
Xunnamius / pz_sp_known_problems.md
Last active March 13, 2023 15:03
Known problems with Project Zomboid 41
  • In Trelai, there is a building on the river (accessible via the boardwalk) that is missing some of its floor tiles, and upon entering the building you'll be immediately "drenched". You might also glitch through the locked reinforced door and be unable to escape. Be careful around this building.

  • Wildberries is a somewhat old map and as such has some glitchy tile issues and some roomes where you might fall through the floor/wall and break a limb or die, so be very very careful as you move around!

  • Seems like Sam Fisher's Night Vision Googles (from Brita's mod) are not working. Might consider adding in a working NVG mod.

  • One or more of the mods have a VRAM leak. Might be Brita's mods, might be one of the map mods. Either way, after 48-96 hours of continuous gameplay, make sure to keep an eye on your VRAM usage levels. Once you have less than a gig rema

@Xunnamius
Xunnamius / pz_sp_sandbox_settings.md
Last active July 23, 2023 19:01
Suggested sandbox settings for Project Zomboid 41

Anything unlisted was left at default.

Warning! These are pretty hardcore settings (to me), but they're not insane if you're skilled or like a challenge.

You can skip all of this and just load all these settings easily as a preset by adding the Fear The Dark (SP).cfg file under C:\Users\(your username)\Zomboid\Sandbox Presets\Fear The Dark (SP).cfg and then loading the preset in the sandbox settings menu.

  • Population > Zombie Count: High
  • Time > Start Time: 12am (more time to loot, can catch the early fishing show on TV, easier to count in-game days)
  • Nature > Erosion Speed: Slow
  • Sadistic AI Director > Helicopter: Sometimes (I think Expanded Helicopter Events mod overrides this, but just in case)
@Xunnamius
Xunnamius / introrx.md
Created November 3, 2022 20:24 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@Xunnamius
Xunnamius / ANSI-Test.sh
Created October 21, 2022 07:09 — forked from mxmerz/ANSI-Test.sh
Shell script to test support of ANSI color and style codes
# ANSI Start Codes
# Styles.
Normal="\x1b[0m"
Bold="\x1b[1m"
Faint="\x1b[2m"
Italic="\x1b[3m"
Underline="\x1b[4m"
Blink_Slow="\x1b[5m"
Blink_Rapid="\x1b[6m"