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
{ | |
"__inputs": [ | |
{ | |
"name": "DS_PROMETHEUS", | |
"label": "prom", | |
"description": "", | |
"type": "datasource", | |
"pluginId": "prometheus", | |
"pluginName": "Prometheus" | |
} |
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
添加subtree: | |
首先: | |
git remote add -f <子仓库名> <子仓库地址> | |
注:其中-f意思是在添加远程仓库之后,立即执行fetch | |
如:git remote add -f cornerstone git@git.xxx.git | |
然后: | |
git subtree add --prefix=<子目录名> <子仓库名> <分支> —squash | |
注:—squash意思是把subtree的改动合并成一次commit,这样就不用拉取子项目完整的历史记录。 |
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" | |
"strconv" | |
"sync" | |
) | |
func worker(wg *sync.WaitGroup, cs chan string, i int) { | |
defer wg.Done() |
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 | |
read -p "Please input kernel-version: " kernel | |
#test -e $kernel | |
Libmodule=/lib/modules/$kernel-generic | |
Usrheader=/usr/src/linux-headers-$kernel | |
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 funcmap | |
import ( | |
"errors" | |
"reflect" | |
) | |
var ( | |
ErrParamsNotAdapted = errors.New("The number of params is not adapted.") | |
) |
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
sqlStr := "REPLACE INTO users VALUES " | |
vals := []interface{}{} | |
for _, user := range users { | |
val := []interface{}{ | |
user.ID, | |
user.FirstName, | |
user.LastName, | |
} | |
q := strings.Repeat("?,", len(val)) | |
q = q[0:len(q) - 1] |