上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 58 下一页
摘要: 实验室有一位大神,他写的程序每次都会吃掉几百 G 的内存然后把服务器搞崩。作为 SysAdmin,肯定不能让服务器动不动就崩溃,因此我决定采取一些方法限制内存用量。 使用 earlyoom earlyoom 会在可用内存和 SWAP 均不足 10% 时关闭内存占用最大的进程。 安装 从 APT 安装 阅读全文
posted @ 2025-04-18 13:53 Undefined443 阅读(370) 评论(0) 推荐(0)
摘要: Visual Studio Code 从 1.99 版本停止支持过时 Linux。但是学校的服务器还在用 CentOS 7,而我没有权限更新系统。为了继续使用 VS Code 连接服务器,有两种方法:第一种是降级 VS Code 为 1.98,第二种是提供 VS Code 所需的 glibc 版本。 阅读全文
posted @ 2025-04-17 14:43 Undefined443 阅读(4875) 评论(0) 推荐(1)
摘要: Python 使用 yield 关键字来创建生成器。生成器相比列表具有使用内存小、可流式处理等优势。 使用 yield: def process_file(file): with open(file) as f: for line in f: yield process_line(line) # 对 阅读全文
posted @ 2025-04-14 17:53 Undefined443 阅读(16) 评论(0) 推荐(0)
摘要: 重新创建 virbr0 接口 今天清理机器上不需要的虚拟网络接口,一不小心把 KVM 虚拟机的 virbr0 接口删除了,试了一下果然不能 SSH 登录虚拟机了,于是需要将 virbr0 接口恢复。 拷贝接口定义文件: cp /usr/share/libvirt/networks/default.x 阅读全文
posted @ 2025-04-12 20:13 Undefined443 阅读(144) 评论(0) 推荐(0)
摘要: Server 安装 NFS 服务端: sudo apt install nfs-kernel-server 编辑导出配置: sudoedit /etc/exports # 根导出目录,允许所有主机访问 /srv/nfs4 *(rw,sync,no_subtree_check,all_squash,f 阅读全文
posted @ 2025-04-10 20:02 Undefined443 阅读(139) 评论(0) 推荐(0)
摘要: terminals database is inaccessible $ clear terminals database is inaccessible 出现这个错误的原因是 clear 找不到 terminfo 数据库。可以通过下面的命令指定 terminfo 数据库的位置: export TE 阅读全文
posted @ 2025-04-08 12:56 Undefined443 阅读(936) 评论(0) 推荐(0)
摘要: 在 CentOS 7 上使用 pip 安装 Python 包时出现证书验证错误: $ pip install tensorboard Looking in indexes: https://pypi.mirrors.ustc.edu.cn/simple WARNING: Retrying (Retr 阅读全文
posted @ 2025-04-06 22:37 Undefined443 阅读(426) 评论(1) 推荐(0)
摘要: 从 mpfr.org 下载源码: wget https://www.mpfr.org/mpfr-current/mpfr-4.2.2.tar.xz tar -Jxf mpfr-*.tar.xz 编译并安装: ./configure make -j$(nproc) sudo make install 阅读全文
posted @ 2025-04-04 06:30 Undefined443 阅读(77) 评论(0) 推荐(0)
摘要: 参见:KVM Network Configuration | Oracle Docs Prerequisite 检查 CPU 虚拟化支持: egrep -c '(vmx|svm)' /proc/cpuinfo # 计算虚拟处理器 VMX 或 SVM 的引用数 输出不为 0 即可。 安装依赖: sud 阅读全文
posted @ 2025-04-04 03:30 Undefined443 阅读(829) 评论(0) 推荐(0)
摘要: launchd 是 macOS 的系统启动和服务管理工具,相当于 Linux 的 systemd。 文件路径: ~/Library/LaunchAgents:仅适用于登录用户的第三方代理 /Library/LaunchAgents:基于每个用户且所有用户适用的第三方代理 /Library/Launc 阅读全文
posted @ 2025-04-02 15:00 Undefined443 阅读(126) 评论(0) 推荐(0)
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 58 下一页