Skip to content

Commit 7322fa5

Browse files
committed
update
1 parent 91cdb41 commit 7322fa5

11 files changed

+130
-5
lines changed

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ Read the [NOTICE](./NOTICE) file distributed with this work for additional infor
112112
## Android
113113

114114
- [ADB](android/adb.md)
115+
- [boot.img](android/bootimg.md)
115116
- [Android Root](android/root.md)
116117
- [Termux](android/termux.md)
117118

@@ -226,6 +227,7 @@ Read the [NOTICE](./NOTICE) file distributed with this work for additional infor
226227
- [关于 webpack 2](front-end/all-about-webpack-2.md)
227228
- [`<script async>``<script defer>`](front-end/async-defer-script-dom.md)
228229
- [圆角的玩法](front-end/border-radius-tricks.md)
230+
- [Chrome 浏览器 DNS 解析](front-end/chrome-dns-resolver.md)
229231
- [Safari 浏览器的类继承 Bug](front-end/class-extend-bug-in-safari.md)
230232
- [代码分离](front-end/code-split.md)
231233
- [颜色对比度](front-end/color-contrast.md)
@@ -710,6 +712,7 @@ Read the [NOTICE](./NOTICE) file distributed with this work for additional infor
710712
- [Ansible 技巧](ops/ansible-tricks.md)
711713
- [Ansible 变量](ops/ansible-vars.md)
712714
- [Ansible](ops/ansible.md)
715+
- [dig 命令](ops/dig.md)
713716
- [DNF](ops/dnf.md)
714717
- [以太网](ops/ethernet.md)
715718
- [IPMI 与 BMC](ops/ipmi-and-bmc.md)
@@ -730,6 +733,7 @@ Read the [NOTICE](./NOTICE) file distributed with this work for additional infor
730733
- [0.30000000000000004](others/0.30000000000000004.md)
731734
- [Today I learned (TIL) 资源列表](others/TIL.md)
732735
- [使用 acme.sh 生成证书](others/acme-cert.md)
736+
- [adguard home](others/adguard-home.md)
733737
- [在梅林固件路由器里安装 AdGuard Home](others/adguardhome-in-asuswrt-merlin-device.md)
734738
- [Alfred Workflow debug 技巧](others/alfred-workflow-debug.md)
735739
- [永久链接](others/archive-webpage.md)
@@ -783,9 +787,11 @@ Read the [NOTICE](./NOTICE) file distributed with this work for additional infor
783787
- [KB 与 KiB 的不同](others/the-difference-between-kb-and-kib.md)
784788
- [时间回跳问题](others/time-backward-issue.md)
785789
- [tmux 环境变量](others/tmux-environment-variable.md)
790+
- [usbipd 与 Windows WSL](others/usbipd-windows-wsl.md)
786791
- [UTF-8 vs UTF-16](others/utf-8-vs-utf-16.md)
787792
- [Vagrant DNS](others/vagrant-dns.md)
788793
- [vagrant-vbguest](others/vagrant-vbguest.md)
794+
- [不用 lsblk 查看块设备](others/view-block-devices-without-lsblk.md)
789795
- [查看 Chrome 通知历史列表](others/view-chrome-notification-history.md)
790796
- [Virtualbox VBoxManage](others/virtualbox-VBoxManage.md)
791797
- [vsftpd](others/vsftpd.md)
@@ -984,6 +990,7 @@ Read the [NOTICE](./NOTICE) file distributed with this work for additional infor
984990
- [在虚拟机里安装 Windows 11](windows/install-win11-in-vm.md)
985991
- [legend bios 无损转 uefi](windows/legend-bios-to-uefi.md)
986992
- [PE 系统](windows/pe-system.md)
993+
- [winget](windows/winget.md)
987994
- [Windows WSL](windows/wsl.md)
988995

989996
[`⬆ 返回目录`](#toc)

android/bootimg.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# boot.img
2+
3+
## 从手机上提取 boot.img
4+
5+
```sh
6+
# 查询 boot 分区位置
7+
$ ls -al /dev/block/by-name/boot
8+
lrwxrwxrwx 1 root root 21 2023-11-17 12:50 /dev/block/by-name/boot -> /dev/block/mmcblk0p42
9+
# 导出到外置存储卡 /sdcard/boot.img
10+
$ dd if=/dev/block/mmcblk0p19 of=/sdcard/boot.img
11+
```
12+
13+
## 从 boot.img 提取内核文件
14+
15+
可使用我编译的 [unpackbootimg 工具](https://github.com/adoyle-h/android-unpackbootimg/actions/runs/6899157671)
16+
17+
`unpackbootimg -i ./boot.img -o ./boot`
18+
19+
## 制作 boot.img
20+
21+
可使用我编译的 [unpackbootimg 工具](https://github.com/adoyle-h/android-unpackbootimg/actions/runs/6899157671)
22+
23+
`mkbooting --kernel KERNEL -o ./boot.img`

android/termux.md

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
## Termux
1+
# Termux
22

33
Termux 是 Android 手机上的一个终端 App。
44
不用 root 手机,普通权限就能很方便地使用了。
55
如果有 root,甚至可以[手机里跑 Docker](https://gist.github.com/FreddieOliveira/efe850df7ff3951cb62d74bd770dce27)
66

7-
### 基本设置
7+
## 基本设置
88

99
- 执行 `termux-change-repo` 设置镜像源,可以选 Cloudflare 源或者最下面四个国内高校的源,速度比较快。
1010
- 执行 `termux-setup-storage` 创建 `~/storage` 目录,用于访问手机内的存储文件。
@@ -17,14 +17,20 @@ Termux 是 Android 手机上的一个终端 App。
1717

1818
然后看一遍文档 https://wiki.termux.com/wiki/Getting_started
1919

20-
### 包管理器
20+
## 包管理器
2121

2222
Termux 装有 pkg、apt、dpkg。pkg 是官方推荐的包管理器。
2323
apt、dpkg 和 Debian 的一模一样,尽量少做修改,只用来查询。
2424

25-
### 学习资料
25+
## 学习资料
2626

2727
- https://p3terx.com/archives/termux-tutorial-1.html
2828
- https://www.sqlsec.com/2018/05/termux.html
2929
- https://github.com/myfreess/Mytermuxdoc
3030
- https://wiki.termux.com/wiki/Main_Page
31+
32+
## 在 Android 5/6 安装 Termux
33+
34+
根据[官方 WIKI](https://github.com/termux/termux-app/wiki/Termux-on-android-5-or-6) 可知,它在 [Github Workfloww](https://github.com/termux/termux-app/actions/workflows/debug_build.yml?query=branch%3Amaster+event%3Apush) 里编译了支持 Android 5/6 的 Termux App。
35+
36+
点进任意成功的 build。在 Artifacts 有列出所有的构建结果文件。选择文件名包含 `android-5` 的文件,支持 Android 5 或 Android 6。

front-end/chrome-dns-resolver.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Chrome 浏览器 DNS 解析
2+
3+
在新版的 `chrome://net-internals/#dns` 里看不到 dns nameserver 信息。
4+
需要到 `chrome://net-export` 记录访问日志,然后用 https://netlog-viewer.appspot.com/#dns 查看 DNS 配置信息以及每条请求的 DNS 解析。
5+
6+
当 secure_dns_mode 为 1 时,代表开启请求 DoH 服务。它会在 nameservers 列表里选择开启 DoH 的服务,跳过不支持 DoH 的服务。
7+
8+
这个在 Chrome 「设置-隐私和安全-使用安全 DNS」可以设置关闭。

ops/dig.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# dig 命令
2+
3+
macos 内置的 dig 命令不支持 `+tls``+https` 参数请求 DoT/DoH。
4+
5+
可以通过 `brew install bind` 安装最新的 dig。虽然这个包主要是安装 bind 服务器,有点多余。

others/adguard-home.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# adguard home
2+
3+
## 开启 DoH
4+
5+
默认配置不开启 DoH。开启需要满足以下条件:
6+
7+
1. 有公网 IP。(为什么一定要有公网 IP ?因为免费 CA 服务商无法为局域网 IP 签发证书)
8+
2. 申请 SSL 证书。
9+
3. 修改 adguard home 的配置。
10+
11+
具体设置步骤详见 https://github.com/AdguardTeam/AdGuardHome/wiki/Encryption
12+
13+
如果不开启 DoH,记得把浏览器的「使用安全 DNS」选项关闭,否则浏览器不会请求 adguard home,详见「[Chrome 浏览器 DNS 解析](../front-end/chrome-dns-resolver.md)」。
14+
15+
## 设置 dns 过滤规则
16+
17+
推荐把规则写到文件里管理。adguard-home 配置项 `upstream_dns_file`
18+
19+
详见 https://github.com/AdguardTeam/AdGuardHome/wiki/Configuration#upstreams-from-file

others/fonts.googleapis.com-is-inaccessible.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# fonts.googleapis.com 不可访问
22

3+
测试[这个链接](https://fonts.googleapis.com/css?family=Roboto:300,400,500%7CMaterial+Icons+Outlined)能否打开。
4+
35
其实 fonts.googleapis.com 在国内是可以访问的。但是可能因为你的 DNS 设置以及翻墙软件的设置,导致它不可访问。
46

57
```
@@ -19,6 +21,18 @@ nslookup fonts.googleapis.com 223.5.5.5
1921

2022
于是我想到一个问题,fonts.googleadapis.com 的国内 IP,究竟是 google 原厂提供的服务,还是我国的代理服务?
2123

22-
我用 https://www.chaipip.com/ 查询 ip 归属地(我这查出来是 IP 是 180.163.150.33),发现位置锁定在上海市政府。(IP 经纬度可能有偏移,所以定位不一定准确,自己判断)
24+
根据 [felixonmars/dnsmasq-china-list/google.china.conf](https://github.com/felixonmars/dnsmasq-china-list/blob/master/google.china.conf) 的列表。我用 https://www.chaipip.com/ 查询 IP 高精度归属地。
25+
26+
|--------------------------------|--------------------|--------------------------------------|
27+
| 域名 | 223.5.5.5 解析地址 | 地址 |
28+
|--------------------------------|--------------------|--------------------------------------|
29+
| fonts.googleadapis.com | 180.163.150.33 | 上海市政府 |
30+
| dl.google.com | 220.181.174.225 | 北京正义路,公安部旁边的一幢不明建筑 |
31+
| download.tensorflow.google.com | 180.163.151.162 | 上海市政府 |
32+
| accounts.googlers.com | 58.63.233.125 | 广州市珠江附近 |
33+
| goto.google.com | 58.63.233.125 | 广州市珠江附近 |
34+
|--------------------------------|--------------------|--------------------------------------|
35+
36+
IP 经纬度可能有偏移,所以定位不一定准确,自己判断。
2337

2438
写到这里,就不展开了。

others/usbipd-windows-wsl.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# usbipd 与 Windows WSL
2+
3+
usbip 是 usbip 客户端。usbipd 是 usbip 服务端。[usbipd-win](https://github.com/dorssel/usbipd-win) 是 windows 平台专用的 usbip 服务端程序。它是 C/S 架构。
4+
5+
它让 Windows 宿主机与 WSL 通过 IP 共享本地的 USB 设备。安装 usbipd 前需要升级 wsl2 版本 `wsl --update`
6+
7+
本文参考自[这个讨论](https://github.com/adoyle-h/my-development-tools/discussions/8)
8+
9+
## 当 usbipd-win 无法与 WSL 搭配使用
10+
11+
排查问题列表:
12+
13+
1. 使用 usbipd **对于 wsl2 版本有要求**,使用前可能需要升级 wsl2 版本 `wsl --update`,参考[官方 Wiki](https://github.com/dorssel/usbipd-win/wiki/WSL-support)
14+
2. windows 防火墙默认会阻止 WSL 访问宿主机。需要在 Windows Defender 防火墙里添加**入站规则**
15+
3. 启用 adb 之前,先在 WSL 里用 `lsusb` 命令看看是否识别了新的 usb 接口。
16+
4. 如果以上都确保没问题,还是没法连通宿主机。可以排查电脑里安装的有关网络管理、监控、VPN 等应用。可能是它搞得鬼。之前我装了一个网络监控工具把我电脑的网络流量给劫持了,导致修改防火墙规则也不起作用。
17+
18+
## WSL 里 adb 无法连接设备
19+
20+
解决方法:先 `adb kill-server`,然后用 `sudo adb devices` 用 sudo 权限开启 adb server 是关键。之后就能正常连接了。参考 [issue](https://github.com/dorssel/usbipd-win/issues/60)
21+
22+
当执行 `adb shell` 看到报错 `This adb server's $ADB_VENDOR_KEYS is not set` 时,去看一眼手机,要点授权后才能访问。需要 `adb kill-server` 重来一遍。
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# 不用 lsblk 查看块设备
2+
3+
有些系统不自带 lsblk 命令。如何查看块设备的分区信息?
4+
5+
执行 `ls -al /dev/block/by-name` 或者 `ls -al /dev/block/bootdevice/by-name`
6+
可以看到分区路径与分区别名的映射关系。
7+
8+
还可以用 `mount` 查看挂载情况。

windows/winget.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# winget
2+
3+
[winget](https://github.com/microsoft/winget-cli) 是 windows 包管理器。
4+
5+
## 代理
6+
7+
普通安装被墙很慢,这时候就需要代理。可是 winget 目前没有代理功能,详见 [issue](https://github.com/microsoft/winget-cli/issues/190)
8+
9+
可以用 [Proxifier](https://www.proxifier.com/) 来设置代理。

windows/wsl.md

+4
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@ C 盘: `cd /mnt/c/`, D 盘: `cd /mnt/d/`,以此类推。
2020

2121
1. 在 power shell 里执行 `wsl -l -v` 看看当前 linux 系统是 wsl 1 还是 2 的。
2222
- 如果是 wsl 1,执行 `wsl --set-version $name 2` 把 wsl 1 转换成 2。再试试 mount。
23+
24+
## 修改 WSL 的 DNS 设置
25+
26+
详见[文章](https://blog.niekun.net/archives/1801.html) ([链接备份](https://web.archive.org/web/20231116102956/https://blog.niekun.net/archives/1801.html))。

0 commit comments

Comments
 (0)