惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

Dejavu's Blog

使用 auto-cpufreq 平衡 Linux 性能功耗 哪吒监控面板部署教程 NodeBB 论坛部署教程 Scaleway VPS 安装 Alpine Linux 甲骨文 ARM 实例部署 Gemma 4 模型 Headscale + Tailscale 组建虚拟专用网 在 Linux 上使用 Yubikey OpenPGP 应用 BuyVM VPS 块存储挂载教程 Alpine Linux 服务器配置指南 Alpine Linux 安装 Cloudflared Docker 多容器共享中心数据库 安装 Komari 服务器监控工具 Scaleway VPS 安装 Debian Linux Debian 13 下部署 AsmBB 论坛 使用 Kopia 自动化备份服务器数据 给 Docker 启用 IPv6 支持 Netcup 服务器安装自定义 ISO 镜像 在 Debian 13 上自托管 Mox 邮局 使用 Stalwart 自托管邮局服务 烽火 HG5582A 光猫开启桥接模式 Docker 自托管 Shlink 短链服务 部署 Obsidian LiveSync 实时同步服务指南 我的 2025 年不完全回顾 我的 2025 年度自托管服务报告 Linux 下 Intel 核显驱动配置与硬件加速 Fedora Linux 安装配置记录 2025 年优雅地自托管 RSS 服务 自托管部署 Pocket ID 与 Tinyauth 完全指南 Woodpecker CI 和 Gitea 实现 Hugo 自动部署 Gitea/Forgejo 集成 Woodpecker CI/CD 在 Blinko 中使用 Ollama 作为 AI 供应商 Docker 部署 Gitea/Forgejo Plausible CE 启用城市级地理位置识别 Blinko 开源 AI 知识库 Docker 部署指南 Netcup 免税账号注册及购买服务器全记录 新到手的 Linux 服务器,我这样设置 Docker 自托管 Cloudreve Pro 私有网盘服务 GiffGaff SIM 卡使用体验和注意事项 在 n8n 中使用 Ollama 的本地 LLM 模型 简体中文互联网在变得糟糕吗? 如何低成本申请 S/MIME 证书用于个人邮件服务 迁移到 NameCrane Mail 域名邮箱套件服务 香烟与咖啡 联系我 Now 近况 在 Windows 中使用 Yubikey 的 OpenPGP 应用 Windows 11 IoT LTSC 养老指南 巧用浏览器生成 HAR 文件批量下载所需网页资源 聊聊静态网站的评论系统 在 Hugo 站点中优雅地展示实况照片 使用 snac 部署一个简洁优雅的 ActivityPub 实例 当 25 岁来临的时候 断网的这两年 从 Bitwarden/Vaultwarden 到 KeePassXC 更新日志 也许是 Android 上最好的本地播放器 - 椒盐音乐 2023 半年小结 写一个好玩的 Hugo 货币汇率转换短代码 写一个 Hugo 短代码将不同类别的总字数统计转换为书名显示 海信 Touch Lite 墨水屏音乐阅读器的简单体验 从 Debian 11(bullseye) 无感升级到 Debian 12(bookworm) 使用 GitHub Actions 自动提交 URL 到 IndexNow 批量重写 Git 历史提交记录 使用 cgit 托管小小的也很可爱的 Git 服务器 在 Debian 上使用 stagit 和 Nginx 的简单 Git 服务器 托管简单 Git 服务器的一些尝试 使用 stagit 自托管纯静态 Git 存储库 使用 Docker 快速部署单人 Fediverse 实例 我是如何建立自己的个人博客的? 简单、隐私友好的谷歌分析替代品,Plausible 自托管部署指南 服务器使用 Cloudflare CDN 的最佳实践 甲骨文服务器分配并启用 IPv6 地址 Git 版本控制学习笔记(二) Cloudflare WAF 防护策略简易指南 Mastodon 服务器批量导入自定义表情 低成本自托管 Mastodon 实例简明指南 自托管服务指南──有了服务器可以做什么? 使用 Miniflux + RSSHub 打造个人 RSS 阅读器 构建支持多种 CPU 架构的 Docker 镜像 一个可自托管的静态短链接应用 别了,二〇二二! Duplicacy CLI 进阶使用指南 Duplicacy CLI 备份工具的基本使用 初探 Cloudflare 零信任 - 通过 Docker 部署 Bitwarden 密码管理器 Yubikey 转运日志及上手指南 初探 Cloudflare 零信任 — 通过 Cloudflare Tunnel 搭建 SSH 聊天室 初探 Cloudflare 零信任 - 通过 Cloudflare Tunnel 访问服务 某科学的 PGP 算号指南 版权声明 2022 年的 MacBook Air M1 使用体验及应用推荐 使用 Vercel 和 Supabase 自托管 Cusdis 评论系统 为什么你的搜索引擎不好用? 个人在 Windows 上常用软件清单 macOS 基础开发环境设置指南 在 macOS 上使用 Canokey 的 OpenPGP 应用 提取 Windows UWP 应用商店的安装包以供离线安装 Git 版本控制学习笔记(一) 使用 Notion 管理 GitHub Star 项目 使用 Vercel 免费部署 Giscus 评论系统 将博客评论从 Utterances 无缝迁移到 Giscus
记录一次捡垃圾装机
2021-09-06 · via Dejavu's Blog

