Saki's 研究记录

Saki's 研究记录

MckeeのClub & SAKI’sブログ

Ansible provisioning ERROR! Using a SSH password instead of a key is not possible
避免 Ansible 无法存取第一次登录的 Server问题最近使用 ansible批量管理服务器,这批机器都没在我本机登录过,在首次运行 ansible-playbook操作时出现报错: 1fatal: [cache_01]: FAILED! => {"msg": "Using a SSH password instead of a key is not possible because Host Key checking is enabled and sshpass does not support this. Please add t...
Parsing a Redis connection string
背景最近在工作中需要访问redis,为了方便使用,将redis的地址、端口、密码等写到配置中读取。例如: 12345# redis configurationredis: db: 0 addr: 'redis-ip:10086' password: '******' 这样配置是没问题的,但计划赶不上变化,当需求改成写个命令行工具来读访问 redis时,就用不上配置文件了。redis的配置需要从命令行的参数传入,例如: 1cmd subcmd --redis_addr 'redis-ip:10086' --redis_pw...
Docker Error standard_init_linux.go exec user process caused exec formaterror
背景最近写了些python脚本打算把它们都扔到Docker里面去跑。写完Dockerfile测试好,push上服务器运行时报错了。 12WARNING: The requested image's platform (linux/arm64/v8) does not match the detected host platform (linux/amd64) and no specific platform was requestedstandard_init_linux.go:228: exec user process caused: exec format error ...
实时性能分析工具Pyroscope
背景当服务上线后,流量增加或短暂功能故障,都会造成用户体验变差,而这时怎样才能快速找到性能瓶颈呢?这次将会介绍一套实时性能分析工具——pyroscope,让开发者可以快速定位到造成性能瓶颈的代码,而且目前还支持在 Python、Rust 或 Go 的环境。下面将主要针对 Go 环境做介绍。 什么是 Pyroscope ?Pyroscope 是一套开源的实时性能监控平台,简单的 Agent-Server 框架,让开发者可以轻松监控服务的性能,不管是要找10秒还或是多年的性能数据,都可以快速的实时呈现。由于采样分析技术,CPU 开销较低,开发者用不用在意安装此监控会不会造成任何性能上的负担...
Golang 1.18 工作区模式(workspace mode)
环境 OS: Darwin Kernel Version 21.4.0GO: go version go1.18 darwin/arm64 背景Go1.18 最 “实用“ 的功能,应该是 Go 工作区模式,它使得开发者在多个模块中的开发工作变得更加简单。 使用在同一个目录下创建两个空的 go 包 demo 和 util。 1mkdir -p workspace_mode_example/{demo,util} 然后分别使用 go mod init 来初始化。 1234cd workspace_mode_example/demogo mod init workspa...
Golang 1.18 报错:linkname must refer to declared function or variable
问题最近在mac上升级golang到1.18版本,新建gin服务执行go run时报错: 123456789101112# golang.org/x/sys/unix../../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20200116001909-b77594299b42/unix/syscall_darwin.1_13.go:25:3: //go:linkname must refer to declared function or variable../../../../go/pkg/mod/golang.org/x/sys@v0.0.0-2...
Node Sass does not yet support apple m1, Big Sur and arm64
问题换了M1芯片的MBP, 最近在原有Vue项目中执行命令编译打包: 1npm run build:prod 遇到了以下报错: 12345error in ./src/styles/index.scssError: Node Sass does not yet support your current environment: OS X Unsupported architecture (arm64) with Unsupported runtime (93)For more information on which environments are supported please ...
Including .well-known directory
背景最近尝试在Brave Rewards注册,并把自己的网站添加到频道上。其中有个步骤是要求将一个txt校验文件添加到网站,并能通过https://myblog.com/.well-known/brave-rewards-verification.txt访问。 问题创建目录在hexo/source目录下建立.well-known目录并把下载好的brave-rewards-verification.txt文件拷贝进去。 1234567.├── 404├── about├── ads.txt├── _posts├── robots.txt└── .well-known 配置修改_confi...
安装 trash 为使用 rm 命令删除文件增加补救机会
背景为了避免在 mac 上执行 rm -rf something 把重要文件删掉,可以使用 trash 替代 rm,这样文件就不会直接被删除,而是进入废纸篓,给自己增加一次反悔的机会。 安装 trashtrash–CLI tool that moves files or folder to the trash 使用 homebrew 安装 trash: 1brew install trash 配置命令行安装完之后在 .zshrc 或者 .bashrc 添加以下配置,.Trash 是Mac下的废纸篓目录。 123456789# trashalias rm=trashalias r=tra...