修复CentOS升级过程中出现的package is a duplicate with的错误

服务器CentOS 7升级过程中出现中断,再次运行yum update则出现大量的包重复问题。

错误内容大致如下:

glibc-2.12-1.107.el6_4.5.x86_64 is a duplicate with glibc-2.12-1.107.el6_4.4.x86_64
glibc-common-2.12-1.107.el6_4.5.x86_64 is a duplicate with glibc-common-2.12-1.107.el6_4.4.x86_64
glibc-devel-2.12-1.107.el6_4.5.x86_64 is a duplicate with glibc-devel-2.12-1.107.el6_4.4.x86_64
glibc-devel-2.12-1.107.el6_4.5.x86_64 has missing requires of glibc-headers = ('0', '2.12', '1.107.el6_4.5')
iputils-20071127-17.el6_4.2.x86_64 is a duplicate with iputils-20071127-17.el6_4.x86_64
nspr-4.9.5-2.el6_4.x86_64 is a duplicate with nspr-4.9.2-1.el6.x86_64
nss-3.14.3-4.el6_4.x86_64 is a duplicate with nss-3.14.0.0-12.el6.x86_64
nss-softokn-3.14.3-3.el6_4.x86_64 is a duplicate with nss-softokn-3.12.9-11.el6.x86_64
nss-util-3.14.3-3.el6_4.x86_64 is a duplicate with nss-util-3.14.0.0-2.el6.x86_64
tzdata-2013g-1.el6.noarch is a duplicate with tzdata-2013c-2.el6.noarch
2:xinetd-2.3.14-39.el6_4.x86_64 is a duplicate with 2:xinetd-2.3.14-38.el6.x86_64

解决:

1,需要安装yum-utils

yum install yum-utils -y

2,清除yum缓存

yum clean all

3,列出重复的包

package-cleanup --dupes

4,删除重复的包

package-cleanup --cleandupes --removenewestdupes

5,清除可能存在的损坏包

package-cleanup --problems

6,继续升级

yum update -y

处理完成。

转自:https://my.oschina.net/u/1261643/blog/1840518

为 Aria2 添加 Tracker 服务器

BitTorrent tracker
BitTorrent tracker(中文可称:BT服务器、tracker服务器等)是帮助BitTorrent协议在节点与节点之间做连接的服务器
BitTorrent客户端下载一开始就要连接到tracker,从tracker获得其他客户端IP地址后,才能连接到其他客户端下载。在传输过程中,也会一直与tracker通信,上传自己的信息,获取其它客户端的信息。
所以说想使用 Aria2 下载 BT 资源,Tracker 是必不可少的。当然 你会说,我从没添加过 Tracker 服务器, Aria2 也照样能用啊!那是因为 Aria2 也支持分布式的 DHT 网络,没有 Tracker 时就靠它了。
trackerslist
trackerslist 是一个开源项目,每天更新 Trackers list,比如下面的 best list
# https://github.com/ngosang/trackerslist/raw/master/trackers_best.txt

udp://tracker.coppersurfer.tk:6969/announce
http://tracker.internetwarriors.net:1337/announce
udp://tracker.opentrackr.org:1337/announce
udp://9.rarbg.to:2710/announce
udp://exodus.desync.com:6969/announce
udp://explodie.org:6969/announce
http://tracker1.itzmx.com:8080/announce
udp://thetracker.org:80/announce
udp://ipv4.tracker.harry.lu:80/announce
udp://denis.stalker.upeer.me:6969/announce
udp://tracker.torrent.eu.org:451/announce
udp://tracker.tiny-vps.com:6969/announce
udp://tracker.port443.xyz:6969/announce
udp://open.demonii.si:1337/announce
udp://bt.xxx-tracker.com:2710/announce
udp://retracker.lanta-net.ru:2710/announce
udp://open.stealth.si:80/announce
http://open.acgnxtracker.com:80/announce
udp://tracker.vanitycore.co:6969/announce
udp://tracker.iamhansen.xyz:2000/announce