捡这台机器已经是去年(2020) 12 月份时候的事了,上周末收拾寝室顺便把它找回来理了下线、清了下灰装上了最新的 Debian GNU/Linux 11 (bullseye) 作为它的系统,然后局域网络 SSH 访问来代替自己笔记本的 WSL 系统,WSL2 和 VMware 总有奇奇怪怪的兼容性问题。

配置一览

部件型号说明费用
主板梅捷 SY-H61L-MiTX 板型、带 HDMI、mSATA 接口¥110.00
CPU英特尔 i3-3245(集显 HD 4000)22nm、2 核心 4 线程、3.4GHz¥95.00
显卡索泰 GTS 4501GB、nVIDIA GeForce GTS 450¥0.00
硬盘西部数据 WD5000AAKX 500GB3.5寸、1423 次/2530 小时¥50.00
内存金士顿 DDR3 2GB*21600MHz、SSTL 1.5V、¥23.00/条¥46.00
机箱AY P6 机箱mATX、薄铁皮、略强于鞋盒¥35.90
电源全汉 FSP 350W主板 24P、SATA 及 IDE*1、CPU 4P、显卡 6+6¥32.15
散热酷冷至尊 I30铝、风冷、2600 RPM±10%¥16.50
合计//¥385.55

配置可以说是非常渣了,但不装图形界面其实真的够用了,本来是准备直接用 i3-3245 的核显的,后来学长给了块二手索泰 GTS 450 显卡就把它给装上了,顺便屏蔽了核显

娱乐大师信息

Debian 下查看 CPU 信息:

dejavu@debian:~lscpu
Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                   36 bits physical, 48 bits virtual
CPU(s):                          4
On-line CPU(s) list:             0-3
Thread(s) per core:              2
Core(s) per socket:              2
Socket(s):                       1
NUMA node(s):                    1
Vendor ID:                       GenuineIntel
CPU family:                      6
Model:                           58
Model name:                      Intel(R) Core(TM) i3-3245 CPU @ 3.40GHz
Stepping:                        9
CPU MHz:                         1737.696
CPU max MHz:                     3400.0000
CPU min MHz:                     1600.0000
BogoMIPS:                        6784.52
Virtualization:                  VT-x
L1d cache:                       64 KiB
L1i cache:                       64 KiB
L2 cache:                        512 KiB
L3 cache:                        3 MiB
NUMA node0 CPU(s):               0-3
Vulnerability Itlb multihit:     KVM: Mitigation: VMX disabled
Vulnerability L1tf:              Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
Vulnerability Mds:               Vulnerable: Clear CPU buffers attempted, no microcode; SMT vulnerable
Vulnerability Meltdown:          Mitigation; PTI
Vulnerability Spec store bypass: Vulnerable
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Full generic retpoline, STIBP disabled, RSB filling
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Not affected
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm
                                  constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 sss
                                 e3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt tsc_deadline_timer xsave avx f16c lahf_lm cpuid_fault epb pti tpr_shadow vnmi flexpriority ept v
                                 pid fsgsbase smep erms xsaveopt dtherm arat pln pts

安装 Debian 11

Debian GNU/Linux 官网 下载最新的镜像文件 debian-11.0.0-amd64-netinst.iso 使用 Rufus 写入 U盘;主板设置 UEFI 启动,设置写好镜像的 U盘为第一启动项即可。因为只通过局域网络 SSH 访问,所以也不需要桌面环境了,安装最后在 choose software to install 的时候只选择安装 SSH server 即可,等待安装完成重启即可

SSH 访问

登录无线路由器管理后台查看 Debian 的局域网络 IP 地址,并记下

查看 IP

