Skip to content

Instantly share code, notes, and snippets.

View zhuomingliang's full-sized avatar

Jimmy Zhuo zhuomingliang

  • Gan Zhou, China
View GitHub Profile

测试平台:DigitalOcean VPS ubuntu14.04 x64, strongswan5.2.2

运行以下命令请使用root权限

一:安装strongswan

由于ubuntu软件仓库中strongswan版本较低,因此从官网源码编译安装

apt-get install build-essential     #编译环境
aptitude install libgmp10 libgmp3-dev libssl-dev pkg-config libpcsclite-dev libpam0g-dev     #编译所需要的软件
@zhuomingliang
zhuomingliang / latency.txt
Created November 26, 2015 06:21 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms
@zhuomingliang
zhuomingliang / tc.sh
Created November 25, 2015 09:48 — forked from jedy/tc.sh
tc带宽控制
#!/bin/bash
#脚本文件名: tc2
#########################################################################################
#用TC(Traffic Control)解决ADSL宽带速度技术 Ver. 1.0 by KindGeorge 2004.12.27 #
#########################################################################################
#此脚本经过实验通过,更多的信息请参阅http://lartc.org
#tc+iptables+HTB+SFQ
#
#一.什么是ADSL? ADSL(Asymmetric Digital Subscriber Loop,非对称数字用户环路)
#用最简单的话的讲,就是采用上行和下行不对等带宽的基于ATM的技术.
@zhuomingliang
zhuomingliang / glr.p6
Last active August 29, 2015 14:28 — forked from jnthn/glr.p6
Great List Re-implementation: initial draft/exploration
# This file contains some work-in-progress bottom-up design work for the GLR.
# All types and operators introduced are prefixed with GLR, so there are no
# conflicts with those in core (the GLR prefix has even been used where there
# isn't anything in core to conflict with, to make clear what's being added).
# There's no syntax sugar, but rather explanations of what some syntax will
# desugar to are included. The various MAIN subs do tests to check correctness
# and various benchmarks to compare with what we have in Rakudo today.
# Up-front summary:
# * (1, 2, 3) makes a List; there is no Parcel. List supports laziness and
-- check for containment
-- i.e. index A contains index B
-- and both share the same first column
-- but they are NOT identical
WITH index_cols_ord as (
SELECT attrelid, attnum, attname
FROM pg_attribute
JOIN pg_index ON indexrelid = attrelid
WHERE indkey[0] > 0
-- check for exact matches
WITH index_cols_ord as (
SELECT attrelid, attnum, attname
FROM pg_attribute
JOIN pg_index ON indexrelid = attrelid
WHERE indkey[0] > 0
ORDER BY attrelid, attnum
),
index_col_list AS (
SELECT attrelid,
<fontconfig>
<match target="pattern">
<test qual="any" name="family">
<string>serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Sans S Chinese</string>
<string>Noto Sans T Chinese</string>
<string>Noto Sans Japanese</string>
<string>Noto Sans Korean</string>

##MoarVM source C language macros

Alphabetical list of all (over 700) C language macros defined in the src/ subtree of MoarVM (https://github.com/MoarVM/MoarVM). Generated by script included at the end.

Macros in .h files

####ATKEY(vm, hash, k) src/mast/nodes_moarvm.h:149 #define ATKEY(vm, hash, k) (MVM_repr_at_key_boxed(vm, hash, k))

@zhuomingliang
zhuomingliang / LICENSE.txt
Created September 9, 2012 12:52 — forked from LeverOne/LICENSE.txt
generate random v4 UUIDs (107 bytes)
DO WTF YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Alexey Silin <[email protected]>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WTF YOU WANT TO PUBLIC LICENSE
@zhuomingliang
zhuomingliang / USAGE
Created August 4, 2012 00:31 — forked from jnthn/USAGE
Take a Rakudo repo. Place the above file in src/json.nqp. Build it like this:
nqp --vmlibs=perl6_group,perl6_ops --target=pir --combine src/json.nqp src/gen/main-version.nqp > src/json.pir
Then you can do:
install\bin\parrot.exe src\json.pir -e "say 42"
Which will dump the parse tree as JSON.