[步骤] Linux 加密压缩 (zip 版)

步骤一:创建测试目录和测试文件

# mkdir test
# touch test/test.txt

(补充:这里以创建 test 目录和里面的 test.txt 文件为例)

步骤二:加密压缩文件或目录

2.1 交互式加密压缩文件或目录

# zip -re test1.zip test
Enter password: 
Verify password: 
  adding: test/ (stored 0%)
  adding: test/test.txt (stored 0%)

(补充:这里以将 test 目录和里面的 test.txt 文件加密压缩成 test1.zip (压缩)包为例)

2.2 非交互式加密解压文件或目录

# zip -rP eternalcenter test2.zip test
  adding: test/ (stored 0%)
  adding: test/test.txt (stored 0%)

(补充:这里以将 test 目录和里面的 test.txt 文件加密压缩成 test2.zip (压缩)包并且将密码设置为 eternalcenter 为例)

步骤三:解压加密文件或目录

3.1 交互式解压加密文件或目录

3.1.1 删除原测试目录和里面的文件
# rm -rf test

(补充:这里以删除 test 目录和里面的文件为例)

3.1.2 交互式解压加密文件或目录
# unzip test2.zip
Archive:  test2.zip
   creating: test/
[test2.zip] test/test.txt password: 
 extracting: test/test.txt

(补充:这里以解压 test2.zip (压缩)包为例)

3.2 非交互式解压加密文件或目录

3.2.1 删除原测试目录和里面的文件
# rm -rf test

(补充:这里以删除 test 目录和里面的文件为例)

3.2.2 非交互式解压加密文件
# unzip -P eternalcenter test1.zip 
Archive:  test1.zip
   creating: test/
 extracting: test/test.txt  

(补充:这里以解压 test2.zip (压缩)包并且解压密码为 eternalcenter 为例)

[FUN] HTML Mingyu Zhu’s Personal Web Page

中文

Code

<html>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<head>

<title>Mingyu Zhu</title>

</head>

<body>

<div style="position:absolute; width:100%; height:100%; z-index:-1; left:0; top:0;"> 
<img src="https://filedn.eu/ltLpz9YGUS2hi1pJmklNfDb/en_us/dimfigure.JPG" height="100%" width="100%" style="position:absolute;left:0; top:0;"> 
</div>

<div style="width:300px;height:50px;float:left"> 
<form action="http://www.google.com/search" method="get"> 
<input type="text" name="q" size="20" maxlength="255" value="" /> 
<input type="submit" name="btnG" value="Google" /> 
</form>
<a href="https://zhu-mingyu.github.io" style="right: 15px; position: absolute; font-size:25px;color:red">中文 (GitHub)</a>
<a href="https://zhumingyu.com" style="right: 215px; position: absolute; font-size:25px;color:red">中文</a>
</div> 

<div style="left: 8px; position: absolute; top: 75px;font-size:45px;">Mingyu Zhu's Personal Web Page</div>

<div style="left: 800px; position: absolute; top: 300px;font-size:15px;">"Hope everyone can achieve self achievement and self happiness fairly."</div>

<a href="http://eternalcenter.com" target="_blank" style="left: 8px; position: absolute; top: 185px;font-size:20px;color:black">Eternal Center (eternalcenter.com), Mingyu Zhu's personal website</a>
<a href="https://e.pcloud.link/publink/show?code=kZukhJZUhQq66Fxs0yg5rL1LsAgrSD3ytMk" target="_blank" style="left: 8px; position: absolute; top: 215px;font-size:20px;color:black">Mingyu Zhu's personal website data for cloning</a>
<a href="https://github.com/eternalcenter-now/eternalcenter-now" target="_blank" style="left: 8px; position: absolute; top: 245px;font-size:20px;color:black">Mingyu Zhu's personal website code for cloning</a>
<a href="http://static.eternalcenter.com" target="_blank" style="left: 8px; position: absolute; top: 275px;font-size:20px;color:black">Effect display page of Mingyu Zhu's personal website</a>
<a href="https://eternalcenter-now.github.io" target="_blank" style="left: 8px; position: absolute; top: 305px;font-size:20px;color:black">Effect display page of Mingyu Zhu's personal website (GitHub)</a>
<a href="https://e.pcloud.link/publink/show?code=kZrJhJZbVIBf8jmVFzumvaYnEwPlLLc34DX" target="_blank" style="left: 8px; position: absolute; top: 335px;font-size:20px;color:black">Public personal data of Mingyu Zhu</a>

