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
@vulpicastor
vulpicastor / keybase.md
Created August 24, 2015 03:59
Keybase.io validation gist

Keybase proof

I hereby claim:

  • I am vulpicastor on github.
  • I am slz (https://keybase.io/slz) on keybase.
  • I have a public key whose fingerprint is 05CB 8CB7 44BF 65AC 55FA 004D ECA3 650A C6A0 C408

To claim this, I am signing this object:

@vulpicastor
vulpicastor / zwrite.py
Last active December 28, 2015 06:43
A Python wrapper for zwrite that shells out to send zephyrgrams.
#!/usr/bin/env python3
# Written in 2015 by Lizhou Sha <slz@mit.edu>
#
# To the extent possible under law, the author has dedicated all copyright
# and related and neighboring rights to this software to the public domain
# worldwide. This software is distributed without any warranty.
#
# See <http://creativecommons.org/publicdomain/zero/1.0/> for a copy of the
# CC0 Public Domain Dedication.
@vulpicastor
vulpicastor / mpris-zephyr.py
Created December 25, 2015 03:46
Grabs your current track metadata from your MPRIS-enabled media player on Linux and zephyrs it in sipbmp3 format.
#!/usr/bin/env python3
import dbus
import sys
from zwrite import zwrite
# You can find zwrite.py at https://gist.github.com/vulpicastor/809952a8a65c808a882f
import platform, getpass
BUS_PREFIX = "org.mpris.MediaPlayer2"
OBJECT_PATH = "/org/mpris/MediaPlayer2"
@vulpicastor
vulpicastor / mit418.html
Created December 28, 2015 06:30
An HTTP 418 error page, with apologies to web.mit.edu.
<!DOCTYPE html>
<html>
<head>
<title>MIT 418 Error - I’m a teapot</title>
<meta charset="UTF-8">
<!-- <link rel="shortcut icon" type="image/x-icon" href="//web.mit.edu/favicon.ico"></link> -->
<style type="text/css">
body {
padding:0px;
margin:0px;
@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
@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 / 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 / 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 / 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 / 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