Skip to content

Instantly share code, notes, and snippets.

View dch's full-sized avatar
🛋️

Dave Cottlehuber dch

🛋️
View GitHub Profile
@dch
dch / rsyslog.md
Created September 18, 2017 18:00
how to debug rsyslog

debugging rsyslog

export RSYSLOG_DEBUG=NoStdOut
export RSYSLOG_DEBUGLOG=/var/log/rsyslog/debug.log
/usr/local/sbin/rsyslogd -i /var/run/syslog.pid -f /usr/local/etc/rsyslog.conf -dn
tee -a /var/log/rsyslog/debug.log
@dch
dch / _zerotier_vpn_on_freebsd.md
Last active November 25, 2022 08:26
how to set up FreeBSD as a zerotier.com vpn

I'm using [PORT]net/zerotier[/PORT] for quite some time as a way of getting to my systems from other networks very happily. It works in airports, cafes, and all the usual hostile places we travel to.

It provides a L2 encrypted mesh (a bit like VXLAN I suppose) via a tap interface.

What I'd like to do is to use the ZT network as a VPN - routing all traffic from my FreeBSD laptop and phone through the zerotier layer out to my appointed ZT "VPN Gateway". Basically, translating the linux doc here: https://support.zerotier.com/knowledgebase.php?entry=show&search-for=full&article=ZWFhNWMyMTZjODY1ODcwNmFhZmJjYmRhN2I5MjRhOGQ_ -- into FreeBSD config. BTW https://www.zerotier.com/manual.shtml has a lot of background detail if you're interested.I can get the iphone working, but not the laptop.

What works after configuring zerotier to provide the "default route" is different on each device:

  • the iphone works
  • an apple imac works
[ 394.896]
X.Org X Server 1.18.4
Release Date: 2016-07-19
[ 394.896] X Protocol Version 11, Revision 0
[ 394.896] Build Operating System: FreeBSD 12.0-CURRENT amd64
[ 394.896] Current Operating System: FreeBSD wintermute.skunkwerks.at 12.0-CURRENT FreeBSD 12.0-CURRENT #0 r320546+9ecc1769c831(drm-next): Sun Jul 2 00:10:54 UTC 2017 root@wintermute:/usr/obj/usr/src/sys/GENERIC amd64
[ 394.896] Build Date: 27 May 2017 01:35:38PM
[ 394.896]
[ 394.897] Current version of pixman: 0.34.0
[ 394.897] Before reporting problems, check http://wiki.x.org
set background=dark
hi clear
if exists("syntax_on")
syntax reset
endif
let colors_name = "kraihlight"
# https://raw.githubusercontent.com/basarevych/ansible-sshjail/1de8015b5d0f3bb9c9c9569106f35e6fe378decc/sshjail.py
# https://github.com/basarevych/ansible-sshjail 1de8015 on Dec 19, 2016
from __future__ import (absolute_import, division, print_function)
import os
import pipes
from ansible.errors import AnsibleError
from ansible.plugins.connection.ssh import Connection as SSHConnection
from contextlib import contextmanager
# show the first argument passed to ether_input function 
dtrace -n 'fbt::ether_input:entry { print(*(args[0])); }'
# dump first 32 bytes of the dereferenced pointer to the actual data arriving on the wire
dtrace -n 'fbt:kernel:ether_input:entry { tracemem(args[1]->m_data, 32); }'
@dch
dch / mcorbin_config.clj
Last active May 24, 2017 18:08 — forked from faxm0dem/riemann-config.clj
riemann collectd watchdog
(streams
(with {:service "heartbeat" :ttl 120 } (index))
(where (service "heartbeat")
(by :host (...))))
@dch
dch / riemann-slack.clj
Created May 24, 2017 17:50
slack with rollups
(defn format-slack-attachments
"Format attachments list from events."
[events mentions]
(let [event-count (count events)
event (last events)
description (:description event)
event-text (format-event-text event)
color (get-event-color event)]
(if (= event-count 1)
[{:text event-text
@dch
dch / com.tarsnap.spiped.vault.plist
Last active January 31, 2018 14:28
an OSX plist for running spiped as a daemon
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.tarsnap.spiped.vault</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/spiped</string>
<string>-D</string>

basics

  • 12-13"
  • touchpad
  • backlight keyboard
  • SD card
  • < 1,4 Kg

compute