Blogs
wsl2 访问 Hyper-V 虚拟机
使用 Hyper-V 创建的虚拟机,如果在 windows 下可以访问,但是 wsl2 下无法访问,则可以尝试移除相关路由: sudo bash -c "ip route | grep -oE '^172\..*\s+dev.*linkdown' | grep -oE 'br-\w+' | xargs -r -n1 ip link set down" 例如我这里路由表:
2025/12/10
pve 安装 immortalwrt
immortalwrt firmware selector, pve 安装下载 squashfs-combined-efi. squashfs: 一种只读的文件系统,每次修改: actually a copy of it is being copied to the second (JFFS2) partition combined: 带引导分区文件 combined-efi: 支持 efi 启动 1. 安装 # 上传到 pve 任意目录 gzip -d immortalwrt-xxx # 查看已有虚拟机配置: qm config <vmid> # ~~net0 待启动 immortalwrt 基本设置完成后再设置~~ # 创建空白虚拟机(无磁盘) qm create 201 --name opw-immort-2305.4 \ --ostype l26 --scsihw virtio-scsi-single \ --cpu x86-64-v2-AES --cores 2 --memory 2048 \ --net0 virtio,bridge=vmbr0,firewall=1 \ --net1 virtio,bridge=vmbr1,firewall=1 \ --net2 virtio,bridge=vmbr2,firewall=1 \ --boot order=scsi0 # 导入磁盘, 此命令成功后会输出 `Successfully imported disk as 'unused0:local-lvm:vm-201-disk-0'`, 记录 local-lvm:vm-201-disk-0 后续命令使用 qm importdisk 201 immortalwrt-xxx.img local-lvm # 磁盘连接到虚拟机的 SCSI 控制器, 并设置大小 qm set 201 --scsi0 local-lvm:vm-201-disk-0,iothread=1,size=1024M 2. 配置 配置备份与还原: 系统 > 备份与升级
2024/06/16
ssh jump & port forwarding
References: SSH from A through B to C, using private key on B A Visual Guide to SSH Tunnels: Local and Remote Port Forwarding man/SSHD_CONFIG.5 ssh jump use self key situation:
2024/04/28
WSL2 安装 ArchLinux
wsl2: wsl --install --no-distribution; wsl --set-default-version 2 推荐浏览: wsl 检查可用容量 wsl vhdx 定位 wsl-config ArchL Wiki ArchL Wiki pacman 安装 ArchLinux 基本安装 官网文档: Install Arch Linux on WSL
2024/04/09
PVE 首页添加温度
pve 首页添加温度 1. 依赖配置 # 安装依赖 apt install lm-sensors # 检测可用传感器 sensors-detect # 测试 -j 参数表示 json 输出 sensors -j 2. 修改源码 vi 编辑按键不对解决: nano /etc/vim/vimrc.tiny 将 set compatible 改为 set nocompatible
2023/09/23
go 杂项
http.Response.Body 注意 Body 字段的注释: The default HTTP client’s Transport may not reuse HTTP/1.x “keep-alive” TCP connections if the Body is not read to completion and closed.
2023/04/15
go 字符串
相关文档: spec#Rune_literals spec#String_literals spec#String_types blog/strings In [1]: import ( ic "github.com/WAY29/icecream-go/icecream" "os" ) func init() { ic.ConfigurePrefix("\u001B[37mic| \u001B[0m") ic.ConfigureOutputFunction(os.Stdout) ic.ConfigureArgNameFormatterFunc(func(name string) string { return "\u001B[36m" + name + "\u001B[0m" }) } 0. 关于 rune 标识 Unicode 码点(code point) 的整数值, 其类型声明为: type rune = int32 是 int32 的别名。
2023/04/09
rclone快速上手
doc: https://rclone.org/docs/ # 开启命令行提示, oh-my-zsh 不要 compinit 相关 rclone genautocomplete zsh # 如果提示 /zsh/vendor-completions 不存在,可以放到家目录下: acdef_path="${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/rclone" mkdir -p "$acdef_path" rclone genautocomplete zsh "$acdef_path/_rclone" # 然后添加 rclone 到 .zshrc 的 plugins 列表里 plugin=(... rclone) 0. config rclone config paths rclone config show 命令行交互式创建配置:
2023/04/02
lf 快速上手
常用命令快捷键 搜索和查找 ignorecase 忽略大小写 搜索 globsearch (false) 是否支持 glob pattern incsearch (false) 是否增量搜索, 即每次按下字符都搜索. 增量模式下 cmd-enter 确认, cmd-escape 取消(光标位置会回滚回去) 查找
2023/03/08