Skip to content

Instantly share code, notes, and snippets.

View openvpn-2.3.6-obfs.patch
--- src/openvpn/options.c.orig 2012-12-17 17:36:07.000000000 +0800
+++ src/openvpn/options.c 2013-03-07 23:21:26.230153027 +0800
@@ -62,6 +62,10 @@
#include "memdbg.h"
+extern char* _socket_obfs_salt;
+extern int _socket_obfs_salt_len;
+extern int _socket_obfs_padlen;
+
@wzyboy
wzyboy / foursquare.bash
Last active Aug 29, 2015
Simple Foursquare Bash utility.
View foursquare.bash
#!/bin/bash -
# Author: Zhuoyun Wei <wzyboy@wzyboy.org>
# Usage: 1. Get your token.
# 2. Fill in / replace information below.
# 3. Source this file.
# 4. `newvenue "某某地铁站 Foobar Metro Station" 120.1234,31.5678`
# to add a new venue. Note the order of lat and long.
# 5. `addlist VENUEID` to add a venue to your (existing) list.
View ttf-ms-win8-japanese.conf
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<matchtarget="font"><testname="family"><string>MS Gothic</string></test><editname="embeddedbitmap"><bool>false</bool></edit></match>
<matchtarget="font"><testname="family"><string>MS UI Gothic</string></test><editname="embeddedbitmap"><bool>false</bool></edit></match>
<matchtarget="font"><testname="family"><string>MS PGothic</string></test><editname="embeddedbitmap"><bool>false</bool></edit></match>
<matchtarget="font"><testname="family"><string>MS Mincho</string></test><editname="embeddedbitmap"><bool>false</bool></edit></match>
<matchtarget="font"><testname="family"><string>MS PMincho</string></test><editname="embeddedbitmap"><bool>false</bool></edit></match>
</fontconfig>
View ocroute.sh
#!/bin/bash -
# Description: A simple script handling default routing for OpenConnect
# URL: https://gist.github.com/wzyboy/07d80b51ff2f8bc50a7c
# Author: Zhuoyun Wei <wzyboy@wzyboy.org>
# Optional: Scripts for chnroutes
# https://github.com/jimmyxu/chnroutes
VPNUP="/etc/openvpn/vpn-up.sh"
VPNDOWN="/etc/openvpn/vpn-down.sh"
@wzyboy
wzyboy / import.py
Last active Aug 29, 2015
A script that helps to import Twitter's official archive.
View import.py
#!/usr/bin/env python
USAGE = """
This script helps to import Twitter's official archive.
Usage: ./import.py tweets.csv
"""
"""
Original data structure:
View xor.py
#!/usr/bin/env python3
import os
import numpy
from zlib import crc32
from shutil import copy
from argparse import ArgumentParser
def xor(data, key):
View name.py
#!/usr/bin/env python3
import sys
import unicodedata
from argparse import ArgumentParser
print('Unicode data version: {}'.format(unicodedata.unidata_version))
def name(chars):
View ocserv.PKGBUILD.sh
# Maintainer: Zhuoyun Wei <wzyboy@wzyboy.org>
pkgname=ocserv
pkgver=0.10.9
pkgrel=1
pkgdesc="OpenConnect VPN Server"
arch=('i686' 'x86_64')
url="http://www.infradead.org/ocserv/"
license=('GPL2')
depends=('gnutls')
View rename-to-hash.py
#!/usr/bin/env python
import os
import sys
from zlib import crc32
def crc(filename):
MAX_FILE_SIZE = 1024 * 1024 * 1024 * 2 # 2 GiB
if os.path.getsize(filename) > MAX_FILE_SIZE:
@wzyboy
wzyboy / mfm.py
Last active Apr 28, 2017
mpv fc-match: A quick and dirty way to determine whether you have all the fonts required in an ass file
View mfm.py
#!/usr/bin/env python
import os
import argparse
import subprocess
def get_fonts_from_ass_file(ass_file):
try:
with open(ass_file) as f: