Skip to content

Commit a433d41

Browse files
committed
2 parents c9a6ab2 + 9961840 commit a433d41

File tree

7 files changed

+157
-28
lines changed

7 files changed

+157
-28
lines changed
Loading
85.5 KB
Loading
145 KB
Loading

docs/learn/credits.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,9 @@
3838
{
3939
"section": "Netcat 使用指南",
4040
"contributors": ["yixinBC"]
41+
},
42+
{
43+
"section": "WSL 安装教程",
44+
"contributors": ["云梦"]
4145
}
4246
]

docs/learn/crypto.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -118,34 +118,34 @@ x = c % p // 2 # [!code highlight]
118118
对于学习 Python,了解以下知识点即可(摘自 [Python 基础教程 | 菜鸟教程](https://www.runoob.com/python))。
119119

120120
<ElCollapse class='vp-collapse' v-model='openCollapse'>
121-
<ElCollapseItem name='acknowledge-list'>
122-
<template #title>
123-
<strong>知识点列表</strong><span data-desc v-text='openCollapse.includes("acknowledge-list") ? "(点此收起)" : "(点此展开)"'></span>
124-
</template>
125-
126-
- Python 基础教程
127-
- Python 简介
128-
- Python 环境搭建
129-
- Python 中文编码
130-
- Python 基础语法
131-
- Python 变量类型
132-
- Python 运算符
133-
- Python 条件语句
134-
- Python 循环语句
135-
- Python While 循环语句
136-
- Python for 循环语句
137-
- Python 循环嵌套
138-
- Python break 语句
139-
- Python continue 语句
140-
- Python pass 语句
141-
- Python Number(数组)
142-
- Python 字符串
143-
- Python List(列表)
144-
- Python 日期和时间
145-
- Python 函数
146-
- Python 模块
147-
148-
</ElCollapseItem>
121+
<ElCollapseItem name='acknowledge-list'>
122+
<template #title>
123+
<strong>知识点列表</strong><span data-desc v-text='openCollapse.includes("acknowledge-list") ? "(点此收起)" : "(点此展开)"'></span>
124+
</template>
125+
126+
- Python 基础教程
127+
- Python 简介
128+
- Python 环境搭建
129+
- Python 中文编码
130+
- Python 基础语法
131+
- Python 变量类型
132+
- Python 运算符
133+
- Python 条件语句
134+
- Python 循环语句
135+
- Python While 循环语句
136+
- Python for 循环语句
137+
- Python 循环嵌套
138+
- Python break 语句
139+
- Python continue 语句
140+
- Python pass 语句
141+
- Python Number(数组)
142+
- Python 字符串
143+
- Python List(列表)
144+
- Python 日期和时间
145+
- Python 函数
146+
- Python 模块
147+
148+
</ElCollapseItem>
149149
</ElCollapse>
150150

151151
::: tip 撰稿人注

docs/learn/install-wsl.md

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
---
2+
titleTemplate: ":title - NewStar CTF"
3+
outline: [2, 4]
4+
---
5+
6+
<script setup>
7+
import Container from '@/components/docs/Container.vue'
8+
</script>
9+
10+
# WSL 安装教程
11+
12+
## WSL 简介
13+
14+
WSL(Windows Subsystem for Linux)是 Windows 操作系统下的一个轻量虚拟机,支持运行 Ubuntu、Debian 等 Linux 子系统。以其与 Windows 操作系统的高度交互性(例如文件系统、网络、部分通用应用程序的无障碍互通等),使用起来更为简便。
15+
16+
WSL 的底层虚拟化实现与传统虚拟机的「完整套娃」不同,WSL 1 将底层系统调用或 API 将转化为 Windows 层;WSL 2 基于微软自家的 Hyper-V 虚拟化技术,做了大量优化。也因此 WSL 的性能开销(内存、CPU)更小,启动速度更快。
17+
18+
WSL 2 比 WSL 1 更接近于完整的 Linux 内核,但对 GPU/USB 等外设支持有限。
19+
20+
关于 WSL 和虚拟机的使用。建议日常开发等需求轻度使用 WSL2 体验最佳。两者可以共存,根据需求切换使用。
21+
22+
## 安装 WSL 2
23+
24+
### 必要条件
25+
26+
Windows 10 1903 及以上版本。
27+
28+
WSL 2 使用了 Hyper-V 架构的一部分功能,你的 PC 须支持虚拟化技术,并在 BIOS 中开启。
29+
30+
使用 WSL 需要开启一些 Windows 功能。下面几种方式都可以开启,选择你喜欢的方式即可。
31+
32+
#### 方式一:图形界面
33+
34+
在 Windows 的搜索栏或设置的搜索栏中搜索「功能」,打开「启用或关闭 Windows 功能」,确保以下功能已启用:
35+
36+
- 适用于 Linux 的 Windows 子系统
37+
- 虚拟机平台(Virtual Machine Platform)
38+
39+
![启用或关闭 Windows 功能](/assets/images/learn/wsl-enable-windows-feature.png)
40+
41+
<Container type="tip">
42+
建议在微软商店搜索「终端」或「Terminal」,它是一个支持多标签页、功能更强大的官方终端工具,推荐使用。
43+
44+
</Container>
45+
46+
#### 方式二:命令行
47+
48+
**管理员身份**运行终端<span data-desc>(按下 <kbd>Win</kbd><kbd>X</kbd> 并选择「终端管理员」可快速打开)</span>。
49+
50+
使用下面的命令,启用功能「适用于 Linux 的 Windows 子系统」:
51+
52+
```shell
53+
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
54+
```
55+
56+
::: tip 可能的报错
57+
若报错:无法解析服务器的名称或地址。请在网络和 Internet 设置中检查你的 DNS 设置。
58+
59+
:::
60+
61+
使用下面的命令,启用功能「虚拟机平台」:
62+
63+
::: code-group
64+
65+
```shell [任意终端]
66+
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
67+
```
68+
69+
```shell [PowerShell]
70+
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -NoRestart
71+
```
72+
73+
:::
74+
75+
::: tip 可能的报错
76+
若报错且报错代码为 `0x800701bc`,请在终端输入下面的命令更新 WSL:
77+
78+
```shell
79+
wsl --update
80+
```
81+
82+
若报 WSL 的更新进度为一直为 0 或者不变,可尝试重启计算机,或尝试从 Github 下载<span data-desc>(须确保你的终端网络环境能访问 Github)</span>:
83+
84+
```shell
85+
wsl --install --web-download
86+
```
87+
88+
:::
89+
90+
### 设置 WSL 2 为默认值
91+
92+
在管理员终端中输入下面的命令:
93+
94+
```shell
95+
wsl --set-default-version 2
96+
```
97+
98+
### 安装一个 Linux 发行版
99+
100+
打开微软应用商店,搜索一个你喜欢的 Linux 发行版(如 Ubuntu、Debian 等),点击安装。
101+
102+
::: tip
103+
若无法正常使用微软商店,请尝试关闭你的代理或 VPN 软件,并检查你的网络环境。
104+
105+
:::
106+
107+
例如:
108+
109+
![Ubuntu](/assets/images/learn/wsl-store-ubuntu.png)
110+
111+
![Debian](/assets/images/learn/wsl-store-debian.png)
112+
113+
安装完成后,你可以打开它,或者在终端中输入 `wsl` 命令来启动它<span data-desc>(如果你使用的是微软商店的终端,在终端的新建标签卡中应当也可以找到你安装的 Linux 发行版)</span>。
114+
115+
随后,按照提示信息设置用户名、密码等即可。
116+
117+
## 相关命令
118+
119+
启动 WSL 并以 ROOT 用户身份登录:
120+
121+
```shell
122+
wsl --user root
123+
```

theme-config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ sidebar:
5050
link: /learn/configure-pwn
5151
- text: Netcat 使用指南
5252
link: /learn/nc
53+
- text: WSL 安装教程
54+
link: /learn/install-wsl
5355

5456
- text: Q&A
5557
link: /learn/qa

0 commit comments

Comments
 (0)