linux-tutorial/codes/linux/sys/README.md
2019-05-10 11:25:59 +08:00

96 lines
3.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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