Skip to content

Instantly share code, notes, and snippets.

View dlangille's full-sized avatar

Dan Langille dlangille

View GitHub Profile
@dlangille
dlangille / Testing with file-based devices
Last active November 19, 2025 23:03
can I reduce the size of a mirror zpool?
# Will this work with disk-based devices which use partitions?
# Instead of /tmp/0.raw, using /dev/adap3?
# create some 500M devices:
root@r730-04:/tmp # for i in $(seq 10 13) ; do truncate -s 500M $i.raw ; done
# and some 1G devices:
root@r730-04:/tmp # for i in $(seq 0 3) ; do truncate -s 1G $i.raw ; done
@dlangille
dlangille / need to run lnms migrate
Created July 16, 2025 13:16
librenms 25.7.0 after upgrading from 25.6.0
[13:08 besser dvl ~] % sudo su -fm www
[%F{cyan}%B%T%b%f %F{magenta}%m%b%f %F{green}%B%n%b%f %F{magenta}%B%~%b%f] %#%b%f lnms migrate
APPLICATION IN PRODUCTION.
┌ Are you sure you want to run this command? ──────────────────┐
│ Yes │
└──────────────────────────────────────────────────────────────┘
@dlangille
dlangille / 1 - I plan to turn these off
Last active June 6, 2025 22:21
Periodic things to turn off in FreeBSD jails
# after reviewing /etc/defaults/periodic.conf I have decided
# to disable these items in jails
daily_status_disks_enable="NO"
daily_status_network_enable="NO"
daily_status_uptime_enable="NO"
# not needed on jails
daily_ntpd_leapfile_enable="NO"
@dlangille
dlangille / install.sh
Last active April 15, 2025 11:01
ZFS root install
# Based on http://www.aisecure.net/2012/01/16/rootzfs/ and
# @vermaden's guide on the forums
# set your disks here
DISKS="ada0 ada1"
# where will we fetch the install from?
FTPURL="ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/10.1-RELEASE"
# the hostname this computer will have:
[20:28 r730-01 dvl ~] % iperf3 -s
-----------------------------------------------------------
Server listening on 5201 (test #1)
-----------------------------------------------------------
Accepted connection from 10.8.1.180, port 64077
[ 5] local 10.55.0.141 port 5201 connected to 10.8.1.180 port 64078
[ ID] Interval Transfer Bitrate
[ 5] 0.00-1.06 sec 23.4 MBytes 185 Mbits/sec
[ 5] 1.06-2.06 sec 22.4 MBytes 188 Mbits/sec
[ 5] 2.06-3.01 sec 21.4 MBytes 188 Mbits/sec
@dlangille
dlangille / boot via serial
Created November 2, 2015 23:17
Resetting the password on a Extreme Networks Summit X450e-48t switch and then doing some config
A usual boot:
Extreme Networks
Running Power On Self Test ...Passed
* Summit X *
Version 1.0.5.6 Branch trunk by release-manager on Fri 04/17/09
Copyright 2003-2009, Extreme Networks, Inc.
Single Processor System Initializing...
@dlangille
dlangille / 1 - the script
Last active December 24, 2024 19:26
about 192,000 distfiles
[16:43 r720-02-ingress01 dvl ~] % cat /jails/freshports/list-old-distfiles.sh
#!/bin/sh
PORTSDIR=/usr/ports
cut -d \| -f 2 ${PORTSDIR}/INDEX* | while read d; do cd $d && make -V ALLFILES | tr " " "\n" | grep -v '^$' || : ; done
@dlangille
dlangille / create.sh
Last active December 6, 2024 13:35
snmp v3 clients for LibreNMS
For more up to date information, see https://dan.langille.org/2023/08/16/configuration-of-net-mgmt-net-snmpd-on-freebsd/
Do this on the snmpd client:
service snmpd stop
net-snmp-config --create-snmpv3-user -ro -A 'AuthPass' -X 'PrivPass' -a SHA -x AES MyRoGroup
chmod go-rwx /var/net-snmp/snmpd.conf /usr/local/share/snmp/snmpd.conf
verify MyRoGroup is in /usr/local/share/snmp/snmpd.conf
freshports.dev=# select * from package_flavors where port_id = 6458 order by flavor_id;
id | port_id | flavor_id | name | flavor_number
-----+---------+-----------+--------------------+---------------
436 | 6458 | 43 | bbdb-emacs26 | 0
671 | 6458 | 43 | bbdb-emacs26 | 0
901 | 6458 | 43 | bbdb-emacs26 | 0
977 | 6458 | 43 | bbdb-emacs26 | 0
437 | 6458 | 44 | bbdb-emacs26_canna | 1
978 | 6458 | 44 | bbdb-emacs26_canna | 1
672 | 6458 | 44 | bbdb-emacs26_canna | 1
@dlangille
dlangille / 1 - messages
Created July 7, 2017 18:19
What is this Toshiba HDD?
Jul 7 18:16:59 slocum kernel: mps0: SAS Address for SATA device = 452e361796809487
Jul 7 18:16:59 slocum kernel: mps0: SAS Address from SATA device = 452e361796809487
Jul 7 18:16:59 slocum kernel: (da7:mps0:0:26:0): UNMAPPED
Jul 7 18:16:59 slocum kernel: da7 at mps0 bus 0 scbus0 target 26 lun 0
Jul 7 18:16:59 slocum kernel: da7: <ATA TOSHIBA HDWE150 FP2A> Fixed Direct Access SPC-4 SCSI device
Jul 7 18:16:59 slocum kernel: da7: Serial Number 4725K6DVF57D
Jul 7 18:16:59 slocum kernel: da7: 600.000MB/s transfers
Jul 7 18:16:59 slocum kernel: da7: Command Queueing enabled
Jul 7 18:16:59 slocum kernel: da7: 4769307MB (9767541168 512 byte sectors)