Skip to content

Instantly share code, notes, and snippets.

Avatar

Dan Langille dlangille

View GitHub Profile
@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
View gist:32a2218d5f31b0035fd69fba81cfafc8
[dan@empty:~/librenms] $ ./scripts/composer_wrapper.php install --no-devl --no-dev
> LibreNMS\ComposerHelper::preInstall
Loading composer repositories with package information
Installing dependencies from lock file
Package operations: 83 installs, 0 updates, 0 removals
- Installing symfony/dotenv (v3.4.42): Loading from cache
- Installing amenadiel/jpgraph (3.6.21): Loading from cache
- Installing clue/socket-raw (v1.4.1): Loading from cache
- Installing dapphp/radius (2.5.4): Loading from cache
- Installing voku/portable-ascii (1.5.2): Loading from cache
@dlangille
dlangille / 1 - a problem with the FreeBSD 1.65.1 port
Last active Aug 5, 2020
Creating vendor tarball for LibreNMS 1.66
View 1 - a problem with the FreeBSD 1.65.1 port
[16:35:24] <lnms-discord> <dvlO> We're on 1.65.1 and our Global Settings page is empty, but for @routes.
....
[17:25:47] <lnms-discord> <jellyfrogO> @dvl what happens if you run ./lnms translation:generate?
[17:26:17] *** Joins: Cheeze_It (~Cheeze_It@71-33-223-224.hlrn.qwest.net)
[17:26:25] <lnms-discord> <dvlO> The command "vue-i18n:generate" does not exist.
[17:26:49] <lnms-discord> <dvlO> @jellyfrog that's interesting. something missing from our install?
[17:27:29] <lnms-discord> <murrantO> @dvl devel dependency
[17:28:02] <lnms-discord> <dvlO> is that something I omitted from the vendor file?
@dlangille
dlangille / sudo iocage restart x8dtu-nginx01
Created Jul 25, 2020
Messed up, removed most of jail
View sudo iocage restart x8dtu-nginx01
[dan@x8dtu:/iocage/jails/x8dtu-nginx01/root] $ sudo iocage restart x8dtu-nginx01
* Stopping x8dtu-nginx01
+ Executing prestop OK
+ Stopping services OK
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/iocage_lib/ioc_stop.py", line 189, in __stop_jail__
child], stderr=su.STDOUT)
File "/usr/local/lib/python3.7/site-packages/iocage_lib/ioc_common.py", line 612, in checkoutput
out = su.check_output(*args, **kwargs)
File "/usr/local/lib/python3.7/subprocess.py", line 411, in check_output