Skip to content

Instantly share code, notes, and snippets.

View zg's full-sized avatar

Zack Zatkin-Gold zg

View GitHub Profile
@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");
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
Verifying I am +zg on my passcard. https://onename.com/zg
// 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";
}
@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(){
@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 / 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 / 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

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: