Skip to content

Instantly share code, notes, and snippets.

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

Dan Langille dlangille

View GitHub Profile
@dlangille
dlangille / the SQL
Last active Mar 10, 2019
BSDCan 2019 list of talks
View the SQL
pentabarf_bsdcan=# SELECT DISTINCT E.title, string_agg(S.name,', ') as name
FROM event E, view_event_person P, view_mail_all_speaker S
WHERE E.event_id = P.event_id
AND P.person_id = S.person_id
AND E.conference_id = 15
and E.event_state = 'accepted'
and P.event_role_name = 'Speaker' and P.event_role_state_name = 'confirmed'
group by E.title order by 1;
title | name
----------------------------------------------------------------------------------------------------+--------------------------------------
View 1 - testport mentions
=>> Checking for extra files and directories
=>> Error: Files or directories modified:
%%FP_DATADIR%%/cache user (10001, 80) permissions (0755, 0775)
%%FP_DATADIR%%/cache/daily user (10001, 80) permissions (0755, 0775)
%%FP_DATADIR%%/cache/news permissions (0755, 0775)
@dlangille
dlangille / what's with the warning?
Created Mar 4, 2019
building vendor directory for LibreNMS 1.49
View what's with the warning?
[dan@empty:~/librenms] $ git status
HEAD detached at 1.49
nothing to commit, working tree clean
[dan@empty:~/librenms] $ ./scripts/composer_wrapper.php install --no-dev
> LibreNMS\ComposerHelper::preInstall
Loading composer repositories with package information
Installing dependencies from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Package operations: 76 installs, 0 updates, 0 removals
- Installing symfony/dotenv (v3.4.22): Loading from cache
View 1 - the problem
[dan@slocum:~] $ /usr/local/bin/sudo /usr/local/libexec/nagios/check_smartmon -d /dev/da5
Traceback (most recent call last):
File "/usr/local/libexec/nagios/check_smartmon", line 309, in <module>
(healthStatus, temperature) = parseOutput(healthStatusOutput, temperatureOutput, devtype)
File "/usr/local/libexec/nagios/check_smartmon", line 219, in parseOutput
vprint(3, "Health status: %s" % healthStatus)
UnboundLocalError: local variable 'healthStatus' referenced before assignment
@dlangille
dlangille / ansible-playbook foo.yml
Created Mar 1, 2019
Ansible 2.7.0 with warnings about hostnames
View ansible-playbook foo.yml
$ ansible-playbook foo.yml
[WARNING]: Unable to parse /usr/local/etc/ansible/hosts as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
[WARNING]: Could not match supplied host pattern, ignoring: knew.int.unixathome.org
@dlangille
dlangille / 1 - original version
Last active Mar 1, 2019
Verifying host and jail
View 1 - original version
[dan@x8dtu:~] $ cat /usr/local/libexec/nagios-custom/check_py_iocage_host_vs_jails.sh
#!/bin/sh
exit
HOSTVERSION=`/usr/bin/file /bin/sh`
JAILS=`/usr/local/bin/iocage list -H | /usr/bin/cut -f 2 -w`
ERRORS=''
for jail in ${JAILS}
View gist:db642ea9840c24eaeaaef165acbc4cc4
2019-02-28.03:15:25 zfs destroy main_tank/iocage/jails/x8dtu-pg02.vpn.unixathome.org@snapshot-for-backup
2019-02-28.03:15:30 zfs destroy main_tank/iocage/jails/x8dtu-pg02.vpn.unixathome.org/root@snapshot-for-backup
Feb 28 23:26:31 x8dtu shutdown: reboot by dan:
Feb 28 23:26:31 x8dtu bacula-fd: Shutting down Bacula service: x8dtu-fd ...
Feb 28 23:27:09 x8dtu nrpe[1049]: Caught SIGTERM - shutting down...
Feb 28 23:27:09 x8dtu kernel: .
Feb 28 23:27:09 x8dtu nrpe[1049]: Daemon shutdown
@dlangille
dlangille / nvmecontrol devlist
Last active Feb 27, 2019
MyDigitalSSD BPX Pro 80mm (2280-S3-M) M.2 PCI Express 3.1 x4 (PCIe Gen3 x4) NVMe SSD (256GB (240GB))
View nvmecontrol devlist
[dan@slocum:~] $ sudo nvmecontrol devlist
nvme0: BPXP
nvme0ns1 (228936MB)
View 1 - postgresql logs
Feb 25 03:19:50 pg03 postgres[32645]: [61-22] broken = NULL,
Feb 25 03:19:50 pg03 postgres[32645]: [61-56] , last_commit_id = 740490 where id = 34294
Feb 25 03:19:51 pg03 postgres[32648]: [65-22] broken = NULL,
Feb 25 03:19:51 pg03 postgres[32648]: [65-56] , last_commit_id = 740613 where id = 34294
Feb 25 03:19:57 pg03 postgres[32658]: [61-22] broken = NULL,
Feb 25 03:19:57 pg03 postgres[32658]: [61-56] , last_commit_id = 740587 where id = 34294
Feb 25 03:21:10 pg03 postgres[32645]: [71-22] broken = NULL,
@dlangille
dlangille / 0 zpool status
Created Feb 15, 2019
The slow scrub returns
View 0 zpool status
[dan@slocum:~] $ zpool status system
pool: system
state: ONLINE
scan: scrub in progress since Thu Feb 14 03:43:34 2019
1.80T scanned at 23.3M/s, 1.44T issued at 18.6M/s, 6.10T total
0 repaired, 23.65% done, 3 days 00:51:32 to go
config:
NAME STATE READ WRITE CKSUM
system ONLINE 0 0 0
You can’t perform that action at this time.