摘要: 创建带密码的zip压缩包 package main import ( "io" "io/fs" "log" "os" "path/filepath" "strings" "github.com/alexmullins/zip" ) func init() { log.SetFlags(log.Lsh 阅读全文
posted @ 2024-09-10 13:59 liy36 阅读(229) 评论(0) 推荐(0)
摘要: #!/usr/bin/env python3 # -*- coding: utf-8 -*- # from collections import namedtuple # 定义一个命名元组来存储赎回费率的期限和费率 RedemptionRate = namedtuple("RedemptionRat 阅读全文
posted @ 2024-08-07 13:32 liy36 阅读(35) 评论(0) 推荐(0)
摘要: Go使用HTTP的私有仓库中的模块 1. 导入方设置Go变量 go env -w GOPRIVATE='gitlab.xxe.example.com' go env -w GOINSECURE='gitlab.xxe.example.com' # 因为中间多了一级.xxe导致不能用通配域名 2. 仓 阅读全文
posted @ 2024-07-23 17:47 liy36 阅读(121) 评论(0) 推荐(0)
摘要: 查看Pod日志中显示 pthread_create failed: Resource temporarily unavailable 通过监控系统查看节点的进程数 topk(3,sum(container_threads{cluster="env",node="worker-13"}) by (po 阅读全文
posted @ 2024-01-17 10:17 liy36 阅读(286) 评论(0) 推荐(0)
摘要: # Prometheus常用查询 ## 集群指标 ``` promql # CPU核心总数 sum(machine_cpu_cores{cluster="$cluster",job="kubelet"}) by(cluster) # CPU请求总数 sum(kube_pod_container_re 阅读全文
posted @ 2023-07-17 09:27 liy36 阅读(661) 评论(0) 推荐(0)
摘要: # jq 命令常用语法 > demo数据 ``` json [ { "name": "user_b75b", "password": "UC9NxVUzfEVq", "instance_id": "rm-3aa3c7a51c6d6491d2421822" }, { "name": "user_fc4 阅读全文
posted @ 2023-07-15 20:28 liy36 阅读(28) 评论(0) 推荐(0)
摘要: package main import ( "fmt" "sync" ) var wg sync.WaitGroup var number, letter = make(chan bool, 1), make(chan bool, 1) func printInt() { defer wg.Done 阅读全文
posted @ 2023-03-09 21:03 liy36 阅读(45) 评论(0) 推荐(0)
摘要: # 使用懒加载优化bash启动速度 ## 优化前 bash补全配置 ``` bash # ~/.bash_profile source .bash_completion # ~/.bash_completion source '/opt/homebrew/etc/profile.d/bash_com 阅读全文
posted @ 2023-02-20 14:09 liy36 阅读(80) 评论(0) 推荐(0)
摘要: # Ansible 批量配置 ssh 公钥 ``` yaml - hosts: k8s remote_user: root tasks: - name: Set authorized key taken from file authorized_key: user: root state: pres 阅读全文
posted @ 2022-11-20 11:56 liy36 阅读(36) 评论(0) 推荐(0)
摘要: 使用Containerd构建容器镜像 一. 安装Containerd 1.1. 下载软件包 https://github.com/containerd/containerd/releases wget https://github.com/containerd/containerd/releases 阅读全文
posted @ 2022-08-17 15:10 liy36 阅读(2112) 评论(0) 推荐(0)