# info
# 脚本测试
curl -Lso- https://raw.githubusercontent.com/oooldking/script/master/superbench.sh | bash
# 看开放的端口
netstat -lntup
# 看有连接的端口
netstat -ant
# 看进程
ps aux
htop
# 搜索文件 位置 and 条件
find / -name *.sh
# 搜索目录内的指定文本内容 grep -irn "条件" 位置
grep -irn "rsa" /root/.ssh
grep -irn PasswordAuthentication /etc/ssh/sshd_config
# DNS
# 国外
cat > /etc/resolv.conf<<-EOF
nameserver 8.8.8.8
nameserver 1.1.1.1
options timeout:1 rotate
EOF
# 国内
cat > /etc/resolv.conf<<-EOF
nameserver 223.5.5.5
nameserver 114.114.114.114
options timeout:1 rotate
EOF
# 查看本机外网IP
curl myip.ipip.net
# 查看指定端口占用
netstat -tunlp |grep 22
# Centos7
yum -y install net-tools git wget
# 升级软件
yum --exclude=kernel* update
# 升级软件+内核
yum -y update
# SSH
# 开启密码登陆
sed -i 's/^.*PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config;
# 禁用密码登录
if [ -z "grep ^PasswordAuthentication /etc/ssh/sshd_config
" ]; then
sed -i "s@^#PasswordAuthentication.*@&\nPasswordAuthentication no@" /etc/ssh/sshd_config
else
sed -i "s@^PasswordAuthentication.*@PasswordAuthentication no@" /etc/ssh/sshd_config
fi
# 重启sshd服务
service sshd restart;
/etc/init.d/ssh restart;
# 查看当前ssh端口
grep ^Port /etc/ssh/sshd_config | awk '{print $2}'
# 场景列表
screen -list
# 安装场景
yum -y install screen
# 恢复场景
screen -r asf
# 创建场景
screen -S asf
# bitwarden
docker pull bitwardenrs/server:latest
docker kill bitwarden
docker rm bitwarden
docker run -d --name bitwarden -v /home/bwdata/:/data/ -p 3000:80 bitwardenrs/server:latest
#docker logs --tail 30 -f bitwarden
docker logs bitwarden
# -----------
docker image ls
docker image rm 多余的镜像
# Linux-NetSpeed
bash <(curl -fsL mcnb.top/tcp.sh)
# debian 8+ 开启bbr
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
sysctl -p
# 观察BBR是否开启成功,执行以下代码:
sysctl net.ipv4.tcp_available_congestion_control && sysctl net.ipv4.tcp_congestion_control && lsmod | grep bbr
# 反馈结果都有bbr, 则证明你的内核已开启bbr