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
[unix_http_server] | |
file=/tmp/supervisor.sock ; socket文件的路径,supervisorctl用XML_RPC和supervisord通信就是通过它进行 | |
的。如果不设置的话,supervisorctl也就不能用了 | |
不设置的话,默认为none。 非必须设置 | |
;chmod=0700 ; 这个简单,就是修改上面的那个socket文件的权限为0700 | |
不设置的话,默认为0700。 非必须设置 | |
;chown=nobody:nogroup ; 这个一样,修改上面的那个socket文件的属组为user.group | |
不设置的话,默认为启动supervisord进程的用户及属组。非必须设置 | |
;username=user ; 使用supervisorctl连接的时候,认证的用户 | |
不设置的话,默认为不需要用户。 非必须设置 |
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
package main | |
import ( | |
"fmt" | |
"reflect" | |
) | |
func StructToMap(s interface{}) map[string]interface{} { | |
m := make(map[string]interface{}) | |
elem := reflect.ValueOf(s).Elem() |
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
-- Tit Petric, Monotek d.o.o., Thu 27 Oct 2016 10:43:38 AM CEST | |
-- | |
-- Delete nginx cached assets with a PURGE request against an endpoint | |
-- | |
local md5 = require 'md5' | |
function file_exists(name) | |
local f = io.open(name, "r") | |
if f~=nil then io.close(f) return true else return false end |
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 data = [ | |
{ | |
y:10.98, | |
x:35.3, | |
}, | |
{ | |
y:11.13, | |
x:29.7, | |
}, | |
{ |
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
log_format main '$http_x_forwarded_for - $remote_user [$time_local] "$http_host" "$request" code:$status $body_bytes_sent $http_referer "$http_user_agent" "$request_time" "$upstream_response_time" "$upstream_addr" "$upstream_status" "server:$http_x_select_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
<?php | |
function normalFind($a, $b){ | |
$matches = []; | |
$lena = strlen($a); | |
$lenb = strlen($b); | |
for ($i=0; $i < strlen($a); $i++) { | |
for ($j=0; $j < $lenb; $j++) { | |
if ($i + $j >= $lena) { | |
break; |
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
git config --global https.proxy http://127.0.0.1:1080 | |
git config --global https.proxy https://127.0.0.1:1080 | |
git config --global --unset http.proxy | |
git config --global --unset https.proxy | |
git clone https://github.com/commaai/openpilot.git --config "http.proxy=proxyHost:proxyPort" |
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
/** | |
* 截取指定长度的中英文混合字符串 | |
* @param {String} str 待截取的字符串 | |
* @param {Number} n 截取长度(中文字符为英文的 double) | |
* @return {String} 截取后的字符串 | |
*/ | |
function subString(str, n) { | |
var r = /[^\x00-\xff]/g; | |
var m; |
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/env bash | |
if [ $# != 1 ] ; then | |
echo "USAGE: $0 OPENPILOT_PATH" | |
echo " e.g.: $0 /data/forks/gernby" | |
exit 1; | |
fi | |
rm -f /data/openpilot |
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 bash | |
# 配置每个 fork 目录位置 | |
PATH_FORK=/data/forks | |
PATH_FORK_1=${PATH_FORK}/gernby | |
PATH_FORK_2=${PATH_FORK}/openpilot | |
PATH_FORK_3=${PATH_FORK}/dragonpilot | |
switch=`cat /sys/devices/virtual/switch/tri-state-key/state` | |
VAR_OP_PATH=`eval echo "$""PATH_FORK_${switch}"` |