Skip to content

Instantly share code, notes, and snippets.

View zhouqiang-cl's full-sized avatar
💧
It is time

zhouqiang zhouqiang-cl

💧
It is time
View GitHub Profile
@zhouqiang-cl
zhouqiang-cl / capture
Created April 11, 2019 02:40 — forked from siddontang/capture
A tool to capture TiKV gRPC message
go run tikv-assembly.go -f "port 20160" -i lo0
2018/12/29 20:17:17 Starting capture on interface "lo0"
2018/12/29 20:17:17 reading in packets
2018/12/29 20:17:26 127.0.0.1:64989 -> 127.0.0.1:20160 /tikvpb.Tikv/KvPrewrite context:<region_id:2 region_epoch:<conf_ver:1 version:1 > peer:<id:3 store_id:1 > > mutations:<key:"usertable:a" value:"\010\000\002\0020" > primary_lock:"usertable:a" start_version:405297128206237697 lock_ttl:3000
2018/12/29 20:17:26 127.0.0.1:20160 -> 127.0.0.1:64989 /tikvpb.Tikv/KvPrewrite
2018/12/29 20:17:26 127.0.0.1:64995 -> 127.0.0.1:20160 /tikvpb.Tikv/KvCommit context:<region_id:2 region_epoch:<conf_ver:1 version:1 > peer:<id:3 store_id:1 > > start_version:405297128206237697 keys:"usertable:a" commit_version:405297128206237698
2018/12/29 20:17:26 127.0.0.1:20160 -> 127.0.0.1:64995 /tikvpb.Tikv/KvCommit
2018/12/29 20:17:29 127.0.0.1:64999 -> 127.0.0.1:20160 /tikvpb.Tikv/KvGet context:<region_id:2 region_epoch:<conf_ver:1 version:1 > peer:<id:3 store_id:1 > > key:"usertable:a" version:4
@zhouqiang-cl
zhouqiang-cl / Jenkinsfile
Created December 26, 2018 17:22 — forked from oifland/Jenkinsfile
Loops in Jenkinsfiles
// Related to https://issues.jenkins-ci.org/browse/JENKINS-26481
abcs = ['a', 'b', 'c']
node('master') {
stage('Test 1: loop of echo statements') {
echo_all(abcs)
}
stage('Test 2: loop of sh commands') {
@zhouqiang-cl
zhouqiang-cl / delay.sh
Created January 30, 2018 09:49 — forked from digilist/delay.sh
Delaying network traffic to a specific IP
#!/bin/bash
interface=lo
ip=10.0.0.1
delay=100ms
tc qdisc add dev $interface root handle 1: prio
tc filter add dev $interface parent 1:0 protocol ip prio 1 u32 match ip dst $ip flowid 2:1
tc qdisc add dev $interface parent 1:1 handle 2: netem delay $delay
@zhouqiang-cl
zhouqiang-cl / iptables.sh
Created December 8, 2016 04:19 — forked from tawateer/iptables.sh
NAT 上控制访问外网的防火墙规则
#!/bin/bash
# 有两种权限:
# 1. 允许访问外网 WEB 端口(80, 443, 8080), 把 IP 加到 wl_web_ip 即可.
# 2. 允许访问外网所有流量, 基于 wl_all_ip, 把 IP 加到 wl_all_ip 即可.
iptables -F FORWARD
iptables -F BLOCK
iptables -F MON