Skip to content

Instantly share code, notes, and snippets.

View luckman212's full-sized avatar

Luke Hamburg luckman212

View GitHub Profile
@luckman212
luckman212 / ixl-aspm-disable.sh
Last active September 29, 2026 21:25
INTEL ixl NIC ASPM disabler script for pfSense Shellcmd
#!/bin/sh
# https://forum.opnsense.org/index.php?topic=51174.0
# based on https://github.com/galmeida/opnsense-protectli-vp2440/blob/main/ixl-aspm-disable.sh
MATCH_VENDOR='0x8086'
MATCH_DEVICE='0x1572'
MATCH_SUBDEVICE='0x0000'
CAP_ADDRESS='0xb0'
BITS_TO_CLEAR=$(( (1<<0) | (1<<1) ))
@luckman212
luckman212 / rc.update_urltables.patch
Last active September 28, 2026 20:25
patch for /etc/rc.update_urltables - redmine https://redmine.pfsense.org/issues/17139
--- a/src/etc/rc.update_urltables
+++ b/src/etc/rc.update_urltables
@@ -66,6 +66,7 @@
logger(LOG_INFO, localize_text("%s Starting URL table alias updates", "{$argv[0]}:"));
$filter_reload = false;
+ $changed_urltables = array();
foreach ($todo as $t) {
// Update a specifically named URL table only.
@luckman212
luckman212 / filter.inc.patch
Created September 27, 2026 15:43
filter.inc patch - redmine 16563: https://redmine.pfsense.org/issues/16563
--- a/src/etc/inc/filter.inc
+++ b/src/etc/inc/filter.inc
@@ -4668,10 +4668,10 @@
}
}
$aline['flags'] = "";
- if ($rule['protocol'] == "tcp") {
- if (isset($rule['tcpflags_any'])) {
- $aline['flags'] = "flags any ";
- } else if (!empty($rule['tcpflags2'])) {
@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)) {