用 podman 部署 file browser (免登录)

Quadlet 配置 路径:~/.config/containers/systemd/filebrowser.container [Unit] Description=<description> After=network-online.target [Container] Image=docker.io/filebrowser/filebrowser:latest ContainerName=<name> UserNS=keep-id PublishPort=<port>:8080 Volume=/share/web:/srv:ro Volume=/share/filebrowser/database:/database Volume=/share/filebrowser/config:/config Environment=FB_NOAUTH=true AutoUpdate=registry [Service] Restart=always TimeoutStartSec=900 [Install] WantedBy=default.target settings.ini /config/settings.ini { "port": 8080, "baseURL": "", "address": "", "log": "stdout", "database": "/database/filebrowser.db", "root": "/srv" } 配置要点 UserNS=keep-id:容器使用当前用户 UID/GID,避免权限错乱 Volume 映射 /share/web:/srv:ro:网站根目录,只读 /share/filebrowser/database:/database:数据库持久化 /share/filebrowser/config:/config:配置持久化 Restart=always:异常退出自动重启 AutoUpdate=registry:容器会根据镜像仓库版本自动更新 初次运行时必须确保 /database 是空的,否则 noauth 不生效! 自动升级机制 AutoUpdate=registry 启用后,Podman 的 systemd 集成会在 systemd.timer 定期触发时检查镜像更新 默认检查周期:每日(受 podman-auto-update.timer 控制) 升级时机: 如果仓库有新版本镜像 → 下载新镜像 自动重启受影响的服务,使用新镜像运行容器 可手动触发: systemctl --user start podman-auto-update.service 启动流程 mkdir -p /share/web \ /share/filebrowser/database \ /share/filebrowser/config loginctl enable-linger $USER systemctl --user daemon-reload systemctl --user enable --now filebrowser.service 验证 systemctl --user status filebrowser journalctl --user -u filebrowser.service -f podman ps | grep filebrowser 访问:<http://<宿主机ip>:8080>

September 25, 2025 · wang1zhen

podman 安装 immich

