linux-tutorial/codes/linux/sys/README.md

96 lines
3.0 KiB
Markdown
Raw Normal View History

2019-02-22 18:57:46 +08:00
# 脚本使用说明
> 建议按照顺序执行本文脚本。
<!-- TOC depthFrom:2 depthTo:3 -->
- [替换 yum repo 源](#替换-yum-repo-源)
2019-02-22 19:15:35 +08:00
- [安装基本工具(可选)](#安装基本工具可选)
- [安装常见 lib](#安装常见-lib)
2019-02-22 18:57:46 +08:00
- [关闭防火墙](#关闭防火墙)
- [设置 DNS](#设置-dns)
- [设置 ntp](#设置-ntp)
<!-- /TOC -->
## 替换 yum repo 源
由于 CentOS 默认 yum 源,访问速度很慢,所以推荐使用国内镜像。
使用方法:执行以下任意命令即可执行脚本。
```sh
2019-05-10 11:25:59 +08:00
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/yum/change-yum-repo.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/yum/change-yum-repo.sh | bash
2019-02-22 18:57:46 +08:00
```
2019-02-22 19:15:35 +08:00
## 安装基本工具(可选)
2019-02-22 18:57:46 +08:00
2019-02-22 19:15:35 +08:00
工具清单(可以根据需要,在 install-tools.sh 中把不需要的工具注掉):
2019-02-22 18:57:46 +08:00
```
# 核心工具df、du、chkconfig
2019-02-22 19:15:35 +08:00
# 网络工具ifconfig、netstat、route、iptables
2019-02-22 18:57:46 +08:00
# IP工具ip、ss、ping、tracepath、traceroute
# DNS工具dig、host、nslookup、whois
# 端口工具lsof、nc、telnet
# 下载工具curl、wget
# 编辑工具emacs、vim
# 流量工具iftop、nethogs
# 抓包工具tcpdump
# 压缩工具unzip、zip
2019-02-22 19:15:35 +08:00
# 版本控制工具git、subversion
2019-02-22 18:57:46 +08:00
```
使用方法:执行以下任意命令即可执行脚本。
```sh
2019-05-10 11:25:59 +08:00
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/install-tools.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/install-tools.sh | bash
2019-02-22 19:15:35 +08:00
```
## 安装常见 lib
lib 清单(可以根据需要,在 install-libs.sh 中把不需要的工具注掉):
```
# gcc gcc-c++ kernel-devel libtool
# openssl openssl-devel
# zlib zlib-devel
# pcre
```
使用方法:执行以下任意命令即可执行脚本。
```sh
2019-05-10 11:25:59 +08:00
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/install-libs.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/install-libs.sh | bash
2019-02-22 18:57:46 +08:00
```
## 关闭防火墙
使用方法:执行以下任意命令即可执行脚本。
```sh
2019-05-10 11:25:59 +08:00
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/stop-firewall.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/stop-firewall.sh | bash
2019-02-22 18:57:46 +08:00
```
## 设置 DNS
使用方法:执行以下任意命令即可执行脚本。
```sh
2019-05-10 11:25:59 +08:00
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/set-dns.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/set-dns.sh | bash
2019-02-22 18:57:46 +08:00
```
## 设置 ntp
使用方法:执行以下任意命令即可执行脚本。
```sh
2019-05-10 11:25:59 +08:00
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/set-ntp.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/set-ntp.sh | bash
2019-02-22 18:57:46 +08:00
```