只要将他们添加到 Aria2 的配置文件中,理论上能大幅提高 Aria2 下载 BT 的速度。
Aria2 的配置文件
参考 Aria2 的官方文档 ,https://aria2.github.io/manual/en/html/aria2c.html#cmdoption-bt-tracker
配置类似于:
bt-tracker=udp://tracker.coppersurfer.tk:6969/announce,http://tracker.internetwarriors.net:1337/announce,udp://tracker.opentrackr.org:1337/announce
添加到 Aria2 的配置文件,重启 Aria2 即可生效。
省力的方法
上面的教程很详细了,但每次都自己来修改肯定会累死人,你可以使用脚本替你完成上面的工作,可以参考小众软件的这篇文章下的评论:
https://www.appinn.com/ara2-add-trackers-list-for-speed-up/
记得重启 Aria2。
这样就完了吗?
懒人自然需要更省力的手段。Aria2 是支持 RPC 的,类似与 AriaNG 等 WEB UI 都是靠 RPC 和 Aria2 通信的,那么我们也是可以写个脚本用 RPC 来设置 Aria2 ,并且实时生效,无需重启 Aria2。
#!/bin/sh
#more trackers list, see https://github.com/ngosang/trackerslist
tracker_url='https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt'
path='http://10.10.10.5:6800/jsonrpc'
passwd='xxxxxx'
tracker=$(echo -n $(curl -s -L $tracker_url | sed 'N;s/\n//g') | tr ' ' ',')
[ -n "$tracker" ] && curl $path -d '{"jsonrpc":"2.0","method":"aria2.changeGlobalOption","id":"cron","params":["token:'$passwd'",{"bt-tracker":"'$tracker'"}]}'

在定时任务中定时执行上面的脚本就万事大吉了。定时任务不在本文的范畴里了蛤,Google 一下就有了。
修改 tracker_url、path 和 passwd 三个变量,脚本就可以为你工作了。

收集一些广告过滤的规则地址

其实以前一直有过收集一些可以去广告和科学上网的小众dns想法,但是这种东西死的快而且不稳定甚至还有隐私泄露的风险所以一直没收集(主要还是因为太懒),这次收集一些去广告的规则说不定以后用AdGuard Home的时候会用上

Host规则
Easylist China
https://easylist-downloads.adblockplus.org/easylistchina.txt

EasyList Lite
https://raw.githubusercontent.com/cjx82630/cjxlist/master/cjxlist.txt

CJX’s Annoyance List(过滤烦人的自我推广,并补充EasyPrivacy隐私规则)
https://raw.githubusercontent.com/cjx82630/cjxlist/master/cjx-annoyance.txt

StevenBlack/hosts(多个规则集合)
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts

hpHosts
https://hosts-file.net/hphosts-partial.txt

元素过滤规则
ChinaListV2.0(国内大部分视频网站的广告过滤)
http://tools.yiclear.com/ChinaList2.0.txt

Fanboy+Easylist-Merged Ultimate List
https://fanboy.co.nz/r/fanboy-ultimate.txt

N2OList China
https://n2o.io/p/adblock/dist/n2olist.cn.txt

乘风 广告过滤规则
https://raw.githubusercontent.com/xinggsf/Adblock-Plus-Rule/master/ABP-FX.txt

baidu-lite(百度美化)
http://tools.yiclear.com/baidu-lite.txt

 

转自:https://www.diefishfish.com/archives/rules.html

如何启用Windows 10中的“极限性能”电源管理方案

首先需要指出的是,“极限性能”模式是专门为高端台式系统打造的。如果你想在电池供电的笔记本平台上使用,显然是无法享受到其所宣称的最佳体验的。

其次,你必须将系统升级到最新的 Windows 10 version 1803 版本,也就是“April 2018 Update”。然后请参考以下步骤:

● 打开‘设置 -> 系统 -> 电源与睡眠’;
● 右键点击‘附加能源设置’;
● 选择‘自定义’、‘展示附加方案’;

如果这般操作后,还看不到“极限性能”选项,请继续参考如下步骤:

● 在开始菜单上点击右键,以管理员身份打开‘Windows Powershell’;
● 在框中输入如下命令并回车;
● powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61

再回到控制面板里的能源选项,“极限性能”模式应该就在那里等着你了。

Debian/Ubuntu 官方完整源列表

Debian 9.0 源列表 (sources.list)

 

deb http://ftp.us.debian.org/debian/ stretch main non-free contrib
deb http://ftp.us.debian.org/debian/ stretch-proposed-updates main non-free contrib
deb-src http://ftp.us.debian.org/debian/ stretch main non-free contrib
deb-src http://ftp.us.debian.org/debian/ stretch-proposed-updates main non-free contrib
deb http://ftp.us.debian.org/debian/ stretch-backports main contrib non-free
deb-src http://ftp.us.debian.org/debian/ stretch-backports main contrib non-free
deb http://security.debian.org/ stretch/updates main
deb-src http://security.debian.org/ stretch/updates main

Debian 8.0 源列表 (sources.list)

deb http://ftp.us.debian.org/debian/ jessie main non-free contrib
deb http://ftp.us.debian.org/debian/ jessie-proposed-updates main non-free contrib
deb-src http://ftp.us.debian.org/debian/ jessie main non-free contrib
deb-src http://ftp.us.debian.org/debian/ jessie-proposed-updates main non-free contrib
deb http://ftp.us.debian.org/debian/ jessie-backports main contrib non-free
deb-src http://ftp.us.debian.org/debian/ jessie-backports main contrib non-free
deb http://security.debian.org/ jessie/updates main
deb-src http://security.debian.org/ jessie/updates main

Debian 7.0 源列表 (sources.list)

deb http://ftp.us.debian.org/debian/ wheezy main non-free contrib
deb http://ftp.us.debian.org/debian/ wheezy-proposed-updates main non-free contrib
deb-src http://ftp.us.debian.org/debian/ wheezy main non-free contrib
deb-src http://ftp.us.debian.org/debian/ wheezy-proposed-updates main non-free contrib
deb http://ftp.us.debian.org/debian/ wheezy-backports main contrib non-free
deb-src http://ftp.us.debian.org/debian/ wheezy-backports main contrib non-free
deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main

Debian 6.0 源列表 (sources.list)

deb http://ftp.us.debian.org/debian/ squeeze main non-free contrib
deb http://ftp.us.debian.org/debian/ squeeze-proposed-updates main non-free contrib
deb-src http://ftp.us.debian.org/debian/ squeeze main non-free contrib
deb-src http://ftp.us.debian.org/debian/ squeeze-proposed-updates main non-free contrib
deb http://ftp.us.debian.org/debian/ squeeze-backports main contrib non-free
deb-src http://ftp.us.debian.org/debian/ squeeze-backports main contrib non-free
deb http://security.debian.org/ squeeze/updates main
deb-src http://security.debian.org/ squeeze/updates main

Ubuntu 17.04 源列表 (sources.list)

deb http://archive.ubuntu.com/ubuntu/ zesty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ zesty-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ zesty-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ zesty-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ zesty-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ zesty main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ zesty-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ zesty-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ zesty-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ zesty-backports main restricted universe multiverse

Ubuntu 16.10 源列表 (sources.list)

deb http://archive.ubuntu.com/ubuntu/ yakkety main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ yakkety-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ yakkety-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ yakkety-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ yakkety-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ yakkety main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ yakkety-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ yakkety-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ yakkety-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ yakkety-backports main restricted universe multiverse

Ubuntu 16.04 源列表 (sources.list)

deb http://archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse

Ubuntu 14.04 源列表 (sources.list)

deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse

Ubuntu 12.04 源列表 (sources.list)

deb http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ precise-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ precise-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse