欢迎来到 W10N 的博客

本站主要是个人使用的读书笔记和技术文档。 收集整理了一些技术资料,希望能帮助到有需要的人。

chezmoi

chezmoi 是一个跨平台的 dotfiles 管理工具,使用 Go 编写,支持模板、加密 secret、多机器差异配置。 安装¬ # Arch Linux pacman -S chezmoi # macOS brew install chezmoi # 通用安装脚本 sh -c "$(curl -fsLS get.chezmoi.io)" 初始化 # 初始化(本地,不关联远程仓库) chezmoi init # 初始化并关联远程 git 仓库(自动 clone 到 ~/.local/share/chezmoi/) chezmoi init git@github.com:用户名/仓库名.git # 用 GitHub 用户名简写(默认找 dotfiles 仓库) chezmoi init <github-username> chezmoi init 可以在任意目录执行,source 目录固定克隆到 ~/.local/share/chezmoi/,不需要手动指定位置。 添加文件 # 将文件纳入 chezmoi 管理 chezmoi add ~/.bashrc chezmoi add ~/.config/nvim/init.lua # 添加整个目录(递归) chezmoi add ~/.config/somedir # 添加时标记为模板 chezmoi add --template ~/.gitconfig 路径包含空格时加引号: ...

2026-05-05 · 2 min · 423 words · -

linux apps

Linux Apps 跨平台常用软件统一维护于 my apps,本文只记录 Linux 专属工具。 说明 pacman — sudo pacman -S aur — yay -S apt — sudo apt install Essentials 跨平台工具详见 my apps,以下是 Linux 上的安装命令速查: app source notes kitty pacman terminal neovim pacman 编辑器 flameshot pacman 截图+标注 bitwarden pacman 密码管理 btop pacman top 替代 wechat aur visual-studio-code-bin aur VSCode 官方二进制版 Browser Ubuntu install Chrome curl -O https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb sudo apt install ./google-chrome-stable_current_amd64.deb Terminal app source notes termite pacman 支持 32 位色 Text Editor app source notes mousepad pacman 轻量文本编辑器 nixnote2-git aur Evernote Linux 客户端 Screenshot / Recording app source notes spectacle pacman KDE 原生截图 simplescreenrecorder pacman 录屏 gtk-recordmydesktop aur 录屏 shutter aur 截图,需配合 perl-goo-canvas System Monitor app source notes ncdu pacman/apt 命令行磁盘空间分析 netdata pacman 系统资源监控 indicator-sysmonitor apt 任务栏系统资源监控 nethogs pacman 网络流量监控 dstat pacman 查看系统性能 dstat -cdlmnpsy slurm aur 网络监控 hardinfo-git aur 硬件信息查看 System Info app source notes fastfetch pacman 打印发行版 logo neofetch pacman/apt 系统信息(已停止维护) stress pacman 压力测试 hdparm pacman 磁盘参数查看 procmon aur 微软的进程监控工具 File Management app source notes filelight pacman 图形化磁盘空间管理 baobab apt 硬盘占用分析工具 catfish pacman 文件搜索 tree apt 树形目录显示 tree -L N nautilus apt Ubuntu 默认文件管理器 Archive / Compression app source notes ark pacman KDE 压缩包管理器 file-roller pacman zip/7z/rar 支持 rar/unrar apt Media / Graphics app source notes digikam pacman KDE 最佳图片管理 gwenview pacman KDE 图片查看 eog apt Eye of Gnome 图片查看 okular pacman PDF reader gpick pacman 颜色拾取工具 Remote Desktop app source notes remmina pacman GTK 远程桌面客户端 freerdp pacman remmina RDP 支持包 rdesktop pacman Development Tools app source notes base-devel pacman 编译工具链 lsof pacman hexyl pacman 彩色 hex 编辑器 lrzsz pacman zmodem binutils pacman 二进制文件处理工具集 inetutils pacman telnet 等网络工具 kotlin pacman Fonts app source notes ttf-wqy-microhei apt 文泉驿-微米黑 ttf-wqy-zenhei apt 文泉驿-正黑 xfonts-wqy apt 文泉驿-点阵宋体 ttf-consolas-with-yahei-powerline-git aur Consolas+雅黑 ttf-wps-fonts aur WPS 字体依赖 KDE sudo pacman -S powerdevil kmix kscreen ark gwenview kcolorchooser app source notes powerdevil pacman 电源管理,休眠按钮 kmix pacman 音量调节 kscreen pacman 多显示器管理 kcolorchooser pacman 颜色拾取 KDE Widget name notes netspeed widget 网络监控 resources monitor CPU/内存监控 Plasma Week Number 显示周数 Virtualization app source notes kvm pacman wine pacman 需开启 Multilib 仓库 playonlinux pacman Wine 图形前端 podlet aur podman 辅助工具 Utilities app source notes rsibreak pacman 番茄钟 gnome-shell-pomodoro apt Pomodoro pavucontrol apt Chrome 音频输出设置 sl pacman 小火车 x11-apps apt xclock, xserver 测试用 pamac-aur aur 图形界面的 pacman libiconv aur 编码转换 Ventoy — 各种 ISO 安装盘引导工具 References Arch Linux List of Applications

2026-05-05 · 2 min · 383 words · w10n

macos apps

