Skip to content

Instantly share code, notes, and snippets.

Avatar

Guan Yang guanix

  • 44FE 23DB 362F 611C 0CC3 116B D49B 113D 48DC 370E
  • New York
View GitHub Profile
@guanix
guanix / zoeytest.py
Created Oct 5, 2020
Zoey REST API request in Python
View zoeytest.py
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(
client_key,
View zfs-on-mac.md

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

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×.

View keybase.md

Keybase proof

I hereby claim:

  • I am guanix on github.
  • I am guan (https://keybase.io/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:

View 2014-02-03 root zone file
. 86400 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2014020301 1800 900 604800 86400
. 86400 IN RRSIG SOA 8 0 86400 20140210000000 20140202230000 33655 . i2JbM98T1U5nBG+GX6CmXMH0ZbBLmgKgbbropo7A7J5YR/uwJGQn5kssP0BoNYNxuGXyd7PtwNPQ8GmvDE6yg4nksZtfUfnue0AbIDi6DHKqdC+c6J0w3vA37VsK2RDigxs/nolLK6ZKNQ6LErLBXyi0AychoxVp7maPQ6P89JM=
. 518400 IN NS a.root-servers.net.
. 518400 IN NS b.root-servers.net.
. 518400 IN NS c.root-servers.net.
. 518400 IN NS d.root-servers.net.
. 518400 IN NS e.root-servers.net.
. 518400 IN NS f.root-servers.net.
. 518400 IN NS g.root-servers.net.
. 518400 IN NS h.root-servers.net.
@guanix
guanix / bogosort.jl
Last active Jan 1, 2016
Bogosort and Bogobogosort in Julia
View bogosort.jl
function bogosort(v::Array)
if length(v) == 1
return v
end
c = deepcopy(v)
while !issorted(c)
shuffle!(c)
end
View smime-ios.md

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:

https://www.startssl.com/certs/sub.class1.client.ca.crt

(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: https://www.startssl.com/certs/ca.crt)

View homebrew-radio-swig-brew-doctor.txt
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
guanix / gnuradio-build.txt
Created Nov 14, 2012
homebrew-gnuradio build problem
View gnuradio-build.txt
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 http://gnuradio.org/releases/gnuradio/gnuradio-3.6.1.tar.gz
Already downloaded: /Library/Caches/Homebrew/gnuradio-3.6.1.tar.gz
View gist:3159826

Test gist

This is my test git.

@guanix
guanix / grove.pem
Created Feb 22, 2012
grove certificate
View grove.pem
-----BEGIN CERTIFICATE-----
MIIHDjCCBfagAwIBAgIDBBa4MA0GCSqGSIb3DQEBBQUAMIGMMQswCQYDVQQGEwJJ
TDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0
YWwgQ2VydGlmaWNhdGUgU2lnbmluZzE4MDYGA1UEAxMvU3RhcnRDb20gQ2xhc3Mg
MSBQcmltYXJ5IEludGVybWVkaWF0ZSBTZXJ2ZXIgQ0EwHhcNMTEwODI2MTM1MzU5
WhcNMTIwODI2MTczMjUwWjBcMSAwHgYDVQQNExc0OTQzMDQtN1NWSndHZTB4RDcz
N3FwMDEVMBMGA1UEAxMMd3d3Lmdyb3ZlLmlvMSEwHwYJKoZIhvcNAQkBFhJ3ZWJt
YXN0ZXJAZ3JvdmUuaW8wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCx
lz4vg37hC8HCr9wLq/liypbSC7pi2IpMmuz5uWFfCAfO143sDKlDafkVfQ49O5Ar
jNzt2/PcKVs4+xw+sA0ATyb75J1Kw90vznwVhl5rSa1Od3tFavaRBRnFnA2albuN