Skip to content

Instantly share code, notes, and snippets.

View laiyonghao's full-sized avatar

Lai Yonghao laiyonghao

View GitHub Profile
<VirtualHost *:1081>
PerlLoadModule Apache::Redmine
<Location />
DAV svn
SVNParentPath "/opt/svn"
Order deny,allow
Deny from all
Satisfy any
# If a client tries to svn update which involves updating many files,
@laiyonghao
laiyonghao / gist:2519354
Created April 28, 2012 14:11
struct-benchmark
#!/usr/bin/env python
from timeit import timeit
setup = '''
from ctypes import create_string_buffer
from struct import Struct
buff = create_string_buffer(1024)
payload = 'hello' * 30
a, b, c = 1, 3.0, 'world'
@laiyonghao
laiyonghao / gist:2499696
Created April 26, 2012 13:40
abu.rpc request encode
#!/usr/bin/env python
import struct
import abu.rpc.rpc_pb2 as rpc
import echo_pb2 as echo
PYLOAD = 'hello' * 30