0%

CentOS/RHEL 下载 Docker 源文件

1
wget -O /etc/yum.repos.d/docker-ce.repo https://download.docker.com/linux/centos/docker-ce.repo

把软件仓库地址替换为腾讯源

1
sudo sed -i 's+download.docker.com+mirrors.cloud.tencent.com/docker-ce+' /etc/yum.repos.d/docker-ce.repo
阅读全文 »

安装 hexo

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
root@ox [11:49:31 PM] [~] 
-> # npm install hexo-cli -g
/usr/local/node/v14.16.1/bin/hexo -> /usr/local/node/v14.16.1/lib/node_modules/hexo-cli/bin/hexo
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.1 (node_modules/hexo-cli/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ hexo-cli@4.2.0
added 65 packages from 53 contributors in 71.217s
root@ox [11:52:01 PM] [~]
-> # hexo version
hexo-cli: 4.2.0
os: Linux 3.10.0-1160.el7.x86_64 linux x64
node: 14.16.1
v8: 8.4.371.19-node.18
uv: 1.40.0
zlib: 1.2.11
brotli: 1.0.9
ares: 1.16.1
modules: 83
nghttp2: 1.41.0
napi: 7
llhttp: 2.1.3
openssl: 1.1.1k
cldr: 37.0
icu: 67.1
tz: 2020a
unicode: 13.0
阅读全文 »

卸载 CentOS 自带 Java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
[22:12:54] root :: sun  ➜  ~ » rpm -qa|grep java
java-1.8.0-openjdk-1.8.0.262.b10-1.el7.x86_64
javapackages-tools-3.4.1-11.el7.noarch
tzdata-java-2020a-1.el7.noarch
python-javapackages-3.4.1-11.el7.noarch
java-1.8.0-openjdk-headless-1.8.0.262.b10-1.el7.x86_64
[22:13:44] root :: sun ➜ ~ » yum -y remove java-1.8.0-openjdk-headless.x86_64
Loaded plugins: fastestmirror, langpacks
Resolving Dependencies
Running transaction check
Package java-1.8.0-openjdk-headless.x86_64 1:1.8.0.262.b10-1.el7 will be erased
Processing Dependency: java-1.8.0-openjdk-headless(x86-64) = 1:1.8.0.262.b10-1.el7 for package: 1:java-1.8.0-openjdk-1.8.0.262.b10-1.el7.x86_64
Processing Dependency: libjava.so()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.262.b10-1.el7.x86_64
Processing Dependency: libjava.so(SUNWprivate_1.1)(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.262.b10-1.el7.x86_64
Processing Dependency: libjvm.so()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.262.b10-1.el7.x86_64
Processing Dependency: libjvm.so(SUNWprivate_1.1)(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.262.b10-1.el7.x86_64
Running transaction check
Package java-1.8.0-openjdk.x86_64 1:1.8.0.262.b10-1.el7 will be erased
Processing Dependency: java >= 1.5 for package: jline-1.0-8.el7.noarch
Processing Dependency: java-1.8.0-openjdk for package: icedtea-web-1.7.1-2.el7_6.x86_64
Running transaction check
Package icedtea-web.x86_64 0:1.7.1-2.el7_6 will be erased
Package jline.noarch 0:1.0-8.el7 will be erased
Processing Dependency: jline for package: rhino-1.7R5-1.el7.noarch
Running transaction check
Package rhino.noarch 0:1.7R5-1.el7 will be erased
Finished Dependency Resolution

Dependencies Resolved

========================================================================================================
Package Arch Version Repository Size
========================================================================================================
Removing:
java-1.8.0-openjdk-headless x86_64 1:1.8.0.262.b10-1.el7 @anaconda 109 M
Removing for dependencies:
icedtea-web x86_64 1.7.1-2.el7_6 @anaconda 2.3 M
java-1.8.0-openjdk x86_64 1:1.8.0.262.b10-1.el7 @anaconda 646 k
jline noarch 1.0-8.el7 @anaconda 72 k
rhino noarch 1.7R5-1.el7 @anaconda 1.1 M

Transaction Summary
========================================================================================================
Remove 1 Package (+4 Dependent packages)

Installed size: 113 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Erasing : icedtea-web-1.7.1-2.el7_6.x86_64 1/5
Erasing : rhino-1.7R5-1.el7.noarch 2/5
Erasing : jline-1.0-8.el7.noarch 3/5
Erasing : 1:java-1.8.0-openjdk-1.8.0.262.b10-1.el7.x86_64 4/5
Erasing : 1:java-1.8.0-openjdk-headless-1.8.0.262.b10-1.el7.x86_64 5/5
Verifying : 1:java-1.8.0-openjdk-headless-1.8.0.262.b10-1.el7.x86_64 1/5
Verifying : 1:java-1.8.0-openjdk-1.8.0.262.b10-1.el7.x86_64 2/5
Verifying : rhino-1.7R5-1.el7.noarch 3/5
Verifying : icedtea-web-1.7.1-2.el7_6.x86_64 4/5
Verifying : jline-1.0-8.el7.noarch 5/5

Removed:
java-1.8.0-openjdk-headless.x86_64 1:1.8.0.262.b10-1.el7

Dependency Removed:
icedtea-web.x86_64 0:1.7.1-2.el7_6 java-1.8.0-openjdk.x86_64 1:1.8.0.262.b10-1.el7
jline.noarch 0:1.0-8.el7 rhino.noarch 0:1.7R5-1.el7

Complete!
[22:14:08] root :: sun ➜ ~ »
[22:14:09] root :: sun ➜ ~ »
[22:14:09] root :: sun ➜ ~ » rpm -qa|grep java
javapackages-tools-3.4.1-11.el7.noarch
tzdata-java-2020a-1.el7.noarch
python-javapackages-3.4.1-11.el7.noarch

配置 Java 环境

编辑 ~/.bashrc 文件,添加:

1
2
3
4
5
6
# ---------- PATH ----------
# PATH for java.
export JAVA_HOME=/usr/local/bin/java/jdk1.8.0_231
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH

source ~/.bashrc 使修改生效

date 命令

1
2
[root@ClockworkMonkey ~]# date
Tue Mar 29 22:58:19 CST 2022
阅读全文 »

firewall 服务管理

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 启动
systemctl start firewalld.service

# 停止
systemctl stop firewalld.service

# 重启
systemctl restart firewalld.service

# 服务状态
systemctl status firewalld.service

# 开机时自启
systemctl enable firewalld.service

# 禁用开机时自启
systemctl disable firewalld.service
阅读全文 »