目录与环境变量 建议使用绝对路径。 样例目录 /share/immich/library /share/immich/postgres 环境文件路径 ~/.config/containers/systemd/immich/.env mkdir -p /share/immich/{library,postgres} mkdir -p ~/.config/containers/systemd/immich .env 样例 # 必填 - 改为绝对路径 UPLOAD_LOCATION=/share/immich/library DB_DATA_LOCATION=/share/immich/postgres # 版本标签 IMMICH_VERSION=release # 时区 TZ=Asia/Tokyo # 数据库 DB_PASSWORD=postgres DB_USERNAME=postgres DB_DATABASE_NAME=immich Quadlet 网络与命名卷 # ~/.config/containers/systemd/immich-network.network [Network] NetworkName=immich [Install] WantedBy=default.target # ~/.config/containers/systemd/model-cache.volume [Volume] VolumeName=model-cache [Install] WantedBy=default.target Valkey # ~/.config/containers/systemd/immich-redis.container [Unit] Description=Immich Redis (Valkey) [Container] Image=docker.io/valkey/valkey:8-bookworm ContainerName=immich_redis Network=immich RestartPolicy=always [Install] WantedBy=default.target Postgres # ~/.config/containers/systemd/immich-postgres.container [Unit] Description=Immich Postgres (vectorchord + pgvector) After=network-online.target Wants=network-online.target [Container] EnvironmentFile=%h/.config/containers/systemd/immich/.env Environment=POSTGRES_PASSWORD=%E{DB_PASSWORD} Environment=POSTGRES_USER=%E{DB_USERNAME} Environment=POSTGRES_DB=%E{DB_DATABASE_NAME} Environment=POSTGRES_INITDB_ARGS=--data-checksums Image=ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0 ContainerName=immich_postgres Volume=%E{DB_DATA_LOCATION}:/var/lib/postgresql/data ShmSize=128m Network=immich RestartPolicy=always [Install] WantedBy=default.target Machine Learning - CPU 基础版 # ~/.config/containers/systemd/immich-machine-learning.container [Unit] Description=Immich Machine Learning After=immich-redis.service immich-postgres.service Wants=immich-redis.service immich-postgres.service [Container] EnvironmentFile=%h/.config/containers/systemd/immich/.env Image=ghcr.io/immich-app/immich-machine-learning:%E{IMMICH_VERSION} ContainerName=immich_machine_learning Volume=model-cache:/cache Network=immich RestartPolicy=always [Install] WantedBy=default.target Server - CPU 基础版 # ~/.config/containers/systemd/immich-server.container [Unit] Description=Immich Server After=immich-redis.service immich-postgres.service Wants=immich-redis.service immich-postgres.service [Container] EnvironmentFile=%h/.config/containers/systemd/immich/.env Image=ghcr.io/immich-app/immich-server:%E{IMMICH_VERSION} ContainerName=immich_server PublishPort=2283:2283 Volume=%E{UPLOAD_LOCATION}:/data Volume=/etc/localtime:/etc/localtime:ro Network=immich RestartPolicy=always [Install] WantedBy=default.target 启动与管理 systemctl --user daemon-reload systemctl --user enable --now immich-network.network model-cache.volume systemctl --user enable --now immich-postgres.service immich-redis.service systemctl --user enable --now immich-machine-learning.service immich-server.service # 查看日志 journalctl --user -u immich-server.service -f journalctl --user -u immich-machine-learning.service -f GPU 加速 - 总览 只改两处:immich-machine-learning.container 与 immich-server.container。 NVIDIA - CUDA 推理与 NVENC 转码 主机准备 安装专有驱动与 NVIDIA Container Toolkit(启用 OCI Hook)。 确认 usr/share/containers/oci/hooks.d 存在 nvidia hook。 immich-machine-learning.container [Container] EnvironmentFile=%h/.config/containers/systemd/immich/.env Image=ghcr.io/immich-app/immich-machine-learning:%E{IMMICH_VERSION}-cuda ContainerName=immich_machine_learning Volume=model-cache:/cache Network=immich Environment=NVIDIA_VISIBLE_DEVICES=all Environment=NVIDIA_DRIVER_CAPABILITIES=compute,video,utility Device=/dev/nvidiactl Device=/dev/nvidia0 Device=/dev/nvidia-uvm RestartPolicy=always immich-server.container [Container] EnvironmentFile=%h/.config/containers/systemd/immich/.env Image=ghcr.io/immich-app/immich-server:%E{IMMICH_VERSION} ContainerName=immich_server PublishPort=2283:2283 Volume=%E{UPLOAD_LOCATION}:/data Volume=/etc/localtime:/etc/localtime:ro Network=immich Environment=NVIDIA_VISIBLE_DEVICES=all Environment=NVIDIA_DRIVER_CAPABILITIES=video,utility Device=/dev/nvidiactl Device=/dev/nvidia0 Device=/dev/nvidia-uvm RestartPolicy=always AMD - ROCm 推理与 VA-API 转码 主机准备 安装 ROCm 运行时。 将用户加入 render 与 video 组。 sudo usermod -aG render,video "$USER" newgrp render immich-machine-learning.container [Container] EnvironmentFile=%h/.config/containers/systemd/immich/.env Image=ghcr.io/immich-app/immich-machine-learning:%E{IMMICH_VERSION}-rocm ContainerName=immich_machine_learning Volume=model-cache:/cache Network=immich Device=/dev/kfd Device=/dev/dri RestartPolicy=always immich-server.container [Container] EnvironmentFile=%h/.config/containers/systemd/immich/.env Image=ghcr.io/immich-app/immich-server:%E{IMMICH_VERSION} ContainerName=immich_server PublishPort=2283:2283 Volume=%E{UPLOAD_LOCATION}:/data Volume=/etc/localtime:/etc/localtime:ro Network=immich Device=/dev/dri RestartPolicy=always 改动后重载 systemctl --user daemon-reload systemctl --user restart immich-machine-learning.service immich-server.service 映射目录与设备说明 Volume=%E{UPLOAD_LOCATION}:/data Immich 媒体与派生数据的根。 典型结构 original/ 原始媒体 thumbs/ 缩略图与预览 encoded-video/ 转码缓存 backup/ 应用内部备份 faces/ clips/ index/ 特征与向量索引缓存 Volume=%E{DB_DATA_LOCATION}:/var/lib/postgresql/data Postgres 数据目录。 结构 base/ 表文件 pg_wal/ 预写式日志 global/ 全局元数据 其他系统目录 Volume=model-cache:/cache ML 模型与推理缓存,避免重复下载或编译。 Volume=/etc/localtime:/etc/localtime:ro 容器时间与宿主同步,日志时间正确。 Device=/dev/dri 暴露渲染节点给容器,开启 VA-API 或 QuickSync。 Device=/dev/nvidiactl /dev/nvidia0 /dev/nvidia-uvm 直通 NVIDIA 设备,配合 OCI Hook 启用 CUDA 与 NVENC。 故障排查 权限 rootless 需加入 render、video 组。检查 ls -l /dev/dri。 编码失败 查看 ffmpeg 日志 journalctl --user -u immich-server.service -f Intel 可尝试设置 LIBVA_DRIVER_NAME=iHD。 CUDA 不可见 检查 NVIDIA OCI Hook 是否存在。 确认容器内可运行 nvidia-smi。 模型重复下载 确认 /cache 已挂载命名卷 model-cache。

