Skip to content

Ecs


PS1

export PS1='\[\e[32;40m\]\h\[\e[35;40m\]@\[\e[33;40m\]forever\[\e[0m\](\W)\[\e[35;40m\]->\[\e[0m\]

Sysctl.conf

vim /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr
net.ipv4.ip_forward = 1

Repo

vim /etc/yum.repos.d/CentOS-Base.repo
mirrors.tuna.tsinghua.edu.cn
yum install epel-release -y

sed -i '/^baseurl/s/mirrors.baidubce.com/mirrors.tuna.tsinghua.edu.cn/' /etc/yum.repos.d/epel*

Yum

yum install -y     vim  wget gcc gcc-c++ make bzip2     psmisc vnstat ncdu initscripts htop ack lsof iftop     NetworkManager NetworkManager-tui bind-utils     iotop iftop mc

# 定时自动更新
yum install -y yum-cron
sed -i 's/^apply_updates = no/apply_updates = yes/' /etc/yum/yum-cron.conf
systemctl enable --now yum-cron

Python

yum install -y python python-pip
cat > ~/.pip/pip.conf <<EOF
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple/
EOF
pip install -U pip
yum install -y python-docs python-devel
pip install -U pip setuptools
pip install -U glances