Skip to content

Instantly share code, notes, and snippets.

@jim-p
jim-p / pkg-option-diff.sh
Created December 3, 2023 20:07
Script to check options for software compiled from ports for changed/non-standard options
#!/bin/sh
for p in $(pkg upgrade -n | grep 'options changed' | awk '{print $1}'); do
pkg_name=$(pkg query %n ${p})
echo ${pkg_name}
pkg query "%Ok %Ov" ${pkg_name} | while read lkey lval; do
pkg rquery -U "%Ok %Ov" ${pkg_name} | while read rkey rval; do
if [ "${lkey}" = "${rkey}" -a "${lval}" != "${rval}" ]; then
echo -e "\t${lkey}\t${lval}\t${rval}\n"
diff --git a/src/usr/local/www/system_authservers.php b/src/usr/local/www/system_authservers.php
index 297d2cf348..42ab9ad81b 100644
--- a/src/usr/local/www/system_authservers.php
+++ b/src/usr/local/www/system_authservers.php
@@ -308,9 +308,7 @@ if ($_POST['save']) {
if (!empty($pconfig['ldap_caref'])) {
$server['ldap_caref'] = $pconfig['ldap_caref'];
}
- if (!empty($pconfig['ldap_certref'])) {
- $server['ldap_certref'] = $pconfig['ldap_certref'];
@jim-p
jim-p / openvpn-push-route-gateway.diff
Created January 9, 2018 17:02
OpenVPN tap mode push route-gateway for bridge interface
diff --git a/src/etc/inc/openvpn.inc b/src/etc/inc/openvpn.inc
index 0b7f1fa949..fa240a57d9 100644
--- a/src/etc/inc/openvpn.inc
+++ b/src/etc/inc/openvpn.inc
@@ -950,6 +950,9 @@ function openvpn_reconfigure($mode, $settings) {
} else {
$conf .= "mode server\n";
}
+ if (is_ipaddrv4($biface_ip)) {
+ $conf .= "push \"route-gateway {$biface_ip}\"\n";
@jim-p
jim-p / backup-pretty.diff
Created March 9, 2016 14:55
Add icons to buttons on Diag > Backup & Restore
diff --git a/src/usr/local/www/diag_backup.php b/src/usr/local/www/diag_backup.php
index d499442..5b49019 100644
--- a/src/usr/local/www/diag_backup.php
+++ b/src/usr/local/www/diag_backup.php
@@ -664,8 +664,10 @@ $group = new Form_Group('');
// Note: ID attribute of each element created is to be unique. Not being used, suppressing it.
$group->add(new Form_Button(
'Submit',
- 'Download configuration as XML'
-))->setAttribute('id');
@jim-p
jim-p / 20160301.txt
Created March 1, 2016 14:44
OpenSSL Security Advisory [1st March 2016] 20160301.txt (in case their site is unreachable)
OpenSSL Security Advisory [1st March 2016]
=========================================
NOTE: With this update, OpenSSL is disabling the SSLv2 protocol by default, as
well as removing SSLv2 EXPORT ciphers. We strongly advise against the use of
SSLv2 due not only to the issues described below, but to the other known
deficiencies in the protocol as described at
https://tools.ietf.org/html/rfc6176
diff --git a/download/mirror.php b/download/mirror.php
index 44b681a..71cce50 100644
--- a/download/mirror.php
+++ b/download/mirror.php
@@ -277,9 +277,9 @@ if (!$this_cc) {
Platform:
<select name="platform">
<option value="">Select</option>
- <option value="livecd">Live CD with Installer</option>
- <option value="memstick">Live CD with Installer (on USB Memstick)</option>
@jim-p
jim-p / 5895-livecd-snapshots-fix.diff
Created February 17, 2016 19:25
5895-livecd-snapshots-fix.diff
diff --git a/index.html b/index.html
index ebc1e58..544a9b8 100755
--- a/index.html
+++ b/index.html
@@ -89,7 +89,7 @@
</td>
<td>
<h5 class="text-center">2.3 (i386)<br /><span class="red">HIGHLY EXPERIMENTAL</span> pfSense 2.3 developers tree</h5>
- <p class="text-center"><a href="/i386/pfSense_master/livecd_installer/?C=M;O=D">LiveCD/Installer ISOs</a></p>
+ <p class="text-center"><a href="/i386/pfSense_master/installer/?C=M;O=D">Installer Images (ISO, memstick)</a></p>
@jim-p
jim-p / upgrade-console-log.txt
Created January 22, 2016 15:19
upgrade-console-log.txt
Firmware upgrade is complete. Rebooting in 10 seconds.
.Done. Rebooting...
Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20121212/xml.so' - Cannot open "/usr/local/lib/php/20121212/xml.so" in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20121212/dom.so' - Cannot open "/usr/local/lib/php/20121212/dom.so" in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20121212/simplexml.so' - Cannot open "/usr/local/lib/php/20121212/simplexml.so" in Unknown on line 0
@jim-p
jim-p / redmine-5766-fix.diff
Last active January 13, 2016 17:18
Fix for eliminating invalid GIF/GRE gateways of the wrong address family
diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc
index 5ea49a0..88d2b86 100644
--- a/src/etc/inc/interfaces.inc
+++ b/src/etc/inc/interfaces.inc
@@ -5589,7 +5589,9 @@ function interface_has_gateway($friendly) {
}
$tunnelif = substr($ifname['if'], 0, 3);
if ($tunnelif == "gif" || $tunnelif == "gre") {
- return true;
+ if (find_interface_ip($ifname['if'])) {
@jim-p
jim-p / byzanz-record-window.sh
Created September 2, 2015 16:02
byzanz-record-window.sh
#!/bin/bash
# Directory to output the videos
DESTDIR=~/Videos/
# Delay before starting
DELAY=10
# Sound notification to let one know when recording is about to start (and ends)
beep() {