mirror of
https://github.com/Dichgrem/Blog.git
synced 2026-02-05 09:31:55 -05:00
Compare commits
6 Commits
main
...
39ec7848aa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
39ec7848aa | ||
|
|
1f827723c0 | ||
|
|
742abf8a37 | ||
|
|
e055808ffe | ||
|
|
fc411e21d8 | ||
|
|
e6869053fe |
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
|||||||
- name: Install Zola
|
- name: Install Zola
|
||||||
uses: taiki-e/install-action@v2
|
uses: taiki-e/install-action@v2
|
||||||
with:
|
with:
|
||||||
tool: zola@0.21.0
|
tool: zola
|
||||||
|
|
||||||
- name: Install Pagefind
|
- name: Install Pagefind
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
16
config.toml
16
config.toml
@@ -22,22 +22,6 @@ taxonomies = [
|
|||||||
[markdown]
|
[markdown]
|
||||||
highlight_code = true
|
highlight_code = true
|
||||||
highlight_theme = "boron"
|
highlight_theme = "boron"
|
||||||
render_emoji = false
|
|
||||||
external_links_target_blank = true
|
|
||||||
external_links_no_follow = true
|
|
||||||
external_links_no_referrer = true
|
|
||||||
smart_punctuation = false
|
|
||||||
bottom_footnotes = true
|
|
||||||
table_of_contents = { start_level = 2, end_level = 4 }
|
|
||||||
|
|
||||||
[markdown.highlight_themes]
|
|
||||||
light = "boron"
|
|
||||||
dark = "dracula"
|
|
||||||
|
|
||||||
[slugify]
|
|
||||||
paths = "on"
|
|
||||||
taxonomies = "on"
|
|
||||||
anchors = "on"
|
|
||||||
|
|
||||||
[extra]
|
[extra]
|
||||||
|
|
||||||
|
|||||||
@@ -33,13 +33,12 @@ Aria2 有以下几个特点:
|
|||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
|
||||||
首先在Github下载aria2[aria2-1.37.0-win-64bit-build1.zip](https://github.com/aria2/aria2/releases/tag/release-1.37.0),将下载好的文件解压并放到你喜欢的目录下,这里放到``D:\Software\aria2\aria2c.exe``
|
首先下载[aria2-1.37.0-win-64bit-build1.zip](https://github.com/aria2/aria2/releases/tag/release-1.37.0),将下载好的文件解压并放到你喜欢的目录下,设置系统环境变量,类似``D:\DATA\Data\AriaNg-1.3.10-AllInOne``,随后即可在 CMD 中使用``aria2c -v``查看Aria2 。
|
||||||
|
|
||||||
然后在同一个目录下创建一个配置文件``aria2.conf``,内容如下:
|
|
||||||
|
|
||||||
|
然后创建一个配置文件``C:\Users\<你>\.aria2\aria2.conf``,内容如下:
|
||||||
```conf
|
```conf
|
||||||
# 下载目录
|
# 下载目录
|
||||||
dir=C:/Users/<你的用户名>/Downloads
|
dir=C:/Users/<你>/Downloads
|
||||||
|
|
||||||
# 断点续传
|
# 断点续传
|
||||||
continue=true
|
continue=true
|
||||||
@@ -50,31 +49,20 @@ enable-rpc=true
|
|||||||
rpc-listen-all=true
|
rpc-listen-all=true
|
||||||
rpc-allow-origin-all=true
|
rpc-allow-origin-all=true
|
||||||
rpc-listen-port=6800
|
rpc-listen-port=6800
|
||||||
rpc-secret=<设置一个密码>
|
rpc-secret=<你的密码>
|
||||||
```
|
```
|
||||||
|
随后在这个项目中[winsw](https://github.com/winsw/winsw)下载 WinSW-x64.exe到一个目录,并重命名为 aria2-service.exe,并在同目录下创建``aria2-service.xml``,内容如下:
|
||||||
|
|
||||||
随后使用winfet安装servy,servy是一个将任何应用变成原生 Windows 服务的软件,可以让aria2服务开机自启动,类似linux上的systemctl.
|
```xml
|
||||||
|
<service>
|
||||||
|
<id>aria2</id>
|
||||||
|
<name>Aria2 Service</name>
|
||||||
|
<description>Aria2 Download Manager</description>
|
||||||
|
<executable>C:\Users\<你>\scoop\apps\aria2\current\aria2c.exe</executable>
|
||||||
|
<arguments>--conf-path=C:\Users\<你>\.aria2\aria2.conf</arguments>
|
||||||
|
</service>
|
||||||
```
|
```
|
||||||
winget install servy
|
随后使用``.\aria2-service.exe install``安装服务,并使用``.\aria2-service.exe start``启动服务,类似linux上的systemctl.
|
||||||
```
|
|
||||||
安装完成后打开管理员权限的powershell,运行以下命令,注意路径要和你实际的路径相同:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
servy-cli install `
|
|
||||||
--name aria2 `
|
|
||||||
--displayName "aria2 download service" `
|
|
||||||
--description "aria2 background download daemon" `
|
|
||||||
--path D:\Software\aria2\aria2c.exe `
|
|
||||||
--params="--conf-path=D:\Software\aria2\aria2.conf" `
|
|
||||||
--startupDir D:\Software\aria2 `
|
|
||||||
--startupType Automatic `
|
|
||||||
--recoveryAction RestartProcess `
|
|
||||||
--stdout D:\Software\aria2\stdout.log `
|
|
||||||
--stderr D:\Software\aria2\stderr.log
|
|
||||||
```
|
|
||||||
|
|
||||||
随后使用``servy-cli start --name aria2``开启服务,并使用``servy-cli status --name aria2``查看服务,在running中则一切正常!现在可以到本文的末尾安装浏览器插件并连接使用。
|
|
||||||
|
|
||||||
> 注意修改用户名!
|
> 注意修改用户名!
|
||||||
|
|
||||||
@@ -131,8 +119,6 @@ systemctl --user start aria2.service
|
|||||||
```bash
|
```bash
|
||||||
systemctl --user status aria2.service
|
systemctl --user status aria2.service
|
||||||
```
|
```
|
||||||
现在可以到本文的末尾安装浏览器插件并连接使用。
|
|
||||||
|
|
||||||
### Nixos
|
### Nixos
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
@@ -165,7 +151,6 @@ systemctl --user status aria2.service
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
现在可以到本文的末尾安装浏览器插件并连接使用。
|
|
||||||
|
|
||||||
## 命令行用法
|
## 命令行用法
|
||||||
|
|
||||||
|
|||||||
255
content/Network-cdn.md
Normal file
255
content/Network-cdn.md
Normal file
@@ -0,0 +1,255 @@
|
|||||||
|
+++
|
||||||
|
title = "网络艺术:CDN技术与应用"
|
||||||
|
date = 2024-02-16
|
||||||
|
|
||||||
|
[taxonomies]
|
||||||
|
tags = ["Network"]
|
||||||
|
+++
|
||||||
|
|
||||||
|
前言 内容分发网络(CDN)是一组分布在不同地理位置的服务器网络,使用户能够就近获取内容,从而降低延迟并缓解源站压力.
|
||||||
|
|
||||||
|
<!-- more -->
|
||||||
|
|
||||||
|
## 什么是CDN?
|
||||||
|
|
||||||
|
内容分发网络(CDN)是一组分布在不同地理位置的服务器网络,旨在将网站或应用的静态资源(如HTML、图片、视频等)缓存到距离用户更近的节点,以缩短传输路径、降低带宽成本并提高访问速度.CDN通过“缓存”机制,在全球多个数据中心临时存储内容副本,用户发起请求时无需回源到主服务器,就能从最近的缓存节点获取数据,从而显著改善页面加载时间和整体用户体验.相比传统的单点源站访问,CDN在用户和源站之间增加了分层缓存,通过负载均衡技术和智能路由,将访问请求定向到最优节点,既减轻了源站压力,又提升了网络抗拥塞能力和可用性.
|
||||||
|
|
||||||
|
在现代互联网中,内容分发网络(CDN)和域名系统(DNS)相互配合,共同提升了网页和多媒体内容的访问速度与可靠性.CDN通过在全球分布的缓存节点上存储静态资源,使用户能够就近获取内容,从而降低延迟并缓解源站压力.而DNS则负责将用户的域名请求导向适当的CDN节点,通过CNAME重定向、全局负载均衡(GSLB)、Anycast及EDNS扩展等技术,实现智能化的流量调度和最优路径选择.
|
||||||
|
|
||||||
|
**CDN的核心功能与优势**
|
||||||
|
|
||||||
|
- 加速访问:将内容存储于距离用户更近的节点,减少传输延迟,常见于视频点播、大文件下载等场景.
|
||||||
|
|
||||||
|
- 减轻源站压力:缓存请求可直接由CDN节点响应,降低源站带宽和计算资源消耗,有助于应对突发流量和DDoS攻击.
|
||||||
|
|
||||||
|
- 高可用与弹性扩展:全球分布的节点架构,使内容分发具备冗余能力,单点故障不会影响整体服务,且可动态扩容以应对业务增长.
|
||||||
|
|
||||||
|
## CDN与DNS的结合方式
|
||||||
|
|
||||||
|
1. **通过CNAME实现权威DNS指向CDN**
|
||||||
|
|
||||||
|
当用户在浏览器中输入域名发起请求时,首先触发本地DNS解析过程;如果该域名已开通CDN服务,其DNS解析记录通常配置为一条CNAME(别名)记录,指向CDN运营商提供的专用域名;本地DNS服务器再将解析权交给CDN的权威DNS服务器,从而实现对CDN网络的接入.
|
||||||
|
|
||||||
|
|
||||||
|
CDN的权威DNS服务器根据用户请求的域名,返回一个“全局负载均衡设备”的IP地址,该IP并非最终缓存节点,而是GSLB层用于智能调度的入口地址;浏览器接收到该IP后,向GSLB层发起实际内容请求.
|
||||||
|
|
||||||
|
2. **全局负载均衡(GSLB)与智能DNS**
|
||||||
|
|
||||||
|
GSLB(Global Server Load Balancing)是CDN架构中最核心的部分,负责根据多种因素(用户IP地理位置、节点健康状态、节点负载情况等)动态选择最优区域负载均衡节点或缓存服务器,向用户提供最低延迟和最佳性能的服务.
|
||||||
|
|
||||||
|
这一过程通常也基于DNS解析完成:当GSLB层接到DNS查询请求时,智能DNS服务器会返回针对该用户最优的缓存节点IP,从而实现“DNS级”的流量调度和负载均衡.
|
||||||
|
|
||||||
|
3. **Anycast与EDNS扩展**
|
||||||
|
|
||||||
|
Anycast路由:部分CDN运营商在全球部署相同IP的多个节点,利用BGP Anycast技术使得用户请求自动路由到网络拓扑上“最近”的节点,增强访问的网络路径效率与容灾能力.
|
||||||
|
|
||||||
|
EDNS Client Subnet(EDNS-CS):传统DNS仅看到发起查询的递归DNS服务器IP,难以准确判断终端用户位置;EDNS-CS协议在DNS请求中携带部分客户端IP前缀,使权威DNS能更细粒度地进行地理定位与节点选取,大幅提升了基于DNS的智能调度精度.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 为什么加了CDN之后网站的自签名证书也被信任了?
|
||||||
|
|
||||||
|
> 在启用 CDN 后,终端用户看到的并不是您在源站(origin)上配置的自签名证书,而是 CDN 边缘节点(edge)所出示的、由受信任 CA 签发的“边缘证书”.也就是说,浏览器与 CDN 边缘之间的 TLS 握手完全独立于您源站和自签名证书的存在,源站的自签名证书仅用于 CDN 与源站之间的“后端”加密连接,不会暴露给最终用户浏览器.
|
||||||
|
|
||||||
|
|
||||||
|
**CDN 模式下的 TLS 终止**
|
||||||
|
|
||||||
|
- **DNS/CNAME 指向**
|
||||||
|
当您为域名启用 CDN 后,通常会在 DNS 中将该域名的 CNAME 记录指向 CDN 运营商提供的专用域名,本地递归 DNS 随后会将解析权交给 CDN 供应商的权威 DNS,实现请求切入 CDN 网络.
|
||||||
|
|
||||||
|
- **边缘节点出示证书**
|
||||||
|
用户发起 HTTPS 请求时,浏览器直接与就近的 CDN 边缘节点建立 TLS 连接,边缘节点会出示由受信任 CA(如 Let's Encrypt、DigiCert 等)签发的“边缘证书”,而非您源站的自签名证书.
|
||||||
|
|
||||||
|
- **源站连接加密**
|
||||||
|
在边缘节点接收并缓存用户流量后,CDN 再以 HTTPS(或 HTTP,根据配置)向源站发起请求.此时,您可以在源站使用自签名证书(或 Cloudflare Origin CA 自签名证书),仅保证 CDN 与源站之间的加密传输,且该证书对终端用户浏览器不可见.
|
||||||
|
|
||||||
|
### SSL/TLS 加密模式对自签名证书的影响
|
||||||
|
|
||||||
|
以 Cloudflare 为例,常见的四种 SSL/TLS 模式对自签名证书的处理策略如下:
|
||||||
|
|
||||||
|
- **Flexible**:浏览器 ↔ CDN 边缘 使用 HTTPS;CDN 边缘 ↔ 源站 使用 HTTP,不接触证书验证.
|
||||||
|
|
||||||
|
- **Full**:浏览器 ↔ CDN 边缘 使用 HTTPS;CDN 边缘 ↔ 源站 使用 HTTPS,但不验证源站证书的 CA 链和域名匹配,可使用自签名证书.
|
||||||
|
Cloudflare Docs
|
||||||
|
|
||||||
|
- **Full (strict)**:浏览器 ↔ CDN 边缘 使用 HTTPS;CDN 边缘 ↔ 源站 使用 HTTPS,严格验证源站证书是否由受信任 CA 签发且域名匹配,不支持自签名证书.
|
||||||
|
Cloudflare Docs
|
||||||
|
|
||||||
|
- **Off**:关闭 HTTPS,加密支持完全关闭.
|
||||||
|
|
||||||
|
若您选择 Full 或 Flexible 模式,即使源站使用自签名证书,CDN 也不会在边缘层对其进行验证,仍会正常转发和缓存内容;而用户浏览器只会看到 CDN 边缘提供的受信任证书,因此不会出现“不受信任”警告.
|
||||||
|
|
||||||
|
> 为什么浏览器会信任? 浏览器内置了受信任的根证书列表,CDN 边缘出示的证书链会完整地链接到某个系统信任根,而您的自签名证书则不在此列表内,因而只有源站连接可被 CDN 信任,而非终端浏览器.CDN 则作为“可信中间人”,它信任自签名证书以加密与源站的通信,而浏览器仅信任 CDN 边缘的 CA 签发证书,二者互不干扰,有效隔离了自签名的风险.
|
||||||
|
|
||||||
|
|
||||||
|
### 如何开启Full (Strict)模式?
|
||||||
|
|
||||||
|
|
||||||
|
要在 Cloudflare 上启用 Full (Strict) 模式,以确保 CDN 与源站之间的通信既加密又验证证书的有效性,请按照以下步骤操作:
|
||||||
|
|
||||||
|
✅ 步骤 1:确保源站配置了有效的 SSL/TLS 证书
|
||||||
|
|
||||||
|
在启用 Full (Strict) 模式之前,您的源站必须安装一个有效且受信任的 SSL/TLS 证书.您可以选择以下方式之一:
|
||||||
|
|
||||||
|
使用公共 CA 颁发的证书:如 Let's Encrypt、DigiCert、GlobalSign 等.
|
||||||
|
|
||||||
|
使用 Cloudflare Origin CA 证书:这是 Cloudflare 提供的免费证书,专为与其边缘节点通信设计.
|
||||||
|
|
||||||
|
确保证书未过期,且域名匹配正确.如果使用 Cloudflare Origin CA 证书,请在源站服务器上正确安装,并配置服务器(如 Nginx、Apache)以使用该证书.
|
||||||
|
|
||||||
|
✅ 步骤 2:在 Cloudflare 仪表板中启用 Full (Strict) 模式
|
||||||
|
```
|
||||||
|
登录到您的 Cloudflare 仪表板.
|
||||||
|
|
||||||
|
选择您要配置的站点.
|
||||||
|
|
||||||
|
在左侧菜单中,点击 “SSL/TLS”.
|
||||||
|
|
||||||
|
在 “概览(Overview)” 标签下,找到 “SSL/TLS 加密模式(SSL/TLS encryption mode)”.
|
||||||
|
|
||||||
|
选择 “Full (Strict)” 模式.
|
||||||
|
```
|
||||||
|
|
||||||
|
更改后,Cloudflare 会立即应用此设置.建议等待几分钟,然后通过浏览器访问您的网站,确保一切正常运行.
|
||||||
|
|
||||||
|
🔗 注意事项
|
||||||
|
|
||||||
|
如果源站使用的是自签名证书或过期的证书,启用 Full (Strict) 模式后,Cloudflare 将无法建立连接,用户可能会看到 526 错误.
|
||||||
|
|
||||||
|
确保源站服务器的时间设置正确,以避免因时间不一致导致的证书验证失败.
|
||||||
|
|
||||||
|
## DNSSEC是什么?
|
||||||
|
|
||||||
|
DNSSEC(Domain Name System Security Extensions,域名系统安全扩展)是一组为 DNS 协议设计的安全机制,旨在通过数字签名验证 DNS 数据的真实性和完整性,防止域名解析过程中的数据篡改和伪造.
|
||||||
|
|
||||||
|
1. DNSSEC 的工作原理
|
||||||
|
|
||||||
|
DNSSEC 通过引入以下关键机制来增强 DNS 的安全性:
|
||||||
|
|
||||||
|
- 数字签名(RRSIG 记录):每个 DNS 记录集(如 A、MX、CNAME 等)都会生成一个对应的数字签名,确保记录在传输过程中未被篡改.
|
||||||
|
|
||||||
|
- 公钥发布(DNSKEY 记录):用于存储验证数字签名所需的公钥.这些公钥本身也通过上级域的签名进行验证,形成信任链.
|
||||||
|
|
||||||
|
- 委派签名者(DS 记录):上级域使用 DS 记录存储下级域的 DNSKEY 记录的摘要,确保公钥的真实性.
|
||||||
|
|
||||||
|
- 不存在性证明(NSEC/NSEC3 记录):用于明确指示某个 DNS 记录不存在,防止攻击者伪造不存在的记录.
|
||||||
|
|
||||||
|
通过这些机制,DNSSEC 建立了一条从根域开始的信任链,逐级验证每个域的 DNS 数据,确保其未被篡改且来源可信.
|
||||||
|
|
||||||
|
2. DNSSEC 的局限性
|
||||||
|
|
||||||
|
- 不加密数据内容:DNSSEC 仅对 DNS 数据进行签名验证,并不加密查询和响应内容,因此无法防止数据被监听.
|
||||||
|
|
||||||
|
- 部署复杂性:实施 DNSSEC 需要域名注册商、DNS 服务提供商和客户端解析器的共同支持,部署和维护相对复杂.
|
||||||
|
|
||||||
|
- 性能影响:由于引入了额外的签名验证过程,DNSSEC 可能会增加 DNS 查询的响应时间和系统资源消耗.
|
||||||
|
|
||||||
|
3. DNSSEC 的优势
|
||||||
|
|
||||||
|
- 防止 DNS 欺骗和缓存投毒:通过验证 DNS 数据的真实性,DNSSEC 能有效防止攻击者伪造 DNS 响应,将用户引导至恶意网站.
|
||||||
|
|
||||||
|
- 增强互联网基础设施安全性:作为互联网信任体系的一部分,DNSSEC 为其他安全协议(如 DANE)提供基础支持.
|
||||||
|
|
||||||
|
## CDN的位置选择
|
||||||
|
|
||||||
|
Netlify在考虑到CDN成本以及可用性的情况下选择了以下这些地区以保证全球大部分访客访问他们的服务都能有不错的连接性和访问速度。
|
||||||
|
|
||||||
|
```
|
||||||
|
欧洲中部(德国法兰克福)
|
||||||
|
南美(巴西圣保罗)
|
||||||
|
美东(美国弗吉尼亚)
|
||||||
|
美西(美国旧金山)
|
||||||
|
亚洲(新加坡)
|
||||||
|
大洋洲(澳大利亚悉尼)
|
||||||
|
```
|
||||||
|
那么Netlify为什么会选择把CDN节点放到这些地区呢?
|
||||||
|
|
||||||
|
1.弗吉尼亚,美东的弗吉尼亚被誉为“全球数据中心之都",美国政府对这个地区的网络投入非常大,使得弗吉尼亚的全球互联(美国本土、欧洲以及到南美洲)优秀。
|
||||||
|
|
||||||
|
2.旧金山,面向亚太和美西的访客。需要注意的是美西对亚太的网络连接比较优秀,但是到南美不太理想,甚至还有丢包的情况。
|
||||||
|
|
||||||
|
3.法兰克福,面向欧洲用户,德国法兰克福或者荷兰阿姆斯特丹都是不错的选择。
|
||||||
|
|
||||||
|
4.新加坡,亚太地区数据中心的枢纽,到印度、日本、越南、香港、中国移动的联通性都不错。
|
||||||
|
|
||||||
|
5.悉尼,土澳出了名的国际互联不太好,悉尼节点主要是服务本地和周边。
|
||||||
|
|
||||||
|
6.圣保罗,南美市场。
|
||||||
|
|
||||||
|
|
||||||
|
## 常见CDN的IP列表
|
||||||
|
|
||||||
|
> 需要注意的是有些CDN的回源IP并不用作节点IP,比如Cloudflare的回源IP仅作回源IP使用,如果要获取Cloudflare的节点IP,可前往https://bgp.tools/as/13335#prefixes。而有些CDN的回源IP同时被用作CDN节点,比如BunnyCDN和Gcore CDN。
|
||||||
|
|
||||||
|
Cloudflare
|
||||||
|
```bash
|
||||||
|
# https://www.cloudflare.com/ips-v4
|
||||||
|
103.21.244.0/22
|
||||||
|
103.22.200.0/22
|
||||||
|
103.31.4.0/22
|
||||||
|
104.16.0.0/13
|
||||||
|
104.24.0.0/14
|
||||||
|
108.162.192.0/18
|
||||||
|
131.0.72.0/22
|
||||||
|
141.101.64.0/18
|
||||||
|
162.158.0.0/15
|
||||||
|
172.64.0.0/13
|
||||||
|
173.245.48.0/20
|
||||||
|
188.114.96.0/20
|
||||||
|
190.93.240.0/20
|
||||||
|
197.234.240.0/22
|
||||||
|
198.41.128.0/17
|
||||||
|
|
||||||
|
# https://www.cloudflare.com/ips-v6
|
||||||
|
2400:cb00::/32
|
||||||
|
2405:8100::/32
|
||||||
|
2405:b500::/32
|
||||||
|
2606:4700::/32
|
||||||
|
2803:f800::/32
|
||||||
|
2a06:98c0::/29
|
||||||
|
2c0f:f248::/32
|
||||||
|
```
|
||||||
|
Gcore
|
||||||
|
```bash
|
||||||
|
https://api.gcore.com/cdn/public-ip-list
|
||||||
|
```
|
||||||
|
BunnyCDN
|
||||||
|
```bash
|
||||||
|
https://api.bunny.net/system/edgeserverlist
|
||||||
|
https://api.bunny.net/system/edgeserverlist/plain
|
||||||
|
```
|
||||||
|
Cloudfront
|
||||||
|
```bash
|
||||||
|
https://d7uri8nf7uskq.cloudfront.net/tools/list-cloudfront-ips
|
||||||
|
https://files.imunify360.com/static/whitelist/v2/cloudfront-cdn.txt
|
||||||
|
```
|
||||||
|
CDN77
|
||||||
|
```bash
|
||||||
|
https://files.imunify360.com/static/whitelist/v2/cdn77.txt
|
||||||
|
```
|
||||||
|
Fastly
|
||||||
|
```bash
|
||||||
|
https://api.fastly.com/public-ip-list
|
||||||
|
```
|
||||||
|
Keycdn
|
||||||
|
```bash
|
||||||
|
https://www.keycdn.com/shield-prefixes.json
|
||||||
|
```
|
||||||
|
quic.cloud
|
||||||
|
```bash
|
||||||
|
https://quic.cloud/ips
|
||||||
|
```
|
||||||
|
Google CDN
|
||||||
|
```bash
|
||||||
|
https://files.imunify360.com/static/whitelist/v2/google-cdn.txt
|
||||||
|
```
|
||||||
|
CacheFly
|
||||||
|
```bash
|
||||||
|
https://cachefly.cachefly.net/ips/cdn.txt
|
||||||
|
```
|
||||||
|
Akaima
|
||||||
|
```bash
|
||||||
|
https://techdocs.akamai.com/origin-ip-acl/docs/update-your-origin-server
|
||||||
|
```
|
||||||
|
---
|
||||||
|
**Done.**
|
||||||
103
content/Network-ssl.md
Normal file
103
content/Network-ssl.md
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
+++
|
||||||
|
title = "网络艺术:SSL/TLS证书"
|
||||||
|
date = 2024-02-15
|
||||||
|
|
||||||
|
[taxonomies]
|
||||||
|
tags = ["Network"]
|
||||||
|
+++
|
||||||
|
|
||||||
|
前言 什么是SSL/TLS证书?它有什么作用?如何部署?
|
||||||
|
<!-- more -->
|
||||||
|
|
||||||
|
## 什么是SSL/TLS证书
|
||||||
|
|
||||||
|
SSL 的全称是 ``Secure Sockets Layer``(安全套接字层),而 TLS 的全称是 ``Transport Layer Security``(传输层安全协议)。最初由 Netscape 开发的 SSL 协议用于保护网络通信,但由于其存在的安全漏洞,后来被更新、更安全的 TLS 协议所取代。
|
||||||
|
|
||||||
|
如今,当我们谈论“SSL 证书”时,实际上指的是支持 TLS 协议的数字证书,``两者在功能上没有本质区别,只是在命名上沿用了历史传统``。该证书是由受信任的数字证书颁发机构 CA,在验证服务器身份后颁发,且具有服务器身份验证和数据传输加密功能。简单来说就是``HTTP+SSL/TLS证书=HTTPS.``
|
||||||
|
|
||||||
|
## SSL证书是如何工作的
|
||||||
|
|
||||||
|
- 当我们点击一个超链接(HTTP),浏览器帮我们跳转到新标签页;
|
||||||
|
- 通过DNS(Domain name system)查询找到该域名(地址栏中的如www.xxx.com之类的字符)对应的IP地址,可能是某个CDN的地址;
|
||||||
|
- 服务器上已经配置好certificate.crt(公钥)和private.key(私钥);
|
||||||
|
- CDN随后与真正的服务器建立连接,服务器上的反向代理(可能是nginx或者caddy)检测连接,并用配置好的证书将连接升级为HTTPS;
|
||||||
|
- HTTPS握手并将内容显示在浏览器上。
|
||||||
|
|
||||||
|
## SSL/TLS证书的握手过程
|
||||||
|
|
||||||
|
- 客户端发送"ClientHello"消息,包含支持的加密算法和TLS版本;
|
||||||
|
- 服务器回应"ServerHello"消息,选择加密算法并发送SSL/TLS证书;
|
||||||
|
- 客户端验证证书的有效性(通过内置的CA根证书);
|
||||||
|
- 客户端使用服务器公钥加密一个"预主密钥"并发送给服务器;
|
||||||
|
- 双方根据预主密钥生成会话密钥;
|
||||||
|
- 使用会话密钥进行加密通信;
|
||||||
|
- 加密通信:握手完成后,所有数据传输都使用协商好的对称密钥加密。
|
||||||
|
|
||||||
|
> 使用公钥加密的数据只能用对应的私钥解密,使用私钥加密(签名)的数据可以用对应的公钥验证。
|
||||||
|
|
||||||
|
> 客户端和服务器都支持非常多的密码套件,比如“ECDHE-RSA-AES256-GCM-SHA384”。格式是“密钥交换算法 + 签名算法 + 对称加密算法 + 摘要算法”,这个密码套件的意思就是:“握手时使用 ECDHE 算法进行密钥交换,用 RSA 签名和身份认证,握手后的通信使用 AES 对称算法,密钥长度 256 位,分组模式是 GCM,摘要算法 SHA384 用于消息认证和产生随机数。”
|
||||||
|
|
||||||
|
## CA证书
|
||||||
|
|
||||||
|
可以看到,验证证书的有效性需要通过CA证书,由CA机构(如DigiCert
|
||||||
|
Let's Encrypt)等颁布,CA证书的层级结构如下:
|
||||||
|
|
||||||
|
- 根CA证书:最高级别的证书,自签名,是整个信任链的起点.
|
||||||
|
- 中间CA证书:由根CA签发,可以签发终端实体证书或其他中间CA证书.
|
||||||
|
- 终端实体证书:由根CA或中间CA签发给网站、服务器等实体使用.
|
||||||
|
|
||||||
|
操作系统和浏览器``内置了受信任的根CA证书列表``,当验证网站证书时,系统会沿着证书链向上追溯至根CA;如果能找到一个受信任的根CA,且证书链上所有签名有效,则验证通过.这就是保护我们上网安全的``信任链``的基础。
|
||||||
|
|
||||||
|
当我们访问网页时,往往会看到左上角的``锁``图标,里面是``Google Trust Services``或者``DigiCert Inc``等等,代表证书的颁发来源。如果锁提示不安全,可能是证书过期或者找不到CA证书,即有可能是自签名证书。``什么是自签名证书?``
|
||||||
|
|
||||||
|
## 证书颁发
|
||||||
|
|
||||||
|
我们先来看证书颁发的流程。
|
||||||
|
- 证书申请:网站所有者向证书颁发机构(CA)申请SSL/TLS证书,提供域名和组织信息。
|
||||||
|
- 身份验证:CA验证申请者的身份和域名所有权。验证方式包括域名验证(DV)、组织验证(OV)或扩展验证(EV)。
|
||||||
|
- 证书签发:验证通过后,CA使用其私钥为申请者签发数字证书,包含公钥、域名信息、颁发者信息和有效期等。
|
||||||
|
- 安装部署:网站管理员将证书安装到Web服务器上。
|
||||||
|
|
||||||
|
可以看到过程有点麻烦,个人建站的话往往使用自签名证书,即``ssh-keygen``生成的公钥和私钥,由于没有CA所以会显示不安全。
|
||||||
|
|
||||||
|
## 申请证书
|
||||||
|
|
||||||
|
- [sslforfree](https://www.sslforfree.com/)由 ZeroSSL 支持颁发的免费SSL证书.
|
||||||
|
|
||||||
|
- 通过[AMH](https://amh.sh/ssl.htm)提供的自助在线申请服务申请SSL通配符证书.需要注册AMH账号.
|
||||||
|
|
||||||
|
- [letsencrypt](https://letsencrypt.osfipin.com/),支持申请多渠道SSL证书.
|
||||||
|
|
||||||
|
- 借助[Punchsalad](https://punchsalad.com/ssl-certificate-generator/)提供的在线服务申请SSL证书,无需登录,仅需邮箱即可完成SSL通配符证书申请和签发.
|
||||||
|
|
||||||
|
## DV/OV/EV SSL证书的区别
|
||||||
|
|
||||||
|
以下是三种主要SSL证书验证类型的对比:
|
||||||
|
|
||||||
|
| 特性 | 域名型SSL (DV SSL) | 企业型SSL (OV SSL) | 增强型SSL (EV SSL) |
|
||||||
|
|------|-------------------|-------------------|-------------------|
|
||||||
|
| **验证级别** | 最低 | 中等 | 最高 |
|
||||||
|
| **验证内容** | 仅验证域名所有权 | 验证域名所有权和组织信息 | 最严格的验证,包括法律、物理和运营存在的全面验证 |
|
||||||
|
| **验证流程** | 自动化验证(邮件、DNS记录等) | 半自动验证 | 人工审核为主 |
|
||||||
|
| **签发时间** | 几分钟到数小时 | 1-3个工作日 | 5-7个工作日 |
|
||||||
|
| **浏览器显示** | 普通锁图标 | 普通锁图标 | 地址栏绿色显示(部分浏览器已取消) |
|
||||||
|
| **适用场景** | 个人博客、信息网站 | 企业网站、电子商务 | 银行、金融机构、大型电商 |
|
||||||
|
| **成本** | 低 | 中等 | 高 |
|
||||||
|
| **信任度** | 基本 | 中等 | 最高 |
|
||||||
|
| **证书信息** | 只包含域名信息 | 包含组织名称和域名 | 包含完整的组织详细信息 |
|
||||||
|
| **安全加密强度** | 相同 | 相同 | 相同 |
|
||||||
|
|
||||||
|
## 证书类型
|
||||||
|
|
||||||
|
有时候可以购买如``*.xxx.com``的通配符证书,即一个证书通用与所有子域名。以及还有其他如多域名证书和上面提到的DV/OV/EV证书的类型。
|
||||||
|
|
||||||
|
| 证书类型 | 覆盖范围 | 安全级别 | 验证过程 | 适用场景 | 价格范围 |
|
||||||
|
|---------|---------|---------|---------|---------|---------|
|
||||||
|
| 单域名证书 | 仅一个特定域名 | 基本到高 | DV/OV/EV | 个人网站或小型企业 | 低到高 |
|
||||||
|
| 通配符证书 | 主域名及其所有一级子域名 | 基本到中等 | DV/OV | 拥有多个子域名的网站 | 中等到高 |
|
||||||
|
| 多域名证书(SAN) | 多个不同域名 | 基本到高 | DV/OV/EV | 管理多个不相关域名的企业 | 中等到高 |
|
||||||
|
| 自签名证书 | 任意 | 低 | 无需验证 | 测试环境、内部网络 | 免费 |
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
**Done.**
|
||||||
@@ -1,112 +0,0 @@
|
|||||||
+++
|
|
||||||
title = "网络艺术:Syncthing 使用指南"
|
|
||||||
date = 2025-04-17
|
|
||||||
|
|
||||||
[taxonomies]
|
|
||||||
tags = ["Network"]
|
|
||||||
+++
|
|
||||||
|
|
||||||
前言 在多设备使用的时代,我们常常需要在电脑、服务器、笔记本之间同步文件。常见方案包括网盘、WebDAV、rsync 等,但这些方案要么依赖中心服务器、要么配置复杂、要么对实时性不友好。
|
|
||||||
|
|
||||||
<!-- more -->
|
|
||||||
|
|
||||||
## 介绍
|
|
||||||
|
|
||||||
**Syncthing** 是一款开源、去中心化、点对点(P2P)的文件同步工具,主打 **安全、私有、实时同步**。与传统网盘不同,Syncthing 不依赖任何中心服务器,所有数据直接在你的设备之间传输。
|
|
||||||
|
|
||||||
Syncthing 具有以下特点:
|
|
||||||
|
|
||||||
- ``去中心化``:设备之间点对点同步,不依赖第三方服务器;
|
|
||||||
- ``安全``:所有通信均使用 TLS 加密,并基于设备 ID 认证;
|
|
||||||
- ``跨平台``:支持 Windows、Linux、macOS、Android 等;
|
|
||||||
- ``实时同步``:文件变化可实时同步到其他设备;
|
|
||||||
- ``Web 管理界面``:通过浏览器即可完成绝大多数配置;
|
|
||||||
- ``开源``:代码完全开源,社区活跃。
|
|
||||||
|
|
||||||
## Windows
|
|
||||||
|
|
||||||
Windows 下推荐直接使用[SyncthingWindowsSetup](https://github.com/Bill-Stewart/SyncthingWindowsSetup)安装,会自动下载最新的syncthing二进制并设置系统服务。
|
|
||||||
|
|
||||||
- Web UI 默认地址:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
http://127.0.0.1:8384
|
|
||||||
```
|
|
||||||
|
|
||||||
## Arch Linux
|
|
||||||
|
|
||||||
- 使用paru包管理器安装:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
paru -S syncthing
|
|
||||||
```
|
|
||||||
|
|
||||||
- 创建 systemd 用户服务
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo systemctl enable --now syncthing@<你的用户名>.service
|
|
||||||
```
|
|
||||||
|
|
||||||
- 查看状态:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
systemctl --user status syncthing.service
|
|
||||||
```
|
|
||||||
|
|
||||||
- Web UI 默认地址:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
http://127.0.0.1:8384
|
|
||||||
```
|
|
||||||
|
|
||||||
## NixOS
|
|
||||||
|
|
||||||
NixOS 自带 Syncthing 模块,配置非常优雅。
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{ lib, pkgs, username, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
services.syncthing = {
|
|
||||||
enable = true;
|
|
||||||
user = username;
|
|
||||||
dataDir = "/home/${username}/Sync";
|
|
||||||
configDir = "/home/${username}/.config/syncthing";
|
|
||||||
guiAddress = "127.0.0.1:8384";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
- 服务状态查看:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
systemctl status syncthing.service
|
|
||||||
```
|
|
||||||
|
|
||||||
## 基本使用
|
|
||||||
|
|
||||||
Syncthing 的所有核心操作都可以通过 Web UI 完成,进入 Web UI 后先设置用户名和密码:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
http://127.0.0.1:8384
|
|
||||||
```
|
|
||||||
|
|
||||||
### 添加设备
|
|
||||||
|
|
||||||
- 在本机和另一台设备上启动 Syncthing;
|
|
||||||
- 分别设置同步文件夹,注意ID要相同;
|
|
||||||
- 复制对方的 **设备 ID**;
|
|
||||||
- 在 Web UI 中点击「添加远程设备」;
|
|
||||||
- 双方确认后即可开始同步。
|
|
||||||
|
|
||||||
### 文件夹同步模式
|
|
||||||
|
|
||||||
Syncthing 支持多种同步模式:
|
|
||||||
|
|
||||||
* **Send & Receive**:双向同步(默认)
|
|
||||||
* **Send Only**:只向外同步
|
|
||||||
* **Receive Only**:只接收更改
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Done.**
|
|
||||||
78
content/about-accurate-pronunciation.md
Normal file
78
content/about-accurate-pronunciation.md
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
+++
|
||||||
|
title = "乱七八糟:常见发音错误术语集合"
|
||||||
|
date = 2023-08-25
|
||||||
|
|
||||||
|
[taxonomies]
|
||||||
|
tags = ["乱七八糟"]
|
||||||
|
+++
|
||||||
|
|
||||||
|
前言 中文和英语发音习惯不同,容易引起误解。本文旨在帮助您准确发音常见的科技术语,欢迎随时补充。
|
||||||
|
|
||||||
|
<!-- more -->
|
||||||
|
|
||||||
|
**常见发音错误指南:公司/产品名**
|
||||||
|
|
||||||
|
- Youtube: 正确念法是 "You-tube" [tju:b],而不是 "优吐毙",应该是 "优tiu啵"。
|
||||||
|
|
||||||
|
- Skype: 应该念为 [ˈskaɪp],而不是 "死盖屁",应该是 "死盖破"。
|
||||||
|
|
||||||
|
- Adobe: 正确的发音是 [əˈdəʊbi],不是 "阿斗伯",而是 "阿兜笔"。
|
||||||
|
|
||||||
|
- C#: 应该念为 "C Sharp",即"C煞破"。
|
||||||
|
|
||||||
|
- GNU: 正确的发音是 [(g)nuː], 即"哥怒"。
|
||||||
|
|
||||||
|
- GUI: 应该念为 [ˈɡui],即"故意"。
|
||||||
|
|
||||||
|
- JAVA: 正确的发音是 [ˈdʒɑːvə],而不是 "夹蛙",应该是 "扎蛙"。
|
||||||
|
|
||||||
|
- AJAX: 应该念为 [ˈeɪdʒæks],而不是 "阿贾克斯",应该是 "诶(ei) 贾克斯"。
|
||||||
|
|
||||||
|
- Ubuntu: 正确的发音是 [uˈbuntuː],而不是 "友邦兔",应该是 "巫不恩兔"。
|
||||||
|
|
||||||
|
- Debian: 应该念为 [ˈdɛbiən],即"得(dei)变"。
|
||||||
|
|
||||||
|
- Linux: 正确的发音有两种,[ˈlɪnəks] 或 [ˈlɪnʊks],"丽娜克斯" 或 "李扭克斯"都可以。
|
||||||
|
|
||||||
|
- LaTeX: 正确的发音是 [ˈleɪtɛk] 或 [ˈleɪtɛx] 或 [ˈlɑːtɛx] 或 [ˈlɑːtɛk],即"雷泰克" 或 "拉泰克"。
|
||||||
|
|
||||||
|
- GNOME: 念法可以是 [ɡˈnoʊm] 或 [noʊm],即"格弄姆" 或 "弄姆"。
|
||||||
|
|
||||||
|
- App: 应该念为 [ˈæp],即 "阿破"。
|
||||||
|
|
||||||
|
- null: 正确的发音是 [nʌl],即"闹"。
|
||||||
|
|
||||||
|
- jpg: 应该念为 [ˈdʒeɪpɛɡ],而不是 "勾屁记",应该是 "zhei派个"。
|
||||||
|
|
||||||
|
- WiFi: 正确的发音是 [ˈwaɪfaɪ],即"歪fai"。
|
||||||
|
|
||||||
|
- mobile: 念法可以是 [moˈbil] 或 [ˈmoˌbil] 或 [ˈməubail],即"膜拜哦" 或 "牟bou"。
|
||||||
|
|
||||||
|
- integer: 正确的发音是 [ˈɪntɪdʒə],而不是 "阴太阁儿",应该是 "音剃摺儿"。
|
||||||
|
|
||||||
|
- cache: 应该念为 [kæʃ],而不是 "卡尺",即"喀什"。
|
||||||
|
|
||||||
|
- @: 应该念为 "at"。
|
||||||
|
|
||||||
|
- Tumblr: 应该念为 "Tumbler",而不是 "贪不勒"。
|
||||||
|
|
||||||
|
- nginx: 正确的发音是 "Engine X",应该是 "恩静 爱克斯"。
|
||||||
|
|
||||||
|
- Apache: 应该念为 [əˈpætʃiː],即"阿趴气"。
|
||||||
|
|
||||||
|
- Lucene: 正确的发音是 [ˈluːsin],即"鲁信"。
|
||||||
|
|
||||||
|
- MySQL: 应该念为 [maɪ ˌɛskjuːˈɛl] 或 [maɪ ˈsiːkwəl],可以是 "买S奎儿" 或 "买 吸扣"。
|
||||||
|
|
||||||
|
- Exposé: 念法可以是 [ɛksˈpəʊzeɪ],重音在Z上。
|
||||||
|
|
||||||
|
- RFID: 官方念法是四个字母分开读 "R F I D"。
|
||||||
|
|
||||||
|
- JSON: 应该念为 "jason",即"zhei森"。
|
||||||
|
|
||||||
|
- Processing: 重音在 "Pro" 上。
|
||||||
|
|
||||||
|
- avatar: 正确的发音是 [ˌævə'tɑr],即"艾瓦塌儿"。
|
||||||
|
|
||||||
|
## 后记
|
||||||
|
虽然许多的词汇常常被错误发音,但在中国遵守拼音原则是入乡随俗的一种表现,且往往并没有所谓的官方读法,不必太过于纠结100%纯正的读法。
|
||||||
@@ -146,60 +146,6 @@ git gc --aggressive --prune=now
|
|||||||
# 重新推送到github
|
# 重新推送到github
|
||||||
git push --force --mirror
|
git push --force --mirror
|
||||||
```
|
```
|
||||||
当然这样还是不够智能,因此现在的方法是写一个GitHub Actions:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
name: Blog CI (Zola)
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Install Zola
|
|
||||||
uses: taiki-e/install-action@v2
|
|
||||||
with:
|
|
||||||
tool: zola
|
|
||||||
|
|
||||||
- name: Install Pagefind
|
|
||||||
run: |
|
|
||||||
wget https://github.com/Pagefind/pagefind/releases/download/v1.4.0/pagefind-v1.4.0-x86_64-unknown-linux-musl.tar.gz
|
|
||||||
tar xvf pagefind-v1.4.0-x86_64-unknown-linux-musl.tar.gz
|
|
||||||
sudo mv pagefind /usr/local/bin/
|
|
||||||
|
|
||||||
- name: Build Zola
|
|
||||||
run: zola build
|
|
||||||
|
|
||||||
- name: Build Pagefind
|
|
||||||
run: pagefind --site public --root-selector body
|
|
||||||
|
|
||||||
- name: Push public to dist
|
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
|
||||||
with:
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
publish_dir: ./public
|
|
||||||
publish_branch: dist
|
|
||||||
force_orphan: true
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
这个action会自动在每次commit之后运行,下载zola并使用zola对仓库进行构建,随后构建出public文件夹在dist分支中,并且dist分支只保留一次commit,这样做的好处有:
|
|
||||||
|
|
||||||
- 自动云端构建,无须本地再安装zola;
|
|
||||||
- 构建Public在dist分支,git仓库大小不会膨胀;
|
|
||||||
- 灵活可修改,支持各种框架包括Hugo/Hexo等等.
|
|
||||||
|
|
||||||
> 注意需要在GitHub的仓库设置中的``Actions-General-Workflow permissions``中打开``Read and write permissions``,否则actions无法对仓库进行读写.
|
|
||||||
|
|
||||||
|
|
||||||
## 🔗
|
## 🔗
|
||||||
|
|||||||
@@ -50,16 +50,18 @@ Enter file in which to save the key (/home/dich/.ssh/id_rsa): /home/dich/.ssh/Gi
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# GitHub
|
# GitHub
|
||||||
Host github github.com
|
|
||||||
|
Host github
|
||||||
HostName github.com
|
HostName github.com
|
||||||
User git
|
User git
|
||||||
IdentityFile ~/.ssh/github
|
IdentityFile ~/.ssh/Github
|
||||||
|
|
||||||
# Gitee
|
# Gitee
|
||||||
Host gitee gitee.com
|
|
||||||
|
Host gitee
|
||||||
HostName gitee.com
|
HostName gitee.com
|
||||||
User git
|
User git
|
||||||
IdentityFile ~/.ssh/gitee
|
IdentityFile ~/.ssh/Gitee
|
||||||
```
|
```
|
||||||
|
|
||||||
> 这边的IdentityFile是你的私钥位置,即为不带pub后缀的文件。如果你不想将私钥放在~/.ssh/下,可以查看我的另一篇[博客](https://blog.dich.bid/network-ssh/)
|
> 这边的IdentityFile是你的私钥位置,即为不带pub后缀的文件。如果你不想将私钥放在~/.ssh/下,可以查看我的另一篇[博客](https://blog.dich.bid/network-ssh/)
|
||||||
|
|||||||
@@ -22,17 +22,6 @@ tags = ["乱七八糟"]
|
|||||||
- **cn 域名有被停用的风险**。2008 年,有人以跳水奥运冠军吴敏霞拼音注册了 wuminxia.cn,[结果被中国互联网络信息中心(CNNIC)回收了域名](https://www.cnbeta.com/articles/tech/62209.htm),并转交给国家体育总局。此域名在 2021 年 2 月 28 日被优视科技[注册](https://whois.cnnic.cn/WhoisServlet?queryType=Domain&domain=wuminxia.cn),呵呵。2009 年,牛博网被域名注册商万网停止解析。
|
- **cn 域名有被停用的风险**。2008 年,有人以跳水奥运冠军吴敏霞拼音注册了 wuminxia.cn,[结果被中国互联网络信息中心(CNNIC)回收了域名](https://www.cnbeta.com/articles/tech/62209.htm),并转交给国家体育总局。此域名在 2021 年 2 月 28 日被优视科技[注册](https://whois.cnnic.cn/WhoisServlet?queryType=Domain&domain=wuminxia.cn),呵呵。2009 年,牛博网被域名注册商万网停止解析。
|
||||||
|
|
||||||
## VPS
|
## VPS
|
||||||
|
|
||||||
|
|
||||||
- 名称格式
|
|
||||||
|
|
||||||
```
|
|
||||||
日本-GreenCloud-2C-4G-22G-SSD-1.5Tb@10Gbps-$60-3year
|
|
||||||
|
|
||||||
## 国家-公司-CPU-内存-硬盘-硬盘类型-流量@端口速度-价格-付费周期
|
|
||||||
```
|
|
||||||
|
|
||||||
- 初始化
|
|
||||||
```bash
|
```bash
|
||||||
# 更新系统
|
# 更新系统
|
||||||
apt update && apt upgrade -y
|
apt update && apt upgrade -y
|
||||||
|
|||||||
@@ -1,29 +1,95 @@
|
|||||||
+++
|
+++
|
||||||
title = "乱七八糟:VScode那些事"
|
title = "乱七八糟:常用实用快捷键"
|
||||||
date = 2024-05-23
|
date = 2024-05-23
|
||||||
|
|
||||||
[taxonomies]
|
[taxonomies]
|
||||||
tags = ["乱七八糟"]
|
tags = ["乱七八糟"]
|
||||||
+++
|
+++
|
||||||
|
|
||||||
前言 VScode 素有世界最强IDE之称,有着丰富的插件系统,优秀的图形界面和极快的响应速度,本文介绍VSCode的一些使用技巧。
|
前言 在日常使用浏览器时,掌握一些快捷键和技巧可以节省大量时间,提高工作和学习效率。通过学习和实践,能够更加轻松地应对各种网页浏览场景,让浏览器成为工作和学习的得力助手。
|
||||||
|
|
||||||
<!-- more -->
|
<!-- more -->
|
||||||
|
|
||||||
## AI 插件
|
## 浏览器快捷键
|
||||||
|
|
||||||
| 插件名 | 免费 | 付费 | 单模型 | 多模型 | 说明 |
|
### 常用
|
||||||
| ---------------------------------------------------------------------------------------- | :-----------: | :--------: | :-: | :-: | ------------------------------------------------------- |
|
|
||||||
| **[GitHub Copilot](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot)** | ✔️(试用 / 学生优惠) | ✔️ | ❌ | ✔️ | 主流 AI 编码助手,支持代码补全和聊天建议。([Visual Studio Marketplace][1]) |
|
| 快捷键 | 描述 |
|
||||||
| **[GPT (ChatGPT)](https://open-vsx.org/extension/openai/chatgpt)** | ✔️ | ✔️(API 模型) | ❌ | ✔️ | 基于 OpenAI 的 ChatGPT,可做代码解释/对话生成 |
|
|----------------------|------------------|
|
||||||
| **[Gemini Code Assist](https://open-vsx.org/extension/Google/geminicodeassist)** | ✔️ | ❌ | ❌ | ✔️ | Google Gemini 驱动的智能编码助手 |
|
| Ctrl + A | 全选 |
|
||||||
| **[Claude Code](https://open-vsx.org/extension/Anthropic/claude-code)** | ❓(账户权限) | ✔️ | ❌ | ✔️ | Anthropic Claude 驱动的编码助手 |
|
| Ctrl + C | 复制 |
|
||||||
| **[Cline (claude-dev)](https://open-vsx.org/extension/saoudrizwan/claude-dev)** | ✔️ | ❌ | ❌ | ✔️ | 社区版 Claude 型 AI 编码插件 |
|
| Ctrl + X | 剪切 |
|
||||||
| **[CodeGeeX](https://open-vsx.org/extension/AMiner/codegeex)** | ✔️ | ❌ | ❌ | ✔️ | 开源多模型 AI код助手 |
|
| Ctrl + V | 粘贴 |
|
||||||
| **[OpenCode](https://open-vsx.org/extension/sst-dev/opencode)** | ✔️ | ❌ | ❌ | ✔️ | 多模型聚合,可接多种后端 |
|
| Ctrl + F | 查找 |
|
||||||
| **[Windsurf (Codeium)](https://open-vsx.org/extension/Codeium/codeium)** | ✔️ | ❌ | ❌ | ✔️ | 轻量级 AI 代码补全助手(Codeium 改名) |
|
| Ctrl + Q | 退出 |
|
||||||
|
| Ctrl + T | 新建标签页 |
|
||||||
|
| Ctrl + W | 关闭标签页 |
|
||||||
|
| Ctrl + N | 新建窗口 |
|
||||||
|
| Ctrl + Shift + P | 新建隐私浏览窗口 |
|
||||||
|
|
||||||
|
### 历史
|
||||||
|
|
||||||
|
| 快捷键 | 描述 |
|
||||||
|
|-------------------------|----------------------------|
|
||||||
|
| Ctrl + H | 历史侧栏 |
|
||||||
|
| Ctrl + Shift + H | 我的足迹窗口(历史) |
|
||||||
|
| Ctrl + Shift + Del | 清除最近历史记录 |
|
||||||
|
|
||||||
|
### 书签
|
||||||
|
|
||||||
|
| 快捷键 | 描述 |
|
||||||
|
|-------------------------------|------------------------------------|
|
||||||
|
| Ctrl + D | 将此页加为书签 |
|
||||||
|
| Ctrl + I | 页面信息 |
|
||||||
|
| Ctrl + Shift + O | 显示全部书签(我的足迹窗口) |
|
||||||
|
| Ctrl + B / Ctrl + Shift + B | 书签侧栏 / 顶栏 |
|
||||||
|
|
||||||
|
### 下载与插件
|
||||||
|
|
||||||
|
| 快捷键 | 描述 |
|
||||||
|
|----------------------|----------------|
|
||||||
|
| Ctrl + Shift + Y | 下载 |
|
||||||
|
| Ctrl + Shift + A | 附加组件 / 插件 |
|
||||||
|
|
||||||
|
### 控制台与开发
|
||||||
|
|
||||||
|
| 快捷键 | 描述 |
|
||||||
|
|----------------------|------------------|
|
||||||
|
| Ctrl + Shift + K | Web 控制台 |
|
||||||
|
| Ctrl + Shift + C | 查看器 |
|
||||||
|
| Shift + F7 | 样式编辑器 |
|
||||||
|
| Shift + F5 | 分析器 |
|
||||||
|
| Ctrl + Shift + E | 网络 |
|
||||||
|
| Ctrl + U | 页面源码 |
|
||||||
|
| Ctrl + Shift + J | 浏览器控制台 |
|
||||||
|
|
||||||
|
### 标签页与界面
|
||||||
|
|
||||||
|
| 快捷键 | 描述 |
|
||||||
|
|-------------------------------|--------------------------|
|
||||||
|
| Ctrl + S | 界面保存 |
|
||||||
|
| Ctrl + + | 放大 |
|
||||||
|
| Ctrl + - | 缩小 |
|
||||||
|
| Ctrl + 0 | 重置缩放 |
|
||||||
|
| Ctrl + K / J | 搜索 |
|
||||||
|
| Ctrl + Home / End | 到文件头 / 尾 |
|
||||||
|
| Ctrl + Page Up | 切换到左边标签页 |
|
||||||
|
| Ctrl + Page Down | 切换到右边标签页 |
|
||||||
|
| Ctrl + Shift + Page Up | 当前标签页左移 |
|
||||||
|
| Ctrl + Shift + Page Down | 当前标签页右移 |
|
||||||
|
|
||||||
|
### 其他操作
|
||||||
|
|
||||||
|
| 快捷键 | 描述 |
|
||||||
|
|--------------------|------------------|
|
||||||
|
| Alt + Space | KDE 搜索栏 |
|
||||||
|
| Alt + → / ← | 前进 / 后退 |
|
||||||
|
| Alt + 数字键 | 选择标签页(1–8)|
|
||||||
|
| Alt + M | 静音 |
|
||||||
|
| End | 到达页尾 |
|
||||||
|
| Home | 到达页首 |
|
||||||
|
| F6 | 地址栏 |
|
||||||
|
|
||||||
[1]: https://marketplace.visualstudio.com/items?itemName=GitHub.copilot&utm_source=chatgpt.com "GitHub Copilot"
|
|
||||||
|
|
||||||
|
|
||||||
## VS Code 快捷键
|
## VS Code 快捷键
|
||||||
@@ -236,87 +302,5 @@ tags = ["乱七八糟"]
|
|||||||
- **函数提示**:
|
- **函数提示**:
|
||||||
- 在悬停窗口上按下 `cmd`:提示函数的实现
|
- 在悬停窗口上按下 `cmd`:提示函数的实现
|
||||||
|
|
||||||
|
|
||||||
## 浏览器快捷键
|
|
||||||
|
|
||||||
### 常用
|
|
||||||
|
|
||||||
| 快捷键 | 描述 |
|
|
||||||
|----------------------|------------------|
|
|
||||||
| Ctrl + A | 全选 |
|
|
||||||
| Ctrl + C | 复制 |
|
|
||||||
| Ctrl + X | 剪切 |
|
|
||||||
| Ctrl + V | 粘贴 |
|
|
||||||
| Ctrl + F | 查找 |
|
|
||||||
| Ctrl + Q | 退出 |
|
|
||||||
| Ctrl + T | 新建标签页 |
|
|
||||||
| Ctrl + W | 关闭标签页 |
|
|
||||||
| Ctrl + N | 新建窗口 |
|
|
||||||
| Ctrl + Shift + P | 新建隐私浏览窗口 |
|
|
||||||
|
|
||||||
### 历史
|
|
||||||
|
|
||||||
| 快捷键 | 描述 |
|
|
||||||
|-------------------------|----------------------------|
|
|
||||||
| Ctrl + H | 历史侧栏 |
|
|
||||||
| Ctrl + Shift + H | 我的足迹窗口(历史) |
|
|
||||||
| Ctrl + Shift + Del | 清除最近历史记录 |
|
|
||||||
|
|
||||||
### 书签
|
|
||||||
|
|
||||||
| 快捷键 | 描述 |
|
|
||||||
|-------------------------------|------------------------------------|
|
|
||||||
| Ctrl + D | 将此页加为书签 |
|
|
||||||
| Ctrl + I | 页面信息 |
|
|
||||||
| Ctrl + Shift + O | 显示全部书签(我的足迹窗口) |
|
|
||||||
| Ctrl + B / Ctrl + Shift + B | 书签侧栏 / 顶栏 |
|
|
||||||
|
|
||||||
### 下载与插件
|
|
||||||
|
|
||||||
| 快捷键 | 描述 |
|
|
||||||
|----------------------|----------------|
|
|
||||||
| Ctrl + Shift + Y | 下载 |
|
|
||||||
| Ctrl + Shift + A | 附加组件 / 插件 |
|
|
||||||
|
|
||||||
### 控制台与开发
|
|
||||||
|
|
||||||
| 快捷键 | 描述 |
|
|
||||||
|----------------------|------------------|
|
|
||||||
| Ctrl + Shift + K | Web 控制台 |
|
|
||||||
| Ctrl + Shift + C | 查看器 |
|
|
||||||
| Shift + F7 | 样式编辑器 |
|
|
||||||
| Shift + F5 | 分析器 |
|
|
||||||
| Ctrl + Shift + E | 网络 |
|
|
||||||
| Ctrl + U | 页面源码 |
|
|
||||||
| Ctrl + Shift + J | 浏览器控制台 |
|
|
||||||
|
|
||||||
### 标签页与界面
|
|
||||||
|
|
||||||
| 快捷键 | 描述 |
|
|
||||||
|-------------------------------|--------------------------|
|
|
||||||
| Ctrl + S | 界面保存 |
|
|
||||||
| Ctrl + + | 放大 |
|
|
||||||
| Ctrl + - | 缩小 |
|
|
||||||
| Ctrl + 0 | 重置缩放 |
|
|
||||||
| Ctrl + K / J | 搜索 |
|
|
||||||
| Ctrl + Home / End | 到文件头 / 尾 |
|
|
||||||
| Ctrl + Page Up | 切换到左边标签页 |
|
|
||||||
| Ctrl + Page Down | 切换到右边标签页 |
|
|
||||||
| Ctrl + Shift + Page Up | 当前标签页左移 |
|
|
||||||
| Ctrl + Shift + Page Down | 当前标签页右移 |
|
|
||||||
|
|
||||||
### 其他操作
|
|
||||||
|
|
||||||
| 快捷键 | 描述 |
|
|
||||||
|--------------------|------------------|
|
|
||||||
| Alt + Space | KDE 搜索栏 |
|
|
||||||
| Alt + → / ← | 前进 / 后退 |
|
|
||||||
| Alt + 数字键 | 选择标签页(1–8)|
|
|
||||||
| Alt + M | 静音 |
|
|
||||||
| End | 到达页尾 |
|
|
||||||
| Home | 到达页首 |
|
|
||||||
| F6 | 地址栏 |
|
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
**Done.**
|
**Done.**
|
||||||
@@ -29,40 +29,47 @@ tags = ["综合工程"]
|
|||||||
|
|
||||||
## 安装软件
|
## 安装软件
|
||||||
|
|
||||||
随后安装常用开源软件,KDE环境和Wayland+WM环境安装的包不同:
|
随后安装常用开源软件(KDE环境省略file和wayland)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# gui
|
# gui
|
||||||
paru -S floorp-bin keepassxc qemu-full virt-manager materialgram-bin legcord-bin onlyoffice-bin localsend-bin kazumi-bin foliate vlc krita qtscrcpy strawberry oculante obs-studio scx-manager
|
|
||||||
|
paru -S floorp-bin keepassxc qemu-full virt-manager materialgram-bin legcord-bin onlyoffice-bin localsend-bin kazumi-bin foliate vlc krita qtscrcpy strawberry oculante obs-studio scx-manager daed
|
||||||
|
|
||||||
# tui
|
# tui
|
||||||
|
|
||||||
paru -S neovim yazi lazygit btop zellij termshark
|
paru -S neovim yazi lazygit btop zellij termshark
|
||||||
|
|
||||||
# cli
|
# cli
|
||||||
paru -S alacritty fastfetch onefetch starship atuin bat fzf fd ripgrep eza tree android-tools payload-dumper-go-bin nexttrace-bin syncthing aria2
|
|
||||||
|
|
||||||
# fish
|
paru -S alacritty fish fastfetch tealdeer expac fish-autopair fish-pure-prompt fisher onefetch starship atuin bat fzf fd ripgrep eza tree android-tools payload-dumper-go-bin nexttrace-bin syncthing aria2
|
||||||
fish tealdeer expac fish-autopair fish-pure-prompt fisher
|
|
||||||
|
|
||||||
|
# file
|
||||||
|
|
||||||
|
paru -S gvfs gvfs-mtp gvfs-afc gvfs-nfs nemo
|
||||||
|
|
||||||
# zip
|
# zip
|
||||||
|
|
||||||
paru -S peazip
|
paru -S peazip
|
||||||
|
|
||||||
# Type
|
# Type
|
||||||
|
|
||||||
paru -S fcitx5-configtool fcitx5-skin-material fcitx5-rime fcitx5-gtk
|
paru -S fcitx5-configtool fcitx5-skin-material fcitx5-rime fcitx5-gtk
|
||||||
|
|
||||||
# ttf
|
# Blog
|
||||||
paru -S ttf-jetbrains-mono-nerd ttf-sarasa-gothic-sc
|
|
||||||
```
|
paru -S zola npm pnpm just go
|
||||||
|
|
||||||
|
# ttf
|
||||||
|
|
||||||
|
paru -S ttf-jetbrains-mono-nerd ttf-sarasa-gothic-sc
|
||||||
|
|
||||||
如果使用Wayland+WM方案,需要额外安装以下这些:
|
|
||||||
```bash
|
|
||||||
# Wayland
|
# Wayland
|
||||||
|
|
||||||
paru -S hyprland waybar network-manager-applet swww wl-gammarelay-rs brightnessctl easyeffects wireplumber pipewire blueman bluez-utils wl-clipboard-rs wl-clip-persist swaync swayosd swappy grim wlogout hyprlock hyprpolkitagent
|
paru -S hyprland waybar network-manager-applet swww wl-gammarelay-rs brightnessctl easyeffects wireplumber pipewire blueman bluez-utils wl-clipboard-rs wl-clip-persist swaync swayosd swappy grim wlogout hyprlock hyprpolkitagent
|
||||||
|
|
||||||
# file
|
|
||||||
paru -S gvfs gvfs-mtp gvfs-afc gvfs-nfs nemo
|
|
||||||
```
|
```
|
||||||
|
|
||||||
| 分类 | 软件列表 |
|
| 分类 | 软件列表 |
|
||||||
| ------------ | ------------------------------------------------ |
|
| ------------ | ------------------------------------------------ |
|
||||||
| **窗口管理器** | hyprland |
|
| **窗口管理器** | hyprland |
|
||||||
@@ -333,12 +340,12 @@ Description=Aria2c - lightweight multi-protocol & multi-source command-line down
|
|||||||
After=network.target
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
User=<username>
|
User=dich
|
||||||
Group=<groupname>
|
Group=dich
|
||||||
WorkingDirectory=/home/<username>
|
WorkingDirectory=/home/dich
|
||||||
Environment=HOME=/home/<username>
|
Environment=HOME=/home/dich
|
||||||
Environment=USER=<username>
|
Environment=USER=dich
|
||||||
ExecStart=/usr/bin/aria2c --conf-path=/home/<username>/.config/aria2/aria2.conf
|
ExecStart=/usr/bin/aria2c --conf-path=/home/dich/.config/aria2/aria2.conf
|
||||||
Restart=always
|
Restart=always
|
||||||
NoNewPrivileges=true
|
NoNewPrivileges=true
|
||||||
PrivateTmp=true
|
PrivateTmp=true
|
||||||
@@ -383,21 +390,24 @@ net.ipv4.tcp_congestion_control = bbr
|
|||||||
```
|
```
|
||||||
|
|
||||||
## 性能模式切换
|
## 性能模式切换
|
||||||
需要安装``tlp-git tlp-pd-git tlp-rdw-git``
|
需要安装``power-profiles-daemon``
|
||||||
```bash
|
```bash
|
||||||
# 查看当前状态
|
# 查看可用的电源配置文件(profiles)
|
||||||
tlp-stat -s
|
powerprofilesctl list
|
||||||
|
|
||||||
|
# 查看当前正在使用的 profile
|
||||||
|
powerprofilesctl get
|
||||||
|
|
||||||
# 切换到“性能”模式
|
# 切换到“性能”模式
|
||||||
sudo tlp performance
|
sudo powerprofilesctl set performance
|
||||||
|
|
||||||
# 切换到“平衡”模式
|
# 切换到“平衡”模式
|
||||||
sudo tlp balanced
|
sudo powerprofilesctl set balanced
|
||||||
|
|
||||||
# 切换到“省电”模式
|
# 切换到“省电”模式
|
||||||
sudo tlp power-saver
|
sudo powerprofilesctl set power-saver
|
||||||
```
|
```
|
||||||
## 其他可选性能优化
|
## 其他性能优化
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
Profile‑sync‑daemon
|
Profile‑sync‑daemon
|
||||||
|
|||||||
@@ -578,17 +578,6 @@ nft list table ip mangle
|
|||||||
- 关闭防火墙的禁止转发规则,全部允许;
|
- 关闭防火墙的禁止转发规则,全部允许;
|
||||||
- 将X86主路由的网线插到AP的任意一个LAN口。
|
- 将X86主路由的网线插到AP的任意一个LAN口。
|
||||||
|
|
||||||
## 更新所有包
|
|
||||||
|
|
||||||
```
|
|
||||||
opkg update
|
|
||||||
|
|
||||||
opkg list-upgradable \
|
|
||||||
| awk '{print $1}' \
|
|
||||||
| grep -vE '^(base-files|busybox|libc|libgcc|libstdc\+\+|procd|netifd|ubus|uci|kernel|kmod-|fstools|mtd|fwtool)$' \
|
|
||||||
| xargs -r opkg upgrade
|
|
||||||
```
|
|
||||||
|
|
||||||
## 🔗
|
## 🔗
|
||||||
|
|
||||||
- [Openwrt wiki](https://openwrt.org/zh/docs/start)
|
- [Openwrt wiki](https://openwrt.org/zh/docs/start)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
+++
|
+++
|
||||||
title = "Windows系列(0):系统安装与设置"
|
title = "Windows系列(1):系统安装与设置"
|
||||||
date = 2024-05-24
|
date = 2024-05-24
|
||||||
|
|
||||||
[taxonomies]
|
[taxonomies]
|
||||||
@@ -12,7 +12,7 @@ tags = ["Windows"]
|
|||||||
|
|
||||||
## 总纲
|
## 总纲
|
||||||
|
|
||||||
安装Windows有两种情况:1.在一台全新的电脑上安装;2.想为现有的系统更换版本。本文主要介绍这两种情况。如果只想对现有的系统进行优化,推荐看下一篇的``"Windows系列(1):常用操作与配置"``.
|
安装Windows有两种情况:1.在一台全新的电脑上安装;2.想为现有的系统更换版本。本文主要介绍这两种情况。如果只想对现有的系统进行优化,推荐看下一篇的``"Windows系列(2):常用操作与配置"``.
|
||||||
|
|
||||||
**全新安装**
|
**全新安装**
|
||||||
- 获得一个Windows的ISO镜像;
|
- 获得一个Windows的ISO镜像;
|
||||||
@@ -178,7 +178,7 @@ tags = ["Windows"]
|
|||||||
- **抓包**: [Wireshark](https://www.wireshark.org/download.html)
|
- **抓包**: [Wireshark](https://www.wireshark.org/download.html)
|
||||||
- **启动器**: [Flow.Launcher](https://github.com/Flow-Launcher/Flow.Launcher)
|
- **启动器**: [Flow.Launcher](https://github.com/Flow-Launcher/Flow.Launcher)
|
||||||
- **输入法**: [Rime](https://rime.im/download/)
|
- **输入法**: [Rime](https://rime.im/download/)
|
||||||
- **浏览器**: [Floorp](https://github.com/Floorp-Projects/Floorp) / [Chrome](https://dl.google.com/tag/s/installdataindex/update2/installers/ChromeStandaloneSetup64.exe)
|
- **浏览器**: [Floorp](https://github.com/Floorp-Projects/Floorp) / [Chrome](https://www.google.com/chrome/)
|
||||||
- **编辑器**: [VSCodium](https://github.com/VSCodium/vscodium)
|
- **编辑器**: [VSCodium](https://github.com/VSCodium/vscodium)
|
||||||
- **虚拟机**: Hyper‑V
|
- **虚拟机**: Hyper‑V
|
||||||
- **科学上网**: [GFS](https://github.com/GUI-for-Cores/GUI.for.SingBox)
|
- **科学上网**: [GFS](https://github.com/GUI-for-Cores/GUI.for.SingBox)
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
+++
|
+++
|
||||||
title = "Windows系列(1):常用操作与配置"
|
title = "Windows系列(2):常用操作与配置"
|
||||||
date = 2024-05-25
|
date = 2024-05-25
|
||||||
|
|
||||||
[taxonomies]
|
[taxonomies]
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
+++
|
+++
|
||||||
title = "Windows系列(2):分类与激活"
|
title = "Windows系列(3):分类与激活"
|
||||||
date = 2024-05-26
|
date = 2024-05-26
|
||||||
|
|
||||||
[taxonomies]
|
[taxonomies]
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
+++
|
+++
|
||||||
title = "Windows系列(3):封装与全自动安装"
|
title = "Windows系列(4):封装与全自动安装"
|
||||||
date = 2024-05-27
|
date = 2024-05-29
|
||||||
|
|
||||||
[taxonomies]
|
[taxonomies]
|
||||||
tags = ["Windows"]
|
tags = ["Windows"]
|
||||||
@@ -1,177 +0,0 @@
|
|||||||
+++
|
|
||||||
title = "Windows系列(4):高效操作与强化"
|
|
||||||
date = 2024-05-28
|
|
||||||
|
|
||||||
[taxonomies]
|
|
||||||
tags = ["Windows"]
|
|
||||||
+++
|
|
||||||
|
|
||||||
前言 本文记载windows下的常用快捷键与PowerShell强化配置.
|
|
||||||
<!-- more -->
|
|
||||||
|
|
||||||
## 快捷键
|
|
||||||
|
|
||||||
高效使用 Windows 的第一步,就是**减少鼠标依赖**。
|
|
||||||
Windows 自身已经内置了大量非常实用的快捷键,只是很多人并没有系统地使用过。
|
|
||||||
|
|
||||||
- **Alt + Tab**
|
|
||||||
在**已打开的窗口之间切换**(经典快捷键)
|
|
||||||
|
|
||||||
- **Win + Tab**
|
|
||||||
打开**任务视图**,可查看所有窗口与虚拟桌面
|
|
||||||
|
|
||||||
- **Alt + F4**
|
|
||||||
关闭当前窗口
|
|
||||||
|
|
||||||
> 在桌面下使用时可弹出关机 / 重启菜单
|
|
||||||
|
|
||||||
- **Win + D**
|
|
||||||
显示桌面 / 恢复窗口
|
|
||||||
|
|
||||||
- **Win + ↑ / ↓ / ← / →**
|
|
||||||
窗口最大化 / 最小化 / 左右分屏
|
|
||||||
|
|
||||||
- **Win + Shift + ← / →**
|
|
||||||
将当前窗口移动到另一个显示器
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### 虚拟桌面
|
|
||||||
|
|
||||||
- **Win + Ctrl + D**
|
|
||||||
新建虚拟桌面
|
|
||||||
|
|
||||||
- **Win + Ctrl + ← / →**
|
|
||||||
在虚拟桌面之间切换
|
|
||||||
|
|
||||||
- **Win + Ctrl + F4**
|
|
||||||
关闭当前虚拟桌面
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### 应用启动与系统
|
|
||||||
|
|
||||||
- **Win**
|
|
||||||
打开开始菜单,直接输入搜索应用
|
|
||||||
|
|
||||||
- **Win + R**
|
|
||||||
打开“运行”窗口
|
|
||||||
|
|
||||||
- **Win + E**
|
|
||||||
打开资源管理器
|
|
||||||
|
|
||||||
- **Win + I**
|
|
||||||
打开系统设置
|
|
||||||
|
|
||||||
- **Win + L**
|
|
||||||
锁屏
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### 截图与录屏
|
|
||||||
|
|
||||||
- **Win + Shift + S**
|
|
||||||
截图(区域 / 窗口 / 全屏)
|
|
||||||
|
|
||||||
- **Win + PrtSc**
|
|
||||||
全屏截图并自动保存
|
|
||||||
|
|
||||||
- **Win + G**
|
|
||||||
打开 Xbox Game Bar,可用于屏幕录制
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### 常用编辑操作
|
|
||||||
|
|
||||||
- **Ctrl + C / V / X**
|
|
||||||
复制 / 粘贴 / 剪切
|
|
||||||
|
|
||||||
- **Ctrl + Z / Y**
|
|
||||||
撤销 / 重做
|
|
||||||
|
|
||||||
- **Ctrl + A**
|
|
||||||
全选
|
|
||||||
|
|
||||||
- **Ctrl + S**
|
|
||||||
保存
|
|
||||||
|
|
||||||
- **Ctrl + F**
|
|
||||||
查找
|
|
||||||
|
|
||||||
- **Ctrl + Shift + Esc**
|
|
||||||
直接打开任务管理器
|
|
||||||
|
|
||||||
|
|
||||||
## 启动器
|
|
||||||
|
|
||||||
有了窗口切换和关闭,还需要打开,这里推荐这两个:
|
|
||||||
- [Flow.Launcher](https://github.com/Flow-Launcher/Flow.Launcher)
|
|
||||||
- [ZeroLaunch-rs](https://github.com/ghost-him/ZeroLaunch-rs)
|
|
||||||
|
|
||||||
现在我们就可以使用``Win+Tab``切换窗口,使用``Alt+F4``关闭窗口,使用``Alt+Space``启动软件.
|
|
||||||
|
|
||||||
## Powershell强化
|
|
||||||
|
|
||||||
要达到类似Linux下``oh-myzsh+atuin+fzf+zoxide+starship``的效果,可以使用以下方法增强:
|
|
||||||
|
|
||||||
- 安装模块
|
|
||||||
```bash
|
|
||||||
winget install junegunn.fzf
|
|
||||||
fzf --version
|
|
||||||
winget install JanDeDobbeleer.OhMyPosh
|
|
||||||
oh-my-posh version
|
|
||||||
winget install ajeetdsouza.zoxide
|
|
||||||
zoxide --version
|
|
||||||
```
|
|
||||||
|
|
||||||
- 导入模块
|
|
||||||
```bash
|
|
||||||
Install-Module PSReadLine -Scope CurrentUser -Force
|
|
||||||
Install-Module posh-git -Scope CurrentUser -Force
|
|
||||||
Install-Module PSFzf -Scope CurrentUser -Force
|
|
||||||
```
|
|
||||||
|
|
||||||
- 写入配置
|
|
||||||
|
|
||||||
首先执行这个命令:
|
|
||||||
```bash
|
|
||||||
notepad $PROFILE
|
|
||||||
```
|
|
||||||
|
|
||||||
在打开的窗口中写入:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# ---------- PSReadLine ----------
|
|
||||||
Import-Module PSReadLine
|
|
||||||
Set-PSReadLineOption -PredictionSource History
|
|
||||||
Set-PSReadLineOption -PredictionViewStyle InlineView
|
|
||||||
|
|
||||||
# ---------- Git ----------
|
|
||||||
Import-Module posh-git
|
|
||||||
|
|
||||||
# ---------- fzf ----------
|
|
||||||
Import-Module PSFzf
|
|
||||||
Set-PsFzfOption -PSReadlineChordProvider 'Ctrl+t' -PSReadlineChordReverseHistory 'Ctrl+r'
|
|
||||||
|
|
||||||
# ---------- zoxide ----------
|
|
||||||
Invoke-Expression (& { (zoxide init powershell | Out-String) })
|
|
||||||
|
|
||||||
# ---------- oh-my-posh ----------
|
|
||||||
|
|
||||||
oh-my-posh init pwsh | Invoke-Expression
|
|
||||||
|
|
||||||
# ---------- Bash-style line editing ----------
|
|
||||||
|
|
||||||
# Ctrl+A → 行首
|
|
||||||
Set-PSReadLineKeyHandler -Key Ctrl+a -Function BeginningOfLine
|
|
||||||
# Ctrl+E → 行尾
|
|
||||||
Set-PSReadLineKeyHandler -Key Ctrl+e -Function EndOfLine
|
|
||||||
# Ctrl+U → 删除从光标到行首
|
|
||||||
Set-PSReadLineKeyHandler -Key Ctrl+u -Function BackwardDeleteLine
|
|
||||||
# Ctrl+K → 删除从光标到行尾
|
|
||||||
Set-PSReadLineKeyHandler -Key Ctrl+k -Function ForwardDeleteLine
|
|
||||||
```
|
|
||||||
随后新开启一个PowerShell,可以看到有Git提示,ctrl+R唤起历史,右方向键透明补全的效果.
|
|
||||||
|
|
||||||
---
|
|
||||||
**Done.**
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
+++
|
+++
|
||||||
title = "Windows系列(5):Python开发配置"
|
title = "Windows系列(5):Python开发配置"
|
||||||
date = 2024-05-30
|
date = 2024-05-31
|
||||||
|
|
||||||
[taxonomies]
|
[taxonomies]
|
||||||
tags = ["Windows"]
|
tags = ["Windows"]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
+++
|
+++
|
||||||
title = "Windows系列(6):C/C++开发配置"
|
title = "Windows系列(6):C/C++开发配置"
|
||||||
date = 2024-05-31
|
date = 2024-05-30
|
||||||
|
|
||||||
[taxonomies]
|
[taxonomies]
|
||||||
tags = ["Windows"]
|
tags = ["Windows"]
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
.copy-button {
|
|
||||||
position: absolute;
|
|
||||||
top: 8px;
|
|
||||||
right: 8px;
|
|
||||||
padding: 4px 10px;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
font-family: DejaVu Sans Mono, Monaco, Consolas, Ubuntu Mono, monospace;
|
|
||||||
background: var(--accent);
|
|
||||||
color: var(--background);
|
|
||||||
border: none;
|
|
||||||
border-radius: 3px;
|
|
||||||
cursor: pointer;
|
|
||||||
opacity: 0;
|
|
||||||
transition: opacity 0.2s ease;
|
|
||||||
z-index: 1;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.copied {
|
|
||||||
background: #4caf50;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pre:hover .copy-button {
|
|
||||||
opacity: 0.8;
|
|
||||||
}
|
|
||||||
|
|
||||||
pre:hover .copy-button:hover {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Hack';
|
font-family: 'Hack';
|
||||||
/* Use full version (not a subset) for unicode icon support */
|
/* Use full version (not a subset) for unicode icon support */
|
||||||
src: url('fonts/hack-regular.woff2') format('woff2'), url('fonts/hack-regular.woff') format('woff');
|
src: url('fonts/hack-regular.woff2?sha=3114f1256') format('woff2'), url('fonts/hack-regular.woff?sha=3114f1256') format('woff');
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Hack';
|
font-family: 'Hack';
|
||||||
src: url('fonts/hack-bold-subset.woff2') format('woff2'), url('fonts/hack-bold-subset.woff') format('woff');
|
src: url('fonts/hack-bold-subset.woff2?sha=3114f1256') format('woff2'), url('fonts/hack-bold-subset.woff?sha=3114f1256') format('woff');
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Hack';
|
font-family: 'Hack';
|
||||||
src: url('fonts/hack-italic-subset.woff2') format('woff2'), url('fonts/hack-italic-webfont.woff') format('woff');
|
src: url('fonts/hack-italic-subset.woff2?sha=3114f1256') format('woff2'), url('fonts/hack-italic-webfont.woff?sha=3114f1256') format('woff');
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Hack';
|
font-family: 'Hack';
|
||||||
src: url('fonts/hack-bolditalic-subset.woff2') format('woff2'), url('fonts/hack-bolditalic-subset.woff') format('woff');
|
src: url('fonts/hack-bolditalic-subset.woff2?sha=3114f1256') format('woff2'), url('fonts/hack-bolditalic-subset.woff?sha=3114f1256') format('woff');
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* -------------------------- */
|
* -------------------------- */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Hack';
|
font-family: 'Hack';
|
||||||
src: url('fonts/hack-regular.woff2') format('woff2'), url('fonts/hack-regular.woff') format('woff');
|
src: url('fonts/hack-regular.woff2?sha=3114f1256') format('woff2'), url('fonts/hack-regular.woff?sha=3114f1256') format('woff');
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Hack';
|
font-family: 'Hack';
|
||||||
src: url('fonts/hack-bold.woff2') format('woff2'), url('fonts/hack-bold.woff') format('woff');
|
src: url('fonts/hack-bold.woff2?sha=3114f1256') format('woff2'), url('fonts/hack-bold.woff?sha=3114f1256') format('woff');
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Hack';
|
font-family: 'Hack';
|
||||||
src: url('fonts/hack-italic.woff2') format('woff2'), url('fonts/hack-italic.woff') format('woff');
|
src: url('fonts/hack-italic.woff2?sha=3114f1256') format('woff2'), url('fonts/hack-italic.woff?sha=3114f1256') format('woff');
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Hack';
|
font-family: 'Hack';
|
||||||
src: url('fonts/hack-bolditalic.woff2') format('woff2'), url('fonts/hack-bolditalic.woff') format('woff');
|
src: url('fonts/hack-bolditalic.woff2?sha=3114f1256') format('woff2'), url('fonts/hack-bolditalic.woff?sha=3114f1256') format('woff');
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ html {
|
|||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
font-family: DejaVu Sans Mono, Monaco, Consolas, Ubuntu Mono, monospace;
|
font-family: Hack, DejaVu Sans Mono, Monaco, Consolas, Ubuntu Mono, monospace;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
line-height: 1.54;
|
line-height: 1.54;
|
||||||
background-color: var(--background);
|
background-color: var(--background);
|
||||||
@@ -118,7 +118,7 @@ figure {
|
|||||||
}
|
}
|
||||||
|
|
||||||
code {
|
code {
|
||||||
font-family: DejaVu Sans Mono, Monaco, Consolas, Ubuntu Mono, monospace;
|
font-family: Hack, DejaVu Sans Mono, Monaco, Consolas, Ubuntu Mono, monospace;
|
||||||
font-feature-settings: normal;
|
font-feature-settings: normal;
|
||||||
background: var(--accent-alpha-20);
|
background: var(--accent-alpha-20);
|
||||||
padding: 1px 6px;
|
padding: 1px 6px;
|
||||||
@@ -127,13 +127,12 @@ code {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pre {
|
pre {
|
||||||
font-family: DejaVu Sans Mono, Monaco, Consolas, Ubuntu Mono, monospace;
|
font-family: Hack, DejaVu Sans Mono, Monaco, Consolas, Ubuntu Mono, monospace;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
font-size: .95rem;
|
font-size: .95rem;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
border-top: 1px solid rgba(255, 255, 255, .1);
|
border-top: 1px solid rgba(255, 255, 255, .1);
|
||||||
border-bottom: 1px solid rgba(255, 255, 255, .1);
|
border-bottom: 1px solid rgba(255, 255, 255, .1);
|
||||||
position: relative;
|
|
||||||
|
|
||||||
@media (max-width: $phone-max-width) {
|
@media (max-width: $phone-max-width) {
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
|
|||||||
@@ -4,7 +4,5 @@
|
|||||||
@import 'logo';
|
@import 'logo';
|
||||||
@import 'main';
|
@import 'main';
|
||||||
@import 'post';
|
@import 'post';
|
||||||
@import 'toc';
|
|
||||||
@import 'copy';
|
|
||||||
@import 'pagination';
|
@import 'pagination';
|
||||||
@import 'footer';
|
@import 'footer';
|
||||||
|
|||||||
@@ -1,88 +0,0 @@
|
|||||||
html {
|
|
||||||
scroll-behavior: smooth;
|
|
||||||
}
|
|
||||||
|
|
||||||
.toc-container {
|
|
||||||
position: fixed;
|
|
||||||
right: 150px;
|
|
||||||
top: 180px;
|
|
||||||
width: 250px;
|
|
||||||
max-height: calc(100vh - 200px);
|
|
||||||
overflow-y: auto;
|
|
||||||
z-index: 10;
|
|
||||||
display: none;
|
|
||||||
|
|
||||||
@media (min-width: 1400px) {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.toc {
|
|
||||||
padding: 15px 0;
|
|
||||||
|
|
||||||
&-title {
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 1.1rem;
|
|
||||||
margin-bottom: 12px;
|
|
||||||
color: var(--color);
|
|
||||||
}
|
|
||||||
|
|
||||||
ul {
|
|
||||||
list-style: none;
|
|
||||||
padding-left: 0;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
li {
|
|
||||||
margin: 4px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul ul {
|
|
||||||
padding-left: 20px;
|
|
||||||
margin-top: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
display: block;
|
|
||||||
text-decoration: none;
|
|
||||||
color: var(--color);
|
|
||||||
font-size: 0.9rem;
|
|
||||||
padding: 2px 0;
|
|
||||||
transition: color 0.2s ease;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: var(--accent);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:target {
|
|
||||||
color: var(--accent);
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.toc-level-1 {
|
|
||||||
font-size: 0.95rem;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
.toc-level-2 {
|
|
||||||
font-size: 0.9rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.toc-level-3 {
|
|
||||||
font-size: 0.85rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.toc-level-4,
|
|
||||||
.toc-level-5,
|
|
||||||
.toc-level-6 {
|
|
||||||
font-size: 0.8rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-content {
|
|
||||||
scroll-margin-top: 80px;
|
|
||||||
}
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
(function() {
|
|
||||||
document.querySelectorAll('pre code').forEach((codeBlock) => {
|
|
||||||
const pre = codeBlock.parentElement;
|
|
||||||
|
|
||||||
if (pre.querySelector('.copy-button')) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const copyButton = document.createElement('button');
|
|
||||||
copyButton.className = 'copy-button';
|
|
||||||
copyButton.textContent = '复制';
|
|
||||||
copyButton.setAttribute('aria-label', '复制代码');
|
|
||||||
copyButton.setAttribute('type', 'button');
|
|
||||||
|
|
||||||
copyButton.addEventListener('click', () => {
|
|
||||||
navigator.clipboard.writeText(codeBlock.textContent.trimEnd()).then(() => {
|
|
||||||
copyButton.textContent = '已复制!';
|
|
||||||
copyButton.classList.add('copied');
|
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
copyButton.textContent = '复制';
|
|
||||||
copyButton.classList.remove('copied');
|
|
||||||
}, 2000);
|
|
||||||
}).catch((err) => {
|
|
||||||
copyButton.textContent = '失败';
|
|
||||||
setTimeout(() => {
|
|
||||||
copyButton.textContent = '复制';
|
|
||||||
}, 2000);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
pre.appendChild(copyButton);
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
@@ -84,9 +84,8 @@
|
|||||||
</header>
|
</header>
|
||||||
{% endblock header %}
|
{% endblock header %}
|
||||||
|
|
||||||
<main>
|
<div class="content">
|
||||||
<div class="content">
|
{% block content %}
|
||||||
{% block content %}
|
|
||||||
<div class="posts">
|
<div class="posts">
|
||||||
{%- if paginator %}
|
{%- if paginator %}
|
||||||
{%- set show_pages = paginator.pages -%}
|
{%- set show_pages = paginator.pages -%}
|
||||||
@@ -123,10 +122,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
</div>
|
</div>
|
||||||
</main>
|
|
||||||
|
|
||||||
{% block footer %} <footer class="footer">
|
{% block footer %}
|
||||||
|
<footer class="footer">
|
||||||
<div class="footer__inner">
|
<div class="footer__inner">
|
||||||
{%- if config.extra.copyright_html %}
|
{%- if config.extra.copyright_html %}
|
||||||
<div class="copyright copyright--user">{{ config.extra.copyright_html | safe }}</div>
|
<div class="copyright copyright--user">{{ config.extra.copyright_html | safe }}</div>
|
||||||
|
|||||||
@@ -4,6 +4,11 @@
|
|||||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta name="robots" content="noodp"/>
|
<meta name="robots" content="noodp"/>
|
||||||
|
<!-- 字体预加载 - 减少布局偏移 CLS -->
|
||||||
|
<link rel="preload" href="{{ get_url(path='fonts/hack-regular.woff2?sha=3114f1256') }}" as="font" type="font/woff2" crossorigin>
|
||||||
|
<link rel="preload" href="{{ get_url(path='fonts/hack-bold.woff2?sha=3114f1256') }}" as="font" type="font/woff2" crossorigin>
|
||||||
|
<link rel="preload" href="{{ get_url(path='fonts/hack-italic.woff2?sha=3114f1256') }}" as="font" type="font/woff2" crossorigin>
|
||||||
|
<link rel="preload" href="{{ get_url(path='fonts/hack-bolditalic.woff2?sha=3114f1256') }}" as="font" type="font/woff2" crossorigin>
|
||||||
|
|
||||||
<link rel="stylesheet" href="{{ get_url(path="style.css", trailing_slash=false) | safe }}">
|
<link rel="stylesheet" href="{{ get_url(path="style.css", trailing_slash=false) | safe }}">
|
||||||
|
|
||||||
@@ -19,6 +24,15 @@
|
|||||||
{% endif -%}
|
{% endif -%}
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
|
|
||||||
|
{%- if config.extra.use_full_hack_font == "exo2" %}
|
||||||
|
<link rel="stylesheet" href="{{ get_url(path="font-exo2.css", trailing_slash=false) | safe }}">
|
||||||
|
<link rel="stylesheet" href="{{ get_url(path="font-hack.css", trailing_slash=false) | safe }}">
|
||||||
|
{%- elif config.extra.use_full_hack_font %}
|
||||||
|
<link rel="stylesheet" href="{{ get_url(path="font-hack.css", trailing_slash=false) | safe }}">
|
||||||
|
{% else %}
|
||||||
|
<link rel="stylesheet" href="{{ get_url(path="font-hack-subset.css", trailing_slash=false) | safe }}">
|
||||||
|
{% endif -%}
|
||||||
|
|
||||||
{% endmacro head %}
|
{% endmacro head %}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,41 +10,5 @@
|
|||||||
{{ post_macros::content(page=page, summary=false, show_only_description=false) }}
|
{{ post_macros::content(page=page, summary=false, show_only_description=false) }}
|
||||||
{{ post_macros::earlier_later(page=page) }}
|
{{ post_macros::earlier_later(page=page) }}
|
||||||
</div>
|
</div>
|
||||||
{% if page.toc %}
|
|
||||||
<div class="toc-container">
|
|
||||||
<div class="toc">
|
|
||||||
<div class="toc-title">目录</div>
|
|
||||||
<ul>
|
|
||||||
{% for h in page.toc %}
|
|
||||||
<li class="toc-level-{{ h.level }}">
|
|
||||||
<a href="#{{ h.id | safe }}">{{ h.title }}</a>
|
|
||||||
{% if h.children %}
|
|
||||||
<ul>
|
|
||||||
{% for h2 in h.children %}
|
|
||||||
<li class="toc-level-{{ h2.level }}">
|
|
||||||
<a href="#{{ h2.id | safe }}">{{ h2.title }}</a>
|
|
||||||
{% if h2.children %}
|
|
||||||
<ul>
|
|
||||||
{% for h3 in h2.children %}
|
|
||||||
<li class="toc-level-{{ h3.level }}">
|
|
||||||
<a href="#{{ h3.id | safe }}">{{ h3.title }}</a>
|
|
||||||
</li>
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
|
||||||
{% endif %}
|
|
||||||
</li>
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
|
||||||
{% endif %}
|
|
||||||
</li>
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|
||||||
{% block extra_body %}
|
|
||||||
<script src="{{ get_url(path='copy.js', trailing_slash=false) | safe }}"></script>
|
|
||||||
{% endblock extra_body %}
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user