Skip to content

Commit 1addc5b

Browse files
committed
update
1 parent 360981f commit 1addc5b

22 files changed

+258
-61
lines changed

.github/workflows/local.yml

-17
This file was deleted.

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
### Jekyll
2+
_site/
3+
.sass-cache/
4+
.jekyll-cache/
5+
.jekyll-metadata
6+
# Ignore folders generated by Bundler
7+
.bundle/
8+
vendor/
19

210
# Created by https://www.gitignore.io/api/node,macos,vim
311

.jekyll/sass/custom/custom.scss

+27
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,30 @@
1313
color: #fa2c2c;
1414
text-decoration: underline;
1515
}
16+
17+
.aux-nav {
18+
.aux-nav-list {
19+
align-items: center;
20+
}
21+
22+
.aux-nav-list-item {
23+
height: 70%;
24+
padding: 0;
25+
margin: 0px 6px;
26+
background-color: #50505033;
27+
border-radius: 6px;
28+
29+
.site-button:hover {
30+
border-radius: 6px;
31+
background-image: none;
32+
background-color: #61616133;
33+
}
34+
}
35+
}
36+
37+
.nav-list .nav-list-item {
38+
.nav-list-link:hover,
39+
.nav-list-link.active {
40+
background-image: linear-gradient(-90deg, #262831 0%, #1e2d4f 80%, rgba(32, 31, 35, 0) 100%);
41+
}
42+
}

LICENSE

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Copyright (c) 2016-2023 ADoyle ([email protected])
2-
All rights reserved.
1+
Copyright 2016-2023 ADoyle ([email protected])
2+
Some rights reserved.
33

44
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
55

Makefile

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
GH_PAGE_IMAGE=adoyle/gh-pages:v228
2+
3+
.PHONY: check-links
4+
check-links:
5+
# https://github.com/tcort/markdown-link-check
6+
ag --md -l | xargs -n1 markdown-link-check
7+
8+
.PHONY: serve
9+
serve:
10+
echo "You should press 'ctrl-c' when \"Auto-regeneration: enabled for '/src/site'\" appeared."
11+
docker run -it --rm -p 4000:4000 -v "${PWD}:/src/site" ${GH_PAGE_IMAGE}
12+
13+
build:
14+
docker run -it --rm -v "${PWD}:/src/site" ${GH_PAGE_IMAGE} \
15+
build --verbose
16+
17+
build-gh:
18+
docker run -it --rm -v "${PWD}:/src/site" --entrypoint github-pages ${GH_PAGE_IMAGE} \
19+
build --verbose
20+
21+
http:
22+
docker run --rm -it -p 4000:80 -v "${PWD}/_site:/usr/share/caddy:ro" caddy:2.6.3-alpine
23+
24+
debug-gh-pages:
25+
docker run -it --rm -p 4000:4000 -v "${PWD}:/src/site" \
26+
--entrypoint ash \
27+
${GH_PAGE_IMAGE}

NOTICE

Whitespace-only changes.

README.md

+15-3
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,15 @@ https://adoyle.me/Today-I-Learned/
3434

3535
## 版权声明
3636

37-
Copyright (c) 2016-2023 ADoyle ([email protected]). The project is licensed under the **BSD 3-clause License**.
37+
Copyright 2016-2023 ADoyle ([email protected]). Some Rights Reserved.
38+
The project is licensed under the **BSD 3-clause License**.
3839

39-
See the [LICENSE][] file for the specific language governing permissions and limitations under the License.
40+
Read the [LICENSE][] file for the specific language governing permissions and limitations under the License.
41+
42+
Read the [NOTICE][] file distributed with this work for additional information regarding copyright ownership.
4043

4144
[LICENSE]: ./LICENSE
45+
[NOTICE]: ./NOTICE
4246

4347

4448
## TOC
@@ -141,7 +145,7 @@ See the [LICENSE][] file for the specific language governing permissions and lim
141145

142146
## Docker
143147

144-
- [Alpine 镜像](docker/alpine.md)
148+
- [Alpine Linux](docker/alpine.md)
145149
- [ContainerD OverlayFS](docker/containerd-overlayfs.md)
146150
- [Containerd](docker/containerd.md)
147151
- [容器里的 Core Dump](docker/core-dump-in-container.md)
@@ -330,6 +334,7 @@ See the [LICENSE][] file for the specific language governing permissions and lim
330334
- [用户增加用户组](linux/add-group-to-user.md)
331335
- [ag 和 rg](linux/ag-and-rg.md)
332336
- [Alfred 找不到文件](linux/alfred-cannot-find-files.md)
337+
- [Alpine Linux](linux/alpine.md)
333338
- [anon_inode](linux/anon_inode.md)
334339
- [ansible 部署到 centos7 时,不能找到 service](linux/ansible-deploy-fault-with-centos7-and-service.md)
335340
- [apt](linux/apt.md)
@@ -346,6 +351,7 @@ See the [LICENSE][] file for the specific language governing permissions and lim
346351
- [btrfs](linux/btrfs.md)
347352
- [内存的 buffer 和 cache](linux/buffer-and-cache-in-memory.md)
348353
- [在容器中构建 Package](linux/build-package-in-container.md)
354+
- [Busybox](linux/busybox.md)
349355
- [CFS (Completely Fair Scheduler)](linux/cfs.md)
350356
- [更改默认 shell](linux/change-default-shell.md)
351357
- [clamav](linux/clamav.md)
@@ -396,6 +402,7 @@ See the [LICENSE][] file for the specific language governing permissions and lim
396402
- [IO、select、epoll](linux/io-select-epoll.md)
397403
- [iproute2 与 ifconfig 命令](linux/iproute2-vs-ifconfig.md)
398404
- [iptables 与 nftables](linux/iptables.md)
405+
- [kconfig](linux/kconfig.md)
399406
- [Linux 内核模块](linux/kernel-module.md)
400407
- [Linux 内核](linux/kernel.md)
401408
- [kswapd0](linux/kswapd0.md)
@@ -409,18 +416,21 @@ See the [LICENSE][] file for the specific language governing permissions and lim
409416
- [命令行中的乱码](linux/messy-codes-in-console.md)
410417
- [创建临时文件的命令](linux/mktemp.md)
411418
- [mount](linux/mount.md)
419+
- [musl libc](linux/musl-libc.md)
412420
- [Netfilter](linux/netfilter.md)
413421
- [netns](linux/netns.md)
414422
- [netstat 与 ss](linux/netstat-and-ss.md)
415423
- [网络接口配置 (ifcfg)](linux/network-interface-configuration.md)
416424
- [硬盘空间占满问题](linux/no-space-left-on-device.md)
417425
- [nsenter](linux/nsenter.md)
418426
- [NTP 时间同步](linux/ntp.md)
427+
- [OpenRC](linux/openrc.md)
419428
- [OverlayFS](linux/overylay-fs.md)
420429
- [PAM](linux/pam.md)
421430
- [perf 命令](linux/perf.md)
422431
- [不需要 root 权限执行 ping](linux/ping-without-sudo.md)
423432
- [管道重定向](linux/pipe-redirect.md)
433+
- [PostmarketOS](linux/postmarketos.md)
424434
- [/proc/interrupts](linux/proc-interrupts.md)
425435
- [进程内存](linux/process-memory.md)
426436
- [命令行中提示用户 Yes/No](linux/read-prompt.md)
@@ -585,6 +595,7 @@ See the [LICENSE][] file for the specific language governing permissions and lim
585595
- [Jekyll](others/jekyll.md)
586596
- [Jinja2](others/jinja2.md)
587597
- [Language Server Protocol](others/language-server-protocol.md)
598+
- [Makefile](others/makefile.md)
588599
- [箴言](others/maxim.md)
589600
- [元语法 (Metasyntax)](others/metasyntax.md)
590601
- [乱码问题](others/mojibake.md)
@@ -645,6 +656,7 @@ See the [LICENSE][] file for the specific language governing permissions and lim
645656

646657
## Ruby
647658

659+
- [Ruby 代理镜像](ruby/proxy.md)
648660
- [使用 scientist 科学重构代码](ruby/using-scientist-for-refactoring.md)
649661

650662
## 安全攻防

_config.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,12 @@ description: 博观而约取,厚积而薄发。ADoyle 的碎片化知识笔记
2626
logo: https://media.githubusercontent.com/media/adoyle-h/_imgs/master/assets/logo.png
2727
favicon_ico: ./.jekyll/assets/favicon.ico
2828
footer_content:
29-
Copyright 2016-2023 ADoyle ([email protected]). The project is licensed under <b>BSD 3-clause License</b>.<br>
30-
Source code at <a href="https://github.com/adoyle-h/my-development-tools">https://github.com/adoyle-h/Today-I-Learned</a>
31-
29+
Copyright 2016-2023 ADoyle ([email protected]). Some Rights Reserved.<br>
30+
The project is licensed under <b>BSD 3-clause License</b>.
31+
aux_links_new_tab: true # Makes Aux links open in a new tab. Default is false
32+
aux_links:
33+
"Give Me a Github Star":
34+
- https://github.com/adoyle-h/Today-I-Learned
3235
last_edit_timestamp: true
3336
color_scheme: dark
3437
back_to_top: true

_docs/license.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
## 版权声明
22

3-
Copyright (c) 2016-2023 ADoyle ([email protected]). The project is licensed under the **BSD 3-clause License**.
3+
Copyright 2016-2023 ADoyle ([email protected]). Some Rights Reserved.
4+
The project is licensed under the **BSD 3-clause License**.
45

5-
See the [LICENSE][] file for the specific language governing permissions and limitations under the License.
6+
Read the [LICENSE][] file for the specific language governing permissions and limitations under the License.
7+
8+
Read the [NOTICE][] file distributed with this work for additional information regarding copyright ownership.
69

710
[LICENSE]: ./LICENSE
11+
[NOTICE]: ./NOTICE

docker/alpine.md

-32
This file was deleted.

docker/alpine.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../linux/alpine.md

docker/docker-for-mac.md

+6
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,9 @@
77
## 修改配置导致 docker 无法启动
88

99
docker for mac 的配置在 `~/Library/Group\ Containers/group.com.docker/settings.json`,修复配置即可。
10+
11+
## 在 ARM 架构的 Docker for mac 里运行 AMD 架构的镜像,ctrl-c 失效
12+
13+
等待解决 https://github.com/docker/for-mac/issues/6082
14+
15+
解决方法:在别的窗口使用 `docker stop` 命令来关闭容器。或者到 Docker Desktop 里关闭容器。

linux/alpine.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
## Alpine Linux
2+
3+
- https://www.alpinelinux.org/
4+
- [介绍](https://wiki.alpinelinux.org/wiki/Alpine_Linux:Overview)
5+
6+
### 内部构成
7+
8+
- [Busybox](./busybox.md): coreutils
9+
- [Musl libc](./musl-libc.md): 轻量级 C 标准库
10+
- [OpenRC](./openrc.md): init 系统
11+
- apk: 包管理器
12+
- [syslinux](https://wiki.syslinux.org/wiki/index.php): bootloader
13+
14+
### apk
15+
16+
- `apk add --no-cache <pkg-name>` 不留缓存安装
17+
18+
### 常用包
19+
20+
搜索: https://pkgs.alpinelinux.org/packages
21+
22+
`build-essential` 类似的包,提供编译工具。`alpine-sdk``build-base`。参考这个 [issue](https://github.com/gliderlabs/docker-alpine/issues/24)
23+
24+
`apk add binutils`
25+
26+
### 根据文件查找包
27+
28+
比如缺失文件 `ld-linux-x86-64.so.2`,可以到 https://pkgs.alpinelinux.org/contents 找到对应的包。
29+
30+
https://pkgs.alpinelinux.org/contents?file=ld-linux-x86-64.so.2
31+
32+
### 依赖 glibc 的程序不要使用 alpine 镜像
33+
34+
当前在 alpine 镜像安装 glibc 的方案有两个,
35+
36+
- `apk add gcompat`,源码 https://git.adelielinux.org/adelie/gcompat 。问题也很多,缺失文件或者缺失符号。比如 `fcntl64: symbol not found`
37+
- sgerrand 提供了 glibc 在 alpine 的编译方案,https://github.com/sgerrand/alpine-pkg-glibc 。但是[问题太多了](https://github.com/sgerrand/alpine-pkg-glibc/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc),各种缺失文件与文件路径不对。
38+
39+
也可以使用 musl libc 代替 glibc,`apk add musl`,但似乎不能完全兼容。
40+
41+
## alpine 的坑
42+
43+
- [Bash 镜像有 bug](../shell/bash-docker-image-has-bug.md)

linux/busybox.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Busybox
2+
3+
- 主页 https://busybox.net/
4+
- 源码 https://git.busybox.net/busybox/tree/ `git clone git://busybox.net/busybox.git`
5+
6+
BusyBox 将许多常见的 UNIX 命令缩减结合到一个单一的可执行文件中(`busybox` 文件)。
7+
8+
例如 `mkdir` 命令可以用 `busybox mkdir` 运行。
9+
例如 `ls` 命令可以用 `busybox ls` 运行。
10+
11+
它通常可以替换在 GNU [coreutils](http://git.savannah.gnu.org/gitweb/?p=coreutils.git) 里的程序。
12+
BusyBox 的程序通常比 GNU coreutils 的少很多参数。不过满足日常使用。
13+
14+
BusyBox 可以为小型或嵌入式系统提供一个相当完整的环境。
15+
BusyBox 考虑到了尺寸优化和有限的资源。它非常模块化,所以你可以在编译时轻松地包括或排除命令(或功能)。
16+
于是可以很容易地定制你的嵌入式系统。只需在 /dev 中添加一些设备节点,在 /etc 中添加一些配置文件,再加入一个 Linux 内核。
17+
18+
注意: **BusyBox 使用 GPL v2 协议开源**。如果不想开源,可以使用 [toybox](https://landley.net/toybox/),MIT 协议。

linux/kconfig.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# kconfig
2+
3+
在编译 linux 内核常见的 `make *config` 命令都是来自于 [kconfig](https://www.kernel.org/doc/html/latest/kbuild/kconfig.html)
4+
可以 `make help` 查看相关命令。
5+
6+
- `make config` 问答式创建 .config 文件。非专家不要使用。
7+
- `make defconfig` 根据当前系统架构和默认配置,自动创建最大适配通用配置的 .config 文件。
8+
- `make menuconfig` 使用终端界面来配置 .config 文件。
9+
- `make nconfig` 使用另一种终端界面来配置 .config 文件。
10+
- `make xconfig` 使用 QT 界面来配置 .config 文件。
11+
- `make gconfig` 使用 GTK+ 界面来配置 .config 文件。
12+
- `make savedefconfig` 通过 .config 文件生成 defconfig 文件。新文件以 `_defconfig` 后缀命名。
13+
- `make oldconfig` 对比现有的和之前的 .config 文件区别。
14+
- 当你将现有的内核配置转移到一个新的内核版本时很有用。
15+
- 如果你在运行了一次 `make oldconfig` 之后再运行第二次,第二次就不会提示你任何选项了。
16+
17+
## make menuconfig
18+
19+
### 修改 menuconfig 配色
20+
21+
使用 [MENUCONFIG_COLOR](https://www.kernel.org/doc/html/latest/kbuild/kconfig.html#menuconfig-color) 修改 menuconfig 配色。
22+
23+
`make MENUCONFIG_COLOR=<theme> menuconfig`
24+
25+
`<theme>` 的值有,
26+
27+
- mono => selects colors suitable for monochrome displays
28+
- blackbg => selects a color scheme with black background
29+
- classic => theme with blue background. The classic look
30+
- bluetitle => a LCD friendly version of classic. (default)
31+
32+
P.S. busybox 不支持修改配色,因为它的 kconfig 版本太低了。

linux/kernel.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
## Linux 内核
1+
# Linux 内核
22

3-
### 升级内核
3+
- https://www.kernel.org/doc/html/latest/
4+
5+
## 编译内核
6+
7+
- [kconfig](./kconfig.md)
8+
- [Kernel Build System](https://www.kernel.org/doc/html/latest/kbuild/)
9+
10+
## 升级内核
411

512
以 debian 系统为例。
613

linux/musl-libc.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# musl libc
2+
3+
轻量级 C 标准库
4+
5+
## 与 glibc 的区别
6+
7+
- [Functional differences from glibc](https://wiki.musl-libc.org/functional-differences-from-glibc.html)

linux/openrc.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
tags: [init]
3+
---
4+
# OpenRC
5+
6+
https://github.com/OpenRC/openrc

linux/postmarketos.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# PostmarketOS
2+
3+
https://postmarketos.org/
4+
5+
一款基于 [Alpine Linux](./alpine.md) 的移动端操作系统。
6+
它将 alpine 运行在 QEMU 虚拟机里。

0 commit comments

Comments
 (0)