Skip to content

Instantly share code, notes, and snippets.

Avatar
🀄
Working for living

cloverstd cloverstd

🀄
Working for living
View GitHub Profile
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 && \
@cloverstd
cloverstd / workerpool.go
Created Mar 16, 2017
Workerpool with golang channel
View workerpool.go
package main
import (
"container/list"
"fmt"
"log"
"net/http"
"strconv"
"sync"
"time"
@cloverstd
cloverstd / main.py
Created Oct 22, 2016
Handle file upload by Tornado and Nginx Upload Module
View main.py
#!/usr/bin/env python
# encoding: utf-8
import tornado.ioloop
import tornado.web
import tornado.log
import tornado.httpserver
from tornado.options import define, options
import logging
import tornado.gen
@cloverstd
cloverstd / sshpass.rb
Last active Aug 17, 2020 — forked from lalyos/sshpass.rb
brew install sshpass
View sshpass.rb
require 'formula'
class Sshpass < Formula
url 'http://sourceforge.net/projects/sshpass/files/sshpass/1.06/sshpass-1.06.tar.gz'
homepage 'http://sourceforge.net/projects/sshpass'
sh256 'c6324fcee608b99a58f9870157dfa754837f8c48be3df0f5e2f3accf145dee60'
def install
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}"
@cloverstd
cloverstd / app.py
Created Sep 27, 2016
Tornado forward HTTP Form upload
View app.py
import tornado.gen
import tornado.web
import tornado.ioloop
import tornado.httpclient
import tornado.tcpclient
class ProxyHandler(tornado.web.RequestHandler):
@tornado.gen.coroutine
@cloverstd
cloverstd / install.sh
Last active Aug 15, 2020
install libtorrent and python binds on centos 7
View install.sh
yum install -y boost boost-devel
yum install -y make gcc gcc-c++ kernel-devel python-devel
wget https://github.com/arvidn/libtorrent/releases/download/libtorrent-1_0_10/libtorrent-rasterbar-1.0.10.tar.gz
tar zxvf libtorrent-rasterbar-1.0.10.tar.gz
cd libtorrent-rasterbar-1.0.10.tar.gz
./configure --disable-debug --with-boost-libdir=/usr/lib64 --disable-encryption --enable-python-binding
make && make install
export LD_LIBRARY_PATH=/usr/local/lib/
cd bindings/python
python setup.py build
@cloverstd
cloverstd / Dockerfile
Created Aug 28, 2016
ghost 0.9 Dockerfile
View Dockerfile
# http://support.ghost.org/supported-node-versions/
FROM node:4-slim
RUN groupadd user && useradd --create-home --home-dir /home/user -g user user
RUN apt-get update && apt-get install -y \
ca-certificates \
wget \
--no-install-recommends && rm -rf /var/lib/apt/lists/*
You can’t perform that action at this time.