Skip to content

Commit 202c8f6

Browse files
committed
fix format
1 parent cd02b65 commit 202c8f6

File tree

40 files changed

+402
-171
lines changed

40 files changed

+402
-171
lines changed

content/posts/2025-08-02_programmer_humor_01.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ draft = false
44
title = '"Chaos Enginnering" In Partice'
55
tags = ['Essay']
66
+++
7-
记录一个小故事 HHH
7+
记录一个小故事 XD
88

99
### “混沌工程”实践
1010

content/posts/2025-09-07_docker-image.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ Docker 默认使用 Docker Hub 作为镜像仓库.
473473

474474
#### Testing the private registry 测试私有注册中心
475475
运行后首先登陆该 registry
476-
```Docker
476+
```bash
477477
% docker login 127.0.0.1:5001
478478

479479
Username: myuser
@@ -488,7 +488,7 @@ Login Succeeded
488488

489489
在生产环境中, 需要让容器从密钥管理系统中获取密钥, 并且使用某种冗余的外部存储.
490490
如果希望在开发环境中, 不同容器之间保留 registry 镜像, 可以在运行 docker 容器时加上类似参数:
491-
```Docker
491+
```bash
492492
--mount type=bind, source=/tmp/registry-data, target=/var/lib/registry
493493
```
494494
这里是将宿主机的 `/tmp/registry-data` 目录映射到容器里的 `/var/lib/registry`, 这样镜像就会存储到宿主机, 即使容器被删除也不会丢失
@@ -513,7 +513,7 @@ e971abc09286: Pushed
513513
latest: digest: sha256:445f229035a87428b9e9dd1f816a29f7aaf8f8eabab220942d1aeae545e3f2f1 size: 2193
514514
```
515515
现在就可以 pull 同样的镜像了
516-
```Docker
516+
```bash
517517
% docker image pull 127.0.0.1:5001/my-registry
518518
Using default tag: latest
519519
latest: Pulling from my-registry
@@ -522,7 +522,7 @@ Status: Image is up to date for 127.0.0.1:5001/my-registry:latest
522522
127.0.0.1:5001/my-registry:latest
523523
```
524524
可以使用下面命令停止该容器
525-
```Docker
525+
```bash
526526
docker container stop registry
527527
```
528528

