logo
publist
写文章

简介

该用户还未填写简介

擅长的技术栈

可提供的服务

暂无可提供的服务

golang.org/x/crypto/ssh使用

packagepackage sshplusimport ("fmt""golang.org/x/crypto/ssh""io/ioutil")func NewConfig(keyFile, user string) (config *ssh.ClientConfig, err error) {key, err := ioutil.ReadFile(keyFile)if err != nil {e

#golang#ssh#开发语言
Error: looks like “https://helm.min.io/“ is not a valid chart repository or cannot be reached

直接添加repo报错如下# helm repo add minio https://helm.min.io/Error: looks like "https://helm.min.io/" is not a valid chart repository or cannot be reached: Get "https://helm.min.io/index.yaml": x509: certifi

#https#linux
golang使用grpc转化为restful

go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gatewaygo get -u github.com/golang/protobuf/protoc-gen-gogo get -u github.com/gogo/protobuf/gogoprotoproto文件syntax = "proto3";package a

#golang#http
n9e源码阅读-agent-3-添加自定义系统指标采集

1. monStart采集监控指标,从该函数开始func main() {...if config.Config.Enable.Mon {monStart()}...}func monStart() {...//采集系统指标funcs.BuildMappers()funcs.Collect()...}2. 添加自定义指标type FuncsAndInterval struct {Fs[]fun

#golang
failed to register layer: Error processing tar file(exit status 1): archive/tar: invalid tar header

网上通用解法:保存镜像时:docker save -o [image].tar// 重点是加上-o选项load镜像时:docker load -i [image].tarhttps://programmerah.com/docker-load-error-processing-tar-fileexit-status-1-archive-tar-invalid-tar-header-23841/本次

#docker
升级ubuntu22.10到24.04

将old-releases.ubuntu.com替换成国内的地址,因为2210国内源没找到,没有了,但是现在更新到24.04,国内是有的。如果执行apt dist-upgrade报错,那就直接reboot,重启之后再执行。将所有kinetic换成noble,noble是24.04源,sed或手动改。

文章图片
n9e源码阅读-agent-3-添加自定义系统指标采集

1. monStart采集监控指标,从该函数开始func main() {...if config.Config.Enable.Mon {monStart()}...}func monStart() {...//采集系统指标funcs.BuildMappers()funcs.Collect()...}2. 添加自定义指标type FuncsAndInterval struct {Fs[]fun

#golang
Open Policy Agent(OPA) rego使用

下载opa文档地址https://www.openpolicyagent.org/docs/latest/#1-download-opacurl -L -o opa https://openpolicyagent.org/downloads/v0.33.1/opa_linux_amd64_staticchmod a+x opamv opa /usr/local/bin非交互式运行package r

n9e源码阅读-agent-3-添加agent上报信息

1. reportStart()函数上报本机信息给ams,从该函数开始func main() {...if config.Config.Enable.Report {reportStart()}...2. 定时循环上报func reportStart() {go report.LoopReport()}func LoopReport() {duration := time.Duration(con

#golang
R系实时KVM

1 warning host doesn't support requested feature: CPUID.01H:EDX.ds [bit 21] 修改nova.conf在[libvirt]下添加cpu_mode=host-passthrough2 创建虚拟机时Insufficient compute resources: Requested instance N...

#linux
    共 20 条
  • 1
  • 2
  • 请选择