Skip to content

Instantly share code, notes, and snippets.

🀄️
Working for living

cloverstd cloverstd

🀄️
Working for living
Block or report user

Report or block cloverstd

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View thread.py
import requests
from Queue import Queue, Empty
import time
import threading
wait_q = Queue()
lock = threading.Lock()
@cloverstd
cloverstd / check.py
Last active Sep 6, 2019
a cheap tcp check
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))
@cloverstd
cloverstd / setup.sh
Created Sep 4, 2019
vultr ipv6 setup
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"
)
@cloverstd
cloverstd / json_test.go
Created Jul 16, 2018
benchmark with json
View json_test.go
package main_test
import (
"encoding/json"
"testing"
)
func BenchmarkJSONMarshalStruct(b *testing.B) {
type Foo struct {
Name string `json:"name"`
View tcp-chcker.py
#!/usr/bin/env python
# encoding: utf-8
import socket
import struct
import select
import errno
import time
# https://github.com/tevino/tcp-shaker
@cloverstd
cloverstd / byte_to_ascii.go
Created Dec 27, 2017
convert []byte to ascii
View byte_to_ascii.go
package main
import (
"fmt"
"strconv"
)
func main() {
// a := map[string]interface{}{
// "中文": map[string]interface{}{
@cloverstd
cloverstd / qiniu.go
Last active Jul 21, 2017
Docker registry V2 qiniu storage,镜像仓库七牛驱动,https://hui.lu/docker-registry-storage/
View qiniu.go
package qiniu
import (
"bytes"
"context"
"encoding/base64"
"encoding/json"
"fmt"
"io"
"io/ioutil"
@cloverstd
cloverstd / Dockerfile
Created May 20, 2017
Minos Dockerfile
View Dockerfile
FROM python:2
RUN echo "deb http://mirrors.aliyun.com/debian/ jessie main non-free contrib" > /etc/apt/sources.list && \
echo "deb http://mirrors.aliyun.com/debian/ jessie-proposed-updates main non-free contrib" >> /etc/apt/sources.list && \
echo "deb-src http://mirrors.aliyun.com/debian/ jessie main non-free contrib" >> /etc/apt/sources.list && \
echo "deb-src http://mirrors.aliyun.com/debian/ jessie-proposed-updates main non-free contrib" >> /etc/apt/sources.list && \
apt-get update && apt-get install libcurl4-openssl-dev -y && \
apt-get install git -y && \
cd / && \
git clone https://github.com/phith0n/Minos.git /code && \
You can’t perform that action at this time.