id
int64
2.05k
16.6k
title
stringlengths
5
75
fromurl
stringlengths
19
185
date
timestamp[s]
tags
sequencelengths
0
11
permalink
stringlengths
20
37
content
stringlengths
342
82.2k
fromurl_status
int64
200
526
status_msg
stringclasses
339 values
from_content
stringlengths
0
229k
10,999
在 Fedora 中安装替代版本的 RPM 包
https://fedoramagazine.org/installing-alternative-rpm-versions-in-fedora/
2019-06-21T01:45:00
[ "模块化", "Fedora" ]
https://linux.cn/article-10999-1.html
![](/data/attachment/album/201906/21/014540v1zgpsss9dqqwipa.jpg) <ruby> <a href="https://docs.pagure.org/modularity"> 模块化 </a> <rt> Modularity </rt></ruby>使 Fedora 能够在仓库中提供替代版本的 RPM 软件包。每个 Fedroa 版本可以原生构建不同应用、语言运行时和工具版本的多个版本。 Fedora Magazine 大约一年前就写了 [Fedora 28 服务器版的模块化](/article-10479-1.html)。那时,它只是一个有附加内容的可选仓库,并且明确只支持服务器版。到目前为止,它已经发生了很多变化,现在**模块化是 Fedora 发行版的核心部分**。一些软件包已完全变成模块。在编写本文时,Fedora 30 的 49,464 个二进制 RPM 软件包中的 1,119(2.26%)来自模块([关于这个数字的更多信息](https://blog.samalik.com/2019/06/12/counting-modularity-packages.html))。 ### 模块化基础知识 由于许多软件包有不同的版本会让人难以承受(并且难以管理),所以包被分组为**模块**,它可以代表一个应用程序、一个语言运行时或任何其他合理的组。 模块通常有多个**流**,这通常代表软件的主要版本。它可以并行使用,但在给定系统上只能安装每个模块的一个流。 为了不让用户因为太多选择而难以承受,每个 Fedora 版本都有一组**默认**,因此只需要在需要时做出决定。 最后,为了简化安装,可以根据用例使用预定义的 **profile** 选择性地安装模块。例如,数据库模块可以作为客户端,服务端或同时安装。 ### 实际使用模块化 当你在 Fedora 系统上安装 RPM 软件包时,它很可能它来自模块流。你可能没有注意到的原因之一是模块化的核心原则之一是在你探究之前保持不可见。 让我们比较以下两种情况。首先,安装流行的 i3 平铺窗口管理器,然后安装极简化的 dwm 窗口管理器: ``` $ sudo dnf install i3 ... Done! ``` 正如所料,上面的命令会在系统上安装 i3 包及其依赖项。这里没有其他事情发生。但另一个会怎么样? ``` $ sudo dnf install dwm ... Enabling module streams: dwm 6.1 ... Done! ``` 感觉是一样的,但后台发生了一些事情 。它启用了默认的 dwm 模块流(6.1),并且安装了模块中的 dwm 包。 为了保持透明,输出中有一条关于模块自动启用的消息。但除此之外,用户不需要了解模块化的任何信息,以便按照他们一贯的方式使用他们的系统。 但如果他们使用模块化方式呢?让我们看看如何安装不同版本的 dwm。 使用以下命令查看可用的模块流: ``` $ sudo dnf module list ... dwm latest ... dwm 6.0 ... dwm 6.1 [d] ... dwm 6.2 ... ... Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled ``` 输出显示 dwm 模块有四个流,6.1 是默认值。 要安装不同版本的 dwm 包,例如,安装 6.2 的流。启用它,然后使用以下两个命令安装软件包: ``` $ sudo dnf module enable dwm:6.2 ... Enabling module streams: dwm 6.2 ... Done! $ sudo dnf install dwm ... Done! ``` 最后,让我们看下配置,以 PostgreSQL 为例。 ``` $ sudo dnf module list ... postgresql 9.6 client, server ... postgresql 10 client, server ... postgresql 11 client, server ... ... ``` 要安装 PostgreSQL 11 服务端,使用以下命令: ``` $ sudo dnf module install postgresql:11/server ``` 请注意,除了启用流之外,我们可以指定配置从而使用一条命令安装模块。 可以立即安装多个版本。要添加客户端工具,使用下面的命令: ``` $ sudo dnf module install postgresql:11/client ``` 还有许多其他带有多个流的模块可供选择。在编写本文时,Fedora 30 中有 83 个模块流。包括两个版本的 MariaDB、三个版本的 Node.js、两个版本的 Ruby 等等。 有关完整的命令集(包括从一个流切换到另一个流),请参阅[模块化的官方用户文档](https://docs.fedoraproject.org/en-US/modularity/using-modules/)。 --- via: <https://fedoramagazine.org/installing-alternative-rpm-versions-in-fedora/> 作者:[Adam Šamalík](https://fedoramagazine.org/author/asamalik/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
[Modularity](https://docs.pagure.org/modularity) enables Fedora to provide alternative versions of RPM packages in the repositories. Several different applications, language runtimes, and tools are available in multiple versions, build natively for each Fedora release. The Fedora Magazine has already covered [Modularity in Fedora 28 Server Edition](https://fedoramagazine.org/modularity-fedora-28-server-edition/) about a year ago. Back then, it was just an optional repository with additional content, and as the title hints, only available to the Server Edition. A lot has changed since then, and now **Modularity is a core part of the Fedora distribution**. And some packages have moved to modules completely. At the time of writing — out of the 49,464 binary RPM packages in Fedora 30 — 1,119 (2.26%) come from a module ([more about the numbers](https://blog.samalik.com/2019/06/12/counting-modularity-packages.html)). ## Modularity basics Because having too many packages in multiple versions could feel overwhelming (and hard to manage), packages are grouped into **modules** that represent an application, a language runtime, or any other sensible group. Modules often come in multiple **streams** — usually representing a major version of the software. Available in parallel, but only one stream of each module can be installed on a given system. And not to overwhelm users with too many choices, each Fedora release comes with a set of **defaults** — so decisions only need to be made when desired. Finally, to simplify installation, modules can be optionally installed using pre-defined **profiles** based on a use case. A database module, for example, could be installed as a client, a server, or both. ## Modularity in practice When you install an RPM package on your Fedora system, chances are it comes from a module stream. The reason why you might not have noticed is one of the core principles of Modularity — remaining invisible until there is a reason to know about it. Let’s compare the following two situations. First, installing the popular *i3* tiling window manager, and second, installing the minimalist *dwm* window manager: $sudo dnf install i3 ... Done! As expected, the above command installs the *i3* package and its dependencies on the system. Nothing else happened here. But what about the other one? $sudo dnf install dwm ... Enabling module streams: dwm 6.1 ... Done! It feels the same, but something happened in the background — the default *dwm* module stream (*6.1*) got enabled, and the *dwm* package from the module got installed. To be transparent, there is a message about the module auto-enablement in the output. But other than that, the user doesn’t need to know anything about Modularity in order to use their system the way they always did. But what if they do? Let’s see how a different version of *dwm* could have been installed instead. Use the following command to see what module streams are available: $sudo dnf module list ... dwm latest ... dwm 6.0 ... dwm 6.1 [d] ... dwm 6.2 ... ... Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled The output shows there are four streams of the *dwm* module, *6.1* being the default. To install the *dwm* package in a different version — from the *6.2* stream for example — enable the stream and then install the package by using the two following commands: $sudo dnf module enable dwm:6.2 ... Enabling module streams: dwm 6.2 ... Done! $sudo dnf install dwm ... Done! Finally, let’s have a look at profiles, with PostgreSQL as an example. $sudo dnf module list ... postgresql 9.6 client, server ... postgresql 10 client, server ... postgresql 11 client, server ... ... To install PostgreSQL 11 as a server, use the following command: $sudo dnf module install postgresql:11/server Note that — apart from enabling — modules can be installed with a single command when a profile is specified. It is possible to install multiple profiles at once. To add the client tools, use the following command: $sudo dnf module install postgresql:11/client There are many other modules with multiple streams available to choose from. At the time of writing, there were 83 module streams in Fedora 30. That includes two versions of MariaDB, three versions of Node.js, two versions of Ruby, and many more. Please refer to the [official user documentation for Modularity](https://docs.fedoraproject.org/en-US/modularity/using-modules/) for a complete set of commands including switching from one stream to another. ## Stephen Gallagher A handy shorthand for installing multiple profiles at the same time is ## Jens Petersen I clicked on this, thinking we had a module for the rpm package now… 😉 I think it would be clearer to include the word “package/s” in the title. 🙂 ## Adam Šamalík Oops! I can see that. I’ve fixed that. ## Walter Hi Adam, I’m on Fedora Rawhide (5.2.0-0.rc3.git0.1.fc31.x86_64) and from the very beginning I ran into this problem: Whenever I do a dnf update I get ————snip 1 Last metadata expiration check: 0:45:12 ago on Thu 13 Jun 2019 06:40:13 AM CEST. Modular dependency problem: Problem: module libgit2:0.28:3120190606170438:f636be4b-0.x86_64 conflicts with module(libgit2:0.27) provided by libgit2:0.27:31201904 07181414:f636be4b-0.x86_64 – module libgit2:0.27:3120190407181414:f636be4b-0.x86_64 conflicts with module(libgit2:0.28) provided by libgit2:0.28:31201906061704 38:f636be4b-0.x86_64 – module tokei:rolling:3120190424130518:c3f9a127-0.x86_64 requires module(libgit2:0.27), but none of the providers can be installed – conflicting requests Dependencies resolved. —————–snap 1 A module list shows up with ———- snip 2 dnf module list libgit2 Last metadata expiration check: 0:35:08 ago on Thu 13 Jun 2019 06:40:13 AM CEST. Modular dependency problem: Problem: module libgit2:0.28:3120190606170438:f636be4b-0.x86_64 conflicts with module(libgit2:0.27) provided by libgit2:0.27:3120190407181414:f636be4b-0.x86_64 – module libgit2:0.27:3120190407181414:f636be4b-0.x86_64 conflicts with module(libgit2:0.28) provided by libgit2:0.28:3120190606170438:f636be4b-0.x86_64 – module tokei:rolling:3120190424130518:c3f9a127-0.x86_64 requires module(libgit2:0.27), but none of the providers can be installed – conflicting requests Fedora – Modular Rawhide – Developmental packages for the next Fedora release Name Stream Profiles Summary libgit2 0.26 Library implementation of Git libgit2 0.27 Library implementation of Git libgit2 0.28 [d][e] Library implementation of Git ——————– snap 2 I tried different things like making 0.27 default/enabled – but no luck! The problem remains the same. What can I do in order to solve this issue? Thanks for your time! 🙂 ## Clément Verna Hi Walter, I think you are experiencing this issue https://bugzilla.redhat.com/show_bug.cgi?id=1718646#c4. ## walter Thanks Clement for the hint. Seems it’s a “poor DNF implementation of modularity” in Fedora…. 🙁 ## alfC Can this be used to install older version of gcc side-by-side? I need gcc 8 (in place of gcc 9) to compile with Nvidia’s nvcc. ## Danny Arcarius Mexen Thank you very much for this. I recently switched to Fedora so I am still learning and exploring. This was a wonderful article and I learned something new. ## FeRD (Frank Dana) OOC, if you already have postgresql:11/server installed, do you have to specify the entire ‘postgresql:11/client’ selector, to install the client? Seems like one of ‘postgresql/client’ or ‘postgresql:client’ should be sufficient (not sure how the syntax is parsed exactly), since if I’m reading correctly 11 is the only client version option if 11/server is already installed, right? ## scr888 for blackberry z10 So, really, every item and fixture considered, the Yankees have a better left fielder ok. Yes, I consider films for a great art form, after i do prose and poetry. http://transmobile.ru/bitrix/rk.php?goto=http%3A%2F%2F918.cafe%2Fdownloads%2F61-download-918kiss-scr888-ios-android
11,000
为什么初创公司应该将代码开源
https://opensource.com/article/19/5/startups-release-code
2019-06-21T02:16:33
[ "开源" ]
/article-11000-1.html
> > Dokit 曾经怀疑将自己的知识开源可能是一个失败的商业决策,然而正是这个选择奠定了它的成功。 > > > ![](/data/attachment/album/201906/21/021544p96mvbhhvas5ttlv.jpg) 回想一个项目开展最初期的细节并不是一件容易的事情,但这有时候可以帮助你更清晰地理解这个项目。如果让我来说,关于 [Dokit](https://dokit.io/) 这个用来创建用户手册和文档的平台的最早的想法来自我的童年。小时候我家里都是 Meccano(LCTT 译注:一种类似乐高的拼装玩具)和飞机模型之类的玩具,对于我来说,游戏中很重要的一部分就是动手制作,把独立的零件组装在一起来创造一个新的东西。我父亲在一家 DIY 公司工作,所以家里到处都建筑、修理,以及使用说明书。小的时候父母还让我参加了童子军,在那里我们制作桌子和帐篷,还有泥巴做的烧烤炉,这些事情都培养了我在共同学习中感受到的乐趣,就像我在开源活动中感受到的一样。 在童年学到的修理东西和回收产品的本领成为了我工作的一部分。后来我决心要用线上的方式,还原这种在家里或者小组里学习如何制作和修理东西时的那种非常棒的感觉。Dokit 就从这个想法中诞生了。 ### 创业初期 事情并非一帆风顺,在我们的公司于 2017 年成立之后,我很快就意识到那些最庞大、最值得奋斗的目标一般来说也总是最困难的。如果想要实现我们的计划 —— 彻底改变 [老式的说明书和用户手册的编写和发行方式](https://dokit.io/9-reasons-to-stop-writing-your-user-manuals-or-work-instructions-with-word-processors/),并且在这个细分市场(我们非常清楚这一点)里取得最大的影响力 —— 那么确立一个主导任务就十分关键,它关乎项目的组织方式。我们据此做出了第一个重要决策:首先 [在短时间内使用一个已有的开源框架 MediaWiki 制作产品原型来验证我们的想法](https://medium.com/@gofloaters/5-cheap-ways-to-build-your-mvp-71d6170d5250),然后将我们的全部代码都作为开源项目发布。 当时 [MediaWiki](https://en.wikipedia.org/wiki/MediaWiki) 已经在正常运作了,事后看来,这一点让我们的决策变得容易了许多。这个平台已经拥有我们设想的最小可用产品(MVP)所需要的 90% 的功能,并且在全世界范围内有 15000 名活跃的开发者。MediaWiki 因为是维基百科的驱动引擎而小有名气,如果没有来自它的支持,事情对我们来说无疑会困难很多。还有一个许多公司都在使用的文档平台 Confluence 也有一些不错的功能,但是最终在这两者之间做出选择还是很容易的。 出于对社区的信赖,我们把自己平台的初始版本完全放在了 GitHub 上。我们甚至还没有真正开始进行推广,就已经可以看到世界各地的创客们开始使用我们的平台,这种令人激动的感觉似乎说明我们的选择是正确的。尽管 [创客以及 Fablab 运动](https://en.wikipedia.org/wiki/Maker_culture)(LCTT 译注:Fablab 是一种向个人提供包括 3D 打印在内的电子化制造服务的小型工坊)都在鼓励用户积极分享说明材料,并且在 [Fablab 章程](http://fab.cba.mit.edu/about/charter/) 中也写明了这一点,但现实中像模像样的文档还是不太多见。 人们喜欢使用我们这个平台的首要原因是它可以解决一个非常实在的问题:一个本来还不错的项目,却使用了非常糟糕的文档 —— 其实这个项目本来可以变得更好的。对我们来说,这有点儿像是在修复创客及 DIY 社区里的一个裂缝。在我们的平台发布后的一年之内,Fablabs、[Wikifab](https://wikifab.org/)、[Open Source Ecology](https://www.opensourceecology.org/)、[Les Petits Debrouillards](http://www.lespetitsdebrouillards.org/)、[Ademe](https://www.ademe.fr/en) 以及 [Low-Tech Lab](http://lowtechlab.org/) 都在他们的服务器上安装了我们的工具,用来制作逐步引导的教程。 甚至在我们还没有发新闻稿之前,我们的其中一个用户 Wikifab 就开始在全国性媒体上收到“DIY 界的维基百科”这样的称赞了。短短两年之内,我们看到有数百的社区都在他们自己的 Dokits 上开展了项目,从有意思的、搞笑的,到那种很正式的产品手册都有。这种社区的力量正是我们想要驾驭的,并且有这么多的项目 —— 从风力涡轮机到宠物喂食器 —— 都在使用我们创建的平台编写非常有吸引力的产品手册,这件事情真的令我们赞叹不已。 ### 项目开源 回头看看前两年的成功,很明显选择开源是我们能迅速取得成果的关键因素。最有价值的事情就是在开源项目中获得反馈的能力了。如果一段代码无法正常运行,[会有人立刻告诉我们](https://opensource.guide/how-to-contribute/)。如果可以从这些已经在使用你提供的服务的人那里学到这么多东西,为什么还要需要等着和顾问们开会呢? 社区对我们这个项目的关注程度也反映出了这个市场的潜力(包括利润上的潜力)。[巴黎有一个非常好的、成长迅速的开发者社区](https://www.rudebaguette.com/2013/03/here-are-the-details-on-the-new-developer-school-that-xavier-niel-is-launching-tomorrow/?lang=en)(LCTT 译注:Dokit 是一家设立在巴黎的公司),但是开源将我们从一个只有数千当地人的小池子里带到了全世界数百万的开发者身边,他们都将成为我们的创作中的一部分。与此同时,代码的开放性也让我们的用户和客户更加放心,因为即使我们这个公司不在了,代码仍然会存续下去。 如果说上面这些都是在我们之前对开源的预期之中的话,其实这一路上也有不少惊喜。因为开源,我们获得了更多的客户、声望以及精准推广,这种推广本来以我们有限的预算是负担不起的,现在却不需要我们支付费用。我们发现开源代码还改善了我们的招聘流程,因为在雇佣之前就可以通过我们的代码来测试候选人,并且被雇佣之后的入职过程也会更加顺利。 开发者在完全公开的情况下写代码,既有一点尴尬,同时也很团结,这对我们提升产品质量很有帮助。人们可以互相发表意见和反馈,并且因为工作都是完全公开的,人们似乎会尽可能地想做到最好。为了不断优化、不断重构 Dokit 的运行方式,我们明白未来应该在对社区的支持上做得更好。 ### 下一步是什么? 尽管我们对正在做的事情一直都很有信念,并且看到很多出色的产品说明书都是用我们的软件制作出来的,我们还是会对这个项目的成长不断地感到兴奋,并且非常确信未来一定会很好。 在创业初期,我们对将自己的知识免费分发出去这件事还是非常担心的。事实证明正好相反 —— 正是开源让我们能够迅速构建起一个可持续的初创企业。Dokit 平台的设计初衷是通过社区的支持,让它的用户有信心去构建、组装、修理和创造全新的发明。事后看来,我们用开源的方式去构建了 Dokit 这个平台,这和 Dokit 本身想做的其实正好是同一件事情。 如同修理或者组装一件实体产品一样,只有当你对自己的方法有信心的时候,事情才会越来越顺利。现在,在我们创业的第三个年头,我们开始注意到全世界对这个领域的兴趣在增加,因为它迎合了出于不断变化的居家和生活方式的需求而 [想要使用或重复利用以及组装产品的新一代客户](https://www.inc.com/ari-zoldan/why-now-is-the-best-time-to-start-a-diy-home-based.html)。我们正是在通过线上社区的支持,创造一个让大家能够在自己动手做东西的时候感到更加有信心的平台。 --- via: <https://opensource.com/article/19/5/startups-release-code> 作者:[Clément Flipo](https://opensource.com/users/cl%C3%A9ment-flipo) 选题:[lujun9972](https://github.com/lujun9972) 译者:[chen-ni](https://github.com/chen-ni) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
null
HTTPSConnectionPool(host='opensource.com', port=443): Read timed out. (read timeout=10)
null
11,002
在 Fedora 中获取最新的 Ansible 2.8
https://fedoramagazine.org/get-the-latest-ansible-2-8-in-fedora/
2019-06-21T19:17:40
[ "Ansible" ]
https://linux.cn/article-11002-1.html
![](/data/attachment/album/201906/21/191741dusvu6jujm764i7s.jpg) Ansible 是世界上最受欢迎的自动化引擎之一。它能让你自动化几乎任何事情,从本地系统的设置到大量的平台和应用。它是跨平台的,因此你可以将其用于各种操作系统。请继续阅读以获取有关如何在 Fedora 中获取最新 Ansible,以及它的一些更改和改进,以及如何使用它。 ### 发布版本和功能 Ansible 2.8 最近发布了,其中包含许多修复、功能和增强。仅仅几天之后,它就可在 Fedora 29 和 30 以及 EPEL 中获取。两周前发布了后续版本 2.8.1。同样,新版本在几天内就可以在 Fedora 中获取。 [使用 sudo](https://fedoramagazine.org/howto-use-sudo/) 能够非常容易地从官方仓库安装: ``` $ sudo dnf -y install ansible ``` 2.8 版本有很长的更新列表,你可以在 [2.8 的迁移指南](https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_2.8.html)中阅读查看。但其中包含了一些好东西,比如 *Python 解释器发现功能* 。Ansible 2.8 现在会试图找出哪个 Python 是它所运行的平台的首选版本。如果失败,Ansible 会使用后备列表。但是,你仍然可以使用变量 `ansible_python_interpreter` 来设置 Python 解释器。 另一个变化使 Ansible 在各个平台上更加一致。由于 `sudo` 专用于 UNIX/Linux,而其他平台并没有,因此现在在更多地方使用 `become`。这包括了命令行开关。例如,`-ask-sudo-pass` 已变成了 `-ask-become-pass`,提示符也变成了 `BECOME password:`。 2.8 和 2.8.1 版本中还有许多其他功能。有关所有细节,请查看 [GitHub 上的官方更新日志](https://github.com/ansible/ansible/blob/stable-2.8/changelogs/CHANGELOG-v2.8.rst)。 ### 使用 Ansible 也许你不确定 Ansible 是否可以实际使用。别担心,你并不是唯一一个这样想的,因为它太强大了。但事实证明,它并不难以使用,在一个家庭内的几台电脑(甚至一台电脑)上设置都可以。 我们之前在 Fedora Magazine 中也讨论过这个话题: * [使用 Ansible 设置工作站](https://fedoramagazine.org/using-ansible-setup-workstation/) 试试看 Ansible,说下你的想法。很重要的一部分是让 Fedora 保持最新版本。自动化快乐! --- via: <https://fedoramagazine.org/get-the-latest-ansible-2-8-in-fedora/> 作者:[Paul W. Frields](https://fedoramagazine.org/author/pfrields/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
Ansible is one of the most popular automation engines in the world. It lets you automate virtually anything, from setup of a local system to huge groups of platforms and apps. It’s cross platform, so you can use it with all sorts of operating systems. Read on for more information on how to get the latest Ansible in Fedora, some of its changes and improvements, and how to put it to use. ## Releases and features Ansible 2.8 was recently released with many fixes, features, and enhancements. It was available in Fedora mere days afterward as an official update in Fedora 29 and 30, as well as EPEL. The follow-on version 2.8.1 released two weeks ago. Again, the new release was available within a few days in Fedora. Installation is, of course, easy to do from the official Fedora repositories [using sudo](https://fedoramagazine.org/howto-use-sudo/): $ sudo dnf -y install ansible The 2.8 release has a long list of changes, and you can read them in the [Porting Guide for 2.8](https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_2.8.html). But they include some goodies, such as *Python interpreter discovery.* Ansible 2.8 now tries to figure out which Python is preferred by the platform it runs on. In cases where that fails, Ansible uses a fallback list. However, you can still use a variable *ansible_python_interpreter* to set the Python interpreter. Another change makes Ansible more consistent across platforms. Since *sudo* is more exclusive to UNIX/Linux, and other platforms don’t have it, *become* is now used in more places. This includes command line switches. For example, *–ask-sudo-pass* has become *–ask-become-pass*, and the prompt is now *BECOME password:* instead. There are many more features in the 2.8 and 2.8.1 releases. Do check out the [official changelog on GitHub](https://github.com/ansible/ansible/blob/stable-2.8/changelogs/CHANGELOG-v2.8.rst) for all the details. ## Using Ansible Maybe you’re not sure if Ansible is something you could really use. Don’t worry, you might not be alone in thinking that, because it’s so powerful. But it turns out that it’s not hard to use it even for simple or individual setups like a home with a couple computers (or even just one!). We covered this topic earlier in the Fedora magazine as well: Give Ansible a try and see what you think. The great part about it is that Fedora stays quite up to date with the latest releases. Happy automating! ## Neville A. Cross I tried Ansible and was interesting to have a easy way to get your computer as you wanted after fresh install. From update, to set some user settings, installing rpmfusion and packages. To me, the odd thing is the documentation. There is no big picture of how you make a playbook. There is plenty of examples of each action, but I have to stumble my way to a functioning structure. I only know it works, but not sure is efficient. Nevertheless, I enjoyed until Fedora 30. It deprecated a python 2 package. Supposedly, the new version of Ansible will auto-discover the proper python interpreter. It is not working for me. Maybe because my twisted setup. In any case, it is possible to force the python3 interpreter. It is very clearly explained how, but not where. I stumbled again my way to making it work. So, besides some hiccups, it is really amazing what it can do for an individual computer. I bet it works wonders for people having to deal with many computers and servers. ## Paul W. Frields @Neville: I found that the easiest way to learn Ansible playbooking was by looking at other people’s playbooks. GitHub, for instance, has many examples of personal playbooks. If you’re looking for something much more complex, the Fedora infrastructure team maintains a public repository with lots of interesting usage. As for variables like the one that sets Python interpreter, they work in many places depending on the scope where you want them to apply, so there’s not one answer as to where to use them. ## Stephen Hello @Neville, You could check this thread on the topic https://discussion.fedoraproject.org/t/how-i-automated-my-fedora-workstation-with-modular-ansible-roles/579, it seems pertinent to your question.
11,004
5 款不错的开源语音识别/语音文字转换系统
https://fosspost.org/lists/open-source-speech-recognition-speech-to-text
2019-06-22T02:06:00
[ "语音", "STT" ]
https://linux.cn/article-11004-1.html
![](/data/attachment/album/201906/22/020632mxj5jjzpujxyjyhy.png) <ruby> 语音文字转换 <rt> speech-to-text </rt></ruby>(STT)系统就像它名字所蕴含的意思那样,是一种将说出的单词转换为文本文件以供后续用途的方式。 语音文字转换技术非常有用。它可以用到许多应用中,例如自动转录,使用自己的声音写书籍或文本,用生成的文本文件和其他工具做复杂的分析等。 在过去,语音文字转换技术以专有软件和库为主导,要么没有开源替代品,要么有着严格的限制,也没有社区。这一点正在发生改变,当今有许多开源语音文字转换工具和库可以让你随时使用。 这里我列出了 5 个。 ### 开源语音识别库 #### DeepSpeech 项目 ![](/data/attachment/album/201906/22/020634a9mxmrc8t8c5xdmt.png "5 Good Open Source Speech Recognition/Speech-to-Text Systems 16 open source speech recognition") 该项目由 Firefox 浏览器的开发组织 Mozilla 团队开发。它是 100% 的自由开源软件,其名字暗示使用了 TensorFlow 机器学习框架实现去功能。 换句话说,你可以用它训练自己的模型获得更好的效果,甚至可以用它来转换其它的语言。你也可以轻松的将它集成到自己的 Tensorflow 机器学习项目中。可惜的是项目当前默认仅支持英语。 它也支持许多编程语言,例如 Python(3.6)。可以让你在数秒之内完成工作: ``` pip3 install deepspeech deepspeech --model models/output_graph.pbmm --alphabet models/alphabet.txt --lm models/lm.binary --trie models/trie --audio my_audio_file.wav ``` 你也可以通过 `npm` 安装它: ``` npm install deepspeech ``` * [项目主页](https://github.com/mozilla/DeepSpeech) #### Kaldi ![](/data/attachment/album/201906/22/020635sy16ij2gcxsyyyjo.png "5 Good Open Source Speech Recognition/Speech-to-Text Systems 18 open source speech recognition") Kaldi 是一个用 C++ 编写的开源语音识别软件,并且在 Apache 公共许可证下发布。它可以运行在 Windows、macOS 和 Linux 上。它的开发始于 2009。 Kaldi 超过其他语音识别软件的主要特点是可扩展和模块化。社区提供了大量的可以用来完成你的任务的第三方模块。Kaldi 也支持深度神经网络,并且在它的网站上提供了[出色的文档](http://kaldi-asr.org/doc/index.html)。 虽然代码主要由 C++ 完成,但它通过 Bash 和 Python 脚本进行了封装。因此,如果你仅仅想使用基本的语音到文字转换功能,你就会发现通过 Python 或 Bash 能够轻易的实现。 * [项目主页](http://kaldi-asr.org) #### Julius ![](/data/attachment/album/201906/22/020639lmhy99t1jtsrj7qz.png "5 Good Open Source Speech Recognition/Speech-to-Text Systems 20 open source speech recognition") 它可能是有史以来最古老的语音识别软件之一。它的开发始于 1991 年的京都大学,之后在 2005 年将所有权转移到了一个独立的项目组。 Julius 的主要特点包括了执行实时 STT 的能力,低内存占用(20000 单词少于 64 MB),能够输出<ruby> 最优词 <rt> N-best word </rt></ruby>和<ruby> 词图 <rt> Word-graph </rt></ruby>,能够作为服务器单元运行等等。这款软件主要为学术和研究所设计。由 C 语言写成,并且可以运行在 Linux、Windows、macOS 甚至 Android(在智能手机上)。 它当前仅支持英语和日语。软件应该能够从 Linux 发行版的仓库中轻松安装。只要在软件包管理器中搜索 julius 即可。最新的版本[发布](https://github.com/julius-speech/julius/releases)于本文发布前大约一个半月之前。 * [项目主页](https://github.com/julius-speech/julius) #### Wav2Letter++ ![](/data/attachment/album/201906/22/020641f2mh558u8y5mu82h.png "5 Good Open Source Speech Recognition/Speech-to-Text Systems 22 open source speech recognition") 如果你在寻找一个更加时髦的,那么这款一定适合。Wav2Letter++ 是一款由 Facebook 的 AI 研究团队于 2 个月之前发布的开源语言识别软件。代码在 BSD 许可证下发布。 Facebook 描述它的库是“最快、<ruby> 最先进 <rt> state-of-the-art </rt></ruby>的语音识别系统”。构建它时的理念使其默认针对性能进行了优化。Facebook 最新的机器学习库 [FlashLight](https://github.com/facebookresearch/flashlight) 也被用作 Wav2Letter++ 的底层核心。 Wav2Letter++ 需要你先为所描述的语言建立一个模型来训练算法。没有任何一种语言(包括英语)的预训练模型,它仅仅是个机器学习驱动的文本语音转换工具,它用 C++ 写成,因此被命名为 Wav2Letter++。 * [项目主页](https://github.com/facebookresearch/wav2letter) #### DeepSpeech2 ![](/data/attachment/album/201906/22/020643yd07u90qzbphdpdp.png "5 Good Open Source Speech Recognition/Speech-to-Text Systems 24 open source speech recognition") 中国软件巨头百度的研究人员也在开发他们自己的语音文字转换引擎,叫做“DeepSpeech2”。它是一个端对端的开源引擎,使用“PaddlePaddle”深度学习框架进行英语或汉语的文字转换。代码在 BSD 许可证下发布。 该引擎可以在你想用的任何模型和任何语言上训练。模型并未随代码一同发布。你要像其他软件那样自己建立模型。DeepSpeech2 的源代码由 Python 写成,如果你使用过就会非常容易上手。 * [项目主页](https://github.com/PaddlePaddle/DeepSpeech) ### 总结 语音识别领域仍然主要由专有软件巨头所占据,比如 Google 和 IBM(它们为此提供了闭源商业服务),但是开源同类软件很有前途。这 5 款开源语音识别引擎应当能够帮助你构建应用,随着时间推移,它们会不断地发展。在几年之后,我们希望开源成为这些技术中的常态,就像其他行业那样。 如果你对清单有其他的建议或评论,我们很乐意在下面听到。 --- via: <https://fosspost.org/lists/open-source-speech-recognition-speech-to-text> 作者:[Simon James](https://fosspost.org/author/simonjames) 选题:[lujun9972](https://github.com/lujun9972) 译者:[LuuMing](https://github.com/LuuMing) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
301
Moved Permanently
null
11,007
用 Bash 脚本监控 Linux 上的内存使用情况
https://www.2daygeek.com/linux-bash-script-to-monitor-memory-utilization-usage-and-send-email/
2019-06-23T08:55:32
[ "内存", "脚本" ]
https://linux.cn/article-11007-1.html
![](/data/attachment/album/201906/23/085446setqkshf5zk0tn2x.jpg) 目前市场上有许多开源监控工具可用于监控 Linux 系统的性能。当系统达到指定的阈值限制时,它可以发送电子邮件警报。它可以监视 CPU 利用率、内存利用率、交换利用率、磁盘空间利用率等所有内容。 如果你只有很少的系统并且想要监视它们,那么编写一个小的 shell 脚本可以使你的任务变得非常简单。 在本教程中,我们添加了两个 shell 脚本来监视 Linux 系统上的内存利用率。当系统达到给定阈值时,它将给特定电子邮件地址发邮件。 ### 方法-1:用 Linux Bash 脚本监视内存利用率并发送电子邮件 如果只想在系统达到给定阈值时通过邮件获取当前内存利用率百分比,请使用以下脚本。 这是个非常简单直接的单行脚本。在大多数情况下,我更喜欢使用这种方法。 当你的系统达到内存利用率的 80% 时,它将触发一封电子邮件。 ``` */5 * * * * /usr/bin/free | awk '/Mem/{printf("RAM Usage: %.2f%\n"), $3/$2*100}' | awk '{print $3}' | awk '{ if($1 > 80) print $0;}' | mail -s "High Memory Alert" [email protected] ``` **注意:**你需要更改电子邮件地址而不是使用我们的电子邮件地址。此外,你可以根据你的要求更改内存利用率阈值。 **输出:**你将收到类似下面的电子邮件提醒。 ``` High Memory Alert: 80.40% ``` 我们过去添加了许多有用的 shell 脚本。如果要查看这些内容,请导航至以下链接。 \* [如何使用 shell 脚本自动执行日常活动?](https://www.2daygeek.com/category/shell-script/) ### 方法-2:用 Linux Bash 脚本监视内存利用率并发送电子邮件 如果要在邮件警报中获取有关内存利用率的更多信息。使用以下脚本,其中包括基于 `top` 命令和 `ps` 命令的最高内存利用率和进程详细信息。 这将立即让你了解系统的运行情况。 当你的系统达到内存利用率的 “80%” 时,它将触发一封电子邮件。 **注意:**你需要更改电子邮件地址而不是使用我们的电子邮件地址。此外,你可以根据你的要求更改内存利用率阈值。 ``` # vi /opt/scripts/memory-alert.sh #!/bin/sh ramusage=$(free | awk '/Mem/{printf("RAM Usage: %.2f\n"), $3/$2*100}'| awk '{print $3}') if [ "$ramusage" > 20 ]; then SUBJECT="ATTENTION: Memory Utilization is High on $(hostname) at $(date)" MESSAGE="/tmp/Mail.out" TO="[email protected]" echo "Memory Current Usage is: $ramusage%" >> $MESSAGE echo "" >> $MESSAGE echo "------------------------------------------------------------------" >> $MESSAGE echo "Top Memory Consuming Process Using top command" >> $MESSAGE echo "------------------------------------------------------------------" >> $MESSAGE echo "$(top -b -o +%MEM | head -n 20)" >> $MESSAGE echo "" >> $MESSAGE echo "------------------------------------------------------------------" >> $MESSAGE echo "Top Memory Consuming Process Using ps command" >> $MESSAGE echo "------------------------------------------------------------------" >> $MESSAGE echo "$(ps -eo pid,ppid,%mem,%Memory,cmd --sort=-%mem | head)" >> $MESSAGE mail -s "$SUBJECT" "$TO" < $MESSAGE rm /tmp/Mail.out fi ``` 最后添加一个 [cron 任务](https://www.2daygeek.com/crontab-cronjob-to-schedule-jobs-in-linux/) 来自动执行此操作。它将每 5 分钟运行一次。 ``` # crontab -e */5 * * * * /bin/bash /opt/scripts/memory-alert.sh ``` **注意:**由于脚本计划每 5 分钟运行一次,因此你将在最多 5 分钟后收到电子邮件提醒(但不是 5 分钟,取决于具体时间)。 比如说,如果你的系统达到 8.25 的给定限制,那么你将在 5 分钟内收到电子邮件警报。希望现在说清楚了。 **输出:**你将收到类似下面的电子邮件提醒。 ``` Memory Current Usage is: 80.71% +------------------------------------------------------------------+ Top Memory Consuming Process Using top command +------------------------------------------------------------------+ top - 12:00:58 up 5 days, 9:03, 1 user, load average: 1.82, 2.60, 2.83 Tasks: 314 total, 1 running, 313 sleeping, 0 stopped, 0 zombie %Cpu0 : 8.3 us, 12.5 sy, 0.0 ni, 75.0 id, 0.0 wa, 0.0 hi, 4.2 si, 0.0 st %Cpu1 : 13.6 us, 4.5 sy, 0.0 ni, 81.8 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st %Cpu2 : 21.7 us, 21.7 sy, 0.0 ni, 56.5 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st %Cpu3 : 13.6 us, 9.1 sy, 0.0 ni, 77.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st %Cpu4 : 17.4 us, 8.7 sy, 0.0 ni, 73.9 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st %Cpu5 : 20.8 us, 4.2 sy, 0.0 ni, 70.8 id, 0.0 wa, 0.0 hi, 4.2 si, 0.0 st %Cpu6 : 9.1 us, 0.0 sy, 0.0 ni, 90.9 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st %Cpu7 : 17.4 us, 4.3 sy, 0.0 ni, 78.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st KiB Mem : 16248588 total, 5015964 free, 6453404 used, 4779220 buff/cache KiB Swap: 17873388 total, 16928620 free, 944768 used. 6423008 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 17163 daygeek 20 2033204 487736 282888 S 10.0 3.0 8:26.07 /usr/lib/firefox/firefox -contentproc -childID 15 -isForBrowser -prefsLen 9408 -prefMapSize 184979 -parentBuildID 20190521202118 -greomni /u+ 1121 daygeek 20 4191388 419180 100552 S 5.0 2.6 126:02.84 /usr/bin/gnome-shell 1902 daygeek 20 1701644 327216 82536 S 20.0 2.0 153:27.92 /opt/google/chrome/chrome 2969 daygeek 20 1051116 324656 92388 S 15.0 2.0 149:38.09 /opt/google/chrome/chrome --type=renderer --field-trial-handle=10346122902703263820,11905758137655502112,131072 --service-pipe-token=1339861+ 1068 daygeek 20 1104856 309552 278072 S 5.0 1.9 143:47.42 /usr/lib/Xorg vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -nolisten tcp -background none -noreset -keeptty -verbose 3 27246 daygeek 20 907344 265600 108276 S 30.0 1.6 10:42.80 /opt/google/chrome/chrome --type=renderer --field-trial-handle=10346122902703263820,11905758137655502112,131072 --service-pipe-token=8587368+ +------------------------------------------------------------------+ Top Memory Consuming Process Using ps command +------------------------------------------------------------------+ PID PPID %MEM %CPU CMD 8223 1 6.4 6.8 /usr/lib/firefox/firefox --new-window 13948 1121 6.3 1.2 /usr/bin/../lib/notepadqq/notepadqq-bin 8671 8223 4.4 7.5 /usr/lib/firefox/firefox -contentproc -childID 5 -isForBrowser -prefsLen 6999 -prefMapSize 184979 -parentBuildID 20190521202118 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 8223 true tab 17163 8223 3.0 0.6 /usr/lib/firefox/firefox -contentproc -childID 15 -isForBrowser -prefsLen 9408 -prefMapSize 184979 -parentBuildID 20190521202118 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 8223 true tab 1121 1078 2.5 1.6 /usr/bin/gnome-shell 17937 8223 2.5 0.8 /usr/lib/firefox/firefox -contentproc -childID 16 -isForBrowser -prefsLen 9410 -prefMapSize 184979 -parentBuildID 20190521202118 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 8223 true tab 8499 8223 2.2 0.6 /usr/lib/firefox/firefox -contentproc -childID 4 -isForBrowser -prefsLen 6635 -prefMapSize 184979 -parentBuildID 20190521202118 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 8223 true tab 8306 8223 2.2 0.8 /usr/lib/firefox/firefox -contentproc -childID 1 -isForBrowser -prefsLen 1 -prefMapSize 184979 -parentBuildID 20190521202118 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 8223 true tab 9198 8223 2.1 0.6 /usr/lib/firefox/firefox -contentproc -childID 7 -isForBrowser -prefsLen 8604 -prefMapSize 184979 -parentBuildID 20190521202118 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 8223 true tab ``` --- via: <https://www.2daygeek.com/linux-bash-script-to-monitor-memory-utilization-usage-and-send-email/> 作者:[Magesh Maruthamuthu](https://www.2daygeek.com/author/magesh/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[wxy](https://github.com/wxy) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
404
Not Found
null
11,008
探索 Linux 上的 /run
https://www.networkworld.com/article/3403023/exploring-run-on-linux.html
2019-06-23T09:29:58
[ "run" ]
https://linux.cn/article-11008-1.html
> > Linux 系统在运行时数据方面的工作方式发生了微小但重大的变化。 > > > ![](/data/attachment/album/201906/23/092816aqczi984w30j8k12.jpg) 如果你没有密切关注,你可能没有注意到 Linux 系统在运行时数据方面的工作方式有一些小但重大的变化。 它重新组织了文件系统中可访问的方式和位置,而这个变化在大约八年前就开始了。虽然这种变化可能不足以让你的袜子变湿,但它在 Linux 文件系统中提供了更多一致性,值得进行一些探索。 要开始,请转到 `/run`。如果你使用 `df` 来检查它,你会看到这样的输出: ``` $ df -k . Filesystem 1K-blocks Used Available Use% Mounted on tmpfs 609984 2604 607380 1% /run ``` 它被识别为 “tmpfs”(临时文件系统),因此我们知道 `/run` 中的文件和目录没有存储在磁盘上,而只存储在内存中。它们表示保存在内存(或基于磁盘的交换空间)中的数据,它看起来像是一个已挂载的文件系统,这个可以使其更易于访问和管理。 `/run` 是各种各样数据的家园。例如,如果你查看 `/run/user`,你会注意到一组带有数字名称的目录。 ``` $ ls /run/user 1000 1002 121 ``` 使用长文件列表可以发现这些数字的重要性。 ``` $ ls -l total 0 drwx------ 5 shs shs 120 Jun 16 12:44 1000 drwx------ 5 dory dory 120 Jun 16 16:14 1002 drwx------ 8 gdm gdm 220 Jun 14 12:18 121 ``` 我们看到每个目录与当前登录的用户或显示管理器 gdm 相关。数字代表他们的 UID。每个目录的内容都是运行中的进程所使用的文件。 `/run/user` 文件只是你在 `/run` 中找到的一小部分。还有很多其他文件。有一些文件包含了各种系统进程的进程 ID。 ``` $ ls *.pid acpid.pid atopacctd.pid crond.pid rsyslogd.pid atd.pid atop.pid gdm3.pid sshd.pid ``` 如下所示,上面列出的 `sshd.pid` 文件包含 ssh 守护程序(`sshd`)的进程 ID。 ``` $ cat sshd.pid 1148 $ ps -ef | grep sshd root 1148 1 0 Jun14 ? 00:00:00 /usr/sbin/sshd -D <== root 10784 1148 0 12:44 ? 00:00:00 sshd: shs [priv] shs 10922 10784 0 12:44 ? 00:00:00 sshd: shs@pts/0 root 18109 1148 0 16:13 ? 00:00:00 sshd: dory [priv] dory 18232 18109 0 16:14 ? 00:00:00 sshd: dory@pts/1 shs 19276 10923 0 16:50 pts/0 00:00:00 grep --color=auto sshd ``` `/run` 中的某些子目录只能使用 root 权限访问,例如 `/run/sudo`。例如,以 root 身份运行我们可以看到一些与真实或尝试使用 `sudo` 相关的文件: ``` /run/sudo/ts# ls -l total 8 -rw------- 1 root dory 112 Jun 16 16:37 dory -rw------- 1 root shs 168 Jun 17 08:33 shs ``` 为了与 `/run` 的变化保持一致,一些运行时数据的旧位置现在是符号链接。`/var/run` 现在是指向 `/run` 的指针,`/var/lock` 指向 `/run/lock` 的指针,可以保证旧的引用按预期工作。 ``` $ ls -l /var total 52 drwxr-xr-x 2 root root 4096 Jun 17 07:36 backups drwxr-xr-x 19 root root 4096 Apr 18 13:46 cache drwxrwsrwt 2 root whoopsie 4096 Jun 13 07:39 crash drwxr-xr-x 75 root root 4096 Jun 9 15:14 lib drwxrwsr-x 2 root staff 4096 Oct 16 2017 local lrwxrwxrwx 1 root root 9 May 14 2018 lock -> /run/lock drwxrwxr-x 17 root syslog 4096 Jun 17 00:00 log drwxrwsrwt 2 root mail 4096 Jun 13 12:10 mail drwxrwsrwt 2 root whoopsie 4096 Jan 5 2018 metrics drwxr-xr-x 2 root root 4096 Jan 5 2018 opt lrwxrwxrwx 1 root root 4 May 14 2018 run -> /run drwxr-xr-x 9 root root 4096 Jun 16 2018 snap drwxr-xr-x 9 root root 4096 Jun 9 15:14 spool drwxrwxrwt 8 root root 4096 Jun 17 00:00 tmp drwxr-xr-x 3 root root 4096 Jan 19 12:14 www ``` 虽然技术上的变化很小,但转换到使用 `/run` 只是为了在 Linux 文件系统中更好地组织运行时数据。 --- via: <https://www.networkworld.com/article/3403023/exploring-run-on-linux.html> 作者:[Sandra Henry-Stocker](https://www.networkworld.com/author/Sandra-Henry_Stocker/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[wxy](https://github.com/wxy) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
301
Moved Permanently
null
11,010
如何在 Debian/Ubuntu 系统中检查程序包是否安装?
https://www.2daygeek.com/how-to-check-whether-the-given-package-is-installed-or-not-on-ubuntu-debian-system/
2019-06-23T23:55:53
[ "安装" ]
https://linux.cn/article-11010-1.html
![](/data/attachment/album/201906/23/235541yl41p73z5jv78y8p.jpg) 我们近期发布了一篇关于批量程序包安装的文章。在此同时,关于如何获取系统上已安装了的程序包信息,我也做了些调查然后找到了些方法。我会把这些方法分享在我们的网站上,希望能帮助到其他人。 有很多种方法可以检查程序包是否已安装,我找到了 7 种命令,你可以从中选择你喜欢的使用。 如下: * `apt-cache`:可用于查询 APT 缓存或程序包的元数据。 * `apt`:是基于 Debian 的系统中的安装、下载、删除、搜索和管理包的强有力的工具。 * `dpkg-query`:一个查询 dpkg 数据库的工具。 * `dpkg`:基于 Debian 的系统的包管理工具。 * `which`:返回在终端中输入命令时执行的可执行文件的全路径。 * `whereis`:可用于搜索指定命令的二进制文件、源码文件和帮助文件。 * `locate`:比 `find` 命令快,因为其使用 `updatedb` 数据库搜索,而 `find`命令在实际系统中搜索。 ### 方法一、使用 apt-cache 命令 `apt-cache` 命令用于从 APT 内部数据库中查询**APT 缓存**和**包的元数据**,将会搜索和显示指定包的信息,包括是否安装、程序包版本、源码仓库信息等。 下面的示例清楚的显示 `nano` 包已经在系统中安装了以及对应安装的版本号。 ``` # apt-cache policy nano nano: Installed: 2.9.3-2 Candidate: 2.9.3-2 Version table: *** 2.9.3-2 500 500 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 Packages 100 /var/lib/dpkg/status ``` ### 方法二、使用 apt 命令 `apt` 是一个功能强大的命令行工具,可用于安装、下载、删除、搜索、管理程序包以及查询关于程序包的信息,类似对于 `libapt-pkg` 库的所有功能的底层访问。其包含一些与包管理相关的但很少用到的命令行功能。 ``` # apt -qq list nano nano/bionic,now 2.9.3-2 amd64 [installed] ``` ### 方法三、使用 dpkg-query 命令 `dpkg-query` 是显示 `dpkg` 数据库中程序包信息列表的一个工具。 下面示例中的输出的第一列 `ii`,表示查询的程序包已安装了。 ``` # dpkg-query --list | grep -i nano ii nano 2.9.3-2 amd64 small, friendly text editor inspired by Pico ``` ### 方法四、使用 dpkg 命令 `dpkg`(**d**ebian **p**ac**k**a**g**e)是一个安装、构建、删除和管理 Debian 包的工具,但和其他包管理系统不同的是,其不能自动下载和安装包或包依赖。 下面示例中的输出的第一列 `ii`,表示查询的包已安装了。 ``` # dpkg -l | grep -i nano ii nano 2.9.3-2 amd64 small, friendly text editor inspired by Pico ``` ### 方法五、使用 which 命令 `which` 命令返回在终端中输入命令时执行的可执行文件的全路径。这对于你想要给可执行文件创建桌面快捷方式或符号链接时非常有用。 `which` 命令仅在当前用户 `PATH` 环境变量配置的目录列表中搜索,而不是在所有用户的目录中搜索。这意思是当你登入你自己账号时,其不会在 `root` 用户文件或目录中搜索。 如果对于指定的程序包或可执行文件路径有如下输出,则表示已安装了,否则没有。 ``` # which nano /bin/nano ``` ### 方法六、使用 whereis 命令 `whereis` 命令用于针对指定命令搜索对应的程序二进制文件、源码文件以及帮助文件等。 如果对于指定的程序包或可执行文件路径有如下输出,则表示已安装了,否则没有。 ``` # whereis nano nano: /bin/nano /usr/share/nano /usr/share/man/man1/nano.1.gz /usr/share/info/nano.info.gz ``` ### 方法七、使用 locate 命令 `locate` 命令比 `find` 命令快,因为其在 `updatedb` 数据库中搜索,而 `find` 命令在实际系统中进行搜索。 对于获取指定文件,其使用数据库而不是在特定目录路径中搜索。 `locate` 命令不会预安装在大多数系统中,需要手动安装。 `locate` 使用的数据库会根据定时任务定期更新。当然,我们也可以手动更新。 如果对于指定的程序包或可执行文件路径有如下输出,则表示已安装了,否则没有。 ``` # locate --basename '\nano' /usr/bin/nano /usr/share/nano /usr/share/doc/nano ``` --- via: <https://www.2daygeek.com/how-to-check-whether-the-given-package-is-installed-or-not-on-ubuntu-debian-system/> 作者:[Magesh Maruthamuthu](https://www.2daygeek.com/author/magesh/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[yizhuoyan](https://github.com/yizhuoyan) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
404
Not Found
null
11,011
为什么说 Kubernetes 是一辆翻斗车
https://opensource.com/article/19/6/kubernetes-dump-truck
2019-06-24T01:27:00
[ "Kubernetes" ]
https://linux.cn/article-11011-1.html
> > 翻斗车是解决各种基本业务问题的优雅解决方案。 > > > ![](/data/attachment/album/201906/24/012846v737bts00uwk3qd7.jpg) 这篇文章写于 Kubernetes 的生日(6 月 7 日星期五)前夕。 翻斗车很优雅。说真的,不信你听我说。它们以优雅的方式解决了各种各样的技术问题。它们可以搬动泥土、砾石、岩石、煤炭、建筑材料或道路上的障碍。它们甚至可以拉动拖车及它们上面的其他重型设备。你可以给一辆翻斗车装上五吨泥土,然后自驾游遍全国。对于像我这样的电脑极客来说,那就是优雅。 但是,它们并不容易使用。驾驶翻斗车需要特殊的驾驶执照。它们也不容易装配和维护。购买翻斗车和各种维护时要做很多选择。但是,它们可以优雅的搬动那些垃圾。 你知道搬动垃圾有什么不优雅的地方吗?假如你有一款新型的紧凑型轿车,它们到处可以买到,易于驾驶、更易于维护。但是,用它们来装泥土就很糟糕。这需要跑 200 趟才能运走 5 吨垃圾,而且,之后没人再会想要这辆车了。 好吧,你可以买一辆出售的翻斗车,而不是想自己造一辆。但是我不同,我是个极客,我喜欢自己造东西。但…… 如果你拥有一家建筑公司,你就不会想着自己造一辆翻斗车。你肯定不会维持一条供应链来重构翻斗车(这可是一条很大的供应链)。但你可以学会驾驶一辆。 好吧,我的这个比喻很粗糙,但很容易理解。易用性是相对的,易于维护是相对的,易于装配也是相对的。这实际上取决于你想要做什么。[Kubernetes](https://kubernetes.io/) 也不例外。 一次性构建 Kubernetes 并不太难。配置好 Kubernetes 呢?好吧,这稍微难一些。你如何看待 KubeCon?它们又宣布了多少新项目?哪些是“真实的”呢?而你应该学习哪些?你对 Harbour、TikV、NATD、Vitess,开放策略代理有多深入的了解?更不用说 Envoy、eBPF 和 Linux 中的一系列底层技术?这就像是 1904 年工业革命爆发时建造翻斗车一样,你要弄清楚使用的螺钉、螺栓、金属和活塞。(有没有蒸汽朋克在这里吗?) 像翻斗车一样构造和配置 Kubernetes 是一个技术问题,如果你从事金融服务、零售、生物研究、食品服务等等,这可能不是你应该做的事情。但是,学习如何驾驶 Kubernetes 肯定是你应该学习的东西。 Kubernetes 就像一辆翻斗车,因其可以解决的各种技术问题(以及它所拖带的生态系统)而优雅。所以,我会给你一句引用的话,这是我的一位计算机科学教授在我大学的第一年告诉我们的,她说,“有一天,你会看到一段代码并对自己说,‘真特么优雅!’” Kubernetes 很优雅。 --- via: <https://opensource.com/article/19/6/kubernetes-dump-truck> 作者:[Scott McCarty](https://opensource.com/users/fatherlinux) 选题:[lujun9972](https://github.com/lujun9972) 译者:[wxy](https://github.com/wxy) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
As we approach Kubernetes anniversary on Friday, June 7 this week let's start with this. Dump trucks are elegant. Seriously, stay with me for a minute. They solve a wide array of technical problems in an elegant way. They can move dirt, gravel, rocks, coal, construction material, or road barricades. They can even pull trailers with other pieces of heavy equipment on them. You can load a dump truck with five tons of dirt and drive across the country with it. For a nerd like me, that's elegance. But, they're not easy to use. Dump trucks require a special driver's license. They're also not easy to equip or maintain. There are a ton of options when you buy a dump truck and a lot of maintenance. But, they're elegant for moving dirt. You know what's not elegant for moving dirt? A late-model, compact sedan. They're way easier to buy. Easier to drive. Easier to maintain. But, they're terrible at carrying dirt. It would take 200 trips to carry five tons of dirt, and nobody would want the car after that. Alright, you're sold on using a dump truck, but you want to build it yourself. I get it. I'm a nerd and I love building things. But… If you owned a construction company, you wouldn't build your own dump trucks. You definitely wouldn't maintain the supply chain to rebuild dump trucks (that's a big supply chain). But you would learn to drive one. OK, my analogy is crude but easy to understand. Ease of use is relative. Ease of maintenance is relative. Ease of configuration is relative. It really depends on what you are trying to do. [Kubernetes](https://kubernetes.io/) is no different. Building Kubernetes once isn't too hard. Equipping Kubernetes? Well, that gets harder. What did you think of KubeCon? How many new projects were announced? Which ones are "real"? Which ones should you learn? How deeply do you understand Harbor, TikV, NATD, Vitess, Open Policy Agent? Not to mention Envoy, eBPF, and a bunch of the underlying technologies in Linux? It feels a lot like building dump trucks in 1904 with the industrial revolution in full swing. Figuring out what screws, bolts, metal, and pistons to use. (Steampunk, anyone?) Building and equipping Kubernetes, like a dump truck, is a technical problem you probably shouldn't be tackling if you are in financial services, retail, biological research, food services, and so forth. But, learning how to drive Kubernetes is definitely something you should be learning. Kubernetes, like a dump truck, is elegant for the wide variety of technical problems it can solve (and the ecosystem it drags along). So, I'll leave you with a quote that one of my computer science professors told us in my first year of college. She said, "one day, you will look at a piece of code and say to yourself, 'now that's elegant!'" Kubernetes is elegant. ## Comments are closed.
11,013
区块链 2.0:智能合约如今的发展(六)
https://www.ostechnix.com/blockchain-2-0-ongoing-projects-the-state-of-smart-contracts-now/
2019-06-24T23:12:00
[ "区块链", "智能合约" ]
https://linux.cn/article-11013-1.html
![The State Of Smart Contracts Now](/data/attachment/album/201906/24/231238kq774ppzh0tx41lo.png) 继续我们的[前面的关于智能合约的文章](/article-10956-1.html),这篇文章旨在讨论智能合约的发展形势,重点介绍目前正在该领域进行开发的一些项目和公司。如本系列前一篇文章中讨论的,智能合约是在区块链网络上存在并执行的程序。我们探讨了智能合约的工作原理以及它们优于传统数字平台的原因。这里描述的公司分布于各种各样的行业中,但是大多涉及到身份管理系统、金融服务、众筹系统等,因为这些是被认为最适合切换到基于区块链的数据库系统的领域。 ### 开放平台 诸如 [Counterparty](https://counterparty.io/platform/) 和 Solidity(以太坊)等平台是完全公用的构建模块,开发者可以以之创建自己的智能合约。大量的开发人员参与此类项目使这些项目成为开发智能合约、设计自己的加密货币令牌系统,以及创建区块链运行协议的事实标准。许多值得称赞的项目都来源于它们。摩根大通派生自以太坊的 [Quorum](https://www.jpmorgan.com/global/Quorum),就是一个例子。而瑞波是另一个例子。 ### 管理金融交易 通过互联网转账加密货币被吹捧为在未来几年会成为常态。与此相关的不足之处是: * 身份和钱包地址是匿名的。如果接收方不履行交易,则付款人没有任何第一追索权。 * 错误交易(如果无法追踪任何交易)。 * 密码生成的哈希密钥很难用于人类,人为错误是主要关注点。 在这种情况下,可以让其他人暂时接受该交易并在接受尽职调查后与接收方结算。 [EscrowMyEther](http://escrowmyether.com/) 和 [PAYFAIR](https://payfair.io/) 是两个这样的托管平台。基本上,托管公司采用商定的金额并向接收方发送令牌。一旦接收方通过相同的托管平台提供付款人想要的内容,两者都会确认并最终付款。 这些得到了自由职业者和业余爱好者收藏家广泛在线使用。 ### 金融服务 小额融资和小额保险项目的发展将改善世界上大多数贫穷或没有银行账户的人的银行金融服务。据估计,社会中较贫穷的“无银行账户”人群可以为银行和机构的增加 3800 亿美元收入 <sup id="fnref1"> <a href="#fn1" rel="footnote"> 1 </a></sup>。这一金额要远远超过银行切换到区块链分布式账本技术(DLT)预期可以节省的运营费用。 位于美国中西部的 BankQu Inc. 的口号是“通过身份而尊严”。他们的平台允许个人建立他们自己的数字身份记录,其中所有交易将在区块链上实时审查和处理。在底层代码上记录并为其用户构建唯一的在线标识,从而实现超快速的交易和结算。BankQu 案例研究探讨了他们如何以这种方式帮助个人和公司,可以在[这里](https://banqu.co/case-study/)看到。 [Stratumn](https://stratumn.com/business-case/insurance-claim-automation-across-europe/) 正在帮助保险公司通过自动化早期由人类微观管理的任务来提供更好的保险服务。通过自动化、端到端可追溯性和高效的数据隐私方法,他们彻底改变了保险索赔的结算方式。改善客户体验以及显著降低成本为客户和相关的公司带来双赢局面。 法国保险公司 [AXA](https://group.axa.com/en/newsroom/news/axa-goes-blockchain-with-fizzy) 目前正在试行类似的努力。其产品 [fizzy](https://fizzy.axa/en-gb/) 允许用户以少量费用订阅其服务并输入他们的航班详细信息。如果航班延误或遇到其他问题,该程序会自动搜索在线数据库,检查保险条款并将保险金额记入用户的帐户。这样就用户或客户无需在手动检查条款后提出索赔,并且就长期而言,一旦这样的系统成为主流,就增加了航空公司的责任心。 ### 跟踪所有权 理论上可以利用 DLT 中的带时间戳的数据块来跟踪媒体的创建到最终用户消费。Peertracks 公司和 Mycelia 公司目前正在帮助音乐家发布内容,而不必担心其内容被盗或被滥用。他们帮助艺术家直接向粉丝和客户销售,同时获得工作报酬,而无需通过权利和唱片公司 <sup id="fnref2"> <a href="#fn2" rel="footnote"> 2 </a></sup>。 ### 身份管理平台 基于区块链的身份管理平台可以将你的身份存储在分布式分类帐本中。设置帐户后,会对其进行安全加密,然后将其发送给所有参与节点。但是,作为数据块的所有者,只有该用户才能访问该数据。一旦你在网络上建立身份并开始交易,网络中的自动程序将验证与你的帐户关联的先前所有的交易,在检查要求后将其发送给监管备案,并在程序认为交易合法时自动执行结算。这里的好处是,由于区块链上的数据是防篡改的,而智能合约以零偏差(或主观性)检查输入,如前所述,交易不需要任何人的监督或批准,并且需要小心是即刻生效的。 像 [ShoCard](https://techcrunch.com/2015/05/05/shocard-is-a-digital-identity-card-on-the-blockchain/) 、[Credits](https://techcrunch.com/2014/10/31/your-next-passport-could-be-on-the-blockchain/) 和 [OneName](https://wiki.namecoin.org/index.php?title=OneName) 这样的初创公司目前正在推出类似的服务,目前正在与政府和社会机构进行谈判,以便将它们整合到主流用途中。 开发商的其他独立项目如 Chris Ellis 和 David Duccini 分别开发或提出了替代的身份管理系统,分别是 “[世界公民](https://github.com/MrChrisJ/World-Citizenship)”和 [IDCoin](https://github.com/IDCoin/IDCoin)。Ellis 先生甚至通过在区块链网络上创建护照来证明他的工作能力。 ### 资源共享 [Share & Charge](https://blog.slock.it/share-charge-launches-its-app-on-boards-over-1-000-charging-stations-on-the-blockchain-ba8275390309) ([Slock.It](https://slock.it/)) 是一家欧洲的区块链初创公司。他们的移动应用程序允许房主和其他个人投入资金建立充电站与其他正在寻找快速充电的人分享他们的资源。这不仅使业主能够收回他们的一些投资,而且还允许 EV 司机在其近地域获得更多的充电点,从而允许供应商以方便的方式满足需求。一旦“客户”完成对其车辆的充电,相关的硬件就会创建一个由数据组成的安全时间戳块,并且在该平台上工作的智能合约会自动将相应的金额记入所有者账户。记录所有此类交易的跟踪并保持适当的安全验证。有兴趣的读者可以看一下[这里](https://blog.slock.it/share-charge-smart-contracts-the-technical-angle-58b93ce80f15),了解他们产品背后的技术角度。该公司的平台将逐步使用户能够与有需要的个人分享其他产品和服务,并从中获得被动收入。 我们在这里看到的公司,以及一个很短的正在进行中的项目的清单,这些项目利用智能合约和区块链数据库系统。诸如此类的平台有助于构建一个安全的“盒子”,其中包含仅由用户自己、其上的代码或智能合约访问的信息。基于触发器对信息进行实时审查、检查,并且算法由系统执行。这样的平台人为监督最小化,这是在安全数字自动化方面朝着正确方向迈出的急需的一步,这在以前从未被考虑过如此规模。 下一篇文章将阐述不同类型的区块链。单击以下链接以了解有关此主题的更多信息。 * [区块链 2.0:公有链与私有链的比较](https://www.ostechnix.com/blockchain-2-0-public-vs-private-blockchain-comparison/) --- 1. B. Pani, “Blockchain Powered Financial Inclusion,” 2016. [↩](#fnref1) 2. M. Gates, “Blockchain. Ultimate guide to understanding blockchain bitcoin cryptocurrencies smart-contracts and the future of money.pdf.” 2017. [↩](#fnref2) --- via: <https://www.ostechnix.com/blockchain-2-0-ongoing-projects-the-state-of-smart-contracts-now/> 作者:[editor](https://www.ostechnix.com/author/editor/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[wxy](https://github.com/wxy) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
403
Forbidden
null
11,014
Slack 的开源替代品 Mattermost 获得 5000 万美元融资
https://itsfoss.com/mattermost-funding/
2019-06-24T23:32:55
[ "Slack", "投资" ]
https://linux.cn/article-11014-1.html
[Mattermost](https://mattermost.com/),作为 [Slack](https://itsfoss.com/slack-use-linux/) 的开源替代品,获得了 5000 万美元的 B 轮融资。这个消息极其令人振奋。 [Slack](https://slack.com) 是一个基于云的团队内部沟通协作软件。企业、初创企业、甚至全球化的开源项目都在使用 Slack 进行同事及项目成员间的沟通。 [Slack 在 2019 年 6 月的估值为 200 亿美元](https://www.ft.com/content/98747b36-9368-11e9-aea1-2b1d33ac3271),由此可见其在科技行业的巨大影响,当然也就有更多产品想与之竞争。 ### 5000 万美元开源项目 ![](/data/attachment/album/201906/24/233300g0osmhionotenz9r.png) 就我个人而言,我并不知道 MatterMost 这个产品。但 [VentureBeat](https://venturebeat.com/2019/06/19/mattermost-raises-50-million-to-advance-its-open-source-slack-alternative/) 对这则新闻的报道,激发了我的好奇心。这次融资由 [Y Combinator](https://www.ycombinator.com/) 的 Continuity 与一家新的投资方 BattleVentures 领投,现有投资者 Redpoint 和 S28 Captial 共同跟投。 在[公告](https://mattermost.com/blog/yc-leads-50m-series-b-in-mattermost-as-open-source-slack-alternative/)中,他们也提到: > > 今天的公告中,Mattermost 成为了 YC 有史以来规模最大的 B 轮投资项目,更重要的是,它是 YC 迄今为止投资额最高的开源项目。 > > > 下面是摘自 VentureBeat 的报道,你可以从中了解到一些细节: > > 本次资本注入,是继 2017 年 2 月的种子轮 350 万融资和今年 2 月份的 2000 万 A 轮融资之后进行的,并使得这家总部位于美国加州<ruby> 帕罗奥图 <rt> Palo Alto </rt></ruby>的公司融资总额达到了约 7000 万美元。 > > > 如果你对他们的规划感兴趣,可以阅读[官方公告](https://mattermost.com/blog/yc-leads-50m-series-b-in-mattermost-as-open-source-slack-alternative/)。 尽管听起来很不错,但可能你并不知道 Mattermost 是什么。所以我们先来作个简单了解: ### Mattermost 快览 ![Mattermost](/data/attachment/album/201906/24/233306gputw598dopdtqoo.jpg) 前面已经提到,Mattermost 是 Slack 的开源替代品。 乍一看,它几乎照搬了 Slack 的界面外观,没错,这就是关键所在,你将拥有你可以轻松使用的软件的开源解决方案。 它甚至集成了一些流行的 DevOps 工具,如 Git、自动机器人和 CI/CD。除了这些功能外,它还关注安全性和隐私。 同样,和 Slack 类似,它支持和多种应用程序与服务的集成。 听起来很有前景?我也这么认为。 #### 定价:企业版和团队版 如果你希望由 Mattermost 托管该服务(或获得优先支持),应选择其企业版。但如果你不想使用付费托管,可以下载[团队版](https://mattermost.com/download/),并将其安装到基于 Linux 的云服务器或 VPS 服务器上。 当然,我们不会在此进行深入探究。我确想在此提及的是,企业版并不昂贵。 ![](/data/attachment/album/201906/24/233311r0k444g441114lv9.jpg) ### 总结 MatterMost 无疑相当出色,有了 5000 万巨额资金的注入,对于那些正在寻求安全的并能提供高效团队协作支持的开源通讯平台的用户,Mattermost 很可能成为开源社区重要的部分。 你觉得这条新闻怎么样?对你来说有价值吗?你是否已了解 Mattermost 是 Slack 的替代品? 请在下面的评论中给出你的想法。 --- via: <https://itsfoss.com/mattermost-funding/> 作者:[Ankush Das](https://itsfoss.com/author/ankush/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[wahailin](https://github.com/wahailin) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
[Mattermost](https://mattermost.com/), which presents itself as an open source alternative to [Slack](https://itsfoss.com/slack-use-linux/) raised $50M in series B funding. This is definitely something to get excited for. [Slack](https://slack.com) is a cloud-based team collaboration software that is mainly used for internal team communication. Enterprises, startups and even open source projects worldwide use it interact with colleagues and project members. Slack is free with limited features while the paid enterprise version has premium features. [Slack is valued at $20 billion](https://www.ft.com/content/98747b36-9368-11e9-aea1-2b1d33ac3271) in June, 2019. You can guess the kind of impact it has made in the tech industry and certainly more products are trying to compete with Slack. ## $50 million for an open source project ![Mattermost Wallpaper](https://itsfoss.com/content/images/wordpress/2019/06/mattermost-wallpaper-800x450.png) Personally, I was not aware of Mattermost. But, when [VentureBeat](https://venturebeat.com/2019/06/19/mattermost-raises-50-million-to-advance-its-open-source-slack-alternative/) reported the story, it made me curious. The funding was led by [Y Combinator’s](https://www.ycombinator.com/) Continuity with a new investor Battery Ventures and was joined by the existing investors – Redpoint and S28 Captial. With the [announcement](https://mattermost.com/blog/yc-leads-50m-series-b-in-mattermost-as-open-source-slack-alternative/), they also mentioned: With today’s announcement, Mattermost becomes YC’s largest ever Series B investment, and more importantly, their largest open source investment to date. To give you some specifics, here’s what VentureBeat mentioned: The capital infusion follows a $20 million series A in February and a $3.5 million seed round in February 2017 and brings the Palo Alto, California-based company’s total raised to roughly $70 million. If you are curious about their plans, you should go through their [official announcement post](https://mattermost.com/blog/yc-leads-50m-series-b-in-mattermost-as-open-source-slack-alternative/). Even though it all sounds good, what is Mattermost? Maybe you didn’t know about it, until now. So, let us take a brief look at it: ## A quick look at Mattermost ![Mattermost Screenshot](https://itsfoss.com/content/images/wordpress/2019/06/mattermost-screenshot.jpg?fit=800%2C497&ssl=1) As mentioned, it is an open source Slack alternative. At first glance, it almost resembles the look and feel of Slack. Well, that’s the point here – you will have an open source solution that you’re comfortable using. It even integrates with some of the popular DevOps tools like Git, Bots, and CI/CD. In addition to the functionality, it focuses on security and privacy as well. Also, similar to Slack, it supports integration with multiple apps and services. Sounds promising? I think so. ### Pricing: Enterprise Edition vs Team Edition If you want them (Mattermost) to host it (or want priority support), you should opt for the Enterprise edition. However, if you want to host it without spending a penny, you can download the [Team edition](https://mattermost.com/download/) and install it on your Linux-based cloud/VPS server. Of course, we are not here to review it in-depth. However, I do want to mention that the enterprise edition is quite affordable. ![Mattermost Enterprise Plan](https://itsfoss.com/content/images/wordpress/2019/06/mattermost-enterprise-plan.jpg?fit=800%2C325&ssl=1) **Wrapping Up** Mattermost is definitely impressive. And, with a whopping $50M funding, it may become the next big thing in the open source community for users who were on the lookout for a secure and open source messaging platform with efficient team collaboration support. What do you think about this news? Is it something exciting for you? Were you already aware of Mattermost as a slack alternative? Let us know your thoughts in the comments below.
11,015
学习 Python 的精品 PLN 资源
https://opensource.com/article/19/5/resources-learning-python
2019-06-25T00:27:20
[ "Python" ]
https://linux.cn/article-11015-1.html
> > 通过将这些资源加入你自己的私人学习网络以拓展 Python 知识。 > > > ![](/data/attachment/album/201906/25/002706hrx0d3dfrxeid3nj.jpg) 我使用和教授 Python 已有很长时间了,但我总是乐于增加我对这门实用语言的知识。这就是为什么我一直试着拓展我的 Python <ruby> <a href="https://en.wikipedia.org/wiki/Personal_learning_network"> 个人学习网络 </a> <rt> personal learning network </rt></ruby>(PLN),这是一个描述用于分享信息的非正式的互惠型网络的概念。 教育学家 [Kelly Paredes](https://www.teachingpython.fm/hosts/kellypared) 和 [Sean Tibor](https://twitter.com/smtibor) 最近在他们的播客 [Teaching Python](https://www.teachingpython.fm/20) 上谈到了如何搭建 Python PLN。我在克里夫兰的 [PyCon 2019](https://us.pycon.org/2019/) 遇到他们之后就订阅了这个频道(并把它们加入到我的 Python PLN 当中)。这个播客激发了我对 Python PLN 中的人的思考,包括那些我最近在 PyCon 遇到的人们。 我会分享一些我找到 PLN 成员的地方;可能它们也可以变成你的 Python PLN 的一部分。 ### Young Coders 导师 Python 基金会的活动协调者 [Betsy Waliszewski](https://www.linkedin.com/in/betsywaliszewski) 是我的 Python PLN 中的一员。当我们在 PyCon2019 见到时,因为我是个老师,她推荐我看看为十二岁及以上的孩子打造的 [Young Coders](https://us.pycon.org/2019/events/letslearnpython/) 工作室。在那我遇到了正在负责这个计划的 [Katie Cunningham](https://www.linkedin.com/in/kcunning/),它会教参与者如何搭建和配置树莓派并使用 Python 项目。年轻学生也会收到两本书 Jason Briggs 的 《[Python for Kids](https://nostarch.com/pythonforkids)》 和 Craig Richardson 的 《[Learn to Program with Minecraft](https://nostarch.com/programwithminecraft)》。我一直寻找提升我教学水平的新方式,因此我在该会议上的 [NoStarch Press](https://nostarch.com/) 展台迅速拿到了两本 Minecraft 书。Katie 是一名优秀的教师,也是一名多产作家,拥有一个充满 Python 培训视频的 [YouTube](https://www.youtube.com/c/KatieCunningham) 精彩频道。 我把 Kattie 与我在 Young Coders 工作室碰到的另外两个人加入我的 PLN:[Nat Dunn](https://www.linkedin.com/in/natdunn/) 和 [Sean Valentine](https://www.linkedin.com/in/sean-valentine-b370349b/)。像 Katie 一样,他们自愿花时间把 Python 介绍给青年程序员们。Nat 是 [Webucator](https://www.webucator.com/) 的总裁,这是一家 IT 培训公司,多年来一直是 Python 软件基金会赞助商,并赞助了 PyCon 2018 教育峰会。在将 Python 教他 13 岁的儿子和 14 岁的侄子之后,他决定在 Young Coders 任教。Sean 是 [Hidden Genius 项目](http://www.hiddengeniusproject.org/) 的战略计划总监,这是一个针对黑人男性青年的技术及领导力打造的教导项目。Sean 说许多 Hidden Genius 参与者“用 Python 打造项目因此我们认为 [Young Coders] 是一个很好的合作机会”。了解 Hidden Genius 项目激发了我更深层次地思考编程的未来以及其改变生活的威力。 ### Open Spaces 聚会 我发现 PyCon 的 [Open Spaces](https://us.pycon.org/2019/events/open-spaces/) —— 这是一个一小时左右的自组织的即兴聚会 —— 跟正式的项目活动一样有用。我的最爱之一是 [Circuit Playground Express](https://www.adafruit.com/product/3333) 设备,它是我们会议主题包的一部分。我很喜欢这个设备,并且 Open Space 提供了学习它的一条大道。组织者提供了工作表和一个 [Github](https://github.com/adafruit/PyCon2019) 仓库,其中包含有我们成功所需要的所有工具,也提供了一个上手实践的机会以及探索这个独特硬件的方向。 这次会面激起了了我对学习 Circuit Playground Express 更新信息的兴趣,因此在 PyCon 之后, 我在 Twitter 上接触到了在会议上就该设备编程发表主旨演讲的 [Nina Zakharenko](https://twitter.com/nnja)。Nina 自从去年秋天我在 [All Things Open](https://allthingsopen.org/) 上听过她的演讲后就在我的 Python PLN 里了。我最近报名参加了她的 [Python 基础](https://frontendmasters.com/courses/python/)课程以加深我的学习。Nina 推荐我将 [Kattni Rembor](https://twitter.com/kattni) 加入我的 Python PLN。他的[示例代码](https://github.com/kattni/ChiPy_2018)正帮助我学习用 CircuitPython 编程。 ### 我的 PLN 中的其他资源 我在 PyCon 2019 也遇见了 [Opensource.com](http://Opensource.com) 社区版主 [Moshe Zadka](https://opensource.com/users/moshez),并和他来了场长谈。他分享了几个新的 Python 资源,包括 [如何像电脑科学家一样思考](http://openbookproject.net/thinkcs/python/english3e/)。社区版主 [Seth Kenlon](https://opensource.com/users/seth) 是我的 PLN 中的另一名成员;他发表了许多优秀的 [Python 文章](https://www.google.com/search?source=hp&ei=gVToXPq-FYXGsAW-mZ_YAw&q=site%3Aopensource.com+%22Seth+Kenlon%22+%2B+Python&oq=site%3Aopensource.com+%22Seth+Kenlon%22+%2B+Python&gs_l=psy-ab.12...627.15303..15584...1.0..0.176.2802.4j21......0....1..gws-wiz.....0..35i39j0j0i131j0i67j0i20i263.r2SAW3dxlB4),我也推荐你关注他。 我的 Python PLN 每天都在持续扩大。除了我已经提到的,我同样推荐你关注 [Al Sweigart](http://alsweigart.com/)、[Eric Matthes](https://twitter.com/ehmatthes?lang=en) 以及 [Adafruit](https://twitter.com/adafruit)他们分享的优质内容。我也推荐这本书《[制作:由 Adafruit Circuit Playground Express 开始](https://www.adafruit.com/product/3944)》和《[Podcast.\_\_init\_\_](https://www.pythonpodcast.com/episodes/)》,这是一个关于 Python 社区的播客。这两个都是我从我的 PLN 中了解到的。 谁在你的 Python PLN 中?请在留言区分享你的最爱。 --- via: <https://opensource.com/article/19/5/resources-learning-python> 作者:[Don Watkins](https://opensource.com/users/don-watkins) 选题:[lujun9972](https://github.com/lujun9972) 译者:[tomjlw](https://github.com/tomjlw) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
I've been using and teaching Python for a long time now, but I'm always interested in increasing my knowledge about this practical and useful programming language. That's why I've been trying to expand my Python [personal learning network](https://en.wikipedia.org/wiki/Personal_learning_network) (PLN), a concept that describes informal and mutually beneficial networks for sharing information. Educators [Kelly Paredes](https://www.teachingpython.fm/hosts/kellypared) and [Sean Tibor](https://twitter.com/smtibor) recently talked about how to build your Python PLN on their podcast, [Teaching Python](https://www.teachingpython.fm/20), which I subscribed to after meeting them at [PyCon 2019](https://us.pycon.org/2019/) in Cleveland (and adding them to my Python PLN). This podcast inspired me to think more about the people in my Python PLN, including those I met recently at PyCon. I'll share some of the places I've met members of my PLN; maybe they can become part of your Python PLN, too. ## Young Coders mentors [Betsy Waliszewski](https://www.linkedin.com/in/betsywaliszewski), the event coordinator for the Python Foundation, is a member of my Python PLN. When we ran into each other at PyCon2019, because I'm a teacher, she recommended I check out the [Young Coders](https://us.pycon.org/2019/events/letslearnpython/) workshop for kids ages 12 and up. There, I met [Katie Cunningham](https://www.linkedin.com/in/kcunning/), who was running the program, which taught participants how to set up and configure a Raspberry Pi and use Python. The young students also received two books: * Python for Kids* by Jason Briggs and *by Craig Richardson. I'm always looking for new ways to improve my teaching, so I quickly picked up two copies of the Minecraft book at* [Learn to Program with Minecraft](https://nostarch.com/programwithminecraft)[NoStarch Press](https://nostarch.com/)' booth at the conference. Katie is a great teacher and a prolific author with a wonderful [YouTube](https://www.youtube.com/c/KatieCunningham)channel full of Python training videos. I added Katie to my PLN, along with two other people I met at the Young Coders workshop: [Nat Dunn](https://www.linkedin.com/in/natdunn/) and [Sean Valentine](https://www.linkedin.com/in/sean-valentine-b370349b/). Like Katie, they were volunteering their time to introduce young programmers to Python. Nat is the president of [Webucator](https://www.webucator.com/), an IT training company that has been a sponsor of the Python Software Foundation for several years and sponsored the PyCon 2018 Education Summit. He decided to teach at Young Coders after teaching Python to his 13-year-old son and 14-year-old nephew. Sean is the Director of Strategic Initiatives at [The Hidden Genius Project](http://www.hiddengeniusproject.org/), a technology and leadership mentoring program for black male youth. Sean said many Hidden Genius participants "built projects using Python, so we saw [Young Coders] as a great opportunity to partner." Learning about the Hidden Genius Project has inspired me to think deeper about the implications of coding and its power to change lives. ## Open Spaces meetups I found PyCon's [Open Spaces](https://us.pycon.org/2019/events/open-spaces/), self-organizing, impromptu hour-long meetups, just as useful as the official programmed events. One of my favorites was about the [Circuit Playground Express](https://www.adafruit.com/product/3333) device, which was part of our conference swag bags. I am fascinated by this device, and the Open Space provided an avenue to learn more. The organizers offered a worksheet and a [GitHub](https://github.com/adafruit/PyCon2019) repo with all the tools we needed to be successful, as well as an opportunity for hands-on learning and direction to explore this unique hardware. This meetup whetted my appetite to learn even more about programming the Circuit Playground Express, so after PyCon, I reached out on Twitter to [Nina Zakharenko](https://twitter.com/nnja), who [presented a keynote](https://www.youtube.com/watch?v=35mXD40SvXM) at the conference about programming the device. Nina has been in my Python PLN since last fall when I heard her talk at [All Things Open](https://allthingsopen.org/), and I recently signed up for her [Python Fundamentals](https://frontendmasters.com/courses/python/) class to add to my learning. Nina recommended I add [Kattni Rembor](https://twitter.com/kattni), whose [code examples](https://github.com/kattni/ChiPy_2018) are helping me learn to program with CircuitPython, to my Python PLN. ## Other resources from my PLN I also met fellow [Opensource.com](http://Opensource.com) Community Moderator [Moshe Zadka](https://opensource.com/users/moshez) at PyCon2019 and talked with him at length. He shared several new Python resources, including * How to Think Like a Computer Scientist*. Community Moderator [Seth Kenlon](https://opensource.com/users/seth)is another member of my PLN; he has published many great [Python articles](https://www.google.com/search?source=hp&ei=gVToXPq-FYXGsAW-mZ_YAw&q=site%3Aopensource.com+%22Seth+Kenlon%22+%2B+Python&oq=site%3Aopensource.com+%22Seth+Kenlon%22+%2B+Python&gs_l=psy-ab.12...627.15303..15584...1.0..0.176.2802.4j21......0....1..gws-wiz.....0..35i39j0j0i131j0i67j0i20i263.r2SAW3dxlB4), and I recommend you follow him, too. My Python personal learning network continues to grow each day. Besides the folks I have already mentioned, I recommend you follow [Al Sweigart](http://alsweigart.com/), [Eric Matthes](https://twitter.com/ehmatthes?lang=en), and [Adafruit](https://twitter.com/adafruit) because they share great content. I also recommend the book * Make: Getting Started with Adafruit Circuit Playground Express* and [Podcast.__init__](https://www.pythonpodcast.com/episodes/), a podcast all about the Python community, both of which I learned about from my PLN. Who is in your Python PLN? Please share your favorites in the comments. ## 1 Comment
11,020
如何用 Linux 命令行发电子邮件
https://www.networkworld.com/article/3402027/how-to-send-email-from-the-linux-command-line.html
2019-06-26T17:42:49
[ "邮件" ]
https://linux.cn/article-11020-1.html
> > Linux 提供了几个可以让你通过终端发送电子邮件的命令,下面来展示一些有趣的方法。 > > > ![Molnia/iStock](/data/attachment/album/201906/26/174253tom9999o7dktyqqv.jpg) Linux 可以用多种方式通过命令行发送电子邮件。有一些方法十分简单,有一些相对会复杂一些,不过仍旧提供了很多有用的特性。选择哪一种方式取决于你想要什么 —— 向同事快速发送消息,还是向一批人群发带有附件的更复杂的信息。接下来看一看几种可行方案: ### mail 发送一条简单消息最便捷的 Linux 命令是 `mail`。假设你需要提醒老板你今天得早点走,你可以使用这样的一条命令: ``` $ echo "Reminder: Leaving at 4 PM today" | mail -s "early departure" myboss ``` 另一种方式是从一个文件中提取出你想要发送的文本信息: ``` $ mail -s "Reminder:Leaving early" myboss < reason4leaving ``` 在以上两种情况中,你都可以通过 `-s` 来为邮件添加标题。 ### sendmail 使用 `sendmail` 命令可以发送一封不包含标题的快信。(用目标收件人替换 `recip`): ``` $ echo "leaving now" | sendmail recip ``` 你可以用这条命令发送一条只有标题,没有内容的信息: ``` $ echo "Subject: leaving now" | sendmail recip ``` 你也可以用 `sendmail` 发送一条包含一条标题行的完整信息。不过使用这个方法时,你的标题行会被添加到要发送的文件中,如下例所示: ``` Subject: Requested lyrics I would just like to say that, in my opinion, longer hair and other flamboyant affectations of appearance are nothing more ... ``` 你也可以发送这样的文件(`lyric` 文件包含标题和正文): ``` $ sendmail recip < lyrics ``` `sendmain` 的输出也可以很冗长。如果你感到好奇并希望查看发送系统和接收系统之间的交互,请添加 `-v` (verbose)选项。 ``` $ sendmail -v [email protected] < lyrics ``` ### mutt `mutt` 是通过命令行发送邮件的一个很好的工具,在使用前你需要安装它。`mutt` 的一个很方便的优势就是它允许你在邮件中添加附件。 使用 `mutt` 发送一条快速信息: ``` $ echo "Please check last night's backups" | mutt -s "backup check" recip ``` 从文件中获取内容: ``` $ mutt -s "Agenda" recip < agenda ``` 使用 `-a` 选项在 `mutt` 中添加附件。你甚至可以添加不止一个附件 —— 如下一条命令所示: ``` $ mutt -s "Agenda" recip -a agenda -a speakers < msg ``` 在以上的命令中,`msg` 文件包含了邮件中的正文。如果你没有其他补充的内容,你可以这样来代替之前的命令: ``` $ echo "" | mutt -s "Agenda" recip -a agenda -a speakers ``` `mutt` 另一个有用的功能是可以添加抄送(`-c`)和密送(`-b`)。 ``` $ mutt -s "Minutes from last meeting" [email protected] -c myboss < mins ``` ### telnet 如果你想深入了解发送电子邮件的细节,你可以使用 `telnet` 来进行电子邮件交互操作。但正如所说的那样,你需要“学习术语”。邮件服务器期望一系列命令,其中包括自我介绍(`EHLO` 命令)、提供发件人(`MAIL FROM` 命令)、指定收件人(`RCPT TO` 命令),然后添加消息(`DATA`)并以 `.` 结束消息。并不是所有的电子邮件服务器都会响应这些请求。此方法通常仅用于故障排除。 ``` $ telnet emailsite.org 25 Trying 192.168.0.12... Connected to emailsite. Escape character is '^]'. 220 localhost ESMTP Sendmail 8.15.2/8.15.2/Debian-12; Wed, 12 Jun 2019 16:32:13 -0400; (No UCE/UBE) logging access from: mysite(OK)-mysite [192.168.0.12] EHLO mysite.org <== introduce yourself 250-localhost Hello mysite [127.0.0.1], pleased to meet you 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-EXPN 250-VERB 250-8BITMIME 250-SIZE 250-DSN 250-ETRN 250-AUTH DIGEST-MD5 CRAM-MD5 250-DELIVERBY 250 HELP MAIL FROM: [email protected] <== 指定发件人 250 2.1.0 [email protected]... Sender ok RCPT TO: recip <== 指定收件人 250 2.1.5 recip... Recipient ok DATA <== 邮件内容开始 354 Enter mail, end with "." on a line by itself This is a test message. Please deliver it for me. . <== 内容结束 250 2.0.0 x5CKWDds029287 Message accepted for delivery quit <== 结束交互 ``` ### 向多个收件人发送电子邮件 如果你希望通过 Linux 命令行向一大组收件人发送电子邮件,你可以使用一个循环来帮助你完成任务,如下面应用在 `mutt` 中的例子: ``` $ for recip in `cat recips` do mutt -s "Minutes from May meeting" $recip < May_minutes done ``` ### 总结 有很多方法可以从 Linux 命令行发送电子邮件。有些工具提供了相当多的选项。 --- via: <https://www.networkworld.com/article/3402027/how-to-send-email-from-the-linux-command-line.html> 作者:[Sandra Henry-Stocker](https://www.networkworld.com/author/Sandra-Henry_Stocker/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[Modrisco](https://github.com/Modrisco) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
301
Moved Permanently
null
11,021
浅谈汇编器、编译器和解释器
https://opensource.com/article/19/5/primer-assemblers-compilers-interpreters
2019-06-26T18:13:00
[ "编译器" ]
https://linux.cn/article-11021-1.html
> > 简单介绍一下编程方式的历史演变。 > > > ![](/data/attachment/album/201906/26/181309vdouxdfktr344rm4.jpg) 在计算机诞生不久的早期年代,硬件非常昂贵,而程序员比较廉价。这些廉价程序员甚至都没有“程序员”这个头衔,并且常常是由数学家或者电气工程师来充当这个角色的。早期的计算机被用来快速解决复杂的数学问题,所以数学家天然就适合“编程”工作。 ### 什么是程序? 首先来看一点背景知识。计算机自己是做不了任何事情的,它们的任何行为都需要程序来引导。你可以把程序看成是非常精确的菜谱,这种菜谱读取一个输入,然后生成对应的输出。菜谱里的各个步骤由操作数据的指令构成。听上去有点儿复杂,不过你或许知道下面这个语句是什么意思: ``` 1 + 2 = 3 ``` 其中的加号是“指令”,而数字 1 和 2 是数据。数学上的等号意味着等式两边的部分是“等价”的,不过在大部分编程语言中对变量使用等号是“赋值”的意思。如果计算机执行上面这个语句,它会把这个加法的结果(也就是“3”)储存在内存中的某个地方。 计算机知道如何使用数字进行数学运算,以及如何在内存结构中移动数据。在这里就不对内存进行展开了,你只需要知道内存一般分为两大类:“速度快/空间小”和“速度慢/空间大”。CPU 寄存器的读写速度非常快,但是空间非常小,相当于一个速记便签。主存储器通常有很大的空间,但是读写速度就比寄存器差远了。在程序运行的时候,CPU 不断将它所需要用到的数据从主存储器挪动到寄存器,然后再把结果放回到主存储器。 ### 汇编器 当时的计算机很贵,而人力比较便宜。程序员需要耗费很多时间把手写的数学表达式翻译成计算机可以执行的指令。最初的计算机只有非常糟糕的用户界面,有些甚至只有前面板上的拨动开关。这些开关就代表一个内存“单元”里的一个个 “0” 和 “1”。程序员需要配置一个内存单元,选择好储存位置,然后把这个单元提交到内存里。这是一个既耗时又容易出错的过程。 ![Programmers operate the ENIAC computer](/data/attachment/album/201906/26/181338d07mcgh77mgeh7c2.gif "Programmers operate the ENIAC computer") *程序员[Betty Jean Jennings](https://en.wikipedia.org/wiki/Jean_Bartik "Jean Bartik") (左) 和 [Fran Bilas](https://en.wikipedia.org/wiki/Frances_Spence "Frances Spence") (右) 在操作 [ENIAC](https://en.wikipedia.org/wiki/ENIAC) 的主控制面板* 后来有一名 [电气工程师](https://en.wikipedia.org/wiki/Nathaniel_Rochester_%28computer_scientist%29) 认为自己的时间很宝贵,就写了一个程序,能够把人们可以读懂的“菜谱”一样的输入转换成计算机可以读懂的版本。这就是最初的“汇编器”,在当时引起了不小的争议。这些昂贵机器的主人不希望把计算资源浪费在人们已经能做的任务上(虽然又慢又容易出错)。不过随着时间的推移,人们逐渐发现使用汇编器在速度和准确性上都胜于人工编写机器语言,并且计算机完成的“实际工作量”增加了。 尽管汇编器相比在机器面板上切换比特的状态已经是很大的进步了,这种编程方式仍然非常专业。上面加法的例子在汇编语言中看起来差不多是这样的: ``` 01 MOV R0, 1 02 MOV R1, 2 03 ADD R0, R1, R2 04 MOV 64, R0 05 STO R2, R0 ``` 每一行都是一个计算机指令,前面是一个指令的简写,后面是指令所操作的数据。这个小小的程序首先会将数值 1 “移动”到寄存器 R0,然后把 2 移动到寄存器 R1。03 行把 R0 和 R1 两个寄存器里的数值相加,然后将结果储存在 R2 寄存器里。最后,04 行和 05 行决定结果应该被放在主存储器里的什么位置(在这里是地址 64)。管理内存中存储数据的位置是编程过程中最耗时也最容易出错的部分之一。 ### 编译器 汇编器已经比手写计算机指令要好太多了,不过早期的程序员还是渴望能够按照他们所习惯的方式,像书写数学公式一样地去写程序。这种需求推动了高级编译语言的发展,其中有一些已经成为历史,另一些如今还在使用。比如 [ALGO](https://en.wikipedia.org/wiki/ALGO) 就已经成为历史了,但是像 [Fortran](https://en.wikipedia.org/wiki/Fortran) 和 [C](https://en.wikipedia.org/wiki/C_(programming_language)) 这样的语言仍然在不断解决实际问题。 ![Genealogy tree of ALGO and Fortran](/data/attachment/album/201906/26/181340u6zfjrmc6fjiiiif.png "Genealogy tree of ALGO and Fortran") *ALGO 和 Fortran 编程语言的谱系树* 这些“高级”语言使得程序员可以用更简单的方式编写程序。在 C 语言中,我们的加法程序就变成了这样: ``` int x; x = 1 + 2; ``` 第一个语句描述了该程序将要使用的一块内存。在这个例子中,这块内存应该占一个整数的大小,名字是 `x`。第二个语句是加法,虽然是倒着写的。一个 C 语言的程序员会说这是 “X 被赋值为 1 加 2 的结果”。需要注意的是,程序员并不需要决定在内存的什么位置储存 `x`,这个任务交给编译器了。 这种被称为“编译器”的新程序可以把用高级语言写的程序转换成汇编语言,再使用汇编器把汇编语言转换成机器可读的程序。这种程序组合常常被称为“工具链”,因为一个程序的输出就直接成为另一个程序的输入。 编译语言相比汇编语言的优势体现在从一台计算机迁移到不同型号或者品牌的另一台计算机上的时候。在计算机的早期岁月里,包括 IBM、DEC、德州仪器、UNIVAC 以及惠普在内的很多公司都在制造除了大量不同类型的计算机硬件。这些计算机除了都需要连接电源之外就没有太多共同点了。它们在内存和 CPU 架构上的差异相当大,当时经常需要人们花费数年来将一台计算机的程序翻译成另一台计算机的程序。 有了高级语言,我们只需要把编译器工具链迁移到新的平台就行了。只要有可用的编译器,高级语言写的程序最多只需要经过小幅修改就可以在新的计算机上被重新编译。高级语言的编译是一个真正的革命性成果。 ![IBM PC XT](/data/attachment/album/201906/26/181342hqzpzn8bbprq8uzk.jpg "IBM PC XT") *1983 发布的 IBM PC XT 是硬件价格下降的早期例子。* 程序员们的生活得到了很好的改善。相比之下,通过高级语言表达他们想要解决的问题让事情变得轻松很多。由于半导体技术的进步以及集成芯片的发明,计算机硬件的价格急剧下降。计算机的速度越来越快,能力也越来越强,并且还便宜了很多。从某个时间点往后(也许是 80 年代末期吧),事情发生了反转,程序员变得比他们所使用的硬件更值钱了。 ### 解释器 随着时间的推移,一种新的编程方式兴起了。一种被称为“解释器”的特殊程序可以直接读取一个程序将其转换成计算机指令以立即执行。和编译器差不多,解释器读取程序并将它转换成一个中间形态。但和编译器不同的是,解释器直接执行程序的这个中间形态。解释型语言在每一次执行的时候都要经历这个过程;而编译程序只需要编译一次,之后计算机每次只需要执行编译好的机器指令就可以了。 顺便说一句,这个特性就是导致人们感觉解释型程序运行得比较慢的原因。不过现代计算机的性能出奇地强大,以至于大多数人无法区分编译型程序和解释型程序。 解释型程序(有时也被成为“脚本”)甚至更容易被移植到不同的硬件平台上。因为脚本并不包含任何机器特有的指令,同一个版本的程序可以不经过任何修改就直接在很多不同的计算机上运行。不过当然了,解释器必须得先移植到新的机器上才行。 一个很流行的解释型语言是 [perl](www.perl.org)。用 perl 完整地表达我们的加法问题会是这样的: ``` $x = 1 + 2 ``` 虽然这个程序看起来和 C 语言的版本差不多,运行上也没有太大区别,但却缺少了初始化变量的语句。其实还有一些其它的区别(超出这篇文章的范围了),但你应该已经注意到,我们写计算机程序的方式已经和数学家用纸笔手写数学表达式非常接近了。 ### 虚拟机 最新潮的编程方式要数虚拟机(经常简称 VM)了。虚拟机分为两大类:系统虚拟机和进程虚拟机。这两种虚拟机都提供一种对“真实的”计算硬件的不同级别的抽象,不过它们的作用域不同。系统虚拟机是一个提供物理硬件的替代品的软件,而进程虚拟机则被设计用来以一种“系统独立”的方式执行程序。所以在这个例子里,进程虚拟机(往后我所说的虚拟机都是指这个类型)的作用域和解释器的比较类似,因为也是先将程序编译成一个中间形态,然后虚拟机再执行这个中间形态。 虚拟机和解释器的主要区别在于,虚拟机创造了一个虚拟的 CPU,以及一套虚拟的指令集。有了这层抽象,我们就可以编写前端工具来把不同语言的程序编译成虚拟机可以接受的程序了。也许最流行也最知名的虚拟机就是 Java 虚拟机(JVM)了。JVM 最初在 1990 年代只支持 Java 语言,但是如今却可以运行 [许多](https://en.wikipedia.org/wiki/List_of_JVM_languages) 流行的编程语言,包括 Scala、Jython、JRuby、Clojure,以及 Kotlin 等等。还有其它一些不太常见的例子,在这里就不说了。我也是最近才知道,我最喜欢的语言 Python 并不是一个解释型语言,而是一个 [运行在虚拟机上的语言](https://opensource.com/article/18/4/introduction-python-bytecode)! 虚拟机仍然在延续这样一个历史趋势:让程序员在使用特定领域的编程语言解决问题的时候,所需要的对特定计算平台的了解变得越来越少了。 ### 就是这样了 希望你喜欢这篇简单介绍软件背后运行原理的短文。有什么其它话题是你想让我接下来讨论的吗?在评论里告诉我吧。 --- via: <https://opensource.com/article/19/5/primer-assemblers-compilers-interpreters> 作者:[Erik O'Shaughnessy](https://opensource.com/users/jnyjny/users/shawnhcorey/users/jnyjny/users/jnyjny) 选题:[lujun9972](https://github.com/lujun9972) 译者:[chen-ni](https://github.com/chen-ni) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
In the early days of computing, hardware was expensive and programmers were cheap. In fact, programmers were so cheap they weren't even called "programmers" and were in fact usually mathematicians or electrical engineers. Early computers were used to solve complex mathematical problems quickly, so mathematicians were a natural fit for the job of "programming." ## What is a program? First, a little background. Computers can't do anything by themselves, so they require programs to drive their behavior. Programs can be thought of as very detailed recipes that take an input and produce an output. The steps in the recipe are composed of instructions that operate on data. While that sounds complicated, you probably know how this statement works: `1 + 2 = 3` The plus sign is the "instruction" while the numbers 1 and 2 are the data. Mathematically, the equal sign indicates that both sides of an equation are "equivalent," however most computer languages use some variant of equals to mean "assignment." If a computer were executing that statement, it would store the results of the addition (the "3") somewhere in memory. Computers know how to do math with numbers and move data around the machine's memory hierarchy. I won't say too much about memory except that it generally comes in two different flavors: fast/small and slow/big. CPU registers are very fast, very small and act as scratch pads. Main memory is typically very big and not nearly as fast as register memory. CPUs shuffle the data they are working with from main memory to registers and back again while a program executes. ## Assemblers Computers were very expensive and people were cheap. Programmers spent endless hours translating hand-written math into computer instructions that the computer could execute. The very first computers had terrible user interfaces, some only consisting of toggle switches on the front panel. The switches represented 1s and 0s in a single "word" of memory. The programmer would configure a word, indicate where to store it, and commit the word to memory. It was time-consuming and error-prone. ![Programmers operate the ENIAC computer Programmers operate the ENIAC computer](https://opensource.com/sites/default/files/uploads/two_women_operating_eniac.gif) Programmers Betty Jean Jennings (left) and Fran Bilas (right) operate ENIAC's main control panel at the Moore School of Electrical Engineering. (U.S. Army photo from the archives of the ARL Technical Library) Eventually, an [electrical engineer](https://en.wikipedia.org/wiki/Nathaniel_Rochester_%28computer_scientist%29) decided his time wasn't cheap and wrote a program with input written as a "recipe" expressed in terms people could read that output a computer-readable version. This was the first "assembler" and it was very controversial. The people that owned the expensive machines didn't want to "waste" compute time on a task that people were already doing; albeit slowly and with errors. Over time, people came to appreciate the speed and accuracy of the assembler versus a hand-assembled program, and the amount of "real work" done with the computer increased. While assembler programs were a big step up from toggling bit patterns into the front panel of a machine, they were still pretty specialized. The addition example above might have looked something like this: ``` 01 MOV R0, 1 02 MOV R1, 2 03 ADD R0, R1, R2 04 MOV 64, R0 05 STO R2, R0 ``` Each line is a computer instruction, beginning with a shorthand name of the instruction followed by the data the instruction works on. This little program will first "move" the value 1 into a register called R0, then 2 into register R1. Line 03 adds the contents of registers R0 and R1 and stores the resulting value into register R2. Finally, lines 04 and 05 identify where the result should be stored in main memory (address 64). Managing where data is stored in memory is one of the most time-consuming and error-prone parts of writing computer programs. ## Compilers Assembly was much better than writing computer instructions by hand; however, early programmers yearned to write programs like they were accustomed to writing mathematical formulae. This drove the development of higher-level compiled languages, some of which are historical footnotes and others are still in use today. [ALGO](https://en.wikipedia.org/wiki/ALGO) is one such footnote, while real problems continue to be solved today with languages like [Fortran](https://en.wikipedia.org/wiki/Fortran) and [C](https://en.wikipedia.org/wiki/C_(programming_language)). ![Genealogy tree of programming languages - Algol & Fortran family Genealogy tree of ALGO and Fortran](https://opensource.com/sites/default/files/uploads/algolfortran_family-by-borkowski.png) Genealogy tree of programming languages, Algol and Fortran family The introduction of these "high-level" languages allowed programmers to write their programs in simpler terms. In the C language, our addition assembly program would be written: ``` int x; x = 1 + 2; ``` The first statement describes a piece of memory the program will use. In this case, the memory should be the size of an integer and its name is **x** The second statement is the addition, although written "backward." A C programmer would read that as "X is assigned the result of one plus two." Notice the programmer doesn't need to say where to put **x** in memory, as the compiler takes care of that. A new type of program called a "compiler" would turn the program written in a high-level language into an assembly language version and then run it through the assembler to produce a machine-readable version of the program. This composition of programs is often called a "toolchain," in that one program's output is sent directly to another program's input. The huge advantage of compiled languages over assembly language programs was porting from one computer model or brand to another. In the early days of computing, there was an explosion of different types of computing hardware from companies like IBM, Digital Equipment Corporation, Texas Instruments, UNIVAC, Hewlett Packard, and others. None of these computers shared much in common besides needing to be plugged into an electrical power supply. Memory and CPU architectures differed wildly, and it often took man-years to translate programs from one computer to another. With high-level languages, the compiler toolchain only had to be ported to the new platform. Once the compiler was available, high-level language programs could be recompiled for a new computer with little or no modification. Compilation of high-level languages was truly revolutionary. ![IBM PC XT IBM PC XT](https://opensource.com/sites/default/files/uploads/639px-ibm_px_xt_color.jpg) IIBM PC XT released in 1983 Life became very good for programmers. It was much easier to express the problems they wanted to solve using high-level languages. The cost of computer hardware was falling dramatically due to advances in semiconductors and the invention of integrated chips. Computers were getting faster and more capable, as well as much less expensive. At some point, possibly in the late '80s, there was an inversion and programmers became more expensive than the hardware they used. ## Interpreters Over time, a new programming model rose where a special program called an "interpreter" would read a program and turn it into computer instructions to be executed immediately. The interpreter takes the program as input and interprets it into an intermediate form, much like a compiler. Unlike a compiler, the interpreter then executes the intermediate form of the program. This happens every time an interpreted program runs, whereas a compiled program is compiled just one time and the computer executes the machine instructions "as written." As a side note, when people say "interpreted programs are slow," this is the main source of the perceived lack of performance. Modern computers are so amazingly capable that most people can't tell the difference between compiled and interpreted programs. Interpreted programs, sometimes called "scripts," are even easier to port to different hardware platforms. Because the script doesn't contain any machine-specific instructions, a single version of a program can run on many different computers without changes. The catch, of course, is the interpreter must be ported to the new machine to make that possible. One example of a very popular interpreted language is [perl](https://opensource.com/www.perl.org). A complete perl expression of our addition problem would be: `$x = 1 + 2` While it looks and acts much like the C version, it lacks the variable initialization statement. There are other differences (which are beyond the scope of this article), but you can see that we can write a computer program that is very close to how a mathematician would write it by hand with pencil and paper. ## Virtual Machines The latest craze in programming models is the virtual machine, often abbreviated as VM. There are two flavors of virtual machine; system virtual machines and process virtual machines. Both types of VMs provide a level of abstraction from the "real" computing hardware, though they have different scopes. A system virtual machine is software that offers a substitute for the physical hardware, while a process virtual machine is designed to execute a program in a system-independent manner. So in this case, a process virtual machine (virtual machine from here on) is similar in scope to an interpreter in that a program is first compiled into an intermediated form before the virtual machine executes it. The main difference between an interpreter and a virtual machine is the virtual machine implements an idealized CPU accessed through its virtual instruction set. This abstraction makes it possible to write front-end language tools that compile programs written in different languages and target the virtual machine. Probably the most popular and well known virtual machine is the Java Virtual Machine (JVM). The JVM was initially only for the Java programming language back in the 1990s, but it now hosts [many](https://en.wikipedia.org/wiki/List_of_JVM_languages) popular computer languages: Scala, Jython, JRuby, Clojure, and Kotlin to list just a few. There are other examples that may not be common knowledge. I only recently learned that my favorite language, [Python](https://opensource.com/resources/python), is not an interpreted language, but a [language hosted on a virtual machine](https://opensource.com/article/18/4/introduction-python-bytecode)! Virtual machines continue the historical trend of reducing the amount of platform-specific knowledge a programmer needs to express their problem in a language that supports their domain-specific needs. ## That's a wrap I hope you enjoy this primer on some of the less visible parts of software. Are there other topics you want me to dive into next? Let me know in the comments. *This article was originally published on PyBites and is reprinted with permission.* ## 4 Comments
11,022
在 Fedora 中使用私人助理 Mycroft
https://fedoramagazine.org/personal-assistant-with-mycroft-and-fedora/
2019-06-27T11:02:47
[ "私人助理" ]
https://linux.cn/article-11022-1.html
![](/data/attachment/album/201906/27/110252hp1agc6l7a01c9zg.jpg) > > 想要找个开源的私人助理么?[Mycroft](https://mycroft.ai/) 可以让你运行一个开源的服务,从而更好地控制你的数据。 > > > ### 在 Fedora 上安装 Mycroft Mycroft 目前不存在于官方软件包集合中,但它可以轻松地从源码安装。第一步是从 Mycroft 的 GitHub 仓库下载源码。 ``` $ git clone https://github.com/MycroftAI/mycroft-core.git ``` Mycroft 是一个 Python 应用,它提供了一个脚本负责在安装 Mycroft 及其依赖项之前创建虚拟环境。 ``` $ cd mycroft-core $ ./dev_setup.sh ``` 安装脚本会提示用户以帮助他完成安装过程。建议运行稳定版本并获取自动更新。 当提示在本地安装 Mimic 文字转语音引擎时,请回答否。因为根据安装描述,这可能需要很长时间,并且 Mimic 有适合 Fedora 的 rpm 包,因此可以使用 `dnf` 进行安装。 ``` $ sudo dnf install mimic ``` ### 开始使用 Mycroft 安装完成后,可以使用以下脚本启动 Mycroft 服务。 ``` $ ./start-mycroft.sh all ``` 要开始使用 Mycroft,需要注册运行服务的设备。因此需要一个帐户,可以在 <https://home.mycroft.ai/> 中创建。 创建帐户后,可以在 <https://account.mycroft.ai/devices> 中添加新设备。添加新设备需要配对码,你的设备会在所有服务启动后告诉你。 ![](/data/attachment/album/201906/27/110254xl8188pfkouoqeou.png) 现在可以使用该设备了。 ### 使用 Mycroft Mycroft 提供了一组默认启用的[技能](https://market.mycroft.ai/skills),它们或者可以从[市场](https://market.mycroft.ai/skills)下载。刚开始,你可以简单地向 Mycroft 问好,或天气如何。 ``` Hey Mycroft, how are you ? Hey Mycroft, what's the weather like ? ``` 如果你对它是如何工作的感兴趣,`start-mycroft.sh` 脚本提供了一个命令行选项,它能让你使用命令行交互。它也会显示用于调试的有用信息。 Mycroft 总在学习新技能,并且有很多方法给 Mycroft 社区做[贡献](https://mycroft.ai/contribute/)。 由 [Przemyslaw Marczynski](https://unsplash.com/@pemmax?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) 摄影,发布于 [Unsplash](https://unsplash.com/search/photos/ai?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) --- via: <https://fedoramagazine.org/personal-assistant-with-mycroft-and-fedora/> 作者:[Clément Verna](https://fedoramagazine.org/author/cverna/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
Looking for an open source personal assistant ? [Mycroft](https://mycroft.ai/) is allowing you to run an open source service which gives you better control of your data. ## Install Mycroft on Fedora Mycroft is currently not available in the official package collection, but it can be easily installed from the project source. The first step is to download the source from Mycroft’s GitHub repository. $ git clone https://github.com/MycroftAI/mycroft-core.git Mycroft is a Python application and the project provides a script that takes care of creating a virtual environment before installing Mycroft and its dependencies. $ cd mycroft-core $ ./dev_setup.sh The installation script prompts the user to help him with the installation process. It is recommended to run the stable version and get automatic updates. When prompted to install locally the Mimic text-to-speech engine, answer No. Since as described in the installation process this can take a long time and Mimic is available as an rpm package in Fedora so it can be installed using dnf. $ sudo dnf install mimic ## Starting Mycroft After the installation is complete, the Mycroft services can be started using the following script. $ ./start-mycroft.sh all In order to start using Mycroft the device running the service needs to be registered. To do that an account is needed and can be created at [https://home.mycroft.ai/](https://home.mycroft.ai/). Once the account created, it is possible to add a new device at the following address [https://account.mycroft.ai/devices.](https://account.mycroft.ai/devices) Adding a new device requires a pairing code that will be spoken to you by your device after starting all the services. ![](https://fedoramagazine.org/wp-content/uploads/2019/06/Screenshot_2019-06-14-Account.png) The device is now ready to be used. ## Using Mycroft Mycroft provides a set of [skills](https://market.mycroft.ai/skills) that are enabled by default or can be downloaded from the [Marketplace](https://market.mycroft.ai/skills). To start you can simply ask Mycroft how is doing, or what the weather is. Hey Mycroft, how are you ? Hey Mycroft, what's the weather like ? If you are interested in how things works, the *start-mycroft.sh* script provides a *cli* option that lets you interact with the services using the command line. It is also displaying logs which is really useful for debugging. Mycroft is always trying to learn new skills, and there are many way to help by [contributing](https://mycroft.ai/contribute/) the Mycroft community. Photo by [Przemyslaw Marczynski](https://unsplash.com/@pemmax?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/search/photos/ai?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) ## Daniel Why do I need an account with a cloud service if this is supposed to be an open source assistant service running on my own device? or is it? Is it just the client that is open source with all the good stuff locked behind the cloud service? ## Clément Verna The speech to text processing is currently done remotely on the Mycroft server, but there is an open discussion to be able to run a personal server (https://community.mycroft.ai/t/the-mycroft-personal-server-starting-the-conversation/4691/8) . ## Chris Most of the good stuff runs on the device, including the core voice assistant software and the skills you install. Some skills need to reach out to the internet to work. For example, the weather skill needs to call a weather API to get your local forecast. However, this is not why the account is necessary. The cloud service is currently the only way to interact with skill settings (unless you want to ssh into your device). Cloud accounts are also how Mycroft tracks your agreement to its Terms of Service and Privacy Policy. ## Lyes Saadi Wow, it’s awesome ! Tried it, and it works very well ! Even if, with my « frainch acent » he has some trouble when waking him up, but, he understands me pretty well 🙂 ! That will really be good to promote Linux to those who like personal assistants. ## Isaque Galdino Does it run on a Raspberry Pi? ## Clément Verna Yes, if you check their get started page, there is a dedicated section for raspberry pi (https://mycroft.ai/get-started/) ## Eric Nicholls I came looking for copper and found gold. Thank you for this article. ## JCjr Where is the audio processing done? I ask, because what’s been shown time and time again is these talking tube devices do all the audio processing on their respective Internet services, and are listening in on every word spoken and every sound made despite the marketing describing that they use a “wake-up word”. In reality, the “wake-up word” is just a command to get it to respond to the following sounds, but the microphone is always on – it has to be for the wake-up word to work. Also, the Mycroft site on which you need to register your device for it to work has a really vague privacy policy. ## Clément Verna The speech to text processing is currently done remotely on the Mycroft server, but there is an open discussion to be able to run a personal server (https://community.mycroft.ai/t/the-mycroft-personal-server-starting-the-conversation/4691/8) . The other good thing is that since it is open source, you can go and check that the device is not listening to ambient noise when it is not suppose too 🙂 ## JCjr How do you propose to do that? The system is always listening for a wake up word, and you say audio processing is done at the remote server, meaning they have ALL of the audio data. I have no idea what code they are using on their end, nor do I have any insight on how or if they monetize the audio data (I mean c’mon….it’s pretty much a given that all companies monetize data stored or streamed to their systems in this day and age). I don’t see much difference between this and Alexa or Google Assistant TBH – UNLESS they do release software to run your own audio processing locally without their required service. Remember: even Android is based on open source software. And it’s probably one of the biggest spycraft kits available. ## Dominik No, Mycroft does the wake word listening locally (either by Mycroft-Precise for pre-learned word or PocketSphinx for custom wake words). For best results speech-to-text of the actual “utterance” (after the wake-word) Mycroft is using Google-TTS via an anonymizing proxy. With some additional installation and configuration you can use local STT via Kaldi or PocketSphinx, but their generic models have less precision. English text-to-speech synthesis can be done locally with Mimic1 or with better quality by Mimic2 (via Mycroft “cloud”). There are some more alternatives for TTS and STT. ## JCjr “Mycroft is using Google-TTS via an anonymizing proxy.” Google. That’s telling. And what proxy? ## Pcwii As an active member of the Mycroft community i can assure you that the wake word processing is done locally on your device. And the team is very serious about not collecting personal identifiable information. ## JCjr Then why is this not spelled out in their vague privacy policy that is almost identical to Google’s? ## jakfrost “I have no idea what code they are using on their end” You do since the code is open sourced. ## JCjr You assume that they’re using that code as-is. Android on a phone isn’t the same as the source code on AOSP. ## Jurando And you assume bad faith on their part, all throughout your questioning and even after all of them have been sufficiently cleared up for everybody else. Why is that? ## Paul W. Frields Although it makes sense to ask questions about processing, I don’t see the point in questioning motive further in this case. Let’s consider that topic closed on this venue, please, and move on. ## JS There is a local STT engine that listens for the wake up word, since there is no such good quality required. Transmission to the remote server starts after that for few seconds. ## giuseppe it is better to run everyghin inside a sandboxed python env. change are that something will be messed up (dnf…) ## Vanga This stuff rotted. They changed this stuff license from gpl to apache. Full closing in success case it is question of time. ## Mark Dzmura Apparently there are two speech recognition systems at work in Mycroft: A (relatively) simple, local recognizer is responsible for detecting the wakeup word/phrase. (By local I mean that it is running entirely on the local host, not in the cloud.) The actual command recognition takes place in the cloud. If my understanding was correct, the default recognizer is actually Google’s service – which explains the extremely high quality speech recognition that I have experienced with Mycroft. (Over time you will note that the number of false positive detections of “Hey Mycroft” is pretty high). Ultimately many would prefer the use of a high-quality local recognizer component, but it will probably be a long while before an open-source recognizer with the phrase-level accuracy of Google’s is available. ## Ruados Is there an option of just text? I find the idea of a personal assistant interesting, just not the idea of talking with my computer like a madman. ## Doug Yes. Use the command “./start-mycroft.sh cli” This is the command to start its command line interface. You can’t then type question to it and it will reply with voice and a text written answer. ## Mehdi Happy to hear about this. Makes me hopeful in open source assistants progress ## Mehdi I think due to the open nature of the project, it is perfectly possible to run a personal server. Isn’t it? ## 23r can I use radio wifi starting voice and stoping button? is Polish language translation? ## Yassir There is a Mycroft AI Plasmoid for KDE Plasma 5 Desktop https://mycroft.ai/documentation/plasma/ ## Eugene OK, I’m not much up-to-date with Linux conspiracy theories, but I think the previous discussion about “openness” of Mycroft boils down to one question, which is important to me. Is Mycroft always going to be free? Can you guarantee it, at least for some years to come? Or are we all supplying training data for a planned commercial product? I’m obviously not talking about privacy. Rather, I don’t want to waste my time and computer resources training AI for commercial products, unless I’m payed to do so.
11,023
VSCodium:100% 开源的 VS Code
https://itsfoss.com/vscodium/
2019-06-27T11:48:03
[ "VSCode" ]
https://linux.cn/article-11023-1.html
> > VSCodium 是微软流行的 Visual Studio Code 编辑器的一个分支。它与 VS Code 完全相同,唯一不同的是,VSCodium 不跟踪你的使用数据。 > > > 微软的 [Visual Studio Code](https://code.visualstudio.com/) 是一个出色的编辑器,不仅对于 Web 开发人员,也适合其他程序员。由于它的功能,它被认为是最好的开源代码编辑器之一。 是的,它是微软众多开源产品之一。因为有 DEB、RPM 和 Snap 包形式的二进制文件,你可以[在 Linux 中轻松安装 Visual Studio Code](https://itsfoss.com/install-visual-studio-code-ubuntu/)。 但它存在一个问题,对于普通用户而言可能不是问题,但对于纯粹开源主义者而言是重要的。 Microsoft 说提供的二进制文件是不开源的。 感到困惑么?让我解释下。 VS Code 的源码是在 MIT 许可下开源的。你可以在 [GitHub](https://github.com/Microsoft/vscode) 上访问它。但是,[Microsoft 创建的安装包含专有的跟踪程序](https://github.com/Microsoft/vscode/issues/60#issuecomment-161792005)。 此跟踪基本上用来收集使用数据并将其发送给 Microsoft 以“帮助改进其产品和服务”。如今,远程报告在软件产品中很常见。即使 [Ubuntu 也这样做,但它透明度更高](https://itsfoss.com/ubuntu-data-collection-stats/)。 你可以[在 VS Code 中禁用远程报告](https://code.visualstudio.com/docs/supporting/faq#_how-to-disable-telemetry-reporting),但是你能完全信任微软吗?如果答案是否定的,那你有什么选择? 你可以从源代码构建它,从而保持全都是开源的。但是如今[从源代码安装](https://itsfoss.com/install-software-from-source-code/)并不总是最好的选择,因为我们习惯于使用二进制文件。 另一种选择是使用 VSCodium ! ### VSCodium:100% 开源形式的 Visual Studio Code ![](/data/attachment/album/201906/27/114807g12qgmdd0042g2bb.png) [VSCodium](https://vscodium.com/) 是微软 Visual Studio Code 的一个分支。该项目的唯一目的是为你提供现成的二进制文件,而没有 Microsoft 的远程收集代码。 这解决了你想在去掉 Microsoft 的专有代码的情况下使用 VS Code ,而你又不习惯从源代码构建它的问题。 由于 [VSCodium 是 VS Code 的一个分支](https://github.com/VSCodium/vscodium),它的外观和功能与 VS Code 完全相同。 这是 Ubuntu 中第一次运行 VS Code 和 VSCodium 的截图。你能分辨出来吗? ![Can you guess which is VSCode and VSCodium?](/data/attachment/album/201906/27/114811mgi05zlhld36ulld.png) 如果你无法区分这两者,请看下面。 ![That’s Microsoft](/data/attachment/album/201906/27/114813spyp99p7poo97pre.png) 除此之外,还有两个应用的 logo,没有其他明显的区别。 ![VSCodium and VS Code in GNOME Menu](/data/attachment/album/201906/27/114815ym8s8ycd8ays81yz.jpg) #### 在 Linux 上安装 VSCodium 虽然 VSCodium 存在于某些发行版(如 Parrot OS)中,但你必须在其他 Linux 发行版中添加额外的仓库。 在基于 Ubuntu 和 Debian 的发行版上,你可以使用以下命令安装 VSCodium。 首先,添加仓库的 GPG 密钥: ``` wget -qO - https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg | sudo apt-key add - ``` 然后添加仓库: ``` echo 'deb https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/repos/debs/ vscodium main' | sudo tee --append /etc/apt/sources.list.d/vscodium.list ``` 现在更新你的系统并安装 VSCodium: ``` sudo apt update && sudo apt install codium ``` 你可以在它的页面上找到[其他发行版的安装说明](https://vscodium.com/#install)。你还应该阅读[有关从 VS Code 迁移到 VSCodium 的说明](https://vscodium.com/#migrate)。 ### 你如何看待 VSCodium? 就个人而言,我喜欢 VSCodium 的概念。说的老套一点,它的初心是好的。我认为,致力于开源的 Linux 发行版甚至可能开始将其包含在官方仓库中。 你怎么看?是否值得切换到 VSCodium 或者你选择关闭远程报告并继续使用 VS Code? 请不要出现“我使用 Vim” 的评论 :D --- via: <https://itsfoss.com/vscodium/> 作者:[Abhishek Prakash](https://itsfoss.com/author/abhishek/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![Warp Terminal](/assets/images/warp-terminal.webp) ![Warp Terminal](/assets/images/warp-terminal.webp) Microsoft’s [Visual Studio Code](https://code.visualstudio.com/?ref=itsfoss.com) is an excellent editor not only for web developers but also for other programmers. Due to its features, it’s considered one of the best open source code editors. Yes, it’s one of the many open source products from Microsoft. You can [easily install Visual Studio Code in Linux](https://itsfoss.com/install-visual-studio-code-ubuntu/) thanks to the ready to use binaries in the form of DEB, RPM and Snap packages. And there is a problem which might not be an issue for a regular user but significant to an open source purist. The ready to use binaries Microsoft provides are not open source. Confused? Let me explain. The source code of VS Code is open sourced under MIT license. You can access it on the [GitHub](https://github.com/Microsoft/vscode?ref=itsfoss.com). However, the [installation files that Microsoft has created contain proprietary telemetry/tracking](https://github.com/Microsoft/vscode/issues/60?ref=itsfoss.com#issuecomment-161792005). This tracking basically collects usage data and sends it to Microsoft to ‘help improve their products and services’. Telemetry reporting is common with software products these days. Even [Ubuntu does that but with more transparency](https://itsfoss.com/ubuntu-data-collection-stats/). You can [disable the telemetry in VS Code](https://code.visualstudio.com/docs/supporting/faq?ref=itsfoss.com#_how-to-disable-telemetry-reporting) but can you trust Microsoft completely? If the answer is no, then what are your options? You can build it from the source code and thus keep everything open source. But [installing from source code](https://itsfoss.com/install-software-from-source-code/) is not always the prettiest option specially in today’s world when we are so used to of having binaries. Another option is to use VSCodium! ## VSCodium: 100% open source form of Visual Studio Code ![VSCodium Completely Open Source version of VS Code](https://itsfoss.com/content/images/wordpress/2019/04/vscodium-800x450.png) [VSCodium](https://vscodium.com/?ref=itsfoss.com) is a clone of Microsoft’s Visual Studio Code. This project’s sole aim is to provide you with ready to use binaries without Microsoft’s telemetry code. This solves the problem where you want to use VS Code without the proprietary code from Microsoft but you are not comfortable with building it from the source. Since [VSCodium is a clone of VS Code](https://github.com/VSCodium/vscodium?ref=itsfoss.com), it looks and functions exactly the same as VS Code. Here’s a screenshot of the first run of VS Code and VSCodium side by side in Ubuntu. Can you distinguish one from another? ![VScode vs VSCodium](https://itsfoss.com/content/images/wordpress/2019/04/vscodium-vs-vscode-800x450.png) If you have not been able to distinguish between the two, look at the bottom. ![Microsoft VSCode Tracking](https://itsfoss.com/content/images/wordpress/2019/04/microsoft-vscode-tracking-800x259.png) Apart from this and the logo of the two applications, there is no other noticeable difference. ![VS Code vs VSCodium](https://itsfoss.com/content/images/wordpress/2019/04/vscodium-and-vscode-800x220.jpg) ## Installing VSCodium on Linux While VSCodium is available in some distributions like Parrot OS, you’ll have to add additional repositories in other Linux distributions. You can use the following commands to [install VSCodium on Ubuntu](https://itsfoss.com/install-vscodium-ubuntu/) and other Debian-based distros. First, add the GPG key of the repository: `wget -qO - https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg | sudo apt-key add -` And then add the repository itself: `echo 'deb https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/repos/debs/ vscodium main' | sudo tee --append /etc/apt/sources.list.d/vscodium.list` Now update your system and install VSCodium: `sudo apt update && sudo apt install codium` If you use Snap, you can easily install it using: ``` snap install codium --classic ``` You can find the [installation instructions for other distributions on its page](https://vscodium.com/?ref=itsfoss.com#install). You should also read the [instructions about migrating from VS Code to VSCodium](https://vscodium.com/?ref=itsfoss.com#migrate). Furthermore, you may also download the latest version of VS Codium from their release page: ## What do you think of VSCodium? There are many [open source code editors](https://itsfoss.com/best-modern-open-source-code-editors-for-linux/) available. VS Code is the most popular among them all if I am not mistaken, at least among the GUI-based editors. [8 Best Open Source Code Editors for LinuxLooking for the best text editors in Linux for coding? Here’s a list of the best code open source code editors for Linux.](https://itsfoss.com/best-modern-open-source-code-editors-for-linux/)![](https://itsfoss.com/content/images/2023/02/modern-code-editors.png) ![](https://itsfoss.com/content/images/2023/02/modern-code-editors.png) Personally, I like the concept of VSCodium. To use the cliche, the project has its heart in the right place. I think Linux distributions committed to open source may even start including it in their official repository. What do you think? Is it worth switching to VSCodium or would you rather opt out of the telemetry and continue using VS Code? And please, no “I use Vim” comments :D
11,026
如何跨越 Kubernetes 学习曲线
https://opensource.com/article/19/6/kubernetes-learning-curve
2019-06-28T13:15:34
[ "Kubernetes" ]
https://linux.cn/article-11026-1.html
> > Kubernetes 就像一辆翻斗车。它非常适合解决它所针对的问题,但你必须首先掌握其学习曲线。 > > > ![](/data/attachment/album/201906/28/131501h8vydvd4tyx5gz5t.jpg) 在[为什么说 Kubernetes 是一辆翻斗车](/article-11011-1.html)中,我谈到了一个工具如何优雅地解决它所设计用来解决的问题 —— 只是你要学会如何使用它。在本系列的第 2 部分中,我将更深入地了解 Kubernetes 的学习曲线。 [Kubernetes](https://kubernetes.io/) 的旅程通常从在一台主机上运行一个容器开始。你可以快速了解运行新版本软件的难易程度,与其他人分享该软件的难易程度,以及对于这些用户按照你预期方式运行它的难易程度。 但是你需要: * 两个容器 * 两个主机 使用容器在端口 80 上启动一个 Web 服务器很容易,但是当你需要在端口 80 上启动第二个容器时会发生什么?当你构建生产环境时,需要容器化 Web 服务器在发生故障时转移到第二个主机时会发生什么?在任何一种情况下,这个答案简单来说就是你必须采用容器编排。 当你开始处理两个容器或两个主机问题时,你将不可避免地引入了复杂性,因此,这就是一个学习曲线。这个两个服务(容器的更通用说法)或两个主机的问题已经存在了很长时间,并且由此带来了复杂性。 从历史上看,这将涉及负载均衡、集群软件甚至集群文件系统。每个服务的配置逻辑都嵌入在每个系统(负载均衡、集群软件和文件系统)中。在负载平衡器后运行 60 或 70 个集群的服务是复杂的。添加另一个新服务也很复杂。更糟糕的是,撤下服务简直是一场噩梦。回想起我对生产环境中的 MySQL 和 Apache 服务器进行故障排除的日子,这些服务器的逻辑嵌入在三、四个或五个不同的地方,所有这些都采用不同的格式,让我头疼不已。 Kubernetes 使用一个软件优雅地解决了所有这些问题: 1. 两项服务(容器):✅ 2. 两台服务器(高可用性):✅ 3. 单一配置来源:✅ 4. 标准配置格式:✅ 5. 网络:✅ 6. 储存:✅ 7. 依赖关系(什么服务与哪些数据库对应):✅ 8. 易于配置:✅ 9. 轻松取消配置:✅(也许是 Kubernetes **最**强大的部分) 等等,这样初看起来 Kubernetes 非常优雅、非常强大。 **没错。**你可以在 Kubernetes 中建模一整个微型 IT 世界。 ![Kubernetes business model](/data/attachment/album/201906/28/131546yihnvy0yv40xwzkw.png "Kubernetes business model") 所以,是的,就像开始使用巨型翻斗车(或任何专业设备)时,有一个学习曲线。使用 Kubernetes 还有一个学习曲线,但它值得,因为你可以用一个工具解决这么多问题。如果你对学习曲线感到担忧,请仔细考虑 IT 基础架构中的所有底层网络、存储和安全问题,并设想一下今天的解决方案 —— 这并不容易。特别是当你越来越快地引入越来越多的服务时。速度是当今的目标,因此要特别考虑配置和取消配置问题。 但是,不要混淆了建造或配置 Kubernetes 的学习曲线(为你的翻斗车挑选合适的挡泥板可能很难,LOL)和使用它的学习曲线。学习用如此多的不同层次(容器引擎、日志记录、监控、服务网格、存储、网络)的技术来建立自己的 Kubernetes 有很多不同的选择,还有每六个月维护每个组件的更新选择,这可能不值得投资 —— 但学会使用它绝对是值得的。 我每天都与 Kubernetes 和容器泡在一起,即使这样我都很难跟踪几乎每天都在宣布的所有重大新项目。 但是,每一天我都对使用单一工具来模拟整个 IT 多个方面的运营优势感到兴奋。此外,记住 Kubernetes 已经成熟了很多,并将继续发展下去。与之前的 Linux 和 OpenStack 一样,每一层的接口和事实上的项目都将成熟并变得更容易选择。 在本系列的第三篇文章中,我将深入挖掘你在驾驶 Kubernetes “卡车”之前需要了解的内容。 --- via: <https://opensource.com/article/19/6/kubernetes-learning-curve> 作者:[Scott McCarty](https://opensource.com/users/fatherlinux/users/fatherlinux) 选题:[lujun9972](https://github.com/lujun9972) 译者:[wxy](https://github.com/wxy) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
In * Kubernetes is a dump truck*, I talked about how a tool can be elegant for the problem it was designed to solve—once you learn how to use it. In part 2 of this series, I'm going a little deeper into the Kubernetes' learning curve. The journey to [Kubernetes](https://kubernetes.io/) often starts with running one container on one host. You quickly discover how easy it is to run new versions of software, how easy it is to share that software with others, and how easy it is for those users to run it the way you intended. But then you need - Two containers - Two hosts It's easy to fire up one web server on port 80 with a container, but what happens when you need to fire up a second container on port 80? What happens when you are building a production environment and you need the containerized web server to fail over to a second host? The short answer, in either case, is you have to move into container orchestration. Inevitably, when you start to handle the two containers or two hosts problem, you'll introduce complexity and, hence, a learning curve. The two services (a more generalized version of a container) / two hosts problem has been around for a long time and has always introduced complexity. Historically, this would have involved load balancers, clustering software, and even clustered file systems. Configuration logic for every service is embedded in every system (load balancers, cluster software, and file systems). Running 60 or 70 services, clustered, behind load balancers is complex. Adding another new service is also complex. Worse, decommissioning a service is a nightmare. Thinking back on my days of troubleshooting production MySQL and Apache servers with logic embedded in three, four, or five different places, all in different formats, still makes my head hurt. Kubernetes elegantly solves all these problems with one piece of software: - Two services (containers): Check - Two servers (high availability): Check - Single source of configuration: Check - Standard configuration format: Check - Networking: Check - Storage: Check - Dependencies (what services talk to what databases): Check - Easy provisioning: Check - Easy de-provisioning: Check (perhaps Kubernetes' *most*powerful piece) Wait, it's starting to look like Kubernetes is pretty elegant and pretty powerful. *It is.* You can model an entire miniature IT universe in Kubernetes. ![Kubernetes business model Kubernetes business model](https://opensource.com/sites/default/files/uploads/developer_native_experience_-_mapped_to_traditional_1.png) So yes, there is a learning curve when starting to use a giant dump truck (or any professional equipment). There's also a learning curve to use Kubernetes, but it's worth it because you can solve so many problems with one tool. If you are apprehensive about the learning curve, think through all the underlying networking, storage, and security problems in IT infrastructure and envision their solutions today—they're not easier. Especially when you introduce more and more services, faster and faster. Velocity is the goal nowadays, so give special consideration to the provisioning and de-provisioning problem. But don't confuse the learning curve for building or equipping Kubernetes (picking the right mud flaps for your dump truck can be hard, LOL) with the learning curve for using it. Learning to build your own Kubernetes with so many different choices at so many different layers (container engine, logging, monitoring, service mesh, storage, networking), and then maintaining updated selections of each component every six months, might not be worth the investment—but learning to use it is absolutely worth it. I eat, sleep, and breathe Kubernetes and containers every day, and even I struggle to keep track of all the major new projects announced literally almost every day. But there isn't a day that I'm not excited about the operational benefits of having a single tool to model an entire IT miniverse. Also, remember Kubernetes has matured a ton and will continue to do so. Like Linux and OpenStack before it, the interfaces and de facto projects at each layer will mature and become easier to select. In the third article in this series, I'll dig into what you need to know before you drive your Kubernetes "truck." ## 2 Comments
11,027
三个在 Fedora 平台上撰写 Markdown 的软件
https://fedoramagazine.org/applications-for-writing-markdown/
2019-06-28T13:36:20
[ "Markdown" ]
https://linux.cn/article-11027-1.html
![](/data/attachment/album/201906/28/133627szbkhi85wkm83kw8.jpg) Markdown 是一种轻量级标记语言,可以在添加格式后以纯文本格式查看时依然保持可读性。Markdown(和 Markdown 衍生物)被广泛用作 GitHub 和 pagure 等服务上格式化文档的主要形式。根据其设计,可以在文本编辑器中轻松创建和编辑 Markdown,但是,有许多编辑器可以提供 Markdown 标记的格式化预览,或提供 Markdown 语法高亮显示。 本文介绍了针对 Fedora 平台的 3 个桌面应用程序,以帮助编辑 Markdown。 ### UberWriter [UberWriter](https://uberwriter.github.io/uberwriter/#1) 是一个小巧的 Markdown 编辑器和预览器,允许你以文本方式编辑,并预览渲染的文档。 ![](/data/attachment/album/201906/28/133639nmmslcj9m94umvfo.png) 该编辑器本身具有内置的内联预览,因此标记为粗体的文本以粗体显示。编辑器还提供图像、公式、脚注等标记的内联预览。按住 `Ctrl` 键单击其中的一个标记可以即时预览要显示的元素。 除了编辑器功能外,UberWriter 还具有全屏模式和聚焦模式,有助于最大限度地减少干扰。焦点模式将以灰色显示除当前段落以外的所有内容,以帮助你专注于文档中当前元素。 从第三方 Flathub 存储库安装 UberWriter 到 Fedora 平台。在将系统[设置为从 Flathub 安装](https://fedoramagazine.org/install-flathub-apps-fedora/)后,可以直接从 Software 应用程序中安装它。 ### Marker Marker 是一个 Markdown 编辑器,它提供了一个简单的文本编辑器来编写 Markdown,并提供渲染文档的实时预览。界面采用分屏设计,左侧为编辑器,右侧为实时预览。 ![](/data/attachment/album/201906/28/133725a1zcg2p844le31ll.png) 此外,Marker 允许你以各种格式导出文档,包括 HTML、PDF 和开放文档格式(ODF)。 从第三方 Flathub 存储库安装 Marker 到 Fedora 平台。在将系统[设置为从 Flathub 安装](https://fedoramagazine.org/install-flathub-apps-fedora/)后,可以直接从 Software 应用程序中安装它。 ### Ghostwriter 以前的编辑更专注于最小的用户体验,Ghostwriter 提供了更多的功能和选项。Ghostwriter 提供了一个文本编辑器,当你以 Markdown 格式书写时,编辑器将 Markdown 部分样式化。粗体标记文本显示为粗体,标题标记显示为较大的字体,以帮助编写 Markdown 标记。 ![](/data/attachment/album/201906/28/133837py5jhtigbtysb0n5.png) 它还提供了一个分屏,包含渲染文档的实时更新预览。 ![](/data/attachment/album/201906/28/133939z10csrrfckfr25f1.png) Ghostwriter 还包括一系列其他功能,包括能够选择渲染预览的 Markdown 风格,以及用于渲染预览的样式表。 此外,它还提供了一个格式菜单(和键盘快捷键)来插入一些频繁的 Markdown 标记,如粗体、项目符号和斜体。 从第三方 Flathub 存储库安装 Ghostwriter 到 Fedora 平台。在将系统[设置为从 Flathub 安装](https://fedoramagazine.org/install-flathub-apps-fedora/)后,可以直接从 Software 应用程序中安装它。 --- via: <https://fedoramagazine.org/applications-for-writing-markdown/> 作者:[Ryan Lerch](https://fedoramagazine.org/author/ryanlerch/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[murphyzhao](https://github.com/murphyzhao) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
Markdown is a lightweight markup language that is useful for adding formatting while still maintaining readability when viewing as plain text. Markdown (and Markdown derivatives) are used extensively as the primary form of markup of documents on services like GitHub and pagure. By design, Markdown is easily created and edited in a text editor, however, there are a multitude of editors available that provide a formatted preview of Markdown markup, and / or provide a text editor that highlights the markdown syntax. This article covers 3 desktop applications for Fedora Workstation that help out when editing Markdown. ### UberWriter [UberWriter](https://uberwriter.github.io/uberwriter/#1) is a minimal Markdown editor and previewer that allows you to edit in text, and preview the rendered document. ![](https://fedoramagazine.org/wp-content/uploads/2019/06/uberwriter-editor-1.png) The editor itself has inline previews built in, so text marked up as bold is displayed bold. The editor also provides inline previews for images, formulas, footnotes, and more. Ctrl-clicking one of these items in the markup provides an instant preview of that element to appear. In addition to the editor features, UberWriter also features a full screen mode and a focus mode to help minimise distractions. Focus mode greys out all but the current paragraph to help you focus on that element in your document Install UberWriter on Fedora from the 3rd-party Flathub repositories. It can be installed directly from the Software application after [setting up your system to install from Flathub](https://fedoramagazine.org/install-flathub-apps-fedora/) ### Marker Marker is a Markdown editor that provides a simple text editor to write Markdown in, and provides a live preview of the rendered document. The interface is designed with a split screen layout with the editor on the left, and the live preview on the right. ![](https://fedoramagazine.org/wp-content/uploads/2019/06/marker-screenshot-1024x500.png) Additionally, Marker allows you to export you document in a range of different formats, including HTML, PDF, and the Open Document Format (ODF). Install Marker on Fedora from the 3rd-party Flathub repositories. It can be installed directly from the Software application after [setting up your system to install from Flathub](https://fedoramagazine.org/install-flathub-apps-fedora/) ### Ghostwriter Where the previous editors are more focussed on a minimal user experice, Ghostwriter provides many more features and options to play with. Ghostwriter provides a text editor that is partially styled as you write in Markdown format. Bold text is bold, and headings are in a larger font to assist in writing the markup. ![](https://fedoramagazine.org/wp-content/uploads/2019/06/ghostwriter-1024x732.png) It also provides a split screen with a live updating preview of the rendered document. ![](https://fedoramagazine.org/wp-content/uploads/2019/06/ghostwriter2-1024x566.png) Ghostwriter also includes a range of other features, including the ability to choose the Markdown flavour that the preview is rendered in, as well as the stylesheet used to render the preview too. Additionally, it provides a format menu (and keyboard shortcuts) to insert some of the frequent markdown ‘tags’ like bold, bullets, and italics. Install Ghostwriter on Fedora from the 3rd-party Flathub repositories. It can be installed directly from the Software application after [setting up your system to install from Flathub](https://fedoramagazine.org/install-flathub-apps-fedora/) ## BlueEnglishMailbox Vim. ## rugk There is also “Mark Text”: https://flathub.org/apps/details/com.github.marktext.marktext ## mark mcintyre I like Ghostwriter and another one called Markdown (search flathub). The latter is rather slick as it converts the formatting in place instead of the need for a separate preview pane. It’s still young, but it is a good concept and worth trying. ## Bruce Thomas HI, great list, BUT … you missed a trick 😀 https://typora.io/ Inline markdown. Enjoy. ## bytesamurai Seriously?! What about the good stuff like Mark Text: https://marktext.app/ or my personal favorite Typora: https://typora.io/ Please -> Update the post, these two should be worthy to look it up ## Robin Hindryckx There are also a multitude of plug-ins for known code-based text-editors. i personally use this markdown plugin for visual code studio. ## Colin Jaffe Which plugin? ## Alex P Ghostwriter is also available as a regular package. ## uriesk Marker is also available from copr: sudo dnf copr enable atim/marker -y && sudo dnf install marker -y ## Elizeu Santos Good job. I currently use Typora. It is a great md file editor. Anyway, VScode has great plugins for editing and viewing md files. ## GroovieMan I really do not like MS applications but VScode with the plugin is nice and quite fast. Before i was working with Remarkable (https://remarkableapp.github.io/). ## Anil I use Joplin after trying multiple markdown editors. It is feature rich and has a nice intuitive interface. Available in Fedora through copr. https://github.com/laurent22/joplin Fedora: https://copr.fedorainfracloud.org/coprs/taw/joplin/ Thanks Anil ## Viktor Maslov I like Uberwriter! ## Dick I like to use https://github.com/joeyespo/grip which uses the GitHub API and has auto refresh in a browser window so I can use my favorite editor with live updates. ## Ph0zzy VIM? ## Yury Hi there! I believe you should mention Joplin (https://joplinapp.org/), it’s open source and has great speed and ability to sync md texts across devices. ## Doc remarkable available in the repo ## toto https://boostnote.io It’s GPL, multi-platform , has local storage in clear, no DB, no cloud. It also has nice feature like copy/paste from web, support for the graphing langage (mermaid, …) And most importantly search feature for free! Couldn’t find this anywhere else. ## Kevin I made a plugin for neovim that will do live previewing of markdown files in the viewer of your choice, as well as LaTeX files and anything else you configure: https://bitbucket.org/frabjous/knap/ ## Ryan McAlister Unotes vscode extension gives a simple markdown WYSIWYG. https://marketplace.visualstudio.com/items?itemName=ryanmcalister.Unotes ## giuseppe when we talk about text editor, beside vim, I think sublime text outperforms others. It containts also plugin for markdown ## Schmidt Atom is my favourite. ## Bruno By the way searching on FlatHub is not that great.I hope thy could implement faceted search. Like Editor / Markdown + AsciiDoctor ## Bruno One solution that has not been mentioned is https://allmark.io/ – Standalone markdown web server – Open Source – Linux, Mac OS and Windows – written in go work with all editors … ## Ricky B Geany w/ Markdown plugin works for me 🙂 ## Neville A. Cross Some time ago I searched for a good markdown editor, at least good for me. At that time I settle for retext which was simple an it was on fedora repos. I did try to do a “dnf search markdown” and found the following: retext notes-up ghostwriter There are times when flatpack is better, but probably it is good to mention that ghostwriter is in the official repos. I will give it a try. ## Vasiliy I want to ask the author: Why you recommend use third-party repo from unknown maintainer for install software instead Fedora’s main repo? ## luis LOVING typora. please update the list! ## xenlo Typo Detected: «Markdown (and Markdown derivatives) are used extensively as the priumaryform of markup of documents on services like GitHub and pagure. »priumary —> primary? ## Paul W. Frields @xenlo: Thanks, fixed! ## Luca ReText
11,028
5 个最具生产力的 Linux 发行版
https://www.linux.com/blog/learn/2019/1/top-5-linux-distributions-productivity
2019-06-28T17:15:00
[ "发行版" ]
https://linux.cn/article-11028-1.html
> > 如果你正在寻找一个适合开发工作的完美环境,我敢说你找不到比 Pop!\_OS 更好的选择。 > > > ![](/data/attachment/album/201906/28/171547l3irv14c5srasrlh.jpg) 必须承认的是,这样的一个热门话题其实很难被总结的话题。为什么呢?首先,Linux 在就是一种有生产力的操作系统。由于它极强的可靠性和稳定的平台,使得完成工作变得很容易。其次为了衡量工作的效率,你需要考虑到哪项工作需要得到生产力方面的助推。是日常办公?开发类工作?学校事务?数据挖掘?或者是人力资源?你可以看到这个问题有多复杂。 然而,这并不意味着某些发行版无法更好地配置将底层操作系统呈现为一个有效的平台来完成工作。恰恰相反,许多发行版在偏离生产力这条道路上越走越远,所以你不会意识到你自己处在工作的窘境中,而是继续挖掘自己的潜力在工期结束之前拼命赶上进度。这些 Linux 发行版可以帮助你化繁为简,因此或许可以减少你工作流程中的痛点。 让我们来看一下这些发行版并为你找出适合你的最佳选择。为了更具条理,我按照生产力诉求把它们分成了几类。这项任务本身也是一种挑战,因为每个人在生产力提升上的需要是千差万别的。然而,我所关注的是下列的几项: * 常规:适于那些只需要有效地完成多项工作的人。 * 设计:适于那些从事设计创造和图像处理的人。 * 开发:适于那些使用 Linux 桌面发行版来进行编程工作的人。 * 运维:适于那些需要一个发行版来促进其执行系统管理任务的人。 * 教育:适于那些需要桌面发行版可以助力他们在教育领域更高效的人。 诚然,有很多很多类别的发行版可供挑选,其中的很多可能用起来十分得心应手,但这五种或许是你最为需要的。 ### 常规 对于常规的生产力诉求来说,你不会找到比 [Ubuntu](https://www.ubuntu.com/) 更为高效的了。在这个类别中首推 Ubuntu 最主要的原因是因为它实现了桌面操作系统、软件、服务的无缝集成。你可能会问为什么我不选择同类别的 Linux Mint 呢?因为 Ubuntu 现在默认的的桌面环境为 GNOME 桌面,而它拥有 GNOME 许多扩展程序的优势的加成(图 1)。 ![GNOME Clipboard](/data/attachment/album/201906/28/171547mzyhh4fyz34y34yf.jpg "GNOME Clipboard") *图 1:运行中的 GNOME 桌面的剪切板管理工具。* 这些扩展程序在提升生产力方面做了很多努力(所以 Ubuntu 比 Linux Mint 获得了更多的认可)。但是 Ubuntu 不仅仅是装了一个普通的 GNOME 桌面。事实上,他们致力于将它改进的更为轻量化、更为高效、以及用户友好度更高、开箱即用。总而言之,由于 Ubuntu 正确的融合了多种特性,开箱即用,完善的软件支持(仅对工作方面而言),这些特性使它几乎成为了生产力领域最为完美的一个平台。 不管你是要写一篇文档,制作一张电子表格,写一个新的软件,开发公司的网站,设计商用的图形,管理一个服务器或是网络,抑或是在你的公司内从事人力资源管理工作,Ubuntu 都可以满足你的需求。Ubuntu 桌面发行版也并不要求你耗费很大的精力才能开始开始开展工作……它直接就能使用(并且工作的十分优秀)。最后,得益于它是基于 Debian 的,使得在 Ubuntu 上安装第三方的软件十分简便。 很难不支持这一发行版独占生产力发行版列表的鳌头,尽管 Ubuntu 几乎已经成为几乎所有“某某类顶级发行版”列表的榜首。 ### 设计 如果你正在寻求提升你的平面设计效率,你不能错过 [Fedora 设计套件](https://labs.fedoraproject.org/en/design-suite/)。这一 Fedora 衍生版是由负责 Fedora 相关的艺术作品的团队亲自操刀制作的。虽然其默认选择的应用程序并不是一个庞大的工具集合,但它所包含的工具都是创建和处理图像专用的。 有了 GIMP、Inkscape、Darktable、Krita、Entangle、Blender、Pitivi、Scribus 等应用程序(图 2),你可以找到完成图像编辑工作所需要的一切。但是 Fedora 设计套件并不仅限于此。这个桌面平台还包括一堆教程,涵盖了许多已安装的应用程序。对于任何想要尽可能提高效率的人来说,这将是一些非常有用的信息。不过,我要说的是,GNOME 收藏夹中的教程并没有超乎[此页中](https://fedoraproject.org/wiki/Design_Suite/Tutorials)链接的内容。 ![Fedora Design Suite Favorites](/data/attachment/album/201906/28/171548ouyiuwgflyeuflzc.jpg "Fedora Design Suite Favorites") *图 2:Fedora 设计套件收藏夹菜单包含了许多工具,可以让你用于图形设计。* 那些使用数码相机的用户肯定会喜欢 Entangle 应用程序,它可以让你在电脑上控制单反相机。 ### 开发 几乎所有的 Linux 发行版都是程序员的绝佳平台。然而,有一种特定的发行版脱颖而出,并超越了其他发行版,它将是你见过的用于编程类最有效率的工具之一。这个操作系统来自 [System76](https://system76.com/)(LCTT 译注:一家美国的计算机制造商),名为 [Pop!\_OS](https://system76.com/pop)。Pop!\_OS 是专门为创作者定制的,但不是针对艺术类。相反,Pop!\_OS 面向专门从事开发、编程和软件制作的程序员。如果你需要一个既能完美的胜任开发工作又包含符合使用习惯的桌面操作系统的开发环境,Pop!\_OS 将会是你的不二选择。(图 3) 可能会让你感到惊讶(考虑到这个操作系统是多么“年轻”)的是 Pop!\_OS 也是你将使用的基于 GNOME 平台的最稳定系统的之一。这意味着 Pop!\_OS 不只是为创作者和创客准备的,也是为任何想要一个可靠的操作系统的人准备的。你可以下载针对你的硬件的专门 ISO 文件,这一点是许多用户十分欣赏的。如果你有英特尔硬件,[下载](https://system76.com/pop) Intel 或 AMD 的版本。如果你的显卡是 NVIDIA,请下载该特定版本。不管怎样,你肯定会得到针对不同平台进行特殊定制的稳定版本。 ![Pop!_OS](/data/attachment/album/201906/28/171548ja6g64p6a6jl10kn.jpg "Pop!_OS") *图 3:装有 GNOME 桌面的 Pop!\_OS 一览。* 有趣的是,在 Pop!\_OS 中,你不会找到太多预装的开发工具。你也不会找到 IDE 或许多其他开发工具。但是,你可以在 Pop 商店中中找到所需的所有开发工具。 ### 运维 如果你正在寻找适合系统管理的最具生产力的发行版,[Debian](https://www.debian.org/) 将会是你的不二之选。为什么这么说呢?因为 Debian 不仅仅拥有无与伦比的可靠性,它也是众多能从苦海中将你解救出来的最好的一个发行版。Debian 是易用性和无限可能性的完美结合。最重要的是,因为它是许多其他发行版的基础,所以可以打赌,如果你需要一个任务的管理工具,那么它一定支持 Debian 系统。当然,我们讨论的是一般的系统管理任务,这意味着大多数时候你需要使用终端窗口 SSH 连接到服务器(图 4),或者在浏览器上使用网络上基于 web 的 GUI 工具。既然如此为什么还要使用一个增加复杂性的桌面呢(比如 Fedora 中的 SELinux 或 openSUSE 中的 YaST)呢?所以,应选择更为简洁易用的那一种。 ![Debian](/data/attachment/album/201906/28/171549ziocc9kckk57ikk3.jpg "Debian") *图 4:在 Debian 系统上通过 SSH 连接到远程服务器。* 你可以选择你想要的不同的桌面(包括 GNOME、Xfce、KDE、Cinnamon、MATE、LXDE),可以确保你所使用的桌面外观最适合你的工作习惯。 ### 教育 如果你是一名老师或学生,抑或是其他从事与教育相关工作的人士,你需要适当的工具来提高生产力。之前,有 Edubuntu 这样的版本。这一版本位列教育类相关发行版排名的前列。然而,自从 Ubuntu 14.04 版之后这一发行版就再也没有更新。还好,现在有一款基于 openSUSE 的新的以教育为基础的发行版有望夺摘得桂冠。这一改版叫做 [openSUSE:Education-Li-f-e](https://en.opensuse.org/openSUSE:Education-Li-f-e)(Li-f-e:Linux For Education - 图 5),它基于 openSUSE Leap 42.1 (所以它可能稍微有一点过时)。 openSUSE:Education-Li-f-e 包含了以下工具: * Brain Workshop(大脑工坊):一种基于 dual n-back 模式的大脑训练软件(LCTT 译注:dual n-back 训练是一种科学的智力训练方法,可以改善人的工作记忆和流体智力) * GCompris:一种针对青少年的教育软件包 * gElemental:一款元素周期表查看工具 * iGNUit:一款通用的记忆卡片工具 * Little Wizard:基于 Pascal 语言的少儿编程开发环境 * Stellarium:天文模拟器 * TuxMath:数学入门游戏 * TuxPaint:一款少儿绘画软件 * TuxType:一款为少儿准备的打字入门软件 * wxMaxima:一个跨平台的计算机代数系统 * Inkscape:矢量图形编辑软件 * GIMP:图像处理软件(LCTT 译注:被誉为 Linux 上的 PhotoShop) * Pencil:GUI 模型制作工具 * Hugin:全景照片拼接及 HDR 效果混合软件 ![Education](/data/attachment/album/201906/28/171550jzat0q0xu6chthuh.jpg "Education") *图 5:openSUSE:Education-Li-f-e 发行版拥有大量的工具可以帮你在学校中变得更为高效。* 同时还集成在 openSUSE:Education-Li-f-e 中的还有 [KIWI-LTSP Server](https://en.opensuse.org/Portal:KIWI-LTSP) 。KIWI-LTSP 服务器是一个灵活的、经济高效的解决方案,旨在使全世界的学校、企业和组织能够轻松地安装和部署桌面工作站。虽然这可能不会直接帮助学生变得更具生产力,但它肯定会使教育机构在部署供学生使用的桌面时更有效率。有关配置 KIWI-LTSP 的更多信息,请查看 openSUSE [KIWI-LTSP 快速入门指南](https://en.opensuse.org/SDB:KIWI-LTSP_quick_start)。 --- via: <https://www.linux.com/blog/learn/2019/1/top-5-linux-distributions-productivity> 作者:[Jack Wallen](https://www.linux.com/users/jlwallen) 选题:[lujun9972](https://github.com/lujun9972) 译者:[qfzy1233](https://github.com/qfzy1233) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
301
Moved Permanently
null
11,031
将 i3 与多个显示器配合使用
https://fedoramagazine.org/using-i3-with-multiple-monitors/
2019-06-29T14:05:52
[ "i3", "显示器" ]
https://linux.cn/article-11031-1.html
![](/data/attachment/album/201906/29/140556o3o9o3j77ju7j3m9.jpg) 你在 Linux 工作站上使用多个显示器吗?一次看到很多东西可能是有益的。但在我们的工作中通常有比实际显示器更多的窗口 —— 这是一件好事,因为一次看到太多东西可能会分散注意力。因此能够切换我们在单个显示器上看到的内容似乎很重要。 让我们来看看 i3,它是一个流行的平铺窗口管理器,可以与多个显示器配合使用。并且有许多其他窗口管理器没有的便利功能,它能够独立地在各个显示器上切换工作区。 ### 快速介绍 i3 大约三年前,[Fedora Magazine 已经写了一篇关于 i3 的文章](https://fedoramagazine.org/getting-started-i3-window-manager/)。这是有史以来最受欢迎的文章之一!虽然情况并非总是如此,但 i3 非常稳定,而且那篇文章如今也很准确。所以,这次不会重复太多内容,本篇只涵盖了让 i3 启动和运行的极少内容,如果你是 i3 的新手,想要了解更多基础知识的话,欢迎你继续阅读。 要在系统上安装 i3,请运行以下命令: ``` $ sudo dnf install i3 ``` 完成后,注销,然后在登录屏幕上选择 i3 作为窗口管理器,然后重新登录。 当你第一次运行 i3 时,系统会询问你是否要继续进行自动配置 —— 在此处回答是。之后,你将被要求选择 “mod 键”。如果你不确定,只需接受默认值,即将 Windows/Super 键设置为 mod 键。你将主要使用此键用于窗口管理器中的快捷方式。 此时,你应该在底部看到一个小条和一个空白屏幕。我们来看看一些基本的快捷方式。 打开终端: ``` $mod + enter ``` 切换到第二个工作区: ``` $mod + 2 ``` 通过以下两个步骤打开 firefox,首先: ``` $mod + d ``` 然后输入 “firefox” 并按回车键。 将其移动到第一个工作区: ``` $mod + shift + 1 ``` 切换到第一个工作区: ``` $mod + 1 ``` 此时,你将并排看到一个终端和一个 firefox 窗口。要关闭窗口,请按: ``` $mod + shift + q ``` 还有更多的快捷方式,但这些足够让你开始使用 i3。 要退出 i3(并退出登录)按: ``` $mod + shift + e ``` 然后在右上角使用鼠标确认。 ### 同时让多个屏幕工作 现在我们已经启动并运行了 i3,让我们把所有这些屏幕都用到! 为此,我们需要使用命令行,因为 i3 非常轻量级,并且没有 GUI 来管理其他屏幕。如果这听起来很难也不用担心,它实际上非常简单! 我们将使用的命令称为 `xrandr`。如果你的系统上没有 `xrandr`,请运行以下命令安装: ``` $ sudo dnf install xrandr ``` 当它安装完毕后,让我们继续运行它: ``` $ xrandr ``` 输出列出了所有可用输出设备,并通过显示支持的分辨率指示哪些输出连接了屏幕(通过电缆连接的显示器)。好消息是,我们不需要关心使它们工作的分辨率。 这个例子显示了笔记本电脑的主屏幕(名为 eDP1),以及连接到 HDMI-2 输出的第二个显示器,它位于笔记本电脑的右侧。要打开它,请运行以下命令: ``` $ xrandr --output HDMI-2 --auto --right-of eDP1 ``` 就是这样!你的屏幕现已激活。 ![第二个屏幕激活。截屏上显示命令与文章中略有不同,它设置了更小的分辨率以使截屏适合阅读](/data/attachment/album/201906/29/140557ys7zigxtu5l2uhs3.png) ### 在多个屏幕上管理工作区 在多个屏幕上切换工作区和创建新工作区非常类似于只有一个屏幕的情况。新工作区会在当前处于活动状态(鼠标光标所在位置)的屏幕上创建。 因此,要切换到特定工作区(或在不存在的情况下创建新工作区),请按: ``` $mod + NUMBER ``` 你可以独立切换各个显示器上的工作区! ![工作空间 2 在左侧屏幕,工作空间 4 在右侧屏幕](/data/attachment/album/201906/29/140558u1plf9f1h3kc7997.png) ![左侧屏幕切换为工作空间 3,右侧屏幕仍为工作空间 4](/data/attachment/album/201906/29/140559rzwppss8lpqwqkzb.png) ![右侧屏幕切换为工作空间 5,左侧屏幕仍为空间空间 3](/data/attachment/album/201906/29/140600wg61ndskgzzxvxgq.png) ### 在显示器之间移动工作区 我们可以通过以下命令将窗口移动到不同的工作区: ``` $mod + shift + NUMBER ``` 我们也可以将工作区移动到不同的屏幕。但是,此操作没有默认快捷方式,因此我们必须先创建它。 要创建自定义快捷方式,你需要在你选择的文本编辑器中打开配置文件(本文使用 `vim`): ``` $ vim ~/.config/i3/config ``` 并将以下行添加到配置文件的最底部: ``` # Moving workspaces between screens bindsym $mod+p move workspace to output right ``` 保存、关闭并重新加载以使配置生效,按下: ``` $mod + shift + r ``` 现在你可以将活跃的工作区移动到第二个显示器: ``` $mod + p ``` ![打开火狐浏览器的工作空间 2 在左侧](/data/attachment/album/201906/29/140600vd0mg6gl8m646fz6.png) ![打开火狐浏览器的工作空间 2 移动到第二个屏幕](/data/attachment/album/201906/29/140601f0imk7smse5zemlu.png) 就是这些了!享受你的新多显示器体验,并了解更多 i3,欢迎阅读 Fedora Magazine 上之前关于 i3 的文章,或者查看官方 i3 文档。 --- via: <https://fedoramagazine.org/using-i3-with-multiple-monitors/> 作者:[Adam Šamalík](https://fedoramagazine.org/author/asamalik/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
Are you using multiple monitors with your Linux workstation? Seeing many things at once might be beneficial. But there are often much more windows in our workflows than physical monitors — and that’s a good thing, because seeing too many things at once might be distracting. So being able to switch what we see on individual monitors seems crucial. Let’s talk about i3 — a popular tiling window manager that works great with multiple monitors. And there is one handy feature that many other window managers don’t have — the ability to switch workspaces on individual monitors independently. ## Quick introduction to i3 The [Fedora Magazine has already covered i3](https://fedoramagazine.org/getting-started-i3-window-manager/) about three years ago. And it was one of the most popular articles ever published! Even though that’s not always the case, i3 is pretty stable and that article is still very accurate today. So — not to repeat ourselves too much — this article only covers the very minimum to get i3 up and running, and you’re welcome to go ahead and read it if you’re new to i3 and want to learn more about the basics. To install i3 on your system, run the following command: $ sudo dnf install i3 When that’s done, log out, and on the log in screen choose i3 as your window manager and log back in again. When you run i3 for the first time, you’ll be asked if you wish to proceed with automatic configuration — answer yes here. After that, you’ll be asked to choose a “mod key”. If you’re not sure here, just accept the default which sets you Windows/Super key as the mod key. You’ll use this key for mostly all the shortcuts within the window manager. At this point, you should see a little bar at the bottom and an empty screen. Let’s have a look at some of the basic shortcuts. Open a terminal using: $mod + enter Switch to a second workspace using: $mod + 2 Open firefox in two steps, first by: $mod + d … and then by typing “firefox” and pressing enter. Move it to the first workspace by: $mod + shift + 1 … and switch to the first workspace by: $mod + 1 At this point, you’ll see a terminal and a firefox window side by side. To close a window, press: $mod + shift + q There are more shortcuts, but these should give you the minimum to get started with i3. Ah! And to exit i3 (to log out) press: $mod + shift + e … and then confirm using your mouse at the top-right corner. ## Getting multiple screens to work Now that we have i3 up and running, let’s put all those screens to work! To do that, we’ll need to use the command line as i3 is very lightweight and doesn’t have gui to manage additional screens. But don’t worry if that sounds difficult — it’s actually quite straightforward! The command we’ll use is called xrandr. If you don’t have xrandr on your system, install it by running: $ sudo dnf install xrandr When that’s installed, let’s just go ahead and run it: $ xrandr The output lists all the available outputs, and also indicated which have a screen attached to them (a monitor connected with a cable) by showing supported resolutions. Good news is that we don’t need to really care about the specific resolutions to make the them work. This specific example shows a primary screen of a laptop (named eDP1), and a second monitor connected to the HDMI-2 output, physically positioned right of the laptop. To turn it on, run the following command: $ xrandr --output HDMI-2 --auto --right-of eDP1 And that’s it! Your screen is now active. ![](https://fedoramagazine.org/wp-content/uploads/2019/06/0-1-1024x384.png) ## Managing workspaces on multiple screens Switching workspaces and creating new ones on multiple screens is very similar to having just one screen. New workspaces get created on the screen that’s currently active — the one that has your mouse cursor on it. So, to switch to a specific workspace (or to create a new one in case it doesn’t exist), press: $mod + NUMBER And you can switch workspaces on individual monitors independently! ![](https://fedoramagazine.org/wp-content/uploads/2019/06/1-1-1024x384.png) ![](https://fedoramagazine.org/wp-content/uploads/2019/06/1-2-1024x384.png) ![](https://fedoramagazine.org/wp-content/uploads/2019/06/1-3-1024x384.png) ## Moving workspaces between monitors The same way we can move windows to different workspaces by the following command: $mod + shift + NUMBER … we can move workspaces to different screens as well. However, there is no default shortcut for this action — so we have to create it first. To create a custom shortcut, you’ll need to open the configuration file in a text editor of your choice (this article uses *vim*): $ vim ~/.config/i3/config And add the following lines to the very bottom of the configuration file: # Moving workspaces between screens bindsym $mod+p move workspace to output right Save, close, and to reload and apply the configuration, press: $mod + shift + r Now you’ll be able to move your active workspace to the second monitor by: $mod + p ![](https://fedoramagazine.org/wp-content/uploads/2019/06/2-1-1024x384.png) ![](https://fedoramagazine.org/wp-content/uploads/2019/06/2-2-1024x384.png) And that’s it! Enjoy your new multi-monitor experience, and to learn more about i3, you’re welcome to read the previous article about i3 on the Fedora Magazine, or consult the official i3 documentation. ## Kaspers Nice guide your wrote here. Hopefully it’ll inspire people to make use of these tiling window managers. Have some experience with i3 myself, absolutely liked it. Moved a bit later to dwm. ## Ph0zzy Do you know how is goint to work with sway? ## oyviaase Sway manages the monitors itself so you need to specify your monitor layout in your Sway configuration file. An example from the github wiki is this output HDMI1 pos 0 0 res 1920×1080 output eDP1 pos 1920 0 res 1600×900 https://github.com/swaywm/sway/wiki#multihead ## plaguedoctor Sway has multiscreen support built in. How to set it up and use it is nicely explained in sway manpages. 🙂 ## Curried Great guide! Any advice on dealing with multiple monitors and HiDPI? Resolution mismatch is ugly. I use mons (https://github.com/Ventto/mons) to manage my monitors on my i3/arch laptop. A bit easier than pure xrandr as it’s arguments are very common arrangements. But the most I do is mirror my laptop on external monitors to work around the hidpi issue. ## John sudo dnf install arandr then run arandr save the profile {it will generate a bash script which calls xrandr} That’s you GUI solution 🙂 ## Stephen Was going to chime in with this a same thing. arandr ++ 😀 ## Hiisi The original article 3 years ago made me switch to i3wm. I have discovered how to use multiple screen just a few days ago. I wish this article were published a week earlier 🙂 ## Shawn McCool I made a mode like the resize mode. It can move workspaces to different outputs. ## Yazan Al Monshed Great article !, Thank you ## LegacyHater Just use sway ???? ## Ryan Murphy multiple graphics cards with multiple monitors? I haven’t been able to get xinerama to work and the second gpu is the only one with dvi ## Thomas Does anyone have some hints on where to start when the above doesn’t work? I love i3, but using it on multiple monitors has not been a good transition. Everytime that I login to i3 I am greeted with nothing. No spinning cursor, my background colour is not loaded. I’ve used Arandr to setup a script to turn on the monitors and setup a keymapping to run it. On the first run it only enables one external monitor. The laptop and second monitor remain on the grey login screen background and don’t have the i3 toolbar along the bottom. Usually the second time I run the script it enables all three windows, but not always… I’m usually able to use the Arandr script I’ve setup to move all workspaces to just the laptop monitor when I need to undock, but the script to re-enable the external monitors fails more often than it works. So far i3 helps me work efficiently enough that it’s still better to reboot my laptop during re-docking events. However, it’s a significant pain point. Would greatly appreciate any nudges along the path to debugging. Unfortunately, I’m not sure where to even look for logs around this and google mostly returns articles at about this depth. ## Eduard Lucena It’s weird, the initial setup is not tied to i3 directly, at least not in Fedora, since any versiona you have installed comes either with SDDM, GDM or LightDM and they are the responsible to setup your login screen (and the monitors). Now, after that, when you log in into i3wm, then you have the setup that was made by the DM, and if you need to change it, you should go with the ways explained in the article. At least, it works that way for me. ## Raphael Groner Does it also work with Displaylink adapters? ## tarek nice guide and thank you for this article ## Leslie Satenstein Adam, It is a very good informative article. I am just beginning with I3, and ran into an issue. My terminals open with white background and pale colors for text. Do you know how to change the terminal background color? I am OK with navigating and creating keymappings. ## Paul Mellors Depends on the terminal you’re using, it’s generally in the terminal settings themselves nothing really to do with i3 ## Hiisi Since I have gnome installed on my system I simply changed default terminal to gnome-terminal in i3′ config: start a terminal bindsym $mod+Return exec gnome-terminal It has black background by default 🙂
11,033
25 岁的 FreeDOS:起源故事
https://opensource.com/article/19/6/freedos-anniversary
2019-06-29T15:48:35
[ "FreeDOS" ]
https://linux.cn/article-11033-1.html
> > 操作系统的历史是开发人员共同造物的开源软件模型的很好例子。 > > > ![](/data/attachment/album/201906/29/154802szbavz4a0fa8a27f.jpg) 6 月 29 日是 [FreeDOS](https://www.freedos.org/) 25 周年的日子。不管对于哪个开源软件项目来说,这都是一个重要的里程碑,我为过去这 ¼ 个世纪来我们在这方面所做的工作感到自豪。我也为我们如何构建 FreeDOS 感到自豪,因为它是开源软件模型如何工作的一个很好的例子。 在它的那个时代,MS-DOS 是一个功能强大的操作系统。自从我的父母用新的 IBM 机器取代了老化的 Apple II 计算机以来,我已经使用 DOS 多年了。MS-DOS 提供了一个灵活的命令行,我非常喜欢它,它可以方便地操作我的文件。多年来,我学会了如何在 C 中编写自己的实用程序,以进一步扩展其命令行功能。 大约在 1994 年,微软宣布其下一代的 Windows 将取消 MS-DOS。但我喜欢 DOS,即使我已经开始迁移到 Linux,我仍然会启动到 MS-DOS 来运行一些 Linux 尚未拥有的应用程序。 我想,如果我们想留下 DOS,我们需要自己编写一个。FreeDOS 就是这样诞生的。 1994 年 6 月 29 日,我向 Usenet 上的 comp.os.msdos.apps 新闻组发表了关于我的想法的一个小小公告: > > PD-DOS 项目公告: > > > 几个月前,我发布了有关启动公共域(PD)版本 DOS 的文章。当时对此的普遍支持很强烈,很多人都赞同:“开始编写吧!”所以,我… > > > 宣布开发 PD-DOS 的首次尝试。我写了一个“清单”来描述这样的一个项目的目标和工作大纲,以及一个“任务列表”,它准确地显示了需要编码开发的内容。我会在这里发布,然后讨论。 > > > 虽然我宣布该项目为 PD-DOS(“公共领域”的意思,缩写是为了模仿 IBM 的“PC-DOS”),但我们很快将名称改为 Free-DOS,再后来又改为 FreeDOS。 我马上开始开发它。首先,我分享了我编写的用于扩展 DOS 命令行功能的实用程序。它们中的许多程序都重现了 MS-DOS 功能,包括 `CLS`、`DATE`、`DEL`、`FIND`、`HELP` 和 `MORE`。有些是我从 Unix 借来的新功能,比如 `TEE` 和 `TRCH`(Unix 的 `tr` 的简单实现)。我贡献了十几个 FreeDOS 工具。 通过分享我的实用程序,我给了其他开发人员一个起点。通过在 [GNU 通用公共许可证](https://www.gnu.org/licenses/licenses.en.html)(GNU GPL)下共享我的源代码,我隐含地允许其他人添加新功能并修复错误。 看到 FreeDOS 开始成型的其他开发人员联系了我并希望提供帮助。Tim Norman 是第一个人,Tim 自愿编写命令行 shell(`COMMAND.COM`,后来命名为 `FreeCOM`)。其他人贡献了复制或扩展了 DOS 命令行的实用程序。 我们尽快发布了第一个 alpha 版本。在宣布了 FreeDOS 后不到三个月,我们就有了一个集合了我们所编写的功能的 Alpha 1 发行版。当我们发布 Alpha 5 时,FreeDOS 已经拥有了 60 多个实用程序。FreeDOS 包含了 MS-DOS 中从未想过的功能,包括通过 PPP 拨号驱动程序实现的互联网连接,以及使用主 VGA 监视器和辅助单色监视器的双显示器支持。 新的开发人员加入了该项目,我们很欢迎他们。到 1998 年 10 月,感谢 Pat Villani,FreeDOS 有了一个可以工作的内核。FreeDOS 还提供了许多新功能,不仅带来了与 MS-DOS 的同等性,而且超越了 MS-DOS,包括 ANSI 支持和类似 Unix lpr 的打印后台处理程序。 你可能熟悉其他的里程碑版本。我们继续向 1.0 版本迈进,终于在 2006 年 9 月发布了 FreeDOS 1.0,在 2012 年 1 月发布了 FreeDOS 1.1,在 2016 年 12 月发布了 FreeDOS 1.2。而 MS-DOS 很久以前就停止了开发,因此我们在 1.0 发布之后不需要经常更新了。 如今,FreeDOS 已经是一个非常现代的 DOS。我们已经超越了“经典 DOS”,现在 FreeDOS 拥有许多开发工具,如编译器、汇编器和调试器。除了普通的 DOS Edit 编辑器之外,我们还有许多编辑器,包括 Fed、Pico、TDE 以及 Emacs 和 Vi 的一个版本。FreeDOS 支持网络,甚至还提供简单的图形 Web 浏览器(Dillo)。我们有大量的新工具,包括许多可以让 Linux 用户感到熟悉的实用工具。 正因为开发人员的共同创造,FreeDOS 才走到如今。本着开源软件的精神,我们通过修复错误和添加新功能为彼此的工作做出了贡献。我们将用户视为共同开发者;我们总能找到方法来吸引贡献者,无论是编写代码还是编写文档。我们基于优点达成共识。如果这听起来很熟悉,那是因为这些是开源软件的核心价值:透明度、协作、尽早发布、经常发布、精英管理和社区。这就是[开源方式](https://opensource.com/open-source-way)! 我鼓励你下载 FreeDOS 1.2 并尝试一下。 ### 更多资源 * [FreeDOS 官方网站](https://www.freedos.org/) * [FreeDOS wiki](http://wiki.freedos.org/) * [下载 FreeDOS 1.2](https://www.freedos.org/download/) * [FreeDOS 的免费电子书](https://www.freedos.org/ebook/) * [FreeDOS 的简单介绍](/article-9983-1.html) * [FreeDOS 起源与革命](https://opensource.com/article/17/10/freedos) * [4 个 FreeDOS 的有趣事实](https://opensource.com/article/17/6/freedos-still-cool-today) * [如何使用 FreeDOS 升级你的系统 BIOS](https://opensource.com/article/17/6/upgrade-bios-freedos) * [庆祝 FreeDOS 24 岁生日:有用的命令速查表](https://opensource.com/article/18/6/freedos-commands-cheat-sheet) * [如何在 Linux 中运行 DOS 程序](/article-9014-1.html) * [让 DOS 活到现在并通过开源来起步](https://opensource.com/life/16/9/interview-jim-hall-freedos) * [在树莓派上运行 DOS](/article-9544-1.html) --- via: <https://opensource.com/article/19/6/freedos-anniversary> 作者:[Jim Hall](https://opensource.com/users/jim-hall) 选题:[lujun9972](https://github.com/lujun9972) 译者:[wxy](https://github.com/wxy) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
June 29 marks the 25th anniversary of [FreeDOS](https://www.freedos.org/). That's a major milestone for any open source software project, and I'm proud of the work that we've done on it over the past quarter century. I'm also proud of how we built FreeDOS because it is a great example of how the open source software model works. For its time, MS-DOS was a powerful operating system. I'd used DOS for years, ever since my parents replaced our aging Apple II computer with a newer IBM machine. MS-DOS provided a flexible command line, which I quite liked and that came in handy to manipulate my files. Over the years, I learned how to write my own utilities in C to expand its command-line capabilities even further. Around 1994, Microsoft announced that its next planned version of Windows would do away with MS-DOS. But I liked DOS. Even though I had started migrating to Linux, I still booted into MS-DOS to run applications that Linux didn't have yet. I figured that if we wanted to keep DOS, we would need to write our own. And that's how FreeDOS was born. On June 29, 1994, I made a small announcement about my idea to the comp.os.msdos.apps newsgroup on Usenet. ANNOUNCEMENT OF PD-DOS PROJECT: A few months ago, I posted articles relating to starting a public domain version of DOS. The general support for this at the time was strong, and many people agreed with the statement, "start writing!" So, I have…Announcing the first effort to produce a PD-DOS. I have written up a "manifest" describing the goals of such a project and an outline of the work, as well as a "task list" that shows exactly what needs to be written. I'll post those here, and let discussion follow. While I announced the project as PD-DOS (for "public domain," although the abbreviation was meant to mimic IBM's "PC-DOS"), we soon changed the name to Free-DOS and later FreeDOS. I started working on it right away. First, I shared the utilities I had written to expand the DOS command line. Many of them reproduced MS-DOS features, including CLS, DATE, DEL, FIND, HELP, and MORE. Some added new features to DOS that I borrowed from Unix, such as TEE and TRCH (a simple implementation of Unix's tr). I contributed over a dozen FreeDOS utilities By sharing my utilities, I gave other developers a starting point. And by sharing my source code under the [GNU General Public License](https://www.gnu.org/licenses/licenses.en.html) (GNU GPL), I implicitly allowed others to add new features and fix bugs. Other developers who saw FreeDOS taking shape contacted me and wanted to help. Tim Norman was one of the first; Tim volunteered to write a command shell (COMMAND.COM, later named FreeCOM). Others contributed utilities that replicated or expanded the DOS command line. We released our first alpha version as soon as possible. Less than three months after announcing FreeDOS, we had an Alpha 1 distribution that collected our utilities. By the time we released Alpha 5, FreeDOS boasted over 60 utilities. And FreeDOS included features never imagined in MS-DOS, including internet connectivity via a PPP dial-up driver and dual-monitor support using a primary VGA monitor and a secondary Hercules Mono monitor. New developers joined the project, and we welcomed them. By October 1998, FreeDOS had a working kernel, thanks to Pat Villani. FreeDOS also sported a host of new features that brought not just parity with MS-DOS but surpassed MS-DOS, including ANSI support and a print spooler that resembled Unix lpr. You may be familiar with other milestones. We crept our way towards the 1.0 label, finally releasing FreeDOS 1.0 in September 2006, FreeDOS 1.1 in January 2012, and FreeDOS 1.2 in December 2016. MS-DOS stopped being a moving target long ago, so we didn't need to update as frequently after the 1.0 release. Today, FreeDOS is a very modern DOS. We've moved beyond "classic DOS," and now FreeDOS features lots of development tools such as compilers, assemblers, and debuggers. We have lots of editors beyond the plain DOS Edit editor, including Fed, Pico, TDE, and versions of Emacs and Vi. FreeDOS supports networking and even provides a simple graphical web browser (Dillo). And we have tons of new utilities, including many that will make Linux users feel at home. FreeDOS got where it is because developers worked together to create something. In the spirit of open source software, we contributed to each other's work by fixing bugs and adding new features. We treated our users as co-developers; we always found ways to include people, whether they were writing code or writing documentation. And we made decisions through consensus based on merit. If that sounds familiar, it's because those are the core values of open source software: transparency, collaboration, release early and often, meritocracy, and community. That's the [open source way](https://opensource.com/open-source-way)! I encourage you to download FreeDOS 1.2 and give it a try. ## More resources [FreeDOS website](https://www.freedos.org/)[FreeDOS wiki](http://wiki.freedos.org/)[Download FreeDOS 1.2](https://www.freedos.org/download/)[Free ebooks about FreeDOS](https://www.freedos.org/ebook/)[A gentle introduction to FreeDOS](https://opensource.com/article/18/4/gentle-introduction-freedos)[The origin and evolution of FreeDOS](https://opensource.com/article/17/10/freedos)[4 cool facts you should know about FreeDOS](https://opensource.com/article/17/6/freedos-still-cool-today)[How to upgrade your system BIOS using FreeDOS](https://opensource.com/article/17/6/upgrade-bios-freedos)[Celebrating 24 years of FreeDOS: Useful commands cheat sheet](https://opensource.com/article/18/6/freedos-commands-cheat-sheet)[How to run DOS programs in Linux](https://opensource.com/article/17/10/run-dos-applications-linux)[Keeping DOS alive and kicking with open source](https://opensource.com/life/16/9/interview-jim-hall-freedos)[Running DOS on the Raspberry Pi](https://opensource.com/article/18/3/can-you-run-dos-raspberry-pi) ## Comments are closed.
11,034
树莓派 4 来袭!
https://opensource.com/article/19/6/raspberry-pi-4
2019-06-29T16:19:30
[ "树莓派" ]
https://linux.cn/article-11034-1.html
![](/data/attachment/album/201906/29/161918icu6zrn8qrg3p38u.png) > > 售价 35 美元起的新一代树莓派单板计算机,装载了 1.5 GHz 的 Arm 芯片,并支持双 HDMI 4K 显示,全吞吐量千兆以太网,以及更多新特性。 > > > ![Raspberry Pi 4 board](/data/attachment/album/201906/29/161935n0gl30da319x31hx.jpg "Raspberry Pi 4 board") 树莓派的最新版本树莓派 4 代,已于近日(北京时间 6 月 24 日)发布,这早于此前预期。树莓派 4 装载了 1.5 GHz 的 Arm 芯片和 VideoCore GPU,支持双 4K 显示输出,并引入了 USB 3 接口和全吞吐量千兆以太网,以及最高可达 4G 的多个可选 RAM 配置。 ![Raspberry Pi 4 case](/data/attachment/album/201906/29/161947owanconlvt0v17fl.jpg "Raspberry Pi 4 case") 树莓派 4 是非常强大的单板计算机,其起始售价依然是 35 美元。起始版的 RAM 配置为 1G,2G RAM 配置的树莓派售价为 45 美元,顶配 4G RAM 的树莓派售价为 55 美元,采用这种差异化定价对树莓派尚属首次。 树莓派 4 的详细配置如下: * 1.5 GHz 4 核心 64 位博通 BCM2711 A72 CPU * VideoCore VI GPU * 千兆以太网端口 * 1GB/2GB/4GB LPDDR4 SDRAM 内存 * 双 Micro-HDMI 接口 * 两个 USB 3 接口 * 两个 USB 2 接口 * 双频(2.4 GHz 和 5 GHz)无线网络 * 蓝牙 5.0 * USB Type C 电源接口 * CSI 摄像头接口 * DSI 显示接口 * MicroSD 卡槽 * PoE(以太网供电)供电针 * 完全兼容早期的树莓派产品 ### USB 接口和网络 树莓派 4 板载了更高速率的 USB 3 接口;它通过 Type C 接口供电,并提供两个 USB 3 接口和两个 USB 2 接口。USB 3 接口可以为连接的硬盘和其它外部设备提供更高的速率。 ![Raspberry Pi 4 USBs](/data/attachment/album/201906/29/161959vl0dr1wbsl0nx00b.jpg "Raspberry Pi 4 USBs") 基于 BCM2835 的树莓派 1 到 3 代的芯片只有一个本地 USB 接口,并且没有以太网接口,因而需要使用板子的 USB 集线器给出更多的 USB 接口和以太网接口。树莓派 3B+ 增加了一个专用的局域网(LAN)芯片,装载了千兆以太网,但它受到 USB 2 速率的限制。树莓派 4 板载了专门的千兆以太网,并且由于它不再受到 USB 速率的限制,网络速度要快得多。 树莓派 4 采用了 3B+ 中已有的技术 —— 该技术使得树莓派 3B+ 成为了第一个带有双频无线网络的单板计算机,即可以同时连接 2.4 GHz 和 5 GHz 频率的网络。 ### 显示 设计第一代树莓派时,其 CPU 和 GPU 性能的平衡大大偏向于 GPU。VideoCore IV 是一个非常强大的图形处理器,支持全高清 1080p 多媒体的处理,这就是为什么树莓派一直作为家庭媒体中心而广受欢迎的原因。树莓派 2 代在某种程度上进行了权衡修改,并将 CPU 的性能进行提升,将树莓派从单核发展成四核 ARM 芯片。而树莓派 4 代将 CPU 和 GPU 的性能都进行了大幅提升。新的 VideoCore VI GPU 支持 4K 视频,并允许通过板子上的两个 Micro HDMI 端口(板子特意保持了和旧有型号相同的尺寸)进行双显示输出,这里要用一个适配器或 Micro HDMI 转 full HDMI 的转换线连接到 HDMI 屏幕。 当你需要同时浏览多个窗口时,需要用到更多的物理显示屏,双显示的好处在此时就得到了绝佳体现。如果你正在编程,你可能会在其中一个屏幕上编写代码,构建网站或应用,而在另一个屏幕上查看数据库、Web 浏览器、电子邮件或其他内容。这是树莓派首次可以不必将开发局限在一台显示器上,从而可以让你在需要时,在不同的屏幕上构建具有不同内容的基于树莓派的项目。 该树莓派还有一个显示器串行接口(DSI),用于驱动另一个特殊的显示-这里并非指另一个监视器本身,而是通过一根挠性电缆连接的官方树莓派触摸屏显示器。 ### Raspbian Buster 树莓派 4 发布后,紧接着更新了基于 Debian 的系统 Raspbian Buster,而新的树莓派对 OpenGL ES 3 的支持,使我们在 Raspbian Buster 上为树莓派 4 开发任意软件成为可能。Buster 对界面进行了一些调整,并对很多软件进行了升级,其中包括 Python3.7。 ![Raspbian Buster](/data/attachment/album/201906/29/162010knxb85drt8rz7573.png "Raspbian Buster") ### 开源图形驱动程序 在过去的五年中,Eric Anholt 一直致力于为树莓派编写开源图形驱动程序。现在,Raspbian 可以使用这个驱动程序加速树莓派上的 Web 浏览、桌面图形和 3D 应用,这取代了以前需要的大量闭源代码。非常感谢 Eric 和博通的贡献。 按之前预计,树莓派 4 将于明年完成,但由于芯片设计比预期更早投入生产,树莓派 4 因而可以提早到现在发布。 --- 树莓派 4 已经开始发售,你会选择哪个型号呢?在评论中说出你的想法吧。 --- via: <https://opensource.com/article/19/6/raspberry-pi-4> 作者:[Ben Nuttall](https://opensource.com/users/bennuttall) 选题:[lujun9972](https://github.com/lujun9972) 译者:[wahailin](https://github.com/wahailin) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
The latest version of the Raspberry Pi—Raspberry Pi 4—was released today, earlier than anticipated, featuring a new 1.5GHz Arm chip and VideoCore GPU with some brand new additions: dual-HDMI 4K display output; USB3 ports; Gigabit Ethernet; and multiple RAM options up to 4GB. ![Raspberry Pi 4 Raspberry Pi 4 case](https://opensource.com/sites/default/files/uploads/raspberry-pi-4-case.jpg) The Raspberry Pi 4 is a very powerful single-board computer and starts at the usual price of $35. That gets you the standard 1GB RAM, or you can pay $45 for the 2GB model or $55 for the 4GB model—premium-priced models are a first for Raspberry Pi. The specs at-a-glance: - 64-bit BCM2711 quad-core A72 CPU @ 1.5GHz - VideoCore VI GPU - Gigabit Ethernet port - 1GB, 2GB, or 4GB LPDDR4 RAM - Two Micro-HDMI ports - Two USB3 ports - Two USB2 ports - Dual-band (2.4GHz and 5GHz) WiFi - Bluetooth 5.0 - USB Type C power port - CSI camera interface - DSI display interface - MicroSD card slot - Power-over-Ethernet pins - Full compatibility with all previous Raspberry Pi models ## USB and networking The Raspberry Pi 4 has the benefit of having USB3; it's powered by a USB Type C cable and provides two USB3 ports and two USB2 ports. You can now connect USB3 hard drives and other peripherals and get faster connectivity. ![Raspberry Pi 4 USBs Raspberry Pi 4 USBs](https://opensource.com/sites/default/files/uploads/raspberry-pi-4-usb.jpg) The BCM2835-based chip in Raspberry Pi 1 to 3 provided just one native USB port and no Ethernet, so a USB hub on the board provided more USB ports and an Ethernet port. The 3B+ added a dedicated LAN chip, which gave it Gigabit Ethernet, but this was limited to USB2 speeds. The Pi 4 has dedicated Gigabit Ethernet, and because it's no longer throttled over USB, its networking speeds are much faster. The Pi 4 takes advantage of the technology built into the 3B+ that made it the first single-board computer with dual-band WiFi. This means you can connect to both 2.4GHz and 5GHz networks. ## Displays When the first Raspberry Pi launched, the balance of its CPU and GPU performance was tipped heavily in favor of the GPU. The VideoCore IV was a very powerful graphics processor, capable of full-HD 1080p multimedia, which is why the Pi has always been popular as a home media center. The Pi 2 rebalanced things somewhat and brought the CPU in line, taking the Pi from a single-core to a quad-core Arm chip. The Pi 4 takes both factors a big step forward. The new VideoCore VI GPU gives the Pi 4K video and allows two displays via the board's two Micro-HDMI ports (selected to keep the board the same size), so you'll need an adapter or a Micro-to-full HDMI cable to use an HDMI monitor. Dual displays are a godsend when you need more screen real estate to keep eye contact with multiple windows—if you're programming you might have your code on one screen and the website or app you're building; your database; your web browser; your emails, or anything else on the other. For the first time, development on Raspberry Pi won't be limited to a single monitor. It's also handy if you want to build a Pi-based project with different things on different screens. The Pi also has a Display Serial Interface (DSI) port to drive another special display—not another monitor per se, but the official Raspberry Pi touch screen display connected via a flex cable. ## Raspbian Buster This Raspberry Pi 4's launch coincides with a major Debian release, and the fact the new Pi supports OpenGL ES 3 means it makes sense for any software developed for the Pi 4 to target Raspbian Buster. Buster brings a few user interface tweaks and a whole host of software upgrades, including Python 3.7. ![Raspbian Buster Raspbian Buster](https://opensource.com/sites/default/files/uploads/raspbian-buster.png) ## Open source graphics drivers Over the last five years, Eric Anholt has been working to write open source graphics drivers for the Raspberry Pi. Now, Raspbian can use this driver to deliver accelerated web browsing, desktop graphics, and 3D applications on the Pi. This replaces a large chunk of closed-source code that was previously required. Huge thanks to Eric and Broadcom for this effort. Previously, the Raspberry Pi 4 was expected to be yet another year away, but the chip design turned out to be ready for production much earlier than anticipated, so here it is! *The Raspberry Pi 4 is on sale now. Which model will you opt for? Let us know your plans in the comments!* ## 6 Comments
11,035
思科收购了物联网安全管理公司 Sentryo
https://www.networkworld.com/article/3400847/cisco-to-buy-iot-security-management-firm-sentryo.html
2019-06-30T11:50:10
[ "IoT", "IIoT" ]
https://linux.cn/article-11035-1.html
> > 买下 Sentryo 将给思科在工业物联网的异常和实时威胁检测两方面予以支持。 > > > ![IDG Worldwide](/data/attachment/album/201906/30/115018x02hv104ao7p40xp.jpg) 为了扩展自己的物联网安全管理产品,思科计划收购 Sentryo,这是一家总部位于法国的公司,Sentryo 为工业物联网提供异常检测和实时威胁检测。 Sentryo 成立于 2014 年,产品包括 ICS CyberVision(一种用于资产库存、网络监控和威胁情报的平台)以及 CyberVision 网络边界传感器,这用于分析网络流量。 **更多关于物联网的信息:** * [什么是物联网?物联网如何运行?](https://www.networkworld.com/article/3207535/internet-of-things/what-is-the-iot-how-the-internet-of-things-works.html) * [什么是边缘计算,这会如何改变我们的网络?](https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html) * [最强的物联网公司](https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html) * [10 个值得关注的热门物联网创业公司](https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html) * [在物联网领域赚钱的六种方法](https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html) * [什么是数字双胞胎技术? [以及它为什么重要]](https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html) * [区块链,以服务为中心的网络是物联网成功的关键](https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html) * [物联网以网络和安全作为基础](https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html) * [构建完整的物联网网络必须优先完成](https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html) * [什么是工业物联网?[为什么风险如此之高]](https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html) “我们通过思科的 IOx 应用框架将 Sentryo 的边缘传感器和我们的工业网络硬件相结合”,思科企业发展和思科投资的副总裁 Rob Salvagno 在一篇关于计划收购的博客中写道。 “我们相信连接是物联网项目的基础,通过释放网络的力量,我们可以大大提高运作的效率并发现新的商业机会。随着 Sentryo 的加入,思科可以为系统控制工程师提供更加深入的资产可见度,以此来对系统进行优化,检测异常并保护他们的网络。” Gartner 对 Sentryo 的系统写道:“ICS CyberVision 产品以其所有 OT 用户都能理解的方式提供对其客户 OT 网络的可视性,而不仅仅是 IT 技术人员。随着黑客和监管机构越来越关注工业控制系统,一个组织的 OT 拥有完整的可见性是至关重要的一件事。很多的 OT 网络不仅在地理上位置分散,而且也很复杂,由成千上万的组件组成。” Frost & Sullivan 的工业分析师 Nandini Natarajan 表示,Sentryo 的 ICS CyberVision 让企业能够确保其工业运作的连续性、动态弹性和安全性,并以此预防可能的网络攻击。“它将使用标签形式的独特的 ‘通用 OT 语言’ 来自动描述资产和通信流程,以纯文本的方式描述每个资产在做什么。ICS CyberVision 可以让任何人都能立刻查看一台设备的类别和行为;它利用人工智能算法提供很多不同的分析视图,来让用户深入了解到一个典型的工业控制系统可以产生多么庞大的数据。Sentryo 可以轻松查看重要或相关的信息。” Natarajan 表示,除此之外,Sentryo 的平台使用深度数据包检测(DPI)从工业设备之间的通信数据包里提取信息。DPI 引擎通过边缘计算架构进行部署,它可以运行在 Sentryo 传感器设备上,也可以在已经安装好的网络设备上运行。因此,Sentryo 可以将可见性和网络安全特性嵌入进工业网络中,而非部署带外监控网络。 Sentryo 的技术将扩大思科在物联网上的总体计划。在今年一月,思科推出了一整套的交换机、软件、开发工具和蓝图,这些东西将用于把物联网、基于意图联网的工业网络、传统信息安全、传统信息监控、应用开发支持融为一体。 这个新平台可以通过思科的 DNA 中心进行管理,让客户能将他们的物联网、工业网络控制和他们的商业 IT 世界融为一体。 DNA 中心是思科用于企业网络的中央管理工具,具有自动化、确保设置、结构配置、基于策略进行分割的功能。它也是该公司 IBN 计划的核心,用于主动向客户提供动态自动化实施网络和策略变更的能力,并在这个过程中确保数据的交付。IoT Field Network Director 是管理思科工业、连接网格路由器和终端的多服务网络的软件。 思科物联网业务部的高级副总裁兼总经理 Liz Centoni 表示,公司希望 Sentryo 的技术能以多种方式帮助物联网客户: 支持网络的被动 DPI 功能,这用于发现 IOT 和 OT 设备,并且在设备和系统之间建立起通信模式。Sentryo 的传感器可以在思科的 IOx 框架里进行本地部署,并且可以内置到这些设备运行的工业网络中,而不是添加额外的硬件。 随着设备识别和通信模式的建立,思科将把 DNA 中心和身份识别服务引擎(ISE)集成到一起,以便客户能够很轻松地定义分割策略。这种集成将使 OT 团队能够利用 IT 安全团队的专业知识来保护他们的环境,而不会对运营的流程造成风险。 由于这些物联网设备缺乏现代嵌入式软件和安全功能,网络分段将成为允许运作设备向合法系统进行通信的关键技术,并降低像我们看见的 WannaCry 和 Norsk Hydro 那样网络安全事件的风险。 据 Crunchbase 称,Sentryo 的每年预计收入为 350 万美元,与 Cymmetria、Team8 和 Indegy 的竞争最为激烈。此次收购预期将在思科 2020 财年的第一季度 - 2019 年 10 月 26 日 - 结束前完成。思科并未详细披露此次收购的财务细节。 Sentryo 是思科今年的第二次收购。思科在今年一月收购了 Singularity 公司的网络分析技术。在 2018 年,思科收购了包含 Duo security software 在内的 6 家公司。 --- via: <https://www.networkworld.com/article/3400847/cisco-to-buy-iot-security-management-firm-sentryo.html> 作者:[Michael Cooney](https://www.networkworld.com/author/Michael-Cooney/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[hopefully2333](https://github.com/hopefully2333) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
301
Moved Permanently
null
11,036
Kubernetes 基础:首先学习如何使用
https://opensource.com/article/19/6/kubernetes-basics
2019-06-30T14:10:14
[ "Kubernetes" ]
https://linux.cn/article-11036-1.html
> > 不要被新项目分心,而是专注于取得你的 Kubernetes 翻斗车驾驶执照。 > > > ![Truck steering wheel and dash](/data/attachment/album/201906/30/141021y2qa1pz16yh0dx1o.jpg "Truck steering wheel and dash") 在本系列的前两篇文章中,我解释了为何 Kubernetes [像翻斗车](/article-11011-1.html),并且想要理解像 [Kubernetes](https://opensource.com/resources/what-is-kubernetes)(和翻斗车,起重机等)这样优雅、专业工具总是有[学习曲线](/article-11026-1.html)的。本文是下一步:学习如何驾驶。 最近,我在 Reddit 上看到了一个关于[重要的 Kubernetes 项目](https://www.reddit.com/r/kubernetes/comments/bsoixc/what_are_the_essential_kubernetes_related/)的帖子。人们似乎很想知道他们应该学习如何开始使用 Kubernetes。“驾驶翻斗车的类比”有助于确保这个问题回到轨道上去。在这个帖子中的某个人提到,除非必要,你不应该运行自己的镜像仓库,所以人们开始逐渐接受驾驭 Kubernetes 而不是构建它的想法。 API 是 Kubernetes 的引擎和变速器。像翻斗车的方向盘、离合器、汽油和制动踏板一样,用于构建应用程序的 YAML 或 JSON 文件是机器的主要接口。当你第一次学习 Kubernetes 时,这应该是你的主要关注点。了解你的控制部件。不要分心于最新和最大的那些项目。当你刚学会开车时,不要尝试驾驶实验性的翻斗车。相反,请专注于基础知识。 ### 定义状态和实际状态 首先,Kubernetes 遵循定义状态和实际状态的原则。 ![Defined state and actual state](/data/attachment/album/201906/30/141023yfx9znjwzfx3tjct.png "Defined state and actual state") 人类(开发人员/系统管理员/运维人员)使用他们提交给 Kubernetes API 的 YAML/JSON 文件指定定义的状态。然后,Kubernetes 使用控制器来分析 YAML/JSON 中定义的新状态与集群中的实际状态之间的差异。 在上面的例子中,Replication Controller 可以看到用户指定的三个 pod 之间的差异,其中一个 pod 正在运行,并调度另外两个 Pod。如果你登录 Kubernetes 并手动杀死其中一个 Pod,它会不断启动另一个来替换它。在实际状态与定义的状态匹配之前,Kubernetes 不会停止。这是非常强大的。 ### 原语 接下来,你需要了解可以在 Kubernetes 中指定的原语。 ![Kubernetes primitives](/data/attachment/album/201906/30/141026kh2d1cz51oh1vh14.png "Kubernetes primatives") 这些原语不仅仅有 Pod,还有<ruby> 部署 <rt> Deployment </rt></ruby>、<ruby> 持久化卷声明 <rt> Persistent Volume Claim </rt></ruby>、<ruby> 服务 <rt> Service </rt></ruby>,<ruby> 路由 <rt> route </rt></ruby>等。使用支持 Kubernetes 的平台 [OpenShift](https://www.openshift.com/),你可以添加<ruby> 构建 <rt> build </rt></ruby>和 BuildConfig。你大概需要一天左右的时间来了解这些原语。你可以在你的用例变得更加复杂时再深入了解。 ### 将原生开发者映射到传统 IT 环境 最后,考虑这该如何映射到你在传统 IT 环境中的操作。 ![Mapping developer-native to traditional IT environments](/data/attachment/album/201906/30/141032s211270rysr1yl1e.png "Mapping developer-native to traditional IT environments") 尽管是一个技术问题,但用户一直在尝试解决业务问题。从历史上看,我们使用诸如<ruby> 剧本 <rt> playbook </rt></ruby>之类的东西将业务逻辑与单一语言的 IT 系统绑定起来。对于运维人员来说,这很不错,但是当你尝试将其扩展到开发人员时,它会变得更加繁琐。 直到 Kubernete 出现之前,我们从未能够以原生开发者的方式真正同时指定一组 IT 系统应如何表现和交互。如果你考虑一下,我们正在使用在 Kubernetes 中编写的 YAML/JSON 文件以非常便携和声明的方式扩展了管理存储、网络和计算资源的能力,但它们总会映射到某处的“真实”资源。我们不必以开发者身份担心它。 因此,快放弃关注 Kubernetes 生态系统中的新项目,而是专注开始使用它。在下一篇文章中,我将分享一些可以帮助你使用 Kubernetes 的工具和工作流程。 --- via: <https://opensource.com/article/19/6/kubernetes-basics> 作者:[Scott McCarty](https://opensource.com/users/fatherlinux/users/fatherlinux/users/fatherlinux) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
In the first two articles in this series, I explained how Kubernetes is [like a dump truck](https://opensource.com/article/19/6/kubernetes-dump-truck) and that there are always [learning curves](https://opensource.com/article/19/6/kubernetes-learning-curve) to understanding elegant, professional tools like [Kubernetes](https://opensource.com/resources/what-is-kubernetes) (and dump trucks, cranes, etc.). This article is about the next step: learning how to drive. Recently, I saw a thread on Reddit about [essential Kubernetes projects](https://www.reddit.com/r/kubernetes/comments/bsoixc/what_are_the_essential_kubernetes_related/). People seem hungry to know the bare minimum they should learn to get started with Kubernetes. The "driving a dump truck analogy" helps frame the problem to stay on track. Someone in the thread mentioned that you shouldn't be running your own registry unless you have to, so people are already nibbling at this idea of driving Kubernetes instead of building it. The API is Kubernetes' engine and transmission. Like a dump truck's steering wheel, clutch, gas, and brake pedal, the YAML or JSON files you use to build your applications are the primary interface to the machine. When you're first learning Kubernetes, this should be your primary focus. Get to know your controls. Don't get sidetracked by all the latest and greatest projects. Don't try out an experimental dump truck when you are just learning to drive. Instead, focus on the basics. ## Defined and actual states First, Kubernetes works on the principles of defined state and actual state. ![Defined state and actual state Defined state and actual state](https://opensource.com/sites/default/files/uploads/defined_state_-_actual_state.png) Humans (developers/sysadmins/operators) specify the defined state using the YAML/JSON files they submit to the Kubernetes API. Then, Kubernetes uses a controller to analyze the difference between the new state defined in the YAML/JSON and the actual state in the cluster. In the example above, the Replication Controller sees the difference between the three pods specified by the user, with one Pod running, and schedules two more. If you were to log into Kubernetes and manually kill one of the Pods, it would start another one to replace it—over and over and over. Kubernetes does not stop until the actual state matches the defined state. This is super powerful. **Primitives** Next, you need to understand what primitives you can specify in Kubernetes. ![Kubernetes primatives Kubernetes primitives](https://opensource.com/sites/default/files/uploads/new_primitives.png) It's more than just Pods; it's Deployments, Persistent Volume Claims, Services, routes, etc. With Kubernetes platform [OpenShift](https://www.openshift.com/), you can add builds and BuildConfigs. It will take you a day or so to get decent with each of these primitives. Then you can dive in deeper as your use cases become more complex. ## Mapping developer-native to traditional IT environments Finally, start thinking about how this maps to what you do in a traditional IT environment. ![Mapping developer-native to traditional IT environments Mapping developer-native to traditional IT environments](https://opensource.com/sites/default/files/uploads/developer_native_experience_-_mapped_to_traditional.png) The user has always been trying to solve a business problem, albeit a technical one. Historically, we have used things like playbooks to tie business logic to sets of IT systems with a single language. This has always been great for operations staff, but it gets hairier when you try to extend this to developers. We have never been able to truly specify how a set of IT systems should behave and interact together, in a developer-native way, until Kubernetes. If you think about it, we are extending the ability to manage storage, network, and compute resources in a very portable and declarative way with the YAML/JSON files we write in Kubernetes, but they are always mapped back to "real" resources somewhere. We just don't have to worry about it in developer mode. So, quit focusing on new projects in the Kubernetes ecosystem and get focused on driving it. In the next article, I will share some tools and workflows that help you drive Kubernetes. ## Comments are closed.
11,037
2019 - 微软:嗨哥们,我能加入你们的发行版邮件列表吗?
https://www.theregister.co.uk/2019/06/27/microsoft_linux_distro_list/
2019-06-30T15:47:00
[ "微软" ]
https://linux.cn/article-11037-1.html
> > 这个 Windows 巨头正在寻求加入关注 Linux 发行版安全的私有讨论版,得到了 Linux 基金会的赞许。 > > > ![](/data/attachment/album/201906/30/153610mn00o9rff9slvoik.jpg) 本周,微软继续想要搭乘上这趟 Linux 爱情列车:这个 Windows 巨头试图加入官方的 Linux 发行版邮件列表(linux-distros)。 linux-distros 邮件列表的[目的](https://oss-security.openwall.org/wiki/mailing-lists/distros#linux-distribution-security-contacts-list)是由 Linux 发行版们用于私下报告、协调和讨论尚未向公众公开的安全问题;而 oss-security 邮件列表是用于传播已经公开的东西、或者已经确定的事情的列表。 Sasha Levin 称自己是这个雷蒙德巨头(指微软)的“Linux 内核黑客”,他为他的雇主申请加入这个邮件列表。如果获得批准将允许微软参与到这个关于漏洞、补丁,以及开源内核和相关代码的持续安全问题的非公开讨论之中。这些讨论对于尽早确定问题,以及在补丁公开之前协调处理和部署修复至关重要。 为了证明微软有资格成为像 Ubuntu、Debian 和 SUSE 等一样的成员,他以微软的 Azure Sphere 和 WSL 2 作为类似发行版的构建示例。 [Azure Sphere](https://www.theregister.co.uk/2018/04/17/microsoft_azure_sphere_iot_chip/) 是微软对边缘计算的一种尝试,它本身是一种运行 Arm 的硬件上的 Linux。然而,它一直处于预览阶段。[WSL 2](https://www.theregister.co.uk/2019/06/13/wsl_2/) 同样处于预览阶段,它是基于 Linux 4.19 内核的经过调整的版本,并在今年 6 月初出现在了 Windows Insiders 计划中。Levin 估计它将在 2020 年公开发行(因此它的正式发布将不会与[日益神秘的](https://www.theregister.co.uk/2019/06/21/summer_is_here_microsoft_oh_no_it_isnt/) Windows 10 的 19H2 版本同步。) Levin 继续强调微软有很多用户并没有采用 Windows,它的 Linux 版本也不是基于其他人的发行版,当然,它也为社区做出了贡献。 Levin 确实是社区的活跃成员。浏览一下 Linux 5.0.15 内核的更新日志,到处是他与 Linux 基金会研究员 Greg Kroah-Hartman 一起的签名。因此,看到 Kroah-Hartman 为 Levin 担保并不奇怪:Kroah-Hartman 指出 Levin 对稳定的内核树有完全的写权限,并称赞了微软的这次申请。 微软将加入谷歌的 Chrome OS 团队和 Red Hat 等 Linux 巨头的行列。企鹅们担心这个第二号云服务商的出现是 Linux 世界曾经无忧无虑的“一切自由”正在悄然公司化的一个迹象,但是最好注意一下,另一个善良、有爱心的软件巨头甲骨文也是邮件列表上的成员。不要忘记:大多数 Linux 内核开发工作都是由在像 IBM 这样的机构工作的工程师完成的,例如 IBM 旗下的 Red Hat、Intel 和 Linux 基金会。 这确实可以看出微软已经和以前大不相同了,微软因为小心翼翼地保护自己的软件机密曾[将 Linux 描述为癌症](https://www.theregister.co.uk/2001/06/02/ballmer_linux_is_a_cancer/)而闻名于世,但它现在已经有了自己的发行版,因此资格获加入专门用于处理影响开源软件的安全问题的邮件列表。 “这里看到的是,微软希望获得 Linux 上的早期安全警报,”开源先驱 Bruce Perens 周四在采访电话中表示。 “这就是为什么他们要求列入这份邮件列表的原因。他们作为 Linux 发行商加入它,这就是他们的方式。 微软显然要在 Linux 方面做很多事情,他们有责任像其他 Linux 发行商一样快速修复已知的安全漏洞。“ Perens 说如果大型云服务商尚未这样做,他也期望它们也这样做。“我觉得 Chrome OS 也有同样的问题,”他说。 --- via: <https://www.theregister.co.uk/2019/06/27/microsoft_linux_distro_list/> 作者:[Richard Speed](https://www.theregister.co.uk/Author/Richard-Speed) 选题:[wxy](https://github.com/wxy) 译者:[wxy](https://github.com/wxy) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
301
Moved Permanently
null
11,039
升级配置后,树莓派 4 瞄准了桌面市场
https://itsfoss.com/raspberry-pi-4/
2019-07-01T11:33:33
[ "树莓派" ]
https://linux.cn/article-11039-1.html
> > 树莓派 4 升级配置后开始发售,其 RAM 配置最高可达 4 GB,并支持双 4k 显示。最新硬件配置下,你可以轻松将其作为桌面使用。起售价格依然和旧有型号一样,为 35 美元。 > > > 树莓派基金会已经发布了最新版的[树莓派 4B](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/) 单板计算机。 在升级了几个重要特性后,树莓派 4 成为了 40 美元以下的[单板计算机](https://itsfoss.com/raspberry-pi-alternatives/)市场中最强大的产品。 ![Raspberry Pi 4](/data/attachment/album/201907/01/113336ojk6rdnkjzjfqjj6.jpg) ### 树莓派 4 的新特性 树莓派 4 开始支持双 4k 显示器设置 —— 如果你对此有所需求的话。除此外,它还配备了更强大的处理器,其搭载的 RAM 最高可达 4 GB,这几乎可以媲美一个中端的便携电脑。 本次配置升级使树莓派可以参与[迷你 Linux 机](https://itsfoss.com/linux-based-mini-pc/)市场的竞争,而依旧 35 美元的起始售价使其比[其它单板计算机](https://itsfoss.com/raspberry-pi-alternatives/)更具优势。 树莓派 4 发布不久,各大主要的在线商店就几乎销售一空。那么,我们来看看它有哪些新卖点吧。 #### 树莓派 4 的核心配置 ![Raspberry Pi 4 Tech Specs](/data/attachment/album/201907/01/113338y8cxx73ouituldkb.jpg) * 博通 BCM2711,1.5 GHz 64 位 4 核心 Cortex-A72(ARM v8) * 顶配 4 GB RAM(可选 RAM 配置为 1 GB,2 GB 和 4 GB) * 无线网络和蓝牙 5.0 * 两个 USB 3.0 接口,两个 USB 2.0 接口 * 40 针 GPIO 引脚(向前兼容) * 两个 Micro-HDMI 接口(支持 4k 显示) * USB-C(供电接口) * 千兆以太网 如果你想更深入的了解配置信息,可以参考树莓派网站的[官方技术规格](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/specifications/)。 ### 定价和可用性 树莓派 4 的板子起始售价为 35 美元,根据可选配置不同(1-4 GB),售价也不同。 * 1 GB RAM 树莓派 4 售价:35 美元 * 2 GB RAM 树莓派 4 售价:45 美元 * 4 GB RAM 树莓派 4 售价:55 美元 根据你所在国家或地区的不同,树莓派 4 有不同的供应商。现有库存即将售罄,如果你想购买一定尽快,否则就要再等上一段时日了,你还可以参考官方页面上的购买信息。 * [购买树莓派 4](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/) 请注意,[运行树莓派需要额外的配件](https://itsfoss.com/things-you-need-to-get-your-raspberry-pi-working/),这就是为什么官方提供了可选的基础套件,套件中包含了所有必需的支持配件。 #### 树莓派 4 桌面套件 ![Raspberry Pi 4 Desktop Kit](/data/attachment/album/201907/01/113339k4zwmobm84iyb8hb.jpg) 你可以在购买树莓派 4 时同时购买树莓派 4 的桌面套件:外壳、键盘、鼠标、micro HDMI 线、USB-C 电源、用户指南以及[预装了 Rasbian 的 16 GB microSD 卡](https://itsfoss.com/tutorial-how-to-install-raspberry-pi-os-raspbian-wheezy/)。 ![Raspberry Pi Branded Desktop Kit](/data/attachment/album/201907/01/113340fbl4gvitzslpbsl4.jpg) 整组套件采用红白颜色设计,看起来很美观(如果你关心外观的话)。你可以在树莓派网站上获取更多的购买信息。 * [树莓派 4 桌面套件](https://www.raspberrypi.org/products/raspberry-pi-4-desktop-kit/) ### 树莓派 4 的前景 拥有所有这些配置后,树莓派 4 无疑会成为同类产品中最好的之一。同样,相比购买入门级桌面计算机,购买树莓派 4 也会是更好的选择。你可以只花很便宜的价格,就能轻松访问文档、管理电子表格,以及完成更多其它操作。 我绝对会考虑购买树莓派 4 作为备用(但强大)的入门级桌面计算机,但不会配备 4k 显示器,但依据文档,树莓派 4 肯定是支持双 4k 显示设置的。 你怎么评价最新版的树莓派 4B? 欢迎在评论中说出你的想法。 --- via: <https://itsfoss.com/raspberry-pi-4/> 作者:[Ankush Das](https://itsfoss.com/author/ankush/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[wahailin](https://github.com/wahailin) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
*Brief: Raspberry Pi 4 is here with the upgraded technical specifications. You get up to 4 GB of RAM and you can connect two 4K displays with it. With the new hardware, you should be more comfortable using it as a desktop. Starting price remains the $35 like the previous models. * The Raspberry Pi Foundation has just launched the new [Raspberry Pi 4 Model B](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/). It comes with some impressive upgrades which makes one of the most powerful [single board computers](https://itsfoss.com/raspberry-pi-alternatives/) under $40. ![Raspberry Pi 4](https://itsfoss.com/content/images/wordpress/2019/06/raspberry-pi-4-800x449.jpeg) ## What’s new in Raspberry Pi 4? The Raspberry Pi 4 now supports a dual 4K monitor setup – if that is what you are looking for. In addition to this, you get a more powerful processor which can be coupled with up to 4 GB of RAM. That’s almost equivalent to a mid-end laptop. The upgraded specification makes it a competitor in the [Linux mini-PC](https://itsfoss.com/linux-based-mini-pc/) segment while the same price tag of $35 gives it an edge over [other single board computers](https://itsfoss.com/raspberry-pi-alternatives/). Right after the launch, it’s almost out of stock at major online stores. So, let us take a look at what makes it so impressive. ### Raspberry Pi 4 key specifications ![Raspberry Pi 4 Tech Specs](https://itsfoss.com/content/images/wordpress/2019/06/raspberry-pi-4-tech-specs.jpg) - Broadcom BCM2711, Quad core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz - Up to 4GB RAM (choices are 1 GB, 2 GB and 4 GB) - WiFi and Bluetooth 5.0 - 2 USB 3.0 and a USB 2.0 ports - 40 pin GPIO header (backward compatible) - 2 micro-HDMI ports (supports 4K displays) - USB-C (power supply) - Gigabit Ethernet If you are curious to know more, do check out the [official tech specs](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/specifications/) on their website. ## Pricing and availability The pricing for just the Raspberry Pi 4 board starts from $35 and depending on the choice of RAM (1-4 GB), the cost shall vary. - Raspberry Pi 4 with 1 GB RAM: $35 - Raspberry Pi 4 with 2 GB RAM: $45 - Raspberry Pi 4 with 4 GB RAM: $55 Raspberry Pi 4 is available from different vendors depending on your country. It’s getting out of stock so you should either hurry up or wait for a few days/weeks. You can get purchase information on its official webpage. You should note that [you need to have additional accessories in order to run Raspberry Pi](https://itsfoss.com/things-you-need-to-get-your-raspberry-pi-working/). This is why there are several starter kits available to give you all the necessary supporting accessories. ### Raspberry Pi 4 desktop Kit ![Raspberry Pi 4 Desktop Kit](https://itsfoss.com/content/images/wordpress/2019/06/raspberry-pi-4-desktop-kit-800x427.jpg) You can also purchase the official Raspberry Pi 4 desktop kit that comes with a Raspberry Pi 4, its case, keyboard, mouse, micro HDMI cables, USB-C power supply, user guide and 16GB [microSD card with Raspbian installed](https://itsfoss.com/tutorial-how-to-install-raspberry-pi-os-raspbian-wheezy/). ![Raspberry Pi Desktop Kit Official](https://itsfoss.com/content/images/wordpress/2019/06/raspberry-pi-desktop-kit-official.jpg) The entire kit is in red and white color and it looks pretty (if you care for the looks). You can get the purchase information on Raspberry Pi website. ### Raspberry Pi 4 is promising With all that spec buff, it is definitely going to be one of the best out there. Also, instead of getting an entry-level desktop, Raspberry Pi 4 will be a better choice. You can easily access your documents, manage your spreadsheets, and do a lot of things at a cheaper price tag. I’m definitely considering to purchase the Raspberry Pi 4 as a spare (but a powerful) entry-level desktop. Well, I won’t be going for the 4K dual monitor setup, but it surely is capable of that, at least on paper. [interaction id=”5d10cc35bf07530c3b0767fb”] What do you think about the new Raspberry Pi 4 Model B? Let us know your thoughts in the comments below.
11,040
不容错过的 5 个微型 Linux 发行版
https://opensource.com/article/19/6/linux-distros-to-try
2019-07-01T12:37:59
[ "发行版" ]
https://linux.cn/article-11040-1.html
> > 这些微型 Linux 发行版可以让你的老爷机复活,可以启动一个损坏的系统,或者是确保在公共电脑上进行安全的操作。 > > > ![](/data/attachment/album/201907/01/123700uva8cagcqywwj8jv.jpg) 可供日常使用的 Linux 发行版比比皆是,不过其中有一些发行版常常被我们忽视,因为它们实在是太小了。但这些微型 Linux 发行版其实是一种非常强大的创新:使用一套完整的操作系统驱动一台只有不到 1 GB 存储空间和 512 MB 内存的计算机,真的是终极的黑客作风。 微型发行版的用法有很多种,比如说: * 从垃圾桶边挽救回那些又老又慢的电脑。你可以继续使用那些本来已经计划报废的机器,直到它们彻底解体(而不是在刚开始感觉有点儿慢的时候就扔掉)。 * 使用 U盘启动一个损坏的系统来恢复数据或者修复启动分区。 * 确保在安全和隐私的操作环境下使用公共电脑。如果使用 U 盘启动酒店大厅或者图书馆里的一台公共电脑,你是可以确定操作环境是安全的。 轻量级发行版有很多种,比如说 [Lubuntu](http://lubuntu.net)、[Peppermint OS](http://peppermintos.com) 和 [Bodhi](https://www.bodhilinux.com/),但是那些真正微型的发行版又有一些独到之处。下面就是你不容错过的五个微型发行版: ### Tiny Core ![Tiny Core Linux](/data/attachment/album/201907/01/123801c9p9u2wdwnncz22j.jpg "Tiny Core Linux") [Tiny Core Linux](http://tinycorelinux.net/) 小得近乎不可思议:终端版本只有 11 MB,图形界面版本只有 16 MB。我翻了一下之前收集的旧 U盘,最小的一个是 128 MB 的,也有 Tiny Core 镜像文件的八倍之大呢。 Tiny Core 默认包括只包括了基本的操作系统,你需要通过以太网下载需要的应用程序。由于设计得极端精简,甚至安装完整操作系统的应用程序都没有被包含在内(不过需要的话可以从 Tiny Core 的软件仓库下载)。 我使用过一个 128 MB 的 U盘在一台只有 512 MB 内存的机器上运行了 Tiny Core,对于一个只有 16 MB 的操作系统来说,效果算是非常棒了。只有在使用网页浏览器的时候速度才会变慢,但这主要是由于大部分现代网站太过复杂,而不是 Tiny Core 的问题。 如果不使用图形界面,运行 Tiny Core 就只需要 64 MB 的内存了。 #### 安装 [下载 Tiny Core](http://tinycorelinux.net/welcome.html) 并使用 `dd` 或者 [Etcher](https://www.balena.io/etcher/) 写入 U盘。 你只需要点击屏幕底部启动栏上的 **Apps** 图标下载 **tc-install** 或者 **tc-install-GUI** 应用,就可以轻松安装 Tiny Core了。 ![Tiny Core installer](/data/attachment/album/201907/01/123802uybribm8ymov4ibm.png "Tiny Core installer") 安装 Tiny Core 有几种不同的方式。你可以把它安装在一个格式化为 Linux 驱动器的 U盘里(这要求你的电脑支持使用 USB 驱动启动。大多数现代电脑都支持,但是在老一些的电脑上不太常见),或者安装在微软 FAT 文件系统的 U 盘里(这对于大多数不支持从 USB 驱动启动的电脑来说非常管用),或者甚至安装在一个现有 Linux 分区的一个文件夹里。 安装过程非常快,完成之后就可以重启计算机,进入到 Tiny Core Linux 系统中啦。 #### 应用程序 由于系统自带程序基本上只有一个文本编辑器和一个终端,你所要做的第一件事情就应该是安装一些应用程序。底部启动栏上的 **Apps** 图标展示了 Tiny Core 提供的所有软件包。**Apps** 软件仓库同时包含了一些重要的驱动程序,对于使用 WiFi 网卡或者是打印机等等都很有帮助。 在安装一个新的应用程序或者实用程序的时候,你可以选择在 Tiny Core 启动的时候就加载软件包,或者是需要的时候才加载。如果选择启动时加载,那么不仅该软件立即就可以使用,并且(不出所料地)下次重启之后也依然可用;如果选择需要时加载,那么在软件包下载完成之后仍然可以马上使用,但是重启之后就不会被自动加载到内存中了。这样可以保持很快的开机速度,并且只占用很少的内存,但同时也意味着每次开机之后,该应用的软件包只有在第一次被使用的时候才会被加载到内存中。 可供选择的应用程序同时包括像 office 和图像应用之类的用户端应用,以及像 [Samba](https://www.samba.org/) 和网站服务器这种的服务端应用。 当然了,随着你在 Tiny Core 上添加的应用程序越来越多,它就不那么“微型”了。不过在 Tiny Core 的网站上我们可以看到,即使是包括了所有 WiFi 驱动程序的 **Tiny Core Plus** 镜像文件也只有大约 100 MB,所以“不那么微型”也仍然很可能比 256 MB 要小很多。 #### 结论 Tiny Core 非常适合性能不佳的老爷机、用来通过网络启动的镜像文件,以及任何更看重应用而不是操作系统的人。Tiny Core 可以作为一个很好的周末工程来实践:从 16 MB 开始一步步搭建操作系统,直到你感觉这个操作系统已经足够满足你的需求了。 ### SliTaz ![SliTaz Linux](/data/attachment/album/201907/01/123803l78ubs8kzkzlkuxx.jpg "SliTaz Linux") [SliTaz Linux](http://www.slitaz.org/en/) 的镜像文件有大约 51 MB 大小,差不多是 Tiny Core 的四倍,但是包含一整套出色的驱动程序和应用程序。事实上,如果事先不知道的话,你可能会以为是通过一个 1 GB 的 Ubuntu 镜像启动的,因为能想到的任何一个基本启动镜像应该有的东西都在这儿:文本编辑器、网页浏览器、绘画工具、表格工具等等。 我使用过一个 128 MB 的 U盘 在一个 512 MB 内存的机器上运行了 SliTaz,效果非常不错。浏览复杂网站的时候性能会下降,但是系统包含的轻量级浏览器 [Midori](https://github.com/midori-browser/core) 可以快速加载绝大多数网站。 你可以在启动的时候选择进入没有图形界面的 SliTaz,这样在仅仅只有 64 MB 的机器上也可以很好地运行。 #### 安装 可供下载的 SliTaz 有很多种,因为它的开发者和社区针对可能存在的限制提供了非常多的版本。比如说,有一种低内存版本可以在只有 24 MB 内存的机器上运行;有一种版本使用 Firefox 而不是 Midori;还有一种版本没有包含额外的应用程序,等等。 如果你挑花了眼,只想赶紧选择一个版本尝试一下的话,那就 [下载滚动发布版本吧](http://slitaz.org/en/get/#rolling)。这个版本有差不多 50 MB 大小,每周都会更新。如果你爱上了 SliTaz,而滚动发布版本又更新得 *过快* 了的话,可以再选择一个更符合你需求的版本。 下载好你选择的 SliTaz 镜像文件之后,你就可以用 `dd` 或者 [Etcher](https://www.balena.io/etcher/) 将它写入 U 盘,然后重启。 将 SliTaz 安装在 U 盘或者硬盘上需要通过 **TazPanel** 这个应用程序来实现。它会引导你对硬盘进行需要的分区,然后将 SliTaz 安装在你选择的地方。 ![SliTaz installer](/data/attachment/album/201907/01/123806b4747nzscej4o4ai.jpg "SliTaz installer") #### 应用程序 SliTaz 的控制中心是 **TazPanel** 这个应用程序。如果你喜欢 OpenSUSE 或者 Mageia (最初被称为 Mandrake),那 TazPanel 对你来说应该不会陌生(至少在核心思想上):包括系统设置、硬件监测、用户和用户组的管理、系统升级、安装应用程序在内的这些功能,都在这一个应用程序内实现。 SliTaz 提供的应用程序可以满足大多数基本需求,如果你不是非常在意完成某一项任务必须使用哪一个应用程序的话,那么在 SliTaz 的软件仓库里应该可以找到你想要的应用。如果你有一些特别的需求(比如说想要使用 GIMP 2.10 而不是 GIMP 2.8),那么就需要学习如何生成 SliTaz 软件包了。好消息是,**tazpkg** 命令支持从好几种软件包格式转换过来,包括: * Debian 软件包(.deb,.udeb) * RPM 软件包(.rpm) * Slackware 软件包(.tgz) * Puppy 软件包(.sfs,.pet) * NuTyX 软件包(.cards.tar.xz) * Arch 和 Alpine Linux 软件包(.apk,.pkg.tar.gz,.pkg.tar.xz) * OpenWrt 软件包(.ipk,.opk) * Paldo 软件包(.tar.bz2) * Void 软件包(.xbps) * Tiny Core 软件包(.tce,.tcel,.tcem, .tcz) #### 结论 SliTaz 是一个快速而小巧的 Linux 发行版,并且非常容易上手(因为有一个中心化的控制面板)。由于它的软件包工具支持从其它格式的 Linux 软件包转换成自己的格式,它的应用程序理论上来说是非常丰富的,你可以很容易地使用喜欢的工具搭建自己的工作环境。SliTaz 很小,但是也非常具有杀伤力,正如它的蜘蛛 logo 所暗示的那样。 ### Porteus ![Porteus Linux](/data/attachment/album/201907/01/123809w1zq4v66e0bwkgbk.jpg "Porteus Linux") [Porteus](http://www.porteus.org/) 提供了不同的桌面环境可供选择,最小的镜像文件大约在 270 MB 左右,最大的有 350 MB。它是微型 Linux 中镜像文件最大的一个,但是这些额外的空间都被用来确保一个非常顺畅的 Linux 桌面环境的体验,以至于你很可能会忘了自己是在使用一个 live 版本。如果将 Porteus 安装到 SSD 或者是在启动的时候加载到内存里的话,你就会得到一个如此天衣无缝地顺畅的环境,以至于不会相信你的操作系统所占用的空间只有不到半个 CD-ROM 的大小。 Porteus 的基础镜像文件相对来说比较小,因此被称为是“微型”,但是根据你选择的桌面环境版本,Porteus 有可能会需要 1 GB 之多的内存才可以运行。尽管其它微型 Linux 发行版倾向于通过精简应用程序来节约空间和资源,Porteus 却希望你像普通发行版一样来使用它。忘掉你是在使用一个微型的压缩根文件系统,尽情安装所有你喜欢的应用程序吧。 #### 安装 可以在 [离你最近的 Porteus 镜像网站](http://porteus.org/porteus-mirrors.txt) 上下载 Porteus,并且从 MATE、LXQT、LXDE、OpenBox、XFCE、Cinnamon 或者 KDE 里选择自己喜欢的桌面环境。如果没有特殊偏好,MATE 或者是 KDE 桌面都是不错的选择,他们可以提供熟悉的桌面环境体验,并且镜像文件又不至于太大。 ![Porteus installer](/data/attachment/album/201907/01/123816o0jyrxbu00ss0nr0.png "Porteus installer") 你可以根据 [官方的安装指南](http://www.porteus.org/component/content/article/26-tutorials/general-info-tutorials/114-official-porteus-installation-guide.html) 将 Porteus 安装到一个 U盘 或者是内部硬盘里。这两种方式非常相似,都会使用一个不可变的压缩根文件系统。这是一种稳定的、受限制的文件系统,会根据你的使用被修改。你所做的变更和安装的应用程序在重启的时候都会被加载到内存里,从而还原你关机前的使用环境。 #### 应用程序 应用程序在 Porteus 里被称为“模块”,由 [Slackware 软件包统一管理器](http://www.porteus.org/tutorials/9-modules/149-usm.html)(USM)提供。USM 的资源涵盖五个不同的 Slackware 软件仓库,所以可供选择的应用还是很丰富的。 #### 结论 Porteus 可以提供完整的 Linux 使用体验,却只使用了正常 Linux 所需要空间的一小部分。这是一个配备了很多种可供选择的桌面环境和很多应用程序的出色的便携式 Linux 发行版。 ### Bodhi Linux ![Bodhi Linux](/data/attachment/album/201907/01/123818pcsysksmcectgy13.jpg "Bodhi Linux") [Bodhi Linux](https://www.bodhilinux.com/) 的 ISO 镜像文件有 740 MB 大小,初看之下并不是很“微型”,不过一旦安装完成之后,你就会惊讶于它是多么微型了。Bodhi 在 512 MB 大小的内存上也可以顺畅运行,并且它的桌面环境看起来就像是来自未来一样。Bodhi 使用的是 [Enlightenment](https://www.enlightenment.org/) 桌面,这是一个精心制作的优美的用户界面,小巧而强悍。 不过 Bodhi 并不只是简单地使用 Enlightenment,而是在此基础上增色不少。Bodhi 在配置型应用程序和系统设置面板上都进行了界面处理,避免了 Enlightenment 有时显得过于繁复的选项。Bodhi 替你做了一些很好的默认选择,并且只显示全部选项的一部分。如果你是一个 Enlightenment 狂热分子,那么 Bodhi 这样的做法对你来说可能显得不是很纯粹,但是对于大多数用户来说,Bodhi 这样做可以让人更加专注于 Enlightenment 桌面本身。 #### 安装 [下载 Bodhi Linux](https://www.bodhilinux.com/download),通过 `dd` 或者 [Etcher](https://www.balena.io/etcher/) 写入 U盘,然后重启。 Bodhi 安装器可以在 **设置** 页面的 **应用程序** 菜单里找到。安装程序用的是 **Ubiquity**,所以整个过程和安装 Ubuntu 是一样的。如果你没有安装过 Ubuntu 也不必担心,因为这是最好安装的发行版之一了。 ![Bodhi installer](/data/attachment/album/201907/01/123821yf6c0xkuf07rfnxq.jpg "Bodhi installer") #### 应用程序 Bodhi 是基于最新的 Ubuntu 长期维护发布版的,所以可供使用的应用程序简直数不胜数。只要是在 Ubuntu 上可以使用的应用,Bohdi 上就同样可以找到。 #### 结论 Bodhi Linux 相比一个标准的 Ubuntu 来说要小不少,但是相比其它微型 Ubuntu 环境来说又好一些(因为使用了 Enlightenment)。如果你在找一个比大多数发行版更轻量的 Linux 发行版,但是又不想使用 OverlayFS 或者是应用程序模块的话,那么 Bodhi 就是一个不错的选择了。 ### Puppy Linux ![Puppy Linux](/data/attachment/album/201907/01/123823qblrl4ogijgv9vlf.jpg "Puppy Linux") 早在 Tiny Core、SliTaz、[AntiX](https://antixlinux.com/) 或者是 Porteus 诞生之前,就已经有 [Puppy Linux](http://puppylinux.com/) 了。作为最早的微型 Linux 发行版之一,Puppy 已经历经了十五年风霜,并且无论是对于老爷机还是新用户来说始终都是一个可靠的、可启动的操作系统。 为了保证正常运行,Puppy 会在第一次启动之后引导用户完成必要的设置步骤。整个过程涉及很多个窗口,但是一旦完成,你就会对一切功能了如指掌,然后再决定是否需要安装。 Puppy 几乎有 300 MB 大小,并且在我测试的 1 GB 内存的机器上并不能正常运行,所以它并不是一个特别微型的 Linux 发行版。尽管如此,它仍然是一个非常棒的 1 GB 以下的操作系统,并且在该类系统里算是非常友好的一个。 #### 安装 [下载 Puppy Linux](http://puppylinux.com/index.html#download),然后通过 `dd` 或 [Etcher](https://www.balena.io/etcher/) 写入 U 盘,或者是刻录到 CD 或者 DVD 里,然后重启。 ![Puppy installer](/data/attachment/album/201907/01/123825hh111s47l3wovlky.jpg "Puppy installer") Puppy 几乎可以安装在支持任何一种数据格式的载体上。你可以在顶部启动栏里找到 **Puppy Installer** 安装程序,这个程序负责安装 Puppy 以及 Puppy 的应用程序。 Puppy 安装器会一步步引导你将系统安装在你提供的任何一种媒介上。Puppy 可以从 U盘、光盘、硬盘,或者甚至是 SD 卡上启动。我曾经在一台没有硬盘、光驱出了故障,并且也无法从 USB 启动的计算机上成功运行了 Puppy。由于 Puppy 支持在任何载体上写入你的配置选项,我甚至可以在一个拥有长期数据存储的外部设备上使用它。 #### 应用程序 **Puppy 安装器** 这个应用同样被用来在 Puppy 上安装应用。由于 Puppy 是基于 Ubuntu 的,它的软件仓库几乎不会缺少任何一个 Linux 软件包,并且如果真的出现了这种情况的话,你也可以使用 [Flatpak](https://docs.fedoraproject.org/en-US/fedora-silverblue/getting-started/#flatpak)。 #### 结论 Puppy 是最早的微型 Linux。尽管它已经不是最微型的了,却是目前最易用的一个。 ### 附赠:Silverblue ![SilverBlue, not tiny, but tiny-adjacent](/data/attachment/album/201907/01/123827iorc0oooggj45rcj.jpg "SilverBlue, not tiny, but tiny-adjacent") 微型 Linux 这个概念是随着时间不断变化的。很久以前,微型 Linux 发行版意味着需要下载到 CD-R 里,从光驱启动,然后将修改写入外部媒介中。后来,你可以从 U 盘启动它,并且有专门用来记录永久修改的空间。现在的微型 Linux 不仅支持上面两种方法,还可以被直接安装在内部驱动或者文件夹里。 大家都没有想到 Linux 开创了容器的热潮 —— 容器里应用程序是在半虚拟化的环境中运行的一套独立的 Linux 系统。曾经只是属于喜欢优化硬盘空间或者重新利用老爷机的人们的小众爱好,很快成为了那些想要开发容器但又不想在应用程序上添加太多负载的人的强烈需求。那些在极简化的、不起眼的 Linux 发行版上所付出的辛苦,一夜之间以一种意想不到的方式得到了回报。 立足于根文件系统这个概念,Fedora 项目发起的 [Silverblue](https://silverblue.fedoraproject.org/) 试验旨在创造一个不可修改的操作系统。该操作系统主要通过容器的形式来更新系统以及安装应用,系统本身永远不会改变。 2.1 GB 的 Silverblue 可不是一个微型 Linux 发行版,但是从某种程度上来说,它是微型 Linux 和容器运动的产物。 #### 安装 [下载 Silverblue](https://silverblue.fedoraproject.org/download),然后通过 `dd` 琥或 [Etcher](https://www.balena.io/etcher/) 写入 U 盘,或者是刻录到 CD 或者 DVD 里,然后重启。 启动到 Silverblue 之后,使用 [Anaconda](https://fedoraproject.org/wiki/Anaconda)(标准的、友好的 Fedora 安装器)将它安装在一个内部硬盘里。 ![Anaconda installer](/data/attachment/album/201907/01/123829ieo7yyoboy7ouuf5.jpg "Anaconda installer") #### 应用程序 Silverblue 安装应用的方式和传统意义上不同:它是在基础操作系统之上运行容器。具体来说,它使用 Flatpak 运行 GUI 应用程序,使用 [Toolbox](https://docs.fedoraproject.org/en-US/fedora-silverblue/toolbox/) 运行命令。 由于 Flatpak 并非像传统的 Fedora RPM 软件包一样常见,Silverblue 也提供了一种可以将 Fedora RPM 软件包转换成 Silverblue 形式的方法:**软件包分层**。 #### 结论 Silverblue 可能是一个用来尝试前沿科技的有趣实验,或者也可能是桌面操作系统的未来。它之所以被称为微型,只是因为根文件系统的大小不会随着系统升级或者安装应用而改变。不过,透过 Silverblue 来看看对微型 Linux 的迷恋在带领着 Linux 社区和行业往哪个方向走,也是一件挺有意思的事情。对了,走之前不要忘了向 11 MB 大小的微型 Linux 先驱们脱帽致敬。 --- via: <https://opensource.com/article/19/6/linux-distros-to-try> 作者:[Seth Kenlon](https://opensource.com/users/seth/users/marcobravo) 选题:[lujun9972](https://github.com/lujun9972) 译者:[chen-ni](https://github.com/chen-ni) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
There are plenty of Linux distributions out there to choose from when you're deciding what to run on a daily basis, yet some are so small that they get little notice. But tiny Linux distributions are powerful innovations: having an entire operating system drive a computer with less than 1GB of storage and half as much RAM is the ultimate software hack. Tiny distros have many uses, such as: - Save old and slow computers from the rubbish bin. Reject planned obsolescence and use computers until they fall apart, not just until they start to feel slow. - Boot broken or corrupted systems from a thumb drive to recover data or repair boot partitions. - Ensure a safe and private environment when on a public computer. If you boot a public computer in a hotel lobby or a library from a thumb drive, you'll know your operating environment is secure. There are plenty of lightweight distributions out there, like [Lubuntu](http://lubuntu.net), [Peppermint OS](http://peppermintos.com), and [Bodhi](https://www.bodhilinux.com/), but there's something special about the truly tiny. Here are five tiny distros you owe it to yourself to try. ## Tiny Core ![Tiny Core Linux Tiny Core Linux](https://opensource.com/sites/default/files/uploads/tinycore.jpg) At 11MB for a text console and 16MB for a GUI, [Tiny Core Linux](http://tinycorelinux.net/) is almost impossibly small. I dug through my collection of old thumb drives; the smallest one was 128MB, which is still eight times the size of Tiny Core's image. By default, Tiny Core includes the base OS, assuming you have an Ethernet connection to the internet so you can install only the applications you need. It's such an extremely efficient model that it doesn't even include an application to install the OS (although you can download it from the Tiny Core repository when you're ready to install). I've run Tiny Core from a 128MB thumb drive on a system with 512MB RAM, and the performance was excellent, as you might expect from an OS that takes only 16MB. Performance slows only when browsing the internet in a web browser, but the blame lies with the complexity of most modern websites more than Tiny Core. Without a GUI, Tiny Core runs well on a mere 64MB of RAM. ### Installation [Download Tiny Core](http://tinycorelinux.net/welcome.html) and write it to a thumb drive with **dd** or [Etcher](https://www.balena.io/etcher/). Installing Tiny Core is easy, once you download the **tc-install** or **tc-install-GUI** application using the **Apps** icon in the launcher bar at the bottom of the screen. ![Tiny Core installer Tiny Core installer](https://opensource.com/sites/default/files/uploads/tc-install-gui.png) You have several options to install Tiny Core. You can install it to a thumb drive formatted as a Linux drive (this requires your computer to allow booting from a USB drive, which is common in most modern PCs but was less common for older ones), to a Microsoft FAT thumb drive (a hack for PCs that don't normally boot from USB drives), or even to a directory in an existing Linux partition. The installation is quick, and when you finish, you can reboot your computer and boot into your Tiny Core Linux OS. ### Applications Since it comes with little more than a text editor and a terminal, the first thing you should do is install some applications. The **Apps** icon in the bottom launcher bar displays all the Tiny Core packages available to you. The **Apps** repository also includes important drivers, so it's useful when you're looking to get a WiFi card or a printer working. When installing a new application or utility, you can choose between having the package load into Tiny Core at boot time or on demand. Choosing to load a package at boot makes it available to you immediately and still available after a reboot (as you would expect). Choosing to load it on demand means the package is available after Tiny Core downloads the package, but after a reboot, it won't be loaded into memory. This may keep your boot time fast and Tiny Core's footprint in RAM tiny, but it also means the package data isn't loaded into memory until you use it for the first time each session. The application selection is a good mix between user-centric apps, like office and graphics applications, and server-centric, such as [Samba](https://www.samba.org/) and web servers. Of course, once you start adding applications to Tiny Core, it becomes less tiny. Even the **Tiny Core Plus** image, which includes all WiFi drivers, on the Tiny Core website is only about 100MB, so "less tiny" is likely still well under 256MB or so. ### Bottom line Tiny Core is ideal for old computers with few resources, network boot images, and anyone who values applications over the OS. Tiny Core is a great weekend project: build the OS you want from 16MB until you have just as much of an OS as you need. ## SliTaz ![SliTaz Linux SliTaz Linux](https://opensource.com/sites/default/files/uploads/slitaz.jpg) The [SliTaz Linux](http://www.slitaz.org/en/) image is about 51MB, about four times the size of Tiny Core, with an impressive collection of drivers and applications included. In fact, if you didn't know better, you might think you booted into a 1GB Ubuntu image because everything you'd expect from a basic starter image is there: text editor, web browser, paint program, spreadsheet application, and so on. I've run SliTaz from a 128MB thumb drive on a system with 512MB RAM, and the performance was excellent. Performance slows when browsing heavy websites, but the included lightweight [Midori](https://github.com/midori-browser/core) browser keeps most sites loading quickly. At boot time, you can choose to run SliTaz without a GUI; it runs nicely on a mere 64MB of RAM. ### Installation There are many download options for SliTaz because its developers and community provide many variations for potential system limitations. For instance, there's a low RAM version for systems with as little as 24MB RAM, a version with Firefox instead of Midori, a version with no extra applications, and so on. If you're overwhelmed by options and just want to try it out, [download the rolling release](http://slitaz.org/en/get/#rolling). This version is roughly 50MB and is updated weekly. If you fall in love with SliTaz, you can choose a download that's better for your needs—if the rolling release proves to be *too* fresh for you. Once you've downloaded your choice of SliTaz image, write it to a thumb drive with **dd** or [Etcher](https://www.balena.io/etcher/) and reboot. Installing SliTaz to a thumb drive or hard drive is done through the **TazPanel** application. It guides you through partitioning your disk (as needed) and installs SliTaz to the destination you choose. ![SliTaz installer SliTaz installer](https://opensource.com/sites/default/files/uploads/slitaz-install.jpg) ### Applications The **TazPanel** application is SliTaz's control center. If you're a fan of OpenSUSE or Mageia (née Mandrake), you might find TazPanel familiar, at least in concept: it's a single application that provides access to system configuration, hardware detection, user and group management, system updates, and application installation. Available applications satisfy most basic requirements, meaning if you're not picky about which application you use to accomplish a task, then SliTaz's repositories probably have something for you. If you have specific requirements (GIMP 2.10 instead of GIMP 2.8, for instance), then you'll have to learn how to generate SliTaz packages. The good news is that the **tazpkg** command can convert from several packaging formats, including: - Debian packages (.deb, .udeb) - RPM packages (.rpm) - Slackware packages (.tgz) - Puppy packages (.sfs, .pet) - NuTyX packages (.cards.tar.xz) - Arch and Alpine Linux packages (.apk, .pkg.tar.gz, .pkg.tar.xz) - OpenWrt packages (.ipk, .opk) - Paldo packages (.tar.bz2) - Void packages (.xbps) - Tiny Core packages (.tce, .tcel, .tcem, .tcz) ### Bottom line SliTaz is a fast, small Linux distribution with a centralized control panel that makes it easy to learn. Because its packaging tools can convert from other Linux packaging formats, its application selection is theoretically vast, making it easy for you to design your work environment with all your favorite tools. SliTaz is small but lethal, just like its arachnid logo. ## Porteus ![Porteus Linux Porteus Linux](https://opensource.com/sites/default/files/uploads/porteus.jpg) [Porteus](http://www.porteus.org/) offers a few desktop options, with the smallest image around 270MB and the largest 350MB. That makes it one of the largest of tiny Linux images, but most of that space is dedicated to ensuring a smooth Linux desktop experience, to the point that you'll likely forget you're using a live distribution. Installing Porteus to an SSD drive or loading it to RAM during boot results in such a flawlessly smooth environment that you won't believe your OS occupies less space than half a CD-ROM. Porteus is tiny in the sense that its base image is comparatively small, but depending on the desktop you choose, it can easily require up to 1GB of RAM to run. While other tiny Linux distributions tend to capitalize on minimalist applications to preserve space and resources, Porteus expects you to use it as you would any other distribution. Install all your favorite apps and drivers and forget you're running on a tiny, compressed root filesystem. ### Installation Download Porteus from your [closest Porteus mirror](http://porteus.org/porteus-mirrors.txt), choosing from MATE, LXQT, LXDE, OpenBox, XFCE, Cinnamon, or KDE, depending upon your preference. If you have no preference, the MATE or KDE desktop are both good at balancing image size with a familiar-feeling desktop experience. ![Porteus installer Porteus installer](https://opensource.com/sites/default/files/styles/medium/public/images/porteus-installer.png?itok=_4pFIBoy) opensource.com You can install Porteus to a thumb drive or an internal hard drive using the instructions in the [official installation guide](http://www.porteus.org/component/content/article/26-tutorials/general-info-tutorials/114-official-porteus-installation-guide.html). The process is similar either way and results in a compressed root filesystem that never changes. It's a stable and contained filesystem upon which you overlay your changes as you use it. When you reboot, changes you make and applications you install are loaded into memory, so your environment is just as you left it. ### Applications Applications are called "modules" in Porteus lingo and are available from the [Unified Slackware Package Manager](http://www.porteus.org/tutorials/9-modules/149-usm.html) (USM), which draws from five different Slackware repositories, meaning you have plenty of applications to choose from. ### Bottom line Porteus is a full Linux experience with a fraction of the space usually required. It's an excellent portable Linux distribution with lots of desktop options and lots of applications. ## Bodhi Linux ![Bodhi Linux Bodhi Linux](https://opensource.com/sites/default/files/uploads/bodhi.jpg) [Bodhi Linux](https://www.bodhilinux.com/) might not look tiny at first glance, with an ISO image of 740MB, but once it's installed, you'll be amazed at just how tiny it is. Bodhi runs smoothly on only 512MB of RAM but looks and feels like the desktop of tomorrow. Bodhi uses the [Enlightenment](https://www.enlightenment.org/) desktop, a beautiful user interface that's lovingly crafted to be both small and powerful. Bodhi doesn't just use Enlightenment, though, it adds to it. Bodhi's configuration applications and system setting panels are custom interfaces to Enlightenment's sometimes overwhelming array of options. Bodhi makes some sane default choices for you and provides a subset of options. If you're a die-hard Enlightenment user, Bodhi's interpretation might not be pure enough for you, but for many users, Bodhi brings focus to the Enlightenment desktop. ### Installation [Download Bodhi Linux](https://www.bodhilinux.com/download), write it to a thumb drive with **dd** or [Etcher](https://www.balena.io/etcher/), and reboot. The Bodhi installer is available from the **Applications** menu in the **Preferences** category. The installation application is **Ubiquity**, so the process is the same as installing Ubuntu. If you've never installed Ubuntu, don't worry; it's one of the easiest to install. ![Bodhi installer Bodhi installer](https://opensource.com/sites/default/files/uploads/bodhi-install.jpg) ### Applications Bodhi is based on the latest long term support (LTS) Ubuntu Linux release, so your available software knows almost no bounds. If it's available for Ubuntu Linux, Bohdi has access to it. ### Bottom line Bodhi Linux is a step down from the size of a typical Ubuntu install and a step up from many other minimalist Ubuntu environments because it uses Enlightenment. If you're looking for a Linux distribution that runs lighter than most without resorting to overlay filesystems and application modules, then Bodhi is the distribution for you. ## Puppy Linux ![Puppy Linux Puppy Linux](https://opensource.com/sites/default/files/uploads/puppy.jpg) Before there was Tiny Core or SliTaz or [AntiX](https://antixlinux.com/) or Porteus, there was [Puppy Linux](http://puppylinux.com/). One of the original tiny Linux distributions, Puppy has endured for a decade and a half as a reliable, bootable OS for old computers and new users alike. Upon first boot, Puppy does its best to guide the user through any necessary steps to ensure everything works as expected. It's a lot of windows to wade through, but once you get through it all, you know without a doubt what works and what doesn't before you choose whether to install. Puppy is almost 300MB and failed to work on anything under 1GB RAM in my tests, so it's not exactly the tiniest Linux available. However, it's still a great, under-1GB operating system, and of the OSes in that category, it's one of the very friendliest. ### Installation [Download Puppy Linux](http://puppylinux.com/index.html#download) and write it to a thumb drive with **dd** or [Etcher](https://www.balena.io/etcher/) or burn it to a CD or DVD, then reboot. ![Puppy installer Puppy installer](https://opensource.com/sites/default/files/uploads/puppy-install.jpg) Puppy can install onto nearly anything that accepts data. The installer application, available from the top launcher bar, is called **Puppy Installer**, and it manages installing Puppy and applications for Puppy. Puppy Installer steps you through the process of installing the OS onto whatever media you have available. Puppy can boot from a thumb drive, an optical disc, a hard drive, and even an SD card. I've used Puppy on a computer with no hard drive whatsoever, no working optical drive, and no option to boot from USB. Because Puppy can write your configuration options to just about anything, I was able to use it with persistent data storage to an external device. ### Applications The **Puppy Installer** application is also used to install apps onto Puppy. Because Puppy is based on Ubuntu, there aren't likely to be any Linux packages missing from its repositories, and if there are, you can probably use a [Flatpak](https://docs.fedoraproject.org/en-US/fedora-silverblue/getting-started/#flatpak). ### Bottom line Puppy is the original tiny Linux. While it's not the tiniest any more, it's by far the easiest. ## Bonus: Silverblue ![SilverBlue, not tiny, but tiny-adjacent SilverBlue, not tiny, but tiny-adjacent](https://opensource.com/sites/default/files/uploads/silverblue.jpg) The concept of tiny Linux has changed over the years. Long ago, a tiny Linux distribution was something you downloaded onto a CD-R and ran from your optical drive while saving changes to external media. Later, it was something you ran from a thumb drive with dedicated space for persistent changes. Now it's all of those things plus the ability to install to internal drives or directories. What no one expected was for Linux to kick off the craze for containers, in which applications are self-contained Linux systems running in a para-virtualized environment. What was once a niche hobby for people who either loved to optimize disk space or who loved to resurrect ancient computers quickly became a salient requirement for developers who wanted to develop containers without adding too much overhead to their applications. All the work put into the minimalist, ephemeral Linux distributions suddenly paid off in an unexpected way. With the concept of what a root filesystem looks like, the Fedora Project's [Silverblue](https://silverblue.fedoraproject.org/) experiment is an effort to create an immutable OS. It's an operating system that never changes and instead gets updates and application installs in the form of, essentially, containers. Silverblue at 2.1GB is by no means a tiny Linux distribution, but in many ways, it's a child of the tiny Linux and container movements. ### Installation [Download Silverblue](https://silverblue.fedoraproject.org/download) and write it to a thumb drive with **dd** or [Etcher](https://www.balena.io/etcher/) or burn it to a CD or DVD, then reboot. After booting into Silverblue, install it to an internal hard drive using [Anaconda](https://fedoraproject.org/wiki/Anaconda), the standard, friendly Fedora Linux installer. ![Anaconda installer Anaconda installer](https://opensource.com/sites/default/files/uploads/silverblue-install.jpg) ### Applications Silverblue doesn't install applications in the traditional sense; instead, it runs containers over the top of its base OS. Specifically, it uses Flatpaks for GUI applications and [Toolbox](https://docs.fedoraproject.org/en-US/fedora-silverblue/toolbox/) for commands. Because Flatpaks aren't nearly as common as traditional Fedora RPM packages, Silverblue also provides **package layering**, a way to convert Fedora RPM packages to Silverblue. ### Bottom line Silverblue could be a fun experiment testing out emerging technology, or it could be the future of the desktop OS. It's tiny only in the sense that its root filesystem remains the same size regardless of updates and applications added onto it, but it's worth looking at to see where the strange obsession with tiny distributions has delivered the Linux community and industry. Don't forget to tip your hat to the 11MB pioneers on your way out. ## 44 Comments
11,042
在 Fedora 中利用 ffsend 使用 Firefox Send
https://fedoramagazine.org/use-firefox-send-with-ffsend-in-fedora/
2019-07-01T12:51:11
[ "ffsend" ]
https://linux.cn/article-11042-1.html
![](/data/attachment/album/201907/01/125114fxkxirjjmjz7uxxv.png) `ffsend` 是 Firefox Send 的命令行客户端。本文将展示 Firefox Send 和 `ffsend` 如何工作。还会详细介绍如何在 Fedora 中安装和使用它。 ### 什么是 Firefox Send 和 ffsend? Firefox Send 是 Mozilla 的一个文件共享工具,它能将加密文件发送给其他用户。你可以在自己的服务器上安装 Send,也可以使用 Mozilla 托管的链接 [send.firefox.com](http://send.firefox.com/)。它最大支持 1GB 的文件,链接会在可配置的下载次数(默认值为 1)或 24 小时后过期,然后会删除发送服务器上的所有文件。此工具仍*处于实验阶段*,因此不应在生产中使用或共享重要或敏感数据。 虽然 Firefox Send 本身就是工具,并且可以在 Web 中使用,但 `ffsend` 是一个可以与脚本和参数一起使用的命令行程序。它有多种配置选项,并且可以在后台工作而无需任何人为干预。 ### 它如何工作? `ffsend` 可以上传和下载文件。远程主机可以使用 Firefox 工具或其他 Web 浏览器来下载文件。 Firefox Send 和 `ffsend` 都不需要使用 Firefox。 值得一提 `ffsend` 使用了客户端加密。这意味着文件在上传*前*被加密。链接中就有密钥,因此在共享时要小心,因为任何有链接的人都可以下载该文件。作为额外的保护,你可以使用以下参数使用密码保护文件: ``` ffsend password URL -p PASSWORD ``` ### 其他功能 还有一些值得一提的其他功能: * 链接到期前可配置的下载限制,范围从 1 到 20 次之间 * 内置解压和归档功能 * 跟踪共享文件的历史记录 * 检查或删除共享文件 * 文件夹也可以按原样共享,也可以作为压缩文件共享 * 生成 QR 码,便于在手机上下载 ### 如何在 Fedora 中安装 虽然 Fedora Send 可以在 Firefox 中使用而无需安装其他,但你需要安装 CLI 工具才能使用 `ffsend`。此工具在官方仓库中,因此你只需使用 `dnf` 命令,并使用 [sudo](https://fedoramagazine.org/howto-use-sudo/)。 ``` $ sudo dnf install ffsend ``` 之后,你可以在终端使用 `ffsend`。 ### 上传文件 上传文件很简单。 ``` $ ffsend upload /etc/os-release Upload complete Share link: https://send.firefox.com/download/05826227d70b9a4b/#RM_HSBq6kuyeBem8Z013mg ``` 现在可以使用 “Share link” URL 轻松共享该文件。 ### 下载文件 下载文件和上传一样简单。 ``` $ ffsend download https://send.firefox.com/download/05826227d70b9a4b/#RM_HSBq6kuyeBem8Z013mg Download complete ``` 在下载之前,检查文件是否存在并获取有关它的信息会有用。`ffsend` 为此提供了 2 个方便的命令。 ``` $ ffsend exists https://send.firefox.com/download/88a6324e2a99ebb6/#YRJDh8ZDQsnZL2KZIA-PaQ Exists: true Password: false $ ffsend info https://send.firefox.com/download/88a6324e2a99ebb6/#YRJDh8ZDQsnZL2KZIA-PaQ ID: 88a6324e2a99ebb6 Downloads: 0 of 1 Expiry: 23h59m (86388s ``` ### 上传历史 `ffsend` 还提供了一种查看使用工具上传的历史记录的方法。例如,如果你用脚本上传了大量文件并且想要跟踪每个文件的下载状态,那么这非常有用。 ``` $ ffsend history LINK EXPIRY 1 https://send.firefox.com/download/#8TJ9QNw 23h59m 2 https://send.firefox.com/download/KZIA-PaQ 23h54m ``` ### 删除文件 另一个有用的功能是删除文件。 ``` ffsend delete https://send.firefox.com/download/2d9faa7f34bb1478/#phITKvaYBjCGSRI8TJ9QNw ``` Firefox Send 是一项很棒的服务,`ffsend` 使得它在终端使用起来非常方便。[Gitlab 仓库](https://gitlab.com/timvisee/ffsend)中有关于 `ffsend` 的更多示例和文档。 --- via: <https://fedoramagazine.org/use-firefox-send-with-ffsend-in-fedora/> 作者:[Sylvia Sánchez](https://fedoramagazine.org/author/lailah/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
*ffsend* is the command line client of Firefox Send. This article will show how Firefox Send and *ffsend* work. It’ll also detail how it can be installed and used in Fedora. ### What are Firefox Send and ffsend ? Firefox Send is a file sharing tool from Mozilla that allows sending encrypted files to other users. You can install Send on your own server, or use the Mozilla-hosted link [send.firefox.com](http://send.firefox.com/). The hosted version officially supports files up to 1 GB, and links that expire after a configurable download count (default of 1) or 24 hours, and then all the files on the Send server are deleted. This tool is still *in experimental phase*, and therefore shouldn’t be used in production or to share important or sensitive data. While Firefox Send is the tool itself and can be used with a web interface, *ffsend* is a command-line utility you can use with scripts and arguments. It has a wide range of configuration options and can be left working in the background without any human intervention. ### How does it work? FFSend can both upload and download files. The remote host can use either the Firefox tool or another web browser to download the file. Neither Firefox Send nor *ffsend* require the use of Firefox. It’s important to highlight that *ffsend* uses client-side encryption. This means that files are encrypted *before* they’re uploaded. You share secrets together with the link, so be careful when sharing, because anyone with the link will be able to download the file. As an extra layer of protection, you can protect the file with a password by using the following argument: ffsend password URL -p PASSWORD ### Other features There are a few other features worth mentioning. Here’s a list: - Configurable download limit, between 1 and 20 times, before the link expires - Built-in extract and archiving functions - Track history of shared files - Inspect or delete shared files - Folders can be shared as well, either as they are or as compressed files - Generate a QR code, for easier download on a mobile phone ### How to install in Fedora While Fedora Send works with Firefox without installing anything extra, you’ll need to install the CLI tool to use *ffsend*. This tool is in the official repositories, so you only need a simple *dnf* command [with ](https://fedoramagazine.org/howto-use-sudo/)* sudo*. $ sudo dnf install ffsend After that, you can use *ffsend* from the terminal . ### Upload a file Uploading a file is a simple as $ ffsend upload /etc/os-release Upload complete Share link: https://send.firefox.com/download/05826227d70b9a4b/#RM_HSBq6kuyeBem8Z013mg The file now can be easily share using the Share link URL. ## Downloading a file Downloading a file is as simple as uploading. $ ffsend download https://send.firefox.com/download/05826227d70b9a4b/#RM_HSBq6kuyeBem8Z013mg Download complete Before downloading a file it might be useful to check if the file exist and get information about it. *ffsend* provides 2 handy commands for that. $ ffsend exists https://send.firefox.com/download/88a6324e2a99ebb6/#YRJDh8ZDQsnZL2KZIA-PaQ Exists: true Password: false $ ffsend info https://send.firefox.com/download/88a6324e2a99ebb6/#YRJDh8ZDQsnZL2KZIA-PaQ ID: 88a6324e2a99ebb6 Downloads: 0 of 1 Expiry: 23h59m (86388s ## Upload history *ffsend* also provides a way to check the history of the uploads made with the tools. This can be really useful if you upload a lot of files during a scripted tasks for example and you want to keep track of each files download status. $ ffsend history LINK EXPIRY 1 https://send.firefox.com/download/#8TJ9QNw 23h59m 2 https://send.firefox.com/download/KZIA-PaQ 23h54m ## Delete a file Another useful feature is the possibility to delete a file. ffsend delete https://send.firefox.com/download/2d9faa7f34bb1478/#phITKvaYBjCGSRI8TJ9QNw Firefox Send is a great service and the *ffsend* tools makes it really convenient to use from the terminal. More examples and documentation is available on *ffsend*‘s [Gitlab repository](https://gitlab.com/timvisee/ffsend). ## Kamil Perhaps we should introduce some QA to fedoramagazine articles? $ sudo dnf install ffsend No match for argument: ffsend Error: Unable to find a match ## Artem Try not disable module repo then. Installed Packages Name : ffsend Version : 0.2.46 ## Hans-Joachim Bothe sudo dnf install ffsend works nicely on Fedora 30. Probably no version for older Fedora available. ## Igor Gnatenko It is available all the way back to Fedora 28 (although there modular repos were still separate). ## Kamil Turns out this is a module and not a standard package. And not even Fedora Packages app can show it: https://apps.fedoraproject.org/packages/s?search=ffsend Oh Modularity, how we love you… ## Artem https://bodhi.fedoraproject.org/updates/?packages=ffsend%3Alatest https://src.fedoraproject.org/rpms/rust-ffsend ## Igor Gnatenko @Kamil, yes. You are not supposed to disable modular repositories 🙂 ## Rick I don’t use Firefox any more. Mozilla has gone woke. They had a good run. ## Tim Visée Note that this isn’t a Firefox component. Firefox is just in the name. You can use this in any browser, and of course, through the CLI. ## Rick Graham Thanks. ## Avi Wadhwa what do you mean “woke”? ## Robert Fairbrother i noticed a few problems for a wile but i think they bounced back. i just hope this isin’t a tactic from infiltrators to get Mozilla in trouble 50.66.39.177 ## Charles Very interesting product/service from Mozilla. Thank you for writing the article. ## Mohnish Is ever aware of the share URL OR is the share URL all local client side affair? ## Tim Visée No. The server creates the download URL with the file ID, but this isn’t enough to decrypt and download. The client then appends the secret (as a hash) to the URL, to allow decryption. So, this required secret is never on the server. ## Jose M. Acosta I like to know what meaning text below trancribed when I tgry to u install upgrade fedora29 nnot download flash-player-npapi-32.0.0.192-release.x86_64.rpm: All mirrors were tried; Last error: Interrupted by header callback: Server reports Content-Length: 5264400 but expected size is: 9026892 ## Rick Graham Looks like it can’t get the flash player upgrade. Flash is a security hole, you prolly don’t want it anyway. It may be required for DRM, dunno, I don’t allow that either.
11,043
在 Linux 中锁定和解锁用户帐户的三种方法
https://www.2daygeek.com/lock-unlock-disable-enable-user-account-linux/
2019-07-01T17:04:22
[ "账号" ]
https://linux.cn/article-11043-1.html
![](/data/attachment/album/201907/01/170410j3tp77ymda3i9wz7.jpg) 如果你已经在你的组织中实施了某种密码策略,你无需看这篇文章了。但是在这种情况下,如果你给账户设置了 24 小时的锁定期,你需要手动解锁用户帐户。 本教程将帮助你在 Linux 中手动锁定和解锁用户帐户。 这可以通过三种方式使用以下两个 Linux 命令来完成。 * `passwd`:用于更新用户的身份验证令牌。这个任务是通过调用 Linux PAM 和 libuser API 来实现。 * `usermod`:用于修改/更新给定用户的帐户信息。它用于将用户添加到特定的组中等等功能。 为了说明这一点,我们选择 `daygeek` 用户帐户。让我们看看,怎么一步步来实现的。 请注意,你必须使用你需要锁定或解锁的用户的帐户,而不是我们的帐户。你可以使用 `id` 命令检查给定的用户帐户在系统中是否可用。是的,我的这个帐户在我的系统中是可用的。 ``` # id daygeek uid=2240(daygeek) gid=2243(daygeek) groups=2243(daygeek),2244(ladmin) ``` ### 方法1: 如何使用 passwd 命令锁定、解锁和检查 Linux 中给定用户帐户的状态? `passwd` 命令是 Linux 管理员经常使用的命令之一。它用于更新 `/etc/shadow` 文件中用户的身份验证令牌。 使用 `-l` 开关运行 `passwd` 命令,锁定给定的用户帐户。 ``` # passwd -l daygeek Locking password for user daygeek. passwd: Success ``` 你可以通过 `passwd` 命令或从 `/etc/shadow` 文件中获取给定用户名来检查锁定的帐户状态。 使用 `passwd` 命令检查用户帐户锁定状态。 ``` # passwd -S daygeek 或 # passwd --status daygeek daygeek LK 2019-05-30 7 90 7 -1 (Password locked.) ``` 这将输出给定帐户密码状态的简短信息。 * `LK`:密码被锁定 * `NP`:没有设置密码 * `PS`:密码已设置 使用 `/etc/shadow` 文件检查锁定的用户帐户状态。如果帐户已被锁定,密码前面将添加两个感叹号。 ``` # grep daygeek /etc/shadow daygeek:!!$6$tGvVUhEY$PIkpI43HPaEoRrNJSRpM3H0YWOsqTqXCxtER6rak5PMaAoyQohrXNB0YoFCmAuh406n8XOvBBldvMy9trmIV00:18047:7:90:7::: ``` 使用 `-u` 开关运行 `passwd` 命令,可以解锁给定的用户帐户。 ``` # passwd -u daygeek Unlocking password for user daygeek. passwd: Success ``` ### 方法2:如何使用 usermod 命令在 Linux 中锁定、解锁和检查给定用户帐户的状态? `usermod` 命令也经常被 Linux 管理员使用。`usermod` 命令用于修改/更新给定用户的帐户信息。它用于将用户添加到特定的组中,等等。 使用 `-L` 开关运行 `usermod` 命令,锁定给定的用户帐户。 ``` # usermod --lock daygeek 或 # usermod -L daygeek ``` 你可以通过 `passwd` 命令或从 `/etc/shadow` 文件中获取给定用户名来检查锁定的帐户状态。 使用 `passwd` 命令检查用户帐户锁定状态。 ``` # passwd -S daygeek 或 # passwd --status daygeek daygeek LK 2019-05-30 7 90 7 -1 (Password locked.) ``` 这将输出给定帐户密码状态的简短信息。 * `LK`:密码被锁定 * `NP`:没有设置密码 * `PS`:密码已设置 使用 `/etc/shadow` 文件检查锁定的用户帐户状态。如果帐户已被锁定,密码前面将添加两个感叹号。 ``` # grep daygeek /etc/shadow daygeek:!!$6$tGvVUhEY$PIkpI43HPaEoRrNJSRpM3H0YWOsqTqXCxtER6rak5PMaAoyQohrXNB0YoFCmAuh406n8XOvBBldvMy9trmIV00:18047:7:90:7::: ``` 使用 `-U` 开关运行 `usermod` 命令以解锁给定的用户帐户。 ``` # usermod --unlock daygeek 或 # usermod -U daygeek ``` ### 方法-3:如何在 Linux 中使用 usermod 命令禁用、启用对给定用户帐户的 SSH 访问? `usermod` 命令也是经常被 Linux 管理员使用的命令。`usermod` 命令用于修改/更新给定用户的帐户信息。它用于将用户添加到特定的组中,等等。 替代的,锁定可以通过将 `nologin` shell 分配给给定用户来完成。为此,可以运行以下命令。 ``` # usermod -s /sbin/nologin daygeek ``` 你可以通过从 `/etc/passwd` 文件中给定用户名来检查锁定的用户帐户详细信息。 ``` # grep daygeek /etc/passwd daygeek:x:2240:2243::/home/daygeek:/sbin/nologin ``` 我们可以通过分配回原来的 shell 来启用用户的 ssh 访问。 ``` # usermod -s /bin/bash daygeek ``` ### 如何使用 shell 脚本锁定、解锁和检查 Linux 中多个用户帐户的状态? 如果你想锁定/解锁多个帐户,那么你需要找个脚本。 是的,我们可以编写一个小的 shell 脚本来执行这个操作。为此,请使用以下 shell 脚本。 创建用户列表。每个用户信息在单独的行中。 ``` $ cat user-lists.txt u1 u2 u3 u4 u5 ``` 使用以下 shell 脚本锁定 Linux中 的多个用户帐户。 ``` # user-lock.sh #!/bin/bash for user in `cat user-lists.txt` do passwd -l $user done ``` 将 `user-lock.sh` 文件设置为可执行权限。 ``` # chmod + user-lock.sh ``` 最后运行脚本来达成目标。 ``` # sh user-lock.sh Locking password for user u1. passwd: Success Locking password for user u2. passwd: Success Locking password for user u3. passwd: Success Locking password for user u4. passwd: Success Locking password for user u5. passwd: Success ``` 使用以下 shell 脚本检查锁定的用户帐户。 ``` # vi user-lock-status.sh #!/bin/bash for user in `cat user-lists.txt` do passwd -S $user done ``` 设置 `user-lock-status.sh` 可执行权限。 ``` # chmod + user-lock-status.sh ``` 最后运行脚本来达成目标。 ``` # sh user-lock-status.sh u1 LK 2019-06-10 0 99999 7 -1 (Password locked.) u2 LK 2019-06-10 0 99999 7 -1 (Password locked.) u3 LK 2019-06-10 0 99999 7 -1 (Password locked.) u4 LK 2019-06-10 0 99999 7 -1 (Password locked.) u5 LK 2019-06-10 0 99999 7 -1 (Password locked.) ``` 使用下面的 shell 脚本来解锁多个用户。 ``` # user-unlock.sh #!/bin/bash for user in `cat user-lists.txt` do passwd -u $user done ``` 设置 `user-unlock.sh` 可执行权限。 ``` # chmod + user-unlock.sh ``` 最后运行脚本来达成目标。 ``` # sh user-unlock.sh Unlocking password for user u1. passwd: Success Unlocking password for user u2. passwd: Success Unlocking password for user u3. passwd: Success Unlocking password for user u4. passwd: Success Unlocking password for user u5. passwd: Success ``` 运行相同的 shell 脚本 `user-lock-status.sh`,检查这些锁定的用户帐户在 Linux 中是否被解锁。 ``` # sh user-lock-status.sh u1 PS 2019-06-10 0 99999 7 -1 (Password set, SHA512 crypt.) u2 PS 2019-06-10 0 99999 7 -1 (Password set, SHA512 crypt.) u3 PS 2019-06-10 0 99999 7 -1 (Password set, SHA512 crypt.) u4 PS 2019-06-10 0 99999 7 -1 (Password set, SHA512 crypt.) u5 PS 2019-06-10 0 99999 7 -1 (Password set, SHA512 crypt.) ``` --- via: <https://www.2daygeek.com/lock-unlock-disable-enable-user-account-linux/> 作者:[Magesh Maruthamuthu](https://www.2daygeek.com/author/magesh/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[heguangzhi](https://github.com/heguangzhi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
404
Not Found
null
11,044
100 个最佳 Ubuntu 应用(上)
https://linuxhint.com/100_best_ubuntu_apps/
2019-07-01T17:44:00
[ "Ubuntu", "应用" ]
https://linux.cn/article-11044-1.html
今年早些时候我们发布了一个 [2018 年最好的 20 个 Ubuntu 应用](https://linuxhint.com/applications-2018-ubuntu/)列表,可能对很多用户来说都很有用。现在我们几乎到 2018 年下半年了(LCTT 译注:好吧,我们翻译的有些晚了,顺便打个广告,[LCTT 欢迎你,有志于通过翻译为开源做些贡献的同学!](https://linux.cn/lctt/)),所以今天我们打算看一下 Ubuntu 上最好的 100 个应用,你可能会觉得有帮助。 ![100 Best Ubuntu Apps](/data/attachment/album/201907/01/175121j727q0mv0bq07qkb.png) 很多用户最近从 Microsoft Windows 转换到了 Ubuntu,可能面临着这样一个困境:寻找它们之前使用了数年的操作系统上的应用软件的最好替代应用。Ubuntu 拥有上千个免费使用和开源应用软件,比 Windows 和其它 OS 上的付费软件运行的更好。 下列列表归纳了各种分类下很多应用软件的功能特点,因此,你可以找到匹配你的需求的最好的应用。 ### 1、Google Chrome 浏览器 几乎所有 Linux 发行版都默认安装了 Mozilla Firefox 网络浏览器,它是 Google Chrome 的强力竞争对手。但是 Chrome 相对 Firefox 而言有它自己的优点,比如它可以让你直接访问你的 Google 账户,你可以通过它来同步你在其它操作系统和手机上的 Chrome 浏览器的书签、浏览历史、扩展等等。 ![Chrome](/data/attachment/album/201907/01/175122fl8lnezleziuelrf.png) Google Chrome 为 Linux 集成了最新的 Flash 播放器,其它 Linux 上的浏览器像 Mozilla Firefox 和 Opera 网络浏览器则不是这样。如果你在 Windows 上经常使用 Chrome,那么在 Linux 上也用它是最好的选择。 ### 2、Steam 现在在 Linux 上玩游戏已经不是问题了,这在很多年前还是一个遥不可及的梦。在 2013 年,Valve 发布了 Linux 上的 Steam 游戏客户端,此后一切都变了。早期用户犹豫着从 Windows 转到 Linux,只是因为他们不能在 Ubuntu 上玩它们最喜欢的游戏,但是现在已经不是这样了。 ![Steam](/data/attachment/album/201907/01/175127m89k7hhx8vt67xhz.png) 一些用户可能发现在 Linux 上安装 Steam 有点棘手,但如果能在 Linux 上玩上千的 Steam 游戏这么做就是值得的。一些流行的高端游戏,如《反恐精英:全球攻势》、《Hitman》、《Dota 2》在 Linux 上都能获取,你只需要确保你满足玩这些游戏的最小硬件需求。 ``` $ sudo add-apt-repository multiverse $ sudo apt-get update $ sudo apt-get install steam ``` ### 3、WordPress 桌面客户端 是的,没错,WordPress 有它专属的 Ubuntu 平台的客户端,你可以用来管理你的 WordPress 站点。你可以在桌面客户端上撰写和设计你的站点而不用转到浏览器。 ![](/data/attachment/album/201907/01/175130h8kmmh45zmkq34qx.png) 如果你拥有使用 WordPress 建立的站点,那么这个桌面客户端就是你必备的应用,它能够让你在单个窗口内追踪所有的 WordPress 通知。你也可以查看你的站点上的博客数据。桌面客户端可以在 Ubuntu 软件中心中获取,你可以在那里下载和安装。 ### 4、VLC 媒体播放器 VLC 是一个非常流行的跨平台的开源媒体播放器,同样在 Ubuntu 中可以获取。使得 VLC 成为一个最好的媒体播放器的原因是它能够毫无问题地播放世界上任何音频视频格式。 ![](/data/attachment/album/201907/01/175143hhc3h3a7r23z2t3a.png) VLC 有一个平滑的用户界面,易于使用,除此之外,它提供了很多功能,包括在线视频流、音频和视频自定义等。 ``` $ sudo add-apt-repository ppa:videolan/master-daily $ sudo apt update $ sudo apt-get install vlc qtwayland5 ``` ### 5、Atom 文本编辑器 由 GitHub 开发的 Atom 是一个自由开源的文本编辑器,它同样能够被用做集成开发环境(IDE)来进行主流编程语言的编码和编辑。Atom 开发者声称它是完全可魔改的 21 世纪文本编辑器。 ![](/data/attachment/album/201907/01/175147egmfpgrmato2cofh.png) Atom 文本编辑器拥有最佳的用户界面,它是一个富文本编辑器,提供了自动补全、语法高亮,支持扩展与插件。 ``` $ sudo add-apt-repository ppa:webupd8team/atom $ sudo apt-get update $ sudo apt-get install atom ``` ### 6、GIMP 图像编辑器 GIMP(GNU 图形操作程序)是 Ubuntu 上的自由开源的图像编辑器。无疑它是 Windows 上 Adobe Photoshop 的最好替代品。如果你过去经常用 Adobe Photoshop,会觉得很难习惯 GIMP,但是你可以自定义 GIMP 使它看起来与 Photoshop 非常相似。 ![](/data/attachment/album/201907/01/175201g2gzuf4n34fupif4.png) GIMP 是一个功能丰富的图片编辑器,你可以随时通过安装扩展和插件来使用附加的功能。 ``` $ sudo apt-get install gimp ``` ### 7、Google Play 音乐桌面播放器 Google Play 音乐桌面播放器是一个开源的音乐播放器,它是 Google Play 音乐的一个复制品,或者说比它更好。Google 一直少个桌面的音乐客户端,但第三方的应用完美的填充了空白。 ![](/data/attachment/album/201907/01/175208t9sg5qk5cdafaqc1.png) 就像你在上面的截屏里看到的,它的界面在外观和感觉上都是首屈一指的。你只需要登录 Google 账户,之后就会导入你的所有音乐和收藏到桌面客户端里。你可以从它的官方[站点](https://www.googleplaymusicdesktopplayer.com/)下载安装文件并使用软件中心安装它。 ### 8、Franz Franz 是一个即时消息客户端,它将聊天和信息服务结合到了一个应用中。它是一个现代化的即时消息平台,在单个应用中支持了 Facebook Messenger、WhatsApp、Telegram、微信、Google Hangouts、 Skype。 ![](/data/attachment/album/201907/01/175215mqryyylty2fgqihy.png) Franz 是一个完备的消息平台,你可以用于商业中管理大量的客户服务。要安装 Franz,你需要从它的[网站](https://meetfranz.com/#download)下载安装包,在软件中心中打开。 ### 9、新立得包管理器 新立得包管理器是 Ubuntu 上必有工具之一,因为它为我们通常在终端里安装软件的 `apt-get` 命令提供了用户图形界面。它是各种 Linux 发行版中的默认应用商店的强力对手。 ![](/data/attachment/album/201907/01/175223jj66ddmsss65iyss.png) 新立得拥有非常简单的用户图形界面,相比其它的应用商店非常快并易于使用。在左手边你可以浏览不同分类的各种应用,也可以轻松安装和卸载。 ``` $ sudo apt-get install synaptic ``` ### 10、Skype Skype 是一个非常流行的跨平台视频电话应用,如今在 Linux 系统可以以 Snap 应用方式获取。Skype 是一个即时通信应用,它提供了视频和音频通话、桌面共享等功能。 ![](/data/attachment/album/201907/01/175232v5iht68hj226tj21.png) Skype 有一个优秀的用户图形界面,与 Windows 上的桌面客户端非常相似,易于使用。它对于从 Windows 上转换来的用户来说非常有用。 ``` $ sudo snap install skype ``` ### 11、VirtualBox VirtualBox 是由 Oracle 公司开发的跨平台的虚拟化软件应用(LCTT 译注:实际上是由被 Oracle 公司收购的 Sun 公司开发的,包括 Java、Solaris 也是)。如果你喜欢尝试新的操作系统,那么 VirtualBox 是你必备的 Ubuntu 应用。你可以在 Windows 内尝试 Linux、Mac,也可以在 Linux 系统内尝试 Windows 和 Mac。 ![](/data/attachment/album/201907/01/175240f8ud855rf2tdwtwr.png) VirtualBox 实际做的是让你在宿机操作系统里可视化地运行访客操作系统。它可以创建虚拟硬盘并在上面安装访客操作系统。你可以在 Ubuntu 软件中心直接下载和安装它。 ### 12、Unity Tweak 工具 Unity Tweak 工具(Gnome Tweak 工具)对于每个 Linux 用户都是必须拥有的,因为它给了用户根据需要自定义桌面的能力。你可以尝试新的 GTK 主题、设置桌面热角、自定义图标集、调整 unity 启动器等等。 ![](/data/attachment/album/201907/01/175247pdjxyyddindx2n2t.png) Unity Tweak 工具对于用户来说可能非常有用,因为它包含了从基础到高级配置的所有内容。 ``` $ sudo apt-get install unity-tweak-tool ``` ### 13、Ubuntu Cleaner Ubuntu Cleaner 是一个系统管理工具,其被特别设计用来移除不再使用的包、不需要的应用和清理浏览器缓存。Ubuntu Cleaner 有易于使用的简单用户界面。 ![](/data/attachment/album/201907/01/175251dbibpcmaczgdbgtf.png) Ubuntu Cleaner 是 BleachBit 最好的替代品之一,BleachBit 是 Linux 发行版上的相当好的清理工具。 ``` $ sudo add-apt-repository ppa:gerardpuig/ppa $ sudo apt-get update $ sudo apt-get install ubuntu-cleaner ``` ### 14、Visual Studio Code Visual Studio Code 是一个代码编辑器,你会发现它与你可能曾用过的 Atom 文本编辑器和 Sublime Text 非常相似。Visual Studio Code 被证明是非常好的教育工具,因为它可以对编程中的从 HTML 标签到语法的所有东西做出解释。 ![](/data/attachment/album/201907/01/175255t7uxivnk2ibxvovv.png) Visual Studio 自身集成了 Git,它有优秀的用户界面,你会发现它与 Atom Text Editor 和 Sublime Text 非常相似。你可以从 Ubuntu 软件中心下载和安装它。 ### 15、Corebird 如果你在找你可以使用 Twitter 的桌面客户端,那 Corebird Twitter 客户端就是你在找的。它被视为 Linux 发行版下可获得的最好的 Twitter 客户端,它提供了与你手机上的 Twitter 应用非常相似的功能。 ![](/data/attachment/album/201907/01/175302e6tzt3eti9f0e733.png) 当有人喜欢或者转发你的 tweet 或者给你发消息时,Corebird Twitter 客户端同样会给你通知。你同样可以在这个客户端上添加多个 Twitter 账户。 ``` $ sudo snap install corebird ``` ### 16、Pixbuf Pixbuf 是来自 Pixbuf 图片社区中心的一个桌面客户端,可以让你上传、分享和出售你的相片。它支持图片共享,如像 Facebook、Pinterest、Instagram、Twitter 等社交媒体,以及像 Flickr、500px 和 Youpic 等相片服务。 ![](/data/attachment/album/201907/01/175307otf9c101t2771ox1.png) Pixbuf 提供了分析等功能,可以让你统计点击量、转发量、照片的回复数、定时发帖、iOS 专有的扩展信息。它同样有移动应用,因此你可以在任何地方连接到你的 Pixbuf 账户。Pixbuf 可以在 Ubuntu 软件中心以 Snap 包的形式获得。 ### 17、Clementine 音乐播放器 Clementine 是一个跨平台的音乐播放器,并且是 Ubuntu 上默认音乐播放器 Rhythmbox 的良好竞争者。它是一个快速而易用的音乐播放器,其用户界面友好。它支持所有主流音频文件格式的回放。 ![](/data/attachment/album/201907/01/175312c8tatawt87kkb4n8.png) 除了可以播放本地库中的音乐,你也可以在线听 Spotify、SKY.fm、Soundcloud 等的广播。它也支持其它的功能像智能和动态播放列表,可以从像 Dropbox、Google Drive 这样的云存储中同步音乐。 ``` $ sudo add-apt-repository ppa:me-davidsansome/clementine $ sudo apt-get update $ sudo apt-get install clementine ``` ### 18、Blender Blender 是一个自由开源的 3D 创建应用软件,你可以用来创建 3D 打印模型、动画电影、视频游戏等。它自身集成了游戏引擎,你可以用来开发和测试视频游戏。 ![blender](/data/attachment/album/201907/01/175317l3q4dd4vz2o32yco.jpg) Blender 拥有赏心悦目的用户界面,易于使用,它包括了内置的渲染引擎、数字雕刻、仿真工具、动画工具,还有很多。考虑到它免费和它的特点,你甚至会认为它可能是 Ubuntu 上最好的应用之一。 ### 19、Audacity Audacity 是一个开源的音频编辑应用,你可以用来记录、编辑音频文件。你可以从各种输入中录入音频,包括麦克风、电子吉它等等。它提供了根据你的需要编辑和裁剪音频的能力。 ![](/data/attachment/album/201907/01/175321w0ivfe5wldllql6i.png) 最近 Audacity 发布了 Ubuntu 上的新版本,新特点包括主题改进、放缩命令等。除了这些,它还提供了降噪等音频效果的功能。 ``` $ sudo add-apt-repository ppa:ubuntuhandbook1/audacity $ sudo apt-get update $ sudo apt-get install audacity ``` ### 20、Vim Vim 是一个集成开发环境,你可以以一个独立应用或 CLI 程序使用它,用于各种像 Python 等主流编程语言的编程。 ![](/data/attachment/album/201907/01/175328le55eaadazeztekz.png) 大多数程序员喜欢在 Vim 中编写代码,因为它快速并且是一个可高度定制的集成开发环境。最初你可能觉得有点难用,但你会很快习惯它。 ``` $ sudo apt-get install vim ``` ### 21、Inkscape Inkscape 是一个开源和跨平台的矢量图形编辑器,你会觉得它和 Corel Draw 和 Adobe Illustrator 很相似。用它可以创建和编辑矢量图形例如柱形图、徽标、图表、插图等。 ![](/data/attachment/album/201907/01/175332w7hyjnb5nyjhiiez.png) Inkscape 使用可缩放矢量图形(SVG),这是一个基于 XML 的 W3C 标准格式。它支持各种格式,包括 JPEG、PNG、GIF、PDF、AI(Adobe Illustrator 格式)、VSD 等等。 ``` $ sudo add-apt-repository ppa:inkscape.dev/stable $ sudo apt-get update $ sudo apt-get install inkscape ``` ### 22、Shotcut Shotcut 是一个 Meltytech, LLC 在 MLT 多媒体框架下开发的自由开源的跨平台视频编辑应用。你会发现它是 Linux 发行版上最强大的视频编辑器之一,它支持所有主要的音频、视频、图片格式。 ![](/data/attachment/album/201907/01/175337zgi7mqz9f1gimiyu.png) 它提供了非线性编辑多轨编辑各种文件格式的视频的能力。它支持 4K 视频分辨率和各种音频、视频过滤、语气生成、音频混合和很多其它的。 ``` snap install shotcut -- classic ``` ### 23、SimpleScreenRecorder SimpleScreenRecorder 是 Ubuntu 上的一个免费而轻量级的屏幕录制工具。如果你是 YouTube 创作者或应用开发者,屏幕录制功能非常有用。 ![](/data/attachment/album/201907/01/175346l4faqufvqfwhd6cc.png) 它可以捕获桌面屏幕的视频/音频记录或直接录制视频游戏。在录制屏幕前,你可以设置视频分辨率、帧率等。它有简单的用户界面,你会发现非常易用。 ``` $ sudo add-apt-repository ppa:maarten-baert/simplescreenrecorder $ sudo apt-get update $ sudo apt-get install simplescreenrecorder ``` ### 24、Telegram Telegram 是一个基于云的即时通信和网络电话平台,近年来非常流行。它是开源和跨平台的,用户可以用来发送消息,共享视频、图片、音频和其它文件。 ![](/data/attachment/album/201907/01/175350ccxyejmcrtxem9rd.png) Telegram 中容易注意到的特点是加密聊天、语音信息、机器人、远程视频通话、在线位置和社交登录。在 Telegram 中隐私和安全拥有最高优先级,因此,所有你发送和接收的是端对端加密的。 ``` $ sudo snap install telegram-desktop ``` ### 25、ClamTk 正如我们知道的,危害 Windows PC 的病毒不能危害 Ubuntu,但是可能被来自包含破坏性文件的 Windows PC 中的邮件所感染。因此,在 Linux 上有一些抗病毒应用是安全的。 ![](/data/attachment/album/201907/01/175400c66imvciz5s5mvcv.png) ClamTk 是一个轻量级的病毒扫描器,可以扫描系统中的文件和文件夹并清理发现的有害文件。ClamTk 可以 Snap 包的形式获得,可以从 Ubuntu 软件中心下载。 ### 26、MailSpring MailSpring 早期名为 Nylas Mail 或 Nylas N1,是开源的邮件客户端。它在电脑本地保存所有的邮件,因此你可以在任何需要的时候访问它。它提供了高级搜索的功能,可以使用“与”和“或”操作,因此你可以基于不同的参数搜索邮件。 ![](/data/attachment/album/201907/01/175409blvjpyvuzlsplsuj.png) MailSpring 有着和其它易于上手的邮件客户端同样优秀的用户界面。MailSpring 同样提供了私密性、安全性、日程、通讯录管理、日历等功能特点。 ### 27、PyCharm 继 Vim 之后,PyCharm 是我最喜欢的的 Python IDE 之一,因为它有优雅的用户界面,有很多扩展和插件支持。基本上,它有两个版本,一个是自由开源的社区版,另一个是付费的专业版。 ![](/data/attachment/album/201907/01/175412sz40wrguwuw1avjg.png) PyCharm 是可高度自定义的 IDE 并且有很多功能,如错误高亮、代码分析、集成单元测试和 Python 调试器等。PyCharm 对于大多数 Python 程序员和开发者来说是首选 IDE。 ### 28、咖啡因 想象一下你在 Youtube 上看视频或阅读一篇新文章,突然你的 Ubuntu 锁屏了,我知道它很烦人。我们很多人都会遇到这种情况,所以咖啡因是一个阻止 Ubuntu 锁屏或屏幕保护程序的工具。 ![](/data/attachment/album/201907/01/175417oo0uuo3p3upht8pm.png) 咖啡因指示器是一个轻量级的工具,它添加图标到通知栏,你可以在那里轻松的激活或禁止它。不需要额外的设置。 ``` $ sudo add-apt-repository ppa:eugenesan/ppa $ sudo apt-get update $ sudo apt-get install caffeine -y ``` ### 29、Etcher USB 镜像写入器 Etcher 是一个由 resin.io 开发的 USB 镜像写入器。它是一个跨平台的应用,可以帮助你将 ZIP、ISO、IMG 格式的镜像文件写入到 USB 存储中。如果你经常尝试新的操作系统,那么 Ethcher 是你必有的简单可靠的工具。 ![](/data/attachment/album/201907/01/175424jms2zljw26osdxd9.png) Etcher 有干净的用户界面,可以指导你在三步内烧录镜像到 USB 驱动或 SD 卡的过程。步骤包括选择镜像文件、选择 USB 驱动 和最终的烧录(写文件到 USB 驱动)。你可以从它的[官网](https://etcher.io/)下载和安装 Etcher。 ### 30、Neofetch Neofetch 是一个酷炫的系统信息工具,通过在终端中运行 `neofetch` 命令,它会给你关于你的系统的所有信息。它酷是因为它可以给你关于桌面环境、内核版本、bash 版本和你正在运行的 GTK 主题的信息。 ![](/data/attachment/album/201907/01/175434jk3aiqfkf3gqrlr0.png) 与其它系统信息工具比较,Nefetch 是高度自定义的工具。你可以使用命令行进行各种自定义。 ``` $ sudo add-apt-repository ppa:dawidd0811/neofetch $ sudo apt-get update $ sudo apt-get update install neofetch ``` ### 31、Liferea Liferea(Linux 订阅阅读器)是一个自由开源的新闻聚合工具,用于在线新闻订阅。使用新的聚合非常快捷和简单,支持各种格式例如 RSS/RDF,Atom 等。 ![](/data/attachment/album/201907/01/175436lqd6wxls8sxmdxlx.png) Liferea 自带与 TinyTinyRSS 的同步支持,它给了你离线阅读的能力。你会发现,就可靠性和灵活性而言,它是 Linux 上最好的订阅工具之一。 ``` $ sudo add-apt-repository ppa:ubuntuhandbook1/apps $ sudo apt-get update $ sudo apt-get install liferea ``` ### 32、Shutter 在 Ubuntu 中很容易截屏,但当需要编辑截屏时 Shutter 是你必不可少的应用。它帮助你捕获、编辑和轻松的共享截屏。使用 Shutter 的选择工具,你可以选择屏幕的特定区域来截屏。 ![](/data/attachment/album/201907/01/175441yual11nohak1aqbg.png) Shutter 是一个功能强大的截图工具,提供了添加截图效果、画线等功能。它同样给你上传截屏到各种图像托管站点的选项。你可以直接在 Ubuntu 软件中心中下载和安装。 ### 33、Weather Weather 是一个小的应用,可以给你关于你的城市或世界上其它位置的实时天气信息。它简单而且轻量级,可以给你最多 7 天的详细天气预报和今明两天的每个小时的细节信息。 ![](/data/attachment/album/201907/01/175449zw3ymsmamj8wamca.png) 它集成在 GNOME shell 中,给你关于最近搜索位置的当前天气状态。它有极简的用户界面,在最小硬件需求下运行很顺畅。 (待续……) 所以这些就是 2018 年我为大家选择的 Ubuntu 上最好的 100 个应用了。所有列出的应用都在 Ubuntu 18.04 上测试了,肯定在老版本上也能运行。 --- via: <https://linuxhint.com/100_best_ubuntu_apps/> 作者:[Swapnil Tirthakar](https://linuxhint.com/author/swapnil/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[warmfrog](https://github.com/warmfrog) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
To make the best use of any operating system, you need the best set of applications and software. Similarly, to make the best use of Ubuntu, you need apps that are best in the business. We are now in 2023 and there are dozens of apps that are available for Ubuntu across various categories. Ubuntu ships-in with handful apps to start, just basic apps that help you use your new operating system. Different user needs different set of applications according to their need and use. In this article, we will give you a brief look into the 100 best apps for Ubuntu that you can install and use in 2023. Many users who recently switched to Ubuntu from Microsoft Windows or any other operating system face the dilemma of finding the best alternative to the application software that they have been using for years on their previous OS. Ubuntu has thousands of free-to-use and open-source application software that perform way better than many paid software on Windows and other OS. The following list features many applications in various categories so that you can find the best application that would best match your requirements. ## 1. Google Chrome Browser Almost all the Linux distributions feature the Mozilla Firefox web browser by default and it is a tough competitor to Google Chrome. But Chrome has its own advantages over Firefox like Chrome gives you direct access to your Google account from where you can sync your bookmarks, browser history, extensions, etc. from the Chrome browser on the other operating systems and mobile phones. Google Chrome features an up-to-date Flash player for Linux which is not the case with the other web browsers on Linux including Mozilla Firefox and Opera web browser. If you continuously use Chrome on Windows, it is the best choice to use it on Linux, too. ## 2. Steam Gaming on Linux is a real deal now which was only a distant dream few years ago. In 2013, Valve announced the Steam gaming client for Linux and everything has changed since then. Earlier users were hesitant to switch to Linux from Windows just because they would not be able to play their favourite games on Ubuntu, but that is not the case now. Some users might find the installation of Steam on Linux tricky but it’s worth all your efforts since thousands of Steam games are available for Linux. Some popular high-end games like Counter Strike: Global Offensive, Hitman, and Dota 2 are available for Linux; you just need to make sure that you have the minimum required hardware to play these games. $ sudo apt-get update $ sudo apt-get install steam ## 3. WordPress Desktop Client Yes, you read it right! WordPress has its dedicated desktop client for Ubuntu from where you can manage your WordPress sites. You can also write and design separately on the desktop client without the need to switch the browser tabs. If you have websites which are backed by WordPress, this desktop client is a must-have application for you as you can also keep track of all the WordPress notifications in one single window. You can also check the stats of the performance of your posts on the website. The WordPress desktop client is available in Ubuntu Software Centre from where you can download and install it. ## 4. VLC Media Player VLC is a very popular cross-platform and open-source media player which is also available for Ubuntu. What makes VLC a best media player is that it can play videos in all the audio and video formats available on planet without any issue. VLC has a slick user interface which is very easy to use. Apart from that, it offers a lot of features such as online video streaming, audio and video customization, etc. $ sudo apt update $ sudo apt-get install vlc qtwayland5 ## 5. Atom Text Editor Having developed by Github, Atom is a free and open-source text editor which can also be used as Integrated Development Environment (IDE) for coding and editing in major programming languages. Atom developers claim it to be a completely hackable text editor for the 21st Century. Atom Text Editor has one of the best user interfaces. It is a feature-rich text editor with features like auto-completion, syntax highlighting, and support of extensions and plug-ins. $ sudo apt-get update $ sudo apt-get install atom ## 6. GIMP Photo Editor GIMP (GNU Image Manipulation Programme) is a free and open-source photo editor for Ubuntu. It is arguably a best alternative to Adobe Photoshop on Windows. If you have been continuously using Adobe Photoshop and finding it difficult to get used to GIMP, you can customize GIMP to look very similar to Photoshop. GIMP is a feature-rich photo editor and you can always use additional features by installing extensions and plug-ins anytime. ## 7. YouTube Music Google Play music player has been replaced by YouTube Music from December 1, 2020 as Google’s main brand for music streaming on various platforms such as Android, Windows, and Linux. YouTube Music comes with much better user interface as compared to Google Music Player. To listen to your favorite music ad-free and download it locally to play in offline mode, you need to buy a premium subscription which can also be accessed on YouTube Premium. With premium subscription, you can listen to music at 256kbit/s AAC while you get an audio quality at 128kbit/s AAC on the free version. It is a great music player to have with great collection across various genres. **Download YouTube Music: https://snapcraft.io/youtube-music-desktop-app** ## 8. Digikam Digikam is a free and open-source professional photo management for creators and photographers. This advanced photo management tool is available for different platforms that includes Linux, Windows, and macOS. This application offers many useful features such as importing, managing, editing, and sharing photos and raw files across other devices. Using digikam’s import tool, you can directly import the photos, raw files, and videos from your camera or external storage like SD cards to your computer. The best thing about this application is that it handles the raw files quite well as compared to the other image editing applications available for Ubuntu. From basic tools for adjusting colors and cropping to advanced tools such as panorama stitching, curve adjustment, and many others, all come bundled with digickam. It also comes with a special tool which applies lens correction automatically on images; the tool is based on Lensfun library. **Download Digikam: https://snapcraft.io/digikam** ## 9. Synaptic Package Manager Synaptic Package Manager is one of the must-have tools on Ubuntu because it works for graphical interface for “apt-get” command which we usually use to install apps on Ubuntu using the terminal. It gives a tough competition to default app stores on various Linux distros. Synaptic comes with very simple user interface which is very fast and easy-to-use as compared to the other app stores. On the other side, you can browse various apps in different categories from where you can easily install and uninstall apps. ## 10. Skype Skype is a very popular cross-platform video calling application which is now also available for Linux as a Snap app. Skype is an instant messaging application which offers features like voice and video calls, desktop screen sharing, etc. Skype has an excellent user interface which is very similar to desktop client on Windows and it is very easy to use. It could be a very useful app for many switchers from Windows. ## 11. VirtualBox VirtualBox is a cross-platform virtualization software application which is developed by Oracle Corporation. If you love trying out new operating systems, VirtualBox is the must-have Ubuntu application for you. You can tryout Linux, mac inside Windows Operating System, or Windows and mac inside Linux. What VB actually does is it lets you virtually run the guest operating system on host operating system. It creates virtual hard drive and installs guest OS on it. You can download and install VB directly from the Ubuntu Software Center. ## 12. Unity Tweak Tool Unity Tweak Tool (Gnome Tweak Tool) is a must-have tool for every Linux user because it gives the users the ability to customize their desktop according to their need. You can try new GTK themes, set up the desktop hot corners, customize the icon set, tweak the unity launcher, etc. Unity Tweak Tool can be very useful to its user as it has everything covered right from the basic to advanced configurations. This tool allows you more control over graphical user interface of your desktop. ## 13. Microsoft Edge Microsoft finally got past its slow and old school web browser. Yes, you guessed it correct! We are talking about Internet Explorer. They finally delivered a web browser that can compete with the likes of Google Chrome and Mozilla Firefox in terms of speed and security which matters most to the users. Now, Microsoft Edge is also available for Linux and its distros with full-fledged features which are similar to that available on Windows. If you use both Windows and Linux, this browser is a must have for you because this makes the syncing process more convenient. ## 14. Stacer Stacer is a GUI-based system optimizer and monitoring tool for Linux and its distributions like Ubuntu. It is an open-source application that helps the user to manage the entire system with different aspects. You can manage various activities using Stacer such as package and process management, CPU, Network, disk monitoring, and managing the startup application. Windows user are aware of CCleaner that helps optimize the system and easily free up space by removing unnecessary files on the system. Same tasks are performed by Stacer on Ubuntu and other Linux distros. Stacer comes with beautiful and modern interface which is very easy to use. $ sudo apt-get update $ sudo apt-get install stacer ## 15. Museek Museek is a simple, clean, and cross-platform music player which is available for platforms such as macOS, Windows, and Linux. This lightweight music player uses “Node.js” as a backend, “electron” for built-in browser, and “React.js” as a frontend framework. It supports most commonly used file formats such as MP3, MP4, M4A, and 3GPP, etc. Its elegant and well-designed interface makes it stand out among others. You can also switch between light and dark theme according to your choice. Its drag and drop feature allows you to add the files and folders directly to its library. Its quick search engine allows you to search your favorite track from the library within seconds. ## 16. Pixbuf Pixbuf is a desktop client from Pixbuf photo community hub which lets you upload, share, and sale your photos. It supports photo sharing to social media networks like Facebook, Pinterest, Instagram, Twitter, etc. and photography services including Flickr, 500px, and Youpic. Pixbuf offers features like analytics which gives you stats about clicks, retweets, repins on your photo, scheduled posts, and dedicated iOS extension. It also has mobile app so that you can always be connected with your Pixbuf account from anywhere. Pixbuf is available for download in the Ubuntu Software Center as a snap package. ## 17. Clementine Music Player Clementine is a cross-platform music player and a good competitor to Rhythmbox which is a default music player on Ubuntu. It is a fast and easy-to-use music player, thanks to its user friendly interface. It supports audio playback in all the major audio file formats. Apart from playing music from the local library, you can also listen to online radio from Spotify, SKY.fm, Soundcloud, etc. It also offers other features like smart and dynamic playlists, and syncing music from cloud storages like Dropbox, Google Drive, etc. $ sudo apt-get update $ sudo apt-get install clementine ## 18. Blender Blender is a free and open-source 3D creation application software which you can use to create 3D printed models, animated films, video games, etc. It comes with integrated out-of-the-box game engine which you can use to develop and test the video games. Blender has a catchy user interface which is easy to use and it includes features like built-in render engine, digital sculpturing, simulation tool, animation tools, and many more. It is one of the best applications that you will ever find for Ubuntu considering it’s free and the features it offer. ## 19. Audacity Audacity is an open-source audio editing application which you can use to record and edit the audio files. You can record the audio from various inputs like microphone, electric guitar, etc. It also gives the ability to edit and trim the audio clips according to your need. Recently, Audacity released new features for Ubuntu which includes theme improvements, zoom toggle command, etc. Apart from these, it offers features like various audio effects including noise reduction and many more. $ sudo apt-get update $ sudo apt-get install audacity ## 20. Vim Vim is an Integrated Development Environment which you can use as standalone application or command-line interface for programming in various major programming languages like Python. Most of the programmers prefer coding in Vim because it is fast and is a highly customizable IDE. Initially, you might find it difficult to use but you will quickly get used to it. ## 21. Inkscape Inkscape is an open-source and cross-platform vector graphics editor which you will find very much similar to Corel Draw and Adobe Illustrator. Using it, you can create and edit the vector graphics such as charts, logos, diagrams, illustrations, etc. Inkscape uses Scalable Vector Graphics (SVG) and an open XML-based W3C standard as a primary format. It supports various formats including JPEG, PNG, GIF, PDF, AI (Adobe Illustrator Format), VSD, etc. $ sudo apt-get update $ sudo apt-get install inkscape ## 22. Exodus Exodus is a very popular cryptocurrency wallet around the world. Exodus is not only a Bitcoin wallet but it is also a Blockchain Wallet Asset called as digital currency or cryptocurrency. Unlike the Bitcoin Core, we don’t need to download the whole Blockchain as it is a lightweight wallet. The user interface of Exodus client is very attractive but simple. If you even don’t have any knowledge about Bitcoin and how it works, you can still be able to use this wallet. Exodus stores all the private keys of your cryptocurrencies on your computer storage locally. You also can backup the wallet to your computer in simple steps which are provided in Exodus client. Crypto exchange or trading is one of the best features available in Exodus. Users can exchange or trade their Bitcoin with other Bitcoin alternatives and vice versa. Exodus has exchange algorithm which is powered by Shapeshifts that performs the exchange or trade of digital currencies in few seconds. ## 23. SimpleScreenRecorder SimpleScreenRecorder is a free and lightweight screen video recorder for Ubuntu. This screen recorder can be a very useful tool for you if you are a YouTube creator or an application developer. It can capture a video/audio record of your desktop screen or directly record the video games. You can set the video resolution, frame rate, etc. before starting the screen recording. It has a simple user interface which you will find very easy to use. $ sudo apt-get update $ sudo apt-get install simplescreenrecorder ## 24. Telegram Telegram is a cloud-based instant messaging and VoIP platform which gained a lot of popularity in recent years. It is an open-source and cross-platform messenger where the user can send messages, share videos, photos, audio, and other files. Some of the notable features in Telegram are secrete chats, voice messages, bots, telescope for video messages, live locations, and social login. Privacy and security is at the highest priority in Telegram, so all the messages that you send and receive are end-to-end encrypted. ## 25. WPS Office WPS office is a clone of Microsoft office on Windows operating system. If you want to have an office suite which is similar to Microsoft Office on Ubuntu, WPS office is a great alternative. Right from the user interface to its features, WPS office has everything identical to Microsoft office. WPS office supports common document format and it works flawlessly with Ubuntu and other Linux distributions. It is a great productivity application to have on Linux. It is also completely free to download and install. ## 26. MailSpring MailSpring, earlier known as Nylas Mail or Nylas N1, is an open-source email client. It saves all the mails locally on your computer so that you can access them anytime you need them. It features advanced search which uses AND and OR operations so that you can search for mails based on different parameters. MailSpring comes with excellent user interface which you will find only on a handful of other mail clients. Privacy and security, scheduler, contact manager, calendar are some of the features that MailSpring offers. ## 27. PyCharm PyCharm is one of my favorite Python IDEs after Vim because it has a slick user interface with lot of extensions and plug-in support. Basically, it comes in two editions: one is the community edition which is free and open-source and the other is the professional edition which is paid. PyCharm has a highly customizable IDE and sports features such as error highlighting, code analysis, integrated unit testing and Python debugger, etc. PyCharm is the preferred IDE by most of the Python programmers and developers. ## 28. Caffeine Imagine you are watching something on YouTube or reading a news article and Ubuntu suddenly locks your screen. I know that is very annoying. It happens with many of us, so Caffeine is the tool that helps you block the Ubuntu lock screen or screensaver. Caffeine Inhibitor is a lightweight tool. It adds icon on the notification bar from where you can activate or deactivate it easily. No additional setting needs to be done in order to use this tool. $ sudo apt-get update $ sudo apt-get install caffeine -y ## 29. Kooha Kooha is an elegant screen recorder for Linux distributions that supports Wayland display. It is one of the first and very few screen recorders that added the support for Wayland. It is a simple screen recorder that comes with simple user interface that is very easy to use. It also supports keyboard shortcuts that helps improve productivity. It supports all the widely used video file formats such as WebM, MP4, GIF, and MKV. In this screen recorder, you get the option to select specific area or the entire screen to record. While recording, you can also add a voice over using microphone. It is quite similar to GNOME’s built-in screen recorder, the user interface being the only exception. To install Kooha on Linux, you need to enable the Flatpack support. Run following commands one by one to install Kooha: $ flatpak install flathub io.github.seadve.Kooha ## 30. Neofetch Neofetch is a cool system information tool that gives you all the information about your system by running the “neofetch” command in the terminal. It is a cool tool to have because it gives you information about the desktop environment, kernel version, Bash version, and GTK theme that you are running. As compared to other system information tools, Nefetch is a highly customizable tool. You can perform various customizations using the following command line: $ sudo apt-get update $ sudo apt-get update install neofetch ## 31. Peek Peek is an animated screen recorder for Ubuntu and other Linux distros. It is very easy to use to with simple user interface that makes you feel at home right from the start. It was initially built to showcase the UI features of the new underdeveloped apps and a bug if there is any. It works flawlessly on Unity desktop environment. Before you proceed with the installation, make sure that you have ffmpeg installed on your system. $ sudo apt update && sudo apt install peek ## 32. Zabbix Zabbix is an open-source monitoring tool for IT infrastructure for networks, servers, virtual machines and cloud services, etc. It is a professionally developed tool specifically for enterprises and organizations. Despite being a powerful tool, it is a completely free-to-use system monitoring tool. It is available for a variety of Linux distributions such as CentOS, Debian, Ubuntu, Raspberry Pi OS, etc. ## 33. Weather Weather is a small application which gives you a real-time weather information for your city or any other location in the world. It is a simple and lightweight tool which gives you a detailed forecast of up to 7 days and an hourly details for the current and the next day. It integrates with the GNOME shell to give you information about the current weather conditions at the recently searched locations. It has a minimalist user interface which works smoothly on minimum hardware requirement. ## 34. Kdenlive Kdenlive is a free and open-source video editing application for Linux and its distros. It is a feature-rich video editor with features like multi-track video editing, support for various video/audio file formats, highly configurable interface with keyboard shortcuts, effects and transitions, and many other useful features. It is a reliable video editing application which runs smoothly on any Linux distribution. It also comes with a variety of light and dark themes to match your needs. ## 35. Thunderbird Thunderbird is an open-source email client which is also a default email client in most of the Linux distributions. Despite parting ways with Mozilla in 2017, Thunderbird is still very popular and is the best email client on the Linux platform. It comes with features like spam filtering, IMAP and POP email syncing, calendar support, address book integration, and many other out-of-the-box features. It is a cross-platform email client with a full community support across all supported platforms. You can always change its look and feel, thanks to its highly customizable nature. ## 36. Pidgin Pidgin is an instant messaging client where you can login into different instant messaging networks under a single window. You can login to instant messaging networks like Google Talk, XMPP, AIM, Bonjour, etc. Pidgin has all the features you can expect in an instant messenger and you can always enhance its performance by installing additional plug-ins. ## 37. Krita Krita is a free and open-source digital painting, editing, and animation application developed by KDE. It has an excellent user interface with everything placed perfectly so that you can easily find the tool you need. It uses OpenGL canvas which boosts Krita’s performance. It also offers many features like different painting tools, animation tools, vector tools, layers and masks, and many more. Krita is available in the Ubuntu Software Center. You can easily download it from there. ## 38. Dropbox Dropbox is a stand-out player in cloud storage and its Linux clients works really well on Ubuntu once installed properly. While Google Drive comes out-of-the-box on Ubuntu 16.04 LTS and later, Dropbox is still a preferred cloud storage tool on Linux in terms of the features it offer. It always works in the background and backs up the new files from your system to the cloud storage, and continuously syncs the files between your computer and its cloud storage. ## 39. Kodi Kodi, formerly known as Xbox Media Center (XBMC), is an open-source media player. You can play music, videos, podcasts, and video games both in online and offline mode. This software was first developed for the first generation of Xbox gaming console and then slowly ported to personal computers. Kodi has very impressive video interface which is fast and powerful. It is a highly customizable media player. By installing additional plug-ins, you can access the online streaming services like Pandora, Spotify, Amazon Prime Video, Netflix and YouTube. ## 40. Spotify Spotify is one of the best online media streaming sites. It provides music, podcast, and video streaming services, both on free and paid subscription basis. Earlier, Spotify was not supported on Linux but now it has its own fully functional desktop client for Ubuntu. Alongside the Google Play Music Desktop Player, Spotify is a must-have media player for you. You just need to login to your Spotify account to access your favorite online content from anywhere. ## 41. Brackets Brackets is an open-source text editor which is developed by Adobe. It can be used for web development and design in web technologies such as HTML, CSS, and JavaScript. It sports live preview mode which is great feature to have as it can get a real-time view of whatever the changes you make in the script. It is one of the modern text editors on Ubuntu and has a slick user interface which takes the web development task to the new level. It also offers features like inline editor and supports for popular extensions like Emmet, Beautify, Git, File Icons, etc. ## 42. Vivaldi Vivaldi is a free cross-platform web browser which is specially developed for end-users with heavy internet usage. This browser adopts some popular features from Opera 12 which was based on the Presto layout engine. You will find many similar features from the older version of Opera web browser and My Opera. Vivaldi is one of the most flexible web browsers out there which gives you full control over customization with features like tab management, customization to create your own unique experience, keyboard shortcuts, mouse gestures, quick commands through command line, and a bookmark manager. It also features a set of built-in tools such as Notes which you can use to take down notes while surfing on web, capture screenshot of a full web page or a particular area, and image properties tool which can be used to get an in-depth information about the image like copyrights, histograms, etc. ## 43. Terminator Terminator is an open-source terminal emulator which is programmed and developed in Java. It is a cross-platform emulator which lets you have privilege of multiple terminals in one single window which is not the case in the Linux default terminal emulator. Other stand-out feature in terminator includes automatic logging, drag and drop, intelligent vertical and horizontal scrolling, etc. ## 44. GitBook Editor Gitbook Editor for Linux helps you write and publish your book in multiple file formats such as PDF, EPUB, and HTML. Markdown syntax helps you create eBook and within just a few clicks after that, you can already publish it. If you have multiple contributors to your project, GitBook allows you to split the workload among them using the git distributed revision control. GitBook editor is a cross-platform and a free application with great graphical user interface. Features like drag-n-drop, auto-complete, live preview, integrated Git control, a file tree panel, and quick formatting buttons facilitate easy document structuring. ## 45. Thonny Thonny is a simple and lightweight IDE which is especially designed for beginners in programming. If you are new to programming, this is the must-have IDE for you because it lets you learn while programming in Python. Thonny is also a great tool for debugging as it supports live variables during debugging. Apart from this, it offers features like separate windows for executing function call, simple user interface, etc. ## 46. Font Manager Font Manager is a lightweight tool for managing, adding, or removing fonts on your Ubuntu system. It is specially built for Gnome desktop environment. Users who don’t have an idea about managing fonts using command line will find this tool very useful. Gtk+ Font Manager is not meant to be for professional users. It has a simple user interface which you will find very easy to navigate. You just need to download the font files from the internet and add them using the Font Manager. $ sudo apt-get update $ sudo apt-get install font-manager ## 47. Atril Document Viewer Atril is a simple document viewer which supports the file formats like Portable Document Format (PDF), PostScript (PS), Encapsulated PostScript (EPS), DJVU and DVI. Atril comes bundled with MATE desktop environment and it is identical to Evince which is a default document on most of the Linux distros. Atril has simple and lightweight user interface which is highly customizable and offers features like search and bookmarks, and its UI includes thumbnails on the left-hand side. ## 48. Notepadqq If you have ever used Notepad++ on Windows and you are looking for similar program on Linux, don’t worry because the developers have ported it to Linux as Notepadqq. It is a simple yet powerful text editor which you can use for your daily tasks or programming in various languages. Despite being a simple text editor, it has some amazing features like setting the theme between dark and light color scheme, multiple selection, regular expression, search, and real-time highlighting. $ sudo apt-get update $ sudo apt-get install notepadqq ## 49. Whatever (Evernote Alternative) Whatever is a lightweight alternative to the Evernote client for Linux and its distros. Evernote is only available for the Windows, macOS, iOS, and Android. Evernote helps you manage the tasks and save the web content for future reference under a single window. Apart from that, you can also perform drawing, sketching, and many more tasks. Whatever is the most reliable alternative to Evernote as it offers all of its features. Whatever can perform all the task that Evernote offers. Whatever integrates almost all the features available on Evernote. Whatever offers feature like to-do-lists, smart note taking, cross-device synchronization, note sharing, and many more. It also supports all the widely used media file formats like audio, video, pdf document, and images. $ sudo dpkg -i Whatever_1.0.0_amd64.deb $ sudo apt update && sudo apt upgrade ## 50. Cheese Cheese is a Linux default webcam application which can be useful to you in some video chat or instant messaging applications. Apart from that, you can also use this app to take photos and videos with fancy effects. It also sports the burst mode which lets you take multiple snaps in a quick succession and option to share your photos with friends and family. Cheese come pre-installed with most of the Linux distros but you can also download and install it from the Software Center. ## 51. MyPaint MyPaint is a free and open-source raster graphics editor which focuses on digital painting rather than image manipulation and post processing. It is a cross-platform application and is more or less similar to Corel Painter. MyPaint could be a good alternative to those who use Microsoft Paint application on Windows. It has simple user interface which is fast and powerful. MyPaint is available in the Software Center for download. ## 52. PlayOnLinux PlayOnLinux is a front-end for WINE emulator which allows you to run the Windows applications on Linux. You just need to install the Windows applications and game on WINE. Then, you can easily launch the applications and games using PlayOnLinux. ## 53. Music on Console Music on Console is a free and open-source command line music player for Linux and its distros like Ubuntu. It is a lightweight yet powerful music player which is very easy to use. There is no need to create the playlist in this music player; you just need to select a file from the directory where your favourite music files are stored. After that, Music on Console will start playing the music one-by-one. It works flawlessly even on machines with old hardware. Features like simple equalizer, multiple theme options, customizable keys, and support for internet broadcast make it a great console-based music player. ## 54. Brave Brave is an open-source web browser which blocks the ads and trackers so that you can browse your content fast and safely. What it actually does is that it pays to the websites and YouTubers on your behalf. If you prefer contributing to the websites and YouTubers rather than seeing the advertisements, this browser is for you. This is a new concept and could be a good browser for those who prefer safe browsing without compromising important data on internet. ## 55. Bitcoin Core Bitcoin Core is an official Bitcoin client which is highly secure and reliable. It keeps track of all your transactions and makes sure that all transactions are valid. It restricts the Bitcoin miners and banks from taking full control of your Bitcoin wallet. Bitcoin Core also offers other important features like private keys backup, cold storage, and security notifications. $ sudo apt-get update $ sudo apt-get install bitcoin-qt ## 56. Speedy Duplicate Finder Speedy Duplicate Finder is a cross-platform file finder which helps you find the duplicate files on your system and free-up the disk space. It is a smart tool which searches for duplicate files on the entire hard disk and also features smart filter which helps you find the file by file type, extension, or size. It has a simple and clean user interface which is very easy to handle. As soon as you download it from the Software Center, you are good to go with the disk space clean-up. ## 57. Zulip Zulip is a free and open-source group chat application which was acquired by Dropbox. It is written in Python and uses PostgreSQL database. It was designed and developed to be a good alternative to other chat applications like Slack and HipChat. Zulip is a feature-rich application with features such as drag and drop files, group chats, private messaging, image previews, and many more. It also supports integration with the likes of Github, JIRA, Sentry, and hundreds of other services. ## 58. Okular Okular is a cross-platform document viewer which is developed by KDE for KDE desktop environment. It is a simple document viewer and supports the file formats like Portable Document Format (PDF), PostScript, DjVu, Microsoft Compiled HTML help, and many other major file formats. Okular is one of the best document viewers that you should try on Ubuntu as it offers features like commenting on PDF documents, drawing lines, highlighting, and much more. You can also extract the text from the PDF document to the text file. ## 59. Pinta Pinta is a free and open-source cross-platform drawing and editing application. It is not as feature-rich image editing applications as Krita but is still very useful and reliable when it comes to basic editing and drawing. Just like Microsoft Paint, you can draw, paint, and add text using this application. Pinta gets some edge on Microsoft Paint when it comes to the features it offer. It is a simple drawing and image editing tool with simple and easy-to-use user interface. It is a great application for computers with minimal hardware resources. ## 60. Guake Guake is a cool drop-down terminal for GNOME Desktop Environment. Guake comes in a flash whenever you need it and disappears as soon as your task is completed. You just need to click the F12 button to launch or exit it, so launching Guake is way faster than launching new terminal window. Guake is a feature-rich terminal with features like support for multiple tabs, ability to save your terminal content to the file in few clicks, and fully customizable user interface. ## 61. KDE Connect KDE Connect is an awesome application on Ubuntu. We would love to list this application much higher in this marathon article but the competition is intense. Anyway, KDE Connect helps you get your Android smartphone notifications directly on the Ubuntu desktop. With KDE Connect, you can do a whole lot of other things like checking your phone’s battery level, exchange files between computer and Android phone, clipboard sync, sending SMS, and using your phone as a wireless mouse or keyboard. $ sudo apt-get update $ sudo apt-get install kdeconnect indicator-kdeconnect ## 62. CopyQ CopyQ is a simple but very useful clipboard manager which stores the content of the system clipboard whenever any change is made so that you can search and restore it back whenever you need it. It is a great tool to have as it supports text, images, HTML, and other formats. CopyQ comes pre-loaded with features like drag and drop, copy/paste, edit, remove, sort, create, etc. It also supports integration with the text editors like Vim. It could be a very useful tool if you are a programmer. $ sudo apt-get update $ sudo apt-get install copyq ## 63. GNOME Tweaks GNOME tweaks is an essential tool for GNOME users. All the major Linux distributions like Ubuntu, Manjaro, Pop_Os! and Fedora use the GNOME desktop environment. You can customize almost everything using GNOME Tweaks on Ubuntu. You can change the themes, wallpaper, and startup application, disable the animation to speed up your desktop, customize the desktop icons, manage the GNOME extensions, manage the fonts, change the power settings, and perform many other tweaks. $ sudo apt install gnaome-tweak-tool ## 64. Anbox Anbox is an Android emulator which lets you install and run the Android apps on your Linux system. It is a free and open-source Android emulator that executes the Android runtime environment using Linux Containers. It uses the latest Linux technologies and Android releases so that you can run any Android app like any other native application. Anbox is one of the modern and feature-rich emulators and offers features like no limit for application use, powerful user interface, and seamless integration with the host operating system. First, you need to install the following kernel modules: $ sudo apt-get update $ sudo apt install anbox-modules-dkms Now, install Anbox using snap: ## 65. OpenShot OpenShot is the best open-source video editor that you will find for Linux distros. It is a cross-platform video editor which is very easy to use without any compromise with its performance. It supports all the major audio, video, and image formats. OpenShot has a clean user interface and offers features like drag and drop, clip resizing, scaling, trimming, snapping, real-time previews, audio mixing and editing, and many other features. $ sudo apt-get update $ sudo apt-get install openshot -qt ## 66. Plank If you are looking for a cool and simple dock for your Ubuntu desktop, Plank should be the first choice for you. It is a perfect dock where you don’t need to make any tweaks after installation. But if you want to, it has built-in preferences panel where you can customize the themes, dock size, and position. Despite being a simple dock, Plank offers features like item rearrangement by simple drag and drop, pinned and running apps icon, and transparent theme support. $ sudo apt-get update $ sudo apt-get install plank ## 67. Filezilla Filezilla is a free and cross-platform FTP application which sports the FileZilla client and server. It lets you transfer files using FTP and encrypted FTP like FTPS and SFTP and supports the IPv6 internet protocol. It is a simple file transfer application with features like drag and drop, support for various languages used worldwide, powerful user interface for multitasking, controlling and configuring the transfer speed, and many other features. ## 68. Stacer Stacer is an open-source system diagnostic tool and optimizer developed using the Electron development framework. It has an excellent user interface and you can clean the cache memory, start-up the applications, uninstall apps that are no longer needed, and monitor the background system processes using it. It also lets you check the disk, memory, and CPU usage and gives you the real-time stats of downloads and uploads. It looks like a tough competitor to the Ubuntu cleaner but both have unique features that separate them apart. $ sudo apt-get update $ sudo apt-get install stacer ## 69. 4K Video Downloader 4K Video Downloader is a simple video downloading tool which you can use to download videos, playlists, channels from Vimeo, Facebook, YouTube and other online video streaming sites. It supports the download of YouTube playlists and channels in MP4, MKV, M4A, 3GP and many other video/audio file formats. 4K Video Downloader is not as simple as you would think. Apart from normal video downloads, it supports 3D and 360 degree video downloading. It also offers features like in-app proxy setup and direct transfer to iTunes. You can download it from [here](https://www.4kdownload.com/download). ## 70. Insync Insync is one of the most reliable Google Drive clients that you will find for Linux and its distributions such as Ubuntu, Linux Mint, Fedora and Debian. It comes with a 15-day free trial. After that, you need to purchase it to use it further. In three simple steps, you can access your Google Drive data on Linux using Insync. Just download Insync, install, and then login to your Google account. Its selective sync 2.0 feature helps you sync all your files and folders either in your local computer or in the cloud storage. Also, you can access all the files that are locally stored on Google Drive in the Linux file manager. You can also access multiple Google Drive accounts. Google docs automatically gets converted to Open Document format for Libre Office compatibility. Insync is great for professional use as you can give offline access to your team to Google’s shared drive for smooth workflow. ## 71. Hiri Hiri is a cross-platform email client which is developed in Python programming language. It has a slick user interface and it can be a good alternative to Microsoft Outlook in terms of features and services offered. This is a great email client that can be used for sending and receiving emails, managing contacts, calendars, and tasks. It is a feature-rich email client that offers features like integrated task manager, email synchronization, email rating, email filtering, and many more. ## 72. Sublime Text Sublime Text is a cross-platform source code editor programmed in C++ and Python. It has Python Application Programming Interface (API) and supports all the major programming and markup languages. It is a simple and lightweight text editor which can be used as IDE with features like auto-completion, syntax highlighting, split editing, etc. Some additional features in this text editor include Goto anything, Goto definition, multiple selections, command palette, and a fully customizable user interface. ## 73. TeXstudio TeXstudio is an integrated writing environment to create and edit the LaTex documents. It is an open-source editor which offers features like syntax highlighting, integrated viewer, interactive spelling checker, code folding, drag and drop, etc. It is a cross-platform editor and has a very simple, lightweight user interface which is easy to use. It ships in with integration for BibTex and BibLatex bibliographies managers and integrates the PDF viewer. You can download the TeXstudio installation package from its [website](https://www.texstudio.org/) or in the Ubuntu Software Center. ## 74. QtQR QtQR is a Qt based application that lets you create and read the QR codes in Ubuntu. It is developed in Python and has a simple and lightweight user interface. You can encode the website URL, email, text, SMS, etc. You can also decode the barcode using the webcam camera. QtQR could prove to be a useful tool to have if you generally deal with product sales and services because we don’t have any other similar tool to QtQR which requires minimal hardware to function smoothly. $ sudo apt-get update $ sudo apt-get install qtqr ## 75. Nylas N1 Nylas N1 is a free and open-source email client for Ubuntu and other Linux distros. This is a cross-platform email client available for all the major operating system platforms such as Windows, macOS, and Linux. If you have a mail account with different mail services like Gmail, Yahoo Mail, and Microsoft Outlook and you want to access them under one single window, Nylas N1 is the best email client to have as it can be used to configure all major mail services under a single window. Nylas N1 supports all the major mail transfer protocols such as IMAP, SMTP, and POP3 which makes it one of the most reliable email clients out there. ## 76. NitroShare NitroShare is a cross-platform, open-source network file sharing application. It lets you easily share files between multiple operating systems’ local network. It is a simple yet powerful application and it automatically detects the other devices that run the NitroShare on local network. File transfer speed is what makes NitroShare a stand-out file sharing application as it achieves gigabit speed on capable hardware. There is no need for required additional configuration. You can start the file transfer as soon as you install it. $ sudo apt-get update $ sudo apt-get install nitroshare ## 77. Konversation Konversation is an open-source Internet Relay Chat (IRC) client which is developed for KDE desktop environment. It gives speedy access to Freenode network’s channels where you can find support for most distributions. It is a simple chat client with features like support for IPv6 connection, SSL server support, bookmarks, on-screen notifications, UTF-8 detection, and additional themes. It has easy-to-use GUI which is highly configurable. ## 78. Discord If you’re a hardcore gamer and play online games frequently, we have a great application for you. Discord is a free Voice over Internet Protocol (VoIP) application which is especially designed for online gamers around the world. It is a cross-platform application and can be used for text and audio chats. Discord is a very popular VoIP application gaming community. Since it is a completely free application, it is a very good competitor to the likes of Skype, Ventrilo, and Teamspeak. It also offers features like clear voice quality, and modern text chat where you can share images, videos, and links. ## 79. Conky Conky is a free and open-source system monitoring tool for Linux, FreeBSD, and OpenBSD systems. It is a highly configurable system monitoring tool. Conky shows the system data such as CPU load, memory usage, hard drive usage, network activity, GPU temperature, fan speed, GPU clock, and other data such as time and weather. It is a lightweight system monitoring tool. Hence, it works effortlessly on the system with minimal hardware. ## 80. MPV Media Player MPV is a free and open-source media player based on MPlayer and MPlayer 2. It has a simple user interface where the user just needs to drag and drop the audio/video files to play them since there is no option to add the media files on GUI. One of the things about MPV is that it can effortlessly play 4K videos which is not the case with the other media players on Linux distros. It also gives the user ability to play the videos from online video streaming sites including YouTube and Dailymotion. $ sudo apt-get update $ sudo apt-get install -y mpv ## 81. Plume Creator If you’re a writer, Plume Creator is a must-have application for you because you will not find other app for Ubuntu with privileges like Plume Creator. Writing and editing stories and chapters is a tedious task. Plume Creator makes this task easier for you with the help of some amazing tools it has to offer. It is an open-source application with minimal user interface which you could find confusing in the beginning but you will get used to it later on. It offers features like edit notes, synopses, export in HTML and ODT formats support, and rich text editing. ## 82. Chromium Web Browser Chromium is an open-source web browser which is developed and distributed by Google. Chromium is very identical to Google Chrome web browser in terms of appearance and features. It is a lightweight and fast web browser with minimalist user interface. If you use Google Chrome regularly on Windows and you are looking for similar browser for Linux, Chromium is the best browser for you as you can login into your Google account to access all your Google services including Gmail. ## 83. Simple Weather Indicator Simple Weather Indicator is an open-source weather indicator app which is developed in Python. It automatically detects your location and shows you the weather information like temperature, possibility of rain, humidity, wind speed, and visibility. Simple Weather Indicator comes with configurable options such as location detection, temperature SI unit, location visibility on/off, etc. It is a cool app to have which comfortably adjusts with your desktop. ## 84. Flameshot Flameshot is a free and open-source screenshot tool for Linux and its distros such as Ubuntu. It is a cross-platform tool which is also available for other major operating system platforms such as Windows and mac. It offers features such as instantly editing screenshots, image upload to Imgur, and export and import configuration. Apart from that, it is a very easy-to-use and highly customizable tool. ## 85. Scribus Scribus is a free and open-source desktop publishing application that lets you create posters, magazines, and books. It is a cross-platform application based on Qt toolkit and is released under GNU general public license. It is a professional application with features like CMYK and ICC color management, Python-based scripting engine, and PDF creation. Scribus comes with decent user interface which is easy to use and works effortlessly on systems with low hardware. It could be downloaded and installed from the Software Center on all the latest Linux distros. ## 86. Cura Cura is an open-source 3D printing application developed by David Braam. Ultimaker Cura is the most popular software in 3D printing world and is used by millions of users worldwide. It follows a 3-step 3D printing model: Design, Prepare, and Print. It is a feature-rich 3D printing application with seamless integration support for CAD plug-ins and add-ons. It is a very simple and easy-to-use tool in which the novice artists can start right away. It supports major file formats like STL, 3MF, and OBJ. ## 87. Nomacs Nomacs is an open-source, cross-platform image viewer which supports all the major image formats including raw and PSD images. It has the ability to browse the images in zip or Microsoft Office files and extract them to a directory. Nomacs has very simple user interface with image thumbnails at the top. It offers some basic image manipulation features like crop, resize, rotate, color correction, etc. $ sudo apt-get update $ sudo apt-get install nomacs ## 88. BitTicker BitTicker is a live bitcoin-USDT Ticker for Ubuntu. It is a simple tool that connects to bittrex.com market, retrieves the latest price for BTC-USDT, and displays the Ubuntu clock on system tray. It is simple but very useful if you regularly invest in Bitcoin and study the price fluctuations. ## 89. pCloud The pCloud is a cross-platform cloud storage application where you can store your personal files or backup your PC. The pCloud has a dedicated client for Linux and its distros such as Ubuntu. This app not only lets you store the data or files on cloud but also helps you recover the older versions of the data up to 1 year. You can also send and receive large files to and from anyone you like. The best thing about pCloud is that it offers military grade file encryption which encrypts sensitive files on any device and make them invisible. ## 90. Shortwave Shortwave is an internet-based radio player application for Linux and its distros such as Ubuntu. It is an open-source radio player that comes with modern user interface. Dark mode feature is also available with this out-of-the-box application. There are some other features that are worth mentioning such as available thousands of radio stations, keyboard navigation, sleep/hibernate mode, and many others. ## 91. Calibre Calibre is a cross-platform, open-source solution to all your e-book needs. It is a simple e-book organizer that offers features like displaying, creating, editing e-books, organizing existing e-books into virtual libraries, syncing, and many more. Calibre also helps you convert the e-books into whichever format you need and send them to your e-book reading device. Calibre is a very good tool to have if you regularly read and manage e-books. ## 92. MATE Dictionary MATE Dictionary is a simple dictionary that is basically developed for MATE desktop environment. You just need to type the word and then this dictionary displays the meaning and references for it. It is a simple and lightweight online dictionary with a minimalist user interface. ## 93. Converseen Converseen is a free cross-platform batch image processing application that lets you convert, edit, resize, rotate, and flip a large number of images with a single mouse click. It offers features like renaming bunch of images using prefix/suffix, extracting the image from a Windows icon file, etc. It has very good user interface which is easy to use even if you are a novice user. It can also convert an entire PDF file into a collection of images. ## 94. Tiled Map Editor Tiled is a free software level map editor which you can use to edit the maps in various projections such as orthogonal, isometric, and hexagonal. This tool can be very useful for game developers during game engine development cycle. Tiled is a versatile map editor which lets you create power boost positions, and map the layouts, collision areas, and enemy positions. It saves all the data in tmx format. ## 95. Sayonara Sayonara is a small and lightweight music player for Linux and its distros such as Ubuntu. It is one of the most underrated music players out there. It definitely deserves more attention. It has a simple but very easy to use user interface that also comes with dark mode. Talking about features, it comes with support for various popular music and playlist formats, directory view, shortcut keys, and seamless desktop integration. $ sudo apt-get update $ sudo apt-get install sayonara ## 96. Arora Arora is a free and open-source web browser which offers features like dedicated download manager, bookmarks, privacy mode, and tabbed browsing. Arora web browser is developed by Benjamin C. Meyer. It is popular among Linux users for its lightweight nature and flexibility. ## 97. Kbackup Kbackup is a simple and user-friendly application to back up your important files and data in the most simple way. You can select which file or folder to include or exclude in the backup. Using Kbackup, you can run an automated backup without the need for graphical user interface. This is a simple application. Even if you are first time user, you will feel at home on the first go. ## 98. Geany Geany is a simple and lightweight text editor which works like an Integrated Development Environment (IDE). It is a cross-platform text editor and supports all the major programming languages including Python, C++, LaTex, Pascal, C#, etc. Geany has simple user interface which resembles to programming editors like Notepad++. It offers IDE-like features such as code navigation, auto-completion, syntax highlighting, and extensions support. ## 99. Mumble Mumble is another Voice over Internet Protocol (VoIP) application which is very similar to Discord. Mumble is also basically designed for online gamers and uses client-server architecture for end-to-end chat. The voice quality is very good on Mumble and it offers end-to-end encryption to ensure privacy. Mumble is an open-source application and features a very simple user interface which is easy to use. Mumble is available for download in the Ubuntu Software Center. ## 100. Deluge Deluge is a cross-platform and lightweight BitTorrent client that can be used to download files on Ubuntu. BitTorrent client come bundled with many Linux distros but Deluge is the best BitTorrent client which has simple and easy-to-use user interface. Deluge comes with all the features that you will find in BitTorrent clients. But one feature that stands out is giving the user ability to access the client from other devices so that you can download the files to your computer even if you are not at home. $ sudo apt-get update $ sudo apt-get install deluge ## Conclusion These are our picks for best 100 applications for Ubuntu in 2023 which you should try. Surely, there are other apps that you may feel should have made the list; it totally depends on the individual choice and its use. All the applications that are listed here are tested on Ubuntu 22.04 LTS and majority of them definitely works on older versions.
11,046
Emacs 的(更多)胜利
https://so.nwalsh.com/2019/03/01/emacs
2019-07-02T00:26:00
[ "Emacs" ]
https://linux.cn/article-11046-1.html
![](/data/attachment/album/201907/02/002550x2ol48004hx6e0od.jpg) 我天天用 Emacs,但我却从意识到。但是每当我用 Emacs 时,它都给我带来了很多乐趣。 > > 如果你是个职业作家……Emacs 与其它的编辑器的相比就如皓日与群星一样。不仅更大、更亮,它轻而易举就让其他所有的东西都消失了。 > > > 我用 [Emacs](https://en.wikipedia.org/wiki/Emacs) 已有二十多年了。我用它来写几乎所有的东西(我用 [IntelliJ](https://en.wikipedia.org/wiki/IntelliJ_IDEA) 编辑 Scala 和 Java )。看邮件的话我是能在 Emacs 里看就在里面看。 尽管我用 Emacs 已有数十年,我在新年前后才意识到,在过去十几年里,我对 Emacs 的使用几乎没有什么变化。当然,新的编辑模式出现了,我就会选一两个插件,几年前我确实是用了 [Helm](https://emacs-helm.github.io/helm/),但大多数时候,它只是完成了我需要的所有繁重工作,日复一日,没有抱怨,也没有妨碍我。一方面,这证明了它有多好。另一方面,这是一个邀请,让我深入挖掘,看看我错过了什么。 于此同时,我也决定从以下几方面改进我的工作方式: * **更好的议程管理** 我在工作中负责几个项目,这些项目有定期和临时的会议;有些我是我主持的,有些我只要参加就可以。 我意识到我对参加会议变得有些敷衍。往会议室里一坐很简单,但实际上我是在阅读电子邮件或处理其他事情。(我强烈反对在会议中“禁止携带笔记本电脑”的这条规定,但这是另一个话题。) 敷衍地去参加会议有几个问题。首先,这是对主持会议的人和其他参会者的不尊重。实际上这是不应该这么做的充分理由,但我还有意识到另一个问题:它掩盖了会议的成本。 如果你在开会,但同时回复了一封电子邮件,也许修复了一个 bug,那么这个会议就没什么成本(或没那么多)。如果会议成本低廉,那么会议数量将会更多。 我想要更少、更短的会议。我不想掩盖它们的成本,我想让开会变得很有价值,除非绝对必要,否则就干脆不要开。 有时,开会是绝对有必要的。而且我认为一个简短的会有时候能够很快的解决问题。但是,如果我一天要开十个短会的话,那我觉得还是不要假装取得了什么效果吧。 我决定在我参加的所有的会上做笔记。我并不是说一定要做会议记录,但是我肯定会花上几分钟。这会让我把注意力集中在开会上,而忽略其他事。 * **更好的时间管理** 无论是工作的或私人的,我有很多要做和想做的事。我一直在问题列表中跟踪其中的一些,一些在保存的电子邮件线索中(Emacs 和 [Gmail](https://en.wikipedia.org/wiki/Gmail) 中,用于一些稍微不同的提醒),还有一些在日历、手机上各种各样的“待办事项列表”和小纸片上。可能还有其他地方。 我决定把它们放在一起。不是说我认为放到一个一致的地方就更好,而是我想完成两件事:首先,把它们都集中在一个地方,我能够更好更全面地了解我在哪里投入了更多的精力;其次,我想养成一个记录、跟踪并保存它们的习惯(习惯指“固定或规律的倾向或做法,尤指难以放弃的倾向或做法”)。 * **更好的问责制** 如果你在某些科学或工程领域工作,你就会养成记笔记的习惯。唉,我没有。但我决定这么做。 我对法律上鼓励使用装订页面或用永久记号笔涂抹并不感兴趣。我感兴趣的是养成做记录的习惯。我的目标是有一个地方记下想法和设计草图等。如果我突然有了灵感,或者我想到了一个不在测试套件中的边缘情况,我希望我的直觉是把它写在我的日志中,而不是草草写在一张小纸片上,或者自己觉得自己会记住它。 这些决心让我很快或多或少指向了 [Org](https://en.wikipedia.org/wiki/Org-mode) 模式。Org 模式有一个庞大的、活跃的、忠诚的用户社区。我以前也用过它(顺带一提,我都[写过](https://www.balisage.net/Proceedings/vol17/html/Walsh01/BalisageVol17-Walsh01.html)关于它的文章,在几年前),我花了很长的一段时间(将 [MarkLogic 集成](https://github.com/ndw/ob-ml-marklogic/)到其中。(这在过去的一两个星期里得到了回报!) 但我从没正经用过 Org 模式。 我现在正在用它。我用了几分钟,我把所有要做的事情都记录下来,我还记了日记。我不确定我争论或列表它的所有功能能有多大价值,你可以通过网页快速地搜索找到很多。 如果你用 Emacs,那你也应该用 Org 模式。如果没用过 Emacs,我相信你不会是第一个因 Org 模式而使用 Emacs 的人。Org 模式可以做很多。它需要一点时间来学习方法和快捷键,但我认为这是值得的。(如果你的口袋中有一台 [iOS](https://en.wikipedia.org/wiki/IOS) 设备,我推荐你在路上使用 [beorg](https://beorgapp.com/) 来记录。) 当然,我想出了如何[将 XML 从其中提取出来](https://github.com/ndw/org-to-xml)(“working out” 确实是“用 elisp 来编程”的一种有趣的魔法)然后,如何将它转换回我的博客用的标记(当然,在 Emacs 中按下一个按钮就可以做到)。这是用 Org 模式写的第一篇帖子。这也不会是最后一次。 附注:生日快乐,[小博客](https://so.nwalsh.com/2017/03/01/helloWorld)。 --- via: <https://so.nwalsh.com/2019/03/01/emacs> 作者:[Norman Walsh](https://so.nwalsh.com) 选题:[lujun9972](https://github.com/lujun9972) 译者:[oneforalone](https://github.com/oneforalone) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
# Emacs for (even more of) the win I use Emacs every day. I rarely notice it. But when I do, it usually brings me joy. If you are a professional writer…Emacs outshines all other editing software in approximately the same way that the noonday sun does the stars. It is not just bigger and brighter; it simply makes everything else vanish. I’ve been using [Emacs](https://en.wikipedia.org/wiki/Emacs) for well over twenty years. I use it for writing *almost* anything and everything (I edit Scala and Java in [IntelliJ](https://en.wikipedia.org/wiki/IntelliJ_IDEA)). I read my email in it. If it can be done in Emacs, that’s where I prefer to do it. Although I’ve used Emacs for literally decades, I realized around the new year that very little about my use of Emacs had changed in the past decade or more. New editing modes had come along, of course, I’d picked up a package or two, and I did adopt [Helm](https://emacs-helm.github.io/helm/) a few years ago, but mostly it just did all the heavy lifting that I required of it, day in and day out without complaining or getting in my way. On the one hand, that’s a testament to how good it is. On the other hand, that’s an invitation to dig in and see what I’ve missed. At about the same time, I resolved to improve several aspects of my work life: - **Better meeting management.**I’m lead on a couple of projects at work and those projects have meetings, both regularly scheduled and ad hoc; some of them I run, some of them, I only attend.I realized I’d become sloppy about my participation in meetings. It’s all too easy sit in a room where there’s a meeting going on but actually read email and work on other items. (I strongly oppose the “no laptops” rule in meetings, but that’s a topic for another day.) There are a couple of problems with sloppy participation. First, it’s disrespectful to the person who convened the meeting and the other participants. That’s actually sufficient reason not to do it, but I think there’s another problem: it disguises the cost of meetings. If you’re in a meeting but also answering your email and maybe fixing a bug, then that meeting didn’t cost anything (or as much). If meetings are cheap, then there will be more of them. I want fewer, shorter meetings. I don’t want to disguise their cost, I want them to be perceived as damned expensive and to be avoided unless absolutely necessary. Sometimes, they are absolutely necessary. And I appreciate that a quick meeting can sometimes resolve an issue quickly. But if I have ten short meetings a day, let’s not pretend that I’m getting anything else productive accomplished. I resolved to take notes at all the meetings I attend. I’m not offering to take minutes, necessarily, but I *am*taking minutes of a sort. It keeps me focused on the meeting and not catching up on other things. - **Better time management.**There are lots and lots of things that I need or want to do, both professionally and personally. I’ve historically kept track off some of them in issue lists, some in saved email threads (in Emacs and[Gmail](https://en.wikipedia.org/wiki/Gmail), for slightly different types of reminders), in my calendar, on “todo lists” of various sorts on my phone, and on little scraps of paper. And probably other places as well.I resolved to keep them all in one place. Not because I think there’s one place that’s uniformly best or better, but because I hope to accomplish two things. First, by having them all in one place, I hope to be able to develop a better and more holistic view of where I’m putting my energies. Second, because I want to develop a habitn. “A settled or regular tendency or practice, especially one that is hard to give up.” of recording, tracking, and preserving them. - **Better accountability.**If you work in certain science or engineering disciplines, you will have developed the habit of keeping a[lab notebook](https://en.wikipedia.org/wiki/Lab_notebook). Alas, I did not. But I resolved to do so.I’m not interested in the legal aspects that encourage bound pages or scribing only in permanent marker. What I’m interested in is developing the habit of keeping a record. My goal is to have a place to jot down ideas and design sketches and the like. If I have sudden inspiration or if I think of an edge case that isn’t in the test suite, I want my instinct to be to write it in my journal instead of scribbling it on a scrap of paper or promising myself that I’ll remember it. This confluence of resolutions led me quickly and more-or-less directly to [Org](https://en.wikipedia.org/wiki/Org-mode). There is a *large*, active, and loyal community of Org users. I’ve played with it in the past (I even [wrote about it](https://www.balisage.net/Proceedings/vol17/html/Walsh01/BalisageVol17-Walsh01.html), at least in passing, a couple of years ago) and I tinkered long enough to [integrate MarkLogic](https://github.com/ndw/ob-ml-marklogic/) into it. (Boy has that paid off in the last week or two!) But I never *used it*. I am now using it. I take minutes in it, I record all of my todo items in it, and I keep a journal in it. I’m not sure there’s much value in me attempting to wax eloquent about it or enumerate all its features, you’ll find plenty of either with a quick web search. If you use Emacs, you should be using Org. If you don’t use Emacs, I’m confident you wouldn’t be the first person who started because of Org. It does *a lot*. It takes a little time to learn your way around and remember the shortcuts, but I think it’s worth it. (And if you carry an [iOS](https://en.wikipedia.org/wiki/IOS) device in your pocket, I recommend [beorg](https://beorgapp.com/) for recording items while you’re on the go.) Naturally, I worked out how to [get XML out of it](https://github.com/ndw/org-to-xml)“Worked out” sure is a funny way to spell “hacked together in elisp.”. And from there, how to turn it back into the markup my weblog expects (and do so at the push of a button in Emacs, of course). So this is the first posting written in Org. It won’t be the last. P.S. Happy birthday [little weblog](https://so.nwalsh.com/2017/03/01/helloWorld).
11,048
100 个最佳 Ubuntu 应用(中)
https://linuxhint.com/100_best_ubuntu_apps/
2019-07-03T01:13:00
[ "Ubuntu", "应用" ]
https://linux.cn/article-11048-1.html
今年早些时候我们发布了一个 [2018 年最好的 20 个 Ubuntu 应用](https://linuxhint.com/applications-2018-ubuntu/)列表,可能对很多用户来说都很有用。现在我们几乎到 2018 年下半年了(LCTT 译注:好吧,我们翻译的有些晚了,顺便打个广告,[LCTT 欢迎你,有志于通过翻译为开源做些贡献的同学!](https://linux.cn/lctt/)),所以今天我们打算看一下 Ubuntu 上最好的 100 个应用,你可能会觉得有帮助。 ![100 Best Ubuntu Apps](/data/attachment/album/201907/03/011350y2v29940b9x984cn.png) 很多用户最近从 Microsoft Windows 转换到了 Ubuntu,可能面临着这样一个困境:寻找它们之前使用了数年的操作系统上的应用软件的最好替代应用。Ubuntu 拥有上千个免费使用和开源应用软件,比 Windows 和其它 OS 上的付费软件运行的更好。 下列列表归纳了各种分类下很多应用软件的功能特点,因此,你可以找到匹配你的需求的最好的应用。 (……接前) ### 34、Ramme Ramme 是一个很酷的非官方的 Instagram 桌面客户端,给你带来 Instagram 移动端的感觉。它是基于 Electron 开发的客户端,所以它复现了 Instagram 应用的功能,并提供了主题自定义的功能。 ![](/data/attachment/album/201907/03/011358m02qr0vqgq0x2030.png) 但是由于 Instagram 的 API 限制,你不能使用 Ramme 客户端上传图像,但你可以订阅 Instagram 流、喜欢和评论文章,给好友发消息。你可以从 [Github](https://github.com/terkelg/ramme/releases) 下载 Ramme 安装文件。 ### 35、Thunderbird Thunderbird 是一个开源的邮件客户端,是很多 Linux 发行版的默认邮件客户端。尽管在 2017 年与 Mozilla 分道扬镳(LCTT 译注: Thunderbird 现在由 Thunderbird 议会独立决策,只是将财务和法律关系留在 Mozilla 基金会),Thunderbird 仍然是 Linux 平台非常流行的最好的邮件客户端。它自带的功能包括垃圾邮件过滤、IMAP 和 POP 邮件同步、日历支持、通讯录集成和很多其它可以开箱即用的功能。 ![](/data/attachment/album/201907/03/011405ax5rqmv4rt5hnwsl.png) 它是一个跨平台的邮件客户端,由社区提供对所有平台提供支持。因其可以高度自定义,你可以改变它的外观和观感。 ### 36、Pidgin Pidgin 是一个即时信息客户端,你能够在单个窗口下登录不同的即时通讯网络。你可以登录到像 Google Talk、XMPP、AIM、Bonjour 等即时通讯。 ![](/data/attachment/album/201907/03/011421wm4i2p92ph4hchc7.png) Pidgin 拥有你所期待的即时通信的所有特点,你总是可以通过安装额外的插件来提升其表现。 ``` $ sudo apt-get install pidgin ``` ### 37、Krita Krita 是由 KDE 开发的自由开源的数字绘制、编辑和动画的应用。它有优秀的用户界面,每个组件都恰到好处,因此你可以轻松找到你所需要的。 ![](/data/attachment/album/201907/03/011430qqim4e3m1gnq00nm.png) 它使用 OpenGL 画布,这提升了 Krita 的性能,并且提供了很多功能,如各种绘画工具、动画工具、矢量工具、层和遮罩等很多。可在 Ubuntu 软件中心获取 Krita 并下载。 ### 38、Dropbox Dropbox 是一个出色的云存储客户端,正确安装后,它在 Ubuntu 中运行得非常好。即使 Google Drive 在 Ubuntu 16.04 LTS 和以后的版本中运行得不错,就 Dropbox 提供的特点而言,Dropbox 仍然是 Linux 上的首选云存储工具。 ![](/data/attachment/album/201907/03/011442gx1atalxfvflhtxl.png) 它总是在后台运行,可以备份你系统上的新文件到云存储,持续保持你的电脑和云存储间的同步。 ``` $ sudo apt-get install nautilus-dropbox ``` ### 39、Kodi Kodi 的前身是人们所熟知的 Xbox 媒体中心(XBMC),它是一个开源的媒体播放器。你可以在线或离线播放音乐、视频、播客、视频游戏等。这个软件最初是为第一代的 Xbox 游戏主机开发的,之后慢慢地移植到了个人电脑上。 ![](/data/attachment/album/201907/03/011450lkzo8jjk1522x5oo.png) Kodi 有令人印象深刻的视频界面,快速而强大。它是可高度定制的媒体播放器,你可以通过安装插件,来获取在线流服务,如 Pandora、Spotify、Amazon Prime Video、Netflix 和 YouTube 等等。 ### 40、Spotify Spotify 是最好的在线媒体流站点之一。它提供免费和付费的音乐、播客、视频流服务。早期的 Spotify 不支持 Linux,但现在它有了自己的全功能的 Ubuntu 客户端。 ![](/data/attachment/album/201907/03/011455jbu8u8cxx3ymyxzm.png) 与 Google Play 音乐播放器一样,Spotify 是必不可少的媒体播放器。你只需要登录你的 Spotify 账户,就能在任何地方获取你最爱的在线内容。 ### 41、Brackets Brackets 是一个由 Adobe 开发的开源的文本编辑器。它可以用来进行 web 开发和设计,例如 HTML、CSS 和 JavaScript。它带有的实时预览模式是一个很棒的特点,当你在脚本中修改时,你可以获得实时预览效果。 ![](/data/attachment/album/201907/03/011505hfnh50v5i1fw4fhk.png) 它是 Ubuntu 上的现代文本编辑器之一,拥有平滑的用户界面,这将 web 开发任务带到新的水平。它同样提供了行内编辑器的特点,支持流行的扩展像 Emmet、Beautify、Git、File Icons 等等。 ### 42、Bitwarden 现今,账户安全是一个严重的问题,我们可以看到用户密码被盗和重要数据受到侵害的安全漏洞在不断增加。推荐你使用 Bitwarden,将你的所有账户和登录密码安全地存在一个地方。 ![](/data/attachment/album/201907/03/011511o3y3jjyyjgc777ay.png) Bitwarden 使用 AES-256 加密技术来存储所有的登录细节,只有用户可以访问这些数据。它同样可以帮你创建健壮的密码,因为弱密码容易被黑。 ### 43、Terminator Terminator 是一个开源的终端模拟器,是用 Java 语言开发的。它是一个跨平台的模拟器,允许你在单个窗口有多个终端,在 Linux 默认的终端模拟器中不是这样。 ![](/data/attachment/album/201907/03/011518jain11rnwpwwgxpf.png) Terminator 其它杰出的特点包括自动日志、拖放、垂直和水平的智能滚动等。 ``` $ sudo apt-get install terminator ``` ### 44、Yak Yak Yak Yak 是一个开源的非官方的 Google Hangouts 消息的桌面客户端。它可以作为 Microsort Skype 的一个不错的替代品,自身拥有很多让人吃惊的特点。你可以启用桌面通知、设置语言偏好,使用很少的内存和处理能力就可以工作。 ![](/data/attachment/album/201907/03/011521wp0kp764drbo7j7f.png) Yak Yak 拥有你期待的任何即时消息应用的所有特点,例如输入指示、拖放媒体文件、音/视频电话。 ### 45、Thonny Thonny 是一个简单和轻量级的 IDE,尤其是为编程的初学者设计的。如果你是编程初学者,这是你必备的 IDE,因为当用 Python 编程的时候它会帮你学习。 ![](/data/attachment/album/201907/03/011527jvvzsvpzprnpgh6s.png) Thonny 同样是一个很棒的调试工具,它支持调试过程中的变量值即时显示,除此之外,它还提供了独立的窗口以执行函数调用,简单的用户界面等等。 ``` $ sudo apt-get install thonny ``` ### 46、字体管理器 字体管理器是一个轻量级的工具,用于管理、添加、移除你的 Ubuntu 系统上的字体。它是特别为 Gnome 桌面环境构建的,在用户不知道如何在命令行管理字体时会发现这个工具非常有用。 ![](/data/attachment/album/201907/03/011534w2r2k7ccp297rczk.png) 这个 Gtk+ 字体管理器不是为专业用户准备的,它有简单的用户界面,你会发现很容易使用。你只需要从网上下载字体文件,并使用字体管理器添加它们。 ``` $ sudo add-apt-repository ppa:font-manager/staging $ sudo apt-get update $ sudo apt-get install font-manager ``` ### 47、Atril 文档查看器 Atril 是一个简单的文件查看器,支持便携文件格式(PDF)、PostScript(PS)、Encapsulated PostScript(EPS)、DJVU 和 DVI。Atril 与 MATE 桌面环境捆绑在一起,它比大多数 Linux 发行版中默认的文件查看器 Evince 更理想。 ![](/data/attachment/album/201907/03/011542wmk9hmemrb8tjboh.png) Atril 用简单和轻量级的用户界面,可高度自定义,提供了搜索、书签、UI 左侧的缩略图等特点。 ``` $ sudo apt-get install atril ``` ### 48、Notepadqq 如果你曾在 Windows 上用过 Notepad++,并且想在 Linux 上寻找相似的程序,别担心,开发者们已经将它移植到 Linux,名为 Notepadqq。它是一个简单而强大的文本编辑器,你可以在日常使用它,或用于各种语言进行编程。 ![](/data/attachment/album/201907/03/011552sqv8rmx225vskps5.png) 尽管是作为一个简单的文本编辑器,它有一些令人惊奇的特点,例如,你可以设置主题为暗黑或明亮模式、多选、正则搜索和实时高亮。 ``` $ sudo add-apt-repository ppa:notpadqq-team/notepadqq $ sudo apt-get update $ sudo apt-get install notepadqq ``` ### 49、Amarok Amarok 是在 KDE 项目下开发的一个开源音乐播放器。它有直观的界面,让你感觉在家一样,因此你可以轻易的发现你最喜爱的音乐。除了 Clementine,当你寻找 Ubuntu 上的完美的音乐播放器时,Amarok 是一个很棒的选择。 ![](/data/attachment/album/201907/03/011601a82gepe2le4e384q.png) Amarok 上的一些顶尖的特点,包括智能播放列表支持,集成在线服务像 MP3tunes、Last.fm、 Magnatune 等。 ### 50、Cheese Cheese 是 Linux 默认的网络摄像头应用,在视频聊天或即时消息应用中非常有用。除了这些,你还可以用这个应用来照相或拍视频,附带一些迷人的特效。 ![](/data/attachment/album/201907/03/011613h5lzb3u7cjqjl32q.png) 它同样提供闪拍模式,让你快速拍摄多张相片,并提供你共享给你的朋友和家人的选项。Cheese 预装在大多数的 Linux 发行版中,但是你同样可以在软件中心下载它。 ### 51、MyPaint MyPaint 是一个自由开源的光栅图形编辑器,专于数字绘画而不是图像操作和相片处理。它是跨平台的应用,与 Corel Painter 很相似。 ![](/data/attachment/album/201907/03/011620r3opea3ejjwwe3ad.png) MyPaint 可能是 Windows 上的 Microsoft Paint 应用的很好的替代品。它有简单的用户界面,快速而强大。MyPaint 可以软件中心下载。 ### 52、PlayOnLinux PlayOnLinux 是 WINE 模拟器的前端,允许你在 Linux 上运行 Windows 应用。你只需要在 WINE 中安装 Windows 应用,之后你就可以轻松的使用 PlayOnLinux 启动应用和游戏了。 ![](/data/attachment/album/201907/03/011628pjy3t3o23x2mzt2m.png) ### 53、Akregator Akregator 是在 KDE 项目下为 KDE Plasma 环境开发的默认 RSS 阅读器。它有简单的用户界面,自带了 KDE 的 Konqueror 浏览器,所以你不需要在阅读新闻提要时切换应用。 Akregator 同样提供了桌面通知、自动摘要等功能。你会发现在大多数 Linux 发行版中它是最好的提要阅读器。 ### 54、Brave Brave 是一个开源的 web 浏览器,拦截了广告和追踪,所以你可以快速和安全的浏览你的内容。它实际做的是代表你向网站和 Youtube 主播支付了费用。如果你宁可支持网站和 Youtube 主播也不愿意看广告,这个浏览器更适合你。 ![](/data/attachment/album/201907/03/011632etb5uttu303jtu21.png) 对于那些想要安全浏览,但又不想错过互联网上重要信息的人来说,这是一个新概念,一个不错的浏览器。 ### 55、Bitcoin Core Bitcoin Core 是一个比特币官方的客户端,非常安全和可靠。它持续追踪你的所有比特币交易以保证你的所有交易都是有效的。它可以防止比特币矿工和银行完全掌控你的比特币钱包。 ![](/data/attachment/album/201907/03/011643ldi6zuuzuuq9pfud.png) Bitcoin Core 同样提供了其它重要的特点,像私钥备份、冷存储、安全通知等。 ``` $ sudo add-apt-repository ppa:bitcoin/bitcoin $ sudo apt-get update $ sudo apt-get install bitcoin-qt ``` ### 56、Speedy 重复查找工具 Speedy 重复查找工具是一个跨平台的文件查找工具,用来帮助你查找你的系统上的重复文件,清理磁盘空间。它是一个智能工具,可以在整个硬盘上搜索重复文件,它同样提供了智能过滤功能,根据文件类型、扩展或大小帮你找到文件。 ![](/data/attachment/album/201907/03/011655sv6hpp4t46xxh664.png) 它有一个简单和整洁的用户界面,易于上手。从软件中心下载完后你就可以开始磁盘空间清理了。 ### 57、Zulip Zulip 是一个自由开源的群聊应用,被 Dropbox 收购了。它是用 Python 写的,用 PostgreSQL 数据库。它被设计和开发为其它如 Slack 和 HipChat 的聊天应用的替代品。 ![](/data/attachment/album/201907/03/011701k25c92eg3kecgzle.png) Zulip 功能丰富,支持例如拖放文件、群聊、私密聊天、图像预览等。它也集成了 Github、JIRA、Sentry 和上百种其它服务。 ### 58、Okular Okular 是为 KDE 桌面环境开发的跨平台的文件查看器。它是一个简单的文件查看器,支持 Portable Document Format (PDF)、PostScript、DjVu、Microsoft Compiled HTML help 和很多其它文件格式。 ![](/data/attachment/album/201907/03/011710e270ats80zwctsjw.png) Okular 是在 Ubuntu 上你应该尝试的最好的文件查看器之一,它提供了 PDF 文件评论、画线、高亮等很多功能。你同样可以从 PDF 文件中提取文本文件。 ### 59、FocusWriter FocusWriter 是一个集中注意力的字处理工具,隐藏了你的桌面屏幕,让你能够专注写作。正如你看到的屏幕截图,整个 Ubuntu 屏幕被隐藏了,只有你和你的字处理工具。但你总是可以进入 Ubuntu 屏幕,当你需要的时候,只需要将光标移动到屏幕的边缘即可。 ![](/data/attachment/album/201907/03/011719pggnt1z6xc15ez66.png) 它是一个轻量级的字处理器,支持 TXT、RTF、ODT 文件格式。它同样提供了可完全定制的用户界面,还有定时器、警报、每日目标、声音效果等特点,已经被翻译为 20 种语言。 ### 60、Guake Guake 是为 GNOME 桌面环境准备的酷炫的下拉式终端。当你需要时,Guake 就会闪现,当你任务完成后,它就会消失。你只需要按 F12 按钮来启动或退出,这样启动 Guake 比启动一个新的终端窗口更快。 ![](/data/attachment/album/201907/03/011726sm4cyqtnq2mjqy44.png) Guake 是一个功能丰富的终端,支持多栏,只需要点击几下就能将你的终端内容保存到文件,并且有完全可定制的用户界面。 ``` $ sudo apt-get install guake ``` ### 61、KDE Connect KDE Connect 是 Ubuntu 上的一个很棒的应用,我很想在这篇马拉松文章中将它提早列出来,但是竞争太激烈了。总之 KDE Connect 可以将你的 Android 智能手机的通知直接转到 Ubuntu 桌面来。 ![](/data/attachment/album/201907/03/011733m0xnl0jf5nbaallj.png) 有了 KDE Connect,你可以做很多事,例如检查手机电池电量,在电脑和 Android 手机间交换文件,剪贴板同步,发送短信,你还可以将你的手机当作无线鼠标或键盘。 ``` $ sudo add-apt-repository ppa:webupd8team/indicator-kedeconnect $ sudo apt-get update $ sudo apt-get install kdeconnect indicator-kdeconnect ``` ### 62、CopyQ CopyQ 是一个简单但是非常有用的剪贴板管理器,它保存你的系统剪贴板内容,无论你做了什么改变,你都可以在你需要的时候搜索和恢复它。它是一个很棒的工具,支持文本、图像、HTML 和其它格式。 ![](/data/attachment/album/201907/03/011742je0qhzst9qqk7002.png) CopyQ 自身有很多功能像拖放、复制/拷贝、编辑、移除、排序、创建等。它同样支持集成文本编辑器,如 Vim,所以如果你是程序员,这非常有用。 ``` $ sudo add-apt-repository ppa:hluk/copyq $ sudo apt-get update $ sudo apt-get install copyq ``` ### 63、Tilix Tilix 是一个功能丰富的高级 GTX3 平铺式终端模拟器。如果你使用 GNOME 桌面环境,那你会爱上 Tilix,因为它遵循了 GNOME 用户界面指导。Tilix 模拟器与大多数 Linux 发行版上默认终端模拟器相比,它给了你切分终端窗口为多个终端面板的功能。 ![](/data/attachment/album/201907/03/011750rcl2a2fazac24mr2.png) Tilix 提供了自定义链接、图片支持、多面板、拖放、固定布局等功能。它同样支持键盘快捷方式,你可以根据你的需要在偏好设置中自定义快捷方式。 ``` $ sudo add-apt-repository ppa:webupd8team/terminix $ sudo apt-get update $ sudo apt-get install tilix ``` ### 64、Anbox Anbox 是一个 Android 模拟器,可以让你在 Linux 系统中安装和运行 Android 应用。它是自由开源的 Android 模拟器,通过使用 Linux 容器来执行 Android 运行时环境。它使用最新的 Linux 技术 和 Android 发布版,所以你可以运行任何原生的 Android 应用。 ![](/data/attachment/album/201907/03/011753g9mncbn2aslgcca9.png) Anbox 是现代和功能丰富的模拟器之一,提供的功能包括无限制的应用使用,强大的用户界面,与宿主系统无缝集成。 首先你需要安装内核模块。 ``` $ sudo add-apt-repository ppa:morphis/anbox-support $ sudo apt-get update $ sudo apt install anbox-modules-dkms ``` 然后你可以使用 snap 来安装 Anbox。 ``` $ snap install --devmode -- beta anbox ``` ### 65、OpenShot 你会发现 OpenShot 是 Linux 发行版中最好的开源的视频编辑器。它是跨平台的视频编辑器,易于使用,性能方面毫不逊色。它支持所有主流的音频、视频、图像格式。 ![](/data/attachment/album/201907/03/011758a9de2cmi4svl9y19.png) OpenShot 有干净的用户界面,功能有拖放、剪切缩放、尺寸缩放、裁剪、快照、实时预览、音频混合和编辑等多种功能。 ``` $ sudo add-apt-repository ppa:openshot.developers/ppa $ sudo apt-get update $ sudo apt-get install openshot -qt ``` ### 66、Plank 如果你在为你的 Ubuntu 桌面寻找一个 Dock 导航栏,那 Plank 应该是一个选择。它是完美的,安装后你不需要任何的修改,除非你想这么做,它有内置的偏好面板,你可以自定义主题、Dock 大小和位置。 ![](/data/attachment/album/201907/03/011809qcucuy13cbbpesmy.png) 尽管是一个简单的导航栏,Plank 提供了通过拖放来重新摆放,固定和运行应用图标,透明主题支持等功能。 ``` $ sudo add-apt-repository ppa:ricotz/docky $ sudo apt-get update $ sudo apt-get install plank ``` (待续……) 所以这些就是 2018 年我为大家选择的 Ubuntu 上最好的 100 个应用了。所有列出的应用都在 Ubuntu 18.04 上测试了,肯定在老版本上也能运行。 --- via: <https://linuxhint.com/100_best_ubuntu_apps/> 作者:[Swapnil Tirthakar](https://linuxhint.com/author/swapnil/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[warmfrog](https://github.com/warmfrog) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
To make the best use of any operating system, you need the best set of applications and software. Similarly, to make the best use of Ubuntu, you need apps that are best in the business. We are now in 2023 and there are dozens of apps that are available for Ubuntu across various categories. Ubuntu ships-in with handful apps to start, just basic apps that help you use your new operating system. Different user needs different set of applications according to their need and use. In this article, we will give you a brief look into the 100 best apps for Ubuntu that you can install and use in 2023. Many users who recently switched to Ubuntu from Microsoft Windows or any other operating system face the dilemma of finding the best alternative to the application software that they have been using for years on their previous OS. Ubuntu has thousands of free-to-use and open-source application software that perform way better than many paid software on Windows and other OS. The following list features many applications in various categories so that you can find the best application that would best match your requirements. ## 1. Google Chrome Browser Almost all the Linux distributions feature the Mozilla Firefox web browser by default and it is a tough competitor to Google Chrome. But Chrome has its own advantages over Firefox like Chrome gives you direct access to your Google account from where you can sync your bookmarks, browser history, extensions, etc. from the Chrome browser on the other operating systems and mobile phones. Google Chrome features an up-to-date Flash player for Linux which is not the case with the other web browsers on Linux including Mozilla Firefox and Opera web browser. If you continuously use Chrome on Windows, it is the best choice to use it on Linux, too. ## 2. Steam Gaming on Linux is a real deal now which was only a distant dream few years ago. In 2013, Valve announced the Steam gaming client for Linux and everything has changed since then. Earlier users were hesitant to switch to Linux from Windows just because they would not be able to play their favourite games on Ubuntu, but that is not the case now. Some users might find the installation of Steam on Linux tricky but it’s worth all your efforts since thousands of Steam games are available for Linux. Some popular high-end games like Counter Strike: Global Offensive, Hitman, and Dota 2 are available for Linux; you just need to make sure that you have the minimum required hardware to play these games. $ sudo apt-get update $ sudo apt-get install steam ## 3. WordPress Desktop Client Yes, you read it right! WordPress has its dedicated desktop client for Ubuntu from where you can manage your WordPress sites. You can also write and design separately on the desktop client without the need to switch the browser tabs. If you have websites which are backed by WordPress, this desktop client is a must-have application for you as you can also keep track of all the WordPress notifications in one single window. You can also check the stats of the performance of your posts on the website. The WordPress desktop client is available in Ubuntu Software Centre from where you can download and install it. ## 4. VLC Media Player VLC is a very popular cross-platform and open-source media player which is also available for Ubuntu. What makes VLC a best media player is that it can play videos in all the audio and video formats available on planet without any issue. VLC has a slick user interface which is very easy to use. Apart from that, it offers a lot of features such as online video streaming, audio and video customization, etc. $ sudo apt update $ sudo apt-get install vlc qtwayland5 ## 5. Atom Text Editor Having developed by Github, Atom is a free and open-source text editor which can also be used as Integrated Development Environment (IDE) for coding and editing in major programming languages. Atom developers claim it to be a completely hackable text editor for the 21st Century. Atom Text Editor has one of the best user interfaces. It is a feature-rich text editor with features like auto-completion, syntax highlighting, and support of extensions and plug-ins. $ sudo apt-get update $ sudo apt-get install atom ## 6. GIMP Photo Editor GIMP (GNU Image Manipulation Programme) is a free and open-source photo editor for Ubuntu. It is arguably a best alternative to Adobe Photoshop on Windows. If you have been continuously using Adobe Photoshop and finding it difficult to get used to GIMP, you can customize GIMP to look very similar to Photoshop. GIMP is a feature-rich photo editor and you can always use additional features by installing extensions and plug-ins anytime. ## 7. YouTube Music Google Play music player has been replaced by YouTube Music from December 1, 2020 as Google’s main brand for music streaming on various platforms such as Android, Windows, and Linux. YouTube Music comes with much better user interface as compared to Google Music Player. To listen to your favorite music ad-free and download it locally to play in offline mode, you need to buy a premium subscription which can also be accessed on YouTube Premium. With premium subscription, you can listen to music at 256kbit/s AAC while you get an audio quality at 128kbit/s AAC on the free version. It is a great music player to have with great collection across various genres. **Download YouTube Music: https://snapcraft.io/youtube-music-desktop-app** ## 8. Digikam Digikam is a free and open-source professional photo management for creators and photographers. This advanced photo management tool is available for different platforms that includes Linux, Windows, and macOS. This application offers many useful features such as importing, managing, editing, and sharing photos and raw files across other devices. Using digikam’s import tool, you can directly import the photos, raw files, and videos from your camera or external storage like SD cards to your computer. The best thing about this application is that it handles the raw files quite well as compared to the other image editing applications available for Ubuntu. From basic tools for adjusting colors and cropping to advanced tools such as panorama stitching, curve adjustment, and many others, all come bundled with digickam. It also comes with a special tool which applies lens correction automatically on images; the tool is based on Lensfun library. **Download Digikam: https://snapcraft.io/digikam** ## 9. Synaptic Package Manager Synaptic Package Manager is one of the must-have tools on Ubuntu because it works for graphical interface for “apt-get” command which we usually use to install apps on Ubuntu using the terminal. It gives a tough competition to default app stores on various Linux distros. Synaptic comes with very simple user interface which is very fast and easy-to-use as compared to the other app stores. On the other side, you can browse various apps in different categories from where you can easily install and uninstall apps. ## 10. Skype Skype is a very popular cross-platform video calling application which is now also available for Linux as a Snap app. Skype is an instant messaging application which offers features like voice and video calls, desktop screen sharing, etc. Skype has an excellent user interface which is very similar to desktop client on Windows and it is very easy to use. It could be a very useful app for many switchers from Windows. ## 11. VirtualBox VirtualBox is a cross-platform virtualization software application which is developed by Oracle Corporation. If you love trying out new operating systems, VirtualBox is the must-have Ubuntu application for you. You can tryout Linux, mac inside Windows Operating System, or Windows and mac inside Linux. What VB actually does is it lets you virtually run the guest operating system on host operating system. It creates virtual hard drive and installs guest OS on it. You can download and install VB directly from the Ubuntu Software Center. ## 12. Unity Tweak Tool Unity Tweak Tool (Gnome Tweak Tool) is a must-have tool for every Linux user because it gives the users the ability to customize their desktop according to their need. You can try new GTK themes, set up the desktop hot corners, customize the icon set, tweak the unity launcher, etc. Unity Tweak Tool can be very useful to its user as it has everything covered right from the basic to advanced configurations. This tool allows you more control over graphical user interface of your desktop. ## 13. Microsoft Edge Microsoft finally got past its slow and old school web browser. Yes, you guessed it correct! We are talking about Internet Explorer. They finally delivered a web browser that can compete with the likes of Google Chrome and Mozilla Firefox in terms of speed and security which matters most to the users. Now, Microsoft Edge is also available for Linux and its distros with full-fledged features which are similar to that available on Windows. If you use both Windows and Linux, this browser is a must have for you because this makes the syncing process more convenient. ## 14. Stacer Stacer is a GUI-based system optimizer and monitoring tool for Linux and its distributions like Ubuntu. It is an open-source application that helps the user to manage the entire system with different aspects. You can manage various activities using Stacer such as package and process management, CPU, Network, disk monitoring, and managing the startup application. Windows user are aware of CCleaner that helps optimize the system and easily free up space by removing unnecessary files on the system. Same tasks are performed by Stacer on Ubuntu and other Linux distros. Stacer comes with beautiful and modern interface which is very easy to use. $ sudo apt-get update $ sudo apt-get install stacer ## 15. Museek Museek is a simple, clean, and cross-platform music player which is available for platforms such as macOS, Windows, and Linux. This lightweight music player uses “Node.js” as a backend, “electron” for built-in browser, and “React.js” as a frontend framework. It supports most commonly used file formats such as MP3, MP4, M4A, and 3GPP, etc. Its elegant and well-designed interface makes it stand out among others. You can also switch between light and dark theme according to your choice. Its drag and drop feature allows you to add the files and folders directly to its library. Its quick search engine allows you to search your favorite track from the library within seconds. ## 16. Pixbuf Pixbuf is a desktop client from Pixbuf photo community hub which lets you upload, share, and sale your photos. It supports photo sharing to social media networks like Facebook, Pinterest, Instagram, Twitter, etc. and photography services including Flickr, 500px, and Youpic. Pixbuf offers features like analytics which gives you stats about clicks, retweets, repins on your photo, scheduled posts, and dedicated iOS extension. It also has mobile app so that you can always be connected with your Pixbuf account from anywhere. Pixbuf is available for download in the Ubuntu Software Center as a snap package. ## 17. Clementine Music Player Clementine is a cross-platform music player and a good competitor to Rhythmbox which is a default music player on Ubuntu. It is a fast and easy-to-use music player, thanks to its user friendly interface. It supports audio playback in all the major audio file formats. Apart from playing music from the local library, you can also listen to online radio from Spotify, SKY.fm, Soundcloud, etc. It also offers other features like smart and dynamic playlists, and syncing music from cloud storages like Dropbox, Google Drive, etc. $ sudo apt-get update $ sudo apt-get install clementine ## 18. Blender Blender is a free and open-source 3D creation application software which you can use to create 3D printed models, animated films, video games, etc. It comes with integrated out-of-the-box game engine which you can use to develop and test the video games. Blender has a catchy user interface which is easy to use and it includes features like built-in render engine, digital sculpturing, simulation tool, animation tools, and many more. It is one of the best applications that you will ever find for Ubuntu considering it’s free and the features it offer. ## 19. Audacity Audacity is an open-source audio editing application which you can use to record and edit the audio files. You can record the audio from various inputs like microphone, electric guitar, etc. It also gives the ability to edit and trim the audio clips according to your need. Recently, Audacity released new features for Ubuntu which includes theme improvements, zoom toggle command, etc. Apart from these, it offers features like various audio effects including noise reduction and many more. $ sudo apt-get update $ sudo apt-get install audacity ## 20. Vim Vim is an Integrated Development Environment which you can use as standalone application or command-line interface for programming in various major programming languages like Python. Most of the programmers prefer coding in Vim because it is fast and is a highly customizable IDE. Initially, you might find it difficult to use but you will quickly get used to it. ## 21. Inkscape Inkscape is an open-source and cross-platform vector graphics editor which you will find very much similar to Corel Draw and Adobe Illustrator. Using it, you can create and edit the vector graphics such as charts, logos, diagrams, illustrations, etc. Inkscape uses Scalable Vector Graphics (SVG) and an open XML-based W3C standard as a primary format. It supports various formats including JPEG, PNG, GIF, PDF, AI (Adobe Illustrator Format), VSD, etc. $ sudo apt-get update $ sudo apt-get install inkscape ## 22. Exodus Exodus is a very popular cryptocurrency wallet around the world. Exodus is not only a Bitcoin wallet but it is also a Blockchain Wallet Asset called as digital currency or cryptocurrency. Unlike the Bitcoin Core, we don’t need to download the whole Blockchain as it is a lightweight wallet. The user interface of Exodus client is very attractive but simple. If you even don’t have any knowledge about Bitcoin and how it works, you can still be able to use this wallet. Exodus stores all the private keys of your cryptocurrencies on your computer storage locally. You also can backup the wallet to your computer in simple steps which are provided in Exodus client. Crypto exchange or trading is one of the best features available in Exodus. Users can exchange or trade their Bitcoin with other Bitcoin alternatives and vice versa. Exodus has exchange algorithm which is powered by Shapeshifts that performs the exchange or trade of digital currencies in few seconds. ## 23. SimpleScreenRecorder SimpleScreenRecorder is a free and lightweight screen video recorder for Ubuntu. This screen recorder can be a very useful tool for you if you are a YouTube creator or an application developer. It can capture a video/audio record of your desktop screen or directly record the video games. You can set the video resolution, frame rate, etc. before starting the screen recording. It has a simple user interface which you will find very easy to use. $ sudo apt-get update $ sudo apt-get install simplescreenrecorder ## 24. Telegram Telegram is a cloud-based instant messaging and VoIP platform which gained a lot of popularity in recent years. It is an open-source and cross-platform messenger where the user can send messages, share videos, photos, audio, and other files. Some of the notable features in Telegram are secrete chats, voice messages, bots, telescope for video messages, live locations, and social login. Privacy and security is at the highest priority in Telegram, so all the messages that you send and receive are end-to-end encrypted. ## 25. WPS Office WPS office is a clone of Microsoft office on Windows operating system. If you want to have an office suite which is similar to Microsoft Office on Ubuntu, WPS office is a great alternative. Right from the user interface to its features, WPS office has everything identical to Microsoft office. WPS office supports common document format and it works flawlessly with Ubuntu and other Linux distributions. It is a great productivity application to have on Linux. It is also completely free to download and install. ## 26. MailSpring MailSpring, earlier known as Nylas Mail or Nylas N1, is an open-source email client. It saves all the mails locally on your computer so that you can access them anytime you need them. It features advanced search which uses AND and OR operations so that you can search for mails based on different parameters. MailSpring comes with excellent user interface which you will find only on a handful of other mail clients. Privacy and security, scheduler, contact manager, calendar are some of the features that MailSpring offers. ## 27. PyCharm PyCharm is one of my favorite Python IDEs after Vim because it has a slick user interface with lot of extensions and plug-in support. Basically, it comes in two editions: one is the community edition which is free and open-source and the other is the professional edition which is paid. PyCharm has a highly customizable IDE and sports features such as error highlighting, code analysis, integrated unit testing and Python debugger, etc. PyCharm is the preferred IDE by most of the Python programmers and developers. ## 28. Caffeine Imagine you are watching something on YouTube or reading a news article and Ubuntu suddenly locks your screen. I know that is very annoying. It happens with many of us, so Caffeine is the tool that helps you block the Ubuntu lock screen or screensaver. Caffeine Inhibitor is a lightweight tool. It adds icon on the notification bar from where you can activate or deactivate it easily. No additional setting needs to be done in order to use this tool. $ sudo apt-get update $ sudo apt-get install caffeine -y ## 29. Kooha Kooha is an elegant screen recorder for Linux distributions that supports Wayland display. It is one of the first and very few screen recorders that added the support for Wayland. It is a simple screen recorder that comes with simple user interface that is very easy to use. It also supports keyboard shortcuts that helps improve productivity. It supports all the widely used video file formats such as WebM, MP4, GIF, and MKV. In this screen recorder, you get the option to select specific area or the entire screen to record. While recording, you can also add a voice over using microphone. It is quite similar to GNOME’s built-in screen recorder, the user interface being the only exception. To install Kooha on Linux, you need to enable the Flatpack support. Run following commands one by one to install Kooha: $ flatpak install flathub io.github.seadve.Kooha ## 30. Neofetch Neofetch is a cool system information tool that gives you all the information about your system by running the “neofetch” command in the terminal. It is a cool tool to have because it gives you information about the desktop environment, kernel version, Bash version, and GTK theme that you are running. As compared to other system information tools, Nefetch is a highly customizable tool. You can perform various customizations using the following command line: $ sudo apt-get update $ sudo apt-get update install neofetch ## 31. Peek Peek is an animated screen recorder for Ubuntu and other Linux distros. It is very easy to use to with simple user interface that makes you feel at home right from the start. It was initially built to showcase the UI features of the new underdeveloped apps and a bug if there is any. It works flawlessly on Unity desktop environment. Before you proceed with the installation, make sure that you have ffmpeg installed on your system. $ sudo apt update && sudo apt install peek ## 32. Zabbix Zabbix is an open-source monitoring tool for IT infrastructure for networks, servers, virtual machines and cloud services, etc. It is a professionally developed tool specifically for enterprises and organizations. Despite being a powerful tool, it is a completely free-to-use system monitoring tool. It is available for a variety of Linux distributions such as CentOS, Debian, Ubuntu, Raspberry Pi OS, etc. ## 33. Weather Weather is a small application which gives you a real-time weather information for your city or any other location in the world. It is a simple and lightweight tool which gives you a detailed forecast of up to 7 days and an hourly details for the current and the next day. It integrates with the GNOME shell to give you information about the current weather conditions at the recently searched locations. It has a minimalist user interface which works smoothly on minimum hardware requirement. ## 34. Kdenlive Kdenlive is a free and open-source video editing application for Linux and its distros. It is a feature-rich video editor with features like multi-track video editing, support for various video/audio file formats, highly configurable interface with keyboard shortcuts, effects and transitions, and many other useful features. It is a reliable video editing application which runs smoothly on any Linux distribution. It also comes with a variety of light and dark themes to match your needs. ## 35. Thunderbird Thunderbird is an open-source email client which is also a default email client in most of the Linux distributions. Despite parting ways with Mozilla in 2017, Thunderbird is still very popular and is the best email client on the Linux platform. It comes with features like spam filtering, IMAP and POP email syncing, calendar support, address book integration, and many other out-of-the-box features. It is a cross-platform email client with a full community support across all supported platforms. You can always change its look and feel, thanks to its highly customizable nature. ## 36. Pidgin Pidgin is an instant messaging client where you can login into different instant messaging networks under a single window. You can login to instant messaging networks like Google Talk, XMPP, AIM, Bonjour, etc. Pidgin has all the features you can expect in an instant messenger and you can always enhance its performance by installing additional plug-ins. ## 37. Krita Krita is a free and open-source digital painting, editing, and animation application developed by KDE. It has an excellent user interface with everything placed perfectly so that you can easily find the tool you need. It uses OpenGL canvas which boosts Krita’s performance. It also offers many features like different painting tools, animation tools, vector tools, layers and masks, and many more. Krita is available in the Ubuntu Software Center. You can easily download it from there. ## 38. Dropbox Dropbox is a stand-out player in cloud storage and its Linux clients works really well on Ubuntu once installed properly. While Google Drive comes out-of-the-box on Ubuntu 16.04 LTS and later, Dropbox is still a preferred cloud storage tool on Linux in terms of the features it offer. It always works in the background and backs up the new files from your system to the cloud storage, and continuously syncs the files between your computer and its cloud storage. ## 39. Kodi Kodi, formerly known as Xbox Media Center (XBMC), is an open-source media player. You can play music, videos, podcasts, and video games both in online and offline mode. This software was first developed for the first generation of Xbox gaming console and then slowly ported to personal computers. Kodi has very impressive video interface which is fast and powerful. It is a highly customizable media player. By installing additional plug-ins, you can access the online streaming services like Pandora, Spotify, Amazon Prime Video, Netflix and YouTube. ## 40. Spotify Spotify is one of the best online media streaming sites. It provides music, podcast, and video streaming services, both on free and paid subscription basis. Earlier, Spotify was not supported on Linux but now it has its own fully functional desktop client for Ubuntu. Alongside the Google Play Music Desktop Player, Spotify is a must-have media player for you. You just need to login to your Spotify account to access your favorite online content from anywhere. ## 41. Brackets Brackets is an open-source text editor which is developed by Adobe. It can be used for web development and design in web technologies such as HTML, CSS, and JavaScript. It sports live preview mode which is great feature to have as it can get a real-time view of whatever the changes you make in the script. It is one of the modern text editors on Ubuntu and has a slick user interface which takes the web development task to the new level. It also offers features like inline editor and supports for popular extensions like Emmet, Beautify, Git, File Icons, etc. ## 42. Vivaldi Vivaldi is a free cross-platform web browser which is specially developed for end-users with heavy internet usage. This browser adopts some popular features from Opera 12 which was based on the Presto layout engine. You will find many similar features from the older version of Opera web browser and My Opera. Vivaldi is one of the most flexible web browsers out there which gives you full control over customization with features like tab management, customization to create your own unique experience, keyboard shortcuts, mouse gestures, quick commands through command line, and a bookmark manager. It also features a set of built-in tools such as Notes which you can use to take down notes while surfing on web, capture screenshot of a full web page or a particular area, and image properties tool which can be used to get an in-depth information about the image like copyrights, histograms, etc. ## 43. Terminator Terminator is an open-source terminal emulator which is programmed and developed in Java. It is a cross-platform emulator which lets you have privilege of multiple terminals in one single window which is not the case in the Linux default terminal emulator. Other stand-out feature in terminator includes automatic logging, drag and drop, intelligent vertical and horizontal scrolling, etc. ## 44. GitBook Editor Gitbook Editor for Linux helps you write and publish your book in multiple file formats such as PDF, EPUB, and HTML. Markdown syntax helps you create eBook and within just a few clicks after that, you can already publish it. If you have multiple contributors to your project, GitBook allows you to split the workload among them using the git distributed revision control. GitBook editor is a cross-platform and a free application with great graphical user interface. Features like drag-n-drop, auto-complete, live preview, integrated Git control, a file tree panel, and quick formatting buttons facilitate easy document structuring. ## 45. Thonny Thonny is a simple and lightweight IDE which is especially designed for beginners in programming. If you are new to programming, this is the must-have IDE for you because it lets you learn while programming in Python. Thonny is also a great tool for debugging as it supports live variables during debugging. Apart from this, it offers features like separate windows for executing function call, simple user interface, etc. ## 46. Font Manager Font Manager is a lightweight tool for managing, adding, or removing fonts on your Ubuntu system. It is specially built for Gnome desktop environment. Users who don’t have an idea about managing fonts using command line will find this tool very useful. Gtk+ Font Manager is not meant to be for professional users. It has a simple user interface which you will find very easy to navigate. You just need to download the font files from the internet and add them using the Font Manager. $ sudo apt-get update $ sudo apt-get install font-manager ## 47. Atril Document Viewer Atril is a simple document viewer which supports the file formats like Portable Document Format (PDF), PostScript (PS), Encapsulated PostScript (EPS), DJVU and DVI. Atril comes bundled with MATE desktop environment and it is identical to Evince which is a default document on most of the Linux distros. Atril has simple and lightweight user interface which is highly customizable and offers features like search and bookmarks, and its UI includes thumbnails on the left-hand side. ## 48. Notepadqq If you have ever used Notepad++ on Windows and you are looking for similar program on Linux, don’t worry because the developers have ported it to Linux as Notepadqq. It is a simple yet powerful text editor which you can use for your daily tasks or programming in various languages. Despite being a simple text editor, it has some amazing features like setting the theme between dark and light color scheme, multiple selection, regular expression, search, and real-time highlighting. $ sudo apt-get update $ sudo apt-get install notepadqq ## 49. Whatever (Evernote Alternative) Whatever is a lightweight alternative to the Evernote client for Linux and its distros. Evernote is only available for the Windows, macOS, iOS, and Android. Evernote helps you manage the tasks and save the web content for future reference under a single window. Apart from that, you can also perform drawing, sketching, and many more tasks. Whatever is the most reliable alternative to Evernote as it offers all of its features. Whatever can perform all the task that Evernote offers. Whatever integrates almost all the features available on Evernote. Whatever offers feature like to-do-lists, smart note taking, cross-device synchronization, note sharing, and many more. It also supports all the widely used media file formats like audio, video, pdf document, and images. $ sudo dpkg -i Whatever_1.0.0_amd64.deb $ sudo apt update && sudo apt upgrade ## 50. Cheese Cheese is a Linux default webcam application which can be useful to you in some video chat or instant messaging applications. Apart from that, you can also use this app to take photos and videos with fancy effects. It also sports the burst mode which lets you take multiple snaps in a quick succession and option to share your photos with friends and family. Cheese come pre-installed with most of the Linux distros but you can also download and install it from the Software Center. ## 51. MyPaint MyPaint is a free and open-source raster graphics editor which focuses on digital painting rather than image manipulation and post processing. It is a cross-platform application and is more or less similar to Corel Painter. MyPaint could be a good alternative to those who use Microsoft Paint application on Windows. It has simple user interface which is fast and powerful. MyPaint is available in the Software Center for download. ## 52. PlayOnLinux PlayOnLinux is a front-end for WINE emulator which allows you to run the Windows applications on Linux. You just need to install the Windows applications and game on WINE. Then, you can easily launch the applications and games using PlayOnLinux. ## 53. Music on Console Music on Console is a free and open-source command line music player for Linux and its distros like Ubuntu. It is a lightweight yet powerful music player which is very easy to use. There is no need to create the playlist in this music player; you just need to select a file from the directory where your favourite music files are stored. After that, Music on Console will start playing the music one-by-one. It works flawlessly even on machines with old hardware. Features like simple equalizer, multiple theme options, customizable keys, and support for internet broadcast make it a great console-based music player. ## 54. Brave Brave is an open-source web browser which blocks the ads and trackers so that you can browse your content fast and safely. What it actually does is that it pays to the websites and YouTubers on your behalf. If you prefer contributing to the websites and YouTubers rather than seeing the advertisements, this browser is for you. This is a new concept and could be a good browser for those who prefer safe browsing without compromising important data on internet. ## 55. Bitcoin Core Bitcoin Core is an official Bitcoin client which is highly secure and reliable. It keeps track of all your transactions and makes sure that all transactions are valid. It restricts the Bitcoin miners and banks from taking full control of your Bitcoin wallet. Bitcoin Core also offers other important features like private keys backup, cold storage, and security notifications. $ sudo apt-get update $ sudo apt-get install bitcoin-qt ## 56. Speedy Duplicate Finder Speedy Duplicate Finder is a cross-platform file finder which helps you find the duplicate files on your system and free-up the disk space. It is a smart tool which searches for duplicate files on the entire hard disk and also features smart filter which helps you find the file by file type, extension, or size. It has a simple and clean user interface which is very easy to handle. As soon as you download it from the Software Center, you are good to go with the disk space clean-up. ## 57. Zulip Zulip is a free and open-source group chat application which was acquired by Dropbox. It is written in Python and uses PostgreSQL database. It was designed and developed to be a good alternative to other chat applications like Slack and HipChat. Zulip is a feature-rich application with features such as drag and drop files, group chats, private messaging, image previews, and many more. It also supports integration with the likes of Github, JIRA, Sentry, and hundreds of other services. ## 58. Okular Okular is a cross-platform document viewer which is developed by KDE for KDE desktop environment. It is a simple document viewer and supports the file formats like Portable Document Format (PDF), PostScript, DjVu, Microsoft Compiled HTML help, and many other major file formats. Okular is one of the best document viewers that you should try on Ubuntu as it offers features like commenting on PDF documents, drawing lines, highlighting, and much more. You can also extract the text from the PDF document to the text file. ## 59. Pinta Pinta is a free and open-source cross-platform drawing and editing application. It is not as feature-rich image editing applications as Krita but is still very useful and reliable when it comes to basic editing and drawing. Just like Microsoft Paint, you can draw, paint, and add text using this application. Pinta gets some edge on Microsoft Paint when it comes to the features it offer. It is a simple drawing and image editing tool with simple and easy-to-use user interface. It is a great application for computers with minimal hardware resources. ## 60. Guake Guake is a cool drop-down terminal for GNOME Desktop Environment. Guake comes in a flash whenever you need it and disappears as soon as your task is completed. You just need to click the F12 button to launch or exit it, so launching Guake is way faster than launching new terminal window. Guake is a feature-rich terminal with features like support for multiple tabs, ability to save your terminal content to the file in few clicks, and fully customizable user interface. ## 61. KDE Connect KDE Connect is an awesome application on Ubuntu. We would love to list this application much higher in this marathon article but the competition is intense. Anyway, KDE Connect helps you get your Android smartphone notifications directly on the Ubuntu desktop. With KDE Connect, you can do a whole lot of other things like checking your phone’s battery level, exchange files between computer and Android phone, clipboard sync, sending SMS, and using your phone as a wireless mouse or keyboard. $ sudo apt-get update $ sudo apt-get install kdeconnect indicator-kdeconnect ## 62. CopyQ CopyQ is a simple but very useful clipboard manager which stores the content of the system clipboard whenever any change is made so that you can search and restore it back whenever you need it. It is a great tool to have as it supports text, images, HTML, and other formats. CopyQ comes pre-loaded with features like drag and drop, copy/paste, edit, remove, sort, create, etc. It also supports integration with the text editors like Vim. It could be a very useful tool if you are a programmer. $ sudo apt-get update $ sudo apt-get install copyq ## 63. GNOME Tweaks GNOME tweaks is an essential tool for GNOME users. All the major Linux distributions like Ubuntu, Manjaro, Pop_Os! and Fedora use the GNOME desktop environment. You can customize almost everything using GNOME Tweaks on Ubuntu. You can change the themes, wallpaper, and startup application, disable the animation to speed up your desktop, customize the desktop icons, manage the GNOME extensions, manage the fonts, change the power settings, and perform many other tweaks. $ sudo apt install gnaome-tweak-tool ## 64. Anbox Anbox is an Android emulator which lets you install and run the Android apps on your Linux system. It is a free and open-source Android emulator that executes the Android runtime environment using Linux Containers. It uses the latest Linux technologies and Android releases so that you can run any Android app like any other native application. Anbox is one of the modern and feature-rich emulators and offers features like no limit for application use, powerful user interface, and seamless integration with the host operating system. First, you need to install the following kernel modules: $ sudo apt-get update $ sudo apt install anbox-modules-dkms Now, install Anbox using snap: ## 65. OpenShot OpenShot is the best open-source video editor that you will find for Linux distros. It is a cross-platform video editor which is very easy to use without any compromise with its performance. It supports all the major audio, video, and image formats. OpenShot has a clean user interface and offers features like drag and drop, clip resizing, scaling, trimming, snapping, real-time previews, audio mixing and editing, and many other features. $ sudo apt-get update $ sudo apt-get install openshot -qt ## 66. Plank If you are looking for a cool and simple dock for your Ubuntu desktop, Plank should be the first choice for you. It is a perfect dock where you don’t need to make any tweaks after installation. But if you want to, it has built-in preferences panel where you can customize the themes, dock size, and position. Despite being a simple dock, Plank offers features like item rearrangement by simple drag and drop, pinned and running apps icon, and transparent theme support. $ sudo apt-get update $ sudo apt-get install plank ## 67. Filezilla Filezilla is a free and cross-platform FTP application which sports the FileZilla client and server. It lets you transfer files using FTP and encrypted FTP like FTPS and SFTP and supports the IPv6 internet protocol. It is a simple file transfer application with features like drag and drop, support for various languages used worldwide, powerful user interface for multitasking, controlling and configuring the transfer speed, and many other features. ## 68. Stacer Stacer is an open-source system diagnostic tool and optimizer developed using the Electron development framework. It has an excellent user interface and you can clean the cache memory, start-up the applications, uninstall apps that are no longer needed, and monitor the background system processes using it. It also lets you check the disk, memory, and CPU usage and gives you the real-time stats of downloads and uploads. It looks like a tough competitor to the Ubuntu cleaner but both have unique features that separate them apart. $ sudo apt-get update $ sudo apt-get install stacer ## 69. 4K Video Downloader 4K Video Downloader is a simple video downloading tool which you can use to download videos, playlists, channels from Vimeo, Facebook, YouTube and other online video streaming sites. It supports the download of YouTube playlists and channels in MP4, MKV, M4A, 3GP and many other video/audio file formats. 4K Video Downloader is not as simple as you would think. Apart from normal video downloads, it supports 3D and 360 degree video downloading. It also offers features like in-app proxy setup and direct transfer to iTunes. You can download it from [here](https://www.4kdownload.com/download). ## 70. Insync Insync is one of the most reliable Google Drive clients that you will find for Linux and its distributions such as Ubuntu, Linux Mint, Fedora and Debian. It comes with a 15-day free trial. After that, you need to purchase it to use it further. In three simple steps, you can access your Google Drive data on Linux using Insync. Just download Insync, install, and then login to your Google account. Its selective sync 2.0 feature helps you sync all your files and folders either in your local computer or in the cloud storage. Also, you can access all the files that are locally stored on Google Drive in the Linux file manager. You can also access multiple Google Drive accounts. Google docs automatically gets converted to Open Document format for Libre Office compatibility. Insync is great for professional use as you can give offline access to your team to Google’s shared drive for smooth workflow. ## 71. Hiri Hiri is a cross-platform email client which is developed in Python programming language. It has a slick user interface and it can be a good alternative to Microsoft Outlook in terms of features and services offered. This is a great email client that can be used for sending and receiving emails, managing contacts, calendars, and tasks. It is a feature-rich email client that offers features like integrated task manager, email synchronization, email rating, email filtering, and many more. ## 72. Sublime Text Sublime Text is a cross-platform source code editor programmed in C++ and Python. It has Python Application Programming Interface (API) and supports all the major programming and markup languages. It is a simple and lightweight text editor which can be used as IDE with features like auto-completion, syntax highlighting, split editing, etc. Some additional features in this text editor include Goto anything, Goto definition, multiple selections, command palette, and a fully customizable user interface. ## 73. TeXstudio TeXstudio is an integrated writing environment to create and edit the LaTex documents. It is an open-source editor which offers features like syntax highlighting, integrated viewer, interactive spelling checker, code folding, drag and drop, etc. It is a cross-platform editor and has a very simple, lightweight user interface which is easy to use. It ships in with integration for BibTex and BibLatex bibliographies managers and integrates the PDF viewer. You can download the TeXstudio installation package from its [website](https://www.texstudio.org/) or in the Ubuntu Software Center. ## 74. QtQR QtQR is a Qt based application that lets you create and read the QR codes in Ubuntu. It is developed in Python and has a simple and lightweight user interface. You can encode the website URL, email, text, SMS, etc. You can also decode the barcode using the webcam camera. QtQR could prove to be a useful tool to have if you generally deal with product sales and services because we don’t have any other similar tool to QtQR which requires minimal hardware to function smoothly. $ sudo apt-get update $ sudo apt-get install qtqr ## 75. Nylas N1 Nylas N1 is a free and open-source email client for Ubuntu and other Linux distros. This is a cross-platform email client available for all the major operating system platforms such as Windows, macOS, and Linux. If you have a mail account with different mail services like Gmail, Yahoo Mail, and Microsoft Outlook and you want to access them under one single window, Nylas N1 is the best email client to have as it can be used to configure all major mail services under a single window. Nylas N1 supports all the major mail transfer protocols such as IMAP, SMTP, and POP3 which makes it one of the most reliable email clients out there. ## 76. NitroShare NitroShare is a cross-platform, open-source network file sharing application. It lets you easily share files between multiple operating systems’ local network. It is a simple yet powerful application and it automatically detects the other devices that run the NitroShare on local network. File transfer speed is what makes NitroShare a stand-out file sharing application as it achieves gigabit speed on capable hardware. There is no need for required additional configuration. You can start the file transfer as soon as you install it. $ sudo apt-get update $ sudo apt-get install nitroshare ## 77. Konversation Konversation is an open-source Internet Relay Chat (IRC) client which is developed for KDE desktop environment. It gives speedy access to Freenode network’s channels where you can find support for most distributions. It is a simple chat client with features like support for IPv6 connection, SSL server support, bookmarks, on-screen notifications, UTF-8 detection, and additional themes. It has easy-to-use GUI which is highly configurable. ## 78. Discord If you’re a hardcore gamer and play online games frequently, we have a great application for you. Discord is a free Voice over Internet Protocol (VoIP) application which is especially designed for online gamers around the world. It is a cross-platform application and can be used for text and audio chats. Discord is a very popular VoIP application gaming community. Since it is a completely free application, it is a very good competitor to the likes of Skype, Ventrilo, and Teamspeak. It also offers features like clear voice quality, and modern text chat where you can share images, videos, and links. ## 79. Conky Conky is a free and open-source system monitoring tool for Linux, FreeBSD, and OpenBSD systems. It is a highly configurable system monitoring tool. Conky shows the system data such as CPU load, memory usage, hard drive usage, network activity, GPU temperature, fan speed, GPU clock, and other data such as time and weather. It is a lightweight system monitoring tool. Hence, it works effortlessly on the system with minimal hardware. ## 80. MPV Media Player MPV is a free and open-source media player based on MPlayer and MPlayer 2. It has a simple user interface where the user just needs to drag and drop the audio/video files to play them since there is no option to add the media files on GUI. One of the things about MPV is that it can effortlessly play 4K videos which is not the case with the other media players on Linux distros. It also gives the user ability to play the videos from online video streaming sites including YouTube and Dailymotion. $ sudo apt-get update $ sudo apt-get install -y mpv ## 81. Plume Creator If you’re a writer, Plume Creator is a must-have application for you because you will not find other app for Ubuntu with privileges like Plume Creator. Writing and editing stories and chapters is a tedious task. Plume Creator makes this task easier for you with the help of some amazing tools it has to offer. It is an open-source application with minimal user interface which you could find confusing in the beginning but you will get used to it later on. It offers features like edit notes, synopses, export in HTML and ODT formats support, and rich text editing. ## 82. Chromium Web Browser Chromium is an open-source web browser which is developed and distributed by Google. Chromium is very identical to Google Chrome web browser in terms of appearance and features. It is a lightweight and fast web browser with minimalist user interface. If you use Google Chrome regularly on Windows and you are looking for similar browser for Linux, Chromium is the best browser for you as you can login into your Google account to access all your Google services including Gmail. ## 83. Simple Weather Indicator Simple Weather Indicator is an open-source weather indicator app which is developed in Python. It automatically detects your location and shows you the weather information like temperature, possibility of rain, humidity, wind speed, and visibility. Simple Weather Indicator comes with configurable options such as location detection, temperature SI unit, location visibility on/off, etc. It is a cool app to have which comfortably adjusts with your desktop. ## 84. Flameshot Flameshot is a free and open-source screenshot tool for Linux and its distros such as Ubuntu. It is a cross-platform tool which is also available for other major operating system platforms such as Windows and mac. It offers features such as instantly editing screenshots, image upload to Imgur, and export and import configuration. Apart from that, it is a very easy-to-use and highly customizable tool. ## 85. Scribus Scribus is a free and open-source desktop publishing application that lets you create posters, magazines, and books. It is a cross-platform application based on Qt toolkit and is released under GNU general public license. It is a professional application with features like CMYK and ICC color management, Python-based scripting engine, and PDF creation. Scribus comes with decent user interface which is easy to use and works effortlessly on systems with low hardware. It could be downloaded and installed from the Software Center on all the latest Linux distros. ## 86. Cura Cura is an open-source 3D printing application developed by David Braam. Ultimaker Cura is the most popular software in 3D printing world and is used by millions of users worldwide. It follows a 3-step 3D printing model: Design, Prepare, and Print. It is a feature-rich 3D printing application with seamless integration support for CAD plug-ins and add-ons. It is a very simple and easy-to-use tool in which the novice artists can start right away. It supports major file formats like STL, 3MF, and OBJ. ## 87. Nomacs Nomacs is an open-source, cross-platform image viewer which supports all the major image formats including raw and PSD images. It has the ability to browse the images in zip or Microsoft Office files and extract them to a directory. Nomacs has very simple user interface with image thumbnails at the top. It offers some basic image manipulation features like crop, resize, rotate, color correction, etc. $ sudo apt-get update $ sudo apt-get install nomacs ## 88. BitTicker BitTicker is a live bitcoin-USDT Ticker for Ubuntu. It is a simple tool that connects to bittrex.com market, retrieves the latest price for BTC-USDT, and displays the Ubuntu clock on system tray. It is simple but very useful if you regularly invest in Bitcoin and study the price fluctuations. ## 89. pCloud The pCloud is a cross-platform cloud storage application where you can store your personal files or backup your PC. The pCloud has a dedicated client for Linux and its distros such as Ubuntu. This app not only lets you store the data or files on cloud but also helps you recover the older versions of the data up to 1 year. You can also send and receive large files to and from anyone you like. The best thing about pCloud is that it offers military grade file encryption which encrypts sensitive files on any device and make them invisible. ## 90. Shortwave Shortwave is an internet-based radio player application for Linux and its distros such as Ubuntu. It is an open-source radio player that comes with modern user interface. Dark mode feature is also available with this out-of-the-box application. There are some other features that are worth mentioning such as available thousands of radio stations, keyboard navigation, sleep/hibernate mode, and many others. ## 91. Calibre Calibre is a cross-platform, open-source solution to all your e-book needs. It is a simple e-book organizer that offers features like displaying, creating, editing e-books, organizing existing e-books into virtual libraries, syncing, and many more. Calibre also helps you convert the e-books into whichever format you need and send them to your e-book reading device. Calibre is a very good tool to have if you regularly read and manage e-books. ## 92. MATE Dictionary MATE Dictionary is a simple dictionary that is basically developed for MATE desktop environment. You just need to type the word and then this dictionary displays the meaning and references for it. It is a simple and lightweight online dictionary with a minimalist user interface. ## 93. Converseen Converseen is a free cross-platform batch image processing application that lets you convert, edit, resize, rotate, and flip a large number of images with a single mouse click. It offers features like renaming bunch of images using prefix/suffix, extracting the image from a Windows icon file, etc. It has very good user interface which is easy to use even if you are a novice user. It can also convert an entire PDF file into a collection of images. ## 94. Tiled Map Editor Tiled is a free software level map editor which you can use to edit the maps in various projections such as orthogonal, isometric, and hexagonal. This tool can be very useful for game developers during game engine development cycle. Tiled is a versatile map editor which lets you create power boost positions, and map the layouts, collision areas, and enemy positions. It saves all the data in tmx format. ## 95. Sayonara Sayonara is a small and lightweight music player for Linux and its distros such as Ubuntu. It is one of the most underrated music players out there. It definitely deserves more attention. It has a simple but very easy to use user interface that also comes with dark mode. Talking about features, it comes with support for various popular music and playlist formats, directory view, shortcut keys, and seamless desktop integration. $ sudo apt-get update $ sudo apt-get install sayonara ## 96. Arora Arora is a free and open-source web browser which offers features like dedicated download manager, bookmarks, privacy mode, and tabbed browsing. Arora web browser is developed by Benjamin C. Meyer. It is popular among Linux users for its lightweight nature and flexibility. ## 97. Kbackup Kbackup is a simple and user-friendly application to back up your important files and data in the most simple way. You can select which file or folder to include or exclude in the backup. Using Kbackup, you can run an automated backup without the need for graphical user interface. This is a simple application. Even if you are first time user, you will feel at home on the first go. ## 98. Geany Geany is a simple and lightweight text editor which works like an Integrated Development Environment (IDE). It is a cross-platform text editor and supports all the major programming languages including Python, C++, LaTex, Pascal, C#, etc. Geany has simple user interface which resembles to programming editors like Notepad++. It offers IDE-like features such as code navigation, auto-completion, syntax highlighting, and extensions support. ## 99. Mumble Mumble is another Voice over Internet Protocol (VoIP) application which is very similar to Discord. Mumble is also basically designed for online gamers and uses client-server architecture for end-to-end chat. The voice quality is very good on Mumble and it offers end-to-end encryption to ensure privacy. Mumble is an open-source application and features a very simple user interface which is easy to use. Mumble is available for download in the Ubuntu Software Center. ## 100. Deluge Deluge is a cross-platform and lightweight BitTorrent client that can be used to download files on Ubuntu. BitTorrent client come bundled with many Linux distros but Deluge is the best BitTorrent client which has simple and easy-to-use user interface. Deluge comes with all the features that you will find in BitTorrent clients. But one feature that stands out is giving the user ability to access the client from other devices so that you can download the files to your computer even if you are not at home. $ sudo apt-get update $ sudo apt-get install deluge ## Conclusion These are our picks for best 100 applications for Ubuntu in 2023 which you should try. Surely, there are other apps that you may feel should have made the list; it totally depends on the individual choice and its use. All the applications that are listed here are tested on Ubuntu 22.04 LTS and majority of them definitely works on older versions.
11,049
领导 Python 社区
https://opensource.com/article/19/6/naomi-ceder-python-software-foundation
2019-07-03T15:57:55
[ "Python" ]
https://linux.cn/article-11049-1.html
> > 对话现任 Python 软件基金会董事会主席 Naomi Ceder。 > > > ![](/data/attachment/album/201907/03/155715vrhkvapiiia9i3zp.jpg) 和开源软件世界的很多其他领袖一样,[Python 软件基金会](https://www.python.org/psf/)(PSF)的董事会主席 [Naomi Ceder](https://www.naomiceder.tech/pages/about/) 通过一种不同寻常的方式走进了 Python 世界。正如她在 2017 年 PyCon España 大会上的 [keynote](https://www.youtube.com/watch?v=ayQK6app_wA) 的标题所说,她是因为这个编程语言而来,因为这个社区而留下的。在我们和她的一次近期的交流中,她分享了自己成为 Python 社区领袖的历程,并且就“是什么让 Python 如此特别”这个问题提供了一些独到的见解。 ### 从授课到编程 Naomi 的职业生涯是从古典文学开始的。她取得了拉丁文和古希腊文的博士学位,并且辅修了印欧语言学。在一家私立学校教授拉丁语的同时,她开始接触了计算机,学习如何编程、如何拆机进行升级或者维修。1995 年,她开始在 [Yggdrasil Linux](https://en.wikipedia.org/wiki/Yggdrasil_Linux/GNU/X) 系统上开发开源软件,并且帮助建立了印第安纳州韦恩堡的 [Linux 用户小组](http://fortwaynelinux.org/about)。 作为一名教师,Naomi 相信在中学教授编程课程是非常重要的,因为等到大多数人上大学的时候,他们已经认为编程和科技相关的职业已经不是自己可以从事的了。她表示,更早地教授相关课程有助于增加科技人才的供给,提高人才的多元化和经验的广度,从而更好地满足行业需求。 大约在 2001 年前后,她决定从学习人类语言转向研究计算机语言,并同时教授计算机课程和管理学校的 IT 系统。在 2001 年的 Linux World 大会上听了一整天时任 PSF 主席 Guido Van Rossum (LCTT 译注:也是 Python 创始人)关于 Python 的演讲之后,她对 Python 的热情被点燃了。在那个时候,Python 还只是一门晦涩难懂的语言,但是她是如此喜欢 Python,以至于在她的学校开始使用 Python 记录学生信息、进行系统管理。 ### 领导 Python 社区 Naomi 表示,“社区是 Python 成功背后的关键因素。开源软件的核心思想是分享,很少有人真的喜欢一个人坐在那儿盯着屏幕写代码。真正的满足来源于和别人交流想法,并且共同创造一些东西。” 她在第一届 [PyCon](http://pycon.org/) 大会上发表了演讲,并且从此之后一直是一名参与者和领导者。她组织了一些 <ruby> 趣味相投 <rt> birds-of-a-feather </rt> <rt> </rt></ruby> 讨论会(LCTT 译注:birds-of-a-feather,一种在大会参与者之间进行的基于兴趣的非正式小规模讨论活动)、PyCon 和 PyCon UK 大会的海报展示会、教育峰会,以及 PyCon 大会的西班牙语频道。 她同时是 《[The Quick Python Book](https://www.manning.com/books/the-quick-python-book-third-edition)》一书的作者,并且联合创立了 [Trans\*Code](https://www.trans.tech/),“英国唯一一个专注于变性者的问题和机遇的黑客节”(LCTT 译注:<ruby> 黑客节 <rt> hack event </rt></ruby>是一种让软件开发、设计、项目管理等相关人员相聚在一起,针对软件项目进行高强度合作的活动)。Naomi 表示,“随着科技能够提供越来越多的机遇,确保传统意义上的边缘化群体能够同等地享受到这些机遇成为了一件更为重要的事情。” ### 通过 PSF 进行贡献 作为 PSF 的董事会主席,Naomi 积极地参与着该组织对 Python 语言和其使用者的支持工作。除了赞助 PyCon 大会的举办之外,PSF 基金会还为世界各地的小型聚会、大型会议和研习会提供资助。2018 年,该组织发放的资助接近 335000 美元,其中大多数款项的金额都在 500 美元到 5000 美元之间。 PSF 的短期目标是成为一个由专业人员维护的可持续的、稳定的、成熟的非盈利机构。它的长期目标包括发展可以提供对 Python 开发工作有效支持的各种资源,以及扩展该组织对全世界范围内 Python 教育工作的支持。 这些工作都需要来自社区的经济上的支持。Naomi 表示,PSF “最大的资金来源是 PyCon 大会。为了确保 PSF 的可持续性,我们同时也关注使用 Python 的企业的赞助,这是我们增长最快的部分。”会员费是每年 99 美元,并且 [捐款和募捐人](https://www.python.org/psf/donations/) 同样也在帮助维持该组织的工作。 你可以在 PSF 的 [年度报告](https://www.python.org/psf/annual-report/2019/) 中了解该组织的更多工作情况。 --- via: <https://opensource.com/article/19/6/naomi-ceder-python-software-foundation> 作者:[Don Watkins](https://opensource.com/users/don-watkins) 选题:[lujun9972](https://github.com/lujun9972) 译者:[chen-ni](https://github.com/chen-ni) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
Like many other leaders in the open source software world, [Naomi Ceder](https://www.naomiceder.tech/pages/about/), board chair of the [Python Software Foundation](https://www.python.org/psf/) (PSF), took a non-traditional path into the Python world. As the title of her 2017 [keynote](https://www.youtube.com/watch?v=ayQK6app_wA) at PyCon España explains, she came for the language and stayed for the community. In a recent conversation with her, she shared how she became a Python community leader and offered some insight into what makes Python special. ## From teaching to coding Naomi began her career in the Classics; she earned a PhD in Latin and Ancient Greek with a minor in Indo-European Linguistics, as she says, "several decades ago." While teaching Latin at a private school, she began tinkering with computers, learning to code and to take machines apart to do upgrades and repairs. She started working with open source software in 1995 with [Yggdrasil Linux](https://en.wikipedia.org/wiki/Yggdrasil_Linux/GNU/X) and helped launch the Fort Wayne, Indiana, [Linux User Group](http://fortwaynelinux.org/about). A teacher at heart, Naomi believes teaching coding in middle and high school is essential because, by the time most people get to college, they are already convinced that coding and technology careers are not for them. Starting earlier can help increase the supply of technical talent and the diversity and breadth of experience in our talent pools to meet the industry's needs, she says. Somewhere around 2001, she decided to switch from studying human languages to researching computer languages, as well as teaching computer classes and managing the school's IT. Her interest in Python was sparked at Linux World 2001 when she attended PSF president Guido Van Rossum's day-long tutorial on Python. Back then, it was an obscure language, but she liked it so well that she began teaching Python and using it to track student records and do sysadmin duties at her school. ## Leading the Python community Naomi says, "community is the key factor behind Python's success. The whole idea behind open source software is sharing. Few people really want to just sit alone, writing code, and staring at their screens. The real satisfaction comes in trading ideas and building something with others." She started giving talks at the first [PyCon](http://pycon.org/) in 2003 has been a consistent attendee and leader since then. She has organized birds-of-a-feather sessions and founded the PyCon and PyCon UK poster sessions, the education summit, and the Spanish language track, [Charlas](https://twitter.com/pyconcharlas?lang=en). She is also the author of * The Quick Python Book* and co-founded [Trans*Code](https://www.trans.tech/), "the UK's only hack event series focused solely on drawing attention to transgender issues and opportunities." Naomi says, "as technology offers growing opportunities, being sure these opportunities are equally accessible to traditionally marginalized groups grows ever more important." ## Contributing through the PSF As board chair of the PSF, Naomi contributes actively to the organization's work to support the Python language and the people working with it. In addition to sponsoring PyCon, the PSF funds grants for meetups, conferences, and workshops around the world. In 2018, the organization gave almost $335,000 in grants, most of them in the $500 to $5,000 range. The PSF's short-term goals are to become a sustainable, stable, and mature non-profit organization with professional staff. Its long-term goals include developing resources that offer meaningful support to development efforts for Python and expanding the organization's support for educational efforts in Python around the world. This work depends on having financial support from the community. Naomi says the PSF's "largest current source of funding is PyCon. To ensure the PSF's sustainability, we are also focusing on [sponsorships](https://www.python.org/psf/sponsorship/) from companies using Python, which is our fastest-growing segment." Supporting memberships are $99 per year, and [donations and fundraisers](https://www.python.org/psf/donations/) also help sustain the organization's work. You can learn much more about the PSF's work in its [Annual Report](https://www.python.org/psf/annual-report/2019/). ## 1 Comment
11,050
BitTorrent 客户端 Deluge 2.0 发布:新功能介绍
https://itsfoss.com/deluge-2-release/
2019-07-03T16:36:02
[ "Torrent", "Deluge" ]
https://linux.cn/article-11050-1.html
你可能已经知道 [Deluge](https://dev.deluge-torrent.org/) 是[最适合 Linux 用户的 Torrent 客户端](https://itsfoss.com/best-torrent-ubuntu/)之一。然而,最近的稳定版本差不多是两年前的了。 尽管它仍在积极开发中,但直到最近才出了一个主要的稳定版本。我们写这篇文章时,最新版本恰好是 2.0.2。所以,如果你还没有下载最新的稳定版本,请尝试一下。 不管如何,如果你感兴趣的话,让我们看看有哪些新的功能。 ### Deluge 2.0 的主要改进 新版本引入了多用户支持,这是一个非常需要的功能。除此之外,还有一些性能改进可以更快地加载更多的种子。 此外,在 2.0 版本中,Deluge 使用了 Python 3,对 Python 2.7 提供最低支持。即使是用户界面,他们也从 GTK UI 迁移到了 GTK3。 根据发行说明,还有一些更重要的补充/改进,包括: * 多用户支持。 * 性能提升,可以更快地加载数千个种子。 * 一个模拟 GTK/Web UI 的新控制台 UI。 * GTK UI 迁移到 GTK3,并带有 UI 改进和补充。 * 磁链预获取功能可以在添加种子时选择文件。 * 完全支持 libtorrent 1.2。 * 语言切换支持。 * 改进了在 ReadTheDocs 托管的文档。 * AutoAdd 插件取代了内置功能。 ### 如何安装或升级到 Deluge 2.0 ![](/data/attachment/album/201907/03/163605cug888eigfu50egz.png) 对于任何 Linux 发行版,你都应该遵循官方[安装指南](https://deluge.readthedocs.io/en/latest/intro/01-install.html)(使用 PPA 或 PyPi)。但是,如果你要升级,你应该留意发行说明中提到的: > > “Deluge 2.0 与 Deluge 1.x 客户端或守护进程不兼容,因此这些也需要升级。如果第三方脚本直接连接到 Deluge 客户端,那么可能也不兼容且需要迁移。” > > > 因此,坚持在升级主版本之前备份你的[配置](https://dev.deluge-torrent.org/wiki/Faq#WheredoesDelugestoreitssettingsconfig)以免数据丢失。而且,如果你是插件作者,那么需要升级它以使其与新版本兼容。 直接下载的安装包尚不包含 Windows 和 Mac OS。但是,说明中提到他们正在进行中。 除此之外,你可以按照更新后的官方文档中的[安装指南](https://deluge.readthedocs.io/en/latest/intro/01-install.html)来手动安装它们。 ### 总结 你如何看待最新的稳定版本?你是否将 Deluge 用作 BitTorrent 客户端?或者你是否找到了其他更好的选择? 请在下面的评论栏告诉我们你的想法。 --- via: <https://itsfoss.com/deluge-2-release/> 作者:[Ankush Das](https://itsfoss.com/author/ankush/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
301
Moved Permanently
null
11,051
5 种在 Ubuntu 上释放空间的简单方法
https://www.2daygeek.com/linux-remove-delete-unwanted-junk-files-free-up-space-ubuntu-mint-debian/
2019-07-03T16:58:00
[ "清理" ]
https://linux.cn/article-11051-1.html
![](/data/attachment/album/201907/03/165641h0xy91x9109wz19w.jpg) 大多数人可能在系统磁盘存储不足的情况下执行释放空间这个操作,也可能在 Linux 系统磁盘存储满了的情况下执行这个操作。 它应该被经常执行,来为安装一个新的应用程序和处理其它文件弥补磁盘存储空间。保持可用空间是 Linux 管理员的一个日常任务,以允许磁盘利用率维持在阈值之下。 这里有一些我们可以清理我们系统空间的方法。 当你有 TB 级存储容量时,可能不需要清理你的系统。但是,如果你空间有限,那么释放磁盘空间就变的不可避免。 在这篇文章中,我将向你展示一些最容易的或简单的方法来清理你的 Ubuntu 系统,获得更多空间。 ### 在 Ubuntu 系统上如何检查可用的空间? 在你的系统上使用 [df 命令](https://www.2daygeek.com/how-to-check-disk-space-usage-using-df-command/) 来检查当前磁盘利用率。 ``` $ df -h Filesystem Size Used Avail Use% Mounted on udev 975M 0 975M 0% /dev tmpfs 200M 1.7M 198M 1% /run /dev/sda1 30G 16G 13G 55% / tmpfs 997M 0 997M 0% /dev/shm tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 997M 0 997M 0% /sys/fs/cgroup ``` 图形界面用户可以使用“磁盘利用率分析器工具”来查看当前利用率。 ![](/data/attachment/album/201907/03/165839ze2w4dww5webx322.jpg) #### 1) 移除不再需要的软件包 下面的命令移除系统不再需要的依赖库和软件包。这些软件包是自动安装的,以使一个安装的软件包满足依赖关系。同样,它也会移除安装在系统中的 Linux 旧内核。它会移除不再被系统需要的孤儿软件包,但是不会清除它们。 ``` $ sudo apt-get autoremove [sudo] password for daygeek: Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED: apache2-bin apache2-data apache2-utils galera-3 libaio1 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl libjemalloc1 liblua5.2-0 libmysqlclient20 libopts25 libterm-readkey-perl mariadb-client-10.1 mariadb-client-core-10.1 mariadb-common mariadb-server-10.1 mariadb-server-core-10.1 mysql-common sntp socat 0 upgraded, 0 newly installed, 25 to remove and 23 not upgraded. After this operation, 189 MB disk space will be freed. Do you want to continue? [Y/n] ``` 为清除它们,可以与命令一起使用 `--purge` 选项。 ``` $ sudo apt-get autoremove --purge Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED: apache2-bin* apache2-data* apache2-utils* galera-3* libaio1* libapr1* libaprutil1* libaprutil1-dbd-sqlite3* libaprutil1-ldap* libconfig-inifiles-perl* libdbd-mysql-perl* libdbi-perl* libjemalloc1* liblua5.2-0* libmysqlclient20* libopts25* libterm-readkey-perl* mariadb-client-10.1* mariadb-client-core-10.1* mariadb-common* mariadb-server-10.1* mariadb-server-core-10.1* mysql-common* sntp* socat* 0 upgraded, 0 newly installed, 25 to remove and 23 not upgraded. After this operation, 189 MB disk space will be freed. Do you want to continue? [Y/n] ``` #### 2) 清空回收站 有可能你的回收站里面有大量的无用数据。它会占用你的系统空间。最好解决方法之一是在你的系统上清理这些无用的数据,以获取一些可用的空间。 为清理这些,简单地使用文件管理器来清空你的回收站。 ![](/data/attachment/album/201907/03/165840f5pzorzodkysr5l5.jpg) #### 3) 清理 APT 缓存文件 Ubuntu 使用 [APT 命令](https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/)(高级软件包工具)用于软件包管理,如:安装、移除、搜索等等。 一般 Linux 操作系统会在各自的目录下保留下载和安装的软件包的缓冲文件。 Ubuntu 也一样,它在你的磁盘上以缓冲的形式保留它下载和安装的每次更新。Ubuntu 在 `/var/cache/apt/archives` 目录中保留 DEB 软件包的缓冲文件。随着时间推移,这些缓存可能快速增长,并在你的系统上占有很多空间。 运行下面的命令来检查当前 APT 缓存文件的使用率。 ``` $ sudo du -sh /var/cache/apt 147M /var/cache/apt ``` 下面的命令会清理过时的 deb 软件包。我想说,一点都清理不干净。 ``` $ sudo apt-get autoclean ``` 下面的命令会移除所有在 apt 缓存中的软件包。 ``` $ sudo apt-get clean ``` #### 4) 卸载不使用的应用程序 这需要你来检查在你的系统上安装的软件包和游戏,删除它们,如果你很少使用的话。 这可以通过 “Ubuntu 软件中心” 简单地做到。 ![](/data/attachment/album/201907/03/165841tt6tx399okq688qi.jpg) #### 5) 清理缩略图缓存 缓存文件夹是程序存储它们可能再次需要的数据的地方,它是为速度保留的,而不是必需保留的。它可以被再次生成或再次下载。假如它真的填满了你的硬盘,那么你可以删除一些东西而不用担心。 运行下面的命令来检查当前 APT 缓存的利用率。 ``` $ du -sh ~/.cache/thumbnails/ 412K /home/daygeek/.cache/thumbnails/ ``` 运行下面的命令来从你的系统中永久地删除它们。 ``` $ rm -rf ~/.cache/thumbnails/* ``` --- via: <https://www.2daygeek.com/linux-remove-delete-unwanted-junk-files-free-up-space-ubuntu-mint-debian/> 作者:[Magesh Maruthamuthu](https://www.2daygeek.com/author/magesh/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[robsean](https://github.com/robsean) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
404
Not Found
null
11,054
4 款很酷的终端复用器
https://fedoramagazine.org/4-cool-terminal-multiplexers/
2019-07-04T12:51:54
[ "终端", "tmux" ]
https://linux.cn/article-11054-1.html
![](/data/attachment/album/201907/04/125200klg0curz7oczf0tt.jpg) Fedora 系统对很多用户来说都很舒适。它有一个令人惊叹的桌面,可以轻松地完成日常任务。而在这光鲜的表面之下是由 Linux 系统提供的支持,而终端是高级用户使用这些底层能力的最简单方法。默认的终端简单且功能有限。但是,*终端复用器*能让你的终端变得非常强大。本文展示了一些流行的终端多路复用器以及如何安装它们。 为什么要用它?嗯,首先,它可以让你注销你的系统,而同时*让你的终端会话不受干扰*。退出你的控制台,这样安全,在其他地方旅行时通过远程登录 SSH 继续之前的操作是非常有用的。这里有一些工具可以看下。 最古老和最知名的终端多路复用器之一是 `screen`。但是,由于其代码不再维护,本文将重点介绍最近的应用。 (“最近的”是相对而言的,其中一些已存在多年!) ### Tmux `tmux` 是 `screen` 最广泛使用的替代品之一。它有高度可配置的接口。你可以根据需要对 `tmux` 进行编程以启动特定类型的会话。在前面发表的这篇文章中你会发现更多关于 tmux 的信息: * [使用 tmux 实现更强大的终端](https://fedoramagazine.org/use-tmux-more-powerful-terminal/) 已经是 `tmux` 用户?你可能会喜欢[这篇使你的 tmux 会话更有效的文章](https://fedoramagazine.org/4-tips-better-tmux-sessions/)。 要安装 `tmux`,由于你可能已经在终端中,请带上 `sudo` 使用 `dnf`: ``` $ sudo dnf install tmux ``` 要开始学习,请运行 `tmux` 命令。单窗格窗口以你的默认 shell 启动。tmux 使用*修饰键*来表示接下来会发出命令。默认情况下,此键为 `Ctrl+B`。如果输入 `Ctrl+B, C`,你将创建一个带有 shell 的新窗口。 提示:使用 `Ctrl+B, ?` 进入帮助模式,会列出你可以使用的所有键。为了简单起见,你先查看 `bind-key -T prefix` 开头的行。这些是你可以在修饰键之后立即使用的键,可以用来配置你的 `tmux` 会话。你可以按 `Ctrl+C` 退出帮助模式回 `tmux`。 要完全退出 `tmux`,请使用标准 `exit` 命令或 `Ctrl+D` 退出所有 shell。 ### Dvtm 你可能最近在 Fedroa Magzine 上看到过一篇 [dwm,一个动态窗口管理器](https://fedoramagazine.org/lets-try-dwm-dynamic-window-manger/)的文章。像 `dwm` 一样,`dvtm` 用于平铺窗口管理,但是是用在终端中。它的设计坚持 UNIX 的“做好一件事”的理念,在这里是管理终端中的窗口。 安装 `dvtm` 也很简单。但是,如果你想要前面提到的注销功能,你还需要 `abduco` 包来处理 dvtm 的会话管理。 ``` $ sudo dnf install dvtm abduco ``` `dvtm` 已经映射了许多管理终端窗口的按键。默认情况下,它使用 `Ctrl+G` 作为其修饰键。这个按键告诉 `dvtm` 接下来的字符将成为它应该处理的命令。例如, `Ctrl+G, C` 创建一个新窗口,`Ctrl+G, X` 将其关闭。 有关使用 `dvtm` 的更多信息,请查看 `dvtm` 的[主页](http://www.brain-dump.org/projects/dvtm/#why),其中包含大量提示和入门信息。 ### Byobu 虽然 `byobu` 本身并不是真正的多路复用器 —— 它封装了 `tmux` 甚至更老的 `screen` 来添加功能,但它也值得在这里一提。通过帮助菜单和窗口选项卡,以便更加容易地找到那些功能,`byobu` 使终端复用器更适合初学者。 当然它也可以在 Fedora 仓库中找到。要安装它,请使用以下命令: ``` $ sudo dnf install byobu ``` 默认情况下,`byobu` 会在内部运行 `screen`,因此你可能希望运行 `byobu-tmux` 来封装 `tmux`。你可以使用 `F9` 键打开帮助菜单以获取更多信息,来帮助你入门。 ### Mtm `mtm` 是你可以找到的最小的复用器之一。事实上,它只有大约 1000 行代码!如果你处于受限的环境(例如旧硬件、最小容器等)中,你可能会发现它很有用。要开始使用,你需要安装一些包。 ``` $ sudo dnf install git ncurses-devel make gcc ``` 然后克隆 `mtm` 所在的仓库: ``` $ git clone https://github.com/deadpixi/mtm.git ``` 进入 `mtm` 文件夹并构建程序: ``` $ make ``` 你可能会收到一些警告,但完成后,你将会有一个非常小的 `mtm` 程序。使用以下命令运行它: ``` $ ./mtm ``` 你可以在 [GitHub 页面](https://github.com/deadpixi/mtm)上找到该程序的所有文档。 这里只是一些终端复用器。你有想推荐的么?请在下面留下你的评论,享受在终端中创建窗口吧! --- via: <https://fedoramagazine.org/4-cool-terminal-multiplexers/> 作者:[Paul W. Frields](https://fedoramagazine.org/author/pfrields/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
The Fedora OS is comfortable and easy for lots of users. It has a stunning desktop that makes it easy to get everyday tasks done. Under the hood is all the power of a Linux system, and the terminal is the easiest way for power users to harness it. By default terminals are simple and somewhat limited. However, a *terminal multiplexer* allows you to turn your terminal into an even more incredible powerhouse. This article shows off some popular terminal multiplexers and how to install them. Why would you want to use one? Well, for one thing, it lets you logout of your system while *leaving your terminal session undisturbed*. It’s incredibly useful to logout of your console, secure it, travel somewhere else, then remotely login with SSH and continue where you left off. Here are some utilities to check out. One of the oldest and most well-known terminal multiplexers is *screen.* However, because the code is no longer maintained, this article focuses on more recent apps. (“Recent” is relative — some of these have been around for years!) ## Tmux The *tmux* utility is one of the most widely used replacements for *screen.* It has a highly configurable interface. You can program tmux to start up specific kinds of sessions based on your needs. You’ll find a lot more about tmux in this article published earlier: Already a tmux user? You might like [this additional article on making your tmux sessions more effective](https://fedoramagazine.org/4-tips-better-tmux-sessions/). To install tmux, use the *sudo* command along with *dnf*, since you’re probably in a terminal already: $ sudo dnf install tmux To start learning, run the *tmux* command. A single pane window starts with your default shell. Tmux uses a *modifier key* to signal that a command is coming next. This key is **Ctrl+B** by default. If you enter **Ctrl+B, C** you’ll create a new window with a shell in it. Here’s a hint: Use **Ctrl+B, ?** to enter a help mode that lists all the keys you can use. To keep things simple, look for the lines starting with *bind-key -T prefix* at first. These are keys you can use right after the modifier key to configure your tmux session. You can hit **Ctrl+C** to exit the help mode back to tmux. To completely exit tmux, use the standard *exit* command or *Ctrl+D* keystroke to exit all the shells. ## Dvtm You might have recently seen the Magazine article on [dwm, a dynamic window manager](https://fedoramagazine.org/lets-try-dwm-dynamic-window-manger/). Like dwm, *dvtm* is for tiling window management — but in a terminal. It’s designed to adhere to the legacy UNIX philosophy of “do one thing well” — in this case managing windows in a terminal. Installing dvtm is easy as well. However, if you want the logout functionality mentioned earlier, you’ll also need the *abduco* package which handles session management for dvtm. $ sudo dnf install dvtm abduco The dvtm utility has many keystrokes already mapped to allow you to manage windows in the terminal. By default, it uses **Ctrl+G** as its modifier key. This keystroke tells dvtm that the following character is going to be a command it should process. For instance, **Ctrl+G, C** creates a new window and **Ctrl+G, X** removes it. For more information on using dvtm, check out the dvtm [home page](http://www.brain-dump.org/projects/dvtm/#why) which includes numerous tips and get-started information. ## Byobu While *byobu* isn’t truly a multiplexer on its own — it wraps *tmux* or even the older *screen* to add functions — it’s worth covering here too. Byobu makes terminal multiplexers better for novices, by adding a help menu and window tabs that are slightly easier to navigate. Of course it’s available in the Fedora repos as well. To install, use this command: $ sudo dnf install byobu By default the *byobu* command runs *screen* underneath, so you might want to run *byobu-tmux* to wrap *tmux* instead. You can then use the **F9** key to open up a help menu for more information to help you get started. ## Mtm The *mtm* utility is one of the smallest multiplexers you’ll find. In fact, it’s only about 1000 lines of code! You might find it helpful if you’re in a limited environment such as old hardware, a minimal container, and so forth. To get started, you’ll need a couple packages. $ sudo dnf install git ncurses-devel make gcc Then clone the repository where mtm lives: $ git clone https://github.com/deadpixi/mtm.git Change directory into the *mtm* folder and build the program: $ make You might receive a few warnings, but when you’re done, you’ll have the very small *mtm* utility. Run it with this command: $ ./mtm You can find all the documentation for the utility [on its GitHub page](https://github.com/deadpixi/mtm). These are just some of the terminal multiplexers out there. Got one you’d like to recommend? Leave a comment below with your tips and enjoy building windows in your terminal! ## murph I’m pretty sure that screen is still actively maintained. It doesn’t need to be included, (That’s up to you) but no reason to say that it’s not being maintained. http://git.savannah.gnu.org/cgit/screen.git/log/ ## dac.override “By default terminals are simple and somewhat limited” Not TermySequence TermySequence is: A server implementation written in cross-platform, multithreaded C++ with minimal dependencies. A Qt-based client implementation with its own set of features, including a plugin system using an embedded Chrome V8 Javascript engine. A terminal emulation system with a focus on connectivity, productivity, and collaboration. Free software, licensed under GPLv2. TermySequence is packaged for: https://termysequence.io/ ## Clément Verna TermySequence looks really cool, would you be interested in writing an article about it for the Fedora Magazine ? ## dac.override I am not such a write, but i can give you a run-down here and maybe someone else can write a nice article: Someone once said: “By default terminals are simple and somewhat limited”. Many of us spend significant time using terminal emulators. Yet A lot of us want it to be fast and light. Why skim on something as important as a terminal emulator? If youre familiar with terminal multiplexers then you probably know some of their limitations. Take for example nesting. You open a terminal emulator locally, then execute a terminal multiplexer. Then you use ssh to connect to a remote machine and either run another terminal multiplexer there or attach to an existing one. Now you have a terminal multiplexer running in another terminal multiplexer. That is where things get confusing because your usual keyboard shortcuts only work for the local instance. You would use different shortcuts to control the remote instance. On top of that, sometimes you need to read or edit a remote file. Things would get even more complicated there because for example if it is a pdf then you might for example use and then run on the remote. There are two considerations there: 1. you need a display server on the remote, 2. youre running a remote instance of apvlv. Otherwise you might use fusermount and/or sshfs to mount the remote pdf locally so that you can open it with your local apvlv instance. Eitherway, not ideal. Enter TermySequence: So why is there no solution for these issues? Why can’t we have all this integrated into a terminal emulator? TermySequence is a rather heavy weight solution compared to say using a “simple” terminal emulator, ssh, fusermount, and a terminal multiplexer. It integrates these features in a neat new way and hides some of the dirty details. It is basically a client and server model. You can either just have a termy-server running on a remote headless system and connect to that with a local termy-qt client and/or have both server and client. You connect from the client to server instances, locally and remote. When you close the client, your work done in terminals running on the server instances is not lost and you can reattach later, just like terminal multiplexers. You can also connect from one server instance to another, effectively chaining connections. There is a file manager that can be used to open remote files with local applications seemingly transparently. You can do collaboration easily by sharing termy-server instances. Either take ownership of your own terminals or allow remote input. You can attach avatars so that people can “put a face on a terminal”. TermyQT is a modern terminal emulator, so you get emoji, inline images, a plugin framework and a lot of other features. Too many to address here. ## Sorin … and there’s the article… lol… ## bachradsusi My favorite multiplexer is a combination of emacs-noxin daemon mode,emacslientand(ansi-term “/usr/bin/zsh”)## dac.override Yes I agree, that is nice as well, together with tramp mode: https://www.emacswiki.org/emacs/TrampMode ## Luciano I understand the need to multiplex terminal window… But I don’t really understand what these programs provide in addition to the features of, say, Konsole. I can have tabs, split windows… I can send the same input to multiple subwindows. What can these provide that I cannot already do with Konsole? Unless the terminal session is in a non graphical environment, of course, but that’s not common for me. ## Paul W. Frields @Luciano: That’s exactly what these multiplexers are for. Having a multiplexed session available via either GUI or console is very useful. There are also plenty of situations where, say, passing graphical information over an SSH tunnel is unwanted. Glad you don’t need it, but many people do. 🙂 ## epii Check out terminator, available in Debina, Ubuntu, Linux Mint, etc. Easy to setup, use and very configurable. ## far2fish I use terminator as my preferred terminal in Fedora 29. ## Cata PAC Manager is my favorite, is more a connection manager but is useful when you have many servers to take care. ## Thomas Stephen Lee Hi, A bug I ran into. https://bugzilla.redhat.com/show_bug.cgi?id=1480460 Affects byobu
11,056
Linux 权限入门指南
https://opensource.com/article/19/6/understanding-linux-permissions
2019-07-04T13:38:00
[ "权限" ]
https://linux.cn/article-11056-1.html
> > Linux 安全权限能够指定谁可以对文件或目录执行什么操作。 > > > ![](/data/attachment/album/201907/04/133751argz0pp7hy5gvv7q.jpg) 与其他系统相比而言 Linux 系统的众多优点中最为主要一个便是 Linux 系统有着更少的安全漏洞和被攻击的隐患。Linux 无疑为用户提供了更为灵活和精细化的文件系统安全权限控制。这可能意味着 Linux 用户理解安全权限是至关重要的。虽然这并不一定是必要的,但是对于初学者来说,理解 Linux 权限的基本知识仍是一个明智之选。 ### 查看 Linux 安全权限 在开始 Linux 权限的相关学习之前,假设我们新建了一个名为 `PermissionDemo` 的目录。使用 `cd` 命令进入这个目录,然后使用 `ls -l` 命令查看 Linux 安全管理权限信息。如果你想以时间为序排列,加上 `-t` 选项 ``` ls -lt ``` 因为这一目录下没有文件,所以这一命令执行不会返回结果。 ![No output from ls -l command](/data/attachment/album/201907/04/133824onqym0wm7koo4mju.jpg "No output from ls -l command") 要了解关于 `ls` 命令的更多信息,请通过在命令行中输入 `man ls` 来查看命令手册。 ![ls man page](/data/attachment/album/201907/04/133825mz87qpm8yfl1ltyp.jpg "ls man page") 现在,让我们创建两个名为 `cat.txt` 和 `dog.txt` 的空白文件;这一步使用 `touch` 命令将更为简便。然后继续使用 `mkdir` 命令创建一个名为 `Pets` 的空目录。我们可以再次使用`ls -l`命令查看这些新文件的权限。 ![Creating new files and directory](/data/attachment/album/201907/04/133826gpy5pmznz2pkm2ok.jpg "Creating new files and directory") 我们需要留意这个命令输出结果的两个部分。 ### 谁拥有权限? 首先要注意的是*谁*具有访问文件/目录的权限。请注意下面红色框中突出显示的部分。第一列是指具有访问权限的*用户*,而第二列是指具有访问权限的*组*。 ![Output from -ls command](/data/attachment/album/201907/04/133827vze76p5y2ht2yphp.jpg "Output from -ls command") 用户的类型主要有三种:用户、组和其他人(本质上既不是用户也不是组)。还有一个*全部*,意思是几乎所有人。 ![User types](/data/attachment/album/201907/04/133832zvk4onr9sorilrli.jpg "User types") 由于我们使用 `root` 作为当前用户,所以我们可以访问任何文件或目录,因为 `root` 是超级用户。然而,通常情况并非如此,你可能会被限定使用你的普通用户登录。所有的用户都存储在 `/etc/passwd` 文件中。 ![/etc/passwd file](/data/attachment/album/201907/04/133835fyhfihwy1mwndm1q.jpg "/etc/passwd file") “组”的相关信息保存在 `/etc/group` 文件中。 ![/etc/passwd file](/data/attachment/album/201907/04/133838s9tle7z7971gl1tu.jpg "/etc/passwd file") ### 他们有什么权限? 我们需要注意的是 `ls -l` 命令输出结果的另一部分与执行权限有关。以上,我们查看了创建的 `dog.txt` 和 `cat.txt` 文件以及 `Pets` 目录的所有者和组权限都属于 `root` 用户。我们可以通过这一信息了解到不同用户组所拥有的相应权限,如下面的红色框中的标示。(LCTT 译注:下图的“OWNER”应为“OTHER”) ![Enforcing permissions for different user ownership types](/data/attachment/album/201907/04/133840xaxqsq0wjwotogsz.jpg "Enforcing permissions for different user ownership types") 我们可以把每一行分解成五部分。第一部分标志着它是文件还是目录:文件用 `-`(连字符)标记,目录用 `d` 来标记。接下来的三个部分分别是用户、组和其他人的对应权限。最后一部分是[访问控制列表](https://en.wikipedia.org/wiki/Access-control_list) (ACL)的标志,是记录着特定用户或者用户组对该文件的操作权限的列表。 ![Different Linux permissions](/data/attachment/album/201907/04/133844ous5itzx4ss775xx.jpg "Different Linux permissions") Linux 的权限级别可以用字母或数字标识。有三种权限类型: * 可读取:`r` 或 `4` * 可写入:`w` 或 `2` * 可执行:`x` 或 `1` (LCTT 译注:原文此处对应的字母标示 `x` 误写为 `e`,已更正) ![Privilege types](/data/attachment/album/201907/04/133849yw1qpeekn1zwqw11.jpg "Privilege types") 每个字母符号(`r`、`w` 或 `x`)表示有该项权限,而 `-` 表示无该项权限。在下面的示例中,文件的所有者可读可写,用户组成员仅可读,其他人可读可执行。转换成数字表示法,对应的是 `645`(如何计算,请参见下图的图示)。 ![Permission type example](/data/attachment/album/201907/04/133852x81q1jltqytqy11r.jpg "Permission type example") 以下是一些示例: ![Permission type examples](/data/attachment/album/201907/04/133858u4iaszl7nmm7riln.jpg "Permission type examples") 完成下面的测试,检查你是否掌握了权限管理相关的知识。 ![Permission type examples](/data/attachment/album/201907/04/133902qnlp9b9bezzbu2q9.jpg "Permission type examples") --- via: <https://opensource.com/article/19/6/understanding-linux-permissions> 作者:[Bryant Son](https://opensource.com/users/brson/users/greg-p/users/tj) 选题:[lujun9972](https://github.com/lujun9972) 译者:[qfzy1233](https://github.com/qfzy1233) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
One of the main benefits of Linux systems is that they are known to be less prone to security vulnerabilities and exploits than other systems. Linux definitely gives users more flexibility and granular controls over its file systems' security permissions. This may imply that it's critical for Linux users to understand security permissions. That isn't necessarily true, but it's still wise for beginning users to understand the basics of Linux permissions. ## View Linux security permissions To start learning about Linux permissions, imagine we have a newly created directory called **PermissionDemo**. Run **cd** inside the directory and use the **ls -l** command to view the Linux security permissions. If you want to sort them by time modified, add the **-t** option. `ls -lt` Since there are no files inside this new directory, this command returns nothing. ![No output from ls -l command No output from ls -l command](https://opensource.com/sites/default/files/uploads/1_3.jpg) To learn more about the **ls** option, access its man page by entering **man ls** on the command line. ![ls man page ls man page](https://opensource.com/sites/default/files/uploads/1_man.jpg) Now, let's create two files: **cat.txt** and **dog.txt** with empty content; this is easy to do using the **touch** command. Let's also create an empty directory called **Pets** with the **mkdir** command. We can use the **ls -l** command again to see the permissions for these new files. ![Permissions for new files Creating new files and directory](https://opensource.com/sites/default/files/uploads/2_6.jpg) We need to pay attention to two sections of output from this command. ## Who has permission? The first thing to examine indicates *who* has permission to access the file/directory. Note the section highlighted in the red box below. The first column refers to the *user* who has access, while the second column refers to the *group* that has access. ![Output from -ls command Output from -ls command](https://opensource.com/sites/default/files/uploads/3_2.jpg) There are three main types of users: **user**, **group**; and **other** (essentially neither a user nor a group). There is one more: **all**, which means practically everyone. ![User types User types](https://opensource.com/sites/default/files/uploads/4_0.jpg) Because we are using **root** as the user, we can access any file or directory because **root** is the superuser. However, this is generally not the case, and you will probably be restricted to your username. A list of all users is stored in the **/etc/passwd** file. ![/etc/passwd file /etc/passwd file](https://opensource.com/sites/default/files/uploads/linuxpermissions_4_passwd.jpg) Groups are maintained in the **/etc/group** file. ![/etc/passwd file /etc/passwd file](https://opensource.com/sites/default/files/uploads/linuxpermissions_4_group.jpg) ## What permissions do they have? The other section of the output from **ls -l** that we need to pay attention to relates to enforcing permissions. Above, we confirmed that the owner and group permissions for the files dog.txt and cat.txt and the directory Pets we created belong to the **root** account. We can use that information about who owns what to enforce permissions for the different user ownership types, as highlighted in the red box below. ![Enforcing permissions for different user ownership types Enforcing permissions for different user ownership types](https://opensource.com/sites/default/files/uploads/linuxpermissions_5.jpg) We can dissect each line into five bits of information. The first part indicates whether it is a file or a directory; files are labeled with a **-** (hyphen), and directories are labeled with **d**. The next three parts refer to permissions for **user**, **group**, and **other**, respectively. The last part is a flag for the [ access-control list](https://en.wikipedia.org/wiki/Access-control_list) (ACL), a list of permissions for an object. ![Different Linux permissions Different Linux permissions](https://opensource.com/sites/default/files/uploads/linuxpermissions_6.jpg) Linux permission levels can be identified with letters or numbers. There are three privilege types: **read**: r or 4**write:**w or 2**executable:**e or 1 ![Privilege types Privilege types](https://opensource.com/sites/default/files/uploads/linuxpermissions_7.jpg) The presence of each letter symbol (**r**, **w**, or **x**) means that the permission exists, while **-** indicates it does not. In the example below, the file is readable and writeable by the owner, only readable if the user belongs to the group, and readable and executable by anyone else. Converted to numeric notation, this would be 645 (see the image below for an explanation of how this is calculated). ![Permission type example Permission type example](https://opensource.com/sites/default/files/uploads/linuxpermissions_8.jpg) Here are a few more examples: ![Permission type examples Permission type examples](https://opensource.com/sites/default/files/uploads/linuxpermissions_9.jpg) Test your knowledge by going through the following exercises. ![Permission type examples Permission type examples](https://opensource.com/sites/default/files/uploads/linuxpermissions_10.jpg) ## 5 Comments
11,057
100 个最佳 Ubuntu 应用(下)
https://linuxhint.com/100_best_ubuntu_apps/
2019-07-04T21:59:00
[ "Ubuntu" ]
https://linux.cn/article-11057-1.html
今年早些时候我们发布了一个 [2018 年最好的 20 个 Ubuntu 应用](https://linuxhint.com/applications-2018-ubuntu/)列表,可能对很多用户来说都很有用。现在我们几乎到 2018 年下半年了(LCTT 译注:好吧,我们翻译的有些晚了,顺便打个广告,[LCTT 欢迎你,有志于通过翻译为开源做些贡献的同学!](https://linux.cn/lctt/)),所以今天我们打算看一下 Ubuntu 上最好的 100 个应用,你可能会觉得有帮助。 ![100 Best Ubuntu Apps](/data/attachment/album/201907/04/221320cydd9gv9w1z4cmxc.png) 很多用户最近从 Microsoft Windows 转换到了 Ubuntu,可能面临着这样一个困境:寻找它们之前使用了数年的操作系统上的应用软件的最好替代应用。Ubuntu 拥有上千个免费使用和开源应用软件,比 Windows 和其它 OS 上的付费软件运行的更好。 下列列表归纳了各种分类下很多应用软件的功能特点,因此,你可以找到匹配你的需求的最好的应用。 (……接前) ### 67、Filezilla Filezilla 是一个免费和跨平台的 FTP 应用,包括 Filezilla 客户端和服务器。它让你使用 FTP 和加密的 FTP,如 FTPS 和 SFTP 传输文件,支持 IPv6 网络协议。 ![](/data/attachment/album/201907/04/221333j0nnn80fgc77gxwb.png) 它是一个简单的文件传输应用,支持拖放,支持世界范围的各种语言,多任务的强大用户界面,可以控制和配置传输速度。 ### 68、Stacer Stacer 是一个开源的系统诊断和优化工具,使用 Electron 开发框架开发。它有一个优秀的用户界面,你可以清理缓存内存、启动应用、卸载不需要的应用、掌控后台系统进程。 ![](/data/attachment/album/201907/04/221531rh9hqrgphyugqqz5.png) 它也可以让你检查磁盘、内存和 CPU 使用情况,给你下载和上传的实时状态。它看起来像 Ubuntu clener 的强力竞争者,但是两者都有独特的特点。 ``` $ sudo add-apt-repository ppa:oguzhaninan/stacer $ sudo apt-get update $ sudo apt-get install stacer ``` ### 69、4K 视频下载器 4K 视频下载器是一个简单的视频下载工具,你可以用来从 Vimeo、Facebook、YouTube 和其它在线视频流站点下载视频、播放列表、频道。它支持下载 YouTuBe 播放列表和频道,可以采用 MP4、MKV、M4A、3GP 和很多其它音/视频格式。 ![](/data/attachment/album/201907/04/221559wi2zxqb9aonbo2at.png) 4K 视频下载器不是你想的那么简单,除了正常的视频下载,它支持 3D 和 360 度视频下载。它同样提供应用内代理设置、直连 iTunes 等功能。你可以从[这里](https://www.4kdownload.com/download)下载。 ### 70、Qalculate Qalculate 是一个多用途、跨平台的桌面计算器,简单而强大。它可以用来解决复杂的数学问题和等式、货币汇率转换和很多其它日常计算。 ![](/data/attachment/album/201907/04/221616y3wlbfywlctuzsp3.png) 它有优秀的用户界面,提供了自定义功能、单位计算、符号计算、四则运算、画图和很多你可以在科学计算器上发现的功能。 ### 71、Hiri Hiri 是一个跨平台的邮件客户端,使用 Python 语言开发的。它有平滑的用户界面,就它的功能和服务而言,是 Micorsoft Outlook 的很好的替代品。这是很棒的邮件客户端,可以用来发送和接收邮件,管理通讯录、日历和任务。 ![](/data/attachment/album/201907/04/221628bqs6pju0v5qfg566.png) 它是一个具有丰富特点的邮件客户端,提供的功能有集成的任务管理器、邮件同步、邮件评分、邮件过滤等多种功能。 ``` $ sudo snap install hiri ``` ### 72、Sublime Text Sublime Text 是一个跨平台的源代码编辑器,用 C++ 和 Python 写的。它有 Python 语言编程接口(API),支持所有主流的编程语言和标记语言。它是简单轻量级的文本编辑器,可被用作 IDE,包含自动补全、语法高亮、分窗口编辑等功能。 ![](/data/attachment/album/201907/04/221642sk22667y32bksnye.png) 这个文本编辑器包括一些额外特点:任意跳转、跳转定义、多选、命令模式和可完全定制的用户界面。 ``` $ sudo apt-get install sublime-text ``` ### 73、TeXstudio Texstudio 是一个创建和编辑 LaTex 文件的集成写作环境。它是开源的编辑器,提供了语法高亮、集成的查看器、交互式拼写检查、代码折叠、拖放等特点。 ![](/data/attachment/album/201907/04/221650ktkqbnynkhbkhqkb.png) 它是跨平台的编辑器,有简单轻量级的用户界面,易于使用。它集成了 BibTex 和 BibLatex 目录管理器,同样有集成的 PDF 查看器。你可以从[官网](https://www.texstudio.org/)和 Ubuntu 软件中心下载 Texstudio。 ### 74、QtQR QtQR 是一个基于 Qt 的应用,让你在 Ubuntu 中创建和读取二维码。它是用 Python 和 Qt 开发的,有简单和轻量级的用户界面,你可以编码网站地址、邮件、文本、短消息等。你也可以用网络相机解码二维码。 ![](/data/attachment/album/201907/04/221706mfmy33irpyt43gb4.png) 如果你经常处理产品销售和服务,QtQR 会证明是有用的工具,我觉得没有能在如此低硬件的要求下能和 QtQR 一样提供类似功能顺畅运行的应用了。 ``` $ sudo add-apt-repository ppa: qr-tools-developers/qr-tools-stable $ sudo apt-get update $ sudo apt-get install qtqr ``` ### 75、Kontact Kontact 是一个为 KDE 桌面环境开发的集成的个人信息管理器(PIM)。它集成了多个软件到一个集合中,在一个用户界面集成了 KMail、KOrganizer和 KAddressBook,你可以管理所有的邮件、通讯录、日程表等。 ![](/data/attachment/album/201907/04/221716a8ke2ks78e57mi5z.png) 它可能是 Microsoft Outlook 的非常好的替代品,因为它是快速且高度高配置的消息管理工具。它有很好的用户界面,你会发现很容易上手。 ``` $ sudo apt-get install kontact ``` ### 76、NitroShare NitroShare 是一个跨平台、开源的网络文件共享应用。它让你轻松的在局域网的多个操作系统中共享文件。它简单而强大,当在局域网中运行 NitroShare 时,它会自动侦查其它设备。 ![](/data/attachment/album/201907/04/221732uffsru2ubu5ry6w0.png) 文件传输速度让 NitroShare 成为一个杰出的文件共享应用,它在能够胜任的硬件中能够达到 GB 级的传输速度。没有必要额外配置,安装完成后你就可以开始文件传输。 ``` $ sudo apt-add-repository ppa:george-edison55/nitroshare $ sudo apt-get update $ sudo apt-get install nitroshare ``` ### 77、Konversation Konversation 是一个为 KDE 桌面环境开发的开源的网络中继聊天(IRC)客户端。它给了你到 Freenode 网络频道的快速入口,你可以为大多数发行版找到支持。 ![](/data/attachment/album/201907/04/221832wffzu1gnivngkgxb.png) 它是一个简单的聊天客户端,支持 IPv6 链接、SSL 服务器支持、书签、屏幕通知、UTF-8 检测和另外的主题。它易于使用的 GUI 是高度可配置的。 ``` $ sudo apt-get install konversation ``` ### 78、Discord 如果你是硬核游戏玩家,经常玩在线游戏,我有一个很棒的应用推荐给你。Discord 是一个免费的网络电话应用,尤其是为在线游戏者们设计的。它是一个跨平台的应用,可用来文字或语音聊天。 ![](/data/attachment/album/201907/04/221849ds4phhfz0ifzri04.png) Discord 是一个非常流行的语音通话应用游戏社区,因为它是完全免费的,它是 Skype、Ventrilo、Teamspeak 的很好的竞争者。它同样提供清晰的语音质量、现代的文本聊天,你可以共享图片、视频和链接。 ### 79、QuiteRSS QuiteRSS是一个开源的 RSS 和 Atom 新闻摘要的聚合应用。它是跨平台的摘要阅读器,用 Qt 和 C++ 写的。它有简单的用户界面,你可以改变为经典或者报纸模式。它集成了 webkit 浏览器,因此,你可以在单个窗口执行所有任务。 ![](/data/attachment/album/201907/04/221914ny82jjdkssmmvdmm.png) QuiteRSS 自带了很多功能,像内容过滤、自动规划摘要、导入/导出 OPML、系统托盘集成了很多其它摘要阅读器有的特点。 ``` $ sudo apt-get install quiterss ``` ### 80、MPV Media Player MPV 是一个自由开源的媒体播放器,基于 MPlayer 和 MPlayer 2。它有简单的用户界面,用户只需要拖放音/视频文件来播放,因为在 GUI 上没有添加媒体文件的选项。 ![](/data/attachment/album/201907/04/221942htjboo7ocw3a1dov.png) 关于 MPV 的一件事是它可以轻松播放 4K 视频,Linux 发行版中的其它媒体播放器可能做不到。它同样给了用户播放在线视频流站点如 YouTube 和 Dailymotion 的能力。 ``` $ sudo add-apt-repository ppa:mc3man/mpv-tests $ sudo apt-get update $ sudo apt-get install -y mpv ``` ### 81、Plume Creator 如果你是一个作家,那么 Plume Creator 是你必不可少的应用,因为你在 Ubuntu 上找不到其它应用像 Plume Creater 这样。写作和编辑故事、章节是繁重的任务,在 Plume Creator 这个令人惊奇的工具的帮助下,将大大帮你简化这个任务。 ![](/data/attachment/album/201907/04/221956kkg8gw08wgsd5yb5.png) 它是一个开源的应用,拥有精简的用户界面,开始你可能觉得困惑,但不久你就会习惯的。它提供的功能有:编辑笔记、摘要、导出 HTML 和 ODT 格式、富文本编辑。 ``` $ sudo apt-get install plume-creator ``` ### 82、Chromium Web 浏览器 Chromium 是一个由 Google 开发和发布的开源 Web 浏览器。Chromium 就其外观和特点而言,很容易被误认为是 Chrome。它是轻量级和快速的网络浏览器,拥有最小用户界面。 ![](/data/attachment/album/201907/04/222009f14n00iun4zu2bzu.png) 如果你经常在 Windows 上使用 Google Chrome,而想在 Linux 上寻找一个类似的浏览器,那么 Chromium 就是你的最佳选择,你可以登录到你的 Google 账户以访问包括 Gmail 在内的所有 Google 服务。 ### 83、简单天气指示器 简单天气指示器是用 Python 开发的开源天气提示应用。它自动侦查你的位置,并显示你天气信息像温度,下雨的可能性,湿度,风速和可见度。 ![](/data/attachment/album/201907/04/222052fi6kb4scg6eh7tzl.png) 简单天气指示器自带一些可配置项,例如位置检测、温度单位、位置可见度开关等等。它是一个还酷的应用,可以根据你的桌面来调整。 ### 84、SpeedCrunch SpeedCrunch 是一个快速和高精度的科学计算器。它预置了数学函数、用户定义函数、复数和单位转换支持。它有简单的用户界面并易于使用。 ![](/data/attachment/album/201907/04/222111nb9bxgxckrxz40bc.png) 这个科学计算器有令人吃惊的特点,如结果预览、语法高亮和自动补全。它是跨平台的,并有多语言支持。 ### 85、Scribus Scribus 是一个自由开源的桌面出版应用,允许你创建宣传海报、杂志和图书。它是基于 Qt 工具器的跨平台应用,在 GNU 通用公共许可证下发布。它是一个专业的应用,拥有 CMYK 和 ICC 颜色管理的功能、基于 Python 的脚本引擎,和 PDF 创建功能。 ![](/data/attachment/album/201907/04/222130yrtr7t15e81ir299.png) Scribus 有相当好的用户界面,易于使用,可以在低配置下轻松使用。在所有的最新的 Linux 发行版的软件中心可以下载它。 ### 86. Cura Cura 是一个由 David Braam 开发的开源的 3D 打印应用。Ultimaker Cura 是 3D 打印世界最流行的软件,世界范围有百万用户在使用。它遵守 3D 打印模型的 3 步:设计、准备、打印。 ![](/data/attachment/album/201907/04/222141wy8gv78kgnqvbkqv.png) 它是功能丰富的 3D 打印应用,为 CAD 插件和扩展提供了无缝支持。它是一款简单易于使用的工具,新手艺术家可以马上开始了。它支持主流的文件格式像 STL、3MF 和 OBJ。 ### 87、Nomacs Nomacs 是一款开源、跨平台的图像浏览器,支持所有主流的图片格式包括 RAW 和 psd 图像。它可以浏览 zip 文件中的图像或者 Microsoft Office 文件并提取到目录。 ![](/data/attachment/album/201907/04/222207pbs004sd0s1de4et.png) Nomacs 拥有非常简单的用户界面,图像缩略图在顶部,它提供了一些基本的图像操作特点像修改、调整大小、旋转、颜色纠正等。 ``` $ sudo add-apt-repository ppa:nomacs/stable $ sudo apt-get update $ sudo apt-get install nomacs ``` ### 88、BitTicker BitTicker 是一个 Ubuntu 上的在线的 BTC-USDT 价格接收器。它是一个简单的工具,能够连接到 bittrex.com 市场,提取最新的 BTC-USDT 价格,并在系统托盘显示 Ubuntu 时钟。 ![](/data/attachment/album/201907/04/222209a68le2qrzpjpj2qe.png) 它是简单但有用的工具,如果你经常有规律的投资比特币并且必须了解价格波动的话。 ### 89、Organize My Files Organize My Files 是一个跨平台的一键点击文件组织工具,它在 Ubuntu 中以 Snap 包的形式获得。它简单而强大,可以帮助你找到未组织的文件,通过简单点击来掌控它们。 ![](/data/attachment/album/201907/04/222223teuy4aia87dp8yzy.png) 它有易于理解的用户界面,强大且快速。它提供了很多功能:自动组织、递归组织、智能过滤和多层文件夹组织等。 ### 90、GnuCash GnuCash 是一个金融账户软件,在 GNU 公共证书下自由使用。它是个人和商业账户的理想软件。它有简单的用户界面允许你追踪银行账户、股票、收入和花费。 ![](/data/attachment/album/201907/04/223530g4errwj4424wer3g.png) GnuCash 实现了双入口记账系统,基于专业的账户原则来确保帐薄的平衡和报告的精确。 ### 91、Calibre Calibre 是一个跨平台的开源的面向电子书需求的解决方案。它是一个简单的电子书管理器,提供显示、创建、编辑电子书、组织已存在的电子书到虚拟书库、同步和其它更多功能。 ![](/data/attachment/album/201907/04/223547oy26q6kw1yub2155.png) Calibre 同样可以帮你转换电子书到你需要的格式并发送到你的电子书阅读设备。Calibre 是一个很棒的工具,如果你经常阅读和管理电子书的话。 ### 92、MATE 词典 MATE 词典是一个简单的词典,基本上是为 MATE 桌面环境开发的。你可以仅仅输入字然后这个字典会显示意思和引用。 ![](/data/attachment/album/201907/04/223608mgh9agdzr8spsg87.png) 它是简单和轻量级的在线词典,有极简的用户界面。 ### 93、Converseen Converseen 是免费的跨平台的批量图片处理应用,允许你转换、编辑、调整、旋转、裁剪大量图像,而仅仅需要一次鼠标点击。它提供了使用前缀或后缀图像批量重命名和从一个 Windows 图标文件提取图像等功能。 ![](/data/attachment/album/201907/04/223626mjzundlllmmflxq8.png) 它有很好的用户界面,易于使用,即时你是一个新手。它也能够转换整个 PDF 文件为图像集合。 ### 94、贴片地图编辑器 贴片地图编辑器是一个免费的关卡地图编辑器,允许你以正交、等轴、和六角等方向编辑地图。这个工具对于游戏开发者在游戏引擎开发阶段内可能非常有用。 ![](/data/attachment/album/201907/04/223636i3dkz2ob13sdo1l8.png) 它是一个通用的地图编辑器,让你创建升级位置、地图布局、碰撞区域和敌人位置。它保存所有的数据为 tmx 格式。 ### 95. Qmmp Qmmp 是一个自由开源的音频播放器,用 C++ 和 Qt 开发的。它是跨平台的音频播放器,界面与 Winamp 很相似。 它有简单的直观的用户界面,可以用 Winamp 皮肤替代默认的 UI。 ![](/data/attachment/album/201907/04/223817akyvh55v2it7mict.png) 它提供了自动唱片集封面获取、支持多艺术家,另外的插件和扩展支持和其它与 Winamp 相似的特点。 ``` $ sudo add-apt-repository ppa:forkotov02/ppa $ sudo apt-get update $ sudo apt-get install qmmp qmmp-q4 qmmp-plugin-pack-qt4 ``` ### 96、Arora Arora 是一个免费开源的 web 浏览器,提供了专有的下载管理器、书签、私密模式、选项卡式浏览。 ![](/data/attachment/album/201907/04/223828awhukhrcpr55rcaw.png) Arora web 浏览器由 Benjamin C. Meyer 开发,它由于它的轻量自然灵活的特点在 Linux 用户间很受欢迎。 ### 97、XnSketch XnSketch 是一个 Ubuntu 上的酷应用,只需要几次点击,就能帮你转换你的图片为卡通或素描图。它展现了 18 个不同的效果,例如:锐化、白描、铅笔画等等。 ![](/data/attachment/album/201907/04/223841u8m88lsnssj31v8z.png) 它有优秀的用户界面,易于使用。一些额外的特点包括透明度和边缘锐化调整、对比度、亮度、饱和度调整。 ### 98、Geany Geany 是一个简单而轻量级的文本编辑器,像一个集成开发环境。它是跨平台的文本编辑器,支持所有主流编程语言包括 Python、C++、LaTex、Pascal、C#、etc。 ![](/data/attachment/album/201907/04/223900uh8kcfhm5nmqjihm.png) Geany 有个类似于 Notepad++ 编程编辑器的简单用户界面。它提供了 IDE 的功能,如代码导航、自动补完、格式高亮,并支持扩展。 ``` $ sudo apt-get install geany ``` ### 99、Mumble Mumble 是又一个 VoIP 应用,与 Discord 类似。Mumble 同样最初是为在线游戏玩家设计的,使用客户端-服务器架构提供了端到端的聊天。在 Mumble 上的声音质量非常好,它提供了端到端的加密来确保私密性。 ![](/data/attachment/album/201907/04/223917u7zg2x7zt0p7xj60.png) Mumble 是一个开源应用,有简单的用户界面,易于使用。Mumble 在 Ubuntu 软件中心可以下载。 ``` $ sudo apt-get install mumble-server ``` ### 100、Deluge Deluge 是一个跨平台的轻量级的 BitTorrent 客户端,能够用来在 Ubuntu 上下载文件。BitTorrent 客户端与很多 Linux 发行版一起发行,但 Deluge 是最好的 BitTorrent 客户端,界面简单、易于使用。 ![](/data/attachment/album/201907/04/223930gvpqy978vk3pflkb.png) Deluge 拥有你可以在其它 BitTorrent 客户端上发现的所有功能,但是一个功能特别突出,它给了用户从其它设备访问客户端的能力,这样你可以远程下载文件了。 ``` $ sudo add-apt-repository ppa:deluge-team/ppa $ sudo apt-get update $ sudo apt-get install deluge ``` 所以这些就是 2018 年我为大家选择的 Ubuntu 上最好的 100 个应用了。所有列出的应用都在 Ubuntu 18.04 上测试了,肯定在老版本上也能运行。 --- via: <https://linuxhint.com/100_best_ubuntu_apps/> 作者:[Swapnil Tirthakar](https://linuxhint.com/author/swapnil/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[warmfrog](https://github.com/warmfrog) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
To make the best use of any operating system, you need the best set of applications and software. Similarly, to make the best use of Ubuntu, you need apps that are best in the business. We are now in 2023 and there are dozens of apps that are available for Ubuntu across various categories. Ubuntu ships-in with handful apps to start, just basic apps that help you use your new operating system. Different user needs different set of applications according to their need and use. In this article, we will give you a brief look into the 100 best apps for Ubuntu that you can install and use in 2023. Many users who recently switched to Ubuntu from Microsoft Windows or any other operating system face the dilemma of finding the best alternative to the application software that they have been using for years on their previous OS. Ubuntu has thousands of free-to-use and open-source application software that perform way better than many paid software on Windows and other OS. The following list features many applications in various categories so that you can find the best application that would best match your requirements. ## 1. Google Chrome Browser Almost all the Linux distributions feature the Mozilla Firefox web browser by default and it is a tough competitor to Google Chrome. But Chrome has its own advantages over Firefox like Chrome gives you direct access to your Google account from where you can sync your bookmarks, browser history, extensions, etc. from the Chrome browser on the other operating systems and mobile phones. Google Chrome features an up-to-date Flash player for Linux which is not the case with the other web browsers on Linux including Mozilla Firefox and Opera web browser. If you continuously use Chrome on Windows, it is the best choice to use it on Linux, too. ## 2. Steam Gaming on Linux is a real deal now which was only a distant dream few years ago. In 2013, Valve announced the Steam gaming client for Linux and everything has changed since then. Earlier users were hesitant to switch to Linux from Windows just because they would not be able to play their favourite games on Ubuntu, but that is not the case now. Some users might find the installation of Steam on Linux tricky but it’s worth all your efforts since thousands of Steam games are available for Linux. Some popular high-end games like Counter Strike: Global Offensive, Hitman, and Dota 2 are available for Linux; you just need to make sure that you have the minimum required hardware to play these games. $ sudo apt-get update $ sudo apt-get install steam ## 3. WordPress Desktop Client Yes, you read it right! WordPress has its dedicated desktop client for Ubuntu from where you can manage your WordPress sites. You can also write and design separately on the desktop client without the need to switch the browser tabs. If you have websites which are backed by WordPress, this desktop client is a must-have application for you as you can also keep track of all the WordPress notifications in one single window. You can also check the stats of the performance of your posts on the website. The WordPress desktop client is available in Ubuntu Software Centre from where you can download and install it. ## 4. VLC Media Player VLC is a very popular cross-platform and open-source media player which is also available for Ubuntu. What makes VLC a best media player is that it can play videos in all the audio and video formats available on planet without any issue. VLC has a slick user interface which is very easy to use. Apart from that, it offers a lot of features such as online video streaming, audio and video customization, etc. $ sudo apt update $ sudo apt-get install vlc qtwayland5 ## 5. Atom Text Editor Having developed by Github, Atom is a free and open-source text editor which can also be used as Integrated Development Environment (IDE) for coding and editing in major programming languages. Atom developers claim it to be a completely hackable text editor for the 21st Century. Atom Text Editor has one of the best user interfaces. It is a feature-rich text editor with features like auto-completion, syntax highlighting, and support of extensions and plug-ins. $ sudo apt-get update $ sudo apt-get install atom ## 6. GIMP Photo Editor GIMP (GNU Image Manipulation Programme) is a free and open-source photo editor for Ubuntu. It is arguably a best alternative to Adobe Photoshop on Windows. If you have been continuously using Adobe Photoshop and finding it difficult to get used to GIMP, you can customize GIMP to look very similar to Photoshop. GIMP is a feature-rich photo editor and you can always use additional features by installing extensions and plug-ins anytime. ## 7. YouTube Music Google Play music player has been replaced by YouTube Music from December 1, 2020 as Google’s main brand for music streaming on various platforms such as Android, Windows, and Linux. YouTube Music comes with much better user interface as compared to Google Music Player. To listen to your favorite music ad-free and download it locally to play in offline mode, you need to buy a premium subscription which can also be accessed on YouTube Premium. With premium subscription, you can listen to music at 256kbit/s AAC while you get an audio quality at 128kbit/s AAC on the free version. It is a great music player to have with great collection across various genres. **Download YouTube Music: https://snapcraft.io/youtube-music-desktop-app** ## 8. Digikam Digikam is a free and open-source professional photo management for creators and photographers. This advanced photo management tool is available for different platforms that includes Linux, Windows, and macOS. This application offers many useful features such as importing, managing, editing, and sharing photos and raw files across other devices. Using digikam’s import tool, you can directly import the photos, raw files, and videos from your camera or external storage like SD cards to your computer. The best thing about this application is that it handles the raw files quite well as compared to the other image editing applications available for Ubuntu. From basic tools for adjusting colors and cropping to advanced tools such as panorama stitching, curve adjustment, and many others, all come bundled with digickam. It also comes with a special tool which applies lens correction automatically on images; the tool is based on Lensfun library. **Download Digikam: https://snapcraft.io/digikam** ## 9. Synaptic Package Manager Synaptic Package Manager is one of the must-have tools on Ubuntu because it works for graphical interface for “apt-get” command which we usually use to install apps on Ubuntu using the terminal. It gives a tough competition to default app stores on various Linux distros. Synaptic comes with very simple user interface which is very fast and easy-to-use as compared to the other app stores. On the other side, you can browse various apps in different categories from where you can easily install and uninstall apps. ## 10. Skype Skype is a very popular cross-platform video calling application which is now also available for Linux as a Snap app. Skype is an instant messaging application which offers features like voice and video calls, desktop screen sharing, etc. Skype has an excellent user interface which is very similar to desktop client on Windows and it is very easy to use. It could be a very useful app for many switchers from Windows. ## 11. VirtualBox VirtualBox is a cross-platform virtualization software application which is developed by Oracle Corporation. If you love trying out new operating systems, VirtualBox is the must-have Ubuntu application for you. You can tryout Linux, mac inside Windows Operating System, or Windows and mac inside Linux. What VB actually does is it lets you virtually run the guest operating system on host operating system. It creates virtual hard drive and installs guest OS on it. You can download and install VB directly from the Ubuntu Software Center. ## 12. Unity Tweak Tool Unity Tweak Tool (Gnome Tweak Tool) is a must-have tool for every Linux user because it gives the users the ability to customize their desktop according to their need. You can try new GTK themes, set up the desktop hot corners, customize the icon set, tweak the unity launcher, etc. Unity Tweak Tool can be very useful to its user as it has everything covered right from the basic to advanced configurations. This tool allows you more control over graphical user interface of your desktop. ## 13. Microsoft Edge Microsoft finally got past its slow and old school web browser. Yes, you guessed it correct! We are talking about Internet Explorer. They finally delivered a web browser that can compete with the likes of Google Chrome and Mozilla Firefox in terms of speed and security which matters most to the users. Now, Microsoft Edge is also available for Linux and its distros with full-fledged features which are similar to that available on Windows. If you use both Windows and Linux, this browser is a must have for you because this makes the syncing process more convenient. ## 14. Stacer Stacer is a GUI-based system optimizer and monitoring tool for Linux and its distributions like Ubuntu. It is an open-source application that helps the user to manage the entire system with different aspects. You can manage various activities using Stacer such as package and process management, CPU, Network, disk monitoring, and managing the startup application. Windows user are aware of CCleaner that helps optimize the system and easily free up space by removing unnecessary files on the system. Same tasks are performed by Stacer on Ubuntu and other Linux distros. Stacer comes with beautiful and modern interface which is very easy to use. $ sudo apt-get update $ sudo apt-get install stacer ## 15. Museek Museek is a simple, clean, and cross-platform music player which is available for platforms such as macOS, Windows, and Linux. This lightweight music player uses “Node.js” as a backend, “electron” for built-in browser, and “React.js” as a frontend framework. It supports most commonly used file formats such as MP3, MP4, M4A, and 3GPP, etc. Its elegant and well-designed interface makes it stand out among others. You can also switch between light and dark theme according to your choice. Its drag and drop feature allows you to add the files and folders directly to its library. Its quick search engine allows you to search your favorite track from the library within seconds. ## 16. Pixbuf Pixbuf is a desktop client from Pixbuf photo community hub which lets you upload, share, and sale your photos. It supports photo sharing to social media networks like Facebook, Pinterest, Instagram, Twitter, etc. and photography services including Flickr, 500px, and Youpic. Pixbuf offers features like analytics which gives you stats about clicks, retweets, repins on your photo, scheduled posts, and dedicated iOS extension. It also has mobile app so that you can always be connected with your Pixbuf account from anywhere. Pixbuf is available for download in the Ubuntu Software Center as a snap package. ## 17. Clementine Music Player Clementine is a cross-platform music player and a good competitor to Rhythmbox which is a default music player on Ubuntu. It is a fast and easy-to-use music player, thanks to its user friendly interface. It supports audio playback in all the major audio file formats. Apart from playing music from the local library, you can also listen to online radio from Spotify, SKY.fm, Soundcloud, etc. It also offers other features like smart and dynamic playlists, and syncing music from cloud storages like Dropbox, Google Drive, etc. $ sudo apt-get update $ sudo apt-get install clementine ## 18. Blender Blender is a free and open-source 3D creation application software which you can use to create 3D printed models, animated films, video games, etc. It comes with integrated out-of-the-box game engine which you can use to develop and test the video games. Blender has a catchy user interface which is easy to use and it includes features like built-in render engine, digital sculpturing, simulation tool, animation tools, and many more. It is one of the best applications that you will ever find for Ubuntu considering it’s free and the features it offer. ## 19. Audacity Audacity is an open-source audio editing application which you can use to record and edit the audio files. You can record the audio from various inputs like microphone, electric guitar, etc. It also gives the ability to edit and trim the audio clips according to your need. Recently, Audacity released new features for Ubuntu which includes theme improvements, zoom toggle command, etc. Apart from these, it offers features like various audio effects including noise reduction and many more. $ sudo apt-get update $ sudo apt-get install audacity ## 20. Vim Vim is an Integrated Development Environment which you can use as standalone application or command-line interface for programming in various major programming languages like Python. Most of the programmers prefer coding in Vim because it is fast and is a highly customizable IDE. Initially, you might find it difficult to use but you will quickly get used to it. ## 21. Inkscape Inkscape is an open-source and cross-platform vector graphics editor which you will find very much similar to Corel Draw and Adobe Illustrator. Using it, you can create and edit the vector graphics such as charts, logos, diagrams, illustrations, etc. Inkscape uses Scalable Vector Graphics (SVG) and an open XML-based W3C standard as a primary format. It supports various formats including JPEG, PNG, GIF, PDF, AI (Adobe Illustrator Format), VSD, etc. $ sudo apt-get update $ sudo apt-get install inkscape ## 22. Exodus Exodus is a very popular cryptocurrency wallet around the world. Exodus is not only a Bitcoin wallet but it is also a Blockchain Wallet Asset called as digital currency or cryptocurrency. Unlike the Bitcoin Core, we don’t need to download the whole Blockchain as it is a lightweight wallet. The user interface of Exodus client is very attractive but simple. If you even don’t have any knowledge about Bitcoin and how it works, you can still be able to use this wallet. Exodus stores all the private keys of your cryptocurrencies on your computer storage locally. You also can backup the wallet to your computer in simple steps which are provided in Exodus client. Crypto exchange or trading is one of the best features available in Exodus. Users can exchange or trade their Bitcoin with other Bitcoin alternatives and vice versa. Exodus has exchange algorithm which is powered by Shapeshifts that performs the exchange or trade of digital currencies in few seconds. ## 23. SimpleScreenRecorder SimpleScreenRecorder is a free and lightweight screen video recorder for Ubuntu. This screen recorder can be a very useful tool for you if you are a YouTube creator or an application developer. It can capture a video/audio record of your desktop screen or directly record the video games. You can set the video resolution, frame rate, etc. before starting the screen recording. It has a simple user interface which you will find very easy to use. $ sudo apt-get update $ sudo apt-get install simplescreenrecorder ## 24. Telegram Telegram is a cloud-based instant messaging and VoIP platform which gained a lot of popularity in recent years. It is an open-source and cross-platform messenger where the user can send messages, share videos, photos, audio, and other files. Some of the notable features in Telegram are secrete chats, voice messages, bots, telescope for video messages, live locations, and social login. Privacy and security is at the highest priority in Telegram, so all the messages that you send and receive are end-to-end encrypted. ## 25. WPS Office WPS office is a clone of Microsoft office on Windows operating system. If you want to have an office suite which is similar to Microsoft Office on Ubuntu, WPS office is a great alternative. Right from the user interface to its features, WPS office has everything identical to Microsoft office. WPS office supports common document format and it works flawlessly with Ubuntu and other Linux distributions. It is a great productivity application to have on Linux. It is also completely free to download and install. ## 26. MailSpring MailSpring, earlier known as Nylas Mail or Nylas N1, is an open-source email client. It saves all the mails locally on your computer so that you can access them anytime you need them. It features advanced search which uses AND and OR operations so that you can search for mails based on different parameters. MailSpring comes with excellent user interface which you will find only on a handful of other mail clients. Privacy and security, scheduler, contact manager, calendar are some of the features that MailSpring offers. ## 27. PyCharm PyCharm is one of my favorite Python IDEs after Vim because it has a slick user interface with lot of extensions and plug-in support. Basically, it comes in two editions: one is the community edition which is free and open-source and the other is the professional edition which is paid. PyCharm has a highly customizable IDE and sports features such as error highlighting, code analysis, integrated unit testing and Python debugger, etc. PyCharm is the preferred IDE by most of the Python programmers and developers. ## 28. Caffeine Imagine you are watching something on YouTube or reading a news article and Ubuntu suddenly locks your screen. I know that is very annoying. It happens with many of us, so Caffeine is the tool that helps you block the Ubuntu lock screen or screensaver. Caffeine Inhibitor is a lightweight tool. It adds icon on the notification bar from where you can activate or deactivate it easily. No additional setting needs to be done in order to use this tool. $ sudo apt-get update $ sudo apt-get install caffeine -y ## 29. Kooha Kooha is an elegant screen recorder for Linux distributions that supports Wayland display. It is one of the first and very few screen recorders that added the support for Wayland. It is a simple screen recorder that comes with simple user interface that is very easy to use. It also supports keyboard shortcuts that helps improve productivity. It supports all the widely used video file formats such as WebM, MP4, GIF, and MKV. In this screen recorder, you get the option to select specific area or the entire screen to record. While recording, you can also add a voice over using microphone. It is quite similar to GNOME’s built-in screen recorder, the user interface being the only exception. To install Kooha on Linux, you need to enable the Flatpack support. Run following commands one by one to install Kooha: $ flatpak install flathub io.github.seadve.Kooha ## 30. Neofetch Neofetch is a cool system information tool that gives you all the information about your system by running the “neofetch” command in the terminal. It is a cool tool to have because it gives you information about the desktop environment, kernel version, Bash version, and GTK theme that you are running. As compared to other system information tools, Nefetch is a highly customizable tool. You can perform various customizations using the following command line: $ sudo apt-get update $ sudo apt-get update install neofetch ## 31. Peek Peek is an animated screen recorder for Ubuntu and other Linux distros. It is very easy to use to with simple user interface that makes you feel at home right from the start. It was initially built to showcase the UI features of the new underdeveloped apps and a bug if there is any. It works flawlessly on Unity desktop environment. Before you proceed with the installation, make sure that you have ffmpeg installed on your system. $ sudo apt update && sudo apt install peek ## 32. Zabbix Zabbix is an open-source monitoring tool for IT infrastructure for networks, servers, virtual machines and cloud services, etc. It is a professionally developed tool specifically for enterprises and organizations. Despite being a powerful tool, it is a completely free-to-use system monitoring tool. It is available for a variety of Linux distributions such as CentOS, Debian, Ubuntu, Raspberry Pi OS, etc. ## 33. Weather Weather is a small application which gives you a real-time weather information for your city or any other location in the world. It is a simple and lightweight tool which gives you a detailed forecast of up to 7 days and an hourly details for the current and the next day. It integrates with the GNOME shell to give you information about the current weather conditions at the recently searched locations. It has a minimalist user interface which works smoothly on minimum hardware requirement. ## 34. Kdenlive Kdenlive is a free and open-source video editing application for Linux and its distros. It is a feature-rich video editor with features like multi-track video editing, support for various video/audio file formats, highly configurable interface with keyboard shortcuts, effects and transitions, and many other useful features. It is a reliable video editing application which runs smoothly on any Linux distribution. It also comes with a variety of light and dark themes to match your needs. ## 35. Thunderbird Thunderbird is an open-source email client which is also a default email client in most of the Linux distributions. Despite parting ways with Mozilla in 2017, Thunderbird is still very popular and is the best email client on the Linux platform. It comes with features like spam filtering, IMAP and POP email syncing, calendar support, address book integration, and many other out-of-the-box features. It is a cross-platform email client with a full community support across all supported platforms. You can always change its look and feel, thanks to its highly customizable nature. ## 36. Pidgin Pidgin is an instant messaging client where you can login into different instant messaging networks under a single window. You can login to instant messaging networks like Google Talk, XMPP, AIM, Bonjour, etc. Pidgin has all the features you can expect in an instant messenger and you can always enhance its performance by installing additional plug-ins. ## 37. Krita Krita is a free and open-source digital painting, editing, and animation application developed by KDE. It has an excellent user interface with everything placed perfectly so that you can easily find the tool you need. It uses OpenGL canvas which boosts Krita’s performance. It also offers many features like different painting tools, animation tools, vector tools, layers and masks, and many more. Krita is available in the Ubuntu Software Center. You can easily download it from there. ## 38. Dropbox Dropbox is a stand-out player in cloud storage and its Linux clients works really well on Ubuntu once installed properly. While Google Drive comes out-of-the-box on Ubuntu 16.04 LTS and later, Dropbox is still a preferred cloud storage tool on Linux in terms of the features it offer. It always works in the background and backs up the new files from your system to the cloud storage, and continuously syncs the files between your computer and its cloud storage. ## 39. Kodi Kodi, formerly known as Xbox Media Center (XBMC), is an open-source media player. You can play music, videos, podcasts, and video games both in online and offline mode. This software was first developed for the first generation of Xbox gaming console and then slowly ported to personal computers. Kodi has very impressive video interface which is fast and powerful. It is a highly customizable media player. By installing additional plug-ins, you can access the online streaming services like Pandora, Spotify, Amazon Prime Video, Netflix and YouTube. ## 40. Spotify Spotify is one of the best online media streaming sites. It provides music, podcast, and video streaming services, both on free and paid subscription basis. Earlier, Spotify was not supported on Linux but now it has its own fully functional desktop client for Ubuntu. Alongside the Google Play Music Desktop Player, Spotify is a must-have media player for you. You just need to login to your Spotify account to access your favorite online content from anywhere. ## 41. Brackets Brackets is an open-source text editor which is developed by Adobe. It can be used for web development and design in web technologies such as HTML, CSS, and JavaScript. It sports live preview mode which is great feature to have as it can get a real-time view of whatever the changes you make in the script. It is one of the modern text editors on Ubuntu and has a slick user interface which takes the web development task to the new level. It also offers features like inline editor and supports for popular extensions like Emmet, Beautify, Git, File Icons, etc. ## 42. Vivaldi Vivaldi is a free cross-platform web browser which is specially developed for end-users with heavy internet usage. This browser adopts some popular features from Opera 12 which was based on the Presto layout engine. You will find many similar features from the older version of Opera web browser and My Opera. Vivaldi is one of the most flexible web browsers out there which gives you full control over customization with features like tab management, customization to create your own unique experience, keyboard shortcuts, mouse gestures, quick commands through command line, and a bookmark manager. It also features a set of built-in tools such as Notes which you can use to take down notes while surfing on web, capture screenshot of a full web page or a particular area, and image properties tool which can be used to get an in-depth information about the image like copyrights, histograms, etc. ## 43. Terminator Terminator is an open-source terminal emulator which is programmed and developed in Java. It is a cross-platform emulator which lets you have privilege of multiple terminals in one single window which is not the case in the Linux default terminal emulator. Other stand-out feature in terminator includes automatic logging, drag and drop, intelligent vertical and horizontal scrolling, etc. ## 44. GitBook Editor Gitbook Editor for Linux helps you write and publish your book in multiple file formats such as PDF, EPUB, and HTML. Markdown syntax helps you create eBook and within just a few clicks after that, you can already publish it. If you have multiple contributors to your project, GitBook allows you to split the workload among them using the git distributed revision control. GitBook editor is a cross-platform and a free application with great graphical user interface. Features like drag-n-drop, auto-complete, live preview, integrated Git control, a file tree panel, and quick formatting buttons facilitate easy document structuring. ## 45. Thonny Thonny is a simple and lightweight IDE which is especially designed for beginners in programming. If you are new to programming, this is the must-have IDE for you because it lets you learn while programming in Python. Thonny is also a great tool for debugging as it supports live variables during debugging. Apart from this, it offers features like separate windows for executing function call, simple user interface, etc. ## 46. Font Manager Font Manager is a lightweight tool for managing, adding, or removing fonts on your Ubuntu system. It is specially built for Gnome desktop environment. Users who don’t have an idea about managing fonts using command line will find this tool very useful. Gtk+ Font Manager is not meant to be for professional users. It has a simple user interface which you will find very easy to navigate. You just need to download the font files from the internet and add them using the Font Manager. $ sudo apt-get update $ sudo apt-get install font-manager ## 47. Atril Document Viewer Atril is a simple document viewer which supports the file formats like Portable Document Format (PDF), PostScript (PS), Encapsulated PostScript (EPS), DJVU and DVI. Atril comes bundled with MATE desktop environment and it is identical to Evince which is a default document on most of the Linux distros. Atril has simple and lightweight user interface which is highly customizable and offers features like search and bookmarks, and its UI includes thumbnails on the left-hand side. ## 48. Notepadqq If you have ever used Notepad++ on Windows and you are looking for similar program on Linux, don’t worry because the developers have ported it to Linux as Notepadqq. It is a simple yet powerful text editor which you can use for your daily tasks or programming in various languages. Despite being a simple text editor, it has some amazing features like setting the theme between dark and light color scheme, multiple selection, regular expression, search, and real-time highlighting. $ sudo apt-get update $ sudo apt-get install notepadqq ## 49. Whatever (Evernote Alternative) Whatever is a lightweight alternative to the Evernote client for Linux and its distros. Evernote is only available for the Windows, macOS, iOS, and Android. Evernote helps you manage the tasks and save the web content for future reference under a single window. Apart from that, you can also perform drawing, sketching, and many more tasks. Whatever is the most reliable alternative to Evernote as it offers all of its features. Whatever can perform all the task that Evernote offers. Whatever integrates almost all the features available on Evernote. Whatever offers feature like to-do-lists, smart note taking, cross-device synchronization, note sharing, and many more. It also supports all the widely used media file formats like audio, video, pdf document, and images. $ sudo dpkg -i Whatever_1.0.0_amd64.deb $ sudo apt update && sudo apt upgrade ## 50. Cheese Cheese is a Linux default webcam application which can be useful to you in some video chat or instant messaging applications. Apart from that, you can also use this app to take photos and videos with fancy effects. It also sports the burst mode which lets you take multiple snaps in a quick succession and option to share your photos with friends and family. Cheese come pre-installed with most of the Linux distros but you can also download and install it from the Software Center. ## 51. MyPaint MyPaint is a free and open-source raster graphics editor which focuses on digital painting rather than image manipulation and post processing. It is a cross-platform application and is more or less similar to Corel Painter. MyPaint could be a good alternative to those who use Microsoft Paint application on Windows. It has simple user interface which is fast and powerful. MyPaint is available in the Software Center for download. ## 52. PlayOnLinux PlayOnLinux is a front-end for WINE emulator which allows you to run the Windows applications on Linux. You just need to install the Windows applications and game on WINE. Then, you can easily launch the applications and games using PlayOnLinux. ## 53. Music on Console Music on Console is a free and open-source command line music player for Linux and its distros like Ubuntu. It is a lightweight yet powerful music player which is very easy to use. There is no need to create the playlist in this music player; you just need to select a file from the directory where your favourite music files are stored. After that, Music on Console will start playing the music one-by-one. It works flawlessly even on machines with old hardware. Features like simple equalizer, multiple theme options, customizable keys, and support for internet broadcast make it a great console-based music player. ## 54. Brave Brave is an open-source web browser which blocks the ads and trackers so that you can browse your content fast and safely. What it actually does is that it pays to the websites and YouTubers on your behalf. If you prefer contributing to the websites and YouTubers rather than seeing the advertisements, this browser is for you. This is a new concept and could be a good browser for those who prefer safe browsing without compromising important data on internet. ## 55. Bitcoin Core Bitcoin Core is an official Bitcoin client which is highly secure and reliable. It keeps track of all your transactions and makes sure that all transactions are valid. It restricts the Bitcoin miners and banks from taking full control of your Bitcoin wallet. Bitcoin Core also offers other important features like private keys backup, cold storage, and security notifications. $ sudo apt-get update $ sudo apt-get install bitcoin-qt ## 56. Speedy Duplicate Finder Speedy Duplicate Finder is a cross-platform file finder which helps you find the duplicate files on your system and free-up the disk space. It is a smart tool which searches for duplicate files on the entire hard disk and also features smart filter which helps you find the file by file type, extension, or size. It has a simple and clean user interface which is very easy to handle. As soon as you download it from the Software Center, you are good to go with the disk space clean-up. ## 57. Zulip Zulip is a free and open-source group chat application which was acquired by Dropbox. It is written in Python and uses PostgreSQL database. It was designed and developed to be a good alternative to other chat applications like Slack and HipChat. Zulip is a feature-rich application with features such as drag and drop files, group chats, private messaging, image previews, and many more. It also supports integration with the likes of Github, JIRA, Sentry, and hundreds of other services. ## 58. Okular Okular is a cross-platform document viewer which is developed by KDE for KDE desktop environment. It is a simple document viewer and supports the file formats like Portable Document Format (PDF), PostScript, DjVu, Microsoft Compiled HTML help, and many other major file formats. Okular is one of the best document viewers that you should try on Ubuntu as it offers features like commenting on PDF documents, drawing lines, highlighting, and much more. You can also extract the text from the PDF document to the text file. ## 59. Pinta Pinta is a free and open-source cross-platform drawing and editing application. It is not as feature-rich image editing applications as Krita but is still very useful and reliable when it comes to basic editing and drawing. Just like Microsoft Paint, you can draw, paint, and add text using this application. Pinta gets some edge on Microsoft Paint when it comes to the features it offer. It is a simple drawing and image editing tool with simple and easy-to-use user interface. It is a great application for computers with minimal hardware resources. ## 60. Guake Guake is a cool drop-down terminal for GNOME Desktop Environment. Guake comes in a flash whenever you need it and disappears as soon as your task is completed. You just need to click the F12 button to launch or exit it, so launching Guake is way faster than launching new terminal window. Guake is a feature-rich terminal with features like support for multiple tabs, ability to save your terminal content to the file in few clicks, and fully customizable user interface. ## 61. KDE Connect KDE Connect is an awesome application on Ubuntu. We would love to list this application much higher in this marathon article but the competition is intense. Anyway, KDE Connect helps you get your Android smartphone notifications directly on the Ubuntu desktop. With KDE Connect, you can do a whole lot of other things like checking your phone’s battery level, exchange files between computer and Android phone, clipboard sync, sending SMS, and using your phone as a wireless mouse or keyboard. $ sudo apt-get update $ sudo apt-get install kdeconnect indicator-kdeconnect ## 62. CopyQ CopyQ is a simple but very useful clipboard manager which stores the content of the system clipboard whenever any change is made so that you can search and restore it back whenever you need it. It is a great tool to have as it supports text, images, HTML, and other formats. CopyQ comes pre-loaded with features like drag and drop, copy/paste, edit, remove, sort, create, etc. It also supports integration with the text editors like Vim. It could be a very useful tool if you are a programmer. $ sudo apt-get update $ sudo apt-get install copyq ## 63. GNOME Tweaks GNOME tweaks is an essential tool for GNOME users. All the major Linux distributions like Ubuntu, Manjaro, Pop_Os! and Fedora use the GNOME desktop environment. You can customize almost everything using GNOME Tweaks on Ubuntu. You can change the themes, wallpaper, and startup application, disable the animation to speed up your desktop, customize the desktop icons, manage the GNOME extensions, manage the fonts, change the power settings, and perform many other tweaks. $ sudo apt install gnaome-tweak-tool ## 64. Anbox Anbox is an Android emulator which lets you install and run the Android apps on your Linux system. It is a free and open-source Android emulator that executes the Android runtime environment using Linux Containers. It uses the latest Linux technologies and Android releases so that you can run any Android app like any other native application. Anbox is one of the modern and feature-rich emulators and offers features like no limit for application use, powerful user interface, and seamless integration with the host operating system. First, you need to install the following kernel modules: $ sudo apt-get update $ sudo apt install anbox-modules-dkms Now, install Anbox using snap: ## 65. OpenShot OpenShot is the best open-source video editor that you will find for Linux distros. It is a cross-platform video editor which is very easy to use without any compromise with its performance. It supports all the major audio, video, and image formats. OpenShot has a clean user interface and offers features like drag and drop, clip resizing, scaling, trimming, snapping, real-time previews, audio mixing and editing, and many other features. $ sudo apt-get update $ sudo apt-get install openshot -qt ## 66. Plank If you are looking for a cool and simple dock for your Ubuntu desktop, Plank should be the first choice for you. It is a perfect dock where you don’t need to make any tweaks after installation. But if you want to, it has built-in preferences panel where you can customize the themes, dock size, and position. Despite being a simple dock, Plank offers features like item rearrangement by simple drag and drop, pinned and running apps icon, and transparent theme support. $ sudo apt-get update $ sudo apt-get install plank ## 67. Filezilla Filezilla is a free and cross-platform FTP application which sports the FileZilla client and server. It lets you transfer files using FTP and encrypted FTP like FTPS and SFTP and supports the IPv6 internet protocol. It is a simple file transfer application with features like drag and drop, support for various languages used worldwide, powerful user interface for multitasking, controlling and configuring the transfer speed, and many other features. ## 68. Stacer Stacer is an open-source system diagnostic tool and optimizer developed using the Electron development framework. It has an excellent user interface and you can clean the cache memory, start-up the applications, uninstall apps that are no longer needed, and monitor the background system processes using it. It also lets you check the disk, memory, and CPU usage and gives you the real-time stats of downloads and uploads. It looks like a tough competitor to the Ubuntu cleaner but both have unique features that separate them apart. $ sudo apt-get update $ sudo apt-get install stacer ## 69. 4K Video Downloader 4K Video Downloader is a simple video downloading tool which you can use to download videos, playlists, channels from Vimeo, Facebook, YouTube and other online video streaming sites. It supports the download of YouTube playlists and channels in MP4, MKV, M4A, 3GP and many other video/audio file formats. 4K Video Downloader is not as simple as you would think. Apart from normal video downloads, it supports 3D and 360 degree video downloading. It also offers features like in-app proxy setup and direct transfer to iTunes. You can download it from [here](https://www.4kdownload.com/download). ## 70. Insync Insync is one of the most reliable Google Drive clients that you will find for Linux and its distributions such as Ubuntu, Linux Mint, Fedora and Debian. It comes with a 15-day free trial. After that, you need to purchase it to use it further. In three simple steps, you can access your Google Drive data on Linux using Insync. Just download Insync, install, and then login to your Google account. Its selective sync 2.0 feature helps you sync all your files and folders either in your local computer or in the cloud storage. Also, you can access all the files that are locally stored on Google Drive in the Linux file manager. You can also access multiple Google Drive accounts. Google docs automatically gets converted to Open Document format for Libre Office compatibility. Insync is great for professional use as you can give offline access to your team to Google’s shared drive for smooth workflow. ## 71. Hiri Hiri is a cross-platform email client which is developed in Python programming language. It has a slick user interface and it can be a good alternative to Microsoft Outlook in terms of features and services offered. This is a great email client that can be used for sending and receiving emails, managing contacts, calendars, and tasks. It is a feature-rich email client that offers features like integrated task manager, email synchronization, email rating, email filtering, and many more. ## 72. Sublime Text Sublime Text is a cross-platform source code editor programmed in C++ and Python. It has Python Application Programming Interface (API) and supports all the major programming and markup languages. It is a simple and lightweight text editor which can be used as IDE with features like auto-completion, syntax highlighting, split editing, etc. Some additional features in this text editor include Goto anything, Goto definition, multiple selections, command palette, and a fully customizable user interface. ## 73. TeXstudio TeXstudio is an integrated writing environment to create and edit the LaTex documents. It is an open-source editor which offers features like syntax highlighting, integrated viewer, interactive spelling checker, code folding, drag and drop, etc. It is a cross-platform editor and has a very simple, lightweight user interface which is easy to use. It ships in with integration for BibTex and BibLatex bibliographies managers and integrates the PDF viewer. You can download the TeXstudio installation package from its [website](https://www.texstudio.org/) or in the Ubuntu Software Center. ## 74. QtQR QtQR is a Qt based application that lets you create and read the QR codes in Ubuntu. It is developed in Python and has a simple and lightweight user interface. You can encode the website URL, email, text, SMS, etc. You can also decode the barcode using the webcam camera. QtQR could prove to be a useful tool to have if you generally deal with product sales and services because we don’t have any other similar tool to QtQR which requires minimal hardware to function smoothly. $ sudo apt-get update $ sudo apt-get install qtqr ## 75. Nylas N1 Nylas N1 is a free and open-source email client for Ubuntu and other Linux distros. This is a cross-platform email client available for all the major operating system platforms such as Windows, macOS, and Linux. If you have a mail account with different mail services like Gmail, Yahoo Mail, and Microsoft Outlook and you want to access them under one single window, Nylas N1 is the best email client to have as it can be used to configure all major mail services under a single window. Nylas N1 supports all the major mail transfer protocols such as IMAP, SMTP, and POP3 which makes it one of the most reliable email clients out there. ## 76. NitroShare NitroShare is a cross-platform, open-source network file sharing application. It lets you easily share files between multiple operating systems’ local network. It is a simple yet powerful application and it automatically detects the other devices that run the NitroShare on local network. File transfer speed is what makes NitroShare a stand-out file sharing application as it achieves gigabit speed on capable hardware. There is no need for required additional configuration. You can start the file transfer as soon as you install it. $ sudo apt-get update $ sudo apt-get install nitroshare ## 77. Konversation Konversation is an open-source Internet Relay Chat (IRC) client which is developed for KDE desktop environment. It gives speedy access to Freenode network’s channels where you can find support for most distributions. It is a simple chat client with features like support for IPv6 connection, SSL server support, bookmarks, on-screen notifications, UTF-8 detection, and additional themes. It has easy-to-use GUI which is highly configurable. ## 78. Discord If you’re a hardcore gamer and play online games frequently, we have a great application for you. Discord is a free Voice over Internet Protocol (VoIP) application which is especially designed for online gamers around the world. It is a cross-platform application and can be used for text and audio chats. Discord is a very popular VoIP application gaming community. Since it is a completely free application, it is a very good competitor to the likes of Skype, Ventrilo, and Teamspeak. It also offers features like clear voice quality, and modern text chat where you can share images, videos, and links. ## 79. Conky Conky is a free and open-source system monitoring tool for Linux, FreeBSD, and OpenBSD systems. It is a highly configurable system monitoring tool. Conky shows the system data such as CPU load, memory usage, hard drive usage, network activity, GPU temperature, fan speed, GPU clock, and other data such as time and weather. It is a lightweight system monitoring tool. Hence, it works effortlessly on the system with minimal hardware. ## 80. MPV Media Player MPV is a free and open-source media player based on MPlayer and MPlayer 2. It has a simple user interface where the user just needs to drag and drop the audio/video files to play them since there is no option to add the media files on GUI. One of the things about MPV is that it can effortlessly play 4K videos which is not the case with the other media players on Linux distros. It also gives the user ability to play the videos from online video streaming sites including YouTube and Dailymotion. $ sudo apt-get update $ sudo apt-get install -y mpv ## 81. Plume Creator If you’re a writer, Plume Creator is a must-have application for you because you will not find other app for Ubuntu with privileges like Plume Creator. Writing and editing stories and chapters is a tedious task. Plume Creator makes this task easier for you with the help of some amazing tools it has to offer. It is an open-source application with minimal user interface which you could find confusing in the beginning but you will get used to it later on. It offers features like edit notes, synopses, export in HTML and ODT formats support, and rich text editing. ## 82. Chromium Web Browser Chromium is an open-source web browser which is developed and distributed by Google. Chromium is very identical to Google Chrome web browser in terms of appearance and features. It is a lightweight and fast web browser with minimalist user interface. If you use Google Chrome regularly on Windows and you are looking for similar browser for Linux, Chromium is the best browser for you as you can login into your Google account to access all your Google services including Gmail. ## 83. Simple Weather Indicator Simple Weather Indicator is an open-source weather indicator app which is developed in Python. It automatically detects your location and shows you the weather information like temperature, possibility of rain, humidity, wind speed, and visibility. Simple Weather Indicator comes with configurable options such as location detection, temperature SI unit, location visibility on/off, etc. It is a cool app to have which comfortably adjusts with your desktop. ## 84. Flameshot Flameshot is a free and open-source screenshot tool for Linux and its distros such as Ubuntu. It is a cross-platform tool which is also available for other major operating system platforms such as Windows and mac. It offers features such as instantly editing screenshots, image upload to Imgur, and export and import configuration. Apart from that, it is a very easy-to-use and highly customizable tool. ## 85. Scribus Scribus is a free and open-source desktop publishing application that lets you create posters, magazines, and books. It is a cross-platform application based on Qt toolkit and is released under GNU general public license. It is a professional application with features like CMYK and ICC color management, Python-based scripting engine, and PDF creation. Scribus comes with decent user interface which is easy to use and works effortlessly on systems with low hardware. It could be downloaded and installed from the Software Center on all the latest Linux distros. ## 86. Cura Cura is an open-source 3D printing application developed by David Braam. Ultimaker Cura is the most popular software in 3D printing world and is used by millions of users worldwide. It follows a 3-step 3D printing model: Design, Prepare, and Print. It is a feature-rich 3D printing application with seamless integration support for CAD plug-ins and add-ons. It is a very simple and easy-to-use tool in which the novice artists can start right away. It supports major file formats like STL, 3MF, and OBJ. ## 87. Nomacs Nomacs is an open-source, cross-platform image viewer which supports all the major image formats including raw and PSD images. It has the ability to browse the images in zip or Microsoft Office files and extract them to a directory. Nomacs has very simple user interface with image thumbnails at the top. It offers some basic image manipulation features like crop, resize, rotate, color correction, etc. $ sudo apt-get update $ sudo apt-get install nomacs ## 88. BitTicker BitTicker is a live bitcoin-USDT Ticker for Ubuntu. It is a simple tool that connects to bittrex.com market, retrieves the latest price for BTC-USDT, and displays the Ubuntu clock on system tray. It is simple but very useful if you regularly invest in Bitcoin and study the price fluctuations. ## 89. pCloud The pCloud is a cross-platform cloud storage application where you can store your personal files or backup your PC. The pCloud has a dedicated client for Linux and its distros such as Ubuntu. This app not only lets you store the data or files on cloud but also helps you recover the older versions of the data up to 1 year. You can also send and receive large files to and from anyone you like. The best thing about pCloud is that it offers military grade file encryption which encrypts sensitive files on any device and make them invisible. ## 90. Shortwave Shortwave is an internet-based radio player application for Linux and its distros such as Ubuntu. It is an open-source radio player that comes with modern user interface. Dark mode feature is also available with this out-of-the-box application. There are some other features that are worth mentioning such as available thousands of radio stations, keyboard navigation, sleep/hibernate mode, and many others. ## 91. Calibre Calibre is a cross-platform, open-source solution to all your e-book needs. It is a simple e-book organizer that offers features like displaying, creating, editing e-books, organizing existing e-books into virtual libraries, syncing, and many more. Calibre also helps you convert the e-books into whichever format you need and send them to your e-book reading device. Calibre is a very good tool to have if you regularly read and manage e-books. ## 92. MATE Dictionary MATE Dictionary is a simple dictionary that is basically developed for MATE desktop environment. You just need to type the word and then this dictionary displays the meaning and references for it. It is a simple and lightweight online dictionary with a minimalist user interface. ## 93. Converseen Converseen is a free cross-platform batch image processing application that lets you convert, edit, resize, rotate, and flip a large number of images with a single mouse click. It offers features like renaming bunch of images using prefix/suffix, extracting the image from a Windows icon file, etc. It has very good user interface which is easy to use even if you are a novice user. It can also convert an entire PDF file into a collection of images. ## 94. Tiled Map Editor Tiled is a free software level map editor which you can use to edit the maps in various projections such as orthogonal, isometric, and hexagonal. This tool can be very useful for game developers during game engine development cycle. Tiled is a versatile map editor which lets you create power boost positions, and map the layouts, collision areas, and enemy positions. It saves all the data in tmx format. ## 95. Sayonara Sayonara is a small and lightweight music player for Linux and its distros such as Ubuntu. It is one of the most underrated music players out there. It definitely deserves more attention. It has a simple but very easy to use user interface that also comes with dark mode. Talking about features, it comes with support for various popular music and playlist formats, directory view, shortcut keys, and seamless desktop integration. $ sudo apt-get update $ sudo apt-get install sayonara ## 96. Arora Arora is a free and open-source web browser which offers features like dedicated download manager, bookmarks, privacy mode, and tabbed browsing. Arora web browser is developed by Benjamin C. Meyer. It is popular among Linux users for its lightweight nature and flexibility. ## 97. Kbackup Kbackup is a simple and user-friendly application to back up your important files and data in the most simple way. You can select which file or folder to include or exclude in the backup. Using Kbackup, you can run an automated backup without the need for graphical user interface. This is a simple application. Even if you are first time user, you will feel at home on the first go. ## 98. Geany Geany is a simple and lightweight text editor which works like an Integrated Development Environment (IDE). It is a cross-platform text editor and supports all the major programming languages including Python, C++, LaTex, Pascal, C#, etc. Geany has simple user interface which resembles to programming editors like Notepad++. It offers IDE-like features such as code navigation, auto-completion, syntax highlighting, and extensions support. ## 99. Mumble Mumble is another Voice over Internet Protocol (VoIP) application which is very similar to Discord. Mumble is also basically designed for online gamers and uses client-server architecture for end-to-end chat. The voice quality is very good on Mumble and it offers end-to-end encryption to ensure privacy. Mumble is an open-source application and features a very simple user interface which is easy to use. Mumble is available for download in the Ubuntu Software Center. ## 100. Deluge Deluge is a cross-platform and lightweight BitTorrent client that can be used to download files on Ubuntu. BitTorrent client come bundled with many Linux distros but Deluge is the best BitTorrent client which has simple and easy-to-use user interface. Deluge comes with all the features that you will find in BitTorrent clients. But one feature that stands out is giving the user ability to access the client from other devices so that you can download the files to your computer even if you are not at home. $ sudo apt-get update $ sudo apt-get install deluge ## Conclusion These are our picks for best 100 applications for Ubuntu in 2023 which you should try. Surely, there are other apps that you may feel should have made the list; it totally depends on the individual choice and its use. All the applications that are listed here are tested on Ubuntu 22.04 LTS and majority of them definitely works on older versions.
11,058
随着 Zorin 15 的发布,Zorin OS 变得更为强大
https://itsfoss.com/zorin-os-15-release/
2019-07-05T11:21:00
[ "Zorin" ]
https://linux.cn/article-11058-1.html
![](/data/attachment/album/201907/05/112128zmz2n2csi6h7y6s2.png) 长久以来 Zorin OS 一直在 [初学者适用的Linux发行版排行](https://itsfoss.com/best-linux-beginners/) 中占有一席之地。的确,它可能不是最受欢迎的,但是对于从 Windows 阵营转向 Linux 的用户而言,它一定是最好的一个发行版。 我还记得,在几年前,我的一位朋友一直坚持让我安装 [Zorin OS](https://zorinos.com/)。就我个人而言,当时我并不喜欢它的 UI 风格。但是,现如今 Zorin OS 15 发布了,这也让我有了更多的理由安装并将它作为我日常的操作系统。 不要担心,在这篇文章里,我会向你介绍你所需要了解的一切。 ### Zorin 15 中的新特性 让我们来看一下最新版本的 Zorin 有哪些主要的改变。Zorin 15 是基于 Ubuntu 18.04.2 的,因此带来了许多性能上的提升。除此之外,也有许多 UI(用户界面)的改进。 #### Zorin Connect ![Zorin Connect](/data/attachment/album/201907/05/112142axwz3mu8s38qax58.jpg) Zorin OS 15 最主要的一个亮点就是 —— Zorin Connect。如果你使用的是安卓设备,那你一定会喜欢这一功能。类似于 [PushBullet](https://www.pushbullet.com/)(LCTT 译注:PushBullet,子弹推送,一款跨平台推送工具), [Zorin Connect](https://play.google.com/store/apps/details?id=com.zorinos.zorin_connect&hl=en_IN) 会提升你的手机和桌面一体化的体验。 你可以在桌面上同步智能手机的通知,同时还可以回复它。甚至,你可以回复短信并查看对话。 总的来说,你可以体验到以下功能: * 在设备间分享文件或链接 * 将你的手机作为电脑的遥控器 * 使用手机控制电脑上媒体的播放,并且当有来电接入时自动停止播放 正如他们在[官方公告](https://zoringroup.com/blog/2019/06/05/zorin-os-15-is-here-faster-easier-more-connected/)中提到的, 数据的传输仅限于本地网络之间,并且不会有数据被上传到云端服务器。通过以下操作体验 Zorin Connect ,找到:Zorin menu (Zorin 菜单) > System Tools (系统工具) > Zorin Connect。 #### 新的桌面主题(包含夜间模式!) ![Zorin 夜间模式](/data/attachment/album/201907/05/112144rvnbnylf6ivq6vnn.jpg) 一提到 “夜间模式” 我就毫无抵抗力。对我而言,这是Zorin OS 15 自带的最好的功能。 当我启用了界面的深色模式时,我的眼睛感到如此舒适,你不想来试试么? 它不单单是一个深色的主题,而是 UI 更干净直观,并且带有恰到好处的新动画。你可以从 Zorin 内置的外观应用程序里找到所有的相关设置。 #### 自适应背景调整 & 深色浅色模式 你可以选择让桌面背景根据一天中每小时的环境亮度进行自动调整。此外,如果你想避免蓝光给眼睛带来伤害,你可以使用夜间模式。 #### 代办事项应用 ![Todo](/data/attachment/album/201907/05/112146q83fjlon5fb0fb73.jpg) 我一直希望支持这个功能,这样我就不必使用其他 Linux 客户端程序来添加任务。很高兴看到内置的应用程序集成并支持谷歌任务和 Todoist。 #### 还有更多么? 是的!其他主要的变化包括对 Flatpak 的支持,支持平板笔记本二合一电脑的触摸布局,DND 模式,以及一些重新设计的应用程序(设置、Libre Office),以此来给你更好的用户体验。 如果你想要了解所有更新和改动的详细信息,你可以查看[官方公告](https://zoringroup.com/blog/2019/06/05/zorin-os-15-is-here-faster-easier-more-connected/)。如果你已经是 Zorin 的用户,你应该已经注意到他们的网站也已经启用了一个全新的外观。 ### 下载 Zorin OS 15 **注释** : 今年的晚些时候将会推出从 Zorin OS 12 直升 15 版本而不需要重新安装的升级包。 提示一下,Zorin OS 有三个版本:旗舰版本、核心板和轻量版。 如果你想支持开发者和项目,同时解锁 Zorin OS 全部的功能,你可以花 39 美元购买旗舰版本。 如果你只是想要一些基本功能,核心版就可以了(你可以免费下载)。如果是这种情况,比如你有一台旧电脑,那么你可以使用轻量版。 * [下载 ZORIN OS 15](https://zorinos.com/download/) 你觉得 Zorin 15 怎么样? 我肯定会尝试一下,将 Zorin OS 作为我的主要操作系统 -(手动狗头)。你呢?你觉得最新的版本怎么样?欢迎在下面的评论中告诉我们。 --- via: <https://itsfoss.com/zorin-os-15-release/> 作者:[Ankush Das](https://itsfoss.com/author/ankush/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[qfzy1233](https://github.com/qfzy1233) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
404
Not Found
null
11,059
你应该选择 Ubuntu 还是 Fedora?
https://itsfoss.com/ubuntu-vs-fedora/
2019-07-05T12:15:05
[ "Ubuntu", "Fedora" ]
https://linux.cn/article-11059-1.html
> > 选择 Ubuntu 还是 Fedora?它们的区别是什么?哪一个更好?你应该使用哪一个?看看这篇对比 Ubuntu 和 Fedora 的文章吧。 > > > [Ubuntu](https://ubuntu.com/) 和 [Fedora](https://getfedora.org/) 都是最流行的 Linux 发行版之一,在两者之间做出选择实非易事。在这篇文章里,我会对比一下 Ubuntu 和 Fedora 的不同特点,帮助你进行决策。 请注意,这篇文章主要是从桌面版的角度进行对比的。Fedora 或者 Ubuntu 针对容器的特殊版本不会被考虑在内。 ### Ubuntu vs Fedora: 哪一个更好? ![Ubuntu Vs Fedora](/data/attachment/album/201907/05/121507px4cu84bwcpczcau.png) 不同 Linux 发行版之间的区别主要体现在以下几个方面: * 基础发行版(Debian、红帽、Arch,或者是从头做起) * 安装方式 * 支持的桌面环境 * 软件包管理、软件支持和更新 * 硬件支持 * 开发团队(由企业支持,还是由业余爱好者创建) * 发布周期 * 社区和线上支持 下面我们来看一下 Ubuntu 和 Fedora 之间的相似之处和不同之处。掌握了这些信息之后,也许就更容易在两者之间做出选择了。 #### 安装方式 Ubuntu 的 Ubiquity 安装器是最好用的安装器之一。我认为这是让 Ubuntu 如此流行的重要原因之一,因为在 2004 年 Ubuntu 刚刚诞生的时候,安装 Linux 还是一个很庞大的工程。 Ubuntu 安装器可以让你在大约 10 分钟左右完成安装。大多数情况下,它还可以识别出机器里安装的 Windows 系统,并且只需要几下点击就可以实现 Ubuntu 和 Windows 的双系统启动。 锦上添花的是,在安装 Ubuntu 的过程中你还可以进行系统更新,或者是安装第三方编译码器。 ![Ubuntu Installer](/data/attachment/album/201907/05/121510q9279e647677u67u.jpg) Fedora 使用的是 Anaconda 安装器,拥有简单易用的界面,同样简化了安装过程。 ![Fedora Installer | Image Credit Fedora Magazine](/data/attachment/album/201907/05/121511rlb7lyv0pplukpbz.png) Fodora 还提供了一个可以在 Windows 操作系统上下载并创建 Fedora live USB 的写入工具。不过我在大约两年前尝试使用它的时候并不成功,最后使用了一个常规的创建 live USB 的软件。 根据我的经验,安装 Ubuntu 要比安装 Fedora 容易一些。不过这并不是说安装 Fedora 有多困难,只是 Ubuntu 更简单而已。 #### 桌面环境 Ubuntu 和 Fedora 默认都使用 GNOME 桌面环境。 ![GNOME Desktop in Fedora](/data/attachment/album/201907/05/121514jvnjg7roosjio9qs.png) Fedora 使用的是原装的 GNOME 桌面,而 Ubuntu 则在此基础上做了个性化调整,让它看起来就像 Ubuntu 之前使用的 Unity 桌面环境。 ![GNOME desktop customized by Ubuntu](/data/attachment/album/201907/05/121515plxx872lrz38sqwq.jpg) 除了 GNOME,Ubuntu 和 Fedora 都提供了一些其它桌面环境的版本。 Ubuntu 有 Kubuntu、Xubuntu、Lubuntu 等版本,分别提供不同的桌面环境。虽然它们都是 Ubuntu 的官方版本,但是却不是由 Canonical 的 Ubuntu 团队直接开发的,而是由另外的团队开发。 Fedora 通过 [Fedora Spins](https://spins.fedoraproject.org/) 的方式提供了一些不同桌面环境的版本。和 Kubuntu、Lubuntu 等版本不同的是,这些版本并非由独立团队开发,而是由 Fedora 核心团队开发的。 #### 软件包管理和可用软件数量 Ubuntu 使用 APT 软件包管理器提供软件并进行管理(包括应用程序、库,以及其它所需编解码器),而 Fedora 使用 DNF 软件包管理器。 [Ubuntu 拥有庞大的软件仓库](https://itsfoss.com/ubuntu-repositories/),能够让你轻松安装数以千计的程序,包括 FOSS(LCTT 译注:Free and Open-Source Software 的缩写,自由开源软件)和非 FOSS 的软件。Fedora 则只专注于提供开源软件。虽然这一点在最近的版本里有所转变,但是 Fedora 的软件仓库在规模上仍然比 Ubuntu 的要逊色一些。 一些第三方软件开发者为 Linux 提供像 .exe 文件一样可以点击安装的软件包。在 Ubuntu 里这些软件包是 .deb 格式的,在 Fedora 里是 .rpm 格式的。 大多数软件供应商都为 Linux 用户提供 DEB 和 RPM 文件,但是我也经历过供应商只提供 DEB 文件的情况。比如说 SEO 工具 [Screaming Frog](https://www.screamingfrog.co.uk/seo-spider/#download) 就只提供 DEB 软件包。反过来,一个软件只有 RPM 格式但是没有 DEB 格式这种情况就极其罕见了。 #### 硬件支持 一般来说,Linux 在 WiFi 适配器和显卡的兼容性上容易出现问题,Ubuntu 和 Fedora 都受此影响。以 Nvidia 为例,它的 [开源驱动程序 Nouveau 经常会引发系统启动时假死机之类的问题](https://itsfoss.com/fix-ubuntu-freezing/)。 在 Ubuntu 上你可以轻松安装专有驱动程序作为补充。在很多情况下,这样可以获得对硬件更好的支持。 ![Installing proprietary driver is easier in Ubuntu](/data/attachment/album/201907/05/121516ot9itd8i8x3u7vit.png) Fedora 则坚持使用开源软件,所以在 Fedora 上安装专有驱动程序就比较困难了。 #### 线上支持和用户群 Ubuntu 和 Fedora 都通过社区论坛提供了很好的线上支持。Ubuntu 主要有两个论坛:[UbuntuForums](https://ubuntuforums.org/) 和 [Ask Ubuntu](https://askubuntu.com/)。Fedora 主要的论坛则是 [Ask Fedora](https://ask.fedoraproject.org/)。 就用户群体而言,Fedora 有着庞大的用户数量。不过 Ubuntu 更为流行,用户数量甚至更为庞大。 Ubuntu 的流行催生了很多专注于 Ubuntu 的网站和博客。所以相比 Fedora,你可以得到更多关于 Ubuntu 的故障排除指导和学习材料。 #### 发布周期 Fedora 每六个月发布一个新版本,每个版本有九个月的支持周期。也就是说,你必须在六个月到九个月之间进行一次系统升级。进行 Fedora 版本升级并不是一件困难的事情,但是需要良好的网络连接。并非所有人都喜欢每九个月进行一次 1.5 GB 的版本升级。 Ubuntu 有两种版本:常规发布版本和长期支持(LTS)发布版本。常规版本和 Fedora 比较类似,每隔六个月发布一次,有九个月的支持周期。 而长期支持发布版本则每两年发布一次,有五年的支持周期。常规发布版本探索新功能特性和新的软件版本,而长期支持发布版本则支持旧版本软件。对于不喜欢经常改变、青睐稳定性的人来说,这是一个很好的选择。 #### 强大的基础发行版 Ubuntu 是基于 [Debian](https://www.debian.org/) 发行版的。Debian 是最大的社区项目之一,并且也是 [自由软件](https://www.fsf.org/) 世界里最受尊敬的项目之一。 Fedora 则是红帽公司的一个社区项目。红帽公司是一个专注于 Linux 发行版的公司。Fedora 充当了一个“试验田”的角色(用技术术语来说叫做“上游”),用来在红帽企业级 Linux 发布新功能之前对这些新功能进行试验。 #### 在背后支持的企业 Ubuntu 和 Fedora 都有来自母公司的支持。Ubuntu 源自 [Canonical](https://canonical.com/) 公司,而 Fedora 源自 [红帽公司](https://www.redhat.com/en)(现在是 [IBM 的一部分](https://itsfoss.com/ibm-red-hat-acquisition/))。背后企业的支持非常重要,因为可以确保 Linux 发行版良好的维护。 有一些发行版是由一群独立的业余爱好者们共同创建的,但是在工作压力之下经常会结束。你也许见过一些还算比较流行的发行版项目仅仅是因为这个原因而终止了。很多这样的发行版由于开发者没有足够的业余时间可以投入到项目上而不得不终止,比如 [Antergos](https://itsfoss.com/antergos-linux-discontinued/) 和 Korora。 Ubuntu 和 Fedora 的背后都有基于 Linux 的企业的支持,这让它们比其它独立的发行版更胜一筹。 #### Ubuntu vs Fedora:服务端 到目前为止,我们在 Ubuntu 和 Fedora 之间的对比主要都集中在桌面端。不过如果不考虑一下服务端的话,对 Linux 的讨论就不能算是完整的。 ![Ubuntu Server](/data/attachment/album/201907/05/121517hiwlb6mzjll6l8dm.png) Ubuntu 不仅在桌面端很流行,在服务端也有很强的存在感。如果你能够在桌面端熟练使用 Ubuntu,那么也不会对 Ubuntu 服务器版本感到陌生。我就是从使用 Ubuntu 桌面端开始的,现在我的网站都运行在 Ubuntu 服务器上。 Fedora 同样有服务端版本,并且也有人在使用。但是大多数系统管理者不会喜欢一个每九个月就需要重启升级的服务器。 学习 Fedora 可以更好地帮助你使用红帽企业级 Linux(RHEL)。RHEL 是一个付费产品,你需要购买订阅才可以使用。如果你希望在服务器上运行一个和 Fedora 或者红帽类似的操作系统,我推荐使用 CentOS。[CentOS](https://centos.org/) 同样是红帽公司附属的一个社区项目,但是专注于服务端。 ### 结论 你可以看到,Ubuntu 和 Fedora 有很多相似之处。不过就可用软件数量、驱动安装和线上支持来说,Ubuntu 的确更有优势。**Ubuntu 也因此成为了一个更好的选择,尤其是对于没有经验的 Linux 新手而言。** 如果你想要熟悉红帽的话,Fedora 是一个很好的开始。如果你对 Linux 有一定经验,或者是只想要使用开源软件,Fedora 就是一个很棒的选择。 最终还是需要你自己来决定是使用 Fedora 还是 Ubuntu。我会建议为两个发行版分别创建一个 live USB,并且在虚拟机上体验一下。 你对于 Ubuntu vs Fedora 的看法是什么呢?你更喜欢哪一个发行版,为什么?在评论里分享你的看法吧。 --- via: <https://itsfoss.com/ubuntu-vs-fedora/> 作者:[Abhishek Prakash](https://itsfoss.com/author/abhishek/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[chen-ni](https://github.com/chen-ni) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![Warp Terminal](/assets/images/warp-terminal.webp) ![Warp Terminal](/assets/images/warp-terminal.webp) [Ubuntu](https://ubuntu.com/?ref=itsfoss.com) and [Fedora](https://getfedora.org/?ref=itsfoss.com) are one of the most popular Linux distributions out there. Making a decision to choose between using Ubuntu and Fedora is not an easy one. I’ll try to help you in making your decision by comparing various features of Ubuntu and Fedora. Do note that this comparison is primarily from the desktop point of view. I am not going to focus on the container-specific versions of Fedora or Ubuntu. ## Ubuntu vs Fedora: Which one is better? ![Ubuntu Vs Fedora](https://itsfoss.com/content/images/wordpress/2019/07/ubuntu-vs-fedora-800x450.png) Almost all Linux distributions differ from one another primarily on these points: - Base distribution (Debian, Red Hat, Arch or from scratch) - Installation - Supported desktop environments - Package management, software support and updates - Hardware support - Development team (backed by corporate or created by hobbyists) - Release cycle - Community and support Let’s see how similar or how different are Ubuntu and Fedora from each other. Once you know that, it should be perhaps easier for you to make a choice. ### Installation Ubuntu’s Ubiquity installer is one of the easiest installers out there. I believe that it played an important role in Ubuntu’s popularity because when Ubuntu was just created in 2004, installing Linux itself was considered a huge task. The Ubuntu installer allows you to install Ubuntu in around 10 minutes. In most cases, it can identify Windows installed on your system and allows you to dual boot Ubuntu and Windows in a matter of clicks. You can also install updates and third-party codecs while installing Ubuntu. That’s an added advantage. ![Installing Linux inside Windows using Oracle VirtualBox](https://itsfoss.com/content/images/wordpress/2018/03/install-linux-inside-windows-10-800x479.jpg) Fedora uses Anaconda installer. This too simplifies the installation process with an easy-to-use interface. However, I feel that Ubuntu’s installer is simpler. Especially considering that it could be troublesome to format/delete existing drives/partitions using Fedora’s installer. I tried to “Reclaim space” using Fedora’s installer, but it didn’t do the trick. It’s way simpler and easier with Ubuntu’s installer. ![Fedora Installer](https://itsfoss.com/content/images/wordpress/2019/07/fedora-installer-800x598.png) Fedora also provides a media writer tool for downloading and creating bootable USB drives with Fedora images. It could work with other ISOs, but it’s tested to work with Fedora images primarily. In my experience, installing Ubuntu is easier than installing Fedora overall. That doesn’t mean installing Fedora is a complex process. Just that Ubuntu is simpler. ### Desktop environments Both Ubuntu and Fedora use GNOME desktop environment by default. ![Gnome Desktop Fedora](https://itsfoss.com/content/images/wordpress/2019/07/gnome-desktop-fedora-800x450.png) While Fedora uses the stock GNOME desktop, Ubuntu has customized its look and presents like its previous Unity desktop. ![Ubuntu 18.04 GNOME application menu](https://itsfoss.com/content/images/wordpress/2019/03/applications_menu-800x450.jpg) Apart from GNOME, both Ubuntu and Fedora offer several other desktop variants. Ubuntu has Kubuntu, Xubuntu, Lubuntu etc., offering various desktop flavors. While they are the official flavor of Ubuntu, they are not directly developed by Ubuntu team from Canonical. The teams are separate. Fedora offers various desktop choices in the form of [Fedora Spins](https://spins.fedoraproject.org/?ref=itsfoss.com). Unlike Kubuntu, Lubuntu etc,. they are not created and maintained by a separate team. They are from the core Fedora team. ### Package management and software availability Ubuntu uses APT package manager to provide and manage software (applications, libraries and other required codes) while Fedora uses DNF package manager. [Ubuntu has vast software repositories](https://itsfoss.com/ubuntu-repositories/) allowing you to easily install thousands of programs, both FOSS and non-FOSS, easily. Fedora on the other hand focuses on providing only open-source software. However, you can enable [RPM Fusion repositories](https://docs.fedoraproject.org/en-US/quick-docs/setup_rpmfusion/?ref=itsfoss.com) for more software that Fedora doesn’t ship normally. Some third-party software developers also provide click-to-install, .exe like packages for Linux. In Ubuntu, these packages are in .deb format while Fedora supports .rpm packages. Most software vendors provide both DEB and RPM files for Linux users, but I have experienced that sometimes software vendor only provides a DEB file. On the other hand, it’s extremely rare that a software is available in RPM but not in DEB format. ### Hardware support Linux in general has its fair share of trouble with some Wi-Fi adapters and graphics cards. Both Ubuntu and Fedora are impacted from that. Take the example of Nvidia. It’s [open source Nouveau driver often results in troubles like system hanging at boot](https://itsfoss.com/fix-ubuntu-freezing/). Ubuntu provides an easy way of installing additional proprietary drivers. This results in better hardware support in many cases. ![software & updates additional drivers nvidia proprietary](https://itsfoss.com/content/images/wordpress/2019/02/software_updates_additional_drivers_nvidia-800x523.png) Fedora, on the other hand, sticks to open source software and thus installing proprietary drivers on Fedora becomes a difficult task. There’s no guarantee that the latest Nvidia driver will work when installed. You can refer to our guide on [installing Nvidia drivers on Fedora](https://itsfoss.com/install-nvidia-drivers-fedora/) if you want to try. ### Windows Subsystem for Linux: Ubuntu or Fedora? ![wsl linux](https://itsfoss.com/content/images/wordpress/2021/03/wsl-linux.png) No matter whether you like or hate Microsoft for what they do, [Windows Subystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/about?ref=itsfoss.com) is a big deal considering the user base of Windows. It lets Linux users access their favorite tools or still be able to use Linux even their systems (at workplace) run on Windows. Not just professionals, it gives you the flexibility to utilize Linux while having Windows as your daily driver for whatever reason you need it. Ubuntu is [officially supported](https://ubuntu.com/wsl?ref=itsfoss.com) and available on WSL 2 (the recent iteration at the time of updating this article). Fedora, isn’t officially available, but without proper Windows integration, you can choose to make it work using one of their [official guides](https://fedoramagazine.org/wsl-fedora-33/?ref=itsfoss.com). ### Support and userbase Both Ubuntu and Fedora provide support through community forums. Ubuntu has two main forums: [UbuntuForums](https://ubuntuforums.org/?ref=itsfoss.com) and [Ask Ubuntu](https://askubuntu.com/?ref=itsfoss.com). Fedora has one main forum [Ask Fedora](https://ask.fedoraproject.org/?ref=itsfoss.com). In terms of user base, Fedora has a large following. However, Ubuntu is more popular and has a larger following than Fedora. The popularity of Ubuntu has prompted a number of websites and blogs focused primarily on Ubuntu. This way, you get more troubleshooting tips and learning material on Ubuntu than Fedora. ### Release cycle A new Fedora version is released every six months and each Fedora release is supported for thirteen months only. Which means that between six to thirteen months, you must perform an upgrade. Upgrading Fedora version is simple, but it does require a good internet connection. Not everyone can be happy with about 1.5 GB of version upgrades every nine months. Of course, that may not be true for every upgrade, but if you have a metered data connection with low limits, you should know that. Ubuntu has two versions: regular release and the long-term support (LTS) release. Regular release is similar to Fedora. It’s released at the interval of six months and is supported for nine months. The LTS release comes at an interval of two years and is supported for five years. Regular releases bring new features, new software versions while the LTS release holds on to the older versions. This makes it a great choice for people who don’t like frequent changes, and prefer stability. ### Solid base distributions Ubuntu is based on [Debian](https://www.debian.org/?ref=itsfoss.com). Debian is one of the biggest community project and one of the most respected projects in the [free software](https://www.fsf.org/?ref=itsfoss.com) world. Fedora is a community project from Red Hat. Red Hat is an enterprise focused Linux distribution. Fedora works as a ‘testing ground’ ([upstream](https://en.wikipedia.org/wiki/Upstream_(software_development)?ref=itsfoss.com) in technical term) for new features before those features are included in Red Hat Enterprise Linux. ### Backed by enterprises Both Ubuntu and Fedora are backed by their parent corporations. Ubuntu is from [Canonical](https://canonical.com/?ref=itsfoss.com) while Fedora is from [Red Hat](https://www.redhat.com/en?ref=itsfoss.com) (now [part of IBM](https://itsfoss.com/ibm-red-hat-acquisition/)). Enterprise backing is important because it ensures that the Linux distribution is well-maintained. Hobbyists distributions created by a group of individuals often crumble under workload. You might have seen reasonably popular distribution projects being shutdown for this sole reason. [Antergos](https://itsfoss.com/antergos-linux-discontinued/), Korora are just some of the many such examples where distributions were discontinued because the developers couldn’t get enough free time to work on the project. The fact that both Ubuntu and Fedora are supported by a two Linux-based enterprises makes them a viable choice over other independent distributions. ### Ubuntu vs Fedora as server The comparison between Ubuntu and Fedora was primarily aimed at desktop users so far. But a discussion about Linux is not complete until you include servers. ![Ubuntu Server](https://itsfoss.com/content/images/wordpress/2019/07/ubuntu-server-800x232.png) Ubuntu is not only popular on desktop, it also has a good presence on the server side. If you are familiar with Ubuntu as a desktop, you might not feel uncomfortable with Ubuntu server edition. I started with Ubuntu desktop and now my websites are hosted on Linux servers running Ubuntu. Fedora too has a server edition and some people use it as well. But most sysadmins won’t prefer a server that has to be upgraded and rebooted every nine months. Knowing Fedora helps you in using Red Hat Enterprise Linux (RHEL). RHEL is a paid product, and you’ll have to purchase a subscription. However, if your job/work requires you to get familiar with RHEL, Fedora can be useful for you to experiment. If you want an operating system for running a server that is close to Fedora/Red Hat, you could also try CentOS Stream or any other [RHEL-based distributions](https://itsfoss.com/rhel-based-server-distributions/). ## Conclusion As you can see, both Ubuntu and Fedora are similar to each other on several points. Ubuntu does take lead when it comes to software availability, driver installation and online support. And *these are the points that make Ubuntu a better choice, specially for inexperienced Linux users.* If you want to get familiar with Red Hat or just want something different for a change, Fedora is a good starting point. If you have some experience with Linux or if you want to use only open-source software, Fedora is an excellent choice as well. In the end, it is really up to you to decide if you want to use Fedora or Ubuntu. I would suggest creating live USB of both distributions or try them out in a virtual machine if you’re not sure. If you are interested in distribution comparison, you may also want to check [Debian and Ubuntu comparison](https://itsfoss.com/debian-vs-ubuntu/). What’s your opinion on Ubuntu vs Fedora? Which distribution do you prefer and why? Do share your views in the comment section.
11,061
在 Linux 上为你的任务创建一个自定义的系统托盘指示器
https://fosspost.org/tutorials/custom-system-tray-icon-indicator-linux
2019-07-05T13:13:00
[ "系统托盘" ]
https://linux.cn/article-11061-1.html
系统托盘图标如今仍是一个很神奇的功能。只需要右击图标,然后选择想要的动作,你就可以大幅简化你的生活并且减少日常行为中的大量无用的点击。 一说到有用的系统托盘图标,我们很容易就想到 Skype、Dropbox 和 VLC: ![Create a Custom System Tray Indicator For Your Tasks on Linux](/data/attachment/album/201907/05/131332f9fgya2nzp74af72.png "Create a Custom System Tray Indicator For Your Tasks on Linux 12") 然而系统托盘图标实际上要更有用得多;你可以根据自己的需求创建自己的系统托盘图标。本指导将会教你通过简单的几个步骤来实现这一目的。 ### 前置条件 我们将要用 Python 来实现一个自定义的系统托盘指示器。Python 可能已经默安装在所有主流的 Linux 发行版中了,因此你只需要确定一下它已经被安装好了(此处使用版本为 2.7)。另外,我们还需要安装好 `gir1.2-appindicator3` 包。该库能够让我们很容易就能创建系统图标指示器。 在 Ubuntu/Mint/Debian 上安装: ``` sudo apt-get install gir1.2-appindicator3 ``` 在 Fedora 上安装: ``` sudo dnf install libappindicator-gtk3 ``` 对于其他发行版,只需要搜索包含 “appindicator” 的包就行了。 在 GNOME Shell 3.26 开始,系统托盘图标被删除了。你需要安装 [这个扩展](https://extensions.gnome.org/extension/1031/topicons/)(或者其他扩展)来为桌面启用该功能。否则你无法看到我们创建的指示器。 ### 基础代码 下面是该指示器的基础代码: ``` #!/usr/bin/python import os from gi.repository import Gtk as gtk, AppIndicator3 as appindicator def main(): indicator = appindicator.Indicator.new("customtray", "semi-starred-symbolic", appindicator.IndicatorCategory.APPLICATION_STATUS) indicator.set_status(appindicator.IndicatorStatus.ACTIVE) indicator.set_menu(menu()) gtk.main() def menu(): menu = gtk.Menu() command_one = gtk.MenuItem('My Notes') command_one.connect('activate', note) menu.append(command_one) exittray = gtk.MenuItem('Exit Tray') exittray.connect('activate', quit) menu.append(exittray) menu.show_all() return menu def note(_): os.system("gedit $HOME/Documents/notes.txt") def quit(_): gtk.main_quit() if __name__ == "__main__": main() ``` 我们待会会解释一下代码是怎么工作的。但是现在,让我们将该文本保存为 `tray.py`,然后使用 Python 运行之: ``` python tray.py ``` 我们会看到指示器运行起来了,如下图所示: ![Create a Custom System Tray Indicator For Your Tasks on Linux](/data/attachment/album/201907/05/131333vy6dr5rgzcdyrryv.png "Create a Custom System Tray Indicator For Your Tasks on Linux 14") 现在,让我们解释一下这个魔法的原理: * 前三行代码仅仅用来指明 Python 的路径并且导入需要的库。 * `def main()` :此为指示器的主函数。该函数的代码用来初始化并创建指示器。 * `indicator = appindicator.Indicator.new("customtray","semi-starred-symbolic",appindicator.IndicatorCategory.APPLICATION_STATUS)` :这里我们指明创建一个名为 `customtray` 的新指示器。这是指示器的唯一名称,这样系统就不会与其他运行中的指示器搞混了。同时我们使用名为 `semi-starred-symbolic` 的图标作为指示器的默认图标。你可以将之改成任何其他值;比如 `firefox` (如果你希望该指示器使用 FireFox 的图标),或任何其他你想用的图标名。最后与 `APPLICATION_STATUS` 相关的部分是指明指示器类别/范围的常规代码。 * `indicator.set_status(appindicator.IndicatorStatus.ACTIVE)`:这一行激活指示器。 * `indicator.set_menu(menu())`:这里说的是我们想使用 `menu()` 函数(我们会在后面定义) 来为我们的指示器创建菜单项。这很重要,可以让你右击指示器后看到一个可以实施行为的列表。 * `gtk.main()`:运行 GTK 主循环。 * 在 `menu()` 中我们定义了想要指示器提供的行为或项目。`command_one = gtk.MenuItem('My Notes')` 仅仅使用文本 “My notes” 来初始化第一个菜单项,接下来 `command_one.connect('activate',note)` 将菜单的 `activate` 信号与后面定义的 `note()` 函数相连接;换句话说,我们告诉我们的系统:“当该菜单项被点击,运行 `note()` 函数”。最后,`menu.append(command_one)` 将菜单项添加到列表中。 * `exittray` 相关的行是为了创建一个退出的菜单项,以便让你在想要的时候关闭指示器。 * `menu.show_all()` 以及 `return menu` 只是返回菜单项给指示器的常规代码。 * 在 `note(_)` 下面是点击 “My Notes” 菜单项时需要执行的代码。这里只是 `os.system("gedit $HOME/Documents/notes.txt")` 这一句话;`os.system` 函数允许你在 Python 中运行 shell 命令,因此这里我们写了一行命令来使用 `gedit` 打开家目录下 `Documents` 目录中名为 `notes.txt` 的文件。例如,这个可以称为你今后的日常笔记程序了! ### 添加你所需要的任务 你只需要修改代码中的两块地方: 1. 在 `menu()` 中为你想要的任务定义新的菜单项。 2. 创建一个新的函数让给该菜单项被点击时执行特定的行为。 所以,比如说你想要创建一个新菜单项,在点击后,会使用 VLC 播放硬盘中某个特定的视频/音频文件?要做到这一点,只需要在第 17 行处添加下面三行内容: ``` command_two = gtk.MenuItem('Play video/audio') command_two.connect('activate', play) menu.append(command_two) ``` 然后在第 30 行添加下面内容: ``` def play(_): os.system("vlc /home/<username>/Videos/somevideo.mp4") ``` 将/home//Videos/somevideo.mp4` 替换成你想要播放的视频/音频文件路径。现在保存该文件然后再次运行该指示器: ``` python tray.py ``` 你将会看到: ![Create a Custom System Tray Indicator For Your Tasks on Linux](/data/attachment/album/201907/05/131335jeza5mv5i1yumers.png "Create a Custom System Tray Indicator For Your Tasks on Linux 16") 而且当你点击新创建的菜单项时,VLC 会开始播放! 要创建其他项目/任务,只需要重复上面步骤即可。但是要小心,需要用其他命令来替换 `command_two`,比如 `command_three`,这样在变量之间才不会产生冲突。然后定义新函数,就像 `play(_)` 函数那样。 可能性是无穷的;比如我用这种方法来从网上获取数据(使用 urllib2 库)并显示出来。我也用它来在后台使用 `mpg123` 命令播放 mp3 文件,而且我还定义了另一个菜单项来 `killall mpg123` 以随时停止播放音频。比如 Steam 上的 CS:GO 退出很费时间(窗口并不会自动关闭),因此,作为一个变通的方法,我只是最小化窗口然后点击某个自建的菜单项,它会执行 `killall -9 csgo_linux64` 命令。 你可以使用这个指示器来做任何事情:升级系统包、运行其他脚本——字面上的任何事情。 ### 自动启动 我们希望系统托盘指示器能在系统启动后自动启动,而不用每次都手工运行。要做到这一点,只需要在自启动应用程序中添加下面命令即可(但是你需要将 `tray.py` 的路径替换成你自己的路径): ``` nohup python /home/<username>/tray.py & ``` 下次重启系统,指示器会在系统启动后自动开始工作了! ### 结论 你现在知道了如何为你想要的任务创建自己的系统托盘指示器了。根据每天需要运行的任务的性质和数量,此方法可以节省大量时间。有些人偏爱从命令行创建别名,但是这需要你每次都打开终端窗口或者需要有一个可用的下拉式终端仿真器,而这里,这个系统托盘指示器一直在工作,随时可用。 你以前用过这个方法来运行你的任务吗?很想听听你的想法。 --- via: <https://fosspost.org/tutorials/custom-system-tray-icon-indicator-linux> 作者:[M.Hanny Sabbagh](https://fosspost.org/author/mhsabbagh) 选题:[lujun9972](https://github.com/lujun9972) 译者:[lujun9972](https://github.com/lujun9972) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
301
Moved Permanently
null
11,063
替代 Trello 的 OpenProject 9 发布了
https://itsfoss.com/openproject-9-release/
2019-07-06T13:03:00
[ "项目管理", "OpenProject" ]
https://linux.cn/article-11063-1.html
![](/data/attachment/album/201907/06/130201r9g70u01uuvvvvu7.jpg) [OpenProject](https://www.openproject.org/) 是一个开源项目协作管理软件。它是 [Trello](https://trello.com/) 和 [Jira](https://www.atlassian.com/software/jira) 等专有方案的替代品。 如果个人使用,你可以免费使用它,并在你自己的服务器上进行设置(并托管它)。这样,你就可以控制数据。 当然,如果你是[企业云版的用户](https://www.openproject.org/pricing/),那么你可以使用高级功能和更优先的帮助。 OpenProject 9 的重点是新的面板视图,包列表视图和工作模板。 如果你对此不了解,可以尝试一下。但是,如果你是已有用户 —— 在迁移到 OpenProject 9 之前,你应该知道这些新功能。 ### OpenProject 9 有什么新功能? 以下是最新版 OpenProject 的一些主要更改。 #### Scrum 和敏捷面板 ![](/data/attachment/album/201907/06/130313eirn4mhqdn74q4dv.jpg) 对于企业云版,有了一个新的 [scrum](https://en.wikipedia.org/wiki/Scrum_(software_development)) 和[敏捷](https://en.wikipedia.org/wiki/Agile_software_development)面板视图。你还可以[看板风格](https://en.wikipedia.org/wiki/Kanban)方式展示你的工作,从而更轻松地支持你的敏捷和 scrum 团队。 新的面板视图使你可以轻松了解为该任务分配的人员并快速更新状态。你还有不同的面板视图选项,如基本面板、状态面板和版本面板。 #### 工作包模板 ![Work Package Template](/data/attachment/album/201907/06/130314s96umq9t8dmt666s.jpg) 你不必为每个独立的工作包从头开始创建所有内容。而是,你只需保留一个模板,这样你就可以在需要创建新工作包时使用它。这将节省大量时间。 #### 新的工作包列表视图 ![Work Package View](/data/attachment/album/201907/06/130317n8ggg5hc35tg227c.jpg) 在工作包列表中,有一个微小的新增功能,可让你查看特定工作的已分配人员的头像。 #### “我的”页面的可自定义工作包视图 “我的”页面显示你正在处理的内容(以及进度),它不应该一直那么呆板。因此,现在你可以自定义它,甚至可以添加甘特图来可视化你的工作。 ### 总结 有关迁移和安装的详细说明,请参阅[官方的公告帖](https://www.openproject.org/openproject-9-new-scrum-agile-board-view/),其中包含了必要的细节。 另外,我们很想知道你使用 OpenProject 9 的经历,请在下面的评论栏告诉我们!如果你使用其他一些项目管理软件,请随时向我们和其他 FOSS 读者推荐。 --- via: <https://itsfoss.com/openproject-9-release/> 作者:[Ankush Das](https://itsfoss.com/author/ankush/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
301
Moved Permanently
null
11,064
对 Python 开发者而言,IPython 仍然是 Jupyter Notebook 的核心
https://opensource.com/article/19/6/ipython-still-heart-jupyterlab
2019-07-06T13:17:50
[ "Jupyter" ]
https://linux.cn/article-11064-1.html
> > Jupyter 项目提供的魔法般的开发体验很大程度上得益于它的 IPython 基因。 > > > ![](/data/attachment/album/201907/06/131704z1lsfssamfxrrliq.jpg) 最近刚刚写过我为什么觉得觉得 Jupyter 项目(特别是 JupyterLab)提供了一种 [魔法般的 Python 开发体验](https://opensource.com/article/19/5/jupyterlab-python-developers-magic)。在研究这些不同项目之间的关联的时候,我回顾了一下 Jupyter 最初从 IPython 分支出来的这段历史。正如 Jupyter 项目的 [大拆分™ 声明](https://blog.jupyter.org/the-big-split-9d7b88a031a7) 所说: > > “如果你不明白 Jupyter 是什么,这么说吧,它拥有和 IPython 同样的代码,并且是由同一批人开发的,只不过取了一个新名字、安了一个新家。” > > > 下面这个注脚进一步说明了这一点: > > “我从声明中解读出来的信息是,‘Jupyter 和 IPython 非常相似,但是拥有多种语言’,这也可以很好地解释为什么这个项目的名字已经不再需要包含 Python,因为当时它已经支持多种语言了。” > > > 我明白 Jupyter Notebook 和 IPython 都是从同样的源代码里分支出来的,但是不太清楚 IPython 项目的现状。在大拆分™ 之后它是已经不再被需要了,还是在以另一种方式延续着? 后来我惊讶地发现,IPython 仍然不断在为 Python 使用者提供价值,它正是 Jupyter 体验的核心部分。下面是 Jupyter 常见问题页面的一段截取: > > **有什么语言是需要预装的吗?** > > > 是的,安装 Jupyter Notebook 会首先安装 IPython 内核。这样我们就可以在 notebook 上运行 Python 语言了。 > > > 现在我明白了,在 JupyterLab(以及 Jupyter Notebook)上编写 Python 程序仍然需要依赖 IPython 内核的持续开发。不仅如此,IPython 还充当了最为强大的默认内核的角色,根据 [这份文档](https://jupyter-client.readthedocs.io/en/latest/kernels.html),它是其它语言内核之间的枢纽,节省了很多开发时间和精力。 现在唯一的问题是,IPython 本身可以做什么呢? ### IPython 如今的作用 IPython 提供了一个强大的、交互性的 Python shell,以及 Jupyter 的内核。安装完成之后,我可以在任何命令行运行 `ipython` 本身,将它当作一个(比默认 Python shell 好太多的)Python shell 来使用: ``` $ ipython Python 3.7.3 (default, Mar 27 2019, 09:23:15) Type 'copyright', 'credits' or 'license' for more information IPython 7.4.0 -- An enhanced Interactive Python. Type '?' for help. In [1]: import numpy as np In [2]: example = np.array([5, 20, 3, 4, 0, 2, 12]) In [3]: average = np.average(example) In [4]: print(average) 6.571428571428571 ``` 这就让我们发现了一个更为重要的问题:是 IPython 让 JupyterLab 可以在项目中执行代码,并且支持了一系列被称为 *Magic* 的功能(感谢 Nicholas Reith 在我上一篇文章的评论里提到这点)。 ### IPython 让魔法成为现实 JupyterLab 和其它使用 IPython 的前端工具可以让你感觉像是在最喜欢的 IDE 或者是终端模拟器的环境下工作。我非常喜欢 [点文件](https://en.wikipedia.org/wiki/Hidden_file_and_hidden_directory#Unix_and_Unix-like_environments) 快捷键功能,Magic 也有类似点文件的特征。比如说,可以试一下 [%bookmark](https://ipython.readthedocs.io/en/stable/interactive/magics.html?highlight=magic#magic-bookmark) 这个命令。我把默认开发文件夹 `~/Develop` 关联到了一个可以在任何时候直接跳转的快捷方式上。 ![Screenshot of commands from JupyterLab](/data/attachment/album/201907/06/131754rryf8hnvjv08f832.png "Screenshot of commands from JupyterLab") `%bookmark`、`%cd`,以及我在前一篇文章里介绍过的 `!` 操作符,都是由 IPython 支持的。正如这篇 [文档](https://ipython.readthedocs.io/en/stable/interactive/magics.html) 所说: > > Jupyter 用户你们好:Magic 功能是 IPython 内核提供的专属功能。一个内核是否支持 Magic 功能是由该内核的开发者针对该内核所决定的。 > > > ### 写在最后 作为一个好奇的新手,我之前并不是特别确定 IPython 是否仍然和 Jupyter 生态还有任何联系。现在我对 IPython 的持续开发有了新的认识和,并且意识到它正是 JupyterLab 强大的用户体验的来源。这也是相当有才华的一批贡献者进行最前沿研究的成果,所以如果你在学术论文中使用到了 Jupyter 项目的话别忘了引用他们。为了方便引用,他们还提供了一个 [现成的引文](https://ipython.org/citing.html)。 如果你在考虑参与哪个开源项目的贡献的话,一定不要忘了 IPython 哦。记得看看 [最新发布说明](https://ipython.readthedocs.io/en/stable/whatsnew/index.html),在这里可以找到 Magic 功能的完整列表。 --- via: <https://opensource.com/article/19/6/ipython-still-heart-jupyterlab> 作者:[Matthew Broberg](https://opensource.com/users/mbbroberg/users/marcobravo) 选题:[lujun9972](https://github.com/lujun9972) 译者:[chen-ni](https://github.com/chen-ni) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
I recently wrote about how I find Jupyter projects, especially JupyterLab, to be a [magical Python development experience](https://opensource.com/article/19/5/jupyterlab-python-developers-magic). In researching how the various projects are related to each other, I recapped how Jupyter began as a fork from IPython. As Project Jupyter's [The Big Split™ announcement](https://blog.jupyter.org/the-big-split-9d7b88a031a7) explained: "If anyone has been confused by what Jupyter is[1], it's the exact same code that lived in IPython, developed by the same people, just in a new home under a new name." That [1] links to a footnote that further clarifies: "I saw 'Jupyter is like IPython, but language agnostic' immediately after the announcement, which is a great illustration of why the project needs to not have Python in the name anymore, since it was already language agnostic at the time." The fact that Jupyter Notebook and IPython forked from the same source code made sense to me, but I got lost in the current state of the IPython project. Was it no longer needed after The Big Split™ or is it living on in a different way? I was surprised to learn that IPython's significance continues to add value to Pythonistas, and that it is an essential part of the Jupyter experience. Here's a portion of the Jupyter FAQ: Are any languages pre-installed?Yes, installing the Jupyter Notebook will also install the IPython kernel. This allows working on notebooks using the Python programming language. I now understand that writing Python in JupyterLab (and Jupyter Notebook) relies on the continued development of IPython as its kernel. Not only that, IPython is the powerhouse default kernel, and it can act as a communication bus for other language kernels according to [the documentation](https://jupyter-client.readthedocs.io/en/latest/kernels.html), saving a lot of time and development effort. The question remains, what can I do with just IPython? ## What IPython does today IPython provides both a powerful, interactive Python shell and a Jupyter kernel. After installing it, I can run **ipython** from any command line on its own and use it as a (much prettier than the default) Python shell: ``` $ ipython Python 3.7.3 (default, Mar 27 2019, 09:23:15) Type 'copyright', 'credits' or 'license' for more information IPython 7.4.0 -- An enhanced Interactive Python. Type '?' for help. In [1]: import numpy as np In [2]: example = np.array([5, 20, 3, 4, 0, 2, 12]) In [3]: average = np.average(example) In [4]: print(average) 6.571428571428571 ``` That brings us to the more significant issue: IPython's functionality gives JupyterLab the ability to execute the code in every project, and it also provides support for a whole bunch of functionality that's playfully called *magic* (thank you, Nicholas Reith, for mentioning this in a comment on my previous article). ## Getting magical, thanks to IPython JupyterLab and other frontends using the IPython kernel can feel like your favorite IDE or terminal emulator environment. I'm a huge fan of how [dotfiles](https://en.wikipedia.org/wiki/Hidden_file_and_hidden_directory#Unix_and_Unix-like_environments) give me the power to use shortcuts, and magic has some dotfile-like behavior as well. For example, check out ** %bookmark**. I've mapped my default development folder, **~/Develop**, to a shortcut I can run at any time and hop right into it. ![Screenshot of commands from JupyterLab Screenshot of commands from JupyterLab](https://opensource.com/sites/default/files/uploads/jupyterlab-commands-ipython.png) The use of **%bookmark** and **%cd**, alongside the **!** operator (which I introduced in the previous article), are powered by IPython. As the [documentation](https://ipython.readthedocs.io/en/stable/interactive/magics.html) states: To Jupyter users: Magics are specific to and provided by the IPython kernel. Whether Magics are available on a kernel is a decision that is made by the kernel developer on a per-kernel basis. ## Wrapping up I, as a curious novice, was not quite sure if IPython remained relevant to the Jupyter ecosystem. I now have a new appreciation for the continuing development of IPython now that I realize it's the source of JupyterLab's powerful user experience. It's also a collection of talented contributors who are part of cutting edge research, so be sure to site them if you use Jupyter projects in your academic papers. They make it easy with this [ready-made citation entry](https://ipython.org/citing.html). Be sure to keep it in mind when you're thinking about open source projects to contribute to, and check out the [latest release notes](https://ipython.readthedocs.io/en/stable/whatsnew/index.html) for a full list of magical features. ## 1 Comment
11,066
如何在 Linux 中查找服务的端口号
https://www.ostechnix.com/how-to-find-the-port-number-of-a-service-in-linux/
2019-07-06T13:36:13
[ "端口" ]
https://linux.cn/article-11066-1.html
![Find The Port Number Of A Service In Linux OS](/data/attachment/album/201907/06/133619g0ncdadqaci0nebs.png) 由于某些原因,你可能经常需要查找端口名称和端口号。如果是这样,你很幸运。今天,在这个简短的教程中,我们将看到在 Linux 系统中最简单、最快捷的查找服务端口号的方法。可能有很多方法可以做到,但我目前只知道以下三种方法。请继续阅读。 ### 在 Linux 中查找服务的端口号 #### 方法1:使用 grep 命令 要使用 `grep` 命令在 Linux 中查找指定服务的默认端口号,只需运行: ``` $ grep <port> /etc/services ``` 例如,要查找 SSH 服务的默认端口,只需运行: ``` $ grep ssh /etc/services ``` 就这么简单。此命令应该适用于大多数 Linux 发行版。以下是我的 Arch Linux 测试机中的示例输出: ``` ssh 22/tcp ssh 22/udp ssh 22/sctp sshell 614/tcp sshell 614/udp netconf-ssh 830/tcp netconf-ssh 830/udp sdo-ssh 3897/tcp sdo-ssh 3897/udp netconf-ch-ssh 4334/tcp snmpssh 5161/tcp snmpssh-trap 5162/tcp tl1-ssh 6252/tcp tl1-ssh 6252/udp ssh-mgmt 17235/tcp ssh-mgmt 17235/udp ``` 正如你在上面的输出中所看到的,SSH 服务的默认端口号是 22。 让我们找到 Apache Web 服务器的端口号。为此,命令是: ``` $ grep http /etc/services # http://www.iana.org/assignments/port-numbers http 80/tcp www www-http # WorldWideWeb HTTP http 80/udp www www-http # HyperText Transfer Protocol http 80/sctp # HyperText Transfer Protocol https 443/tcp # http protocol over TLS/SSL https 443/udp # http protocol over TLS/SSL https 443/sctp # http protocol over TLS/SSL gss-http 488/tcp gss-http 488/udp webcache 8080/tcp http-alt # WWW caching service webcache 8080/udp http-alt # WWW caching service [...] ``` FTP 端口号是什么?这很简单! ``` $ grep ftp /etc/services ftp-data 20/tcp ftp-data 20/udp # 21 is registered to ftp, but also used by fsp ftp 21/tcp ftp 21/udp fsp fspd tftp 69/tcp [...] ``` #### 方法 2:使用 getent 命令 如你所见,上面的命令显示指定搜索词 “ssh”、“http” 和 “ftp” 的所有端口名称和数字。这意味着,你将获得与给定搜索词匹配的所有端口名称的相当长的输出。 但是,你可以使用 `getent` 命令精确输出结果,如下所示: ``` $ getent services ssh ssh 22/tcp $ getent services http http 80/tcp www www-http $ getent services ftp ftp 21/tcp ``` 如果你不知道端口名称,但是知道端口号,那么你只需将端口名称替换为数字: ``` $ getent services 80 http 80/tcp ``` 要显示所有端口名称和端口号,只需运行: ``` $ getent services ``` #### 方法 3:使用 Whatportis 程序 Whatportis 是一个简单的 Python 脚本,来用于查找端口名称和端口号。与上述命令不同,此程序以漂亮的表格形式输出。 确保已安装 pip 包管理器。如果没有,请参考以下链接。 * [如何使用 pip 管理 Python 包](https://www.ostechnix.com/manage-python-packages-using-pip/) 安装 pip 后,运行以下命令安装 Whatportis 程序。 ``` $ pip install whatportis ``` 现在,你可以找到与服务关联的端口,如下所示。 ``` $ whatportis ssh $ whatportis ftp $ whatportis http ``` 我的 CentOS 7 服务器的示例输出: ![](/data/attachment/album/201907/06/133620yv57vvj0qqvv3quz.png) *在 Linux 中查找服务的端口号* 如果你不知道服务的确切名称,请使用 `–like` 标志来显示相关结果。 ``` $ whatportis mysql --like ``` 上述命令帮助你查找与服务关联的端口。你还可以找到与端口号相关联的服务,如下所示。 ``` $ whatportis 993 ``` 你甚至可以以 JSON 格式显示结果。 ``` $ whatportis 993 --json ``` ![](/data/attachment/album/201907/06/133621hdxbewr4refgzbe5.png) 有关更多详细信息,请参阅 GitHub 仓库。 * [Whatportis GitHub 仓库](https://github.com/ncrocfer/whatportis) 就是这些了。你现在知道了如何使用三种简单方法在 Linux 中查找端口名称和端口号。如果你知道任何其他方法/命令,请在下面的评论栏告诉我。我会查看并更相应地更新本指南。 --- via: <https://www.ostechnix.com/how-to-find-the-port-number-of-a-service-in-linux/> 作者:[sk](https://www.ostechnix.com/author/sk/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
403
Forbidden
null
11,067
何时需要关注 Linux 的内存用量?
https://www.networkworld.com/article/3394603/when-to-be-concerned-about-memory-levels-on-linux.html
2019-07-06T17:39:37
[ "内存" ]
https://linux.cn/article-11067-1.html
> > Linux 上的内存管理很复杂。尽管使用率高但未必存在问题。你也应当关注一些其他的事情。 > > > ![](/data/attachment/album/201907/06/173913n6rjbxwj6bfrjxwx.jpg) 在 Linux 上用光内存通常并不意味着存在严重的问题。为什么?因为健康的 Linux 系统会在内存中缓存磁盘活动,基本上占用掉了未被使用的内存,这显然是一件好事情。 换句话说,它不让内存浪费掉。使用空闲的内存增加磁盘访问速度,并且不占用运行中应用程序的内存。你也能够想到,使用这种内存缓存比起直接访问硬盘驱动器(HDD)快上数百倍,也比明显快于直接访问固态硬盘驱动。内存占满或几乎占满通常意味着系统正在尽可能高效地运行当中 —— 并不是运行中遇到了问题。 ### 缓存如何工作 磁盘缓存简单地意味着系统充分利用未使用的资源(空闲内存)来加速磁盘读取与写入。应用程序不会失去任何东西,并且大多数时间里能够按需求获得更多的内存。此外,磁盘缓存不会导致应用程序转而使用交换分区。反而,用作磁盘缓存的内存空间当被需要时会立即归还,并且磁盘内容会被更新。 ### 主要和次要的页故障 Linux 系统通过分割物理内存来为进程分配空间,将分割成的块称为“页”,并且映射这些页到每个进程的虚拟内存上。不再会用到的页也许会从内存中移除,尽管相关的进程还在运行。当进程需要一个没有被映射或没在内存中页时,故障便会产生。所以,这个“<ruby> 故障 <rt> fault </rt></ruby>”并不意味着“<ruby> 错误 <rt> error </rt></ruby>”而是“<ruby> 不可用 <rt> unavailables </rt></ruby>”,并且故障在内存管理中扮演者一个重要的角色。 次要故障意味着在内存中的页未分配给请求的进程,或未在内存管理单元中标记为出现。主要故障意味着页没有保留在内存中。 如果你想切身感受一下次要页故障和主要页故障出现的频率,像这样试一下 `ps` 命令。注意我们要的是与页故障和产生它的命令相关的项。输出中省略了很多行。`MINFL` 显示出次要故障的数目,而 `MAJFL` 表示了主要故障的数目。 ``` $ ps -eo min_flt,maj_flt,cmd MINFL MAJFL CMD 230760 150 /usr/lib/systemd/systemd --switched-root --system --deserialize 18 0 0 [kthreadd] 0 0 [rcu_gp] 0 0 [rcu_par_gp] 0 0 [kworker/0:0H-kblockd] ... 166 20 gpg-agent --homedir /var/lib/fwupd/gnupg --use-standard-socket --daemon 525 1 /usr/libexec/gvfsd-trash --spawner :1.16 /org/gtk/gvfs/exec_spaw/0 4966 4 /usr/libexec/gnome-terminal-server 3617 0 bash 0 0 [kworker/1:0H-kblockd] 927 0 gdm-session-worker [pam/gdm-password] ``` 汇报单一进程,你可以尝试这样的命令(LCTT 译注:参数里面的 `1` 是要查看的进程的 PID): ``` $ ps -o min_flt,maj_flt 1 MINFL MAJFL 230064 150 ``` 你也可以添加其他的显示字段,例如进程所有者的 UID 和 GID。 ``` $ ps -o min_flt,maj_flt,cmd,args,uid,gid 1 MINFL MAJFL CMD COMMAND UID GID 230064 150 /usr/lib/systemd/systemd -- /usr/lib/systemd/systemd -- 0 0 ``` ### 多少才算满? 一种较好的方法来掌握内存究竟使用了多少是用 `free -m` 命令。`-m` 选项指定了数字的单位是 <ruby> MiB <rt> mebibyte </rt></ruby> 而不是字节。 ``` $ free -m total used free shared buff/cache available Mem: 3244 3069 35 49 140 667 Swap: 3535 0 3535 ``` 注意 `free`(未使用)的内存可能会不足,而 `available`(可用于启动新的应用)会显示更大的数量。这两者的区别值得我们去关注。<ruby> 可用 <rt> available </rt></ruby>意味着它可以在需要时恢复使用,而<ruby> 空闲 <rt> free </rt></ruby>意味着现在就能够使用。 ### 什么时候要担心 如果 Linux 系统上的性能表现良好 —— 应用程序响应度高,命令行没有显示出问题 —— 很可能系统状况良好。记住,一些应用也许会出于某种原因而变慢,但它不影响整个系统。 过多的硬故障也许表明确实存在问题,但要将其与观察到的性能相比较。 一个好的方法是当可用内存接近 0 或者“<ruby> 用作交换 <rt> swap used </rt></ruby>”项显著增长或波动时开始担心。如果“可用”项占总内存可用量的百分比合理,那么就无需担心,就像下面的例子那样: ``` $ free -m total used free shared buff/cache available Mem: 3244 3069 35 49 140 667 Swap: 3535 0 3535 ``` ### Linux 性能很复杂 抛开这些不说,Linux 系统上的内存可能会变满,并且性能可能会降低。当系统出现问题时不要仅将单一的内存使用报告作为指标。 Linux 系统的内存管理很复杂,因为它采取的措施需要确保系统资源得到最好的利用。不要受到一开始内存占满的欺骗,使你认为系统存在问题,但实际上并没有。 --- via: <https://www.networkworld.com/article/3394603/when-to-be-concerned-about-memory-levels-on-linux.html> 作者:[Sandra Henry-Stocker](https://www.networkworld.com/author/Sandra-Henry_Stocker/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[LuuMing](https://github.com/LuuMing) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
301
Moved Permanently
null
11,068
什么?!Mozilla 被提名英国“互联网恶棍”奖
https://itsfoss.com/mozilla-internet-villain/
2019-07-07T10:39:00
[ "Mozilla", "DoH" ]
https://linux.cn/article-11068-1.html
Mozilla Firefox 是目前最流行的浏览器之一。很多用户喜欢它胜过 Chrome 就是因为它鼓励隐私保护,并且可以通过一些选项设置让你的互联网活动尽可能地私密。 不过最近推出的功能之一 —— 仍然处于测试阶段的 [DoH (DNS-over-HTTPS)](https://en.wikipedia.org/wiki/DNS_over_HTTPS) 功能却受到了英国互联网服务提供商行业协会的负面评价。 英国<ruby> 互联网服务提供商行业协会 <rt> Internet Services Providers Association </rt></ruby>(ISPA)决定将 Mozilla 列入 2019 年“互联网恶棍”奖的最终入围者名单。该奖项将在 ISPA 于 7 月 11 日在伦敦举行的颁奖典礼上进行颁发。 ![](/data/attachment/album/201907/07/103915xb8uulstexef6ixj.jpg) ### 为什么说 “Mozilla” 是 “互联网恶棍”? ISPA 在他们的声明中表示,Mozilla 因为支持了 DoH(DNS-over-HTTPS)而被视为“互联网恶棍”。 > > [@mozilla](https://twitter.com/mozilla?ref_src=twsrc%5Etfw) 被提名为 [#ISPA](https://twitter.com/hashtag/ISPAs?src=hash&ref_src=twsrc%5Etfw) 的 [#互联网恶棍](https://twitter.com/hashtag/InternetVillain?src=hash&ref_src=twsrc%5Etfw) 是因为他们试图推行 DNS-over-HTTPS 以绕开英国的内容过滤系统和家长监护模式,破坏了英国 [#互联网](https://twitter.com/hashtag/internet?src=hash&ref_src=twsrc%5Etfw) 安全准则。 <https://t.co/d9NaiaJYnk> [pic.twitter.com/WeZhLq2uvi](https://t.co/WeZhLq2uvi) > > > — 英国互联网提供商行业协会 (ISPAUK) (@ISPAUK) [2019 年 7 月 4 日](https://twitter.com/ISPAUK/status/1146725374455373824?ref_src=twsrc%5Etfw) > > > ![](/data/attachment/album/201907/07/103959qeetlpk88trrt32n.jpg) 和 Mozilla 一同被列入最终入围者名单的还有欧盟《版权法第 13 条》和美国总统特朗普。ISPA 在他们的声明里是这样解释的: **Mozilla**:因为试图推行 DNS-over-HTTPS 以绕开英国的内容过滤系统和家长监护模式,破坏了英国互联网安全准则。 **欧盟《版权法第 13 条》**:因为要求各平台使用“内容识别技术”,威胁到了线上言论自由。 **美国总统特朗普**:因为在试图保护其国家安全的过程中,为复杂的全球通信供应链带来了巨大的不确定性。 ### 什么是 DNS-over-HTTPS? 你可以将 DoH 理解为,域名解析服务(DNS)的请求通过 HTTPS 连接加密传输。 传统意义上的 DNS 请求是不会被加密的,因此你的 DNS 提供商或者是互联网服务提供商(ISP)可以监视或者是控制你的浏览行为。如果没有 DoH,你很容易被 DNS 提供商强制拦截和进行内容过滤,并且你的互联网服务提供商也同样可以做到。 然而 DoH 颠覆了这一点,可以让你得到一个私密的浏览体验。 你可以研究一下 [Mozilla 是如何开展和 Cloudflare 的合作的](https://blog.nightly.mozilla.org/2018/06/01/improving-dns-privacy-in-firefox/),并且可以自己配置一下 DoH(如果需要的话)。 ### DoH 有用吗? 既有用又没有用。 当然了,从事情的一方面来看,DoH 可以帮助用户绕过 DNS 或者互联网服务提供商强制的内容过滤系统。如果说 DoH 有助于满足我们避开互联网审查的需求,那么它是一件好事情。 不过从事情的另一方面来看,如果你是一位家长,而你的孩子在 Mozilla Firefox 上使用了 DoH 的话,你就无法 [设置内容过滤器](https://itsfoss.com/how-to-block-porn-by-content-filtering-on-ubuntu/) 了。这取决于 [防火墙配置](https://itsfoss.com/set-up-firewall-gufw/) 的好坏。 DoH 可能会成为一些人绕过家长监护的手段,这可能不是一件好事。 如果我这样的说法有问题,你可以在下面的评论区纠正我。 并且,使用 DoH 就意味着你没办法使用本地 host 文件了(如果你正用它作为广告拦截或者是其它用途的话)。 ### 总结 你是如何看待 DoH 的呢?它足够好吗? 你又是如何看待 ISPA 的决定的呢?你觉得他们这样的声明是不是在鼓励互联网审查和政府对网民的监控呢? 我个人觉得这个提名决定非常可笑。即使 DoH 并不是所有人都需要的那个终极功能,能够有一种保护个人隐私的选择也总不是件坏事。 在下面的评论区里发表你的看法吧。最后我想引用这么一句话: > > 在谎言遍地的时代,说真话是一种革命行为。(LCTT 译注:引自乔治奥威尔) > > > --- via: <https://itsfoss.com/mozilla-internet-villain/> 作者:[Ankush Das](https://itsfoss.com/author/ankush/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[chen-ni](https://github.com/chen-ni) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
Mozilla Firefox is one of the most popular browsers available out there. A lot of users prefer it over Chrome just because it encourages privacy protection and features options to keep your Internet activity as private as possible. But, one of the recently proposed features – ** DoH (DNS-over-HTTPS)** which is still in the testing phase didn’t receive a good response from the UK’s ISPs trade association. So, the ISPA (Internet Services Providers Association) of UK decided to [nominate](https://www.ispa.org.uk/ispa-announces-finalists-for-2019-internet-heroes-and-villains-trump-and-mozilla-lead-the-way-as-villain-nominees/) Mozilla as one of the “Internet Villains” among the nominees for 2019. This is for an award ceremony to be held on 11th July in London by the ISP trade association of the UK. Update – The nomination has been withdrawn Mozilla, being included in the list of Internet Villain nominees surely gained a lot of attention. A week later – ISPA realized that it sent the wrong message to the Internet users with their original decision. So, they decided to [withdraw Mozilla from the list of nominees of Internet Villains category](https://www.ispa.org.uk/ispa-withdraws-mozilla-internet-villain-nomination-and-category/). ![Mozilla Internet Villain](https://itsfoss.com/content/images/wordpress/2019/07/mozilla-internet-villain-800x450.jpg) ## Why “Mozilla” is the “Internet Villain” here? In their announcement, the ISPA mentioned that Mozilla is one of the Internet Villains for supporting **DoH** (DNS-over-HTTPS). Along with Mozilla, Article 13 Copyright Directive and President Donald Trump also appear in the list. Here’s how ISPA explained in their announcement: *Mozilla** – for their proposed approach to introduce DNS-over-HTTPS in such a way as to bypass UK filtering obligations and parental controls, undermining internet safety standards in the UK*. *Article** 13 Copyright Directive** – for threatening freedom of expression online by requiring ‘content recognition technologies’ across platforms* *President Donald Trump** – for causing a huge amount of uncertainty across the complex, global telecommunications supply chain in the course of trying to protect national security* ## What is DNS-over-HTTPS? DoH basically means that your DNS requests will be encrypted over an HTTPS connection. Traditionally, the DNS requests are unencrypted and your DNS provider or the ISP can monitor/control your browsing activity. Without DoH, you can easily enforce blocking/content filtering through your DNS provider or the ISP can do that when they want. However, DoH completely takes that out of the equation and hence, you get a private browsing experience. You can explore[ how Mozilla implements this partnering with Cloudflare](https://blog.nightly.mozilla.org/2018/06/01/improving-dns-privacy-in-firefox/) and set it up for yourself if you want. ## Is DoH helpful? Yes and no. Of course, on one side of the coin, it lets user bypass any content filters enforced by the DNS or the ISPs. So, it is a good thing that we want to put a stop to Internet censorship and DoH helps us with that. But, on the other side, if you are a parent, you can no longer [set content filters](https://itsfoss.com/how-to-block-porn-by-content-filtering-on-ubuntu/) if your kid utilizes DoH on Mozilla Firefox. It depends on how good/bad the [firewall is configured](https://itsfoss.com/set-up-firewall-gufw/). But potentially DoH is a solution for some to bypass parental controls, which could be a bad thing. Correct me if I’m wrong here – in the comments below. Also, using DoH means that you can no longer use the local host file (in case you are using it for ad blocking or something else) ## Wrapping Up What do you think about DoH in general? Is it good enough? And, what’s your take on ISPA’s decision? Do you think that they are encouraging Internet censorship and government monitoring on netizens with this kind of announcement? Personally, I find it hilarious. Even if DoH isn’t the ultimate feature that everyone wants, it is always good to have an option to protect your privacy in some way.
11,069
如何使用 Tig 浏览 Git 日志
https://opensource.com/article/19/6/what-tig
2019-07-07T11:19:18
[ "tig", "git" ]
/article-11069-1.html
> > Tig 可不仅仅是 Git 的文本界面。以下是它如何增强你的日常工作流程。 > > > ![](/data/attachment/album/201907/07/111847v1zx3qk5qqhklyjp.png) 如果你使用 Git 作为你的版本控制系统,你可能已经让自己接受了 Git 是一个复杂的野兽的事实。它是一个很棒的工具,但浏览 Git 仓库可能很麻烦。因此像 [Tig](https://jonas.github.io/tig/) 这样的工具出现了。 来自 [Tig 手册页](http://manpages.ubuntu.com/manpages/bionic/man1/tig.1.html): > > Tig 是 `git`(1) 的基于 ncurses 的文本界面。它主要用作 Git 仓库浏览器,但也有助于在块级别暂存提交更改,并作为各种 Git 命令的输出分页器。 > > > 这基本上意味着 Tig 提供了一个可以在终端中运行的基于文本的用户界面。Tig 可以让你轻松浏览你的 Git 日志,但它可以做的远不止让你从最后的提交跳到前一个提交。 ![Tig screenshot](/data/attachment/album/201907/07/111922w78yfrcezh09gi18.jpg "Tig screenshot") 这篇快速入门的 Tig 中的许多例子都是直接从其出色的手册页中拿出来的。我强烈建议你阅读它以了解更多信息。 ### 安装 Tig * Fedora 和 RHEL: `sudo dnf install tig` * Ubuntu 和 Debian: `sudo apt install tig` * MacOS: `:brew install tig` 有关更多方式,请参阅官方[安装说明](https://jonas.github.io/tig/INSTALL.html)。 ### 浏览当前分支中的提交 如果要浏览分支中的最新提交,请输入: ``` tig ``` 就是这样。这个三字符命令将启动一个浏览器,你可以在其中浏览当前分支中的提交。你可以将其视为 `git log` 的封装器。 要浏览这些输出,可以使用向上和向下箭头键从一个提交移动到另一个提交。按回车键将会垂直分割窗口,右侧包含所选提交的内容。你可以继续在左侧的提交历史记录中上下浏览,你的更改将显示在右侧。使用 `k` 和 `j` 可以逐行上下浏览,`-` 和空格键可以在右侧上下翻页。使用 `q` 退出右侧窗格。 搜索 `tig` 输出也很简单。使用 `/` (向前)或 `?` (向后)在左右窗格中搜索。 ![Searching Tig](/data/attachment/album/201907/07/111926fdajcz52gczdb8bs.png "Searching Tig") 这些就足以让你浏览你的提交信息了。这里有很多的键绑定,但单击 `h` 将显示“帮助”菜单,你可以在其中发现其导航和命令选项。你还可以使用 `/` 和 `?` 来搜索“帮助”菜单。使用 `q` 退出帮助。 ![Tig Help](/data/attachment/album/201907/07/111928z34e4cwe5gi5e8e5.png "Tig Help") ### 浏览单个文件的修改 由于 Tig 是 `git log` 的封装器,它可以方便地接受可以传递给 `git log` 的相同参数。例如,要浏览单个文件的提交历史记录,请输入: ``` tig README.md ``` 将其与被封装的 Git 命令的输出进行比较,以便更清楚地了解 Tig 如何增强输出。 ``` git log README.md ``` 要在原始 Git 输出中包含补丁,你可以添加 `-p` 选项: ``` git log -p README.md ``` 如果要将提交范围缩小到特定日期范围,请尝试以下操作: ``` tig --after="2017-01-01" --before="2018-05-16" -- README.md ``` 再一次,你可以将其与原始的 Git 版本进行比较: ``` git log --after="2017-01-01" --before="2018-05-16" -- README.md ``` ### 浏览谁更改了文件 有时你想知道谁对文件进行了更改以及原因。命令: ``` tig blame README.md ``` 器本质上是 `git blame` 的封装。正如你所期望的那样,它允许你查看谁是编辑指定行的最后一人,它还允许你查看到引入该行的提交。这有点像 vim 的 `vim-fugitive` 插件提供的 `:Gblame` 命令。 ### 浏览你的暂存区 如果你像我一样,你可能会在你的暂存区做了许多修改。你很容易忘记它们。你可以通过以下方式查看暂存处中的最新项目: ``` git stash show -p stash@{0} ``` 你可以通过以下方式找到第二个最新项目: ``` git stash show -p stash@{1} ``` 以此类推。如果你在需要它们时调用这些命令,那么你会有比我更清晰的记忆。 与上面的 Git 命令一样,Tig 可以通过简单的调用轻松增强你的 Git 输出: ``` tig stash ``` 尝试在有暂存的仓库中执行此命令。你将能够浏览*并搜索*你的暂存项,快速浏览你的那些修改。 ### 浏览你的引用 Git ref 是指你提交的东西的哈希值。这包括文件和分支。使用 `tig refs` 命令可以浏览所有的 ref 并深入查看特定提交。 ``` tig refs ``` 完成后,使用 `q` 回到前面的菜单。 ### 浏览 git 状态 如果要查看哪些文件已被暂存,哪些文件未被跟踪,请使用 `tig status`,它是 `git status` 的封装。 ![Tig status](/data/attachment/album/201907/07/111934kc99omloqorykps7.png "Tig status") ### 浏览 git grep 你可以使用 `grep` 命令在文本文件中搜索表达式。命令 `tig grep` 允许你浏览 `git grep` 的输出。例如: ``` tig grep -i foo lib/Bar ``` 它会让你浏览 `lib/Bar` 目录中以大小写敏感的方式搜索 `foo` 的输出。 ### 通过标准输入管道输出给 Tig 如果要将提交 ID 列表传递给 Tig,那么必须使用 `--stdin` 标志,以便 `tig show` 从标准输入读取。否则,`tig show` 会在没有输入的情况下启动(出现空白屏幕)。 ``` git rev-list --author=olaf HEAD | tig show --stdin ``` ### 添加自定义绑定 你可以使用 [rc](https://en.wikipedia.org/wiki/Run_commands) 文件自定义 Tig。以下是如何根据自己的喜好添加一些有用的自定义键绑定的示例。 在主目录中创建一个名为 `.tigrc` 的文件。在你喜欢的编辑器中打开 `~/.tigrc` 并添加: ``` # 应用选定的暂存内容 bind stash a !?git stash apply %(stash) # 丢弃选定的暂存内容 bind stash x !?git stash drop %(stash) ``` 如上所述,运行 `tig stash` 以浏览你的暂存。但是,通过这些绑定,你可以按 `a` 将暂存中的项目应用到仓库,并按 `x` 从暂存中删除项目。请记住,你要在浏览暂存*列表*时,才能执行这些命令。如果你正在浏览暂存*项*,请输入 `q` 退出该视图,然后按 `a` 或 `x` 以获得所需效果。 有关更多信息,你可以阅读有关 [Tig 键绑定](https://github.com/jonas/tig/wiki/Bindings)。 ### 总结 我希望这有助于演示 Tig 如何增强你的日常工作流程。Tig 可以做更强大的事情(比如暂存代码行),但这超出了这篇介绍性文章的范围。这里有足够的让你置身于危险的信息,但还有更多值得探索的地方。 --- via: <https://opensource.com/article/19/6/what-tig> 作者:[Olaf Alders](https://opensource.com/users/oalders/users/mbbroberg/users/marcobravo) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
null
HTTPSConnectionPool(host='opensource.com', port=443): Read timed out. (read timeout=10)
null
11,072
在 Fedora 上搭建 Jupyter 和数据科学环境
https://fedoramagazine.org/jupyter-and-data-science-in-fedora/
2019-07-08T13:03:19
[ "Jupyter" ]
https://linux.cn/article-11072-1.html
![](/data/attachment/album/201907/08/130323myvdvjpgyv8ytdyl.jpg) 在过去,神谕和魔法师被认为拥有发现奥秘的力量,国王和统治者们会借助他们预测未来,或者至少是听取一些建议。如今我们生活在一个痴迷于将一切事情量化的社会里,这份工作就交给数据科学家了。 数据科学家通过使用统计模型、数值分析,以及统计学之外的高级算法,结合数据库里已经存在的数据,去发掘、推断和预测尚不存在的数据(有时是关于未来的数据)。这就是为什么我们要做这么多的预测分析和规划分析。 下面是一些可以借助数据科学家回答的问题: 1. 哪些学生有旷课倾向?每个人旷课的原因分别是什么? 2. 哪栋房子的售价比合理价格要高或者低?一栋房子的合理价格是多少? 3. 如何将我们的客户按照潜在的特质进行分组? 4. 这个孩子的早熟可能会在未来引发什么问题? 5. 我们的呼叫中心在明天早上 11 点 43 分会接收到多少次呼叫? 6. 我们的银行是否应该向这位客户发放贷款? 请注意,这些问题的答案是在任何数据库里都查询不到的,因为它们尚不存在,需要被计算出来才行。这就是我们数据科学家从事的工作。 在这篇文章中你会学习如何将 Fedora 系统打造成数据科学家的开发环境和生产系统。其中大多数基本软件都有 RPM 软件包,但是最先进的组件目前只能通过 Python 的 `pip` 工具安装。 ### Jupyter IDE 大多数现代数据科学家使用 Python 工作。他们工作中很重要的一部分是 <ruby> 探索性数据分析 <rt> Exploratory Data Analysis </rt> <rt> </rt></ruby>(EDA)。EDA 是一种手动进行的、交互性的过程,包括提取数据、探索数据特征、寻找相关性、通过绘制图形进行数据可视化并理解数据的分布特征,以及实现原型预测模型。 Jupyter 是能够完美胜任该工作的一个 web 应用。Jupyter 使用的 Notebook 文件支持富文本,包括渲染精美的数学公式(得益于 [mathjax](http://mathjax.org))、代码块和代码输出(包括图形输出)。 Notebook 文件的后缀是 `.ipynb`,意思是“交互式 Python Notebook”。 #### 搭建并运行 Jupyter 首先,[使用 sudo](https://fedoramagazine.org/howto-use-sudo/) 安装 Jupyter 核心软件包: ``` $ sudo dnf install python3-notebook mathjax sscg ``` 你或许需要安装数据科学家常用的一些附加可选模块: ``` $ sudo dnf install python3-seaborn python3-lxml python3-basemap python3-scikit-image python3-scikit-learn python3-sympy python3-dask+dataframe python3-nltk ``` 设置一个用来登录 Notebook 的 web 界面的密码,从而避免使用冗长的令牌。你可以在终端里任何一个位置运行下面的命令: ``` $ mkdir -p $HOME/.jupyter $ jupyter notebook password ``` 然后输入你的密码,这时会自动创建 `$HOME/.jupyter/jupyter_notebook_config.json` 这个文件,包含了你的密码的加密后版本。 接下来,通过使用 SSLby 为 Jupyter 的 web 服务器生成一个自签名的 HTTPS 证书: ``` $ cd $HOME/.jupyter; sscg ``` 配置 Jupyter 的最后一步是编辑 `$HOME/.jupyter/jupyter_notebook_config.json` 这个文件。按照下面的模版编辑该文件: ``` { "NotebookApp": { "password": "sha1:abf58...87b", "ip": "*", "allow_origin": "*", "allow_remote_access": true, "open_browser": false, "websocket_compression_options": {}, "certfile": "/home/aviram/.jupyter/service.pem", "keyfile": "/home/aviram/.jupyter/service-key.pem", "notebook_dir": "/home/aviram/Notebooks" } } ``` `/home/aviram/` 应该替换为你的文件夹。`sha1:abf58...87b` 这个部分在你创建完密码之后就已经自动生成了。`service.pem` 和 `service-key.pem` 是 `sscg` 生成的和加密相关的文件。 接下来创建一个用来存放 Notebook 文件的文件夹,应该和上面配置里 `notebook_dir` 一致: ``` $ mkdir $HOME/Notebooks ``` 你已经完成了配置。现在可以在系统里的任何一个地方通过以下命令启动 Jupyter Notebook: ``` $ jupyter notebook ``` 或者是将下面这行代码添加到 `$HOME/.bashrc` 文件,创建一个叫做 `jn` 的快捷命令: ``` alias jn='jupyter notebook' ``` 运行 `jn` 命令之后,你可以通过网络内部的任何一个浏览器访问 `<https://your-fedora-host.com:8888>` (LCTT 译注:请将域名替换为服务器的域名),就可以看到 Jupyter 的用户界面了,需要使用前面设置的密码登录。你可以尝试键入一些 Python 代码和标记文本,看起来会像下面这样: ![Jupyter with a simple notebook](/data/attachment/album/201907/08/130327dd9us52t235twd7t.png) 除了 IPython 环境,安装过程还会生成一个由 `terminado` 提供的基于 web 的 Unix 终端。有人觉得这很实用,也有人觉得这样不是很安全。你可以在配置文件里禁用这个功能。 ### JupyterLab:下一代 Jupyter JupyterLab 是下一代的 Jupyter,拥有更好的用户界面和对工作空间更强的操控性。在写这篇文章的时候 JupyterLab 还没有可用的 RPM 软件包,但是你可以使用 `pip` 轻松完成安装: ``` $ pip3 install jupyterlab --user $ jupyter serverextension enable --py jupyterlab ``` 然后运行 `jupiter notebook` 命令或者 `jn` 快捷命令。访问 `<http://your-linux-host.com:8888/`lab`>` (LCTT 译注:将域名替换为服务器的域名)就可以使用 JupyterLab 了。 ### 数据科学家使用的工具 在下面这一节里,你将会了解到数据科学家使用的一些工具及其安装方法。除非另作说明,这些工具应该已经有 Fedora 软件包版本,并且已经作为前面组件所需要的软件包而被安装了。 #### Numpy Numpy 是一个针对 C 语言优化过的高级库,用来处理大型的内存数据集。它支持高级多维矩阵及其运算,并且包含了 `log()`、`exp()`、三角函数等数学函数。 #### Pandas 在我看来,正是 Pandas 成就了 Python 作为数据科学首选平台的地位。Pandas 构建在 Numpy 之上,可以让数据准备和数据呈现工作变得简单很多。你可以把它想象成一个没有用户界面的电子表格程序,但是能够处理的数据集要大得多。Pandas 支持从 SQL 数据库或者 CSV 等格式的文件中提取数据、按列或者按行进行操作、数据筛选,以及通过 Matplotlib 实现数据可视化的一部分功能。 #### Matplotlib Matplotlib 是一个用来绘制 2D 和 3D 数据图像的库,在图象注解、标签和叠加层方面都提供了相当不错的支持。 ![matplotlib pair of graphics showing a cost function searching its optimal value through a gradient descent algorithm](/data/attachment/album/201907/08/130339q2nirlp2214e8lre.png) #### Seaborn Seaborn 构建在 Matplotlib 之上,它的绘图功能经过了优化,更加适合数据的统计学研究,比如说可以自动显示所绘制数据的近似回归线或者正态分布曲线。 ![Linear regression visualised with SeaBorn](/data/attachment/album/201907/08/130342erliee2dlr26ee8m.png) #### StatsModels [StatsModels](https://www.statsmodels.org/) 为统计学和经济计量学的数据分析问题(例如线形回归和逻辑回归)提供算法支持,同时提供经典的 [时间序列算法](https://www.statsmodels.org/stable/examples/index.html#stats) 家族 ARIMA。 ![Normalized number of passengers across time \(blue\) and ARIMA-predicted number of passengers \(red\)](/data/attachment/album/201907/08/130345fqs4uch81r8fq5h5.png) #### Scikit-learn 作为机器学习生态系统的核心部件,[Scikit](https://scikit-learn.org/stable/) 为不同类型的问题提供预测算法,包括 [回归问题](https://scikit-learn.org/stable/supervised_learning.html#supervised-learning)(算法包括 Elasticnet、Gradient Boosting、随机森林等等)、[分类问题](https://scikit-learn.org/stable/supervised_learning.html#supervised-learning) 和聚类问题(算法包括 K-means 和 DBSCAN 等等),并且拥有设计精良的 API。Scikit 还定义了一些专门的 Python 类,用来支持数据操作的高级技巧,比如将数据集拆分为训练集和测试集、降维算法、数据准备管道流程等等。 #### XGBoost XGBoost 是目前可以使用的最先进的回归器和分类器。它并不是 Scikit-learn 的一部分,但是却遵循了 Scikit 的 API。[XGBoost](https://xgboost.ai) 并没有针对 Fedora 的软件包,但可以使用 `pip` 安装。[使用英伟达显卡可以提升 XGBoost 算法的性能](https://xgboost.readthedocs.io/en/latest/gpu/index.html),但是这并不能通过 `pip` 软件包来实现。如果你希望使用这个功能,可以针对 CUDA (LCTT 译注:英伟达开发的并行计算平台)自己进行编译。使用下面这个命令安装 XGBoost: ``` $ pip3 install xgboost --user ``` #### Imbalanced Learn [Imbalanced-learn](https://imbalanced-learn.readthedocs.io) 是一个解决数据欠采样和过采样问题的工具。比如在反欺诈问题中,欺诈数据相对于正常数据来说数量非常小,这个时候就需要对欺诈数据进行数据增强,从而让预测器能够更好地适应数据集。使用 `pip` 安装: ``` $ pip3 install imblearn --user ``` #### NLTK [Natural Language toolkit](https://www.nltk.org)(简称 NLTK)是一个处理人类语言数据的工具,举例来说,它可以被用来开发一个聊天机器人。 #### SHAP 机器学习算法拥有强大的预测能力,但并不能够很好地解释为什么做出这样或那样的预测。[SHAP](https://github.com/slundberg/shap) 可以通过分析训练后的模型来解决这个问题。 ![Where SHAP fits into the data analysis process](/data/attachment/album/201907/08/130348gpufkf0kar3y33z5.png) 使用 `pip` 安装: ``` $ pip3 install shap --user ``` #### Keras [Keras](https://keras.io) 是一个深度学习和神经网络模型的库,使用 `pip` 安装: ``` $ sudo dnf install python3-h5py $ pip3 install keras --user ``` #### TensorFlow [TensorFlow](https://www.tensorflow.org) 是一个非常流行的神经网络模型搭建工具,使用 `pip` 安装: ``` $ pip3 install tensorflow --user ``` --- Photo courtesy of [FolsomNatural](https://www.flickr.com/photos/87249144@N08/) on [Flickr](https://www.flickr.com/photos/87249144@N08/45871861611/) (CC BY-SA 2.0). --- via: <https://fedoramagazine.org/jupyter-and-data-science-in-fedora/> 作者:[Avi Alkalay](https://fedoramagazine.org/author/aviram/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[chen-ni](https://github.com/chen-ni) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
In the past, kings and leaders used oracles and magicians to help them predict the future — or at least get some good advice due to their supposed power to perceive hidden information. Nowadays, we live in a society obsessed with quantifying everything. So we have data scientists to do this job. Data scientists use statistical models, numerical techniques and advanced algorithms that didn’t come from statistical disciplines, along with the data that exist on databases, to find, to infer, to predict data that doesn’t exist yet. Sometimes this data is about the future. That is why we do a lot of predictive analytics and prescriptive analytics. Here are some questions to which data scientists help find answers: - Who are the students with high propensity to abandon the class? For each one, what are the reasons for leaving? - Which house has a price above or below the fair price? What is the fair price for a certain house? - What are the hidden groups that my clients classify themselves? - Which future problems this premature child will develop? - How many calls will I get in my call center tomorrow 11:43 AM? - My bank should or should not lend money to this customer? Note how the answer to all these question is not sitting in any database waiting to be queried. These are all data that still doesn’t exist and has to be calculated. That is part of the job we data scientists do. Throughout this article you’ll learn how to prepare a Fedora system as a Data Scientist’s development environment and also a production system. Most of the basic software is RPM-packaged, but the most advanced parts can only be installed, nowadays, with Python’s *pip* tool. ## Jupyter — the IDE Most modern data scientists use Python. And an important part of their work is EDA (exploratory data analysis). EDA is a manual and interactive process that retrieves data, explores its features, searches for correlations, and uses plotted graphics to visualize and understand how data is shaped and prototypes predictive models. Jupyter is a web application perfect for this task. Jupyter works with Notebooks, documents that mix rich text including beautifully rendered math formulas (thanks to [mathjax](http://mathjax.org)), blocks of code and code output, including graphics. Notebook files have extension *.ipynb*, which means Interactive Python Notebook. ### Setting up and running Jupyter First, install essential packages for Jupyter ([using ](https://fedoramagazine.org/howto-use-sudo/)* sudo*): $ sudo dnf install python3-notebook mathjax sscg You might want to install additional and optional Python modules commonly used by data scientists: $ sudo dnf install python3-seaborn python3-lxml python3-basemap python3-scikit-image python3-scikit-learn python3-sympy python3-dask+dataframe python3-nltk Set a password to log into Notebook web interface and avoid those long tokens. Run the following command anywhere on your terminal: $ mkdir -p $HOME/.jupyter $ jupyter notebook password Now, type a password for yourself. This will create the file *$HOME/.jupyter/jupyter_notebook_config.json* with your encrypted password. Next, prepare for SSLby generating a self-signed HTTPS certificate for Jupyter’s web server: $ cd $HOME/.jupyter; sscg Finish configuring Jupyter by editing your *$HOME/.jupyter/jupyter_notebook_config.json* file. Make it look like this: { "NotebookApp": { "password": "sha1:abf58...87b", "ip": "*", "allow_origin": "*", "allow_remote_access": true, "open_browser": false, "websocket_compression_options": {}, "certfile": "/home/aviram/.jupyter/service.pem", "keyfile": "/home/aviram/.jupyter/service-key.pem", "notebook_dir": "/home/aviram/Notebooks" } } The parts in red must be changed to match your folders. Parts in blue were already there after you created your password. Parts in green are the crypto-related files generated by *sscg*. Create a folder for your notebook files, as configured in the *notebook_dir* setting above: $ mkdir $HOME/Notebooks Now you are all set. Just run Jupyter Notebook from anywhere on your system by typing: $ jupyter notebook Or add this line to your *$HOME/.bashrc* file to create a shortcut command called *jn*: alias jn='jupyter notebook' After running the command *jn*, access *https://your-fedora-host.com:8888* from any browser on the network to see the Jupyter user interface. You’ll need to use the password you set up earlier. Start typing some Python code and markup text. This is how it looks: ![](https://avi.alkalay.net/articlefiles/2018/07/jupyter-fedora.png) In addition to the IPython environment, you’ll also get a web-based Unix terminal provided by *terminado*. Some people might find this useful, while others find this insecure. You can disable this feature in the config file. ## JupyterLab — the next generation of Jupyter JupyterLab is the next generation of Jupyter, with a better interface and more control over your workspace. It’s currently not RPM-packaged for Fedora at the time of writing, but you can use *pip* to get it installed easily: $ pip3 install jupyterlab --user $ jupyter serverextension enable --py jupyterlab Then run your regular *jupiter notebook* command or *jn* alias. JupyterLab will be accessible from *http://your-linux-host.com:8888/ lab*. ## Tools used by data scientists In this section you can get to know some of these tools, and how to install them. Unless noted otherwise, the module is already packaged for Fedora and was installed as prerequisites for previous components. **Numpy** *Numpy* is an advanced and C-optimized math library designed to work with large in-memory datasets. It provides advanced multidimensional matrix support and operations, including math functions as log(), exp(), trigonometry etc. ### Pandas In this author’s opinion, Python is THE platform for data science mostly because of Pandas. Built on top of numpy, Pandas makes easy the work of preparing and displaying data. You can think of it as a no-UI spreadsheet, but ready to work with much larger datasets. Pandas helps with data retrieval from a SQL database, CSV or other types of files, columns and rows manipulation, data filtering and, to some extent, data visualization with matplotlib. ### Matplotlib Matplotlib is a library to plot 2D and 3D data. It has great support for notations in graphics, labels and overlays ![](https://fedoramagazine.org/wp-content/uploads/2019/06/gradient-descent-cost-function-optimization.png) ### Seaborn Built on top of matplotlib, Seaborn’s graphics are optimized for a more statistical comprehension of data. It automatically displays regression lines or Gauss curve approximations of plotted data. ![](https://seaborn.pydata.org/_images/regression_marginals.png) [StatsModels](https://www.statsmodels.org/) StatsModels provides algorithms for statistical and econometrics data analysis such as linear and logistic regressions. Statsmodel is also home for the classical family of [time series algorithms](https://www.statsmodels.org/stable/examples/index.html#stats) known as ARIMA. ![](https://fedoramagazine.org/wp-content/uploads/2019/06/time-series.png) ### Scikit-learn The central piece of the machine-learning ecosystem, [scikit](https://scikit-learn.org/stable/) provides predictor algorithms for [regression](https://scikit-learn.org/stable/supervised_learning.html#supervised-learning) (Elasticnet, Gradient Boosting, Random Forest etc) and [classification](https://scikit-learn.org/stable/supervised_learning.html#supervised-learning) and clustering (K-means, DBSCAN etc). It features a very well designed API. Scikit also has classes for advanced data manipulation, dataset split into train and test parts, dimensionality reduction and data pipeline preparation. ### XGBoost XGBoost is the most advanced regressor and classifier used nowadays. It’s not part of scikit-learn, but it adheres to scikit’s API. [XGBoost](https://xgboost.ai) is not packaged for Fedora and should be installed with pip. [XGBoost can be accelerated with your nVidia GPU](https://xgboost.readthedocs.io/en/latest/gpu/index.html), but not through its *pip* package. You can get this if you compile it yourself against CUDA. Get it with: $ pip3 install xgboost --user ### Imbalanced Learn [imbalanced-learn](https://imbalanced-learn.readthedocs.io) provides ways for under-sampling and over-sampling data. It is useful in fraud detection scenarios where known fraud data is very small when compared to non-fraud data. In these cases data augmentation is needed for the known fraud data, to make it more relevant to train predictors. Install it with *pip*: $ pip3 install imblearn --user ### NLTK The [Natural Language toolkit](https://www.nltk.org), or NLTK, helps you work with human language data for the purpose of building chatbots (just to cite an example). ### SHAP Machine learning algorithms are very good on predicting, but aren’t good at explaining why they made a prediction. [SHAP](https://github.com/slundberg/shap) solves that, by analyzing trained models. ![](https://raw.githubusercontent.com/slundberg/shap/master/docs/artwork/shap_diagram.png) Install it with *pip*: $ pip3 install shap --user [Keras](https://keras.io) Keras is a library for deep learning and neural networks. Install it with *pip*: $ sudo dnf install python3-h5py $ pip3 install keras --user [TensorFlow](https://www.tensorflow.org) TensorFlow is a popular neural networks builder. Install it with *pip*: $ pip3 install tensorflow --user *Photo courtesy of FolsomNatural on Flickr (CC BY-SA 2.0).* ## Raul Giucich Hi Avil, thanks for your article. I’m starting in data science and this kind of reference is very useful. I found a typo in keras section, in dnf sentence, the command must be “install” an l is missing. Thanks again. Best regards ## Paul W. Frields @Raul: Thanks, this is fixed. ## Ankur Sinha "FranciscoD" I think we should probably be suggesting people use virtual environments when installing stuff using pip, but that’s another blog post (or quick-doc)? https://docs.python.org/3/library/venv.html ## Jason Alternatively, conda can manage a lot of the data sciency stuff, including environments. https://www.anaconda.com/distribution/ ## M. "Loffi" I’d love to see a post about that. ## Avi Alkalay Virtual environments are useful in development scenarios where multiple projects happening in a certain machine have conflicting requirements, like different versions of same Python module. Virtual environments (in the Python sense) is very unnatural in production environments. It is a better practice to reach same objectives using methods that are closer to production environments, as multiple Docker images, one for each project or requirement set. This technique comes from the DevOps world and it’s called Shift Left, because it anticipates (shift left) to the developer’s environment a step of the delivery pipeline that would need to happen anyway. Docker, containers and shift left are the way to go in my opinion, while virtualenv is a Python-specific hack. ## Avi Alkalay Here are some packages and modules that I forgot to add in the original article: LEAFLET Interactive mapping framework that uses Google Maps and other backends to render its maps. Install it with: pip3 install leaflet –user CARTOPY Plot data on top of high resolution open source maps. Cartopy provides raster and vector maps of the world (but no street maps as Google Maps). Install it with: sudo dnf install python3-cartopy.x86_64 PLOTLY Visualisation framework which is more advanced that Matplotlib. Plotly supports animations and user interactivity. Plotly is part of a family of tools which also includes Dash, a Python BI framework. Install it with: dnf install python3-retrying.noarch pip3 install plotly –user ## Mehdi Love the article. Gives good insight to machine learning packages in 10 minutes. Thanks Avi. ## Kiril Why not use conda for python package management? ## drakkai People interested in the Jupyter may also be interested in https://colab.research.google.com/ ## Avi Alkalay One more addition related to web scraping, or the technique of extracting structured data from web pages. BEAUTIFULSOUP The most common library for HTML parsing and data extraction. Install it with: $ sudo dnf install python3-beautifulsoup4 LXML Similar to BeautifulSoup but goes lower in the XML. Get it: $ dnf install python3-lxml SCRAPY A more advanced framework which supports multiple languages and the shell command line. Get it with: $ sudo dnf install python3-scrapy SELENIUM If you are scrapping more dynamic and AJAX-constructed web content, Scrapy, and BeautifulSoup won’t work. Enter Selenium which uses your installed browser (Chromium, Firefox and their headless versions) to load the page and run its JavaScript code before scrapping (with Scrapy and BeautifulSoup). Get it: $ sudo dnf install python3-selenium Here is an advanced article that discusses advanced scraping techniques: https://www.codementor.io/blog/python-web-scraping-63l2v9sf2q ## Musashi This is a great article! I personally work a lot on natural language processing, and recently I’ve been working with a wonderful library called spaCy. Also, for what it’s worth, I’m a fan of using anaconda as a package/environment manager. ## Avi Alkalay For those looking into Conda/Anaconda, I want to recall that Conda is a Python distribution, by the way a not very stable one. And I think there is no good reason to use a Python distribution (Conda) on top of the best Python distribution (Fedora) which is fully integrated with the underlying OS (also Fedora). Besides, I had a bad time with Conda packages. They were unstable and outdated when I had to use it, for exemple TensorFlow. If something you need is not RPM-packaged from Fedora, use pip3 to get it. It’s the most natural way to work with Python. ## Andreas T My experience with Anaconda is quite the opposite to the Avi’s comment. Using conda-forge, packages are up to date (e.g. tensorflow) and stable. This is based on use in an academic research lab. Collaborating in a team with users that run different unix versions and windows, running Anaconda provides the same base for all and makes code sharing easy. ## Michael I switched to Fedora (from Ubuntu) just before SciPy2019. Everything here used Jupyter notebooks as the standard way of sharing and teachine data science. Fedora has been brilliant. I think I would still suggest people use Anaconda to work with Jupyter on Fedora, rather than trying ot have it run natively on Fedora. But that is not remotely a criticism of Fedora – it’s just that the very large majority of the people who use Jupyter use Anaconda to manage scientific python environments (including use of Jupyter). Michael ## Elliott S There’s no need to install explicitly; it’s a dependency of already. Also, s/Numpy/NumPy/g. ## Matthew Fallon Just wanted to drop in one more important extension that people may need or want for map visualization, the mapview and other widgets extension that allows for map visualization. WIDGETS NB EXTENSION: run: $pip install widgetsnbextension With whatever command arguments or versions you need for pip or install using the jupyter notebook commands for extensions: $jupyter nbextension install –py widgetsnbextension $jupyter nbextension enable –py widgetsnbextension with the –user flag or another flag for each just like with pip. This will give you access to widgets such as MapView which will interface with other data visualization software, one of which I was recently turned on to was arcgis which allows for maps with complex data visuals overlaid on it and uses MapView for all of it. ARCGIS: Install with: $pip install arcgis or again with: $jupyter nbextension install –py arcgis $jupyter nbextension enable –py arcgis With corresponding flags again, this second mode allows for modules to be controlled and turned on and off through jupyter. Just wanted to offer these because they will not be installed out of the box with the way presented here, this is sort of the very manual non-automated way of installing it and you will need to put each of these pieces on your install as one is dependent on the other. Or, as mentioned in other comments, it may be preffered to install through something like conda to make sure everything is installed by default. ## r44e54 How changing language to Polish? I’m talking about frontend language not for language similar Ruby or Perl
11,073
Undo 发布用于 Linux 调试的 Live Recorder 5.0
https://www.networkworld.com/article/3405584/undo-releases-live-recorder-5-0-for-linux-debugging.html
2019-07-08T13:35:23
[ "调试" ]
https://linux.cn/article-11073-1.html
> > 随着 Undo 发布 Live Recorder 5.0,这使得在多进程系统上的调试变得更加轻松。 > > > ![](/data/attachment/album/201907/08/133450i18fp2p011bs5pu6.jpg) 随着 Undo 发布 Live Recorder 5.0,Linux 调试迈出了一大步。该产品于上个月发布,这使得在多进程系统上的调试变得更加轻松。它基于<ruby> 飞行记录仪技术 <rt> flight recorder technology </rt></ruby>,它更加深入进程之中,以深入了解每个进程的情况。这包括内存、线程、程序流,服务调用等。为了实现这一目标,Live Recorder 5.0 的记录、重放和调试功能都得到了增强,能够: * 记录进程更改共享内存变量的确切顺序。甚至可以针对特定变量并在任何进程中跳转到最后修改该变量的一行。 * 通过随机化线程执行来暴露潜在缺陷,以帮助揭示竞态、崩溃和其他多线程缺陷。 * 记录并重放单个 Kubernetes 和 Docker 容器的执行,以帮助在微服务环境中更快地解决缺陷。 Undo Live Recorder 使工程团队能够记录和重放任何软件程序的执行,而无论软件多么复杂。并且可以诊断和修复测试或生产中问题的根本原因。 根据你的许可证,Live Recorder 可以在命令行中使用 `live-record` 命令,但有点类似于 `strace`,但它不会打印系统调用和信号,而是创建一个“Undo 录制”。然后你可以调试录制中捕获的失败(远比分析核心转储高效!)。这些录制也可以与其他工作人员共享,并可以使用可逆调试器进行重放,以进一步调查崩溃原因或其他问题。 Undo 引擎支持以下 Linux 发行版: * Red Hat Enterprise Linux 6.8、6.9、6.10、7.4、7.5、7.6 和 8.0 * Fedora 28、29 和 30 * SuSE Linux Enterprise Server 12.3、12.4 和 15 * Ubuntu 16.04 LTS、18.04 LTS、18.10 和 19.04 Undo 是一家快速发展的,有风险投资支持的技术初创公司,它的总部位于旧金山和英国剑桥。他们称 Live Recorder 可以 100% 确定导致任何软件故障的因素 —— 即使在最复杂的软件环境中也是如此。 在 [Facebook](https://www.facebook.com/NetworkWorld/) 和 [LinkedIn](https://www.linkedin.com/company/network-world) 上加入 Network World 社区,评论你想说的话题。 --- via: <https://www.networkworld.com/article/3405584/undo-releases-live-recorder-5-0-for-linux-debugging.html> 作者:[Sandra Henry-Stocker](https://www.networkworld.com/author/Sandra-Henry_Stocker/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
404
Not Found
null
11,075
深入学习 Linux 内核模块
https://www.networkworld.com/article/3391362/looking-into-linux-modules.html
2019-07-08T16:29:07
[ "模块", "内核" ]
https://linux.cn/article-11075-1.html
> > lsmod 命令能够告诉你当前系统上加载了哪些内核模块,以及关于使用它们的一些有趣的细节。 > > > ![Rob Oo \(CC BY 2.0\)](/data/attachment/album/201907/08/162919unen090np50pi8i5.jpg) ### 什么是 Linux 内核模块? 内核模块是可以根据需要加载到内核中或从内核中卸载的代码块,因此无需重启就可以扩展内核的功能。事实上,除非用户使用类似 `lsmod` 这样的命令来查询模块信息,否则用户不太可能知道内核发生的任何变化。 需要知道的重要一点是,在你的 Linux 系统上总会有*很多*可用的模块,并且如果你可以深入其中了解到很多细节。 `lsmod` 的主要用途之一是在系统不能正常工作时检查模块。然而,大多数情况下,模块会根据需要加载的,而且用户不需要知道它们如何运作。 ### 显示内核模块 显示内核模块最简单的方法是使用 `lsmod` 命令。虽然这个命令包含了很多细节,但输出却是非常用户友好。 ``` $ lsmod Module Size Used by snd_hda_codec_realtek 114688 1 snd_hda_codec_generic 77824 1 snd_hda_codec_realtek ledtrig_audio 16384 2 snd_hda_codec_generic,snd_hda_codec_realtek snd_hda_codec_hdmi 53248 1 snd_hda_intel 40960 2 snd_hda_codec 131072 4 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel ,snd_hda_codec_realtek snd_hda_core 86016 5 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel ,snd_hda_codec,snd_hda_codec_realtek snd_hwdep 20480 1 snd_hda_codec snd_pcm 102400 4 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda _core snd_seq_midi 20480 0 snd_seq_midi_event 16384 1 snd_seq_midi dcdbas 20480 0 snd_rawmidi 36864 1 snd_seq_midi snd_seq 69632 2 snd_seq_midi,snd_seq_midi_event coretemp 20480 0 snd_seq_device 16384 3 snd_seq,snd_seq_midi,snd_rawmidi snd_timer 36864 2 snd_seq,snd_pcm kvm_intel 241664 0 kvm 626688 1 kvm_intel radeon 1454080 10 irqbypass 16384 1 kvm joydev 24576 0 input_leds 16384 0 ttm 102400 1 radeon drm_kms_helper 180224 1 radeon drm 475136 13 drm_kms_helper,radeon,ttm snd 81920 15 snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda _codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd _hda_codec_realtek,snd_timer,snd_pcm,snd_rawmidi i2c_algo_bit 16384 1 radeon fb_sys_fops 16384 1 drm_kms_helper syscopyarea 16384 1 drm_kms_helper serio_raw 20480 0 sysfillrect 16384 1 drm_kms_helper sysimgblt 16384 1 drm_kms_helper soundcore 16384 1 snd mac_hid 16384 0 sch_fq_codel 20480 2 parport_pc 40960 0 ppdev 24576 0 lp 20480 0 parport 53248 3 parport_pc,lp,ppdev ip_tables 28672 0 x_tables 40960 1 ip_tables autofs4 45056 2 raid10 57344 0 raid456 155648 0 async_raid6_recov 24576 1 raid456 async_memcpy 20480 2 raid456,async_raid6_recov async_pq 24576 2 raid456,async_raid6_recov async_xor 20480 3 async_pq,raid456,async_raid6_recov async_tx 20480 5 async_pq,async_memcpy,async_xor,raid456,async_raid6_re cov xor 24576 1 async_xor raid6_pq 114688 3 async_pq,raid456,async_raid6_recov libcrc32c 16384 1 raid456 raid1 45056 0 raid0 24576 0 multipath 20480 0 linear 20480 0 hid_generic 16384 0 psmouse 151552 0 i2c_i801 32768 0 pata_acpi 16384 0 lpc_ich 24576 0 usbhid 53248 0 hid 126976 2 usbhid,hid_generic e1000e 245760 0 floppy 81920 0 ``` 在上面的输出中: * `Module` 显示每个模块的名称 * `Size` 显示每个模块的大小(并不是它们占的内存大小) * `Used by` 显示每个模块被使用的次数和使用它们的模块 显然,这里有*很多*模块。加载的模块数量取决于你的系统和版本以及正在运行的内容。我们可以这样计数: ``` $ lsmod | wc -l 67 ``` 要查看系统中可用的模块数(不止运行当中的),试试这个命令: ``` $ modprobe -c | wc -l 41272 ``` ### 与内核模块相关的其他命令 Linux 提供了几条用于罗列、加载及卸载、测试,以及检查模块状态的命令。 * `depmod` —— 生成 `modules.dep` 和映射文件 * `insmod` —— 一个往 Linux 内核插入模块的程序 * `lsmod` —— 显示 Linux 内核中模块状态 * `modinfo` —— 显示 Linux 内核模块信息 * `modprobe` —— 添加或移除 Linux 内核模块 * `rmmod` —— 一个从 Linux 内核移除模块的程序 ### 显示内置的内核模块 正如前文所说,`lsmod` 命令是显示内核模块最方便的命令。然而,也有其他方式可以显示它们。`modules.builtin` 文件中列出了所有构建在内核中的模块,在 `modprobe` 命令尝试添加文件中的模块时会使用它。注意,以下命令中的 `$(uname -r)` 提供了内核版本的名称。 ``` $ more /lib/modules/$(uname -r)/modules.builtin | head -10 kernel/arch/x86/crypto/crc32c-intel.ko kernel/arch/x86/events/intel/intel-uncore.ko kernel/arch/x86/platform/intel/iosf_mbi.ko kernel/mm/zpool.ko kernel/mm/zbud.ko kernel/mm/zsmalloc.ko kernel/fs/binfmt_script.ko kernel/fs/mbcache.ko kernel/fs/configfs/configfs.ko kernel/fs/crypto/fscrypto.ko ``` 你可以使用 `modinfo` 获得一个模块的更多细节,虽然没有对模块提供的服务的简单说明。下面输出内容中省略了冗长的签名。 ``` $ modinfo floppy | head -16 filename: /lib/modules/5.0.0-13-generic/kernel/drivers/block/floppy.ko alias: block-major-2-* license: GPL author: Alain L. Knaff srcversion: EBEAA26742DF61790588FD9 alias: acpi*:PNP0700:* alias: pnp:dPNP0700* depends: retpoline: Y intree: Y name: floppy vermagic: 5.0.0-13-generic SMP mod_unload sig_id: PKCS#7 signer: sig_key: sig_hashalgo: md4 ``` 你可以使用 `modprobe` 命令加载或卸载模块。使用下面这条命令,你可以找到特定模块关联的内核对象: ``` $ find /lib/modules/$(uname -r) -name floppy* /lib/modules/5.0.0-13-generic/kernel/drivers/block/floppy.ko ``` 如果你想要加载模块,你可以使用这个命令: ``` $ sudo modprobe floppy ``` ### 总结 很明显,内核模块的加载和卸载非常重要。它使得 Linux 系统比使用通用内核运行时更加灵活和高效。这同样意味着你可以进行重大更改而无需重启,例如添加硬件。 --- via: <https://www.networkworld.com/article/3391362/looking-into-linux-modules.html> 作者:[Sandra Henry-Stocker](https://www.networkworld.com/author/Sandra-Henry_Stocker/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[LazyWolfLin](https://github.com/LazyWolfLin) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
301
Moved Permanently
null
11,076
学校可以变得敏捷吗?
https://opensource.com/open-organization/19/4/education-culture-agile
2019-07-08T23:53:00
[ "教育", "学校", "敏捷" ]
https://linux.cn/article-11076-1.html
> > 我们一定不会希望用商业的方式运作我们的学校 —— 但是更加注重持续改进的教育机构是可以让我们受益的。 > > > ![](/data/attachment/album/201907/08/235409pfj7ws3hepuha73z.png) 我们都有过那种感觉一件事情“似曾相识”的经历。在 1980 年代末期我经常会有这种感觉,那时候我刚刚进入工业领域不久。当时正赶上一波组织变革的热潮,美国制造业在尝试各种各样不同的模型,让企业领导、经理人和像我这样的工程师重新思考我们应该如何处理质量、成本、创新以及股东价值这样的问题。我们似乎每一年(有时候更加频繁)都需要通过学习一本书来找到让我们更精简、更扁平、更灵活以及更加能满足顾客需求的“最佳方案”。 这里面的很多方法都带来了巨大的改进,我至今仍然赞同它们的核心原则。像 John Kotter、Peter Drucker、Edwards Demming 和 Peter Senge 这样的思想领袖提出的某些思想和策略,还有我们采用的像 Six Sigma 以及在“丰田模式”里可以找到的一些流程优化方法,对我们改进工作都起到了十分关键的作用。 但是其他人似乎只是在同样的思想上进行了润色和调整,然后重新包装了一下 —— 所以我才会有那种 *似曾相识* 的感觉。但是当我成为了一名教师之后,我遇到了一个 *没有* 给我那种似曾相识的感觉的地方:教育界。事实上我十分惊讶地发现,在我的这个新职业里,“持续不断的改进”并 *不像* 在我之前的职业里那样重要了(特别是对于像我这种授课老师职级的人来说)。 为什么教育机构很少努力营造一种不断改进的文化氛围呢?我能想到几个原因,在这里我列举两个。 ### 不再做生产线上的元件 这种不断改进的文化氛围遇到的第一个阻碍是,教育界普遍不愿意从其它行业借鉴可以为自己所用的思想 —— 特别是来自商界的思想。第二个阻碍是,主导教育界的仍然是一种自上而下的、等级制度森严的领导模式。人们往往只能在小范围内讨论这种系统性的、持续的改进方案,比如包括校长、助理校长、学校监管人(LCTT 译注:美国地方政府下设的一种官职,每个学校监管人管理一定数量的学校,接受学校校长的汇报)等等在内的学校领导和区域领袖。但是一小群人的参与是远远不足以带来整个组织层面的文化改革的。 在进一步展开观点之前,我想强调一下,上面所做的概括一定是存在例外情况的(我自己就见到过很多),不过我觉得任何一个教育界的利益相关者都应该会同意以下两点基本假设: 1. 为学生提供高质量的、公平的教育和教学系统的工作所涉及到的任何人都应该将持续不断的改进作为思维方式里的重要部分; 2. 如果学校领导在做决策的时候可以更多地参考那些离学生最近的工作者的意见,那么学生以及学生所在的社区都将更加受益; 那么教育界人士为什么会倾向于忽视(或者公然地敌视)教育界之外的思想呢? 比如我过去就曾经提议应该向别的行业借鉴一些思想和灵感来帮助我们更好地迎合学生的需求,并且果然遭到了批评。我经常得到的回应是:“你这是在把我们的学生当成生产线上的元件来对待呀!”但是我们的学生现在就是在被当作生产线上的元件对待,并且已经无以复加了。他们按照被年龄划分的群体考入大学,每天根据刺耳的铃声的指示去上一节又一节孤立的课程,并且由一些武断的、强调同一性而不是个性的考试来评判他们的成绩。 很多教育界人士可能不知道,生产线元件这种会让人想到流水线标准化作业的东西已经不是现代制造业里的重要组成部分了。得益于上面提到的不断改进的文化氛围,现代先进制造业已经可以做到在单个顾客产生需求的时候,以合理的价格有针对性地提供她所需要的商品。如果我们的学校也可以采用这种模式,教师们之间就更可能会进行协作,并且可以基于学生即时的需求和兴趣,不断完善每一个学生独特的成长和进步路线,而不受时间、课题或者其它传统规范的限制。 我并不是要呼吁大家像经营商业一样经营我们的学校。我所主张的是,用一种清晰而客观的态度去看待任何行业的任何思想,只要它们有可能帮助我们更好地迎合学生个体的需求。不过,如果想有效率地实现这个目标,我们需要仔细研究这个 100 多年来都停滞不前的领导结构。 ### 把不断改进作为努力的目标 有一种说法认为教育和其它行业之间存在着巨大的差异,我虽然赞同这种说法,但同时也相信“重新思考组织和领导结构”这件事情对于任何一个希望对利益相关者负责(并且可以及时作出响应)的主体来说都是适用的。大多数其它行业都已经在重新审视它们传统的、封闭的、等级森严的结构,并且采用可以鼓励员工基于共有的优秀目标发挥自主性的组织结构 —— 这种组织结构对于不断改进来说十分关键。我们的学校和行政区是时候放开眼界了,而不应该拘泥于只听到来自内部的声音,因为它们的用意虽然是好的,但都没有脱离现有的范式。 对于任何希望开始或者加速这个转变过程的学校,我推荐一本很好的书:Jim Whitehurst 的《开放组织》(这不应该让你感到意外)。这本书不仅可以帮助我们理解教育者如何创造更加开放、覆盖面更广的领导领导结构 —— 在这样的结构下,互相尊重让人们可以基于实时数据作出更加灵活的决策 —— 并且它所使用的语言风格也和教育者们所习惯使用的奇怪的词汇库非常契合(这种词汇库简直是教育者们第二天性)。任何组织都可以借鉴开放组织的思维提供的实用主义方法让组织成员更加开放:分享想法和资源、拥抱以共同协作为核心的文化、通过快速制作原型来开发创新思维、基于价值(而不是提出者的职级)来评估一个想法,以及创造一种融入到组织 DNA 里的很强的社区观念。通过众包的方式,这样的开放组织不仅可以从组织内部,也能够从组织外部收集想法,创造一种可以让本地化的、以学生为中心的创新蓬勃发展的环境。 最重要的事情是:在快速变化的未来,我们在过去所做的事情不一定仍然适用了 —— 认清楚这一点对于创造一个不断改进的文化氛围是十分关键的。对于教育者来说,这意味着我们不能只是简单地依赖在针对工厂模型发展出来的解决方案和实践方式了。我们必须从其它行业(比如说非营利组织、军事、医疗以及商业 —— 没错,甚至是商业)里借鉴数不清的最佳方案,这样至少应该能让我们 *知道* 如何找到让学生受益最大的办法。从教育界传统的陈词滥调里超脱出来,才有机会拥有更广阔的视角。我们可以更好地顾全大局,用更客观地视角看待我们遇到的问题,同时也知道我们在什么方面已经做得很不错。 通过有意识地借鉴各路思想 —— 从一年级教师到纽约时报上最新的商业、管理、领导力畅销书 —— 我们可以更好地发掘和运用校内人才,以帮助我们克服阻碍了我们的学校和区域进步的制度里的惰性。 坚持不懈地追求不断改进这件事情,不应该只局限于那种努力在一个全球化的、创新的经济环境中争取竞争力的机构,或者是负责运营学校的少数几个人。当机构里的每一个人都能不断思考怎样才能让今天比昨天做得更好的时候,这就是一个拥有优秀的文化氛围的机构。这种非常有注重协作性和创新的文化氛围,正是我们希望在这些负责改变年轻人命运的机构身上看到的。 我非常期待,有朝一日我能在学校里感受到这种精神,然后微笑着对自己说:“这种感觉多么似曾相识啊。” --- via: <https://opensource.com/open-organization/19/4/education-culture-agile> 作者:[Ben Owens](https://opensource.com/users/engineerteacher/users/ke4qqq/users/n8chz/users/don-watkins) 选题:[lujun9972](https://github.com/lujun9972) 译者:[chen-ni](https://github.com/chen-ni) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
We've all had those *deja vu* moments that make us think "I've seen this before!" I experienced them often in the late 1980s, when I first began my career in industry. I was caught up in a wave of organizational change, where the U.S. manufacturing sector was experimenting with various models that asked leaders, managers, and engineers like me to rethink how we approached things like quality, cost, innovation, and shareholder value. It seems as if every year (sometimes, more frequently) we'd study yet another book to identify the "best practices" necessary for making us leaner, flatter, more nimble, and more responsive to the needs of the customer. Many of the approaches were so transformational that their core principles still resonate with me today. Specific ideas and methods from thought leaders such as John Kotter, Peter Drucker, Edwards Demming, and Peter Senge were truly pivotal for our ability to rethink our work, as were the adoption of process improvement methods such as Six Sigma and those embodied in the "Toyota Way." But others seemed to simply repackage these same ideas with a sexy new twist—hence my *deja vu*. And yet when I began my career as a teacher, I encountered a context that *didn't* give me that feeling: education. In fact, I was surprised to find that "getting better all the time" was *not* the same high priority in my new profession that it was in my old one (particularly at the level of my role as a classroom teacher). Why aren't more educational organizations working to create cultures of continuous improvement? I can think of several reasons, but let me address two. ## Widgets no more The first barrier to a culture of continuous improvement is education's general reticence to look at other professions for ideas it can adapt and adopt—especially ideas from the business community. The second is education's predominant leadership model, which remains predominantly top-down and rooted in hierarchy. Conversations about systemic, continuous improvement tend to be the purview of a relatively small group of school or district leaders: principals, assistant principals, superintendents, and the like. But widespread organizational culture change can't occur if only one small group is involved in it. Before unpacking these points a bit further, I'd like to emphasize that there are certainly exceptions to the above generalization (many I have seen first hand) and that there are two basic assumptions that I think any education stakeholder should be able to agree with: - Continuous improvement must be an essential mindset for *anyone*involved in the work of providing high-quality and equitable teaching and learning systems for students, and - Decisions by leaders of our schools will more greatly benefit students and the communities in which they live when those decisions are informed and influenced by those who work closest with students. So why a tendency to ignore (or be outright hostile toward) ideas that come from outside the education space? I, for example, have certainly faced criticism in the past for suggesting that we look to other professions for ideas and inspiration that can help us better meet the needs of students. A common refrain is something like: "You're trying to treat our students like widgets!" But how could our students be treated any more like widgets than they already are? They matriculate through school in age-based cohorts, going from siloed class to class each day by the sound of a shrill bell, and receive grades based on arbitrary tests that emphasize sameness over individuality. It may be news to many inside of education, but widgets—abstract units of production that evoke the idea of assembly line standardization—are not a significant part of the modern manufacturing sector. Thanks to the culture of continuous improvement described above, modern, advanced manufacturing delivers just what the individual customer wants, at a competitive price, exactly when she wants it. If we adapted this model to our schools, teachers would be more likely to collaborate and constantly refine their unique paths of growth for all students based on just-in-time needs and desires—regardless of the time, subject, or any other traditional norm. What I'm advocating is a clear-eyed and objective look at any idea from any sector with potential to help us better meet the needs of individual students, not that we somehow run our schools like businesses. In order for this to happen effectively, however, we need to scrutinize a leadership structure that has frankly remained stagnant for over 100 years. ## Toward continuous improvement While I certainly appreciate the argument that education is an animal significantly different from other professions, I also believe that rethinking an organizational and leadership structure is an applicable exercise for any entity wanting to remain responsible (and responsive) to the needs of its stakeholders. Most other professions have taken a hard look at their traditional, closed, hierarchical structures and moved to ones that encourage collective autonomy per shared goals of excellence—organizational elements essential for continuous improvement. It's time our schools and districts do the same by expanding their horizon beyond sources that, while well intended, are developed from a lens of the current paradigm. Not surprisingly, a go-to resource I recommend to any school wanting to begin or accelerate this process is *The Open Organization* by Jim Whitehurst. Not only does the book provide a window into how educators can create more open, inclusive leadership structures—where mutual respect enables nimble decisions to be made per real-time data—but it does so in language easily adaptable to the rather strange lexicon that's second nature to educators. Open organization thinking provides pragmatic ways any organization can empower members to be more open: sharing ideas and resources, embracing a culture of collaborative participation as a top priority, developing an innovation mindset through rapid prototyping, valuing ideas based on merit rather than the rank of the person proposing them, and building a strong sense of community that's baked into the organization's DNA. Such an open organization crowd-sources ideas from both inside and outside its formal structure and creates the type of environment that enables localized, student-centered innovations to thrive. Here's the bottom line: Essential to a culture of continuous improvement is recognizing that what we've done in the past may not be suitable in a rapidly changing future. For educators, that means we simply can't rely on solutions and practices we developed in a factory-model paradigm. We must acknowledge countless examples of best practices from other sectors—such as non-profits, the military, the medical profession, and yes, even business—that can at least *inform* how we rethink what we do in the best interest of students. By moving beyond the traditionally sanctioned "eduspeak" world, we create opportunities for considering perspectives. We can better see the forest for the trees, taking a more objective look at the problems we face, as well as acknowledging what we do very well. Intentionally considering ideas from all sources—from first year classroom teachers to the latest NYT Business & Management Leadership bestseller—offers us a powerful way to engage existing talent within our schools to help overcome the institutionalized inertia that has prevented more positive change from taking hold in our schools and districts. Relentlessly pursuing methods of continuous improvement should not be a behavior confined to organizations fighting to remain competitive in a global, innovation economy, nor should it be left to a select few charged with the operation of our schools. When everyone in an organization is always thinking about what they can do differently *today* to improve what they did *yesterday*, then you have an organization living a culture of excellence. That's the kind of radically collaborative and innovative culture we should especially expect for organizations focused on changing the lives of young people. I'm eagerly awaiting the day when I enter a school, recognize that spirit, and smile to myself as I say, "I've seen this before." ## 7 Comments
11,077
如何在 Linux 服务器上设置 ulimit 和文件描述符数限制
https://www.linuxtechi.com/set-ulimit-file-descriptors-limit-linux-servers/
2019-07-09T12:14:33
[ "ulimit", "文件句柄" ]
https://linux.cn/article-11077-1.html

**简介**:在生产环境中遇到打开文件数这类的挑战如今已是司空见惯的事情了。因为许多应用程序是基于 Java 和 Apache 的,安装和配置它们可能会导致打开过多的文件(文件描述符)。如果打开的文件描述符超过了默认设置的限制,就可能会面临访问控制问题,受阻于打开文件的挑战。许多生产环境因此而陷入停滞状态。 ![](/data/attachment/album/201907/09/121422bv6t76nztjxqoprn.jpg) 幸运的是,在基于 Linux 的服务器上,都有 `ulimit` 命令,通过它可以查看、设置、获取文件打开的状态和配置详情。此命令配备了许多选项,通过这些组合可以设置打开文件的数量。下面逐个命令用示例做了详细说明。 ### 查看任何 Linux 系统中当前打开文件数的限制 要在 Linux 服务器上得到打开文件数的限制,请执行以下命令, ``` [root@ubuntu ~]# cat /proc/sys/fs/file-max 146013 ``` 上面的数字表明用户可以在每个用户登录会话中打开 ‘146013’ 个文件。 ``` [root@centos ~]# cat /proc/sys/fs/file-max 149219 [root@debian ~]# cat /proc/sys/fs/file-max 73906 ``` 这清楚地表明,各个 Linux 操作系统具有不同的打开文件数限制。这基于各自系统中运行的依赖关系和应用程序。 ### ulimit 命令 顾名思义,`ulimit`(用户限制)用于显示和设置登录用户的资源限制。当我们使用 `-a` 选项运行 `ulimit` 命令时,它将打印登录用户的所有资源限制。现在让我们在 Ubuntu/Debian 和 CentOS 系统上运行 `ulimit -a`, #### Ubuntu / Debian 系统 ``` shashi@Ubuntu ~}$ ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 5731 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 5731 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited ``` #### CentOS 系统 ``` shashi@centos ~}$ ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 5901 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 5901 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited ``` 正如我们可以在这里看到的,不同的操作系统具有不同的限制设置。所有这些限制都可以使用 `ulimit` 命令进行配置/更改。 要显示单个资源限制,可以在 `ulimit` 命令中传递特定的参数,下面列出了一些参数: * `ulimit -n` –> 显示打开文件数限制 * `ulimit -c` –> 显示核心转储文件大小 * `umilit -u` –> 显示登录用户的最大用户进程数限制 * `ulimit -f` –> 显示用户可以拥有的最大文件大小 * `umilit -m` –> 显示登录用户的最大内存大小 * `ulimit -v` –> 显示最大内存大小限制 使用以下命令检查登录用户打开文件数量的硬限制和软限制: ``` shashi@Ubuntu ~}$ ulimit -Hn 1048576 shashi@Ubuntu ~}$ ulimit -Sn 1024 ``` ### 如何修复达到最大文件数限制的问题? 让我们假设我们的 Linux 服务器已经达到了打开文件的最大数量限制,并希望在系统范围扩展该限制,例如,我们希望将 100000 设置为打开文件数量的限制。 ``` root@ubuntu~]# sysctl -w fs.file-max=100000 fs.file-max = 100000 ``` 上述更改将在下次重启之前有效,因此要使这些更改在重启后仍存在,请编辑文件 `/etc/sysctl.conf` 并添加相同的参数, ``` root@ubuntu~]# vi /etc/sysctl.conf fs.file-max = 100000 ``` 保存文件并退出。 运行下面命令,使上述更改立即生效,而无需注销和重新启动。 ``` root@ubuntu~]# sysctl -p ``` 现在验证新的更改是否生效。 ``` root@ubuntu~]# cat /proc/sys/fs/file-max 100000 ``` 使用以下命令找出当前正在使用的文件描述符数量: ``` [root@ansible ~]# more /proc/sys/fs/file-nr 1216 0 100000 ``` 注意:命令 `sysctl -p` 用于在不重新启动和注销的情况下提交更改。 ### 通过 limit.conf 文件设置用户级资源限制 `/etc/sysctl.conf` 文件用于设置系统范围的资源限制,但如果要为 Oracle、MariaDB 和 Apache 等特定用户设置资源限制,则可以通过 `/etc/security/limits.conf` 文件去实现。 示例 `limits.conf` 如下所示, ``` root@ubuntu~]# cat /etc/security/limits.conf ``` ![Limits-conf-linux-part1](/data/attachment/album/201907/09/121436ghw4hqgdlgbdqqdn.jpg) ![Limits-conf-linux-part2](/data/attachment/album/201907/09/121436qkczc2cx2gd2sqc4.jpg) 假设我们要为 linuxtechi 用户设置打开文件数量的硬限制和软限制,而对于 oracle 用户设置打开进程数量的硬限制和软限制,编辑文件 `/etc/security/limits.conf` 并添加以下行: ``` # hard limit for max opened files for linuxtechi user linuxtechi hard nofile 4096 # soft limit for max opened files for linuxtechi user linuxtechi soft nofile 1024 # hard limit for max number of process for oracle user oracle hard nproc 8096 # soft limit for max number of process for oracle user oracle soft nproc 4096 ``` 保存文件并退出。 **注意:** 如果你想对一个组而不是用户进行资源限制,那么也可以通过 `limits.conf` 文件,输入 `@<组名>` 代替用户名,其余项都是相同的,示例如下, ``` # hard limit for max opened files for sysadmin group @sysadmin hard nofile 4096 # soft limit for max opened files for sysadmin group @sysadmin soft nofile 1024 ``` 验证新的更改是否生效: ``` ~]# su - linuxtechi ~]$ ulimit -n -H 4096 ~]$ ulimit -n -S 1024 ~]# su - oracle ~]$ ulimit -H -u 8096 ~]$ ulimit -S -u 4096 ``` 注:其他主要使用的命令是 [lsof](https://www.linuxtechi.com/lsof-command-examples-linux-geeks/),可用于找出“当前打开了多少个文件”,这命令对管理员非常有帮助。 ### 结尾 正如在介绍部分提到的,`ulimit` 命令非常强大,可以帮助用户配置并确保应用程序安装更加流畅而没有任何瓶颈。此命令有助于修复基于 Linux 的服务器中的(打开)大量文件的限制。 --- via: <https://www.linuxtechi.com/set-ulimit-file-descriptors-limit-linux-servers/> 作者:[Shashidhar Soppin](https://www.linuxtechi.com/author/shashidhar/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[zgj1024](https://github.com/zgj1024) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
In this post, we will explain how to set ulimit and file descriptors limit in Linux. Challenges like number of open files in any of the production environment has become common now a day. Since many applications which are Java based and Apache based, are getting installed and configured, which may lead to too many open files, file descriptors etc. If this exceeds the default limit that is set, then one may face access control problems and file opening challenges. Many production environments come to standstill kind of situations because of this. Luckily, we have “ulimit” command in any of the Linux based server, by which one can see/set/get number of files open status/configuration details. This command is equipped with many options and with this combination one can set number of open files. Following are step-by-step commands with examples explained in detail. ## View Current Open File Limit in Linux To get open file limit on any Linux server, execute the following command, [root@ubuntu ~]# cat /proc/sys/fs/file-max 146013 The above number shows that user can open ‘146013’ file per user login session. [root@centos ~]# cat /proc/sys/fs/file-max 149219 [root@debian ~]# cat /proc/sys/fs/file-max 73906 This clearly indicates that individual Linux operating systems have different number of open files. This is based on dependencies and applications which are running in respective systems. ## ulimit command As the name suggests, ulimit (user limit) is used to display and set resources limit for logged in user.When we run ulimit command with -a option then it will print all resources’ limit for the logged in user. Now let’s run “ulimit -a” on Ubuntu / Debian and RHEL systems, Ubuntu / Debian System, shashi@Ubuntu ~}$ ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 5731 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 5731 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited **RHEL /CentOS System** shashi@centos ~}$ ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 5901 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 5901 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited As we can be seen here different OS have different limits set. All these limits can be configured/changed using “ulimit” command. To display the individual resource limit then pass the individual parameter in ulimit command, some of parameters are listed below: - ulimit -n –> It will display number of open files limit - ulimit -c –> It display the size of core file - umilit -u –> It will display the maximum user process limit for the logged in user. - ulimit -f –> It will display the maximum file size that the user can have. - umilit -m –> It will display the maximum memory size for logged in user. - ulimit -v –> It will display the maximum memory size limit Use below commands check hard and soft limits for number of open file for the logged in user shashi@Ubuntu ~}$ ulimit -Hn 1048576 shashi@Ubuntu ~}$ ulimit -Sn 1024 #### How to fix the problem when limit on number of maximum files was reached ? Let’s assume our Linux server has reached the limit of maximum number of open files and want to extend that limit system wide, for example we want to set 100000 as limit of number of open files. Use sysctl command to pass fs.file-max parameter to kernel on the fly, execute beneath command as root user, root@ubuntu~]# sysctl -w fs.file-max=100000 fs.file-max = 100000 Above changes will be active until the next reboot, so to make these changes persistent across the reboot, edit the file /etc/sysctl.conf and add same parameter, root@ubuntu~]# vi /etc/sysctl.conf fs.file-max = 100000 save and exit file, Run the beneath command to make above changes into effect immediately without logout and reboot. root@ubuntu~]# sysctl -p Now verify whether new changes are in effect or not. root@ubuntu~]# cat /proc/sys/fs/file-max 100000 Use below command to find out how many file descriptors are currently being utilized: [root@ansible ~]# more /proc/sys/fs/file-nr 1216 0 100000 Note: Command “sysctl -p” is used to commit the changes without reboot and logout. ## Set ulimit (User level resource limit) via limit.conf file “/etc/sysctl.conf” file is used to set resource limit system wide but if you want to set resource limit for specific user like Oracle, MariaDB and Apache then this can be achieved via “/etc/security/limits.conf” file. Sample limit.conf is shown below, root@ubuntu~]# cat /etc/security/limits.conf Let’s assume we want to set hard and soft limit on number of open files for linuxtechi user and for oracle user set hard and soft limit on number of open process, edit the file “/etc/security/limits.conf” and add the following lines # hard limit for max opened files for linuxtechi user linuxtechi hard nofile 4096 # soft limit for max opened files for linuxtechi user linuxtechi soft nofile 1024 # hard limit for max number of process for oracle user oracle hard nproc 8096 # soft limit for max number of process for oracle user oracle soft nproc 4096 Save & exit the file. Note: In case you want to put resource limit on a group instead of users, then it can also be possible via limit.conf file, in place of user name , type **@<Group_Name>** and rest of the items will be same, example is shown below, # hard limit for max opened files for sysadmin group @sysadmin hard nofile 4096 # soft limit for max opened files for sysadmin group @sysadmin soft nofile 1024 Verify whether new changes are in effect or not, ~]# su - linuxtechi ~]$ ulimit -n -H 4096 ~]$ ulimit -n -S 1024 ~]# su - oracle ~]$ ulimit -H -u 8096 ~]$ ulimit -S -u 4096 Note: Other majorly used command is “[lsof](https://www.linuxtechi.com/lsof-command-examples-linux-geeks/)” which is used for finding out “how many files are opened currently”. This command is very helpful for admins. #### Conclusion As mentioned in the introduction section “ulimit” command is very powerful and helps one to configure and make sure application installations are smoother without any bottlenecks. This command helps in fixing many of the number of file limitations in Linux based servers. Rajicat /proc/sys/fs/file-max shows 146013, but ulimit -a shows: open files (-n) 1024 What is the difference Pradeep Kumarcat /proc/sys/fs/file-max –> shows the limit of max open file for the system wide ulimit -a –> will show all the resources limit of a specific user davidhello, ok so do you mean that if I set a value like this it will be add to limits.conf? ulimit -f 65000 Pradeep KumarHi David, User level limits are configured via ‘/etc/security/limits.conf’ file. Example is shown in above guide.
11,079
追溯 Linux 上的库注入
https://www.networkworld.com/article/3404621/tracking-down-library-injections-on-linux.html
2019-07-09T22:32:00
[ "库注入" ]
https://linux.cn/article-11079-1.html
> > <ruby> 库注入 <rt> Library injections </rt></ruby>在 Linux 上不如 Windows 上常见,但它仍然是一个问题。下来看看它们如何工作的,以及如何鉴别它们。 > > > ![](/data/attachment/album/201907/09/224102bv5gli004hjvvifh.jpg) 尽管在 Linux 系统上几乎见不到,但库(Linux 上的共享目标文件)注入仍是一个严峻的威胁。在采访了来自 AT&T 公司 Alien 实验室的 Jaime Blasco 后,我更加意识到了其中一些攻击是多么的易实施。 在这篇文章中,我会介绍一种攻击方法和它的几种检测手段。我也会提供一些展示攻击细节的链接和一些检测工具。首先,引入一个小小的背景信息。 ### 共享库漏洞 DLL 和 .so 文件都是允许代码(有时候是数据)被不同的进程共享的共享库文件。公用的代码可以放进一个文件中使得每个需要它的进程可以重新使用而不是多次被重写。这也促进了对公用代码的管理。 Linux 进程经常使用这些共享库。(显示共享对象依赖的)`ldd` 命令可以对任何程序文件显示其共享库。这里有一些例子: ``` $ ldd /bin/date linux-vdso.so.1 (0x00007ffc5f179000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f02bea15000) /lib64/ld-linux-x86-64.so.2 (0x00007f02bec3a000) $ ldd /bin/netstat linux-vdso.so.1 (0x00007ffcb67cd000) libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f45e5d7b000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f45e5b90000) libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f45e5b1c000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f45e5b16000) /lib64/ld-linux-x86-64.so.2 (0x00007f45e5dec000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f45e5af5000) ``` `linux-vdso.so.1` (在一些系统上也许会有不同的名字)是内核自动映射到每个进程地址空间的文件。它的工作是找到并定位进程所需的其他共享库。 对库加载机制加以利用的一种方法是通过使用 `LD_PRELOAD` 环境变量。正如 Jaime Blasco 在他的研究中所解释的那样,“`LD_PRELOAD` 是在进程启动时加载共享库的最简单且最受欢迎的方法。可以将此环境变量配置到共享库的路径,以便在加载其他共享对象之前加载该共享库。” 为了展示有多简单,我创建了一个极其简单的共享库并且赋值给我的(之前不存在) `LD_PRELOAD` 环境变量。之后我使用 `ldd` 命令查看它对于常用 Linux 命令的影响。 ``` $ export LD_PRELOAD=/home/shs/shownum.so $ ldd /bin/date linux-vdso.so.1 (0x00007ffe005ce000) /home/shs/shownum.so (0x00007f1e6b65f000) <== 它在这里 libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1e6b458000) /lib64/ld-linux-x86-64.so.2 (0x00007f1e6b682000) ``` 注意,仅仅将新的库赋给 `LD_PRELOAD` 就影响到了运行的任何程序。 通过设置 `LD_PRELOAD` 指定的共享库首先被加载(紧随 linux-vdso.so.1),这些库可以极大程度上改变一个进程。例如,它们可以重定向系统调用到它们自己的资源,或对程序运行的行为方式进行意想不到的更改。 ### osquery 工具可以检测库注入 `osquery` 工具(可以在 [osquery.io](https://osquery.io/)下载)提供了一个非常独特的查看 Linux 系统的方式。它基本上将操作系统视作一个高性能的关系数据库。然后,也许你会猜到,这就意味着它可以用来查询并且生成 SQL 表,该表提供了诸如以下的详细信息: * 运行中的进程 * 加载的内核模块 * 打开的网络链接 一个提供了进程信息的内核表叫做 `process_envs`。它提供了各种进程使用环境变量的详细信息。Jaime Blasco 提供了一个相当复杂的查询,可以使用 `osquery` 识别出使用 `LD_PRELOAD` 的进程。 注意,这个查询是从 `process_envs` 表中获取数据。攻击 ID(T1055)参考 [Mitre 对攻击方法的解释](https://attack.mitre.org/techniques/T1055/)。 ``` SELECT process_envs.pid as source_process_id, process_envs.key as environment_variable_key, process_envs.value as environment_variable_value, processes.name as source_process, processes.path as file_path, processes.cmdline as source_process_commandline, processes.cwd as current_working_directory, 'T1055' as event_attack_id, 'Process Injection' as event_attack_technique, 'Defense Evasion, Privilege Escalation' as event_attack_tactic FROM process_envs join processes USING (pid) WHERE key = 'LD_PRELOAD'; ``` 注意 `LD_PRELOAD` 环境变量有时是合法使用的。例如,各种安全监控工具可能会使用到它,因为开发人员需要进行故障排除、调试或性能分析。然而,它的使用仍然很少见,应当加以防范。 同样值得注意的是 `osquery` 可以交互使用或是作为定期查询的守护进程去运行。了解更多请查阅文章末尾给出的参考。 你也能够通过查看用户的环境设置来定位 `LD_PRELOAD` 的使用。如果在用户账户中使用了 `LD_PRELOAD`,你可以使用这样的命令来查看(假定以个人身份登录后): ``` $ env | grep PRELOAD LD_PRELOAD=/home/username/userlib.so ``` 如果你之前没有听说过 `osquery`,也别太在意。它正在成为一个更受欢迎的工具。事实上就在上周,Linux 基金会宣布打造了新的 [osquery 基金会](https://www.linuxfoundation.org/press-release/2019/06/the-linux-foundation-announces-intent-to-form-new-foundation-to-support-osquery-community/)以支持 osquery 社区。 #### 总结 尽管库注入是一个严重的威胁,但了解一些优秀的工具来帮助你检测它是否存在是很有帮助的。 #### 扩展阅读 重要的参考和工具的链接: * [用 osquery 追寻 Linux 库注入](https://www.alienvault.com/blogs/labs-research/hunting-for-linux-library-injection-with-osquery),AT&T Cybersecurity * [Linux:我的内存怎么了?](https://www.trustedsec.com/2018/09/linux-hows-my-memory/),TrustedSec * [下载 osquery](https://osquery.io/) * [osquery 模式](https://osquery.io/schema/3.3.2) * [osqueryd(osquery 守护进程)](https://osquery.readthedocs.io/en/stable/deployment/configuration/#schedule) * [Mitre 的攻击框架](https://attack.mitre.org/) * [新的 osquery 基金会成立](https://www.linuxfoundation.org/press-release/2019/06/the-linux-foundation-announces-intent-to-form-new-foundation-to-support-osquery-community/) --- via: <https://www.networkworld.com/article/3404621/tracking-down-library-injections-on-linux.html> 作者:[Sandra Henry-Stocker](https://www.networkworld.com/author/Sandra-Henry_Stocker/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[LuuMing](https://github.com/LuuMing) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
301
Moved Permanently
null
11,080
区块链 2.0:公有链与私有链(七)
https://www.ostechnix.com/blockchain-2-0-public-vs-private-blockchain-comparison/
2019-07-10T11:22:06
[ "区块链", "公有链" ]
https://linux.cn/article-11080-1.html
![Public vs Private blockchain](/data/attachment/album/201907/10/112211sn1s10uq44sez1e1.png) [区块链 2.0](/article-10650-1.html)系列的前一篇文章探索了[智能合同的现状](/article-11013-1.html)。这篇文章旨在揭示可以创建的不同类型的区块链。它们每个都用于非常不同的应用程序,并且根据用例的不同,每个应用程序所遵循的协议也不同。现在,让我们将公有链之于私有链对比一下开源软件之于专有技术。 正如我们所知,基于区块链的分布式分类账本的基本三层结构如下: ![](/data/attachment/album/201907/10/112214wzwsackzeuhzvh2l.png) *图 1 – 区块链分布式账本的基本结构* 这里提到的类型之间的差异主要归因于底层区块链其所依赖的协议。该协议规定了参与者的规则和参与的方式。 阅读本文时,请记住以下几点事项: * 任何平台的产生都是为了解决需求而生。技术应该采取最好的方向。例如,区块链具有巨大的应用价值,其中一些可能需要丢弃在其他情形中看起来很重要的功能。在这方面,**分布式存储**就是最好的例子。 * 区块链本质上是一个数据库系统,通过时间戳和区块的形式组织数据来跟踪信息。此类区块链的创建者可以选择谁有权产出这些区块并进行修改。 * 区块链也可以“中心化”,参与的程度可以限定于由“中央权威”认定为符合条件的人。 大多数区块链要么是公有的,要么是私有的。广义上说,公有链可以被认为是开源软件的等价物,大多数私有链可以被视为源自公有链的专有平台。下图应该会让大多数人明显地看出基本的区别。 ![](/data/attachment/album/201907/10/112216ioq99ccv99snvkws.png) *图 2 – 公有链/私有链与开源/专有技术的对比* 虽然这是最受欢迎的理解。但是这并不是说所有的私有链都是从公有链中衍生出来的。 ### 公有链 公有链可以被视为是一个无需许可的、开放的平台或网络。任何拥有专业知识和计算资源的人都可以参与其中。这将产生以下影响: * 任何人都可以加入公有链网络并参与到其中。“参与者” 所需要的只是稳定的网络资源和计算资源。 * 参与行为包括了读取、写入、验证和提供交易期间的共识。比特币矿工就是很好的例子。作为网络的参与者,矿工会得到比特币作为回报。 * 平台完全去中心,完全冗余。 * 由于去中心化,没有一个实体可以完全控制分类账本中记录的数据。所有 (或大多数) 参与者都需要通过验证区块的方式检查数据。 * 这意味着,一旦信息被验证和记录,就不能轻易改变。即使能改变,也不可能不留下痕迹。 * 在比特币和莱特币等平台上,参与者的身份仍然是匿名的。设计这些平台的目的是保护和保护用户身份。这主要是由上层协议栈提供的功能。 * 公有链有比特币、莱特币、以太坊等不同的网络。 * 广泛的去中心化意味着,在区块链分布式网络实现的交易,获得共识可能需要一段时间,对于旨在每时每刻都在推动大量交易的大型企业来说,吞吐量可能是一个挑战。 * 开放式参与,使比特币等公有链中的大量参与者,往往会增加对计算设备和能源成本的初始投资。 * 公有链以设计安全著称。它们的实现依靠以下几点: + 匿名参与者 + 多个节点上的分布式和冗余的加密存储 + 创建和更改数据需要大量的共识 ### 私有链 相比之下,私有链是一个*被许可的区块链*\*。这意味着: * 参与网络的许可受到限制,并由监督网络的所有者或机构主持。这意味着,即使个人能够存储数据并进行交易(例如,发送和接收付款),这些交易的验证和存储也只能由选定的参与者来完成。 * 参与者一旦获得中心机构的许可,将受到条款的限制。例如,在金融机构运营的私有链网络中,并不是每个客户都可以访问整个区块链的分布式账本,甚至在那些获得许可的客户中吗,也不是每个人都能访问所有的东西。在这种情况下,中心机构将授予访问选择服务的权限。这通常被称为 “**通道**”。 * 与公有链相比,这种系统具有更大的吞吐量能力,也展示了更快的交易速度,因为区块只需要由少数几个人验证。 私有链通常在其协议中没有任何特征。这使得该系统仅与目前使用的大多数基于云的数据库系统一样安全。 ### 智者的观点 需要注意的一点是,它们被命名为公有或私有(或开源、闭源)的事实与底层代码库无关。在这两种情况下,平台所基于的代码或文字基础可能是公开的,也可能不是公开的。R3 是一家 DLT(<ruby> 分布式分类账本 <rt> <strong> D </strong> istributed <strong> L </strong> edger <strong> T </strong> echnology </rt></ruby>)公司,领导着由 200 多家跨国机构组成的公有财团。他们的目标是在金融和商业领域进一步发展区块链和相关分布式账本技术。corda 是这一共同努力的产物。R3 将 corda 定义为专门为企业构建的区块链平台。其代码库同样是开源的,鼓励世界各地的开发人员为这个项目做出贡献。然而,考虑到 corda 面临的业务性质和旨在满足的需求,corda 被归类为许可的封闭区块链平台。这意味着企业可以在部署后选择网络的参与者,并通过使用原生可用的智能合约工具选择这些参与者可以访问的信息类型。 虽然像比特币和以太坊这样的公有链负责该领域的广泛认知和发展,但仍然可以认为,为企业或商业环境中的特定用例设计的私有链将在短期内引领货币投资。这些都是我们大多数人在不久的将来会看到以实际方式运用起来的平台。 请继续阅读本系列中下一篇有关 Hyperledger 项目的文章。 * [区块链 2.0:Hyperledger(HLP)项目介绍](https://www.ostechnix.com/blockchain-2-0-an-introduction-to-hyperledger-project-hlp/) 我们正在研究更多有趣的区块链技术话题。敬请期待! --- via: <https://www.ostechnix.com/blockchain-2-0-public-vs-private-blockchain-comparison/> 作者:[ostechnix](https://www.ostechnix.com/author/editor/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[zionfuo](https://github.com/zionfuo) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
403
Forbidden
null
11,082
借助 Valve 的新编译器,Linux 游戏在 AMD GPU 中获得了性能提升
https://itsfoss.com/linux-games-performance-boost-amd-gpu/
2019-07-10T12:54:23
[ "AMD", "游戏" ]
https://linux.cn/article-11082-1.html
Steam 寻求公众反馈以便为 AMD GPU 测试 ACO(一个新的 Mesa [着色器](https://en.wikipedia.org/wiki/Shader)编译器)已经有几天了。 目前,AMD 驱动程序使用 LLVM 作为着色器编译器。而 [Mesa](https://en.wikipedia.org/wiki/Mesa_(computer_graphics)) 则是一个开源的 [LLVM](https://en.wikipedia.org/wiki/LLVM) 的替代品。因此,在这种情况下,Valve 希望支持 AMD 显卡以提高 Linux 游戏在各种 Linux 发行版上的性能。 ![](/data/attachment/album/201907/10/125425yshoefsnoodenmo2.png) 为了提高游戏性能,编译时间至关重要,使用新的 ACO 编译器,它将时间缩短了近 50%。 Valve 在其 [Steam 社区](https://steamcommunity.com/games/221410/announcements/detail/1602634609636894200)的帖子中解释了更多关于它的信息: > > AMD OpenGL 和 Vulkan 驱动程序目前使用的着色器编译器是上游 LLVM 项目的一部分。该项目规模庞大,并且有许多不同的目标,游戏着色器的在线编译只是其中之一。这可能会导致不同的开发权衡,其中改进游戏特定功能比其他情况更难,特定于游戏的功能也经常被 LLVM 的开发人员因其他事情破坏。特别是,着色器编译速度就是这样一个例子:它在大多数其他场景中并不是一个关键因素,只能锦上添花。但是对于游戏来说,编译时间是至关重要的,而缓慢的着色器编译可能导致几乎无法播放的顿挫。 > > > ### Linux 游戏真的有性能提升吗? 是的,没错。 这里的主要亮点是编译时间。如果着色器编译时间急剧减少,理论上应该会改善游戏的性能。 而且,根据[最初的基准报告](https://gist.github.com/pendingchaos/aba1e4c238cf039d17089f29a8c6aa63),我们确实看到了一些重大改进。 ![](/data/attachment/album/201907/10/125427vwi4fhihn4zbbdy3.png) 当然,游戏中的 FPS 改进并不是很大。但是,它在早期阶段仍然是一个很好的进步。 如果你对编译时间的改进感到好奇,下面是结果: ![](/data/attachment/album/201907/10/125428rlyipzpt93wsytck.png) 是的,即使大幅的编译时间减少也不会大幅影响游戏中的 FPS。但是,它仍然是一件大事,因为目前,这是一项正在进行中的工作。所以,我们可以有更多期待。 但是,还能做些什么呢? 好吧,ACO 还没完成。下面是为什么(在 Valve 中提到): > > 现在,ACO 只处理像素和计算着色器阶段。当其余的阶段实现时,我们预计编译时间将进一步减少。 > > > #### 总结 尽管我没有配备 AMD GPU,但我很有兴趣看到对 Linux 游戏场景的改进。 此外,随着事情进展,我们将期待更多的基准和报告。 你怎么看待?请在下面的评论中告诉我们你的想法。如果你有基本报告要分享,请告诉我们。 --- via: <https://itsfoss.com/linux-games-performance-boost-amd-gpu/> 作者:[Ankush Das](https://itsfoss.com/author/ankush/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
It has been a few days since Steam asked for the public feedback in order to test ACO (a new Mesa [shader](https://en.wikipedia.org/wiki/Shader) compiler) for AMD GPUs. Currently, the AMD drivers use a shader compiler utilizing LLVM. However, [Mesa](https://en.wikipedia.org/wiki/Mesa_(computer_graphics)) is an open source alternative to [LLVM](https://en.wikipedia.org/wiki/LLVM). So, in this case, Valve wants to support AMD graphics to improve the performance of Linux games on various Linux distros. ![Improved Linux Gaming](https://itsfoss.com/content/images/wordpress/2019/07/Improved-Linux-Gaming-800x450.png) For gaming performance improvement, the compile time is critical and with the new ACO compiler, it reduces the time by almost 50%. Valve explained more about it in its [Steam community](https://steamcommunity.com/games/221410/announcements/detail/1602634609636894200) post: The AMD OpenGL and Vulkan drivers currently use a shader compiler that is part of the upstream LLVM project. That project is massive, and has many different goals, with online compilation of game shaders only being one of them. That can result in development tradeoffs, where improving gaming-specific functionality is harder than it otherwise would, or where gaming-specific features would often accidentally get broken by LLVM developers working on other things. In particular, shader compilation speed is one such example: it’s not really a critical factor in most other scenarios, just a nice-to-have. But for gaming, compile time is critical, and slow shader compilation can result in near-unplayable stutter. ## Is there really a performance boost for Linux games? Yes, there is. The primary highlight here is the compile time. If the shader compilation time reduces dramatically, it should theoretically improve the performance of the game. And, as per the [initial benchmark reports](https://gist.github.com/pendingchaos/aba1e4c238cf039d17089f29a8c6aa63), we really do see some significant improvements. ![Fps Improvement Amd](https://itsfoss.com/content/images/wordpress/2019/07/fps-improvement-amd.png?fit=800%2C412&ssl=1) Of course, the in-game FPS improvement isn’t huge. But, it is still a good progress in its early stage. If you’re curious about the compile time improvement, then here it is: ![Compile Time Amd Gpu Linux](https://itsfoss.com/content/images/wordpress/2019/07/compile-time-amd-gpu-linux.png) Yes, even a big compile time reduction did not affect the in-game FPS by a large margin. But, it is still a big deal because currently, it is a work in progress. So, we can expect even more. But, what more can be done? Well, the ACO compiler isn’t complete yet. Here’s why (as Valve mentioned): Right now, ACO only handles pixel and compute shader stages. When the rest of the stages are implemented, we expect the compile times will be reduced even further. ### Wrapping Up Even though I don’t have an AMD GPU on board, it is actually interesting to see improvements for the Linux gaming scene in general. Also, we shall be expecting more benchmarks and reports as this progresses. What do you think? Let us know your thoughts in the comments below. If you have a benchmark report to share, do let us know about it.
11,083
图解 Debian 10(Buster)安装步骤
https://www.linuxtechi.com/debian-10-buster-installation-guide/
2019-07-11T00:09:51
[ "Debian" ]
https://linux.cn/article-11083-1.html
![](/data/attachment/album/201907/11/000856swbwnfyknnbn3twk.jpg) Debian 项目发布了它的最新稳定版 Debian 10,其代号是 “Buster”,这个发布版将获得 5 年的支持。Debian 10 可用于 32 位和 64 位系统。这个发布版带来很多新的特色,列出下面一些特色: * 引入新的 Debian 10 的主题 “FuturePrototype” * 新版本的电脑桌面环境 GNOME 3.30、Cinnamon 3.8、KDE Plasma 5.14、MATE 1.20、Xfce 4.12 * 长期支持版内核 4.19.0-4 * 新的 Python 3 (3.7.2)、Perl 5.28、PHP 7.3 * iptables 替换为 nftables * 更新 LibreOffice 6.1、GIMP 2.10.8 * 更新 OpenJDK 11、MariaDB 10.3 和 Apache 2.4.38 * 更新 Chromium 73.0、Firefox 60.7 * 改进 UEFI 支持 在这篇文章中,我们将演示如何在你的笔记本电脑和台式电脑上安装 Debian 10 “Buster” 工作站。 Debian 10 建议系统要求: * 2 GB 内存 * 2 GHz 双核处理器 * 10 GB 可用硬盘空间 * 可启动安装介质(USB / DVD) * 网络连接(可选) 让我们跳转到 Debian 10 的安装步骤。 ### 步骤:1)下载 Debian 10 ISO 文件 从它的官方入口网站,下载 Debian 10 ISO 文件, * <https://www.debian.org/releases/buster/debian-installer/> ISO 文件下载完成后刻录它到 USB 或 DVD,使其可用来启动。 ### 步骤:2)使用安装可启动介质(USB / DVD)启动你的电脑系统 重启你将安装 Debian 10 的电脑,转到 BIOS 设置,并设置启动介质为 USB 或 DVD。 用可启动介质启动电脑后,那么我们将看到下面的屏幕。 ![](/data/attachment/album/201907/11/000953azdp6dypi6gzv3g1.jpg) 选择第一个选项 “Graphical Install”。 ### 步骤:3)选择你的首选语言、位置和键盘布局 在这个步骤中,你将被要求选择你的首选语言。 ![](/data/attachment/album/201907/11/000955sijle88s8aeaqmae.jpg) 点击 “Continue”。 选择你的首选位置,电脑系统将依照位置自动设置时区。 ![](/data/attachment/album/201907/11/001007p1vns6j1sts1n1d9.jpg) 现在选择适合于你安装设备的键盘布局。 ![](/data/attachment/album/201907/11/001008b1ys1190xfv9all0.jpg) 点击 “Continue” 以继续。 ### 步骤:4)为 Debian 10 系统设置主机名称和域名 设置适合于你的环境的主机名,然后在 “Continue” 上单击,就我而言, 我指定主机名为 “debian10-buster”。 ![](/data/attachment/album/201907/11/001009mehbsez8ymb6bf6x.jpg) 指定适合于环境的域名,并安装,然后在 “Continue” 上单击。 ![](/data/attachment/album/201907/11/001011dtbrjj88t8q6sisb.jpg) ### 步骤:5)指定 root 用户的密码 在下面的屏幕中指定 root 密码,然后在 “Continue” 上单击。 ![](/data/attachment/album/201907/11/001014wq1jrq1j71871j7z.jpg) ### 步骤:6)创建本地用户和它的密码 在这个步骤中,你将被提示指定本地用户具体信息,如完整的姓名、用户名和密码, ![](/data/attachment/album/201907/11/001018uzuhhhhfpt83zyyu.jpg) 在 “Continue” 上单击。 ![](/data/attachment/album/201907/11/001020jor75z4xfu5orzut.jpg) 在 “Continue” 上单击,并在接下来的窗口中指定密码。 ![](/data/attachment/album/201907/11/001022kqnqb90ddbqzrbdj.jpg) ### 步骤:7)为 Debian 10 选择硬盘分区方案 在这个步骤中,为 Debian 10 选择硬盘分区方案,就我而言,我有 40 GB 硬盘可用于操作系统安装。分区方案有两种类型: * 向导分区(安装器将自动创建需要的分区) * 手动分区(正如名字所示,使用这种方式,我们可以手动创建分区方案) 在这篇教程中,我们将在我 42 GB 硬盘上使用带有 LVM 的向导分区。 ![](/data/attachment/album/201907/11/001025l88v24vvzu4mmeo1.jpg) 在 “Continue” 上单击来继续, ![](/data/attachment/album/201907/11/001045gtkhphfpsdgbrg4l.jpg) 正如我们所视,我大约有 42 GB 硬盘空间,选择 “Continue”。 在接下来的屏幕中,你将被要求选择分区,如果是 Linux 新用户,那么选择第一个选项。假使你想要一个独立的 home 分区,那么选择第二种方案,否则选择第三种方案,它们将为 `/home`、`/var` 和 `/tmp` 创建独立的分区。 就我而言,我将通过选择第三种选项来为 `/home`、`/var` 和 `/tmp` 创建独立的分区。 ![](/data/attachment/album/201907/11/001049nbnmzj3mbonzqhmj.jpg) 在接下来的屏幕中,选择 “yes” 来将更改写到磁盘中,配置 LVM ,然后在 “Continue” 上单击。 ![](/data/attachment/album/201907/11/001056y1qt116fr53mmlmt.jpg) 在接下来的屏幕中,将显示分区表,验证分区大小、文件系统类型和挂载点。 ![](/data/attachment/album/201907/11/001101hwirhwkibwhmkfwx.jpg) 在 “Continue” 上单击来继续, 在接下来的屏幕中,选择 “yes” 来写更改到磁盘中, ![](/data/attachment/album/201907/11/001115toeviietr3cplklk.jpg) 在 “Continue” 上单击来继续安装, ### 步骤:7)Debian 10 安装开始 在这一步骤中,Debian 10 的安装已经开始,并正在进行中, ![](/data/attachment/album/201907/11/001118jwburwkzwwh95bwh.jpg) 在安装期间,安装器将提示你扫描 CD/DVD 以配置软件包管理器,选择 “No” ,然后在 “Continue” 上单击。 ![](/data/attachment/album/201907/11/001126turttprnt0pinupn.jpg) 在接下来的屏幕中,如果你想配置基于网络的软件包管理器选择 “yes” ,但是为了使这个方式工作,要确保你的系统连接到了网络,否则选择 “No”。 ![](/data/attachment/album/201907/11/001131wmwvxr1mmzmkf2zp.jpg) 在 “Continue” 上单击来配置基于你本地的软件包管理器,在接下来的几个屏幕中,你将被提示选择本地和 Debian 软件包存储库 URL ,然后你将获得下面的屏幕。 ![](/data/attachment/album/201907/11/001133u0dn5bunvivo6nb5.jpg) 选择 “No” 来跳过软件包审查步骤,然后在 “Continue” 上单击。 ![](/data/attachment/album/201907/11/001140cj61ckbh6bvb4c8v.jpg) 在接下来的窗口中,你将被提示选择电脑桌面环境和其它软件包,就我而言,我选择 “Gnome Desktop” ,“SSH Server” 和 “Standard System utilities”。 ![](/data/attachment/album/201907/11/001146fcflpjzth77jh4rr.jpg) 在 “Continue” 上单击来继续安装, 选择选项 “yes” 来安装 Grub 引导加载程序。 ![](/data/attachment/album/201907/11/001151fsgbvisgn5bcpbhd.jpg) 在 “Continue” 上单击来继续,然后在接下来的窗口中选择将安装引导加载程序的磁盘(`/dev/sda`)。 ![](/data/attachment/album/201907/11/001157gu78qzlhyun71sxu.jpg) 在 “Continue” 上单击来继续安装,一旦安装完成,安装器将提示我们来重启系统, ![](/data/attachment/album/201907/11/001201xes8sgegg8eigivi.jpg) 在 “Continue” 上单击来重启你的系统,不要忘记在 BIOS 设置中更改启动介质,以便系统从我们已经安装 Debian 10 操作系统的硬盘启动。 ### 步骤:8)启动你新安装的 Debian 10 系统 在成功安装后,一旦我们重启系统,我们将获取下面的引导加载程序屏幕。 ![](/data/attachment/album/201907/11/001206w4k5z51dd3095jv1.jpg) 选择第一个选项 “Debian GNU/Linux” 并敲击回车键。 一旦系统启动,使用我在安装期间创建的本地用户和它的密码。 ![](/data/attachment/album/201907/11/001210obhig8egmyggghkz.jpg) 在成功登录后,将看到如下电脑桌面屏幕, ![](/data/attachment/album/201907/11/001215fp4ip8ddaddddizg.jpg) 这证实 Debian 10 已经成功安装,这就是本文的全部,探索这个令人激动的 Linux 发行版吧,玩得开心 ? --- via: <https://www.linuxtechi.com/debian-10-buster-installation-guide/> 作者:[Pradeep Kumar](https://www.linuxtechi.com/author/pradeep/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[robsean](https://github.com/robsean) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
Debian Project has released its latest and stable operating system as **Debian 10**, code name for Debian 10 is “**Buster**“, this release will get 5 years of support. Debian 10 is available for both 32-bit and 64-bit systems. This release comes with lot of new features, some of them are listed below: - Introduction of new Debian 10 theme known as “ **FuturePrototype**” - Updated Desktop GNOME 3.30, Cinnamon 3.8, KDE Plasma 5.14, MATE 1.20 & Xfce 4.12 - LTS kernel 4.19.0-4 - New Python 3 (3.7.2), Perl 5.28 & PHP 7.3 - Iptables are replaced by nftables - Updated LibreOffice 6.1 & GIMP 2.10.8 - Updated OpenJDK 11, MariaDB 10.3 and Apache 2.4.38 - Updated Chromium 73.0 & Firefox 60.7 - Improved support for UEFI (Unified Extensible Firmware Interface) In this article we will demonstrate how to install Debian 10 “Buster” workstation on your Laptop & Desktop. **Recommended System Requirements for Debian 10** - 2 GB RAM - 2 GHz Dual Core Processor - 10 GB Free Hard disk space - Bootable Installation Media (USB/ DVD) - Internet connectivity (Optional) Let’s jump into the installation steps of Debian 10 #### Step:1) Download Debian 10 ISO file Download the Debian 10 ISO file from its official portal, [https://www.debian.org/releases/buster/debian-installer/](https://www.debian.org/releases/buster/debian-installer/) Once the ISO file is downloaded, burn it either into USB or DVD and make it bootable. #### Step:2) Boot Your System with Installation Bootable Media (USB / DVD) Reboot your system in which you will be installing Debian 10 and go to bios settings and set the boot medium as USB or DVD. Once the system is booted with installation bootable media then we will get the following screen. Choose the First option “**Graphical Install**” #### Step:3) Choose Your preferred Language, Location and Keyboard Layout In this step you will be asked to choose your preferred language Click on Continue Select your preferred location, based on location, time zone will be automatically set for your system. Now Choose your keyboard layout that suits to your installation, Click on Continue to proceed further, #### Step:4) Set Host name and Domain Name for Debian 10 System Set the hostname that suits to your environment and then click on Continue, in my case I am specifying the hostname as “**debian10-buster**” Specify the domain name that suits to environment and installation and then click on Continue #### Step:5) Specify the root user’s password Specify the root password in the screen below and then click on Continue #### Step:6) Create Local User and its password In this step you will be prompted to specify local user details like full name, user name and its password, Click on Continue Click on Continue and specify the password in the next window #### Step:7) Choose Hard Disk Partitioning Scheme for Debian 10 In this step, select partitioning scheme for Debian 10, in my case I have 40 GB hard disk available for OS installation. Partitioning scheme is of two types: - Guided Partitioning (Installer will automatically create required partitions) - Manual Partitioning (As name suggests using this we can create manual partitions scheme) In this tutorial we will use guided partitions with LVM on my 42 GB hard drive, Click on Continue to proceed further, As we can see I have around 42 GB hard disk space, so choose Continue In the next screen, you will be asked to choose partitions, if are a new Linux user then choose the first option and in case you want a separate home partition then choose second option and else third option, which will create a separate partition for /home, /var and /tmp. In my case I am going to create separate partition for /home, /var and /tmp by choosing the third option. In the next screen select “**yes**” to write changes to disk and Configure LVM and then click on Continue In the next screen, partition table will be displayed, cross verify the partitions size, file system type and mount point. Click on Continue to proceed further, In the next screen, choose “yes” to write changes to disk, Click on Continue to proceed with installation, #### Step:7) Debian 10 Installation Started In this step, Installation of Debian 10 has been started and is in progress, During the installation, installer will prompt you to scan CD/DVD for configuring package manager, Choose No and then click on Continue In the next screen choose “yes” if you want to configure Package Manager based on Network but for this to work, make sure your system is connected to Internet, else Choose No Click on continue to configure package manager based on your location, In next couple of screens you will be prompted to choose location and Debian package repository URL, then you will get below screen Choose “No” to skip package survey step and then click on Continue In the next window, you will be prompted to choose Desktop environment and other packages, in my case I am selecting **Gnome Desktop**, **SSH Server** and **Standard System utilities** Click on Continue to proceed with Installation, Choose the option “yes” to install Grub Boot Loader Click on Continue to proceed further, then in the next window choose the disk (/dev/sda) on which bootloader will be installed Click on Continue to proceed with installation, Once the installation is completed then installer will prompt us to reboot the system, Click on Continue to reboot your system and don’t forget to change boot medium from Bios settings so that system boots up with hard disk on which we have installed Debian 10 OS. #### Step:8) Boot your newly installed system with Debian 10 Once we reboot the system after the successful installation we will get below bootloader screen Choose the first option “**Debian GNU/Linux**” and hit enter, Once the system boots up, use the same local user and its password that we have created during the installation, Following will be Desktop screen after successful login, This confirms that Debian 10 has been installed successfully, that’s all from this article, explore this exciting Linux Distribution and have fun ? Read More on : [How to dual boot Windows 10 and Debian 10](https://www.linuxtechi.com/dual-boot-windows-10-debian-10/) Read Also : [Top 8 Things to do after Installing Debian 10 (Buster)](https://www.linuxtechi.com/things-to-do-after-installing-debian-10/) Kabeer SayeedDear Mr. Pradeep Kumar: 1. Thank you very much for the description of the installation procedure for Debian 10. 2. There are numerous ISO files. Which one(s) should be downloaded? For example, I have downloaded the following ISO file which seems applicable to the KDE desktop: 2.1. debian-live-10.0.0-amd64-kde.iso 3. There seem to be numerous ISO files that could be downloaded. 4. Kindly clarify. Yours truly, Kabeer Sayeed Pradeep KumarHi Kabeer, You can download DVD ISO file which will have all Desktops environments and all other required packages. Below is the url ‘https://cdimage.debian.org/debian-cd/current/amd64/iso-dvd/’ T.N.GThank you very much, your installation procedure for Debian 10 was very helpful. Jim RodgersThank you very much for this guide, especially setting up LVM. I have not been able to set up LVM manually and wonder if you have any insight. Manual setup is needed since I have a Windows system partition as the first partition on the drive. The problem/error that occurs, is that the installer finds “no root” defined. Indeed the list of LVs show no root. I do not know how to specify a root either inside or outside of the LG. Your advice will be greatly appreciated. Atul Kumar PandeyThanks for the great tutorial, I was stuck on the CD/DVD screen and I was looking for what kind of file it is looking for, but your step-by-step guide helped me a lot. Once again thanks for the detailed article.
11,086
MacOS 系统中如何设置 Python 虚拟环境
https://opensource.com/article/19/6/virtual-environments-python-macos
2019-07-11T12:46:41
[ "Python" ]
https://linux.cn/article-11086-1.html
> > 使用 pyenv 和 virtualwrapper 来管理你的虚拟环境,可以避免很多困惑。 > > > ![](/data/attachment/album/201907/11/124645ns3ndlpnaqlgaasp.jpg) 作为 Python 开发者和 MacOS 用户,拿到新机器首先要做的就是设置 Python 开发环境。下面是最佳实践(虽然我们已经写过 [在 MacOS 上管理 Python 的其它方法](https://opensource.com/article/19/5/python-3-default-macos))。 ### 预备 首先,打开终端,在其冰冷毫无提示的窗口输入 `xcode-select --install` 命令。点击确认后,基本的开发环境就会被配置上。MacOS 上需要此步骤来设置本地开发实用工具库,根据 [OS X Daily](http://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/) 的说法,其包括 ”许多常用的工具、实用程序和编译器,如 make、GCC、clang、perl、svn、git、size、strip、strings、libtool、cpp、what 及许多在 Linux 中系统默认安装的有用命令“。 接下来,安装 [Homebrew](https://brew.sh/), 执行如下的 Ruby 脚本。 ``` ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ``` 如果你像我一样,对随意就运行的来源于互联网的脚本心存疑虑的话,可以点击上面的脚本去仔细看看其具体功能。 一旦安装完成后,就恭喜了,你拥有了一个优秀的包管理工具。自然的,你可能接下来会执行 `brew install python` 或其他的命令。不要这样,哈哈!Homebrew 是为我们提供了一个 Python 的管理版本,但让此工具来管理我们的 Python 环境话,很快会失控的。我们需要 [pyenv](https://github.com/pyenv/pyenv),一款简单的 Python 版本管理工具,它可以安装运行在 [许多操作系统](https://github.com/pyenv/pyenv/wiki) 上。运行如下命令: ``` $ brew install pyenv ``` 想要每次打开命令提示框时 `pyenv` 都会运行的话,需要把下面的内容加入你的配置文件中(MacOS 中默认为 `.bash_profile`,位于家目录下): ``` $ cd ~/ $ echo 'eval "$(pyenv init -)"' >> .bash_profile ``` 添加此行内容后,每个终端都会启动 `pyenv` 来管理其 `PATH` 环境变量,并插入你想要运行的 Python 版本(而不是在环境变量里面设置的初始版本。更详细的信息,请阅读 “[如何给 Linux 系统设置 PATH 变量](https://opensource.com/article/17/6/set-path-linux)”)。打开新的终端以使修改的 `.bash_profile` 文件生效。 在安装你中意的 Python 版本前,需要先安装一些有用的工具,如下示: ``` $ brew install zlib sqlite ``` `pyenv` 依赖于 [zlib](https://zlib.net/) 压缩算法和 [SQLite](https://www.sqlite.org/index.html) 数据库,如果未正确配置,往往会[导致构建问题](https://github.com/pyenv/pyenv/wiki/common-build-problems#build-failed-error-the-python-zlib-extension-was-not-compiled-missing-the-zlib)。将这些导出配置命令加入当前的终端窗口执行,确保它们安装完成。 ``` $ export LDFLAGS="-L/usr/local/opt/zlib/lib -L/usr/local/opt/sqlite/lib" $ export CPPFLAGS="-I/usr/local/opt/zlib/include -I/usr/local/opt/sqlite/include" ``` 现在准备工作已经完成,是时候安装一个适合于现代人的 Python 版本了: ``` $ pyenv install 3.7.3 ``` 去喝杯咖啡吧,挑些豆类,亲自烧烤,然后品尝。说这些的意思是上面的安装过程需要一段时间。 ### 添加虚拟环境 一旦完成,就可以愉快地使用虚拟环境了。如没有接下来的步骤的话,你只能在你所有的工作项目中共享同一个 Python 开发环境。使用虚拟环境来隔离每个项目的依赖关系的管理方式,比起 Python 自身提供的开箱即用功能来说,更加清晰明确和更具有重用性。基于这些原因,把 `virtualenvwrapper` 安装到 Python 环境中吧: ``` $ pyenv global 3.7.3 # Be sure to keep the $() syntax in this command so it can evaluate $ $(pyenv which python3) -m pip install virtualenvwrapper ``` 再次打开 `.bash_profile` 文件,把下面内容添加进去,使得每次打开新终端时它都有效: ``` # We want to regularly go to our virtual environment directory $ echo 'export WORKON_HOME=~/.virtualenvs' >> .bash_profile # If in a given virtual environment, make a virtual environment directory # If one does not already exist $ echo 'mkdir -p $WORKON_HOME' >> .bash_profile # Activate the new virtual environment by calling this script # Note that $USER will substitute for your current user $ echo '. ~/.pyenv/versions/3.7.3/bin/virtualenvwrapper.sh' >> .bash_profile ``` 关掉终端再重新打开(或者运行 `exec /bin/bash -l` 来刷新当前的终端会话),你会看到 `virtualenvwrapper` 正在初始化环境配置: ``` $ exec /bin/bash -l virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/premkproject virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/postmkproject virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/initialize virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/premkvirtualenv virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/postmkvirtualenv virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/prermvirtualenv virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/postrmvirtualenv virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/predeactivate virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/postdeactivate virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/preactivate virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/postactivate virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/get_env_details ``` 从此刻开始,你的所有工作都是在虚拟环境中的,其允许你使用临时环境来安全地开发。使用此工具链,你可以根据工作所需,设置多个项目并在它们之间切换: ``` $ mkvirtualenv test1 Using base prefix '/Users/moshe/.pyenv/versions/3.7.3' New python executable in /Users/moshe/.virtualenvs/test1/bin/python3 Also creating executable in /Users/moshe/.virtualenvs/test1/bin/python Installing setuptools, pip, wheel... done. virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test1/bin/predeactivate virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test1/bin/postdeactivate virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test1/bin/preactivate virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test1/bin/postactivate virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test1/bin/get_env_details (test1)$ mkvirtualenv test2 Using base prefix '/Users/moshe/.pyenv/versions/3.7.3' New python executable in /Users/moshe/.virtualenvs/test2/bin/python3 Also creating executable in /Users/moshe/.virtualenvs/test2/bin/python Installing setuptools, pip, wheel... done. virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test2/bin/predeactivate virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test2/bin/postdeactivate virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test2/bin/preactivate virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test2/bin/postactivate virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test2/bin/get_env_details (test2)$ ls $WORKON_HOME get_env_details postmkvirtualenv premkvirtualenv initialize postrmvirtualenv prermvirtualenv postactivate preactivate test1 postdeactivate predeactivate test2 postmkproject premkproject (test2)$ workon test1 (test1)$ ``` 此处,使用 `deactivate` 命令可以退出当前环境。 ### 推荐实践 你可能已经在比如 `~/src` 这样的目录中添加了长期的项目。当要开始了一个新项目时,进入此目录,为此项目增加子文件夹,然后使用强大的 Bash 解释程序自动根据你的目录名来命令虚拟环境。例如,名称为 “pyfun” 的项目: ``` $ mkdir -p ~/src/pyfun && cd ~/src/pyfun $ mkvirtualenv $(basename $(pwd)) # we will see the environment initialize (pyfun)$ workon pyfun test1 test2 (pyfun)$ deactivate $ ``` 当需要处理此项目时,只要进入该目录,输入如下命令重新连接虚拟环境: ``` $ cd ~/src/pyfun (pyfun)$ workon . ``` 初始化虚拟环境意味着对 Python 版本和所加载的模块的时间点的拷贝。由于依赖关系会发生很大的改变,所以偶尔需要刷新项目的虚拟环境。这种情况,你可以通过删除虚拟环境来安全的执行此操作,源代码是不受影响的,如下所示: ``` $ cd ~/src/pyfun $ rmvirtualenv $(basename $(pwd)) $ mkvirtualenv $(basename $(pwd)) ``` 这种使用 `pyenv` 和 `virtualwrapper` 管理虚拟环境的方法可以避免开发环境和运行环境中 Python 版本的不一致出现的苦恼。这是避免混淆的最简单方法 - 尤其是你工作的团队很大的时候。 如果你是初学者,正准备配置 Python 环境,可以阅读下 [MacOS 中使用 Python 3](https://opensource.com/article/19/5/python-3-default-macos) 文章。 你们有关于 Python 相关的问题吗,不管是初学者的还是中级使用者的?给我们留下评论信息,我们在下篇文章中会考虑讲解。 --- via: <https://opensource.com/article/19/6/virtual-environments-python-macos> 作者:[Matthew Broberg](https://opensource.com/users/mbbroberg/users/moshez/users/mbbroberg/users/moshez) 选题:[lujun9972](https://github.com/lujun9972) 译者:[runningwater](https://github.com/runningwater) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
301
Moved Permanently
null
11,088
如何在 Mac 上配置 Kubernetes
https://cn.ubuntu.com/blog/how-to-install-kubernetes-on-mac
2019-07-11T23:21:22
[ "MicroK8s", "Kubernetes" ]
https://linux.cn/article-11088-1.html
![](/data/attachment/album/201907/11/232103nkj6zwgp4jl4n47z.jpg) Mac 用户可使用 MicroK8s 运行 Kubernetes 环境,进而开发、测试应用。通过下面的步骤可轻松搭建此环境。 [MicroK8s](https://microk8s.io/) 是一个 Ubuntu 推出的一个本地的 Kubernetes 版本。它是一个轻量级的 snap 应用,可安装到 PC 上作为一个单节点集群使用。尽管 MicroK8s 仅针对 Linux 构建,但是也可以在 Mac 上启动 Ubuntu VM 来实现。 MicroK8s 可在 Ubuntu 和任意支持 snap 的 OS 上运行全部[原生的 K8s 服务](https://ubuntu.com/blog/how-to-deploy-production-ready-kubernetes)。这对于开发应用,创建简单的 K8s 集群和本地微服务开发非常有帮助,所有的开发工作最终都还是需要部署的。 MicroK8s 提供另一个级别的可靠性因为它提供了与当前 Kubernetes(以下简称 Kubernetes 为 K8s)版本一致的开发环境。 在[最新的上游 K8s](https://ubuntu.com/kubernetes/install) 发布后的一周内,在 Ubuntu 上即可使用。 ### 在 Mac 上配置 Kubernetes K8s 和 MicroK8s 都需要一个 Linux 内核来工作,因此二者都需要 Ubuntu 环境。Mac 用户可使用 Multipass,此工具被设计为方便用户在 Mac、Windows、Linux 上开启 Ubuntu VM(虚拟)环境。 下面的教程将介绍在 Mac 上配置 Multipass 和运行 K8s。 #### 步骤1:使用 Multipass 为 Mac 安装一个 VM 最新的 [Multipass 的程序包可在 GitHub 上](https://github.com/CanonicalLtd/multipass/releases)找到,双击 .pkg 即可安装。用 MicroK8s 来启动一个 VM: ``` multipass launch --name microk8s-vm --mem 4G --disk 40G multipass exec microk8s-vm -- sudo snap install microk8s --classic multipass exec microk8s-vm -- sudo iptables -P FORWARD ACCEPT ``` 确保为主机保留足够的资源。上述命令表示我们创建了一个名字为 microk8s-vm 的 VM,分配了 4GB 内存和 40GB 硬盘。 使用以下命令来查看 VM 分配的 IP 地址:(记一下下面的 IP,我们将从此开始) ``` multipass list Name State IPv4 Release microk8s-vm RUNNING 192.168.64.1 Ubuntu 18.04 LTS ``` #### 步骤2:在 VM 上与 MicroK8s 互动 可使用以下 3 种方式: 命令行,用 Multipass 的 shell 提示符: ``` multipass shell microk8s-vm ``` 用 `multipass exec` 来执行一个命令(输入后无提示): ``` multipass exec microk8s-vm -- /snap/bin/microk8s.status ``` 调用运行在 VM 的 K8s API 服务器,这里使用 MicroK8s 的 kubeconfig 文件和一个[本地的安装的 kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) 来访问 VM 内的 K8s,运行以下命令: ``` multipass exec microk8s-vm -- /snap/bin/microk8s.config > kubeconfig ``` 下一步,在本地主机安装 kubectl,然后使用 kubeconfig: ``` kubectl --kubeconfig=kubeconfig get all --all-namespaces ``` ``` NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE Default service/kubernetes ClusterIP 10.152.183.1 <none> 443/TCP 3m12s ``` #### 步骤 3:用 Mutlpass 服务访问 VM 并开启 MicroK8s 组件 配置基础的 MicroK8s 组件是开启 Grafana 仪表,下面我们将展示一步开启 Grafana,监视和分析一个 MicroK8s 实例。可执行以下命令: ``` multipass exec microk8s-vm -- /snap/bin/microk8s.enable dns dashboard Enabling DNS Applying manifest service/kube-dns created serviceaccount/kube-dns created configmap/kube-dns created deployment.extensions/kube-dns created Restarting kubelet DNS is enabled Enabling dashboard secret/kubernetes-dashboard-certs created serviceaccount/kubernetes-dashboard created deployment.apps/kubernetes-dashboard created service/kubernetes-dashboard created service/monitoring-grafana created service/monitoring-influxdb created service/heapster created deployment.extensions/monitoring-influxdb-grafana-v4 created serviceaccount/heapster created configmap/heapster-config created configmap/eventer-config created deployment.extesions/heapster-v1.5.2 created dashboard enabled ``` 接下来,用下面命令检查部署进程: ``` multipass exec microk8s-vm -- /snap/bin/microk8s.kubectl get all --all-namespaces ``` 返回信息如下: ![](/data/attachment/album/201907/11/232126fd957yz19zjeuyfy.png) 一旦所有的必要服务已开启,接下来使用以下的链接访问仪表。命令如下: ``` multipass exec microk8s-vm -- /snap/bin/microk8s.kubectl cluster-info Kubernetes master is running at https://127.0.0.1:16443 Heapster is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/heapster/proxy KubeDNS is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy Grafana is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/monitoring-grafana/proxy InfluxDB is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/monitoring-influxdb:http/proxy To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'. ``` 如果我们在 VM 内,可以用此链接来访问 Grafana 仪表。不过,我们可以通过代理在主机上访问。 ``` multipass exec microk8s-vm -- /snap/bin/microk8s.kubectl proxy --address='0.0.0.0' --accept-hosts='.*' Starting to serve on [::][::]:8001 ``` 保持终端运行状态,记一下端口号(8001),我们在下一步需要用到。要访问 Grafana 仪表,我们需要修改 VM 内仪表的链接: * 使用 VM 的 IP 替换 127.0.0.1(`multipass info microk8s-vm`) * 将端口(16443)替换为代理端口 8001。 * 在浏览器内输入这个链接地址:`https://127.0.0.1:8001/api/v1/namespaces/kube-system/services/monitoring-grafana/proxy`,你将看到 Grafana 仪表,如下图: ![](/data/attachment/album/201907/11/232127jgd0o9oodtdr5ado.png) ### 总结 使用 MicroK8s 在本地开发和测试应用,将使得团队在部署上更快,这对于开发者和 DevOp 团队来说是非常有价值和意义的。 ![](/data/attachment/album/201907/11/232127l52rrqvzntxqpprq.png)
200
# 如何在Mac上配置Kubernetes by liam zheng on 9 July 2019 Mac用户可使用MicroK8s运行Kubernetes环境进而开发、测试应用。通过下面的步骤可轻松搭建此环境。 [MicroK8s](https://microk8s.io/) 是一个Ubuntu推出的一个本地的Kubernetes版本。它是一个轻量级的snap应用,可安装到PC上作为一个单节点集群使用。尽管MicroK8s仅针对Linux构建,但是也可以在Mac上启Ubuntu VM来实现。 MicroK8s可在Ubuntu和任意支持snap的OS上运行[全部原生的Kubernetes服务](https://ubuntu.com/blog/how-to-deploy-production-ready-kubernetes)。这对于开发应用,创建简单的K8s集群和本地微服务开发非常有帮助,所有的开发工作最终都还是需要部署的。 MicroK8s提供另一个级别的可靠性因为它提供了与当前[Kubernetes](https://cn.ubuntu.com/blog/canonical-kubernetes-1-15-upgrade)版本一致的开发环境。 在[最新的上游K8s](https://ubuntu.com/kubernetes/install)发布后的一周内,在Ubuntu上即可使用。(以下简称Kubernetes为K8s) ## 在Mac上配置Kubernetes K8s和MicroK8s都需要一个Linux内核来工作,因此2者都需要Ubuntu环境。Mac用户可使用Multipass,此工具被设计为方便用户在Mac、Windows、Linux上开启Ubuntu VM(虚拟)环境。 下面的教程将介绍在Mac上配置Multipass和运行K8s。 #### 步骤1:使用Multipass为Mac安装一个VM 最新的[Multipass的程序包可在Github上](https://github.com/CanonicalLtd/multipass/releases)找到,双击.pkg即可安装。用MicroK8s来启动一个VM: multipass launch --name microk8s-vm --mem 4G --disk 40G multipass exec microk8s-vm -- sudo snap install microk8s --classic multipass exec microk8s-vm -- sudo iptables -P FORWARD ACCEPT 确保为主机保留足够的资源。上述命令表示我们创建了一个名字为microk8s-vm的VM,分配了4GB内存和40GB硬盘。 使用以下命令来查看VM分配的IP地址:(记一下下面的IP,我们将从此开始) multipass list Name State IPv4 Release microk8s-vm RUNNING 192.168.64.1 Ubuntu 18.04 LTS #### 步骤2:在VM上与MicroK8s互动 可使用以下3种方式: 命令行:用Multipass的shell 提示: multipass shell microk8s-vm 用multipass exec来执行一个命令(输入后无提示) multipass exec microk8s-vm -- /snap/bin/microk8s.status 调用运行在VM的K8s API服务器,这里使用MicroK8s kubeconfig文件和一个[本地的安装的kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)来访问VM内的K8s,运行以下命令: multipass exec microk8s-vm -- /snap/bin/microk8s.config > kubeconfig 下一步,在本地主机安装kubectl,然后使用kubeconfig: kubectl --kubeconfig=kubeconfig get all --all-namespaces NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE Default service/kubernetes ClusterIP 10.152.183.1 <none> 443/TCP 3m12s #### 步骤3:用Mutlpass服务访问VM并开启MicroK8s组件 配置基础的MicroK8s组件是开启Grafana仪表,下面我们将展示一步开启Grafana,监视和分析一个MicroK8s实例。可执行以下命令:multipass exec microk8s-vm -- /snap/bin/microk8s.enable dns dashboard Enabling DNS Applying manifest service/kube-dns created serviceaccount/kube-dns created configmap/kube-dns created deployment.extensions/kube-dns created Restarting kubelet DNS is enabled Enabling dashboard secret/kubernetes-dashboard-certs created serviceaccount/kubernetes-dashboard created deployment.apps/kubernetes-dashboard created service/kubernetes-dashboard created service/monitoring-grafana created service/monitoring-influxdb created service/heapster created deployment.extensions/monitoring-influxdb-grafana-v4 created serviceaccount/heapster created configmap/heapster-config created configmap/eventer-config created deployment.extesions/heapster-v1.5.2 created dashboard enabled 接下来,用下面命令检查部署进程: multipass exec microk8s-vm -- /snap/bin/microk8s.kubectl get all --all-namespaces 返回信息如下: 一旦所有的必要服务已开启,接下来使用以下的链接访问仪表。命令如下: multipass exec microk8s-vm -- /snap/bin/microk8s.kubectl cluster-info Kubernetes master is running at https://127.0.0.1:16443 Heapster is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/heapster/proxy KubeDNS is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy Grafana is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/monitoring-grafana/proxy InfluxDB is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/monitoring-influxdb:http/proxy To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'. 如果我们在VM内,可以用此链接来访问Grafana仪表。不过,我们可以通过代理在主机上访问。 multipass exec microk8s-vm -- /snap/bin/microk8s.kubectl proxy --address='0.0.0.0' --accept-hosts='.*' Starting to serve on [::][::]:8001 保持终端运行状态,记一下端口号(8001),我们在下一步需要用到。要访问Grafana仪表,我们需要修改VM内仪表的链接: ## 总结 使用MicroK8s在本地开发和测试应用,将使得团队在部署上更快,这对于开发者和DevOp团队来说是非常有价值和意义的。 ##### 订阅博客文章 ### 查看更多内容 #### [ Charmed PostgreSQL 全面上市 ](/blog/charmed-postgresql_cn) 值得信赖的企业级 PostgreSQL Canonical 正式发布 Charmed PostgreSQL,这是一款企业级解决方案,有助于确保安全性,可自动完成 PostgreSQL 数据库在私有云和公共云上的部署、维护和升级。 PostgreSQL 是一个开源数据库管理系统。已在 IT 领域应用超过 30 年。成熟的技术、活跃的社群使其始终成为开发人员的首选 DBMS。 Canonical 推出的 Charmed PostgreSQL 便以此为基础进行构建并提供额外的功能,能够满足您的一切企业需求: 长达 10 年的安全维护和支持 订阅 Ubuntu Pro,即可购买 Charmed PostgreSQL 安全与支持服务。Ubuntu Pro 订阅提供长达 10 年的安 […] #### [ 首席信息安全官对欧盟《网络弹性法案》的全面解析 ](/blog/a-cisos-comprehensive-breakdown-of-the-cyber-resilience-act_cn) 强有力的、影响广泛的监管政策可以为社会提供安全保障,但也可能带来不确定性。事实证明,《网络弹性法案》(Cyber Resilience Act,CRA)也并不例外。在开源领域乃至更广泛的技术领域,人们对该法案的推行一直有着各种不同的反应——或是担忧,或是焦虑,或是充满希望。 但哪些方面会让人担心呢?CRA 真的会给开源领域带来变化吗?您的团队应该如何针对这项法规做好准备?在本文中,笔者将深入探讨 CRA 及其目的、要求和对开源领域的影响,并就对于 CRA 的准备给出个人的网络安全建议。 什么是《网络弹性法案》(CRA)? CRA 是欧盟即将出台的一项法规,旨在通过对欧盟 IT 行业实施更严格的网络安全、文档和漏洞报告要求,提高设备安全性。该法规将适用于硬件、设备、软件、 […] #### [ Canonical 为任何 open source Docker 镜像提供 12 年长期支持 ](/blog/canonical-offers-12-year-lts-for-any-open-source-docker-image_cn) “Everything LTS 计划”— Canonical 将根据客户的规格要求构建 distroless Docker 镜像,其中包括 Ubuntu 中未打包的上游组件,并在 24 小时内修复关键的 CVE 漏洞,在 RHEL、Ubuntu、VMware 或公共云 K8s 上畅享长达 12 年以上的支持。 Canonical 将其 LTS 产品扩展到 Ubuntu 的 “deb” 包以外,并推出了一项新的 distroless Docker 镜像设计与构建服务,该项服务为任何开源应用程序或依赖项均提供 12 年的安全维护,无论该软件是否是 Ubuntu 中已打包的软件。 「Everything LTS 计划意味着 CVE 维护将覆盖您的整个开源依赖项树,包括 Ubun […]
11,089
使用 xclip 在 Linux 命令行中复制粘贴
https://opensource.com/article/19/7/xclip
2019-07-12T11:46:55
[ "复制", "粘贴" ]
https://linux.cn/article-11089-1.html
> > 了解如何在 Linux 中使用 xclip。 > > > ![](/data/attachment/album/201907/12/114625cu6ayuvvvm5pgfs4.jpg) 在使用 Linux 桌面工作时,你通常如何复制全部或部分文本?你可能会在文本编辑器中打开文件,选择全部或仅选择要复制的文本,然后将其粘贴到其他位置。 这样没问题。但是你可以使用 [xclip](https://github.com/astrand/xclip) 在命令行中更有效地完成工作。`xclip` 提供了在终端窗口中运行的命令与 Linux 图形桌面环境中的剪贴板之间的管道。 ### 安装 xclip `xclip` 并不是许多 Linux 发行版的标准套件。要查看它是否已安装在你的计算机上,请打开终端窗口并输入 `which xclip`。如果该命令返回像 `/usr/bin/xclip` 这样的输出,那么你可以开始使用了。否则,你需要安装 `xclip`。 为此,请使用你的发行版的包管理器。如果你喜欢冒险,你可以[从 GitHub 获取源代码](https://github.com/astrand/xclip)并自己编译。 ### 基础使用 假设你要将文件的内容复制到剪贴板。在 `xclip` 中可以使用两种方法。输入: ``` xclip file_name ``` 或者 ``` xclip -sel clip file_name ``` 两个命令之间有什么区别(除了第二个命令更长)?第一个命令在你使用鼠标中键粘贴的情况下有效。但是,不是每个人都这样做。许多人习惯使用右键单击菜单或按 `Ctrl+V` 粘贴文本。如果你时其中之一(我就是!),使用 `-sel clip` 选项可确保你可以粘贴要粘贴的内容。 ### 将 xclip 与其他应用一起使用 将文件内容直接复制到剪贴板是个巧妙的技巧。很可能你不会经常这样做。还有其他方法可以使用 `xclip`,其中包括将其与另一个命令行程序结合。 结合是用管道(`|`)完成的。管道将一个命令行程序的输出重定向到另一个命令行程序。这样我们就会有更多的可能性,我们来看看其中的三个。 假设你是系统管理员,你需要将日志文件的最后 30 行复制到 bug 报告中。在文本编辑器中打开文件,向下滚动到最后,复制和粘贴有一点工作量。为什么不使用 `xclip` 和 [tail](https://en.wikipedia.org/wiki/Tail_(Unix)) 来快速轻松地完成?运行此命令以复制最后 30 行: ``` tail -n 30 logfile.log | xclip -sel clip ``` 我的写作有相当一部分用于内容管理系统 (CMS) 或者在其他网络中发布。但是,我从不使用 CMS 的 WYSIWYG 编辑器来编写 - 我采用 [Markdown](https://gumroad.com/l/learnmarkdown) 格式离线编写[纯文本](https://plaintextproject.online)。也就是说,许多编辑器都有 HTML 模式。通过使用此命令,我可以使用 [Pandoc](https://pandoc.org) 将 Markdown 格式的文件转换为 HTML 并将其一次性复制到剪贴板: ``` pandoc -t html file.md | xclip -sel clip ``` 在其他地方,粘贴完成。 我的两个网站使用 [GitLab Pages](https://docs.gitlab.com/ee/user/project/pages/) 托管。我使用名为 [Certbot](https://certbot.eff.org/) 的工具为这些站点生成 HTTPS 证书,每当我更新它时,我需要将每个站点的证书复制到 GitLab。结合 [cat](https://en.wikipedia.org/wiki/Cat_(Unix)) 命令和 xclip 比使用编辑器更快,更有效。例如: ``` cat /etc/letsencrypt/live/website/fullchain.pem | xclip -sel clip ``` 这就是全部可以用 xclip 做的事么?当然不是。我相信你可以找到更多用途来满足你的需求。 ### 最后总结 不是每个人都会使用 `xclip`。没关系。然而,它是一个在你需要它时非常方便的一个小工具。而且,正如我几次发现的那样,你不知道什么时候需要它。等到时候,你会很高兴能用上 `xclip`。 --- via: <https://opensource.com/article/19/7/xclip> 作者:[Scott Nesbitt](https://opensource.com/users/scottnesbitt) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
How do you usually copy all or part of a text file when working on the Linux desktop? Chances are you open the file in a text editor, select all or just the text you want to copy, and paste it somewhere else. That works. But you can do the job a bit more efficiently at the command line using the [xclip](https://github.com/astrand/xclip) utility. xclip provides a conduit between commands you run in a terminal window and the clipboard in a Linux graphical desktop environment. ## Installing xclip xclip isn't standard kit with many Linux distributions. To see if it's installed on your computer, open a terminal window and type **which xclip**. If that command returns output like */usr/bin/xclip*, then you're ready to go. Otherwise, you need to install xclip. To do that, use your distribution's package manager. Or, if you're adventurous, [grab the source code](https://github.com/astrand/xclip) from GitHub and compile it yourself. ## Doing the basics Let's say you want to copy the contents of a file to the clipboard. There are two ways to do that with xclip. Type either: `xclip file_name` or `xclip -sel clip file_name` What's the difference between the two commands (aside from the second one being longer)? The first command works if you use the middle button on the mouse to paste text. However, not everyone does. Many people are conditioned to use a right-click menu or to press Ctrl+V to paste text. If you're one of those people (I am!), using the **-sel clip** option ensures you can paste what you want to paste. ## Using xclip with other applications Copying the contents of a file directly to the clipboard is a neat parlor trick. Chances are, you won't be doing that very often. There are other ways you can use xclip, and those involve pairing it with another command-line application. That pairing is done with a *pipe* (|). The pipe redirects the output of one command line application to another. Doing that opens several possibilities. Let's take a look at three of them. Say you're a system administrator and you need to copy the last 30 lines of a log file into a bug report. Opening the file in a text editor, scrolling down to the end, and copying and pasting is a bit of work. Why not use xclip and the [tail](https://en.wikipedia.org/wiki/Tail_(Unix)) utility to quickly and easily do the deed? Run this command to copy those last 30 lines: `tail -n 30 logfile.log | xclip -sel clip` Quite a bit of my writing goes into some content management system (CMS) or another for publishing on the web. However, I never use a CMS's WYSIWYG editor to write—I write offline in [plain text](https://plaintextproject.online) formatted with [Markdown](https://gumroad.com/l/learnmarkdown). That said, many of those editors have an HTML mode. By using this command, I can convert a Markdown-formatted file to HTML using [Pandoc](https://pandoc.org) and copy it to the clipboard in one fell swoop: `pandoc -t html file.md | xclip -sel clip` From there, I paste away. Two of my websites are hosted using [GitLab Pages](https://docs.gitlab.com/ee/user/project/pages/). I generate the HTTPS certificates for those sites using a tool called [Certbot](https://certbot.eff.org/), and I need to copy the certificate for each site to GitLab whenever I renew it. Combining the [cat](https://en.wikipedia.org/wiki/Cat_(Unix)) command and xclip is faster and more efficient than using an editor. For example: `cat /etc/letsencrypt/live/website/fullchain.pem | xclip -sel clip` Is that all you can do with xclip? Definitely not. I'm sure you can find more uses to fit your needs. ## Final thoughts Not everyone will use xclip. That's fine. It is, however, one of those little utilities that really comes in handy when you need it. And, as I've discovered on a few occasions, you don't know when you'll need it. When that time comes, you'll be glad xclip is there. ## 8 Comments
11,091
穿越到 1983 年学习 BASIC
https://twobithistory.org/2018/09/02/learning-basic.html
2019-07-12T12:57:00
[ "BASIC" ]
https://linux.cn/article-11091-1.html
![](/data/attachment/album/201907/12/125743p495dqnqdtctqzgp.jpg) 1983 年时我还没出生,这让我略有一些遗憾。但我特别遗憾的是,是我没有经历过 8 位计算机时代的到来,因为我认为那些初次接触到还相对简单和受限的计算机的人们,拥有超过如今的我们的巨大优势。 今天,(几乎)每个人知道如何使用计算机,但是即使是在计算机行业当中,也很少有人能明白任何一台计算机内部的所有内容。现在软件分为[如此多的层次](https://www.youtube.com/watch?v=kZRE7HIO3vk),做的是如此不同的事情,没有哪个人能知道哪些是必不可少的。而在 1983 年,家用电脑足够傻大粗,努力一些的人就能了解到一台特定的计算机是如何工作的。那样的一个人可能不会像今天的我觉得操作系统那么神秘,因为如今的操作系统已经在硬件上叠加了太多的抽象层。我希望这些抽象层逐一引入以易于理解;而今天,新的程序员们不得不自上而下、按时间回溯地尝试理解它们。 很多著名的程序员,尤其在计算机游戏行业,孩童时期就在苹果 II 和 Commodore 64 这样的 8 位计算机上开始编写游戏,John Romero、Richard Garriott 和 Chris Roberts 都是这样的例子。这好理解。在 8 位计算机时代,很多游戏只能在计算机杂志和[书籍](https://en.wikipedia.org/wiki/BASIC_Computer_Games)中以印刷的 BASIC 程序清单方式得到。如果你想玩其中一款游戏,就必须手工键入整个程序。不可避免的,你可能遇到一些问题,所以你就得调试你的程序。等到你让它可以工作起来了,你就已经对程序是如何运行的有了足够的了解,你就可以开始自己修改它了。如果你是一个狂热的游戏玩家,你几乎必然会成为一名优秀的程序员。 在我的童年时期我也玩电脑游戏。但是我玩的游戏是在 CD-ROM 上的。我有时发现我自己必须得搜索一下如何修复崩溃的安装程序,这可能涉及编辑 Windows 注册表之类的东西。可能是这种小故障的排除让我感觉很棒,所以我才考虑在大学里学习计算机科学。但是在大学中从不教我一些计算机如何工作的或如何控制它们的关键性的东西。 当然,现在我可以告诉计算机去干什么。尽管如此,我还是不禁感到,我缺少一些根本的见解 —— 只有那些伴随着更简单的计算机编程而成长的人才有的深刻见解。我不禁在想,如果在上世纪 80 年代初就接触到计算机会是什么样子?它们与今天使用计算机的体验相比有何不同? 这篇文章将与通常的 Two-Bit History 的文章有一点不同,因为我将为这些问题尝试设想一个答案。 ### 1983 就在上周,你在电视上看到了 [Commodore 64 的广告](https://www.youtube.com/watch?v=ZekAbt2o6Ms) ,现在 M\*A\*S\*H 播完了(LCTT 译注: 这是一部上世纪 70 年代初的电视剧),星期一晚上你可以找点新的事情做了。这个 Commodore 64 甚至看起来比鲁迪(LCTT 译注:应该是下文中拥有 Apple II 的人)的家人放在他们家地下室的 Apple II 更好。而且,广告中吹嘘说新的计算机会让你的朋友们“挤破”你家的大门。你知道学校里的几个家伙宁愿在你家闲逛,也不愿去鲁迪家里,只要他们能玩 Zork 就行。 所以,你得说服你的父母去买一台。你的母亲说,这事可以考虑,只要你不去游戏厅玩街机就给你买一台家庭电脑。虽然不太情愿,但是你还是同意了。而你的父亲则想,他可以用 MultiPlan (LCTT 译注:电子表格程序)跟踪家庭的资金状况,MultiPlan 是他曾听说过的一个电子表格程序,这就是为什么这台计算机被放在客厅的原因。然而,一年后,你仍然是唯一使用它的人。最终,他们同意你把它搬到了你的卧室的桌子上,正好位于你的警察海报下方。 (你的姐姐对这个决定表示抗议,但是,在 1983 年电脑这种东西[并不适合女孩](https://www.npr.org/sections/money/2014/10/21/357629765/when-women-stopped-coding)。) 你的父亲在下班路上从 [ComputerLand](https://www.youtube.com/watch?v=MA_XtT3VAVM) 那里把它捎了回来。你俩把盒子放置在电视机的旁边,并打开了它。外包装上说“欢迎来到友好的计算机世界”。而二十分钟以后你就不再信这句话了 —— 你俩仍然在尝试把 Commodore 连接到电视机上,并在想电视机的天线电缆到底是 75 欧姆还是 300 欧姆的同轴电缆。但是,最终你把电视机调到了频道 3,看到了一个颗粒状的、紫色的图像。 ![Commodore 64 启动屏幕](/data/attachment/album/201907/12/125758zwgbwgl7m37t7w11.png) 计算机显示了一个 `READY`。你的爸爸把计算机推向了你,这意思是你是第一个尝试它的人。你小心翼翼地敲击每个字母,键入了 `HELLO`。然而计算机的回应是令人困惑的。 ![Commodore 64 语法错误](/data/attachment/album/201907/12/125759tud7d7wcrk7sh5hc.png) 你尝试输入了一些稍有不同的单词,然而回应总是一样的。你父亲说,你最好仔细读一下手册的其它部分。这绝非易事,[随 Commodore 64 一起提供的手册](ftp://www.zimmers.net/pub/cbm/c64/manuals/C64_Users_Guide.pdf) 是一本小一些的书。但是这不会困住你,因为手册的介绍预示着奇迹。 它声称,Commodore 64 有“微型计算机行业中最先进的图画制作器”,能允许“你设计拥有四种不同颜色的图画,就像你在街机视频游戏里看到的一样”。Commodore 64 也有“内置的音乐和声音效果,可以与很多著名的音乐合成器相媲美”。所有的这些工具都置身于你的手边,手册会引导你完成所有这些: > > 与所有提供的硬件一样重要的是,这本用户指南将提高你对计算机的理解。它无法在这里告诉你有关计算机的所有信息,但是它会向你推荐各种出版物,以获取有关所提出主题的更多详细信息。Commodore 希望你真正喜欢你的新 COMMODORE 64。要想真正得到乐趣,请记住:编程不是一种一天就能学会的东西。通读这个用户指南你要有耐心。 > > > 那一夜,你在床上通读了整整前三个章节:“安装”、“入门”和“BASIC 编程入门”,在你最终睡着时,手册还打开着放在了胸前。 ### Commodore BASIC 现在是星期六早上,你渴望尝试你所学到的新东西。手册里教给你的第一件事是如何更改在显示器上的颜色。你按照操作说明,按下 `CTRL-9` 来进入反色输入模式,然后按住空格键来创建了一个长长的空行。你可以使用 `CTRL-1` 到 `CTRL-8` 在不同的颜色之间交换,这让你的电视机屏幕焕发出了新的力量。 ![Commodore 64 颜色带](/data/attachment/album/201907/12/125807ouda48mad9ua8ge8.png) 尽管这很酷,但你觉得这不能算是编程。要对计算机编程,你昨晚已经学会了如何做,你必须以一种称为 BASIC 的语言与计算机交谈。对你来说,BASIC 看起来就像星球大战中的东西一样科幻,但是,到 1983 年时,其实 BASIC 已经快有二十岁了。它是由两位达特茅斯教授 John Kemeny 和 Tom Kurtz 发明的,他们想让社会科学和人文科学中的本科生也可以使用计算机。它被广泛使用在微型计算机上,在大学的数学课上很受欢迎。在比尔盖茨和保罗艾伦为 Altair 编写了微软 BASIC 解释器后,它就成为了微型计算机上的标准。但是这本手册对此没有任何解释,那么多年你都没学过它。 手册中建议你尝试的第一个 BASIC 命令是 `PRINT` 命令。你输入了 `PRINT "COMMODORE 64"`,很慢,因为你需要花费一点时间才能在按键 `2` 上面找到引号符号。你单击 `RETURN`,这一次,计算机没有抱怨,完全是按照你告诉它做的,在下一行中显示了 “COMMODORE 64” 。 现在你尝试对各种不同的东西使用 `PRINT` 命令:两个数字加在一起,两个数字乘在一起,甚至几个十进制数字。你不再输入 `PRINT` ,而是使用 `?` 代替,因为手册中告诉你 `?` 是 `PRINT` 的一个缩写,通常专业程序员都这么使用。你感觉自己已经像是一个专家了,不过你想起你还没有进行到第三章“BASIC 编程入门”。 你很快就开始了。该章节提示你编写你的第一个真正的 BASIC 程序。你输入 `NEW` 并单击 `RETURN`,它给了你一个干净的<ruby> 黑板 <rt> slate </rt></ruby>。然后你在其中输入你的程序: ``` 10 ?"COMMODORE 64" 20 GOTO 10 ``` 手册里解释说 10 和 20 是行号。它们为计算机排序了语句。它们也允许程序员在某些命令中引用程序的其它行,正像你在这里使用的 `GOTO` 命令一样,它将程序指回到行 10。“这是一个很好的编程习惯”,手册认为,“以 10 的增量来编号行,可以防止你以后需要插入一些语句”。 你输入 `RUN`,并凝视充满了 “COMMODORE 64” 的屏幕,它一遍又一遍的重复。 ![Commodore 64 显示反复打印 "Commodore 64" 的结果](/data/attachment/album/201907/12/125818twwb7dtssws6wdox.png) 你不确定这不会引爆你的计算机,过了一秒钟你才想起来应该单击 `RUN/STOP` 按键来打断循环。 手册接下来的一些部分向你介绍了变量,它告诉你变量像“在计算机中许多的盒子,它们每个可以容纳一个数字或一个文本字符串”。以一个 `%` 符号结尾的变量是一个整数,与此同时,以一个 `$` 符号结尾的变量是一个字符串。其余的所有变量是一些称为“浮点”变量的东西。手册警告你要小心变量名称,因为计算机仅会识别变量名称的前两个字母,尽管它不限制你想创建的名称有多长。(这并没有特别让你困扰,但是要是在 30 年后来看,这可能会让人们感到太疯狂了) 你接着学习 `IF... THEN...` 和 `FOR... NEXT...` 结构体。有了这些新的工具,你感觉有能力来解决接下来手册丢给你的重大挑战。“如果你是个有野心的人”,没错,“输入下面的程序,并查看会发生什么。”该程序比你目前为止看到的程序更长、更复杂,但是,你很想知道它做了什么: ``` 10 REM BOUNCING BALL 20 PRINT "{CLR/HOME}" 25 FOR X = 1 TO 10 : PRINT "{CRSR/DOWN}" : NEXT 30 FOR BL = 1 TO 40 40 PRINT " ●{CRSR LEFT}";:REM (● is a Shift-Q) 50 FOR TM = 1 TO 5 60 NEXT TM 70 NEXT BL 75 REM MOVE BALL RIGHT TO LEFT 80 FOR BL = 40 TO 1 STEP -1 90 PRINT " {CRSR LEFT}{CRSR LEFT}●{CRSR LEFT}"; 100 FOR TM = 1 TO 5 110 NEXT TM 120 NEXT BL 130 GOTO 20 ``` 上面的程序充分利用了 Commodore 64 最酷的功能之一。当把不可打印的命令字符作为字符串的一部分传递到 `PRINT` 命令时,它们会执行其操作,而不是被打印到屏幕上。这允许你重新摆放你程序中打印的字符串。(LCTT 译注:上述程序中如 `{CRSR LEFT}` 之类的控制字符执行类似 “在行中向左移动一个位置” 的操作,因此上述程序中利用这些字符操作了一个圆点字符四处移动,如下图。) 输入上面的程序你花费了很长时间。你犯一些错误,并不得不重新输入一些行。但是,你最终能够按下 `RUN`,并看到了一幅杰作: ![Commodore 64 反弹球](/data/attachment/album/201907/12/125819fjxyaojv3r38r82j.gif) 你觉得这恐怕是你见过的最酷的事了。不过你几乎转头就忘记了它,因为马上你就学到了 BASIC 的内置函数,像 `RND`(它返回一个随机数字)和 `CHR$`(它返回与一个给定数字代码匹配的字符),这个手册向你展示一个程序,这个程序有名到什么程度呢?直到许多年后,它仍然被当成了一个[短文选集](http://10print.org/)的标题: ``` 10 PRINT "{CLR/HOME}" 20 PRINT CHR$(205.5 + RND(1)); 40 GOTO 20 ``` 当运行时,上面的程序会生成一个随机的迷宫: ![Commodore 64 迷宫程序](/data/attachment/album/201907/12/125822gg7hc2l2140si531.gif) 这绝对是你曾经见过最酷的事。 ### PEEK 和 POKE 现在你已经看过了 Commodore 64 手册的前四章节,包含那篇 “高级的 BASIC” 的章节,所以你感到十分自豪。在这个星期六早上,你学习到了很多东西。但是这个下午(在赶快吃了点午饭后),你将继续学习一些使这个放在你的客厅中的奇妙机器变得不再神秘的东西。 手册中的下一个章节标题是“高级颜色和图像命令”。它从回顾你今天早上首先键入的彩色条开始,并向你展示了如何在一个程序中做同样的事。然后它教给了你如何更改屏幕的背景颜色。 为此,你需要使用 BASIC 的 `PEEK` 和 `POKE` 命令。这些命令分别允许你检查和写入一个存储器地址。Commodore 64 有一个主背景颜色和一个边框背景颜色。每个都通过一个特定的内存地址控制。你可以把你喜欢的任何颜色值写入到这些地址,以使用这些背景颜色和边框颜色。 手册中解释: > > 正像变量可以被认为机器中你放置信息的“盒子”一样,你也可以认为在计算机中代表特定内存位置的是一些特殊定义的“盒子”。 > > > Commodore 64 会查看这些内存位置来了解屏幕的背景和边框应该是什么样的颜色,什么样的字符应该被显示在屏幕上,以及显示在哪里,等等其它任务。 > > > 你编写了一个程序来遍历所有可用的背景和边界的颜色的组合: ``` 10 FOR BA = 0 TO 15 20 FOR BO = 0 TO 15 30 POKE 53280, BA 40 POKE 53281, BO 50 FOR X = 1 TO 500 : NEXT X 60 NEXT BO : NEXT BA ``` 虽然 `POKE` 命令以及它的大操作数一开始时看起来很吓人,现在你看到那个数字的实际值其实不是很要紧。显然,你必须得到正确的数字,但是所有的数字代表的是一个“盒子”,Commodore 只是正好存储在地址 53280 处而已。这个盒子有一个特殊的用途:Commodore 使用它来确定屏幕背景应该是什么颜色。 ![Commodore 64 更改背景颜色](/data/attachment/album/201907/12/125823yqddscktfks525bt.gif) 你认为这简直棒极了。只需要写入到内存中一个专用的盒子,你可以控制一台计算机的基础属性。你不确定 Commodore 64 的电路系统如何读取你写入在内存中的值并更改屏幕的颜色的,但是,你不知道这些也没事。至少你知道结果是怎么样的。 ### 特殊容器 在那个周六,你没有读完整本手册,因为你现在有点精疲力尽了。但是你最终会全部读完它。在这个过程中,你学到更多的 Commodore 64 专用的盒子。有一些盒子你可以写入来控制在屏幕上显示什么——这也是一个盒子,事实上,是控制每一个位置出现的字符。在第六章节 “精灵图形” 中,你学到可以让你定义可以移动和甚至缩放图像的特殊盒子。在第七章节 “创造声音” 中,你学到能写入以便使你的 Commodore 64 歌唱 “Michael Row the Boat Ashore” 的盒子。Commodore 64,事实证明,它和你可能以后学习到的一个称为 API 的关系甚少。控制 Commodore 64 大多涉及写入到电路系统赋予特殊意义的内存地址。 多年来,你花费在这些特殊盒子的时光一直伴随着你。甚至几十年后,当你在一个拥有大量的图形或声音 API 的机器上编程时,你知道,隐藏于其背后的,这些 API 最终是写入到这些盒子之类的东西里面的。你有时会好奇那些只使用过 API 的年轻程序员,他们肯定是觉得 API 为他们做到的这一切。可能他们认为这些 API 调用了一些其它隐藏的 API。但是,那些隐藏的 API 调用了什么?你不由得同情这些年轻的程序员们,因为他们一定会非常迷惑。 如果你喜欢这篇文章,也喜欢它每两周发布的一篇新文章的话,那么请在 Twitter 上关注 [@TwoBitHistory](https://twitter.com/TwoBitHistory) 或订阅 [RSS 源](https://twobithistory.org/feed.xml)来确保你知道新的文章发布出来。 --- via:<https://twobithistory.org/2018/09/02/learning-basic.html> 作者:[Two-Bit History](https://twobithistory.org) 选题:[lujun9972](https://github.com/lujun9972) 译者:[robsean](https://github.com/robsean) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
I was not yet alive in 1983. This is something that I occasionally regret. I am especially sorry that I did not experience the 8-bit computer era as it was happening, because I think the people that first encountered computers when they were relatively simple and constrained have a huge advantage over the rest of us. Today, (almost) everyone knows how to use a computer, but very few people, even in the computing industry, grasp all of what is going on inside of any single machine. There are now [so many layers of software](https://www.youtube.com/watch?v=kZRE7HIO3vk) doing so many different things that one struggles to identify the parts that are essential. In 1983, though, home computers were unsophisticated enough that a diligent person could learn how a particular computer worked through and through. That person is today probably less mystified than I am by all the abstractions that modern operating systems pile on top of the hardware. I expect that these layers of abstractions were easy to understand one by one as they were introduced; today, new programmers have to try to understand them all by working top to bottom and backward in time. Many famous programmers, particularly in the video game industry, started programming games in childhood on 8-bit computers like the Apple II and the Commodore 64. John Romero, Richard Garriott, and Chris Roberts are all examples. It’s easy to see how this happened. In the 8-bit computer era, many games were available only as printed BASIC listings in computer magazines and [books](https://en.wikipedia.org/wiki/BASIC_Computer_Games). If you wanted to play one of those games, you had to type in the whole program by hand. Inevitably, you would get something wrong, so you would have to debug your program. By the time you got it working, you knew enough about how the program functioned to start modifying it yourself. If you were an avid gamer, you became a good programmer almost by necessity. I also played computer games throughout my childhood. But the games I played came on CD-ROMs. I sometimes found myself having to google how to fix a crashing installer, which would involve editing the Windows Registry or something like that. This kind of minor troubleshooting may have made me comfortable enough with computers to consider studying computer science in college. But it never taught me anything crucial about how computers worked or how to control them. Now, of course, I tell computers what to do for a living. All the same, I can’t help feeling that I missed out on some fundamental insight afforded only to those that grew up programming simpler computers. What would it have been like to encounter computers for the first time in the early 1980s? How would that have been different from the experience of using a computer today? This post is going to be a little different from the usual Two-Bit History post because I’m going to try to imagine an answer to these questions. ## 1983 It was just last week that you saw [the Commodore 64 ad](https://www.youtube.com/watch?v=ZekAbt2o6Ms) on TV. Now that *M*A*S*H* was over, you were in the market for something new to do on Monday nights. This Commodore 64 thing looked even better than the Apple II that Rudy’s family had in their basement. Plus, the ad promised that the new computer would soon bring friends “knocking down” your door. You knew several people at school that would rather be hanging out at your house than Rudy’s anyway, if only they could play *Zork* there. So you persuaded your parents to buy one. Your mother said that they would consider it only if having a home computer meant that you stayed away from the arcade. You reluctantly agreed. Your father thought he would start tracking the family’s finances in MultiPlan, the spreadsheet program he had heard about, which is why the computer got put in the living room. A year later, though, you would be the only one still using it. You were finally allowed to put it on the desk in your bedroom, right under your *Police* poster. (Your sister protested this decision, but it was 1983 and computers [weren’t for her](https://www.npr.org/sections/money/2014/10/21/357629765/when-women-stopped-coding).) Dad picked it up from [ComputerLand](https://www.youtube.com/watch?v=MA_XtT3VAVM) on the way home from work. The two of you laid the box down next to the TV and opened it. “WELCOME TO THE WORLD OF FRIENDLY COMPUTING,” said the packaging. Twenty minutes later, you weren’t convinced—the two of you were still trying to connect the Commodore to the TV set and wondering whether the TV’s antenna cable was the 75-ohm or 300-ohm coax type. But eventually you were able to turn your TV to channel 3 and see a grainy, purple image. `READY` , the computer reported. Your father pushed the computer toward you, indicating that you should be the first to give it a try. `HELLO` , you typed, carefully hunting for each letter. The computer’s response was baffling. You tried typing in a few different words, but the response was always the same. Your father said that you had better read through the rest of the manual. That would be no mean feat—[the manual that came with the Commodore 64](ftp://www.zimmers.net/pub/cbm/c64/manuals/C64_Users_Guide.pdf) was a small book. But that didn’t bother you, because the introduction to the manual foreshadowed wonders. The Commodore 64, it claimed, had “the most advanced picture maker in the microcomputer industry,” which would allow you “to design your own pictures in four different colors, just like the ones you see on arcade type video games.” The Commodore 64 also had “built-in music and sound effects that rival many well known music synthesizers.” All of these tools would be put in your hands, because the manual would walk you through it all: Just as important as all the available hardware is the fact that this USER’S GUIDE will help you develop your understanding of computers. It won’t tell you everything there is to know about computers, but it will refer you to a wide variety of publications for more detailed information about the topics presented. Commodore wants you to really enjoy your new COMMODORE 64. And to have fun, remember: programming is not the kind of thing you can learn in a day. Be patient with yourself as you go through the USER’S GUIDE. That night, in bed, you read through the entire first three chapters—”Setup,” “Getting Started,” and “Beginning BASIC Programming”—before finally succumbing to sleep with the manual splayed across your chest. ## Commodore BASIC Now, it’s Saturday morning and you’re eager to try out what you’ve learned. One of the first things the manual teaches you how to do is change the colors on the display. You follow the instructions, pressing `CTRL-9` to enter reverse type mode and then holding down the space bar to create long lines. You swap between colors using `CTRL-1` through `CTRL-8` , reveling in your sudden new power over the TV screen. As cool as this is, you realize it doesn’t count as programming. In order to program the computer, you learned last night, you have to speak to it in a language called BASIC. To you, BASIC seems like something out of *Star Wars*, but BASIC is, by 1983, almost two decades old. It was invented by two Dartmouth professors, John Kemeny and Tom Kurtz, who wanted to make computing accessible to undergraduates in the social sciences and humanities. It was widely available on minicomputers and popular in college math classes. It then became standard on microcomputers after Bill Gates and Paul Allen wrote the MicroSoft BASIC interpreter for the Altair. But the manual doesn’t explain any of this and you won’t learn it for many years. One of the first BASIC commands the manual suggests you try is the `PRINT` command. You type in `PRINT "COMMODORE 64"` , slowly, since it takes you a while to find the quotation mark symbol above the `2` key. You hit `RETURN` and this time, instead of complaining, the computer does exactly what you told it to do and displays “COMMODORE 64” on the next line. Now you try using the `PRINT` command on all sorts of different things: two numbers added together, two numbers multiplied together, even several decimal numbers. You stop typing out `PRINT` and instead use `?` , since the manual has advised you that `?` is an abbreviation for `PRINT` often used by expert programmers. You feel like an expert already, but then you remember that you haven’t even made it to chapter three, “Beginning BASIC Programming.” You get there soon enough. The chapter begins by prompting you to write your first real BASIC program. You type in `NEW` and hit `RETURN` , which gives you a clean slate. You then type your program in: ``` 10 ?"COMMODORE 64" 20 GOTO 10 ``` The 10 and the 20, the manual explains, are line numbers. They order the statements for the computer. They also allow the programmer to refer to other lines of the program in certain commands, just like you’ve done here with the `GOTO` command, which directs the program back to line 10. “It is good programming practice,” the manual opines, “to number lines in increments of 10—in case you need to insert some statements later on.” You type `RUN` and stare as the screen clogs with “COMMODORE 64,” repeated over and over. You’re not certain that this isn’t going to blow up your computer. It takes you a second to remember that you are supposed to hit the `RUN/STOP` key to break the loop. The next few sections of the manual teach you about variables, which the manual tells you are like “a number of boxes within the computer that can each hold a number or a string of text characters.” Variables that end in a `%` symbol are whole numbers, while variables ending in a `$` symbol are strings of characters. All other variables are something called “floating point” variables. The manual warns you to be careful with variable names because only the first two letters of the name are actually recognized by the computer, even though nothing stops you from making a name as long as you want it to be. (This doesn’t particularly bother you, but you could see how 30 years from now this might strike someone as completely insane.) You then learn about the `IF... THEN...` and `FOR... NEXT...` constructs. With all these new tools, you feel equipped to tackle the next big challenge the manual throws at you. “If you’re the ambitious type,” it goads, “type in the following program and see what happens.” The program is longer and more complicated than any you have seen so far, but you’re dying to know what it does: ``` 10 REM BOUNCING BALL 20 PRINT "{CLR/HOME}" 25 FOR X = 1 TO 10 : PRINT "{CRSR/DOWN}" : NEXT 30 FOR BL = 1 TO 40 40 PRINT " ●{CRSR LEFT}";:REM (● is a Shift-Q) 50 FOR TM = 1 TO 5 60 NEXT TM 70 NEXT BL 75 REM MOVE BALL RIGHT TO LEFT 80 FOR BL = 40 TO 1 STEP -1 90 PRINT " {CRSR LEFT}{CRSR LEFT}●{CRSR LEFT}"; 100 FOR TM = 1 TO 5 110 NEXT TM 120 NEXT BL 130 GOTO 20 ``` The program above takes advantage of one of the Commodore 64’s coolest features. Non-printable command characters, when passed to the `PRINT` command as part of a string, just do the action they usually perform instead of printing to the screen. This allows you to replay arbitrary chains of commands by printing strings from within your programs. It takes you a long time to type in the above program. You make several mistakes and have to re-enter some of the lines. But eventually you are able to type `RUN` and behold a masterpiece: You think that this is a major contender for the coolest thing you have ever seen. You forget about it almost immediately though, because once you’ve learned about BASIC’s built-in functions like `RND` (which returns a random number) and `CHR$` (which returns the character matching a given number code), the manual shows you a program that many years from now will still be famous enough to be made the title of an [essay anthology](http://10print.org/): ``` 10 PRINT "{CLR/HOME}" 20 PRINT CHR$(205.5 + RND(1)); 40 GOTO 20 ``` When run, the above program produces a random maze: *This* is definitely the coolest thing you have ever seen. ## PEEK and POKE You’ve now made it through the first four chapters of the Commodore 64 manual, including the chapter titled “Advanced BASIC,” so you’re feeling pretty proud of yourself. You’ve learned a lot this Saturday morning. But this afternoon (after a quick lunch break), you’re going to learn something that will make this magical machine in your living room much less mysterious. The next chapter in the manual is titled “Advanced Color and Graphic Commands.” It starts off by revisiting the colored bars that you were able to type out first thing this morning and shows you how you can do the same thing from a program. It then teaches you how to change the background colors of the screen. In order to do this, you need to use the BASIC `PEEK` and `POKE` commands. Those commands allow you to, respectively, examine and write to a memory address. The Commodore 64 has a main background color and a border color. Each is controlled by a specially designated memory address. You can write any color value you would like to those addresses to make the background or border that color. The manual explains: Just as variables can be thought of as a representation of “boxes” within the machine where you placed your information, you can also think of some specially defined “boxes” within the computer that represent specific memory locations. The Commodore 64 looks at these memory locations to see what the screen’s background and border color should be, what characters are to be displayed on the screen—and where—and a host of other tasks. You write a program to cycle through all the available combinations of background and border color: ``` 10 FOR BA = 0 TO 15 20 FOR BO = 0 TO 15 30 POKE 53280, BA 40 POKE 53281, BO 50 FOR X = 1 TO 500 : NEXT X 60 NEXT BO : NEXT BA ``` While the `POKE` commands, with their big operands, looked intimidating at first, now you see that the actual value of the number doesn’t matter that much. Obviously, you have to get the number right, but all the number represents is a “box” that Commodore just happened to store at address 53280. This box has a special purpose: Commodore uses it to determine what color the screen’s background should be. You think this is pretty neat. Just by writing to a special-purpose box in memory, you can control a fundamental property of the computer. You aren’t sure how the Commodore 64’s circuitry takes the value you write in memory and changes the color of the screen, but you’re okay not knowing that. At least you understand everything up to that point. ## Special Boxes You don’t get through the entire manual that Saturday, since you are now starting to run out of steam. But you do eventually read all of it. In the process, you learn about many more of the Commodore 64’s special-purpose boxes. There are boxes you can write to control what is on screen—one box, in fact, for every place a character might appear. In chapter six, “Sprite Graphics,” you learn about the special-purpose boxes that allow you to define images that can be moved around and even scaled up and down. In chapter seven, “Creating Sound,” you learn about the boxes you can write to in order to make your Commodore 64 sing “Michael Row the Boat Ashore.” The Commodore 64, it turns out, has very little in the way of what you would later learn is called an API. Controlling the Commodore 64 mostly involves writing to memory addresses that have been given special meaning by the circuitry. The many years you ultimately spend writing to those special boxes stick with you. Even many decades later, when you find yourself programming a machine with an extensive graphics or sound API, you know that, behind the curtain, the API is ultimately writing to those boxes or something like them. You will sometimes wonder about younger programmers that have only ever used APIs, and wonder what they must think the API is doing for them. Maybe they think that the API is calling some other, hidden API. But then what do think that hidden API is calling? You will pity those younger programmers, because they must be very confused indeed. * If you enjoyed this post, more like it come out every four weeks! Follow @TwoBitHistory on Twitter or subscribe to the RSS feed to make sure you know when a new post is out. * *Previously on TwoBitHistory…* Have you ever wondered what a 19th-century computer program would look like translated into C? — TwoBitHistory (@TwoBitHistory) This week's post: A detailed look at how Ada Lovelace's famous program worked and what it was trying to do.[https://t.co/BizR2Zu7nt][August 19, 2018]
11,092
美国总统特朗普要禁用端到端加密
https://news.softpedia.com/news/donald-trump-now-wants-to-ban-end-to-end-encryption-526567.shtml
2019-07-13T10:53:58
[ "加密" ]
https://linux.cn/article-11092-1.html
> > 美国官方在开会讨论端到端加密。 > > > ![](/data/attachment/album/201907/13/105342ksl6zsn0eelsn0sg.png) 在[禁止](https://news.softpedia.com/news/google-bans-huawei-from-using-android-google-play-gmail-other-services-526083.shtml)和[解禁](https://news.softpedia.com/news/breaking-donald-trump-says-huawei-can-buy-american-products-again-526564.shtml)华为之后,美国总统唐纳德特朗普现在将目光盯上了端到端加密,据一份新的报告声称,白宫高级官员本周会面讨论了政府可以在这方面采取的第一项动作。 [Politico](https://www.politico.com/story/2019/06/27/trump-officials-weigh-encryption-crackdown-1385306) 援引了三位知情人士的话指出,来自几个关键机构的二号官员讨论了针对端到端加密的潜在攻击。 “这两条路径是,要么就加密问题发表声明或一般立场,并且[说]他们将继续致力于解决方案,或者要求国会立法,”Politico 援引一位消息人士的话说。 虽然美国政府希望终止美国公司开发的软件中的端到端加密功能,但这一提议却招致了美国各机构代表的不同反应。 Politico 指出,例如,国土安全部 “内部存在分歧”,因为该机构意识到禁止端到端加密可能产生的安全隐患。 ### 加密争议 推动制定这项针对端到端加密的规定,被视为美国情报机构和执法部门努力获取属于犯罪分子和恐怖分子的设备和数据的决定性步骤。 大多数美国公司已经将加密捆绑到他们的产品当中,这包括苹果和谷歌,它阻止了调查人员访问嫌疑人的数据。科技公司将端到端加密定位为一项关键的隐私功能,其中一些人警告说,任何针对它的监管都可能影响到国家安全。 特别是苹果公司,它是反对加密监管的最大公司之一。该公司[拒绝解锁圣贝纳迪诺恐怖分子使用的 iPhone](https://news.softpedia.com/news/judge-orders-apple-to-help-the-fbi-hack-san-bernardino-shooter-s-iphone-500517.shtml),解释说侵入该设备会损害所有客户的安全。 FBI 最终使用了第三方开发的软件解锁了该设备。 --- via: <https://news.softpedia.com/news/donald-trump-now-wants-to-ban-end-to-end-encryption-526567.shtml> 作者:[Bogdan Popa](https://news.softpedia.com/editors/browse/bogdan-popa) 选题:[lujun9972](https://github.com/lujun9972) 译者:[wxy](https://github.com/wxy) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
403
Forbidden
null
11,093
使用防火墙让你的 Linux 更加强大
https://opensource.com/article/19/7/make-linux-stronger-firewalls
2019-07-13T11:45:05
[ "防火墙" ]
https://linux.cn/article-11093-1.html
> > 掌握防火墙的工作原理,以及如何设置防火墙来提高 Linux 的安全性 > > > ![](/data/attachment/album/201907/13/114424m9clibvi0p128fln.jpg) 所有人都听说过防火墙(哪怕仅仅是在网络犯罪片里看到过相关的情节设定),很多人也知道他们的计算机里很可能正运行着防火墙,但是很少有人明白在必要的时候如何驾驭防火墙。 防火墙被用来拦截那些不请自来的网络流量,然而不同网络需要的安全级别也不尽相同。比如说,和在外面一家咖啡馆里使用公共 WiFi 相比,你在家里的时候可以更加信任网络里的其它计算机和设备。你或许希望计算机能够区分可以信任和不可信任的网络,不过最好还是应该学会自己去管理(或者至少是核实)你的安全设置。 ### 防火墙的工作原理 网络里不同设备之间的通信是通过一种叫做<ruby> 端口 <rt> port </rt></ruby>的网关实现的。这里的端口指的并不是像 USB 端口 或者 HDMI 端口这样的物理连接。在网络术语中,端口是一个纯粹的虚拟概念,用来表示某种类型的数据到达或离开一台计算机时候所走的路径。其实也可以换个名字来称呼,比如叫“连接”或者“门口”,不过 [早在 1981 年的时候](https://tools.ietf.org/html/rfc793) 它们就被称作端口了,这个叫法也沿用至今。其实端口这个东西没有任何特别之处,只是一种用来指代一个可能会发生数据传输的地址的方式。 1972 年,发布了一份 [端口号列表](https://tools.ietf.org/html/rfc433)(那时候的端口被称为“<ruby> 套接字 <rt> socket </rt></ruby>”),并且从此演化为一组众所周知的标准端口号,帮助管理特定类型的网络流量。比如说,你每天访问网站的时候都会使用 80 和 443 端口,因为互联网上的绝大多数人都同意(或者是默认)数据从 web 服务器上传输的时候是通过这两个端口的。如果想要验证这一点,你可以在使用浏览器访问网站的时候在 URL 后面加上一个非标准的端口号码。比如说,访问 `example.com:42` 的请求会被拒绝,因为 example.com 在 42 端口上并不提供网站服务。 ![Navigating to a nonstandard port produces an error](/data/attachment/album/201907/13/114508qjl4azm23y322tm2.png "Navigating to a nonstandard port produces an error") 如果你是通过 80 端口访问同一个网站,就可以(不出所料地)正常访问了。你可以在 URL 后面加上 `:80` 来指定使用 80 端口,不过由于 80 端口是 HTTP 访问的标准端口,所以你的浏览器其实已经默认在使用 80 端口了。 当一台计算机(比如说 web 服务器)准备在指定端口接收网络流量的时候,保持该端口向网络流量开放是一种可以接受的(也是必要的)行为。但是不需要接收流量的端口如果也处在开放状态就比较危险了,这就是需要用防火墙解决的问题。 #### 安装 firewalld 有很多种配置防火墙的方式,这篇文章介绍 [firewalld](https://firewalld.org/)。在桌面环境下它被集成在<ruby> 网络管理器 <rt> Network Manager </rt></ruby>里,在终端里则是集成在 `firewall-cmd` 里。很多 Linux 发行版都预装了这些工具。如果你的发行版里没有,你可以把这篇文章当成是管理防火墙的通用性建议,在你所使用的防火墙软件里使用类似的方法,或者你也可以选择安装 `firewalld`。 比如说在 Ubuntu 上,你必须启用 universe 软件仓库,关闭默认的 `ufw` 防火墙,然后再安装 `firewalld`: ``` $ sudo systemctl disable ufw $ sudo add-apt-repository universe $ sudo apt install firewalld ``` Fedora、CentOS、RHEL、OpenSUSE,以及其它很多发行版默认就包含了 `firewalld`。 无论你使用哪个发行版,如果希望防火墙发挥作用,就必须保持它在开启状态,并且设置成开机自动加载。你应该尽可能减少在防火墙维护工作上所花费的精力。 ``` $ sudo systemctl enable --now firewalld ``` ### 使用网络管理器选择区域 或许你每天都会连接到很多不同的网络。在工作的时候使用的是一个网络,在咖啡馆里是另一个,在家里又是另一个。你的计算机可以判断出哪一个网络的使用频率比较高,但是它并不知道哪一个是你信任的网络。 一个防火墙的<ruby> 区域 <rt> zone </rt></ruby>里包含了端口开放和关闭的预设规则。你可以通过使用区域来选择一个对当前网络最适用的策略。 你可以打开网络管理器里的连接编辑器(可以在应用菜单里找到),或者是使用 `nm-connection-editor &` 命令以获取所有可用区域的列表。 ![Network Manager Connection Editor](/data/attachment/album/201907/13/114508k2f2fvzvf20yrzly.png "Network Manager Connection Editor") 在网络连接列表中,双击你现在所使用的网络。 在出现的网络配置窗口中,点击“通用”标签页。 在“通用”面板中,点击“防火墙区域”旁边的下拉菜单以获取所有可用区域的列表。 ![Firewall zones](/data/attachment/album/201907/13/114511w3t3zpoqdzo66op3.png "Firewall zones") 也可以使用下面的终端命令以获取同样的列表: ``` $ sudo firewall-cmd --get-zones ``` 每个区域的名称已经可以透露出设计者创建这个区域的意图,不过你也可以使用下面这个终端命令获取任何一个区域的详细信息: ``` $ sudo firewall-cmd --zone work --list-all work target: default icmp-block-inversion: no interfaces: sources: services: ssh dhcpv6-client ports: protocols: [...] ``` 在这个例子中,`work` 区域的配置是允许接收 SSH 和 DHCPv6-client 的流量,但是拒绝接收其他任何用户没有明确请求的流量。(换句话说,`work` 区域并不会在你浏览网站的时候拦截 HTTP 响应流量,但是 **会** 拦截一个针对你计算机上 80 端口的 HTTP 请求。) 你可以依次查看每一个区域,弄清楚它们分别都允许什么样的流量。比较常见的有: * `work`:这个区域应该在你非常信任的网络上使用。它允许 SSH、DHCPv6 和 mDNS,并且还可以添加更多允许的项目。该区域非常适合作为一个基础配置,然后在此之上根据日常办公的需求自定义一个工作环境。 * `public`: 用在你不信任的网络上。这个区域的配置和工作区域是一样的,但是你不应该再继续添加其它任何允许项目。 * `drop`: 所有传入连接都会被丢弃,并且不会有任何响应。在不彻底关闭网络的条件下,这已经是最接近隐形模式的配置了,因为只允许传出网络连接(不过随便一个端口扫描器就可以通过传出流量检测到你的计算机,所以这个区域并不是一个隐形装置)。如果你在使用公共 WiFi,这个区域可以说是最安全的选择;如果你觉得当前的网络比较危险,这个区域也一定是最好的选择。 * `block`: 所有传入连接都会被拒绝,但是会返回一个消息说明所请求的端口被禁用了。只有你主动发起的网络连接是被允许的。这是一个友好版的 `drop` 区域,因为虽然还是没有任何一个端口允许传入流量,但是说明了会拒绝接收任何不是本机主动发起的连接。 * `home`: 在你信任网络里的其它计算机的情况下使用这个区域。该区域只会允许你所选择的传入连接,但是你可以根据需求添加更多的允许项目。 * `internal`: 和工作区域类似,该区域适用于内部网络,你应该在基本信任网络里的计算机的情况下使用。你可以根据需求开放更多的端口和服务,同时保持和工作区域不同的一套规则。 * `trusted`: 接受所有的网络连接。适合在故障排除的情况下或者是在你绝对信任的网络上使用。 ### 为网络指定一个区域 你可以为你的任何一个网络连接都指定一个区域,并且对于同一个网络的不同连接方式(比如以太网、WiFi 等等)也可以指定不同的区域。 选择你想要的区域,点击“保存”按钮提交修改。 ![Setting a new zone](/data/attachment/album/201907/13/114513drb7gmkdren3a7ja.png "Setting a new zone") 养成为网络连接指定区域的习惯的最好办法是从你最常用的网络开始。为你的家庭网络指定家庭区域,为工作网络指定工作区域,为你最喜欢的图书馆或者咖啡馆的网络指定公关区域。 一旦你为所有常用的网络都指定了一个区域,在之后加入新的网络的时候(无论是一个新的咖啡馆还是你朋友家的网络),试图也为它指定一个区域吧。这样可以很好地让你意识到不同的网络的安全性是不一样的,你并不会仅仅因为使用了 Linux 而比任何人更加安全。 ### 默认区域 每次你加入一个新的网络的时候,`firewalld` 并不会提示你进行选择,而是会指定一个默认区域。你可以在终端里输入下面这个命令来获取你的默认区域: ``` $ sudo firewall-cmd --get-default public ``` 在这个例子里,默认区域是 `public` 区域。你应该保证该区域有非常严格的限制规则,这样在将它指定到未知网络中的时候才比较安全。或者你也可以设置你自己的默认区域。 比如说,如果你是一个比较多疑的人,或者需要经常接触不可信任的网络的话,你可以设置一个非常严格的默认区域: ``` $ sudo firewall-cmd --set-default-zone drop success $ sudo firewall-cmd --get-default drop ``` 这样一来,任何你新加入的网络都会被指定使用 `drop` 区域,除非你手动将它制定为另一个没有这么严格的区域。 ### 通过开放端口和服务实现自定义区域 Firewalld 的开发者们并不是想让他们设定的区域能够适应世界上所有不同的网络和所有级别的信任程度。你可以直接使用这些区域,也可以在它们基础上进行个性化配置。 你可以根据自己所需要进行的网络活动决定开放或关闭哪些端口,这并不需要对防火墙有多深的理解。 #### 预设服务 在你的防火墙上添加许可的最简单的方式就是添加预设服务。严格来讲,你的防火墙并不懂什么是“服务”,因为它只知道端口号码和使用协议的类型。不过在标准和传统的基础之上,防火墙可以为你提供一套端口和协议的组合。 比如说,如果你是一个 web 开发者并且希望你的计算机对本地网络开放(这样你的同事就可以看到你正在搭建的网站了),可以添加 `http` 和 `https` 服务。如果你是一名游戏玩家,并且在为你的游戏公会运行开源的 [murmur](https://www.mumble.com/) 语音聊天服务器,那么你可以添加 `murmur` 服务。还有其它很多可用的服务,你可以使用下面这个命令查看: ``` $ sudo firewall-cmd --get-services amanda-client amanda-k5-client bacula bacula-client \ bgp bitcoin bitcoin-rpc ceph cfengine condor-collector \ ctdb dhcp dhcpv6 dhcpv6-client dns elasticsearch \ freeipa-ldap freeipa-ldaps ftp [...] ``` 如果你找到了一个自己需要的服务,可以将它添加到当前的防火墙配置中,比如说: ``` $ sudo firewall-cmd --add-service murmur ``` 这个命令 **在你的默认区域里** 添加了指定服务所需要的所有端口和协议,不过在重启计算机或者防火墙之后就会失效。如果想让你的修改永久有效,可以使用 `--permanent` 标志: ``` $ sudo firewall-cmd --add-service murmur --permanent ``` 你也可以将这个命令用于一个非默认区域: ``` $ sudo firewall-cmd --add-service murmur --permanent --zone home ``` #### 端口 有时候你希望允许的流量并不在 `firewalld` 定义的服务之中。也许你想在一个非标准的端口上运行一个常规服务,或者就是想随意开放一个端口。 举例来说,也许你正在运行开源的 [虚拟桌游](https://opensource.com/article/18/5/maptool) 软件 [MapTool](https://github.com/RPTools)。由于 MapTool 服务器应该使用哪个端口这件事情并没有一个行业标准,所以你可以自行决定使用哪个端口,然后在防火墙上“开一个洞”,让它允许该端口上的流量。 实现方式和添加服务差不多: ``` $ sudo firewall-cmd --add-port 51234/tcp ``` 这个命令 **在你的默认区域** 里将 51234 端口向 TCP 传入连接开放,不过在重启计算机或者防火墙之后就会失效。如果想让你的修改永久有效,可以使用 `--permanent` 标志: ``` $ sudo firewall-cmd --add-port 51234/tcp --permanent ``` 你也可以将这个命令用于一个非默认区域: ``` $ sudo firewall-cmd --add-port 51234/tcp --permanent --zone home ``` 在路由器的防火墙上设置允许流量和在本机上设置的方式是不同的。你的路由器可能会为它的内嵌防火墙提供一个不同的配置界面(原理上是相同的),不过这就超出本文范围了。 ### 移除端口和服务 如果你不再需要某项服务或者某个端口了,并且设置的时候没有使用 `--permanent` 标志的话,那么可以通过重启防火墙来清除修改。 如果你已经将修改设置为永久生效了,可以使用 `--remove-port` 或者 `--remove-service` 标志来清除: ``` $ sudo firewall-cmd --remove-port 51234/tcp --permanent ``` 你可以通过在命令中指定一个区域以将端口或者服务从一个非默认区域中移除。 ``` $ sudo firewall-cmd --remove-service murmur --permanent --zone home ``` ### 自定义区域 你可以随意使用 `firewalld` 默认提供的这些区域,不过也完全可以创建自己的区域。比如如果希望有一个针对游戏的特别区域,你可以创建一个,然后只有在玩儿游戏的时候切换到该区域。 如果想要创建一个新的空白区域,你可以创建一个名为 `game` 的新区域,然后重新加载防火墙规则,这样你的新区域就启用了: ``` $ sudo firewall-cmd --new-zone game --permanent success $ sudo firewall-cmd --reload ``` 一旦创建好并且处于启用状态,你就可以通过添加玩游戏时所需要的服务和端口来实现个性化定制了。 ### 勤勉 从今天起开始思考你的防火墙策略吧。不用着急,可以试着慢慢搭建一些合理的默认规则。你也许需要花上一段时间才能习惯于思考防火墙的配置问题,以及弄清楚你使用了哪些网络服务,不过无论是处在什么样的环境里,只要稍加探索你就可以让自己的 Linux 工作站变得更为强大。 --- via: <https://opensource.com/article/19/7/make-linux-stronger-firewalls> 作者:[Seth Kenlon](https://opensource.com/users/seth) 选题:[lujun9972](https://github.com/lujun9972) 译者:[chen-ni](https://github.com/chen-ni) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
Everyone's heard of firewalls, even if only as a plot device in a TV cybercrime drama. Many people also know that their computer is (likely) running a firewall, but fewer people understand how to take control of their firewall when necessary. Firewalls block unwanted network traffic, but different networks have different threat levels. For instance, if you're at home, you probably trust the other computers and devices on your network a lot more than when you're out at the local café using public WiFi. You can hope your computer differentiates between a trusted network and an untrusted one, or you can learn to manage, or at least verify, your security settings yourself. ## How firewalls work Communication between devices on a network happens through gateways called *ports*. Port, in this context, doesn't mean a physical connection like a USB port or an HDMI port. In network lingo, a port is an entirely virtual concept representing pathways for a specific type of data to either arrive at or depart from a computer. This system could have been called anything, like "connections" or "doorways," but they were named ports at least [as early as 1981](https://tools.ietf.org/html/rfc793), and that's the name in use today. The point is, there's nothing special about any port; they're just a way to designate an address where data transference may happen. Back in 1972, [a list of port numbers](https://tools.ietf.org/html/rfc433) (then called "sockets") was published, and this has since evolved into a set of well-known standard port numbers that help manage specific kinds of traffic. For instance, you access ports 80 and 443 on a daily basis when you visit a website, because most everyone on the internet has agreed, implicitly or explicitly, that data is transferred from web servers over those ports. You can test this theory by opening a web browser and navigating to a website with a nonstandard port appended to the URL. For instance, if you navigate to **example.com:42**, your request is denied because example.com does not serve a website at port 42. ![Navigating to a nonstandard port produces an error Navigating to a nonstandard port produces an error](https://opensource.com/sites/default/files/uploads/web-port-nonstandard.png) If you revisit the same website at port 80, you get a website, as expected. You can specify port 80 with **:80** at the end of the URL, but because port 80 is the standard port for HTTP traffic, your web browser assumes port 80 by default. When a computer, like a web server, expects traffic at a specific port, it's acceptable (and necessary) to have the port open for traffic. The danger is leaving ports open that you have no reason to expect traffic on, and that's exactly what a firewall is for. ## Install firewalld There are many interfaces for firewall configuration. This article covers [ firewalld](https://firewalld.org/), which integrates with Network Manager on the desktop and **firewall-cmd**in the terminal. Many Linux distributions ship with these tools installed. If yours doesn't, you can either take this article as general advice for firewall management and apply it to what you use, or you can install **firewalld**. On Ubuntu, for instance, you must enable the **universe** repository, deactivate the default **ufw** firewall, and then install **firewalld**: ``` $ sudo systemctl disable ufw $ sudo add-apt-repository universe $ sudo apt install firewalld ``` Fedora, CentOS, RHEL, OpenSUSE, and many others include **firewalld** by default. Regardless of your distribution, for a firewall to be effective, it must be active and set to be loaded at boot. The less you have to think about firewall maintenance, the better. `$ sudo systemctl enable --now firewalld` ## Choose your zone with Network Manager You probably connect to many different networks every day. You're on one network at work, another at the café, and yet another at home. Your computer can detect which network you use more frequently than others, but it doesn't know which you trust. A firewall *zone* contains presets deciding what ports to open and close. Using zones, you can choose a policy that makes the most sense for the network you're currently on. To see a list of available zones, open the Network Manager Connection Editor, found in your Applications menu, or with the **nm-connection-editor &** command. ![Network Manager Connection Editor Network Manager Connection Editor](https://opensource.com/sites/default/files/uploads/nm-connection-editor.png) From the list of network connections, double-click on your current network. In the network configuration window that appears, click the General tab. In the General panel, click the drop-down menu next to Firewall Zone for a list of all available zones. ![Firewall zones Firewall zones](https://opensource.com/sites/default/files/uploads/nm-zone.png) You can get this same list with this terminal command: `$ sudo firewall-cmd --get-zones` The zone titles indicate what their designers had in mind when creating them, but you can get the specifics of any zone with this terminal command: ``` $ sudo firewall-cmd --zone work --list-all work target: default icmp-block-inversion: no interfaces: sources: services: ssh dhcpv6-client ports: protocols: [...] ``` In this example, the **work** zone is configured to permit SSH and DHCPv6-client incoming traffic but drops any other incoming traffic not explicitly requested by the user. (In other words, the **work** zone doesn't block HTTP response traffic when you visit a website, but it *does* deny an HTTP request on your port 80.) View each zone to get familiar with the traffic each one allows. The most common ones are: **Work:**Use this one when on a network you mostly trust. SSH, DHCPv6, and mDNS are permitted, and you can add more as needed. This zone is meant to be a starting point for a custom work environment based on your daily office requirements.**Public:**For networks you do not trust. This zone is the same as the work zone, but presumably, you would not add the same exceptions as your work zone.**Drop:**All incoming connections are dropped with no response given. This is as close to a stealth mode as you can get without shutting off networking entirely because only outgoing network connections are possible (even a casual port scanner could detect your computer from outgoing traffic, though, so don't mistake this zone for a cloaking device). This is arguably the safest zone when on public WiFi, and definitely the best when you have reason to believe a network is hostile.**Block:**All incoming connections are rejected with a message declaring that the requested port is prohibited. Only network connections you initiate are possible. This is a "friendly" version of the drop zone because, even though no port is open for incoming traffic, a port verbosely declines an uninitiated connection.**Home:**Use this when you trust other computers on the network. Only selected incoming connections are accepted, and you can add more as needed.**Internal:**Similar to the work zone, this is intended for internal networks where you mostly trust the other computers. You can open more ports and services as needed but still maintain a different rule set than you have on your work zone.**Trusted:**All network connections are accepted. Good for troubleshooting or on networks you absolutely trust. ## Assigning a zone to a network You can assign a zone to any network connection you make. Furthermore, you can assign a different zone to each network interface (Ethernet cable, WiFi, and so on) that attaches to each network. Select the zone you want and click the Save button to commit the change. ![Setting a new zone Setting a new zone](https://opensource.com/sites/default/files/uploads/nm-set.png) The easiest way to get into the habit of assigning a zone to a network interface is to tend to the networks you use most often. Assign the home zone to your home network, the work zone to your work network, and the public network to your favorite library or café network. Once you have assigned a zone to all your usual networks, make an effort to assign a zone to the next new network you join, whether it's a new café or your mate's home network. Assigning zones is the best way to reinforce your own awareness that networks are not all equal and that you're not any more secure than anybody else just because you run Linux. ## Default zone Rather than prompting you for a zone every time you join a new network, firewalld assigns any unknown network a default zone. Open a terminal and type this command to get your default zone: ``` $ sudo firewall-cmd --get-default public ``` In this example, the public zone is the default. It's expected that you will keep the public zone highly restrictive, so it's a pretty safe zone to assign unknown networks. However, you can set your own default instead. For instance, if you're more paranoid than most, or if you know that you frequent networks you have reason to distrust, you can assign a highly restrictive zone as default: ``` $ sudo firewall-cmd --set-default-zone drop success $ sudo firewall-cmd --get-default drop ``` Now any new network you join will be subject to the drop zone rules unless you manually change it to something less restrictive. ## Customizing zones by opening ports and services Firewalld's developers don't intend for their zone definitions to satisfy the needs of all the different networks and levels of trust in existence. They're just starting points for you to use and customize. You don't have to know much about firewalls to be able to open and close ports based on the kinds of network activity you know you generate. ### Predefined services The simplest way to add permissions to your firewall is to add a predefined service. Strictly speaking, there's no such thing as a "service" as far as your firewall knows, because firewalls understand port numbers and protocol types. However, firewalld provides collections of ports and protocols based on standards and conventions. For example, if you're a web developer and want to open your computer up on your local network so your colleagues can see the website you're building, you would add the **http** and **https** services. If you're a gamer and you're running the open source [murmur](https://www.mumble.com/) voice-chat server for your guild, then you'd add the **murmur** service. There are many other services available, which you can view with this command: ``` $ sudo firewall-cmd --get-services amanda-client amanda-k5-client bacula bacula-client \ bgp bitcoin bitcoin-rpc ceph cfengine condor-collector \ ctdb dhcp dhcpv6 dhcpv6-client dns elasticsearch \ freeipa-ldap freeipa-ldaps ftp [...] ``` If you see a service you need, add it to your current firewall configuration, for example: `$ sudo firewall-cmd --add-service murmur` This command opens all the ports and protocols needed for a particular service *within your default zone*, but only until you reboot your computer or restart your firewall. To make your changes permanent, use the **--permanent** flag: `$ sudo firewall-cmd --add-service murmur --permanent` You can also issue the command for a zone other than your default: `$ sudo firewall-cmd --add-service murmur --permanent --zone home` ### Ports Sometimes you want to allow traffic for something that just isn't defined by firewalld's services. Maybe you're setting up a nonstandard port for a common service or you need to open an arbitrary port. For example, maybe you're running the open source [virtual tabletop](https://opensource.com/article/18/5/maptool) software [MapTool](https://github.com/RPTools). Since you're running the MapTool server and there's no industry standard governing which port MapTool runs on, you can decide what port it uses and then "poke a hole" in your firewall to allow traffic on that port. The process is basically the same as for services: `$ sudo firewall-cmd --add-port 51234/tcp` This command opens port 51234 to incoming TCP connections *in your default zone*, but only until you reboot your computer or restart your firewall. To make your changes permanent, use the **--permanent** flag: `$ sudo firewall-cmd --add-port 51234/tcp --permanent` You can also issue the command for a zone other than your default: `$ sudo firewall-cmd --add-port 51234/tcp --permanent --zone home` Allowing traffic through your computer is different from letting traffic through your router"s firewall. Your router probably has a different interface for its own embeded firewall (though the principle is the same), which is outside the scope of this article. ## Removing ports and services If you decide a service or a port is no longer needed, you can restart your firewall to clear your changes, unless you use the **--permanent** flag. If you made your changes permanent, use the **--remove-port** or **--remove-service** flag: `$ sudo firewall-cmd --remove-port 51234/tcp --permanent` You can remove ports and services from a zone other than your default zone by specifying a zone in your command: `$ sudo firewall-cmd --remove-service murmur --permanent --zone home` ## Custom zones You can use and abuse the default zones provided by firewalld, but you also have the freedom to create your own. For instance, if it makes sense for you to have a zone specific to gaming, then you can create one and switch over to it only while gaming. To create a new, empty zone, create a new zone called **game** and reload the firewall rules so that your new zone becomes active: ``` $ sudo firewall-cmd --new-zone game --permanent success $ sudo firewall-cmd --reload ``` Once it's created and active, you can customize it with all the services and ports you need to have open for game night. ## Diligence Start thinking about your firewall strategy today. Start slow, and build up some sane defaults that make sense for you. It may take time before you make it a habit to think about your firewall and understand which network services you use, but with a little exploration, you can strengthen your Linux workstation no matter what your environment. ## 3 Comments
11,095
管理你的 shell 环境
https://fedoramagazine.org/manage-your-shell-environment/
2019-07-13T12:19:27
[ "shell" ]
https://linux.cn/article-11095-1.html
![](/data/attachment/album/201907/13/121931vwyqg2wrpryzqfqy.jpg) 前段时间,Fedora Magazine 发表了一篇 [介绍 ZSH](https://fedoramagazine.org/set-zsh-fedora-system/) 的文章,它是 Fedora 默认的 bash shell 的替代品。这一次,我们将着重定制它来更有效地使用它。本文中显示的所有概念也适用于其他 shell,例如 bash。 ### 别名 别名是命令的快捷方式。为那些需要经常执行,但需要很长时间输入的长命令创建快捷方式很有用。语法是: ``` $ alias yourAlias='complex command with arguments' ``` 它们并不总是用来缩短长命令。重要的是,你将它们用于你经常执行的任务。可能的例子: ``` $ alias dnfUpgrade='dnf -y upgrade' ``` 这样,为了进行系统升级,我只需输入 `dnfUpgrade` 而不用输入完整的 `dnf` 命令。 在终端中设置别名的问题是,一旦终端会话关闭,别名就会丢失。要永久设置它们,请使用资源文件。 ### 资源文件 资源文件(即 rc 文件)是在会话或进程开始时(每个用户在开启新终端窗口或启动 vim 等新程序时)加载的配置文件。对于 ZSH,资源文件是 `.zshrc`,对于 bash,它是 `.bashrc`。 要使别名成为永久别名,你可以将它们放入资源文件中。你可以使用你选择的文本编辑器编辑资源文件。这里使用 vim: ``` $ vim $HOME/.zshrc ``` 或者对于 bash: ``` $ vim $HOME/.bashrc ``` 请注意,资源文件的位置是相对于家目录指定的。这是 ZSH(或 bash)默认为每个用户查找该文件的位置。 还有一种是将你的配置放在任何其他文件中,然后读取它: ``` $ source /path/to/your/rc/file ``` 同样,在会话中直接读取它只会将其应用于会话,因此要使其永久化,请将 `source` 命令添加到资源文件中。将文件放在不同位置的优点是你可以随时读取它。这在共享环境中很有用。 ### 环境变量 环境变量是分配了特定名称的值,你可以在脚本和命令中调用它们。它们以美元符号(`$`)开始。其中最常见的是指向主目录的 `$HOME`。 顾名思义,环境变量是你环境的一部分。使用以下语法设置变量: ``` $ http_proxy="http://your.proxy" ``` 要使其成为环境变量,请使用以下命令将其导出: ``` $ export $http_proxy ``` 要查看当前设置的所有环境变量,请使用 `env` 命令: ``` $ env ``` 该命令输出会话中可用的所有变量。要演示如何在命令中使用它们,请尝试运行以下 `echo` 命令: ``` $ echo $PWD /home/fedora $ echo $USER fedora ``` 这里发生了变量扩展,即存储在变量中的值在命令中使用。 另一个有用的变量是 `$PATH`,它定义了 shell 查找二进制文件的目录。 ### $PATH 变量 有许多对于操作系统很重要的目录或文件夹(在图形环境中调用它们的方式)。某些目录设置为保存可直接在 shell 中使用的二进制文件。这些目录在 `$PATH` 变量中定义。 ``` $ echo $PATH /usr/lib64/qt-3.3/bin:/usr/share/Modules/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/usr/libexec/sdcc:/usr/libexec/sdcc:/usr/bin:/bin:/sbin:/usr/sbin:/opt/FortiClient ``` 当你希望在 shell 中访问自己的二进制文件(或脚本)时,这会有帮助。 --- via: <https://fedoramagazine.org/manage-your-shell-environment/> 作者:[Eduard Lucena](https://fedoramagazine.org/author/x3mboy/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
Some time ago, the Fedora Magazine has published an [article introducing ZSH ](https://fedoramagazine.org/set-zsh-fedora-system/)— an alternative shell to Fedora’s default, bash. This time, we’re going to look into customizing it to use it in a more effective way. All of the concepts shown in this article also work in other shells such as bash. ### Alias Aliases are shortcuts for commands. This is useful for creating short commands for actions that are performed often, but require a long command that would take too much time to type. The syntax is: $ alias yourAlias='complex command with arguments' They don’t always need to be used for shortening long commands. Important is that you use them for tasks that you do often. An example could be: $ alias dnfUpgrade='dnf -y upgrade' That way, to do a system upgrade, I just type dnfUpgrade instead of the whole dnf command. The problem of setting aliases right in the console is that once the terminal session is closed, the alias would be lost. To set them permanently, resource files are used. ### Resource Files Resource files (or rc files) are configuration files that are loaded per user in the beginning of a session or a process (when a new terminal window is opened, or a new program like vim is started). In the case of ZSH, the resource file is *.zshrc*, and for bash it’s *.bashrc*. To make the aliases permanent, you can either put them in your resource. You can edit your resource file with a text editor of your choice. This example uses vim: $ vim $HOME/.zshrc Or for bash: $ vim $HOME/.bashrc Note that the location of the resource file is specified relatively to a home directory — and that’s where ZSH (or bash) are going to look for the file by default for each user. Other option is to put your configuration in any other file, and then source it: $ source /path/to/your/rc/file Again, sourcing it right in your session will only apply it to the session, so to make it permanent, add the source command to your resource file. The advantage of having your source file in a different location is that you can source it any time. Or anywhere which is especially useful in shared environments. ### Environment Variables Environment variables are values assigned to a specific name which can be then called in scripts and commands. They start with the $ dollar sign. One of the most common is $HOME that references the home directory. As the name suggests, environment variables are a part of your environment. Set a variable using the following syntax: $ http_proxy="http://your.proxy" And to make it an environment variable, export it with the following command: $ export http_proxy To see all the environment variables that are currently set, use the *env* command: $ env The command outputs all the variables available in your session. To demonstrate how to use them in a command, try running the following echo commands: $ echo $PWD /home/fedora $ echo $USER fedora What happens here is variable expansion — the value stored in the variable is used in your command. Another useful variable is *$PATH*, that defines directories that your shell uses to look for binaries. ### The $PATH variable There are many directories, or folders (the way they are called in graphical environments) that are important to the OS. Some directories are set to hold binaries you can use directly in your shell. And these directories are defined in the $PATH variable. $ echo $PATH /usr/lib64/qt-3.3/bin:/usr/share/Modules/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/usr/libexec/sdcc:/usr/libexec/sdcc:/usr/bin:/bin:/sbin:/usr/sbin:/opt/FortiClient This will help you when you want to have your own binaries (or scripts) accessible in the shell. ## Joao Rodrigues Aliases can have the same name as the command. For example, if you want to always run ‘dnf’ with sudo you can type: $ alias dnf=’sudo dnf’ $ dnf upgrade [sudo] password for jr: or if you want ‘rm’ to prompt you for confirmation before deleting you can type: $ alias rm=’rm -i’ $ touch foo $ rm foo rm: remove regular empty file ‘foo’? If you want to know what is being interpreted when you type a command use ‘type’. $ type dnf dnf is aliased to $ type rm rm is aliased to rm -i’ You can also print the list of all the current aliases: $ alias -p alias cp=’cp -i’ alias rm=’rm -i’ alias mv=’mv -i’ alias ls=’ls –color=auto’ alias ll=’ls -l –color=auto’ (…) You can remove an alias with the ‘unalias’ command: $ type dnf dnf is aliased to `sudo dnf’ $ unalias dnf $ type dnf dnf is /usr/bin/dnf Shell Functions are another fun way to create useful snipplets. function psman () { TF=$(mktemp) man -t “$@” > “$TF” && xdg-open “$TF” } You can now type: $ psman man and read the man(1) man page in your favourite postscript renderer ## Joao Rodrigues Something happened with the comment formatting. I think it has something to do with the back-ticks in my copy-paste. It should be: (…) $ type dnf dnf is aliased to ‘sudo dnf’ $ type rm rm is aliased to ‘rm -i’ (…) ## Thomas Nice article! By the export line should not have a dollar sign : “export http_proxy” ## Paul W. Frields @Thomas: Thanks for the catch — fixed! ## Xavier Delaruelle When you need to manage a lot of different shell variables/aliases or if you have to juggle between different shell environments, you may need some tool to dynamically set/unset your environment and keep track of changes you made. The shell utility (from the Environment Modules project, https://github.com/cea-hpc/modules/) fills these shell environment handling needs. It relies on modulefiles, which are Tcl scripts describing sets of environment change. For instance if you have a modulefile: set-alias myalias "echo Hello!" append-path PATH /path/to/myenv/bin can load and unload this modulefile to dynamically update your current shell session: bash: myalias: command not found... $ module load ./myenv $ myalias Hello! $ module unload ./myenv $ myalias bash: myalias: command not found... Read more on http://modules.sourceforge.net/ To give it a try on your Fedora workstation: ## Friendly Giraffe Hi Eduard, Thanks for the post. I tried to add my own environment variable a test – I then tried to check if it existed – Which returned 0 results. Where have I gone wrong? Thanks in advance. ## Paul W. Frields @Giraffe: It’s the errant $ in the command that’s been fixed. On behalf of the author, sorry about that! ## Friendly Giraffe Great thanks a lot Paul, working like a charm now. ## Eduard Lucena Yes, I’m sorry. The export command shouldn’t have the $ sign. It was fixed in the article. ## Avi Alkalay I always put this in ~/.bashrc: export PS1=’\h:\w\$ ‘; export HISTCONTROL=ignoredups; export HISTSIZE=9999999999; export HISTTIMEFORMAT=’%Y-%m-%dT%H:%M:%S%z :: ‘; export SEND_256_COLORS_TO_REMOTE=1; export LC_CTYPE=en_US.UTF-8; Explanation: PS1 makes prompt nicer. Big HISTSIZE will let you record more commands in your history. HISTTIMEFORMAT will also record the date and time command was issued. HISTCONTROL=ignoredups will stop wasting your time and disk space with repeating commands. ## Avi Alkalay Instead of aliases, I good practice that I have (especially when you have long history), is to tag long and important commands that I use to type with a small comment at the end. For example, here is a command that I type a lot in my Mac terminal: $ rsync –iconv=UTF8-MAC,UTF8 -avSH –progress –delete [email protected]:Media/Music/* . #musync The “#musync” at the end is the tag. Whenever I want to recall this command, I type Ctrl+R and then “musync” and shell history brings it to me ready to be executed. I call this “fast man’s aliases” ‘cause you don’t need to edit any file to define an alias. It gets recorded right there when you are typing your command. ## Jean-Christophe BAPTISTE Good tip. But much less persistent than aliases (history often gets lost). ## Anil a cool tip that i never saw anywhere 🙂 ## Paul awsome!!!!!! Thanks for sharing ## amazonguy5465184 When you really start getting into complex syntax ( single quotes, double, backticks ) quoting your alias command may become difficult. Quick solution, throw the command into a function and have your alias call the function name. instanceslistbyhilappname () { NAME=$1 printf "%s,%s,%s,%s\n" $(aws --profile saml ec2 describe-instances --output=text --filters "Name=tag:Name,Values=${NAME}" --query 'Reservations[<em>].Instances[</em>].[InstanceType,InstanceId,PrivateIpAddress,Tags[?Key== ].Value]’ | sed s’/ /_/g’) } #ALIAS alias aws-instance-byhilappname=instanceslistbyhilappname ## Paul W. Frields This comment somehow got b0rked by the editor or app. It can be helpful when dealing with blogs, online forums, etc. to pastebin a big snippet like this. Feel free to do that. ## rcb Does the shell read typographic characters? Such as U+201C “ Left double quotation mark and U+201D ” Right double quotation mark Should’nt this be ‘quotation marks’? U+0022 ” 34 Quotation mark As well as U+0027 ‘ 39 Apostrophe which is displayed as U+2018 ‘ Left single quotation mark and U+2019 ’ Right single quotation mark Entering into the shell $ text=“fast man’s aliases” && echo $text (with typographic characters) returns Whereas $ text=”fast man’s aliases” && echo $text (with quotation marks) returns ## Paul W. Frields @rcb: As far as I know, it reads only ASCII type characters, not typographic ones.
11,097
从 BASIC 到 Ruby:入门编程语言的体悟
https://opensource.com/19/7/command-line-heroes-ruby-basic
2019-07-14T13:18:37
[ "BASIC" ]
https://linux.cn/article-11097-1.html
> > 为什么 BASIC 是一种备受喜爱的入门语言?下一代该如何学习编程? > > > ![Listen to the Command Line Heroes Podcast](/data/attachment/album/201907/14/131843zs9eh4nnk3sexvnb.png "Listen to the Command Line Heroes Podcast") 《[Command Line Heroes](https://www.redhat.com/en/command-line-heroes)》 第三季的第二集今天抵达了,它对我的入门编程的怀旧让我回到了过去。 (LCTT 译注:《Command Line Heroes》 是红帽公司制作的播客,讲述了开发人员、程序员、黑客、极客和开源反叛者如何彻底改变技术前景的真实史诗。其第一季制作于 2017 年,邀请到了谷歌、NASA 等重量级企业的技术专家担当嘉宾,讲述操作系统战争风云、美国航天局如何开源等等,涉及开源、操作系统、容器、DevOps、云计算等话题。) ### 语言会影响可访问性 这一集告诉我,BASIC 是计算机的理解力民主化的一次巨大飞跃。我很难想象,在一个不太遥远的、计算机尚且是稀罕之物的时代,是 BASIC 改变了世界。正如 [Saron Yitbarek](https://twitter.com/saronyitbarek) 提到的那样,“在早些年编程,你几乎得有个博士学位才行。”BASIC 是一个巨大的飞跃,它专注于可用性(适合初学者的命令)和资源共享(单个计算机的分时操作)。它使得编程不在局限于当时的“计算机玩家”(我喜欢这集中的这句话),并帮助了新一代人参与了进来。进入编程领域的壁垒得以下降。 ### 入门编程语言 这一集的核心话题是围绕学习入门语言展开的。关于学习什么编程语言以及如何学习,有很多建议。关于这个问题[在这里](/article-8379-1.html)已经写了很多。我喜欢听到 Saron 以 Ruby 作为她的介绍的故事,以及它以一种几乎意想不到的方式变得有趣。我有一些类似的经历,因为我在一些项目中用到了 Ruby。它的灵活性让我感到开心。当我(对编程)感到紧张时,正是这种快乐让我重新回到它的身边,并且它有一些能够使语言如此充满情感的强大功能。 我第一次体验编程是用 HTML 和 CSS,但我第一个重型编程语言是 Java。我永远不会忘记在课堂的第一天被告知要记住 `public static void main`,但没有告知我关于它意味着什么的任何信息。我们花了很多时间在面向对象编程的上下文环境中探讨它是什么,但它从未像我在 Ruby 中使用 `.each` 迭代列表,或者像在 Python 中用 `import numpy` 做一些数学魔术那样感到兴奋。然后我听说孩子们正在学习如何使用 Python 编写 [Minecraft](https://opensource.com/life/15/5/getting-started-minecraft-pi) 或使用像 [Scratch](https://opensource.com/education/11/6/how-teach-next-generation-open-source-scratch) 这样的可视化编程语言,我因此而悟,BASIC 的遗产正在以新的方式存在。 我从这一集中获取到的内容: * 请记住,没有人出生就是程序员。每个人都没有这样的背景。你并不孤单。 * 学习一门语言。任何一种都行。如果你有选择的可能,那么请选择能带给你最大乐趣的那个。 * 不要忘记所有语言都可以构建一些东西。请为人类创造有意义的事物。 《Command Line Heroes》整个第三季将涉及编程语言。[请在此处订阅来学习你想要了解的有关编程语言的起源](https://www.redhat.com/en/command-line-heroes),我很乐意在下面的评论中听到你的想法。 --- via: <https://opensource.com/19/7/command-line-heroes-ruby-basic> 作者:[Matthew Broberg](https://opensource.com/users/mbbroberg) 选题:[lujun9972](https://github.com/lujun9972) 译者:[wxy](https://github.com/wxy) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
The second episode of this [Command Line Heroes](https://www.redhat.com/en/command-line-heroes) season 3 drops today and it sent me back through a nostalgic look at the idea of first programming languages. ## Languages affect accessibility This episode taught me that BASIC was a huge leap in the democratization of computer comprehension. It's hard for me to imagine a time when computers were scarce, but that not-so-distant past was when BASIC changed the world. As [Saron Yitbarek](https://twitter.com/saronyitbarek) mentions, "In the early days of programming, you pretty much needed a Ph.D. to do anything." BASIC was such a monumental leap with its focus on usability (beginner-friendly commands) and resource sharing (timesharing of a single computer). It helped programming get beyond the "computer jocks" of the time (I love that phrase from the episode) and helped a new generation of people participate. The barrier of entry dropped. ## First programming languages The heart of this episode rests on the topic of learning the first language. There is so much advice out there about what to learn and how to learn it. Quite a lot has been written on the subject [on here](https://opensource.com/article/17/1/choosing-your-first-programming-language). I love hearing Saron's story of Ruby being her introduction, and how it was fun in an almost unexpected way. I had a similar experience as I dug into Ruby for a few projects. It's wildly flexible in a way that makes me happy. It's that happiness that keeps me coming back to it when I'm in a pinch, and there's something powerful about how languages can be so emotionally charged. I first experienced programming with HTML and CSS, but the first heavy-duty language was Java. I will never forget being told on day one of class to memorize **public static void main** without any context on what it meant. We took a good bit of that semester to explore what it in the context of object-oriented programming, but it never made me feel as excited as when I iterate over a list using **.each** in Ruby or **import numpy** and do some mathematical magic in Python. Then I hear about how kids are learning to program with Python for [Minecraft](https://opensource.com/life/15/5/getting-started-minecraft-pi) or visual programming languages like [Scratch](https://opensource.com/education/11/6/how-teach-next-generation-open-source-scratch) and I am inspired. The legacy of BASIC lives on in new ways. Which leads to my takeaways from this episode: - Remember that no one is born a programmer. Everyone starts with no background. You're not alone there. - Learn a language. Any of them. Choose the one that brings you the most joy if you have the luxury of choosing. - Don't forget that all languages are there to build something. Create meaningful things for humans. Command Line Heroes will cover programming languages for all of season 3. [Subscribe here to learn everything you want to know about the origin of programming languages](https://www.redhat.com/en/command-line-heroes), and I would love to hear your thoughts in the comments below. ## 6 Comments
11,098
5G 会增强 Wi-Fi,而不是取代它
https://www.networkworld.com/article/3399978/5g-will-augment-wi-fi-not-replace-it.html
2019-07-14T14:58:00
[ "WiFi", "5G" ]
https://linux.cn/article-11098-1.html
> > Aruba 战略和企业发展副总裁 Jeff Lipton 为 5G 炒作增添了一些干货,讨论了它和 Wi-Fi 如何协同工作以及如何最大化两者的价值。 > > > ![](/data/attachment/album/201907/14/145851d6eh327nlllmd838.jpg) 如今可以说没有技术主题比 [5G](https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html) 更热。这是最近 [移动世界大会](https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html) 节目的一个主题,并且已经在其他活动中占据了主导地位,例如 Enterprise Connect 和我参加的几乎所有供应商活动。 一些供应商将 5G 定位为解决所有网络问题的灵丹妙药,并预测它将消除所有其他形式的网络。像这样的观点显然是极端的,但我相信 5G 会对网络行业产生影响,网络工程师应该意识到这一点。 为了帮助为 5G 炒作带来一些现实感,我最近采访了一家惠普公司旗下的 Aruba 公司的战略和企业发展副总裁 Jeff Lipton,因为我知道惠普已经深入参与了 5G 和 Wi-Fi 的发展。 ### Zeus Kerravala: 5G 被吹捧为“明日之星”。你是这样看的吗? **Jeff Lipton:** 接下来的重点是连接“事物”并从这些事物中产生可操作的见解和背景。5G 是服务于这一趋势的技术之一。Wi-Fi 6 是另一个,还有边缘计算、蓝牙低功耗(BLE)、人工智能(AI)和机器学习(ML)。这一切都很重要,全都有自己的用武之地。 ### 你是否在企业中看到 5G 的风头盖过 Wi-Fi? **Lipton:** 与所有蜂窝接入一样,如果你需要<ruby> 宏观区域覆盖 <rt> macro area coverage </rt></ruby>和高速切换,使用 5G 是合适的。但对于大多数企业级应用程序而言,它通常不需要这些功能。从性能角度来看,[Wi-Fi 6](https://www.networkworld.com/article/3215907/why-80211ax-is-the-next-big-thing-in-wi-fi.html) 和 5G 在大多数指标上大致相等,包括吞吐量、延迟、可靠性和连接密度。它们并不相似的地方在经济方面,Wi-Fi 要好得多。我不认为很多客户愿意用 Wi-Fi 交换 5G,除非他们需要宏观覆盖或高速切换。 ### Wi-Fi 和 5G 可以共存吗? 企业如何一起使用 5G 和 Wi-Fi? **Lipton:** Wi-Fi 和 5G 可以共存并且应该是互补的。5G 架构将蜂窝核心和无线接入网络(RAN)分离。因此,Wi-Fi 可以是企业无线电前端,并与 5G 核心紧密连接。由于 Wi-Fi(特别是 Wi-Fi 6)的经济有利,并且性能非常好,我们设想许多服务提供商会使用 Wi-Fi 作为其 5G 系统的无线电前端,充当其分布式天线(DAS)和小型蜂窝系统的替代方案。 > > “Wi-Fi 和 5G 可以并且应该是互补的。” — Jeff Lipton > > > ### 如果一个企业打算完全转向 5G,那将如何实现以及它的实用性如何? **Lipton:** 为了将 5G 用于主要的室内访问方式,客户需要升级其网络和几乎所有设备。5G 在室外提供良好的覆盖,但蜂窝信号不能可靠地穿透建筑物,5G 会使这个问题变得更糟,因为它部分依赖于更高频率的无线电。因此,服务提供商需要一种提供室内覆盖的方法。为了提供这种覆盖,他们会部署 DAS 或小型蜂窝系统 —— 由终端客户支付费用。然后,客户将他们的设备直连到这些蜂窝系统,并为每个设备支付服务合同。 这种方法存在一些问题。首先,DAS 和小型蜂窝系统比 Wi-Fi 网络贵得多。并且成本不会仅限于网络。每台设备都需要一台 5G 蜂窝调制解调器,批量价格高达数十美元,而终端用户通常需要花费一百多美元。由于目前很少或者没有 MacBook、PC、打印机、AppleTV 有 5G 调制解调器,因此需要对这些设备进行升级。我不相信很多企业会愿意支付这笔额外费用并升级他们的大部分设备以获得尚不明确的好处。 ### 经济性是 5G 与 Wi-Fi 之争的一个要素吗? **Lipton:** 经济性始终是一个要素。让我们将对话集中在室内企业级应用程序上,因为这是一些运营商打算用 5G 定位的用例。我们已经提到升级到 5G 将要求企业部署昂贵的 DAS 或小型蜂窝系统用于室内覆盖,几乎将所有设备升级到包含 5G 调制解调器,并为每个设备支付服务合同。理解 5G 蜂窝网络和 DAS 系统在许可频谱上运行也很重要,这类似于一条私人高速公路。服务提供商为此频谱支付了数十亿美元,这笔费用需要货币化并嵌入服务成本中。因此,从部署和生命周期的角度来看,Wi-Fi 在经济上比 5G 有利。 ### 5G 与 Wi-Fi 相比有任何安全隐患吗? **Lipton:** 一些人认为蜂窝技术比 Wi-Fi 更安全,但事实并非如此。LTE 相对安全,但也有弱点。例如,普渡大学和爱荷华大学的研究人员表示,LTE 容易受到一系列攻击,包括数据拦截和设备跟踪。5G 通过多种认证方法和更好的密钥管理改进了 LTE 安全性。 Wi-Fi 的安全性也没有停滞不前而是在继续发展。当然,不遵循最佳实践的 Wi-Fi 实现,例如那些甚至没有基本密码保护的实现,并不是最佳的。但那些配置了适当的访问控制和密码的则是非常安全的。随着新标准 —— 特别是 WPA3 和<ruby> 增强开放 <rt> Enhanced Open </rt></ruby> —— Wi-Fi 网络安全性进一步提高。 同样重要的是要记住,企业已根据其特定需求对安全性和合规性解决方案进行了大量投资。对于包括 5G 在内的蜂窝网络,企业将失去部署所选安全性和合规性解决方案的能力,以及对流量流的大多数可见性。虽然 5G 的未来版本将通过称为网络切片的功能提供高级别的自定义,但企业仍将失去他们目前需要的和拥有的安全性和合规性定制级别。 ### 关于 5G 与 Wi-Fi 之间的讨论的补充想法 **Lipton:** 围绕 Wi-Fi 与 5G 的争论忽略了这一点。它们都有自己的用武之地,而且它们在很多方面都是互补的。由于需要连接和分析越来越多的东西,Wi-Fi 和 5G 市场都将增长。如果客户需要宏观覆盖或高速切换,并且可以为这些功能支付额外成本,那么 5G 是可行的。 5G 也适用于客户需要物理网络分段的某些工业用例。但对于绝大多数企业客户而言,Wi-Fi 将继续像现在一样证明自己作为可靠、安全且经济高效的无线接入技术的价值。 **更多关于 802.11ax (Wi-Fi 6):** * [为什么 802.11ax 是无线网络的下一件大事](https://www.networkworld.com/article/3215907/mobile-wireless/why-80211ax-is-the-next-big-thing-in-wi-fi.html) * [FAQ:802.11ax Wi-Fi](https://%20https//www.networkworld.com/article/3048196/mobile-wireless/faq-802-11ax-wi-fi.html) * [Wi-Fi 6 (802.11ax) 正在来到你附近的路由器](https://www.networkworld.com/article/3311921/mobile-wireless/wi-fi-6-is-coming-to-a-router-near-you.html) * [带有 OFDMA 的 Wi-Fi 6 打开了一个全新的无线可能性世界](https://www.networkworld.com/article/3332018/wi-fi/wi-fi-6-with-ofdma-opens-a-world-of-new-wireless-possibilities.html) * [802.11ax 预览:支持 Wi-Fi 6 的接入点和路由器随时可用](https://www.networkworld.com/article/3309439/mobile-wireless/80211ax-preview-access-points-and-routers-that-support-the-wi-fi-6-protocol-on-tap.html) --- via: <https://www.networkworld.com/article/3399978/5g-will-augment-wi-fi-not-replace-it.html> 作者:[Zeus Kerravala](https://www.networkworld.com/author/Zeus-Kerravala/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[GraveAccent](https://github.com/graveaccent) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
301
Moved Permanently
null
11,099
在 Linux 中如何从命令行查找 VirtualBox 版本
https://www.ostechnix.com/how-to-find-virtualbox-version-from-commandline-in-linux/
2019-07-14T15:08:13
[ "VirtualBox" ]
https://linux.cn/article-11099-1.html
![FInd Virtualbox version from commandline In Linux](/data/attachment/album/201907/14/150821ufgf8hd4jleoxepl.png) 我使用 Oracle VirtualBox 和 [KVM](https://www.ostechnix.com/setup-headless-virtualization-server-using-kvm-ubuntu/) 虚拟化程序[测试不同的 Linux 操作系统](https://www.ostechnix.com/test-100-linux-and-unix-operating-systems-online-for-free/)。虽然我偶尔使用 KVM,但 Virtualbox 始终是我的首选。不是因为我不喜欢 KVM,而是因为我只是习惯了 VirtualBox。当在我的 Ubuntu 无头服务器上使用 [Virtualbox](https://www.ostechnix.com/install-oracle-virtualbox-ubuntu-16-04-headless-server/) 时,我需要知道 VirtualBox 的版本。如果它有 GUI,我可以进入 Virtualbox -> About -> Help 轻松找到它。但我的是没有 GUI 的 Ubuntu 服务器。如果你想知道如何在 Linux 中从命令行查找 VirtualBox 版本,可以采用以下几种方法。 ### 在 Linux 中从命令行查找 VirtualBox 版本 要查找已安装的 VirtualBox 的版本,请打开终端并运行以下命令: ``` $ vboxmanage --version ``` 示例输出: ``` 5.2.18_Ubuntur123745 ``` ![](/data/attachment/album/201907/14/150822esgd1wmn5d9n89q1.png) *在 Linux 中从命令行查找 Virtualbox 版本* 正如你在上面的输出中看到的,安装的 VirtualBox 的版本是 5.2。 查找 VirtualBox 版本的另一种方法是: ``` $ vbox-img --version ``` 示例输出: ``` 5.2.18_Ubuntur123745 ``` 或者,你可以使用 `head` 和 `awk` 命令来查找 VirtualBox 版本。 ``` $ virtualbox --help | head -n 1 | awk '{print $NF}' ``` 示例输出: ``` 5.2.18_Ubuntu ``` 或者,使用 `echo` 命令结合 `head` 和 `awk` 命令: ``` $ echo $(virtualbox --help | head -n 1 | awk '{print $NF}') ``` 示例输出: ``` 5.2.18_Ubuntu ``` 以上命令适用于任何 Linux 发行版。如果你使用的是 Ubuntu,你可以使用 `dpkg` 命令查看 VirtualBox 版本。 ``` $ dpkg -l | grep virtualbox | awk '{print $3}' ``` 示例输出: ``` 5.2.30-130521~Ubuntu~bionic 5.2.18-dfsg-2~ubuntu18.04.5 ``` 就是这些了。这些是从 Linux 中的终端查找 Oracle Virtualbox 版本的几种方法。希望这篇文章很有用。 参考来自: * [AskUbuntu](https://askubuntu.com/questions/420363/how-do-i-check-virtualbox-version-from-cli) --- via: <https://www.ostechnix.com/how-to-find-virtualbox-version-from-commandline-in-linux/> 作者:[sk](https://www.ostechnix.com/author/sk/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
403
Forbidden
null
11,101
帮助你驾驭 Kubernetes 的 4 个工具
https://opensource.com/article/19/6/tools-drive-kubernetes
2019-07-15T12:20:49
[ "Kubernetes" ]
/article-11101-1.html
> > 学习如何驾驭 Kubernetes 比如何建造它更重要,这些工具可以帮助你更快上路。 > > > ![Tools in a workshop](/data/attachment/album/201907/15/122052y1b0rc3nixnyvcn8.jpg "Tools in a workshop") 在本系列的第三篇文章中,[Kubernetes 基础:首先学习如何使用](/article-11036-1.html),我强调你应该学会使用 Kubernetes,而不是建造它。我还解释说,在 Kubernetes 中,你必须学习最小的一组原语来建模应用程序。我想强调这一点:你需要学习的这组原语是最简单的原语集,你可以通过它们学习如何实现生产级的应用程序部署(即高可用性 [HA]、多容器、多应用程序)。换句话说,学习 Kubernetes 内置的原语集比学习集群软件、集群文件系统、负载平衡器、让人发疯的 Apache 和 Nginx 的配置、路由器、交换机、防火墙和存储后端更容易 —— 这些是你在传统的 IT 环境(虚拟机或裸机)中建模简单的 HA 应用程序所需要的东西。 在这第四篇文章中,我将分享一些有助于你学习快速驾驭 Kubernetes 的工具。 ### 1、Katacoda 无疑,[Katacoda](https://learn.openshift.com/subsystems/container-internals-lab-2-0-part-1) 是试驾 Kubernetes 集群的最简单方法。只需单击一下,五秒钟后就可以将基于 Web 的终端直接连接到正在运行的 Kubernetes 集群中。这对于使用和学习来说非常棒。我甚至将它用于演示和测试新想法。Katacoda 提供了一个完整的临时环境,在你使用完毕后可以回收利用。 ![OpenShift Playground](/data/attachment/album/201907/15/122053tz76pb1avpfpq6bb.png "OpenShift Playground") *[OpenShift Playground](https://learn.openshift.com/playgrounds/openshift311/)* ![Kubernetes Playground](/data/attachment/album/201907/15/122054hal8g72papgllno4.png "Kubernetes Playground") *[Kubernetes Playground](https://katacoda.com/courses/kubernetes/playground)* Katacoda 提供了一个临时的环境和更深入的实验室环境。例如,我最近三四年主讲的 [Linux Container Internals Lab](https://learn.openshift.com/subsystems/container-internals-lab-2-0-part-1) 是在 Katacoda 中构建的。 Katacoda 在其主站点上维护了若干 [Kubernetes 和云教程](https://katacoda.com/learn)并与 Red Hat 合作以支持了一个 [OpenShift 的专用学习门户](http://learn.openshift.com/)。了解一下,它们是极好的学习资源。 当你第一次学习驾驶翻斗车时,最好先观察一下其他人的驾驶方式。 ### 2、Podman generate kube `podman generate kube` 命令是一个很棒的子命令,可以帮助用户自然地从运行简单容器的简单容器引擎转换到运行许多容器的集群用例(正如我在[上篇文章](/article-11036-1.html)中所描述的那样)。[Podman](https://podman.io/) 通过让你启动一个新的容器,然后导出这个可工作的 Kube YAML,并在 Kubernetes 中启动它来实现这一点。看看这个(你可以在 [Katacoda lab](https://learn.openshift.com/subsystems/container-internals-lab-2-0-part-1) 中运行它,它已经有了 Podman 和 OpenShift)。 首先,请注意运行容器的语法与 Docker 非常相似: ``` podman run -dtn two-pizza quay.io/fatherlinux/two-pizza ``` 不过这个是其它容器引擎所没有的: ``` podman generate kube two-pizza ``` 输出: ``` # Generation of Kubernetes YAML is still under development! # # Save the output of this file and use kubectl create -f to import # it into Kubernetes. # # Created with podman-1.3.1 apiVersion: v1 kind: Pod metadata: creationTimestamp: "2019-06-07T08:08:12Z" labels: app: two-pizza name: two-pizza spec: containers: - command: - /bin/sh - -c - bash -c 'while true; do /usr/bin/nc -l -p 3306 < /srv/hello.txt; done' env: - name: PATH value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - name: TERM value: xterm - name: HOSTNAME - name: container value: oci image: quay.io/fatherlinux/two-pizza:latest name: two-pizza resources: {} securityContext: allowPrivilegeEscalation: true capabilities: {} privileged: false readOnlyRootFilesystem: false tty: true workingDir: / status: {} --- apiVersion: v1 kind: Service metadata: creationTimestamp: "2019-06-07T08:08:12Z" labels: app: two-pizza name: two-pizza spec: selector: app: two-pizza type: NodePort status: loadBalancer: {} ``` 你现在有了一些可以的工作 Kubernetes YAML,你可以用它作为练习的起点来学习、调整等等。`-s` 标志可以为你创造一项服务。[Brent Baude](https://developers.redhat.com/blog/author/bbaude/) 甚至致力于[添加卷/持久卷断言](https://github.com/containers/libpod/issues/2303)等新功能。如果想进一步深入,请在 Brent 的博客文章《[Podman 现在可以轻松过渡到 Kubernetes 和 CRI-O](https://developers.redhat.com/blog/2019/01/29/podman-kubernetes-yaml/)》中了解他的工作。 ### 3、oc new-app `oc new-app` 命令非常强大。它是特定于 OpenShift 的,所以它在默认的 Kubernetes 中不可用,但是当你开始学习 Kubernetes 时它非常有用。让我们从快速命令开始创建一个相当复杂的应用程序: ``` oc new-project -n example oc new-app -f https://raw.githubusercontent.com/openshift/origin/master/examples/quickstarts/cakephp-mysql.json ``` 使用 `oc new-app`,你可以从 OpenShift 开发人员那里偷取模板,并在开发原语来描述你自己的应用程序时拥有一个已知良好的起点。运行上述命令后,你的 Kubernetes 命名空间(在 OpenShift 中)将由若干新的已定义资源填充。 ``` oc get all ``` 输出: ``` NAME READY STATUS RESTARTS AGE pod/cakephp-mysql-example-1-build 0/1 Completed 0 4m pod/cakephp-mysql-example-1-gz65l 1/1 Running 0 1m pod/mysql-1-nkhqn 1/1 Running 0 4m NAME DESIRED CURRENT READY AGE replicationcontroller/cakephp-mysql-example-1 1 1 1 1m replicationcontroller/mysql-1 1 1 1 4m NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/cakephp-mysql-example ClusterIP 172.30.234.135 <none> 8080/TCP 4m service/mysql ClusterIP 172.30.13.195 <none> 3306/TCP 4m NAME REVISION DESIRED CURRENT TRIGGERED BY deploymentconfig.apps.openshift.io/cakephp-mysql-example 1 1 1 config,image(cakephp-mysql-example:latest) deploymentconfig.apps.openshift.io/mysql 1 1 1 config,image(mysql:5.7) NAME TYPE FROM LATEST buildconfig.build.openshift.io/cakephp-mysql-example Source Git 1 NAME TYPE FROM STATUS STARTED DURATION build.build.openshift.io/cakephp-mysql-example-1 Source Git@47a951e Complete 4 minutes ago 2m27s NAME DOCKER REPO TAGS UPDATED imagestream.image.openshift.io/cakephp-mysql-example docker-registry.default.svc:5000/example/cakephp-mysql-example latest About aminute ago NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD route.route.openshift.io/cakephp-mysql-example cakephp-mysql-example-example.2886795271-80-rhsummit1.environments.katacoda.com cakephp-mysql-example <all> None ``` 这样做的好处是你可以删除 Pod,观察复制控制器如何重新创建它们,缩放 Pod 等等。你可以使用模板并将其更改为其他应用程序(这是我第一次启动时所做的)。 ### 4、Visual Studio Code 我把我最喜欢的放在最后。我的大部分工作都使用 [vi](https://en.wikipedia.org/wiki/Vi),但我从来没有为 Kubernetes 找到一个好的语法高亮器和代码补完插件(如果有的话,请告诉我)。相反,我发现微软的 [VS Code](https://code.visualstudio.com/) 有一套杀手级的插件,可以完成 Kubernetes 资源的创建并提供样板。 ![VS Code plugins UI](/data/attachment/album/201907/15/122055gex5smsd2s9gr79b.png "VS Code plugins UI") 首先,安装上图中显示的 Kubernetes 和 YAML 插件。 ![Autocomplete in VS Code](/data/attachment/album/201907/15/122056hk2pn3m2ddpms1rr.png "Autocomplete in VS Code") 然后,你可以从头开始创建新的 YAML 文件,并自动补完 Kubernetes 资源。上面的示例显示了一个服务。 ![VS Code autocomplete filling in boilerplate for an object](/data/attachment/album/201907/15/122057sm8ufuwvlhavja7f.png "VS Code autocomplete filling in boilerplate for an object") 当你使用自动补完并选择服务资源时,它会填充该对象的一些模板。当你第一次学习使用 Kubernetes 时,这非常棒。你可以构建 Pod、服务、复制控制器、部署等。当你从头开始构建这些文件甚至修改你使用 `podman generate kube` 创建的文件时,这是一个非常好的功能。 ### 总结 这四个工具(如果算上两个插件,则为六个)将帮助你学习驾驭 Kubernetes,而不是构造或装备它。在本系列的最后一篇文章中,我将讨论为什么 Kubernetes 如此适合运行这么多不同的工作负载。 --- via: <https://opensource.com/article/19/6/tools-drive-kubernetes> 作者:[Scott McCarty](https://opensource.com/users/fatherlinux/users/fatherlinux/users/fatherlinux/users/fatherlinux) 选题:[lujun9972](https://github.com/lujun9972) 译者:[wxy](https://github.com/wxy) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
null
HTTPSConnectionPool(host='opensource.com', port=443): Read timed out. (read timeout=10)
null
11,102
什么是 DevSecOps?
https://opensource.com/article/19/1/what-devsecops
2019-07-15T14:17:39
[ "DevSecOps", "DevOps" ]
https://linux.cn/article-11102-1.html
> > DevSecOps 的实践之旅开始于 DevSecOps 增权、赋能和培养。下面就介绍如何开始学习使用 DevSecOps。 > > > ![](/data/attachment/album/201907/15/141713lo98h7zm6m88n96u.jpg) > > Stephen Streichsbier 说过: DevSecOps 使得组织可以用 DevOps 的速度发布内在安全的软件。 > > > DevSecOps 是一场关于 DevOps 概念实践或艺术形式的变革。为了更好理解 DevSecOps,你应该首先理解 DevOps 的含义。 DevOps 起源于通过合并开发和运维实践,消除隔离,统一关注点,提升团队和产品的效率和性能。它是一种注重于构建容易维护和易于平常自动运营的产品和服务的新型协作方式。 安全在很多团队中都是常见的隔离点。安全的核心关注点是保护团队,而有时这也意味着创建延缓新服务或是新产品发布的障碍或策略,用于保障任何事都能被很好的理解和安全的执行,并且没有给团队带来不必要的风险。 因为安全隔离点方面的明显特征和它可能带来的摩擦,开发和运维有时会避开安全要求以满足客观情况。在一些公司,这种隔离形成了一种产品安全完全是安全团队责任的期望,并取决于安全团队去寻找产品的安全缺陷或是可能带来的问题。 DevSecOps 看起来是通过给开发或是运维角色加强或是建立安全意识,或是在产品团队中引入一个安全工程师角色,在产品设计中找到安全问题,从而把安全要求汇聚在 Devops 中。 这样使得公司能更快发布和更新产品,并且充分相信安全已经嵌入产品中。 ### 坚固的软件哪里适用 DevSecOps? 建造坚固的软件是 DevOps 文化的一个层面而不是一个特别的实践,它完善和增强了 DevSecOps 实践。想想一款坚固的软件就像是某些经历过残酷战斗过程的事物。 有必要指出坚固的软件并不是 100% 安全可靠的(虽然它可能最终是在某些方面)。然而,它被设计成可以处理大部分被抛过来的问题。 践行坚固软件最重要的原则是促进竞争、实践、可控的失败与合作。 ### 你该如何开始学习 DevSecOps ? 开始实践 DevSecOps 涉及提升安全需求和在开发过程中尽可能早的阶段进行实践。它最终在公司文化上提升了安全的重要性,使得安全成为所有人的责任,而并不只是安全团队的责任。 你可能在团队中听说过“<ruby> 左上升 <rt> shift left </rt></ruby>”这个词,如果你把开发周期线扁平化到一条横线上,以包括产品变革的的关键时期:从初始化到设计、建造、测试以及最终的运行,安全的目的就是尽早的参与进来。这使得风险可以在设计中能更好的评估、交流和减轻。“左提升”的含义是指促使安全能在开发周期线上更往左走。 这个过程始于三个关键要素: * <ruby> 增权 <rt> empowerment </rt></ruby> * <ruby> 赋能 <rt> enablement </rt></ruby> * <ruby> 培养 <rt> education </rt></ruby> 增权,在我看来,是关于释放控制权以及使得团队(在理性分析下)做出独立决定而不用害怕失败或影响。这个过程的唯一告诫信息就是要严格的做出明智的决定(不要比这更低要求)。 为了实现增权,商务和行政支持(通过内部销售、展示来建立,通过建立矩阵来展示这项投资的回报)是打破历史障碍和割裂的团队的关键。合并安全人员到开发和运维团队中,提升交流和透明度有助于开始 DevSecOps 之旅。 这个整合和移动使得团队只关注单一的结果:打造一个他们共同负责的产品,让开发和安全人员相互依赖合作。这将引领你们共同走向增权。这是产品研发团队的共同责任,并保证每个可分割的产品都保持其安全性。 赋能涉及正确的使用掌握在团队手中的工具和资源。这是建立一种通过论坛、维基、信息聚合的知识分享文化。 打造一种注重自动化、重复任务应该编码来尽可能减少以后的操作并增强安全性的理念。这种场景不仅仅是提供知识,而是让这种知识能够通过多种渠道和媒介(通过某些工具)可获取,以便它可以被团队或是个人以他喜欢的方式去消化和分享。当团队成员正在编码时一种媒介可能工作的很好,而当他们在进行中时另一种可能更好。让工具简单可用,让团队用上它们。 不同的 DevSecOps 团队有不同的喜好,因此允许他们尽可能的保持独立。这是一个微妙的平衡工作,因为你确实希望实现规模经济和产品间共享的能力。在选择中协作和参与,并更新工具方法有助于减少使用中的障碍。 最后,也可能是最重要的,DevSecOps 是有关训练和兴趣打造。聚会、社交或是组织中通常的报告会都是让同事们教学和分享他们的知识的很棒的方式。有时,这些会突出其他人可能没有考虑过的共同挑战、顾虑或风险。分享和教学也是一种高效的学习和指导团队的方法。 在我个人经验中,每个团队的文化都是独一无二的,因此你不能用一种“普适”的方法。走进你的团队并找到他们想要使用的工具方法。尝试不同的论坛和聚会并找出最适用于你们文化的方式。寻找反馈并询问团队如何工作,他们喜欢什么以及对应的原因。适应和学习,保持乐观,不要停止尝试,你们将会有所收获。 * [下载 DevSecOps 的入门手册](https://opensource.com/downloads/devsecops) --- via: <https://opensource.com/article/19/1/what-devsecops> 作者:[Brett Hunoldt](https://opensource.com/users/bretthunoldtcom) 选题:[lujun9972](https://github.com/lujun9972) 译者:[PandaWizard](https://github.com/PandaWizard) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
“DevSecOps enables organizations to deliver inherently secure software at DevOps speed.” -Stefan Streichsbier DevSecOps as a practice or an art form is an evolution on the concept of DevOps. To better understand DevSecOps, you should first have an understanding of what DevOps means. DevOps was born from merging the practices of development and operations, removing the silos, aligning the focus, and improving efficiency and performance of both the teams and the product. A new synergy was formed, with DevOps focused on building products and services that are easy to maintain and that automate typical operations functions. Security is a common silo in many organizations. Security’s core focus is protecting the organization, and sometimes this means creating barriers or policies that slow down the execution of new services or products to ensure that everything is well understood and done safely and that nothing introduces unnecessary risk to the organization. [[Download the Getting started with DevSecOps guide]](https://opensource.com/downloads/devsecops) Because of the distinct nature of the security silo and the friction it can introduce, development and operations sometimes bypass or work around security to meet their objectives. At some firms, the silo creates an expectation that security is entirely the responsibility of the security team and it is up to them to figure out what security defects or issues may be introduced as a result of a product. DevSecOps looks at merging the security discipline within DevOps. By enhancing or building security into the developer and/or operational role, or including a security role within the product engineering team, security naturally finds itself in the product by design. This allows companies to release new products and updates more quickly and with full confidence that security is embedded into the product. ## Where does rugged software fit into DevSecOps? Building rugged software is more an aspect of the DevOps culture than a distinct practice, and it complements and enhances a DevSecOps practice. Think of a rugged product as something that has been battle-hardened through experimentation or experience. It’s important to note that rugged software is not necessarily 100% secure (although it may have been at some point in time). However, it has been designed to handle most of what is thrown at it. The key tenets of a rugged software practice are fostering competition, experimentation, controlled failure, and cooperation. ## How do you get started in DevSecOps? Gettings started with DevSecOps involves shifting security requirements and execution to the earliest possible stage in the development process. It ultimately creates a shift in culture where security becomes everyone’s responsibility, not only the security team’s. You may have heard teams talking about a "shift left." If you flatten the development pipeline into a horizontal line to include the key stages of the product evolution—from initiation to design, building, testing, and finally to operating—the goal of a security is to be involved as early as possible. This allows the risks to be better evaluated, socialized, and mitigated by design. The "shift-left" mentality is about moving this engagement far left in this pipeline. This journey begins with three key elements: - empowerment - enablement - education Empowerment, in my view, is about releasing control and allowing teams to make independent decisions without fear of failure or repercussion (within reason). The only caveat in this process is that information is critical to making informed decisions (more on that below). To achieve empowerment, business and executive support (which can be created through internal sales, presentations, and establishing metrics to show the return on this investment) is critical to break down the historic barriers and siloed teams. Integrating security into the development and operations teams and increasing both communication and transparency can help you begin the journey to DevSecOps. This integration and mobilization allows teams to focus on a single outcome: Building a product for which they share responsibility and collaborate on development and security in a reliable way. This will take you most of the way towards empowerment. It places the shared responsibility for the product with the teams building it and ensures that any part of the product can be taken apart and maintain its security. Enablement involves placing the right tools and resources in the hands of the teams. It’s about creating a culture of knowledge-sharing through forums, wikis, and informal gatherings. Creating a culture that focuses on automation and the concept that repetitive tasks should be coded will likely reduce operational overhead and strengthen security. This scenario is about more than *providing* knowledge; it is about making this knowledge highly accessible through multiple channels and mediums (which are enabled through tools) so that it can be consumed and shared in whatever way teams or individuals prefer. One medium might work best when team members are coding and another when they are on the road. Make the tools accessible and simple and let the team play with them. Finally, and perhaps most importantly, DevSecOps is about training and awareness building. Meetups, social gatherings, or formal presentations within the organization are great ways for peers to teach and share their learnings. Sometimes these highlight shared challenges, concerns, or risks others may not have considered. Sharing and teaching are also effective ways to learn and to mentor teams. In my experience, each organization's culture is unique, so you can’t take a “one-size-fits-all” approach. Reach out to your teams and find out what tools they want to use. Test different forums and gatherings and see what works best for your culture. Seek feedback and ask the teams what is working, what they like, and why. Adapt and learn, be positive, and never stop trying, and you’ll almost always succeed. ## 1 Comment
11,104
Pipx:在隔离环境中安装和运行 Python 应用
https://www.ostechnix.com/pipx-install-and-run-python-applications-in-isolated-environments/
2019-07-15T15:17:11
[ "Python", "pipx" ]
https://linux.cn/article-11104-1.html
![](/data/attachment/album/201907/15/151714m0e3t3dyycyr9c50.png) 我们始终建议在虚拟环境中安装 Python 应用以避免彼此冲突。Pip 包管理器可以帮助我们在隔离的环境中安装 Python 应用,我们使用两个工具,即 `venv` 和 `virtualenv`。还有一个 Python.org 推荐的名为 [Pipenv](https://www.ostechnix.com/pipenv-officially-recommended-python-packaging-tool/) 的 Python 包管理器也可以用来安装 Python 应用。与 Pip 不同,Pipenv 默认会自动创建虚拟环境。这意味着你不再需要为项目手动创建虚拟环境。今天,我偶然发现了一个名为 “Pipx” 的类似工具,它是一个自由开源程序,允许你在隔离的虚拟环境中安装和运行 Python 应用。 使用 Pipx,我们可以轻松安装 PyPI 中托管的数千个 Python 应用,而不会有太多麻烦。好的是,你可以使用常规用户权限执行所有操作。你不需要成为 “root” 用户或不需要具有 “sudo” 权限。值得一提的是,Pipx 可以从临时环境运行程序,而无需安装它。当你经常测试同一程序的多个版本时,这将非常方便。随 Pipx 一起安装的软件包可以随时列出、升级或卸载。Pipx 是一个跨平台的程序,因此它可以在 Linux、Mac OS 和 Windows 上运行。 ### 安装 Pipx Python 3.6+ 、Pip 和 `venv` 模块是安装 `pipx` 所必需的。确保按照以下指南中的说明安装它们。 * [如何使用 Pip 管理 Python 包](https://www.ostechnix.com/manage-python-packages-using-pip/) 此处,需要 `venv` 来创建虚拟环境。 接下来,运行以下命令安装 Pipx。 ``` $ python3 -m pip install --user pipx $ python3 -m userpath append ~/.local/bin ``` `pipx` 二进制文件的默认位置是 `~/.local/bin`。你可以使用 `PIPX_BIN_DIR` 环境变量覆盖它。如果要覆盖 `PIPX_BIN_DIR`,只需运行 `userpath append $PIPX_BIN_DIR`,确保它在你的路径中。 Pipx 的默认虚拟环境位置是 `~/.local/pipx`。这可以用环境变量 `PIPX_HOME` 覆盖。 让我们继续看看如何使用 Pipx 安装 Python 应用。 ### 使用 Pipx 在隔离环境中安装和运行 Python 应用 以下是 Pipx 入门的几个例子 #### 安装 Python 包 要全局安装 Python 应用,例如 cowsay,请运行: ``` $ pipx install cowsay ``` 此命令将自动创建虚拟环境,在其中安装包并包的可执行文件放在 `$PATH` 中。 示例输出: ``` installed package cowsay 2.0.3, Python 3.6.8 These binaries are now globally available - cowsay done! ✨ ? ✨ ``` ![1](/data/attachment/album/201907/15/151715t7cummd3mm027mds.png) *使用 Pipx 安装 Python 应用* 让我们测试新安装的 cowsay 程序: ![1](/data/attachment/album/201907/15/151716rffq9ddzzurdqb7r.png) 在这里,我从官方网站上摘取了这些例子。你可以安装/测试任何其他的 Python 包。 #### 列出 Python 包 要使用 Pipx 列出所有已安装的应用,请运行: ``` $ pipx list ``` 示例输出: ``` venvs are in /home/sk/.local/pipx/venvs binaries are exposed on your $PATH at /home/sk/.local/bin package cowsay 2.0.3, Python 3.6.8 - cowsay ``` 如果你尚未安装任何软件包,你将看到以下输出: ``` nothing has been installed with pipx ? ``` #### 升级包 要升级包,只需执行以下操作: ``` $ pipx upgrade cowsay ``` 要一次性升级所有已安装的软件包,请使用: ``` $ pipx upgrade-all ``` #### 从临时虚拟环境运行应用 有时,你可能希望运行特定的 Python 程序,但并不实际安装它。 ``` $ pipx run pycowsay moooo ``` ![1](/data/attachment/album/201907/15/151717fwdpts19uxkozxur.png) *在临时隔离虚拟环境中运行 Python 应用* 此命令实际上并不安装指定程序,而是从临时虚拟环境运行它。你可以使用此命令快速测试 Python 应用。 你甚至可以直接运行 .py 文件。 ``` $ pipx run https://gist.githubusercontent.com/cs01/fa721a17a326e551ede048c5088f9e0f/raw/6bdfbb6e9c1132b1c38fdd2f195d4a24c540c324/pipx-demo.py pipx is working! ``` #### 卸载软件包 可以使用以下命令卸载软件包: ``` $ pipx uninstall cowsay ``` 要删除所有已安装的包: ``` $ pipx uninstall-all ``` #### 获得帮助 要查看帮助部分,请运行: ``` $ pipx --help ``` 就是这些了。如果你一直在寻找安全,方便和可靠的程序来安装和运行 Python 应用,Pipx 可能是一个不错的选择。 资源: * [Pipx 的 GitHub 仓库](https://github.com/pipxproject/pipx) --- via: <https://www.ostechnix.com/pipx-install-and-run-python-applications-in-isolated-environments/> 作者:[sk](https://www.ostechnix.com/author/sk/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
403
Forbidden
null
11,105
使用 Ansible 管理你的工作站:配置桌面设置
https://opensource.com/article/18/5/manage-your-workstation-ansible-part-3
2019-07-16T11:45:46
[ "Ansible", "工作站" ]
https://linux.cn/article-11105-1.html
> > 在本系列第三篇(也是最后一篇)文章中,我们将使用 Ansible 自动化配置 GNOME 桌面设置。 > > > ![](/data/attachment/album/201907/16/114537wwtc7n6pempwr56c.jpg) 在本系列关于使用 Ansible 配置工作站的[第一篇文章](/article-10434-1.html)中,我们设置了一个仓库并配置了一些基本的东西。在[第二篇文章](/article-10449-1.html)中,我们配置了 Ansible 以使其在对仓库进行更改时自动应用设置。在第三篇(也是最后一篇)文章中,我们将使用 Ansible 配置 GNOME 桌面设置。 此配置只适用于较新的发行版(例如我将在示例中使用的 Ubuntu 18.04)。较旧版本的 Ubuntu 将无法运行,因为它们附带了一个老版本的 `python-psutils`,对于 Ansible 的 `dconf` 模块无法正常工作。如果你使用的是较新版本的 Linux 发行版,则应该没有问题。 在开始之前,确保你已经完成了本系列的第一部分和第二部分,因为第三部分建立在此基础之上的。如果还没有,下载前两篇文章中一直使用的 GitHub [仓库](https://github.com/jlacroix82/ansible_article.git),我们将为其添加更多功能。 ### 设置壁纸和锁屏 首先,我们将创建一个任务手册来保存我们的 GNOME 设置。在仓库的根目录中,应该有一个名为 `local.yml` 的文件,添加以下行: ``` - include: tasks/gnome.yml ``` 整个文件应如下所示: ``` - hosts: localhost become: true pre_tasks: - name: update repositories apt: update_cache=yes changed_when: False tasks: - include: tasks/users.yml - include: tasks/cron.yml - include: tasks/packages.yml - include: tasks/gnome.yml ``` 基本上,这添加了对名为 `gnome.yml` 文件的引用,它将存储在仓库内的 `tasks` 目录中。我们还没有创建这个文件,现在就来创建它。在 `tasks` 目录中创建 `gnome.yml` 文件,并将以下内容放入: ``` - name: Install python-psutil package apt: name=python-psutil - name: Copy wallpaper file copy: src=files/wallpaper.jpg dest=/home/jay/.wallpaper.jpg owner=jay group=jay mode=600 - name: Set GNOME Wallpaper become_user: jay dconf: key="/org/gnome/desktop/background/picture-uri" value="'file:///home/jay/.wallpaper.jpg'" ``` 注意,此代码多次引用我的用户名(`jay`),因此确保使用你机器上的用户名替换每次出现的 `jay`。另外,如果你没有像我一样使用 Ubuntu 18.04,你将必须更改 `apt` 一行来匹配你所选择的发行版的包管理器,并确认 `python-psutil` 包的名称,因为它可能有所不同。 在示例任务中,我引用了 `file` 目录下的 `wallpaper.jpg` 文件,此文件必须存在,否则 Ansible 配置将失败。在 `tasks` 目录中,创建一个名为 `files` 的子目录。找到你喜欢的壁纸图片,将其命名为 `wallpaper.jpg`,然后把它放在 `files` 目录中。如果文件是 PNG 图像而不是 JPG,在代码和仓库中更改文件扩展名。如果你觉得没有创意,我在 [GitHub 仓库](https://github.com/jlacroix82/ansible_article.git) 中有一个示例壁纸文件,你可以使用它。 完成所有这些更改后,将内容提交到 GitHub 仓库,并推送这些更改。总结一下,你应该完成以下工作: * 修改 `local.yml` 文件以引用 `tasks/gnome.yml` * 使用上面提到的内容创建 `tasks/gnome.yml` * 在 `tasks` 目录中创建一个 `files` 目录,其中有一个名为 `wallpaper.jpg` 的图像文件(或者你选择的任何名称)。 完成这些步骤并将更改推送到仓库后,配置应该在下次计划运行期间自动应用。(你可能还记得我们在上一篇文章中对此进行了自动化。)如果你想节省时间,可以使用以下命令立即应用配置: ``` sudo ansible-pull -U https://github.com/<github_user>/ansible.git ``` 如果一切正常,你应该可以看到你的新壁纸。 让我们花一点时间来了解新的 GNOME 任务手册的功能。首先,我们添加了一个计划来安装 `python-psutil` 包。如果不添加它,我们就不能使用 `dconf` 模块,因为它需要在修改 GNOME 设置之前安装这个包。接下来,我们使用 `copy` 模块将壁纸文件复制到我们的 `home` 目录,并将生成的文件命名为以点开头的隐藏文件。如果你不希望此文件放在 `home` 目录的根目录中,你可以随时指示此部分将其复制到其它位置 —— 只要你在正确的位置引用它,它仍然可以工作。在下一个计划中,我们使用 `dconf` 模块来更改 GNOME 设置。在这种情况下,我们调整了 `/org/gnome/desktop/background/picture-uri` 键并将其设置为 `file:///home/jay/.wallpaper.jpg`。注意本节中的引号 —— 你必须在 `dconf` 值中使用两个单引号,如果值是一个字符串,还必须包含在双引号内。 现在,让我们进一步进行配置,并将背景应用于锁屏。这是现在的 GNOME 任务手册,但增加了两个额外的计划: ``` - name: Install python-psutil package apt: name=python-psutil - name: Copy wallpaper file copy: src=files/wallpaper.jpg dest=/home/jay/.wallpaper.jpg owner=jay group=jay mode=600 - name: Set GNOME wallpaper dconf: key="/org/gnome/desktop/background/picture-uri" value="'file:///home/jay/.wallpaper.jpg'" - name: Copy lockscreenfile copy: src=files/lockscreen.jpg dest=/home/jay/.lockscreen.jpg owner=jay group=jay mode=600 - name: Set lock screen background become_user: jay dconf: key="/org/gnome/desktop/screensaver/picture-uri" value="'file:///home/jay/.lockscreen.jpg'" ``` 正如你所看到的,我们做的事情和设置壁纸时差不多。我们添加了两个额外的任务,一个是复制锁屏图像并将其放在我们的 `home` 目录中,另一个是将设置应用于 GNOME 以便使用它。同样,确保将 `jay` 更改为你的用户名,并命名你想要的锁屏图片 `lockscreen.jpg`,并将其复制到 `files` 目录。将这些更改提交到仓库后,在下一次计划的 Ansible 运行期间就会应用新的锁屏。 ### 应用新的桌面主题 设置壁纸和锁屏背景很酷,但是让我们更进一步来应用桌面主题。首先,让我们在我们的任务手册中添加一条指令来安装 `arc` 主题的包。将以下代码添加到 GNOME 任务手册的开头: ``` - name: Install arc theme apt: name=arc-theme ``` 然后,在底部,添加以下动作: ``` - name: Set GTK theme become_user: jay dconf: key="/org/gnome/desktop/interface/gtk-theme" value="'Arc'" ``` 你看到 GNOME 的 GTK 主题在你眼前变化了吗?我们添加了一个动作来通过 `apt` 模块安装 `arc-theme` 包,另一个动作将这个主题应用到 GNOME。 ### 进行其它定制 既然你已经更改了一些 GNOME 设置,你可以随意添加其它定制。你在 GNOME 中调整的任何设置都可以通过这种方式自动完成,设置壁纸和主题只是几个例子。你可能想知道如何找到要更改的设置,以下是一个我用的技巧。 首先,通过在你管理的计算机上运行以下命令,获取所有当前 `dconf` 设置的快照: ``` dconf dump / > before.txt ``` 此命令将所有当前更改导出到名为 `before.txt` 的文件中。接下来,手动更改要自动化的设置,并再次获取 `dconf` 设置: ``` dconf dump / > after.txt ``` 现在,你可以使用 `diff` 命令查看两个文件之间的不同之处: ``` diff before.txt after.txt ``` 这应该会给你一个已更改键值的列表。虽然手动更改设置确实违背了自动化的目的,但你实际上正在做的是获取更新首选设置时更改的键,这允许你创建 Ansible 任务以修改这些设置,这样你就再也不需要碰这些设置了。如果你需要还原机器,Ansible 仓库会处理好你的每个定制。如果你有多台计算机,甚至是一组工作站,则只需手动进行一次更改,所有其他工作站都将应用新设置并完全同步。 ### 最后 如果你已经阅读完本系列文章,你应该知道如何设置 Ansible 来自动化工作站。这些示例提供了一个有用的基础,你可以使用这些语法和示例进行其他定制。随着你的进展,你可以继续添加新的修改,这将使你的 Ansible 配置一直增长。 我已经用 Ansible 以这种方式自动化了一切,包括我的用户帐户和密码、Vim、tmux 等配置文件、桌面包、SSH 设置、SSH 密钥,基本上我想要自定义的一切都使用了。以本系列文章作为起点,将为你实现工作站的完全自动化铺平道路。 --- via: <https://opensource.com/article/18/5/manage-your-workstation-ansible-part-3> 作者:[Jay LaCroix](https://opensource.com/users/jlacroix) 选题:[lujun9972](https://github.com/lujun9972) 译者:[MjSeven](https://github.com/MjSeven) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
In the [first article](https://opensource.com/article/18/3/manage-workstation-ansible) of this series on using Ansible to configure a workstation, we set up a repository and configured a few basic things. In the [second part](https://opensource.com/article/18/3/manage-your-workstation-configuration-ansible-part-2), we automated Ansible to apply settings automatically when changes are made to our repository. In this third (and final) article, we'll use Ansible to configure GNOME desktop settings. This configuration will work only on newer distributions (such as Ubuntu 18.04, which I'll use in my examples). Older versions of Ubuntu will not work, as they ship with a version of `python-psutils` that is too old for Ansible's `dconf` module to work properly. If you're using a newer version of your Linux distribution, you should have no issues. Before you begin, make sure you've worked through parts one and two of this series, as part three builds upon that groundwork. If you haven't already, download [the repository](https://gitlab.com/jsherman82/ansible_article.git) you've been using in those first two articles. We'll add a few more features to it. ## Set a wallpaper and lock screen First, we'll create a taskbook to hold our GNOME settings. In the root of the repository, you should have a file named `local.yml` . Add the following line to it: `- include: tasks/gnome.yml` The entire file should now look like this: ``` - hosts: localhost become: true pre_tasks: - name: update repositories apt: update_cache=yes changed_when: False tasks: - include: tasks/users.yml - include: tasks/cron.yml - include: tasks/packages.yml - include: tasks/gnome.yml ``` Basically, this added a reference to a file named `gnome.yml` that will be stored in the `tasks` directory inside the repository. We haven't created this file yet, so let's do that now. Create `gnome.yml` file in the `tasks` directory, and place the following content inside: ``` - name: Install python-psutil package apt: name=python-psutil - name: Copy wallpaper file copy: src=files/wallpaper.jpg dest=/home/jay/.wallpaper.jpg owner=jay group=jay mode=600 - name: Set GNOME Wallpaper become_user: jay dconf: key="/org/gnome/desktop/background/picture-uri" value="'file:///home/jay/.wallpaper.jpg'" ``` Note that this code refers to my username (`jay` ) several times, so make sure to replace every occurrence of `jay` with the username you use on your machine. Also, if you're not using Ubuntu 18.04 (as I am), you'll have to change the `apt` line to match the package manager for your chosen distribution and to confirm the name of the `python-psutil` package for your distribution, as it may be different. In the example tasks, I referred to a file named `wallpaper.jpg` inside the `files` directory. This file must exist or the Ansible configuration will fail. Inside the `tasks` directory, create a subdirectory named `files` . Find a wallpaper image you like, name it `wallpaper.jpg` , and place it inside the `files` directory. If the file is a PNG image instead of a JPG, change the file extension in both the code and in the repository. If you're not feeling creative, I have an example wallpaper file in the [repository](https://git.iostreamcomputing.net/jay/ansible_article.git) for this article series that you can use. Once you've made all these changes, commit everything to your repository, and push those changes. To recap, you should've completed the following: - Modified the `local.yml` file to refer to the`tasks/gnome.yml` playbook - Created the `tasks/gnome.yml` playbook with the content mentioned above - Created a `files` directory inside the`tasks` directory, with an image file named`wallpaper.jpg` (or whatever you chose to call it). Once you've completed those steps and pushed your changes back to the repository, the configuration should be automatically applied during its next scheduled run. (You may recall that we automated this in the previous article.) If you're in a hurry, you can apply the configuration immediately with the following command: `sudo ansible-pull -U https://github.com/<github_user>/ansible.git` If everything ran correctly, you should see your new wallpaper. Let's take a moment to go through what the new GNOME taskbook does. First, we added a play to install the `python-psutil` package. If we don't add this, we can't use the `dconf` module, since it requires this package to be installed before we can modify GNOME settings. Next, we used the `copy` module to copy the wallpaper file to our `home` directory, and we named the resulting file starting with a period to hide it. If you'd prefer not to have this file in the root of your `home` directory, you can always instruct this section to copy it somewhere else—it will still work as long as you refer to it at the correct place. In the next play, we used the `dconf` module to change GNOME settings. In this case, we adjusted the `/org/gnome/desktop/background/picture-uri` key and set it equal to `file:///home/jay/.wallpaper.jpg` . Note the quotes in this section of the playbook—you must always use two single-quotes in `dconf` values, and you must also include double-quotes if the value is a string. Now, let's take our configuration a step further and apply a background to the lock screen. Here's the GNOME taskbook again, but with two additional plays added: ``` - name: Install python-psutil package apt: name=python-psutil - name: Copy wallpaper file copy: src=files/wallpaper.jpg dest=/home/jay/.wallpaper.jpg owner=jay group=jay mode=600 - name: Set GNOME wallpaper dconf: key="/org/gnome/desktop/background/picture-uri" value="'file:///home/jay/.wallpaper.jpg'" - name: Copy lockscreenfile copy: src=files/lockscreen.jpg dest=/home/jay/.lockscreen.jpg owner=jay group=jay mode=600 - name: Set lock screen background become_user: jay dconf: key="/org/gnome/desktop/screensaver/picture-uri" value="'file:///home/jay/.lockscreen.jpg'" ``` As you can see, we're pretty much doing the same thing as we did with the wallpaper. We added two additional tasks, one to copy the lock screen image and place it in our `home` directory, and another to apply the setting to GNOME so it will be used. Again, be sure to change your username from `jay` and also name your desired lock screen picture `lockscreen.jpg` and copy it to the `files` directory. Once you've committed these changes to your repository, the new lock screen should be applied during the next scheduled Ansible run. ## Apply a new desktop theme Setting the wallpaper and lock screen background is cool and all, but let's go even further and apply a desktop theme. First, let's add an instruction to our taskbook to install the package for the `arc` theme. Add the following code to the beginning of the GNOME taskbook: ``` - name: Install arc theme apt: name=arc-theme ``` Then, at the bottom, add the following play: ``` - name: Set GTK theme become_user: jay dconf: key="/org/gnome/desktop/interface/gtk-theme" value="'Arc'" ``` Did you see GNOME's GTK theme change right before your eyes? We added a play to install the `arc-theme` package via the `apt` module and another play to apply this theme to GNOME. ## Make other customizations Now that you've changed some GNOME settings, feel free to add additional customizations on your own. Any setting you can tweak in GNOME can be automated this way; setting the wallpapers and the theme were just a few examples. You may be wondering how to find the settings that you want to change. Here's a trick that works for me. First, take a snapshot of ALL your current `dconf` settings by running the following command on the machine you're managing: `dconf dump / > before.txt` This command exports all your current changes to a file named `before.txt` . Next, manually change the setting you want to automate, and capture the `dconf` settings again: `dconf dump / > after.txt` Now, you can use the `diff` command to see what's different between the two files: `diff before.txt after.txt` This should give you a list of keys that changed. While it's true that changing settings manually defeats the purpose of automation, what you're essentially doing is capturing the keys that change when you update your preferred settings, which then allows you to create Ansible plays to modify those settings so you'll never need to touch those settings again. If you ever need to restore your machine, your Ansible repository will take care of each and every one of your customizations. If you have multiple machines, or even a fleet of workstations, you only have to manually make the change once, and all other workstations will have the new settings applied and be completely in sync. ## Wrapping up If you've followed along with this series, you should know how to set up Ansible to automate your workstation. These examples offer a useful baseline, and you can use the syntax and examples to make additional customizations. As you go along, you can continue to add new modifications, which will make your Ansible configuration grow over time. I've used Ansible in this way to automate everything, including my user account and password; configuration files for Vim, tmux, etc.; desktop packages; SSH settings; SSH keys; and basically everything I could ever want to customize. Using this series as a starting point will pave the way for you to completely automate your workstations. ## 3 Comments
11,106
创新的幻觉
https://opensource.com/open-organization/19/6/innovation-delusion
2019-07-16T12:03:11
[ "创新" ]
https://linux.cn/article-11106-1.html
> > 创新是一种混乱的过程,但是关于创新的故事却很有条理。我们不应该把两者搞混了。 > > > ![](/data/attachment/album/201907/16/120302zlyzlzl2d2vh1eyd.jpg) 如果说 [传统的规划方法已经消亡了](https://www.youtube.com/watch?v=8MCbJmZQM9c),为什么这么多机构还在孜孜不倦地运用那些针对工业革命所设计的规划方法呢? 其中的一个原因是,我们错误地认为创新是可以通过结构化的、线性的过程实现的。我觉得这样做是在混淆关于创新的 **故事** 和创新这个 **过程** 本身 —— 两者是截然不同的东西。 创新的过程是混乱和不可预测的,并不遵循井然有序的时间线。过程中充满了重复迭代、突然的改变方向、各式各样的启动和终止、死胡同、失败(但愿是有用的失败),以及很多不可知的变量。创新是混乱的。 但是关于创新的故事却让事情显得很简单,从讲述伟大发明的书籍和文章,到我们(简化了整个过程之后)讲述自己在工作上的成功都是这样。想想你在社交媒体上读的帖子里,有多少都只写了最好的、最愉快的部分吧。 好故事就是这样。我们把一些原本分散的时间点干净利落地整理到一起,有开头、有发展、也有结尾。尽管我们一路上经历了很多没有把握、恐慌、甚至是绝望的时刻,在故事里这些坎坷却都被抹平了,让事情看起来像是从一开始就注定是成功的。 我们不应该把混乱的过程和简化了的故事搞混。否则,我们会错误地认为可以使用在简单线性过程中所使用的同样的方法迎接创新的挑战。换句话说,我们将适用于一种类型的活动(比较偏死记硬背、机械和规则性的任务)的管理技术应用在了并不适用的另一种类型的活动(更加有创造性的、非线性的工作,需要自主性和试验)上。 ### 一个创新的故事 下面这个故事可以很好地说明这一点。这是我 [最喜欢举的例子](https://www.youtube.com/watch?v=8MCbJmZQM9c) 之一。 在 1970 年代,英国的摩托车行业怎么也想不明白为什么他们在美国的市场份额急剧下降,而本田公司的市场份额却急速攀升。他们雇佣了波士顿咨询公司(刚好是我之前的雇主)帮助他们找出问题所在。波士顿咨询搜集了一些历史数据,回看了二十年的历史事件,总结出了一个井井有条的、线性的故事,可以很好地解释本田公司的成功。 [波士顿咨询的结论是](https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/235319/0532.pdf),本田公司使用了一个巧妙的策略:通过一种可以以更低价格销售的偏小型摩托车进入美国市场,并且借助于他们在日本本土市场发展出来的规模经济,在美国市场使用低价策略发展市场份额,然后等到需求进一步增长的时候,再利用更大的规模经济发展他们在美国的市场份额。在所有人的眼中,本田公司都表现得非常出色,不仅发挥了自己的优势,还非常透彻和精准地理解了新的目标顾客:美国消费者。他们智胜一筹,通过一个执行得很好的计划占领了先机,胜过了竞争对手们。 这个故事 **听上去** 很厉害,但是实际情况没有这么简单。 没错,本田公司 **确实** 是想进入美国摩托车市场。他们最初是想 [效仿在美国的竞争对手](http://www.howardyu.org/the-revolutionary-approach-honda-took-to-rise-above-competition/),也制造美国人似乎更喜欢的大型摩托车。但是大型摩托车并不是本田公司的强项,他们生产的大型摩托车存在可靠性上的问题。更糟的是,他们的产品和市面上的其它产品没有什么差别,所以并不能脱颖而出。简单来说,他们的产品销售额表现平平。 但是在一次奇妙的巧合里,本田公司出访美国的日本代表们带了几辆自己开的摩托车。这些摩托车和本田公司试图在美国市场上销售的摩托车完全不同,它们更为小巧灵活、不那么笨重、更有效率,并且一般来说也更便宜。西尔斯公司(LCTT 译注:美国零售业巨头)注意到了这些小巧的摩托车,并且和日本代表达成了一项协议,让西尔斯公司可以在他们在美国的商店里出售这种被称为“超级幼兽”的新型摩托车。 剩下的故事已经载入史册。超级幼兽成为了 [史上最畅销的机动车](https://autoweek.com/article/motorcycles/first-ride-honda-super-cub-c125-abs-all-new-and-still-super-cute),并且本田公司 [至今仍然在生产超级幼兽](https://www.autoblog.com/2019/02/13/2019-honda-super-cub-first-ride-review/)。 事后看来,将超级幼兽带到美国的一连串事件似乎很有逻辑,近乎无聊了。但是本田公司的成功和“巧妙的计划”没有什么关系,而更应该归功于一些(大多数人不愿意承认的)机缘巧合。 ### 开放(并且混乱的)创新 机构(特别是领导们)喜欢把成功说成是一件计划之内的事情 —— 好像成功人士可以驾驭混乱,并且几乎可以预测未来。但是这些言论都是事后诸葛亮罢了,他们在讲述自己充满偶然性的经历的时候会刻意将无序的事情整理一番,对于毫无确定性的事情也会说“我们就是想要那么做的”。 但是正如我前面说的,我们不应该相信这些故事是创新过程的真实还原,也不应该在这种错误的假设的基础之上去构建未来的方案或者实验。 试想有另一家摩托车制造商想要复制本田公司在超级幼兽上的成功,就逐字逐句地照搬波士顿咨询总结的故事。由于本田公司成功的 **故事** 听上去是如此有逻辑,并且是线性的,这家新公司也许会假定他们可以通过类似的程序得到同样的结果:制定目标、谋划行动,然后针对可预期的结果进行执行。但是我们知道本田公司并不是真的靠这种“制定、谋划、执行”的方式赢得他们的市场份额的。他们是通过灵活性和一点运气获得成功的 —— 更像是“尝试、学习、修改”。 当我们可以真正理解并且接受“创新过程是混乱的”这个事实的时候,我们就可以换种方式思考如何让我们的机构实现创新了。与其将资源浪费在预先制定的计划上,**强迫** 创新以一种线性时间线的方式发生,我们不如去构建一些开放并且敏捷的机构,可以 **在创新发生的时候做出及时的响应**。 几年前红帽公司发布一个包含了重大技术升级的产品的新版本的时候,我就看到了这样的方法。[红帽企业级 Linux 5.4 版本](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/5/html/5.4_release_notes/index) 首次完全支持了一种被称为基于内核的虚拟机(KVM)的技术。这对于我们来说是一个重大的创新,不仅可以为顾客和合作伙伴带来巨大的价值,也有望为开源社区带来巨大的价值。 这项技术正在快速演进。幸运的事,因为我们是一个开放的机构,我们具有足够的适应能力,可以在这项创新发生的时候做出响应,从而帮助我们的顾客和合作伙伴可以更好地利用它。这项技术太重要了,并且竞争格局也太不稳定了,以至于我们没有理由要等到像 6.0 版本这样的里程碑时刻才出手。 如果你回看红帽企业级 Linux [已经存档的发行说明](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/5/html/5.0_release_notes/index),你会发现它读起来并不像一个典型的软件创新的故事。一次改变游戏规则的进展突然出现在一个没有预测到的、并不起眼的时刻(5.4 版本),而不是一个事先计划好的重要里程碑时刻(6.0 版本)。事后看来,我们现在知道 KVM 这种“大爆炸”级别的进步是足够担得起 “6.0 版本”这样的里程碑式的名字的。但是创新并不是按照这样的剧本发生的。 不要误解我,机构仍然需要保持出色的运转,高效完成执行性的任务。但是 [不同的挑战需要不同的方法去应对](https://opensource.com/open-organization/19/4/managed-enabled-empowered),我们需要能够更好地建立灵活的机构,以及对 [意想不到和不可知的事情](https://www.linkedin.com/pulse/how-plan-world-full-unknowns-jim-whitehurst/) 能够做出更好的响应。 一个在计划工作(以及按照计划执行)上做得很出色的公司很可能会得到他们计划要得到的结果。但是如果成功还取决于我们没有预测或者无法预测的的事情,那么仅仅精准地按照计划执行是不是就不够了? --- via: <https://opensource.com/open-organization/19/6/innovation-delusion> 作者:[Jim Whitehurst](https://opensource.com/users/jwhitehurst/users/jwhitehurst/users/n8chz/users/dhdeans) 选题:[lujun9972](https://github.com/lujun9972) 译者:[chen-ni](https://github.com/chen-ni) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
If [traditional planning is dead](https://www.youtube.com/watch?v=8MCbJmZQM9c), then why do so many organizations still invest in planning techniques optimized for the Industrial Revolution? One reason might be that we trick ourselves into thinking innovation is the kind of thing we can accomplish with a structured, linear process. When we do this, I think we're confusing our *stories* about innovation with the *process* of innovation itself—and the two are very different. The *process* of innovation is chaotic and unpredictable. It doesn't operate according to clean, regimented timelines. It's filled with iterative phases, sudden changes in direction, various starts and stops, dead ends, (hopefully productive) failures, and unknowable variables. It's messy. But the stories we tell ourselves about innovation, including the books and articles we read about great inventions and the tales we tell each other about our successes in the workplace, tidy that process up. Think about how many social media posts you've seen that feature nothing but the "high points." That's the nature of good storytelling. It takes a naturally scattered collection of moments and puts them neatly into a beginning, middle, and end. It smoothes out all the rough patches and makes a result seem inevitable from the start, despite whatever moments of uncertainty, panic, even despair we experienced along the way. We shouldn't confuse messy process with simplified story. When we do, we might mistakenly assume we can approach innovation challenges with the same practices we bring to neat and linear processes. In other words, we apply a set of management techniques appropriate for one set of activities (for more rote, mechanical, and prescriptive tasks) to a set of activities they aren't really suited for (more creative, non-linear work requiring autonomy and experimentation). ## An innovation story Here's [one of my favorite examples](https://www.youtube.com/watch?v=8MCbJmZQM9c) of how this idea in action. In the 1970s, the British motorcycle industry was desperately trying to figure out why its U.S. market share was plummeting while Honda's was skyrocketing. The company hired my former employer, the Boston Consulting Group, to help them figure out what was going wrong. BCG gathered some historical data, reviewed a two-decade sequence of events, and developed a neat, linear story explaining Honda's success. Honda, [BCG concluded](https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/235319/0532.pdf), had executed an ingenious strategy: enter the U.S market with smaller motorcycles it could sell at lower cost, use the economies of scale it had developed in the Japense market to set low prices and grow a market, then further leverage those economies of scale to grow their share in the States as demand grew. By all accounts, Honda had done it brilliantly, playing to its strengths while thoroughly and accurately assessing the new, target U.S. consumer. It had outsmarted, outflanked, and outperformed competitors with a well-executed plan. It *sounded* great. But the reality was much less straightforward. Yes, Honda *did* want to enter the U.S. motorcycle market. It initially attempted to [copy its competitors there](http://www.howardyu.org/the-revolutionary-approach-honda-took-to-rise-above-competition/), building the larger bikes Americans seemed to favor. But bikes like that weren't one of Honda's strengths, and their versions had reliability issues. To make matters worse, their models didn't look much different than other offerings already in the market, so they weren't standing out. Suffice it to say, sales were not booming. But in a happy coincidence, Honda's Japanese representatives visiting the States had brought their own motorcycles with them. Those bikes were different than the ones the company was attempting to sell to the American market. They were smaller, zippier, less bulky, more efficient, and generally less expensive. Sears took notice, contacted the reps, and the companies struck a deal that let Sears carry this new motorcycle—called the "Super Cub"—in its American stores. And the rest, as they say, is history. The Super Cub would go on to become the [best-selling motorized vehicle of all time](https://autoweek.com/article/motorcycles/first-ride-honda-super-cub-c125-abs-all-new-and-still-super-cute), and Honda [continues to produce it today](https://www.autoblog.com/2019/02/13/2019-honda-super-cub-first-ride-review/). In hindsight, the events that brought the Super Cub to the U.S. seem logical, almost boring. But Honda owed its success less to an ingenious master plan and much more to serendipity and happenstance than most people care to admit. ## Open (and messy) innovation Organizations (and especially leaders) like to think that success is always planned—that they've become masters of chaos and can almost predict the future. But they're often making those assessments with the benefit of hindsight, telling the stories of their haphazard journey in a way that organizes the chaos, essentially reflecting on a period of uncertainty and saying "we meant to do that." But as I said, we shouldn't assume those stories are mirror reflections of the innovation process itself and build future initiatives or experiments on that mistaken assumption. Imagine another motorcycle manufacturer looking to replicate Honda's success with the Super Cub by following BCG's narrative to the letter. Because the *story* of Honda's success seems so logical and linear, the new company might assume it could use similar processes and get the same results: plan objectives, prescribe behaviors, and execute against knowable outcomes. But we know that Honda didn't really win its market with that kind of "plan, prescribe, execute" mentality. It won through flexibility and a bit of blind luck—something more like "[try, learn, modify](https://opensource.com/open-organization/18/3/try-learn-modify)." When we're able to appreciate and accept that the innovation process is messy, we allow ourselves to think differently about approaching innovation in our organizations. We can begin building the kinds of open and agile organizations capable of *responding to innovation as it happens* instead of over-investing resources into pre-formed plans that try to *force* innovation into a linear timeline. I saw this kind of approach several years ago, when Red Hat released a new version of a product that included a major technology update. [Version 5.4 of Red Hat Enterprise Linux](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/5/html/5.4_release_notes/index) was the first to include full support for a technology called the Kernel-based Virtual Machine (or "KVM"). For us it was a significant innovation that promised to deliver immense value not only to customers and partners, but also to open source software communities. The technology was evolving quickly. Luckily, because we're an open organization, we were adaptable enough to respond to that innovation as it was happening and help our customers and partners take advantage of it. It was too important, and the competitive landscape too volatile, to justify withholding just so we could "save" it for a milestone moment like version 6.0. When you go back and review [the archived release notes](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/5/html/5.0_release_notes/index) for Red Hat Enterprise Linux, you'll see that it doesn't "read" like a typical software innovation tale. A game-changing development pops up at an unpredicted and unremarkable moment (version 5.4), rather than a pre-planned blockbuster milestone (version 6.0). In hindsight, we now know that KVM *was* the kind of "big bang" advancement that could have warranted a milestone release name like "6.0." But that's just not how the innovation process unfolded. Don't get me wrong, organizations still need to maintain operational excellence and perform execution-oriented tasks well. But [different kinds of challenges require different kinds of approaches](https://opensource.com/open-organization/19/4/managed-enabled-empowered), and we need to get better at building flexible organizations just as capable of [responding to the unforeseen or unknowable](https://www.linkedin.com/pulse/how-plan-world-full-unknowns-jim-whitehurst/). An organization great at planning (and executing against that plan) will quite likely get the results it planned for. But when success depends on things we *don't* or *can't* predict, is getting exactly what you've planned for good enough? ## 3 Comments
11,108
使用 Python 和 Scribus 创建一个 RGB 立方体
https://opensource.com/article/19/7/rgb-cube-python-scribus
2019-07-16T12:48:14
[ "Python", "颜色" ]
/article-11108-1.html
> > 使用 Scribus 的 Python 脚本编写器功能,开发一个显示 RGB 色谱的 3D 立方体。 > > > ![cubes coming together to create a larger cube](/data/attachment/album/201907/16/124822hhxpzvbpzqdi3s3i.png "cubes coming together to create a larger cube") 当我决定这个夏天要玩色彩游戏时,我想到通常色彩都是在色轮上描绘的。这些色彩通常都是使用色素而不是光,并且你失去了任何对颜色亮度或光度变化的感觉。 作为色轮的替代,我想在立方体表面使用一系列图形来显示 RGB 频谱。色彩的 RGB 值将在具有 X、Y、Z 轴的三维图形上展示。例如,一个平面将会保持 B(蓝色)为 0,其余的坐标轴将显示当我将 R(红色)和 G (绿色)的值从 0 绘制到 255 时发生的情况。 事实证明,使用 [Scribus](https://www.scribus.net/) 及其 [Python 脚本编写器](https://opensource.com/sites/default/files/ebooks/pythonscriptingwithscribus.pdf) 功能实现这一点并不困难。我可以创建 RGB 颜色,使矩形显示颜色,并以 2D 格式排列它们。我决定设置颜色值的间隔为 5,并让矩形按 5 个点(pt)进行绘图。因此,对于每个 2D 图形,我将使用大约 250 种颜色,立方体的一个边有 250 个点(pt),也就是 3.5 英寸。 我使用下面这段 Python 代码完成了绿 - 红图的任务: ``` x = 300 y = 300 r = 0 g = 0 b = 0 if scribus.newDoc(scribus.PAPER_LETTER, (0,0,0,0),scribus.PORTRAIT, 1, scribus.UNIT_POINTS, scribus.NOFACINGPAGES, scribus.FIRSTPAGERIGHT): while r < 256: while g < 256: newcolor = str(r) + '_' + str(g) + '_' + str(b) if newcolor == '0_0_0': newcolor = 'Black' scribus.defineColorRGB(newcolor,r, g, b) rect = scribus.createRect(x + g, y, 5, 5) scribus.setFillColor(newcolor, rect) scribus.setLineColor(newcolor, rect) g = g + 5 g = 0 r = r + 5 y = y – 5 ``` 这个脚本在 `300,300` 位置开始绘制图形,这个位置大约是一个美国信件大小的纸张的水平中心,大概是垂直方向从顶部到底的三分之一位置;这是图像的原点,然后它沿着 X 轴(绿色值)水平构建图形,然后返回到 Y 轴,向上移动 5 个点,然后绘制下一条矩形线。 ![Red-Green graph](/data/attachment/album/201907/16/124822nov1uveupp64aoe8.png "Red-Green graph") 这看起来很简单;我只需要调整一下数字就可以把立方体的另一面画出来。但这不仅仅是再画两个图,一个是蓝 - 绿色,另一个是红 - 蓝色的问题。我想创建一个展开的立方体,这样我就可以打印、剪开然后折叠它,创建一个 RGB 的 3D 视图。因此,下一部分(向下的页面)的原点(黑色的角落)需要在左上角,其水平方向是绿色,垂直方向是蓝色。 “调整数字”最终或多或少变成了试错,从而得到我想要的东西。在创建了第二个图之后,我需要第三个图,它是红 - 蓝色的,原点位于左上角,红色向左递增,蓝色向下递增。 下面是最终效果图: ![First half of RGB cube](/data/attachment/album/201907/16/124824intjl4snms7j7mtg.png "First half of RGB cube") 当然,这只是这个立方体的前半部分。我需要做一个类似的形状,除了原点应该是白色(而不是黑色)来表示高值。这是我希望自己更聪明的时候之一,因为我不仅需要做出一个类似的整体形状,还需要以镜像的方式与第一个形状交互(我认为)。有时候,尝试和错误是你唯一的朋友。 结果是这样的;我使用了一个单独的脚本,因为在一个美国信件大小的页面上没有足够的空间同时容纳这两个图案。 ![Second half of RGB cube](/data/attachment/album/201907/16/124826f6166q7r7rc1kw6c.png "Second half of RGB cube") 现在,是时候轮到打印机了!在这里,你可以直观了解彩色打印机如何处理 RGB 颜色到 CMYK 颜色的转换以及打印颜色密集空间。 接下来,朋友们,是剪切粘贴时间!我可以用胶带,但我不想改变表面的外观,所以我在切割的时候在两边留下了一些空间,这样我就可以把它们粘在里面了。根据我的经验,在复印纸上打印会产生一些不需要的皱纹,所以在我的复印纸原型完成后,我把立方体打印在了更厚的纸上,表面是哑光的。 ![RGB cubes](/data/attachment/album/201907/16/124838vtk0md3fuupkmt14.png "RGB cubes") 请记住,这只是 RGB 空间边界的一个视图;更准确地说,你必须做出一个可以在中间切片的实心立方体。例如,这是一个实心 RGB 立方体在蓝色 = 120 的切片。 ![RGB cube slice](/data/attachment/album/201907/16/124839pz0umeu2y58xozhe.png "RGB cube slice") 最后,我做这个项目很开心。如果您也想参与其中,这里有两个脚本。 这是前半部分: ``` #!/usr/bin/env python # black2rgb.py """ Creates one-half of RGB cube with Black at origin """ import scribus x = 300 y = 300 r = 0 g = 0 b = 0 if scribus.newDoc(scribus.PAPER_LETTER, (0,0,0,0),scribus.PORTRAIT, 1, scribus.UNIT_POINTS, scribus.NOFACINGPAGES, scribus.FIRSTPAGERIGHT): while r < 256: while g < 256: newcolor = str(r) + '_' + str(g) + '_' + str(b) if newcolor == '0_0_0': newcolor = 'Black' scribus.defineColorRGB(newcolor,r, g, b) rect = scribus.createRect(x + g, y, 5, 5) scribus.setFillColor(newcolor, rect) scribus.setLineColor(newcolor, rect) g = g + 5 g = 0 r = r + 5 y = y - 5 r = 0 g = 0 y = 305 while b < 256: while g < 256: newcolor = str(r) + '_' + str(g) + '_' + str(b) if newcolor == '0_0_0': newcolor = 'Black' scribus.defineColorRGB(newcolor,r, g, b) rect = scribus.createRect(x + g, y, 5, 5) scribus.setFillColor(newcolor, rect) scribus.setLineColor(newcolor, rect) g = g + 5 g = 0 b = b + 5 y = y + 5 r = 255 g = 0 y = 305 x = 39 b = 0 while b < 256: while r >= 0: newcolor = str(r) + '_' + str(g) + '_' + str(b) if newcolor == '0_0_0': newcolor = 'Black' scribus.defineColorRGB(newcolor,r, g, b) rect = scribus.createRect(x, y, 5, 5) scribus.setFillColor(newcolor, rect) scribus.setLineColor(newcolor, rect) r = r - 5 x = x+5 b = b + 5 x = 39.5 r = 255 y = y + 5 scribus.setRedraw(True) scribus.redrawAll() ``` 后半部分: ``` #!/usr/bin/env python # white2rgb.py """ Creates one-half of RGB cube with White at origin """ import scribus x = 300 y = 300 r = 255 g = 255 b = 255 if scribus.newDoc(scribus.PAPER_LETTER, (0,0,0,0),scribus.PORTRAIT, 1, scribus.UNIT_POINTS, scribus.NOFACINGPAGES, scribus.FIRSTPAGERIGHT): while g >= 0: while r >= 0: newcolor = str(r) + '_' + str(g) + '_' + str(b) if newcolor == '255_255_255': newcolor = 'White' scribus.defineColorRGB(newcolor,r, g, b) rect = scribus.createRect(x + 255 - r, y, 5, 5) scribus.setFillColor(newcolor, rect) scribus.setLineColor(newcolor, rect) r = r - 5 r = 255 g = g - 5 y = y - 5 r = 255 g = 255 y = 305 while b >= 0: while r >= 0: newcolor = str(r) + '_' + str(g) + '_' + str(b) if newcolor == '255_255_255': newcolor = 'White' scribus.defineColorRGB(newcolor,r, g, b) rect = scribus.createRect(x + 255 - r, y, 5, 5) scribus.setFillColor(newcolor, rect) scribus.setLineColor(newcolor, rect) r = r - 5 r = 255 b = b - 5 y = y + 5 r = 255 g = 0 y = 305 x = 39 b = 255 while b >= 0: while g < 256: newcolor = str(r) + '_' + str(g) + '_' + str(b) if newcolor == '255_255_255': newcolor = 'White' scribus.defineColorRGB(newcolor,r, g, b) rect = scribus.createRect(x + g, y, 5, 5) scribus.setFillColor(newcolor, rect) scribus.setLineColor(newcolor, rect) g = g + 5 g = 0 b = b - 5 y = y + 5 scribus.setRedraw(True) scribus.redrawAll() ``` 由于我创建了大量的颜色,所以当看到 Scribus 文件比我用它创建的 PDF 文件大得多的时候,我并不感到惊讶。例如,我的 Scribus SLA 文件是 3.0MB,而从中生成的 PDF 只有 70KB。 --- via: <https://opensource.com/article/19/7/rgb-cube-python-scribus> 作者:[Greg Pittman](https://opensource.com/users/greg-p/users/greg-p) 选题:[lujun9972](https://github.com/lujun9972) 译者:[zianglei](https://github.com/zianglei) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux 中国](https://linux.cn/) 荣誉推出
null
HTTPSConnectionPool(host='opensource.com', port=443): Read timed out. (read timeout=10)
null
11,110
好消息!Ubuntu LTS 用户不需要 PPA 也可以获得最新的 Nvidia 驱动更新
https://itsfoss.com/ubuntu-lts-latest-nvidia-drivers/
2019-07-17T00:18:35
[ "Ubuntu", "Nvidia" ]
https://linux.cn/article-11110-1.html
> > 要在 Ubuntu LTS 上获得的最新 Nvidia 驱动程序,你不必再使用 PPA 了。最新的驱动程序现在将在 Ubuntu LTS 版本的存储库中提供。 > > > ![](/data/attachment/album/201907/17/001838o2gn0xh23att3mto.png) 你可能已经注意到在 Ubuntu 上安装最新和最好的 Nvidia 二进制驱动程序更新的麻烦。 默认情况下,Ubuntu 提供开源的 [Nvidia Nouveau 驱动程序](https://nouveau.freedesktop.org/wiki/),这有时会导致 Ubuntu 卡在启动屏幕上。 你也可以轻松地[在 Ubuntu 中安装专有的 Nvidia 驱动程序](https://itsfoss.com/install-additional-drivers-ubuntu/)。问题是默认 [Ubuntu 存储库](https://itsfoss.com/ubuntu-repositories/)中的 Nvidia 驱动程序不是最新的。为此,几年前 [Ubuntu 引入了一个专门的 PPA](https://itsfoss.com/ubuntu-official-ppa-graphics/)以解决这个问题。 [使用官方 PPA](https://itsfoss.com/ppa-guide/) 仍然是安装闭源图形驱动程序的一个不错的解决方法。但是,它绝对不是最方便的选择。 但是,现在,Ubuntu 同意将最新的 Nvidia 驱动程序更新作为 SRU([StableReleaseUpdates](https://wiki.ubuntu.com/StableReleaseUpdates))的一部分提供。所以,你将在使用 Ubuntu LTS 版本时也拥有 Nvidia 驱动程序了。 好吧,这意味着你不再需要在 Ubuntu LTS 版本上单独下载/安装 Nvidia 图形驱动程序。 就像你会获得浏览器或核心操作系统更新(或安全更新)的更新包一样,你将获得所需的 Nvidia 二进制驱动程序的更新包。 ### 这个最新的 Nvidia 显卡驱动程序可靠吗? SRU 字面上指的是 Ubuntu(或基于 Ubuntu 的发行版)的稳定更新。因此,要获得最新的图形驱动程序,你应该等待它作为稳定更新释出,而不是选择预先发布的更新程序。 当然,没有人能保证它能在所有时间内都正常工作 —— 但安装起来比预先发布的更安全。 ### 怎样获得最新的 Nvidia 驱动程序? ![Software Updates Nvidia](/data/attachment/album/201907/17/001844u4r2owoo0dnojz9h.jpg) 你只需从软件更新选项中的其他驱动程序部分启用“使用 NVIDIA 驱动程序元数据包……”。 最初,[The Linux Experiment](https://twitter.com/thelinuxEXP) 通过视频分享了这个消息 —— 然后 Ubuntu 的官方 Twitter 作为公告重新推送了它。你可以观看下面的视频以获取更多详细信息: ### 支持哪些 Ubuntu LTS 版本? 目前,Ubuntu 18.04 LTS 已经可用了,它也将很快在 Ubuntu 16.04 LTS 上可用(随后的 LTS 也将次第跟上)。 ### 总结 现在你可以安装最新的 Nvidia 二进制驱动程序更新了,你认为这有何帮助? 如果你已经测试了预先发布的软件包,请在下面的评论中告诉我们你对此的看法。 --- via: <https://itsfoss.com/ubuntu-lts-latest-nvidia-drivers/> 作者:[Ankush Das](https://itsfoss.com/author/ankush/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[wxy](https://github.com/wxy) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
*Brief: To get the latest Nvidia drivers in Ubuntu LTS versions, you don’t have to use PPA anymore. The latest drivers will now be available in the repositories of the Ubuntu LTS versions.* ![Nvidia Ubuntu Logo](https://itsfoss.com/content/images/wordpress/2019/07/nvidia-ubuntu-logo-800x450.png) You might be aware of the troubles to install the latest and greatest Nvidia binary driver updates on Ubuntu. By default, Ubuntu provides the open source [Nvidia Nouveau drivers](https://nouveau.freedesktop.org/wiki/) that some time result in Ubuntu being stuck at boot screen. You can also [install the proprietary Nvidia driver in Ubuntu](https://itsfoss.com/install-additional-drivers-ubuntu/) easily. The problem is that the Nvidia drivers in the default [Ubuntu repositories](https://itsfoss.com/ubuntu-repositories/) are not the latest one. To solve this problem, [Ubuntu introduced a dedicated PPA](https://itsfoss.com/ubuntu-official-ppa-graphics/) a few years back. [Using the official PPA](https://itsfoss.com/ppa-guide/) is still a decent workaround for installing the closed source graphics driver. However, it is definitely not the most convenient option. But, now, Ubuntu agreed to include the latest Nvidia driver update as part of the SRU ([StableReleaseUpdates](https://wiki.ubuntu.com/StableReleaseUpdates)). So, you will have Nvidia drivers baked in with Ubuntu LTS versions. Well, this means that you no longer have to separately download/install the Nvidia graphics drivers on Ubuntu LTS versions. Just like you get an update for your browser or the core OS updates (or the security updates), similarly, you will get the required Nvidia binary driver update packages. ## Can We Rely on the Latest Nvidia Graphics Driver? SRU literally refers to stable updates for Ubuntu (or Ubuntu-based distros). So, instead of opting for the pre-released updates in order to get the latest graphics driver, you should wait for it to drop as a stable update. Of course, no one can guarantee that it will work 100% of the time – but it will be way more safe to install than the pre-released ones. ## How Can I Get the latest Nvidia drivers? ![Software Updates Nvidia](https://itsfoss.com/content/images/wordpress/2019/07/software-updates-nvidia.jpg?fit=800%2C542&ssl=1) You just have to enable “Using NVIDIA driver meta package….” from the additional drivers section in the software update option. Originally, [The Linux Experiment](https://twitter.com/thelinuxEXP) shared this news through a video – which then Ubuntu’s official Twitter handle re-tweeted as an announcement. You can watch the video below to get more details on it: ## Which Ubuntu LTS Versions are Supported? For now, Ubuntu 18.04 LTS supports this out of the box. It will soon be available for Ubuntu 16.04 LTS (and later LTS versions will follow). This will also benefit other distributions that are based on Ubuntu LTS releases. Zorin OS, Linux Mint are a few such examples: **Wrapping Up** Now that you can install the latest Nvidia binary driver updates, how do you think will it help you? If you have tested a pre-released package, let us know your thoughts on that in the comments below.
11,113
系统管理员与网站可靠性工程师(SRE)对比:区别在那儿?
https://opensource.com/article/19/7/sysadmins-vs-sres
2019-07-17T21:45:13
[ "SRE", "运维工程师" ]
https://linux.cn/article-11113-1.html
> > 系统管理员和网站可靠性工程师(SRE,下同)对于任何组织来讲都很重要。本篇将介绍下两者的不同之处。 > > > ![](/data/attachment/album/201907/17/214505qgk19kjuvzb2m1m4.jpg) 在 IT 行业,成为多面手或是专家的争议一直存在。99% 的传统系统管理员都被归到了多面手这类。<ruby> <a href="https://en.wikipedia.org/wiki/Site_Reliability_Engineering"> 网站可靠性工程师 </a> <rt> site reliability engineer </rt></ruby>(SRE)的角色则更加专精,并且在如 Google 般有着一定规模的头部公司中对其的需求不断增加。但总的来说这两者对于跑着应用的基础设施有着同样的目标:为应用的消费者提供良好的体验。然而两者的出发点却截然不同。 ### 系统管理员:中立善良的化身 系统管理员一般都是从基础的桌面或网络支持成长过来的,并一路习得大多数系统管理员都会掌握的广泛的技能。此时这些系统管理员会对他们所负责的系统和应用了如指掌。他们会知道一号服务器上的应用每隔一个星期二就需要重启一次,或是九号服务器周三会静默的崩溃。他们会对服务器的监视作出微调以忽略无关紧要的信息,尽管那个被标记为<ruby> 致命 <rt> fatal </rt> <rt> </rt></ruby>的错误信息每个月第三个周日都会显示。 总的来讲,系统管理员了解如何照料那些跑着你核心业务的服务器。这些系统管理员已经成长到开始使用自动化工具去处理所有归他们管的服务器上的例行任务。他们虽然喜欢使用模板、<ruby> 黄金镜像 <rt> golden images </rt></ruby>、以及标准,但同时也有着足够的灵活度去修改一个服务器上的参数以解决错误,并注释为什么那个服务器的配置与众不同。 尽管系统管理员很伟大,但他们也有着一些怪癖。其中一项就是没有他们神圣的授权你永远也获取不了系统的 root 访问权限,另一项则是任何不是出于他们的主意的变更都要在文档中被记录为应用提供方的要求,并仍然需要再次核对。 他们所管理的服务器是他们的地盘,没有人可以随意干涉。 ### SRE:灭霸将为之自豪 与成为系统管理员的道路相反,从开发背景和从系统管理员背景成长为 SRE 的可能性相近。SRE 的职位出现的时长与应用开发环境的生命周期相近。 随着一个组织的发展而引入的类似于[持续集成](https://en.wikipedia.org/wiki/Continuous_integration)和[持续发布](https://en.wikipedia.org/wiki/Continuous_delivery) (CI/CD) 的 [DevOps](https://opensource.com/resources/devops) 概念,通常会出现技能空缺,以让这些<ruby> 不可变 <rt> immutable </rt></ruby>的应用部署到多个环境并随着业务需求进行扩展。这将是 SRE 的舞台。的确,一个系统管理员可以学习额外的工具,但大体上成为一个全职的职位更容易跟的上发展。一个专精的专家更有意义。 SRE 使用如<ruby> <a href="https://en.wikipedia.org/wiki/Infrastructure_as_code"> 代码即基础设施 </a> <rt> infrastructure-as-code </rt></ruby>的概念去制作模板,然后调用它们来部署用以运行应用的环境,并以使用一键完整重现每个应用和它们的环境作为目标。因此会出现这样的情况:测试环境中一号服务器里的一号应用的二进制文件与生产环境中十五号服务器的完全一致,仅环境相关的变量如密码和数据库链接字串有所不同。 SRE 也会在配置发生改变时完全销毁一个环境并重新构建它。对于任何系统他们都不带一点感情。每个系统只是个被打了标记和安排了生命周期的数字而已,甚至连例行的对服务器打补丁也要重新部署整个<ruby> 应用栈 <rt> application stack </rt></ruby> ### 总结 对于一些情况,尤其是运维一些大型的基于 DevOps 的环境时,一个 SRE 所能提供的用于处理各种规模的业务的专业技能当然更具优势。但每次他们在运气不好走入死胡同时都会去寻求他的系统管理员友人或是 [来自地狱的混蛋运维(BOFH)](http://www.bofharchive.com/BOFH.html) ,得到他那身经百战的故障排除技能,和那些用于给组织提供价值的丰富经验的帮助。 --- via: <https://opensource.com/article/19/7/sysadmins-vs-sres> 作者:[Vince Power](https://opensource.com/users/vincepower/users/craig5/users/dawnparzych/users/penglish) 选题:[lujun9972](https://github.com/lujun9972) 译者:[vizv](https://github.com/vizv) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
In the IT world, there has always been a pull between generalist and specialist. The stereotypical sysadmin falls in the generalist category 99 times out of 100. The [site reliability engineer (SRE)](https://en.wikipedia.org/wiki/Site_Reliability_Engineering) role is specialized, however, and grew out of the needs of one of the first companies to know real scale: Google. Ultimately, these two roles have the same goal for the applications whose infrastructure they operate: providing a good experience for the applications’ consumers. Yet, these roles have drastically different starting points. ## Sysadmins: Neutral good incarnate Sysadmins typically grow into their position by starting as entry-level desktop and network support, and then over time acquiring the broad set of skills most sysadmins have in common. By that point, these sysadmins know all of the systems and applications they are responsible for. They know the app on server one needs to be restarted every other Tuesday, or the service on server nine will crash on Wednesday with no errors. They have fine-tuned their monitoring so it ignores what doesn’t matter, even that error that happens on the third Sunday of the month, despite the fact that it’s marked as fatal. In short, sysadmins know how to feed and care for the servers that run the core of your business. These sysadmins have grown to use automation to handle routine tasks across all the servers they manage. They love templates, golden images, and standards, but are flexible enough to make a parameter change on just the one server that has an error, and then make a note regarding why that server is now uniquely configured. Sysadmins are great, but they have a couple of quirks. The first being that you just do not get root access without divine intervention, and that any changes they make which were not their idea have to be documented as required by the application they are working with’s vendor, and then will still be double-checked. The servers are their domain, and no one messes with their stuff. ## SREs: Thanos would be proud As opposed to the path to becoming a sysadmin, SREs are as likely to come from a development background as a sysadmin background. The SRE position is closer to the lifecycle you find in an application development environment. As an organization grows and introduces [DevOps](https://opensource.com/resources/devops) concepts like [continuous integration](https://en.wikipedia.org/wiki/Continuous_integration) and [continuous delivery](https://en.wikipedia.org/wiki/Continuous_delivery) (CI/CD), there will often be a skills gap on how to run those immutable applications across multiple environments while having them scale to meet the business’s needs. This is the world of an SRE. Yes, a sysadmin can learn the additional tools, but at scale, this easily becomes a full-time position to keep up. A specialist makes sense. SREs use concepts like [infrastructure-as-code](https://en.wikipedia.org/wiki/Infrastructure_as_code) to produce templates, which are called to deploy the environment an application will run in, with the goal of every application and its environment being completely reproducible with the push of a button. So, app one on server one in system testing will have the exact same binaries that will be used on server fifteen in production, with the exception of environment-specific variables like passwords and database connection strings. An SRE will also completely destroy an environment and rebuild it based on a configuration change. There is no emotional attachment to any system. Each system is just a number and is tagged and lifecycled accordingly, even to the point that routine server patching is done by redeploying the entire application stack. ## Conclusion In certain situations, especially when operating in large DevOps-based environments, the specialized skills an SRE provides regarding how to handle any level of scale definitely offer an advantage. And every time they get stuck, they will seek out the help of their friendly neighborhood sysadmin—or [(BOFH)](http://www.bofharchive.com/BOFH.html) on a bad day—for those well-honed troubleshooting skills, and the breadth of experiences which sysadmins rely on to provide value to any organization they are a part of. ## Comments are closed.
11,115
如何在 Ubuntu 中删除仓库及其 GPG 密钥
https://www.ostechnix.com/how-to-delete-a-repository-and-gpg-key-in-ubuntu/
2019-07-17T22:32:19
[ "Ubuntu" ]
https://linux.cn/article-11115-1.html
![Delete A Repository And GPG Key In Ubuntu](/data/attachment/album/201907/17/223223badn7ulike6qw27x.png) 前几天我们讨论了如何在基于 RPM 和 DEB 的系统中[列出已安装的仓库](https://www.ostechnix.com/find-list-installed-repositories-commandline-linux/)。今天,我们将学习如何在 Ubuntu 中删除仓库及其 GPG 密钥。对于不知道仓库的人,仓库(简称 repo)是开发人员存储软件包的地方。仓库的软件包经过全面测试,并由 Ubuntu 开发人员专门为每个版本构建。用户可以使用 Apt 包管理器在他们的 Ubuntu 系统上下载和安装这些包。Ubuntu 有四个官方仓库,即 Main、Universe、Restricted 和 Multiverse。 除了官方仓库外,还有许多由开发人员(或软件包维护人员)维护的非官方仓库。非官方仓库通常有官方仓库中不可用的包。所有包都由包维护者用一对密钥(公钥和私钥)签名。如你所知,公钥是发给用户的,私钥必须保密。每当你在源列表中添加新的仓库时,如果 Apt 包管理器想要信任新添加的仓库,你还应该添加仓库密钥(公钥)。使用仓库密钥,你可以确保从正确的人那里获得包。到这里希望你对软件仓库和仓库密钥有了一个基本的了解。现在让我们继续看看如果在 Ubuntu 系统中不再需要仓库及其密钥,那么该如何删除它。 ### 在 Ubuntu 中删除仓库 每当使用 `add-apt-repository` 命令添加仓库时,它都将保存在 `/etc/apt/sources.list` 中。 要从 Ubuntu 及其衍生版中删除软件仓库,只需打开 `/etc/apt/sources.list` 文件并查找仓库名字并将其删除即可。 ``` $ sudo nano /etc/apt/sources.list ``` 正如你在下面的截图中看到的,我在我的 Ubuntu 系统中添加了 [Oracle Virtualbox](https://www.ostechnix.com/install-oracle-virtualbox-ubuntu-16-04-headless-server/) 仓库。 ![](/data/attachment/album/201907/17/223224tefb2m6f28ahfom6.png) *virtualbox 仓库* 要删除此仓库,只需删除该条目即可。保存并关闭文件。 如果你已添加 PPA 仓库,请查看 `/etc/apt/sources.list.d/` 目录并删除相应的条目。 或者,你可以使用 `add-apt-repository` 命令删除仓库。例如,我要删除 [Systemback](https://www.ostechnix.com/systemback-restore-ubuntu-desktop-and-server-to-previous-state/) 仓库,如下所示。 ``` $ sudo add-apt-repository -r ppa:nemh/systemback ``` 最后,使用以下命令更新软件源列表: ``` $ sudo apt update ``` ### 删除仓库密钥 我们使用 `apt-key` 命令添加仓库密钥。首先,让我们使用命令列出添加的密钥: ``` $ sudo apt-key list ``` 此命令将列出所有添加的仓库密钥。 ``` /etc/apt/trusted.gpg -------------------- pub rsa1024 2010-10-31 [SC] 3820 03C2 C8B7 B4AB 813E 915B 14E4 9429 73C6 2A1B uid [ unknown] Launchpad PPA for Kendek pub rsa4096 2016-04-22 [SC] B9F8 D658 297A F3EF C18D 5CDF A2F6 83C5 2980 AECF uid [ unknown] Oracle Corporation (VirtualBox archive signing key) <[email protected]> sub rsa4096 2016-04-22 [E] /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-archive.gpg ------------------------------------------------------ pub rsa4096 2012-05-11 [SC] 790B C727 7767 219C 42C8 6F93 3B4F E6AC C0B2 1F32 uid [ unknown] Ubuntu Archive Automatic Signing Key (2012) <[email protected]> /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg ------------------------------------------------------ pub rsa4096 2012-05-11 [SC] 8439 38DF 228D 22F7 B374 2BC0 D94A A3F0 EFE2 1092 uid [ unknown] Ubuntu CD Image Automatic Signing Key (2012) <[email protected]> /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg ------------------------------------------------------ pub rsa4096 2018-09-17 [SC] F6EC B376 2474 EDA9 D21B 7022 8719 20D1 991B C93C uid [ unknown] Ubuntu Archive Automatic Signing Key (2018) <[email protected]> ``` 正如你在上面的输出中所看到的,那串长的(40 个字符)十六进制值是仓库密钥。如果你希望 APT 包管理器停止信任该密钥,只需使用以下命令将其删除: ``` $ sudo apt-key del "3820 03C2 C8B7 B4AB 813E 915B 14E4 9429 73C6 2A1B" ``` 或者,仅指定最后 8 个字符: ``` $ sudo apt-key del 73C62A1B ``` 完成!仓库密钥已被删除。运行以下命令更新仓库列表: ``` $ sudo apt update ``` 资源: * [软件仓库 – Ubuntu 社区 Wiki](https://help.ubuntu.com/community/Repositories/Ubuntu) --- via: <https://www.ostechnix.com/how-to-delete-a-repository-and-gpg-key-in-ubuntu/> 作者:[sk](https://www.ostechnix.com/author/sk/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
403
Forbidden
null
11,116
利用 Python 引导孩子的计算机思维
https://opensource.com/article/19/2/break-down-stereotypes-python
2019-07-17T23:12:39
[ "Python" ]
/article-11116-1.html
> > 编程可以给低收入家庭的学生提供足够的技能、信心和知识,进而让他们摆脱因为家庭收入低带来的经济和社会地位上的劣势。 > > > ![](/data/attachment/album/201907/17/231228k3t9skntnlst59h9.jpg) 尽管暑假期间底特律公共图书馆的[帕克曼分部](https://detroitpubliclibrary.org/locations/parkman)挤满了无聊的孩子并且占用了所有的电脑,图书馆工作人员并不觉得这会是个问题,反而更多是一个机会。他们成立一个名为 [Parkman Coders](https://www.dplfound.org/single-post/2016/05/15/Parkman-Branch-Coders) 的编程社团,社团以 [Qumisha Goss](https://www.linkedin.com/in/qumisha-goss-b3bb5470) 为首,她是图书管理员,也负责利用 Python 的魔力引导弱势儿童的计算机思维。 四年前 [Qumisha Goss](https://www.linkedin.com/in/qumisha-goss-b3bb5470) 刚发起 Parkman Coders 计划的时候, “Q”(代表她)并不是太懂编程。之后她通过努力成为图书馆里教学和技术方面的专家和树莓派认证讲师。 社团最开始采用 [Scratch](https://scratch.mit.edu/) 教学,但很快学生就对这种图形化的块编程感到乏味,他们觉得这就是个“婴儿玩具”。Q 坦言,“我们意识到是时候需要在课程内容这方面做些改变了,如果是为了维持课程内容对初学者的友好性继续选择 Scratch 教学,这无疑会影响孩子们后期继续保持对编程的关注。”因此,她开始教授孩子们 Python。 Q 是在 [Code.org](http://Code.org) 平台玩地牢骷髅怪物这个关卡的时候第一次接触到 Python。她最开始是通过 《[Python Programming: An Introduction to Computer Science](https://www.amazon.com/Python-Programming-Introduction-Computer-Science/dp/1887902996)》 和 《[Python for Kids](https://nostarch.com/pythonforkids)》 这两本书学习的 Python。她也推荐 《[Automate the Boring Stuff with Python](https://automatetheboringstuff.com/)》 和 《[Lauren Ipsum: A Story about Computer Science and Other Improbable Things](https://nostarch.com/laurenipsum)》 这两本书。 ### 建立一个基于树莓派的创客空间 Q 决定使用[树莓派](https://www.raspberrypi.org/)电脑来避免学生可能会因为自己的不当操作对图书馆的电脑造成损害,而且这些电脑因为便携性等问题也不方便用来构建组成一个创客空间。[树莓派](https://www.raspberrypi.org/)的购买价格加上它的灵活性和便携性包括生态圈里面的一些适合教学的自由免费软件,让大家更能感受到她的决策的可行性和可靠性。 虽然图书馆发起 [Parkman Coders](https://www.dplfound.org/single-post/2016/05/15/Parkman-Branch-Coders) 社区计划的本意是通过努力创造一个吸引孩子们的学习空间,进而维持图书馆的平和,但社区发展的很快,很受大家欢迎,以至于这座建立于 1921 的大楼的空间,电脑和插座都不够用了。他们最开始是 20 个孩子共享 10 台[树莓派](https://www.raspberrypi.org/)来进行授课,但后来图书馆陆续收到了来自个人和公司比如 Microsoft、4H,和 Detroit Public Library Foundation 的资金援助从而能够购买更多设备以支撑社区的进一步壮大发展。 目前,每节课程大概有 40 个孩子参加,而且图书馆也有了足够的[树莓派](https://www.raspberrypi.org/)让参与者人手一台设备甚至还可以送出去一些。鉴于不少 [Parkman Coders](https://www.dplfound.org/single-post/2016/05/15/Parkman-Branch-Coders) 的参与者来自于低收入家庭,图书馆也能提供别人捐赠的 Chromebooks 给他们使用。 Q 说,“当孩子们的表现可以证明他们能够很好的使用[树莓派](https://www.raspberrypi.org/)或者 [Microbit](https://microbit.org/guide/) 而且定期来参加课程,我们也会提供设备允许他们可以带回家练习。但即便这样也还是会遇到很多问题,比如他们在家无法访问网络或者没有显示器、键盘、鼠标等外设。” ### 利用 Python 学习生存技能,打破束缚 Q 说,“我认为教授孩子们计算机科学的主要目的是让他们学会批判性思考和解决问题的能力。我希望随着孩子们长大成人,不管他们选择在哪个领域继续发展他们的未来,这些经验教训都会一直伴随他们成长。此外,我也希望这个课程能够激发孩子们对创造的自豪感。能够清楚的意识到‘这是我做的’是一种很强烈、很有用的感受。而且一旦孩子们越早能够有这种成功的体验,我相信未来的路上他们都会满怀热情迎接新的挑战而不是逃避。” 她继续分享道,“在学习编程的过程中,你不得不对单词的拼写和大小写高度警惕。受限于孩子年龄,有时候阅读认知会是个大问题。为了确保课程受众的包容性,我们会在授课过程中大声拼读,同样我们也会极力鼓励孩子们大声说出他们不知道的或者不能正确拼写的单词,以便我们纠正。” Q 也会尝试尽力去给需要帮助的孩子们更多的关注。她解释道,“如果我确认有孩子遇到困难不能跟上我们的授课进度,我们会尝试在课下时间安排老师辅导帮助他,但还是会允许他们继续参加编程。我们想帮助到他们而不是让他们因为挫败而沮丧的不再参与进来。” 最重要的是,[Parkman Coders](https://www.dplfound.org/single-post/2016/05/15/Parkman-Branch-Coders) 计划所追求的是能够帮助每个孩子认识到每个人都会有独特的技能和能力。参与进来的大部分孩子都是非裔美国人,一半是女孩。Q 直言,“我们所生活在的这个世界,我们成长的过程中,伴随着各种各种的社会偏见,这些都常常会限制我们对自己所能达到的成就的准确认知。”她坚信孩子们需要一个没有偏见的空间,“他们可以尝试很多新事物,不会因为担心犯错责骂而束手束脚,可以放心大胆的去求知探索。” Q 和 [Parkman Coders](https://www.dplfound.org/single-post/2016/05/15/Parkman-Branch-Coders) 计划所营造的环境氛围能够帮助到参与者摆脱低家庭收入带来的劣势。如果说社区能够发展壮大到今天的规模真有什么独特秘诀的话,那大概就是,Q 解释道,“确保你有一个令人舒适的空间,充满了理解与宽容,这样大家才会被吸引过来。让来的人不忘初心,做好传道受业解惑的准备;当大家参与进来并感觉到充实愉悦,自然而然会想要留下来。” --- via: <https://opensource.com/article/19/2/break-down-stereotypes-python> 作者:[Don Watkins](https://opensource.com/users/don-watkins) 选题:[lujun9972](https://github.com/lujun9972) 译者:[WangYueScream](https://github.com/WangYueScream) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
null
HTTPSConnectionPool(host='opensource.com', port=443): Read timed out. (read timeout=10)
null
11,118
在线试用 200 多种 Linux 和 Unix 操作系统
https://www.ostechnix.com/test-100-linux-and-unix-operating-systems-online-for-free/
2019-07-18T12:43:00
[ "试用" ]
https://linux.cn/article-11118-1.html
![DistroTest——在线试用200多种Linux和Unix操作系统](/data/attachment/album/201907/18/124355htdu1tuqt1kxaggd.jpg) 不久前我们介绍过[OSBoxes](https://www.ostechnix.com/osboxes-free-unixlinux-virtual-machines-for-vmware-and-virtualbox/),该网站提供了一系列免费且开箱即用的 Linux 和 Unix 虚拟机。你可以在你的 Linux 系统中下载这些虚拟机并用 VirtualBox 或 VMWare workstation 试用。今天,我偶然发现一个名叫 “DistroTest” 的类似服务。与 OSBoxes 不同之处在于 DistroTest 让你免费试用现场版 Linux 和 Unix 操作系统。你可以在线试用 200 多种 Linux 和 Unix 操作系统而无需在本地安装它们。只要打开该网站,选择你需要的 Linux/Unix 发行版,然后开始试用! 两个名为 Klemann Andy 和 Forster Tobias 的好心人用 Qemu 在 Debian 上运行了这项网络服务。这里列出的公开发行版在使用上没有任何限制。你可以象使用本地系统一样使用系统的所有功能。你可以安装和卸载软件。你可以测试安装的程序,甚至删除或格式化硬盘,删除系统文件。简而言之,DistroTest让喜欢尝试不同发行版的的人自行决定: * 最适合他们的发行版 * 想要哪种图形界面 * 他们可以选择哪些配置 本文撰写之时,DistroTest 提供了 227 种操作系统的 711 个版本。我已经使用 Linux 很多年,但我从未听说过这里列出的一些发行版。说实话我甚至不知道 Linux 操作系统有如此之多的版本。 DistroTest 网站提供的 Linux 发行版的列表如下。(LCTT 译注:其中也包括部分非 Linux 的操作系统如 FreeBSD 和 FreeDOS,或是分区工具如 Gparted) * 4mLinux * AbsoluteLinux * AlpineLinux * Antergos * antiX Linux * Aptosid * ArchBang * ArchLabs * ArchLinux * Archman * ArchStrike * ArtixLinux * AryaLinux * AvLinux * BackBoxLinux * BigLinux * Bio-Linux * BlackArch * BlackLab * BlackPantherOS * blag * BlankOn * Bluestar * Bodhi * BunsenLabs * Caine * Calculate Linux Desktop * CentOS 7 * Chakra * ChaletOS * ClearOS * Clonezilla * ConnochaetOS * Cucumber * Damn Small Linux * Debian * Devil-Linux * Devuan * DragonFly BSD * Dragora * Dyne:bolic * Edubuntu * elementaryOS * Elive Linux * Emmabuntüs * Emmabuntüs * Endless OS * EnsoOS * Exe GNU/Linux * ExTiX * Fatdog64 * Fedora * FerenOS * FreeBSD * FreeDOS * Frugalware * Frugalware * G4L * GeckoLinux * Gentoo * GNewSense * GoboLinux * Gparted * GreenieLinux * GRML * GuixSD * Haiku * Heads * Kali Linux * Kanotix * KaOS * Knoppix * Kodachi * KolibriOS * Korora * Kwort * Linux Lite * Linux Mint * LiveRaizo * LMDE * LXLE OS * Macpup * Mageia * MakuluLinux * Manjaro * MauiLinux * MenuetOS * MiniNo * Modicia * Musix * MX Linux * Nas4Free * Neptune * NetBSD * Netrunner * NixOs * NuTyX * OpenIndiana * OpenMandriva * openSUSE * OracleLinux * OSGeo live * OviOS * Parabola * Pardus * Parrot * Parsix * PCLinuxOS * PeachOSI * Peppermint * Pinguy * PinguyOS * plopLinux * PointLinux * Pop!\_OS * PORTEUS * Puppy Linux * PureOS * Q4OS * QubesOS * Quirky * ReactOS * Redcore * Rescatux * RevengeOS * RoboLinux * Rockstor * ROSA * Runtu * Sabayon * SalentOS * Salix * ScientificLinux * Siduction * Slax * SliTaz * Solus * SolydK * SparkyLinux * Springdale * Stresslinux * SubgraphOS * SwagArch (18.03) * Tails * Tanglu * Tiny Core * Trisquel * TrueOS * TurnKey Linux * Ubuntu及其官方衍生版本 * Uruk * VectorLinux * VineLinux * VoidLinux * Voyager * VyOS * WattOs * Zentyal * Zenwalk * Zevenet * Zorin OS ### 如何使用? 要试用任何操作系统,点击下面的链接: <https://distrotest.net/> 在这个网站,你会看到可用的操作系统列表。单击你想了解的发行版名称即可。 ![](/data/attachment/album/201907/18/124357zoh8yx3k3jlnl3vb.png) 用 DistroTest 试用 200 多种Linux和Unix操作系统 本文中我会试用 Arch Linux。 单击发行版链接后,在跳转到的页面单击 “System start” 按钮即可启动所选操作系统。 ![](/data/attachment/album/201907/18/124359tqott327caqq1t6a.png) 此现场版操作系统会在新浏览器窗口中启动。你可以通过内建的 noVNC viewer 访问它。请在浏览器中启用/允许 DistroTest 网站的弹出窗口,否则无法看到弹出的 noVNC 窗口。 按回车启动现场版系统。 ![](/data/attachment/album/201907/18/124403zqswjxuzee6qeexe.png) 这就是 Arch Linux 现场版系统: ![](/data/attachment/album/201907/18/124406asgwzjezwd3v1js3.png) 你可以免费使用这个系统 1 小时。你可以试用该现场版操作系统、安装应用、卸载应用、删除或修改系统文件、测试配置或脚本。每次关机后,一切都会恢复成默认配置。 一旦试用结束,回到 DistroTest 页面并停止你试用的系统。如果你不想启用 DistroTest 页面的弹出窗口,用你本地系统安装的任意 VNC 客户端也可以。VNC 登录信息可在同一页面找到。 ![](/data/attachment/album/201907/18/124407elpgggdw16p1givg.png) DistroTest 服务对两类用户比较实用:想在线试用 Linux/Unix 系统,或是没有喜欢的操作系统现场版 ISO 镜像文件的人。我在 4G 网络上测试的结果一切正常。 ### 实际上,我没法在这个虚拟机里安装新软件 试用期间我注意到的一个问题是这个虚拟机没有联网。除了本地环回接口之外没有其他网络接口。没有联网也没有本地镜像源的情况下我没法下载和安装新软件。我不知道为何网站声称可以安装软件。也许在这点上我遗漏了什么。我在 DistroTest 上能做的只是看看现成的系统,试用现场版而不能安装任何软件。 推荐阅读: * [免费在线学习和练习 Linux命令!](https://www.ostechnix.com/learn-and-practice-linux-commands-online-for-free/) * [在浏览器中运行 Linux 和其他操作系统](https://www.ostechnix.com/run-linux-operating-systems-browser/) 暂时就这样了。我不知道 DistroTest 团队如何设法托管了这么多操作系统。我肯定这会花不少时间。这的确是件值得称赞的工作。我非常感激项目成员的无私行为。荣誉归于你们。加油! --- via: <https://www.ostechnix.com/test-100-linux-and-unix-operating-systems-online-for-free/> 作者:[sk](https://www.ostechnix.com/author/sk/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[0x996](https://github.com/0x996) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
403
Forbidden
null
11,119
MX Linux:一款专注于简洁性的中等体量发行版
https://www.linux.com/learn/intro-to-linux/2018/4/mx-linux-mid-weight-distro-focused-simplicity
2019-07-18T23:50:57
[ "发行版", "Linux" ]
https://linux.cn/article-11119-1.html
> > 这个发行版可以使任何人在 Linux 上如家一般。 > > > ![](/data/attachment/album/201907/18/235101h8m8cwcew2zwl8kq.png) Linux 有着如此多种的发行版。许多发行版为了使自己与众不同而做出了很多改变。另一方面,许多发行版之间的区别又是如此之小,你可能会问为什么有人还愿意不厌其烦的重复别人已经做过的工作呢?也正是基于这一疑惑,让我好奇为什么 [antiX](https://antixlinux.com/) 和 [MEPIS](https://en.wikipedia.org/wiki/MEPIS)这两个社区要联合推出一个特殊的发行版,考虑到具体情况应该会是一个搭载 Xfce 桌面并基于 antiX 的版本,由 MEPIS 社区承担开发。 这一开发中的使用 Xfce 桌面的 antiX 系统是否会基于它之前的发行版呢?毕竟,antiX 旨在提供一个“基于 Debian 稳定版的快速、轻量级、易于安装的非 systemd 的 live CD 发行版”。antiX 所搭载的桌面是 [LXDE](https://lxde.org/),能够极好的满足关于轻量化系统的相关要求和特性。那究竟是什么原因使得 antiX 决定构建另一个轻量化发行版呢,仅仅是因为这次换成了 Xfce 吗?好吧,Linux 社区中的任何人都知道,增加了不同风格的好的轻量级发行版是值得一试的(特别是可以使得我们的旧硬件摆脱进入垃圾填埋场的宿命)。当然,LXDE 和 Xfce 并不完全属于同一类别。LXDE 应该被认为是一个真正的轻量级桌面,而 Xfce 应该被认为是一个中等体量的桌面。朋友们,这就是为什么 MX Linux 是 antiX 的一个重要迭代的关键。一个基于 Debian 的中等体量的发行版,它包含你完成工作所需的所有工具。 但是在 MX Linux 中有一些直接从 antiX 借用来的非常有用的东西 —— 那就是安装工具。当我初次设置了 VirtualBox 虚拟机来安装 MX Linux 时,我认为安装的系统将是我已经习惯的典型的、非常简单的 Linux 系统。令我非常惊讶的是,MX Linux 使用的 antiX 安装程序打破了以往的痛点,特别是对于那些对尝试 Linux 持观望态度的人来说。 因此,甚至在我开始尝试 MX Linux 之前,我就对它有了深刻的印象。让我们来看看是什么让这个发行版的安装如此特别,最后再来看看桌面。 你可以从[这里](https://mxlinux.org/download-links)下载 MX Linux 17.1。系统的最低要求是: * CD/DVD驱动器(以及能够从该驱动器引导的 BIOS)或 live USB(以及能够从 USB 引导的 BIOS) * 英特尔 i486 或 AMD 处理器 * 512 MB 内存 * 5 GB 硬盘空间 * 扬声器,AC97 或 HDA-compatible 声卡 * 作为一个 LiveUSB 使用,需要 4 GB 空间 ### 安装 MX Linux 安装程序使安装 Linux 变得轻而易举。虽然它可能不是外观最现代化的安装工具,但也已经差不多了。安装的要点是从选择磁盘和选择安装类型开始的(图 1)。 ![install](/data/attachment/album/201907/18/235102zrdzscdjsqgta7dv.jpg "install") *图 1:MX Linux 的安装程序截图之一* 下一个重要的界面(图 2)要求你设置一个计算机名称、域名和(如果需要的话,为微软网络设置)工作组。 ![network](/data/attachment/album/201907/18/235103cjkkui00xei67iq8.jpg) *图 2:设置网络名称* 配置工作组的能力是第一个真正值得称赞的。这是我记忆中第一款在安装期间提供此选项的发行版。它还应该提示你,MX Linux 提供了开箱即用的共享目录功能。它做到了,而且深藏功与名。它并不完美,但它可以在不需要安装任何额外包的情况下工作(稍后将详细介绍)。 最后一个重要的安装界面(需要用户交互)是创建用户帐户和 root 权限的密码(图 3)。 ![user](/data/attachment/album/201907/18/235104xf7g0dg9uurmsgd7.jpg "user") *图 3:设置用户帐户详细信息和 root 用户密码* 最后一个界面设置完成后,安装将完成并要求重新启动。重启后,你将看到登录屏幕。登录并享受 MX Linux 带来的体验。 ### 使用 Xfce 桌面是一个非常容易上手的界面。默认设置将面板位于屏幕的左边缘(图 4)。 ![desktop](/data/attachment/album/201907/18/235105mkstisski51sigzi.jpg "desktop") *图 4:MX Linux 的默认桌面* 如果你想将面板移动到更传统的位置,右键单击面板上的空白点,然后单击“面板”>“面板首选项”。在显示的窗口中(图 5),单击样式下拉菜单,在桌面栏、垂直栏或水平栏之间进行选择你想要的模式。 ![panel](/data/attachment/album/201907/18/235106eh9chv2m2rjm6vjj.jpg "panel") *图 5:配置 MX Linux 面板* 桌面栏和垂直选项的区别在于,在桌面栏模式下,面板垂直对齐,就像在垂直模式下一样,但是插件是水平放置的。这意味着你可以创建更宽的面板(用于宽屏布局)。如果选择水平布局,它将默在顶部,然后你必须取消锁定面板,单击关闭,然后(使用面板左侧边缘的拖动手柄)将其拖动到底部。你可以回到面板设置窗口并重新锁定面板。 除此之外,使用 Xfce 桌面对于任何级别的用户来说都是无需动脑筋的事情……就是这么简单。你会发现很多涵盖了生产力(LibreOffice、Orage Calendar、PDF-Shuffler)、图像(GIMP)、通信(Firefox、Thunderbird、HexChat)、多媒体(Clementine、guvcview SMTube、VLC媒体播放器)的软件,和一些 MX Linux 专属的工具(称为 MX 工具,涵盖了 live-USB 驱动器制作工具、网络助手、包管理工具、仓库管理工具、live ISO 快照工具等等)。 ### Samba 让我们讨论一下如何将文件夹共享到你的网络。正如我所提到的,你不需要安装任何额外的包就可以使其正常工作。只需打开文件管理器,右键单击任何位置,并选择网络上的共享文件夹。系统将提示你输入管理密码(已在安装期间设置)。验证成功之后,Samba 服务器配置工具将打开(图 6)。 ![sharing](/data/attachment/album/201907/18/235107wudepgzdximx53dc.jpg "sharing") *图 6:向网络共享一个目录* 单击“+”按钮配置你的共享。你将被要求指定一个目录,为共享提供一个名称/描述,然后决定该共享是否可写和可见(图 7)。 ![sharing](/data/attachment/album/201907/18/235107xub6sjn6zhz55b3i.jpg "sharing") *图 7:在 MX Linux 上配置共享* 当你单击 Access 选项时,你可以选择是让每个人都访问共享,还是限于特定的用户。问题就出在这里。此时,没有用户可以共享。为什么?因为它们还没有被添加。有两种方法可以把它们添加到共享:从命令行或使用我们已经打开的工具。让我们用一种更为简单的方法。在 Samba 服务器配置工具的主窗口中,单击“首选项” > “Samba 用户”。在弹出的窗口中,单击“添加用户”。 将出现一个新窗口(图 8),你需要从下拉框中选择用户,输入 Windows 用户名,并为用户键入/重新键入密码。 ![Samba](/data/attachment/album/201907/18/235108cyeecsevuydchzmq.jpg "Samba") *图 8:向 Samba 添加用户* 一旦你单击“确定”,这用户就会被添加,并且基于你的网络的对用户的共享功能也随之启用。创建 Samba 共享从未变得如此容易。 ### 结论 MX Linux 使任何从桌面操作系统转到 Linux 都变得非常简单。尽管有些人可能会觉得桌面界面不太现代,但发行版的主要关注点不是美观,而是简洁。为此,MX Linux 以出色的方式取得了成功。Linux 的这个特色发行版可以让任何人在使用 Linux 的过程中感到宾至如归。尝试这一中等体量的发行版,看看它能否作为你的日常系统。 --- via: <https://www.linux.com/learn/intro-to-linux/2018/4/mx-linux-mid-weight-distro-focused-simplicity> 作者:[JACK WALLEN](https://www.linux.com/users/jlwallen) 译者:[qfzy1233](https://github.com/qfzy1233) 校对:[wxy](https://github.com/wxy) 选题:[lujun9972](https://github.com/lujun9972) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
301
Moved Permanently
null
11,120
32位支持:使用 GCC 交叉编译
https://opensource.com/article/19/7/cross-compiling-gcc
2019-07-19T05:42:57
[ "GCC", "编译" ]
https://linux.cn/article-11120-1.html
> > 使用 GCC 在单一的构建机器上来为不同的 CPU 架构交叉编译二进制文件。 > > > ![](/data/attachment/album/201907/19/054242nwhludz9tm2lwd8t.jpg) 如果你是一个开发者,要创建二进制软件包,像一个 RPM、DEB、Flatpak 或 Snap 软件包,你不得不为各种不同的目标平台编译代码。典型的编译目标包括 32 位和 64 位的 x86 和 ARM。你可以在不同的物理或虚拟机器上完成你的构建,但这需要你为何几个系统。作为代替,你可以使用 GNU 编译器集合 ([GCC](https://gcc.gnu.org/)) 来交叉编译,在单一的构建机器上为几个不同的 CPU 架构产生二进制文件。 假设你有一个想要交叉编译的简单的掷骰子游戏。在大多数系统上,以 C 语言来编写这个相对简单,出于给添加现实的复杂性的目的,我以 C++ 语言写这个示例,所以程序依赖于一些不在 C 语言中东西 (具体来说就是 `iostream`)。 ``` #include <iostream> #include <cstdlib> using namespace std; void lose (int c); void win (int c); void draw (); int main() { int i; do { cout << "Pick a number between 1 and 20: \n"; cin >> i; int c = rand ( ) % 21; if (i > 20) lose (c); else if (i < c ) lose (c); else if (i > c ) win (c); else draw (); } while (1==1); } void lose (int c ) { cout << "You lose! Computer rolled " << c << "\n"; } void win (int c ) { cout << "You win!! Computer rolled " << c << "\n"; } void draw ( ) { cout << "What are the chances. You tied. Try again, I dare you! \n"; } ``` 在你的系统上使用 `g++` 命令编译它: ``` $ g++ dice.cpp -o dice ``` 然后,运行它来确认其工作: ``` $ ./dice Pick a number between 1 and 20: [...] ``` 你可以使用 `file` 命令来查看你刚刚生产的二进制文件的类型: ``` $ file ./dice dice: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 5.1.15, not stripped ``` 同样重要,使用 `ldd` 命令来查看它链接哪些库: ``` $ ldd dice linux-vdso.so.1 =&gt; (0x00007ffe0d1dc000) libstdc++.so.6 =&gt; /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fce8410e000) libc.so.6 =&gt; /lib/x86_64-linux-gnu/libc.so.6 (0x00007fce83d4f000) libm.so.6 =&gt; /lib/x86_64-linux-gnu/libm.so.6 (0x00007fce83a52000) /lib64/ld-linux-x86-64.so.2 (0x00007fce84449000) libgcc_s.so.1 =&gt; /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fce8383c000) ``` 从这些测试中,你已经确认了两件事:你刚刚运行的二进制文件是 64 位的,并且它链接的是 64 位库。 这意味着,为实现 32 位交叉编译,你必需告诉 `g++` 来: 1. 产生一个 32 位二进制文件 2. 链接 32 位库,而不是 64 位库 ### 设置你的开发环境 为编译成 32 位二进制,你需要在你的系统上安装 32 位的库和头文件。如果你运行一个纯 64 位系统,那么,你没有 32 位的库或头文件,并且需要安装一个基础集合。最起码,你需要 C 和 C++ 库(`glibc` 和 `libstdc++`)以及 GCC 库(`libgcc`)的 32 位版本。这些软件包的名称可能在每个发行版中不同。在 Slackware 系统上,一个纯 64 位的带有 32 位兼容的发行版,可以从 [Alien BOB](http://www.slackware.com/%7Ealien/multilib/) 提供的 `multilib` 软件包中获得。在 Fedora、CentOS 和 RHEL 系统上: ``` $ yum install libstdc++-*.i686 $ yum install glibc-*.i686 $ yum install libgcc.i686 ``` 不管你正在使用什么系统,你同样必须安装一些你工程使用的 32 位库。例如,如果你在你的工程中包含 `yaml-cpp`,那么,在编译工程前,你必需安装 `yaml-cpp` 的 32 位版本,或者,在很多系统上,安装 `yaml-cpp` 的开发软件包(例如,在 Fedora 系统上的 `yaml-cpp-devel`)。 一旦这些处理好了,编译是相当简单的: ``` $ g++ -m32 dice.cpp -o dice32 -L /usr/lib -march=i686 ``` `-m32` 标志告诉 GCC 以 32 位模式编译。`-march=i686` 选项进一步定义来使用哪种最优化类型(参考 `info gcc` 了解选项列表)。`-L` 标志设置你希望 GCC 来链接的库的路径。对于 32 位来说通常是 `/usr/lib`,不过,这依赖于你的系统是如何设置的,它可以是 `/usr/lib32`,甚至 `/opt/usr/lib`,或者任何你知道存放你的 32 位库的地方。 在代码编译后,查看你的构建的证据: ``` $ file ./dice32 dice: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs) [...] ``` 接着,当然, `ldd ./dice32` 也会指向你的 32 位库。 ### 不同的架构 在 64 位相同的处理器家族上允许 GCC 做出很多关于如何编译代码的假设来编译 32 位软件。如果你需要为完全不同的处理器编译,你必需安装适当的交叉构建实用程序。安装哪种实用程序取决于你正在编译的东西。这个过程比为相同的 CPU 家族编译更复杂一点。 当你为相同处理器家族交叉编译时,你可以期待找到与 32 位库集的相同的 64 位库集,因为你的 Linux 发行版是同时维护这二者的。当为一个完全不同的架构编译时,你可能不得不穷追你的代码所需要的库。你需要的版本可能不在你的发行版的存储库中,因为你的发行版可能不为你的目标系统提供软件包,或者它不在容易到达的位置提供所有的软件包。如果你正在编译的代码是你写的,那么你可能非常清楚它的依赖关系是什么,并清楚在哪里找到它们。如果代码是你下载的,并需要编译,那么你可能不熟悉它的要求。在这种情况下,研究正确编译代码需要什么(它们通常被列在 `README` 或 `INSTALL` 文件中,当然也出现在源文件代码自身之中),然后收集需要的组件。 例如,如果你需要为 ARM 编译 C 代码,你必须首先在 Fedora 或 RHEL 上安装 `gcc-arm-linux-gnu`(32 位)或 `gcc-aarch64-linux-gnu`(64 位);或者,在 Ubuntu 上安装 `arm-linux-gnueabi-gcc` 和 `binutils-arm-linux-gnueabi`。这提供你需要用来构建(至少)一个简单的 C 程序的命令和库。此外,你需要你的代码使用的任何库。你可以在惯常的位置(大多数系统上在 `/usr/include`)放置头文件,或者,你可以放置它们在一个你选择的目录,并使用 `-I` 选项将 GCC 指向它。 当编译时,不使用标准的 `gcc` 或 `g++` 命令。作为代替,使用你安装的 GCC 实用程序。例如: ``` $ arm-linux-gnu-g++ dice.cpp \ -I/home/seth/src/crossbuild/arm/cpp \ -o armdice.bin ``` 验证你构建的内容: ``` $ file armdice.bin armdice.bin: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV) [...] ``` ### 库和可交付结果 这是一个如何使用交叉编译的简单的示例。在真实的生活中,你的源文件代码可能产生的不止于一个二进制文件。虽然你可以手动管理,在这里手动管理可能不是好的正当理由。在我接下来的文章中,我将说明 GNU 自动工具,GNU 自动工具做了使你的代码可移植的大部分工作。 --- via: <https://opensource.com/article/19/7/cross-compiling-gcc> 作者:[Seth Kenlon](https://opensource.com/users/seth) 选题:[lujun9972](https://github.com/lujun9972) 译者:[robsean](https://github.com/robsean) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
If you're a developer creating binary packages, like an RPM, DEB, Flatpak, or Snap, you have to compile code for a variety of different target platforms. Typical targets include 32-bit and 64-bit x86 and ARM. You could do your builds on different physical or virtual machines, but that means maintaining several systems. Instead, you can use the GNU Compiler Collection ([GCC](https://gcc.gnu.org/)) to cross-compile, producing binaries for several different architectures from a single build machine. Assume you have a simple dice-rolling game that you want to cross-compile. Something written in C is relatively easy on most systems, so to add complexity for the sake of realism, I wrote this example in C++, so the program depends on something not present in C (**iostream**, specifically). ``` #include <iostream> #include <cstdlib> using namespace std; void lose (int c); void win (int c); void draw (); int main() { int i; do { cout << "Pick a number between 1 and 20: \n"; cin >> i; int c = rand ( ) % 21; if (i > 20) lose (c); else if (i < c ) lose (c); else if (i > c ) win (c); else draw (); } while (1==1); } void lose (int c ) { cout << "You lose! Computer rolled " << c << "\n"; } void win (int c ) { cout << "You win!! Computer rolled " << c << "\n"; } void draw ( ) { cout << "What are the chances. You tied. Try again, I dare you! \n"; } ``` Compile it on your system using the **g++ **command: `$ g++ dice.cpp -o dice` Then run it to confirm that it works: ``` $ ./dice Pick a number between 1 and 20: [...] ``` You can see what kind of binary you just produced with the **file** command: ``` $ file ./dice dice: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 5.1.15, not stripped ``` And just as important, what libraries it links to with **ldd**: ``` $ ldd dice linux-vdso.so.1 => (0x00007ffe0d1dc000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fce8410e000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fce83d4f000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fce83a52000) /lib64/ld-linux-x86-64.so.2 (0x00007fce84449000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fce8383c000) ``` You have confirmed two things from these tests: The binary you just ran is 64-bit, and it is linked to 64-bit libraries. That means that, in order to cross-compile for 32-bit, you must tell **g++** to: - Produce a 32-bit binary - Link to 32-bit libraries instead of the default 64-bit libraries ## Setting up your dev environment To compile to 32-bit, you need 32-bit libraries and headers installed on your system. If you run a pure 64-bit system, then you have no 32-bit libraries or headers and need to install a base set. At the very least, you need the C and C++ libraries (**glibc** and **libstdc++**) along with 32-bit version of GCC libraries (**libgcc**). The names of these packages may vary from distribution to distribution. On Slackware, a pure 64-bit distribution with 32-bit compatibility is available from the **multilib** packages provided by [Alien BOB](http://www.slackware.com/~alien/multilib/). On Fedora, CentOS, and RHEL: ``` $ yum install libstdc++-*.i686 $ yum install glibc-*.i686 $ yum install libgcc.i686 ``` Regardless of the system you're using, you also must install any 32-bit libraries your project uses. For instance, if you include **yaml-cpp** in your project, then you must install the 32-bit version of **yaml-cpp** or, on many systems, the development package for **yaml-cpp** (for instance, **yaml-cpp-devel** on Fedora) before compiling it. Once that's taken care of, the compilation is fairly simple: `$ g++ -m32 dice.cpp -o dice32 -L /usr/lib -march=i686` The **-m32** flag tells GCC to compile in 32-bit mode. The **-march=i686** option further defines what kind of optimizations to use (refer to **info gcc** for a list of options). The **-L** flag sets the path to the libraries you want GCC to link to. This is usually **/usr/lib** for 32-bit, although, depending on how your system is set up, it could be **/usr/lib32** or even **/opt/usr/lib** or any place you know you keep your 32-bit libraries. After the code compiles, see proof of your build: ``` $ file ./dice32 dice: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs) [...] ``` And, of course, **ldd ./dice32** points to your 32-bit libraries. ## Different architectures Compiling 32-bit on 64-bit for the same processor family allows GCC to make many assumptions about how to compile the code. If you need to compile for an entirely different processor, you must install the appropriate cross-build GCC utilities. Which utility you install depends on what you are compiling. This process is a little more complex than compiling for the same CPU family. When you're cross-compiling for the same family, you can expect to find the same set of 32-bit libraries as 64-bit libraries, because your Linux distribution is maintaining both. When compiling for an entirely different architecture, you may have to hunt down libraries required by your code. The versions you need may not be in your distribution's repositories because your distribution may not provide packages for your target system, or it may not mirror all packages in a convenient location. If the code you're compiling is yours, then you probably have a good idea of what its dependencies are and possibly where to find them. If the code is something you have downloaded and need to compile, then you probably aren't as familiar with its requirements. In that case, investigate what the code requires to build correctly (they're usually listed in the README or INSTALL files, and certainly in the source code itself), then go gather the components. For example, if you need to compile C code for ARM, you must first install **gcc-arm-linux-gnu** (32-bit) or **gcc-aarch64-linux-gnu** (64-bit) on Fedora or RHEL, or **arm-linux-gnueabi-gcc** and **binutils-arm-linux-gnueabi** on Ubuntu. This provides the commands and libraries you need to build (at least) a simple C program. Additionally, you need whatever libraries your code uses. You can place header files in the usual location (**/usr/include** on most systems), or you can place them in a directory of your choice and point GCC to it with the **-I** option. When compiling, don't use the standard **gcc** or **g++** command. Instead, use the GCC utility you installed. For example: ``` $ arm-linux-gnu-g++ dice.cpp \ -I/home/seth/src/crossbuild/arm/cpp \ -o armdice.bin ``` Verify what you've built: ``` $ file armdice.bin armdice.bin: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV) [...] ``` ## Libraries and deliverables This was a simple example of how to use cross-compiling. In real life, your source code may produce more than just a single binary. While you can manage this manually, there's probably no good reason to do that. In my next article, I'll demonstrate GNU Autotools, which does most of the work required to make your code portable. ## Comments are closed.
11,121
Epic Games 给予 Blender 基金会 120 万美元的拨款支持
https://itsfoss.com/epic-games-blender-grant/
2019-07-19T06:42:05
[ "Blender", "Epic" ]
https://linux.cn/article-11121-1.html
[Epic MegaGrants](https://www.unrealengine.com/en-US/megagrants) 是 [Epic Games](https://www.epicgames.com/store/en-US/) 的一个计划,用于支持游戏开发人员、企业专业人士、内容创建者和工具开发人员使用<ruby> 虚幻引擎 <rt> Unreal Engine </rt></ruby>(UE)做出神奇的作品或增强 3D 图形社区的开源功能。 作为该计划的一部分,Epic Games 给予 [Blender 基金会](https://www.blender.org/) 120 万美元拨款以帮助改善他们的发展。如果你还不知道,Blender 是[最好的开源视频编辑](https://itsfoss.com/open-source-video-editors/)之一,特别是以创建专业的 3D 计算机图形而闻名。 **Tim Sweeney**(Epic Games 的创始人兼首席执行官)这样评论这笔授予: > > “开放式工具、库和平台对数字内容生态系统的未来至关重要。……Blender 是艺术社区持久的资源,我们的目标是确保其进步,造福所有创作者。” > > > 即使这是个好消息,也有人对此不满意。在本文中,我们将看一下得到该拨款后的 Blender 基金会的计划,以及人们对此的看法。 ### Blender 基金会的改进计划 ![Image Credit : BlenderNation](/data/attachment/album/201907/19/064207nm5m7o575eoxe7e7.jpg) 在[新闻稿](https://www.blender.org/press/epic-games-supports-blender-foundation-with-1-2-million-epic-megagrant/)当中,Blender 基金会提到了如何利用这笔资金以及用于何种目的: > > “Epic MegaGrant 将在未来三年内逐步交付,并将为 Blender 的<ruby> 专业 Blender 发展计划 <rt> Professionalizing Blender Development Initiative </rt></ruby>做出贡献。” > > > 所以,没错,这笔财务帮助将以现金提供 —— 但是,它要在 3 年内完成。也就是说,我们要期待 Blender 基金会及其软件质量得到重大改进还有很长时间。 这是 **Ton Roosendaal**(Blender 基金会的创始人)需要说明的它将如何被利用: > > “Epic Games 的支持对 Blender 是一个重要里程碑,”Blender 基金会的创始人兼董事长 Ton Roosendaal 说道。“由于这项拨款,我们将对我们的项目组织进行大量投入,以改善支持、协作和代码质量实践。因此,我们期望更多来自该行业的贡献者加入我们的项目。” > > > ### 为什么人们对此不是很喜欢? 让我澄清一下,就我个人而言,我不喜欢用 Epic Game 的市场或客户端玩游戏。 由于各种原因(功能、隐私等),我更喜欢 [Steam](https://itsfoss.com/install-steam-ubuntu-linux/) 而不是 Epic Games。 Epic Games 被称为游戏社区中的坏人,因为它最近几款游戏专属于其平台 —— 尽管很多人警告用户该平台上的隐私问题。 不仅如此,Epic Games 的首席执行官在过去发过这样的推特: > > 安装 Linux 相当于人们不喜欢美国的政治趋势时就搬到加拿大。 > > > 不,我们必须为今天的自由而战,如今我们拥有自由。 > > > * Tim Sweeney(@TimSweeneyEpic)[2018年2月15日](https://twitter.com/TimSweeneyEpic/status/964284402741149698?ref_src=twsrc%5Etfw) > > > 嗯,这并不直接暗示他讨厌 Linux 或者没有积极推动 Linux 的游戏开发 —— 但是只是因为很多历史情况,人们并不真正信任 Epic Games 的决策。所以,他们并不欣赏与 Blender 基金会的联系(即使这个财务帮助是积极的)。 这与财务帮助无关。但是,Epic Games 缺乏良好的声誉(当然是主观的),因此,人们对此的看法是消极的。看看拨款公告后的一些推文: > > 希望不要走向排它……这可能会破坏你的声誉。 > > > * Ray(@ Epicshadow1994)[2019年7月15日](https://twitter.com/Epicshadow1994/status/1150787326626263042?ref_src=twsrc%5Etfw) > > > 我对将来会变成什么样感到怀疑。EPIC 最近一直在采取敌对战术。 > > > * acrid Heartwood(@acrid\_heartwood)[2019年7月15日](https://twitter.com/acrid_heartwood/status/1150789691979030528?ref_src=twsrc%5Etfw) > > > ### 总而言之 你仍然可以[通过 Lutris 在 Linux 上运行 Epic Games](/article-10968-1.html),但这是很单薄的非官方尝试。Epic Games 没有表示有兴趣正式支持该项目。 所以,很明显不是每个人都信任 Epic Games。因此,这个消息带来了各种消极反应。 但是,这笔拨款肯定会帮助 Blender 基金会改善其组织和软件质量。 你怎么看待这件事?请在下面的评论中告诉我们您的想法。 --- via: <https://itsfoss.com/epic-games-blender-grant/> 作者:[Ankush Das](https://itsfoss.com/author/ankush/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[wxy](https://github.com/wxy) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
301
Moved Permanently
null
11,123
命令行快速提示:权限
https://fedoramagazine.org/command-line-quick-tips-permissions/
2019-07-20T00:21:59
[ "权限" ]
https://linux.cn/article-11123-1.html
![](/data/attachment/album/201907/20/002206gmse8odsynsz71ds.jpg) Fedora 与所有基于 Linux 的系统一样,它提供了一组强大的安全特性。其中一个基本特性是文件和文件夹上的*权限*。这些权限保护文件和文件夹免受未经授权的访问。本文将简要介绍这些权限,并向你展示如何使用它们共享对文件夹的访问。 ### 权限基础 Fedora 本质上是一个多用户操作系统,它也有*组*,用户可以是其成员。但是,想象一下一个没有权限概念的多用户系统,不同的登录用户可以随意阅读彼此的内容。你可以想象到这对隐私或安全性并不是很好。 Fedora 上的任何文件或文件夹都分配了三组权限。第一组用于拥有文件或文件夹的*用户*,第二组用于拥有它的*组*,第三组用于其他人,即既不是该文件的用户也不是拥有该文件的组中的用户。有时这被称为*全世界*。 ### 权限意味着什么 每组权限都有三种形式:*读*、*写*和*执行*。其中每个都可以用首字母来代替,即 `r`、`w`、`x`。 #### 文件权限 对于*文件*,权限的含义如下所示: * 读(`r`):可以读取文件内容 * 写(`w`):可以更改文件内容 * 执行(`x`):可以执行文件 —— 这主要用于打算直接运行的程序或脚本 当你对任何文件进行详细信息列表查看时,可以看到这三组权限。尝试查看系统上的 `/etc/services` 文件: ``` $ ls -l /etc/services -rw-r--r--. 1 root root 692241 Apr 9 03:47 /etc/services ``` 注意列表左侧的权限组。如上所述,这些表明三种用户的权限:拥有该文件的用户,拥有该文件的组以及其他人。用户所有者是 `root`,组所有者是 `root` 组。用户所有者具有对文件的读写权限,`root` 组中的任何人都只能读取该文件。最后,其他任何人也只能读取该文件。(最左边的 `-` 显示这是一个常规文件。) 顺便说一下,你通常会在许多(但不是所有)系统配置文件上发现这组权限,它们只由系统管理员而不是普通用户更改。通常,普通用户需要读取其内容。 #### 文件夹(目录)权限 对于文件夹,权限的含义略有不同: * 读(`r`):可以读取文件夹内容(例如 `ls` 命令) * 写(`w`):可以更改文件夹内容(可以在此文件夹中创建或删除文件) * 执行(`x`):可以搜索文件夹,但无法读取其内容。(这听起来可能很奇怪,但解释起来需要更复杂的文件系统细节,这超出了本文的范围,所以现在就这样吧。) 看一下 `/etc/grub.d` 文件夹的例子: ``` $ ls -ld /etc/grub.d drwx------. 2 root root 4096 May 23 16:28 /etc/grub.d ``` 注意最左边的 `d`,它显示这是一个目录或文件夹。权限显示用户所有者(`root`)可以读取、更改和 `cd` 到此文件夹中。但是,没有其他人可以这样做 —— 无论他们是否是 `root` 组的成员。注意,你不能 `cd` 进入该文件夹。 ``` $ cd /etc/grub.d bash: cd: /etc/grub.d: Permission denied ``` 注意你自己的主目录是如何设置的: ``` $ ls -ld $HOME drwx------. 221 paul paul 28672 Jul 3 14:03 /home/paul ``` 现在,注意除了作为所有者之外,没有人可以访问此文件夹中的任何内容。这是特意的!你不希望其他人能够在共享系统上读取你的私人内容。 ### 创建共享文件夹 你可以利用此权限功能轻松创建一个文件夹以在组内共享。假设你有一个名为 `finance` 的小组,其中有几个成员需要共享文档。因为这些是用户文档,所以将它们存储在 `/home` 文件夹层次结构中是个好主意。 首先,[使用 sudo](https://fedoramagazine.org/howto-use-sudo/) 创建一个共享文件夹,并将其设置为 `finance` 组所有: ``` $ sudo mkdir -p /home/shared/finance $ sudo chgrp finance /home/shared/finance ``` 默认情况下,新文件夹具有这些权限。注意任何人都可以读取或搜索它,即使他们无法创建或删除其中的文件: ``` drwxr-xr-x. 2 root root 4096 Jul 6 15:35 finance ``` 对于金融数据来说,这似乎不是一个好主意。接下来,使用 `chmod` 命令更改共享文件夹的模式(权限)。注意,使用 `g` 更改所属组的权限,使用 `o` 更改其他用户的权限。同样,`u` 会更改用户所有者的权限: ``` $ sudo chmod g+w,o-rx /home/shared/finance ``` 生成的权限看起来更好。现在,`finance` 组中的任何人(或用户所有者 `root`)都可以完全访问该文件夹及其内容: ``` drwxrwx---. 2 root finance 4096 Jul 6 15:35 finance ``` 如果其他用户尝试访问共享文件夹,他们将无法执行此操作。太棒了!现在,我们的金融部门可以将文档放在一个共享的地方。 ### 其他说明 还有其他方法可以操作这些权限。例如,你可能希望将此文件夹中的任何文件设置为 `finance` 组所拥有。这需要本文未涉及的其他设置,但请继续关注我们,以了解关于该主题的更多信息。 --- via: <https://fedoramagazine.org/command-line-quick-tips-permissions/> 作者:[Paul W. Frields](https://fedoramagazine.org/author/pfrields/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[MjSeven](https://github.com/MjSeven) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
Fedora, like all Linux based systems, comes with a powerful set of security features. One of the basic features is *permissions* on files and folders. These permissions allow files and folders to be secured from unauthorized access. This article explains a bit about these permissions, and shows you how to share access to a folder using them. ## Permission basics Fedora is by nature a multi-user operating system. It also has *groups*, which users can be members of. But imagine for a moment a multi-user system with no concept of permissions. Different logged in users could read each other’s content at will. This isn’t very good for privacy or security, as you can imagine. Any file or folder on Fedora has three sets of permissions assigned. The first set is for the *user* who owns the file or folder. The second is for the *group* that owns it. The third set is for everyone else who’s not the user who owns the file, or in the group that owns the file. Sometimes this is called the *world*. ## What permissions mean Each set of permissions comes in three flavors — *read*, *write*, and *execute*. Each of these has an initial that stands for the permission, thus *r*, *w*, and *x*. ### File permissions For *files*, here’s what these permissions mean: - Read (r): the file content can be read - Write (w): the file content can be changed - Execute (x): the file can be executed — this is used primarily for programs or scripts that are meant to be run directly You can see the three sets of these permissions when you do a long listing of any file. Try this with the */etc/services* file on your system: $ls -l /etc/services -rw-r--r--. 1 root root 692241 Apr 9 03:47 /etc/services Notice the groups of permissions at the left side of the listing. These are provided in three sets, as mentioned above — for the user who owns the file, for the group that owns the file, and for everyone else. The user owner is *root* and the group owner is the *root* group. The user owner has read and write access to the file. Anyone in the group *root* can only read the file. And finally, anyone else can also only read the file. (The dash at the far left shows this is a regular file.) By the way, you’ll commonly find this set of permissions on many (but not all) system configuration files. They are only meant to be changed by the system administrator, not regular users. Often regular users need to read the content as well. ### Folder (directory) permissions For folders, the permissions have slightly different meaning: - Read (r): the folder contents can be read (such as the *ls*command) - Write (w): the folder contents can be changed (files can be created or erased in this folder) - Execute (x): the folder can be searched, although its contents cannot be read. (This may sound strange, but the explanation requires more complex details of file systems outside the scope of this article. So just roll with it for now.) Take a look at the */etc/grub.d* folder for example: $ls -ld /etc/grub.d drwx------. 2 root root 4096 May 23 16:28 /etc/grub.d Note the *d* at the far left. It shows this is a directory, or folder. The permissions show the user owner (*root*) can read, change, and *cd* into this folder. However, no one else can do so — whether they’re a member of the *root* group or not. Notice you can’t *cd* into the folder, either: $cd /etc/grub.d bash: cd: /etc/grub.d: Permission denied Notice how your own home directory is setup: $ls -ld $HOME drwx------. 221 paul paul 28672 Jul 3 14:03 /home/paul Now, notice how no one, other than you as the owner, can access anything in this folder. This is intentional! You wouldn’t want others to be able to read your private content on a shared system. ## Making a shared folder You can exploit this permissions capability to easily make a folder to share within a group. Imagine you have a group called *finance* with several members who need to share documents. Because these are user documents, it’s a good idea to store them within the */home* folder hierarchy. To get started, [use ](https://fedoramagazine.org/howto-use-sudo/)* sudo* to make a folder for sharing, and set it to be owned by the *finance*group: $ sudo mkdir -p /home/shared/finance $ sudo chgrp finance /home/shared/finance By default the new folder has these permissions. Notice how it can be read or searched by anyone, even if they can’t create or erase files in it: drwxr-xr-x. 2 root finance 4096 Jul 6 15:35 finance That doesn’t seem like a good idea for financial data. Next, use the *chmod* command to change the mode (permissions) of the shared folder. Note the use of *g* to change the owning group’s permissions, and *o* to change other users’ permissions. Similarly, *u* would change the user owner’s permissions: $ sudo chmod g+w,o-rx /home/shared/finance The resulting permissions look better. Now, anyone in the *finance* group (or the user owner *root*) have total access to the folder and its contents: drwxrwx---. 2 root finance 4096 Jul 6 15:35 finance If any other user tries to access the shared folder, they won’t be able to do so. Great! Now our finance group can put documents in a shared place. ## Other notes There are additional ways to manipulate these permissions. For example, you may want any files in this folder to be set as owned by the group *finance*. This requires additional settings not covered in this article, but stay tuned to the Magazine for more on that topic soon. ## Tom Paul – The finance group isn’t shown in the final ls of the /home/shared/finance directory. ## Paul W. Frields @Tom: Thanks, I must have copypasta’d the wrong output. Fixed! ## OlivierS I think when you : sudo chgrp finance /home/shared/finance You should have drwxr-xr-x. 2 root finance 4096 Jul 6 15:35 finance and not drwxr-xr-x. 2 root root 4096 Jul 6 15:35 finance A mistake in images i think but at the end drwxrwx—. 2 root root 4096 Jul 6 15:35 finance seems not to be correct too because in this case just user “root” and group “root” can access “finance” ## Paul W. Frields @OlivierS: Indeed, fixed now as above. ## Chris Rainey Great and timelyarticle Paul!I’ve recently returned to Fedora from Ubuntu due to my concerns about $PRIVACY over $CONVENIENCE in the default umask=0022 of Ubuntu(and Debian). How I missed these defaults in Ubuntu’s /etc/adduser.conf(DIR_MODE=0750) and /etc/login.defs for so many years is a matter of some embarrassment for me and ought to be for Ubuntu/Debian, as well. All one has to do is look signpost’s such as the GDPR or the Equifax data breach for clues as to why ‘open'(world readable) $HOME dirs is a verybad idea for $DEFAULTS.Thank you for bringing the remedy and highlighting the point in your post, as Fedora uses $SANE defaults in this regard. BTW: I started my journey with Linux by purchasing a boxed-set of “RED HAT 8.0” at a CompUSA store for $39.00. Fedora was still just a gleam in some developer’s eyes. ## Chris Rainey Errrrr… :%s/DIR_MODE=0750/DIR_MODE=0755/g , above, as 0750 is my change to the default of 0755. :%s/look signpost’s/look to signpost’s/g , above, proof-b4-post! ## Jarek I am very grateful for these articles. Could the next advanced article also explain the use of numbers with the permission system? A person can see those a lot when searching for some solutions (or reading specfiles 🙂 ) regarding the permissions ## Yuri Oliveira I would add that we can use numbers to change permissions: read: 4 write: 2 execute: 1 And we would sum up the permissions for each category (user, group, others). For a permission, we’d have rwx = 4+2+1 = 7 r-x = 4+0+1 = 5 r-x = 4+0+1 = 5 So, if you’d like to change the permissions of the shared folder from (755) to (700), that would be: ## NotEnough And what about 2775 ? ## we4 and create finance user and change own chown finance.finance ## fdelapena Thanks! Another interesting permissions feature not quite popular is ACL (getfacl/setfacl) for fine-grained control for users and groups.
11,124
Linux 入门十法
https://opensource.com/article/19/7/ways-get-started-linux
2019-07-20T06:16:00
[ "Linux" ]
https://linux.cn/article-11124-1.html
> > 想要进入 Linux 之门,试试这十个方法。 > > > ![](/data/attachment/album/201907/20/061809wwkmb51vqookoqq5.jpg) 文章《[什么是 Linux 用户?](https://opensource.com/article/19/6/what-linux-user)》的作者 Anderson Silva 明确表示,现今人们使用 Linux(在某种程度上)就像使用 Windows 一样,只要你对“使用 Linux”这个事情定义得足够广义。尽管如此,如果你的生活中没有太多的使用 Linux 的机会,现在正是以前所未有的方式尝试 Linux 的好时机。 以下是 Linux 入门的十种方法。你可以试试其中一个或者全部试试。 ### 1、加入免费 shell 计划 ![Free shell screenshot](/data/attachment/album/201907/20/061648howbfjuooytw4t4t.png "Free shell screenshot") 有很多人在用不上的服务器上运行 Linux (请记住,“Linux 服务器”可以是从最新的超级计算机到丢弃的、已经用了 12 年的笔记本电脑中的任何一个)。为了充分利用多余的计算机,许多管理员用这些备用的机器提供了免费的 shell 帐户。 如果你想要登录到 Linux 终端中学习命令、shell 脚本、Python 以及 Web 开发的基础知识,那么免费的 shell 帐户是一种简单、免费的入门方式。下面是一个可以体验一下的简短列表: * [Freeshell.de](https://freeshell.de) 是一个自 2002 年以来一直在线服务的公用 Linux 系统。你可以通过 SSH、IPv6 和 OpenSSL 进行访问,以获得 Linux shell 体验,并且可以使用 MySQL 数据库。 * [Blinkenshell](https://blinkenshell.org/wiki/Start) 提供了一个学习 Unix、使用 IRC、托管简单网站和共享文件的 Linux shell。它自 2006 年以来一直在线服务。 * [SDF 公用 Unix 系统](https://sdf.org/)成立于 1987 年,提供了免费的 NetBSD 账户。当然,NetBSD 不是 Linux,但它是开源的 Unix,因此它提供了类似的体验。它也有几个自制应用程序,因此它不但有普通的免费 shell,还提供了老派 BBS。 免费 shell 帐户常会受到滥用,因此你表现出的可信程度和积极参与协作的意愿越多,你的体验就越好。你可以通过专门请求或小额捐赠来证明你的诚意,通常可以访问数据库引擎、编译器和高级编程语言。你还可以要求安装其他软件或库,但需经管理员批准。 #### 如何使用 公用 shell 帐户是尝试真正的 Linux 系统的好方法。你无法获得 root 权限这一事实意味着你可以学习本地软件管理,而无需做更多的维护工作。你可以做很多实际操作,以完成真正的工作,尽管它们对于学习关键任务还不够。 ### 2、试试 Windows WSL 2 里面的 Linux 不管你信不信,微软从 2019 年 6 月开始在 Windows 里面带上了 Linux,这意味着你可以从 Windows 运行 Linux 应用程序,这是 [Windows 里的 Linux 子系统](https://devblogs.microsoft.com/commandline/wsl-2-is-now-available-in-windows-insiders/)的第二版(WSL 2)。虽然它主要针对开发人员,但 Windows 用户可以发现 WSL 2 是一个来自于他们熟悉的桌面上的 Linux 环境,而没有被任何虚拟化占用额外资源。这是一个以进程方式运行在 Windows 机器上的 Linux。现阶段,它仍然是一个新的动向和正在进行中的工作,因此它可能会发生变化。如果你试图用它承担重任,你可能会遇到一两个错误,但是如果你只是想入门 Linux、学习一些命令,并感受在基于文本的环境如何完成工作,那么 WSL 2 可能正是你所需要的。 #### 如何使用 WSL 还没有明确的用途或目的,但它在 Windows 机器上提供了 Linux 环境。你可以获得 root 访问权限,并可以运行 Linux 发行版和应用程序,因此这是一种简单而无缝的学习方式。但是,即使 WSL *是Linux*,它也不能给你典型的 Linux 体验。它是由 Windows 提供的 Linux,而这不太会是你在现实世界中遇到的情况。WSL 是一个开发和教育工具,但如果你可以使用它,那么你应该试试它。 ### 3、把 Linux 放到可启动的 U 盘上 ![Porteus Linux](/data/attachment/album/201907/20/061649e0oeyo322vt2tq2t.jpg "Porteus Linux") 便携 Linux 可以安装到 U 盘上随身携带,并用该 U 盘启动你遇到的任何计算机。你可以获得个性化的 Linux 桌面,而无需担心所用于启动的主机上的数据。该计算机上原有的系统不会与你的 Linux 系统相接触,并且你的 Linux 操作系统也不会影响计算机。它非常适合酒店商务中心、图书馆、学校的公共计算机,或者只是给自己一个不时启动 Linux 的借口。 与许多其他快速获得的 Linux shell 不同,此方法为你提供了一个完整而强大的 Linux 系统,包括桌面环境,可访问你需要的任何软件以及持久的数据存储。 这个系统永远不会改变。你要保存的任何数据都将写入压缩的文件系统中,然后在引导时将其作为覆盖层应用于该系统。这种灵活性允许你选择是以持久模式启动,将所有数据保存回 U 盘;还是以临时模式启动,以便一旦关闭电源,你所做的一切都会消失。换句话说,你可以将其用作不受信任的计算机上的安全信息亭或你信任的计算机上的便携式操作系统。 你可以尝试很多 [U 盘发行版](/article-11040-1.html),有些带有精简的桌面环境,适用于低功耗计算机,而另一些带有完整的桌面环境。我偏爱 [Porteus](http://porteus.org) Linux。在过去的八年里,我每天都把它放在我的钥匙链上,在商务旅行中使用它作为我的主要计算平台,如果在工作场所或家中计算机发生问题,它也会用作工具盘。它是一个可靠而稳定的操作系统,有趣且易于使用。 在 Mac 或 Windows 上,下载 [Fedora Media Writer](https://getfedora.org/en/workstation/download/) 以创建你下载的任何便携式发行版的可启动 U 盘。 #### 如何使用 从 U 盘启动一个 “实时 Linux” 可提供完整的 Linux 发行版环境。虽然数据存储与你安装到硬盘驱动器的系统略有不同,但其它的所有内容都与你在 Linux 桌面上所期望的一样。在便携式 Linux 操作系统上你几乎没有什么不能做的,所以在你的钥匙串上挂上一个以解锁你遇到的每台计算机的全部潜力吧。 ### 4、在线游览 ![Linux tour screenshot](/data/attachment/album/201907/20/061649wubi8bbbpkbbggtl.jpg "Linux tour screenshot") Ubuntu 的某个人想到了在浏览器中托管 Ubuntu GNOME 桌面的好主意。如果想要自己尝试一下,可以打开 Web 浏览器并导航到 [tour.ubuntu.com](http://tour.ubuntu.com/en/#)。你可以选择要演示的活动,也可以跳过单个课程并单击 “<ruby> 四处看看 <rt> Show Yourself Around </rt></ruby>” 按钮。 即使你是 Linux 桌面的新用户,你也可能会发现“四处看看”功能比你想象的更还简单。在线游览中,你可以四处看看,查看可用的应用程序,以及查看典型的默认 Linux 桌面。你不能在 Firefox 中调整设置或启动另一个在线游览(这是我尝试过的第一件事),虽然你可以完成安装应用程序的动作,但你无法启动它们。但是,如果你之前从未使用过 Linux 桌面,并且想要看到各种新奇的东西,那这就是一场旋风之旅。 #### 如何使用 在线游览真的只是一次旅行。如果你从未见过 Linux 桌面,那么这是一个了解它的情况的机会。这不是一个正式的使用,而是一个吸引过客的展示。 ### 5、在浏览器中用 JavaScript 运行 Linux ![JSLinux](/data/attachment/album/201907/20/061650vo6dr2bodrm6cd76.jpg "JSLinux") 就在不久之前,虚拟化的计算成本还很高,还仅限于使用先进的硬件的用户。而现在虚拟化已被优化到可以由 JavaScript 引擎执行的程度,这要归功于 Fabrice Bellard,它是优秀的开源 [QEMU](https://www.qemu.org) 机器仿真器和虚拟器的创建者。 Bellard 还启动了 JSLinux 项目,该项目允许你在浏览器中运行 Linux 和其他操作系统,这算是闲暇时间的一个乐趣。它仍然是一个实验性项目,但它是一个技术奇迹。打开 Web 浏览器导航到 [JSLinux](https://bellard.org/jslinux/) 页面,你可以启动基于文本的 Linux shell 或精简的图形 Linux 环境。你可以上传和下载文件到 JSLinux 主机上或(在理论上可以)将文件发送到一个网络备份位置,因为 JSLinux 可以通过 VPN 套接字访问互联网(尽管上限速度取决于 VPN 服务)。 #### 如何使用 你不会在 JSLinux 上正经使用多少时间,这个环境可能太不寻常了,无法学习 Linux 正常工作的广泛课程。但是,如果你厌倦了在一台普通的 PC 上运行 Linux 并想在一个真正独特的平台上试用 Linux,那么 JSLinux 就属于这种。 ### 6、阅读关于它的书 并非每种 Linux 体验都要用到计算机。也许你是那种喜欢在开始新事物之前保持距离先观察和研究的人,或者你可能还不清楚 “Linux” 所包含的内容,或者你喜欢全情投入其中。关于 Linux 如何工作、运行 Linux 的方式以及 Linux 世界中有什么,有很多书可以读。 你越熟悉开源世界,就越容易理解常用术语,将城市神话与实际经验区分开来。我们不时会发布[图书清单](https://opensource.com/article/19/1/tech-books-new-skils),但我的最爱之一是 Hazel Russman 的《[The Charm of Linux](http://www.lulu.com/shop/hazel-russman/the-charm-of-linux/paperback/product-21229401.html)》。这是一个从不同角度巡览 Linux 的过程,是由一位独立作者在发现 Linux 时兴奋之余写作的。 #### 如何使用 没有什么能比一本好书更好。这是体验 Linux 的最不传统的方法,但对于喜欢印刷文字的人来说,它既舒适又有效。 ### 7、弄块树莓派 ![Raspberry Pi 4](/data/attachment/album/201907/20/061650fhgjcel18bpz1kya.jpg "Raspberry Pi 4") 如果你正在使用[树莓派](https://opensource.com/resources/raspberry-pi),那么你就正在运行 Linux。Linux 和低功耗计算很容易上手。关于树莓派的好处,除了价格低于 100 美元之外,它的[网站](https://www.raspberrypi.org/)是专为教育而设计的。你可以了解树莓派所能做的一切,当你了解之后,就知道了 Linux 可以为你做些什么。 #### 如何使用 树莓派被设计为低功耗计算机。这意味着你不能像过去那样做那么多的多任务处理,但这是一种避免不堪重负的方便方法。树莓派是学习 Linux 及其附带的所有可能性的好方法,它是发现环保、小型、简化计算能力的有趣方式。并且一定要关注 Opensource.com 上的[提示](https://opensource.com/article/19/3/raspberry-pi-projects)、[技巧](https://opensource.com/article/19/3/piflash)和[有趣的](https://opensource.com/article/19/3/gamepad-raspberry-pi)[活动](https://opensource.com/life/16/3/make-music-raspberry-pi-milkytracker),特别是在每年三月份的树莓派之周的期间。 ### 8、赶上容器热潮 如果你从事于神话般的[云服务](https://opensource.com/resources/cloud)的后端工作,那么你已经听说过容器热潮。虽然你可以在 Windows、Azure、Mac 和 Linux 上运行 Docker 和 Kubernetes,但你可能不知道容器本身就是 Linux。云计算应用和基础设施实际上是精简的 Linux 系统,部分虚拟化,部分基于裸机。如果启动容器,则会启动微型的超特定的 Linux 发行版。 容器与虚拟机或物理服务器[不同](https://opensource.com/article/19/6/how-ssh-running-container)。它们不打算用作通用操作系统。但是,如果你在容器中进行开发,你可以停下来四处打量一下,你将了解到 Linux 系统的结构、保存重要文件的位置以及最常见的命令。你甚至可以[在线尝试容器](https://linuxcontainers.org/lxd/try-it/),你可以在我的文章中[深入到 Linux 容器的背后](https://opensource.com/article/18/11/behind-scenes-linux-containers)了解它们如何工作的。 #### 如何使用 根据设计,容器特定于一个单一任务,但它们是 Linux,因此它们非常灵活。你可以如你预期的使用它们,也可以在你的 Linux 实验当中将容器构建到大部分完整系统中。它虽然不提供桌面 Linux 体验,但它是完整的 Linux 体验。 ### 9、以虚拟机方式安装 Linux 虚拟化是尝试操作系统的简便方法,[VirtualBox](https://virtualbox.org) 是一种很好的开源虚拟化方法。VirtualBox 可以在 Windows 和 Mac 上运行,因此你可以将 Linux 安装为虚拟机(VM)并使用它,就好像它只是一个应用程序一样。如果你不习惯安装操作系统,VirtualBox 也是一种尝试 Linux 的非常安全的方式,而不会意外地将其安装覆盖在你通常的操作系统上。 #### 如何使用 将 Linux 作为虚拟机运行既方便又简单,既可以作为试运行使用,也可以在需要 Linux 环境时进行双启动或重启进入。它功能齐全,因为它使用虚拟硬件,宿主操作系统负责驱动你的外围设备。将 Linux 作为虚拟机运行的唯一缺点主要是心理上的。如果你打算使用 Linux 作为主要操作系统,但最终默认在宿主操作系统上做除了特定于 Linux 的大多数任务,那么虚拟机就会让你失望。否则,虚拟机是现代技术的胜利,在 VirtualBox 中使用 Linux 可以为你提供 Linux 所提供的所有最佳功能。 ### 10、安装一个 Linux ![Fedora Silverblue](/data/attachment/album/201907/20/061651i9wnnnnnz0lpi4ee.png "Fedora Silverblue") 如果对上述方式有疑问,那么总会有传统的方式。如果你想给予 Linux 应有的关注,你可以下载 Linux,将安装程序刻录到 U 盘(或 DVD,如果你更喜欢光学介质的话),并将其安装在你的计算机上。Linux 是开源的,所以任何想要花时间打包 Linux 的人都可以分发 Linux,并且可以将所有可用的部分分配到通常称为发行版的内容中。无论问哪一个 Linux 用户什么发行版是“最好的”,你必然都会得到一个不同的答案(主要是因为这个术语“最佳”通常是尚未定义的)。大多数人都认可:你应该使用适合你的 Linux 发行版,这意味着你应该测试一些流行的发行版,并坚持使你的计算机按照你期望的行为行事。这是一种务实和功能性的方法。例如,如果发行版无法识别你的网络摄像头而你希望它可以正常工作,则可以使用一个可识别该网络摄像头的发行版。 如果你之前从未安装过操作系统,你会发现大多数 Linux 发行版都包含一个友好且简单的安装程序。只需下载一个发行版(它们以 ISO 文件提供),然后下载 [Fedora Media Writer](https://getfedora.org/en/workstation/download/) 来创建一个可启动的安装 U 盘。 #### 如何使用 安装 Linux 并将其用作操作系统是迈向熟悉它的一步。怎么使用它都可以。你可能会发现一些你从未了解过的所需的必备功能,你可能会比你想象的更多地了解计算机,并且可能会改变你的世界观。你使用一个 Linux 桌面,或者是因为它易于下载和安装,或者是因为你想要削弱公司中某些人的霸主地位,或者只是因为它可以帮助你完成工作。 无论你的原因是什么,只需尝试使用上面这些任何(或所有)这些方式。 --- via: <https://opensource.com/article/19/7/ways-get-started-linux> 作者:[Seth Kenlon](https://opensource.com/users/seth/users/don-watkins) 选题:[lujun9972](https://github.com/lujun9972) 译者:[wxy](https://github.com/wxy) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
The article * What is a Linux user?* by Anderson Silva made it clear that these days people are as likely to use Linux (in some way) as they are to use Windows, as long as your definition of "using Linux" is sufficiently broad. Still, if you don't have enough Linux in your life, now is a great time to try Linux in a way you've never tried before. Here are 10 ways to get started with Linux. Try one or try them all. ## 1. Join a free shell ![Free shell screenshot Free shell screenshot](https://opensource.com/sites/default/files/uploads/freeshell.png) There are a lot of people running Linux with more Linux servers than they know what to do with (keep in mind that a "Linux server" can be anything from the latest supercomputer to a discarded 12-year-old laptop). To put excess computers to good use, many administrators open their spare boxes up for free shell accounts. If you want to log time in a Linux terminal to learn commands, shell scripting, Python, and the basics of web development, a free shell account is an easy, no-cost way to get started. Here's a short list to try: [Freeshell.de](https://freeshell.de)is a public access Linux system that's been online since 2002. You get SSH access (to experiment in a Linux shell), IPv6, and OpenSSL, and you can request a MySQL database.[Blinkenshell](https://blinkenshell.org/wiki/Start)provides a Linux shell to learn Unix, use IRC, host simple websites, and share files. It's been online since 2006.[SDF Public Access Unix System](https://sdf.org/)was established in 1987 to offer free NetBSD accounts. NetBSD isn't Linux, of course, but it's open source Unix, so it offers a similar experience. It also has several homebrewed applications, so it straddles the line between old-school BBS and plain-old free shell. Free shell accounts are subject to a lot of abuse, so the more you demonstrate trustworthiness and willingness to participate in the goings-on of the collective, the better your experience. You can often gain access (through a special request or a small donation to demonstrate goodwill) to database engines, compilers, and advanced programming languages. You can also ask for additional software or libraries to be installed, subject to administrator approval. ### How to use it Public access shell accounts are a great way to try out a real Linux system. The fact that you don't get root access means you get to learn local software management without having to mow your own lawn or fix leaky faucets. You can do just enough real-life activities to make them viable for getting real work done, although they're not reliable enough to be mission critical. ## 2. Try Linux on Windows with WSL 2 Believe it or not, Microsoft started shipping Linux with Windows as of June 2019, meaning you can run Linux applications from Windows as the second iteration of the [Windows Subsystem for Linux](https://devblogs.microsoft.com/commandline/wsl-2-is-now-available-in-windows-insiders/) (WSL 2). While it's primarily aimed at developers, Windows users will find WSL 2 to be a Linux environment from the comfort of a familiar desktop without any virtualization taking up extra resources. This is Linux running as a process on your Windows machine. At this time, it's still a new initiative and a work in progress, so it's subject to change. If you try to push it too far too soon, you're likely to encounter a bug or two, but if you're just looking to get started with Linux, learn some commands, and get a feel for getting serious work done in a text-based environment, WSL 2 may be exactly what you need. ### How to use it WSL doesn't yet have a clear pathway or purpose, but it provides a Linux environment on your Windows machine. You get root access and can run Linux distributions and applications, so it's an easy and seamless way to learn. However, even though WSL *is Linux*, it's not exactly a typical Linux experience. It's Linux provided by Windows, and that's not what you're likely to encounter in the real world. WSL is a development and educational tool, but if it's available to you, then you should use it. ## 3. Carry Linux on a bootable thumb drive ![Porteus Linux Porteus Linux](https://opensource.com/sites/default/files/uploads/porteus.jpg) Carry Linux, installed to a USB thumb drive, everywhere you go, and boot any computer you encounter from that thumb drive. You get a personalized Linux desktop, and you don't have to worry about the data on the host computer you've booted from. The computer doesn't touch your Linux OS, and your Linux OS doesn't affect the computer. It's ideal for public computers at hotel business centers, libraries, schools, or just to give yourself an excuse to boot into Linux from time to time. Unlike many other quick hacks to get to a Linux shell, this method offers you a full and robust Linux system, complete with a desktop, access to whatever software you need, and persistent data storage. The system never changes. Any data you want to save is written into a compressed filesystem, which is then applied as an overlay to the system when you boot. This flexibility allows you to choose whether to boot in persistent mode, saving all data back to the thumb drive, or in an ephemeral mode, so everything you do disappears once you power down. In other words, you can use this as a secure kiosk on an untrusted computer or as your portable OS on computers you trust. There are many [thumb drive distributions](https://opensource.com/article/19/6/tiny-linux-distros-you-have-try) you can try, some with minimal desktop environments for low-powered computers and others with a full desktop. I'm partial to [Porteus](http://porteus.org) Linux. I've carried it on my keychain every day for the past eight years, using it as my primary computing platform during business travel as well as a utility disk if computer problems strike at work or home. It's a reliable and stable operating system that's fun and easy to use. On Mac or Windows, download the [Fedora Media Writer](https://getfedora.org/en/workstation/download/) to create a bootable thumb drive of whatever portable distribution you download. ### How to use it Booting a "live Linux" from a USB thumb drive provides a complete Linux distribution. While data storage is done a little differently from a system you install to a hard drive, everything else is as you'd expect from a Linux desktop. There's little you can't do on a portable Linux OS, so install one on your keychain to unlock the full potential of every computer you encounter. ## 4. Take an online tour ![Linux tour screenshot Linux tour screenshot](https://opensource.com/sites/default/files/uploads/linux_tour.jpg) Somebody over at Ubuntu thought up the brilliant idea of hosting an Ubuntu GNOME desktop in the browser. To try it out for yourself, open a web browser and navigate to [tour.ubuntu.com](http://tour.ubuntu.com/en/#). You can select which activity you want demonstrated, or you can skip individual lessons and click the Show Yourself Around button. Even if you're new to the Linux desktop, you might find showing yourself around is more familiar than you might expect. From the online tour, you can look around, see what applications are available, and view what a typical default Linux desktop is like. You can't adjust settings or launch another tour in Firefox (it was the first thing I tried, naturally), and while you can go through the motions of installing applications, you can't launch them. But if you've never used a Linux desktop before and you want to see what all the fuss is about, this is the whirlwind tour. ### How to use it An online tour is truly just a tour. If you've never seen a Linux desktop in action, this is an opportunity to get a glimpse of what it's like. Not intended for serious work, this is an attractive display to entice passers-by. ## 5. Run Linux in the browser with JavaScript ![JSLinux JSLinux](https://opensource.com/sites/default/files/uploads/jslinux.jpg) Not so long ago, virtualization used to be computationally expensive, limited to users with premium hardware. Now virtualization has been optimized to the point that it can be performed by a JavaScript engine, thanks to Fabrice Bellard, the creator of the excellent and open source [QEMU](https://www.qemu.org) machine emulator and virtualizer. Bellard also started the JSLinux project, which allows you to run Linux and other operating systems in a browser, in his spare time for fun. It's still an experimental project, but it's a technical marvel. Open a web browser to the [JSLinux](https://bellard.org/jslinux/) page, and you can boot a text-based Linux shell or a minimal graphical Linux environment. You can upload and download files to your JSLinux host or (theoretically) send your files to a network backup location, because JSLinux has access to the internet through a VPN socket (although at capped speeds, dependent upon the VPN service). ### How to use it You won't be doing serious work on JSLinux anytime soon, and the environment is arguably too unusual to learn broad lessons about how Linux normally works. If, however, you're bored of running Linux on a plain old PC and would like to try Linux on a truly distinctive platform, JSLinux is in a class all its own. ## 6. Read about it Not every Linux experience happens on the computer. Maybe you're the sort of person who likes to keep your distance, observe, and do your research before jumping into something new, or maybe you're just not clear yet on what "Linux" encompasses, or maybe you love full immersion. There's a wealth of information to read about how Linux works, what it's like to run Linux, and what's happening in the Linux world. The more you get familiar with the world of open source, the easier it is to understand the common lingo and to separate urban myth from actual experience. We publish [book lists](https://opensource.com/article/19/1/tech-books-new-skils) from time to time, but one of my favorites is [ The Charm of Linux](http://www.lulu.com/shop/hazel-russman/the-charm-of-linux/paperback/product-21229401.html) by Hazel Russman. It's a tour through Linux from many different angles, written by an independent author out of excitement over discovering Linux. ### How to use it Nothing beats kicking back with a good book. This is the least traditional method of experiencing Linux, but for people who love the printed word, it's both comforting and effective. ## 7. Get a Raspberry Pi ![Raspberry Pi 4 Raspberry Pi 4](https://opensource.com/sites/default/files/uploads/raspberry-pi-4-case.jpg) If you're using a [Raspberry Pi](https://opensource.com/resources/raspberry-pi), you're running Linux. It's that easy to get started with Linux and low-powered computing. The great thing about the Pi, aside from it costing well under $100, is that its [website](https://www.raspberrypi.org/) is designed for education. You can learn all about what the Pi does, and while you're at it, all about what Linux can do for you. ### How to use it The Pi is, by design, a low-powered computer. That means you can't do as much multitasking as you might be used to, but that's a convenient way to keep yourself from getting overwhelmed. The Raspberry Pi is a great way to learn Linux and all of the possibilities that come with it, and it's a fun way to discover the power of eco-friendly, small-form-factor, simplified computing. And be sure to stay tuned to Opensource.com—especially during Pi Week every March—for [tips](https://opensource.com/article/19/3/raspberry-pi-projects) and [tricks](https://opensource.com/article/19/3/piflash) and [fun](https://opensource.com/article/19/3/gamepad-raspberry-pi) [activities](https://opensource.com/life/16/3/make-music-raspberry-pi-milkytracker). ## 8. Climb aboard the container craze If you work near the back end of the mythical [cloud](https://opensource.com/resources/cloud), then you've heard about the container craze. While you can run Docker and Kubernetes on Windows, Azure, Mac, and Linux, you may not know that the containers themselves are Linux. Cloud computing apps and infrastructure are literally minimal Linux systems that run partly virtualized and partly on bare metal. If you launch a container, you are launching a miniature, hyper-specific Linux distribution. Containers are [different](https://opensource.com/article/19/6/how-ssh-running-container) than virtual machines or physical servers. They're not intended to be used as a general-purpose operating system. However, if you are developing in a container, you might want to pause and have a look around. You'll get a glimpse of how a Linux system is structured, where important files are kept, and which commands are the most common. You can even [try a container online](https://linuxcontainers.org/lxd/try-it/), and you can read all about how they work in my article about going [behind the scenes with Linux containers](https://opensource.com/article/18/11/behind-scenes-linux-containers). ### How to use it Containers are, by design, specific to a single task, but they're Linux, so they're extremely flexible. You can use them as they're intended, or you can build a container out into a mostly complete system for your Linux experiments. It's not a desktop Linux experience, but it's a full Linux experience. ## 9. Install Linux as a VM Virtualization is the easy way to try an operating system, and [VirtualBox](https://virtualbox.org) is a great open source way to virtualize. VirtualBox runs on Windows and Mac, so you can install Linux as a virtual machine (VM) and use it almost as if it were just another application. If you're not accustomed to installing an operating system, VirtualBox is also a very safe way to try Linux without accidentally installing it over your usual OS. ### How to use it Running Linux as a VM is convenient and easy, either as a trial run or an alternative to dual-booting or rebooting when you need a Linux environment. It's full-featured and, because it uses virtual hardware, the host operating system drives your peripherals. The only disadvantage to running Linux as a virtual machine is primarily psychological. If you intend to use Linux as your main OS, but end up defaulting to the host OS for all but the most Linux-specific tasks, then the VM has failed you. Otherwise, a VM is a triumph of modern technology, and using Linux in VirtualBox provides you with all the best features Linux has to offer. ## 10. Install it ![Fedora Silverblue Fedora Silverblue](https://opensource.com/sites/default/files/uploads/fedora-silverblue.png) When in doubt, there's always the traditional route. If you want to give Linux the attention it deserves, you can download Linux, burn the installer to a thumb drive (or a DVD, if you prefer optical media), and install it on your computer. Linux is open source, so it can be distributed by anyone who wants to take the time to bundle Linux—and all the bits and pieces that make it usable—into what is commonly called a *distribution* (or "distro") for short. Ask any Linux user, and you're bound to get a different answer for which distribution is "best" (mostly because the term "best" is often left undefined). Most people admit that you should use the Linux distribution that works for you, meaning that you should test a few popular distros and settle on the one that makes your computer behave as you expect it to behave. This is a pragmatic and functional approach. For example, should a distribution fail to recognize your webcam and you want your webcam to work, then use a distribution that recognizes your webcam. If you've never installed an operating system before, you'll find most Linux distributions include a friendly and easy installer. Just download a distribution (they are delivered as ISO files), and download the [Fedora Media Writer](https://getfedora.org/en/workstation/download/) to create a bootable installation thumb drive. ### How to use it Installing Linux and using it as an operating system is a step toward becoming familiar and familial with it. There's no wrong way to use it. You might discover must-have features you never knew you needed, you might learn more about computers than you ever imagined you could, and you may shift in your worldview. Or you might use a Linux desktop because it was easy to download and install, or because you want to cut out the middleman of some corporate overlord, or because it helps you get your work done. Whatever your reason, just give Linux a try with any (or all) of these options. ## 7 Comments
11,125
如何在 MacOS 上安装 Elasticsearch
https://opensource.com/article/19/7/installing-elasticsearch-macos
2019-07-20T06:50:15
[ "Elasticsearch" ]
https://linux.cn/article-11125-1.html
> > 安装 Elasticsearch 很复杂!以下是如何在 Mac 上安装。 > > > ![](/data/attachment/album/201907/20/064958dnnwvp8wqzqq4fm2.jpg) [Elasticsearch](https://www.getapp.com/it-management-software/a/qbox-dot-io-hosted-elasticsearch/) 是一个用 Java 开发的开源全文搜索引擎。用户上传 JSON 格式的数据集。然后,Elasticsearch 在向集群索引中的文档添加可搜索的引用之前先保存原始文档。 Elasticsearch 创建还不到九年,但它是最受欢迎的企业搜索引擎。Elastic 在 2019 年 6 月 25 日发布了最新的更新版本 7.2.0。 [Kibana](https://www.elastic.co/products/kibana) 是 Elasticsearch 的开源数据可视化工具。此工具可帮助用户在 Elasticsearch 集群的内容索引之上创建可视化。 [Sunbursts](https://en.wikipedia.org/wiki/Pie_chart#Ring)、[地理空间数据地图](https://en.wikipedia.org/wiki/Spatial_analysis)、[关系分析](https://en.wikipedia.org/wiki/Correlation_and_dependence)和实时数据面板只是其中几个功能。并且由于 Elasticsearch 的机器学习能力,你可以了解哪些属性可能会影响你的数据(如服务器或 IP 地址)并查找异常模式。 在上个月的 [DevFest DC](https://www.devfestdc.org/) 中,Booz Allen Hamilton 的首席数据科学家 [Summer Rankin 博士](https://www.summerrankin.com/about)将 TED Talk 的内容数据集上传到了 Elasticsearch,然后使用 Kibana 快速构建了面板。出于好奇,几天后我去了一个 Elasticsearch 聚会。 由于本课程针对的是新手,因此我们从第一步开始:在我们的笔记本上安装 Elastic 和 Kibana。如果没有安装这两个包,我们无法将莎士比亚的文本数据集作为测试 JSON 文件创建可视化了。 接下来,我将分享在 MacOS 上下载、安装和运行 Elasticsearch V7.1.1 的分步说明。这是我在 2019 年 6 月中旬参加 Elasticsearch 聚会时的最新版本。 ### 下载适合 MacOS 的 Elasticsearch 1、进入 <https://www.elastic.co/downloads/elasticsearch>,你会看到下面的页面: ![The Elasticsearch download page.](/data/attachment/album/201907/20/065017vv8c61wv8kvvvnov.png "The Elasticsearch download page.") 2、在**下载**区,单击 **MacOS**,将 Elasticsearch TAR 文件(例如,`elasticsearch-7.1.1-darwin-x86_64.tar`)下载到 `Downloads` 文件夹。 3、双击此文件并解压到自己的文件夹中(例如,`elasticsearch-7.1.1`),这其中包含 TAR 中的所有文件。 **提示**:如果你希望 Elasticsearch 放在另一个文件夹中,现在可以移动它。 ### 在 MacOS 命令行中运行 Elasticsearch 如果你愿意,你可以只用命令行运行 Elasticsearch。只需遵循以下流程: 1、[打开终端窗口](https://support.apple.com/en-ca/guide/terminal/welcome/mac)。 2、在终端窗口中,输入你的 Elasticsearch 文件夹。例如(如果你移动了程序,请将 `Downloads` 更改为正确的路径): ``` $ cd ~Downloads/elasticsearch-1.1.0 ``` 3、切换到 Elasticsearch 的 `bin` 子文件夹,然后启动该程序。例如: ``` $ cd bin $ ./elasticsearch ``` 这是我启动 Elasticsearch 1.1.0 时命令行终端显示的一些输出: ![Terminal output when running Elasticsearch.](/data/attachment/album/201907/20/065020fbpv5zwske8gkwop.png "Terminal output when running Elasticsearch.") **注意**:默认情况下,Elasticsearch 在前台运行,这可能会导致计算机速度变慢。按 `Ctrl-C` 可以阻止 Elasticsearch 运行。 ### 使用 GUI 运行 Elasticsearch 如果你更喜欢点击操作,你可以像这样运行 Elasticsearch: 1、打开一个新的 **Finder** 窗口。 2、在左侧 Finder 栏中选择 `Downloads`(如果你将 Elasticsearch 移动了另一个文件夹,请进入它)。 3、打开名为 `elasticsearch-7.1.1` 的文件夹(对于此例)。出现了八个子文件夹。 ![The elasticsearch/bin menu.](/data/attachment/album/201907/20/065021iev3qa56j43jj36a.png "The elasticsearch/bin menu.") 4、打开 `bin` 子文件夹。如上面的截图所示,此子文件夹中有 20 个文件。 5、单击第一个文件,即 `elasticsearch`。 请注意,你可能会收到安全警告,如下所示: ![The security warning dialog box.](/data/attachment/album/201907/20/065021w1ze3cjneqctbc00.jpg "The security warning dialog box.") 这时候要打开程序需要: 1. 在警告对话框中单击 **OK**。 2. 打开**系统偏好**。 3. 单击**安全和隐私**,打开如下窗口: ![Where you can allow your computer to open the downloaded file.](/data/attachment/album/201907/20/065021c61nyx7hlb5h2vq7.jpg "Where you can allow your computer to open the downloaded file.") 4. 单击**永远打开**,打开如下所示的确认对话框: ![Security confirmation dialog box.](/data/attachment/album/201907/20/065022xpap8g88w3md9uos.jpg "Security confirmation dialog box.") 5. 单击**打开**。会打开一个终端窗口并启动 Elasticsearch。 启动过程可能需要一段时间,所以让它继续运行。最终,它将完成,你最后将看到类似这样的输出: ![Launching Elasticsearch in MacOS.](/data/attachment/album/201907/20/065022eigxpzvn31n3gzni.png "Launching Elasticsearch in MacOS.") ### 了解更多 安装 Elasticsearch 之后,就可以开始探索了! 该工具的 [Elasticsearch:开始使用](https://www.elastic.co/webinars/getting-started-elasticsearch?ultron=%5BB%5D-Elastic-US+CA-Exact&blade=adwords-s&Device=c&thor=elasticsearch&gclid=EAIaIQobChMImdbvlqOP4wIVjI-zCh3P_Q9mEAAYASABEgJuAvD_BwE)指南会根据你的目标指导你。它的介绍视频介绍了在 [Elasticsearch Service](https://info.elastic.co/elasticsearch-service-gaw-v10-nav.html?ultron=%5BB%5D-Elastic-US+CA-Exact&blade=adwords-s&Device=c&thor=elasticsearch%20service&gclid=EAIaIQobChMI_MXHt-SZ4wIVJBh9Ch3wsQfPEAAYASAAEgJo9fD_BwE) 上启动托管集群,执行基本搜索查询,通过创建、读取、更新和删除(CRUD)REST API 等方式操作数据的步骤。 本指南还提供文档链接,开发控制台命令,培训订阅以及 Elasticsearch Service 的免费试用版。此试用版允许你在 AWS 和 GCP 上部署 Elastic 和 Kibana 以支持云中的 Elastic 集群。 在本文的后续内容中,我们将介绍在 MacOS 上安装 Kibana 所需的步骤。此过程将通过不同的数据可视化将你的 Elasticsearch 查询带到一个新的水平。 敬请关注! --- via: <https://opensource.com/article/19/7/installing-elasticsearch-macos> 作者:[Lauren Maffeo](https://opensource.com/users/lmaffeo/users/don-watkins) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
[Elasticsearch](https://www.getapp.com/it-management-software/a/qbox-dot-io-hosted-elasticsearch/) is an open source, full-text search engine developed in Java. Users upload datasets as JSON files. Then, Elasticsearch stores the original document before adding a searchable reference to the document in the cluster’s index. Less than nine years after its creation, Elasticsearch is the most popular enterprise search engine. Elastic released its latest update—version 7.2.0 —on June 25, 2019. [Kibana](https://www.elastic.co/products/kibana) is an open source data visualizer for Elasticsearch. This tool helps users create visualizations on top of content indexed in an Elasticsearch cluster. [Sunbursts](https://en.wikipedia.org/wiki/Pie_chart#Ring), [geospatial data maps](https://en.wikipedia.org/wiki/Spatial_analysis), [relationship analyses](https://en.wikipedia.org/wiki/Correlation_and_dependence), and dashboards with live data are just a few options. And thanks to Elasticsearch’s machine learning prowess, you can learn which properties might influence your data (like servers or IP addresses) and find abnormal patterns. At [DevFest DC](https://www.devfestdc.org/) last month, [Dr. Summer Rankin](https://www.summerrankin.com/about)—lead data scientist at Booz Allen Hamilton—uploaded a dataset of content from TED Talks to Elasticsearch, then used Kibana to quickly build a dashboard. Intrigued, I went to an Elasticsearch meetup days later. Since this course was for newbies, we started at Square One: Installing Elastic and Kibana on our laptops. Without both packages installed, we couldn’t create our own visualizations from the dataset of Shakespeare texts we were using as a dummy JSON file. Next, I will share step-by-step instructions for downloading, installing, and running Elasticsearch Version 7.1.1 on MacOS. This was the latest version when I attended the Elasticsearch meetup in mid-June 2019. ## Downloading Elasticsearch for MacOS - Go to [https://www.elastic.co/downloads/elasticsearch](https://www.elastic.co/downloads/elasticsearch), which takes you to the webpage below: ![The Elasticsearch download page. The Elasticsearch download page.](https://opensource.com/sites/default/files/uploads/wwa1f3_600px_0.png) - In the **Downloads**section, click**MacOS**, which downloads the Elasticsearch TAR file (for example,**elasticsearch-7.1.1-darwin-x86_64.tar**) into your**Downloads**folder. - Double-click this file to unpack it into its own folder (for example, **elasticsearch-7.1.1**), which contains all of the files that were in the TAR. **Tip**: If you want Elasticsearch to live in another folder, now is the time to move this folder. ## Running Elasticsearch from the MacOS command line You can run Elasticsearch only using the command line if you prefer. Just follow this process: [Open a](https://support.apple.com/en-ca/guide/terminal/welcome/mac).**Terminal**window- In the terminal window, enter your Elasticsearch folder. For example (if you moved the program, change **Downloads**to the correct path): **$ cd ~Downloads/elasticsearch-1.1.0** - Change to the Elasticsearch **bin**subfolder, and start the program. For example: **$ cd bin $ ./elasticsearch** Here’s some of the output that my command line terminal displayed when I launched Elasticsearch 1.1.0: ![Terminal output when running Elasticsearch. Terminal output when running Elasticsearch.](https://opensource.com/sites/default/files/uploads/io6t1a_600px.png) **NOTE**: Elasticsearch runs in the foreground by default, which can cause your computer to slow down. Press **Ctrl-C to** stop Elasticsearch from running. ## Running Elasticsearch using the GUI If you prefer your point-and-click environment, you can run Elasticsearch like so: - Open a new **Finder**window. - Select **Downloads**in the left Finder sidebar (or, if you moved Elasticsearch to another folder, navigate to there). - Open the folder called (for the sake of this example) **elasticsearch-7.1.1**. A selection of eight subfolders appears. ![The elasticsearch/bin menu. The elasticsearch/bin menu.](https://opensource.com/sites/default/files/uploads/o43yku_600px.png) - Open the **bin**subfolder. As the screenshot above shows, this subfolder yields 20 assets. - Click the first option, which is **elasticsearch**. Note that you may get a security warning, as shown below: ![The security warning dialog box. The security warning dialog box.](https://opensource.com/sites/default/files/uploads/elasticsearch_security_warning_500px.jpg) opensource.com In order to open the program in this case: - Click **OK**in the warning dialog box. - Open **System Preferences**. - Click **Security & Privacy**, which opens the window shown below: ![Where you can allow your computer to open the downloaded file. Where you can allow your computer to open the downloaded file.](https://opensource.com/sites/default/files/uploads/the_general_tab_of_the_system_preferences_security_and_privacy_window.jpg) - Click **Open Anyway**, which opens the confirmation dialog box shown below: ![Security confirmation dialog box. Security confirmation dialog box.](https://opensource.com/sites/default/files/uploads/confirmation_dialog_box.jpg) - Click **Open**. A terminal window opens and launches Elasticsearch. The launch process can take a while, so let it run. Eventually, it will finish, and you will see output similar to this at the end: ![Launching Elasticsearch in MacOS. Launching Elasticsearch in MacOS.](https://opensource.com/sites/default/files/uploads/y5dvtu_600px.png) ## Learning more Once you’ve installed Elasticsearch, it’s time to start exploring! The tool’s [Elasticsearch: Getting Started](https://www.elastic.co/webinars/getting-started-elasticsearch?ultron=%5BB%5D-Elastic-US+CA-Exact&blade=adwords-s&Device=c&thor=elasticsearch&gclid=EAIaIQobChMImdbvlqOP4wIVjI-zCh3P_Q9mEAAYASABEgJuAvD_BwE) guide directs you based on your goals. Its introductory video walks through steps to launch a hosted cluster on [Elasticsearch Service](https://info.elastic.co/elasticsearch-service-gaw-v10-nav.html?ultron=%5BB%5D-Elastic-US+CA-Exact&blade=adwords-s&Device=c&thor=elasticsearch%20service&gclid=EAIaIQobChMI_MXHt-SZ4wIVJBh9Ch3wsQfPEAAYASAAEgJo9fD_BwE), perform basic search queries, play with data through create, read, update, and delete (CRUD) REST APIs, and more. This guide also offers links to documentation, dev console commands, training subscriptions, and a free trial of Elasticsearch Service. This trial lets you deploy Elastic and Kibana on AWS and GCP to support your Elastic clusters in the cloud. In the follow-up to this article, we’ll walk through the steps you’ll take to install Kibana on MacOS. This process will take your Elasticsearch queries to the next level via diverse data visualizations. Stay tuned! ## 1 Comment
11,128
ElectronMail:ProtonMail 和 Tutanota 的桌面客户端
https://itsfoss.com/electronmail/
2019-07-21T20:05:59
[ "电子邮件", "Email" ]
https://linux.cn/article-11128-1.html
互联网上的大多数人都拥有来自 Google 等大公司的电子邮件帐户,但这些帐户不尊重你的隐私。值得庆幸的是,目前有 [Tutanota](https://itsfoss.com/tutanota-review/) 和 [ProtonMail](https://itsfoss.com/protonmail/) 等具有隐私意识的替代品。问题是并非所有人都有桌面客户端。今天,我们将研究一个为你解决该问题的项目。我们来看看 ElectronMail 吧。 > > ‘Electron’ 警告! > > > 以下应用是使用 Electron 构建的(也就是名为 ElectronMail 的原因之一)。如果使用 Electron 让你感到不安,请将此视为触发警告。 > > > ### ElectronMail:Tutanota 和 ProtonMail 的桌面客户端 ![Electron Mail About](/data/attachment/album/201907/21/200603jedbowmssb6ausub.jpg) [ElectronMail](https://github.com/vladimiry/ElectronMail) 可以简单地视作 ProtonMail 和 Tutanota 的电子邮件客户端。它使用三大技术构建:[Electron](https://electronjs.org/)、[TypeScript](http://www.typescriptlang.org/) 和 [Angular](https://angular.io/)。它包括以下功能: * 针对每个电子邮件提供商提供多帐户支持 * 加密本地存储 * 适用于 Linux、Windows、macOS 和 FreeBSD * 原生通知系统 * 带有未读消息总数的系统托盘图标 * 用主密码保护帐户信息 * 可切换的视图布局 * 可离线访问电子邮件 * 电子邮件在本地加密存储 * 批量导出电子邮件为 EML 文件 * 全文搜索 * 内置/预打包的 Web 客户端 * 可以为每个帐户配置代理 * 拼写检查 * 支持双因素身份验证,以提高安全性 目前,ElectronMail 仅支持 Tutanota 和 ProtonMail。我觉得他们将来会增加更多。根据 [GitHub 页面](https://github.com/vladimiry/ElectronMail):“多电子邮件提供商支持。目前支持 ProtonMail 和 Tutanota。” ElectronMail 目前是 MIT 许可证。 #### 如何安装 ElectronMail 目前,有几种方法可以在 Linux 上安装 ElectronMail。对于Arch 和基于 Arch 的发行版,你可以从[Arch 用户仓库](https://aur.archlinux.org/packages/electronmail-bin)安装它。ElectrionMail 还有一个 Snap 包。要安装它,只需输入 `sudo snap install electron-mail` 即可。 对于所有其他 Linux 发行版,你可以[下载](https://github.com/vladimiry/ElectronMail/releases) `.deb` 或 `.rpm` 文件。 ![Electron Mail Inbox](/data/attachment/album/201907/21/200604tlxe3v4lplsxlclg.jpg) 你也可以[下载](https://github.com/vladimiry/ElectronMail/releases)用于 Windows 中的 `.exe` 安装程序或用于 macOS 的 `.dmg` 文件。甚至还有给 FreeBSD 用的文件。 #### 删除 ElectronMail 如果你安装了 ElectronMail 并确定它不适合你,那么[开发者](https://github.com/vladimiry)建议采用几个步骤。 **在卸载应用之前,请务必遵循以下步骤。** 如果你使用了“保持登录”功能,请单击菜单上的“注销”。这将删除本地保存的主密码。卸载 ElectronMail 后也可以删除主密码,但这涉及编辑系统密钥链。 你还需要手动删除设置文件夹。在系统托盘中选择应用图标后,单击“打开设置文件夹”可以找到它。 ![Electron Mail Setting][13] ### 我对 ElectronMail 的看法 我通常不使用电子邮件客户端。事实上,我主要依赖于 Web 客户端。所以,这个应用对我没太大用处。 话虽这么说,但是 ElectronMail 看着不错,而且很容易设置。它有大量开箱即用的功能,并且高级功能并不难使用。 我遇到的一个问题与搜索有关。根据功能列表,ElectronMail 支持全文搜索。但是,Tutanota 的免费版本仅支持有限的搜索。我想知道 ElectronMail 如何处理这个问题。 最后,ElectronMail 只是一个基于 Web Email 的一个 Electron 封装。我宁愿在浏览器中打开它们,而不是将单独的系统资源用于运行 Electron。如果你只[使用 Tutanota,他们有自己官方的 Electron 桌面客户端](/article-10688-1.html)。你可以尝试一下。 我最大的问题是安全性。这是两个非常安全的电子邮件应用的非官方应用。如果有办法捕获你的登录信息或阅读你的电子邮件怎么办?比我聪明的人必须通过源代码才能确定。这始终是一个安全项目的非官方应用的问题。 你有没有使用过 ElectronMail?你认为是否值得安装 ElectronMail?你最喜欢的邮件客户端是什么?请在下面的评论中告诉我们。 如果你发现这篇文章很有趣,请花一点时间在社交媒体、Hacker News 或 [Reddit](http://reddit.com/r/linuxusersgroup) 上分享它。 --- via: <https://itsfoss.com/electronmail/> 作者:[John Paul](https://itsfoss.com/author/john/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
The majority of people on the internet have email accounts from big companies, such as Google, that do not respect your privacy. Thankfully, there are privacy conscience alternatives like [Tutanota](https://itsfoss.com/tutanota-review/) and [ProtonMail](https://itsfoss.com/protonmail/). The problems is that not all of them have a desktop client. Today, we will look at a project that seeks to solve that problem for you. Let’s take a look at ElectronMail. ‘Electron’-ic warning! The following app is built with Electron (the name is ElectronMail for a reason). If the use of Electron upsets you, please consider this a trigger warning. ## ElectronMail: Desktop Client for Tutanota and ProtonMail ![Electron Mail About](https://itsfoss.com/content/images/wordpress/2019/07/electron-mail-about-800x500.jpg) [ElectronMail](https://github.com/vladimiry/ElectronMail) is simply put an email client for ProtonMail and Tutanota. It is built using three big technologies: [Electron](https://electronjs.org/), [TypeScript](http://www.typescriptlang.org/) and [Angular](https://angular.io/). It includes the following features: - Multi accounts support per each email provider - Encrypted local storage - Available for Linux, Windows, macOS, and FreeBSD - Native notifications - System tray icon with a total number of unread messages - Master password to protect account information - Switchable view layouts - Offline access to the emails - Encrypted local storage for emails - Batch emails export to EML files - Full-text search - Built-in/prepackaged web clients - Configuring proxy per account - Spell Checking - Support for two-factor authentication for extra security Currently, ElectronMail only supports Tutanota and ProtonMail. I get the feeling that they will be adding more in the future. According to the [GitHub page](https://github.com/vladimiry/ElectronMail): “Multi email providers support. ProtonMail and Tutanota at the moment.” ElectronMail is licensed under the MIT license. ### How to install ElectronMail Currently, there are several options to install ElectronMail on Linux. for Arch and Arch-based distros, you can install it from the [Arch User Repository](https://aur.archlinux.org/packages/electronmail-bin). There is also a Snap available for ElectronMail. To install it, just enter `sudo snap install electron-mail` . For all other Linux distros, you can [download](https://github.com/vladimiry/ElectronMail/releases) a `.deb` or `.rpm` file. ![Electron Mail Inbox](https://itsfoss.com/content/images/wordpress/2019/07/electron-mail-inbox.jpg) You can also [download](https://github.com/vladimiry/ElectronMail/releases) an `.exe` installer for Windows or a `.dmg` file for macOS. There is even a file for FreeBSD. ### Removing ElectronMail If you install ElectronMail and decide that it is not for you, there are a couple steps that the [developer](https://github.com/vladimiry) recommends. **Be sure to follow these steps before you uninstall the application.** If you are using the “Keep Me Signed In” feature, click “Log out” on the menu. This will delete the locally stored master password. It is possible to delete the master password after uninstalling ElectronMail, but that would involve editing the system keychain. You will also need to delete the settings folder manually. You can find it by clicking “Open setting folder” after selecting the application’s icon in the system tray. ![Electron Mail Setting](https://itsfoss.com/content/images/wordpress/2019/07/electron-mail-setting.jpg) ## My Thoughts on ElectronMail I don’t usually use email clients. In fact, I mostly depend on web clients. So, I don’t have much use for this application. That being said, ElectronMail has a nice feel to it and is easy to set up. It has a good number of features activated out of the box and the advanced features aren’t that hard to activate. The one question I have relates to search. According to the features list, ElectronMail supports full-text search. However, the free version of Tutanota only supports a limited search. I wonder how ElectronMail handles that. At the end of the day, ElectronMail is just an Electron wrapper for a couple of web-based emails. I would rather just have them open in my browser than dedicate separate system resources to running Electron. If you only [use Tutanota email, they have their own official Electron-based desktop client](https://itsfoss.com/tutanota-desktop/). You may try that. My biggest issue is with security. This is an unofficial app for two very secure email apps. What if there is a way to capture your login info or read through your emails? Someone who is smarter than I would have to go through the source code to know for sure. That is always the issue with unofficial apps for a security project. Have you every used ElectronMail? Do you think it would be worthwhile to install ElectronMail? What is your favorite email client? Please let us know in the comments below. If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit](http://reddit.com/r/linuxusersgroup).
11,130
成为终身学习者,并在工作中取得成功
https://opensource.com/open-organization/19/7/informal-learning-adaptability
2019-07-21T20:57:23
[ "持续学习" ]
https://linux.cn/article-11130-1.html
> > 在具有适应性文化的开放组织中,学习应该一直持续 —— 但不会总是出现在正式场合。我们真的明白它是如何工作的吗? > > > ![Writing in a notebook](/data/attachment/album/201907/21/205725u2eeh7yzuhq442g2.jpg "Writing in a notebook") 持续学习是指人们为发展自己而进行的持续的、职业驱动的、有意识的学习过程。对于那些自认是持续学习者的人来说,学习从未停止 —— 这些人从日常经历中看到学习机会。与同事进行辩论、反思反馈、在互联网上寻找问题的解决方案、尝试新事物或冒险都是一个人在工作中可以进行的非正式学习活动的例子。 持续学习是开放组织中任何人的核心能力。毕竟,开放的组织是建立在同行相互思考、争论和行动的基础上的。在开放组织的模棱两可、话语驱动的世界中茁壮成长,每天都需要员工具备这些技能。 不幸的是,科学文献在传播我们在工作中学习的知识方面、帮助个人欣赏和发展自己的学习能力方面,做得很差。因此,在本文系列中,我将向你介绍非正式学习,并帮助你理解将学习视为一种技能会如何帮助你在任何组织中茁壮成长,尤其是在开放式组织中。 ### 为什么这么正式? 迄今为止,对组织中学习的科学研究主要集中在正式学习而不是非正式学习的设计、交付和评估上。 投资于员工知识、技能和能力的发展是一个组织保持其相对于竞争对手优势的重要方式。组织通过创建或购买课程、在线课程、研讨会等来使学习机会正规化。这些课程旨在像个人传授与工作相关的内容,就像学校里的班级一样。对于一个组织来说,提供一门课程是一种简单(如果成本高昂的话)的方法,可以确保其员工的技能或知识保持最新。同样,教室环境是研究人员的天然实验室,使得基于培训的研究和工作不仅可能,而且强大。 当然,有些东西人们不需要培训来学习;通常,人们通过研究答案、与同事交谈、思考、实验或适应变化来学习。事实上,[最近的评估表明](https://www.groupoe.com/images/Accelerating_On-the-Job-Learning_-_White_Paper.pdf) 70% 到 80% 的与工作相关的知识不是在培训中学到的,而是在工作中非正式学到的。这并不是说正规的培训无效;培训可能非常有效,但它是一种精确的干预方式。在工作的大部分方面正式培训一个人是不现实的,尤其是当这些工作变得更加复杂的时候。 因此,非正式学习,或者任何发生在结构化学习环境之外的学习,对工作场所来说是极其重要的。事实上,[最近的科学证据](https://www.researchgate.net/publication/316490244_Antecedents_and_Outcomes_of_Informal_Learning_Behaviors_a_Meta-Analysis)表明,非正式学习比正式培训更能预测工作表现。 那么,为什么机构和科学界如此关注培训呢? ### 循环过程 除了我前面提到的原因,研究非正式学习可能非常困难。与正式学习不同,非正式学习发生在非结构化环境中,高度依赖于个人,很难或不可能观察到。 直到最近,大多数关于非正式学习的研究都集中在定义非正式学习的合格特征和确定非正式学习在理论上是如何与工作经验联系在一起的。研究人员描述了一个[动态的周期性过程](https://psycnet.apa.org/record/2008-13469-009),通过这个过程,个人可以在组织中非正式地学习。 与正式学习一样,非正式学习发生在非结构化环境中,高度依赖于个人,很难或不可能观察。 在这个过程中,个人和组织都有创造学习机会的机构。例如,一个人可能对学习某样东西感兴趣,并为此表现出学习行为。组织以向个人提供反馈的形式,可能表明需要学习。这可能是一个糟糕的绩效评估、一个在项目中发表的评论、或者一个不是个人指导的组织环境的更广泛的变化。这些力量在组织环境中(例如,有人尝试了一个新想法,他或她的同事认识到并奖励了这种行为)或者通过在个人的头脑中反思(例如,有人反思了关于他或她的表现的,并决定在学习工作中付出更多的努力)。与培训不同,非正式学习不遵循正式的线性过程。个人可以随时体验过程的任何部分,同时体验过程的多个部分。 ### 开放组织中的非正式学习 具体而言,在开放组织中,既减少了对等级制度的重视程度,又更加注重对参与式文化的重视程度,这两者都推动了这种非正式的学习。简而言之,开放式组织只是为个人和组织环境提供了更多互动和激发学习的机会。此外,想法和变革需要开放式组织中员工给予更广泛的认同 —— 而认同需要对他人的适应性和洞察力的欣赏。 也就是说,仅仅增加学习机会并不能保证学习会发生或成功。有人甚至可能会说,开放式组织中常见的模糊性和公开性话语可能会阻止不擅长持续学习的人——同样,随着时间的推移学习的习惯和开放式组织的核心能力——尽可能有效地为组织做出贡献。 解决这些问题需要一种以一致的方式跟踪非正式学习。最近,科学界呼吁创造衡量非正式学习的方法,这样就可以进行系统的研究来解决非正式学习的前因后果的问题。我自己的研究集中在这一呼吁上,我花了几年时间发展和完善我们对非正式学习行为的理解,以便可以衡量它们。 在本文系列的第二部分,我将重点介绍我最近在一个开放式组织中进行的一项研究的成果,在该研究中,我测试了我对非正式学习行为的研究,并将它们与更广泛的工作环境和个人工作成果联系起来。 --- via: <https://opensource.com/open-organization/19/7/informal-learning-adaptability> 作者:[Colin Willis](https://opensource.com/users/colinwillishttps://opensource.com/users/marcobravo) 选题:[lujun9972](https://github.com/lujun9972) 译者:[heguangzhi](https://github.com/heguangzhi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
Continuous learning refers to the ongoing, career-driven, intentional learning process people undertake to develop themselves. For people who consider themselves continuous learners, learning never stops—and these people see learning opportunities in everyday experiences. Engaging with one's colleagues in debate, reflecting on feedback, scouring the internet for a solution to a frustrating problem, trying something new, or taking a risk are all examples of the informal learning activities one can perform on the job. Continuous learning is a core competency for anyone in an open organization. After all, open organizations are built upon peers thinking, arguing, and acting alongside one another. And thriving in the ambiguous, discourse-driven world of the open organization requires these sorts of skills from employees daily. Unfortunately, the scientific literature has done a poor job disseminating our knowledge of learning at work in a way that helps individuals appreciate and develop their own learning abilities. So in this article series, I'll introduce you to informal learning and help you understand how viewing learning as a skill can help you thrive—in any organization, but *especially* open organizations. ## Why so formal? To date, the scientific study of learning in organizations has focused primarily on the design, delivery, and evaluation of *formal* training as opposed to *informal* learning. Investing in the development of the knowledge, skills, and abilities of its workforce is an important way an organization maintains its edge over its competitors. Organizations *formalize* learning opportunities by creating or purchasing classes, online courses, workshops, etc., which are meant to instruct an individual on job-related content—much like a class at a school. Providing a class is an easy (if expensive) way for an organization to ensure the skills or knowledge of its workforce remains current. Likewise, classroom settings are natural experiment rooms for researchers, making training-based research and work not only possible but also powerful. Of course, people don't *need* training to learn something; often, people learn by researching answers, talking to colleagues, reflecting, experimenting, or adapting to changes. In fact, [recent estimates suggest](https://www.groupoe.com/images/Accelerating_On-the-Job-Learning_-_White_Paper.pdf) that between 70% to 80% of all job-related knowledge isn't learned in training but rather *informally* on-the-job. That isn't to say that formal training isn't effective; training can be *very* effective, but it is a precise type of intervention. It simply isn't practical to formally train someone on most aspects of a job, especially as those jobs become more complex. Informal learning, or any learning that occurs outside a structured learning environment, is therefore incredibly important to the workplace. In fact, [recent scientific evidence](https://www.researchgate.net/publication/316490244_Antecedents_and_Outcomes_of_Informal_Learning_Behaviors_a_Meta-Analysis) suggests that informal learning is a better predictor of job performance than formal training. So why do organizations and the scientific community focus so much on training? ## A cyclical process Apart from the reasons I mentioned earlier, researching informal learning can be very difficult. Unlike formal training, informal learning occurs in unstructured environments, is highly dependent on the individual, and can be difficult or impossible to observe. Until recently, most of the research on informal learning focused on defining the qualifies characteristic of informal learning and identifying how informal learning is theoretically connected to work experience. Researchers have described a [dynamic, cyclical process](https://psycnet.apa.org/record/2008-13469-009) by which individuals learn informally in organizations. In the process, both the individual and the organization have agency for creating learning opportunities. For example, an individual may be interested in learning something and performs learning behaviors to do so. The organization, in the form of feedback delivered to the individual, may signal that learning is needed. This could be a poor performance review, a comment made during a project, or a broader change in the organizational environment that isn't personally directed. These forces interact in the organizational environment (e.g., someone experiments with a new idea and his or her colleagues recognize and reward that behavior) or in the mind of the individual via reflection (e.g., someone reflects on feedback about his or her performance and decides to exert more effort into learning the job). Unlike training, informal learning does not follow a formal, linear process. An individual can experience any part of the process at any time and experience multiple parts of the process simultaneously. ## Informal learning in the open organization In open organizations specifically, both a decreased emphasis on hierarchy and an increased focus on a participatory culture fuel this informal learning process. In short, open organizations simply present more opportunities for individuals and the organizational environment to interact and spark learning moments. Moreover, ideas and change require a broader level of buy-in among employees in an open organization—and buy-in requires an appreciation for the adaptability and insight of others. That said, simply increasing the numbers of opportunities to learn does not guarantee that learning will occur or be successful. One might even argue that the ambiguity and open discourse common in an open organization could *prevent* someone who is *not* skilled at continuous learning—again, that habit of learning over time and a core competency of the open organization—from contributing to the organization as effectively as they could in more traditional organizations. Addressing these kinds of concerns require a way of tracking informal learning in a consistent manner. Recently, there have been calls in the scientific community to create ways of measuring informal learning, so systematic research can be conducted to address questions around the antecedents and outcomes of informal learning. My own research has focused on this call, and I have spent several years developing and refining our understanding of informal learning behaviors so that they can be measured. In the second part of this article series, I'll focus on findings from a recent study I conducted inside an open organization, where I tested my measure of informal learning behaviors and connected them to the broader workplace environment and individual work outcomes. ## 2 Comments
11,132
如何在 Debian/Ubuntu 上手动安装安全更新?
https://www.2daygeek.com/manually-install-security-updates-ubuntu-debian/
2019-07-21T23:36:27
[ "安全更新" ]
https://linux.cn/article-11132-1.html
![](/data/attachment/album/201907/21/233619rm8kvj5z9ojkpwc8.jpg) 在 Linux 上通过命令行安装一个包程序是一件简单的事。在一行命令中组合使用多个命令能让你更加简单地完成任务。 安全更新也同样如此。 在这个教程里面,我们会向你展示如何查看可用的安全更新,以及如何在 Ubuntu、LinuxMint 等等这些基于 Debian 的系统中安装它们。 有三种方法可以完成这件事,下面会详细地描述这三种方法。 作为一个 Linux 管理员,你应该让你的系统保持为最新,这会让你的系统更安全,保护你的系统抵抗意想不到的攻击。 如果你因为一些应用的依赖问题不能解决,导致不能给所有的系统进行全部更新。那至少,你应该打上安全补丁来让你的系统 100% 符合要求。 ### 方法一:如何检查 Debian/Ubuntu 中是否有任何可用的安全更新? 在进行补丁安装之前,检查可用安全更新列表始终是一个好习惯。它会为你提供将在你的系统中进行更新的软件包的列表。 默认情况下,你的系统上应该是已经安装了 `unattended-upgrades` 包的。但是如果你的系统没有装这个包,那么请使用下面的命令来安装它。 使用 [APT-GET 命令](https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/) 或者 [APT 命令](https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/) 来安装 `unattended-upgrades` 包。 ``` $ sudo apt-get install unattended-upgrades 或 $ sudo apt install unattended-upgrades ``` **什么是试运行?** 大多数的 Linux 命令都有一个试运行选项,它会给出实际的输出但不会下载或安装任何东西。 为此,你需要在 `unattended-upgrades` 命令中添加 `--dry-run` 选项。 ``` $ sudo unattended-upgrade --dry-run -d Initial blacklisted packages: Initial whitelisted packages: Starting unattended upgrades script Allowed origins are: o=Ubuntu,a=bionic, o=Ubuntu,a=bionic-security, o=UbuntuESM,a=bionic Using (^linux-image-[0-9]+\.[0-9\.]+-.*|^linux-headers-[0-9]+\.[0-9\.]+-.*|^linux-image-extra-[0-9]+\.[0-9\.]+-.*|^linux-modules-[0-9]+\.[0-9\.]+-.*|^linux-modules-extra-[0-9]+\.[0-9\.]+-.*|^linux-signed-image-[0-9]+\.[0-9\.]+-.*|^kfreebsd-image-[0-9]+\.[0-9\.]+-.*|^kfreebsd-headers-[0-9]+\.[0-9\.]+-.*|^gnumach-image-[0-9]+\.[0-9\.]+-.*|^.*-modules-[0-9]+\.[0-9\.]+-.*|^.*-kernel-[0-9]+\.[0-9\.]+-.*|^linux-backports-modules-.*-[0-9]+\.[0-9\.]+-.*|^linux-modules-.*-[0-9]+\.[0-9\.]+-.*|^linux-tools-[0-9]+\.[0-9\.]+-.*|^linux-cloud-tools-[0-9]+\.[0-9\.]+-.*) regexp to find kernel packages Using (^linux-image-4\.15\.0\-51\-generic$|^linux-headers-4\.15\.0\-51\-generic$|^linux-image-extra-4\.15\.0\-51\-generic$|^linux-modules-4\.15\.0\-51\-generic$|^linux-modules-extra-4\.15\.0\-51\-generic$|^linux-signed-image-4\.15\.0\-51\-generic$|^kfreebsd-image-4\.15\.0\-51\-generic$|^kfreebsd-headers-4\.15\.0\-51\-generic$|^gnumach-image-4\.15\.0\-51\-generic$|^.*-modules-4\.15\.0\-51\-generic$|^.*-kernel-4\.15\.0\-51\-generic$|^linux-backports-modules-.*-4\.15\.0\-51\-generic$|^linux-modules-.*-4\.15\.0\-51\-generic$|^linux-tools-4\.15\.0\-51\-generic$|^linux-cloud-tools-4\.15\.0\-51\-generic$) regexp to find running kernel packages Checking: apt ([]) adjusting candidate version: apt=1.6.6ubuntu0.1 Checking: apt-utils ([]) adjusting candidate version: apt-utils=1.6.6ubuntu0.1 Checking: bash ([]) . . Checking: xxd ([, ]) pkgs that look like they should be upgraded: binutils binutils-common binutils-x86-64-linux-gnu cpp cpp-7 dbus dbus-user-session dbus-x11 firefox firefox-locale-en g++ g++-7 gcc gcc-7 gcc-7-base gcc-8-base libasan4 libatomic1 libbinutils libcc1-0 libcilkrts5 libdbus-1-3 libdbus-1-dev libgcc-7-dev libgcc1 libgfortran4 libgomp1 libitm1 liblsan0 libmpx2 libquadmath0 libstdc++-7-dev libstdc++6 libtsan0 libubsan0 vim-common vim-tiny xxd ``` 如果在终端里,上面的命令输出说 “No packages found that can be upgraded unattended and no pending auto-removals”,这意味着你的系统已经是最新的了。 #### 如何在 Debian/Ubuntu 中安装可用的安全更新? 如果你在上面的命令输出中获得了任意的软件包更新,就运行下面的命令来安装它们。 ``` $ sudo unattended-upgrade -d ``` 除此之外,你也可以使用 `apt-get` 命令来进行安装。但是这个方法有点棘手,我会建议用户用第一个选项。 ### 方法二:如何使用 apt-get 命令在 Debian/Ubuntu 中检查是否有可用的安全更新? 在你的 Debian/Ubuntu 系统中运行下面的命令来查看可用安全更新的列表。 ``` $ sudo apt-get -s dist-upgrade | grep "^Inst" | grep -i securi Inst libquadmath0 [8.2.0-1ubuntu2~18.04] (8.3.0-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst libitm1 [8.2.0-1ubuntu2~18.04] (8.3.0-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst gcc-8-base [8.2.0-1ubuntu2~18.04] (8.3.0-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [libmpx2:amd64 libgcc1:amd64 libtsan0:amd64 liblsan0:amd64 libgomp1:amd64 libatomic1:amd64 libcc1-0:amd64 libstdc++6:amd64 ] Inst libgcc1 [1:8.2.0-1ubuntu2~18.04] (1:8.3.0-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [libmpx2:amd64 libtsan0:amd64 liblsan0:amd64 libgomp1:amd64 libatomic1:amd64 libcc1-0:amd64 libstdc++6:amd64 ] Inst libmpx2 [8.2.0-1ubuntu2~18.04] (8.3.0-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [libtsan0:amd64 liblsan0:amd64 libgomp1:amd64 libatomic1:amd64 libcc1-0:amd64 libstdc++6:amd64 ] Inst liblsan0 [8.2.0-1ubuntu2~18.04] (8.3.0-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [libtsan0:amd64 libgomp1:amd64 libatomic1:amd64 libcc1-0:amd64 libstdc++6:amd64 ] Inst libtsan0 [8.2.0-1ubuntu2~18.04] (8.3.0-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [libgomp1:amd64 libatomic1:amd64 libcc1-0:amd64 libstdc++6:amd64 ] Inst libcc1-0 [8.2.0-1ubuntu2~18.04] (8.3.0-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [libgomp1:amd64 libatomic1:amd64 libstdc++6:amd64 ] Inst libatomic1 [8.2.0-1ubuntu2~18.04] (8.3.0-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [libgomp1:amd64 libstdc++6:amd64 ] Inst libgomp1 [8.2.0-1ubuntu2~18.04] (8.3.0-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [libstdc++6:amd64 ] Inst libstdc++6 [8.2.0-1ubuntu2~18.04] (8.3.0-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) Inst libdbus-1-dev [1.12.2-1ubuntu1] (1.12.2-1ubuntu1.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst dbus-user-session [1.12.2-1ubuntu1] (1.12.2-1ubuntu1.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst dbus-x11 [1.12.2-1ubuntu1] (1.12.2-1ubuntu1.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst dbus [1.12.2-1ubuntu1] (1.12.2-1ubuntu1.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst libdbus-1-3 [1.12.2-1ubuntu1] (1.12.2-1ubuntu1.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) Inst xxd [2:8.0.1453-1ubuntu1] (2:8.0.1453-1ubuntu1.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) Inst vim-tiny [2:8.0.1453-1ubuntu1] (2:8.0.1453-1ubuntu1.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst vim-common [2:8.0.1453-1ubuntu1] (2:8.0.1453-1ubuntu1.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [all]) Inst binutils-x86-64-linux-gnu [2.30-21ubuntu1~18.04] (2.30-21ubuntu1~18.04.2 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [binutils:amd64 ] Inst binutils-common [2.30-21ubuntu1~18.04] (2.30-21ubuntu1~18.04.2 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [binutils:amd64 libbinutils:amd64 ] Inst binutils [2.30-21ubuntu1~18.04] (2.30-21ubuntu1~18.04.2 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [libbinutils:amd64 ] Inst libbinutils [2.30-21ubuntu1~18.04] (2.30-21ubuntu1~18.04.2 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) Inst libasan4 [7.3.0-27ubuntu1~18.04] (7.4.0-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst libubsan0 [7.3.0-27ubuntu1~18.04] (7.4.0-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst libcilkrts5 [7.3.0-27ubuntu1~18.04] (7.4.0-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst g++-7 [7.3.0-27ubuntu1~18.04] (7.4.0-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst gcc-7 [7.3.0-27ubuntu1~18.04] (7.4.0-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst libstdc++-7-dev [7.3.0-27ubuntu1~18.04] (7.4.0-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst libgcc-7-dev [7.3.0-27ubuntu1~18.04] (7.4.0-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst libgfortran4 [7.3.0-27ubuntu1~18.04] (7.4.0-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst cpp-7 [7.3.0-27ubuntu1~18.04] (7.4.0-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst gcc-7-base [7.3.0-27ubuntu1~18.04] (7.4.0-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) Inst cpp [4:7.3.0-3ubuntu2.1] (4:7.4.0-1ubuntu2.3 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) Inst firefox [67.0.1+build1-0ubuntu0.18.04.1] (67.0.2+build2-0ubuntu0.18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) Inst firefox-locale-en [67.0.1+build1-0ubuntu0.18.04.1] (67.0.2+build2-0ubuntu0.18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) Inst gcc [4:7.3.0-3ubuntu2.1] (4:7.4.0-1ubuntu2.3 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) Inst g++ [4:7.3.0-3ubuntu2.1] (4:7.4.0-1ubuntu2.3 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) ``` #### 如何使用 apt-get 命令在 Debian/Ubuntu 系统中安装可用的安全更新? 如果你在上面命令的输出中发现任何的软件包更新。就运行下面的命令来安装它们。 ``` $ sudo apt-get -s dist-upgrade | grep "^Inst" | grep -i securi | awk -F " " {'print $2'} | xargs apt-get install ``` 除此之外,也可以使用 `apt` 命令来完成。但是这个方法有点棘手,我会建议用户用第一个方式。 ### 方法三:如何使用 apt 命令在 Debian/Ubuntu 系统中检查是否有可用的安全更新? 在 Debian/Ubuntu 系统中运行下面的命令来查看可用安全更新的列表。 ``` $ sudo apt list --upgradable | grep -e "-security" binutils/bionic-updates,bionic-security 2.30-21ubuntu1~18.04.2 amd64 [upgradable from: 2.30-21ubuntu1~18.04] binutils-common/bionic-updates,bionic-security 2.30-21ubuntu1~18.04.2 amd64 [upgradable from: 2.30-21ubuntu1~18.04] binutils-x86-64-linux-gnu/bionic-updates,bionic-security 2.30-21ubuntu1~18.04.2 amd64 [upgradable from: 2.30-21ubuntu1~18.04] cpp/bionic-updates,bionic-security 4:7.4.0-1ubuntu2.3 amd64 [upgradable from: 4:7.3.0-3ubuntu2.1] cpp-7/bionic-updates,bionic-security 7.4.0-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04] dbus/bionic-updates,bionic-security 1.12.2-1ubuntu1.1 amd64 [upgradable from: 1.12.2-1ubuntu1] dbus-user-session/bionic-updates,bionic-security 1.12.2-1ubuntu1.1 amd64 [upgradable from: 1.12.2-1ubuntu1] dbus-x11/bionic-updates,bionic-security 1.12.2-1ubuntu1.1 amd64 [upgradable from: 1.12.2-1ubuntu1] firefox/bionic-updates,bionic-security 67.0.2+build2-0ubuntu0.18.04.1 amd64 [upgradable from: 67.0.1+build1-0ubuntu0.18.04.1] firefox-locale-en/bionic-updates,bionic-security 67.0.2+build2-0ubuntu0.18.04.1 amd64 [upgradable from: 67.0.1+build1-0ubuntu0.18.04.1] g++/bionic-updates,bionic-security 4:7.4.0-1ubuntu2.3 amd64 [upgradable from: 4:7.3.0-3ubuntu2.1] g++-7/bionic-updates,bionic-security 7.4.0-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04] gcc/bionic-updates,bionic-security 4:7.4.0-1ubuntu2.3 amd64 [upgradable from: 4:7.3.0-3ubuntu2.1] gcc-7/bionic-updates,bionic-security 7.4.0-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04] gcc-7-base/bionic-updates,bionic-security 7.4.0-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04] gcc-8-base/bionic-updates,bionic-security 8.3.0-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04] libasan4/bionic-updates,bionic-security 7.4.0-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04] libatomic1/bionic-updates,bionic-security 8.3.0-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04] libbinutils/bionic-updates,bionic-security 2.30-21ubuntu1~18.04.2 amd64 [upgradable from: 2.30-21ubuntu1~18.04] libcc1-0/bionic-updates,bionic-security 8.3.0-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04] libcilkrts5/bionic-updates,bionic-security 7.4.0-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04] libdbus-1-3/bionic-updates,bionic-security 1.12.2-1ubuntu1.1 amd64 [upgradable from: 1.12.2-1ubuntu1] libdbus-1-dev/bionic-updates,bionic-security 1.12.2-1ubuntu1.1 amd64 [upgradable from: 1.12.2-1ubuntu1] libgcc-7-dev/bionic-updates,bionic-security 7.4.0-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04] libgcc1/bionic-updates,bionic-security 1:8.3.0-6ubuntu1~18.04.1 amd64 [upgradable from: 1:8.2.0-1ubuntu2~18.04] libgfortran4/bionic-updates,bionic-security 7.4.0-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04] libgomp1/bionic-updates,bionic-security 8.3.0-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04] libitm1/bionic-updates,bionic-security 8.3.0-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04] liblsan0/bionic-updates,bionic-security 8.3.0-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04] libmpx2/bionic-updates,bionic-security 8.3.0-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04] libquadmath0/bionic-updates,bionic-security 8.3.0-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04] libstdc++-7-dev/bionic-updates,bionic-security 7.4.0-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04] libstdc++6/bionic-updates,bionic-security 8.3.0-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04] libtsan0/bionic-updates,bionic-security 8.3.0-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04] libubsan0/bionic-updates,bionic-security 7.4.0-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04] vim-common/bionic-updates,bionic-updates,bionic-security,bionic-security 2:8.0.1453-1ubuntu1.1 all [upgradable from: 2:8.0.1453-1ubuntu1] vim-tiny/bionic-updates,bionic-security 2:8.0.1453-1ubuntu1.1 amd64 [upgradable from: 2:8.0.1453-1ubuntu1] xxd/bionic-updates,bionic-security 2:8.0.1453-1ubuntu1.1 amd64 [upgradable from: 2:8.0.1453-1ubuntu1] ``` #### 如何在 Debian/Ubuntu 系统中使用 apt 命令来安装可用的安全更新? 如果你在上面命令的输出中发现任何的软件包更新。就运行下面的命令来安装它们。 ``` $ sudo apt list --upgradable | grep -e "-security" | awk -F "/" '{print $1}' | xargs apt install ``` 同样,下面的文件也会告诉你更新包的总数。 ``` $ sudo cat /var/lib/update-notifier/updates-available 190 packages can be updated. 39 updates are security updates. ``` --- via: <https://www.2daygeek.com/manually-install-security-updates-ubuntu-debian/> 作者:[Magesh Maruthamuthu](https://www.2daygeek.com/author/magesh/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[hopefully2333](https://github.com/hopefully2333) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
404
Not Found
null
11,133
使用 Python 处理 JSON 格式的数据
https://opensource.com/article/19/7/save-and-load-data-python-json
2019-07-21T23:57:32
[ "JSON" ]
https://linux.cn/article-11133-1.html
> > 如果你不希望从头开始创造一种数据格式来存放数据,JSON 是一个很好的选择。如果你对 Python 有所了解,就更加事半功倍了。下面就来介绍一下如何使用 Python 处理 JSON 数据。 > > > ![](/data/attachment/album/201907/21/235723kkk55q455145dkkr.jpg) [JSON](https://json.org) 的全称是 <ruby> JavaScript 对象表示法 <rt> JavaScript Object Notation </rt></ruby>。这是一种以键值对的形式存储数据的格式,并且很容易解析,因而成为了一种被广泛使用的数据格式。另外,不要因为 JSON 名称而望文生义,JSON 并不仅仅在 JavaScript 中使用,它也可以在其它语言中使用。下文会介绍它是如何在 Python 中使用的。 首先我们给出一个 JSON 示例: ``` { "name":"tux", "health":"23", "level":"4" } ``` 上面是一个和编程语言无关的原生 JSON 数据。熟悉 Python 的人会看出来这个 JSON 数据跟 Python 中的<ruby> 字典 <rt> dictionary </rt></ruby>长得很像。而这两者之间确实非常相似,如果你对 Python 中的列表和字典数据结构有一定的理解,那么 JSON 理解起来也不难。 ### 使用字典存放数据 如果你的应用需要存储一些结构复杂的数据,不妨考虑使用 JSON 格式。对比你可能曾经用过的自定义格式的文本配置文件,JSON 提供了更加结构化的可递归的存储格式。同时,Python 自带的 `json` 模块已经提供了可以将 JSON 数据导入/导出应用时所需的所有解析库。因此,你不需要针对 JSON 自行编写代码进行解析,而其他开发人员在与你的应用进行数据交互的时候也不需要去解析新的数据格式。正是这个原因,JSON 在数据交换时被广泛地采用了。 以下是一段在 Python 中使用嵌套字典的代码: ``` #!/usr/bin/env python3 import json # instantiate an empty dict team = {} # add a team member team['tux'] = {'health': 23, 'level': 4} team['beastie'] = {'health': 13, 'level': 6} team['konqi'] = {'health': 18, 'level': 7} ``` 这段代码声明了一个名为 `team` 的字典,并初始化为一个空字典。 如果要给这个字典添加内容,首先需要创建一个键,例如上面示例中的 `tux`、`beastie`、`konqi`,然后为这些键一一提供对应的值。上面示例中的值由一个个包含游戏玩家信息的字典充当。 字典是一种可变的变量。字典中的数据可以随时添加、删除或更新。这样的特性使得字典成为了应用程序存储数据的极好选择。 ### 使用 JSON 格式存储数据 如果存放在字典中的数据需要持久存储,这些数据就需要写到文件当中。这个时候就需要用到 Python 中的 `json` 模块了: ``` with open('mydata.json', 'w') as f: json.dump(team, f) ``` 上面的代码首先创建了一个名为 `mydata.json` 的文件,然后以写模式打开了这个文件,这个被打开的文件以变量 `f` 表示(当然也可以用任何你喜欢的名称,例如 `file`、`output` 等)。而 `json` 模块中的 `dump()` 方法则是用于将一个字典输出到一个文件中。 从应用中导出数据就是这么简单,同时这些导出的数据是结构化的、可理解的。现在可以查看导出的数据: ``` $ cat mydata.json {"tux": {"health": 23, "level": 4}, "beastie": {"health": 13, "level": 6}, "konqi": {"health": 18, "level": 7}} ``` ### 从 JSON 文件中读取数据 如果已经将数据以 JSON 格式导出到文件中了,也有可能需要将这些数据读回到应用中去。这个时候,可以使用 Python `json` 模块中的 `load()` 方法: ``` #!/usr/bin/env python3 import json f = open('mydata.json') team = json.load(f) print(team['tux']) print(team['tux']['health']) print(team['tux']['level']) print(team['beastie']) print(team['beastie']['health']) print(team['beastie']['level']) # when finished, close the file f.close() ``` 这个方法实现了和保存文件大致相反的操作。使用一个变量 `f` 来表示打开了的文件,然后使用 `json` 模块中的 `load()` 方法读取文件中的数据并存放到 `team` 变量中。 其中的 `print()` 展示了如何查看读取到的数据。在过于复杂的字典中迭代调用字典键的时候有可能会稍微转不过弯来,但只要熟悉整个数据的结构,就可以慢慢摸索出其中的逻辑。 当然,这里使用 `print()` 的方式太不灵活了。你可以将其改写成使用 `for` 循环的形式: ``` for i in team.values(): print(i) ``` ### 使用 JSON 如上所述,在 Python 中可以很轻松地处理 JSON 数据。因此只要你的数据符合 JSON 的模式,就可以选择使用 JSON。JSON 非常灵活易用,下次使用 Python 的时候不妨尝试一下。 --- via: <https://opensource.com/article/19/7/save-and-load-data-python-json> 作者:[Seth Kenlon](https://opensource.com/users/seth) 选题:[lujun9972](https://github.com/lujun9972) 译者:[HankChow](https://github.com/HankChow) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
[JSON](https://json.org) stands for JavaScript Object Notation. This format is a popular method of storing data in key-value arrangements so it can be parsed easily later. Don’t let the name fool you, though: You can use JSON in Python—not just JavaScript—as an easy way to store data, and this article demonstrates how to get started. First, take a look at this simple JSON snippet: ``` { "name":"tux", "health":"23", "level":"4" } ``` That's pure JSON and has not been altered for Python or any other language. Yet if you’re familiar with Python, you might notice that this example JSON code looks an awful lot like a Python dictionary. In fact, the two are very similar: If you are comfortable with Python lists and dictionaries, then JSON is a natural fit for you. ## Storing data in JSON format You might consider using JSON if your application needs to store somewhat complex data. While you may have previously resorted to custom text configuration files or data formats, JSON offers you structured, recursive storage, and Python’s JSON module offers all of the parsing libraries necessary for getting this data in and out of your application. So, you don’t have to write parsing code yourself, and other programmers don’t have to decode a new data format when interacting with your application. For this reason, JSON is easy to use, and ubiquitous. Here is some sample Python code using a dictionary within a dictionary: ``` #!/usr/bin/env python3 import json # instantiate an empty dict team = {} # add a team member team['tux'] = {'health': 23, 'level': 4} team['beastie'] = {'health': 13, 'level': 6} team['konqi'] = {'health': 18, 'level': 7} ``` This code creates a Python dictionary called **team**. It’s empty initially (you can create one that's already populated, but that’s impossible if you don’t have the data to put into the dictionary yet). To add to the **dict** object, you create a key, such as **tux**, **beastie**, or **konqi** in the example code, and then provide a value. In this case, the value is *another* dictionary full of player statistics. Dictionaries are mutable. You can add, remove, and update the data they contain as often as you please. This format is ideal storage for data that your application frequently uses. ## Saving data in JSON format If the data you’re storing in your dictionary is user data that needs to persist after the application quits, then you must write the data to a file on disk. This is where the JSON Python module comes in: ``` with open('mydata.json', 'w') as f: json.dump(team, f) ``` This code block creates a file called **mydata.json** and opens it in write mode. The file is represented with the variable **f** (a completely arbitrary designation; you can use whatever variable name you like, such as **file**, **FILE**, **output**, or practically anything). Meanwhile, the JSON module’s **dump** function is used to dump the data from the **dict** into the data file. Saving data from your application is as simple as that, and the best part about this is that the data is structured and predictable. To see, take a look at the resulting file: ``` $ cat mydata.json {"tux": {"health": 23, "level": 4}, "beastie": {"health": 13, "level": 6}, "konqi": {"health": 18, "level": 7}} ``` ## Reading data from a JSON file If you are saving data to JSON format, you probably want to read the data back into Python eventually. To do this, use the Python JSON module’s **json.load** function: ``` #!/usr/bin/env python3 import json f = open('mydata.json') team = json.load(f) print(team['tux']) print(team['tux']['health']) print(team['tux']['level']) print(team['beastie']) print(team['beastie']['health']) print(team['beastie']['level']) # when finished, close the file f.close() ``` This function implements the inverse, more or less, of saving the file: an arbitrary variable (**f**) represents the data file, and then the JSON module’s **load** function dumps the data from the file into the arbitrary **team** variable. The **print** statements in the code sample demonstrate how to use the data. It can be confusing to compound **dict** key upon **dict** key, but as long as you are familiar with your own dataset, or else can read the JSON source to get a mental map of it, the logic makes sense. Of course, the **print** statements don’t have to be hard-coded. You could rewrite the sample application using a **for** loop: ``` for i in team.values(): print(i) ``` ## Using JSON As you can see, JSON integrates surprisingly well with Python, so it’s a great format when your data fits in with its model. JSON is flexible and simple to use, and learning one basically means you’re learning the other, so consider it for data storage the next time you’re working on a Python application. ## 1 Comment
11,135
如何在 MacOS 上安装 Kibana
https://opensource.com/article/19/7/installing-kibana-macos
2019-07-22T20:41:27
[ "Elasticsearch" ]
/article-11135-1.html
> > Elasticsearch 安装好了之后,Kibana 插件可以为这个功能强大的搜索工具添加可视化功能。 > > > ![](/data/attachment/album/201907/22/204048vl8t88y6q8988229.jpg) 在我之前的文章中,我向 Mac 用户介绍了[安装 Elasticsearch](/article-11125-1.html) 的步骤,这是世界上最受欢迎的企业级搜索引擎。(这里有一篇针对 Linux 用户的[单独文章](https://opensource.com/article/19/7/installing-elasticsearch-and-kibana-linux)。)其自然语言处理能力使得 Elasticsearch 在数据集中查找细节方面表现出色。一旦你发现了你需要的数据,如果你已经安装了 [Kibana](https://www.elastic.co/products/kibana),你可以将它提升到一个新的水平。 Kibana 是 Elasticsearch 的开源的数据可视化插件。当你在 Elasticsearch 中找到了数据,Kibana 就会帮助你将其放入折线图、[时间序列查询](https://en.wikipedia.org/wiki/Time_series)、地理空间地图等。该工具非常适合于必须展示其研究成果的数据科学家,尤其是那些使用开源数据的人。 ### 安装 Kibana 你需要在 Elasticsearch 之外单独安装 Kibana。因为我安装了 Elasticsearch 7.1.1,所以我将安装 Kibana 1.1。版本的匹配非常重要,Kibana 需要针对相同版本的 Elasticsearch 节点运行。 (Kibana 运行在 node.js 上。) 以下是我为 MacOS 安装 Kibana 7.1.1 时所遵循的步骤: 1、确保 Elasticsearch 已下载并运行。如果需要,请参阅上一篇文章。 **注意**:你至少需要先安装 Elasticsearch 1.4.4 或更高版本才能使用 Kibana。这是因为你需要向 Kibana 提供要连接的 Elasticsearch 实例的 URL 以及你要搜索的 Elasticsearch 索引。通常,最好安装两者的最新版本。 2、单击[此处](https://www.elastic.co/downloads/kibana)下载 Kibana。你将看到如下的网页,它会提示你在**下载**部分的右上角下载 Kibana for Mac: ![Download Kibana here.](/data/attachment/album/201907/22/204132mvow3ld6k3z6aw3o.png "Download Kibana here.") 3、在你的 `Downloads` 文件夹中,打开 .tar 文件以展开它。此操作将创建一个具有相同名称的文件夹(例如,`kibana-7.1.1-darwin-x86_64`)。 4、如果你希望 Kibana 放在另一个文件夹中,请立即移动它。 仔细检查 Elasticsearch 是否正在运行,如果没有,请在继续之前启动它。(如果你需要说明,请参阅上一篇文章。) ### 打开 Kibana 插件 Elasticsearch 运行起来后,你现在可以启动 Kibana 了。该过程类似于启动 Elasticsearch: 1、从 Mac 的 `Downloads` 文件夹(或 Kibana 移动到的新文件夹)里,打开 Kibana 文件夹(即 `~Downloads/kibana-7.1.1-darwin-x86_64`)。 2、打开 `bin` 子文件夹。 ![The Kibana bin folder.](/data/attachment/album/201907/22/204137krn6gnpnhujcpbjw.png "The Kibana bin folder.") 3、运行 `kibana-plugin`。你可能会遇到上一篇文章中出现的相同安全警告: ![Security warning](/data/attachment/album/201907/22/204144fl2vsvhld2hlpmcc.png "Security warning") 通常,如果收到此警告,请按照那篇文章中的说明清除警告并打开 Kibana。请注意,如果我在终端中没有运行 Elasticsearch 的情况下打开该插件,我会收到相同的安全警告。要解决此问题,如上一篇文章中所述,打开 Elasticsearch 并在终端中运行它。使用 GUI 启动 Elasticsearch 也应该打开终端。 然后,我右键单击 `kibana-plugin` 并选择“打开”。这个解决方案对我有用,但你可能需要尝试几次。 我的 Elasticsearch 聚会中的几个人在他们的设备上打开 Kibana 时遇到了一些麻烦。 ### 更改 Kibana 的主机和端口号 Kibana 的默认设置将其配置为在 `localhost:5601` 上运行。你需要更新文件(在这个例子的情况下)`~Downloads/kibana-7.1.1-darwin-x86_64/config/kibana.yml` 以在运行 Kibana 之前更改主机或端口号。 ![The Kibana config directory.](/data/attachment/album/201907/22/204150pnu0oz3en1adz2r0.png "The Kibana config directory.") 以下是我的 Elasticsearch 聚会组里配置 Kibana 时终端的样子,因此默认为 `http://localhost:9200`,这是查询 Elasticsearch 实例时使用的 URL: ![Configuring Kibana's host and port connections.](/data/attachment/album/201907/22/204151nfmxxywrraf2yf35.png "Configuring Kibana's host and port connections.") ### 从命令行运行 Kibana 打开插件后,可以从命令行或 GUI 运行 Kibana。这是终端连接到 Elasticsearch 后的样子: ![Kibana running once it's connected to Elasticsearch.](/data/attachment/album/201907/22/204153p63k00hiredgsddg.png "Kibana running once it's connected to Elasticsearch.") 与 Elasticsearch 一样,Kibana 默认在前台运行。你可以按 `Ctrl-C` 来停止它。 ### 总结 Elasticsearch 和 Kibana 是占用大量存储空间的大型软件包。有这么多人一次下载这两个软件包,当我的Elasticsearch 会员和我下载它们两个时,我平均要下载几分钟。这可能是由于 WiFi 不佳和/或用户数量太多,但如果发生同样的事情,请记住这种可能性。 之后,由于我的笔记本电脑存储空间不足,我无法上传我们正在使用的 JSON 文件。我能够按照讲师的可视化进行操作,但无法实时使用 Kibana。因此,在下载 Elasticsearch 和 Kibana 之前,请确保设备上有足够的空间(至少几千兆字节)来上传和使用这些工具搜索文件。 要了解有关 Kibana 的更多信息,他们的用户指南[简介](https://www.elastic.co/guide/en/kibana/7.2/introduction.html)是理想的。(你可以根据你正在使用的 Kibana 版本配置该指南。)他们的演示还向你展示了如何[在几分钟内构建仪表板](https://www.elastic.co/webinars/getting-started-kibana?baymax=rtp&elektra=docs&storm=top-video&iesrc=ctr),然后进行首次部署。 玩得开心! --- via: <https://opensource.com/article/19/7/installing-kibana-macos> 作者:[Lauren Maffeo](https://opensource.com/users/lmaffeo) 选题:[lujun9972](https://github.com/lujun9972) 译者:[wxy](https://github.com/wxy) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
null
HTTPSConnectionPool(host='opensource.com', port=443): Read timed out. (read timeout=10)
null
11,138
10 个 Linux 中最好的 Visio 替代品
https://itsfoss.com/visio-alternatives-linux/
2019-07-23T07:35:19
[ "Visio" ]
https://linux.cn/article-11138-1.html
> > 如果你正在 Linux 中寻找一个好的 Visio 查看器,这里有一些可以在 Linux 中使用的微软 Visio 的替代方案。 > > > [微软 Visio](https://products.office.com/en/visio/flowchart-software) 是创建或生成关键任务图和矢量表示的绝佳工具。虽然它可能是制作平面图或其他类型图表的好工具 —— 但它既不是免费的,也不是开源的 此外,微软 Visio 不是一个独立的产品。它与微软 Office 捆绑在一起。我们过去已经看过 [MS Office 的开源替代品](https://itsfoss.com/best-free-open-source-alternatives-microsoft-office/)。今天我们将看看你可以在 Linux 上使用哪些工具代替 Visio。 ### 适用于 Linux 的最佳 微软 Visio 备选方案 ![用于 Linux 的微软 Visio 备选方案](/data/attachment/album/201907/23/073521hp23n7nnff7p7i7l.png) 此处为强制性免责声明。该列表不是排名。排名第三的产品并不比排名第六的好。 我还提到了两个可以从 Web 界面使用的非开源 Visio 软件。 | 软件 | 类型 | 许可证类型 | | --- | --- | --- | | [LibreOffice Draw](https://www.libreoffice.org/discover/draw/) | 桌面软件 | 自由开源 | | [OpenOffice Draw](https://www.openoffice.org/product/draw.html) | 桌面软件 | 自由开源 | | [Dia](http://dia-installer.de/) | 桌面软件 | 自由开源 | | [yED Graph Editor](https://www.yworks.com/products/yed) | 桌面和基于 Web | 免费增值 | | [Inkscape](https://inkscape.org/en/) | 桌面软件 | 自由开源 | | [Pencil](http://pencil.evolus.vn/Downloads.html) | 桌面和基于 Web | 自由开源 | | [Graphviz](http://graphviz.org/) | 桌面软件 | 自由开源 | | [darw.io](https://about.draw.io/) | 桌面和基于 Web | 自由开源 | | [Lucidchart](https://www.lucidchart.com/) | 基于 Web | 免费增值 | | [Calligra Flow](https://www.calligra.org/flow/) | 桌面软件 | 自由开源 | ### 1、LibreOffice Draw ![](/data/attachment/album/201907/23/073522vez9neebnpeqgxqx.jpg) LibreOffice Draw 模块是微软 Visio 的最佳开源替代方案之一。在它的帮助下,你可以选择制作一个想法的速写或一个复杂的专业平面布置图来展示。流程图、组织结构图、网络图、小册子、海报等等!所有这些都不需要花一分钱。 好的是它与 LibreOffice 捆绑在一起,默认情况下安装在大多数 Linux 发行版中。 #### 主要功能概述: * 用于制作宣传册/海报的样式和格式工具 * Calc 数据可视化 * PDF 文件编辑功能 * 通过操作图库中的图片来创建相册 * 灵活的绘图工具类似于 微软 Visio (智能连接器,尺寸线等)的工具 * 支持 .VSD 文件(打开) 官网:[LibreOffice Draw](https://www.libreoffice.org/discover/draw/) ### 2、Apache OpenOffice Draw ![](/data/attachment/album/201907/23/073522gz74j6g7x0ofz6ch.jpg) 很多人都知道 OpenOffice(LibreOffice 项目最初就是基于它的),但他们并没有真正意识到 Apache OpenOffice Draw 可以作为微软 Visio 的替代方案。但事实上,它是另一个令人惊奇的开源图表软件工具。与 LibreOffice Draw 不同,它不支持编辑 PDF 文件,但它为任何类型的图表创建提供了绘图工具。 这只是个警告。仅当你的系统中已经有 OpenOffice 时才使用此工具。这是因为[安装 OpenOffice](https://itsfoss.com/install-openoffice-ubuntu-linux/) 是一件痛苦的事情,而且它已经[不再继续开发](https://itsfoss.com/openoffice-shutdown/)。 #### 主要功能概述: * 快速创建 3D 形状控制器 * 创建作品的 flash 版本(.swf) * 样式和格式工具 * 与微软 Visio 类似的灵活绘图工具(智能连接器、尺寸线等) 官网:[Apache OpenOffice Draw](https://www.openoffice.org/product/draw.html) ### 3、Dia ![](/data/attachment/album/201907/23/073522ff4qgjgc0gyq3ngc.jpg) Dia 是另一个有趣的开源工具。它可能不像前面提到的那样处于积极开发之中。但是,如果你正在寻找一个自由而开源的替代微软 Visio 的简单而体面的图表,那么 Dia 可能是你的选择。这个工具可能唯一让你失望的地方就是它的用户界面。除此之外,它还允许你为复杂的图使用强大的工具(但它看起来可能不太好 —— 所以我们建议你用于更简单的图)。 #### 主要功能概述: * 它可以通过命令行使用 * 样式和格式工具 * 用于自定义形状的形状存储库 * 与微软 Visio 类似的绘图工具(特殊对象、网格线、图层等) * 跨平台 官网:[Dia](http://dia-installer.de/) ### 4、yED Graph Editor 是最受欢迎的免费的微软 Visio 替代方案之一。如果你对它是一个免费软件而不是开源项目有些担心,你仍然可以通过 web 浏览器免费使用 [yED 的实时编辑器](https://www.yworks.com/products/yed-live)。如果你想用一个非常易于使用的界面快速绘制图表,这是最好的建议之一。 #### 主要功能概述: * 拖放功能,方便图表制作 * 支持导入外部数据进行链接 官网:[yED Graph Editor](https://www.yworks.com/products/yed) ### 5、Inkscape ![](/data/attachment/album/201907/23/073523pwzfsfss0sn434wh.jpg) Inkscape 是一个自由开源的矢量图形编辑器。你将拥有创建流程图或数据流程图的基本功能。它不提供高级的图表绘制工具,而是提供创建更简单图表的基本工具。因此,当你希望通过使用图库中的可用符号,在图库连接器工具的帮助下生成基本图时,Inkscape 可能是你的 Visio 替代品。 #### 主要功能概述: * 连接器工具 * 灵活的绘图工具 * 广泛的文件格式兼容性 官网:[Inkscape](https://inkscape.org/en/) ### 6、Pencil 项目 ![](/data/attachment/album/201907/23/073523jhl6ulnl36thwty1.jpg) Pencil 项目是一个令人印象深刻的开源项目,适用于 Windows、Mac 以及 Linux。它具有易于使用的图形界面,使绘图更容易和方便。它有一个很好的内建形状和符号的集合,可以使你的图表看起来很棒。它还内置了 Android 和 iOS UI 模板,可以让你在需要时创建应用程序原型。 你也可以将其安装为 Firefox 扩展,但该扩展不能使用项目的最新版本。 #### 主要功能概述: * 轻松浏览剪贴画(使用 openclipart.org) * 导出为 ODT 文件/PDF 文件 * 图表连接工具 * 跨平台 官网:[Pencil 项目](http://pencil.evolus.vn/Downloads.html) ### 7、Graphviz ![](/data/attachment/album/201907/23/073524zfyzp9tppftag9mc.jpg) Graphviz 略有不同。它不是绘图工具,而是专用的图形可视化工具。如果你在网络图中需要多个设计来表示一个节点,那么一定要使用这个工具。当然,你不能用这个工具做平面布置图(至少这不容易)。因此,它最适合于网络图、生物信息学、数据库连接和类似的东西。 #### 主要功能概述: * 支持命令行使用 * 支持自定义形状和表格节点布局 * 基本样式和格式设置工具 官网:[Graphviz](http://graphviz.org/) ### 8、Draw.io Draw.io 主要是一个基于 Web 的免费图表工具,它的强大的工具几乎可以制作任何类型的图表。你只需要拖放然后连接它们以创建流程图、ER 图或任何相关的。此外,如果你喜欢该工具,则可以尝试[离线桌面版本](https://about.draw.io/integrations/#integrations_offline)。 #### 主要功能概述: * 直接上传到云存储服务 * 自定义形状 * 样式和格式工具 * 跨平台 官网:[Draw.io](https://about.draw.io/) ### 9、Lucidchart ![](/data/attachment/album/201907/23/073524ofwrlsru0hsftpq4.jpg) Lucidchart 是一个基于 Web 的高级图表工具,它提供了一个具有有限功能的免费订阅。你可以使用免费订阅创建几种类型的图表,并将其导出为图像或 PDF。但是,免费版本不支持数据链接和 Visio 导入/导出功能。如果你不需要数据链接功能,Lucidchart 可以说是一个生成漂亮的图表的非常好的工具。 #### 主要功能概述: * 可以集成到 Slack、Jira 核心、Confluence * 能够制作产品模型 * 导入 Visio 文件 官网:[Lucidchart](https://www.lucidchart.com/) ### 10、Calligra Flow ![calligra flow](/data/attachment/album/201907/23/073525gfusm6euuimerm7z.jpg) Calligra Flow 是 [Calligra 项目](https://www.calligra.org/)的一部分,旨在提供自由开源的软件工具。使用 Calligra flow 你可以轻松地创建网络图、实体关系图、流程图等 #### 主要功能概述: * 各种模具盒 * 样式和格式工具 官网:[Calligra Flow](https://www.calligra.org/flow/) ### 总结 既然你已经了解到了这些最好的自由开源的 Visio 替代方案,你对它们有什么看法? 对于你任何方面的需求,它们是否优于 微软 Visio?另外,如果我们错过了你最喜欢的基于 Linux 的替代微软 Visio 的绘图工具,请在下面的评论中告诉我们。 --- via: <https://itsfoss.com/visio-alternatives-linux/> 作者:[Ankush Das](https://itsfoss.com/author/ankush/) 译者:[ZhiW5217](https://github.com/ZhiW5217) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
**Brief: If you are looking for a good Visio viewer in Linux, here are some alternatives to Microsoft Visio that you can use in Linux.** [Microsoft Visio](https://products.office.com/en/visio/flowchart-software) is a great tool for creating or generating mission-critical diagrams and vector representations. While it may be a good tool for making floor plans or other kinds of diagrams – it is neither free nor open source. Moreover, Microsoft Visio is not a standalone product. It comes bundled with Microsoft Office. We have already seen [open source alternatives to MS Office](https://itsfoss.com/best-free-open-source-alternatives-microsoft-office/) in the past. Today we’ll see what tools you can use in place of Visio on Linux. **Note:** *The alternatives mentioned here may not completely offer the same features but could act as replacements for some requirements.* ## Best Microsoft Visio alternatives for Linux ![Microsoft Visio Alternatives for Linux](https://itsfoss.com/content/images/wordpress/2017/12/visio-alternatives-linux-featured.png) Mandatory disclaimer here. The list is not a ranking. The product at number three is not better than the one at number six on the list. I have also mentioned a couple of non open source Visio software that you can use from the web interface. Software | Type | License Type | ---|---|---| | [OpenOffice Draw](#apachedraw)[Dia](#dia)[yED Graph Editor](#yed)[Inkscape](#inkscape)[Pencil](#pencil)[Graphviz](#graphviz)[Diagrams.net](https://www.diagrams.net/)[Lucidchart](#lucidchart)[Calligra Flow](#calligra)### 1. LibreOffice Draw ![](https://itsfoss.com/content/images/wordpress/2017/12/libreoffice-draw-microsoft-visio-alternatives.jpg) LibreOffice Draw module is one of the best open source alternatives to Microsoft Visio. With the help of it, you can either choose to make a quick sketch of an idea or a complex professional floor plan for presentation. Flowcharts, organization charts, network diagrams, brochures, posters, and what not! All that without even requiring to spend a penny. The Good thing is that it comes bundled with LibreOffice which is installed in most Linux distributions by default. #### Overview of Key Features: - Style & Formatting tools to make Brochures/Posters - Calc Data Visualization - PDF-File editing capability - Create Photo Albums by manipulating the pictures from Gallery - Flexible Diagramming tools similar to the ones with Microsoft Visio (Smart Connectors, Dimension lines, etc.,) - Supports .VSD files (to open) ### 2. Apache OpenOffice Draw ![](https://itsfoss.com/content/images/wordpress/2017/12/apache-open-office-draw.jpg) A lot of people do know about OpenOffice (on which LibreOffice project was initially based on) but they don’t really mention Apache OpenOffice Draw as an alternative to Microsoft Visio. But, for a fact – it is yet another amazing open-source diagramming software tool. Unlike LibreOffice Draw, it does not support editing PDF files but it does offer drawing tools for any type of diagram creation. Just a caveat here. Use this tool only if you have OpenOffice already on your system. This is because [installing OpenOffice](https://itsfoss.com/install-openoffice-ubuntu-linux/) is a pain and it is [not properly developed anymore](https://itsfoss.com/openoffice-shutdown/). #### Overview of Key Features: - 3D Controller to create shapes quickly - Create (.swf) flash versions of your work - Style & Formatting tools - Flexible Diagramming tools similar to the ones with Microsoft Visio (Smart Connectors, Dimension lines, etc.,) ### 3. Dia (No longer developed) ![](https://itsfoss.com/content/images/wordpress/2017/12/dia-screenshot.jpg) Dia is yet another interesting open source tool. It may not seem to be under active development like the other ones mentioned. But, if you were looking for a free and open-source alternative to Microsoft Visio for simple and decent diagrams – Dia could be your choice to experiment. The only let down of this tool for you could be its user interface. Apart from that, it does let you utilize powerful tools for a complex diagram (but it may not look great – so we recommend it for simpler diagrams). #### Overview of Key Features: - It can be used via command-line - Styling & Formatting tools - Shape Repository for custom shapes - Diagramming tools similar to the ones with Microsoft Visio (Special Objects, Grid Lines, Layers, etc.,) - Cross-platform ### 4. yED Graph Editor (Not Open Source) yED Graph editor is one of the most loved free Microsoft Visio alternative. If you worry about it being a freeware but not an open source project, you can still utilize [yED’s live editor](https://www.yworks.com/products/yed-live) via your web browser for free. It is one of the best recommendations if you want to make diagrams quickly with a very easy-to-use interface. #### Overview of Key Features: - Drag and drop feature for easy diagram making - Supports importing external data for linking ### 5. Inkscape ![](https://itsfoss.com/content/images/wordpress/2017/12/inkscape-screenshot.jpg) Inkscape is a free and open source vector graphics editor. You get the basic functionalities of creating a flowchart or a data flow diagram. It does not offer advanced diagramming tools but the basic ones to create simpler diagrams. So, Inkscape could be your Visio alternative only if you are looking to generate basic diagrams with the help of diagram connector tool by utilizing the available symbols from the library. #### Overview of Key Features: - Connector Tool - Flexible drawing tools - Broad file format compatibility ### 6. Pencil Project (No longer developed) ![](https://itsfoss.com/content/images/wordpress/2017/12/pencil-project.jpg) Pencil Project is an impressive open source initiative that is available for both Windows and Mac along with Linux. It features an easy-to-use GUI which makes diagramming easier and convenient. A good collection of inbuilt shapes and symbols to make your diagrams look great. It also comes baked in with Android and iOS UI stencils to let you start prototyping apps when needed. You can also have it installed as a Firefox extension – but the extension does not utilize the latest build of the project. #### Overview of Key Features: - Browse cliparts easily (utilizing openclipart.org) - Export as an ODT file / PDF file - Diagram connector tool - Cross-platform ### 7. Graphviz ![](https://itsfoss.com/content/images/wordpress/2017/12/graphviz.jpg) Graphviz is slightly different. It is not a drawing tool but a dedicated graph visualization tool. You should definitely utilize this tool if you are into network diagrams which require several designs to represent a node. Well, of course, you can’t make a floor plan with this tool (it won’t be easy at least). So, it is best-suited for network diagrams, bioinformatics, database connections, and similar stuff. #### Overview of Key Features: - Supports command-line usage - Supports custom shapes & tabular node layouts - Basic stying and formatting tools ### 8. Diagrams.net ![diagrams net](https://itsfoss.com/content/images/wordpress/2021/02/diagrams-net.png) Digrams.net (formerly draw.io) is primarily a free and open-source web-based diagramming tool with powerful tools to make almost any type of diagrams. You just need to drag and drop and then connect them to create a flowchart, an E-R diagram, or anything relevant. Also, if you like the tool, you can try the [offline desktop version](https://github.com/jgraph/drawio-desktop/releases/tag/v14.4.2) for enhanced privacy. It also works with your existing tools like Office 365 apps, Google workplace, and offers integrations with GitLab/GitHub as well. **Overview of Key Features:** - Direct uploads to a cloud storage service - Custom Shapes - Styling & Formatting tools - Cross-platform ### 9. Lucidchart ![lucidchart screenshot](https://itsfoss.com/content/images/wordpress/2021/02/lucidchart-screenshot.png) Lucidchart is a premium web-based diagramming tool which offers a free subscription with limited features. You can utilize the free subscription to create several types of diagrams and export them as an image or a PDF. However, the free version does not support data linking and Visio import/export functionality. If you do not need data linking -Lucidchart could prove to be a very good tool while generating beautiful diagrams. #### Overview of Key Features: - Integrations to Slack, Jira Core, Confluence - Ability to make product mockups - Import Visio files ### 10. Calligra Flow ![calligra flow](https://itsfoss.com/content/images/wordpress/2017/12/calligra-flow.jpg) Calligra Flow is a part of [Calligra Project](https://www.calligra.org/) which aims to provide free and open-source software tools. With Calligra flow, you can easily create network diagrams, entity-relation diagrams, flowcharts, and more. #### Overview of Key Features: - Wide range of stencil boxes - Styling and formatting tools ### Wrapping Up Now that you know about the best free and open source Visio alternatives, what do you think about them? Are they better than Microsoft Visio in any aspect of your requirements? Also, let us know in the comments below if we missed any of your favorite diagramming tools as a Linux alternative to Microsoft Visio.
11,141
使用 ImageGlass 以幻灯片形式快速查看 JPG 图像
https://opensource.com/article/19/6/use-imageglass-view-jpg-images-slideshow-windows-10
2019-07-23T23:34:21
[ "幻灯片" ]
https://linux.cn/article-11141-1.html
> > 想要在 Windows 10 中以幻灯片形式逐个查看文件夹中的图像么?开源软件可以做到。 > > > ![Looking back with binoculars](/data/attachment/album/201907/23/233438bnaxazkwf6bfxw92.png "Looking back with binoculars") 欢迎阅读今天的系列文章 “我该如何让它实现?”就我而言,我试图在 Windows 10 上以幻灯片形式查看 JPG 图像的文件夹。像往常一样,我转向开源来解决这个问题。 在 Mac 上,以幻灯片形式查看 JPG 图像文件夹只需选择文件夹中的所有图像(`Command-A`),然后按 `Option-Command-Y` 即可。之后,你可以使用箭头键向前翻动。当然,在 Windows 中,你可以通过选择第一个图像,然后单击窗口中黄色的**管理**栏,然后选择**幻灯片**来执行类似的操作。在那里,你可以控制速度,但只能做到:慢、中、快。 我希望像在 Windows 中能像 Mac 一样翻下一张图片。自然地,我 Google 搜索了一下并找到了一个方案。我发现了 [ImageGlass](https://imageglass.org/) 这个开源应用,其许可证是 [GPL 3.0](https://github.com/d2phap/ImageGlass/blob/master/LICENSE),并且它完美地做到了。这是它的样子: ![Viewing an image in ImageGlass.](/data/attachment/album/201907/23/233520tq08b2si0d0i8ljr.png "Viewing an image in ImageGlass.") ### 关于 ImageGlass ImageGlass 是由 Dương Diệu Pháp 开发的,根据他的网站,他是一名越南开发人员,在 Chainstack 负责前端。他与在美国的 [Kevin Routley](https://github.com/fire-eggs) 协作,后者“为 ImageGlass 开发新功能”。源代码可以在 [GitHub](https://github.com/d2phap/ImageGlass) 上找到。 ImageGlass 支持最常见的图像格式,包括 JPG、GIF、PNG、WEBP、SVG 和 RAW。用户可以轻松自定义扩展名列表。 我遇到的具体问题是需要找到一张用于目录封面的图像。不幸的是,它在一个包含数十张照片的文件夹中。在 ImageGlass 中以幻灯片浏览照片,在我想要的照片前停止,并将其下载到我的项目文件夹中变得很容易。开源再次帮助了我,该应用只花了很短的时间下载和使用。 在 2016 年 3 月 10 日,Jason Baker 在他的文章 [9 款 Picasa 的开源替代品](https://opensource.com/alternatives/picasa) 中将 ImageGlass 列为其中之一。如果你有需求,里面还有一些其他有趣的图像相关工具。 --- via: <https://opensource.com/article/19/6/use-imageglass-view-jpg-images-slideshow-windows-10> 作者:[Jeff Macharyas](https://opensource.com/users/jeffmacharyas) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
Welcome to today’s episode of "How Can I Make This Work?" In my case, I was trying to view a folder of JPG images as a slideshow on Windows 10. As often happens, I turned to open source to solve the issue. On a Mac, viewing a folder of JPG images as a slideshow is a simple matter of selecting all the images in a folder (**Command-A**), and then pressing **Option-Command-Y**. From there, you can advance the images with the arrow key. Of course, you can do a similar thing on Windows by selecting the first image, then clicking on the window frame's yellow **Manage** bar, then selecting **Slide Show**. There, you can control the speed, but only to a point: slow, medium, and fast. I wanted to advance the images in Windows the same way I do it on a Mac. Naturally, I fired up the Googler and searched for a solution. There, I found the [ImageGlass](https://imageglass.org/) open source app, [licensed GPL 3.0](https://github.com/d2phap/ImageGlass/blob/master/LICENSE), and it did the trick perfectly. Here's what it looks like: ![Viewing an image in ImageGlass. Viewing an image in ImageGlass.](https://opensource.com/sites/default/files/uploads/imageglass-screenshot.png) ## About ImageGlass ImageGlass was developed by Dương Diệu Pháp, a Vietnamese developer who works on the front end for Chainstack, according to his website. He collaborates with US-based [Kevin Routley](https://github.com/fire-eggs), who "develops new features for ImageGlass." The source code is available on [GitHub](https://github.com/d2phap/ImageGlass). ImageGlass supports most common image formats, including JPG, GIF, PNG, WEBP, SVG, and RAW. Users can customize this extension list easily. My specific problem was needing to find an image for a catalog cover. Unfortunately, it was in a folder containing dozens of photos. Navigating through the slideshow in ImageGlass, stopping on the image I wanted, and downloading it into my project folder turned out to be easy. Open source to the rescue yet again, and the app took only seconds to download and use. ImageGlass was featured as a Picasa alternative in Jason Baker’s article [9 open source alternatives to ](https://opensource.com/alternatives/picasa)[Picasa](https://opensource.com/alternatives/picasa) from March 10, 2016. There are some other interesting image-related open source tools in there as well if you are in need. ## Comments are closed.
11,142
用大写字母输入 Linux 命令以将其作为 sudo 用户运行
https://www.ostechnix.com/type-linux-commands-in-capital-letters-to-run-them-as-sudo-user/
2019-07-24T09:11:04
[ "sudo" ]
https://linux.cn/article-11142-1.html
![Type Linux Commands In Capital Letters To Run Them As Sudo User](/data/attachment/album/201907/24/091111leufqj6vujuu9evz.png) 我非常喜欢 Linux 社区的原因是他们创建了很多有趣的项目,你很少能在任何其他操作系统中找到它们。不久前,我们看了一个名为 [Hollywood](https://www.ostechnix.com/turn-ubuntu-terminal-hollywood-technical-melodrama-hacker-interface/) 的有趣项目,它在类 Ubuntu 系统将终端变成了好莱坞技术情景剧的黑客界面。还有一些其他工具,例如 `cowsay`、`fortune`、`sl` 和 `toilet` 等,用来消磨时间自娱自乐!它们可能没有用,但这些程序娱乐性不错并且使用起来很有趣。今天,我偶然发现了另一个名为 `SUDO` 的类似工具。正如名字暗示的那样,你无论何时用大写字母输入 Linux 命令,`SUDO` 程序都会将它们作为 sudo 用户运行!这意味着,你无需在要运行的 Linux 命令前面输入 `sudo`。很酷,不是么? ### 安装 SUDO > > 提醒一句: > > > 在安装这个程序(或任何程序)之前,请查看源代码(最后给出的链接),并查看是否包含会损害你的系统的可疑/恶意代码。在 VM 中测试它。如果你喜欢或觉得它很有用,你可以在个人/生产系统中使用它。 > > > 用 Git 克隆 `SUDO` 仓库: ``` $ git clone https://github.com/jthistle/SUDO.git ``` 此命令将克隆 SUDO GIT 仓库的内容,并将它们保存在当前目录下的 `SUDO` 的目录中。 ``` Cloning into 'SUDO'... remote: Enumerating objects: 42, done. remote: Counting objects: 100% (42/42), done. remote: Compressing objects: 100% (29/29), done. remote: Total 42 (delta 17), reused 30 (delta 12), pack-reused 0 Unpacking objects: 100% (42/42), done. ``` 切换到 `SUDO` 目录: ``` $ cd SUDO/ ``` 并使用命令安装它: ``` $ ./install.sh ``` 该命令将在 `~/.bashrc` 文件中添加以下行: ``` [...] # SUDO - shout at bash to su commands # Distributed under GNU GPLv2, @jthistle on github shopt -s expand_aliases IFS_=${IFS} IFS=":" read -ra PATHS <<< "$PATH" for i in "${PATHS[@]}"; do for j in $( ls "$i" ); do if [ ${j^^} != $j ] && [ $j != "sudo" ]; then alias ${j^^}="sudo $j" fi done done alias SUDO='sudo $(history -p !!)' IFS=${IFS_} # end SUDO ``` 它还会备份你的 `~/.bashrc` 并将其保存为 `~/.bashrc.old`。如果有重大错误,你可以恢复它。 最后,使用命令更新更改: ``` $ source ~/.bashrc ``` ### 现在,用大写字母中输入 Linux 命令,将它们作为 Sudo 用户运行 通常我们像下面那样执行需要 sudo/root 权限的命令。 ``` $ sudo mkdir /ostechnix ``` 对么?没错!上面的命令将在根目录(`/`)中创建名为 `ostechnix` 的目录。让我们使用 `Ctrl + c` 取消。 一旦安装了 `SUDO`,你就可以**在不使用 sudo 的情况下输入任何大写 Linux 命令**并运行它们。因此,你可以像下面那样运行上面的命令: ``` $ MKDIR /ostechnix $ TOUCH /ostechnix/test.txt $ LS /ostechnix ``` ![](/data/attachment/album/201907/24/091112jygas3632iff6rae.gif) 用大写字母输入 Linux 命令以将其作为 sudo 用户运行 请注意**它无法绕过 sudo 密码**。你仍然需要键入 `sudo` 密码才能执行给定的命令。它只会有助于避免在每个命令前面输入 `sudo`。 相关阅读: * [如何在 Linux 中没有 sudo 密码运行特定命令](https://www.ostechnix.com/run-particular-commands-without-sudo-password-linux/) * [如何恢复用户的 sudo 权限](https://www.ostechnix.com/how-to-restore-sudo-privileges-to-a-user/) * [如何在 Ubuntu 上为用户授予和删除 sudo 权限](https://www.ostechnix.com/how-to-grant-and-remove-sudo-privileges-to-users-on-ubuntu/) * [如何在 Linux 系统中查找所有 sudo 用户](https://www.ostechnix.com/find-sudo-users-linux-system/) * [如何在终端中输入密码时显示星号](https://www.ostechnix.com/display-asterisks-type-password-terminal/) * [如何更改 Linux 中的 sudo 提示符](https://www.ostechnix.com/change-sudo-prompt-linux-unix/) 当然,输入 `sudo` 只需几秒钟,所以这不是什么大问题。 我必须告诉这是一个用来消磨时间的有趣且无用的项目。 如果你不喜欢它,那就去学习一些有用的东西吧。 如果你喜欢它,试一试,玩得开心! 资源: * [SUDO GitHub 仓库](https://github.com/jthistle/SUDO) --- via: <https://www.ostechnix.com/type-linux-commands-in-capital-letters-to-run-them-as-sudo-user/> 作者:[sk](https://www.ostechnix.com/author/sk/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
403
Forbidden
null
11,144
使用 Python 解析参数
https://opensource.com/article/19/7/parse-arguments-python
2019-07-24T21:04:07
[ "参数" ]
https://linux.cn/article-11144-1.html
> > 使用 argparse 模块像专业人士一样解析参数。 > > > ![](/data/attachment/album/201907/24/210351h99gzcttqmk7c7mx.jpg) 如果你在使用 [Python](https://www.python.org/) 进行开发,你可能会在终端中使用命令,即使只是为了启动 Python 脚本或使用 [pip](https://pip.pypa.io/en/stable/installing/) 安装 Python 模块。命令可能简单而单一: ``` $ ls ``` 命令也可能需要参数: ``` $ ls example ``` 命令也可以有选项或标志: ``` $ ls --color example ``` 有时选项也有参数: ``` $ sudo firewall-cmd --list-all --zone home ``` ### 参数 POSIX shell 会自动将你输入的内容作为命令分成数组。例如,这是一个简单的命令: ``` $ ls example ``` 命令 `ls` 的位置是 `$0`,参数 `example` 位置是 `$1`。 你**可以**写一个循环迭代每项。确定它是否是命令、选项还是参数。并据此采取行动。幸运的是,已经有一个名为 [argparse](https://pypi.org/project/argparse/) 的模块。 ### argparse argparse 模块很容易集成到 Python 程序中,并有多种便利功能。例如,如果你的用户更改选项的顺序或使用一个不带参数的选项(称为**布尔**,意味着选项可以打开或关闭设置),然后另一个需要参数(例如 `--color red`),argparse 可以处理多种情况。如果你的用户忘记了所需的选项,那么 argparse 模块可以提供友好的错误消息。 要在应用中使用 argparse,首先要定义为用户提供的选项。你可以接受几种不同的参数,而语法一致又简单。 这是一个简单的例子: ``` #!/usr/bin/env python import argparse import sys def getOptions(args=sys.argv[1:]): parser = argparse.ArgumentParser(description="Parses command.") parser.add_argument("-i", "--input", help="Your input file.") parser.add_argument("-o", "--output", help="Your destination output file.") parser.add_argument("-n", "--number", type=int, help="A number.") parser.add_argument("-v", "--verbose",dest='verbose',action='store_true', help="Verbose mode.") options = parser.parse_args(args) return options ``` 此示例代码创建一个名为 `getOptions` 的函数,并告诉 Python 查看每个可能的参数,前面有一些可识别的字符串(例如 `--input` 或者 `-i`)。 Python 找到的任何选项都将作为 `options` 对象从函数中返回(`options` 是一个任意名称,且没有特殊含义。它只是一个包含函数已解析的所有参数的摘要的数据对象)。 默认情况下,Python 将用户给出的任何参数视为字符串。如果需要提取整数(数字),则必须指定选项 `type=int`,如示例代码中的 `--number` 选项。 如果你有一个只是关闭和打开功能的参数,那么你必须使用 `boolean` 类型,就像示例代码中的 `--verbose` 标志一样。这种选项只保存 `True` 或 `False`,用户用来指定是否使用标志。如果使用该选项,那么会激活 `stored_true`。 当 `getOptions` 函数运行时,你就可以使用 `options` 对象的内容,并让程序根据用户调用命令的方式做出决定。你可以使用测试打印语句查看 `options` 的内容。将其添加到示例文件的底部: ``` print(getOptions()) ``` 然后带上参数运行代码: ``` $ python3 ./example.py -i foo -n 4 Namespace(input='foo', number=4, output=None, verbose=False) ``` ### 检索值 示例代码中的 `options` 对象包含了用户提供的选项后面的值(或派生的布尔值)。例如,在示例代码中,可以通过 `options.number` 来检索 `--number`。 ``` options = getOptions(sys.argv[1:]) if options.verbose: print("Verbose mode on") else: print("Verbose mode off") print(options.input) print(options.output) print(options.number) # 这里插入你的 Python 代码 ``` 示例中的布尔选项 `--verbose` 是通过测试 `options.verbose` 是否为 `True`(意味着用户使用了 `--verbose` 标志)或 `False`(用户没有使用 `--verbose` 标志),并采取相应的措施。 ### 帮助和反馈 argparse 还包含一个内置的 `--help`(简写 `-h`)选项,它提供了有关如何使用命令的提示。这是从你的代码派生的,因此生成此帮助系统不需要额外的工作: ``` $ ./example.py --help usage: example.py [-h] [-i INPUT] [-o OUTPUT] [-n NUMBER] [-v] Parses command. optional arguments: -h, --help show this help message and exit -i INPUT, --input INPUT Your input file. -o OUTPUT, --output OUTPUT Your destination output file. -n NUMBER, --number NUMBER A number. -v, --verbose Verbose mode. ``` ### 像专业人士一样用 Python 解析 这是一个简单的示例,来演示如何在 Python 应用中的解析参数以及如何快速有效地记录它的语法。下次编写 Python 脚本时,请使用 argparse 为其提供一些选项。你以后会感到自得,你的命令不会像一个快速的临时脚本,更像是一个“真正的” Unix 命令! 以下是可用于测试的示例代码: ``` #!/usr/bin/env python3 # GNU All-Permissive License # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. This file is offered as-is, # without any warranty. import argparse import sys def getOptions(args=sys.argv[1:]): parser = argparse.ArgumentParser(description="Parses command.") parser.add_argument("-i", "--input", help="Your input file.") parser.add_argument("-o", "--output", help="Your destination output file.") parser.add_argument("-n", "--number", type=int, help="A number.") parser.add_argument("-v", "--verbose",dest='verbose',action='store_true', help="Verbose mode.") options = parser.parse_args(args) return options options = getOptions(sys.argv[1:]) if options.verbose: print("Verbose mode on") else: print("Verbose mode off") print(options.input) print(options.output) print(options.number) ``` --- via: <https://opensource.com/article/19/7/parse-arguments-python> 作者:[Seth Kenlon](https://opensource.com/users/seth/users/notsag) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
If you're using [Python](https://www.python.org/) for any amount of development, you have probably issued a command in a terminal, even if only to launch a Python script or install a Python module with [pip](https://pip.pypa.io/en/stable/installing/). Commands may be simple and singular: `$ ls` Commands also might take an argument: `$ ls example` Commands can also have options or flags: `$ ls --color example` Sometimes options also have arguments: `$ sudo firewall-cmd --list-all --zone home` ## Arguments The POSIX shell automatically splits whatever you type as a command into an array. For instance, here is a simple command: `$ ls example` The command **ls** is position **$0**, and the argument **example** is in position **$1**. You *could* write a loop to iterate over each item; determine whether it is the command, an option, or an argument; and take action accordingly. Luckily, a module called [argparse](https://pypi.org/project/argparse/) already exists for that. ## Argparse The argparse module is easy to integrate into your Python programs and has several convenience features. For instance, if your user changes the order of options or uses one option that takes no arguments (called a *Boolean*, meaning the option toggles a setting on or off) and then another that requires an argument (such as **--color red**, for example), argparse can handle the variety. If your user forgets an option that's required, the argparse module can provide a friendly error message. Using argparse in your application starts with defining what options you want to provide your user. There are several different kinds of arguments you can accept, but the syntax is consistent and simple. Here's a simple example: ``` #!/usr/bin/env python import argparse import sys def getOptions(args=sys.argv[1:]): parser = argparse.ArgumentParser(description="Parses command.") parser.add_argument("-i", "--input", help="Your input file.") parser.add_argument("-o", "--output", help="Your destination output file.") parser.add_argument("-n", "--number", type=int, help="A number.") parser.add_argument("-v", "--verbose",dest='verbose',action='store_true', help="Verbose mode.") options = parser.parse_args(args) return options ``` This code sample creates a function called **getOptions** and tells Python to look at each potential argument preceded by some recognizable string (such as **--input** or **-i**). Any option that Python finds is returned out of the function as an **options** object (**options** is an arbitrary name and has no special meaning; it's just a data object containing a summary of all the arguments that the function has parsed). By default, any argument given by the user is seen by Python as a string. If you need to ingest an integer (a number), you must specify that an option expects **type=int**, as in the **--number** option in the sample code. If you have an argument that just turns a feature on or off, then you must use the **boolean** type, as with the **--verbose** flag in the sample code. This style of option simply stores **True** or **False**, specifying whether or not the user used the flag. If the option is used, then **stored_true** is activated. Once the **getOptions** function runs, you can use the contents of the **options** object and have your program make decisions based on how the user invoked the command. You can see the contents of **options** with a test print statement. Add this to the bottom of your example file: `print(getOptions())` Then run the code with some arguments: ``` $ python3 ./example.py -i foo -n 4 Namespace(input='foo', number=4, output=None, verbose=False) ``` ## Retrieving values The **options** object in the sample code contains any value provided by the user (or a derived Boolean value) in keys named after the long option. In the sample code, for instance, the **--number** option can be retrieved by looking at **options.number**. ``` options = getOptions(sys.argv[1:]) if options.verbose: print("Verbose mode on") else: print("Verbose mode off") print(options.input) print(options.output) print(options.number) # Insert Useful Python Code Here... ``` The Boolean option, **--verbose** in the example, is determined by testing whether **options.verbose** is True (meaning the user did use the **--verbose** flag) or False (the user did not use the **--verbose** flag), and taking some action accordingly. ## Help and feedback Argparse also includes a built-in **--help** (**-h** for short) option that provides a helpful tip on how the command is used. This is derived from your code, so it takes no extra work to generate this help system: ``` $ ./example.py --help usage: example.py [-h] [-i INPUT] [-o OUTPUT] [-n NUMBER] [-v] Parses command. optional arguments: -h, --help show this help message and exit -i INPUT, --input INPUT Your input file. -o OUTPUT, --output OUTPUT Your destination output file. -n NUMBER, --number NUMBER A number. -v, --verbose Verbose mode. ``` ## Python parsing like a pro This a simple example that demonstrates how to deal with parsing arguments in a Python application and how to quickly and efficiently document their syntax. The next time you write a quick Python script, give it some options with argparse. You'll thank yourself later, and your command will feel less like a quick hack and more like a "real" Unix command! Here's the sample code, which you can use for testing: ``` #!/usr/bin/env python3 # GNU All-Permissive License # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. This file is offered as-is, # without any warranty. import argparse import sys def getOptions(args=sys.argv[1:]): parser = argparse.ArgumentParser(description="Parses command.") parser.add_argument("-i", "--input", help="Your input file.") parser.add_argument("-o", "--output", help="Your destination output file.") parser.add_argument("-n", "--number", type=int, help="A number.") parser.add_argument("-v", "--verbose",dest='verbose',action='store_true', help="Verbose mode.") options = parser.parse_args(args) return options options = getOptions(sys.argv[1:]) if options.verbose: print("Verbose mode on") else: print("Verbose mode off") print(options.input) print(options.output) print(options.number) ``` ## 4 Comments
11,145
最适合于初学者的 Linux 发行版
https://itsfoss.com/best-linux-beginners/
2019-07-25T10:29:40
[ "发行版" ]
https://linux.cn/article-11145-1.html
> > 在本文中,我们将看到**最适合于初学者的 Linux 发行版**。这将有助于 Linux 新用户选择他们的第一个发行版。 > > > ![](/data/attachment/album/201907/25/102920n7y7xdzyl2td5yfy.jpg) 让我们面对现实,[Linux](https://www.linux.com/what-is-linux) 可能会给新用户带来巨大的复杂性。但是,带来这种复杂性的并不是 Linux 本身。相反,是“新奇”因素导致了这种情况。并不是怀旧,但我记得第一次使用 Linux 时,我甚至不知道会发生什么。我喜欢它,但最初这对我来说像是逆流游泳一样。 不知道从何处着手可能是一个令人沮丧的原因,特别是对于那些在 PC 上运行 Windows 之外的其它系统没有概念的人来说。 Linux 不仅仅是一个操作系统,而是一个理念:在这里大家共同成长,也适合于每个人的不同需要。我们已经介绍过: * [Windows 用户的最佳 Linux 发行版](https://itsfoss.com/windows-like-linux-distributions/) * [最佳轻量级 Linux 发行版](https://itsfoss.com/lightweight-linux-beginners/) * [黑客攻击的最佳 Linux 发行版](https://itsfoss.com/linux-hacking-penetration-testing/) * [最佳 Linux 游戏发行版](https://itsfoss.com/linux-gaming-distributions/) * [隐私和匿名的最佳 Linux 发行版](https://itsfoss.com/privacy-focused-linux-distributions/) * [看起来像 MacOS 的最佳 Linux 发行版](https://itsfoss.com/macos-like-linux-distros/) 除此之外,还有一些能够特别满足新人需求的发行版。这里有一些这样的适合初学者的 Linux 发行版。你也可以在视频中观看并[订阅我们的 YouTube 频道](https://www.youtube.com/c/itsfoss)以获取更多与 Linux 相关的视频。 ### 最适合于初学者的 Linux 发行版 请记住,此列表没有特别的顺序。编制此列表的主要标准是易于安装、开箱即用的硬件和软件、易用性和软件包的可用性。 #### 1、Ubuntu 如果你在互联网上研究过 Linux,那么你很可能遇到过 Ubuntu。Ubuntu 是领先的 Linux 发行版之一,它也是开始 Linux 之旅的完美之选。 ![](/data/attachment/album/201907/25/102945kms2vv2v75jmsf0x.jpg) Ubuntu 被视为人性化的 Linux,这是因为 Ubuntu 在通用可用性上付出了很多努力。Ubuntu 并不要求你在技术方面懂得很多才能使用它。它打破了 “Linux = 命令行麻烦”这一概念。这是 Ubuntu 飙升到今天的主要优势之一。 Ubuntu 提供了非常方便的安装程序。这个安装程序以简单的英语(或你想要的任何主要语言)描述安装过程。你甚至可以在实际执行安装过程之前尝试使用 Ubuntu。安装程序提供了简单的选项: * 删除旧操作系统以安装 Ubuntu。 * 与 Windows 或任何其他现有操作系统[一起](https://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/)安装 Ubuntu(每次启动时都会提供要启动的操作系统的选择列表)。 * 让高级用户自行配置分区。 *初学者提示:如果你不确定该怎么做,请选择第二个选项。* Ubuntu 的用户界面采用 GNOME。它简单、高效。你可以通过按 Windows 键搜索从应用程序到文件的任何内容。有什么比这更简单的吗? 没有驱动程序安装问题,因为 Ubuntu 附带硬件检测器,可以检测、下载和安装适用于你的 PC 的最佳驱动程序。此外,安装会附带所有基本软件,如音乐播放器、视频播放器、办公套件和一些消磨时间的游戏。 Ubuntu 拥有出色的文档和社区支持。[Ubuntu 论坛](https://ubuntuforums.org/)和 [Ask Ubuntu](http://askubuntu.com/) 几乎在 Ubuntu 的所有方面都提供了可观的高质量支持。你的一些问题很有可能已经得到了回答,这些答案是适合初学者的。 请在[官方网站](https://www.ubuntu.com/)查看并下载 [Ubuntu](https://www.ubuntu.com/)。 #### 2、Linux Mint Cinnamon 多年来,Linux Mint 一直是 [Distrowatch](https://distrowatch.com/) 上的**排名第一的** Linux 发行版。我必须说,这是当之无愧的宝座。Linux Mint 是我个人的最爱之一。它优雅、秀气,提供了卓越的计算体验(开箱即用)。 ![](/data/attachment/album/201907/25/102946gef8gwneeg3khkle.jpg) Linux Mint 带有 Cinnamon 桌面环境。仍处于熟悉 Linux 软件阶段的 Linux 新用户会发现 Cinnamon 非常有用。所有软件都按类别分组,非常易于访问。虽然这不是一个令人兴奋的功能,但对于不了解 Linux 软件名称的新用户来说,这是一个巨大的好处。 Linux Mint 很快,在旧电脑上也运行良好。Linux Mint 建立在坚如磐石的 Ubuntu 基础之上。它使用与 Ubuntu 相同的软件存储库。而对于 Ubuntu 软件存储库,仅在广泛测试后 Ubuntu 才会将软件推送在其中。这意味着用户不必处理某些新软件容易出现的意外崩溃和故障,对于新的 Linux 用户来说这可能是一个真正不可接受的。 ![](/data/attachment/album/201907/25/102947cn9j0hhvohxhhbtr.jpg) Windows 7 爱好者如果没有真的升级到微软 Windows 10 的话,那将会发现 Linux Mint 的可爱。 Linux Mint 桌面非常类似于 Windows 7 桌面。类似的工具栏、类似的菜单、类似的托盘图标都绝对会使 Windows 用户感到十分熟悉。 就个人而言,我更倾向于向 Linux 世界的新人推荐 Linux Mint,因为 Linux Mint 确实给用户留下了足够的印象,会让他们接受它。对我来说,Linux Mint 应该是面向初学者的 Linux 列表中的首位。 请在这里查看 [Linux Mint](https://linuxmint.com/),看看 Cinnamon 版。 #### 3、Zorin OS 大多数计算机用户是 Windows 用户。当 [Windows 用户拿到一个 Linux](https://itsfoss.com/windows-like-linux-distributions/) 时,他必须经历相当多的“去知识过程”。大量的操作已经固定在我们的肌肉记忆当中。例如,每次要启动应用程序时,鼠标都会移动屏幕的左下角(“开始”菜单)。因此,如果我们能够在 Linux 上找到一些可以缓解这些问题的东西,那就成功了一半了。进入 Zorin OS。 ![](/data/attachment/album/201907/25/102948ydgwgrrxd1kkd6gx.jpg) Zorin OS 是一款基于 Ubuntu 的高度打磨的 Linux 发行版,完全是为 Windows 难民制作的。尽管几乎每个 Linux 发行版都可供任何人使用,但是当桌面看起来太陌生时,有些人可能会不情愿使用。Zorin OS 避开了这个障碍,因为它与 Windows 外观明显相似。 对 Linux 新手来说,软件包管理器是一个新概念。这就是为什么 Zorin OS 带有一个巨大的(我的意思是真的很大)预安装软件列表。你需要的任何东西,很有可能都已经安装在 Zorin OS 上了。好像这还不够,[Wine 和 PlayOnLinux](https://itsfoss.com/use-windows-applications-linux/) 也预先安装好了,所以你也可以在这里运行你喜爱的 Windows 软件和[游戏](https://itsfoss.com/linux-gaming-guide/)。 ![](/data/attachment/album/201907/25/102949ftyntvwd2yeylf5u.jpg) Zorin OS 配备了一款名为 “Zorin look changer” 的惊人的主题引擎。它提供了一些重要的自定义选项和预设,可以使你的操作系统看起来像 Windows 7、XP、2000 甚至是 Mac,你会有宾至如归的感觉。 ![](/data/attachment/album/201907/25/102950w2g5zlgneb9ci7nc.jpg) 正是这些功能使 Zorin OS 成为**适合初学者的最佳 Linux 发行版**。查看 [Zorin OS 网站](https://zorinos.com/)以了解更多信息和下载该操作系统。 #### 4、Elementary OS 我们已经看过了给 Windows 用户准备的 Linux 发行版,让我们为 MacOS 用户也提供一些东西。Elementary OS 成名非常迅速,现在总是被列入顶级发行列表之中,这一切都归功于其美学本质。其灵感来自于 MacOS,Elementary OS 是最美丽的 Linux 发行版之一。 ![](/data/attachment/album/201907/25/102951cmnskobfognzhi55.jpg) Elementary OS 是又一个基于 Ubuntu 的操作系统,这意味着操作系统本身无疑是稳定的。Elementary OS 带有 Pantheon 桌面环境。你马上就会注意到它与 MacOS 桌面的相似之处。这对于转换到 Linux 的 MacOS 用户来说是一个优势,因为他们会对桌面非常适应,这确实简化了应对此变化的过程。 ![](/data/attachment/album/201907/25/102952bqxwz4qw169xzql9.jpg) 它的菜单简单,可根据用户喜好自定义。该操作系统是零侵入性的,因此你可以真正专注于工作。它附带了非常少量的预安装软件。因此,新用户都不会被庞杂的内容吓跑。但是,嘿,它具备开箱即用所需要的一切。如果需要更多软件,Elementary OS 提供了一个整洁的 AppCenter。它易于访问且简单易用,一切都在一个地方,你可以一键获得所需的所有软件和升级。 经验表明,[Elementary OS](https://elementary.io/) 真的是一个很棒的软件。绝对值得[试一试](https://elementary.io/)。 #### 5、Linux Mint Mate 许多来了解 Linux 的人都希望让旧电脑焕发新生。随着 Windows 10 的普及,几年前许多具有不错配置的计算机已经变得无力应对。在谷歌上快速搜索一下会建议你在这样的电脑上安装 Linux。通过这种方式,你可以让它们在之后一段时间仍旧能保持水准。如果你正在寻找可以运行在旧计算机上的操作系统,Linux Mint Mate 是一个很棒的 Linux 发行版。 ![](/data/attachment/album/201907/25/102953ff1nhvr3xoxzyojp.jpg) Linux Mint Mate 非常轻便,资源利用效率高,而仍然是一个漂亮的发行版。它可以在计算能力较弱的计算机上平稳运行。桌面环境没有各种花哨的东西。但它在功能上和任何其他桌面环境相比毫不逊色。这个操作系统是非侵入式的,允许你获得高效的计算体验而不会妨碍你。 同样,Linux Mint Mate 基于 Ubuntu,具有巨大而坚实的 Ubuntu 软件存储库的优势。它预装了最少数量的必需软件。提供了简便的驱动程序安装和设置管理。 即使你只有 512 MB 的内存和 9 GB 的硬盘空间(当然是越多越好),你也可以运行 Linux Mint Mate。 Mate 桌面环境非常简单易用,没有什么费解的地方。对于 Linux 初学者来说,这确实是一个巨大的优势,更有理由 [尝试 Linux Mint Mate](http://blog.linuxmint.com/?p=3182)。 #### 6、Manjaro Linux 好吧。任何一个 Linux 的老用户都会说,即使只是在大方向上,引导新手接触 Arch Linux 都是一种罪过。但是听我说。 Arch 被认为是专家级 Linux,因为它的安装过程非常复杂。Manajro 和 Arch Linux 有着共同的起源,但它们在其他方面存在很大差异。 ![](/data/attachment/album/201907/25/102954k0nz0f3k0zwu34c1.jpg) Manajro Linux 具有非常适合初学者的安装程序。许多事情都是自动化的,比如使用“硬件检测”进行驱动程序安装。Manjaro 极大地解决了困扰许多其它 Linux 发行版的硬件驱动程序的麻烦。即使你遇到任何问题,Manjaro 也有很棒的社区支持。 Manjaro 拥有自己的软件存储库,其维护了最新的软件。虽然优先向用户提供最新软件,但它是以保证稳定性不会受到损害为前提的。这是 Arch 和 Manjaro 之间的主要区别之一。Manjaro 延迟软件包的发布以确保它们绝对稳定并且不会导致回退。你还可以访问 Manjaro 上的 Arch User Repository(AUR),因此你可以随时获得所需的一切。 如果你想了解更多有关 Manjaro 功能的信息,请阅读我的同事 [John 的 Manjaro Linux 经历以及为什么他会被它迷住](https://itsfoss.com/why-use-manjaro-linux/)。 ![](/data/attachment/album/201907/25/102954n9ii65of5s5bkk7m.jpg) Manjaro Linux 有 XFCE、KDE、Gnome、Cinnamon 以及更多桌面环境,请查看[官方网站](https://manjaro.org/)。 要安装上述 6 个操作系统中的任何一个,你需要创建一个可启动的 U 盘。如果你当前正在使用 Windows [请使用本指南](https://www.ubuntu.com/download/desktop/create-a-usb-stick-on-windows)。Mac OS 用户可以[遵循本指南](https://www.ubuntu.com/download/desktop/create-a-usb-stick-on-macos)。 ### 你选择哪个最适合初学者的 Linux 发行版? Linux 可能会有学习曲线,但这是一件不会让每个人都感到后悔的事情。进一步获得一个 ISO 文件并体验一下 Linux 吧。如果你已经是 Linux 用户,请分享这篇文章,并帮助人们在这个爱的季节爱上 Linux 吧。加油! --- via: <https://itsfoss.com/best-linux-beginners/> 作者:[Aquil Roshan](https://itsfoss.com/author/aquil/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[wxy](https://github.com/wxy) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![Warp Terminal](/assets/images/warp-terminal.webp) ![Warp Terminal](/assets/images/warp-terminal.webp) Let’s face it, Linux can pose an overwhelming complexity to new users. But then, it’s not Linux itself that brings this complexity. Rather, it’s the “newness” factor that causes this. Not getting nostalgic, but remembering my first time with Linux, I didn’t even know what to expect. I liked it. But it was an upstream swim for me initially. Not knowing where to start can be a downer, especially for someone who does not have the concept of something else running on their PC in place of Windows. The first thing that confuses a newcomer is that Linux is not a single operating system. There are hundreds of Linux OSes (the correct technical term is distribution). We have covered [why there are so many Linux](https://itsfoss.com/what-is-linux/) distributions in detail to help you out with that. Here are a few lists of Linux distributions based on different criteria: [Best Linux distributions for Windows users](https://itsfoss.com/windows-like-linux-distributions/)[Best lightweight Linux distros](https://itsfoss.com/lightweight-linux-beginners/)[Best Linux distributions for hacking](https://itsfoss.com/linux-hacking-penetration-testing/)[Best Linux distributions for gaming](https://itsfoss.com/linux-gaming-distributions/)[Best Linux distributions for privacy and anonymity](https://itsfoss.com/privacy-focused-linux-distributions/)[Best Linux distributions that look like MacOS](https://itsfoss.com/macos-like-linux-distros/) In addition to that, there are distributions that cater to the needs of newcomers. So, here, we shall focus on those options. ## Best Linux Distros for Beginners ### 1. Ubuntu ![Ubuntu 20 04 Desktop](https://itsfoss.com/content/images/wordpress/2020/11/ubuntu-20-04-desktop.jpg) - Easy to use - Unique user experience - Huge collection of software applications available through the software center - Essential tools pre-installed You must have heard about Ubuntu — no matter what. It is the most popular Linux distribution overall. Not just limited to servers, but also the most popular choice for Linux desktops. It is easy to use, offers a good user experience, and comes pre-installed with essential tools to get a head start. Of course, Ubuntu managed to “simplify” the Linux experience years back and that is the reason it is still so popular even with several other alternatives available. ![Ubuntu 20 04 desktop with file manager and a terminal window running htop](https://itsfoss.com/content/images/wordpress/2020/08/ubuntu-20-04.png) Ubuntu offers a very convenient installation procedure and ensures the best hardware compatibility when compared to some other non-Ubuntu-based Linux distributions. The original Ubuntu relies on [GNOME desktop](https://en.wikipedia.org/wiki/Gnomes?ref=itsfoss.com). Even though it is easy to use, it may not be a familiar user interface if you’re coming from the Windows platform. In that case, you can try out some official [flavors of Ubuntu](https://itsfoss.com/which-ubuntu-install/) like [Kubuntu](https://kubuntu.org/?ref=itsfoss.com), [Lubuntu](https://lubuntu.net/?ref=itsfoss.com) to get a Windows-like user interface. Ubuntu has great documentation and community support. [Ubuntu forums ](https://ubuntuforums.org/?ref=itsfoss.com)and [Ask Ubuntu](http://askubuntu.com/?ref=itsfoss.com) provide appreciable quality support in almost all aspects of Ubuntu. You should easily find answers to common issues and even if you notice something new, the community will help you out with troubleshooting. ### 2. Linux Mint ![Linux Mint 20 desktop screenshot](https://itsfoss.com/content/images/wordpress/2020/11/mint-20-screenshot.jpg) - Familiar user interface with Windows - Performs great with older hardware - Some improvements over Ubuntu Linux Mint is arguably the [best Ubuntu-based Linux distribution](https://itsfoss.com/best-ubuntu-based-linux-distros/) suitable for beginners. Yes, it is based on Ubuntu, so you should expect the same advantages of using Ubuntu. However, instead of [GNOME](https://en.wikipedia.org/wiki/GNOME?ref=itsfoss.com) desktop, it offers different desktop environments like [Cinnamon](https://en.wikipedia.org/wiki/Cinnamon_(desktop_environment)?ref=itsfoss.com), [Xfce](https://en.wikipedia.org/wiki/Xfce?ref=itsfoss.com), and [MATE](https://en.wikipedia.org/wiki/MATE_(software)?ref=itsfoss.com). Furthermore, [Linux Mint does a few things better than Ubuntu](https://itsfoss.com/linux-mint-vs-ubuntu/). [8 Reasons Why Linux Mint is Better Than Ubuntu for Linux BeginnersWhich one is better, Linux Mint or Ubuntu? This question has been there ever since Linux Mint came into the picture, and this article does not answer this question. Well, not entirely. So, what is this about, then? I have been an Ubuntu user for a long time. I stray](https://itsfoss.com/linux-mint-vs-ubuntu/)![](https://itsfoss.com/content/images/wordpress/2013/12/reasons-why-mint-is-better-than-ubuntu.jpg) ![](https://itsfoss.com/content/images/wordpress/2013/12/reasons-why-mint-is-better-than-ubuntu.jpg) Not just limited to the familiar user interface, which will be a bonus for Windows users. It provides impressive performance with minimal hardware requirements, especially with Xfce or MATE desktop environments. It also uses the same software repository as Ubuntu. So, you don’t have to worry about the availability of software to install. ![Home page of Software Manager application in Linux Mint](https://itsfoss.com/content/images/wordpress/2020/11/software-manager-linux-mint.jpg) Linux Mint is a fantastic [Windows-like distribution](https://itsfoss.com/windows-like-linux-distributions/). So, if you do not want a unique user interface (like Ubuntu), Linux Mint should be a perfect choice. The most popular suggestion would be to go with the **Linux Mint Cinnamon** edition. But, you can explore whatever you want. Moreover, you might want to look at our tutorial to [install Linux Mint from USB](https://itsfoss.com/install-linux-mint/). ### 3. Zorin OS ![zorin os 16 pro desktop with file manager opened](https://itsfoss.com/content/images/wordpress/2022/02/zorin-os-16-pro.jpg) - Windows-like user interface - Intuitive user experience - Easy to use - Ultimate edition available with a lot of pre-installed goodies and Lite edition for older computers Zorin OS is yet another impressive [Linux distribution that offers a similar user interface to Windows](https://itsfoss.com/windows-like-linux-distributions/). It may not be the most popular choice but being an Ubuntu-based distribution, it is perfectly suitable for beginners while offering many cool features as well. Zorin OS is an Ubuntu-based distribution but feels highly polished. In my opinion, it is perfectly tailored for former Windows users who want a similar look and feel but something beautiful. No wonder why Zorin OS is one of the [most beautiful Linux distros](https://itsfoss.com/beautiful-linux-distributions/) out there. The ultimate edition of Zorin OS is worth spending if you need all the pre-installed goodies (fun games, office suite, and some additional features). But, the free edition works like charm as well. You will also find a “Lite” and Education edition, which is suitable for old hardware and school requirements respectively. ### 4. Elementary OS ![elementary os 6 1 desktop screenshot, where several apps like file manager, web browser etc., are opened](https://itsfoss.com/content/images/wordpress/2022/02/elementary-os-6-1-screenshot.jpg) - macOS inspired user interface - Focuses on rich user experience - Easy to use elementary OS is one of the most beautiful Linux distros. It originally takes inspiration from macOS but has evolved over the years. Even though it is not a “macOS clone” in any aspect, it tries to focus on the user experience similar to how macOS does (or should). If you are coming from the Apple ecosystem, you would love to try elementary OS. Again, it is based on Ubuntu, so you get all the benefits of it along with a rich user experience. Elementary OS features the Pantheon desktop environment. You can immediately notice the resemblance to the macOS desktop. The operating system is zero intrusive, so you can really focus on your work. It comes with a minimal number of pre-installed software. So, any new user will not be repulsed by massive bloat. But it’s got everything you need out of the box. The App Center is also unique when compared to other Linux distributions. You will find many applications specifically tailored for elementary OS. You can install the apps for free, but it encourages you to donate something first. Experience-wise, [Elementary OS](https://elementary.io/?ref=itsfoss.com) is really a great piece of software. ### 5. Linux Lite ![Linux Lite 5 desktop](https://itsfoss.com/content/images/wordpress/2020/06/linux-lite-5.jpg) - Windows-like user interface - Tailored as a lightweight Linux distribution - Easy to use Linux Lite is yet another Ubuntu-based distribution that is easy to use. It is specifically tailored as a [lightweight distribution](https://itsfoss.com/lightweight-linux-beginners/) with some pre-installed applications that are not resource-heavy. Linux Lite is perfectly suitable for Windows users, with a similar user interface featuring the Xfce desktop environment. Compared to its previous iterations, Linux Lite has improved the user experience. Even though it isn’t meant to provide you with the most modern experience, it still looks great as a desktop OS. ### 6. Manjaro Linux ![Manjaro 20 Desktop](https://itsfoss.com/content/images/wordpress/2020/11/manjaro-20-desktop.jpeg) - Not an Ubuntu-based distribution - Arch-based Linux distribution - Presents a learning curve If you want to take up a challenge with a learning curve and try something besides a distribution based on Ubuntu, Manjaro Linux is the best bet. It is based on Arch Linux but tailored as a beginner-friendly distribution. Of course, considering that it follows a rolling release update cycle, you might end up with a broken system (even though that does not happen all the time). But, you have to compromise on the reliability when compared to any Ubuntu-based Linux distribution mentioned in this list. You also get a wide range of choices to install a variety of software tools. There’s also [AUR](https://itsfoss.com/aur-arch-linux/), which is a community-maintained repository for software that may not be available for Manjaro officially. If you want to know more about it, you may want to check out our [detailed review of Manjaro Linux](https://itsfoss.com/manjaro-linux-review/). Manjaro Linux offers different desktop environments like XFCE, KDE, Gnome, Cinnamon, and a host of more desktop environments. So, you get numerous choices. ### 7. Pop!_OS ![Pop Os desktop running file manager and terminal](https://itsfoss.com/content/images/wordpress/2020/02/pop-os-stock.jpg) - Improved user experience when compared to Ubuntu - Extra out-of-the-box features like Auto-window tiling to help with fast multitasking Pop OS is probably the best [Ubuntu-based Linux distribution](https://itsfoss.com/best-ubuntu-based-linux-distros/) if you’re not looking for a lightweight Linux distribution. It provides a polished and snappy experience when compared to the Ubuntu GNOME edition. You also get some interesting features like automatic window tiling, window stacking, and a few more extras with Pop OS. You get Cosmic, based on GNOME as the desktop environment, with many customizations/built-in extensions to enhance the user experiencee. Unlike some other options, it does not officially support other desktop environments out of the box. So, if you dislike GNOME, you may have to try other desktop environments manually as an experiment. You might find the new features of [Pop OS 22.04](https://news.itsfoss.com/pop-os-22-04-release/) useful to explore more about it. ### 8. Peppermint OS ![Peppermint desktop](https://itsfoss.com/content/images/wordpress/2022/02/Peppermint-Desktop.jpg) - Lightweight Linux distribution - Easy to use and simple - Ability to use web apps in the form of local apps Peppermint Linux is an interesting choice for beginners who prefer to use web applications as local applications, using the out-of-the-box integration with [Ic](https://github.com/peppermintos/ice?ref=itsfoss.com)[e](https://github.com/peppermintos/ice?ref=itsfoss.com). It is based on Debian. It isn’t pitched as a lightweight distro, but it works quite well with older hardware as well. ### 9. Deepin ![Deepin desktop screenshot](https://itsfoss.com/content/images/wordpress/2022/02/deepin-20-3-screenshot.png) - Eye-candy visuals - Rich user experience - Easy to use If performance or hardware requirement does not bother you, Deepin OS will be an interesting pick. It is known for its eye-candy user interface, one of the most gorgeous Linux distributions out there. Of course, it suffers from performance issues if you do not have a decent modern hardware configuration. But, if it works well on your system, it is easy to use and offers plenty of software tools to get started. Some might mention that just because it is a project with based out of Mainland China, you need to avoid it. So, if you have an issue with that, you might take a look at [UbuntuDDE](https://itsfoss.com/ubuntudde/) (which is basically Ubuntu + eye-candy visuals of Deepin) ## Frequently Asked Questions: If You’re Still Confused Where to Start If you still want help for a head start, I’ve put together an FAQ to address the most basic questions for beginners: **What is the easiest Linux distribution?** The distribution which provides you with a familiar user interface and essential software tools pre-installed should be the easiest experience. If you’re coming from Windows, Linux Mint/Linux Lite can be some of our immediate suggestions. If you’re comfortable with macOS, elementary OS can be a good replacement. **What is the fastest Linux distribution?** If you want fast performance and easy-to-use OS, Linux Lite can be a fantastic option. However, you can also explore other [lightweight distros](https://web.archive.org/web/20221203072343/https://itsfoss.com/lightweight-linux-beginners/). **Can I run Windows apps on Linux?** Yes and no. You can use WINE to run some Windows applications on Linux. You can follow our[ guide on using windows applications ](https://web.archive.org/web/20221203072343/https://itsfoss.com/use-windows-applications-linux/)on Linux. You can also try tools like [Bottles](https://web.archive.org/web/20221203072343/https://usebottles.com/) and [Crossover](https://web.archive.org/web/20221203072343/https://www.codeweavers.com/crossover) to easily install Windows applications. **Do I need Anti-Virus on Linux?** No. You have nothing to worry about as long as you download stuff from official sources and do not indulge in malicious activities. However, you can explore any pre-installed firewall or [set up a new firewall](https://web.archive.org/web/20221203072343/https://itsfoss.com/set-up-firewall-gufw/) for additional protection. **Your choice for the best Linux distro for beginners?** Linux might come with a learning curve, but that’s not something anybody ever regretted. Go ahead, you will love it like I do! To give you a head start, I would recommend you to follow [Ubuntu 20.04 installation guide](https://itsfoss.com/install-ubuntu/) and refer [how to install a distro from USB](https://itsfoss.com/install-linux-mint/). [How to Install Ubuntu Linux in the Simplest Possible WayThe easiest way to install Ubuntu. Want to save time and need no hassle? This is the way.](https://itsfoss.com/install-ubuntu/)![](https://itsfoss.com/content/images/2023/04/install-ubuntu-easily-1.png) ![](https://itsfoss.com/content/images/2023/04/install-ubuntu-easily-1.png) [How to Install Linux Mint [The Simplest Way Possible]Linux Mint is the best Linux distribution for beginners. Learn how to install Linux Mint and make it your main and the only operating system.](https://itsfoss.com/install-linux-mint/)![](https://itsfoss.com/content/images/wordpress/2020/07/install-linux-mint.png) ![](https://itsfoss.com/content/images/wordpress/2020/07/install-linux-mint.png)
11,147
ClusterShell:一个在集群节点上并行运行命令的好工具
https://www.2daygeek.com/clustershell-clush-run-commands-on-cluster-nodes-remote-system-in-parallel-linux/
2019-07-26T05:32:32
[ "并行" ]
https://linux.cn/article-11147-1.html
![](/data/attachment/album/201907/26/053202pgcgg1y1rc5l5mgg.jpg) 我们过去曾写过两篇如何并行地在多个远程服务器上运行命令的文章:[并行 SSH(PSSH)](https://www.2daygeek.com/pssh-parallel-ssh-run-execute-commands-on-multiple-linux-servers/) 和[分布式 Shell(DSH)](https://www.2daygeek.com/dsh-run-execute-shell-commands-on-multiple-linux-servers-at-once/)。今天,我们将讨论相同类型的主题,但它允许我们在集群节点上执行相同的操作。你可能会想,我可以编写一个小的 shell 脚本来实现这个目的,而不是安装这些第三方软件包。 当然,你是对的,如果要在十几个远程系统中运行一些命令,那么你不需要使用它。但是,你的脚本需要一些时间来完成此任务,因为它是按顺序运行的。想想你要是在一千多台服务器上运行一些命令会是什么样子?在这种情况下,你的脚本用处不大。此外,完成任务需要很长时间。所以,要克服这种问题和情况,我们需要可以在远程计算机上并行运行命令。 为此,我们需要在一个并行应用程序中使用它。我希望这个解释可以解决你对并行实用程序的疑虑。 ### ClusterShell [ClusterShell](https://cea-hpc.github.io/clustershell/) 是一个事件驱动的开源 Python 库,旨在在服务器场或大型 Linux 集群上并行运行本地或远程命令。(`clush` 即 [ClusterShell](https://cea-hpc.github.io/clustershell/))。 它将处理在 HPC 集群上遇到的常见问题,例如在节点组上操作,使用优化过的执行算法运行分布式命令,以及收集结果和合并相同的输出,或检索返回代码。 ClusterShell 可以利用已安装在系统上的现有远程 shell 设施,如 SSH。 ClusterShell 的主要目标是通过为开发人员提供轻量级、但可扩展的 Python API 来改进高性能集群的管理。它还提供了 `clush`、`clubak` 和 `cluset`/`nodeset` 等方便的命令行工具,可以让传统的 shell 脚本利用这个库的一些功能。 ClusterShell 是用 Python 编写的,它需要 Python(v2.6+ 或 v3.4+)才能在你的系统上运行。 ### 如何在 Linux 上安装 ClusterShell? ClusterShell 包在大多数发行版的官方包管理器中都可用。因此,使用发行版包管理器工具进行安装。 对于 Fedora 系统,使用 [DNF 命令](https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/)来安装 clustershell。 ``` $ sudo dnf install clustershell ``` 如果系统默认是 Python 2,这会安装 Python 2 模块和工具,可以运行以下命令安装 Python 3 开发包。 ``` $ sudo dnf install python3-clustershell ``` 在执行 clustershell 安装之前,请确保你已在系统上启用 [EPEL 存储库](https://www.2daygeek.com/install-enable-epel-repository-on-rhel-centos-scientific-linux-oracle-linux/)。 对于 RHEL/CentOS 系统,使用 [YUM 命令](https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/) 来安装 clustershell。 ``` $ sudo yum install clustershell ``` 如果系统默认是 Python 2,这会安装 Python 2 模块和工具,可以运行以下命令安装 Python 3 开发包。 ``` $ sudo yum install python34-clustershell ``` 对于 openSUSE Leap 系统,使用 [Zypper 命令](https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/) 来安装 clustershell。 ``` $ sudo zypper install clustershell ``` 如果系统默认是 Python 2,这会安装 Python 2 模块和工具,可以运行以下命令安装 Python 3 开发包。 ``` $ sudo zypper install python3-clustershell ``` 对于 Debian/Ubuntu 系统,使用 [APT-GET 命令](https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/) 或 [APT 命令](https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/) 来安装 clustershell。 ``` $ sudo apt install clustershell ``` ### 如何在 Linux 使用 PIP 安装 ClusterShell? 可以使用 PIP 安装 ClusterShell,因为它是用 Python 编写的。 在执行 clustershell 安装之前,请确保你已在系统上启用了 [Python](https://www.2daygeek.com/3-methods-to-install-latest-python3-package-on-centos-6-system/) 和 [PIP](https://www.2daygeek.com/install-pip-manage-python-packages-linux/)。 ``` $ sudo pip install ClusterShell ``` ### 如何在 Linux 上使用 ClusterShell? 与其他实用程序(如 `pssh` 和 `dsh`)相比,它是直接了当的优秀工具。它有很多选项可以在远程并行执行。 在开始使用 clustershell 之前,请确保你已启用系统上的[无密码登录](https://www.2daygeek.com/linux-passwordless-ssh-login-using-ssh-keygen/)。 以下配置文件定义了系统范围的默认值。你不需要修改这里的任何东西。 ``` $ cat /etc/clustershell/clush.conf ``` 如果你想要创建一个服务器组,那也可以。默认情况下有一些示例,请根据你的要求执行相同操作。 ``` $ cat /etc/clustershell/groups.d/local.cfg ``` 只需按以下列格式运行 clustershell 命令即可从给定节点获取信息: ``` $ clush -w 192.168.1.4,192.168.1.9 cat /proc/version 192.168.1.9: Linux version 4.15.0-45-generic ([email protected]) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019 192.168.1.4: Linux version 3.10.0-957.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) ) #1 SMP Thu Nov 8 23:39:32 UTC 2018 ``` 选项: * `-w:` 你要运行该命令的节点。 你可以使用正则表达式而不是使用完整主机名和 IP: ``` $ clush -w 192.168.1.[4,9] uname -r 192.168.1.9: 4.15.0-45-generic 192.168.1.4: 3.10.0-957.el7.x86_64 ``` 或者,如果服务器位于同一 IP 系列中,则可以使用以下格式: ``` $ clush -w 192.168.1.[4-9] date 192.168.1.6: Mon Mar 4 21:08:29 IST 2019 192.168.1.7: Mon Mar 4 21:08:29 IST 2019 192.168.1.8: Mon Mar 4 21:08:29 IST 2019 192.168.1.5: Mon Mar 4 09:16:30 CST 2019 192.168.1.9: Mon Mar 4 21:08:29 IST 2019 192.168.1.4: Mon Mar 4 09:16:30 CST 2019 ``` clustershell 允许我们以批处理模式运行命令。使用以下格式来实现此目的: ``` $ clush -w 192.168.1.4,192.168.1.9 -b Enter 'quit' to leave this interactive mode Working with nodes: 192.168.1.[4,9] clush> hostnamectl --------------- 192.168.1.4 --------------- Static hostname: CentOS7.2daygeek.com Icon name: computer-vm Chassis: vm Machine ID: 002f47b82af248f5be1d67b67e03514c Boot ID: f9b37a073c534dec8b236885e754cb56 Virtualization: kvm Operating System: CentOS Linux 7 (Core) CPE OS Name: cpe:/o:centos:centos:7 Kernel: Linux 3.10.0-957.el7.x86_64 Architecture: x86-64 --------------- 192.168.1.9 --------------- Static hostname: Ubuntu18 Icon name: computer-vm Chassis: vm Machine ID: 27f6c2febda84dc881f28fd145077187 Boot ID: f176f2eb45524d4f906d12e2b5716649 Virtualization: oracle Operating System: Ubuntu 18.04.2 LTS Kernel: Linux 4.15.0-45-generic Architecture: x86-64 clush> free -m --------------- 192.168.1.4 --------------- total used free shared buff/cache available Mem: 1838 641 217 19 978 969 Swap: 2047 0 2047 --------------- 192.168.1.9 --------------- total used free shared buff/cache available Mem: 1993 352 1067 1 573 1473 Swap: 1425 0 1425 clush> w --------------- 192.168.1.4 --------------- 09:21:14 up 3:21, 3 users, load average: 0.00, 0.01, 0.05 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT daygeek :0 :0 06:02 ?xdm? 1:28 0.30s /usr/libexec/gnome-session-binary --session gnome-classic daygeek pts/0 :0 06:03 3:17m 0.06s 0.06s bash daygeek pts/1 192.168.1.6 06:03 52:26 0.10s 0.10s -bash --------------- 192.168.1.9 --------------- 21:13:12 up 3:12, 1 user, load average: 0.08, 0.03, 0.00 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT daygeek pts/0 192.168.1.6 20:42 29:41 0.05s 0.05s -bash clush> quit ``` 如果要在一组节点上运行该命令,请使用以下格式: ``` $ clush -w @dev uptime or $ clush -g dev uptime or $ clush --group=dev uptime 192.168.1.9: 21:10:10 up 3:09, 1 user, load average: 0.09, 0.03, 0.01 192.168.1.4: 09:18:12 up 3:18, 3 users, load average: 0.01, 0.02, 0.05 ``` 如果要在多个节点组上运行该命令,请使用以下格式: ``` $ clush -w @dev,@uat uptime or $ clush -g dev,uat uptime or $ clush --group=dev,uat uptime 192.168.1.7: 07:57:19 up 59 min, 1 user, load average: 0.08, 0.03, 0.00 192.168.1.9: 20:27:20 up 1:00, 1 user, load average: 0.00, 0.00, 0.00 192.168.1.5: 08:57:21 up 59 min, 1 user, load average: 0.00, 0.01, 0.05 ``` clustershell 允许我们将文件复制到远程计算机。将本地文件或目录复制到同一个远程节点: ``` $ clush -w 192.168.1.[4,9] --copy /home/daygeek/passwd-up.sh ``` 我们可以通过运行以下命令来验证它: ``` $ clush -w 192.168.1.[4,9] ls -lh /home/daygeek/passwd-up.sh 192.168.1.4: -rwxr-xr-x. 1 daygeek daygeek 159 Mar 4 09:00 /home/daygeek/passwd-up.sh 192.168.1.9: -rwxr-xr-x 1 daygeek daygeek 159 Mar 4 20:52 /home/daygeek/passwd-up.sh ``` 将本地文件或目录复制到不同位置的远程节点: ``` $ clush -g uat --copy /home/daygeek/passwd-up.sh --dest /tmp ``` 我们可以通过运行以下命令来验证它: ``` $ clush --group=uat ls -lh /tmp/passwd-up.sh 192.168.1.7: -rwxr-xr-x. 1 daygeek daygeek 159 Mar 6 07:44 /tmp/passwd-up.sh ``` 将文件或目录从远程节点复制到本地系统: ``` $ clush -w 192.168.1.7 --rcopy /home/daygeek/Documents/magi.txt --dest /tmp ``` 我们可以通过运行以下命令来验证它: ``` $ ls -lh /tmp/magi.txt.192.168.1.7 -rw-r--r-- 1 daygeek daygeek 35 Mar 6 20:24 /tmp/magi.txt.192.168.1.7 ``` --- via: <https://www.2daygeek.com/clustershell-clush-run-commands-on-cluster-nodes-remote-system-in-parallel-linux/> 作者:[Magesh Maruthamuthu](https://www.2daygeek.com/author/magesh/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[wxy](https://github.com/wxy) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
404
Not Found
null
11,148
掌握 Linux 用户组
https://www.networkworld.com/article/3409781/mastering-user-groups-on-linux.html
2019-07-26T06:04:31
[ "用户组" ]
https://linux.cn/article-11148-1.html
> > 在 Linux 系统中管理用户组并不费力,但相关命令可能比你所知的更为灵活。 > > > ![Scott 97006 \(CC BY 2.0\)](/data/attachment/album/201907/26/060434prox1x573i55krtz.jpg) 在 Linux 系统中用户组起着重要作用。用户组提供了一种简单方法供一组用户互相共享文件。用户组也允许系统管理员更加有效地管理用户权限,因为管理员可以将权限分配给用户组而不是逐一分配给单个用户。 尽管通常只要在系统中添加用户账户就会创建用户组,关于用户组如何工作以及如何运用用户组还有很多需要了解的。 ### 一个用户一个用户组? Linux 系统中多数用户账户被设为用户名与用户组名相同。用户 `jdoe` 会被赋予一个名为 `jdoe` 的用户组,且成为该新建用户组的唯一成员。如本例所示,该用户的登录名,用户 id 和用户组 id 在新建账户时会被添加到 `/etc/passwd` 和 `/etc/group` 文件中: ``` $ sudo useradd jdoe $ grep jdoe /etc/passwd jdoe:x:1066:1066:Jane Doe:/home/jdoe:/bin/sh $ grep jdoe /etc/group jdoe:x:1066: ``` 这些文件中的配置使系统得以在文本(`jdoe`)和数字(`1066`)这两种用户 id 形式之间互相转换—— `jdoe` 就是 `1006`,且 `1006` 就是 `jdoe`。 分配给每个用户的 UID(用户 id)和 GID(用户组 id)通常是一样的,并且顺序递增。若上例中 Jane Doe 是最近添加的用户,分配给下一个新用户的用户 id 和用户组 id 很可能都是 1067。 ### GID = UID? UID 和 GID 可能不一致。例如,如果你用 `groupadd` 命令添加一个用户组而不指定用户组 id,系统会分配下一个可用的用户组 id(在本例中为 1067)。下一个添加到系统中的用户其 UID 会是 1067 而 GID 则为 1068。 你可以避免这个问题,方法是添加用户组的时候指定一个较小的用户组 id 而不是接受默认值。在下面的命令中我们添加一个用户组并提供一个 GID,这个 GID 小于用于用户账户的 GID 取值范围。 ``` $ sudo groupadd -g 500 devops ``` 创建账户时你可以指定一个共享用户组,如果这样对你更合适的话。例如你可能想把新来的开发人员加入同一个 DevOps 用户组而不是一人一个用户组。 ``` $ sudo useradd -g staff bennyg $ grep bennyg /etc/passwd bennyg:x:1064:50::/home/bennyg:/bin/sh ``` ### 主要用户组和次要用户组 用户组实际上有两种:<ruby> 主要用户组 <rt> primary group </rt></ruby>和<ruby> 次要用户组 <rt> secondary group </rt></ruby>。 主要用户组是保存在 `/etc/passwd` 文件中的用户组,该用户组在账户创建时配置。当用户创建一个文件时,用户的主要用户组与此文件关联。 ``` $ whoami jdoe $ grep jdoe /etc/passwd jdoe:x:1066:1066:John Doe:/home/jdoe:/bin/bash ^ | +-------- 主要用户组 $ touch newfile $ ls -l newfile -rw-rw-r-- 1 jdoe jdoe 0 Jul 16 15:22 newfile ^ | +-------- 主要用户组 ``` 用户一旦拥有账户之后被加入的那些用户组是次要用户组。次要用户组成员关系在 `/etc/group` 文件中显示。 ``` $ grep devops /etc/group devops:x:500:shs,jadep ^ | +-------- shs 和 jadep 的次要用户组 ``` `/etc/group` 文件给用户组分配组名称(例如 `500` = `devops`)并记录次要用户组成员。 ### 首选的准则 每个用户是他自己的主要用户组成员,并可以成为任意多个次要用户组成员,这样的一种准则允许用户更加容易地将个人文件和需要与同事分享的文件分开。当用户创建一个文件时,用户所属的不同用户组的成员不一定有访问权限。用户必须用 `chgrp` 命令将文件和次要用户组关联起来。 ### 哪里也不如自己的家目录 添加新账户时一个重要的细节是 `useradd` 命令并不一定为新用户添加一个<ruby> 家目录 <rt> /home </rt></ruby>家目录。若你只有某些时候想为用户添加家目录,你可以在 `useradd` 命令中加入 `-m` 选项(可以把它想象成“安家”选项)。 ``` $ sudo useradd -m -g devops -c "John Doe" jdoe2 ``` 此命令中的选项如下: * `-m` 创建家目录并在其中生成初始文件 * `-g` 指定用户归属的用户组 * `-c` 添加账户描述信息(通常是用户的姓名) 若你希望总是创建家目录,你可以编辑 `/etc/login.defs` 文件来更改默认工作方式。更改或添加 `CREATE_HOME` 变量并将其设置为 `yes`: ``` $ grep CREATE_HOME /etc/login.defs CREATE_HOME yes ``` 另一种方法是用自己的账户设置别名从而让 `useradd` 一直带有 `-m` 选项。 ``` $ alias useradd=’useradd -m’ ``` 确保将该别名添加到你的 `~/.bashrc` 文件或类似的启动文件中以使其永久生效。 ### 深入了解 /etc/login.defs 下面这个命令可列出 `/etc/login.defs` 文件中的全部设置。下面的 `grep` 命令会隐藏所有注释和空行。 ``` $ cat /etc/login.defs | grep -v "^#" | grep -v "^$" MAIL_DIR /var/mail FAILLOG_ENAB yes LOG_UNKFAIL_ENAB no LOG_OK_LOGINS no SYSLOG_SU_ENAB yes SYSLOG_SG_ENAB yes FTMP_FILE /var/log/btmp SU_NAME su HUSHLOGIN_FILE .hushlogin ENV_SUPATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin ENV_PATH PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games TTYGROUP tty TTYPERM 0600 ERASECHAR 0177 KILLCHAR 025 UMASK 022 PASS_MAX_DAYS 99999 PASS_MIN_DAYS 0 PASS_WARN_AGE 7 UID_MIN 1000 UID_MAX 60000 GID_MIN 1000 GID_MAX 60000 LOGIN_RETRIES 5 LOGIN_TIMEOUT 60 CHFN_RESTRICT rwh DEFAULT_HOME yes CREATE_HOME yes <=== USERGROUPS_ENAB yes ENCRYPT_METHOD SHA512 ``` 注意此文件中的各种设置会决定用户 id 的取值范围以及密码使用期限和其他设置(如 umask)。 ### 如何显示用户所属的用户组 出于各种原因用户可能是多个用户组的成员。用户组成员身份给与用户对用户组拥有的文件和目录的访问权限,有时候这种工作方式是至关重要的。要生成某个用户所属用户组的清单,用 `groups` 命令即可。 ``` $ groups jdoe jdoe : jdoe adm admin cdrom sudo dip plugdev lpadmin staff sambashare ``` 你可以键入不带任何参数的 `groups` 命令来列出你自己的用户组。 ### 如何添加用户至用户组 如果你想添加一个已有用户至别的用户组,你可以仿照下面的命令操作: ``` $ sudo usermod -a -G devops jdoe ``` 你也可以指定逗号分隔的用户组列表来添加一个用户至多个用户组: ``` $ sudo usermod -a -G devops,mgrs jdoe ``` 参数 `-a` 意思是“添加”,`-G` 指定用户组列表。 你可以编辑 `/etc/group` 文件将用户名从用户组成员名单中删除,从而将用户从用户组中移除。`usermod` 命令或许也有个选项用于从用户组中删除某个成员。 ``` fish:x:16:nemo,dory,shark | V fish:x:16:nemo,dory ``` ### 提要 添加和管理用户组并非特别困难,但长远来看配置账户时的一致性可使这项工作更容易些。 --- via: <https://www.networkworld.com/article/3409781/mastering-user-groups-on-linux.html> 作者:[Sandra Henry-Stocker](https://www.networkworld.com/author/Sandra-Henry_Stocker/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[0x996](https://github.com/0x996) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
301
Moved Permanently
null
11,149
绑定 WiFi 和以太网,以使网络间移动更轻松
https://fedoramagazine.org/bond-wifi-and-ethernet-for-easier-networking-mobility/
2019-07-26T06:17:00
[ "网络" ]
https://linux.cn/article-11149-1.html
![](/data/attachment/album/201907/26/061716j1fgny0udgkyut0e.jpg) 有时一个网络接口是不够的。网络绑定允许将多条网络连接与单个逻辑接口一起工作。你可能因为需要给单条连接更多的带宽而这么做,或者你可能希望在有线和无线网络之间来回切换而不会丢失网络连接。 我是后面一种情况。在家工作的好处之一是,当天气晴朗时,在阳光明媚的阳台而不是在室内工作是很愉快的。但每当我这样做时,我都会失去网络连接。IRC、SSH、VPN,一切都断开了,客户端重连至少需要一会。本文介绍了如何在 Fedora 30 笔记本上设置网络绑定,以便从笔记本扩展坞的有线连接无缝切换到 WiFi。 在 Linux 中,接口绑定由内核模块 `bonding` 处理。默认情况下,Fedora 没有启用此功能,但它包含在 `kernel-core` 软件包中。这意味着启用接口绑定只需一个命令: ``` sudo modprobe bonding ``` 请注意,这只会在你重启之前生效。要永久启用接口绑定,请在 `/etc/modules-load.d` 目录中创建一个名为 `bonding.conf` 的文件,该文件仅包含单词 `bonding`。 现在你已启用绑定,现在可以创建绑定接口了。首先,你必须获取要绑定的接口的名称。要列出可用的接口,请运行: ``` sudo nmcli device status ``` 你将看到如下输出: ``` DEVICE TYPE STATE CONNECTION enp12s0u1 ethernet connected Wired connection 1 tun0 tun connected tun0 virbr0 bridge connected virbr0 wlp2s0 wifi disconnected -- p2p-dev-wlp2s0 wifi-p2p disconnected -- enp0s31f6 ethernet unavailable -- lo loopback unmanaged -- virbr0-nic tun unmanaged -- ``` 在本例中,有两个(有线)以太网接口可用。 `enp12s0u1` 在笔记本电脑扩展坞上,你可以通过 `STATE` 列知道它已连接。另一个是 `enp0s31f6`,是笔记本电脑中的内置端口。还有一个名为 `wlp2s0` 的 WiFi 连接。 `enp12s0u1` 和 `wlp2s0` 是我们在这里感兴趣的两个接口。(请注意,阅读本文无需了解网络设备的命名方式,但如果你感兴趣,可以查看 [systemd.net-naming-scheme 手册页](https://www.freedesktop.org/software/systemd/man/systemd.net-naming-scheme.html)。) 第一步是创建绑定接口: ``` sudo nmcli connection add type bond ifname bond0 con-name bond0 ``` 在此示例中,绑定接口名为 `bond0`。`con-name bond0` 将连接名称设置为 `bond0`。直接这样做会有一个名为 `bond-bond0` 的连接。你还可以将连接名设置得更加人性化,例如 “Docking station bond” 或 “Ben”。 下一步是将接口添加到绑定接口: ``` sudo nmcli connection add type ethernet ifname enp12s0u1 master bond0 con-name bond-ethernet sudo nmcli connection add type wifi ifname wlp2s0 master bond0 ssid Cotton con-name bond-wifi ``` 如上所示,连接名称被设置为[更具描述性](https://en.wikipedia.org/wiki/Master/slave_(technology)#Terminology_concerns)。请务必使用系统上相应的接口名称替换 `enp12s0u1` 和 `wlp2s0`。对于 WiFi 接口,请使用你自己的网络名称 (SSID)替换我的 “Cotton”。如果你的 WiFi 连接有密码(这当然会有!),你也需要将其添加到配置中。以下假设你使用 [WPA2-PSK](https://en.wikipedia.org/wiki/Wi-Fi_Protected_Access#Target_users_(authentication_key_distribution)) 身份验证 ``` sudo nmcli connection modify bond-wifi wifi-sec.key-mgmt wpa-psk sudo nmcli connection edit bond-wif ``` 第二条命令将进入交互式编辑器,你可以在其中输入密码,而无需将其记录在 shell 历史记录中。输入以下内容,将 `password` 替换为你的实际密码。 ``` set wifi-sec.psk password save quit ``` 现在,你可以启动你的绑定接口以及你创建的辅助接口。 ``` sudo nmcli connection up bond0 sudo nmcli connection up bond-ethernet sudo nmcli connection up bond-wifi ``` 你现在应该能够在不丢失网络连接的情况下断开有线或无线连接。 ### 警告:使用其他 WiFi 网络时 在指定的 WiFi 网络间移动时,此配置很有效,但是当远离此网络时,那么绑定中使用的 SSID 就不可用了。从理论上讲,可以为每个使用的 WiFi 连接添加一个接口,但这似乎并不合理。相反,你可以禁用绑定接口: ``` sudo nmcli connection down bond0 ``` 回到定义的 WiFi 网络时,只需按上述方式启动绑定接口即可。 ### 微调你的绑定 默认情况下,绑定接口使用“<ruby> 轮询 <rt> round-robin </rt></ruby>”模式。这会在接口上平均分配负载。但是,如果你有有线和无线连接,你可能希望更喜欢有线连接。 `active-backup` 模式能实现此功能。你可以在创建接口时指定模式和主接口,或者之后使用此命令(绑定接口应该关闭): ``` sudo nmcli connection modify bond0 +bond.options "mode=active-backup,primary=enp12s0u1" ``` [内核文档](https://www.kernel.org/doc/Documentation/networking/bonding.txt)提供了有关绑定选项的更多信息。 --- via: <https://fedoramagazine.org/bond-wifi-and-ethernet-for-easier-networking-mobility/> 作者:[Ben Cotton](https://fedoramagazine.org/author/bcotton/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
Sometimes one network interface isn’t enough. Network bonding allows multiple network connections to act together with a single logical interface. You might do this because you want more bandwidth than a single connection can handle. Or maybe you want to switch back and forth between your wired and wireless networks without losing your network connection. The latter applies to me. One of the benefits to working from home is that when the weather is nice, it’s enjoyable to work from a sunny deck instead of inside. But every time I did that, I lost my network connections. IRC, SSH, VPN — everything goes away, at least for a moment while some clients reconnect. This article describes how I set up network bonding on my Fedora 30 laptop to seamlessly move from the wired connection my laptop dock to a WiFi connection. In Linux, interface bonding is handled by the bonding kernel module. Fedora does not ship with this enabled by default, but it is included in the kernel-core package. This means that enabling interface bonding is only a command away: sudo modprobe bonding Note that this will only have effect until you reboot. To permanently enable interface bonding, create a file called *bonding.conf* in the */etc/modules-load.d* directory that contains only the word “bonding”. Now that you have bonding enabled, it’s time to create the bonded interface. First, you must get the names of the interfaces you want to bond. To list the available interfaces, run: sudo nmcli device status You will see output that looks like this: DEVICE TYPE STATE CONNECTION enp12s0u1 ethernet connected Wired connection 1 tun0 tun connected tun0 virbr0 bridge connected virbr0 wlp2s0 wifi disconnected -- p2p-dev-wlp2s0 wifi-p2p disconnected -- enp0s31f6 ethernet unavailable -- lo loopback unmanaged -- virbr0-nic tun unmanaged -- In this case, there are two (wired) Ethernet interfaces available. *enp12s0u1* is on a laptop docking station, and you can tell that it’s connected from the *STATE* column. The other, *enp0s31f6*, is the built-in port in the laptop. There is also a WiFi connection called *wlp2s0*. *enp12s0u1* and *wlp2s0* are the two interfaces we’re interested in here. (Note that it’s not necessary for this exercise to understand how network devices are named, but if you’re interested you can see the [systemd.net-naming-scheme man page](https://www.freedesktop.org/software/systemd/man/systemd.net-naming-scheme.html).) The first step is to create the bonded interface: sudo nmcli connection add type bond ifname bond0 con-name bond0 In this example, the bonded interface is named *bond0*. The “*con-name bond0*” sets the connection name to *bond0*; leaving this off would result in a connection named *bond-bond0*. You can also set the connection name to something more human-friendly, like “Docking station bond” or “Ben” The next step is to add the interfaces to the bonded interface: sudo nmcli connection add type ethernet ifname enp12s0u1 master bond0 con-name bond-ethernet sudo nmcli connection add type wifi ifname wlp2s0 master bond0 ssid Cotton con-name bond-wifi As above, the connection name is specified to be [more descriptive](https://en.wikipedia.org/wiki/Master/slave_(technology)#Terminology_concerns). Be sure to replace *enp12s0u1* and *wlp2s0* with the appropriate interface names on your system. For the WiFi interface, use your own network name (SSID) where I use “Cotton”. If your WiFi connection has a password (and of course it does!), you’ll need to add that to the configuration, too. The following assumes you’re using [WPA2-PSK](https://en.wikipedia.org/wiki/Wi-Fi_Protected_Access#Target_users_(authentication_key_distribution)) authentication sudo nmcli connection modify bond-wifi wifi-sec.key-mgmt wpa-psk sudo nmcli connection edit bond-wif The second command will bring you into the interactive editor where you can enter your password without it being logged in your shell history. Enter the following, replacing *password* with your actual password set wifi-sec.psk password save quit Now you’re ready to start your bonded interface and the secondary interfaces you created sudo nmcli connection up bond0 sudo nmcli connection up bond-ethernet sudo nmcli connection up bond-wifi You should now be able to disconnect your wired or wireless connections without losing your network connections. ## A caveat: using other WiFi networks This configuration works well when moving around on the specified WiFi network, but when away from this network, the SSID used in the bond is not available. Theoretically, one could add an interface to the bond for every WiFi connection used, but that doesn’t seem reasonable. Instead, you can disable the bonded interface: sudo nmcli connection down bond0 When back on the defined WiFi network, simply start the bonded interface as above. ## Fine-tuning your bond By default, the bonded interface uses the “load balancing (round-robin)” mode. This spreads the load equally across the interfaces. But if you have a wired and a wireless connection, you may want to prefer the wired connection. The “active-backup” mode enables this. You can specify the mode and primary interface when you are creating the interface, or afterward using this command (the bonded interface should be down): sudo nmcli connection modify bond0 +bond.options "mode=active-backup,primary=enp12s0u1" The [kernel documentation](https://www.kernel.org/doc/Documentation/networking/bonding.txt) has much more information about bonding options. ## Arjen Heidinga You say you already have VPN… You could also just put wireguard on your homeserver, and laptop/phone. Keep it connected at all times, and it is as if you are at home wherever you are. Switch back and forth between networks (even outside your home) and all your connection stay alive. There is the slight setback of latency. I honestly turn it off when gaming. For all other purposes it is fast enough, even on my puny 200/200 MBit home connection. ## Matt Awesome stuff !! I’ve implemented this and it works flawlessly .. thank you !! ## Joao Rodrigues This only works if the wireless and wired interface are on the same network right? Let’s say that I’m at a place where wireless connections go to a 10.0.0.0/8 network that NAT to a public IP address and wired connections go to a 192.168.0.0/24 that NAT to a different public IP address. ## Ryan W.W. This is a fantastic write-up, Ill need to get this working for my desktop that has a spare wireless card in it. ## Umair Why would you use bonding when you do same thing for teaming. Teaming is recommended as it work far better then bonding and works in user space. ## Paul W. Frields @Umair: Why would you merely comment on an article when you could write your own for the Magazine? 🙂 ## Umair Was not trying to be rude, just trying to understand logic to use bonding instead of teaming. Yeah I’m thinking to starting writing for Fedora Magazine because I really like fedora 🙂 Couldn’t imagine my work life without it. ## Marek Is it possible to use teamd with wireless interface? ## Bruce To be clear, bonding for speed would only make sense when an ISP can deliver or receive packets faster than your computer’s NIC can send or receive them or when you are connected to more than one networking simultaneously. ## Pranav Did not work for me I’m afraid. Traffic does not failover to the backup wireless interface and just stops after I down the primary active ethernet interface. /proc/net/bonding/bond0 shows two slave interfaces are up. Everything is happy if I bring the primary back up. I’m using wpa-eap/peap/mschapv2 for wireless auth if it makes any difference. ## Marek Łukasz How creating a bounding connection in ssh? For example I have 2 host (meybe with 2 wan network) and need send my dynamic package -D from 2 host (round robin). Or I can use this same port -R 7000:localhost:443 on 2 different computers and simulating sending transmision from 2 host simultanice ?
11,151
如何使用 virt-manager 运行虚拟机
https://fedoramagazine.org/full-virtualization-system-on-fedora-workstation-30/
2019-07-27T06:40:24
[ "libvirt" ]
https://linux.cn/article-11151-1.html
![](/data/attachment/album/201907/27/064028u9yjhvx44wy1ix66.jpg) 在早些年,在同一台笔记本中运行多个操作系统只能双启动。当时,这些操作系统很难同时运行或彼此交互。许多年过去了,在普通的 PC 上,可以通过虚拟化在一个系统中运行另一个系统。 最近的 PC 或笔记本(包括价格适中的笔记本电脑)都有硬件虚拟化,可以运行性能接近物理主机的虚拟机。 虚拟化因此变得常见,它可以用来测试操作系统、学习新技术、创建自己的家庭云、创建自己的测试环境等等。本文将指导你使用 Fedora 上的 Virt Manager 来设置虚拟机。 ### 介绍 QEMU/KVM 和 Libvirt 与所有其他 Linux 系统一样,Fedora 附带了虚拟化扩展支持。它由作为内核模块之一的 KVM(基于内核的虚拟机)提供支持。 QEMU 是一个完整的系统仿真器,它可与 KVM 协同工作,允许你使用硬件和外部设备创建虚拟机。 最后,[libvirt](https://libvirt.org/) 能让你管理基础设施的 API 层,即创建和运行虚拟机。 这三个技术都是开源的,我们将在 Fedora Workstation 上安装它们。 ### 安装 #### 步骤 1:安装软件包 安装是一个相当简单的操作。 Fedora 仓库提供了 “virtualization” 软件包组,其中包含了你需要的所有包。 ``` sudo dnf install @virtualization ``` #### 步骤 2:编辑 libvirtd 配置 默认情况下,系统管理仅限于 root 用户,如果要启用常规用户,那么必须按以下步骤操作。 打开 `/etc/libvirt/libvirtd.conf` 进行编辑: ``` sudo vi /etc/libvirt/libvirtd.conf ``` 将 UNIX 域套接字组所有者设置为 libvirt: ``` unix_sock_group = "libvirt" ``` 调整 UNIX 域套接字的读写权限: ``` unix_sock_rw_perms = "0770" ``` #### 步骤 3:启动并启用 libvirtd 服务 ``` sudo systemctl start libvirtd sudo systemctl enable libvirtd ``` #### 步骤 4:将用户添加到组 为了管理 libvirt 与普通用户,你必须将用户添加到 `libvirt` 组,否则每次启动 `virt-manager` 时,都会要求你输入 sudo 密码。 ``` sudo usermod -a -G libvirt $(whoami) ``` 这会将当前用户添加到组中。你必须注销并重新登录才能应用更改。 ### 开始使用 virt-manager 可以通过命令行 (`virsh`) 或通过 `virt-manager` 图形界面管理 libvirt 系统。如果你想做虚拟机自动化配置,那么命令行非常有用,例如使用 [Ansible](https://fedoramagazine.org/get-the-latest-ansible-2-8-in-fedora/),但在本文中我们将专注于用户友好的图形界面。 `virt-manager` 界面很简单。主窗口显示连接列表,其中包括本地系统连接。 连接设置包括虚拟网络和存储定义。你可以定义多个虚拟网络,这些网络可用于在客户端系统之间以及客户端系统和主机之间进行通信。 ### 创建你的第一个虚拟机 要开始创建新虚拟机,请按下主窗口左上角的按钮: ![](/data/attachment/album/201907/27/064029q8v1158bn1pz2bpb.png) 向导的第一步需要选择安装模式。你可以选择本地安装介质、网络引导/安装或导入现有虚拟磁盘: ![](/data/attachment/album/201907/27/064029ry51fc5vc50fqqz5.png) 选择本地安装介质,下一步将需要选择 ISO 镜像路径: ![ ](/data/attachment/album/201907/27/064030mp0i1q149p95y0v0.png) 随后的两个步骤能让你调整新虚拟机的 CPU、内存和磁盘大小。最后一步将要求你选择网络选项:如果你希望虚拟机通过 NAT 与外部隔离,请选择默认网络。如果你希望从外部访问虚拟机,那么选择桥接。请注意,如果选择桥接,那么虚拟机则无法与主机通信。 如果要在启动设置之前查看或更改配置,请选中“安装前自定义配置”: ![](/data/attachment/album/201907/27/064030l38gfkv98skxyuf9.png) 虚拟机配置窗口能让你查看和修改硬件配置。你可以添加磁盘、网络接口、更改引导选项等。满意后按“开始安装”: ![](/data/attachment/album/201907/27/064031vdw3pjjpyj3pp7yf.png) 此时,你将被重定向到控制台来继续安装操作系统。操作完成后,你可以从控制台访问虚拟机: ![](/data/attachment/album/201907/27/064031d3kmlwwaawlnqes9.png) 刚刚创建的虚拟机将出现在主窗口的列表中,你还能看到 CPU 和内存占用率的图表: ![](/data/attachment/album/201907/27/064031fttotnss74pdo12n.png) libvirt 和 `virt-manager` 是功能强大的工具,它们可以以企业级管理为你的虚拟机提供出色的自定义。如果你需要更简单的东西,请注意 Fedora Workstation [预安装的 GNOME Boxes 已经能够满足基础的虚拟化要求](https://fedoramagazine.org/getting-started-with-virtualization-in-gnome-boxes/)。 --- via: <https://fedoramagazine.org/full-virtualization-system-on-fedora-workstation-30/> 作者:[Marco Sarti](https://fedoramagazine.org/author/msarti/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
In the beginning there was dual boot, it was the only way to have more than one operating system on the same laptop. At the time, it was difficult for these operating systems to be run simultaneously or interact with each other. Many years passed before it was possible, on common PCs, to run an operating system inside another through virtualization. Recent PCs or laptops, including moderately-priced ones, have the hardware features to run virtual machines with performance close to the physical host machine. Virtualization has therefore become normal, to test operating systems, as a playground for learning new techniques, to create your own home cloud, to create your own test environment and much more. This article walks you through using Virt Manager on Fedora to setup virtual machines. ## Introducing QEMU/KVM and Libvirt Fedora, like all other Linux systems, comes with native support for virtualization extensions. This support is given by KVM (Kernel based Virtual Machine) currently available as a kernel module. QEMU is a complete system emulator that works together with KVM and allows you to create virtual machines with hardware and peripherals. Finally [libvirt](https://libvirt.org/) is the API layer that allows you to administer the infrastructure, ie create and run virtual machines. The set of these three technologies, all open source, is what we’re going to install on our Fedora Workstation. ## Installation ### Step 1: install packages Installation is a fairly simple operation. The Fedora repository provides the “virtualization” package group that contains everything you need. sudo dnf install @virtualization ### Step 2: edit the libvirtd configuration By default the system administration is limited to the root user, if you want to enable a regular user you have to proceed as follows. Open the /etc/libvirt/libvirtd.conf file for editing sudo vi /etc/libvirt/libvirtd.conf Set the domain socket group ownership to libvirt unix_sock_group = "libvirt" Adjust the UNIX socket permissions for the R/W socket unix_sock_rw_perms = "0770" ### Step 3: start and enable the libvirtd service sudo systemctl start libvirtd sudo systemctl enable libvirtd ### Step 4: add user to group In order to administer libvirt with the regular user you must add the user to the libvirt group, otherwise every time you start virtual-manager you will be asked for the password for sudo. sudo usermod -a -G libvirt $(whoami) This adds the current user to the group. You must log out and log in to apply the changes. ## Getting started with virt-manager The libvirt system can be managed either from the command line (virsh) or via the virt-manager graphical interface. The command line can be very useful if you want to do automated provisioning of virtual machines, for example with [Ansible](https://fedoramagazine.org/get-the-latest-ansible-2-8-in-fedora/), but in this article we will concentrate on the user-friendly graphical interface. The virt-manager interface is simple. The main form shows the list of connections including the local system connection. The connection settings include virtual networks and storage definition. it is possible to define multiple virtual networks and these networks can be used to communicate between guest systems and between the guest systems and the host. ## Creating your first virtual machine To start creating a new virtual machine, press the button at the top left of the main form: ![](https://fedoramagazine.org/wp-content/uploads/2019/07/Screenshot-from-2019-07-14-09-41-45.png) The first step of the wizard requires the installation mode. You can choose between a local installation media, network boot / installation or an existing virtual disk import: ![](https://fedoramagazine.org/wp-content/uploads/2019/07/Screenshot-from-2019-07-14-09-30-53.png) Choosing the local installation media the next step will require the ISO image path: ![](https://fedoramagazine.org/wp-content/uploads/2019/07/Screenshot-from-2019-07-14-10-42-39.png) The subsequent two steps will allow you to size the CPU, memory and disk of the new virtual machine. The last step will ask you to choose network preferences: choose the default network if you want the virtual machine to be separated from the outside world by a NAT, or bridged if you want it to be reachable from the outside. Note that if you choose bridged the virtual machine cannot communicate with the host machine. Check “Customize configuration before install” if you want to review or change the configuration before starting the setup: ![](https://fedoramagazine.org/wp-content/uploads/2019/07/Screenshot-from-2019-07-14-10-43-21.png) The virtual machine configuration form allows you to review and modify the hardware configuration. You can add disks, network interfaces, change boot options and so on. Press “Begin installation” when satisfied: ![](https://fedoramagazine.org/wp-content/uploads/2019/07/Screenshot-from-2019-07-14-10-44-58.png) At this point you will be redirected to the console where to proceed with the installation of the operating system. Once the operation is complete, you will have the working virtual machine that you can access from the console: ![](https://fedoramagazine.org/wp-content/uploads/2019/07/Screenshot-from-2019-07-14-10-55-35.png) The virtual machine just created will appear in the list of the main form, where you will also have a graph of the CPU and memory occupation: ![](https://fedoramagazine.org/wp-content/uploads/2019/07/Screenshot-from-2019-07-14-11-09-22.png) libvirt and virt-manager is a powerful tool that allows great customization to your virtual machines with enterprise level management. If something even simpler is desired, note that Fedora Workstation comes with [GNOME Boxes pre-installed and can be sufficient for basic virtualization needs](https://fedoramagazine.org/getting-started-with-virtualization-in-gnome-boxes/). ## Jakfrost Since late 1990’s into the early 2000’s, I have used virtualization on many PC’s in Industrial Control applications. For the Systems Integrator/Solution Provider of Industrial Control applications programming, it has been a must have. This is due in large part to the fact that different OEM vendors of the control equipment (PLC’s, HMI’s etc…) didn’t play well together, and it was a constant, sometimes very painful, process of reconfiguring your system to accomidate that. VM’s wiped that out overnight. ## Rubem Mota Hi, I have a question, which is the best pratice to use another directory to store de ISO’s and the VM’s files, like an external drive, instead the main disk. ## Marco Sarti In the connection details, storage, you can add a large number of storage pool type. If you have an external drive you can mount it on a directory and add this directory as storage pool. ## Shaun Assam Nice article Marco. Virt-Manager has been my go-to for KVM VM management for many years due to it’s incredible detail in the settings. One thing I’d like to point out, in the article it is stated, “Note that if you choose bridged the virtual machine cannot communicate with the host machine.” In my experience I’ve been able to communicate with the host machine after configuring bridge mode. My guest VM would get the IP address from the router instead of the default NAT. I used the instructions from Lief Madsen’s site to do it. Even though it was published almost 3 years ago it still works today. Maybe using these instructions allows communication to the host. ## Marco Sarti Great suggestion! Thanks. ## John L. Ries Curiously enough, IBM’s OS/2 employed virtualization to run its DOS and Windows subsystems back in the 1990s. ## Marco Sarti I recently found my old OS/2 Warp CD and reinstalled it in a virtual machine, fully functional 🙂 ## Walter van der Schee What OS/2 called virtualization, was the i386 ‘virtual 8086’ mode, which allowed the Intel 80386 to run up to 8 fully protected 8086 mode PC VM’s. If the DOS mode needed no more than 16-bit addressing, this worked nicely and quick (for a i386 machine…). DOS extenders or Windows enhanched mode did not run inside those VMs, since it was 16-bit 8086 mode nothing more. ## Jean-Francois Messier Very interesting article. I knew there was a way to manage VMs without VMware or VirtualBox. Did you make an article about the “Debian” side of things (I use Ubuntu servers) ? Thanks 🙂 ## Marco Sarti Debian has packages in its repository, https://wiki.debian.org/KVM I’m pretty sure also Ubuntu has. ## Ron Is this a viable alternative for recent-ish Windows-targeted games? Or am I stuck with a native installation? ## Marco Sarti I think at least there is a display performance problem. Spice console has pretty good performances but not enough for gaming. ## Shaun Assam Ho Ron, have you checked out the virtio option for graphics instead of QXL. According to https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Virtualization_Deployment_and_Administration_Guide/sect-KVM_Para_virtualized_virtio_Drivers-Using_KVM_virtio_drivers_for_GPU_devices.html. this enhances GPU 3d acceleration performance. This may work with some — or maybe all — your games. You can find the virtio drivers and installation guide at https://docs.fedoraproject.org/en-US/quick-docs/creating-windows-virtual-machines-using-virtio-drivers/index.html ## rr4r i need example how run raspbery pi zero w in qemu and fedora ## Marco Sarti If you install the qemu-system-arm package you can choose the arm architecture at the first step of VM creation. This article helps you https://fedoraproject.org/wiki/Architectures/ARM/HowToQemu ## Guus Bonnema Does this open up an security hole if someone gains access to the normal user? Isn’t the reason for sudo the wish to isolate systemstuff from the regular user should someone enter the user’s id? ## Marco Sarti Consider that virt-manger can be used (and it is used) to administer libvirt remotely. In this case, using a regular user instead of root is a security enhancement. ## Guus Bonnema I am confused. Why would administering libvirt remotely through a regular user be more secure than root? Isn’t the root user harder to come by? Or does this have to do with usually disallowing root to log on remotely? P.S. I am a longtime fedora user, but I guess there is a lot about security that I do not know. ## gotmunchies How is the performance. I had tried this setup a couple years ago and found the performance to be horrible to the point of being unusable. So I have resorted to virtualbox. If there has been vast performance improvements to the virt-manager system of virtualization then I may give it a try again. ## Marco Sarti The computational performances are close to those of the host machine, this because the CPU virtualization is not emulated but managed directly by the hardware (if it supports). This applies to all hypervisors including VirtualBox. Of course processes that benefit from other low-level computational resources, such as GPUs, cannot have comparable performance. ## Marco Sarti Also consider that KVM is widely used in cloud implementations, for example OpenStack. ## Ravindu Meegasmulla This is actually brilliant compare to Virtual Box and other variants. I had bit of trouble when installing a windows machine using VirtIO. Here is a guide i found if any one needed. https://dennisnotes.com/note/20180614-ubuntu-18.04-qemu-setup/ ## Stan Sykes Superb article, many thanks for this. I’m also a long time user of Fedora and Virtualbox. Now I feel more confident to run virtual machine with virt-manager so I can release Virtualbox to regain space on my SSD … 🙂 ## Justin W. Flory I was surprised virt-manager was mentioned. I noticed in the RHEL 8.0 release notes, virt-manager is deprecated in favor of Cockpit. Will virt-manager continue to receive active development attention or should Fedora users look more closely at using Cockpit to manage libvirt VMs? ## Marco Sarti Currently the management of virtual machines in Cockipt has limited functionality compared to virt-manager. This is the current version of Fedora. ## Jamison Lofthouse Still waiting for the ability to create virtual networks on the libvirt user session. Then I wouldn’t have to have permissions to the system instance and wouldn’t have to reconfigure the storage path so that the images aren’t stored on /var.
11,152
如何在 Ubuntu LTS 系统上启用 Canonical 的内核实时补丁服务
https://www.2daygeek.com/enable-canonical-kernel-livepatch-service-on-ubuntu-lts-system/
2019-07-27T07:23:00
[ "内核", "补丁" ]
https://linux.cn/article-11152-1.html
![](/data/attachment/album/201907/27/072251d3dij23lndtuutzr.jpg) Canonical 在 Ubuntu 14.04 LTS 系统中引入了<ruby> 内核实时补丁服务 <rt> Kernel Livepatch Service </rt></ruby>。实时补丁服务允许你安装和应用关键的 Linux 内核安全更新,而无需重新启动系统。这意味着,在应用内核补丁程序后,你无需重新启动系统。而通常情况下,我们需要在安装内核补丁后重启 Linux 服务器才能供系统使用。 实时修补非常快。大多数内核修复程序只需要几秒钟。Canonical 的实时补丁服务对于不超过 3 个系统的用户无需任何费用。你可以通过命令行在桌面和服务器中启用 Canonical 实时补丁服务。 这个实时补丁系统旨在解决高级和关键的 Linux 内核安全漏洞。 有关[支持的系统](https://wiki.ubuntu.com/Kernel/Livepatch)和其他详细信息,请参阅下表。 | Ubuntu 版本 | 架构 | 内核版本 | 内核变体 | | --- | --- | --- | --- | | Ubuntu 18.04 LTS | 64-bit x86 | 4.15 | 仅 GA 通用和低电压内核 | | Ubuntu 16.04 LTS | 64-bit x86 | 4.4 | 仅 GA 通用和低电压内核 | | Ubuntu 14.04 LTS | 64-bit x86 | 4.4 | 仅 Hardware Enablement 内核 | **注意**:Ubuntu 14.04 中的 Canonical 实时补丁服务 LTS 要求用户在 Trusty 中运行 Ubuntu v4.4 内核。如果你当前没有运行使用该服务,请重新启动到此内核。 为此,请按照以下步骤操作。 ### 如何获取实时补丁令牌? 导航到 [Canonical 实时补丁服务页面](https://auth.livepatch.canonical.com/),如果要使用免费服务,请选择“Ubuntu 用户”。它适用于不超过 3 个系统的用户。如果你是 “UA 客户” 或多于 3 个系统,请选择 “Ubuntu customer”。最后,单击 “Get your Livepatch token” 按钮。 ![](/data/attachment/album/201907/27/072318afz0v1tu3tt6z601.jpg) 确保你已经在 “Ubuntu One” 中拥有帐号。否则,可以创建一个新的。 登录后,你将获得你的帐户密钥。 ![](/data/attachment/album/201907/27/072319yfntggggrhnh4tnt.jpg) ### 在系统中安装 Snap 守护程序 实时补丁系统通过快照包安装。因此,请确保在 Ubuntu 系统上安装了 snapd 守护程序。 ``` $ sudo apt update $ sudo apt install snapd ``` ### 如何系统中安装和配置实时补丁服务? 通过运行以下命令安装 `canonical-livepatch` 守护程序。 ``` $ sudo snap install canonical-livepatch canonical-livepatch 9.4.1 from Canonical* installed ``` 运行以下命令以在 Ubuntu 计算机上启用实时内核补丁程序。 ``` $ sudo canonical-livepatch enable xxxxc4xxxx67xxxxbxxxxbxxxxfbxx4e Successfully enabled device. Using machine-token: xxxxc4xxxx67xxxxbxxxxbxxxxfbxx4e ``` 运行以下命令查看实时补丁机器的状态。 ``` $ sudo canonical-livepatch status client-version: 9.4.1 architecture: x86_64 cpu-model: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz last-check: 2019-07-24T12:30:04+05:30 boot-time: 2019-07-24T12:11:06+05:30 uptime: 19m11s status: - kernel: 4.15.0-55.60-generic running: true livepatch: checkState: checked patchState: nothing-to-apply version: "" fixes: "" ``` 使用 `--verbose` 开关运行上述相同的命令,以获取有关实时修补机器的更多信息。 ``` $ sudo canonical-livepatch status --verbose ``` 如果要手动运行补丁程序,请执行以下命令。 ``` $ sudo canonical-livepatch refresh Before refresh: kernel: 4.15.0-55.60-generic fully-patched: true version: "" After refresh: kernel: 4.15.0-55.60-generic fully-patched: true version: "" ``` `patchState` 会有以下状态之一: * `applied`:未发现任何漏洞 * `nothing-to-apply`:成功找到并修补了漏洞 * `kernel-upgrade-required`:实时补丁服务无法安装补丁来修复漏洞 请注意,安装内核补丁与在系统上升级/安装新内核不同。如果安装了新内核,则必须重新引导系统以激活新内核。 --- via: <https://www.2daygeek.com/enable-canonical-kernel-livepatch-service-on-ubuntu-lts-system/> 作者:[Magesh Maruthamuthu](https://www.2daygeek.com/author/magesh/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[wxy](https://github.com/wxy) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
404
Not Found
null
11,155
MTTR 已死,CIRT 长存
https://opensource.com/article/19/7/measure-operational-performance
2019-07-28T08:48:40
[ "运维绩效" ]
https://linux.cn/article-11155-1.html
> > 通过关注影响业务的事件,CIRT 是衡量运维绩效的更准确方法。 > > > ![Green graph of measurements](/data/attachment/album/201907/28/084845qz5n3kzfikjg9loj.png "Green graph of measurements") IT 运维圈子的玩法正在发生变化,这意味着过去的规则越来越不合理。机构需要适当环境中的准确的、可理解的、且可操作的指标,以衡量运维绩效并推动关键业务转型。 越多的客户使用现代工具,他们管理的事件类型的变化越多,将所有这些不同事件粉碎到一个桶中以计算平均解决时间来表示运维绩效的意义就越少,这就是 IT 一直以来在做的事情。 ### 历史与指标 历史表明,在分析信号以防止错误和误解时,背景信息是关键。例如,在 20 世纪 80 年代,瑞典建立了一个分析水听器信号的系统,以提醒他们在瑞典当地水域出现的俄罗斯潜艇。瑞典人使用了他们认为代表一类俄罗斯潜艇的声学特征 —— 但实际上是鲱鱼在遇到潜在捕食者时释放的[气泡声](http://blogfishx.blogspot.com/2014/05/herring-fart-to-communicate.html)。这种对指标的误解加剧了各国之间的紧张关系,几乎导致了战争。 ![Funny fish cartoon](/data/attachment/album/201907/28/084846e3od44rl9gj6zznu.png "Funny fish cartoon") <ruby> 平均解决时间 <rt> Mean Time To Resolve </rt></ruby>(MTTR)是运维经理用于获得实现目标洞察力的主要运维绩效指标。这是一项基于<ruby> 系统可靠性工程 <rt> systems reliability engineering </rt></ruby>的古老措施。MTTR 已被许多行业采用,包括制造、设施维护以及最近的 IT 运维,它代表了解决在特定时间段内创建的事件所需的平均时间。 MTTR 的计算方法是将所有事件(从事件创建时间到解决时间)所需的时间除以事件总数。 ![MTTR formula](/data/attachment/album/201907/28/084846j00jahwtdhwi0jq4.png "MTTR formula") 正如它所说的,MTTR 是 **所有** 事件的平均值。MTTR 将高紧急事件和低紧急事件混为一谈。它还会重复计算每个单独的、未分组的事件,并得出有效的解决时间。它包括了在相同上下文中手动解决和自动解决的事件。它将在创建了几天(或几个月)甚至完全被忽略的事件混合在一起。最后,MTTR 包括每个小的瞬态突发事件(在 120 秒内自动关闭的事件),这些突发事件要么是非问题噪音,要么已由机器快速解决。 ![Variability in incident types](/data/attachment/album/201907/28/084847n0a2ahzacss0iqq0.png "Variability in incident types") MTTR 将所有事件(无论何种类型)抛入一个桶中,将它们全部混合在一起,并计算整个集合中的“平均”解决时间。这种过于简单化的方法导致运维执行方式的的噪音、错误和误导性指示。 ### 一种衡量绩效的新方法 <ruby> 关键事件响应时间 <rt> Critical Incident Response Time </rt></ruby>(CIRT)是评估运维绩效的一种更准确的新方法。PagerDuty 创立了 CIRT 的概念,但该方法可供所有人免费使用。 CIRT 通过使用以下技术剔除来自信号的噪声,其重点关注最有可能影响业务的事件: 1. 真正影响(或可能影响)业务的事件很少是低紧急事件,因此要排除所有低紧急事件。 2. 真正影响业务的事件很少(如果有的话)可以无需人为干预而通过监控工具自动解决,因此要排除未由人工解决的事件。 3. 在 120 秒内解决的短暂、爆发性和瞬态事件几乎不可能是真正影响业务的事件,因此要排除它们。 4. 长时间未被注意、提交或忽略(未确认、未解决)的事件很少会对业务造成影响;排除它们。注意:此阈值可以是特定于客户的统计推导数字(例如,高于均值的两个标准差),以避免使用任意数字。 5. 由单独警报产生的个别未分组事件并不代表较大的业务影响事件。因此,模拟具有非常保守的阈值(例如,两分钟)的事件分组以计算响应时间。 应用这些假设对响应时间有什么影响?简而言之,效果非常非常大! 通过在关键的、影响业务的事件中关注运维绩效,解决时间分布变窄并极大地向左偏移,因为现在它处理类似类型的事件而不是所有事件。 由于 MTTR 计算的响应时间长得多、人为地偏差,因此它是运维绩效较差的一个指标。另一方面,CIRT 是一项有意的措施,专注于对业务最重要的事件。 与 CIRT 一起使用的另一个关键措施是确认和解决事故的百分比。这很重要,因为它验证 CIRT(或 MTTA / MTTR)是否值得利用。例如,如果 MTTR 结果很低,比如 10 分钟,那听起来不错,但如果只有 42% 的事件得到解决,那么 MTTR 是可疑的。 总之,CIRT 和确认、解决事件的百分比形成了一组有价值的指标,可以让你更好地了解运营的执行情况。衡量绩效是提高绩效的第一步,因此这些新措施对于实现机构的可持续、可衡量的改进周期至关重要。 --- via: <https://opensource.com/article/19/7/measure-operational-performance> 作者:[Julie Gunderson](https://opensource.com/users/juliegund/users/kearnsjd/users/ophir) 选题:[lujun9972](https://github.com/lujun9972) 译者:[wxy](https://github.com/wxy) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
The game is changing for the IT ops community, which means the rules of the past make less and less sense. Organizations need accurate, understandable, and actionable metrics in the right context to measure operations performance and drive critical business transformation. The more customers use modern tools and the more variation in the types of incidents they manage, the less sense it makes to smash all those different incidents into one bucket to compute an average resolution time that will represent ops performance, which is what IT has been doing for a long time. ## History and metrics History shows that context is key when analyzing signals to prevent errors and misunderstandings. For example, during the 1980s, Sweden set up a system to analyze hydrophone signals to alert them to Russian submarines in local Sweden waters. The Swedes used an acoustic signature they thought represented a class of Russian submarines—but was actually [gas bubbles](http://blogfishx.blogspot.com/2014/05/herring-fart-to-communicate.html) released by herring when confronted by a potential predator. This misinterpretation of a metric increased tensions between the countries and almost resulted in a war. ![Funny fish cartoon Funny fish cartoon](https://opensource.com/sites/default/files/uploads/fish.png) Mean time to resolve (MTTR) is the main ops performance metric operations managers use to gain insight towards achieving their goals. It is an age-old measure based on systems reliability engineering. MTTR has been adopted across many industries, including manufacturing, facility maintenance, and, more recently, IT ops, where it represents the average time it takes to resolve incidents from the time they were created across a given period of time. MTTR is calculated by dividing the time it takes to resolve all incidents (from the time of incident creation to time of resolution) by the total number of incidents. ![MTTR formula MTTR formula](https://opensource.com/sites/default/files/uploads/mttr.png) Ophir Ronen, CC BY MTTR is exactly what it says: It's the average across ** all** incidents. MTTR smears together both high- and low-urgency incidents. It also repetitively counts each separate, ungrouped incident and results in a biased resolve time. It includes manually resolved and auto-resolved incidents in the same context. It mashes together incidents that are tabled for days (or months) after creation or are even completely ignored. Finally, MTTR includes every little transient burst (incidents that are auto-closed in under 120 seconds), which are either noisy non-issues or quickly resolved by a machine. ![Variability in incident types Variability in incident types](https://opensource.com/sites/default/files/uploads/incidents.png) Ophir Ronen, CC BY MTTR takes all incidents, regardless of type, throws them into a single bucket, mashes them all together, and calculates an "average" resolution time across the entire set. This overly simplistic method results in a noisy, erroneous, and misleading indication of how operations is performing. ## A new way of measuring performance Critical incident response time (CIRT) is a new, significantly more accurate method to evaluate operations performance. CIRT focuses on the incidents that are most likely to impact business by culling noise from incoming signals using the following techniques: - Real business-impacting (or potentially impacting) incidents are very rarely low urgency, so rule out all low-urgency incidents. - Real business-impacting incidents are very rarely (if ever) auto-resolved by monitoring tools without the need for human intervention, so rule out incidents that were not resolved by a human. - Short, bursting, and transient incidents that are resolved within 120 seconds are highly unlikely to be real business-impacting incidents, so rule them out. - Incidents that go unnoticed, tabled, or ignored (not acknowledged, not resolved) for a very long time are rarely business-impacting; rule them out. Note: This threshold can be a statistically derived number that is customer-specific (e.g., two standard deviations above the mean) to avoid using an arbitrary number. - Individual, ungrouped incidents generated by separate alerts are not representative of the larger business-impacting incident. Therefore, simulate incident groupings with a very conservative threshold, e.g., two minutes, to calculate response time. What effect does applying these assumptions have on response times? In a nutshell, a very, very large effect! By focusing on ops performance during critical, business-impacting incidents, the resolve-time distribution narrows and shifts greatly to the left, because now it is dealing with similar types of incidents rather than all events. Because MTTR calculates a much longer, artificially skewed response time, it is a poor indicator of operations performance. CIRT, on the other hand, is an intentional measure focused on the incidents that matter most to business. An additional critical measure that is wise to use alongside CIRT is the percentage of incidents which are acknowledged and resolved. This is important, as it validates whether the CIRT (or MTTA/MTTR for that matter) is worth utilizing. For example, if an MTTR result is low, say 10 minutes, it sounds great, but if only 42% of incidents are resolved, then that MTTR is suspect. In summary, CIRT and the percentage of incidents acknowledged and resolved form a valuable set of metrics that give you a much better idea of how your operations are performing. Gauging performance is the first step to improving performance, so these new measures are key to achieving continuous cycles of measurable improvement for your organization. ## 1 Comment
11,156
在 Linux 中不使用 useradd 命令如何创建用户账号
https://www.2daygeek.com/linux-user-account-creation-in-manual-method/
2019-07-28T20:07:45
[ "用户" ]
https://linux.cn/article-11156-1.html
![](/data/attachment/album/201907/28/200732enjn6u0mrr61nz62.jpg) Linux 中有三个命令可以用来创建用户账号。你尝试过在 Linux 中手动创建用户吗?我的意思是不使用上面说的三个命令。 如果你不知道怎么做,本文可以手把手教你,并向你展示细节部分。 你可能想,这怎么可能?别担心,正如我们多次提到的那样,在 Linux 上任何事都可以搞定。这只是其中一例。 是的,我们可以做到的。想了解更多吗? * [在 Linux 中创建用户的三种方法](https://www.2daygeek.com/linux-user-account-creation-useradd-adduser-newusers/) * [在 Linux 中批量创建用户的两种方法](https://www.2daygeek.com/linux-bulk-users-creation-useradd-newusers/) 话不多说,让我们开始吧。 首先,我们要找出最后创建的 UID 和 GID 信息。 掌握了这些信息之后,就可以继续下一步。 ``` # cat /etc/passwd | tail -1 tuser1:x:1153:1154:Test User:/home/tuser1:/bin/bash ``` 根据以上输出,最后创建的用户 UID 是 1153,GID 是 1154。为了试验,我们将在系统中添加 `tuser2` 用户。 现在,在`/etc/passwd` 文件中添加一条用户信息。 总共七个字段,你需要添加一些必要信息。 ``` +-----------------------------------------------------------------------+ |username:password:UID:GID:Comments:User Home Directory:User Login Shell| +-----------------------------------------------------------------------+ | | | | | | | 1 2 3 4 5 6 7 ``` 1. 用户名:这个字段表示用户名称。字符长度必须在 1 到 32 之间。 2. 密码(`x`):表示存储在 `/etc/shadow` 文件中的加密密码。 3. 用户 ID:表示用户的 ID(UID),每个用户都有独一无二的 UID。UID 0 保留给 root 用户,UID 1-99 保留给系统用户,UID 100-999 保留给系统账号/组。 4. 组 ID:表示用户组的 ID(GID),每个用户组都有独一无二的 GID,存储在 `/etc/group` 文件中。 5. 注释/用户 ID 信息:这个字段表示备注,用于描述用户信息。 6. 主目录(`/home/$USER`):表示用户的主目录。 7. shell(`/bin/bash`):表示用户使用的 shell。 在文件最后添加用户信息。 ``` # vi /etc/passwd tuser2:x:1154:1155:Test User2:/home/tuser2:/bin/bash ``` 你需要创建相同名字的用户组。同样地,在 `/etc/group` 文件中添加用户组信息。 ``` # vi /etc/group tuser2:x:1155: ``` 做完以上两步之后,给用户设置一个密码。 ``` # passwd tuser2 Changing password for user tuser2. New password: Retype new password: passwd: all authentication tokens updated successfully. ``` 最后,试着登录新创建的用户。 ``` # ssh [email protected] [email protected]'s password: Creating directory '/home/tuser2'. $ls -la total 16 drwx------. 2 tuser2 tuser2 59 Jun 17 09:46 . drwxr-xr-x. 15 root root 4096 Jun 17 09:46 .. -rw-------. 1 tuser2 tuser2 18 Jun 17 09:46 .bash_logout -rw-------. 1 tuser2 tuser2 193 Jun 17 09:46 .bash_profile -rw-------. 1 tuser2 tuser2 231 Jun 17 09:46 .bashrc ``` --- via: <https://www.2daygeek.com/linux-user-account-creation-in-manual-method/> 作者:[Magesh Maruthamuthu](https://www.2daygeek.com/author/magesh/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[hello-wn](https://github.com/hello-wn) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
404
Not Found
null
11,158
获取有关 Linux shell 内置命令的帮助
https://www.networkworld.com/article/3410350/getting-help-for-linux-shell-built-ins.html
2019-07-28T20:49:35
[ "shell", "内置命令" ]
https://linux.cn/article-11158-1.html
> > Linux 内置命令属于用户 shell 的一部分,本文将告诉你如何识别它们并获取使用它们的帮助。 > > > ![](/data/attachment/album/201907/28/204915bj1wmhxeargx14lt.jpg) Linux 内置命令是内置于 shell 中的命令,很像内置于墙中的书架。与标准 Linux 命令存储在 `/usr/bin` 中的方式不同,你不会找到它们的独立文件,你可能使用过相当多的内置命令,但你不会感觉到它们与 `ls` 和 `pwd` 等命令有何不同。 内置命令与其他 Linux 命令一样使用,它们可能要比不属于 shell 的类似命令运行得快一些。Bash 内置命令包括 `alias`、`export` 和 `bg` 等。 正如你担心的那样,因为内置命令是特定于 shell 的,所以它们不会提供手册页。使用 `man` 来查看 `bg`,你会看到这样的东西: ``` $ man bg No manual entry for bg ``` 判断内置命令的另一个提示是当你使用 `which` 命令来识别命令的来源时,Bash 不会响应,表示没有与内置命令关联的文件: ``` $ which bg $ ``` 另一方面,如果你的 shell 是 `/bin/zsh`,你可能会得到一个更有启发性的响应: ``` % which bg bg: shell built-in command ``` bash 提供了额外的帮助信息,但它是通过使用 `help` 命令实现的: ``` $ help bg bg: bg [job_spec ...] Move jobs to the background. Place the jobs identified by each JOB_SPEC in the background, as if they had been started with `&'. If JOB_SPEC is not present, the shell's notion of the current job is used. Exit Status: Returns success unless job control is not enabled or an error occurs. ``` 如果你想要查看 bash 提供的所有内置命令的列表,使用 `compgen -b` 命令。通过管道将命令输出到列中,以获得较好格式的清单。 ``` $ compgen -b | column . compgen exit let return typeset : complete export local set ulimit [ compopt false logout shift umask alias continue fc mapfile shopt unalias bg declare fg popd source unset bind dirs getopts printf suspend wait break disown hash pushd test builtin echo help pwd times caller enable history read trap cd eval jobs readarray true command exec kill readonly type ``` 如果你使用 `help` 命令,你将看到一个内置命令列表以及简短描述。但是,这个列表被截断了(以 `help` 命令结尾): ``` $ help GNU bash, version 5.0.3(1)-release (x86_64-pc-linux-gnu) These shell commands are defined internally. Type `help' to see this list. Type `help name' to find out more about the function `name'. Use `info bash' to find out more about the shell in general. Use `man -k' or `info' to find out more about commands not in this list. A star (*) next to a name means that the command is disabled. job_spec [&] history [-c] [-d offset] [n] or histo> (( expression )) if COMMANDS; then COMMANDS; [ elif CO> . filename [arguments] jobs [-lnprs] [jobspec ...] or jobs -> : kill [-s sigspec | -n signum | -sigsp> [ arg... ] let arg [arg ...] [[ expression ]] local [option] name[=value] ... alias [-p] [name[=value] ... ] logout [n] bg [job_spec ...] mapfile [-d delim] [-n count] [-O ori> bind [-lpsvPSVX] [-m keymap] [-f filen> popd [-n] [+N | -N] break [n] printf [-v var] format [arguments] builtin [shell-builtin [arg ...]] pushd [-n] [+N | -N | dir] caller [expr] pwd [-LP] case WORD in [PATTERN [| PATTERN]...) > read [-ers] [-a array] [-d delim] [-i> cd [-L|[-P [-e]] [-@]] [dir] readarray [-d delim] [-n count] [-O o> command [-pVv] command [arg ...] readonly [-aAf] [name[=value] ...] or> compgen [-abcdefgjksuv] [-o option] [-> return [n] complete [-abcdefgjksuv] [-pr] [-DEI] > select NAME [in WORDS ... ;] do COMMA> compopt [-o|+o option] [-DEI] [name ..> set [-abefhkmnptuvxBCHP] [-o option-n> continue [n] shift [n] coproc [NAME] command [redirections] shopt [-pqsu] [-o] [optname ...] declare [-aAfFgilnrtux] [-p] [name[=va> source filename [arguments] dirs [-clpv] [+N] [-N] suspend [-f] disown [-h] [-ar] [jobspec ... | pid . &lt;p&gt'&gt; test [expr] echo [-neE] [arg ...] time [-p] pipeline enable [-a] [-dnps] [-f filename] [nam> times eval [arg ...] trap [-lp] [[arg] signal_spec ...] exec [-cl] [-a name] [command [argumen> true exit [n] type [-afptP] name [name ...] export [-fn] [name[=value] ...] or exp> typeset [-aAfFgilnrtux] [-p] name[=va> false ulimit [-SHabcdefiklmnpqrstuvxPT] [li> fc [-e ename] [-lnr] [first] [last] or> umask [-p] [-S] [mode] fg [job_spec] unalias [-a] name [name ...] for NAME [in WORDS ... ] ; do COMMANDS> unset [-f] [-v] [-n] [name ...] for (( exp1; exp2; exp3 )); do COMMAND> until COMMANDS; do COMMANDS; done function name { COMMANDS ; } or name (> variables - Names and meanings of som> getopts optstring name [arg] wait [-fn] [id ...] hash [-lr] [-p pathname] [-dt] [name .> while COMMANDS; do COMMANDS; done help [-dms] [pattern ...] { COMMANDS ; } ``` 从上面的清单中可以看出,`help` 命令本身就是内置的。 你可以通过向 `help` 命令提供你感兴趣的内置命令名称来获取关于它们的更多信息,例如 `help dirs`: ``` $ help dirs dirs: dirs [-clpv] [+N] [-N] Display directory stack. Display the list of currently remembered directories. Directories find their way onto the list with the `pushd' command; you can get back up through the list with the `popd' command. Options: -c clear the directory stack by deleting all of the elements -l do not print tilde-prefixed versions of directories relative to your home directory -p print the directory stack with one entry per line -v print the directory stack with one entry per line prefixed with its position in the stack Arguments: +N Displays the Nth entry counting from the left of the list shown by dirs when invoked without options, starting with zero. -N Displays the Nth entry counting from the right of the list shown by dirs when invoked without options, starting with zero. Exit Status: Returns success unless an invalid option is supplied or an error occurs. ``` 内置命令提供了每个 shell 的大部分功能。你使用的任何 shell 都有一些内置命令,但是如何获取这些内置命令的信息可能因 shell 而异。例如,对于 `zsh`,你可以使用 `man zshbuiltins` 命令获得其内置命令的描述。 ``` $ man zshbuiltins ZSHBUILTINS(1) General Commands Manual ZSHBUILTINS(1) NAME zshbuiltins - zsh built-in commands SHELL BUILTIN COMMANDS Some shell builtin commands take options as described in individual en‐ tries; these are often referred to in the list below as `flags' to avoid confusion with shell options, which may also have an effect on the behav‐ iour of builtin commands. In this introductory section, `option' always has the meaning of an option to a command that should be familiar to most command line users. … ``` 在这个冗长的手册页中,你将找到一个内置命令列表,其中包含有用的描述,如下摘录中所示: ``` bg [ job ... ] job ... & Put each specified job in the background, or the current job if none is specified. bindkey See the section `Zle Builtins' in zshzle(1). break [ n ] Exit from an enclosing for, while, until, select or repeat loop. If an arithmetic expression n is specified, then break n levels instead of just one. ``` ### 最后 Linux 内置命令对于每个 shell 都很重要,它的操作类似特定于 shell 的命令一样。如果你经常使用不同的 shell,并注意到你经常使用的某些命令似乎不存在或者不能按预期工作,那么它可能是你使用的其他 shell 之一中的内置命令。 --- via: <https://www.networkworld.com/article/3410350/getting-help-for-linux-shell-built-ins.html> 作者:[Sandra Henry-Stocker](https://www.networkworld.com/author/Sandra-Henry_Stocker/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[MjSeven](https://github.com/MjSeven) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
301
Moved Permanently
null