Skip to content

Instantly share code, notes, and snippets.

@marfillaster
marfillaster / 00-tldr-default-config-dual-wan-pcc-recursive-failover.md
Last active May 6, 2026 20:55
MikroTik RouterOS v7 dual DHCP WAN recursive failover w/ PCC load-balancing; and recursive ECMP

TL;DR: Default-Config Dual WAN PCC + Recursive Failover

This paste assumes a hardware MikroTik RouterBOARD with the standard MikroTik default config — hAP, hEX, RB5009-class, etc. — where ether1 is the WAN port and ether2 through etherN are LAN bridge ports. The paste removes ether2 from the LAN bridge and turns it into WAN2.

If your router is not in that default state — CHR, multi-WAN appliances, anything reconfigured, or anything where ether1 is not your WAN — read the full guide and substitute interface names. The lab report's §8.7 TL;DR validation shows the kind of remap CHR needs before this paste is safe.

Resulting layout after the paste:

WAN1 = ether1, DHCP
@geerlingguy
geerlingguy / increase-pci-bar-space.sh
Last active March 17, 2026 17:36
Increase the BAR memory address space for PCIe devices on the Raspberry Pi Compute Module 4
#!/bin/bash
# The default BAR address space available on the CM4 may be too small to allow
# some devices to initialize correctly. To avoid 'failed to assign memory'
# errors on boot, you can increase the range of the PCIe bus in the Raspberry
# Pi's Device Tree (a .dtb file specific to each Pi model).
#
# You should probably read up on Device Trees if you don't know what they are:
# https://www.raspberrypi.org/documentation/configuration/device-tree.md
#
#!/usr/bin/env python3
# coding=utf8
#
# Simple script to scale a KiCad footprint
# Usage:
# python kicad-resize-footprint.py <input.kicad_mod> <output.kicad_mod> <scale>
#
# Where scale is how much to scale (1 = 100%)
#
# Copyright (C) 2020, Uri Shaked.
@pezz
pezz / renoise.md
Last active September 7, 2025 14:56
How to use Renoise on a system without f*#$ing it over and doing your head in
@udoprog
udoprog / mumble-broadcast
Created August 23, 2013 20:56
Send a broadcast message to all members on a mumble server
#!/usr/bin/env python
import dbus
import collections
import sys
import os
if __name__ == "__main__":
if len(sys.argv) < 2:
print "Usage: mumble-broadcast <message>"
sys.exit(1)
@Coopeh
Coopeh / nginx-multiple-if.conf
Created January 25, 2013 19:42
How to use multiple if statements in Nginx
set $posting 0; # Make sure to declare it first to stop any warnings
if ($request_method = POST) { # Check if request method is POST
set $posting N; # Initially set the $posting variable as N
}
if ($geoip_country_code ~ (BR|CN|KR|RU|UA) ) { # Here we're using the Nginx GeoIP module to block some spammy countries
set $posting "${posting}O"; # Set the $posting variable to itself plus the letter O
}
@schlamar
schlamar / processify.py
Last active December 4, 2025 10:37
processify
import os
import sys
import traceback
from functools import wraps
from multiprocessing import Process, Queue
def processify(func):
'''Decorator to run a function as a process.
Be sure that every argument and the return value