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
tjdett / backup.service
Last active Oct 12, 2017
Backup script for use with backup2swift
View backup.service
[Unit]
Description=Run backup script
[Service]
Type=oneshot
ExecStart=/bin/bash -c 'PATH=/opt/bin:$PATH /opt/bin/backup.sh /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 <t.dettrick@uq.edu.au>
RUN echo "http://dl-4.alpinelinux.org/alpine/edge/testing" >> /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
tjdett / instructions.md
Created Nov 2, 2016
Archiving secret keys to printed 2D data matrix
View instructions.md

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/mykey.pub.asc
@tjdett
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 https://quay.io/repository/coreos/hyperkube 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
tjdett / systemd-in-rkt.sh
Created Oct 19, 2016
Run systemd init in a rkt container
View systemd-in-rkt.sh
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
tjdett / run.sh
Last active Oct 7, 2016
Very basic example of a sidekick app registering a rkt pod service
View run.sh
# PUTs IP as plain text to http://requestb.in/pimdumpi
sudo `which rkt` run --dns=8.8.8.8 --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 @- http://requestb.in/pimdumpi; sleep 60; done"
@tjdett
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 http://www.census.abs.gov.au/ 2>&1 | ts '[%Y-%m-%d %H:%M:%S]'
[2016-08-09 20:38:05] * Trying 150.207.169.5...
[2016-08-09 20:40:13] * connect to 150.207.169.5 port 80 failed: Connection timed out
[2016-08-09 20:40:13] * Trying 150.207.169.8...
[2016-08-09 20:40:44] * Connected to www.census.abs.gov.au (150.207.169.8) port 80 (#0)
[2016-08-09 20:40:44] > GET / HTTP/1.1
[2016-08-09 20:40:44] > Host: www.census.abs.gov.au
[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
tjdett / latency.sh
Last active Jul 29, 2016
Find the server with lowest latency over HTTPS using nmap & xmlstarlet
View latency.sh
#!/bin/sh
nmap -oX - -n -sn "$@" | xmlstarlet sel -t -m '//host' -v 'concat(times/@srtt, " ", hostnames/hostname/@name, "
")' | sort -n
@tjdett
tjdett / keybase.md
Created Jul 26, 2016
Verifying myself on keybase.io
View keybase.md

Keybase proof

I hereby claim:

  • I am tjdett on github.
  • I am tjdett (https://keybase.io/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.