Skip to content

Commit 7edf165

Browse files
committed
update
1 parent 08f137d commit 7edf165

31 files changed

+513
-46
lines changed

README.md

+29-17
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ Read the [NOTICE](./NOTICE) file distributed with this work for additional infor
6161
- [设计](#设计)
6262
- [Docker](#docker)
6363
- [Elixir](#elixir)
64+
- [嵌入式](#嵌入式)
6465
- [函数式编程](#函数式编程)
6566
- [前端](#前端)
6667
- [React](#react)
@@ -80,6 +81,7 @@ Read the [NOTICE](./NOTICE) file distributed with this work for additional infor
8081
- [数学](#数学)
8182
- [机器学习](#机器学习)
8283
- [网络](#网络)
84+
- [Nix](#nix)
8385
- [Nodejs](#nodejs)
8486
- [运维](#运维)
8587
- [其他](#其他)
@@ -159,7 +161,6 @@ Read the [NOTICE](./NOTICE) file distributed with this work for additional infor
159161

160162
## Docker
161163

162-
- [Alpine Linux](docker/alpine.md)
163164
- [ContainerD OverlayFS](docker/containerd-overlayfs.md)
164165
- [Containerd](docker/containerd.md)
165166
- [容器里的 Core Dump](docker/core-dump-in-container.md)
@@ -209,6 +210,12 @@ Read the [NOTICE](./NOTICE) file distributed with this work for additional infor
209210

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

213+
## 嵌入式
214+
215+
- [zephyr与 esp32](embedded/zephyr-esp32.md)
216+
217+
[`⬆ 返回目录`](#toc)
218+
212219
## 函数式编程
213220

214221
- [Cache-Control](fp/cache-control.md)
@@ -413,18 +420,12 @@ Read the [NOTICE](./NOTICE) file distributed with this work for additional infor
413420
- [anon_inode](linux/anon_inode.md)
414421
- [ansible 部署到 centos7 时,不能找到 service](linux/ansible-deploy-fault-with-centos7-and-service.md)
415422
- [apt](linux/apt.md)
423+
- [arch linux](linux/arch-linux.md)
416424
- [Armbian 关闭 swap](linux/armbian-turn-swap-off.md)
417425
- [Armbian](linux/armbian.md)
418-
- [bash error exit](linux/bash-error-exit.md)
419-
- [bash history](linux/bash-history.md)
420-
- [bash 开启 vi 模式](linux/bash-in-vi-mode.md)
421-
- [学习 Bash](linux/bash-learning.md)
422-
- [Bash 的坑](linux/bash-pitfalls.md)
423-
- [Bash 小技巧](linux/bash-tricks.md)
424426
- [BIOS](linux/bios.md)
425427
- [Block Layer](linux/block-layer.md)
426428
- [BootLoader](linux/boot-loader.md)
427-
- [eBPF 与 XDP](linux/bpf-xdp.md)
428429
- [btrfs](linux/btrfs.md)
429430
- [内存的 buffer 和 cache](linux/buffer-and-cache-in-memory.md)
430431
- [在容器中构建 Package](linux/build-package-in-container.md)
@@ -436,6 +437,7 @@ Read the [NOTICE](./NOTICE) file distributed with this work for additional infor
436437
- [命令格式标准](linux/command-arguments-syntax-standard.md)
437438
- [linux 命令被 hash 缓存](linux/command-be-hashed.md)
438439
- [compgen](linux/compgen.md)
440+
- [configfs](linux/configfs.md)
439441
- [连接 tty](linux/connect-tty.md)
440442
- [conntrack](linux/conntrack.md)
441443
- [上下文切换](linux/context-switch.md)
@@ -453,6 +455,7 @@ Read the [NOTICE](./NOTICE) file distributed with this work for additional infor
453455
- [ELF 文件](linux/elf.md)
454456
- [终端开启真彩色 (true color)](linux/enable-true-color-in-terminal.md)
455457
- [用环境变量替换文本内容 envsubst](linux/envsubst.md)
458+
- [exfat](linux/exfat.md)
456459
- [ExtFS (Extended File System)](linux/ext-fs.md)
457460
- [快速删除文件](linux/fast-delete-files.md)
458461
- [快速创建大文件](linux/fast-generate-large-file.md)
@@ -498,6 +501,7 @@ Read the [NOTICE](./NOTICE) file distributed with this work for additional infor
498501
- [man 命令](linux/man.md)
499502
- [mdadm](linux/mdadm.md)
500503
- [命令行中的乱码](linux/messy-codes-in-console.md)
504+
- [mkisofs](linux/mkisofs.md)
501505
- [创建临时文件的命令](linux/mktemp.md)
502506
- [mount](linux/mount.md)
503507
- [musl libc](linux/musl-libc.md)
@@ -506,7 +510,6 @@ Read the [NOTICE](./NOTICE) file distributed with this work for additional infor
506510
- [netstat 与 ss](linux/netstat-and-ss.md)
507511
- [网络接口配置 (ifcfg)](linux/network-interface-configuration.md)
508512
- [网络配置工具](linux/network-manage-tools.md)
509-
- [networking.service](linux/networking-service.md)
510513
- [硬盘空间占满问题](linux/no-space-left-on-device.md)
511514
- [nsenter](linux/nsenter.md)
512515
- [NTP 时间同步](linux/ntp.md)
@@ -541,9 +544,6 @@ Read the [NOTICE](./NOTICE) file distributed with this work for additional infor
541544
- [sudoer](linux/sudoer.md)
542545
- [syslinux](linux/syslinux.md)
543546
- [Linux 系统调用](linux/system-call.md)
544-
- [systemd-resolved](linux/systemd-resolved.md)
545-
- [systemd-timesyncd](linux/systemd-timesyncd.md)
546-
- [systemd](linux/systemd.md)
547547
- [tailf](linux/tailf.md)
548548
- [tar](linux/tar.md)
549549
- [基于内存的虚拟文件系统 tmpfs/ramfs/RamDisk](linux/temporary-fs-in-memory.md)
@@ -601,6 +601,7 @@ Read the [NOTICE](./NOTICE) file distributed with this work for additional infor
601601
- [多网卡在 Mac 系统的问题](mac/double-network-card-problems-in-mac.md)
602602
- [Mac 下按住键盘不能输出重复的字符](mac/hold-down-key-cannot-keep-print-character.md)
603603
- [Homebrew](mac/homebrew.md)
604+
- [MacOS log](mac/log.md)
604605
- [Mac 快捷键](mac/mac-shortcuts.md)
605606
- [用命令触发系统通知](mac/notification-with-command.md)
606607
- [Mac 自启动配置 plist](mac/plist.md)
@@ -664,6 +665,15 @@ Read the [NOTICE](./NOTICE) file distributed with this work for additional infor
664665

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

668+
## Nix
669+
670+
- [nix flake](nix/flake.md)
671+
- [学习 Nix](nix/learning.md)
672+
- [nixos installer](nix/nixos-installer.md)
673+
- [nixpkgs](nix/nixpkgs.md)
674+
675+
[`⬆ 返回目录`](#toc)
676+
667677
## Nodejs
668678

669679
- [MaxListenersExceededWarning](nodejs/MaxListenersExceededWarning.md)
@@ -720,8 +730,8 @@ Read the [NOTICE](./NOTICE) file distributed with this work for additional infor
720730
- [使用 acme.sh 生成证书](others/acme-cert.md)
721731
- [在梅林固件路由器里安装 AdGuard Home](others/adguardhome-in-asuswrt-merlin-device.md)
722732
- [Alfred Workflow debug 技巧](others/alfred-workflow-debug.md)
723-
- [Github Markdown 中的锚点引用](others/anchor-in-github-markdown.md)
724733
- [永久链接](others/archive-webpage.md)
734+
- [aria2](others/aria2.md)
725735
- [ASCII 与 ANSI](others/ascii-and-ansi.md)
726736
- [梅林固件 asuswrt-merlin](others/asuswrt-merlin.md)
727737
- [脱字符 (caret)](others/caret.md)
@@ -731,17 +741,15 @@ Read the [NOTICE](./NOTICE) file distributed with this work for additional infor
731741
- [YAML 中的 Date 类型陷阱](others/date-trap-in-yaml.md)
732742
- [MacOS 彻底删除搜狗输入法](others/delete-sogou-input-in-macos.md)
733743
- [dropbear](others/dropbear.md)
744+
- [Duplicati](others/duplicati.md)
734745
- [文件命名,下划线还是中划线?](others/file-naming-with-underscores-and-dashes.md)
735-
- [github 中 markdown 折叠文本](others/fold-text-in-github.md)
736746
- [fzf](others/fzf.md)
737747
- [从微信公众号提取原图](others/get-raw-image-from-weixin.md)
738-
- [Github Template (模板)](others/github-template.md)
739748
- [gRPC](others/grpc.md)
740749
- [通过 Hash 密码到 url 来验证密码](others/hashed-password-to-url.md)
741750
- [如何学习一门编程语言](others/how-to-learn-a-program-language.md)
742751
- [如何阅读标准](others/how-to-read-spec.md)
743752
- [如何审核代码](others/how-to-review-code.md)
744-
- [如何在 github 项目里搜索代码](others/how-to-use-github-to-browse-codes.md)
745753
- [Hyper.js 中文问题](others/hyper-js-chinese-problems.md)
746754
- [无法在 Tmux 显示图片](others/imgcat-not-work-in-tmux.md)
747755
- [Jekyll](others/jekyll.md)
@@ -760,7 +768,6 @@ Read the [NOTICE](./NOTICE) file distributed with this work for additional infor
760768
- [如何打开超大文件](others/open-huge-file-with-editor.md)
761769
- [Protocol Buffers](others/protocal-buffers.md)
762770
- [正则表达式的小技巧](others/regexp-tricks.md)
763-
- [在 Github Markdown 中如何填写图片的链接](others/relative-link-in-github-markdown.md)
764771
- [Markdown 里写反引号](others/reverse-quote-in-markdown.md)
765772
- [rsync](others/rsync.md)
766773
- [Semver](others/semver.md)
@@ -772,11 +779,13 @@ Read the [NOTICE](./NOTICE) file distributed with this work for additional infor
772779
- [vim textwidth=78 的约定](others/textwidth-78-of-vim.md)
773780
- [KB 与 KiB 的不同](others/the-difference-between-kb-and-kib.md)
774781
- [时间回跳问题](others/time-backward-issue.md)
782+
- [tmux 环境变量](others/tmux-environment-variable.md)
775783
- [UTF-8 vs UTF-16](others/utf-8-vs-utf-16.md)
776784
- [Vagrant DNS](others/vagrant-dns.md)
777785
- [vagrant-vbguest](others/vagrant-vbguest.md)
778786
- [查看 Chrome 通知历史列表](others/view-chrome-notification-history.md)
779787
- [Virtualbox VBoxManage](others/virtualbox-VBoxManage.md)
788+
- [vsftpd](others/vsftpd.md)
780789
- [水快速加热](others/water-heating-in-seconds.md)
781790
- [为何 Protobuf 3 移除了 required 和 optional](others/why-protobuf-3-remove-required-and-optional.md)
782791
- [为什么 Unicode U+F8FF 是苹果 Logo?](others/why-unicode-f8ff-is-apple-logo.md)
@@ -968,7 +977,10 @@ Read the [NOTICE](./NOTICE) file distributed with this work for additional infor
968977

969978
## Windows
970979

980+
- [在虚拟机里安装 Windows 10](windows/install-win10-in-vm.md)
971981
- [在虚拟机里安装 Windows 11](windows/install-win11-in-vm.md)
982+
- [legend bios 无损转 uefi](windows/legend-bios-to-uefi.md)
972983
- [PE 系统](windows/pe-system.md)
984+
- [Windows WSL](windows/wsl.md)
973985

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

build.config.mjs

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
export const ignoreDirs = [
2+
'database', 'node_modules', 'makefile-utils',
3+
];
4+
5+
export const categoryNameMap = {
6+
k8s: 'K8S',
7+
philosophy: '哲学',
8+
thinking: '思考',
9+
'front-end': '前端',
10+
design: '设计',
11+
fp: '函数式编程',
12+
others: '其他',
13+
ops: '运维',
14+
storage: '存储',
15+
lsp: 'Language Server Protocol (LSP)',
16+
network: '网络',
17+
algorithm: '算法',
18+
computer: '计算机',
19+
language: '语言设计',
20+
math: '数学',
21+
security: '安全攻防',
22+
vm: '虚拟机',
23+
proverbs: '箴言录',
24+
hardware: '硬件',
25+
ml: '机器学习',
26+
embedded: '嵌入式',
27+
};

docker/macvlan.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,21 @@
1313
## 注意
1414

1515
1. podman、nerdctl、docker 在 rootless 模式下都不支持 macvlan。
16-
2. nerdctl 的 macvlan 子网不支持跟宿主机的网段有重合。就没法获取宿主机的局域网 IP。docker 可以。
16+
2. nerdctl 的 macvlan 子网不支持跟宿主机的网段有重合。就没法获取宿主机的局域网 IP。详见 [issue](https://github.com/containerd/nerdctl/issues/2490)。然而 docker 没这问题。
17+
3. nerdctl compose 不支持 mac_address。然而 docker 没这问题。
1718

1819
## mac_address
1920

20-
mac_address 的地址不能随意填。需要匹配物理网卡的 mac 地址的前缀。
21+
mac_address 的地址似乎可以随意填。不必与物理网卡的 mac 地址的前缀保持一致。
22+
如果遇到奇怪的问题,建议尝试 mac 地址前缀部分与物理网卡的保持一致。
2123

2224
## 排查问题
2325

2426
可以自己手动创建 macvlan 来排查问题。`sudo ip link add link eth0 name macvlan0 type macvlan mode bridge`
2527
如果显示 `Unknown device type.` 那就是内核模块没开启。
28+
29+
## 宿主机无法访问 macvlan 容器的 IP
30+
31+
这是因为 kernel 中有关 macvlan 的安全策略会完全过滤来自 host 访问。
32+
33+
解决方案参考[这篇文章](https://www.cnblogs.com/azureology/p/16750154.html) ([链接备份](https://web.archive.org/web/20231103173715/https://www.cnblogs.com/azureology/p/16750154.html))。

embedded/zephyr-esp32.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# zephyr与 esp32
2+
3+
## 烧录
4+
5+
直接通过 usb 连接到电脑。
6+
**Mac 电脑注意**:雷电 4 接口电压过高,需要用 usb 2.0 hub 转接一下。否则会烧坏板子。
7+
8+
默认波特率 921600bps 有问题,需要改成 115200。`west flash --esp-baud-rate 115200`

hardware/home-assistant.md

-10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1 @@
11
# Home Assistant
2-
3-
Zigbee2MQTT
4-
Z2M
5-
6-
ESPhome
7-
ESP32 芯片
8-
9-
10-
cc2531
11-
cc2652p

hardware/usb.md

+27-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
## USB
1+
# USB
22

3-
### USB 型号
3+
## USB 型号
44

5-
![](https://corp.adata.com/support/quiktips/images/knowledge/04/article_04_P02.jpg)
5+
![图片](https://corp.adata.com/support/quiktips/images/knowledge/04/article_04_P02.jpg)
66

77
- USB 1.0
88
- 速度: 1.5 Mbps (0.1875 MB/S)
@@ -20,7 +20,30 @@
2020
- USB 3.2 (现在改名叫 USB 3.2 Gen2x2)
2121
- 速度: 20 Gbps (2500 MB/S)
2222

23+
## 查看电脑的 usb 接口信号
2324

24-
### USB-IF 认证
25+
- windows 系统:安装 [Windows SDK](https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/usbview)。其中有个 USBView 很好用。
26+
- linux 系统:`lsusb -t | grep 'root hub'`
27+
28+
## 查看已连接的 USB 设备的 usb 型号
29+
30+
`lsusb -t` 仅列出已连接的 USB 设备。根据显示的速度判断型号。
31+
32+
## USB-IF 认证
2533

2634
https://www.enablingusb.org/certification-chinese
35+
36+
## Linux 用命令行安全拔出 USB 设备
37+
38+
假设 usb 挂载路径是 `/mnt/usb`
39+
40+
```sh
41+
# 把缓存写入块存储
42+
sudo sync
43+
# 终止访问该挂载点的进程
44+
sudo fuser -km /mnt/usb
45+
# 拆卸挂载
46+
sudo umount /mnt/usb
47+
```
48+
49+
或者,使用 `eject` 命令。但有些系统不自带命令,需要自己安装。而且只有支持 `eject` 命令的设备才会响应,不一定所有 usb 设备都支持。

linux/arch-linux.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# arch linux

linux/clamav.md

+4
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,7 @@ curl -O https://secure.eicar.org/eicar.com \
3737
```
3838

3939
然后尝试扫描病毒 `clamdscan ./*`,显示出 `Win.Test.EICAR_HDB-1 FOUND` 就说明扫出病毒。扫完后尝试 `cat eicar.com`
40+
41+
## clamdscan 扫不出病毒,但 clamscan 可以
42+
43+
`clamdscan -v --fdpass $path` 看看那个病毒文件是不是 excluded 的。当前 clamav 有个 [bug](https://github.com/Cisco-Talos/clamav/issues/940) 会把 excluded 的文件也输出 OK。

linux/configfs.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# configfs

linux/exfat.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# exfat
2+
3+
适用于闪存设备(固态硬盘),windows/macos/linux 通用的文件系统。微软创建的用来取代 FAT32 文件格式的新型文件格式。它最大可以支持 1EB 的文件大小。
4+
5+
## Linux
6+
7+
linux 系统需要安装 exfat-utils 包才能正常 mount 该设备。

linux/fast-generate-large-file.md

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1-
## 快速创建大文件
1+
# 快速创建大文件
22

3-
三种命令`truncate`, `fallocate`, `dd`
3+
几种命令`truncate`, `fallocate`, `dd`, `mkfile` (仅 MacOS)。
44

5-
`dd` 用法最复杂,且效率最低。
5+
- `dd` 用法最复杂,且效率最低。推荐 `truncate``fallocate`
6+
- `dd``truncate` 创建的是稀疏文件 (Sparse File)。该文件不包含用户数据,不会分配存储数据的磁盘块。只被 ASCII 码的 NULL 字符占据。当数据被写入稀疏文件时,才逐渐地为其分配磁盘块。因此创建会很快,并且拷贝稀疏文件时也很快,因为只复制了元数据。
7+
- `fallocate` 会创建普通文件。
8+
- `mkfile``-n` 参数可以创建稀疏文件,默认创建普通文件。
69

7-
推荐 `truncate``fallocate`
10+
## 例子:创建一个 20G 文件
11+
12+
- `dd if=/dev/zero of=20G.txt bs=1M count=0 seek=20000`
13+
- `truncate -s 20G 20G.txt`
14+
- `fallocate -l 20G 20G.txt`
15+
- `mkfile 20g 20G.txt`
16+
- `mkfile -n 20g 20G.txt`

linux/file-system.md

+9
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,19 @@
66
- zfs
77
- jffs
88
- jffs2
9+
- yaffs2
10+
- ubifs
911
- rootfs: linux 根文件系统
1012
- tmpfs
1113
- nfs
1214
- 9pfs
1315
- GlusterFS
1416
- CephFS
1517
- MooseFS
18+
- SquashFS
19+
- procfs
20+
- debugfs
21+
- [configfs](./configfs.md)
22+
- functionfs
23+
- sysfs
24+
- [exfat](./exfat.md): 适用于闪存设备(固态硬盘),windows/macos/linux 通用的文件系统。

0 commit comments

Comments
 (0)