Skip to content

Instantly share code, notes, and snippets.


Zack Zatkin-Gold zg

View GitHub Profile
zg /
Last active Jun 11, 2020
Create FreeBSD virtual machine using qemu. Run the VM using xhyve.


  • Create 10GB FreeBSD image using QEMU.
  • Run the VM using xhyve.
  • Mount host directory.
  • Resize the image.



Keybase proof

I hereby claim:

  • I am zg on github.
  • I am zg ( on keybase.
  • I have a public key whose fingerprint is 4BEB 7AD4 AEAA FFAF 2E6C BE9A F886 05CB ACE8 3706

To claim this, I am signing this object:

zg /
Created May 13, 2016 — forked from lloeki/
Running debian 8.1 in xhyve
# unfortunately debian currently panics in xhyve
tmp=$(mktemp -d)
pushd "$tmp"
echo "fixing disk"
dd if=/dev/zero bs=2k count=1 of=tmp.iso
zg /
Created May 13, 2016 — forked from lloeki/
Run Arch Linux in xhyve
tmp=$(mktemp -d)
pushd "$tmp"
echo "fixing disk"
dd if=/dev/zero bs=2k count=1 of=tmp.iso
dd if=$iso bs=2k skip=1 >> tmp.iso
echo "mounting disk"
from __future__ import division
from pyparsing import (Literal,CaselessLiteral,Word,Combine,Group,Optional,
import math
import operator
__author__='Paul McGuire'
__version__ = '$Revision: 0.0 $'
__date__ = '$Date: 2009-03-20 $'

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

# remap prefix to Control + a
zg / class.Google2FA.php
Created Feb 9, 2013
A PHP implementation of Google two-factor authentication.
View class.Google2FA.php
class Google2FA {
const keyRegeneration = 30; // Interval between key regeneration
const otpLength = 6; // Length of the Token generated
private static $lut = array( // Lookup needed for Base32 encoding
"A" => 0, "B" => 1,
"C" => 2, "D" => 3,
"E" => 4, "F" => 5,
"G" => 6, "H" => 7,
"I" => 8, "J" => 9,
zg / cloak.c
Created Dec 30, 2012
unreal cloak.c
View cloak.c
* IRC - Internet Relay Chat, src/modules/cloak.c
* (C) 2004 The UnrealIRCd Team
* See file AUTHORS in IRC package for additional names of
* the programmers.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 1, or (at your option)
zg /
Created Nov 9, 2015
Used for Lobsters tag cloud generated at
import java.util.HashMap;
import java.util.Map;
public class TagCloud {
private HashMap<String, Integer> tags;
public static void main(String[] args) {
TagCloud tagcloud = new TagCloud();
public TagCloud(){
View font_check.c
// The four boxing wizards jump
#include <stdio.h> // <= quickly.
int main(int argc, char **argv) {
long il1[]={1-2/3.4,5+6==7/8};
int OxFaced=0xBAD||"[{(CQUINE";
unsigned O0,l1,Z2,S5,G6,B8__XY;
return ~7&8^9?0:l1|!"j->k+=*w";
You can’t perform that action at this time.