Skip to content

Instantly share code, notes, and snippets.

View SoulSu's full-sized avatar
🎯
Focusing

soul SoulSu

🎯
Focusing
View GitHub Profile
@SoulSu
SoulSu / go-metrics.json
Created January 8, 2020 06:56
prometheus dashboard for grafana. local golang
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@SoulSu
SoulSu / Readme.md
Created August 23, 2019 09:50 — forked from ledongthuc/Readme.md
[Github Actions][Go] Check pull requests before merging

Create template actions that's used to verify Go language pull requests before merging. It's easy to custom the flow, tools with your case.

Put pr_checker.yml or pr_checker_simple.yml to .github/workflows/ and see how it works with your pull requests. Make sure you are allows to use actions of Github.

  • pr_checker.yml is using by mine with full checking tools. It will make sure every Go langauge pull requests will be buildable, testable, passed security checking and error-able code checking.
  • pr_checker_simple.yml is more simpler with buildable, testable.

References:

@SoulSu
SoulSu / .vimrc
Last active August 23, 2019 02:38
vimrc
map <F9> :call SaveInputData()<CR>
func! SaveInputData()
exec "tabnew"
exec 'normal "+gP'
exec "w! /tmp/input_data"
endfunc
"colorscheme torte
"colorscheme murphy
"colorscheme desert
"colorscheme desert
@SoulSu
SoulSu / windows-install-minikube.sh
Created June 27, 2019 02:13
windows 安装minikube
#!/bin/bash
set HTTP_PROXY=http://127.0.0.1:1080
set HTTPS_PROXY=http://127.0.0.1:1080
set NO_PROXY=localhost,127.0.0.1,10.96.0.0/12,192.168.99.1/24,192.168.39.0/24,10.5.0.0/16
minikube start --vm-driver=hyperv --hyperv-virtual-switch=minikube --docker-env=HTTP_PROXY=$HTTP_PROXY --docker-env HTTPS_PROXY=$HTTPS_PROXY --docker-env NO_PROXY=$NO_PROXY --v=7 --alsologtostderr
@SoulSu
SoulSu / dockerhubimage2k8s.sh
Created June 27, 2019 01:28
docker hub image to k8s
#!/bin/bash
docker pull soooooul/kube-proxy:v1.14.3
docker tag soooooul/kube-proxy:v1.14.3 k8s.gcr.io/kube-proxy:v1.14.3
docker rmi soooooul/kube-proxy:v1.14.3
docker pull soooooul/kube-apiserver:v1.14.3
docker tag soooooul/kube-apiserver:v1.14.3 k8s.gcr.io/kube-apiserver:v1.14.3
docker rmi soooooul/kube-apiserver:v1.14.3
@SoulSu
SoulSu / images2dockerhub.sh
Last active June 27, 2019 01:29
制作k8s docker hub 镜像
#!/bin/bash
#minikube info
#
# _ _
# _ _ ( ) ( )
# ___ ___ (_) ___ (_)| |/') _ _ | |_ __
#/' _ ` _ `\| |/' _ `\| || , < ( ) ( )| '_`\ /'__`\
#| ( ) ( ) || || ( ) || || |\`\ | (_) || |_) )( ___/
#(_) (_) (_)(_)(_) (_)(_)(_) (_)`\___/'(_,__/'`\____)
@SoulSu
SoulSu / terminator
Created March 23, 2019 07:31
~/.config/terminator/config terminator 配置
[global_config]
handle_size = -3
enabled_plugins = CustomCommandsMenu, LaunchpadCodeURLHandler, APTURLHandler, LaunchpadBugURLHandler
title_transmit_fg_color = "#000000"
suppress_multiple_term_dialog = True
title_transmit_bg_color = "#3e3838"
inactive_color_offset = 1.0
[keybindings]
[profiles]
[[default]]
@SoulSu
SoulSu / gaauth.go
Created December 18, 2018 11:52
生成谷歌验证器
package tools
// 谷歌验证
// clone from: https://github.com/928799934/googleAuthenticator
import (
"crypto/hmac"
"crypto/sha1"
"encoding/base32"
"encoding/hex"
"errors"
@SoulSu
SoulSu / ssl.go
Created December 18, 2018 11:49
使用Golang生成证书 公钥 私钥
package tools
import (
"bytes"
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"crypto/x509/pkix"
"encoding/asn1"
"encoding/pem"
@SoulSu
SoulSu / interface.go
Created November 27, 2018 10:10
Golang 实现一个接口后 方法需要传数组怎么办
package main
import (
"fmt"
"reflect"
)
type Aer interface {
GetVal() string
SetVal(int)