4 Commits

Author SHA1 Message Date
dependabot[bot]
47b3f39974 build(deps): bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-12 10:11:11 +00:00
github-actions[bot]
f718df5a11 chore: lint text and auto correct 2025-06-23 19:40:48 +08:00
ad8fbc6fc2 Update 个人向Linux新服务器初始化清单.md 2025-06-23 19:40:32 +08:00
d2368e9008 feat: update post 2025-06-21 16:17:57 +08:00
5 changed files with 13 additions and 11 deletions

View File

@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Find and Replace Release
uses: jacobtomlinson/gha-find-replace@2.0.0

View File

@@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
name: Build and Deploy Job
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
submodules: true
- name: Build And Deploy

View File

@@ -37,7 +37,7 @@ jobs:
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
submodules: recursive
- name: Setup Pages

View File

@@ -11,10 +11,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: huacnlee.autocorrect
uses: huacnlee/autocorrect-action@v2.13.3
uses: huacnlee/autocorrect-action@v2.10.0
with:
args: --fix

View File

@@ -1,6 +1,7 @@
---
title: 个人向 Linux 新服务器初始化清单
date: 2023-03-14
lastmod: 2025-06-21
description: 一份 Linux 初始化清单,避免每次拿到新的服务器都要一个个去各种地方搜集指令,以做备忘 & 供有需要的朋友参考。以目前最新的 Debian 11 Bullseye 为例
categories:
- 技术
@@ -107,12 +108,10 @@ sudo hostnamectl status
### 1.6 SWAP
可选,建议内存<2G 配置 swap, 大小至少为 2 倍物理内存
可选,建议内存<2G 配置 swap, 大小至少为 2 倍物理内存可以有效避免意外爆内存的情况仅推荐 SSD 盘的服务器开启
推荐用 `fallocate` , 因为这个是最简单最快速的创建交换空间的方法 `fallocate`  命令用于为文件预分配块 / 大小
以下内容参考 linux.cn
使用  `fallocate`  创建交换空间首先在  `/`  目录下创建一个名为  `swap_space`  的文件然后分配 2GB  `swap_space`  文件
```shell
@@ -145,8 +144,6 @@ sudo swapon -s
还可以按需选择使用 zram提升内存可用量不过会略微增加 cpu 使用和内存延时可以搜索 zramctl, zramswap 等关键字
---
### 1.7 绑定域名  
@@ -341,6 +338,11 @@ net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr
net.ipv4.tcp_fastopen=3
net.ipv4.tcp_slow_start_after_idle=0
# zram 相关配置,配合下文 zram 使用
vm.watermark_boost_factor = 0
vm.watermark_scale_factor = 125
vm.page-cluster = 0
```
配置完之后保存并应用
@@ -372,7 +374,7 @@ NAME TYPE SIZE USED PRIO
/dev/zram0 partition 489.9M 0B 100
```
这样依赖会将机器物理内存的 50% 配置 zram, 使用 zstd 压缩算法一般压缩比能达到 3:1, 也就是说1G 的机器可以相当于有`0.5G+3*0.5G=2G`的内存
这样一来会将机器物理内存的 50% 配置 zram, 使用 zstd 压缩算法一般压缩比能达到 3:1, 也就是说1G 的机器可以相当于有`0.5G+3*0.5G=2G`的内存
注意 Debian 新版本 swapon 等工具所在的目录 /usr/sbin 不在普通用户的 PATH 可能需要手动执行前缀使用 /usr/sbin/swapon