摘要:
0.top指令和ps指令的CPU计算 top top指令显示为一段时间内的CPU使用率,通常为几秒 显示值可大于100%,表示多核占用的情况 用于排查CPU高负载进程 ps ps指令显示从开机到现在的平均CPU使用率 主要用于查看进程CPU资源占用 1.Linux下CPU使用率计算 1.1 获取CP
阅读全文
posted @ 2023-05-24 15:39
umichan
阅读(3065)
推荐(0)
2025年8月22日
摘要:
编译和运行环境分离 以C++项目为例,容器运行除了项目的二进制文件以外,还需要相关的依赖库,而运行环境中并不需要编译环境中的大部分依赖 # Compile FROM docker.io/library/ubuntu:latest AS builder # Install compile relate
阅读全文
posted @ 2025-08-22 16:14
umichan
阅读(12)
推荐(0)
2025年8月8日
摘要:
使用buildah官方提供的镜像作为运行容器 docker pull quay.io/buildah/stable:latest 创建buildah容器,容器中可以执行pull/build/push 镜像的数据会存储到宿主机的/var/buildah目录下 sudo docker run -it \
阅读全文
posted @ 2025-08-08 14:43
umichan
阅读(12)
推荐(0)
2025年7月23日
摘要:
chroot命令无法直接使用exec.Command调用,提示错误代码125或127 以查看宿主机磁盘的命令为例 package main import ( "fmt" "os/exec" "syscall" ) func main() { // Replace with your chroot p
阅读全文
posted @ 2025-07-23 11:29
umichan
阅读(28)
推荐(0)
2024年5月11日
摘要:
Header定义 // standard archive format - standard tar - ustar struct TarHeader { char name[100]; // 0 -99 char mode[8]; // 100-107 char uid[8]; // 108-11
阅读全文
posted @ 2024-05-11 11:27
umichan
阅读(259)
推荐(0)
2024年4月18日
摘要:
运行进程时报错 ./main: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by ./main) ./main: /lib/x86_64-linux-gnu/libc.so.6: version
阅读全文
posted @ 2024-04-18 14:59
umichan
阅读(19035)
推荐(2)
2024年2月20日
摘要:
报错找不到zsh Last login: Tue Feb 20 14:28:15 2024 from 192.168.102.123 usr/bin/zsh: No such file or directory Connection to 192.168.102.112 closed. 登录服务器发
阅读全文
posted @ 2024-02-20 15:21
umichan
阅读(130)
推荐(0)
2024年2月6日
摘要:
调用的开源库引用了github个人仓库,如果作者删除了仓库或者改成私人仓库,那么go mod tidy就会失败 以github.com/mitchellh/osext为例,作者因为某些原因删除了仓库,并给出了替代的官方仓库github.com/kardianos/osext 使用replace命令
阅读全文
posted @ 2024-02-06 10:29
umichan
阅读(668)
推荐(0)
2024年1月24日
摘要:
发现与ntp服务器同步后,间隔10秒再同步,系统时间与ntp服务器已经相差0.6秒,因此怀疑系统时钟被修改了 使用adjtimex调整 sudo apt install adjtimex 对比当前系统时钟 sudo adjtimex --compare WARNING: CMOS time is 5
阅读全文
posted @ 2024-01-24 14:32
umichan
阅读(149)
推荐(0)
2023年12月1日
摘要:
不同架构的CPU,CPU温度所在的系统文件有区别 CPU温度相关的系统文件位于 cd /sys/class/thermal 可以看到文件夹下有很多命名为thermal_zone{n}的文件夹 以thermal_zone0文件夹为例 cat /sys/class/thermal/thermal_zon
阅读全文
posted @ 2023-12-01 10:41
umichan
阅读(3778)
推荐(1)
2023年11月23日
摘要:
公司电脑尝试拉取ubuntu镜像报错如下: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Clien
阅读全文
posted @ 2023-11-23 11:38
umichan
阅读(333)
推荐(0)