Skip to content

Instantly share code, notes, and snippets.

Avatar

Dan Langille dlangille

View GitHub Profile
@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
@dlangille
dlangille / 1 - 2020.07.21.17.15.07.000000.24204ab75f8f780d312b56745536862be7120adc.xml
Last active Jul 24, 2020
The Log entry in this XML file is giving me a 'Wide character in subroutine entry' when I try to print it. I'm using XML::Node to parse it. When I call DBI's quote function, I get that error message. I have no idea how to deal with this.
View 1 - 2020.07.21.17.15.07.000000.24204ab75f8f780d312b56745536862be7120adc.xml
<?xml version='1.0' encoding='UTF-8'?>
<UPDATES Version="1.4.0.0">
<UPDATE>
<DATE Year="2020" Month="7" Day="21"/>
<TIME Timezone="UTC" Hour="17" Minute="15" Second="7"/>
<OS Repo="ports" Id="FreeBSD" Branch="master"/>
<LOG>- Add devel/py-trio: Friendly Python library for async concurrency and I/O
The Trio project’s goal is to produce a production-quality,
permissively licensed, async/await-native I/O library for Python.
@dlangille
dlangille / git-delta.sh
Created Jul 7, 2020
FreshPorts git - echo /usr/local/libexec/freshports/git-delta.sh | sudo su -fm freshports
View git-delta.sh
[dan@devgit-ingress01:~/scripts] $ echo /usr/local/libexec/freshports/git-delta.sh | sudo su -fm freshports
2020.07.07 22:20:58 git-delta.sh started
2020.07.07 22:20:58 git-delta.sh repo is /var/db/freshports/ports-jail/var/db/repos/PORTS-head-git
2020.07.07 22:20:58 git-delta.sh XML dir is /var/db/freshports/message-queues/incoming
2020.07.07 22:20:58 git-delta.sh running: /usr/local/bin/git fetch origin
remote: Enumerating objects: 1045, done.
remote: Counting objects: 100% (1045/1045), done.
remote: Compressing objects: 100% (62/62), done.
remote: Total 1913 (delta 985), reused 1041 (delta 982), pack-reused 868
Receiving objects: 100% (1913/1913), 678.31 KiB | 5.34 MiB/s, done.
You can’t perform that action at this time.