macOS Apps 跨平台常用软件统一维护于 my apps,本文只记录 macOS 专属工具。 说明 brew — brew install <name> cask — brew install --cask <name> Essentials 跨平台工具见 my apps,以下为 macOS 专属推荐: app install notes iterm2 cask:iterm2 功能强大的 terminal stats cask:stats 任务栏系统资源监控 itsycal cask:itsycal 任务栏日历(显示周数) tunnelblick cask:tunnelblick OpenVPN GUI 客户端 Productivity app install notes CleanMyMac X — 系统清理(官网购买) Bob cask:bob 翻译/词典 Itsycal cask:itsycal 任务栏日历,显示周数 Stats cask:stats 任务栏 CPU/内存/网络监控 Monosnap cask:monosnap 截图+标注 RealVNC Viewer cask:vnc-viewer 远程桌面 Terminal app install notes iterm2 cask:iterm2 macOS 最流行的 terminal VPN app install notes Tunnelblick cask:tunnelblick OpenVPN GUI,macOS 专属 Graphics / Design app install notes Sketch — 矢量绘图(官网购买) References Homebrew

2026-05-05 · 1 min · 97 words · -

my apps

跨平台常用软件统一列表。各平台专属工具见: Linux Apps macOS Apps Windows Apps 说明 列值为包名,可直接用于安装命令: pacman 列:sudo pacman -S <name> aur 列:yay -S <name> brew 列:brew install <name> cask 列:brew install --cask <name> win 列:winget install <id> — 表示该平台不支持或不常用 Essentials app pacman aur brew cask win notes chezmoi chezmoi — chezmoi — twpayne.chezmoi dotfiles 管理 kitty kitty — — kitty — terminal neovim neovim — neovim — Neovim.Neovim 编辑器 bitwarden bitwarden — — bitwarden Bitwarden.Bitwarden 密码管理 flameshot flameshot — — flameshot Flameshot.Flameshot 截图+标注 btop btop — btop — — top 替代 wechat — wechat — wechat Tencent.WeChat vscode — visual-studio-code-bin — visual-studio-code Microsoft.VisualStudioCode Browser app pacman aur brew cask win notes chromium chromium — chromium — Hibbiki.Chromium 开源版 Chrome google-chrome — google-chrome — google-chrome Google.Chrome google-chrome-beta — google-chrome-beta — google-chrome@beta Google.Chrome.Beta Terminal app pacman aur brew cask win notes kitty kitty — — kitty — tmux tmux — tmux — — hyper hyper — — hyper Hyper.Hyper Text Editor / Notes app pacman aur brew cask win notes neovim neovim — neovim — Neovim.Neovim typora — typora — typora Typora.Typora Markdown 编辑器 obsidian obsidian — — obsidian Obsidian.Obsidian 知识管理 Screenshot app pacman aur brew cask win notes flameshot flameshot — — flameshot Flameshot.Flameshot 截图+标注 System Monitor app pacman aur brew cask win notes btop btop — btop — — ncdu ncdu — ncdu — — 磁盘空间分析 Development Tools app pacman aur brew cask win notes git git — git — Git.Git lazygit — — lazygit — JesseDuffield.lazygit go install github.com/jesseduffield/lazygit@latest gitkraken — gitkraken — gitkraken Axosoft.GitKraken Git GUI github-desktop — github-desktop-bin — github GitHub.GitHubDesktop cmake cmake — cmake — Kitware.CMake iperf3 iperf3 — iperf3 — ESnet.iPerf3 网络测试 wireshark wireshark-qt — — wireshark WiresharkFoundation.Wireshark zeal zeal — — zeal OlegKalnin.Zeal 离线文档 chezmoi chezmoi — chezmoi — twpayne.chezmoi dotfiles 管理 platformio — platformio platformio — — 物联网开发 IDE app pacman aur brew cask win notes vscode — visual-studio-code-bin — visual-studio-code Microsoft.VisualStudioCode vscodium — vscodium-bin — vscodium VSCodium.VSCodium 无遥测版 jetbrains-toolbox — jetbrains-toolbox — jetbrains-toolbox JetBrains.Toolbox intellij-idea-ce intellij-idea-community-edition — — intellij-idea-ce JetBrains.IntelliJIDEA.Community intellij-idea-ult — intellij-idea-ultimate-edition — intellij-idea JetBrains.IntelliJIDEA.Ultimate goland — goland — goland JetBrains.GoLand webstorm — webstorm — webstorm JetBrains.WebStorm clion — clion — clion JetBrains.CLion datagrip — — — datagrip JetBrains.DataGrip claude-code — claude-code — — — macOS: npm i -g @anthropic-ai/claude-code Java app pacman aur brew cask win notes jdk (latest) jdk-openjdk — openjdk — Microsoft.OpenJDK.21 jdk8 jdk8-openjdk — openjdk@8 — Microsoft.OpenJDK.8 maven maven — maven — Apache.Maven gradle gradle — gradle — Gradle.Gradle graphviz graphviz — graphviz — Graphviz.Graphviz PlantUML 依赖 jd-gui — jd-gui-bin — jd-gui — Java 反编译 eclipse-mat — eclipse-mat — mat — Eclipse Memory Analyzer Go / Node.js / Rust app pacman aur brew cask win notes go go — go — GoLang.Go nvm nvm — nvm — — Node.js 版本管理 rust rust — rustup — Rustlang.Rustup Database app pacman aur brew cask win notes redisinsight — redisinsight — redisinsight Redis.RedisInsight Redis GUI tableplus — tableplus — tableplus — DB 客户端 heidisql — heidisql — — HeidiSQL.HeidiSQL MySQL 客户端 Communication app pacman aur brew cask win notes telegram telegram-desktop — — telegram Telegram.TelegramDesktop wechat — wechat — wechat Tencent.WeChat feishu — feishu — feishu ByteDance.Feishu 飞书 dingtalk — dingtalk — dingtalk Alibaba.DingTalk zoom — zoom — zoom Zoom.Zoom thunderbird thunderbird — — thunderbird Mozilla.Thunderbird 邮件客户端 Office app pacman aur brew cask win notes libreoffice libreoffice-fresh — — libreoffice TheDocumentFoundation.LibreOffice wps-office — wps-office — wpsoffice — Media / Graphics app pacman aur brew cask win notes inkscape inkscape — — inkscape Inkscape.Inkscape 矢量图形 SVG audacity audacity — — audacity Audacity.Audacity 音频处理 Archive / Compression app pacman aur brew cask win notes zstd zstd — zstd — Facebook.Zstandard 多线程快速压缩 Download app pacman aur brew cask win notes aria2 aria2 — aria2 — aria2.aria2 axel axel — axel — — VPN app pacman aur brew cask win notes openvpn openvpn — — tunnelblick OpenVPNTechnologies.OpenVPN macOS 用 Tunnelblick GUI Virtualization / Container app pacman aur brew cask win notes docker docker — — docker Docker.DockerDesktop podman podman — podman — RedHat.Podman Fonts app pacman aur brew cask win notes JetBrains Mono ttf-jetbrains-mono — font-jetbrains-mono — JBRAINS.JetBrainsMono Source Code Pro adobe-source-code-pro-fonts — font-source-code-pro — — Adobe 编程字体 Utilities app pacman aur brew cask win notes keepassxc keepassxc — — keepassxc KeePassXCTeam.KeePassXC 密码管理 qalculate qalculate-gtk — qalculate-gtk — — 全宇宙最好用的计算器

