Skip to content

Commit e3628fc

Browse files
authored
doc: update docker.md & linux-command.md & nginx.md (#838)
* doc: update linux-command.md * 增加代理构建 * 删除上次提交多余
1 parent 184ec1c commit e3628fc

File tree

3 files changed

+19
-38
lines changed

3 files changed

+19
-38
lines changed

docs/docker.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ $ docker build - < Dockerfile
163163
$ docker build - < context.tar.gz
164164
$ docker build -t eon/nginx-server .
165165
$ docker build -f myOtherDockerfile .
166+
$ docker build --build-arg https_proxy=127.0.0.1:8088 # 使用http代理构建
166167
$ curl example.com/remote/Dockerfile | docker build -f - .
167168
$ docker save -o <保存路径>/myimage.tar myimage:latest # 导出
168169
$ docker load -i <路径>/myimage.tar # 导入

docs/linux-command.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Linux 命令速查表
2424
**`w`** | 显示系统中当前登录的用户
2525
**`whoami`** | 显示您的登录身份
2626
**`finger username`** | 显示有关用户的信息
27+
**`sed -ri 's/.*swap.*/#&/' /etc/fstab && swapoff -a`** | 关闭swap
2728
<!--rehype:className=style-list-->
2829

2930
### 硬件
@@ -332,6 +333,23 @@ Linux 命令速查表
332333
`Ctrl`+`N` (Down) | 下一条命令
333334
<!--rehype:className=left-align shortcuts-->
334335

336+
技巧
337+
---
338+
339+
### linux技巧
340+
<!--rehype:wrap-class=row-span-2 col-span-2-->
341+
342+
:--- | :---
343+
:----------------------------------------------| :---
344+
**`du -h / \| sort -rh \| head -20`** | 最大20个文件
345+
**`grep -Ev '^\s*($\|#\|;)' example.conf`** | 查看去掉注释和空行
346+
**`echo <passwd> \| passwd root --stdin`** | 单行改密码
347+
**`find /data/app/tmp -mtime +30 -name "*.flv" -exec rm -Rf {} \;`** | 删除30天前文件
348+
**`for file in $(ls); do sed -i 's/nmg/sz/g' "$file"; done`** | 当前目录修改字符串
349+
**`ssh -NfR remote_port:localhost:local_port user@remote_server`** | ssh代理
350+
**`find . -wholename "*.sh" -exec dos2unix {} \;`** | 修复脚本格式错误
351+
<!--rehype:className=left-align shortcuts-->
352+
335353
另见
336354
---
337355

docs/nginx.md

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -975,44 +975,6 @@ server {
975975
}
976976
```
977977

978-
### 流量镜像配置
979-
<!--rehype:wrap-class=col-span-3-->
980-
981-
```nginx
982-
server {
983-
listen 80;
984-
server_name 192.168.1.1;
985-
986-
location = /mirror1 {
987-
internal;
988-
#### address1 ####
989-
proxy_set_header Host mirror1.com;
990-
proxy_pass http://127.0.0.1:8008/api/service/list;
991-
}
992-
993-
location = /mirror2 {
994-
internal;
995-
#### address2 ####
996-
proxy_set_header Host mirror2.com;
997-
proxy_pass http://127.0.0.1:8009/api/service/list;
998-
}
999-
1000-
# 只转发这个接口
1001-
location /api/service/list {
1002-
access_log /data/logs/nginx/json_test_to_mirror.log json;
1003-
mirror /mirror1;
1004-
mirror /mirror2;
1005-
proxy_pass http://127.0.0.1:8007;
1006-
}
1007-
1008-
location / {
1009-
access_log /data/logs/nginx/json_test.log json;
1010-
proxy_pass http://192.168.1.1:8007;
1011-
}
1012-
1013-
}
1014-
```
1015-
1016978
另见
1017979
---
1018980

0 commit comments

Comments
 (0)