September 24, 2025 · wang1zhen

hyprland 配置

安装软件包 sudo apt update sudo apt install -y \ hyprland waybar \ kitty dolphin \ wofi firefox-esr spectacle \ pavucontrol blueman brightnessctl wl-clipboard \ hyprpaper swayidle 检查显示器名称并写入配置 先运行: hyprctl monitors 示例输出: Monitor eDP-1 (ID 0): 1920x1080@60.000Hz Monitor HDMI-A-1 (ID 1): 2560x1440@144.000Hz 配置文件写法(~/.config/hypr/hyprland.conf): monitor=eDP-1,1920x1080@60,0x0,1 monitor=HDMI-A-1,2560x1440@144,1920x0,1 swayidle 用法 在配置中添加: exec-once = swayidle -w \ timeout 300 'hyprctl dispatch dpms off' \ resume 'hyprctl dispatch dpms on' 解释: -w :阻塞运行,保证进程驻留 timeout 300 'cmd' :空闲 300 秒执行命令(这里是关闭屏幕) resume 'cmd' :恢复活动后执行命令(这里是点亮屏幕) 输入设备配置 input { kb_layout = us touchpad { natural_scroll = true # 反向滚动 } } 快捷键设置 # 基础 bind=SUPER,RETURN,exec,kitty bind=SUPER,E,exec,dolphin bind=SUPER,B,exec,firefox bind=SUPER,D,exec,wofi --show drun # 窗口管理 bind=SUPER,Q,killactive bind=SUPER,F,fullscreen # 真全屏 bind=SUPER,SHIFT,F,fullscreen,1 # maximized (伪全屏,保留UI) bind=SUPER,SPACE,togglefloating bind=SUPER,P,togglepseudo # 浮动窗口操作(仅对浮动窗口有效) bind=SUPER,arrowup,moveactive,0 -50 bind=SUPER,arrowdown,moveactive,0 50 bind=SUPERCTRL,arrowup,resizeactive,0 -50 bind=SUPERCTRL,arrowdown,resizeactive,0 50 # 截图(Spectacle) bind=SUPER,SHIFT,S,exec,spectacle bind=SHIFT,PRINT,exec,spectacle -f -o ~/Pictures # 全屏保存 bind=CTRL,PRINT,exec,spectacle -c # 截图复制到剪贴板 # 音量 bind=XF86AudioRaiseVolume,exec,pactl set-sink-volume @DEFAULT_SINK@ +5% bind=XF86AudioLowerVolume,exec,pactl set-sink-volume @DEFAULT_SINK@ -5% bind=XF86AudioMute,exec,pactl set-sink-mute @DEFAULT_SINK@ toggle # 亮度 bind=XF86MonBrightnessUp,exec,brightnessctl s +10% bind=XF86MonBrightnessDown,exec,brightnessctl s 10%- 窗口美化 decoration { active_opacity = 0.9 inactive_opacity = 0.8 blur = yes blur_size = 5 blur_passes = 3 blur_new_optimizations = on rounding = 8 } 说明: ...

September 18, 2025 · wang1zhen

Linux 下 fio 测试硬盘读写性能

核心选项说明 –name: 任务名 –rw: I/O 模式 read: 顺序读 write: 顺序写 rw: 顺序读写交替 randread: 随机读 randwrite: 随机写 randrw: 随机读写交替 –bs: 块大小(block size),如 4k, 1M –size: 测试文件大小 –filename: 目标文件或设备路径 –runtime: 测试时长 –time_based: 基于时间运行,而不是直到写满 size –group_reporting: 汇总结果 –numjobs: job 数量,即多少线程/进程同时运行相同任务 –iodepth: 每个 job 可挂起的并发 I/O 请求数(队列深度) numjobs × iodepth ≈ 总并发请求数 准备测试文件 fio --name=prepare --rw=write --bs=1M --size=1G --filename=testfile --numjobs=1 --group_reporting 顺序吞吐量测试(CDM Seq QD=8 T=1) 顺序读 fio --name=seqread --rw=read --bs=1M --size=1G --filename=testfile --numjobs=1 --iodepth=8 --runtime=30 --time_based --group_reporting 顺序写 fio --name=seqwrite --rw=write --bs=1M --size=1G --filename=testfile --numjobs=1 --iodepth=8 --runtime=30 --time_based --group_reporting 随机延迟测试(CDM Rnd4K QD=1 T=1) 随机读 fio --name=latread --rw=randread --bs=4k --size=1G --filename=testfile --numjobs=1 --iodepth=1 --runtime=60 --time_based --group_reporting 随机写 fio --name=latwrite --rw=randwrite --bs=4k --size=1G --filename=testfile --numjobs=1 --iodepth=1 --runtime=60 --time_based --group_reporting 随机 IOPS 高并发(CDM Rnd4K QD=32 T=1) 随机读 fio --name=randread --rw=randread --bs=4k --size=1G --filename=testfile --numjobs=1 --iodepth=32 --runtime=60 --time_based --group_reporting 随机写 fio --name=randwrite --rw=randwrite --bs=4k --size=1G --filename=testfile --numjobs=1 --iodepth=32 --runtime=60 --time_based --group_reporting 随机 IOPS 超高并发(CDM Rnd4K QD=32 T=16) 随机读 fio --name=randread_mt --rw=randread --bs=4k --size=1G --filename=testfile --numjobs=16 --iodepth=32 --runtime=60 --time_based --group_reporting 随机写 fio --name=randwrite_mt --rw=randwrite --bs=4k --size=1G --filename=testfile --numjobs=16 --iodepth=32 --runtime=60 --time_based --group_reporting 混合负载(模拟真实业务) fio --name=randrw --rw=randrw --rwmixread=70 --bs=4k --size=1G --filename=testfile --numjobs=4 --iodepth=32 --runtime=60 --time_based --group_reporting 清理 rm testfile

September 18, 2025 · wang1zhen

tailscale cli 设置 exit 节点

查看可用 Exit 节点 tailscale status 指定 Exit 节点 # 节点名或 Tailscale 内网 IP tailscale up --exit-node=mynode 保留本地局域网访问 tailscale up --exit-node=mynode --exit-node-allow-lan-access=true 取消 Exit 节点 tailscale up --exit-node= 参数说明 `–exit-node=<节点名或IP>` 指定出口节点 `–exit-node-allow-lan-access` 允许访问本地局域网,否则所有流量都走 exit 节点

September 18, 2025 · wang1zhen

kdenlive 制作切片

工具与素材准备 剪辑:Kdenlive 字幕生成:Whisper(medium 模型) 字幕美化:Aegisub AI 分离:Demucs(–two-stems=vocals) 音频统一规格:48 kHz,双声道,WAV。 # 从录播提取音频 ffmpeg -i record.mp4 -vn -ac 2 -ar 48000 record.wav 人声与伴奏分离 使用 Demucs two-stems: demucs --two-stems=vocals record.wav 输出目录:./separated/htdemucs/record/ vocals.wav → 人声轨 no_vocals.wav → 伴奏轨 自动字幕生成(Whisper medium) 仅对人声生成字幕: whisper vocals.wav --model medium --language ja --task transcribe --output_format srt vocals.wav → 输入音频文件(人声轨) –model medium –language ja → 指定语言(日语,中文 zh,英文 en) –task transcribe → 转写模式(保持原语言) –output_format srt → 输出带时间戳的 .srt 输出:vocals.srt 字幕美化 在 Aegisub 打开 vocals.srt。 创建样式: Style: SongStyle,Noto Sans CJK JP,48,&H00FFFFFF,&H000000FF,&H00FACE87,&H64000000,0,0,0,0,100,100,0,0,1,3,1,2,10,10,30,1 白字 &H00FFFFFF ...

September 16, 2025 · wang1zhen

arch on zfs 在 zfs 上安装 archlinux

第一部分:准备安装介质 安装archiso工具 sudo pacman -S archiso 复制并自定义配置 # 复制官方配置 cp -r /usr/share/archiso/configs/releng/ ~/archlive cd ~/archlive 修改包列表 # 删除不需要的包并添加新包 sed -i '/^linux$/d; /^linux-headers$/d; /^broadcom-wl$/d' packages.x86_64 echo -e "linux-lts\nlinux-lts-headers\nzfs-utils\nzfs-dkms" >> packages.x86_64 echo "packages.x86_64 文件已更新完成" 配置pacman源 # 在文件末尾添加archzfs仓库 cat >> pacman.conf << 'EOF' [archzfs] SigLevel = TrustAll Optional Server = http://archzfs.com/$repo/$arch EOF pacman-key --recv-keys DDF7DB817396A49B2A2723F7403BD972F75D9D76 pacman-key --lsign-key DDF7DB817396A49B2A2723F7403BD972F75D9D76 # 更新包数据库 pacman -Sy echo "pacman.conf 已自动配置archzfs仓库" 更新启动配置文件 # 定义需要修改的文件列表 config_files=( "airootfs/etc/mkinitcpio.d/linux.preset" "efiboot/loader/entries/01-archiso-x86_64-linux.conf" "efiboot/loader/entries/02-archiso-x86_64-speech-linux.conf" "syslinux/archiso_pxe-linux.cfg" "syslinux/archiso_sys-linux.cfg" "grub/loopback.cfg" ) # 批量处理所有配置文件 for file in "${config_files[@]}"; do if [[ -f "$file" ]]; then echo "正在更新 $file" sed -i 's/vmlinuz-linux\([^-]\|$\)/vmlinuz-linux-lts\1/g; s/initramfs-linux/initramfs-linux-lts/g' "$file" echo "✓ $file 已更新" else echo "⚠ 警告: $file 不存在,跳过" fi done echo "所有启动配置文件已更新完成" 构建ISO mkdir -p ~/isobuild sudo mkarchiso -v -r -w /tmp/archiso-tmp -o ~/isobuild ~/archlive 构建完成后,ISO文件将位于 ~/isobuild 目录中。 ...

September 15, 2025 · wang1zhen

Debian on zfs 在 zfs 上安装 Debian linux

第一部分:准备安装介质 下载Debian 13 Live镜像 # 下载Debian 13 Live镜像(GNOME版本) wget https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/debian-live-13.0.0-amd64-gnome.iso # 验证校验和(可选) wget https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/SHA256SUMS sha256sum -c SHA256SUMS --ignore-missing 制作启动U盘 # 查看可用设备 lsblk # 制作启动盘(请替换/dev/sdX为实际设备) sudo dd if=debian-live-13.0.0-amd64-gnome.iso of=/dev/sdX bs=4M status=progress oflag=sync 警告:这将完全擦除目标设备上的所有数据。 第二部分:启动并配置网络环境 启动到Live环境 从U盘启动 选择 “Advanced options” -> “Expert install” 或选择 “Rescue mode” 获得完整shell访问权限 配置网络连接 # 有线网络(通常自动配置) ip a # 无线网络配置 iwconfig wpa_supplicant -B -i wlan0 -c <(wpa_passphrase "SSID" "password") dhclient wlan0 设置系统时间 timedatectl set-ntp true 启用SSH(可选) # 切换到root用户 sudo -i # 安装必要软件包 apt install openssh-server vim # 设置用户密码 passwd user # 启动SSH服务 systemctl start ssh ip a # 查看IP地址 第三部分:磁盘分区 安装必要工具 apt install linux-headers-amd64 zfs-dkms arch-install-scripts gdisk 识别目标磁盘 ls /dev/disk/by-id lsblk fdisk -l 以下示例假设目标磁盘为 =/dev/nvme0n1=,请根据实际情况调整。 ...

September 15, 2025 · wang1zhen

sing-box webui 配置

安装 sing-box yay -S sing-box 获取订阅配置 从 prprcloud 后台复制订阅链接,然后下载到配置目录: curl -o ~/.config/sing-box/config.json '你的订阅链接' 如果在海外使用,选择直连/direct 节点。 运行 sing-box sudo sing-box run -c ~/.config/sing-box/config.json 使用 Dashboard 如果需要 Zashboard,直接访问: http://board.zash.run.place/ 在设置页无需填写任何内容。 如果不使用 Zashboard,也可以直接访问: http://localhost:9090 搭配 yacd 使用。 Aff 链接 prprcloud 订阅链接

September 15, 2025 · wang1zhen

修改网卡 MAC 地址

From https://superuser.com/questions/1011721/how-do-i-change-wifi-adapter-mac-address-for-win7-8-10-network-adapter-advance Edit Registry win+r regedit HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\00xx\NDI\params Replace 00xx with the numerical key associated with your network adapter by checking the DriverDesc string value. Under params, create a new key named NetworkAddress. Add the following string values under the NetworkAddress key: "optional"="1" "type"="edit" "uppercase"="1" "limittext"="12" "paramdesc"="Network Address" After completing the steps, check the “Advanced” tab in your network adapter’s properties. The “Network Address” field should appear. .reg file for reference: MAC.reg ...

October 16, 2024 · wang1zhen