2026-05-05 · 4 min · 710 words · -

Windows apps

Windows Apps 跨平台常用软件统一维护于 my apps,本文只记录 Windows 专属工具。 说明 winget — winget install <id> choco — choco install <name> Essentials 跨平台工具见 my apps,以下为 Windows 专属推荐: app install notes Windows Terminal winget:Microsoft.WindowsTerminal PowerToys winget:Microsoft.PowerToys WSL2 — wsl --install T-Clock — 任务栏显示周数,GitHub Disk Analysis app install notes WizTree — 硬盘占用分析,商用收费 SpaceSniffer — 硬盘占用分析,商用友好 WinDirStat — Partition app install notes MiniTool Partition Wizard — 磁盘分区工具 Remote Desktop app install notes AnyDesk winget:AnyDesk.AnyDesk 远程桌面 ToDesk — 远程桌面 MobaXterm — SSH client + X server WinSCP winget:WinSCP.WinSCP SFTP/SCP 客户端 System Tools app install notes Process Hacker choco:processhacker 任务管理器替代 Open Hardware Monitor — 监控温度/内存 PowerToys winget:Microsoft.PowerToys Windows Terminal winget:Microsoft.WindowsTerminal taskmgr — C:\Windows\System32\Taskmgr.exe X Server app install notes x410 — X server,Microsoft Store VcXsrv choco:vcxsrv X server Misc app install notes T-Clock — 任务栏时钟(显示周数),格式:mm-dd HH:nn \nW Wi ddd rufus choco:rufus 创建启动盘,ISO to USB WSL2 — wsl --install winget packages winget install Microsoft.WindowsTerminal winget install Microsoft.PowerToys winget install WinSCP.WinSCP winget install Mozilla.Firefox winget install Microsoft.PowerShell winget install cURL.cURL choco packages # 安装 choco install keepassxc # 升级 choco upgrade keepassxc name notes keepassxc microsoft-windows-terminal winscp heidisql MySQL 客户端 redis-desktop-manager processhacker vcxsrv X server 录屏 v1tx 录屏工具推荐 winget winget install Microsoft.WindowsTerminal Microsoft.WindowsTerminal WinScp, WinSCP.WinSCP firefox, Mozilla.Firefox powershell, Microsoft.PowerShell curl, cURL.cURL Golang, GoLang.Go Tabby, Eugeny.Tabby nodejs, OpenJS.NodeJS choco # 安装软件,重复执行只会检查是否安装不会升级版本 choco install keepassxc # 升级软件到新版本 choco upgrade keepassxc https://blog.wiloon.com/?p=8340 https://chocolatey.org/packages ...

2026-05-05 · 2 min · 312 words · -

Markdown 语法

Markdown 语法 JetBrain Writerside implements the CommonMark Spec: https://spec.commonmark.org/0.30/ 转义 比如在 Markdown 中显示反引号, 可以用反斜杠转义 ` 字体 加粗 要加粗的文字左右分别用两个*号包起来 斜体 要倾斜的文字左右分别用一个*号包起来 *foo* foobarfoo 斜体加粗 要倾斜和加粗的文字左右分别用三个*号包起来 删除线 要加删除线的文字左右分别用两个~~号包起来 示例 这是加粗的文字 这是倾斜的文字 这是斜体加粗的文字 这是加删除线的文字 标题 # 一级标题 ## 二级标题 ### 三级标题 #### 四级标题 ##### 五级标题 ###### 六级标题 图片 ![Alt text](图片链接 "optional title") # 本地图片 ![avatar](/user/desktop/doge.png) # 网络图片 ![avatar](https://dubbo.apache.org/imgs/v3/concepts/threecenters.png) ![](https://dubbo.apache.org/imgs/v3/concepts/threecenters.png) 表格 | t0 | t1 | | - | - | | c0r0 | c1r0| | c1r1 | c1r1 | 代码块 Code Blocks 围栏式代码块(Fenced Code Blocks) 使用三个反引号包裹,开头的反引号后面跟语言标识符: ...

2026-05-05 · 2 min · 282 words · -

硬盘扩容, PVE, Archlinux

