This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding:utf-8 -*- | |
from qiniu import * | |
from Queue import Queue | |
import pymysql, hashlib, threading, random, sys, json, time, logging | |
logging.basicConfig( | |
level=logging.DEBUG, | |
format='%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s %(message)s', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from Queue import Queue | |
import threading, random, time | |
__author__ = 'homeway' | |
__version__ = '2015.10.01' | |
class producer(threading.Thread): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MCrypt { | |
private $hex_iv = '00000000000000000000000000000000'; // converted JAVA byte code in to HEX and placed it here | |
private $key = 'U1MjU1M0FDOUZ.Qz'; //Same as in JAVA | |
function __construct() { | |
$this->key = hash('sha256', $this->key, true); | |
} | |
function encrypt($str) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/python | |
# -*- coding: utf-8 -*- | |
import os, json, time, hashlib | |
class Cache(object): | |
def __init__(self, cache_path=None, cache_name=None, cache_extension="cache", expired=3600): | |
extension = cache_extension.lstrip(".") or "cache" | |
self.extension = "." + extension |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin | |
export PATH | |
# Check if user is root | |
if [ $(id -u) != "0" ]; then | |
echo "Error: You must be root to run this script, please use root to install nfs" | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @package Logger | |
* @author grasses | |
* @link http://homeway.me/ | |
* @copyright Copyright(c) 2014 | |
* @version 14.11.20 | |
**/ | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
param=$1 | |
if [ $(id -u) != "0" ]; then | |
echo "Error: You must be root to run this script." | |
exit 1 | |
fi | |
start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"关闭vim一致性原则 | |
set nocompatible | |
"设置在编辑过程中右下角显示光标的行列信息 | |
set ruler | |
"在状态栏显示正在输入的命令 | |
set showcmd | |
"设置匹配模式 | |
set showmatch | |
"设置C/C++方式自动对齐 | |
set autoindent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import pydotplus, csv | |
import numpy as np | |
from sklearn import tree, preprocessing | |
from sklearn.datasets import load_iris | |
from IPython.display import Image | |
import matplotlib.pyplot as plt |
OlderNewer