File tree Expand file tree Collapse file tree 3 files changed +19
-38
lines changed Expand file tree Collapse file tree 3 files changed +19
-38
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,7 @@ $ docker build - < Dockerfile
163
163
$ docker build - < context.tar.gz
164
164
$ docker build -t eon/nginx-server .
165
165
$ docker build -f myOtherDockerfile .
166
+ $ docker build --build-arg https_proxy=127.0.0.1:8088 # 使用http代理构建
166
167
$ curl example.com/remote/Dockerfile | docker build -f - .
167
168
$ docker save -o < 保存路径> /myimage.tar myimage:latest # 导出
168
169
$ docker load -i < 路径> /myimage.tar # 导入
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ Linux 命令速查表
24
24
** ` w ` ** | 显示系统中当前登录的用户
25
25
** ` whoami ` ** | 显示您的登录身份
26
26
** ` finger username ` ** | 显示有关用户的信息
27
+ ** ` sed -ri 's/.*swap.*/#&/' /etc/fstab && swapoff -a ` ** | 关闭swap
27
28
<!-- rehype:className=style-list-->
28
29
29
30
### 硬件
@@ -332,6 +333,23 @@ Linux 命令速查表
332
333
` Ctrl ` +` N ` (Down) | 下一条命令
333
334
<!-- rehype:className=left-align shortcuts-->
334
335
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
+
335
353
另见
336
354
---
337
355
Original file line number Diff line number Diff line change @@ -975,44 +975,6 @@ server {
975
975
}
976
976
```
977
977
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
-
1016
978
另见
1017
979
---
1018
980
You can’t perform that action at this time.
0 commit comments