@@ -545,11 +545,11 @@ docker container stop registry
545545
Go 是一门编译语言, 可以很方便地生成静态编译的二进制文件.
546546
作为示例, 这里使用一个 Go 编写的 Web 应用, 该应用可以在 [Github](https://github.com/spkane/scratch-helloworld) 上找到.
547547
运行下面命令, 然后在浏览器打开
548-
```Docker
548+
```bash
549549
docker container run --rm -d -p 8080:8080 spkane/scratch-helloworld
550550
```
551551
一般情况下可能认为容器内会有项目文件, 但实际上并不是这样, 使用下面类似命令将容器打包
552-
```Docker
552+
```bash
553553
docker container export 19931dd0fc21 -o web-app.tar
554554
```
555555
再使用 tar 命令, 检查容器内容
@@ -570,11 +570,11 @@ tar -tvf web-app.tar
570570
如果需要经常查看镜像文件, 可以尝试一下这个工具 [dive](https://github.com/wagoodman/dive), 其提供了一个 CLI 接口便捷地查看镜像内容.
571571

572572
尽管可以使用 `docker container run -ti alpine:latest /bin/sh` 查看 apline image, 但对于 `spkane/scratch-helloworld` 这个镜像不行, 因为这个容器中不含 bash 或者 SSH. 这之前是用 `docker container export` 命令生成了一个 `.tar` 文件, 其中包含容器内所有文件的副本, 但本次将直接连接到 Docker 服务器并查看容器自身的 文件系统来检查它. 要做到这一点, 需要找出文件在服务器磁盘上的存放位置, 可以使用下面命令获取:
573-
```Docker
573+
```bash
574574
docker image inspect <container_name>:<container_tag>
575575
```
576576
下面使用这个例子来演示
577-
```Docker
577+
```bash
578578
docker container run --rm -it --privileged --pid=host debian nsenter -t 1 -m -u -n -i sh
579579
```
580580
alpine 是一个非常小的基础镜像, 只有 4.5 MB, 非常适合在其之上构建容器.
@@ -651,7 +651,7 @@ CMD ["/helloworld"]
651651
但问题是这样即使只更新了一行源码, 整个层都需要重新下载.
652652

653653
可以使用 `docker image history <image>` 命令查看镜像构建阶段的文件层信息, 例如下面这样:
654-
```Docker
654+
```bash
655655
% docker image history ...
656656
IMAGE CREATED CREATED BY SIZE
657657
543d61c95677 About a minute ago CMD ["/usr/sbin/httpd" "-DFOREGROU…"] 0B
@@ -849,7 +849,7 @@ docker container run --rm -ti 2a236efc3f06 /bin/bash
849849
#### Debugging BuildKit Images
850850
当使用 BuildKit 时, 需要采用略有不同的方法来定位构建失败的位置, 因为这种模式下不会将任何中间构建层导出到 Docker daemon.
851851

852-
先将 Dockerfile 回复, 然后做下面这样的修改:
852+
先将 Dockerfile 恢复, 然后做下面这样的修改:
853853
```Dockerfile
854854
RUN npm install
855855
```

content/posts/2025-09-12_english-for-programmers-02.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title = 'English for Programmers - 02'
55
tags = ['English']
66
+++
77

8-
# Unit2: Code Review & Testing
8+
# Unit 2. Code Review & Testing
99
this unit will cover:
1010
- Differentiate between various **testing strategies**
1111
- Write **professional guidelines**

content/posts/2025-09-16_morden-js-fundamentals.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
+++
22
date = '2025-09-16T8:00:00+08:00'
33
draft = false
4-
title = 'Morden Javascript Tutorial Part 1 - Fundamentals :01~05'
4+
title = 'Morden Javascript Tutorial Part 1 - Fundamentals: 01~05'
55
tags = ['JavaScript']
66
+++
77

content/posts/2025-09-17_morden-js-fundamentals.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
+++
22
date = '2025-09-17T8:00:00+08:00'
33
draft = false
4-
title = 'Morden Javascript Tutorial Part 1- Fundamentals :06~10'
4+
title = 'Morden Javascript Tutorial Part 1- Fundamentals: 06~10'
55
tags = ['JavaScript']
66
+++
77

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
+++
2+
date = '2025-09-20T8:00:00+08:00'
3+
draft = false
4+
title = 'English for Programmers - 03'
5+
tags = ['English']
6+
+++
7+
8+
# Unit 3. Discussing Code
9+
10+
## vocabulary - Modifiers
11+
When discussing code, *modifiers* can be extremely useful for making your feedback constructive and precise.
12+
13+
- *modifiers*: words that change the meaning of a sentence
14+
15+
For example, a colleague asks:
16+
17+
What do you think of the website?
18+
19+
- Response 1: It's good When I click something it loads very quickly and I can navigate it easyily without any instructions.
20+
21+
- Response 2: It's good! It's very *responsive* and can be navigated *intuitively*.
22+
23+
By using *technical adjectives and adverbs*, Response 2 sounds more clear and professional.
24+
There are some modifiers can be used in your opinion on technical topics:
25+
26+
- **scalable**
27+
- **robust**
28+
- **consistent**
29+
- **user-friendly**
30+
- **reusable**
31+
- **seamlessly**
32+
33+
Examples:
34+
35+
1. I like the interface of GitHub; it's very *easy to use and understand*.
36+
I like the interface of GitHub; it's very **user-friendly**.
37+
38+
2. Developers should follow *the same* coding practices.
39+
Developers should follow **consistent** coding practices.
40+
41+
3. Can you explain why a *strong* code review process is important?
42+
Can you explain why a **robust** code review process is important?
43+
44+
4. New features should be integrated *smoothly and without disruptions*.
45+
New features should be integrated **seamlessly** (无缝的).
46+
47+
5. I want you to focus on building components that *can be used many times*.
48+
I want you to focus on building components that **reusable**.
49+
50+
6. Our infrastructure needs to be *able to be made larger* to handle an increase in users.
51+
Our infrastructure needs to be **scalable** to handle an increase in users.
52+
53+
## grammer - Placement of Modifiers
54+
When a modifier isn't used in correct position, it can make the sentence confusing for a reader/listner.
55+
56+
- Incorrect: "The algorithm solved(verb) quickly the problem(noun)."
57+
- Correct: "The algorithm solved the problem quickly."
58+
OR: "The algorithm quickly solved the problem."
59+
60+
Example:
61+
62+
1. **maintainable**: It's important to write code.
63+
It's important to write maintainable code.
64+
65+
2. **briefly**: The comment should describe what each function does.
66+
The comment should briefly describle what each function does.
67+
68+
3. **accurately**: Using a version control system helps to track changes.
69+
Using a version control system helps to accutately track changes.
70+
71+
4. **critical**: Joe mentioned several issues that need immediate attention.
72+
Joe mentioned several critical issues that are needed immediate attention.
73+
74+
5. **constructive**: I want to thank the team for providing feedback.
75+
I want to thank the team for providing constructive feedback.
76+
77+
6. **versatile** (多才多艺的): I spoke with the team and they liked our framework.
78+
I spoke with the team and they liked our versatile framework.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
+++
2+
date = '2025-09-21T8:00:00+08:00'
3+
draft = true
4+
title = 'Morden Javascript Tutorial Part 1- Fundamentals: 11~15'
5+
tags = ['Javascript']
6+
+++
7+

0 commit comments

Comments
 (0)