mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-26 21:30:55 +08:00
Merge remote-tracking branch 'LCTT/master'
This commit is contained in:
commit
3274c772f3
@ -1,18 +1,19 @@
|
||||
书评|算法之美
|
||||
书评:《算法之美( Algorithms to Live By )》
|
||||
======
|
||||
|
||||
![](https://www.eyrie.org/~eagle/reviews/covers/1-62779-037-3.jpg)
|
||||
|
||||
又一次为了工作图书俱乐部而读书。除了其它我亲自推荐的书,这是我至今最喜爱的书。
|
||||
|
||||
作为计算机科学基础之一的研究领域是算法:我们如何高效地用计算机程序解决问题?这基本上属于数学领域,但是这很少关于理想的或理论上的解决方案,而是更在于最高效地利用有限的资源获得一个充足(如果不能完美)的答案。其中许多问题要么是日常的生活问题,要么与人们密切相关。毕竟,计算机科学的目的是为了用计算机解决实际问题。《算法之美》提出的问题是:“我们可以反过来吗”--我们可以通过学习计算机科学解决问题的方式来帮助我们做出日常决定吗?
|
||||
作为计算机科学基础之一的研究领域是算法:我们如何高效地用计算机程序解决问题?这基本上属于数学领域,但是这很少关于理想的或理论上的解决方案,而是更在于最高效地利用有限的资源获得一个充分(如果不能完美)的答案。其中许多问题要么是日常的生活问题,要么与人们密切相关。毕竟,计算机科学的目的是为了用计算机解决实际问题。《<ruby>算法之美<rt>Algorithms to Live By</rt></ruby>》提出的问题是:“我们可以反过来吗”——我们可以通过学习计算机科学解决问题的方式来帮助我们做出日常决定吗?
|
||||
|
||||
本书的十一个章节有很多有趣的内容,但也有一个有趣的主题:人类早已擅长这一点。很多章节以一个算法研究和对问题的数学分析作为开始,接着深入到探讨如何利用这些结果做出更好的决策,然后讨论关于人类真正会做出的决定的研究,之后,考虑到典型生活情境的限制,会发现人类早就在应用我们提出的最佳算法的特殊版本了。这往往会破坏本书的既定目标,值得庆幸的是,它决不会破坏对一般问题的有趣讨论,即计算机科学如何解决它们,以及我们对这些问题的数学和技术形态的了解。我认为这本书的自助效用比作者打算的少一些,但有很多可供思考的东西。
|
||||
|
||||
(也就是说,值得考虑这种一致性是否太少了,因为人类已经擅长这方面了,更因为我们的算法是根据人类直觉设计的。可能我们的最佳算法只是反映了人类的思想。在某些情况下,我们发现我们的方案和数学上的典范不一样, 但是在另一些情况下,它们仍然是我们当下最好的猜想。)
|
||||
(也就是说,值得考虑这种一致性是否太少了,因为人类已经擅长这方面了,更因为我们的算法是根据人类直觉设计的。可能我们的最佳算法只是反映了人类的思想。在某些情况下,我们发现我们的方案和数学上的典范不一样,但是在另一些情况下,它们仍然是我们当下最好的猜想。)
|
||||
|
||||
这是那种章节列表是书评里重要部分的书。这里讨论的算法领域有最优停止、探索和利用决策(什么时候带着你发现的最好东西走以及什么时候寻觅更好的东西),以及排序、缓存、调度、贝叶斯定理(一般还有预测)、创建模型时的过拟合、放松(解决容易的问题而不是你的实际问题)、随机算法、一系列网络算法,最后还有游戏理论。其中每一项都有有用的见解和发人深省的讨论--这些有时显得十分理论化的概念令人吃惊地很好地映射到了日常生活。这本书以一段关于“可计算的善意”的讨论结束:鼓励减少你自己和你交往的人所需的计算和复杂性惩罚。
|
||||
这是那种章节列表是书评里重要部分的书。这里讨论的算法领域有最优停止、探索和利用决策(什么时候带着你发现的最好东西走,以及什么时候寻觅更好的东西),以及排序、缓存、调度、贝叶斯定理(一般还有预测)、创建模型时的过拟合、放松(解决容易的问题而不是你的实际问题)、随机算法、一系列网络算法,最后还有游戏理论。其中每一项都有有用的见解和发人深省的讨论——这些有时显得十分理论化的概念令人吃惊地很好地映射到了日常生活。这本书以一段关于“可计算的善意”的讨论结束:鼓励减少你自己和你交往的人所需的计算和复杂性惩罚。
|
||||
|
||||
如果你有计算机科学背景(就像我一样),其中许多都是熟悉的概念,而且你因为被普及了很多新东西或许会有疑惑。然而,请给这本书一个机会,类比法没你担忧的那么令人紧张。作者既小心又聪明地应用了这些原则。这本书令人惊喜地通过了一个重要的合理性检查:涉及到我知道或反复思考过的主题的章节很少有或没有明显的错误,而且能讲出有用和重要的事情。比如,调度的那一章节毫不令人吃惊地和时间管理有关,通过直接跳到时间管理问题的核心而胜过了半数时间管理类书籍:如果你要做一个清单上的所有事情,你做这些事情的顺序很少要紧,所以最难的调度问题是决定不做哪些事情而不是做这些事情的顺序。
|
||||
如果你有计算机科学背景(就像我一样),其中许多都是熟悉的概念,而且你因为被普及了很多新东西或许会有疑惑。然而,请给这本书一个机会,类比法没你担忧的那么令人紧张。作者既小心又聪明地应用了这些原则。这本书令人惊喜地通过了一个重要的合理性检查:涉及到我知道或反复思考过的主题的章节很少有或没有明显的错误,而且能讲出有用和重要的事情。比如,调度的那一章节毫不令人吃惊地和时间管理有关,通过直接跳到时间管理问题的核心而胜过了半数的时间管理类书籍:如果你要做一个清单上的所有事情,你做这些事情的顺序很少要紧,所以最难的调度问题是决定不做哪些事情而不是做这些事情的顺序。
|
||||
|
||||
作者在贝叶斯定理这一章节中的观点完全赢得了我的心。本章的许多内容都是关于贝叶斯先验的,以及一个人对过去事件的了解为什么对分析未来的概率很重要。作者接着讨论了著名的棉花糖实验。即给了儿童一个棉花糖以后,儿童被研究者告知如果他们能够克制自己不吃这个棉花糖,等到研究者回来时,会给他们两个棉花糖。克制自己不吃棉花糖(在心理学文献中叫作“延迟满足”)被发现与未来几年更好的生活有关。这个实验多年来一直被引用和滥用于各种各样的宣传,关于选择未来的收益放弃即时的快乐从而拥有成功的生活,以及生活中的失败是因为无法延迟满足。更多的邪恶分析(当然)将这种能力与种族联系在一起,带有可想而知的种族主义结论。
|
||||
|
||||
@ -20,7 +21,7 @@
|
||||
|
||||
《算法之美》是我读过的唯一提到了棉花糖实验并应用了我认为更有说服力的分析的书。这不是一个关于儿童天赋的实验,这是一个关于他们的贝叶斯先验的实验。什么时候立即吃棉花糖而不是等待奖励是完全合理的?当他们过去的经历告诉他们成年人不可靠,不可信任,会在不可预测的时间内消失并且撒谎的时候。而且,更好的是,作者用我之前没有听说过的后续研究和观察支持了这一分析,观察到的内容是,一些孩子会等待一段时间然后“放弃”。如果他们下意识地使用具有较差先验的贝叶斯模型,这就完全合情合理。
|
||||
|
||||
这是一本很好的书。它可能在某些地方的尝试有点太勉强(数学上最优停止对于日常生活的适用性比我认为作者想要表现的更加偶然和牵强附会),如果你学过算法,其中一些内容会感到熟悉,但是它的行文思路清晰,简洁,而且编辑得非常好。这本书没有哪一部分对不起它所受的欢迎,书中的讨论贯穿始终。如果你发现自己“已经知道了这一切”,你可能还会在接下来几页中遇到一个新的概念或一个简洁的解释。有时作者会做一些我从没想到但是回想起来正确的联系,比如将网络协议中的指数退避和司法系统中的选择惩罚联系起来。还有意识到我们的现代通信世界并不是一直联系的,它是不断缓冲的,我们中的许多人正深受缓冲膨胀这一独特现象的苦恼。
|
||||
这是一本很好的书。它可能在某些地方的尝试有点太勉强(数学上最优停止对于日常生活的适用性比我认为作者想要表现的更加偶然和牵强附会),如果你学过算法,其中一些内容会感到熟悉,但是它的行文思路清晰,简洁,而且编辑得非常好。这本书没有哪一部分对不起它所受到的欢迎,书中的讨论贯穿始终。如果你发现自己“已经知道了这一切”,你可能还会在接下来几页中遇到一个新的概念或一个简洁的解释。有时作者会做一些我从没想到但是回想起来正确的联系,比如将网络协议中的指数退避和司法系统中的选择惩罚联系起来。还有意识到我们的现代通信世界并不是一直联系的,它是不断缓冲的,我们中的许多人正深受缓冲膨胀这一独特现象的苦恼。
|
||||
|
||||
我认为你并不必须是计算机科学专业或者精通数学才能读这本书。如果你想深入,每章的结尾都有许多数学上的细节,但是正文总是易读而清晰,至少就我所知是这样(作为一个以计算机科学为专业并学到了很多数学知识的人,你至少可以有保留地相信我)。即使你已经钻研了多年的算法,这本书仍然可以提供很多东西。
|
||||
|
||||
@ -36,7 +37,7 @@ via: https://www.eyrie.org/~eagle/reviews/books/1-62779-037-3.html
|
||||
|
||||
作者:[Brian Christian;Tom Griffiths][a]
|
||||
译者:[GraveAccent](https://github.com/GraveAccent)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -1,53 +1,43 @@
|
||||
一些提高你开源源码安全性的工具
|
||||
一些提高开源代码安全性的工具
|
||||
======
|
||||
|
||||
> 开源软件的迅速普及带来了对健全安全实践的需求。
|
||||
|
||||
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/open-security.jpg?itok=R3M5LDrb)
|
||||
|
||||
虽然目前开源依然发展势头较好,并被广大的厂商所采用,然而最近由 Black Duck 和 Synopsys 发布的[2018开源安全与风险评估报告][1]指出了一些存在的风险并重点阐述了对于健全安全措施的需求。这份报告的分析资料素材来自经过脱敏后的 1100 个商业代码库,这些代码所涉及:自动化、大数据、企业级软件、金融服务业、健康医疗、物联网、制造业等多个领域。
|
||||
虽然目前开源依然发展势头较好,并被广大的厂商所采用,然而最近由 Black Duck 和 Synopsys 发布的 [2018 开源安全与风险评估报告][1]指出了一些存在的风险,并重点阐述了对于健全安全措施的需求。这份报告的分析资料素材来自经过脱敏后的 1100 个商业代码库,这些代码所涉及:自动化、大数据、企业级软件、金融服务业、健康医疗、物联网、制造业等多个领域。
|
||||
|
||||
这份报告强调开源软件正在被大量的使用,扫描结果中有 96% 的应用都使用了开源组件。然而,报告还指出许多其中存在很多漏洞。具体在 [这里][2]:
|
||||
这份报告强调开源软件正在被大量的使用,扫描结果中有 96% 的应用都使用了开源组件。然而,报告还指出许多其中存在很多漏洞。具体在 [这里][2]:
|
||||
|
||||
* 令人担心的是扫描的所有结果中,有 78% 的代码库存在至少一个开源的漏洞,平均每个代码库有 64 个漏洞。
|
||||
|
||||
* 在经过代码审计过后代码库中,发现超过 54% 的漏洞经验证是高危漏洞。
|
||||
|
||||
* 17% 的代码库包括一种已经早已公开的漏洞,包括:Heartbleed、Logjam、Freak、Drown、Poddle。
|
||||
|
||||
Synopsys 旗下 Black Duck 的技术负责人 Tim Mackey 称,“这份报告清楚的阐述了:随着开源软件正在被企业广泛的使用,企业与组织也应当使用一些工具来检测可能出现在这些开源软件中的漏洞,以及管理其所使用的开源软件的方式是否符合相应的许可证规则。”
|
||||
|
||||
确实,随着越来越具有影响力的安全威胁出现,历史上从未有过我们目前对安全工具和实践的需求。大多数的组织已经意识到网络与系统管理员需要具有相应的较强的安全技能和安全证书。[在一篇文章中][3],我们给出一些具有较大影响力的工具、认证和实践。
|
||||
|
||||
Linux 基金会已经在安全方面提供了许多关于安全的信息与教育资源。比如,Linux 社区提供了许多针对特定平台的免费资源,其中 [Linux 工作站安全检查清单][4] 其中提到了很多有用的基础信息。线上的一些发表刊物也可以提升用户针对某些平台对于漏洞的保护,如:[Fedora 安全指南][5]、[Debian 安全手册][6]。
|
||||
|
||||
Tim Mackey,Synopsys 旗下 Black Duck 的技术负责人称,"这份报告清楚的阐述了:随着开源软件正在被企业广泛的使用,企业与组织也应当使用一些工具来检测可能出现在这些开源软件中的漏洞,并且管理其所使用的开源软件的方式是否符合相应的许可证规则"
|
||||
|
||||
确实,随着越来越具有影响力的安全威胁出现,历史上从未有过我们目前对安全工具和实践的需求。大多数的组织已经意识到网络与系统管理员需要具有相应的较强的安全技能和安全证书。[在这篇文章中,][3] 我们给出一些具有较大影响力的工具、认证和实践。
|
||||
|
||||
Linux 基金会已经在安全方面提供了许多关于安全的信息与教育资源。比如,Linux 社区提供许多免费的用来针对一些平台的工具,其中[Linux 服务器安全检查表][4] 其中提到了很多有用的基础信息。线上的一些发表刊物也可以提升用户针对某些平台对于漏洞的保护,如:[Fedora 安全指南][5],[Debian 安全手册][6]。
|
||||
|
||||
目前被广泛使用的私有云平台 OpenStack 也加强了关于基于云的智能安全需求。根据 Linux 基金会发布的 [公有云指南][7]:“据 Gartner 的调研结果,尽管公有云的服务商在安全和审查方面做的都还不错,安全问题是企业考虑向公有云转移的最重要的考量之一”
|
||||
|
||||
无论是对于组织还是个人,千里之堤毁于蚁穴,这些“蚁穴”无论是来自路由器、防火墙、VPNs或虚拟机都可能导致灾难性的后果。以下是一些免费的工具可能对于检测这些漏洞提供帮助:
|
||||
|
||||
* [Wireshark][8], 流量包分析工具
|
||||
|
||||
* [KeePass Password Safe][9], 免费开源的密码管理器
|
||||
|
||||
* [Malwarebytes][10], 免费的反病毒和勒索软件工具
|
||||
|
||||
* [NMAP][11], 安全扫描器
|
||||
|
||||
* [NIKTO][12], 开源 web 扫描器
|
||||
|
||||
* [Ansible][13], 自动化的配置运维工具,可以辅助做安全基线
|
||||
|
||||
* [Metasploit][14], 渗透测试工具,可辅助理解攻击向量
|
||||
目前被广泛使用的私有云平台 OpenStack 也加强了关于基于云的智能安全需求。根据 Linux 基金会发布的 [公有云指南][7]:“据 Gartner 的调研结果,尽管公有云的服务商在安全审查和提升透明度方面做的都还不错,安全问题仍然是企业考虑向公有云转移的最重要的考量之一。”
|
||||
|
||||
无论是对于组织还是个人,千里之堤毁于蚁穴,这些“蚁穴”无论是来自路由器、防火墙、VPN 或虚拟机都可能导致灾难性的后果。以下是一些免费的工具可能对于检测这些漏洞提供帮助:
|
||||
|
||||
* [Wireshark][8],流量包分析工具
|
||||
* [KeePass Password Safe][9],自由开源的密码管理器
|
||||
* [Malwarebytes][10],免费的反病毒和勒索软件工具
|
||||
* [NMAP][11],安全扫描器
|
||||
* [NIKTO][12],开源的 web 服务器扫描器
|
||||
* [Ansible][13],自动化的配置运维工具,可以辅助做安全基线
|
||||
* [Metasploit][14],渗透测试工具,可辅助理解攻击向量
|
||||
|
||||
这里有一些对上面工具讲解的视频。比如 [Metasploit 教学][15]、[Wireshark 教学][16]。还有一些传授安全技能的免费电子书,比如:由 Ibrahim Haddad 博士和 Linux 基金会共同出版的[并购过程中的开源审计][17],里面阐述了多条在技术平台合并过程中,因没有较好的进行开源审计,从而引发的安全问题。当然,书中也记录了如何在这一过程中进行代码合规检查、准备以及文档编写。
|
||||
|
||||
同时,我们 [之前提到的一个免费的电子书][18], 由来自[The New Stack][19] 编写的“Docker与容器中的网络、安全和存储”,里面也提到了关于加强容器网络安全的最新技术,以及Docker本身可提供的关于,提升其网络的安全与效率的最佳实践。这本电子书还记录了关于如何构建安全容器集群的最佳实践。
|
||||
同时,我们 [之前提到的一个免费的电子书][18], 由来自 [The New Stack][19] 编写的“Docker 与容器中的网络、安全和存储”,里面也提到了关于加强容器网络安全的最新技术,以及 Docker 本身可提供的关于提升其网络的安全与效率的最佳实践。这本电子书还记录了关于如何构建安全容器集群的最佳实践。
|
||||
|
||||
所有这些工具和资源,可以在很大的程度上预防安全问题,正如人们所说的未雨绸缪,考虑到一直存在的安全问题,现在就应该开始学习这些安全合规资料与工具。
|
||||
想要了解更多的安全、合规以及开源项目问题,点击[这里][20]
|
||||
|
||||
想要了解更多的安全、合规以及开源项目问题,点击[这里][20]。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -55,8 +45,8 @@ via: https://www.linux.com/blog/2018/5/free-resources-securing-your-open-source-
|
||||
|
||||
作者:[Sam Dean][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者ID](https://github.com/sd886393)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
译者:[sd886393](https://github.com/sd886393)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
@ -64,7 +54,7 @@ via: https://www.linux.com/blog/2018/5/free-resources-securing-your-open-source-
|
||||
[1]:https://www.blackducksoftware.com/open-source-security-risk-analysis-2018
|
||||
[2]:https://www.prnewswire.com/news-releases/synopsys-report-finds-majority-of-software-plagued-by-known-vulnerabilities-and-license-conflicts-as-open-source-adoption-soars-300648367.html
|
||||
[3]:https://www.linux.com/blog/sysadmin-ebook/2017/8/future-proof-your-sysadmin-career-locking-down-security
|
||||
[4]:http://go.linuxfoundation.org/ebook_workstation_security
|
||||
[4]:https://linux.cn/article-6753-1.html
|
||||
[5]:https://docs.fedoraproject.org/en-US/Fedora/19/html/Security_Guide/index.html
|
||||
[6]:https://www.debian.org/doc/manuals/securing-debian-howto/index.en.html
|
||||
[7]:https://www.linux.com/publications/2016-guide-open-cloud
|
@ -1,3 +1,4 @@
|
||||
Translating by z52527
|
||||
Publishing Markdown to HTML with MDwiki
|
||||
======
|
||||
|
||||
|
@ -1,196 +0,0 @@
|
||||
How To Limit Network Bandwidth In Linux Using Wondershaper
|
||||
======
|
||||
|
||||
![](https://www.ostechnix.com/wp-content/uploads/2018/09/Wondershaper-1-720x340.jpg)
|
||||
|
||||
This tutorial will help you to easily limit network bandwidth and shape your network traffic in Unix-like operating systems. By limiting the network bandwidth usage, you can save unnecessary bandwidth consumption’s by applications, such as package managers (pacman, yum, apt), web browsers, torrent clients, download managers etc., and prevent the bandwidth abuse by a single or multiple users in the network. For the purpose of this tutorial, we will be using a command line utility named **Wondershaper**. Trust me, it is not that hard as you may think. It is one of the easiest and quickest way ever I have come across to limit the Internet or local network bandwidth usage in your own Linux system. Read on.
|
||||
|
||||
Please be mindful that the aforementioned utility can only limit the incoming and outgoing traffic of your local network interfaces, not the interfaces of your router or modem. In other words, Wondershaper will only limit the network bandwidth in your local system itself, not any other systems in the network. These utility is mainly designed for limiting the bandwidth of one or more network adapters in your local system. Hope you got my point.
|
||||
|
||||
Let us see how to use Wondershaper to shape the network traffic.
|
||||
|
||||
### Limit Network Bandwidth In Linux Using Wondershaper
|
||||
|
||||
**Wondershaper** is simple script used to limit the bandwidth of your system’s network adapter(s). It limits the bandwidth iproute’s tc command, but greatly simplifies its operation.
|
||||
|
||||
**Installing Wondershaper**
|
||||
|
||||
To install the latest version, git clone wondershaoer repository:
|
||||
|
||||
```
|
||||
$ git clone https://github.com/magnific0/wondershaper.git
|
||||
|
||||
```
|
||||
|
||||
Go to the wondershaper directory and install it as show below
|
||||
|
||||
```
|
||||
$ cd wondershaper
|
||||
|
||||
$ sudo make install
|
||||
|
||||
```
|
||||
|
||||
And, run the following command to start wondershaper service automatically on every reboot.
|
||||
|
||||
```
|
||||
$ sudo systemctl enable wondershaper.service
|
||||
|
||||
$ sudo systemctl start wondershaper.service
|
||||
|
||||
```
|
||||
|
||||
You can also install using your distribution’s package manager (official or non-official) if you don’t mind the latest version.
|
||||
|
||||
Wondershaper is available in [**AUR**][1], so you can install it in Arch-based systems using AUR helper programs such as [**Yay**][2].
|
||||
|
||||
```
|
||||
$ yay -S wondershaper-git
|
||||
|
||||
```
|
||||
|
||||
On Debian, Ubuntu, Linux Mint:
|
||||
|
||||
```
|
||||
$ sudo apt-get install wondershaper
|
||||
|
||||
```
|
||||
|
||||
On Fedora:
|
||||
|
||||
```
|
||||
$ sudo dnf install wondershaper
|
||||
|
||||
```
|
||||
|
||||
On RHEL, CentOS, enable EPEL repository and install wondershaper as shown below.
|
||||
|
||||
```
|
||||
$ sudo yum install epel-release
|
||||
|
||||
$ sudo yum install wondershaper
|
||||
|
||||
```
|
||||
|
||||
Finally, start wondershaper service automatically on every reboot.
|
||||
|
||||
```
|
||||
$ sudo systemctl enable wondershaper.service
|
||||
|
||||
$ sudo systemctl start wondershaper.service
|
||||
|
||||
```
|
||||
|
||||
**Usage**
|
||||
|
||||
First, find the name of your network interface. Here are some common ways to find the details of a network card.
|
||||
|
||||
```
|
||||
$ ip addr
|
||||
|
||||
$ route
|
||||
|
||||
$ ifconfig
|
||||
|
||||
```
|
||||
|
||||
Once you find the network card name, you can limit the bandwidth rate as shown below.
|
||||
|
||||
```
|
||||
$ sudo wondershaper -a <adapter> -d <rate> -u <rate>
|
||||
|
||||
```
|
||||
|
||||
For instance, if your network card name is **enp0s8** and you wanted to limit the bandwidth to **1024 Kbps** for **downloads** and **512 kbps** for **uploads** , the command would be:
|
||||
|
||||
```
|
||||
$ sudo wondershaper -a enp0s8 -d 1024 -u 512
|
||||
|
||||
```
|
||||
|
||||
Where,
|
||||
|
||||
* **-a** : network card name
|
||||
* **-d** : download rate
|
||||
* **-u** : upload rate
|
||||
|
||||
|
||||
|
||||
To clear the limits from a network adapter, simply run:
|
||||
|
||||
```
|
||||
$ sudo wondershaper -c -a enp0s8
|
||||
|
||||
```
|
||||
|
||||
Or
|
||||
|
||||
```
|
||||
$ sudo wondershaper -c enp0s8
|
||||
|
||||
```
|
||||
|
||||
Just in case, there are more than one network card available in your system, you need to manually set the download/upload rates for each network interface card as described above.
|
||||
|
||||
If you have installed Wondershaper by cloning its GitHub repository, there is a configuration named **wondershaper.conf** exists in **/etc/conf.d/** location. Make sure you have set the download or upload rates by modifying the appropriate values(network card name, download/upload rate) in this file.
|
||||
|
||||
```
|
||||
$ sudo nano /etc/conf.d/wondershaper.conf
|
||||
|
||||
[wondershaper]
|
||||
# Adapter
|
||||
#
|
||||
IFACE="eth0"
|
||||
|
||||
# Download rate in Kbps
|
||||
#
|
||||
DSPEED="2048"
|
||||
|
||||
# Upload rate in Kbps
|
||||
#
|
||||
USPEED="512"
|
||||
|
||||
```
|
||||
|
||||
Here is the sample before Wondershaper:
|
||||
|
||||
After enabling Wondershaper:
|
||||
|
||||
As you can see, the download rate has been tremendously reduced after limiting the bandwidth using WOndershaper in my Ubuntu 18.o4 LTS server.
|
||||
|
||||
For more details, view the help section by running the following command:
|
||||
|
||||
```
|
||||
$ wondershaper -h
|
||||
|
||||
```
|
||||
|
||||
Or, refer man pages.
|
||||
|
||||
```
|
||||
$ man wondershaper
|
||||
|
||||
```
|
||||
|
||||
As far as tested, Wondershaper worked just fine as described above. Give it a try and let us know what do you think about this utility.
|
||||
|
||||
And, that’s all for now. Hope this was useful. More good stuffs to come. Stay tuned.
|
||||
|
||||
Cheers!
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.ostechnix.com/how-to-limit-network-bandwidth-in-linux-using-wondershaper/
|
||||
|
||||
作者:[SK][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.ostechnix.com/author/sk/
|
||||
[1]: https://aur.archlinux.org/packages/wondershaper-git/
|
||||
[2]: https://www.ostechnix.com/yay-found-yet-another-reliable-aur-helper/
|
@ -1,233 +0,0 @@
|
||||
Translating by dianbanjiu How to Install Popcorn Time on Ubuntu 18.04 and Other Linux Distributions
|
||||
======
|
||||
**Brief: This tutorial shows you how to install Popcorn Time on Ubuntu and other Linux distributions. Some handy Popcorn Time tips have also been discussed.**
|
||||
|
||||
[Popcorn Time][1] is an open source [Netflix][2] inspired [torrent][3] streaming application for Linux, Mac and Windows.
|
||||
|
||||
With the regular torrents, you have to wait for the download to finish before you could watch the videos.
|
||||
|
||||
[Popcorn Time][4] is different. It uses torrent underneath but allows you to start watching the videos (almost) immediately. It’s like you are watching videos on streaming websites like YouTube or Netflix. You don’t have to wait for the download to finish here.
|
||||
|
||||
![Popcorn Time in Ubuntu Linux][5]
|
||||
Popcorn Time
|
||||
|
||||
If you want to watch movies online without those creepy ads, Popcorn Time is a good alternative. Keep in mind that the streaming quality depends on the number of available seeds.
|
||||
|
||||
Popcorn Time also provides a nice user interface where you can browse through available movies, tv-series and other contents. If you ever used [Netflix on Linux][6], you will find it’s somewhat a similar experience.
|
||||
|
||||
Using torrent to download movies is illegal in several countries where there are strict laws against piracy. In countries like the USA, UK and West European you may even get legal notices. That said, it’s up to you to decide if you want to use it or not. You have been warned.
|
||||
(If you still want to take the risk and use Popcorn Time, you should use a VPN service like [Ivacy][7] that has been specifically designed for using Torrents and protecting your identity. Even then it’s not always easy to avoid the snooping authorities.)
|
||||
|
||||
Some of the main features of Popcorn Time are:
|
||||
|
||||
* Watch movies and TV Series online using Torrent
|
||||
* A sleek user interface lets you browse the available movies and TV series
|
||||
* Change streaming quality
|
||||
* Bookmark content for watching later
|
||||
* Download content for offline viewing
|
||||
* Ability to enable subtitles by default, change the subtitles size etc
|
||||
* Keyboard shortcuts to navigate through Popcorn Time
|
||||
|
||||
|
||||
|
||||
### How to install Popcorn Time on Ubuntu and other Linux Distributions
|
||||
|
||||
I am using Ubuntu 18.04 in this tutorial but you can use the same instructions for other Linux distributions such as Linux Mint, Debian, Manjaro, Deepin etc.
|
||||
|
||||
Let’s see how to install Popcorn time on Linux. It’s really easy actually. Simply follow the instructions and copy paste the commands I have mentioned.
|
||||
|
||||
#### Step 1: Download Popcorn Time
|
||||
|
||||
You can download Popcorn Time from its official website. The download link is present on the homepage itself.
|
||||
|
||||
[Get Popcorn Time](https://popcorntime.sh/)
|
||||
|
||||
#### Step 2: Install Popcorn Time
|
||||
|
||||
Once you have downloaded Popcorn Time, it’s time to use it. The downloaded file is a tar file that consists of an executable among other files. While you can extract this tar file anywhere, the [Linux convention is to install additional software in][8] /[opt directory.][8]
|
||||
|
||||
Create a new directory in /opt:
|
||||
|
||||
```
|
||||
sudo mkdir /opt/popcorntime
|
||||
```
|
||||
|
||||
Now go to the Downloads directory.
|
||||
|
||||
```
|
||||
cd ~/Downloads
|
||||
```
|
||||
|
||||
Extract the downloaded Popcorn Time files into the newly created /opt/popcorntime directory.
|
||||
|
||||
```
|
||||
sudo tar Jxf Popcorn-Time-* -C /opt/popcorntime
|
||||
```
|
||||
|
||||
#### Step 3: Make Popcorn Time accessible for everyone
|
||||
|
||||
You would want every user on your system to be able to run Popcorn Time without sudo access, right? To do that, you need to create a [symbolic link][9] to the executable in /usr/bin directory.
|
||||
|
||||
```
|
||||
ln -sf /opt/popcorntime/Popcorn-Time /usr/bin/Popcorn-Time
|
||||
```
|
||||
|
||||
#### Step 4: Create desktop launcher for Popcorn Time
|
||||
|
||||
So far so good. But you would also like to see Popcorn Time in the application menu, add it to your favorite application list etc.
|
||||
|
||||
For that, you need to create a desktop entry.
|
||||
|
||||
Open a terminal and create a new file named popcorntime.desktop in /usr/share/applications.
|
||||
|
||||
You can use any [command line based text editor][10]. Ubuntu has [Nano][11] installed by default so you can use that.
|
||||
|
||||
```
|
||||
sudo nano /usr/share/applications/popcorntime.desktop
|
||||
```
|
||||
|
||||
Insert the following lines here:
|
||||
|
||||
```
|
||||
[Desktop Entry]
|
||||
Version = 1.0
|
||||
Type = Application
|
||||
Terminal = false
|
||||
Name = Popcorn Time
|
||||
Exec = /usr/bin/Popcorn-Time
|
||||
Icon = /opt/popcorntime/popcorn.png
|
||||
Categories = Application;
|
||||
```
|
||||
|
||||
If you used Nano editor, save it using shortcut Ctrl+X. When asked for saving, enter Y and then press enter again to save and exit.
|
||||
|
||||
We are almost there. One last thing to do here is to have the correct icon for Popcorn Time. For that, you can download a Popcorn Time icon and save it as popcorn.png in /opt/popcorntime directory.
|
||||
|
||||
You can do that using the command below:
|
||||
|
||||
```
|
||||
sudo wget -O /opt/popcorntime/popcorn.png https://upload.wikimedia.org/wikipedia/commons/d/df/Pctlogo.png
|
||||
|
||||
```
|
||||
|
||||
That’s it. Now you can search for Popcorn Time and click on it to launch it.
|
||||
|
||||
![Popcorn Time installed on Ubuntu][12]
|
||||
Search for Popcorn Time in Menu
|
||||
|
||||
On the first launch, you’ll have to accept the terms and conditions.
|
||||
|
||||
![Popcorn Time in Ubuntu Linux][13]
|
||||
Accept the Terms of Service
|
||||
|
||||
Once you do that, you can enjoy the movies and TV shows.
|
||||
|
||||
![Watch movies on Popcorn Time][14]
|
||||
|
||||
Well, that’s all you needed to install Popcorn Time on Ubuntu or any other Linux distribution. You can start watching your favorite movies straightaway.
|
||||
|
||||
However, if you are interested, I would suggest reading these Popcorn Time tips to get more out of it.
|
||||
|
||||
[![][15]][16]
|
||||
![][17]
|
||||
|
||||
### 7 Tips for using Popcorn Time effectively
|
||||
|
||||
Now that you have installed Popcorn Time, I am going to tell you some nifty Popcorn Time tricks. I assure you that it will enhance your experience with Popcorn Time multiple folds.
|
||||
|
||||
#### 1\. Use advanced settings
|
||||
|
||||
Always have the advanced settings enabled. It gives you more options to tweak Popcorn Time. Go to the top right corner and click on the gear symbol. Click on it and check advanced settings on the next screen.
|
||||
|
||||
![](https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2015/01/Popcorn_Time_Tricks.jpeg)
|
||||
|
||||
#### 2\. Watch the movies in VLC or other players
|
||||
|
||||
Did you know that you can choose to watch a file in your preferred media player instead of the default Popcorn Time player? Of course, that media player should have been installed in the system.
|
||||
|
||||
Now you may ask why would one want to use another player. And my answer is because other players like VLC has hidden features which you might not find in the Popcorn Time player.
|
||||
|
||||
For example, if a file has very low volume, you can use VLC to enhance the audio by 400 percent. You can also [synchronize incoherent subtitles with VLC][18]. You can switch between media players before you start to play a file:
|
||||
|
||||
![](https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2015/01/Pocorn_Time_Tricks_1.png)
|
||||
|
||||
#### 3\. Bookmark movies and watch it later
|
||||
|
||||
Just browsing through movies and TV series but don’t have time or mood to watch those? No issues. You can add the movies to the bookmark and can access these bookmarked videos from the Favorites tab. This enables you to create a list of movies you would watch later.
|
||||
|
||||
![](https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2015/01/Pocorn_Time_Tricks2.png)
|
||||
|
||||
#### 4\. Check torrent health and seed information
|
||||
|
||||
As I had mentioned earlier, your viewing experience in Popcorn Times depends on torrent speed. Good thing is that Popcorn time shows the health of the torrent file so that you can be aware of the streaming speed.
|
||||
|
||||
You will see a green/yellow/red dot on the file. Green means there are plenty of seeds and the file will stream easily. Yellow means a medium number of seeds, streaming should be okay. Red means there are very few seeds available and the streaming will be poor or won’t work at all.
|
||||
|
||||
![](https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2015/01/Pocorn_Time_Tricks3.jpg)
|
||||
|
||||
#### 5\. Add custom subtitles
|
||||
|
||||
If you need subtitles and it is not available in your preferred language, you can add custom subtitles downloaded from external websites. Get the .srt files and use it inside Popcorn Time:
|
||||
|
||||
![](https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2015/01/Pocporn_Time_Tricks5.png)
|
||||
|
||||
This is where VLC comes handy as you can [download subtitles automatically with VLC][19].
|
||||
|
||||
|
||||
#### 6\. Save the files for offline viewing
|
||||
|
||||
When Popcorn Times stream a content, it downloads it and store temporarily. When you close the app, it’s cleaned out. You can change this behavior so that the downloaded file remains there for your future use.
|
||||
|
||||
In the advanced settings, scroll down a bit. Look for Cache directory. You can change this to some other directory like Downloads. This way, even if you close Popcorn Time, the file will be available for viewing.
|
||||
|
||||
![](https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2015/01/Popcorn_Time_Tips.jpg)
|
||||
|
||||
#### 7\. Drag and drop external torrent files to play immediately
|
||||
|
||||
I bet you did not know about this one. If you don’t find a certain movie on Popcorn Time, download the torrent file from your favorite torrent website. Open Popcorn Time and just drag and drop the torrent file in Popcorn Time. It will start playing the file, depending upon seeds. This way, you don’t need to download the entire file before watching it.
|
||||
|
||||
When you drag and drop the torrent file in Popcorn Time, it will give you the option to choose which video file should it play. If there are subtitles in it, it will play automatically or else, you can add external subtitles.
|
||||
|
||||
![](https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2015/01/Pocorn_Time_Tricks4.png)
|
||||
|
||||
There are plenty of other features in Popcorn Time. But I’ll stop with my list here and let you explore Popcorn Time on Ubuntu Linux. I hope you find these Popcorn Time tips and tricks useful.
|
||||
|
||||
I am repeating again. Using Torrents is illegal in many countries. If you do that, take precaution and use a VPN service. If you are looking for my recommendation, you can go for [Swiss-based privacy company ProtonVPN][20] (of [ProtonMail][21] fame). Singapore based [Ivacy][7] is another good option. If you think these are expensive, you can look for [cheap VPN deals on It’s FOSS Shop][22].
|
||||
|
||||
Note: This article contains affiliate links. Please read our [affiliate policy][23].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/popcorn-time-ubuntu-linux/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[1]: https://popcorntime.sh/
|
||||
[2]: https://netflix.com/
|
||||
[3]: https://en.wikipedia.org/wiki/Torrent_file
|
||||
[4]: https://en.wikipedia.org/wiki/Popcorn_Time
|
||||
[5]: https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/09/popcorn-time-linux.jpeg
|
||||
[6]: https://itsfoss.com/netflix-firefox-linux/
|
||||
[7]: https://billing.ivacy.com/page/23628
|
||||
[8]: http://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/opt.html
|
||||
[9]: https://en.wikipedia.org/wiki/Symbolic_link
|
||||
[10]: https://itsfoss.com/command-line-text-editors-linux/
|
||||
[11]: https://itsfoss.com/nano-3-release/
|
||||
[12]: https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/09/popcorn-time-ubuntu-menu.jpg
|
||||
[13]: https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/09/popcorn-time-ubuntu-license.jpeg
|
||||
[14]: https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/09/popcorn-time-watch-movies.jpeg
|
||||
[15]: https://ivacy.postaffiliatepro.com/accounts/default1/vdegzkxbw/7f82d531.png
|
||||
[16]: https://billing.ivacy.com/page/23628/7f82d531
|
||||
[17]: http://ivacy.postaffiliatepro.com/scripts/vdegzkxiw?aff=23628&a_bid=7f82d531
|
||||
[18]: https://itsfoss.com/how-to-synchronize-subtitles-with-movie-quick-tip/
|
||||
[19]: https://itsfoss.com/download-subtitles-automatically-vlc-media-player-ubuntu/
|
||||
[20]: https://protonvpn.net/?aid=chmod777
|
||||
[21]: https://itsfoss.com/protonmail/
|
||||
[22]: https://shop.itsfoss.com/search?utf8=%E2%9C%93&query=vpn
|
||||
[23]: https://itsfoss.com/affiliate-policy/
|
@ -0,0 +1,196 @@
|
||||
在 Linux 中使用 Wondershaper 限制网络带宽
|
||||
======
|
||||
|
||||
![](https://www.ostechnix.com/wp-content/uploads/2018/09/Wondershaper-1-720x340.jpg)
|
||||
|
||||
以下内容将向你介绍如何轻松对网络带宽做出限制,并在类 Unix 操作系统中对网络流量进行优化。通过限制网络带宽,可以节省应用程序不必要的带宽消耗,包括软件包管理器(pacman、yum、apt)、web 浏览器、torrent 客户端、下载管理器等,并防止单个或多个用户滥用网络带宽。在本文当中,将会介绍 Wondershaper 这一个实用的命令行程序,这是我认为限制 Linux 系统 Internet 或本地网络带宽的最简单、最快捷的方式之一。
|
||||
|
||||
请注意,Wondershaper 只能限制本地网络接口的传入和传出流量,而不能限制路由器或调制解调器的接口。换句话说,Wondershaper 只会限制本地系统本身的网络带宽,而不会限制网络中的其它系统。因此 Wondershaper 主要用于限制本地系统中一个或多个网卡的带宽。
|
||||
|
||||
下面来看一下 Wondershaper 是如何优化网络流量的。
|
||||
|
||||
### 在 Linux 中使用 Wondershaper 限制网络带宽
|
||||
|
||||
`wondershaper` 是用于显示系统网卡网络带宽的简单脚本。它使用了 `iproute` 和 `tc` 命令,但大大简化了操作过程。
|
||||
|
||||
**安装 Wondershaper**
|
||||
|
||||
使用 `git clone` 克隆 Wondershaper 的版本库就可以安装最新版本:
|
||||
|
||||
```
|
||||
$ git clone https://github.com/magnific0/wondershaper.git
|
||||
|
||||
```
|
||||
|
||||
按照以下命令进入 `wondershaper` 目录并安装:
|
||||
|
||||
```
|
||||
$ cd wondershaper
|
||||
|
||||
$ sudo make install
|
||||
|
||||
```
|
||||
|
||||
然后执行以下命令,可以让 `wondershaper` 在每次系统启动时都自动开始服务:
|
||||
|
||||
```
|
||||
$ sudo systemctl enable wondershaper.service
|
||||
|
||||
$ sudo systemctl start wondershaper.service
|
||||
|
||||
```
|
||||
|
||||
如果你不强求安装最新版本,也可以使用软件包管理器(官方和非官方均可)来进行安装。
|
||||
|
||||
`wondershaper` 在 [Arch 用户软件仓库][1](Arch User Repository, AUR)中可用,所以可以使用类似 [`yay`][2] 这些 AUR 辅助软件在基于 Arch 的系统中安装 `wondershaper` 。
|
||||
|
||||
```
|
||||
$ yay -S wondershaper-git
|
||||
|
||||
```
|
||||
|
||||
对于Debian、Ubuntu 和 Linux Mint 可以使用以下命令安装:
|
||||
|
||||
```
|
||||
$ sudo apt-get install wondershaper
|
||||
|
||||
```
|
||||
|
||||
对于 Fedora 可以使用以下命令安装:
|
||||
|
||||
```
|
||||
$ sudo dnf install wondershaper
|
||||
|
||||
```
|
||||
|
||||
对于 RHEL、CentOS,只需要启用 EPEL 仓库,就可以使用以下命令安装:
|
||||
|
||||
```
|
||||
$ sudo yum install epel-release
|
||||
|
||||
$ sudo yum install wondershaper
|
||||
|
||||
```
|
||||
|
||||
在每次系统启动时都自动启动 `wondershaper` 服务。
|
||||
|
||||
```
|
||||
$ sudo systemctl enable wondershaper.service
|
||||
|
||||
$ sudo systemctl start wondershaper.service
|
||||
|
||||
```
|
||||
|
||||
**用法**
|
||||
|
||||
首先需要找到网络接口的名称,通过以下几个命令都可以查询到网卡的详细信息:
|
||||
|
||||
```
|
||||
$ ip addr
|
||||
|
||||
$ route
|
||||
|
||||
$ ifconfig
|
||||
|
||||
```
|
||||
|
||||
在确定网卡名称以后,就可以按照以下的命令限制网络带宽:
|
||||
|
||||
```
|
||||
$ sudo wondershaper -a <adapter> -d <rate> -u <rate>
|
||||
|
||||
```
|
||||
|
||||
例如,如果网卡名称是 `enp0s8`,并且需要把上行、下行速率分别限制为 1024 Kbps 和 512 Kbps,就可以执行以下命令:
|
||||
|
||||
```
|
||||
$ sudo wondershaper -a enp0s8 -d 1024 -u 512
|
||||
|
||||
```
|
||||
|
||||
其中参数的含义是:
|
||||
|
||||
* `-a`:网卡名称
|
||||
* `-d`:下行带宽
|
||||
* `-u`:上行带宽
|
||||
|
||||
|
||||
|
||||
如果要对网卡解除网络带宽的限制,只需要执行:
|
||||
|
||||
```
|
||||
$ sudo wondershaper -c -a enp0s8
|
||||
|
||||
```
|
||||
|
||||
或者:
|
||||
|
||||
```
|
||||
$ sudo wondershaper -c enp0s8
|
||||
|
||||
```
|
||||
|
||||
如果系统中有多个网卡,为确保稳妥,需要按照上面的方法手动设置每个网卡的上行、下行速率。
|
||||
|
||||
如果你是通过 `git clone` 克隆 GitHub 版本库的方式安装 Wondershaper,那么在 `/etc/conf.d/` 目录中会存在一个名为 `wondershaper.conf` 的配置文件,修改这个配置文件中的相应值(包括网卡名称、上行速率、下行速率),也可以设置上行或下行速率。
|
||||
|
||||
```
|
||||
$ sudo nano /etc/conf.d/wondershaper.conf
|
||||
|
||||
[wondershaper]
|
||||
# Adapter
|
||||
#
|
||||
IFACE="eth0"
|
||||
|
||||
# Download rate in Kbps
|
||||
#
|
||||
DSPEED="2048"
|
||||
|
||||
# Upload rate in Kbps
|
||||
#
|
||||
USPEED="512"
|
||||
|
||||
```
|
||||
|
||||
Wondershaper 使用前:
|
||||
![](https://www.ostechnix.com/wp-content/uploads/2018/09/wondershaper-1.png)
|
||||
|
||||
Wondershaper 使用后:
|
||||
![](https://www.ostechnix.com/wp-content/uploads/2018/09/wondershaper-2.png)
|
||||
|
||||
可以看到,使用 Wondershaper 限制网络带宽之后,下行速率与限制之前相比已经大幅下降。
|
||||
|
||||
执行以下命令可以查看更多相关信息。
|
||||
|
||||
```
|
||||
$ wondershaper -h
|
||||
|
||||
```
|
||||
|
||||
也可以查看 Wondershaper 的用户手册:
|
||||
|
||||
```
|
||||
$ man wondershaper
|
||||
|
||||
```
|
||||
|
||||
As far as tested, Wondershaper worked just fine as described above. Give it a try and let us know what do you think about this utility.
|
||||
根据测试,Wondershaper 按照上面的方式可以有很好的效果。你可以试用一下,然后发表你的看法。
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.ostechnix.com/how-to-limit-network-bandwidth-in-linux-using-wondershaper/
|
||||
|
||||
作者:[SK][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[HankChow](https://github.com/HankChow)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.ostechnix.com/author/sk/
|
||||
[1]: https://aur.archlinux.org/packages/wondershaper-git/
|
||||
[2]: https://www.ostechnix.com/yay-found-yet-another-reliable-aur-helper/
|
||||
|
@ -0,0 +1,230 @@
|
||||
# 如何在 Ubuntu 以及其他 Linux 发行版上安装 Popcorn Time
|
||||
|
||||
**简要:这篇教程展示给你如何在 Ubuntu 和其他 Linux 发行版上安装 Popcorn Time,也会讨论一些 Popcorn Time 的便捷操作**
|
||||
|
||||
[Popcorn Time][1] 是一个受开源 [Netflix][2] 启发的 [torrent][3] 流媒体应用,可以在 Linux,Mac上Windows 上运行。
|
||||
|
||||
传统的 torrents,在你看影片之前必须等待它下载完成。
|
||||
|
||||
[Popcorn Time][4] 有所不同。它的使用基于 torrent,但是允许你(几乎)立即开始观看影片。他跟你在 Youtube 或者 Netflix 等流媒体网页上看影片一样,无需等待它下载完成。
|
||||
|
||||
![Popcorn Time in Ubuntu Linux][5]
|
||||
Popcorn Time
|
||||
|
||||
如果你不想在看在线电影时被突如其来的广告吓倒的话,Popcorn Time 是一个不错的选择。不过要记得,它的播放质量依赖于当前网络中可用的种子(seeds)数。
|
||||
|
||||
Popcorn Time 还提供了一个不错的用户界面,让你能够浏览可用的电影,电视剧和其他视频内容。如果你曾经[在 Linux 上使用过 Netflix][6],你会发现两者有一些相似之处。
|
||||
|
||||
有些国家严格打击盗版,所以使用 torrent 下载电影是违法行为。在类似美国,英国和西欧等一些国家,你或许曾经收到过法律声明。也就是说,是否使用取决于你。已经警告过你了。
|
||||
(如果你仍想要冒险使用 Popcorn Time,你应该使用像 [Ivacy][7] 这样的 VPN 服务,它为使用 Torrents 和保护隐私有特别的设计。即便这样,也不能完全避免被查到。)
|
||||
|
||||
Popcorn Time 一些主要的特点:
|
||||
|
||||
* 使用 Torrent 在线观看电影和电视剧
|
||||
* 有一个时尚的用户界面让你浏览可用的电影和电视剧资源
|
||||
* 调整流媒体的质量
|
||||
* 标记为稍后观看
|
||||
* 下载为离线观看
|
||||
* 可以默认开启字幕,改变字母尺寸等
|
||||
* 使用键盘快捷键浏览
|
||||
|
||||
|
||||
### 如何在 Ubuntu 和其它 Linux 发行版上安装 Popcorn Time
|
||||
|
||||
这篇教程以 Ubuntu 18.04 为例,但是你可以使用类似的结构,在例如 Linux Mint,Debian,Manjaro,Deepin等 Linux 发行版上安装。
|
||||
|
||||
接下来我们看该如何在 Linux 上安装 Popcorn Time。事实上,这个过程非常简单。只需要按照说明操作复制粘贴我提到的这些命令即可。
|
||||
|
||||
#### 第一步:下载 Popcorn Time
|
||||
|
||||
你可以从它的官网上安装 Popcorn Time。它主页上的下载链接是。
|
||||
[Get Popcorn Time](https://popcorntime.sh/)
|
||||
|
||||
#### 第二步:安装 Popcorn Time
|
||||
|
||||
下载完成之后,就该使用它了。下载下来的是一个 tar 文件,在这些文件里面包含有一个可执行文件。你可以把 tar 文件提取在任何位置,[Linux 常把附加软件安装在][8] /[opt 目录。][8]
|
||||
|
||||
在 /opt 下创建一个新的目录:
|
||||
|
||||
```
|
||||
sudo mkdir /opt/popcorntime
|
||||
```
|
||||
|
||||
现在进入你下载文件的文件夹中,比如我把 Popcorn Time 下载到了主目录的 Downloads目录下。
|
||||
|
||||
```
|
||||
cd ~/Downloads
|
||||
```
|
||||
|
||||
提取下载好的 Popcorn Time 文件到新创建的 /opt/popcorntime 目录下
|
||||
|
||||
```
|
||||
sudo tar Jxf Popcorn-Time-* -C /opt/popcorntime
|
||||
```
|
||||
|
||||
#### 第三步:让所有用户可以使用 Popcorn Time
|
||||
|
||||
如果你想要系统中所有的用户无需经过 sudo 就可以运行 Popcorn Time。你需要在 /usr/bin 目录下创建一个[符号链接(软链接)][9]指向这个可执行文件。
|
||||
|
||||
```
|
||||
ln -sf /opt/popcorntime/Popcorn-Time /usr/bin/Popcorn-Time
|
||||
```
|
||||
|
||||
#### 第四步:为 Popcorn Time 创建桌面启动器
|
||||
|
||||
到目前为止,一切顺利,但是你也许想要在应用菜单里看到 Popcorn Time,又或是想把它添加到最喜欢的应用列表里等。
|
||||
|
||||
为此,你需要创建一个桌面入口。
|
||||
|
||||
打开一个终端窗口,在 /usr/share/applications 目录下创建一个名为 popcorntime.desktop 的文件。
|
||||
|
||||
你可以使用任何[基于命令行的文本编辑器][10]。Ubuntu 默认安装了 [Nano][11],所以你可以直接使用这个。
|
||||
|
||||
```
|
||||
sudo nano /usr/share/applications/popcorntime.desktop
|
||||
```
|
||||
|
||||
在里面插入以下内容:
|
||||
|
||||
```
|
||||
[Desktop Entry]
|
||||
Version = 1.0
|
||||
Type = Application
|
||||
Terminal = false
|
||||
Name = Popcorn-Time
|
||||
Exec = /usr/bin/Popcorn-Time
|
||||
Icon = /opt/popcorntime/popcorn.png
|
||||
Categories = Application;
|
||||
```
|
||||
|
||||
如果你使用的是 Nano 编辑器,使用 Ctrl+X 保存输入的内容,当询问是否保存时,输入 Y,然后按回车保存并退出。
|
||||
|
||||
就快要完成了。最后一件事就是为 Popcorn Time 设置一个正确的图标。你可以下载一个 Popcorn Time 图标到 /opt/popcorntime 目录下,并命名为 popcorn.png。
|
||||
|
||||
你可以使用以下命令:
|
||||
|
||||
```
|
||||
sudo wget -O /opt/popcorntime/popcorn.png https://upload.wikimedia.org/wikipedia/commons/d/df/Pctlogo.png
|
||||
```
|
||||
|
||||
这样就 OK 了。现在你可以搜索 Popcorn Time 然后点击启动它了。
|
||||
|
||||
![Popcorn Time installed on Ubuntu][12]
|
||||
在菜单里搜索 Popcorn Time
|
||||
|
||||
第一次启动时,你必须接受这些条款和条件。
|
||||
|
||||
![Popcorn Time in Ubuntu][13]
|
||||
接受这些服务条款
|
||||
|
||||
一旦你完成这些,你就可以享受你的电影和电视节目了。
|
||||
|
||||
![Watch movies on Popcorn Time][14]
|
||||
|
||||
好了,这就是所有你在 Ubuntu 或者其他 Linux 发行版上安装 Popcorn Time 所需要的了。你可以直接开始看你最喜欢的影视节目了。
|
||||
|
||||
当然,如果你有兴趣的话,我建议你阅读以下关于 Popcorn Time 的小贴士,可以学到更多。
|
||||
|
||||
[![][15]][16]
|
||||
![][17]
|
||||
|
||||
### 高效使用 Popcorn Time 的七个小贴士
|
||||
|
||||
现在你已经安装好了 Popcorn Time 了,我接下来将要告诉你一些有用的 Popcorn Time 技巧。我保证它会增强你使用 Popcorn Time 的体验。
|
||||
|
||||
#### 1\. 使用高级设置
|
||||
|
||||
始终启用高级设置。它给了你更多的选项去调整 Popcorn Time 点击右上角的齿轮标记。查看其中的高级设置。
|
||||
|
||||
![](https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2015/01/Popcorn_Time_Tricks.jpeg)
|
||||
|
||||
#### 2\. 在 VLC 或者其他播放器里观看影片
|
||||
|
||||
你知道你可以选择自己喜欢的播放器而不是 Popcorn Time 默认的播放器观看一个视频吗?当然,这个播放器必须已经安装在你的系统上了。
|
||||
|
||||
现在你可能会问为什么要使用其他的播放器。我的回答是:其他播放器可以弥补 Popcorn Time 默认播放器上的一些不足。
|
||||
|
||||
例如,如果一个文件的声音非常小,你可以使用 VLC 将音频声音增强 400%,你还可以[使用 VLC 同步不连贯的字幕][18]。你可以在播放文件之前在不同的媒体播放器之间进行切换。
|
||||
|
||||
![](https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2015/01/Pocorn_Time_Tricks_1.png)
|
||||
|
||||
#### 3\. 将影片标记为稍后观看
|
||||
|
||||
只是浏览电影和电视节目,但是却没有时间和精力去看?这不是问题。你可以添加这些影片到书签里面,稍后可以在 Faveriate 标签里面访问这些影片。这可以让你创建一个你想要稍后观看的列表。
|
||||
|
||||
![](https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2015/01/Pocorn_Time_Tricks2.png)
|
||||
|
||||
#### 4\. 检查 torrent 的信息和种子信息
|
||||
|
||||
像我之前提到的,你在 Popcorn Time 的观看体验依赖于 torrent 的速度。好消息是 Popcorn Time 显示了 torrent 的信息,因此你可以知道流媒体的速度。
|
||||
|
||||
你可以在文件上看到一个绿色 / 黄色 / 红色的点。绿色意味着有足够的种子,文件很容易播放。黄色意味着有中等数量的种子,应该可以播放。红色意味着只有非常少可用的种子,播放的速度会很慢甚至无法观看。
|
||||
|
||||
![](https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2015/01/Pocorn_Time_Tricks3.jpg)
|
||||
|
||||
#### 5\. 添加自定义字幕
|
||||
|
||||
如果你需要字幕而且它没有你想要的语言,你可以从外部网站下载自定义字幕。得到 .src 文件,然后就可以在 Popcorn Time 中使用它:
|
||||
|
||||
![](https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2015/01/Pocporn_Time_Tricks5.png)
|
||||
|
||||
这是[用 VLC 自动下载字幕][19]
|
||||
|
||||
#### 6\. 保存文件离线观看
|
||||
|
||||
用 Popcorn Time 播放内容时,它会下载并暂时存储这些内容。当你关闭 APP 时,缓存会被清理干净。你可以更改这个操作,使得下载的文件可以保存下来供你未来使用。
|
||||
|
||||
在高级设置里面,向下滚动一点。找到缓存目录,你可以把它更改到其他像是 Downloads 目录,这下你即便关闭了 Popcorn Time,这些文件依旧可以观看。
|
||||
|
||||
![](https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2015/01/Popcorn_Time_Tips.jpg)
|
||||
|
||||
#### 7\. 拖放外部 torrent 文件立即播放
|
||||
|
||||
我猜你不知道这个操作。如果你没有在 Popcorn Time 发现某些影片,从你最喜欢的 torrent 网站下载 torrent 文件,打开 Popcorn Time,然后拖放这个 torrent 文件到 Popcorn Time 里面。它将会立即播放文件,当然这个取决于种子。这次你不需要在观看前下载整个文件了。
|
||||
|
||||
当你拖放文件到 Popcorn Time 后,它将会给你对应的选项,选择它应该播放的。如果里面有字幕,它会自动播放,否则你需要添加外部字幕。
|
||||
|
||||
![](https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2015/01/Pocorn_Time_Tricks4.png)
|
||||
|
||||
在 Popcorn Time 里面有很多的功能,但是我决定就此打住,剩下的就由你自己来探索吧。我希望你能发现更多 Popcorn Time 有用的功能和技巧。
|
||||
|
||||
我再提醒一遍,使用 Torrents 在很多国家是违法的。如果你还是这样做了,请做好防护措施,并使用 VPN 服务。如果你想要我的建议,你可以去看一下(让 [ProtonMail][21] 成名的)[瑞士的隐私公司 ProtonVPN][20]。新加坡的 [Ivacy][7] 也是一个不错的选择。如果你觉得这些都太贵了,你可以看一下[在 FOSS SHOP 上廉价的 VPN][22]
|
||||
|
||||
注意:这篇文章里包含了会员链接,请阅读我们的[会员隐私][23]。
|
||||
|
||||
|
||||
-----------------------------------
|
||||
|
||||
via: https://itsfoss.com/popcorn-time-ubuntu-linux/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[dianbanjiu](https://github.com/dianbanjiu)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[1]: https://popcorntime.sh/
|
||||
[2]: https://netflix.com/
|
||||
[3]: https://en.wikipedia.org/wiki/Torrent_file
|
||||
[4]: https://en.wikipedia.org/wiki/Popcorn_Time
|
||||
[5]: https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/09/popcorn-time-linux.jpeg
|
||||
[6]: https://itsfoss.com/netflix-firefox-linux/
|
||||
[7]: https://billing.ivacy.com/page/23628
|
||||
[8]: http://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/opt.html
|
||||
[9]: https://en.wikipedia.org/wiki/Symbolic_link
|
||||
[10]: https://itsfoss.com/command-line-text-editors-linux/
|
||||
[11]: https://itsfoss.com/nano-3-release/
|
||||
[12]: https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/09/popcorn-time-ubuntu-menu.jpg
|
||||
[13]: https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/09/popcorn-time-ubuntu-license.jpeg
|
||||
[14]: https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/09/popcorn-time-watch-movies.jpeg
|
||||
[15]: https://ivacy.postaffiliatepro.com/accounts/default1/vdegzkxbw/7f82d531.png
|
||||
[16]: https://billing.ivacy.com/page/23628/7f82d531
|
||||
[17]: http://ivacy.postaffiliatepro.com/scripts/vdegzkxiw?aff=23628&a_bid=7f82d531
|
||||
[18]: https://itsfoss.com/how-to-synchronize-subtitles-with-movie-quick-tip/
|
||||
[19]: https://itsfoss.com/download-subtitles-automatically-vlc-media-player-ubuntu/
|
||||
[20]: https://protonvpn.net/?aid=chmod777
|
||||
[21]: https://itsfoss.com/protonmail/
|
||||
[22]: https://shop.itsfoss.com/search?utf8=%E2%9C%93&query=vpn
|
||||
[23]: https://itsfoss.com/affiliate-policy/
|
Loading…
Reference in New Issue
Block a user