SSH工具
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
|
Aria2
1
| wget https://raw.githubusercontent.com/P3TERX/aria2.sh/master/aria2.sh && bash aria2.sh
|
lnmp一键安装包
1 2 3 4
| wget http://soft.vpser.net/lnmp/lnmp1.7beta.tar.gz -cO lnmp1.7beta.tar.gz && tar zxf lnmp1.7beta.tar.gz && cd lnmp1.7
wget http://soft.vpser.net/lnmp/lnmp1.6.tar.gz -cO lnmp1.6.tar.gz && tar zxf lnmp1.6.tar.gz && cd lnmp1.6 && LNMP_Auto="y" DBSelect="2" DB_Root_Password="lnmp.org" InstallInnodb="y" PHPSelect="5" SelectMalloc="1" ./install.sh lnmp
|
Screen
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
yum install screen
screen -S t1
ctrl+a d
screen -r t1
|
Rclone
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| yum -y update
yum install fuse fuse-devel -y curl https://rclone.org/install.sh | sudo bash
rclone config
rclone config file
systemctl enable rclone
systemctl restart rclone
systemctl stop rclone
systemctl status rclone
df -h
fusermount -qzu LocalFolder
/usr/bin/rclone mount googleDrive:/test /home/00 \ --umask 0000 \ --default-permissions \ --allow-non-empty \ --allow-other \ --buffer-size 32M \ --dir-cache-time 12h \ --vfs-read-chunk-size 64M \ --vfs-read-chunk-size-limit 1G
|
虚拟内存
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
wget https://www.moerats.com/usr/shell/swap.sh && bash swap.sh
|
多媒体
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
yum install https://github.com/MediaBrowser/Emby.Releases/releases/download/4.4.0.40/emby-server-rpm_4.4.0.40_x86_64.rpm
/usr/sbin/service emby-server restart /usr/sbin/service emby-server start /usr/sbin/service emby-server status /usr/sbin/service emby-server stop
yum install https://downloads.plex.tv/plex-media-server-new/1.18.9.2578-513b381af/redhat/plexmediaserver-1.18.9.2578-513b381af.x86_64.rpm
systemctl enable plexmediaserver.service systemctl start plexmediaserver.service
systemctl status plexmediaserver
service plexmediaserver start service plexmediaserver stop service plexmediaserver restart
|
Nginx
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
| yum install epel-release
yum install nginx
yum remove nginx
sudo systemctl start nginx
sudo systemctl status nginx
nginx -t
sudo systemctl enable nginx
sudo systemctl disable nginx
sudo systemctl stop nginx
sudo systemctl restart nginx
sudo systemctl reload nginx
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
add_header Cache-Control no-store;
charset utf-8,gbk;
add_header Content-Disposition attachment;
ps -ef | grep nginx
sudo systemctl reload nginx
|
Nginx配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| server { listen 10808; server_name us-nat.tiiao.cn us-nat.tiiao.cn; location / { root /var/www/main; autoindex on; autoindex_exact_size off; autoindex_localtime on; charset utf-8,gbk; } location /d { root /usr/share/nginx/html/d; autoindex on; autoindex_exact_size off; autoindex_localtime on; charset utf-8,gbk; }
}
|
Caddy
1 2 3 4 5 6 7 8 9 10 11 12 13
|
sudo systemctl start caddy.service
sudo systemctl restart caddy.service
sudo systemctl stop caddy.service
sudo systemctl status caddy.service
sudo systemctl enable caddy.service
|
Caddy配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| # https: # 配置文件路径 /etc/caddy/Caddyfile # 开启目录浏览,gzip down.nobige.cn{ root /var/www/main gzip browse }
railgun.moe { gzip log /var/log/caddy/railgun_moe.log tls lengz@lengzzz.com root /var/www/ header /api { Access-Control-Allow-Origin * Access-Control-Allow-Methods "GET, POST, OPTIONS" -Server } fastcgi / 127.0.0.1:9000 php { index index.php } rewrite { to {path} {path}/ /index.php?{query} } } lengzzz.com { tls lengz@lengzzz.com log /var/log/caddy/lengzzz_com.log redir / https: }
|
yum源
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| cd /etc/yum.repos.d/ mv CentOS-Base.repo CentOS-Base.repo_bak
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS5-Base-163.repo
wget -O /etc/yum.repos.d/CentOS-Base.repo https://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/centos?codeblock=3
wget -O /etc/yum.repos.d/CentOS-Base.repo https://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/centos?codeblock=2
wget -O /etc/yum.repos.d/CentOS-Base.repo https://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/centos?codeblock=1
epel源: yum -y install epel-release
sudo yum clean all
sudo yum makecache
|
神奇的脚本
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| bash <(curl -s -L https://git.io/v2ray.sh)
wget -N --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubi/doubi/master/ssr.sh && chmod +x ssr.sh && bash ssr.sh
wget -N --no-check-certificate "https://raw.githubusercontent.com/ylx2016/Linux-NetSpeed/master/tcp.sh" && chmod +x tcp.sh && ./tcp.sh
wget -N --no-check-certificate -q -O install.sh "https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/master/install.sh" && chmod +x install.sh && bash install.sh
wget --no-check-certificate https://github.com/tcp-nanqinlang/general/releases/download/3.4.2.1/tcp_nanqinlang-fool-1.3.0.sh bash tcp_nanqinlang-fool-1.3.0.sh
wget --no-check-certificate https://raw.githubusercontent.com/tcp-nanqinlang/general/master/General/CentOS/bash/tcp_nanqinlang-1.3.2.sh bash tcp_nanqinlang-1.3.2.sh
shutdown -r now
mkdir /home/mtproxy && cd /home/mtproxy curl -s -o mtproxy.sh https://raw.githubusercontent.com/ellermister/mtproxy/master/mtproxy.sh && chmod +x mtproxy.sh && bash mtproxy.sh
wget -qO- bench.sh | bash
curl -Lso- bench.sh | bash
|
SELinux
方法
端口查询
1 2 3
| netstat -ntlp //查看当前所有tcp端口 netstat -ntulp | grep 80 //查看所有80端口使用情况 netstat -ntulp | grep 3306 //查看所有3306端口使用情况
|
目录浏览
nginx[宝塔]开启目录浏览模式(nginx autoindex)
在网站 设置 伪静态里边设置如下
1 2 3 4
| autoindex on; autoindex_exact_size off; autoindex_localtime on; charset utf-8,gbk;
|
端口映射
Xshell
putty
mount的基本用法
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
|
防火墙
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
sudo firewall-cmd --zone=public --add-port=6800/tcp --permanent sudo firewall-cmd --zone=public --add-port=80/tcp --permanent sudo firewall-cmd --reload
systemctl restart firewalld
firewall-cmd --state firewall-cmd --list-all
systemctl disable firewalld systemctl stop firewalld systemctl status firewalld
systemctl enable firewalld systemctl start firewalld systemctl status firewalld
|
生成测试文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| dd if=/dev/zero of=32M.bin bs=1M count=32 conv=fdatasync
dd if=/dev/zero of=64M.bin bs=1M count=64 conv=fdatasync
dd if=/dev/zero of=128M.bin bs=1M count=128 conv=fdatasync
dd if=/dev/zero of=256M.bin bs=1M count=256 conv=fdatasync
dd if=/dev/zero of=512M.bin bs=1M count=512 conv=fdatasync
dd if=/dev/zero of=1024M.bin bs=1M count=1024 conv=fdatasync
|
错误
-bash: wget: command not found
解决:yum -y install wget
Try ‘chmod –help’ for more information.
解决:chmod +x xx.sh
或是bash xx.sh
None of the supported tools for extracting zip archives (unzip 7z busybox) were found. Please install one of them and try agai
解决:yum install -y unzip
The nameserver prefix is invalid.
解决:只填NS Prefix前缀,不填.com域名之类,随意填写一些任意单词字母
umount 时出现的 “Device is busy”
umount, 老是提示:device is busy, 服务又不能停止的。
解决:用”umount -fl”解决
mount error(13): Permission denied
1 2 3 4
| mount.cifs //192.168.123.13/dwonload /home/download/ --verbose -o username=root,password=root,iocharset=utf8,uid=0,gid=0
mount.cifs //192.168.123.13/dwonload /home/download/ --verbose -o username=root,password=root,sec=ntlmssp,iocharset=utf8,uid=0,gid=0
|
-bash: netstat: command not found
1
| yum install -y net-tools
|
No package nginx available.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
yum makecache
yum -y install epel-release
yum -y install nginx
|
Nginx目录列表 403 无法显示
- 权限问题,可以尝试添加权限解决问题,即
chmod -R 755 /var/www/main
修改这个目录或者权限和其他目录
- SELinux策略问题,可以通过
sestatus
查看SELinux是否有开启,用sudo setenforce 0
可以临时关闭SELinux模式,用vim /etc/selinux/config
将SELINUX=enforcing改为SELINUX=disabled永可以永久关闭,具体详细可以Google一下,你就知道。
- 用户权限问题,
vim /etc/nginx/nginx.conf
修改user 用户名改为user root
参考