Skip to content

Instantly share code, notes, and snippets.

Chris Swan cpswan

View GitHub Profile
cpswan / named.conf
Created Apr 2, 2018
Unbound/BIND config for DNS over TLS to
View named.conf
options {
directory "/tmp";
listen-on-v6 { none; };
forwarders { port 2053;
auth-nxdomain no; # conform to RFC1035
cpswan /
Created Jan 21, 2018
Command line to launch UniFi controller in a Docker container
sudo docker run --rm --init -d -p 8080:8080 -p 8443:8443 -p 3478:3478/udp -p 10001:10001/udp -e TZ='Europe/London' -e RUNAS_UID0=false -e UNIFI_UID=1000 -e UNIFI_GID=1000 -v ~/unifi:/unifi --name unifi jacobalberty/unifi:stable
View GameOfLife_20171213.txt
Started by user Chris Swan
Building in workspace /var/jenkins_home/workspace/GameOfLife
Unpacking to /var/jenkins_home/tools/hudson.tasks.Maven_MavenInstallation/Maven3 on Jenkins
Cloning the remote Git repository
Cloning repository
> git init /var/jenkins_home/workspace/GameOfLife # timeout=10
Fetching upstream changes from
> git --version # timeout=10
> git fetch --tags --progress +refs/heads/*:refs/remotes/origin/*
> git config remote.origin.url # timeout=10
cpswan / history
Created Jan 25, 2017
Bash history from Asus Tinker Board Debian image
View history
sudo ping
sudo apt-get update
cd Desktop/
tar -zxvf ASUSTinkerBoard.gpio-0.1_20161025.tar.gz
cd ASUSTinkerBoard.gpio-0.1_20161025/
cd ..
cpswan /
Created Jan 22, 2017
Example Network UPS Tool (NUT) configs
import os
import sys
import smtplib
import mimetypes
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.MIMEText import MIMEText
from email.MIMEAudio import MIMEAudio
from email.MIMEImage import MIMEImage
cpswan / sshvps
Created Jan 8, 2017
autossh init script for keeping up a connection to a VPS
View sshvps
# Provides: sshvps
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Tunnel to VPS
# Description: This runs a script continuously in screen.
cpswan / .screenrc
Created Jan 3, 2017
Keep shell/prompt when using screen (on Synology)
View .screenrc
shell -$SHELL
cpswan /
Created Dec 24, 2015
Sync time between Ubuntu VM and VMware host
sudo apt-get install -y open-vm-tools
vmware-toolbox-cmd timesync enable
cpswan /
Created Dec 24, 2015
Configure systemd to use overlay file system for Docker
sudo mkdir /etc/systemd/system/docker.service.d
sudo bash -c 'cat <<EOF > /etc/systemd/system/docker.service.d/overlay.conf
ExecStart=/usr/bin/docker daemon -H fd:// --storage-driver=overlay
sudo systemctl daemon-reload
sudo systemctl restart docker
cpswan /
Last active Oct 17, 2015
Attempt to create symlinks for best quality music from mix of wav and mp3
while read -u 3 outerdir
cd "${outerdir}"
ls -1 ../../wav/"${outerdir}" > list
while read -u 4 innerdir
ln -s ../../wav/"${outerdir}"/"${innerdir}" "${innerdir}"
done 4< list
done 3< test
You can’t perform that action at this time.