为了方便,直接使用 Windows Terminal 访问,打开 Windows Terminal 配置添加配置文件

SSH 访问

配置新的配置文件里面的命令行为

👉 Debian Logo (下载保存)

The authenticity of host '192.168.0.101 (192.168.0.101)' can't be established.
ECDSA key fingerprint is SHA256:/GENLehSKZfNxJ4bDSaAc5byAaLcROZ+kh70F9E08jI.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.0.101' (ECDSA) to the list of known hosts.
[email protected]'s password:
Linux debian 5.10.0-8-amd64 #1 SMP Debian 5.10.46-4 (2021-08-03) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Sep  6 08:23:23 2021 from 192.168.0.104
dejavu@debian:~$

配置

更换镜像源

国内可以使用清华大学的 Tuna Debian 镜像源

# 切换到 root 用户
su
# 刷新软件源
apt update && apt upgrade
# 安装基本的软件包 
apt install apt-transport-https ca-certificates vim curl wget sudo tree net-tools bind9-utils dnsutils
# 修改镜像源
vim /etc/apt/sources.list
# 将下面内容加到最前面

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free

deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free

deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free

配置 sudo

虽然在安装的时候为了安全我们新建了一个普通用户,但是在执行需要权限的操作还要切换 root 用户,这样很麻烦,可以给这个用户配置下 sudo 提权

# 切换 root 用户并使用 root 用户的配置文件
su -
# 刷新软件源
apt update
# 安装 sudo
apt install sudo
# 将普通用户 dejavu 添加到 sudo 组
usermod -a -G sudo dejavu
# 编辑 sudoer 配置文件
vim /etc/sudoers

取消 sudo ALL=(ALL:ALL) ALL 前面的注释,在 root ALL=(ALL:ALL) ALL 下面添加一行 dejavu ALL=(ALL:ALL) ALL 然后按 :wq! 保存(注意替换为你的实际用户名)

现在输入 exit 退出 root 用户,普通用户应该可以用 sudo 来提权了

dejavu@debian:~sudo apt update

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

