Skip to content

Instantly share code, notes, and snippets.

View zg's full-sized avatar

Zack Zatkin-Gold zg

View GitHub Profile

Keybase proof

I hereby claim:

  • I am zg on github.
  • I am zg (https://keybase.io/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
zg / debian-xhyve.sh
Created May 13, 2016 21:15 — forked from lloeki/debian-xhyve.sh
Running debian 8.1 in xhyve
#!/bin/bash
# unfortunately debian currently panics in xhyve
tmp=$(mktemp -d)
pushd "$tmp"
iso="$HOME"/Downloads/debian-8.1.0-amd64-netinst.iso
#iso="$HOME"/Downloads/debian-8.1.0-i386-netinst.iso
echo "fixing disk"
dd if=/dev/zero bs=2k count=1 of=tmp.iso
@zg
zg / arch-xhyve.sh
Created May 13, 2016 21:14 — forked from lloeki/arch-xhyve.sh
Run Arch Linux in xhyve
#!/bin/bash
tmp=$(mktemp -d)
pushd "$tmp"
iso=/Users/lloeki/Downloads/archlinux-2015.08.01-dual.iso
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"
@zg
zg / freebsd-qemu-xhyve-mac-os-x-virtual-machine.md
Last active April 1, 2024 21:47
Create FreeBSD virtual machine using qemu. Run the VM using xhyve.

TL;DR

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

Requisites

@zg
zg / TagCloud.java
Created November 9, 2015 00:19
Used for Lobsters tag cloud generated at tagcrowd.com
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(){
// 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;
printf("@$Hamburgefo%c`",'\n');
return ~7&8^9?0:l1|!"j->k+=*w";
}
Verifying I am +zg on my passcard. https://onename.com/zg
48 87 15 43 25
65 91 19 19 76
21 46 72 29 8
22 55 7 95 55
11 36 11 33 3
39 9 49 66 52
95 97 44 96 82
53 44 1 86 11
48 45 26 3 9
54 98 83 86 20
@zg
zg / endian.c
Last active August 29, 2015 14:02
#include <stdio.h>
int main(){
unsigned int i = 1;
char *p = (char *)&i;
if(*p == 0)
printf("big endianness");
else
printf("little endianness");
37107287533902102798797998220837590246510135740250
46376937677490009712648124896970078050417018260538
74324986199524741059474233309513058123726617309629
91942213363574161572522430563301811072406154908250
23067588207539346171171980310421047513778063246676
89261670696623633820136378418383684178734361726757
28112879812849979408065481931592621691275889832738
44274228917432520321923589422876796487670272189318
47451445736001306439091167216856844588711603153276
70386486105843025439939619828917593665686757934951