Skip to content

Instantly share code, notes, and snippets.

View luckman212's full-sized avatar

Luke Hamburg luckman212

View GitHub Profile
@luckman212
luckman212 / rrd.inc.patch
Last active September 18, 2026 19:28
rrd.inc patch V3 - redmine: https://redmine.pfsense.org/issues/17099
--- a/src/etc/inc/rrd.inc
+++ b/src/etc/inc/rrd.inc
@@ -256,20 +256,64 @@
chown($rrddbpath, "nobody");
$rrd_pidfile = g_get('varrun_path') . '/updaterrd.sh.pid';
+ $rrd_lockfile = g_get('varrun_path') . '/updaterrd.sh.lock';
$rrdupdatesh = <<<EOD
#!/bin/sh
@luckman212
luckman212 / rrd.inc.patch
Last active September 18, 2026 19:25
updated rrd.inc patch V2 - redmine: https://redmine.pfsense.org/issues/17099
--- a/src/etc/inc/rrd.inc
+++ b/src/etc/inc/rrd.inc
@@ -256,20 +256,66 @@
chown($rrddbpath, "nobody");
$rrd_pidfile = g_get('varrun_path') . '/updaterrd.sh.pid';
+ $rrd_lockfile = g_get('varrun_path') . '/updaterrd.sh.lock';
$rrdupdatesh = <<<EOD
#!/bin/sh
@luckman212
luckman212 / debug.patch
Created September 17, 2026 23:34
add debug logging header - for pfSense System Patches
--- a/src/usr/local/pfSense/include/www/system_advanced_admin.inc
+++ b/src/usr/local/pfSense/include/www/system_advanced_admin.inc
@@ -55,6 +55,7 @@
$pconfig['sshdkeyonly'] = config_get_path('system/ssh/sshdkeyonly');
$pconfig['sshdagentforwarding'] = config_path_enabled('system/ssh', 'sshdagentforwarding');
$pconfig['quietlogin'] = config_path_enabled('system/webgui', 'quietlogin');
+ $pconfig['debugoutput'] = config_get_path('system/debugoutput');
$pconfig['roaming'] = (config_get_path('system/webgui/roaming', 'enabled') == 'enabled') ? true : false;
$pconfig['sshguard_threshold'] = config_get_path('system/sshguard_threshold', '');
$pconfig['sshguard_blocktime'] = config_get_path('system/sshguard_blocktime', '');
@luckman212
luckman212 / diff.patch
Created September 17, 2026 23:07
pfSense patch: fix System Logs source address if bridge is configured without an IP
--- a/src/etc/inc/interfaces.inc
+++ b/src/etc/inc/interfaces.inc
@@ -6628,19 +6628,23 @@
return NULL;
}
-/****f* interfaces/link_interface_to_bridge
- * NAME
- * link_interface_to_bridge - Finds out a bridge group for an interface
- * INPUTS
--- a/src/etc/inc/rrd.inc 2026-08-31 10:02:52.168340000 -0400
+++ b/src/etc/inc/rrd.inc 2026-08-31 13:18:43.532859000 -0400
@@ -256,21 +256,81 @@
chown($rrddbpath, "nobody");
$rrd_pidfile = g_get('varrun_path') . '/updaterrd.sh.pid';
+ $rrd_lockfile = g_get('varrun_path') . '/updaterrd.sh.lock';
$rrdupdatesh = <<<EOD
#!/bin/sh
--- a/src/etc/inc/gwlb.inc
+++ b/src/etc/inc/gwlb.inc
@@ -2419,19 +2419,19 @@
$a_gateway_item = config_get_path("gateways/gateway_item/{$realid}");
/* NOTE: If gateway ip is changed need to cleanup the old static interface route */
if ($gateway_settings['monitor'] != "dynamic" &&
- !empty($a_gateway_item) &&
- is_ipaddr($a_gateway_item['gateway']) &&
- $gateway['gateway'] != $a_gateway_item['gateway'] &&
- isset($a_gateway_item["nonlocalgateway"])) {
@luckman212
luckman212 / if_ip.php
Last active March 8, 2026 05:34
helper script to return interface IP on pfSense
#!/usr/bin/env php
<?php
require_once('interfaces.inc');
$ifaces = get_configured_interface_with_descr();
asort($ifaces);
$it = trim($argv[1]);
if (empty($it)) {
@luckman212
luckman212 / note.txt
Created February 26, 2026 23:10
video-redmine-16720
hello world!
@luckman212
luckman212 / tscheck.sh
Last active September 15, 2026 16:14
Healthcheck script for Tailscale running on pfSense
#!/bin/sh
QRY='some-hostname-in-your-tailnet.ts.net'
WANT='100.100.101.101' #expected IP address of that host
RESTART=0
SVC_RC_FILE='/usr/local/etc/rc.conf.d/tailscaled'
if [ -e /var/run/booting ]; then
logger -t tailscaled "system is booting: skipping check"
exit 0
#!/bin/zsh --no-rcs
# https://github.com/tailscale/tailscale/issues/18101
# https://gist.github.com/luckman212/356dfc72396b838a055ec10d315b042b
zmodload zsh/datetime
#get a random peer
ts_json=$(tailscale status --json)
all_peers=$(jq '.Peer | to_entries | map(select(.value.DNSName!="")) | map(.value.DNSName)' <<< "$ts_json")