[sudo] password for dejavu:
Hit:1 https://mirrors.tuna.tsinghua.edu.cn/debian bullseye InRelease
Hit:2 https://mirrors.tuna.tsinghua.edu.cn/debian bullseye-updates InRelease
Get:3 https://mirrors.tuna.tsinghua.edu.cn/debian bullseye-backports InRelease [39.3 kB]
Get:4 https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security InRelease [44.1 kB]
Get:5 https://mirrors.tuna.tsinghua.edu.cn/debian bullseye/contrib amd64 Packages [50.4 kB]
Get:6 https://mirrors.tuna.tsinghua.edu.cn/debian bullseye/contrib Translation-en [46.9 kB]
Get:7 https://mirrors.tuna.tsinghua.edu.cn/debian bullseye/non-free amd64 Packages [93.8 kB]
Get:8 https://mirrors.tuna.tsinghua.edu.cn/debian bullseye/non-free Translation-en [91.5 kB]
Get:9 https://mirrors.tuna.tsinghua.edu.cn/debian bullseye-backports/main amd64 Packages [56.8 kB]
Get:10 https://mirrors.tuna.tsinghua.edu.cn/debian bullseye-backports/main Translation-en [42.9 kB]
Get:11 https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security/main amd64 Packages [29.6 kB]
Get:12 https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security/main Translation-en [16.0 kB]
Fetched 511 kB in 1s (696 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
dejavu@debian:~$

SFTP 访问

因为局域网络服务器,在 Windows 下使用 WinSCP 的 SFTP 协议管理很方便,而局域网络(无公网,无穿透内网)的环境也不用担心安全,所以这里配置下 SSH 允许 root 用户登录,要不然 SFTP 在很多操作会遇到权限不足的情况 🤡

# 编辑 SSH 配置文件
sudo vim /etc/ssh/sshd_config
# 取消 PermitRootLogin prohibit-password 前面的注释并改为 PermitRootLogin yes
# 输入 :wq! 保存配置
# 重启 SSH 服务
sudo systemctl restart sshd.service

PS: 请尽量避免在生产环境允许 root 用户登录

显卡驱动

已屏蔽核显,仅使用独显(参考 Debian 文档

# 前提已经安装配置好sudoer或者使用root账户操作
sudo apt update
# 安装nvidia-detect软件包
sudo apt install nvidia-detect
# 查看显卡信息
lspci -nn | egrep -i "3d|display|vga"
# 使用nvidia-detect查看推荐安装驱动软件包信息
nvidia-detect
# 根据输出提示的软件包名安装即可
It is recommended to install the nvidia-legacy-390xx-driver package.

完整输出如下

dejavu@debian:~sudo apt install nvidia-detect
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  nvidia-detect
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 233 kB of archives.
After this operation, 307 kB of additional disk space will be used.
Get:1 https://mirrors.tuna.tsinghua.edu.cn/debian bullseye/non-free amd64 nvidia-detect amd64 460.91.03-1 [233 kB]
Fetched 233 kB in 0s (678 kB/s)
Selecting previously unselected package nvidia-detect.
(Reading database ... 25264 files and directories currently installed.)
Preparing to unpack .../nvidia-detect_460.91.03-1_amd64.deb ...
Unpacking nvidia-detect (460.91.03-1) ...
Setting up nvidia-detect (460.91.03-1) ...
dejavu@debian:~lspci -nn | egrep -i "3d|display|vga"
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GF116 [GeForce GTS 450 Rev. 2] [10de:1245] (rev a1)
dejavu@debian:~nvidia-detect
Detected NVIDIA GPUs:
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GF116 [GeForce GTS 450 Rev. 2] [10de:1245] (rev a1)

Checking card:  NVIDIA Corporation GF116 [GeForce GTS 450 Rev. 2] (rev a1)
Your card is only supported up to the 390 legacy drivers series.
It is recommended to install the
    nvidia-legacy-390xx-driver
package.
# 安装推荐的显卡驱动软件包
dejavu@debian:~sudo apt install nvidia-legacy-390xx-driver

Docker

按照 Docker 官方文档 的方法安装Docker

# 更新Debian软件源
sudo apt update
# 安装几个需要的软件包
sudo apt install apt-transport-https ca-certificates curl gnupg lsb-release
# 添加Docker的官方GPG密钥
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
# 默认情况下使用下面命令设置稳定版的存储库,推荐用于生产环境
 echo \
  "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# 更新软件源
sudo apt update
# 安装Docker引擎和容器,根据网速情况,稍等片刻即可😎
sudo apt install docker-ce docker-ce-cli containerd.io

docker-compose

docker-compose 是用于定义和运行多容器 Docker 应用程序的工具,通过 compose,可以使用 YAML 文件来配置应用程序需要的所有服务,然后,只需一个命令,就可以从 YML 文件配置中创建并启动所有服务

# 安装最新版docker-compose,将版本号换成你需要的版本号
sudo curl -L "https://github.com/docker/compose/releases/download/v2.3.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
# 给予权限
sudo chmod +x /usr/local/bin/docker-compose
# 创建软链接
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
# 验证安装成功
dejavu@debian:~docker-compose --version
Docker Compose version v2.3.3

zsh 和 oh-my-zsh

zsh 和 oh-my-zsh 可以让终端用起来更加顺手

# 安装 git zsh
sudo apt update && sudo apt install git zsh
# 设置 zsh 为默认 shell
chsh -s $(which zsh)
# 安装 oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# 安装 zsh 插件 zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# 安装 zsh 插件 zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

zsh-autosuggestions zsh-syntax-highlighting 加进 zsh 配置文件中

# 编辑 zsh 配置文件
vim ~/.zshrc
# 在 plugin 字段加上插件名称即可
plugins=(git zsh-autosuggestions zsh-syntax-highlighting )
# 更新配置
source ~/.zshrc

C/C++ 工具链

因为是局域网络访问,所以延迟几乎可以忽略不计,完全可以使用 VScode 和 Jetbrains CLion 的 Remote Host 开发

# 安装 CLion 所需的工具链
sudo apt install cmake gcc g++ clang gdb

基本环境

为了方便,这里我使用的是 OneInstack ,脚本需要以 Root 用户执行

编译安装组件如下:

  • Nginx
  • PHP 7.4
  • PHP OPcache 加速拓展
  • PHP 拓展 fileinfo
  • PHP 拓展 redis
  • MySQL 5.7
  • redis
  • iptables
wget -c http://mirrors.linuxeye.com/oneinstack-full.tar.gz && tar xzf oneinstack-full.tar.gz && ./oneinstack/install.sh --nginx_option 1 --php_option 9 --phpcache_option 1 --php_extensions fileinfo,redis --phpmyadmin  --db_option 3 --dbinstallmethod 2 --dbrootpwd password --redis  --memcached  --iptables  --reboot 

等待漫长的编译安装过程……完成后会自动重启,至此基本的服务器配置环境就配置好了。