Skip to content

Instantly share code, notes, and snippets.

Avatar

Dan Langille dlangille

View GitHub Profile
View upgrade
[dan@knew:~/src/mkjail] $ sudo ./src/bin/mkjail upgrade -v 13.0-RELEASE -j ansible
Upgrading ansible jail from - to 13.0-RELEASE...
D /etc/amd.map
D /etc/newsyslog.conf.d/amd.conf
D /etc/rc.d/amd
D /etc/rc.d/nsswitch
D /etc/rc.d/timed
U /etc/auto_master
U /etc/autofs/include_ldap
@dlangille
dlangille / patch-snort-3.1.5.0
Created May 21, 2021
This patch allows snort to again build on FreeBSD
View patch-snort-3.1.5.0
diff --git a/security/snort3/Makefile b/security/snort3/Makefile
index 200f008f8831..a612712b2e60 100644
--- a/security/snort3/Makefile
+++ b/security/snort3/Makefile
@@ -1,8 +1,7 @@
# Created by: Mark Felder <feld@FreeBSD.org>
PORTNAME= snort
-DISTVERSION= 3.1.3.0
-PORTREVISION= 1
View 1 - the file
[dan@aws-1:~] $ cat /usr/local/etc/sanoid/sanoid.conf
# by default, don't snapshot anything in here
[data01]
recursive = yes
use_template = ignore
[data01/freshports/ingress01/var/db/freshports/message-queues]
use_template = repos
@dlangille
dlangille / gist:20349b1ecd6c708eb566d6a8b31b7892
Last active Jan 26, 2021
could not load library "/usr/local/lib/postgresql/llvmjit.so"
View gist:20349b1ecd6c708eb566d6a8b31b7892
freshports.org=# SELECT DISTINCT
freshports.org-# PA.category,
freshports.org-# PA.name AS port,
freshports.org-# coalesce(V.date_modified, V.date_entry, V.date_discovery) AS
freshports.org-# date,
freshports.org-# V.vid,
freshports.org-# to_char(coalesce(V.date_modified, V.date_entry,
freshports.org(# V.date_discovery)::date, 'Mon DD') AS date_formatted,
freshports.org-# V.date_modified IS NULL AS new,
freshports.org-# lower(name)
@dlangille
dlangille / StripLeadingPrefix
Created Nov 24, 2020
FreshPorts element strip repo head /ports/head /ports/branches/2020Q4
View StripLeadingPrefix
sub StripLeadingPrefix {
# take an element name, and remove the leading /ports/head or /ports/branches/foo from the path name
# for example: /ports/head/lang/yap/Makefile
# /ports/head/lang/yap/files/patch-Makefile.in
# /ports/head/lang/yap/pkg-descr
# split the incoming path up by /
# This will have a leading /, so we wind up with
#
@dlangille
dlangille / History
Created Oct 10, 2020
/dev/gpt didn't take the first time. I don't know why
View History
I got the labels wrong, I was reading dmesg output incorrectly.
41 22:47 gpart modify -l S59VNJ0N631973D -i 1 da3
42 22:47 gpart modify -l S5B3NDFN807386P -i 1 da4
43 22:47 gpart modify -l S59VNS0N809087J -i 1 da5
44 22:47 gpart modify -l S59VNS0N809087J -i 1 da2
45 22:48 gpart modify -l S5B3NDFN807386P -i 1 da5
46 22:48 gpart modify -l S59VNJ0N631973D -i 1 da3
47 22:48 gpart modify -l S5B3NDFN807383E -i 1 da4
View gist:5060e2f1d91e7e1bed9b8ff11784b2ea
diff --git a/src/share/mkjail/update.sh b/src/share/mkjail/update.sh
index ef34aa9..ad6e639 100755
--- a/src/share/mkjail/update.sh
+++ b/src/share/mkjail/update.sh
@@ -25,7 +25,7 @@ _alljails()
echo "Updating ${JAILNAME} jail..."
echo ""
export UNAME_r=$(_get_version)
- freebsd-update -b ${JAILROOT}/${JAILNAME} -f ${JAILROOT}/${JAILNAME}/etc/freebsd-update.conf -F fetch install
+ PAGER=cat freebsd-update -b ${JAILROOT}/${JAILNAME} -f ${JAILROOT}/${JAILNAME}/etc/freebsd-update.conf -F fetch install
View gist:6be88511b778e79c645daf2d8d9fd4de
from /etc/pf.conf:
PUBLIC="ix2"
MYSELF="163.237.218.22"
nat on ix2 from 10.163.0.0/24 to any -> 163.237.218.22
pass in all
@dlangille
dlangille / events
Created Aug 13, 2020
Using the events API to detect commits
View events
[dan@pro02:~] $ curl -H "Authorization: token MYTOKEN" https://api.github.com/repos/freebsd/freebsd/events | grep 0d19f9ca2fba9df8176b5439518a0a7d946b9abd
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 82145 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 "head": "0d19f9ca2fba9df8176b5439518a0a7d946b9abd",
"sha": "0d19f9ca2fba9df8176b5439518a0a7d946b9abd",
"url": "https://api.github.com/repos/freebsd/freebsd/commits/0d19f9ca2fba9df8176b5439518a0a7d946b9abd"
100 82145 100 82145 0 0 205k 0 --:--:-- --:--:-- --:--:-- 204k
[dan@pro02:~] $
credit to cem
@dlangille
dlangille / librenms.1.66.diff
Created Aug 10, 2020
FreeBSD net-mgmt/librenms update to 1.66
View librenms.1.66.diff
Index: Makefile
===================================================================
--- Makefile (revision 544642)
+++ Makefile (working copy)
@@ -2,8 +2,7 @@
# $FreeBSD$
PORTNAME= librenms
-PORTVERSION= 1.65.1
-PORTREVISION= 3