Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ice-kylin committed Jun 12, 2021
1 parent 1145b8c commit a44a21f
Show file tree
Hide file tree
Showing 10 changed files with 154 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/rookie/graphic-driver.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ title: 显卡驱动

:::

::: warning ⚠️ 注意

请确保已经按照本指南之前的章节安装配置好系统再向下进行,**不要多个教程混着看(尤其是一些过时的教程)**。因为可能导致漏掉本指南前置步骤中的某些操作,从而造成问题。

:::

## 核芯显卡

### Intel 核芯显卡
Expand Down
6 changes: 5 additions & 1 deletion docs/rookie/optional-cfg.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ title: 可选配置

# 其它可选配置

## 调整部分系统设置

### 以空会话启动

## 字体设置

笔者的设置是英文使用 Hack,中文使用 Noto Sans CJK SC。可以在 `系统设置` > `字体` 中进行设置。

有关用户全局级别更改日文异型字的设置,可参考 [archWiki 相关说明](<https://wiki.archlinux.org/index.php/Localization_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)/Simplified_Chinese_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)#%E4%BF%AE%E6%AD%A3%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87%E6%98%BE%E7%A4%BA%E4%B8%BA%E5%BC%82%E4%BD%93%EF%BC%88%E6%97%A5%E6%96%87%EF%BC%89%E5%AD%97%E5%BD%A2>)

## 休眠(hibernate)设置(可选)
## 休眠(hibernate)设置

KDE 自身提供开箱即用的睡眠功能(sleep),即将系统挂起到内存,消耗少量的电量。休眠(hibernate)则会将系统挂起到交换分区或交换文件,几乎不消耗电量。如果睡眠功能已可满足你的需求,不需要休眠到硬盘的功能,则可略过此步。

Expand Down
143 changes: 143 additions & 0 deletions docs/rookie/transparent.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: 透明代理
sidebarDepth: 2
---

# archlinux 透明代理
Expand Down Expand Up @@ -239,6 +240,24 @@ cgproxy 默认配置是代理所有 `tcp` 和 `udp`、`ipv4` 和 `ipv6` 的流
sudo systemctl start cgproxy.service
```

::: tip ℹ️ 提示

每次重启后都要重新命令启动 cgproxy 服务。

若要设为开机自启,请执行以下命令:

```bash
sudo systemctl enable cgproxy.service
```

若要关闭 cgproxy 服务,请执行以下命令:

```bash
sudo systemctl stop cgproxy.service
```

:::

4. 通过以下命令检查 cgproxy 服务运行情况:

```bash
Expand All @@ -251,6 +270,130 @@ systemctl status cgproxy.service

![check](../static/rookie/transparent_check.png)

::: tip ℹ️ 提示

如果 cgproxy 不生效 😢,请尝试以下步骤:

1. 观察 Qv2ray 日志,看流量是否被定向到了 Qv2ray
2. 如果没有,请检查配置是否准确、cgproxy 服务是否开启等
3. 如果还是没发现问题,尝试更换端口
4. 使用以下命令尝试给核心文件加上相应的特权:

:::

:::: code-group
::: code-group-item V2Ray

```bash
sudo setcap "cap_net_admin,cap_net_bind_service=ep" /usr/bin/v2ray
```

:::
::: code-group-item Xray

```bash
sudo setcap "cap_net_admin,cap_net_bind_service=ep" /usr/bin/xray
```

:::
::::

## 其它代理方法(非透明代理)

> 虽然 cgproxy 很好,但有的时候就是会有诡异的 bug。本指南为了内容的全面性,介绍其它的代理方法。
### 系统代理

如步骤 [4. 通过系统代理方式尝试连接](./transparent.md#_4-通过系统代理方式尝试连接) 所述,但在很多应用不生效(主流浏览器已支持 KDE 的系统代理)。

### 应用自身的代理配置

#### Firefox

Firefox 可使用系统代理,也可手动配置:

![Firefox](../static/rookie/transparent/firefox.png)

#### Telegram

1. 点击 `Settings` > `Advanced` > `Connection type` > `Use custom proxy`

![Telegram_step-1](../static/rookie/transparent/telegram-1.png)

2. 点击 `ADD PROXY` > 填写合适的类型和端口 > `SAVE`

![Telegram_step-2](../static/rookie/transparent/telegram-2.png)

#### Visual Studio Code(code OSS)

1. 点击 `File``文件`) > `Preference``首选项`) > `Settings``设置`

2. 搜索 `proxy`,在其中填入 http 代理地址(`http://127.0.0.1:xxxx`)即可:

![vscode](../static/rookie/transparent/vscode.png)

::: tip ℹ️ 提示

其它应用请自行寻找代理设置。

:::

### export

通过以下 `export` 命令设置当前终端的代理方式:

```bash
export https_proxy=http://127.0.0.1:xxxx
export http_proxy=http://127.0.0.1:xxxx
export all_proxy=http://127.0.0.1:xxxx
```

::: tip ℹ️ 提示

不同终端命令所识别的环境变量名不同,如 `all_proxy``curl` 生效,而对 `wget` 则不生效,具体可查看各个命令的 `man page`

:::

### proxychains-ng

如果对于一个应用,KDE 系统代理不生效,在终端 `export``ALL_PROXY` 变量再用终端启动此应用代理也不生效,并且这个应用自身也没有配置代理的选项,此时可以尝试使用 proxychains-ng。

它可以为单行命令配置代理。它是一个预加载的 hook,允许通过一个或多个 SOCKS 或 HTTP 代理重定向现有动态链接程序的 TCP 流量。

1. 通过以下命令安装 proxychains-ng 包:

```bash
sudo pacman -S proxychains-ng
```

2. 通过 `vim` 编辑 `/etc/proxychains.conf` 文件:

```bash
sudo vim /etc/proxychains.conf
```

把配置文件中最后两行改为 Qv2ray 代理的 ip 和端口:

![proxychains_step-1](../static/rookie/transparent/proxychains-1.png)

`proxy_dns` 一行前添加 `#` 注释掉此行,否则使用 `proxychains` 启动 yay 会报错:

![proxychains_step-2](../static/rookie/transparent/proxychains-2.png)

3. 使用代理方式为在单一命令前添加 `proxychains` 前缀:

```bash
proxychains %command%
```

如使用 proxychains-ng 代理 yay:

```bash
proxychains yay -Syyu
```

![proxychains_step-3](../static/rookie/transparent/proxychains-3.png)

> 📔 本节参考资料:
>
> - [Qv2ray](https://qv2ray.net/lang/zh/)
Binary file added docs/static/rookie/transparent/firefox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/static/rookie/transparent/proxychains-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/static/rookie/transparent/proxychains-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/static/rookie/transparent/proxychains-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/static/rookie/transparent/telegram-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/static/rookie/transparent/telegram-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/static/rookie/transparent/vscode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a44a21f

Please sign in to comment.