Skip to content

Instantly share code, notes, and snippets.

View dlangille's full-sized avatar

Dan Langille dlangille

View GitHub Profile
[dan@slocum:/usr/jails] $ sudo du -ch -d 1 .
38G ./bacula
3.5G ./bacula156
94G ./metrics
3.5G ./bacula164
3.5G ./bacula163
3.5G ./bacula169
3.5G ./bacula151
3.4G ./minion
3.5G ./bacula170
+---------------------+---------------------+------------+--------------+
| Connected (UTC) | Disconnected (UTC) | Connected | Disconnected |
|---------------------+---------------------+------------+--------------+
| 2015-03-25 05:35:34 | 2015-05-02 21:27:47 | 1d 21:27 | 0d 00:00 |
| 2015-05-02 21:39:29 | 2015-05-21 08:16:32 | 18d 10:37 | 0d 00:11 |
| 2015-05-21 08:19:14 | 2015-05-21 08:40:57 | 0d 00:21 | 0d 00:02 |
| 2015-05-21 08:43:22 | Still up | 10d 15:16 | 0d 00:02 |
+---------------------+---------------------+------------+--------------+
bsdcan=# \d person
Table "public.person"
Column | Type | Modifiers
-----------------+-----------------------------+-------------------------------------------------------------
id | integer | not null default nextval('person_id_seq'::regclass)
date_added | timestamp without time zone | not null default ('now'::text)::timestamp(6) with time zone
first_name | text | not null
last_name | text | not null
@dlangille
dlangille / TEMPer
Created June 10, 2015 01:04
The USB thermal sensor when inserted into Raspberry PI 2 running FreeBSD 11.x
[root@dvl ~]#
ugen0.5: <RDing> at usbus0
ukbd0: <RDing TEMPerV1.4, class 0/0, rev 2.00/0.01, addr 5> on usbus0
kbd1 at ukbd0
ums0: <RDing TEMPerV1.4, class 0/0, rev 2.00/0.01, addr 5> on usbus0
@dlangille
dlangille / gist:2261cff553393d9225ed
Created June 10, 2015 01:40
ntpd does not run on FreeBSD 11.x on Rasperberry Pi 2
[root@dvl /var/log]# /usr/sbin/ntpd -n
8 Jun 18:31:52 ntpd[1090]: ntpd 4.2.8p2-a (1): Starting
8 Jun 18:31:52 ntpd[1090]: Command line: /usr/sbin/ntpd -n
8 Jun 18:31:52 ntpd[1090]: proto: precision = 3.645 usec (-18)
8 Jun 18:31:52 ntpd[1090]: Listen and drop on 0 v6wildcard [::]:123
8 Jun 18:31:52 ntpd[1090]: Listen and drop on 1 v4wildcard 0.0.0.0:123
8 Jun 18:31:52 ntpd[1090]: Listen normally on 2 lo0 [::1]:123
8 Jun 18:31:52 ntpd[1090]: Listen normally on 3 lo0 [fe80::1%1]:123
8 Jun 18:31:52 ntpd[1090]: Listen normally on 4 lo0 127.0.0.1:123
8 Jun 18:31:52 ntpd[1090]: Listen normally on 5 ue0 10.66.66.66:123
@dlangille
dlangille / gist:b42209ea16da256d8578
Created June 29, 2015 18:21
When FreshPorts gets hit by torrent seekers
rm garbage
grep '"-" 408 - "-" "-"' /usr/websites/log/freshports.org-access.log | cut -f 1 -d ' ' > garbage
grep Bittorrent /usr/websites/log/freshports.org-access.log | cut -f 1 -d ' ' >> garbage
grep microsoftupdate /usr/websites/log/freshports.org-access.log | cut -f 1 -d ' ' >> garbage
grep 'GET /announce?info_hash=' /usr/websites/log/freshports.org-access.log | cut -f 1 -d ' ' >> garbage
sort garbage | uniq > allbad
sudo mv allbad /usr/local/etc/bittorent-clients
sudo pfctl -t bittorent-clients -T replace -f /usr/local/etc/bittorent-clients
egrep '"-" 408 - "-" "-"|Bittorrent|microsoftupdate|info_hash|GET /iframe.php|GET /feeds/page.php|GET /banners' /usr/websites/log/freshports.org-access.log | cut -f 1 -d ' ' >> garbage
@dlangille
dlangille / gist:c44265adb7b945da30ee
Last active August 29, 2015 14:24
Tape fails to load
$ sudo mtx -f /dev/pass11 load 14
Loading media from Storage Element 14 into drive 0...mtx: Request Sense: Long Report=yes
mtx: Request Sense: Valid Residual=no
mtx: Request Sense: Error Code=70 (Current)
mtx: Request Sense: Sense Key=Not Ready
mtx: Request Sense: FileMark=no
mtx: Request Sense: EOM=no
mtx: Request Sense: ILI=no
mtx: Request Sense: Additional Sense Code = 04
mtx: Request Sense: Additional Sense Qualifier = 01
swap_pager: indefinite wait buffer: bufobj: 0, blkno: 1450, size: 4096
FreeBSD/amd64 (supernews.unixathome.org) (ttyu0)
login: root
swap_pager: indefinite wait buffer: bufobj: 0, blkno: 1450, size: 4096
swap_pager: indefinite wait buffer: bufobj: 0, blkno: 1450, size: 4096
dan=# select datname, pg_size_pretty(pg_database_size(datname)) from pg_database;
datname | pg_size_pretty
----------------+----------------
bacula156 | 8115 kB
template1 | 6835 kB
bacula157 | 8099 kB
postgres | 6835 kB
template0 | 6537 kB
bacula | 122 GB
bacula100 | 7649 kB
@dlangille
dlangille / device.hints
Last active August 29, 2015 14:25
FreeBSD 10.2-BETA: look at line 234 of dmesg.boot: da19: da20 at mps2 bus 0 scbus11 target 4 lun 0
# $FreeBSD: stable/10/sys/amd64/conf/GENERIC.hints 276986 2015-01-11 17:10:07Z nwhitehorn $
hint.fdc.0.at="isa"
hint.fdc.0.port="0x3F0"
hint.fdc.0.irq="6"
hint.fdc.0.drq="2"
hint.fd.0.at="fdc0"
hint.fd.0.drive="0"
hint.fd.1.at="fdc0"
hint.fd.1.drive="1"
hint.atkbdc.0.at="isa"