Skip to content

Instantly share code, notes, and snippets.

import sys
import logging
formatter = logging.Formatter('[%(asctime)s] %(levelname)-5s PID:%(process)d [%(filename)s], %(module)s %(lineno)d: %(message)s')
logger = logging.getLogger("")
console = logging.StreamHandler(sys.stdout)
console.setFormatter(formatter)
logger.addHandler(console)
#define STRING2(x) #x
#define STRING(x) STRING2(x)
#define LOG_WARNING ("@@@@@ Need Log @@@@@ " __FILE__ "[" STRING(__LINE__) "]: " __FUNCTION__)
#pragma message LOG_WARNING
#!/bin/sh
VPN_SERVER_IP=
REAL_SERVER_IP=
VPN_NAME=
usage()
{
import (
"fmt"
"time"
)
type LatencyPrinter struct {
beginTime time.Time
}
func (h *LatencyPrinter) Begin() {
package main
import (
"flag"
"fmt"
"net"
)
func main() {
var network string
#!/bin/sh
set -e
set -x
git config http.proxy http://127.0.0.1:8899
git $@
git config --unset http.proxy
void Jump2Regedit(HKEY hRoot, const CString& strKey, const CString& strValue = TEXT(""), const DWORD dwSleepTime = 100)
{
do
{
if (NULL == hRoot || strKey.IsEmpty())
{
break;
}
//连接字符串
@mkdym
mkdym / generate-https-cert.sh
Last active December 5, 2017 08:37
generate https cert
#!/bin/sh
#
# generate ssl cert for https
#
set -e
if [ "$DEBUG"x = "true"x ]; then
set -x
@mkdym
mkdym / echo-color.sh
Created December 5, 2017 08:39
echo color functions
#!/bin/sh
#
# echo utils
#
echo_prefix=""
set_echo_prefix(){
echo_prefix=$1
#!/bin/sh
git config http.proxy http://127.0.0.1:8899
http_proxy=127.0.0.1:8899 go get $@
git config --unset http.proxy