Skip to content

Instantly share code, notes, and snippets.

View guanix's full-sized avatar

Guan Yang guanix

  • 44FE 23DB 362F 611C 0CC3 116B D49B 113D 48DC 370E
  • New York
View GitHub Profile
guanix /
Created October 5, 2020 15:20
Zoey REST API request in Python
from requests_oauthlib import OAuth1Session
import pprint
client_key = os.environ["ZOEY_CONSUMER_KEY"]
client_secret = os.environ["ZOEY_CONSUMER_SECRET"]
oauth_token = os.environ["ZOEY_OAUTH_TOKEN"]
oauth_secret = os.environ["ZOEY_OAUTH_SECRET"]
zoey = OAuth1Session(

Notes on using ZFS on a Mac

I decided to move a big chunk of the data on my everyday Mac to ZFS. Here are some of my notes.

Why ZFS?


Compression is the killer feature for casual users. I only have 1TB of storage in my MacBook Pro, and I was constantly running out of space. A lot of the files I store compress very well, for example my Mail archive, source code, applications and Parallels virtual machines. The overall compression ratio for my pool is currently 2.06×.

Keybase proof

I hereby claim:

  • I am guanix on github.
  • I am guan ( on keybase.
  • I have a public key whose fingerprint is 44FE 23DB 362F 611C 0CC3 116B D49B 113D 48DC 370E

To claim this, I am signing this object:

. 86400 IN SOA 2014020301 1800 900 604800 86400
. 86400 IN RRSIG SOA 8 0 86400 20140210000000 20140202230000 33655 . i2JbM98T1U5nBG+GX6CmXMH0ZbBLmgKgbbropo7A7J5YR/uwJGQn5kssP0BoNYNxuGXyd7PtwNPQ8GmvDE6yg4nksZtfUfnue0AbIDi6DHKqdC+c6J0w3vA37VsK2RDigxs/nolLK6ZKNQ6LErLBXyi0AychoxVp7maPQ6P89JM=
. 518400 IN NS
. 518400 IN NS
. 518400 IN NS
. 518400 IN NS
. 518400 IN NS
. 518400 IN NS
. 518400 IN NS
. 518400 IN NS
guanix / bogosort.jl
Last active January 1, 2016 16:39
Bogosort and Bogobogosort in Julia
function bogosort(v::Array)
if length(v) == 1
return v
c = deepcopy(v)
while !issorted(c)

StartCom is a good CA for S/MIME. You need to create an account, verify your email address, then create a certificate for S/MIME email. Key generation looks like it happens on their side, but it actually occurs in the browser using the tag.

Once the certificate and key are in OS X Keychain, export it into a p12 file, use a good passphrase, and email it to yourself. Then open it up on the iOS device and install the certificate.

You'll also need to install the StartCom Class 1 Intermediate Client CA certificate. Open this link in Mobile Safari:

(That certificate is in turn signed by the StartCom root CA, and as far as I know that's already trusted by iOS. There should be no need to explicitly trust any certificate. If necessary, the root certificate is here:

guanix / homebrew-radio-swig-brew-doctor.txt
Created November 14, 2012 16:47
homebrew-radio brew doctor
Last login: Wed Nov 14 11:42:13 on ttys003
breguan-air:~ guan$ brew doctor
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
guanix / gnuradio-build.txt
Created November 14, 2012 16:45
homebrew-gnuradio build problem
Last login: Wed Nov 14 11:42:09 on ttys002
guan-air:~ guan$ brew update -
guan-air:~ guan$ brew install -v gnuradio
/usr/bin/env python -c import Cheetah
/usr/bin/env python -c import scipy
/usr/bin/env python -c import lxml
/usr/bin/env python -c import matplotlib
/usr/bin/env python -c import numpy
==> Downloading
Already downloaded: /Library/Caches/Homebrew/gnuradio-3.6.1.tar.gz
guanix / gist:3159826
Created July 22, 2012 14:14
Test gist

Test gist

This is my test git.

guanix / grove.pem
Created February 22, 2012 18:01
grove certificate