硬盘扩容 PVE ext4 disk resize (parted) 理论上 parted 可以在根分区正在被使用的情况下扩容根分区,但实际操作中发现根分区无法卸载,导致 parted 报错 Error: /dev/sda: unrecognised disk label,解决方法是直接进入 parted,parted 会提示修复,输入 Fix 即可修复分区表,然后就可以正常扩容了。 [Online Lossless Expansion of EXT4 Partition](https://tech.he-sb.top/posts/online-lossless-expansion-of-ext4-partition/) 在 pve 里给硬盘扩容: vm>hardware> Hard Disk> Disk Action> resize: 填写新增的容量 ### 查看分区表类型 ```bash parted -l 回显有可能是以下其中一种 Partition Table: msdos Partition Table: gpt Partition Table: loop msdos: MBR gpt: GPT loop: loop 设备(虚拟磁盘) 查看磁盘的分区信息 lsblk # 回显 # sda2 挂载到了根目录 / NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sda 8:0 0 13G 0 disk ├─sda1 8:1 0 200M 0 part /boot └─sda2 8:2 0 7.8G 0 part / 停掉写磁盘的服务(如果是扩容非根分区) systemctl stop service0 非根分区扩容, 建议先卸载磁盘分区 umount /dev/sda2 确认磁盘分区的卸载结果 lsblk # 回显 # vdb 没有挂载 vdb 253:16 0 200G 0 disk 进入 parted # 进入 parted 分区工具, 参数要传整个硬盘(sda), 不要传某一个分区(sda2) parted /dev/sda # 输入"p" 然后回车,查看当前磁盘分区情况。 (parted) p # 如果提示需要修复,执行Fix Fix # 扩容, 使用所有剩余空间,在分区层面扩容 (parted) resizepart 2 100% # 查看分区 (parted) p # 退出 parted (parted) q 检查磁盘分区文件系统的正确性, 文件系统扩容 # 执行以下命令,检查磁盘分区文件系统的正确性, 如果是要分区分显示正在使用, 检查不了 # 可能会提示 Inode 262714 extent tree (at level 1) could be narrower. Optimize<y>? yes e2fsck -f /dev/sda2 # 其它分区如果回显 /dev/vdb is in use, 停掉读写硬盘的服务重试 # 执行以下命令,扩展磁盘分区文件系统的大小,在文件系统层面扩容 resize2fs /dev/sda2 # 查看分区容量(只能查看已挂载的分区容量, 如果是扩容非根分区, 需要先挂载分区才能看到扩容后的容量) df -TH # 查看分区大小(分区层) fdisk -l /dev/sda # 查看文件系统大小(文件系统层,Block count × Block size) dumpe2fs -h /dev/sda2 | grep -E "Block count|Block size" pve ext4 根分区磁盘扩容 (fdisk) 虚拟机关机 ...

2026-05-05 · 9 min · 1796 words · -

archlinux packages

archlinux packages 本文逐步记录我的 Arch Linux 系统中安装的软件包,目标是了解每个包在当前系统中的用途,以及它是否是必要的依赖(能否安全删除)。 aalib: ASCII art graphic library aardvark-dns: Authoritative DNS server for A/AAAA container records abseil-cpp: Collection of C++ library code designed to augment the C++ standard library adwaita-fonts: GNOME Adwaita 字体,被 wechat 等应用依赖 ansible: IT automation tool ansible-core: Ansible core engine aom: Alliance for Open Media video codec appstream: Provides a standard for creating app stores across distributions archlinux-appstream-data: Arch Linux application database for AppStream-based software centers at-spi2-core: Protocol definitions and daemon for D-Bus at-spi audit: Userspace components of the audit framework avahi: Service Discovery for Linux using mDNS/DNS-SD (compatible with Bonjour) baloo-widgets: KDE Baloo 搜索框架集成小部件 bluez-libs: Deprecated libraries for the bluetooth protocol stack boost-libs: Boost C++ 通用库运行时动态库,详见 boost-libs botan: Crypto library written in C++ bubblewrap: 非特权沙箱工具,详见 bubblewrap btrfs-progs: Userspace utilities to manage btrfs filesystems c-ares: 异步 DNS 解析 C 库,被 curl、Node.js 等广泛使用 ca-certificates-mozilla: Mozilla’s set of trusted CA certificates cfitsio: C/Fortran library for reading and writing FITS data format files chrony: Lightweight NTP client and server conmon: OCI container runtime monitor cryptsetup: Userspace setup tool for transparent encryption of block devices using dm-crypt dav1d: AV1 cross-platform decoder focused on speed and correctness expat: C 语言实现的流式 XML 解析库(libexpat),详见 expat fftw: A library for computing the discrete Fourier transform (DFT) fzf: General-purpose command-line fuzzy finder gcr: A library for bits of crypto UI and parsing glslang: OpenGL Shading Language 编译器和验证器,详见 glslang gnutls: A library which provides a secure layer over a reliable transport layer gtk-update-icon-cache: GTK icon cache updater hwdata: Hardware identification databases iproute2: IP routing utilities libavif: Library for encoding and decoding .avif files libplist: Library to handle Apple Property List files libx11: X11 client-side library expat C 语言实现的流式 XML 解析库(libexpat),采用 SAX(事件驱动)解析模型,适合处理大型 XML 文档。当前系统被以下包依赖:antigravity(Google 的 AI 辅助 IDE 工具)、avahi(mDNS/DNS-SD 零配置网络服务)、cmake(跨平台构建系统)、dbus(进程间通信总线)、dbus-broker(D-Bus 的替代实现)、exiv2(图片元数据读写库)、fontconfig(字体配置库)、gdb(GNU 调试器)、git(版本控制工具)、mesa(OpenGL/Vulkan 图形驱动实现)、neon(HTTP/WebDAV 客户端库)、polkit(权限授权框架)、python(Python 解释器)、qt6-webengine(Qt6 网页渲染引擎)、vtk(3D 可视化工具库)、wayland(显示服务协议库)、webkit2gtk-4.1(WebKit 网页渲染引擎)、wechat-bin(微信桌面客户端)。 ...

2026-05-02 · 2 min · 425 words · -

grub

grub 判断是否由 grub 引导 journalctl -b | grep -i grub https://www.gnu.org/software/grub/manual/grub/grub.html#Simple-configuration GRUB 来自 GRand Unified Bootloader 的缩写。它的功能是在启动时从 BIOS 接管掌控、加载自身、加载 Linux 内核到内存,然后再把执行权交给内核。一旦内核开始掌控,GRUB 就完成了它的任务,也就不再需要了。 GRUB 支持多种 Linux 内核,并允许用户在启动时通过菜单在其中选择。 GRUB 菜单提供了一个 “救援rescue” 内核,用于故障排除或者由于某些原因导致的常规内核不能完成启动过程。 grub.cfg 文件是 GRUB 配置文件。它由 grub2-mkconfig 程序根据用户的配置使用一组主配置文件以及 grub 默认文件而生成。/boot/grub2/grub.cfg 文件在 Linux 安装时会初次生成,安装新内核时又会重新生成。 grub.cfg 文件包括了类似 Bash 脚本的代码以及一个按照安装顺序排序的已安装内核列表。 grub.cfg 的主要配置文件都在 /etc/grub.d 目录。该目录中的每个文件都包含了最终会整合到 grub.cfg 文件中的 GRUB 代码。这些配置文件的命名模式以排序方式设计,这使得最终的 grub.cfg 文件可以按正确的顺序整合而成。每个文件都有注释表明该部分的开始和结束,这些注释也是最终的 grub.cfg 文件的一部分,从而可以看出每个部分是由哪个文件生成。 grub config file path Arch Linux:/boot/grub/grub.cfg RHEL/Fedora:/boot/grub2/grub.cfg EFI 系统:/boot/efi/EFI/<distro>/grub.cfg 临时修改 grub.cfg(直接编辑) 直接编辑 /boot/grub/grub.cfg 可以立即生效,无需重启(下次启动即生效),但不是持久化的——下次运行 grub-mkconfig 时会被覆盖。 ...

2026-05-02 · 2 min · 398 words · -

Linux 显示器分辨率问题修复:手动加载 EDID 固件

EDID 简介 什么是 EDID? EDID (Extended Display Identification Data) 是一种标准化的数据结构,用于显示器向计算机系统描述自己的能力和特性。可以将它理解为显示器的"身份证"或"技术规格说明书"。 EDID 包含的信息: 基本标识信息: 制造商 ID(如 Dell = “DEL”, Samsung = “SAM”) 产品型号代码和序列号 生产日期(周数/年份) 显示能力参数: 支持的分辨率列表(如 1920x1200, 1600x1200, 1280x1024) 支持的刷新率(如 60Hz, 75Hz) 原生(推荐)分辨率 色彩深度和色域信息 物理特性: 屏幕物理尺寸(以毫米为单位,用于计算正确的 DPI) 显示接口类型(模拟/数字) Gamma 值(2.2 是常见值) 系统如何读取 EDID? 是的,操作系统从显示器读取 EDID 信息。 这是一个自动化的初始化过程: ┌─────────────────────────────────────────────────────────────┐ │ 1. 物理连接 │ │ 显示器连接到主机(HDMI/DisplayPort/DVI/VGA) │ │ 硬件检测到连接 │ └──────────────────┬──────────────────────────────────────────┘ ↓ ┌─────────────────────────────────────────────────────────────┐ │ 2. DDC 通信初始化 │ │ 主机 → 显示器:发起 DDC (Display Data Channel) 请求 │ │ 使用 I2C 总线协议 │ └──────────────────┬──────────────────────────────────────────┘ ↓ ┌─────────────────────────────────────────────────────────────┐ │ 3. EDID 数据传输 │ │ 显示器 → 主机:返回 EDID 数据(128 或 256 字节) │ │ 通过显示线缆内的专用数据通道 │ └──────────────────┬──────────────────────────────────────────┘ ↓ ┌─────────────────────────────────────────────────────────────┐ │ 4. 内核处理 │ │ GPU 驱动解析 EDID → 验证校验和 → 提取支持的模式 │ └──────────────────┬──────────────────────────────────────────┘ ↓ ┌─────────────────────────────────────────────────────────────┐ │ 5. 自动配置 │ │ 选择最佳分辨率(通常是原生分辨率)→ 配置显示输出 │ └─────────────────────────────────────────────────────────────┘ 通信协议细节: ...

2026-05-01 · 17 min · 3517 words · -

Linux 显示器分辨率问题修复:手动加载 EDID 固件

EDID 简介 什么是 EDID? EDID (Extended Display Identification Data) 是一种标准化的数据结构,用于显示器向计算机系统描述自己的能力和特性。可以将它理解为显示器的"身份证"或"技术规格说明书"。 EDID 包含的信息: 基本标识信息: 制造商 ID(如 Dell = “DEL”, Samsung = “SAM”) 产品型号代码和序列号 生产日期(周数/年份) 显示能力参数: 支持的分辨率列表(如 1920x1200, 1600x1200, 1280x1024) 支持的刷新率(如 60Hz, 75Hz) 原生(推荐)分辨率 色彩深度和色域信息 物理特性: 屏幕物理尺寸(以毫米为单位,用于计算正确的 DPI) 显示接口类型(模拟/数字) Gamma 值(2.2 是常见值) 系统如何读取 EDID? 是的,操作系统从显示器读取 EDID 信息。 这是一个自动化的初始化过程: ┌─────────────────────────────────────────────────────────────┐ │ 1. 物理连接 │ │ 显示器连接到主机(HDMI/DisplayPort/DVI/VGA) │ │ 硬件检测到连接 │ └──────────────────┬──────────────────────────────────────────┘ ↓ ┌─────────────────────────────────────────────────────────────┐ │ 2. DDC 通信初始化 │ │ 主机 → 显示器:发起 DDC (Display Data Channel) 请求 │ │ 使用 I2C 总线协议 │ └──────────────────┬──────────────────────────────────────────┘ ↓ ┌─────────────────────────────────────────────────────────────┐ │ 3. EDID 数据传输 │ │ 显示器 → 主机:返回 EDID 数据(128 或 256 字节) │ │ 通过显示线缆内的专用数据通道 │ └──────────────────┬──────────────────────────────────────────┘ ↓ ┌─────────────────────────────────────────────────────────────┐ │ 4. 内核处理 │ │ GPU 驱动解析 EDID → 验证校验和 → 提取支持的模式 │ └──────────────────┬──────────────────────────────────────────┘ ↓ ┌─────────────────────────────────────────────────────────────┐ │ 5. 自动配置 │ │ 选择最佳分辨率(通常是原生分辨率)→ 配置显示输出 │ └─────────────────────────────────────────────────────────────┘ 通信协议细节: ...

2026-05-01 · 17 min · 3517 words · -

Vue

vue basic Vue 3 npm init vue@latest 构建工具链 Vue 3 官方脚手架从 Vue CLI(基于 Webpack)切换到了 Vite。 工具分层 层次 Vue CLI 时代 Vite 时代 工具链 Vue CLI + Webpack Vite 转译器 Babel esbuild 打包器 Webpack Rollup(生产) 压缩 Terser esbuild(默认) Babel vs esbuild 两者都是 JS 转译器(Transpiler),核心职责相同:把现代 JS/TS/JSX 语法转换成目标环境能运行的 JS。 Babel esbuild 实现语言 JavaScript Go 速度 慢 快 10-100x 可扩展性 插件生态极其丰富 插件有限 功能边界 只转译 转译 + 打包都能做 适合场景 需要复杂插件、polyfill 追求速度的现代项目 Rollup Rollup 是一个 JS 模块打包器(Bundler),解决的核心问题是:把多个 JS 模块文件合并成一个(或少数几个)输出文件。 ...

2026-04-30 · 4 min · 852 words · -

Service Worker

解决的问题 1. 离线体验 传统 Web 应用断网即不可用。Service Worker 可拦截网络请求,从缓存中返回资源,让应用在无网络时仍能运行。 2. 网络性能 可缓存静态资源(HTML、CSS、JS、图片),后续请求直接走缓存,减少网络延迟,加快页面加载速度。 3. 推送通知(Push Notifications) 即使页面未打开,Service Worker 也能在后台接收服务器推送的消息并展示通知。 4. 后台同步(Background Sync) 当用户在离线状态下提交表单或操作时,Service Worker 可在网络恢复后自动重试,保证数据最终被发送到服务器。 5. 独立于页面生命周期 它是独立于页面的后台进程,页面关闭后仍可运行,适合处理跨页面共享的复杂逻辑。 核心本质:Service Worker 是一个可编程的网络代理,让开发者能完全控制"请求如何被响应",这是 Web 平台此前缺失的能力。 概述 Service Worker 是浏览器在后台独立于网页运行的脚本,本质上充当 Web 应用程序、浏览器与网络之间的代理服务器。 是一种 JavaScript Worker,无法直接访问 DOM 通过响应 postMessage 接口发送的消息与页面通信 不用时会被中止,下次有需要时重启——不能依赖全局状态,持久数据应使用 IndexedDB 广泛使用 Promise 是浏览器中的独立进程(非内核线程),注册后可被多个页面共用,页面关闭后不会销毁 Chrome 调试 chrome://inspect/#service-workers chrome://serviceworker-internals 参考 https://juejin.im/post/6844903613270081543

2026-04-30 · 1 min · 55 words · -

nginx basic, command

vhost(虚拟主机) nginx 中每个 server {} 块就是一个虚拟主机(vhost,Virtual Host),同一台服务器上可以配置多个 server {} 块,让 nginx 同时托管多个网站或服务。 nginx 收到请求后,依次匹配 listen(端口/IP)和 server_name(域名),找到对应的 server {} 块处理请求。如果没有匹配项,则使用第一个定义的 server 或标记了 default_server 的块。 基于域名(最常用) server { listen 80; server_name example.com; root /var/www/example; } server { listen 80; server_name another.com; root /var/www/another; } 基于端口 server { listen 8080; server_name localhost; } server { listen 9090; server_name localhost; } 基于 IP server { listen 192.168.1.1:80; } server { listen 192.168.1.2:80; } nginx basic, command # Do not run, just test the configuration file. sudo nginx -t nginx -s signal # stop — fast shutdown # quit — graceful shutdown # reload — reloading the configuration file # reopen — reopening the log files almalinux install nginx sudo dnf update -y sudo dnf install nginx -y sudo systemctl enable --now nginx # install # nerdctl nerdctl run -d \ --name nginx \ --restart=always \ -p 80:80 \ -p 443:443 \ -v nginx-config:/etc/nginx \ -v nginx-www:/var/www \ -v /etc/letsencrypt:/etc/letsencrypt \ -v /etc/localtime:/etc/localtime:ro \ nginx:1.29.1 # docker docker run -d \ --name nginx \ --restart=always \ -p 80:80 \ -p 443:443 \ -v nginx-config:/etc/nginx \ -v nginx-www:/var/www \ -v /etc/letsencrypt:/etc/letsencrypt \ -v /etc/localtime:/etc/localtime:ro \ nginx:1.27.2 docker run -d \ --name nginx \ --restart=always \ -p 80:80 \ -p 443:443 \ -v nginx-config:/etc/nginx \ -v nginx-www:/var/www \ -v /etc/localtime:/etc/localtime:ro \ nginx:1.27.2 # podman podman run -d \ --name nginx \ -p 80:80 \ -p 443:443 \ -p 1022:1022 \ -v nginx-config:/etc/nginx \ -v nginx-www:/var/www \ -v nginx-cert:/etc/letsencrypt \ -v /etc/localtime:/etc/localtime:ro \ nginx:1.27.2 # nginx config text docker run --name nginx-config-test --rm -t -a stdout -v nginx-conf:/etc/nginx:ro nginx nginx -c /etc/nginx/nginx.conf -t # archlinux, mainline branch: new features, updates, bugfixes sudo pacman -S nginx-mainline # start sudo systemctl enable --now nginx # restart kill -HUP pid #stop kill -s QUIT 1628 文件下载 server { listen 8088; location /download/images { alias /home/net-files/images; # 我在这个路径下放了一张图片: fei_ji.jpg } } 下载 curl "http://my_ip_address:8088/download/images/fei_ji.jpg" > test.jpg ———————————————— 版权声明: 本文为CSDN博主「tomeasure」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 原文链接: https://blog.csdn.net/qq_29695701/article/details/86491331

2026-04-29 · 2 min · 321 words · -

nerdctl

nerdctl nerdctl 是 containerd 的命令行客户端工具,它提供了与 Docker CLI 兼容的用户体验。 什么是 nerdctl containerd 的 CLI 工具:nerdctl 全称是 “non-enterprise control”(或 containerd ctl) Docker 兼容:命令语法与 docker 命令高度兼容,降低学习成本 CNCF 项目:由 containerd 社区开发和维护 功能丰富:支持 Docker 不支持的一些高级功能 主要特性 1. Docker 兼容性 nerdctl 的命令与 docker 几乎完全兼容,可以无缝切换: # Docker 命令 docker run -d -p 80:80 nginx docker ps docker images docker build -t myapp . # nerdctl 命令(完全相同) nerdctl run -d -p 80:80 nginx nerdctl ps nerdctl images nerdctl build -t myapp . 2. 增强功能 nerdctl 支持一些 Docker 不支持的高级特性: ...

2026-04-29 · 7 min · 1334 words · -

OpenTofu 入门:用 IaC 在 AWS 创建 VPC 和 EC2

什么是 OpenTofu OpenTofu 是 Terraform 的开源分支,用于以声明式的方式管理云基础设施(IaC,Infrastructure as Code)。 与 AWS CLI 的区别: OpenTofu AWS CLI 方式 声明式(描述终态) 命令式(执行具体操作) 状态管理 有 state 文件,追踪资源状态 无状态 典型场景 创建/销毁一整套基础设施 查询、临时操作 OpenTofu 和 AWS CLI 都直接调用 AWS API,不存在封装关系。 核心概念 Provider Provider 是 OpenTofu 操作各家云服务的插件,tofu init 时自动下载。 required_providers { aws = { source = "hashicorp/aws" version = "~> 5.0" } } Resource vs Data Source resource — 创建资源(EC2、VPC、安全组等) data — 查询已有信息,不创建资源 # 查询最新的 Amazon Linux 2023 AMI(不创建资源) data "aws_ami" "al2023" { most_recent = true owners = ["137112412989"] filter { name = "name" values = ["al2023-ami-2023.*-x86_64"] } } # 创建 EC2 实例(使用上面查到的 AMI ID) resource "aws_instance" "server" { ami = data.aws_ami.al2023.id instance_type = "t2.nano" } Variables 变量分两个文件: ...

2026-04-29 · 3 min · 554 words · -

YubiKey 使用笔记

MFA(多因素认证) MFA(Multi-Factor Authentication)是在密码之外再加一层验证,防止密码泄露后账户被盗。 YubiKey 5C 支持 FIDO2/WebAuthn 协议,可作为硬件 MFA 设备使用,比手机 TOTP App 更安全。 常见 MFA 类型对比: 类型 示例 说明 硬件 FIDO2/WebAuthn YubiKey 5C 物理密钥,最安全 虚拟 TOTP Google Authenticator、Authy 手机 App 生成 6 位码 硬件 TOTP Gemalto 等老设备 专用硬件令牌 在 AWS 上绑定 YubiKey IAM → 用户 → 安全凭证 → 分配 MFA 设备 → 选择"安全密钥(FIDO)" → 按提示触碰 YubiKey 完成注册。 Root 用户和 IAM admin 用户建议各自绑定 MFA。 yubikey HMAC-SHA1 challenge-response YubiKey 4 可以同时工作在三种模式: OTP mode: 作为键盘设备 (HID) : Yubico OTP, ...

2026-04-29 · 4 min · 642 words · -

AWS 使用笔记

用户管理最佳实践 AWS 官方推荐:日常操作不使用 root 用户,改用 IAM 用户。 Root 用户 只用于以下场景,用完即退出: 创建 AWS 账户 设置账单和账户信息 创建第一个 IAM admin 用户 建议为 root 用户开启 MFA,日常锁起来不用。 IAM Admin 用户(日常使用) 对于个人用户,创建一个附加 AdministratorAccess 策略的 IAM 用户即可满足绝大多数需求。 AdministratorAccess 几乎等同于 root 权限,但不包括账单管理和关闭账户,日常管理 EC2、S3、RDS 等资源完全够用。 创建步骤: 以 root 登录 → IAM → 创建用户(如 admin) 附加托管策略:AdministratorAccess 为该用户开启 MFA 创建 Access Key 用于 CLI 之后退出 root,以后只用 admin 用户登录控制台和操作 CLI。 常用命令 查看所有区域的资源: ec2 > 左侧菜单 > AWS Global View # 配置 CLI(使用 IAM admin 用户的 Access Key) aws configure # S3 aws s3 ls s3://obsidian-w10n aws s3 cp foobar s3://obsidian-w10n https://aws.amazon.com/cli/ ...

2026-04-29 · 1 min · 93 words · W10N

plantuml, puml

Mermaid:VS Code 内置替代方案 Mermaid 是最佳替代方案,VS Code 的 Markdown 预览内置支持,无需扩展或服务器。直接在 Markdown 中写 ```mermaid 代码块,按 Ctrl+Shift+V 打开预览即可看到渲染结果。 功能 PlantUML Mermaid VS Code 原生支持 需要 Java + 扩展 内置 GitHub 渲染 不支持 支持 语法 更强大 更简洁 离线使用 需要 graphviz 完全离线 序列图 sequenceDiagram Alice->>Bob: Authentication Request Bob-->>Alice: Authentication Response Alice->>Bob: Another authentication Request Alice<<--Bob: Another authentication Response 类图 classDiagram class Animal { +String name } class Duck { +quack() } Animal <|-- Duck 活动图 / 流程图 flowchart TD start([start]) stop([stop]) decision{foo?} start --> decision decision -->|yes| process0[process0] decision -->|no| process1[process1] process0 --> stop process1 --> stop 状态图 stateDiagram-v2 [*] --> State1 State1 --> State2 State2 --> [*] 思维导图 mindmap root((Debian)) Ubuntu Linux Mint Kubuntu Lubuntu LMDE SteamOS Raspbian plantuml, puml UML 序列图, Sequence Diagram 用例图, Use Case Diagram 类图, Class Diagram 对象图, Object Diagram 活动图, Activity Diagram 组件图, Component Diagram 部署图, Deployment Diagram 状态图, State Diagram 时序图, Timing Diagram 非 UML 图 架构图, Archimate diagram UML 图 时序图, Sequence Diagram @startuml Alice -> Bob: Authentication Request Bob --> Alice: Authentication Response Alice -> Bob: Another authentication Request Alice <-- Bob: Another authentication Response Alice ->> Bob: async msg @enduml 类图, Class Diagram @startuml skinparam classFontColor red class Foo note left: parent class Bar Bar : String field0 Bar : String method0() Foo<|--Bar note left: child abstract class Abstract0 Foo--|>Abstract0 interface Interface0 ' 注意, 接口名和冒号之间必须用空格分隔 Interface0 : void method0() class Class0{ - private_field_0 } @enduml @startuml skinparam class { BackgroundColor Lightblue ArrowColor #0ACF97 BorderColor #d5d5d5 } skinparam stereotypeCBackgroundColor YellowGreen Class101 <|.. Class102 @enduml 活动图, Activity Diagram @startuml !theme plain start if (foo?) then (yes) :process0; else (no) :process1; endif stop @enduml 组件图, Component Diagram 别名后面可以标注颜色 修改线和箭头的颜色 文字颜色 语法 # 把组件显示成普通矩形 skinparam componentStyle rectangle # 组件间横向距离 skinparam nodesep 10 # 组件间纵向距离 skinparam ranksep 10 @startuml skinparam componentStyle rectangle skinparam nodesep 10 skinparam ranksep 10 skinparam ParticipantFontColor #A9DCDF ' comments line starts by single quote, 注释 [First component] [Another component] as Comp2 component Comp3 component [Last\ncomponent] as Comp4 [component0] as c0 #ff0000 [<color:#ff0000>component1</color>] as c1 [component2] as c2 [component3] as c3 [component4] as c4 c0 -- c1 c0-[#00ff00]-c2 c1--c3 c0--c3 c2--c4 note left of c0 note0 end note @enduml 部署图, Deployment Diagram @startuml circle 1 circle 2 circle 3 agent 4 1 -- 2 1 -- 3 1 -- 4 queue 5 4 -right- 5 5 -right-2 @enduml 状态图, State Diagram @startuml [*] --> State1 State1 --> [*] State1 : this is a string State1 : this is another string State1 -> State2 State2 --> [*] @enduml 安装 graphviz sudo apt-get install -y graphviz https://graphviz.org/download/ ...

2026-04-28 · 4 min · 734 words · -

ZooKeeper Leader Latch 与 Leader Election

ZooKeeper 节点类型 ZooKeeper 的节点(ZNode)类型是两个维度的组合: 生命周期维度: 持久(Persistent):客户端断开后节点依然存在,需要显式删除 临时(Ephemeral):与创建它的客户端 Session 绑定,Session 结束节点自动删除 命名维度: 普通:你指定什么路径就创建什么路径,路径已存在则报错 顺序(Sequential):路径作为前缀,ZooKeeper 自动追加 10 位单调递增序号 两两组合,实际有四种节点类型: 类型 说明 持久节点 最普通的节点,手动删除才消失 持久顺序节点 名称自动追加递增序号,永久存在 临时节点 Session 结束自动删除 临时顺序节点 Session 结束自动删除 + 名称追加序号 各场景适用类型: 场景 用哪种 分布式锁(抢占式) 普通临时节点,谁先创建谁得锁 分布式锁(公平排队) 顺序临时节点,序号最小的得锁 Leader 选举 顺序临时节点,序号最小的是 leader 配置中心、服务注册 普通持久节点 临时节点原理 ZooKeeper 客户端连接服务端后会建立一个 Session,并维持心跳(默认每隔 tickTime 发一次)。服务端为每个 Session 设置超时时间(sessionTimeout),超时内未收到心跳则判定 Session 过期,自动删除该 Session 创建的所有临时节点,其他 watch 了这些节点的客户端会收到删除通知。 状态 临时节点是否消失 网络抖动(短暂断开) 不消失,等待重连,Session 未过期 断开超过 sessionTimeout 消失,Session 过期 客户端主动 close() 立即消失 临时节点不能有子节点,因为它的生命周期是不确定的。 ...

2026-04-28 · 2 min · 260 words · -