前言

这是我自己记录一些代码的页面

CentOS7

libsodium

yum install m2crypto gcc -y
wget -N --no-check-certificate https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz
tar zfvx libsodium-1.0.18.tar.gz
cd libsodium-1.0.18
./configure
make && make install
echo "include ld.so.conf.d/*.conf" > /etc/ld.so.conf
echo "/lib" >> /etc/ld.so.conf
echo "/usr/lib64" >> /etc/ld.so.conf
echo "/usr/local/lib" >> /etc/ld.so.conf
ldconfig

中文

localectl  set-locale LANG=zh_CN.UTF8

主机名

hostnamectl set-hostname xxx

bbr

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
yum install https://www.elrepo.org/elrepo-release-7.0-4.el7.elrepo.noarch.rpm
yum --enablerepo=elrepo-kernel install kernel-ml -y
awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg 
grub2-set-default 0
reboot
echo "net.core.default_qdisc = fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control = bbr" >> /etc/sysctl.conf
sysctl -p

验证

sysctl net.ipv4.tcp_available_congestion_control

openssl升级

wget https://www.openssl.org/source/openssl-1.1.1d.tar.gz
tar -zxvf openssl-1.1.1d.tar.gz
cd openssl-1.1.1d
./config --prefix=/usr/local/openssl   #如果此步骤报错,需要安装perl以及gcc包
make && make install
mv /usr/bin/openssl /usr/bin/openssl.old
mv /usr/lib64/openssl /usr/lib64/openssl.old
mv /usr/lib64/libssl.so /usr/lib64/libssl.so.old
ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/openssl/include/openssl /usr/include/openssl
ln -s /usr/local/openssl/lib/libssl.so /usr/lib64/libssl.so
echo "/usr/local/openssl/lib" >> /etc/ld.so.conf
ldconfig -v                    # 设置生效

Ubuntu18

libsodium

apt-get install build-essential
wget -N --no-check-certificate https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz
tar zfvx libsodium-1.0.18.tar.gz
cd libsodium-1.0.18
./configure
make && make install
ldconfig

Debian10

中文

apt-get install locales
dpkg-reconfigure locales

BBR

1.修改系统变量&保存生效

echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
sysctl -p

查看bbr是否启动

lsmod | grep bbr

Docker安装

apt install apt-transport-https ca-certificates curl software-properties-common gnupg2
curl -fsSL https://download.docker.com/linux/debian/gpg |  apt-key add -
 add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
apt update
apt install docker-ce

修改主机名

hostnamectl set-hostname xxx(更改主机名为xxx)

Debian9升级Debian10

apt update && apt upgrade -y
sed -i 's/stretch/buster/g' /etc/apt/sources.list
apt update && apt upgrade -y
apt dist-upgrade -y

验证版本:

lsb_release -a

沉淪在無盡的深淵中