Skip to content

Instantly share code, notes, and snippets.

View wsky's full-sized avatar
🏠
Working from home

Harry wsky

🏠
Working from home
View GitHub Profile
@wsky
wsky / top-auth-client.java
Last active December 19, 2015 14:58
TOP client usual code
//https://github.com/wsky/cross-fire/blob/master/java/src/main/java/com/taobao/top/integration/Util.java
private static String doSign(String secret, Map<String, String> data) {
String[] keys = new String[data.size()];
data.keySet().toArray(keys);
Arrays.sort(keys);
StringBuilder strb = new StringBuilder();
strb.append(secret);
for (String k : keys) {
// data.get(k) != "" sometimes unnecessary
@wsky
wsky / btrace.sh
Last active August 29, 2015 14:01
btrace, dtrace, strace, dtruss
#https://kenai.com/projects/btrace/pages/UserGuide
btrace pid script.java
@wsky
wsky / ulimit_mac.sh
Created October 14, 2014 08:25
mac settings
sysctl kern.maxfiles
#kern.maxfiles: 12288
sysctl kern.maxfilesperproc
#kern.maxfilesperproc: 10240
sudo sysctl -w kern.maxfiles=1048600
#kern.maxfiles: 12288 -> 1048600
sudo sysctl -w kern.maxfilesperproc=1048576
#kern.maxfilesperproc: 10240 -> 1048576
sudo sysctl -w net.inet.tcp.rfc1323=1
@wsky
wsky / SPDY.md
Last active August 29, 2015 14:12
SPDY support

Jetty supports both a client and a server implementation for the SPDY protocol, beginning with versions 7.6.2 and 8.1.2.

http://www.chromium.org/spdy/spdy-protocol

direct usage:

  • SPDY Client - SPDY Server

remap in/out of the box:

  • SPDY Client - SPDY PROXY - HTTP Server
  • HTTP Client - SPDY PROXY - SPDY Server
@wsky
wsky / 1_off-heap.md
Last active August 29, 2015 14:22
java off-heap
systemtap
http://developerblog.redhat.com/2014/01/10/probing-java-w-systemtap/
btrace
lightweight-java-profiler
https://code.google.com/p/lightweight-java-profiler/
@wsky
wsky / call.sh
Created December 16, 2015 07:57
top api call
#!/bin/bash
#how to: . call.sh
call_api() {
local APPKEY=$1
local SECRET=$2
local SESSION=$3
local METHOD=$4
local URL=$5
local IP=$6
local SSL=$7