Jitdor Tech Tips

Category: 折腾

  • 在 Debian 系统中开启自动安全更新(Auto Patching)

    在 Debian 系统中开启自动安全更新(Auto Patching)

    在 Ubuntu 系统中,很多人习惯使用 Ubuntu ProLivepatch 来获得自动安全更新。但在 Debian 系统里,并没有完全一样的官方服务。不过,Debian 提供了一个非常成熟的工具 —— unattended-upgrades,可以帮助我们实现类似的功能:自动安装安全补丁,减少手动维护的工作量。

    下面就带大家一步一步开启 Debian 的自动安全更新。

    一、为什么要启用自动更新?

    • 提高安全性:Debian 的安全团队会不断发布安全补丁,修复漏洞。如果不及时更新,系统可能暴露在攻击风险中。
    • 降低维护成本:自动下载并安装更新,管理员无需每天手动运行 apt upgrade。
    • 稳定性可控:通过配置,可以只允许「安全更新」自动安装,避免大版本升级导致兼容性问题。

    二、安装必要的组件

    Debian 默认自带 unattended-upgrades 包,如果没有,可以手动安装:

    sudo apt update
    sudo apt install unattended-upgrades apt-listchanges
    • unattended-upgrades:负责自动下载和安装更新
    • apt-listchanges:在更新前显示 changelog(可选)

    三、启用自动更新

    运行配置命令:

    sudo dpkg-reconfigure unattended-upgrades


    选择 Yes 之后,系统会自动在 /etc/apt/apt.conf.d/20auto-upgrades 中写入默认配置,例如:

    APT::Periodic::Update-Package-Lists "1";
    APT::Periodic::Download-Upgradeable-Packages "1";
    APT::Periodic::AutocleanInterval "7";
    APT::Periodic::Unattended-Upgrade "1";

    这里的数字代表天数:

    • 1 = 每天
    • 7 = 每周一次

    Pages: 1 2

  • Building the latest Windows 10 Enterprise VL USB installer from scratch

    Building the latest Windows 10 Enterprise VL USB installer from scratch

    If you are a Microsoft Volume License customer, the usual channel for obtaining creating a bootable USB for OS installation is to obtain the ISO images via the Volume License Service Center (VLSC) or Microsoft Business Center (MBC), and then using tools such as Rufus or the good old Windows USB/DVD Download Tool to write the ISO to USB. However, there exist situations whereby you can’t get hold of the ISO in a timely fashion, such as when the person with the download rights went on leave, or that a new release is not yet available for download. In this article, I’ll show you how you can build a bootable USB drive with the latest Windows 10 Enterprise release from scratch with just the Media Creation Tool from Microsoft.

    (more…)
  • 修改 ServerStatus-V 探针脚本配合 vnStat 2.x 版本使用

    修改 ServerStatus-V 探针脚本配合 vnStat 2.x 版本使用

    网上常见的改版 ServerStatus 探针里采用的流量统计是根据 python 函数 psutil.net_io_counters() 所返回的数值来显示的。所以每次系统重启就会清零,作为检测小鸡每月流量有没有跑超的实用性不大。后来发现了以 vnStat 流量统计为基础的 ServerStatus-V 项目,用比较科学的自然月流量采集方式补足了原来 ServerStatus 的短板,这也是我一直沿用的版本。

    最近适逢 Ubuntu 20.04 LTS 问世,我把手头上一大波的 VPS 系统更新,大致顺利。但后来发现探针监控台里越来越多小鸡的流量报告均为 0 | 0。难道是更新后比较节省流量吗?当然是不存在的。强迫症发作下无可奈何只好研究一下代码…

    果然,问题就出现在这行代码里:

    Pages: 1 2