前言
有时候会遇到Linux
的源更新速度非常的缓慢,特别是在国内使用默认的源,因为国内的网络环境,经常会出现无法更新,更新缓慢的情况。在这种情况下,更换一个更适合或者说更近,更快的软件源,会为你的Linux
安装更新操作更加的流畅和顺利。
使用
系统要求:CentOS 5+
、Ubuntu 14.04+
、Debian 7+
使用命令:
#下载脚本
wget git.io/superupdate.sh
#运行脚本
bash superupdate.sh
如果第一步你出现错误或执行后无任何输出,请检查是否安装wget
和ca-certificates
,使用命令:
#Debian、Ubuntu
apt-get install -y wget && apt-get install -y ca-certificates
#CentOS
yum install -y wget && yum install -y ca-certificates
对于Debian
默认换源为Fastly CDN
的mirror
这个源有Fastly
的加持对境外主机都有不错的速度。对于Ubuntu
和 CentOS
系统都默认换为阿里云的mirror
,这个源有阿里云全球CDN
的加持,全球都有不错的速度。
对于Debian
系统还设置了四套其他的源,阿里云,CloudFront CDN
,网易163
,中科大的源,请根据需要使用参数一键设置如:
bash superupdate.sh cn
bash superupdate.sh 163
bash superupdate.sh aliyun
bash superupdate.sh aws
如果配置的文件不满意,一键还原
bash superupdate.sh restore
原创文章,作者:南猫,如若转载,请注明出处:https://southcat.net/2268/
不妨点个广告再走嘛
相关推荐
-
Linux Centos下Nginx反向代理教程
系统要求:CentOS系统,内存64MB及以上、80端口没有被占用 1、安装EPEL repo rpm -Uvh http://mirror.ancl.hawaii.edu/linux/epel/6/i386/epel-release-6-8.noarch.rpm EPEL repo下载地址:https://fedoraproject.org/wiki/EPEL 2、安装Nginx安装Nginx yum install nginx -y 调整Nginx配置 cd /etc/nginx/conf.d mv default.conf default.conf.disabled 3、创建Nginx反代配置文件 cd /etc/nginx/conf.d vi yourdomain.com 粘贴以下内容: server { listen 80; server_name yourdomain.com; access_log off; error_log off; location / { proxy_pass http://需要反代的服务器IP/; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_max_temp_file_size 0; client_max_body_size 10m; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; } } 然后保存。 service nginx start
-
使用Docker安装Aria2+AriaNg+Filebrowser,可离线BT下载/在线播放
说明:博主好像水了很多离线BT下载的Docker镜像,刚好还有Filebrowser文件管理没水,Filebrowser估计很多人没听过但用过,之前就叫FileManager,只是改名了而已,该文件管理器很强大,有在线PDF、图片、视频浏览、上传下载、打包下载等功能。博主就自己用alpine系统给制作了个Docker镜像,这里就分享下,顺便把一键脚本和手动安装也水下。 截图 Docker安装 1、安装Docker使用以下命令: #CentOS 6 rpm -iUvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm yum update -y yum -y install docker-io service docker start chkconfig docker on #CentOS 7、Debian、Ubuntu curl -sSL https://get.docker.com/ | sh systemctl start docker systemctl enable docker 2、安装Aria2+AriaNg+Filebrowser #由于我们可以直接在Filebrowser里进行删减文件,所以这里就暂时不把下载目录映射出来了 docker run --name ccaa -d -p 6800:6800 -p 6080:6080 moerats/ccaa:latest 然后就安装好了。 #大致信息如下 AriaNg界面:http://ip:6080 访问界面用户名密码分别为:admin、moerats Aria2密匙:moerats Filebrowser访问地址:http://ip:6080/admin,也可以通过AriaNg界面上方的文件管理按钮进入 如果我们Web界面进不去,就需要开启防火墙,一般出现在CentOS 6/7。 #CentOS 6 iptables -I INPUT -p tcp --dport 6080 -j ACCEPT iptables -I INPUT -p tcp --dport 6800 -j ACCEPT service iptables save service iptables restart #CentOS 7 firewall-cmd --zone=public --add-port=6080/tcp --permanent firewall-cmd --zone=public --add-port=6800/tcp...
-
IPinfo:一款整合了多接口的IP地址查询工具
简介 网上已经有很多IP查询工具了,但是数据参差不齐,结果存在偏差,于是IPinfo整合了多个IP查询接口,包括ipip.net、淘宝、新浪、GeoIP,方面对查询结果进行对比。 截图 搭建 IPinfo使用PHP开发,您可以访问:master.zip下载源码,放到您的PHP环境中就可以运行了,真正做到开箱即用。 频次限制 IPinfo用的都是免费接口,所以在查询次数方面会受到限制,具体如下。 ipip.net:限速每天1000次。 淘宝:访问频率需小于10qps。 数据对比 ipip.net:可能是国内最精准的IP查询。 淘宝:准确度也不错。 新浪:感觉IP库好久没更新了,不是很准确。 GeoIP:查询国外的IP比较准确。 其它
-
使用Linux VPS自动删除在百度贴吧的一切回复(黑历史)
说明:我们很多人小时候不懂事,到处发自己的个人信息,家人信息等,导致这些信息在网上就会随时被搜索到,很可能会被一些别有用心的人利用,特别是和自己闹过矛盾的网友,严重的会影响自己的生活,最近一个朋友就遇到了,所以这里博主就提一下,一般以前使用最多社交软件也就是贴吧了,所以建议在贴吧留过自己的信息的人可以都删掉,以防万一。如果回复的帖子太多,每天删除都被限制,可能会导致我们没耐心或没时间天天去删,这里就说下使用VPS自动删除贴吧回复的方法。 使用 Github地址:https://github.com/rmb122/Delete-my-hisroy-in-tieba 1、安装Python3一般大多数Ubuntu自带Python3,而Centos、Debian就需要我们安装了。 #查看是否有Python3 python3 -V #安装Python3 #CentOS系统 wget https://www.southcat.net/usr/shell/Python3/CentOS_Python3.6.sh && sh CentOS_Python3.6.sh #Debian系统 wget https://www.southcat.net/usr/shell/Python3/Debian_Python3.6.sh && sh Debian_Python3.6.sh 然后再输入python3 -V看是否安装成功。 2、下载源码 #CentOS系统 yum install git -y #Ubuntu和Debian系统 apt-get install git -y #下载源码 git clone https://github.com/rmb122/Delete-my-hisroy-in-tieba.git cd Delete-my-hisroy-in-tieba #安装依赖 pip3 install -r requirements.txt 3、使用先获取贴吧的Cookie,且为JSON格式,这里可以借助浏览器的Edit This Cookie插件,先打开浏览器拓展,搜索该插件安装,然后登录贴吧,点击浏览器上面的EditThisCookie按钮,并导出Cookie。再编辑cookie.json文件,将Cookie全部替换进去。 cd /root/Delete-my-hisroy-in-tieba nano cookie.json 替换好了后,使用Ctrl+x,y保存退出。 再运行工具: python3 Delete-reply.py 会输出以下画面:如果你的回复很多,一天是删不完的,因为有限制,所以就需要个定时任务,一天运行一次,直到删完为止,查看:Linux系统Crontab的安装及定时任务的命令详解。
-
Debian/Ubuntu开启超级暴力版魔改BBR教程
说明:超级暴力版魔改BBR源码由南琴浪大佬提供,具体有多暴力博主暂时没怎么测试,这里只说下安装教程。 安装 系统要求:Debian/Ubuntu系统,内核版本v4.9.3-v4.12.x。得安装gcc,Makefile默认只支持gcc 6,你可以修改它(例如)gcc-4.9。 1、更换内核并开启BBR这里手动安装,方法从BBR刚出来时就在博客说过,这里再说一次。内核下载地址:http://kernel.ubuntu.com/~kernel-ppa/mainline/。且魔改BBR需要3个内核linux-image、linux-headers-all、linux-headers-$bit,这里以v4.10.1为例。 内核下载 #64位系统 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.10.1/linux-headers-4.10.1-041001-generic_4.10.1-041001.201702260735_amd64.deb wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.10.1/linux-headers-4.10.1-041001_4.10.1-041001.201702260735_all.deb wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.10.1/linux-image-4.10.1-041001-generic_4.10.1-041001.201702260735_amd64.deb #32位系统 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.10.1/linux-headers-4.10.1-041001-generic_4.10.1-041001.201702260735_i386.deb wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.10.1/linux-headers-4.10.1-041001_4.10.1-041001.201702260735_all.deb wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.10.1/linux-image-4.10.1-041001-generic_4.10.1-041001.201702260735_i386.deb 内核安装,且安装顺序不要变,依次image、headers_all、headers,不然会出错。 dpkg -i linux-image-4.10.1-041001-generic_4.10.1-041001.201702260735_i386.deb dpkg -i linux-headers-4.10.1-041001_4.10.1-041001.201702260735_all.deb dpkg -i linux-headers-4.10.1-041001-generic_4.10.1-041001.201702260735_i386.deb 查看内核 dpkg -l|grep linux-image dpkg -l|grep linux-headers 删除旧内核 apt-get purge (旧内核名称) 内核更新 update-grub 重启 reboot 保存生效 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 显示以下即启动成功 # lsmod | grep bbr tcp_bbr 20480 14 2、安装超级暴力版魔改BBR安装环境 apt install -y gcc git make 下载暴力魔改BBR源码 git clone https://github.com/nanqinlang/tcp_nanqinlang-test.git 查看/usr/bin文件夹gcc文件。 find /usr/bin/gcc* 此时可以看到几个文件,找到gcc-5,也可以是6,具体自己看着办。如果没看到gcc-6,则需要编辑Makefile文件。 cd tcp_nanqinlang* nano Makefile 将modules CC=/usr/bin/gcc-6后面的gcc修改成刚刚看到的gcc版本文件,如gcc-5。 安装暴力魔改BBR...
-
使用LNMP常见问题解答
一、LNMP的安装 ##先要下载,并根据不同系统进行安装: wget -c http://soft.vpser.net/lnmp/lnmp1.3.tar.gz tar zxvf lnmp1.3.tar.gz cd lnmp1.3 ./install.sh #开始进行安装操作 以上为下载及进入安装过程,以下为安装前简易设置,切记输入个其它域名及牢记mysql密码: +------------------------------------------------------------------------+ | LNMP V1.2 for Ubuntu Linux Server, Written by Licess | +------------------------------------------------------------------------+ | A tool to auto-compile & install LNMP/LNMPA/LAMP on Linux | +------------------------------------------------------------------------+ | For more information please visit http://www.lnmp.org | +------------------------------------------------------------------------+ Please setup root password of MySQL.(Default password: root) Please enter: southcat.net #输入mysql的root密码 MySQL root password: southcat.net =========================== Do you want to enable or disable the InnoDB Storage Engine? Default enable,Enter your choice [Y/n]: n #是否安装InnoDB You will disable the InnoDB Storage Engine! ===========================...
-
OpenVZ平台Google BBR加速TCP之Rinetd方式
简介 Rinetd这种方式其实两三个月前就已经有了,是v2ex网友@linhua的成果,他直接将BBR内置到了Rinetd里边,比较方便的就能配置出来。也就是由于配置比较简单,先说一下手动搭建的方法。后续扩软博主可能会制作出通用的rinetd-bbr一键脚本,到时候更新一键包方法。 手动安装 Github地址:https://github.com/linhua55/lkl_study系统支持:仅支持64位系统。1、下载文件到/usr/bin/rinetd-bbr wget -O /usr/bin/rinetd-bbr https://github.com/linhua55/lkl_study/releases/download/v1.2/rinetd_bbr_powered 2、设置权限 chmod a+x /usr/bin/rinetd-bbr 3、创建配置文件 vi /etc/rinetd-bbr.conf 输入以下内容 # bindadress bindport connectaddress connectport 0.0.0.0 443 0.0.0.0 443 其中的443请改为你的端口,IP地址统一写0.0.0.0。 4、获取接口名称 # ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN link/void inet 127.0.0.2/32 scope host venet0 inet 10.10.10.10/32 brd 10.10.10.10 scope global venet0:0 看具有公网IP的接口名称(比如我的公网IP是10.10.10.10),上面这种的接口是venet0:0而不是venet0,搬瓦工的OpenVZ应该都是venet0:0接口。 5、启动 /usr/bin/rinetd-bbr -f -c /etc/rinetd-bbr.conf raw venet0:0 & 注意:将最后的接口改为你上面获取到的接口。在命令最后面加&以使其能后台运行。 验证 正常情况下的输出:...
-
LNMP网站出现No input file specified解决办法
说明:有时候更改网站目录后,没修改.user.ini的时候网站会出现No input file specified该错误。这时可以通过修改.user.ini文件中的网站目录路径来解决。 提示:.user.ini文件无法直接修改,而且是隐藏文件,用WinSCP工具的话,需要打开隐藏文件选项,建议用vim编辑。 1、编辑权限 chattr -i /网站目录/.user.ini #操作此步骤后才可编辑 2、重新授权 chattr +i /网站目录/.user.ini /etc/init.d/php-fpm restart
-
Vultr利用快照备份Snapshots功能快速的备份和迁移资料
说明:用了那么久的Vultr,直到今天才发现Vultr还有快照备份Snapshots功能,试了一下后感觉很好用,特别是对于我们经常喜欢换节点服务器的,其实很多商家都有提供Snapshots快照功能,不过别太依赖这个了,都会有翻车的时候,还是乖乖的手动备份下数据。 方法 1、备份数据进入Vultr面板,点击Snapshots选项,选择Add Snapshot,然后在Label那里填一个标签,再点击Take Snapshot。等待备份完成之后,我们才可以去创建。
-
Debian免编译快速安装PHP(v5.6,v7.0,v7.1)教程
说明:这里安装PHP将完全不编译任何组件,完全依赖软件源安装。提供PHP软件源的Ondřej Surý大神是Debian社区中PHP源的维护者,所以无需担心软件的安全和性能问题肯定比我们自己编译更好,软件源安装的PHP默认以Unix Socket的状态运行在/run/php/php7.1-fpm.sock,比使用TCP以localhost:9000的方式性能更好。 安装 适用系统:Debian 9/Debian 8 1、安装软件源拓展Sury官方默认源:https://packages.sury.org/php/镜像源:https://mirror.xtom.com.hk/sury/php/ 添加GPG wget -O /etc/apt/trusted.gpg.d/php.gpg https://mirror.xtom.com.hk/sury/php/apt.gpg 安装apt-transport-https apt-get install apt-transport-https 添加sury软件源 sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' 更新软件源缓存 apt-get update 2、安装PHP安装PHP7.1: apt install php7.1-fpm php7.1-mysql php7.1-curl php7.1-gd php7.1-mbstring php7.1-mcrypt php7.1-xml php7.1-xmlrpc php7.1-zip php7.1-opcache -y 安装PHP7.0: apt install php7.0-fpm php7.0-mysql php7.0-curl php7.0-gd php7.0-mbstring php7.0-mcrypt php7.0-xml php7.0-xmlrpc php7.0-zip php7.0-opcache -y 安装PHP5.6: apt install php5.6-fpm php5.6-mysql php5.6-curl php5.6-gd php5.6-mbstring php5.6-mcrypt php5.6-xml php5.6-xmlrpc php5.6-zip php5.6-opcache -y 3、设置PHP这里以PHP7.1为例,其他版本仅需将版本号改成自己所用的即可。安装完成后,编辑/etc/php/7.1/fpm/php.ini替换;cgi.fix_pathinfo=1为cgi.fix_pathinfo=0。快捷命令: sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/' /etc/php/7.1/fpm/php.ini 4、管理PHP安装好了先重启一下! 更多操作: systemctl restart php7.1-fpm #重启 systemctl start php7.1-fpm #启动 systemctl stop...