Skip to content

Instantly share code, notes, and snippets.

View codeskyblue's full-sized avatar

codeskyblue codeskyblue

View GitHub Profile
@codeskyblue
codeskyblue / gist:6432491
Created September 4, 2013 03:32
what's the result?
package main
import "fmt"
import "time"
var ss = []string{"foo", "bar"}
func main() {
for _, name := range ss {
go func(){
@codeskyblue
codeskyblue / 8-15 moon
Created September 20, 2013 10:18
a gift to 15.Aug moon
// 8.15 project main.go
// generate a pic of moon
package main
import (
"fmt"
"image"
"image/color"
"image/draw"
"image/png"
#!/bin/bash
#
#
Echo(){
echo ">>> $(date "+%Y-%m-%d %H:%M:%S")" "$@"
}
Die(){ Echo "$@"; exit 1; }
package main
import (
"fmt"
"log"
"time"
)
type Record struct {
a int
@codeskyblue
codeskyblue / showmetainfo.py
Created February 19, 2014 03:39
torrent信息查看工具 showmetainfo
#!/usr/bin/python
# Written by Henry 'Pi' James and Loring Holden
# modified for multitracker display by John Hoffman
# see LICENSE.txt for license information
# dependency
# $ pip install bencode
from sys import *
@codeskyblue
codeskyblue / template_multi_search.py
Created August 7, 2014 11:47
python opencv2 find multi template image
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import cv2
import numpy as np
def _cv2open(filename, arg=0):
obj = cv2.imread(filename, arg)
if obj == None:
raise IOError('cv2 read file error:'+filename)
@codeskyblue
codeskyblue / monitor.py
Created August 14, 2014 02:56
use goless to implement monitor
import goless
import time
import gevent
from gevent import monkey
monkey.patch_all()
def time_after(seconds):
c = goless.chan()
def _fn():
gevent.sleep(seconds)
@codeskyblue
codeskyblue / ftpserver.py
Created October 24, 2014 07:30
ftpserver which support .ftpignore
#!/usr/bin/env python
# coding: utf-8
#
import fnmatch
import os
import pathspec
import pyftpdlib
from pyftpdlib.filesystems import AbstractedFS
from pyftpdlib.authorizers import DummyAuthorizer
@codeskyblue
codeskyblue / README.txt
Created February 13, 2015 06:46
Get Process Cpu Percent
go run_percent.go -p $PID
@codeskyblue
codeskyblue / msv.sh
Created February 27, 2015 09:28
help tool for supervisorctl
#!/bin/bash
#
# help tool of supervisorctl
#
# reference: http://supervisord.org/
RUNUSER=hzsunshx
CONFDIR="/etc/supervisor/conf.d/"
CRED='\033[0;31m'