Skip to content

Instantly share code, notes, and snippets.

View dch's full-sized avatar
🛋️

Dave Cottlehuber dch

🛋️
View GitHub Profile
# 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

host

iocell clone template tag=iwmnbase \
  host_domainname=example.com \
  host_hostname=iwmnbase \
  ip4_addr='lo1|10.241.0.4' \
  resolver='search example.com;nameserver 10.241.0.0' \
  allow_raw_sockets=1 \
  enforce_statfs=1
#!/usr/bin/env python
# props to the non-functional version found on
# http://stackoverflow.com/questions/21721942/is-there-an-easy-way-to-generate-a-graph-of-ansible-role-dependencies
# thanks xmj@ for the tip
import sys
import pygraphviz
from glob import glob
import yaml
g = pygraphviz.AGraph()
{
"name": "couchdb",
"origin": "databases/couchdb",
"version": "1.6.1_10,2",
"comment": "Document database server, accessible via a RESTful JSON API",
"maintainer": "[email protected]",
"www": "http://couchdb.org/",
"abi": "FreeBSD:12:amd64",
"arch": "freebsd:12:x86:64",
"prefix": "/usr/local",
~ sudo lldb -p 44953 (31s 653ms)
(lldb) process attach --pid 44953
Process 44953 stopped
Executable module set to "/sbin/ifconfig".
Architecture set to: x86_64--freebsd12.0.
(lldb) stacktrace
error: 'stacktrace' is not a valid command.
error: Unrecognized command 'stacktrace'.
(lldb) bt
@dch
dch / droplet.conf
Last active June 7, 2019 11:43
digital ocean's automatic setup script
# /etc/rc.digitalocean.d/droplet.conf
# Generated by bsdcloud-init 2017-01-31 08:52
hostname="wolf.example.org"
# Generated by bsdcloud-init 2017-01-31 08:52
ifconfig_vtnet0_alias0="inet 10.18.0.5 netmask 255.255.0.0"
# Generated by bsdcloud-init 2017-01-31 08:52
ifconfig_vtnet0="inet 188.166.73.162 netmask 255.255.192.0"
# Generated by bsdcloud-init 2017-01-31 08:52
defaultrouter="188.166.64.1"