This file contains hidden or 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 | |
| /** | |
| * SnowFlake ID Generator | |
| * Based on Twitter Snowflake to generate unique ID across multiple | |
| * datacenters and databases without having duplicates. | |
| * | |
| * | |
| * SnowFlake Layout | |
| * |
This file contains hidden or 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
| # default.custom.yaml | |
| # save it to: | |
| # ~/.config/ibus/rime (linux) | |
| # ~/Library/Rime (macos) | |
| # %APPDATA%\Rime (windows) | |
| patch: | |
| schema_list: | |
| - schema: luna_pinyin # 朙月拼音 | |
| - schema: luna_pinyin_simp # 朙月拼音 简化字模式 |
This file contains hidden or 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
| # coding: utf8 | |
| ''' | |
| 对于图片相似度比较有很多方法,我们这以RGB直方图为例。 | |
| 我们以一种规则,使得每个图片生成一组描述的特征向量。 | |
| opencv的直方图比较函数我们可以巧妙的利用,其有若干比较规则,但只支持直方图的数据结构,我们可以将特征向量拟合成直方图的数据结构,然后使用其的相似度比较函数。 | |
| 具体的数学计算方法有兴趣的可以看opencv的官方教程,这里我们期望生成百分比形式的相似度参数,所以使用CV_COMP_CORREL | |
| 以下是代码,以python编写 | |
| ''' | |
| import cv2.cv as cv |
This file contains hidden or 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
| git init # 初始化本地git仓库(创建新仓库) | |
| git config --global user.name "xxx" # 配置用户名 | |
| git config --global user.email "[email protected]" # 配置邮件 | |
| git config --global color.ui true # git status等命令自动着色 | |
| git config --global color.status auto | |
| git config --global color.diff auto | |
| git config --global color.branch auto | |
| git config --global color.interactive auto | |
| git config --global --unset http.proxy # remove proxy configuration on git | |
| git clone git+ssh://[email protected]/VT.git # clone远程仓库 |
This file contains hidden or 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 | |
| # | |
| # Proof of Concept: UDP Hole Punching | |
| # Two client connect to a server and get redirected to each other. | |
| # | |
| # This is the client. | |
| # | |
| # Koen Bollen <meneer koenbollen nl> | |
| # 2010 GPL | |
| # |
This file contains hidden or 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 | |
| # | |
| # tc uses the following units when passed as a parameter. | |
| # kbps: Kilobytes per second | |
| # mbps: Megabytes per second | |
| # kbit: Kilobits per second | |
| # mbit: Megabits per second | |
| # bps: Bytes per second | |
| # Amounts of data can be specified in: | |
| # kb or k: Kilobytes |
This file contains hidden or 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 | |
| # Wonder Shaper | |
| # please read the README before filling out these values | |
| # | |
| # Speed/Rate syntax: tcng vs. tc | |
| # source: http://www.faqs.org/docs/Linux-HOWTO/Traffic-Control-tcng-HTB-HOWTO.html | |
| # | |
| # tcng English tc | |
| # ---------------------------------------------- | |
| # bps bit(s) per second bit |
This file contains hidden or 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 | |
| # | |
| # limite net output rate | |
| # | |
| # 2014.09.25 | |
| # with kernel 2.6, netem was added to kernel, | |
| # so it is easier to use it with tc instead of the following way. | |
| # if su |
This file contains hidden or 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
| import win32serviceutil | |
| import win32service | |
| import win32event | |
| import servicemanager | |
| import socket | |
| import time | |
| import logging | |
| logging.basicConfig( | |
| filename = 'c:\\Temp\\hello-service.log', |
This file contains hidden or 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
| --- openvpn-2.2.2.orig/options.c 2011-12-14 00:58:56.000000000 +0800 | |
| +++ openvpn-2.2.2/options.c 2012-12-21 10:44:57.683130505 +0800 | |
| @@ -54,6 +54,10 @@ | |
| #include "memdbg.h" | |
| +extern char* _socket_obfs_salt; | |
| +extern int _socket_obfs_salt_len; | |
| +extern int _socket_obfs_padlen; | |
| + |
NewerOlder