Skip to content

Instantly share code, notes, and snippets.

View oldthreefeng's full-sized avatar
🎯
Focusing never give up

daoren oldthreefeng

🎯
Focusing never give up
View GitHub Profile
@oldthreefeng
oldthreefeng / config
Last active October 11, 2020 16:43
ssh proxy github.com
## use ssh proxy github.com on linux/ubuntu/mac os/ windows .
# A highest way to get resource from github.com
A local host (git client),B is jumpserver(can fastest get resource from Github),C is Github host 。
by using ssh forward ,A could tunnel B to get C,so we can fastest get resource from Github。
ln -sv /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
#!/bin/sh
title=$1
messageUrl=$2
picUrl=$4
text=$3
PHONE="158215*****"
TOKEN=$5
DING="curl -H \"Content-Type: application/json\" -X POST --data '{\"msgtype\": \"link\", \"link\": {\"messageUrl\": \"${messageUrl}\", \"title\": \"${title}\", \"picUrl\": \"${picUrl}\", \"text\": \"${text}\",}, \"at\": {\"atMobiles\": [${PHONE}], \"isAtAll\": false}}' ${TOKEN}"
eval $DING
@oldthreefeng
oldthreefeng / pipeline
Last active September 18, 2019 11:03
pipeline
node {
stage('Parallel Stage') {
parallel 'test02': {
def remote = [:]
remote.name = "test01"
remote.host = "host"
remote.port = port
remote.allowAnyHosts = true
withCredentials([sshUserPrivateKey(credentialsId: 'louis', keyFileVariable: 'identity', passphraseVariable: 'passphrase', usernameVariable: 'username')]) {
remote.user = username
package sort
type Sorter interface{
Len() int
Less(i, j int) bool
Swap(i, j int)
}
func Sort(data Sorter) {
for i:=1; i<=data.Len(); i++{
for j:=0; j<=data.len()-i; j++{