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 | |
print '----- pre-receive start -----' | |
import sys,subprocess,re | |
def validate_commit_msg(msg): | |
if len(msg)<10: | |
return False | |
else: |
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 | |
echo "--------------push commit msg检查--------------" | |
regex="^\[(CarPlay|8327)\].{10,}" #符合要求格式的正则表达式 | |
while read oldsha newsha refname; do | |
# echo "update : $oldsha,$newsha,$refname" | |
ret=`git log --pretty=format:%s $oldsha..$newsha|awk '$1 !~ /'"$regex"'/ {print $1}'` | |
echo $ret | |
if [ ! -n "$ret" ]; then | |
echo "符合格式要求" |
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
'use strict'; | |
var http = require('http'); | |
var https = require('https'); | |
var httpProxy = require('http-proxy'); | |
var url = require('url'); | |
var PROXY_PORT = 80; | |
var proxy, server; |
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
BACK_DIR="/data/discuz" | |
WORK_DIR="/root/discuz_backup" | |
discuz_DATA=discuz_$(date +"%Y%m%d").tar.gz | |
if [ ! -d $WORK_DIR ]; | |
then | |
mkdir -p "$WORK_DIR" | |
fi | |
cd $WORK_DIR | |
rm ./*.tar.gz |
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
2018/08/16 19:05:59 udp:182.89.62.114:4183 accepted tcp:clients1.google.com:443 | |
2018/08/16 19:06:04 udp:182.89.62.114:4183 accepted tcp:[2001:b28:f23f:f005::a]:443 | |
2018/08/16 19:06:04 udp:182.89.62.114:4183 accepted tcp:91.108.56.130:443 | |
2018/08/16 19:06:04 udp:182.89.62.114:4183 accepted tcp:91.108.56.130:80 | |
2018/08/16 19:06:15 udp:182.89.62.114:4183 accepted tcp:149.154.166.120:80 | |
2018/08/16 19:06:15 udp:182.89.62.114:4346 accepted tcp:149.154.166.120:443 | |
2018/08/16 19:06:15 udp:182.89.62.114:4183 accepted tcp:149.154.166.120:443 | |
2018/08/16 19:06:15 udp:182.89.62.114:4183 accepted tcp:[2001:67c:4e8:f004::b]:443 | |
2018/08/16 19:06:15 udp:182.89.62.114:4346 accepted tcp:[2001:67c:4e8:f004::b]:443 | |
2018/08/16 19:06:15 udp:182.89.62.114:4346 accepted tcp:149.154.166.120:80 |
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 | |
/usr/sbin/service aria2 stop | |
list=`wget -qO- https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt|awk NF|sed ":a;N;s/\n/,/g;ta"` | |
if [ -z "`grep "bt-tracker" /root/.aria2/aria2.conf`" ]; then | |
sed -i '$a bt-tracker='${list} /root/.aria2/aria2.conf | |
echo add...... | |
else | |
sed -i "s@bt-tracker.*@bt-tracker=$list@g" /root/.aria2/aria2.conf | |
echo update...... | |
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
#/bin/bash | |
start=0; | |
count=0; | |
in="$1" | |
#bn="$(basename "$in")" | |
bn="out" | |
echo "==============================================================================" | |
echo "FILE START: $bn" | |
mkdir "./$bn" |
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
db.getCollection('xxx').aggregate([ | |
{ | |
$project: { | |
_id: 0, | |
mage: { $toInt: "$age" //age 字符串类型转int比较过滤 | |
} | |
} | |
}, | |
{ | |
$match: { |
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
var jquery = document.createElement('script'); | |
jquery.src = "https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"; | |
//若调试页面是https的这里也修改为https. | |
document.getElementsByTagName('head')[0].appendChild(jquery); | |
jQuery.noConflict(); | |
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
//go generate protoc -I ./proto -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --go_out ./services --go-grpc_out ./services --grpc-gateway_out ./services --grpc-gateway_opt logtostderr=true hub.proto | |
//go:generate protoc -I ./proto --js_out=import_style=commonjs:./services --grpc-web_out=import_style=commonjs,mode=grpcwebtext:./services hub.proto |