Skip to content

Instantly share code, notes, and snippets.

💭
Working on https://github.com/dlangille/thin_to_thick

Dan Langille dlangille

💭
Working on https://github.com/dlangille/thin_to_thick
Block or report user

Report or block dlangille

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dlangille
dlangille / ada2
Last active Jul 19, 2019
zuul drive upgrade
View ada2
[dan@zuul:~] $ sudo smartctl -a /dev/ada3
smartctl 7.0 2018-12-30 r4883 [FreeBSD 12.0-RELEASE-p7 amd64] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Western Digital RE4
Device Model: WDC WD5003ABYX-18WERA0
Serial Number: WD-WMAYP6365619
LU WWN Device Id: 5 0014ee 0ae4bf9c6
Add. Product Id: DELL(tm)
@dlangille
dlangille / the details
Last active Jul 17, 2019
Upgrading packages after major upgrade
View the details
# For me, I need to update this file and adjust the repo it uses.
/usr/local/etc/pkg/repos/local.conf
#
#e.g:
#
#local: {
# url: "pkg+http://fedex.unixathome.org/packages/120amd64-default-master-list/"
# mirror_type: "srv",
@dlangille
dlangille / pfSense
Last active Jun 25, 2019
When IPv6 he.net Hurricane Electric connection is down
View pfSense
1 - See if you can ping the he.net tunnel point:
$ ping 209.51.161.14
PING 209.51.161.14 (209.51.161.14): 56 data bytes
64 bytes from 209.51.161.14: icmp_seq=0 ttl=59 time=13.276 ms
64 bytes from 209.51.161.14: icmp_seq=1 ttl=59 time=9.800 ms
^C
--- 209.51.161.14 ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 9.800/11.538/13.276/1.738 ms
@dlangille
dlangille / pkg
Created Jun 21, 2019
Upgrading jail after updating the OS within the jail
View pkg
alter /usr/local/etc/pkg/repos/local.conf to use new jail
pkg-static install -f pkg
pkg upgrade -f
pkg autoremove
# the above should have upgrade all packages and the following check verifies it.
# any package not upgraded, needs to be built, and added to the build list.
pkg query -a '%n %t' | awk -v t=$(date -v -6H +%s) '$2 < t { print $1 }'
View compare list of drives in system against those specified in periodic.conf
#!/bin/sh
# list of drives in the system
DRIVES=`/sbin/sysctl -n kern.disks | /usr/bin/xargs -n 1 | /usr/bin/sort`
# the list we are checking for
PERIODIC=`/usr/sbin/sysrc -nf /etc/periodic.conf daily_status_smart_devices | /usr/bin/xargs -n 1 | /usr/bin/sed 's/\/dev\///g' | /usr/bin/sort`
#if [ "${DEV_DISKS}" == "${CHECKED}" ]
if [ "${DRIVES}" == "${PERIODIC}" ]
View make buildkernel
cc -target x86_64-unknown-freebsd12.0 --sysroot=/usr/obj/usr/src/amd64.amd64/tmp -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin -shared -nostdlib hack.c -o hack.pico
rm -f hack.c
MAKE="/usr/obj/usr/src/make.amd64/bmake" sh /usr/src/sys/conf/newvers.sh "-R" GENERIC
cc -target x86_64-unknown-freebsd12.0 --sysroot=/usr/obj/usr/src/amd64.amd64/tmp -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin -c -O2 -pipe -fno-strict-aliasing -g -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -I/usr/src/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-er
View schedule
Scheduled Jobs:
Level Type Pri Scheduled Job Name Volume
===================================================================================
Full Backup 10 09-Jun-19 14:22 x8dtu basic FullAuto-3580
Full Backup 10 09-Jun-19 14:22 r710-01 jail snapshots FullAuto-3580
Full Backup 10 09-Jun-19 14:22 r710-01 basic FullAuto-3580
Full Backup 10 09-Jun-19 14:22 supernews FullAuto-3580
Full Backup 10 09-Jun-19 14:22 supernews basic FullAuto-3580
Full Backup 10 09-Jun-19 14:22 svn everything FullAuto-3580
Full Backup 10 09-Jun-19 14:22 svn basic FullAuto-3580
@dlangille
dlangille / Updating System
Created Jun 9, 2019
pfSense upgrade from 2.4.4_2 to 2.4.4_3 - 2019.06.09
View Updating System
>>> Updating repositories metadata...
Updating pfSense-core repository catalogue...
pfSense-core repository is up to date.
Updating pfSense repository catalogue...
pfSense repository is up to date.
All repositories are up to date.
>>> Removing vital flag from lang/php72... done.
>>> Downloading upgrade packages...
Updating pfSense-core repository catalogue...
pfSense-core repository is up to date.
@dlangille
dlangille / pushovernet.sh
Last active May 13, 2019
using pam_exec to send pushover.net notifications of all logins (ssh, scp)
View pushovernet.sh
Credit to @feldpos for providing the original version of this file, designed for inclusion into a .bashrc etc file
$ ls -l /etc/pam.d/pushovernet.sh
-rwxr-xr-x 1 root wheel 485 Mar 22 14:48 /etc/pam.d/pushovernet.sh
$ cat /etc/pam.d/pushovernet.sh
#!/bin/sh
(if [ "${PAM_SM_FUNC}" == "pam_sm_open_session" ]; then
P_KEY="YOUR USER KEY HERE"
P_TOKEN="YOUR APP TOKEN HERE"
P_MSG="${PAM_USER} logged in to $(hostname) from ${PAM_RHOST} via ${PAM_SERVICE}"
@dlangille
dlangille / Steps
Last active Apr 12, 2019
Moving from private IMAP to third party IMAP
View Steps
* Convert from maildrop to seive: https://www.mail-archive.com/dovecot@dovecot.org/msg40469.html
* Configure MX: https://www.fastmail.com/help/receive/domains-setup-mxonly.html
* imapsync
* deltest account let it keep forwarding to mailjail.langille.org
If I do the imapsync, will I lose the Fastmail mail?
You can’t perform that action at this time.