-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.xml
96 lines (96 loc) · 80.7 KB
/
index.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>LS-Shandong 的博客</title>
<link>https://ls-shandong.github.io/</link>
<description>LS-Shandong 的博客</description>
<generator>Hugo 0.136.5 & FixIt v0.3.13</generator>
<language>zh-CN</language>
<lastBuildDate>Sat, 26 Oct 2024 15:07:09 +0800</lastBuildDate>
<atom:link href="https://ls-shandong.github.io/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>百听不厌</title>
<link>https://ls-shandong.github.io/posts/2024-10-26-1/</link>
<pubDate>Sat, 26 Oct 2024 15:07:09 +0800</pubDate>
<guid>https://ls-shandong.github.io/posts/2024-10-26-1/</guid>
<category domain="https://ls-shandong.github.io/categories/%E6%88%8F%E6%9B%B2/">戏曲</category>
<description><![CDATA[<p>麒派就是这样。</p>
<p>周信芳先生的代表剧目有《打渔杀家》《打严嵩》《四进士》《投军别窑》《乌龙院》《萧何月下追韩信》《徐策跑城》《清风亭》《明末遗恨》《义责王魁》《海瑞上疏》等。</p>
<p>这里选了两个著名的唱段:</p>
<p>-《徐策跑城·湛湛青天不可欺》(2:40 开始唱)
<div class="bilibili">
 <iframe src="//player.bilibili.com/player.html?bvid=BV12u41127Sh&page=1&autoplay=false&poster=true&muted=false&danmaku=true&t=0" border="0" framespacing="0" allowfullscreen="true"></iframe>
</div></p>
<p>-《萧何月下追韩信·我主爷起义在芒砀》(音配像)
<div class="bilibili">
 <iframe src="//player.bilibili.com/player.html?bvid=BV1kb4y117u5&page=1&autoplay=false&poster=true&muted=false&danmaku=true&t=0" border="0" framespacing="0" allowfullscreen="true"></iframe>
</div></p>
<p>听过麒派的《四郎探母》吗?</p>
<div class="bilibili">
 <iframe src="//player.bilibili.com/player.html?bvid=BV1gN4y167xP&page=1&autoplay=false&poster=true&muted=false&danmaku=true&t=0" border="0" framespacing="0" allowfullscreen="true"></iframe>
</div>]]></description>
</item>
<item>
<title>使用 Timeshift 备份系统</title>
<link>https://ls-shandong.github.io/posts/2024-9-28-1/</link>
<pubDate>Sat, 28 Sep 2024 13:52:41 +0800</pubDate>
<guid>https://ls-shandong.github.io/posts/2024-9-28-1/</guid>
<category domain="https://ls-shandong.github.io/categories/linux/">Linux</category>
<description><![CDATA[<p>BTRFS 是一种现代的写时复制(COW)Linux 文件系统,Timeshift 可帮助定期创建文件系统的增量快照。</p>
<hr>
<blockquote>
<p>摘自 Arch Linux 中文维基:</p>
<p><em>Timeshift</em> 可帮助定期创建文件系统的增量快照,然后在以后恢复到这些快照,以撤销对系统的所有更改。</p>
</blockquote>
<p>本文主要介绍 Timeshift 在 Arch Linux 上的配置(使用 Btrfs 文件系统的快照功能),仅供参考。</p>
<h2 id="需要安装的软件包" class="heading-element"><span>需要安装的软件包</span>
 <a href="#%e9%9c%80%e8%a6%81%e5%ae%89%e8%a3%85%e7%9a%84%e8%bd%af%e4%bb%b6%e5%8c%85" class="heading-mark">
 <svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>
 </a>
</h2><p>安装 <code>Timeshift</code> 软件包以获得 <em>Timeshift</em> 本体。</p>
<p>可选:安装 <code>grub-btrfs</code> 软件包以在每次生成 GRUB 配置时向 GRUB 菜单添加快照。</p>
<p>安装 <code>btrfs-progs</code> 以获得 Btrfs 分区基础操作所必须的工具。</p>
<h2 id="timeshift-配置" class="heading-element"><span>Timeshift 配置</span>
 <a href="#timeshift-%e9%85%8d%e7%bd%ae" class="heading-mark">
 <svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>
 </a>
</h2><h3 id="需要的分区配置" class="heading-element"><span>需要的分区配置</span>
 <a href="#%e9%9c%80%e8%a6%81%e7%9a%84%e5%88%86%e5%8c%ba%e9%85%8d%e7%bd%ae" class="heading-mark">
 <svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>
 </a>
</h3><p><em>Timeshift</em> 需要驱动器 <em>/</em> 目录和 <em>/home</em> 目录分别使用 <em>@</em> 和 <em>@home</em> 子卷布局配置。</p>
<p>所以我安装 Arch Linux 的时候是像这样分区的[仅针对根分区(/dev/sda6)]:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span><span class="lnt">14
</span><span class="lnt">15
</span><span class="lnt">16
</span><span class="lnt">17
</span><span class="lnt">18
</span><span class="lnt">19
</span><span class="lnt">20
</span><span class="lnt">21
</span><span class="lnt">22
</span><span class="lnt">23
</span><span class="lnt">24
</span><span class="lnt">25
</span><span class="lnt">26
</span><span class="lnt">27
</span><span class="lnt">28
</span><span class="lnt">29
</span><span class="lnt">30
</span><span class="lnt">31
</span><span class="lnt">32
</span><span class="lnt">33
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># 格式化并挂载分区</span>
</span></span><span class="line"><span class="cl">mkfs.btrfs /dev/sda6
</span></span><span class="line"><span class="cl">mount /dev/sda6 /mnt
</span></span><span class="line"><span class="cl"><span class="c1"># 创建普通的子卷</span>
</span></span><span class="line"><span class="cl">btrfs subvolume create /mnt/@
</span></span><span class="line"><span class="cl">btrfs subvolume create /mnt/@home
</span></span><span class="line"><span class="cl">btrfs subvolume create /mnt/@log
</span></span><span class="line"><span class="cl">btrfs subvolume create /mnt/@pkg
</span></span><span class="line"><span class="cl"><span class="c1"># 创建 swap 子卷及 swap 文件</span>
</span></span><span class="line"><span class="cl">btrfs subvolume create /mnt/swap
</span></span><span class="line"><span class="cl">btrfs filesystem mkswapfile --size 8g --uuid clear /mnt/swap/swapfile
</span></span><span class="line"><span class="cl"><span class="c1"># 启用 swap 文件</span>
</span></span><span class="line"><span class="cl">swapon /mnt/swap/swapfile
</span></span><span class="line"><span class="cl"><span class="c1"># 卸载分区</span>
</span></span><span class="line"><span class="cl">umount /dev/sda6
</span></span><span class="line"><span class="cl"><span class="c1"># 挂载分区(noatime、discard=async 与 compress=zstd 是可选的)</span>
</span></span><span class="line"><span class="cl">mount /dev/sda6 /mnt -o <span class="nv">subvol</span><span class="o">=</span>@,noatime,discard<span class="o">=</span>async,compress<span class="o">=</span>zstd
</span></span><span class="line"><span class="cl"><span class="c1"># 新建目录</span>
</span></span><span class="line"><span class="cl">mkdir /mnt/home
</span></span><span class="line"><span class="cl">mkdir -p /mnt/var/log
</span></span><span class="line"><span class="cl">mkdir -p /mnt/var/cache/pacman/pkg
</span></span><span class="line"><span class="cl"><span class="c1"># 挂载子卷(noatime、discard=async 与 compress=zstd 是可选的)</span>
</span></span><span class="line"><span class="cl"><span class="c1">## 挂载 /home 目录</span>
</span></span><span class="line"><span class="cl">mount /dev/sda6 /mnt/home -o <span class="nv">subvol</span><span class="o">=</span>@home,noatime,discard<span class="o">=</span>async,compress<span class="o">=</span>zstd
</span></span><span class="line"><span class="cl"><span class="c1">## 挂载 /var/log 目录</span>
</span></span><span class="line"><span class="cl">mount /dev/sda6 /mnt/var/log -o <span class="nv">subvol</span><span class="o">=</span>@log,noatime,discard<span class="o">=</span>async,compress<span class="o">=</span>zstd
</span></span><span class="line"><span class="cl"><span class="c1">## 挂载 /var/cache/pacman/pkg 目录</span>
</span></span><span class="line"><span class="cl">mount /dev/sda6 /mnt/var/cache/pacman/pkg -o <span class="nv">subvol</span><span class="o">=</span>@pkg,noatime,discard<span class="o">=</span>async,compress<span class="o">=</span>zstd
</span></span><span class="line"><span class="cl"><span class="c1"># 因为我不希望 /var/log 和 /var/cache/pacman/pkg 在将来被保存快照,所以选择为这两个目录禁用写时复制:</span>
</span></span><span class="line"><span class="cl">chattr +C /mnt/var/log
</span></span><span class="line"><span class="cl">chattr +C /mnt/var/cache/pacman/pkg
</span></span><span class="line"><span class="cl"><span class="c1"># 生成 fstab 文件</span>
</span></span><span class="line"><span class="cl">genfstab -U /mnt &gt;&gt; /mnt/etc/fstab</span></span></code></pre></td></tr></table>
</div>
</div><h3 id="软件配置" class="heading-element"><span>软件配置</span>
 <a href="#%e8%bd%af%e4%bb%b6%e9%85%8d%e7%bd%ae" class="heading-mark">
 <svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>
 </a>
</h3><p>按照向导设置,记得要启用 cronie 服务:</p>
<pre><code># systemctl enable cronie.service --now
</code></pre>
<p><code>grub-btrfs</code> 软件包附带 <code>grub-btrfsd.service</code>,启用后可在创建新快照时自动更新 GRUB 配置。</p>
<p>要使 <code>grub-btrfsd</code> 与 <code>Timeshift</code> 一起工作,请运行以下命令编辑服务:</p>
<pre><code># systemctl edit --full grub-btrfsd
</code></pre>
<p>并将 <code>grub-btrfsd --syslog /.snapshots</code> 替换为 <code>grub-btrfsd --syslog -t</code>。 这样 grub-btrfs 就会监视 Timeshift 创建的快照。</p>
<h2 id="timeshift-的-man-手册页翻译" class="heading-element"><span>Timeshift 的 man 手册页翻译</span>
 <a href="#timeshift-%e7%9a%84-man-%e6%89%8b%e5%86%8c%e9%a1%b5%e7%bf%bb%e8%af%91" class="heading-mark">
 <svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>
 </a>
</h2><p>还没有开始……</p>
<hr>
<p>本文写得匆忙,有疏漏之处请指出。</p>]]></description>
</item>
<item>
<title>在 Wayland 环境下运行 Godot Engine</title>
<link>https://ls-shandong.github.io/posts/2024-9-08/</link>
<pubDate>Sun, 08 Sep 2024 22:44:19 +0800</pubDate>
<guid>https://ls-shandong.github.io/posts/2024-9-08/</guid>
<category domain="https://ls-shandong.github.io/categories/linux/">Linux</category>
<category domain="https://ls-shandong.github.io/categories/%E8%BD%AF%E4%BB%B6/">软件</category>
<description><![CDATA[<p>在 Wayland 环境下运行 Godot Engine。</p>
<p>如题,我要在 Wayland 环境下运行官方仓库里的 Godot Engine。</p>
<p>方法如下:</p>
<p>复制 <code>/usr/share/applications/org.godotengine.Godot.desktop</code> 至 <code>$XDG_DATA_HOME/applications/</code>(例如 <code>~/.local/share/applications/</code>),文件内容如下:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span><span class="lnt">14
</span><span class="lnt">15
</span><span class="lnt">16
</span><span class="lnt">17
</span><span class="lnt">18
</span><span class="lnt">19
</span><span class="lnt">20
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">[Desktop Entry]
</span></span><span class="line"><span class="cl">Name=Godot Engine
</span></span><span class="line"><span class="cl">GenericName=Libre game engine
</span></span><span class="line"><span class="cl">GenericName[el]=Ελεύθερη μηχανή παιχνιδιού
</span></span><span class="line"><span class="cl">GenericName[fr]=Moteur de jeu libre
</span></span><span class="line"><span class="cl">GenericName[nl]=Libre game-engine
</span></span><span class="line"><span class="cl">GenericName[zh_CN]=自由的游戏引擎
</span></span><span class="line"><span class="cl">Comment=Multi-platform 2D and 3D game engine with a feature-rich editor
</span></span><span class="line"><span class="cl">Comment[el]=2D και 3D μηχανή παιχνιδιού πολλαπλών πλατφορμών με επεξεργαστή πλούσιο σε χαρακτηριστικά
</span></span><span class="line"><span class="cl">Comment[fr]=Moteur de jeu 2D et 3D multiplateforme avec un éditeur riche en fonctionnalités
</span></span><span class="line"><span class="cl">Comment[nl]=Multi-platform 2D- en 3d-game-engine met een veelzijdige editor
</span></span><span class="line"><span class="cl">Comment[zh_CN]=多平台 2D 和 3D 游戏引擎,带有功能丰富的编辑器
</span></span><span class="line"><span class="cl">Exec=godot %f
</span></span><span class="line"><span class="cl">Icon=godot
</span></span><span class="line"><span class="cl">Terminal=false
</span></span><span class="line"><span class="cl">PrefersNonDefaultGPU=true
</span></span><span class="line"><span class="cl">Type=Application
</span></span><span class="line"><span class="cl">MimeType=application/x-godot-project;
</span></span><span class="line"><span class="cl">Categories=Development;IDE;
</span></span><span class="line"><span class="cl">StartupWMClass=Godot</span></span></code></pre></td></tr></table>
</div>
</div><p>编辑如下一行:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">...
</span></span><span class="line"><span class="cl">Exec=godot --display-driver wayland %f
</span></span><span class="line"><span class="cl">...</span></span></code></pre></td></tr></table>
</div>
</div><p>此方法仅适用于最新版本的 Godot Engine。</p>]]></description>
</item>
<item>
<title>LaTeX 入门之软件安装</title>
<link>https://ls-shandong.github.io/posts/2024-8-26-1/</link>
<pubDate>Mon, 26 Aug 2024 11:46:40 +0800</pubDate>
<guid>https://ls-shandong.github.io/posts/2024-8-26-1/</guid>
<category domain="https://ls-shandong.github.io/categories/linux/">Linux</category>
<category domain="https://ls-shandong.github.io/categories/%E8%BD%AF%E4%BB%B6/">软件</category>
<description><![CDATA[<p>我新建了一个合集“$\LaTeX$ 入门”,主要记录我入门 $\LaTeX$ 的过程。本文主要记录使用 $\LaTeX$ 所需的软件的安装。本文在实际上代替了<a href="https://ls-shandong.github.io/posts/2024-8-17-1/"target="_blank" rel="external nofollow noopener noreferrer">这篇文章的作用</a></p>
<h2 id="需要知道的信息" class="heading-element"><span>需要知道的信息</span>
 <a href="#%e9%9c%80%e8%a6%81%e7%9f%a5%e9%81%93%e7%9a%84%e4%bf%a1%e6%81%af" class="heading-mark">
 <svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>
 </a>
</h2><p>$\LaTeX$ 是一款流行的的排版系统,它基于 $\TeX$。要想使用 $\LaTeX$,我们需要一个 $\TeX$ 发行版和一个 $\TeX$ 编辑器。我选择了 $\TeX$ Live 发行版和 Kile 编辑器。</p>
<p><a href="https://www.tug.org/texlive/"target="_blank" rel="external nofollow noopener noreferrer">$\TeX$ Live</a> 是一款流行的 $\TeX$ 发行版,它以年份作为发行版的版本号,保持一年一更的频率。一个 $\TeX$ 发行版是 $\TeX$ 排版引擎、支持排版的文件(基本格式、$\LaTeX$ 宏包、字体等)以
及一些辅助工具的集合。</p>
<p><a href="https://apps.kde.org/zh-cn/kile/"target="_blank" rel="external nofollow noopener noreferrer">Kile</a> 是一款由 <a href="https://kde.org/zh-cn/"target="_blank" rel="external nofollow noopener noreferrer">KDE</a> 开发的 $\TeX$/$\LaTeX$ 编辑器。<a href="https://kile.sourceforge.io"target="_blank" rel="external nofollow noopener noreferrer">Kile 官网</a>。</p>
<h2 id="安装" class="heading-element"><span>安装</span>
 <a href="#%e5%ae%89%e8%a3%85" class="heading-mark">
 <svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>
 </a>
</h2><h3 id="安装-tex-live" class="heading-element"><span>安装 $\TeX$ Live</span>
 <a href="#%e5%ae%89%e8%a3%85-tex-live" class="heading-mark">
 <svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>
 </a>
</h3><p>在 <a href="https://archlinux.org"target="_blank" rel="external nofollow noopener noreferrer">Arch Linux</a> 安装 TeX Live 相当容易。有两种方法来安装 $\TeX$ Live。目前仅记录其中一种。</p>
<h4 id="安装官方仓库里打包的-tex-live" class="heading-element"><span>安装官方仓库里打包的 $\TeX$ Live。</span>
 <a href="#%e5%ae%89%e8%a3%85%e5%ae%98%e6%96%b9%e4%bb%93%e5%ba%93%e9%87%8c%e6%89%93%e5%8c%85%e7%9a%84-tex-live" class="heading-mark">
 <svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>
 </a>
</h4><p>通过此方法安装 $\TeX$ Live 的好处是安装完成后开箱即用,无需设置环境变量。
<a href="https://archlinux.org/groups/x86_64/texlive/"target="_blank" rel="external nofollow noopener noreferrer">texlive</a> 包组包含大多数 $\TeX$ Live 包,根据上游集合进行分类。</p>
<p><a href="https://archlinux.org/groups/x86_64/texlive-lang/"target="_blank" rel="external nofollow noopener noreferrer">texlive-lang</a> 包组包含为具有非拉丁字符的语言提供字符集和功能的包。一般来说,我们中国大陆的人安装 <a href="https://archlinux.org/groups/x86_64/texlive-langchinese/"target="_blank" rel="external nofollow noopener noreferrer">texlive-langchinese</a> 即可。</p>
<p>所以我们通过运行一条命令来安装 $\TeX$ Live:</p>
<p><code># pacman -S texlive texlive-langchinese</code></p>
<div class="details admonition tip open">
 <div class="details-summary admonition-title"><i class="icon fa-fw fa-regular fa-lightbulb" aria-hidden="true"></i>提示<i class="details-icon fa-solid fa-angle-right fa-fw" aria-hidden="true"></i></div>
 <div class="details-content">
 <div class="admonition-content">如果你缺少特定的 <em>.sty</em> 文件,你可以运行 <code>pacman -F</code> 来找到提供它们的 Arch 包。</div>
 </div>
</div>
<h3 id="安装-kile" class="heading-element"><span>安装 Kile</span>
 <a href="#%e5%ae%89%e8%a3%85-kile" class="heading-mark">
 <svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>
 </a>
</h3><p>运行以下命令以安装<a href="https://archlinux.org/packages/extra/x86_64/kile/"target="_blank" rel="external nofollow noopener noreferrer">官方仓库</a>里的 Kile:</p>
<p><code># pacman -S kile</code></p>]]></description>
</item>
<item>
<title>Linux 启动时报错</title>
<link>https://ls-shandong.github.io/posts/2024-8-24-1/</link>
<pubDate>Sat, 24 Aug 2024 13:55:31 +0800</pubDate>
<guid>https://ls-shandong.github.io/posts/2024-8-24-1/</guid>
<category domain="https://ls-shandong.github.io/categories/%E7%A1%AC%E4%BB%B6/">硬件</category>
<category domain="https://ls-shandong.github.io/categories/linux/">Linux</category>
<description><![CDATA[<p>每次开机时都会报一堆错误,却不影响系统使用。</p>
<p>运行: <code># journalctl -p err..alert</code> 得到结果是这样的(有删减):</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">I/O error, dev sr1, sector 262128 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class&gt;
</span></span><span class="line"><span class="cl">I/O error, dev sr1, sector 262128 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
</span></span><span class="line"><span class="cl">Buffer I/O error on dev sr1, logical block 32766, async page read
</span></span><span class="line"><span class="cl">I/O error, dev sr1, sector 4096 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0
</span></span><span class="line"><span class="cl">I/O error, dev sr1, sector 4096 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
</span></span><span class="line"><span class="cl">Buffer I/O error on dev sr1, logical block 512, async page read
</span></span><span class="line"><span class="cl">I/O error, dev sr1, sector 260080 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class&gt;
</span></span><span class="line"><span class="cl">I/O error, dev sr1, sector 260080 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
</span></span><span class="line"><span class="cl">Buffer I/O error on dev sr1, logical block 32510, async page read
</span></span><span class="line"><span class="cl">Buffer I/O error on dev sr1, logical block 512, async page read</span></span></code></pre></td></tr></table>
</div>
</div><p>看报错好像是光盘驱动器坏了。我确实有一个光盘驱动器,但是它是正常的,而且,关键的是,我的光盘驱动器是 <em>/dev/sr0</em> 而不是 <em>/dev/sr1</em>。</p>
<p>运行 <code>ls /dev/</code> 发现 <em>/dev/</em> 目录下只有 <em>/dev/sr0</em>。</p>
<p>运行 <code>udevadm info /dev/sr1</code> ,得到 <code>Unknown device &quot;/dev/sr1&quot;: No such device</code>。</p>
<p>在 Arch Linux CN 的聊天群问了问,明白这是怎么回事了。</p>
<p>有些无线网卡厂家,为了实现“免驱”效果,会把网卡模拟成一个光驱,然后把驱动程序放入模拟光驱中,再放个 autorun 文件,网卡就会在首次插入 <em>Windows</em> 电脑时自动安装驱动程序。</p>
<p>然而它不会自动安装 Linux 驱动程序。在 Linux 上,驱动程序可作为内核模块(Module)使用。虽然 Linux 内核里包含了我的网卡的驱动程序,但是由于网卡还是会被识别为一个光驱,我们需要用软件 usb_modeswitch 来把它切换成 Wifi 模式。这便是我以前写的一篇文章<a href="https://ls-shandong.github.io/posts/2024-8-15-1/"target="_blank" rel="external nofollow noopener noreferrer">《在 Linux 上使用无线网卡(网卡基于 RTL8188GU 芯片)》</a>的主要内容。</p>
<p>显然,这个 <em>/dev/sr1</em> 就是我的网卡。奇怪的是 /dev/sr0 和 /dev/sr1 都会启动时报 I/O 错误,仍未解决。</p>]]></description>
</item>
<item>
<title>给 tree 命令加上彩色输出</title>
<link>https://ls-shandong.github.io/posts/2024-8-22-2/</link>
<pubDate>Thu, 22 Aug 2024 15:32:34 +0800</pubDate>
<guid>https://ls-shandong.github.io/posts/2024-8-22-2/</guid>
<category domain="https://ls-shandong.github.io/categories/linux/">Linux</category>
<category domain="https://ls-shandong.github.io/categories/%E8%BD%AF%E4%BB%B6/">软件</category>
<description><![CDATA[<p>给 tree 命令加上彩色输出。</p>
<p>默认安装的 Arch Linux 的 <em>ls</em> 命令是默认彩色输出的,而 <em>tree</em> 软件包提供的 tree 命令默认没有彩色输出。<em>ls</em> 有彩色输出是因为 Arch Linux 默认把 <em>ls</em> 设置为了 <code>ls --color=auto</code> 的别名,那么我们也采用这种方式。</p>
<p>打开 <strong>~/.bashrc</strong> ,插入以下一行:</p>
<p><code>alias tree='tree -C'</code></p>
<p>然后注销再重新登录,此时再执行 tree 命令,就是彩色输出了。</p>]]></description>
</item>
<item>
<title>中文自由或开源游戏维基</title>
<link>https://ls-shandong.github.io/posts/2024-8-22-1/</link>
<pubDate>Thu, 22 Aug 2024 14:23:19 +0800</pubDate>
<guid>https://ls-shandong.github.io/posts/2024-8-22-1/</guid>
<category domain="https://ls-shandong.github.io/categories/%E7%BF%BB%E8%AF%91/">翻译</category>
<category domain="https://ls-shandong.github.io/categories/linux/">Linux</category>
<description><![CDATA[<p>Libregamewiki 的中文翻译工作开始了。</p>
<p>我从今年早些时候就提出要翻译 <a href="https://libregamewiki.org/Libregamewiki:Community_portal#Can_I_create_translation_pages_for_existing_articles_on_this_wiki?"target="_blank" rel="external nofollow noopener noreferrer">Libregamewiki</a>了(虽然这和 Arch Linux 中文维基<em>游戏列表</em>界面有点重复),可是 Libregamewiki 的社区一直不回复,那我就自己做好了。可是我又没有一个适合托管 wiki 的服务器。就想到了<a href="https://readthedocs.com/"target="_blank" rel="external nofollow noopener noreferrer">Read the Docs</a>(虽然它不是专门用来写 wiki 的),现在已经<a href="https://chinese-libre-game-wiki.readthedocs.io"target="_blank" rel="external nofollow noopener noreferrer">部署上去了</a>。</p>
<p>但是它现在仍然处于“毛坯”的状态,有兴趣做翻译工作的可以去 <a href="https://github.com/LS-Shandong/Chinese-libre-game-wiki"target="_blank" rel="external nofollow noopener noreferrer">Github</a> 提 Issues 或在本页下方评论。而且,我不会把工作重心转移至这上面来。</p>
<div class="details admonition tip open">
 <div class="details-summary admonition-title"><i class="icon fa-fw fa-regular fa-lightbulb" aria-hidden="true"></i>提示<i class="details-icon fa-solid fa-angle-right fa-fw" aria-hidden="true"></i></div>
 <div class="details-content">
 <div class="admonition-content">如果坚持不下去,我就会放弃这个项目。</div>
 </div>
</div>]]></description>
</item>
<item>
<title>对 TTF 字体进行压缩与转换</title>
<link>https://ls-shandong.github.io/posts/2024-8-20-1/</link>
<pubDate>Tue, 20 Aug 2024 14:36:32 +0800</pubDate>
<guid>https://ls-shandong.github.io/posts/2024-8-20-1/</guid>
<category domain="https://ls-shandong.github.io/categories/%E8%BD%AF%E4%BB%B6/">软件</category>
<description><![CDATA[<p>在 HTML 网页里引用中文字体时,发现字体过大,导致加载得很慢。本文介绍了压缩与转换 ttf 字体的方法</p>
<p>我在网络上查找了资料,基本上都说可以通过工具删去字体中不需要的部分,以达到压缩 ttf 字体的目的。</p>
<h2 id="安装-font-spider" class="heading-element"><span>安装 font-spider</span>
 <a href="#%e5%ae%89%e8%a3%85-font-spider" class="heading-mark">
 <svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>
 </a>
</h2><p>需要先安装 Node.js 和 npm(或 yarn),它们的安装和配置以后再说。</p>
<p>运行:</p>
<p><code># yarn global add font-spider</code></p>
<h2 id="压缩字体" class="heading-element"><span>压缩字体</span>
 <a href="#%e5%8e%8b%e7%bc%a9%e5%ad%97%e4%bd%93" class="heading-mark">
 <svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>
 </a>
</h2><h3 id="准备工作" class="heading-element"><span>准备工作</span>
 <a href="#%e5%87%86%e5%a4%87%e5%b7%a5%e4%bd%9c" class="heading-mark">
 <svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>
 </a>
</h3><p>新建一个 HTML 文件,自定义要保留的字符,如下:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span><span class="lnt">14
</span><span class="lnt">15
</span><span class="lnt">16
</span><span class="lnt">17
</span><span class="lnt">18
</span><span class="lnt">19
</span><span class="lnt">20
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-HTML" data-lang="HTML"><span class="line"><span class="cl"><span class="cp">&lt;!DOCTYPE html&gt;</span>
</span></span><span class="line"><span class="cl"><span class="p">&lt;</span><span class="nt">html</span><span class="p">&gt;</span>
</span></span><span class="line"><span class="cl"> <span class="p">&lt;</span><span class="nt">head</span><span class="p">&gt;</span>
</span></span><span class="line"><span class="cl"> <span class="p">&lt;</span><span class="nt">meta</span> <span class="na">charset</span><span class="o">=</span><span class="s">&#34;utf-8&#34;</span><span class="p">&gt;</span>
</span></span><span class="line"><span class="cl"> <span class="p">&lt;</span><span class="nt">meta</span> <span class="na">name</span><span class="o">=</span><span class="s">&#34;viewport&#34;</span> <span class="na">content</span><span class="o">=</span><span class="s">&#34;width=device-width, initial-scale=1&#34;</span><span class="p">&gt;</span>
</span></span><span class="line"><span class="cl"> <span class="p">&lt;</span><span class="nt">title</span><span class="p">&gt;&lt;/</span><span class="nt">title</span><span class="p">&gt;</span>
</span></span><span class="line"><span class="cl"> <span class="p">&lt;</span><span class="nt">style</span> <span class="na">type</span><span class="o">=</span><span class="s">&#34;text/css&#34;</span><span class="p">&gt;</span>
</span></span><span class="line"><span class="cl"> <span class="p">@</span><span class="k">font-face</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">font-family</span><span class="o">:</span> <span class="nt">字体名称</span><span class="o">;</span>
</span></span><span class="line"><span class="cl"> <span class="nt">src</span><span class="o">:</span> <span class="nt">url</span><span class="o">(</span><span class="s1">&#39;文件URL&#39;</span><span class="o">);</span>
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
</span></span><span class="line"><span class="cl"> <span class="nt">body</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="k">font-family</span><span class="p">:</span> <span class="err">字体名称</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
</span></span><span class="line"><span class="cl"> <span class="p">&lt;/</span><span class="nt">style</span><span class="p">&gt;</span>
</span></span><span class="line"><span class="cl"> <span class="p">&lt;/</span><span class="nt">head</span><span class="p">&gt;</span>
</span></span><span class="line"><span class="cl"> <span class="p">&lt;</span><span class="nt">body</span><span class="p">&gt;</span>
</span></span><span class="line"><span class="cl"> 在这里写要保留的文字。可以直接把《义务教育语文课程常用字表》复制进来。
</span></span><span class="line"><span class="cl"> <span class="p">&lt;/</span><span class="nt">body</span><span class="p">&gt;</span>
</span></span><span class="line"><span class="cl"><span class="p">&lt;/</span><span class="nt">html</span><span class="p">&gt;</span></span></span></code></pre></td></tr></table>
</div>
</div><p><figure><a class="lightgallery" href="https://ls-shandong.github.io/images/blogs/2024-8-20-1/2024-8-20-1-1.jpg?size=large" data-thumbnail="/images/blogs/2024-8-20-1/2024-8-20-1-1.jpg?size=small" data-sub-html="<h2>文件内容示例</h2><p>文件内容示例</p>"><img loading="lazy" src="https://ls-shandong.github.io/images/blogs/2024-8-20-1/2024-8-20-1-1.jpg" alt="文件内容示例" srcset="https://ls-shandong.github.io/images/blogs/2024-8-20-1/2024-8-20-1-1.jpg?size=small, https://ls-shandong.github.io/images/blogs/2024-8-20-1/2024-8-20-1-1.jpg?size=medium 1.5x, https://ls-shandong.github.io/images/blogs/2024-8-20-1/2024-8-20-1-1.jpg?size=large 2x" data-title="文件内容示例" style="--width: 1426px;--aspect-ratio: 1426 / 846;background: url(/images/loading.min.svg) no-repeat center;" onload="this.title=this.dataset.title;for(const i of ['style', 'data-title','onerror','onload']){this.removeAttribute(i);}this.dataset.lazyloaded='';" onerror="this.title=this.dataset.title;for(const i of ['style', 'data-title','onerror','onload']){this.removeAttribute(i);}"/></a><figcaption class="image-caption">文件内容示例</figcaption>
 </figure></p>
<h3 id="压缩字体-1" class="heading-element"><span>压缩字体</span>
 <a href="#%e5%8e%8b%e7%bc%a9%e5%ad%97%e4%bd%93-1" class="heading-mark">
 <svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>
 </a>
</h3><p>假设你编写的 HTML 文件叫作 <em>index.html</em>,运行:</p>
<p><code>$ font-spider index.html</code></p>
<p><figure><a class="lightgallery" href="https://ls-shandong.github.io/images/blogs/2024-8-20-1/2024-8-20-1-2.jpg?size=large" data-thumbnail="/images/blogs/2024-8-20-1/2024-8-20-1-2.jpg?size=small" data-sub-html="<h2>运行结果示例</h2><p>运行结果示例</p>"><img loading="lazy" src="https://ls-shandong.github.io/images/blogs/2024-8-20-1/2024-8-20-1-2.jpg" alt="运行结果示例" srcset="https://ls-shandong.github.io/images/blogs/2024-8-20-1/2024-8-20-1-2.jpg?size=small, https://ls-shandong.github.io/images/blogs/2024-8-20-1/2024-8-20-1-2.jpg?size=medium 1.5x, https://ls-shandong.github.io/images/blogs/2024-8-20-1/2024-8-20-1-2.jpg?size=large 2x" data-title="运行结果示例" style="--width: 1912px;--aspect-ratio: 1912 / 612;background: url(/images/loading.min.svg) no-repeat center;" onload="this.title=this.dataset.title;for(const i of ['style', 'data-title','onerror','onload']){this.removeAttribute(i);}this.dataset.lazyloaded='';" onerror="this.title=this.dataset.title;for(const i of ['style', 'data-title','onerror','onload']){this.removeAttribute(i);}"/></a><figcaption class="image-caption">运行结果示例</figcaption>
 </figure></p>
<p>这样就把 32570.002 KB 大小的字体文件压缩到 3383.312 KB 了。</p>
<p>执行完后,它会把原来的字体文件移动到 .font-spider 文件夹,而原来的字体文件会被替换为压缩后的字体文件。如果有要补充的字符,把要补充的字符继续添加到 HTML 文件中,执行 <code>font-spider index.html</code> 即可。</p>
<h2 id="转换字体" class="heading-element"><span>转换字体</span>
 <a href="#%e8%bd%ac%e6%8d%a2%e5%ad%97%e4%bd%93" class="heading-mark">
 <svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>
 </a>
</h2><p>3 MB 多加载起来还是有点慢,我们可以把它转换成 woff2 格式。</p>
<p>在 Arch Linux 上,将 ttf 文件转换为 woff2 文件,需要安装软件包 <em>woff2</em>:</p>
<p><code># pacman -S woff2</code></p>
<p>然后在字体所在目录,执行:</p>
<p><code>$ woff2_compress 要转换的字体文件的名称</code></p>
<p><figure><a class="lightgallery" href="https://ls-shandong.github.io/images/blogs/2024-8-20-1/2024-8-20-1-3.png?size=large" data-thumbnail="/images/blogs/2024-8-20-1/2024-8-20-1-3.png?size=small" data-sub-html="<h2>运行结果示例</h2><p>运行结果示例</p>"><img loading="lazy" src="https://ls-shandong.github.io/images/blogs/2024-8-20-1/2024-8-20-1-3.png" alt="运行结果示例" srcset="https://ls-shandong.github.io/images/blogs/2024-8-20-1/2024-8-20-1-3.png?size=small, https://ls-shandong.github.io/images/blogs/2024-8-20-1/2024-8-20-1-3.png?size=medium 1.5x, https://ls-shandong.github.io/images/blogs/2024-8-20-1/2024-8-20-1-3.png?size=large 2x" data-title="运行结果示例" style="--width: 577px;--aspect-ratio: 577 / 66;background: url(/images/loading.min.svg) no-repeat center;" onload="this.title=this.dataset.title;for(const i of ['style', 'data-title','onerror','onload']){this.removeAttribute(i);}this.dataset.lazyloaded='';" onerror="this.title=this.dataset.title;for(const i of ['style', 'data-title','onerror','onload']){this.removeAttribute(i);}"/></a><figcaption class="image-caption">运行结果示例</figcaption>
 </figure></p>
<p>当前目录就会出现一个转换后的 woff2 文件,1.9 MB。</p>]]></description>
</item>
<item>
<title>如何将 MIDI 音乐文件转换为 MP3 文件并压缩?</title>
<link>https://ls-shandong.github.io/posts/2024-8-19-1/</link>
<pubDate>Mon, 19 Aug 2024 14:48:00 +0800</pubDate>
<guid>https://ls-shandong.github.io/posts/2024-8-19-1/</guid>
<category domain="https://ls-shandong.github.io/categories/%E9%9F%B3%E4%B9%90/">音乐</category>
<description><![CDATA[<p>MIDI 曾经非常流行。在专业音乐创作/编曲中,它仍然起着至关重要的作用。本文主要介绍将 MIDI(.mid)文件转换为 MP3 文件的方法。</p>
<p>本文全部操作均在 Arch Linux 环境下。</p>
<h2 id="需要的软件包" class="heading-element"><span>需要的软件包</span>
 <a href="#%e9%9c%80%e8%a6%81%e7%9a%84%e8%bd%af%e4%bb%b6%e5%8c%85" class="heading-mark">
 <svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>
 </a>
</h2><p>要转换 MIDI(.mid)文件,我们需要:</p>
<ul>
<li>
<p>一个<strong>常见的</strong>合成器(比如 FluidSynth 或 TiMidity++)</p>
</li>
<li>
<p>soundfont(比如 Fluid 或 FreePats)</p>
</li>
<li>
<p>软件包 ffmpeg(TiMidity++ 需要) 或 twolame(FluidSynth 需要)</p>
</li>
</ul>
<p>要压缩 MIDI(.mid)文件,我们需要:</p>
<ul>
<li>ffmpeg</li>
</ul>
<p>上述软件包均存在于官方仓库中。要安装它们,直接运行:</p>
<p><code>pacman -S 软件包名称</code></p>
<h2 id="转换" class="heading-element"><span>转换</span>
 <a href="#%e8%bd%ac%e6%8d%a2" class="heading-mark">
 <svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>
 </a>
</h2><h3 id="对于-fluidsynth" class="heading-element"><span>对于 FluidSynth</span>
 <a href="#%e5%af%b9%e4%ba%8e-fluidsynth" class="heading-mark">
 <svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>
 </a>
</h3><p>要将 MIDI(.mid)文件转换为 MP3 文件,运行:</p>
<p><code>$ fluidsynth -l -T raw -F - /usr/share/soundfonts/FluidR3_GM.sf2 input.mid | twolame -b 256 -r - output.mp3</code>
<div class="details admonition tip open">
 <div class="details-summary admonition-title"><i class="icon fa-fw fa-regular fa-lightbulb" aria-hidden="true"></i>提示<i class="details-icon fa-solid fa-angle-right fa-fw" aria-hidden="true"></i></div>
 <div class="details-content">
 <div class="admonition-content"><p>将 <em>FluidR3_GM.sf2</em> 替换为您选择的 <em>soundfont</em>,</p>
<p>将 <em>input.mid</em> 替换为要转换的 MIDI 文件,</p>
<p>将 <em>output.mp3</em> 替换为目标 mp3 文件。</p>
</div>
 </div>
</div></p>
<h3 id="对于-timidity" class="heading-element"><span>对于 TiMidity</span>
 <a href="#%e5%af%b9%e4%ba%8e-timidity" class="heading-mark">
 <svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>
 </a>
</h3><p>要将 MIDI(.mid)文件转换为 MP3 文件,运行:</p>
<p><code>$ timidity input.mid -Ow -o - | ffmpeg -i - -acodec libmp3lame -ab 256k out.mp3</code></p>
<div class="details admonition tip open">
 <div class="details-summary admonition-title"><i class="icon fa-fw fa-regular fa-lightbulb" aria-hidden="true"></i>提示<i class="details-icon fa-solid fa-angle-right fa-fw" aria-hidden="true"></i></div>
 <div class="details-content">
 <div class="admonition-content"><p>将 <em>input.mid</em> 替换为要转换的 MIDI 文件,</p>
<p>将 <em>output.mp3</em> 替换为目标 mp3 文件。</p>
</div>
 </div>
</div>
<h2 id="压缩" class="heading-element"><span>压缩</span>
 <a href="#%e5%8e%8b%e7%bc%a9" class="heading-mark">
 <svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>
 </a>
</h2><p>我们在前面转换的时候设置 mp3 文件码率为256kbps,可以通过降低码率来压缩 mp3,运行:</p>
<p><code>$ ffmpeg -i input.mp3 -b:a 128k output.mp3</code></p>
<div class="details admonition tip open">
 <div class="details-summary admonition-title"><i class="icon fa-fw fa-regular fa-lightbulb" aria-hidden="true"></i>提示<i class="details-icon fa-solid fa-angle-right fa-fw" aria-hidden="true"></i></div>
 <div class="details-content">
 <div class="admonition-content"><p>将 <em>input.mp3</em> 替换为要压缩的 mp3 文件,</p>
<p>将 <em>output.mp3</em> 替换为目标 mp3 文件。</p>
<p>将 <em>128k</em> 替换为目标码率</p>
</div>
 </div>
</div>
<p>还有其它方法,慢慢补充。</p>
<h2 id="参见" class="heading-element"><span>参见</span>
 <a href="#%e5%8f%82%e8%a7%81" class="heading-mark">
 <svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>
 </a>
</h2><p>1.<a href="https://wiki.archlinux.org/title/MIDI"target="_blank" rel="external nofollow noopener noreferrer">MIDI -ArchWiki</a></p>
<p>2.<a href="https://wiki.archlinuxcn.org/wiki/FluidSynth"target="_blank" rel="external nofollow noopener noreferrer">FluidSynth -Arch Linux 中文维基</a></p>
<p>3.<a href="https://wiki.archlinuxcn.org/wiki/Timidity%2B%2B"target="_blank" rel="external nofollow noopener noreferrer">Timidity++ -Arch Linux 中文维基</a></p>]]></description>
</item>
<item>
<title>读《报任安书》</title>
<link>https://ls-shandong.github.io/reading/2024-8-18-1/</link>
<pubDate>Sun, 18 Aug 2024 12:52:34 +0800</pubDate>
<guid>https://ls-shandong.github.io/reading/2024-8-18-1/</guid>
<description><![CDATA[<p>本文是汉代司马迁《报任安书》全文,过几天会加上《古文辞类篹》的圈点。</p>
<h2 id="正文" class="heading-element"><span>正文</span>
 <a href="#%e6%ad%a3%e6%96%87" class="heading-mark">
 <svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>
 </a>
</h2><p>太史公牛马走司马迁,再拜言。</p>
<p>少卿足下:曩者辱赐书,教以慎于接物,推贤进士为务,意气勤勤恳恳。若望仆不相师,而用流俗人之言,仆非敢如此也。仆虽罢驽,亦尝侧闻长者之遗风矣。顾自以为身残处秽,动而见尤,欲益反损,是以独郁悒而无谁语。谚曰:“谁为为之?孰令听之?”盖钟子期死,伯牙终身不复鼓琴。何则?士为知己者用,女为说己者容。若仆大质已亏缺矣,虽材怀随和,行若由夷,终不可以为荣,适足以发笑而自点耳。</p>
<p>书辞宜答,会东从上来,又迫贱事,相见日浅,卒卒无须臾之间,得竭指意。今少卿抱不测之罪,涉旬月,迫季冬,仆又薄从上雍,恐卒然不可为讳,是仆终已不得舒愤懑以晓左右,则长逝者魂魄私恨无穷。请略陈固陋。阙然久不报,幸勿为过。</p>
<p>仆闻之:修身者,智之符也;爱施者,仁之端也;取予者,义之表也;耻辱者,勇之决也;立名者,行之极也。士有此五者,然后可以托于世,列于君子之林矣。故祸莫憯于欲利,悲莫痛于伤心,行莫丑于辱先,诟莫大于宫刑。刑余之人,无所比数,非一世也,所从来远矣。昔卫灵公与雍渠同载,孔子适陈;商鞅因景监见,赵良寒心;同子参乘,袁丝变色:自古而耻之!夫以中材之人,事有关于宦竖,莫不伤气,而况于慷慨之士乎!如今朝廷虽乏人,奈何令刀锯之余,荐天下之豪俊哉!仆赖先人绪业,得待罪辇毂下,二十余年矣。所以自惟:上之,不能纳忠效信,有奇策材力之誉,自结明主;次之,又不能拾遗补阙,招贤进能,显岩穴之士;外之,不能备行伍,攻城野战,有斩将搴旗之功;下之,不能积日累劳,取尊官厚禄,以为宗族交游光宠。四者无一遂,苟合取容,无所短长之效,可见于此矣。乡者,仆亦尝厕下大夫之列,陪外廷末议。不以此时引维纲,尽思虑,今已亏形为扫除之隶,在阘茸之中,乃欲仰首伸眉,论列是非,不亦轻朝廷、羞当世之士邪?嗟乎!嗟乎!如仆尚何言哉!尚何言哉!</p>
<p>且事本末未易明也。仆少负不羁之才,长无乡曲之誉,主上幸以先人之故,使得奉薄伎,出入周卫之中。仆以为戴盆何以望天,故绝宾客之知,忘室家之业,日夜思竭其不肖之材力,务一心营职,以求亲媚于主上。而事乃有大谬不然者!</p>
<p>夫仆与李陵俱居门下,素非能相善也。趣舍异路,未尝衔杯酒,接殷勤之余欢。然仆观其为人,自守奇士,事亲孝,与士信,临财廉,取予义,分别有让,恭俭下人,常思奋不顾身,以徇国家之急。其素所蓄积也,仆以为有国士之风。夫人臣出万死不顾一生之计,赴公家之难,斯已奇矣。今举事一不当,而全躯保妻子之臣随而媒孽其短,仆诚私心痛之。且李陵提步卒不满五千,深践戎马之地,足历王庭,垂饵虎口,横挑强胡,仰亿万之师,与单于连战十有余日,所杀过当。虏救死扶伤不给,旃裘之君长咸震怖,乃悉征其左、右贤王,举引弓之民,一国共攻而围之。转斗千里,矢尽道穷,救兵不至,士卒死伤如积。然陵一呼劳军,士无不起,躬自流涕,沬血饮泣,更张空弮,冒白刃,北首争死敌者。陵未没时,使有来报,汉公卿王侯皆奉觞上寿。后数日,陵败书闻,主上为之食不甘味,听朝不怡。大臣忧惧,不知所出。仆窃不自料其卑贱,见主上惨凄怛悼,诚欲效其款款之愚,以为李陵素与士大夫绝甘分少,能得人之死力,虽古之名将,不能过也。身虽陷败,彼观其意,且欲得其当而报于汉。事已无可奈何,其所摧败,功亦足以暴于天下矣。仆怀欲陈之,而未有路,适会召问,即以此指,推言陵之功,欲以广主上之意,塞睚眦之辞。未能尽明,明主不晓,以为仆沮贰师,而为李陵游说,遂下于理。拳拳之忠,终不能自列。因为诬上,卒从吏议。家贫,货赂不足以自赎,交游莫救,左右亲近不为一言。身非木石,独与法吏为伍,深幽囹圄之中,谁可告愬者!此真少卿所亲见,仆行事岂不然乎?李陵既生降,隤其家声,而仆又佴之蚕室,重为天下观笑。悲夫!悲夫!事未易一二为俗人言也。</p>
<p>仆之先非有剖符丹书之功,文史星历,近乎卜祝之间,固主上所戏弄,倡优所畜,流俗之所轻也。假令仆伏法受诛,若九牛亡一毛,与蝼蚁何以异?而世又不与能死节者比,特以为智穷罪极,不能自免,卒就死耳。何也?素所自树立使然也。人固有一死,或重于泰山,或轻于鸿毛,用之所趋异也。太上不辱先,其次不辱身,其次不辱理色,其次不辱辞令,其次诎体受辱,其次易服受辱,其次关木索、被箠楚受辱,其次剔毛发、婴金铁受辱,其次毁肌肤、断肢体受辱,最下腐刑极矣!传曰“刑不上大夫。”此言士节不可不勉厉也。猛虎在深山,百兽震恐,及在槛阱之中,摇尾而求食,积威约之渐也。故士有画地为牢,势不可入;削木为吏,议不可对,定计于鲜也。今交手足,受木索,暴肌肤,受榜箠,幽于圜墙之中。当此之时,见狱吏则头抢地,视徒隶则心惕息。何者?积威约之势也。及以至是,言不辱者,所谓强颜耳,曷足贵乎!且西伯,伯也,拘于羑里;李斯,相也,具于五刑;淮阴,王也,受械于陈;彭越、张敖,南面称孤,系狱抵罪;绛侯诛诸吕,权倾五伯,囚于请室;魏其,大将也,衣赭衣,关三木;季布为朱家钳奴;灌夫受辱于居室。此人皆身至王侯将相,声闻邻国,及罪至罔加,不能引决自裁,在尘埃之中。古今一体,安在其不辱也?由此言之,勇怯,势也;强弱,形也。审矣,何足怪乎?夫人不能早自裁绳墨之外,以稍陵迟,至于鞭箠之间,乃欲引节,斯不亦远乎!古人所以重施刑于大夫者,殆为此也。
夫人情莫不贪生恶死,念父母,顾妻子,至激于义理者不然,乃有所不得已也。今仆不幸,早失父母,无兄弟之亲,独身孤立,少卿视仆于妻子何如哉?且勇者不必死节,怯夫慕义,何处不勉焉!仆虽怯懦,欲苟活,亦颇识去就之分矣,何至自沉溺缧绁之辱哉!且夫臧获婢妾,犹能引决,况仆之不得已乎?所以隐忍苟活,幽于粪土之中而不辞者,恨私心有所不尽,鄙陋没世,而文采不表于后也。</p>
<p>古者富贵而名摩灭,不可胜记,唯倜傥非常之人称焉。盖文王拘而演《周易》;仲尼厄而作《春秋》;屈原放逐,乃赋《离骚》;左丘失明,厥有《国语》;孙子膑脚,《兵法》修列;不韦迁蜀,世传《吕览》;韩非囚秦,《说难》《孤愤》;《诗》三百篇,大底圣贤发愤之所为作也。此人皆意有所郁结,不得通其道,故述往事、思来者。乃如左丘无目,孙子断足,终不可用,退而论书策,以舒其愤,思垂空文以自见。</p>
<p>仆窃不逊,近自托于无能之辞,网罗天下放失旧闻,略考其行事,综其终始,稽其成败兴坏之纪,上计轩辕,下至于兹,为十表,本纪十二,书八章,世家三十,列传七十,凡百三十篇。亦欲以究天人之际,通古今之变,成一家之言。草创未就,会遭此祸,惜其不成,是以就极刑而无愠色。仆诚以著此书,藏之名山,传之其人,通邑大都,则仆偿前辱之责,虽万被戮,岂有悔哉!然此可为智者道,难为俗人言也!</p>
<p>且负下未易居,下流多谤议。仆以口语遇遭此祸,重为乡党所笑,以污辱先人,亦何面目复上父母之丘墓乎?虽累百世,垢弥甚耳!是以肠一日而九回,居则忽忽若有所亡,出则不知其所往。每念斯耻,汗未尝不发背沾衣也!身直为闺阁之臣,宁得自引深藏于岩穴邪?故且从俗浮沉,与时俯仰,以通其狂惑。今少卿乃教以推贤进士,无乃与仆私心剌谬乎?今虽欲自雕琢,曼辞以自饰,无益,于俗不信,适足取辱耳。要之,死日然后是非乃定。书不能悉意,故略陈固陋。谨再拜。</p>]]></description>
</item>
</channel>
</rss>