Skip to content

Instantly share code, notes, and snippets.

Tim Dettrick tjdett

Block or report user

Report or block tjdett

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
tjdett / backup.service
Last active Oct 12, 2017
Backup script for use with backup2swift
View backup.service
Description=Run backup script
ExecStart=/bin/bash -c 'PATH=/opt/bin:$PATH /opt/bin/ /etc/systemd/system /opt/bin'
View pick_random.scala
import scala.util.Random
import scala.util.Try
import scala.collection.immutable.Stream
object PickRandom extends App {
def picksValid(picksStr: String) =
Try(picksStr.toInt).filter(_ > 0).isSuccess
override def main(args: Array[String]) {
val picksRequired = args.toList match {
View Dockerfile
FROM alpine:edge
MAINTAINER Tim Dettrick <>
RUN echo "" >> /etc/apk/repositories && \
adduser -S -D -h /dev/null -s /sbin/nologin nghttpx && \
apk add --update nghttp2 python openssl ca-certificates && \
rm -rf /var/cache/apk/*
ENTRYPOINT ["/usr/bin/nghttpx", "--user=nghttpx"]
tjdett /
Created Nov 2, 2016
Archiving secret keys to printed 2D data matrix

Produce with following steps:

paperkey --output-type raw < /tmp/mykey.gpg \
    > /tmp/mykey.paperkey
dmtxwrite -e 8 /tmp/mykey.paperkey > /tmp/mykey.paperkey.png

To reassemble, scan to JPG and then:

gpg2 --import /tmp/
tjdett / convo.txt
Last active Oct 26, 2016
Kublet & rkt from #rkt @ 2016-10-26T13:44Z
View convo.txt
<waly> Hi everyone
<waly> I've read somewhen in the past, that rkt provides a better featureset for the kubelet than docker does. Was somehow around the context, why the kubelet-wrapper is using rkt ... Can somebody explain that/point me to the missing link about that?
<vincent_vdk> waly: maybe because rkt is pod 'aware'
<sur> waly The are two aspects: 1) launching the kubelet and 2) launching pods
<sur> for 1) launching the kubelet the kubelet-wrapper uses rkt, because we can leverage the image to launch the kubelet using "rkt fly", which doesn't do any isolation, but only chroot, because the kubelet is a privileged component on the host. That way we can reuse the same (hyperkube) image for both the kubelet, and
<sur> all the other kubernetes components (proxy, apiserver, ....)
<sur> for 2) launching pods from withing the kubelet you can also use rkt as the container runtime. There are quite a few nice points for doing so, one summary I tried to give i.e. in this p
tjdett /
Created Oct 19, 2016
Run systemd init in a rkt container
sudo `which rkt` run --interactive \
--volume volume-sys-fs-cgroup,kind=host,source=/sys/fs/cgroup,readOnly=true \
--insecure-options=image,seccomp,capabilities \
docker://fedora/systemd-systemd --exec /bin/bash -- \
-c "exec unshare --pid --fork --mount-proc /sbin/init"
tjdett /
Last active Oct 7, 2016
Very basic example of a sidekick app registering a rkt pod service
# PUTs IP as plain text to
sudo `which rkt` run --dns= --insecure-options=image \
docker://nginx -- --- \
docker://alpine:3.4 --exec /bin/sh -- -c \
"apk update && apk add -u curl && while true; do ip -f inet addr show eth0 | grep -Eo 'inet [0-9\.]+' | cut -f2 -d' ' | curl -X POST -H 'Content-Type: text/plain' -d @-; sleep 60; done"
tjdett / curl.log
Created Aug 9, 2016
Attempting to connect to census website on 9 August 2016 @ 20:40 AEST
View curl.log
$ curl -sLv 2>&1 | ts '[%Y-%m-%d %H:%M:%S]'
[2016-08-09 20:38:05] * Trying
[2016-08-09 20:40:13] * connect to port 80 failed: Connection timed out
[2016-08-09 20:40:13] * Trying
[2016-08-09 20:40:44] * Connected to ( port 80 (#0)
[2016-08-09 20:40:44] > GET / HTTP/1.1
[2016-08-09 20:40:44] > Host:
[2016-08-09 20:40:44] > User-Agent: curl/7.47.1
[2016-08-09 20:40:44] > Accept: */*
[2016-08-09 20:40:44] >
tjdett /
Last active Jul 29, 2016
Find the server with lowest latency over HTTPS using nmap & xmlstarlet
nmap -oX - -n -sn "$@" | xmlstarlet sel -t -m '//host' -v 'concat(times/@srtt, " ", hostnames/hostname/@name, "
")' | sort -n
tjdett /
Created Jul 26, 2016
Verifying myself on

Keybase proof

I hereby claim:

  • I am tjdett on github.
  • I am tjdett ( on keybase.
  • I have a public key whose fingerprint is 1DC5 86BE 4DB4 42DA F5CA BB13 AF08 7014 85FB 53F0

To claim this, I am signing this object:

You can’t perform that action at this time.