diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b08d669 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM golang:1.19 as builder +WORKDIR /workdir +ADD go.mod go.mod +ADD go.sum go.sum +ENV GOPROXY=https://goproxy.cn,direct GO111MODULE=on +RUN go mod download +ADD main.go main.go +ADD pkg pkg +RUN GOOS=linux GOARCH=amd64 go build -o /appname main.go + +FROM scratch +COPY --from=builder /workdir/appname / +ENTRYPOINT [ "/appname" ] \ No newline at end of file diff --git a/go/double_ball/main.go b/go/double_ball/main.go new file mode 100644 index 0000000..57eb437 --- /dev/null +++ b/go/double_ball/main.go @@ -0,0 +1,68 @@ +package main + +import ( + "flag" + "fmt" + "math/rand" + "sort" + "time" +) + + +const ( + RedMax = 33 + BlueMax = 16 +) + +func randRate(){ + rand.Seed(time.Now().UnixNano()) + rate := rand.Intn(100) + 1 + fmt.Printf("\t (中奖概率%d%%)", rate) +} + +func randBall(max int)int{ + rand.Seed(time.Now().UnixNano()) + return rand.Intn(max) + 1 +} + +func isIn(list []int, item int )bool{ + for _, i := range list{ + if i == item { + return true + } + } + return false +} + +func randDoubleBall(){ + balls := []int{} + for i := 0; i < 6;{ + ball := randBall(RedMax) + if isIn(balls, ball) { + continue + } + i++ + balls = append(balls, ball) + } + sort.Ints(balls) + blueball := randBall(BlueMax) + for _, ball := range balls { + fmt.Printf("\033[1;31;40m%d\033[0m \t", ball) + } + fmt.Printf("\033[1;34;40m%d\033[0m \t", blueball) + randRate() + fmt.Println("") +} + +func main(){ + var groups int + flag.IntVar(&groups, "g", 1, "注数") + flag.Parse() + if groups < 0 { + groups = 1 + } + fmt.Printf("为您选取了 %d 注随机双色球,祝君中奖!\n", groups) + for i := 0; i < groups; i++ { + randDoubleBall() + } +} \ No newline at end of file diff --git a/go/tensorflow/main.go b/go/tensorflow/main.go new file mode 100644 index 0000000..85f0393 --- /dev/null +++ b/go/tensorflow/main.go @@ -0,0 +1 @@ +package main \ No newline at end of file diff --git a/go/uiweb/SC/test.txt b/go/uiweb/SC/test.txt new file mode 100644 index 0000000..e69de29 diff --git a/go/uiweb/index.tmpl b/go/uiweb/index.tmpl index 950e11d..7ed24d7 100644 --- a/go/uiweb/index.tmpl +++ b/go/uiweb/index.tmpl @@ -13,9 +13,13 @@

{{.title}}


- {{ range .files }} + {{ range $file := .files }}
-
{{.}}
+ {{ if eq $file "SC" }} +
{{$file}}
+ {{ else }} +
{{$file}}
+ {{ end }}
{{else}}
diff --git a/go/uiweb/main.go b/go/uiweb/main.go index 8b51622..1bae14b 100644 --- a/go/uiweb/main.go +++ b/go/uiweb/main.go @@ -14,6 +14,7 @@ func run(dir, title, addr string)error{ engine := gin.Default() engine.LoadHTMLGlob(dir + "/*.tmpl") engine.Static("/ui", dir) + engine.StaticFS("/SC", http.Dir(dir + "/SC")) engine.GET("/", func(ctx *gin.Context) { dirs, _ := os.ReadDir(dir) files := []string{} diff --git a/go/uiweb/uiweb b/go/uiweb/uiweb new file mode 100755 index 0000000..b7e4514 Binary files /dev/null and b/go/uiweb/uiweb differ diff --git a/kubernetes/installation/scripts/get_images.sh b/kubernetes/installation/scripts/get_images.sh index 1cb2108..76fa414 100644 --- a/kubernetes/installation/scripts/get_images.sh +++ b/kubernetes/installation/scripts/get_images.sh @@ -12,4 +12,15 @@ do ctr images push -k -u ${IMAGE_REGISTRY_USER} ${IMAGE_REGISTRY}/${IMAGE_NAME} # ctr images rm ${IMAGE} done -#192.168.0.144:1080 ccr.ccs.tencentyun.com/kgcrio 100004225373 \ No newline at end of file +<<<<<<< Updated upstream +#192.168.0.144:1080 ccr.ccs.tencentyun.com/kgcrio 100004225373 +======= +#192.168.0.144:1080 ccr.ccs.tencentyun.com/kgcrio 100004225373:Hello2022 +https_proxy=192.168.0.200:1080 ctr images pull --all-platforms registry.k8s.io/prometheus-adapter/prometheus-adapter:v0.10.0 +https_proxy=192.168.0.200:1080 ctr images pull --all-platforms registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.8.2 +ctr images tag registry.k8s.io/prometheus-adapter/prometheus-adapter:v0.10.0 registry.cn-hangzhou.aliyuncs.com/slmgoogle/prometheus-adapter:v0.10.0 +ctr images tag registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.9.2 registry.cn-hangzhou.aliyuncs.com/slmgoogle/kube-state-metrics:v2.9.2 + + +registry-vpc.cn-hangzhou.aliyuncs.com/slmgoogle +>>>>>>> Stashed changes