Skip to content

Instantly share code, notes, and snippets.

Avatar
🪐
Planet huntin'

Lizhou Sha vulpicastor

🪐
Planet huntin'
View GitHub Profile
@vulpicastor
vulpicastor / cloud-init-ubuntu-trusty.md
Last active May 16, 2020
Configure a custom Ubuntu 14.04 Athena virtual machine with cloud-init
View cloud-init-ubuntu-trusty.md

How to configure a custom Ubuntu 14.04 Athena dialup with cloud-init

Preparations

Install dependencies

apt-get install libvirt-bin virtinst cloud-img-utils
@vulpicastor
vulpicastor / iodined.service
Last active Jan 20, 2020
A systemd service file for iodine on Debian or Ubuntu
View iodined.service
# Author: Lizhou Sha <slz@mit.edu>
# Note: This version is OUTDATED. Please refer to the latest iodine package in Debian Unstable.
[Unit]
Description=A daemon for tunneling traffic over DNS queries
After=network.target
[Service]
EnvironmentFile=/etc/default/iodine
ExecStartPre=/bin/sh -xc "test ${START_IODINED} = true"
View zshenv
typeset -U path
path=(/usr/local/go/bin $path $HOME/bin $HOME/.local/bin $HOME/go/bin)
@vulpicastor
vulpicastor / dnscheck.py
Last active Apr 26, 2017
A script to check the SOA serial numbers of all nameservers of a domain and notify via Zephyr
View dnscheck.py
#!/usr/bin/env python3
from __future__ import print_function
import sys
import time
import dns.resolver, dns.exception
from random import randrange
import zwrite
DEFAULT_ARGS = {"classname": "test",
@vulpicastor
vulpicastor / uclip
Created Feb 25, 2017
A simple shell script that uses xclip to clear all the clipboards of X
View uclip
#!/bin/bash
XCLIP=`which xclip`
if [ -z $XCLIP ]; then
echo "Please install xclip"
fi
$XCLIP /dev/null
$XCLIP -selection clipboard /dev/null
@vulpicastor
vulpicastor / slz-pgp-key-transition-2016-10-27.txt
Created Oct 27, 2016
OpenPGP Key Transition Statement from Lizhou Sha (2016-10-27)
View slz-pgp-key-transition-2016-10-27.txt
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
OpenPGP Key Transition Statement from Lizhou Sha (2016-10-27)
I have created a new OpenPGP key and will be transitioning away from my
old key. The old key remains secure to the best of my knowledge and will
continue to be valid for some time, but I prefer all new correspondence
to be encrypted with the new key, and I will be making signatures with
the new key going forward.
@vulpicastor
vulpicastor / check_parkio.py
Created Oct 14, 2016
A parser and Zephyr nottification bot for park.io's auctions
View check_parkio.py
#!/usr/bin/env python3
import requests
import time
from datetime import datetime
import pytz
from zwrite import zwrite
PARKIO_DOMAIN = "https://app.park.io"
AUCTION_PATH = "/auctions.json"
@vulpicastor
vulpicastor / gpg.conf
Created Jul 27, 2016
An example of gpg.conf with sane settings; h/t https://riseup.net/en/gpg-best-practices
View gpg.conf
charset utf-8
keyserver hkp://pool.sks-keyservers.net
keyserver-options no-honor-keyserver-url
keyid-format 0xlong
with-fingerprint
personal-digest-preferences SHA512
cert-digest-algo SHA512
@vulpicastor
vulpicastor / sl2.html
Created Jul 21, 2016
Ancient placeholder for sl2.xyz
View sl2.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"></meta>
<title>Welcome to SL₂(ℤ)!</title>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
"HTML-CSS": {
availableFonts: ["Gyre-Pagella"],
preferredFont: "Gyre-Pagella",
@vulpicastor
vulpicastor / zlogrotate
Created Dec 30, 2015
A simple script to rotate your zlog.
View zlogrotate
#!/bin/sh
ZCLASS=$1
DATE=`date +%F`
PRESS='xz'
if [ -n "$ZCLASS" ]
then
mv -i "$ZCLASS" "$ZCLASS.$DATE" && $PRESS "$ZCLASS.$DATE" || ( echo Failed; exit 1 )
else