View main.go
func main() { | |
var i interface{} = 100 | |
/** | |
type eface struct { | |
_type *_type | |
data unsafe.Pointer | |
} | |
*/ | |
n := *(*int)(*(*unsafe.Pointer)(unsafe.Pointer(uintptr(unsafe.Pointer(&i)) + unsafe.Alignof(i)))) | |
fmt.Println(n) |
View config.yml
mixed-port: 17890 | |
redir-port: 17892 | |
allow-lan: true | |
mode: rule | |
log-level: info |
View recover.js
function getParams() { | |
const pairs = window.location.hash.substr(1).split('::'); | |
if (!pairs) { | |
throw new Error('取不到参数'); | |
} | |
return { | |
sndId: pairs[1].split('=')[1], | |
sndMagic: pairs[2].split('=')[1] | |
}; | |
} |
View Probes
*** Probes *** | |
+ FPing | |
binary = /usr/bin/fping | |
+ Curl | |
binary = /usr/bin/curl |
View thread.py
import requests | |
from Queue import Queue, Empty | |
import time | |
import threading | |
wait_q = Queue() | |
lock = threading.Lock() |
View check.py
import socket | |
import struct | |
import time | |
# https://github.com/tevino/tcp-shaker | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
s.setsockopt(socket.SOL_TCP, socket.TCP_QUICKACK, 0) # disable TCP_QUICKACK | |
s.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER, struct.pack('ii', 1, 0)) # diable liner, send RST to close | |
s.connect(('127.0.0.1', 9999)) |
View setup.sh
sudo apt-get install ndisc6 # install rdsic6 | |
sudo rdisc6 ens3 # search ens3 iface info, the last line from block is your gateway | |
sudo ip -6 route add default via YOUR_GATEWAY_FROM_rdisc6 dev ens3 |
View taobao_sign.go
package sign | |
import ( | |
"crypto/md5" | |
"encoding/hex" | |
"net/url" | |
"sort" | |
"strings" | |
) |
View taobao_sign.go
package sign | |
import ( | |
"crypto/md5" | |
"encoding/hex" | |
"net/url" | |
"sort" | |
"strings" | |
) |
View json_test.go
package main_test | |
import ( | |
"encoding/json" | |
"testing" | |
) | |
func BenchmarkJSONMarshalStruct(b *testing.B) { | |
type Foo struct { | |
Name string `json:"name"` |
NewerOlder