</body>

<html/>

Background Picture

[命令] Linux 命令 ping (检测网络联通性)

内容一:ping 命令选项

1) -c 设置 ping 的次数 (默认会一直 ping)
2) -d 开启 Socket 的 SO_DEBUG 功能
3) -f 进行极限测试
4) -i 设置间隔时间,建议值为 0.4
5) -I 指定去 ping 的硬件设备或者 IP 地址
6) -m 设置标记
7) -l 设置发送不等待回复的数据包
8) -n 只显示数值
9) -q 只显示结果
10) -r 忽略路由表(可以用于检查本地网络接口是否有问题)
11) -R 记录路由的过程
12) -s 指定包的大小
13) -S 指定源 IP 地址
14) -t 设置 ping 包的生存时间 (TLL)
15) -v 输出详细信息
16) -w 设置 deadline,建议值为 0.8

内容二:ping 命令案例

2.1 案例一:让本地的某个 IP 地址 ping 目标 IP 地址

# ping -I 192.168.0.2 192.168.0.1

(补充:这里以本地的 IP 地址 192.168.0.2 ping 目标 IP 地址 192.168.0.1 为例)

2.2 案例二:让本地的某个网卡 ping 目标 IP 地址


# ping -I eth0 192.168.0.1

(补充:这里以本地的网卡 eth0 ping 目标 IP 地址 192.168.0.1 为例)

2.3 案例三:快速检测网络联通行

# ping -c 3 -i 0.4 -w 0.8 192.168.0.1

(补充:这里 ping 目标 IP 地址 192.168.0.1,同时只 ping 3 次、间隔 0.4 秒、等待 0.8 秒为例)

[命令] Linux 命令 set (设置 Shell 里的位置变量或者 Shell 的执行方式)

内容一:set 命令的格式

1.1 set 命令在 Shell 中设置位置变量的格式

# set <Value of the first position variable> <Value of the second location variable> ......

1.2 set 命令在命令行中的格式

# set -[optional parameter] -o [option]

内容二: set 的常用参数

1) -a 将已修改的变量进行标记,为将其输出至环境变量做准备
2) -b 让被中止的后台进程立刻显示退出状态代码
3) -d 取消使用杂凑表记忆中使用过的指令
4) -e 若返回状态代码不为 0 (状态代码为 0 则代表正常) 则立即退出 Shell,并显示错误原因
5) -f 取消通配符
6) -h 默认自动记录函数位置
7) -k 让命令的参数为此命令的环境变量
8) -l 默认自动记录 for 循环变量名
9) -m 监视模式
10) -n 测试模式(只读取不执行)
11) -p 优先顺序模式
12) -P 让文件或目录代替符号链接
13) -t 让随后的命令执行后立即退出
14) -u 使用未定义的变量时显示错误信息
15) -v 显示输入值
16) -H shell 使用感叹号 “!” + 号码的方式调用 history 命令中的历史命令
17) -x 命令指向前先显示此命令的参数或变量
18) -o <option> 设置特殊属性,set 的特殊属性有很多,大部分的功能和上面的相同


补充:
1) 将以上参数前面的 – 换成 + 则会变成相反的效果
2) 直接使用 — 命令可以清除所有参数,例如:set —

内容三:set 命令的案例

3.1 set 命令在 Shell 中设置位置变量的案例

# set a1 b2 c2
# echo $1 $2 $3
a1 b2 c2

(补充:这里以给位置变量 1、位置变量 2、位置变量 3 分别设置值 a1、b2、c3 为例)

3.2 set 命令在 命令行中显示所有变量的案例

# set