Skip to content

Instantly share code, notes, and snippets.

View vulpicastor's full-sized avatar
🪐
Planet huntin'

Lizhou Sha vulpicastor

🪐
Planet huntin'
View GitHub Profile
typeset -U path
path=(/usr/local/go/bin $path $HOME/bin $HOME/.local/bin $HOME/go/bin)
@vulpicastor
vulpicastor / uclip
Created February 25, 2017 20:22
A simple shell script that uses xclip to clear all the clipboards of X
#!/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 October 27, 2016 06:47
OpenPGP Key Transition Statement from Lizhou Sha (2016-10-27)
-----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 October 14, 2016 16:18
A parser and Zephyr nottification bot for park.io's auctions
#!/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 July 27, 2016 08:23
An example of gpg.conf with sane settings; h/t https://riseup.net/en/gpg-best-practices
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 July 21, 2016 03:25
Ancient placeholder for sl2.xyz
<!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 / dnscheck.py
Last active April 26, 2017 01:32
A script to check the SOA serial numbers of all nameservers of a domain and notify via Zephyr
#!/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 / iodined.service
Last active January 20, 2020 23:56
A systemd service file for iodine on Debian or Ubuntu
# 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"
@vulpicastor
vulpicastor / cloud-init-ubuntu-trusty.md
Last active May 16, 2020 15:23
Configure a custom Ubuntu 14.04 Athena virtual machine with cloud-init

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 / zlogrotate
Created December 30, 2015 00:25
A simple script to rotate your zlog.
#!/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