diff --git a/published/20211109 relaying mail to multiple smarthosts with opensmtpd.md b/published/20211109 relaying mail to multiple smarthosts with opensmtpd.md new file mode 100644 index 0000000000..5b9a69799c --- /dev/null +++ b/published/20211109 relaying mail to multiple smarthosts with opensmtpd.md @@ -0,0 +1,75 @@ +[#]: subject: "relaying mail to multiple smarthosts with opensmtpd" +[#]: via: "https://jao.io/blog/2021-11-09-relaying-mail-to-multiple-smarthosts.html" +[#]: author: "jao https://jao.io" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14891-1.html" + +使用 OpenSMTPD 将邮件中继到多个 smarthost +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/03/162813rc900xbgx3xggxxg.jpg) + +我喜欢使用本地 SMTP 守护进程从我的笔记本电脑发送电子邮件,因为这样我即使在断开连接的情况下也可以发送电子邮件,而且,即使是在网络正常的情况下,因为我不需要等待网络协议在远程 smarthost 上完成。哦,我还需要本地邮件投递。 + +多年来,我一直使用 Postfix 来达到这些目的。它具有可接受的简单配置。但最近我开始喜欢 VPN([mullvad][1],如果你想知道的话),而在 `/etc/resolv.conf` 发生变化时会变得混乱(例如,你在 Postfix 的服务启动后才启动 VPN)。我找到了一个非常简单的替代方案:[OpenSMTPD][2]。 + +假设我想在使用 [jao@gnu.org][3] 发送电子邮件时使用 SMTP 服务器 fencepost.gnu.org,而在我的 `From` 头中使用 [mail@jao.io][4] 或 [news@xmobar.org][5] 时使用 smtp.jao.io。OpenSMTPD 让你通过一个非常简单的配置文件 `/etc/smtpd.conf` 来实现: + +(这是我的 Debian 机器中的默认配置文件。另一个流行的替代方案是 `/etc/openstmpd.conf`)。 + +``` +table aliases file:/etc/aliases +table secrets db:/etc/mail/secrets.db + +table sendergnu { jao@gnu.org } +table senderjao { mail@jao.io, news@xmobar.org } + +listen on localhost + +action "local" mbox alias +action "relaygnu" relay host smtp+tls://gnu@fencepost.gnu.org:587 auth +action "relayjao" relay host smtps://jao@smtp.jao.io:465 auth + +match for local action "local" +match for any from mail-from action "relaygnu" +match for any from mail-from action "relaygan" +``` + +我们还为此配置了本地投递。这是完整的配置文件!唯一需要的另一件事是生成 `secrets.db` 文件,其中包含与键 `gnu` 和 `jao` 对应的用户和密码(这些只是任意名称)。为此,我们使用它们创建一个纯文本文件,使用形式为 ` :` 的条目: + +``` +gnu jao:my fencepost password +jao mail@jao.io:xxxxxxxxxxxxxxxxx +``` + +`fencepost.gnu.org` 用户是 `jao`,`smtp.jao.io` 的用户是 `mail@jao.io`(你看,不需要转义空格或 ats)。然后我们使用程序 `makemap` 来创建密钥数据库: + +``` +makemap secrets && rm secrets +``` + +-------------------------------------------------------------------------------- + +via: https://jao.io/blog/2021-11-09-relaying-mail-to-multiple-smarthosts.html + +作者:[jao][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jao.io +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Mullvad +[2]: https://www.opensmtpd.org/ +[3]: mailto:jao@gnu.org +[4]: mailto:mail@jao.io +[5]: mailto:news@xmobar.org +[6]: tmp.zHAc8OxDnm#fn.1 +[7]: tmp.zHAc8OxDnm#fnr.1 +[8]: https://jao.io/blog/tags.html +[9]: https://jao.io/blog/tag-sundry.html diff --git a/published/20211122 7 key components of observability in Python.md b/published/20211122 7 key components of observability in Python.md new file mode 100644 index 0000000000..d577b7f35b --- /dev/null +++ b/published/20211122 7 key components of observability in Python.md @@ -0,0 +1,176 @@ +[#]: subject: "7 key components of observability in Python" +[#]: via: "https://opensource.com/article/21/11/observability-python" +[#]: author: "Moshe Zadka https://opensource.com/users/moshez" +[#]: collector: "lujun9972" +[#]: translator: "Yufei-Yan" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14889-1.html" + +Python 中可观测性的 7 个关键部分 +====== + +> 学习为什么 Python 中的可观测性很重要,以及如何在你的软件开发生命周期中实现它。 + +![](https://img.linux.net.cn/data/attachment/album/202208/02/115713cbml51nooltb21bx.jpg) + +你写的应用会执行很多代码,而且是以一种基本上看不到的方式执行。所以你是怎么知道: + + * 代码是否在运行? + * 是不是在正常工作? + * 谁在使用它,如何使用? + +可观测性是一种能力,可以通过查看数据来告诉你,你的代码在做什么。在这篇文章中,主要关注的问题是分布式系统中的服务器代码。并不是说客户端应用代码的可观测性不重要,只是说客户端往往不是用 Python 写的。也不是说可观测性对数据科学不重要,而是在数据科学领域的可观测性工具(大多是 Juptyter 和快速反馈)是不同的。 + +### 为什么可观测性很重要 + +所以,为什么可观测性重要呢?在软件开发生命周期(SDLC)中,可观测性是一个关键的部分。 + +交付一个应用不是结束,这只是一个新周期的开始。在这个周期中,第一个阶段是确认这个新版本运行正常。否则的话,很有可能需要回滚。哪些功能正常运行?哪些功能有细微的错误?你需要知道发生了什么,才能知道接下来要怎么做。这些东西有时候会以奇怪的方式不能正常运行。不管是天灾,还是底层基础设施的问题,或者应用进入了一种奇怪的状态,这些东西可能在任何时间以任何理由停止工作。 + +在标准 SDLC 之外,你需要知道一切都在运行中。如果没有,有办法知道是怎么不能运行的,这是非常关键的。 + +### 反馈 + +可观测性的第一部分是获得反馈。当代码给出它正在做什么的信息时,反馈可以在很多方面提供帮助。在模拟环境或测试环境中,反馈有助于发现问题,更重要的是,以更快的方式对它们进行分类。这可以改善在验证步骤中的工具和交流。 + +当进行金丝雀部署canary deployment或更改特性标志时,你需要知道是否要继续,还是等更长时间,或者回滚,反馈就显得很重要了。 + +### 监控 + +有时候你怀疑有些东西不太对。也许是一个依赖服务有问题,或者是社交网站爆出了大量你的网站的问题。也许在相关的系统中有复杂的操作,然后你想确保你的系统能完美处理。在这些情况下,你就想把可观测性系统的数据整合到控制面板上。 + +当写一个应用的时候,这些控制面板需要是设计标准的一部分。只有当你的应用能把数据共享给这些控制面板,它们才会把这些数据显示出来。 + +### 警报 + +看控制面板超过 15 分钟就像看着油漆变干一样。任何人都不应该遭受这种折磨。对于这种任务,我们要有报警系统。报警系统将可观测性数据与预期数据进行对比,当它们不匹配的时候就发出通知。完全深入研究时间管理超出了本文的范围。然而,从两方面来说,可观测应用是报警友好的alert-friendly: + + * 它们有足够多,足够好的数据,发出的警报才是高质量的。 + * 警报有足够的数据,或者接收者可以很容易的得到数据,这样有助于找到源头。 + +高质量警报有三个特点: + + * 较少的错报:如果有警报,那一定是有问题了。 + * 较少的漏报:如果有问题,那一定有警报触发。 + * 及时性:警报会迅速发出以减少恢复时间。 + +这三个特点是互相有冲突的。你可以通过提高监测的标准来减少错误警报,代价是增加了漏报。你也可以通过降低监测的门槛来减少漏报,代价是增加错报。通过收集更多数据,你也可以同时减少错报和漏报,而代价是降低了及时性。 + +同时改善这三个参数就更难了。这就要求高质量的可观测性数据。更高质量的数据可以同时改善这三个特点。 + +### 日志 + +有的人喜欢嘲笑用打印来调试的方法。但是,在一个大多数软件都不在你本机运行的世界里,你所能做的只有打印调试。日志记录就是打印调试的一种形式。尽管它有很多缺点,但 Python 日志库提供了标准化的日志记录。更重要的是,它意味着你可以通过这些库去记录日志。 + +应用程序要负责配置日志的记录方式。讽刺地是,在应用程序对配置日志负责了多年以后,现在越来越不是这样了。在现代容器编排orchestration环境中,现代应用程序记录标准错误和标准输出,并且信任编排orchestration系统可以合理的处理日志。 + +然而,你不应该依赖库,或者说,其他任何地方。如果你想让操作的人知道发生了什么,_使用日志,而不是打印_。 + +#### 日志级别 + +日志记录的一个最重要功能就是 _日志级别_。不同的日志级别可以让你合理的过滤并分流日志。但是这只有在日志级别保持一致的情况下才能做到。最后,你应该在整个应用程序中保持日志级别的一致性。 + +选择不兼容语义的库可以通过在应用层面的适当配置来追溯修复,这只需要通过使用 Python 中最重要的通用风格做到:`getLogger(__name-_)`。 + +大多数合理的库都会遵循这个约定。过滤器Filters可以在日志对象发出之前就地修改它们。你可以给处理程序附加一个过滤器,这个处理程序会根据名称修改消息,使其具有合适的级别。 + +``` +import logging +LOGGER=logging.getLogger(__name__) +``` + +考虑到这一点,你现在必须明确日志级别的语义。这其中有很多选项,但是下面这些是我的最爱: + + * `Error`:发送一个即时警告。应用程序处于一个需要操作人员引起注意的状态。(这意味着包含 `Critical` 和 `Error`) + * `Warning`:我喜欢把这些称作“工作时间警报”。这种情况下,应该有人在一个工作日内关注一下。 + * `Info`:这是在正常工作流程中发出的。如果怀疑有问题的时候,这个是用来帮助人们了解应用程序在做什么的。 + * `Debug`:默认情况下,这个不应该在生产环境中出现。在模拟环境或开发环境下,可以发出来,也可以不发。如果需要更多的信息,在生产环境也可以特地被打开。 + +任何情况下都不要在日志中包含个人身份信息Personal Identifiable Information(PII)或密码。无论日志级别是什么,都是如此,比如级别更改,激活调试级别等等。日志聚合系统很少是 PII 安全PII-safe的,特别是随着 PII 法规的不断发展(HIPAA、GDPR 等等)。 + +#### 日志聚合 + +现代系统几乎都是分布式的。冗余redundancy扩展性scaling,有时是管辖权jurisdictional需要更多的水平分布。微服务意味着垂直分布。登录到每个机器去查看日志已经是不现实的了。出于合理的控制原因,允许开发人员登录到机器中会给予他们更多的权限,这不是个好主意。 + +所有的日志都应该被发到一个聚合器。有一些商业的方案,你可以配置一个 ELK 栈,或者也可以使用其他的数据库(SQL 或则 no-SQL)。作为一个真正的低技术解决方案,你可以将日志写入文件,然后将它们发送到对象存储中。有很多解决方案,但是最重要的事情是选择一个,并且将所有东西聚合到一起。 + +#### 记录查询 + +在将所有东西记录到一个地方后,会有很多日志。具体的聚合器可以定义如何写查询,但是无论是通过从存储中搜索还是写 NoSQL 查询,记录查询以匹配源和细节都是很有用的。 + +### 指标抓取 + +指标抓取Metric Scraping是一个服务器拉取server pull模型。指标服务器定时和应用程序连接,并且拉取指标。 + +最后,这意味着服务器需要连接和找到所有相关的应用服务器。 + +#### 以 Prometheus 为标准 + +如果你的指标聚合器是 Prometheus,那么 [Prometheus][2] 格式做为一个端点endpoint是很有用的。但是,即使聚合器不是 Prometheus,也是很有用的。几乎所有的系统都包含与 Prometheus 端点兼容的垫片shim + +使用客户端 Python 库给你的应用程序加一个 Prometheus 垫片,这将使它能够被大多数的指标聚合器所抓取。当 Prometheus 发现一个服务器,它就期望找到一个指标端点。这经常是应用程序路由的一部分,通常在 `/metrics` 路径下。不管 Web 应用的平台是什么,如果你能在一个端点下运行一个定制类型的定制字节流,Prometheus 就可以将它抓取。 + +对于大多数流行的框架,总有一个中间件插件或者类似的东西收集指标,如延迟和错误率。通常这还不够。你需要收集定制的应用数据:比如,每个端点的缓存命中/缺失hit/miss率,数据库延迟,等等。 + +#### 使用计数器 + +Prometheus 支持多个数据类型。一个重要且巧妙的类型就是计数器。计数器总是在前进 —— 但有一点需要注意。 + +当应用重置,计数器会归零。计数器中的这些“历时epochs”通过将计数器“创建时间”作为元数据发送来管理。Prometheus 知道不去比较两个不同历时epochs的计数器。 + +#### 使用仪表值 + +仪表值会简单很多:它们测量瞬时值。用它们来测量会上下起伏的数据:比如,分配的总内存大小,缓存大小,等等。 + +#### 使用枚举值 + +枚举值对于整个应用程序的状态是很有用的,尽管它们可以以更精细的方式被收集。比如,你正使用一个功能门控feature-gating框架,一个有多个状态(比如,使用中、关闭、屏蔽shadowing 等)的功能,也许使用枚举会更有用。 + +### 分析 + +分析不同于指标,因为它们要对应连续的事件。比如,在网络服务器中,事件是一个外部请求及其产生的工作。特别是,在事件完成之前事件分析是不能被发送的。 + +事件包含特定的指标:延迟,数量,以及可能产生的对其他服务请求的细节,等等。 + +#### 结构化日志 + +现在一个可能的选择是将日志结构化。发送事件只发送带有正确格式的有效载荷payload的日志。这个数据可以从日志聚合器请求,然后解析,并且放入一个合适的系统,这样可以对它的可见性。 + +### 错误追踪 + +你可以使用日志来追踪错误,也可以用分析来追踪错误。但是一个专门的错误系统还是值得的。一个为错误而优化的系统可以发送更多的错误,因为错误毕竟还是罕见的。这样它就可以发送正确的数据,并且用这些数据,它能做更多智能的事情。Python 中的错误追踪系统通常和一般的异常处理关联,然后收集数据,并且把它发到一个专门的错误聚合器。 + +#### 使用 Sentry + +很多情况下,自己运行 Sentry 是正确的做法。当错误发生时,就说明有些东西就出问题了。可靠地删除敏感数据是不可能的,因为一定有会出现敏感数据被发送到不应该的地方。 + +通常,这种工作量并不会很大:异常并不常出现。最后,这个系统并不需要很高的质量,也不需要高可靠性的备份。昨天的错误应该已经修复了,希望如此,如果没有,你还会发现的! + +### 快速、安全、可重复:三者都要 + +可观测的系统开发起来更快,因为它们可以给你提供反馈。它们运行起来也更安全,因为当出问题的时候,它们也会更早的让你知道。最后,因为有反馈回路,可观测性也有助于围绕它构建可重复的过程。可观测性可以让你了解你的应用程序。而更了解它们,就胜利了一半。 + +#### 磨刀不误砍柴功 + +构建所有的可观测层是一件困难的事情。总会让人感觉是在浪费的工作,或者更像是“可以有,但是不急”。 + +之后再做这个可以吗?也许吧,但是不应该。正确的构建可观测性可以加速后面所有阶段的开发:测试、监控,甚至是培训新人。在一个和科技行业一样动荡的行业,减少培训新人的工作量绝对是值得的。 + +事实上,可观测性很重要,所以尽早把它写出来,然后就可以在整个过程中进行维护。反过来,它也会帮你维护你的软件。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/11/observability-python + +作者:[Moshe Zadka][a] +选题:[lujun9972][b] +译者:[MCGA](https://github.com/Yufei-Yan) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/search_find_code_python_programming.png?itok=ynSL8XRV (Searching for code) +[2]: https://opensource.com/article/21/7/run-prometheus-home-container diff --git a/published/20220626 An open source project that opens the internet for all.md b/published/20220626 An open source project that opens the internet for all.md new file mode 100644 index 0000000000..f63538723f --- /dev/null +++ b/published/20220626 An open source project that opens the internet for all.md @@ -0,0 +1,59 @@ +[#]: subject: "An open source project that opens the internet for all" +[#]: via: "https://opensource.com/article/22/6/equalify-open-internet-accessibility" +[#]: author: "Blake Bertuccelli https://opensource.com/users/blake" +[#]: collector: "lkxed" +[#]: translator: "yjacks" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14905-1.html" + +Equalify:让每一个人都可以无障碍访问互联网 +====== + +> Equalify 是一个为了让互联网更易于使用的开源项目。 + +![](https://img.linux.net.cn/data/attachment/album/202208/07/114828xkk55krbsprkx7kk.jpg) + +无障碍访问Accessibility 是一把促进社会更加开放的的钥匙。 + +我们在网上学习,我们在网上花钱,也在网上吵吵嚷嚷。更重要的是,我们在网上获取的信息激励我们创造一个更好的世界。当我们忽视无障碍访问的要求时,出生时失去光明,或在战争中失去四肢的人们都将只能被阻挡在他人可以享受的网上信息之外。 + +*我们必须确保每个人都有通往开放互联网的通道*,而我正在通过开发 [Equalify][2],为实现这一目标而努力。 + +### 什么是 Equalify? + +Equalify 是“无障碍访问平台”。 + +这个平台允许使用者们对数以千计的网站进行多种无障碍访问的扫描。通过使用我们的最新版本,用户还可以过滤无数的警告,创建一个对他们来说有意义的统计仪表盘。 + +这个项目才刚刚开始。Equalify 的目的是开源像 SiteImprove 这样的昂贵服务所提供的各种收费服务。有了更好的工具,我们可以确保互联网更容易访问、我们的社会更开放。 + +### 如何判断网站的无障碍访问? + +W3C 的网络无障碍访问组织发布了《网络内容无障碍访问指南(WCAG)》,为无障碍访问设定了标准。Equalify 和包括美国联邦政府在内的其它机构,都使用 WCAG 来定义网站的无障碍访问。我们扫描的的网站越多,我们就越能了解 WCAG 标准的不足和潜力。 + +### 如何使用 Equalify? + +花点时间查看一下我们的 GitHub,这样你能更多的了解这个产品。[README][3] 提供了如何开始支持和使用 Equalify 的分步教程。 + +### 我们的目标 + +我们的最终目标是让开放的互联网更易于使用。根据 [The WebAIM Million][4] 的数据,96.8% 的网站主页不满足 WCAG 标准。随着越来越多的人们开发和使用 Equalify,我们将与有障碍的页面斗争。每个人都应该有平等的机会进入开放的互联网。在我们朝着为所有人建设一个更强大、更开放的社会而努力时,Equalify 也正在朝着这个目标努力。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/6/equalify-open-internet-accessibility + +作者:[Blake Bertuccelli][a] +选题:[lkxed][b] +译者:[yjacks](https://github.com/yjacks) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/blake +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/2022-06/plumeria-frangipani-bernard-spragg.jpg +[2]: https://equalify.app/ +[3]: https://github.com/bbertucc/equalify +[4]: https://webaim.org/projects/million/ diff --git a/published/20210101 Djinn- A Code Generator and Templating Language Inspired by Jinja2.md b/published/202207/20210101 Djinn- A Code Generator and Templating Language Inspired by Jinja2.md similarity index 100% rename from published/20210101 Djinn- A Code Generator and Templating Language Inspired by Jinja2.md rename to published/202207/20210101 Djinn- A Code Generator and Templating Language Inspired by Jinja2.md diff --git a/published/20210107 A hands-on tutorial for using the GNU Project Debugger.md b/published/202207/20210107 A hands-on tutorial for using the GNU Project Debugger.md similarity index 100% rename from published/20210107 A hands-on tutorial for using the GNU Project Debugger.md rename to published/202207/20210107 A hands-on tutorial for using the GNU Project Debugger.md diff --git a/published/20210120 Highlighted Text Not Visible in gedit in Dark Mode- Here-s What You Can Do.md b/published/202207/20210120 Highlighted Text Not Visible in gedit in Dark Mode- Here-s What You Can Do.md similarity index 100% rename from published/20210120 Highlighted Text Not Visible in gedit in Dark Mode- Here-s What You Can Do.md rename to published/202207/20210120 Highlighted Text Not Visible in gedit in Dark Mode- Here-s What You Can Do.md diff --git a/published/20210511 What is fog computing.md b/published/202207/20210511 What is fog computing.md similarity index 100% rename from published/20210511 What is fog computing.md rename to published/202207/20210511 What is fog computing.md diff --git a/published/20210511 What is the OSI model.md b/published/202207/20210511 What is the OSI model.md similarity index 100% rename from published/20210511 What is the OSI model.md rename to published/202207/20210511 What is the OSI model.md diff --git a/published/20210602 Establish an SSH connection between Windows and Linux.md b/published/202207/20210602 Establish an SSH connection between Windows and Linux.md similarity index 100% rename from published/20210602 Establish an SSH connection between Windows and Linux.md rename to published/202207/20210602 Establish an SSH connection between Windows and Linux.md diff --git a/published/20210611 How to use the FreeDOS text editor.md b/published/202207/20210611 How to use the FreeDOS text editor.md similarity index 100% rename from published/20210611 How to use the FreeDOS text editor.md rename to published/202207/20210611 How to use the FreeDOS text editor.md diff --git a/published/20210627 How to Convert File Formats With Pandoc in Linux -Quick Guide.md b/published/202207/20210627 How to Convert File Formats With Pandoc in Linux -Quick Guide.md similarity index 100% rename from published/20210627 How to Convert File Formats With Pandoc in Linux -Quick Guide.md rename to published/202207/20210627 How to Convert File Formats With Pandoc in Linux -Quick Guide.md diff --git a/published/20211017 How I use open source to play RPGs.md b/published/202207/20211017 How I use open source to play RPGs.md similarity index 100% rename from published/20211017 How I use open source to play RPGs.md rename to published/202207/20211017 How I use open source to play RPGs.md diff --git a/published/20211104 Beginner-s Guide to Installing Arch Linux on VirtualBox.md b/published/202207/20211104 Beginner-s Guide to Installing Arch Linux on VirtualBox.md similarity index 100% rename from published/20211104 Beginner-s Guide to Installing Arch Linux on VirtualBox.md rename to published/202207/20211104 Beginner-s Guide to Installing Arch Linux on VirtualBox.md diff --git a/published/20211203 Should Businesses Opt for Serverless Computing-.md b/published/202207/20211203 Should Businesses Opt for Serverless Computing-.md similarity index 100% rename from published/20211203 Should Businesses Opt for Serverless Computing-.md rename to published/202207/20211203 Should Businesses Opt for Serverless Computing-.md diff --git a/published/20220106 Send desktop notifications and reminders from Linux terminal.md b/published/202207/20220106 Send desktop notifications and reminders from Linux terminal.md similarity index 100% rename from published/20220106 Send desktop notifications and reminders from Linux terminal.md rename to published/202207/20220106 Send desktop notifications and reminders from Linux terminal.md diff --git a/published/20220115 Why use a Raspberry Pi to power your business.md b/published/202207/20220115 Why use a Raspberry Pi to power your business.md similarity index 100% rename from published/20220115 Why use a Raspberry Pi to power your business.md rename to published/202207/20220115 Why use a Raspberry Pi to power your business.md diff --git a/published/20220214 A guide to Kubernetes architecture.md b/published/202207/20220214 A guide to Kubernetes architecture.md similarity index 100% rename from published/20220214 A guide to Kubernetes architecture.md rename to published/202207/20220214 A guide to Kubernetes architecture.md diff --git a/published/20220519 Top 10 Essential Ubuntu Apps For Everyone in 2022.md b/published/202207/20220519 Top 10 Essential Ubuntu Apps For Everyone in 2022.md similarity index 100% rename from published/20220519 Top 10 Essential Ubuntu Apps For Everyone in 2022.md rename to published/202207/20220519 Top 10 Essential Ubuntu Apps For Everyone in 2022.md diff --git a/published/20220527 Plotting Data in R- Graphs.md b/published/202207/20220527 Plotting Data in R- Graphs.md similarity index 100% rename from published/20220527 Plotting Data in R- Graphs.md rename to published/202207/20220527 Plotting Data in R- Graphs.md diff --git a/published/20220531 How dynamic linking for modular libraries works on Linux.md b/published/202207/20220531 How dynamic linking for modular libraries works on Linux.md similarity index 100% rename from published/20220531 How dynamic linking for modular libraries works on Linux.md rename to published/202207/20220531 How dynamic linking for modular libraries works on Linux.md diff --git a/published/20220603 How static linking works on Linux.md b/published/202207/20220603 How static linking works on Linux.md similarity index 100% rename from published/20220603 How static linking works on Linux.md rename to published/202207/20220603 How static linking works on Linux.md diff --git a/published/20220606 10 Best Ubuntu Apps for Everyone in 2022 [Part 2].md b/published/202207/20220606 10 Best Ubuntu Apps for Everyone in 2022 [Part 2].md similarity index 100% rename from published/20220606 10 Best Ubuntu Apps for Everyone in 2022 [Part 2].md rename to published/202207/20220606 10 Best Ubuntu Apps for Everyone in 2022 [Part 2].md diff --git a/published/202207/20220614 Build a Smart Parking System for a Metro Station.md b/published/202207/20220614 Build a Smart Parking System for a Metro Station.md new file mode 100644 index 0000000000..f218f0956a --- /dev/null +++ b/published/202207/20220614 Build a Smart Parking System for a Metro Station.md @@ -0,0 +1,158 @@ +[#]: subject: "Build a Smart Parking System for a Metro Station" +[#]: via: "https://www.opensourceforu.com/2022/06/build-a-smart-parking-system-for-a-metro-station/" +[#]: author: "Dr Maheswari R. https://www.opensourceforu.com/author/dr-maheswari-r/" +[#]: collector: "lkxed" +[#]: translator: "Maisie-x" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14881-1.html" + +为地铁站构建一个智能停车系统 +====== + +> 本文将帮助你设计一个基于 Web 的应用程序,使用 Node-RED 为地铁站的汽车提供一个自动智能停车系统。 + +![Smart car parking][1] + +Web 应用程序是在 Web 服务器上运行的软件。终端用户通过 Web 浏览器访问 Web 应用程序。Web 应用程序使用客户端—服务器(C/S)架构进行编程,该架构是用户(客户端)通过远程服务器(可能由第三方托管)提供服务。Web API(应用程序编程接口)在整个 Web 上是可用的,用户可以通过 HTTP 协议访问该接口,如图 1 所示。 + +![Figure 1: Web API][4] + +本文将演示如何为地铁设计一个基于 Web 的汽车自动智能停车系统。 它是使用开源的 Node-RED 设计。该系统使用模板节点创建了一个交互式的、时尚的用户登录表单,用 HTML 和 CSS 编码以获取车主的详细信息,从而实现停车系统的自动化。我们可以在图 2 和图 3 看到登录表单和提交表单的流程图。 + +使用的节点如下: + +![table function][3] + +### 地铁智能停车节点流程设计 + +Node-RED 由 `node-red` 命令激活。访问网址 `http://127.0.0.1:1880/` 可以看到 Node-RED 用户界面流程浏览器已经启用,可以认为 Node-RED 设置已完成,可以正常工作了。 + +按照下面给出的步骤创建登录表单和提交表单。 + +![Figure 2: Login form flow diagram][5] + +![Figure 3: Submission form flow diagram][6] + +### 登录表单 + +1、在节点画布中,拖放 http 输入http in 节点,这会为创建 Web 服务创建一个 HTTP 访问点。 + +2、将 http 输入http in 节点连接到 函数function 节点。函数节点有助于编写 JavaScript 函数处理节点接收到的消息。 + +![Figure 4: Login form for smart parking for cars][7] + +3、将 函数function 节点连接到 模板template 节点,模板节点基于提供的模板创建一个 Web API。 + +4、将 模板template 节点连接到 http 响应http response 节点,它将响应 http 输入http in 节点的请求。 + +![Figure 5: Submission form for smart parking for cars][8] + +### 提交表单 + +1、拖放 http 输入http in 节点并将其连接到 json 节点,json 节点将数据转换为 JSON 字符串进行通信。 + +2、将 http 输入http in 节点连接到 调试debug 节点,调试节点的调试监控器会输出结果。 + +3、将 json 节点放置并连接到 函数function 节点,将后者连接到 http 响应http response 节点。 + +创建完整流程后,单击 Node-RED 窗口右上角的 部署Deploy 按钮。访问 `http://127.0.0.1:1880/ui/` 这个链接查看用户界面。 + +输入链接然后单击 提交Submit 后,该链接会跳转到下一页,你可以在该页面阅读所有新闻。 + +### Node-RED 工作流程 + +在单个 Node-RED 流程中,你可以创建登录表单和提交表单,如图 4 和图 5 所示。 + +现在我们将配置节点属性。 + +#### 登录表单 + +编辑 http 输入http in 属性: + +- 方法method 选择 “Get” +- 网址URL 设为 `/MetroStation` +- 名称name 配置为 “智能停车系统Smart Parking”。 + +(LCTT 译注:下文 http 响应节点的名称为 Smart parking,p 字母小写,为了区分,此处中文翻译成智能停车系统。) + +![Figure 6: Http in node property configurations][9] + +> 注意:URL 可以使用任何用户定义的本地变量。 + +现在选择 函数function 节点,编辑函数节点属性:输入代码 `msg.url = project` ,并配置代码 名称name 字段为 “项目提交Project Submission”。 + +![Figure 7: Function node property configurations][10] + +在 模板template 节点的属性窗口,为登录表单配置相应的 HTML 代码,并将代码 名称name 命名为 “显示面板Display panel”。在此流程使用了 Mustache 模板格式(LCTT 译注:Mustache 是胡子的意思,因为它的嵌入标记 `{{ }}` 非常像胡子)。Mustache 是一个简单的 Web 模板系统,被描述为无逻辑的模板引擎。Mustache 没有任何显式的控制流语句,例如 `if` 和 `else` 条件和 `for` 循环。可以通过使用块标签处理列表和lambdas 来实现循环和条件评估。 + +![Figure 8: Template node property configurations][11] + +配置编辑 http 响应http response 节点的属性,名称name 设为 “智能停车Smart parking”(图 9) 。 + +![Figure 9: Http response node property configurations][12] + +#### 提交表单 + +在 http 输入http in 节点的编辑属性窗口,方法method 选择 “POST” ,网址URL 设为 `/project`。 + +![Figure 10: Http in node property configurations][13] + +在 JSON 节点的编辑窗口,操作Action设为 “JSON字符串与对象互转Convert between JSON String & Object”,参考图 11。 + +![Figure 11: JSON node property configurations][14] + +函数function 节点的配置如图 12 所示。 + +![Figure 12: Function node property configurations][15] + +在 http 响应http response 节点,编辑属性 名称name 为 “已提交项目Project Submitted”。 + +![Figure 13: Http response node property configurations][16] + +> 注意:添加带有评论的评论节点作为 “登录表单” 和 “提交表单”。 + +![Figure 14: Debug node property configurations][17] + +### 用户界面的控制面板 + +当用户单击 提交Submit,给出的数据将显示在用户界面和调试节点。如果单击 重置Reset,详细信息将被清除,允许用户输入新的详细信息(图15)。 + +![Figure 15: User login UI][18] + +地铁停车费率通过超链接提供,收费表在用户界面显示。因此,汽车智能停车系统通过适当的超链接实现自动化,展示地铁站的停车费。该自动化系统的最终输出可以在 Node-RED 控制面板的用户界面和调试监控器调取和展示。 + +![Figure 16: Metro parking tariff][19] + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/06/build-a-smart-parking-system-for-a-metro-station/ + +作者:[Dr Maheswari R.][a] +选题:[lkxed][b] +译者:[Maisie-x](https://github.com/Maisie-x) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/dr-maheswari-r/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Smart-car-parking.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/04/table-function-node-red.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/04/table-function-node-red.jpg +[4]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-1-Web-Application-Programming-Interface300.jpg +[5]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-2-Login-Form-Flow-Diagram300.jpg +[6]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-3-Submission-Form-Flow-Diagram300.jpg +[7]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-4-Login-Form-of-Metro-Smart-Car-Parking300.jpg +[8]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-5-Submission-Form-of-Metro-Smart-Car-Parking300.jpg +[9]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-6-Http-in-Node-Property-Configurations300.jpg +[10]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-7-Function-Node-Property-Configurations300.jpg +[11]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-8-Template-Node-Property-Configurations300.jpg +[12]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-9-Template-Node-Property-Configurations300.jpg +[13]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-10-Http-in-Node-Property-Configurations300.jpg +[14]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-11-Json-Node-Property-Configurations300.jpg +[15]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-12-Function-Node-Property-Configurations300.jpg +[16]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-13-Http-Response-Node-Property-Configurations300.jpg +[17]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-14-Debug-Node-Property-Configurations300.jpg +[18]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-15-User-Login-UI300.jpg +[19]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-16-Parking-Tariff-Metro300.jpg diff --git a/published/20220623 How to Boot into an Older Kernel By Default in Ubuntu and Other Linux.md b/published/202207/20220623 How to Boot into an Older Kernel By Default in Ubuntu and Other Linux.md similarity index 100% rename from published/20220623 How to Boot into an Older Kernel By Default in Ubuntu and Other Linux.md rename to published/202207/20220623 How to Boot into an Older Kernel By Default in Ubuntu and Other Linux.md diff --git a/published/20220625 Download YouTube Videos with VLC -Because, Why Not--.md b/published/202207/20220625 Download YouTube Videos with VLC -Because, Why Not--.md similarity index 100% rename from published/20220625 Download YouTube Videos with VLC -Because, Why Not--.md rename to published/202207/20220625 Download YouTube Videos with VLC -Because, Why Not--.md diff --git a/translated/tech/20220627 How to Install Docker And Docker Compose In Ubuntu 22.04 LTS.md b/published/202207/20220627 How to Install Docker And Docker Compose In Ubuntu 22.04 LTS.md similarity index 85% rename from translated/tech/20220627 How to Install Docker And Docker Compose In Ubuntu 22.04 LTS.md rename to published/202207/20220627 How to Install Docker And Docker Compose In Ubuntu 22.04 LTS.md index cd27e0a7c9..0c483c7203 100644 --- a/translated/tech/20220627 How to Install Docker And Docker Compose In Ubuntu 22.04 LTS.md +++ b/published/202207/20220627 How to Install Docker And Docker Compose In Ubuntu 22.04 LTS.md @@ -2,28 +2,29 @@ [#]: via: "https://ostechnix.com/install-docker-ubuntu/" [#]: author: "sk https://ostechnix.com/author/sk/" [#]: collector: "lkxed" -[#]: translator: "Donkey" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - +[#]: translator: "Donkey-Hao" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14871-1.html" 如何在 Ubuntu 22.04 LTS 中安装 Docker 和 Docker Compose ====== -在 Ubuntu 中使用 Docker Compose 安装 Docker 引擎详细指导 -在这篇文章中,我们将会明白 **Docker** 是什么,如何 **在 Ubuntu 中安装 Docker 引擎** 。此外,我们也将会明白如何 **安装 Docker Compose** ,它是一个定义并运行多容器的 Docker 应用。 +![](https://img.linux.net.cn/data/attachment/album/202207/28/142549iwrj25mw9turhc9o.jpg) -我们已经在 Ubuntu 22.04 LTS 中正式的测试了这份指南。然而,它也应该对旧版本如 20.04 LTS 和 18.04 LTS 有效。为了更好的安全性和稳定性,我推荐你使用最新的版本—— Ubuntu 22.04 LTS 。 +> 在 Ubuntu 中使用 Docker Compose 安装 Docker 引擎的分步指导。 +在这篇文章中,我们将会明白 Docker 是什么,如何 **在 Ubuntu 中安装 Docker 引擎** 。此外,我们也将会明白如何 **安装 Docker Compose** ,它是一个定义并运行多容器的 Docker 应用。 + +我们已经在 Ubuntu 22.04 LTS 中正式的测试了这份指南。然而,它也应该对旧版本如 20.04 LTS 和 18.04 LTS 有效。为了更好的安全性和稳定性,我推荐你使用最新的版本 —— Ubuntu 22.04 LTS 。 ### 什么是 Docker ? -**Docker** 是一个快捷,轻便的系统级虚拟化技术,开发者和系统管理员可以使用它构建具备所有必要依赖项的应用程序,并将其作为一个包发布。 +**Docker** 是一个快捷、轻便的系统级虚拟化技术,开发者和系统管理员可以使用它构建具备所有必要依赖项的应用程序,并将其作为一个包发布。 Docker 与其他如 VMWare 、Xen 、以及 VirtualBox 等工具的虚拟化方式不同,每个虚拟机不需要单独的客户操作系统。 -所有的 Docker 容器有效地共享主机系统内核。每个容器都在同一操作系统中的隔离用户空间中运行。 +所有的 Docker 容器有效地共享同一个主机系统内核。每个容器都在同一个操作系统中的隔离用户空间中运行。 Docker 容器可以在任何 Linux 版本上运行。比如说你使用 Fedora ,我用 Ubuntu 。我们能相互开发、共享并分发 Docker 镜像。 @@ -39,11 +40,10 @@ Docker 容器可以在任何 Linux 版本上运行。比如说你使用 Fedora 为了安装并配置 Docker ,你的系统必须满足下列最低要求: - 1. 64 位 Linux 或 Windows 系统 2. 如果使用 Linux ,内核版本必须不低于 3.10 3. 能够使用 `sudo` 权限的用户 -4. 在你系统 BIOS 上启用了 VT(虚拟化技术)支持 on your system BIOS. [参考: [如何查看 CPU 支持 虚拟化技术(VT)][1]] +4. 在你系统 BIOS 上启用了 VT(虚拟化技术)支持 on your system BIOS(参考: [如何查看 CPU 支持 虚拟化技术(VT)][1]) 5. 你的系统应该联网 在 Linux ,在终端上运行以下命令验证内核以及架构详细信息: @@ -52,43 +52,37 @@ Docker 容器可以在任何 Linux 版本上运行。比如说你使用 Fedora $ uname -a ``` -**输出样例:** +输出样例: ``` Linux Ubuntu22CT 5.15.35-3-pve #1 SMP PVE 5.15.35-6 (Fri, 17 Jun 2022 13:42:35 +0200) x86_64 x86_64 x86_64 GNU/Linux ``` -正如上面你看到的那样,我的 Ubuntu 系统内核版本是 **5.15.35-3-pve** 并且系统架构是 **64 位**(**x86_64 x86_64 x86_64 GNU/Linux**)。查看上方结果的黑体字。 +正如上面你看到的那样,我的 Ubuntu 系统内核版本是 **5.15.35-3-pve** 并且系统架构是 **64 位**(**x86_64 x86_64 x86_64 GNU/Linux**)。 -**注意:** 这里,我在 **[Proxmox][2]** 中使用 Ubuntu 22.04 容器。这是你看到上方内核版本中有 “pve” 字符的原因。如果你正在使用 Ubuntu 实体(或者虚拟)机,你将看到系统版本为 **5.15.35-3-generic** 。 +> **注意:** 这里,我在 [Proxmox][2] 中使用 Ubuntu 22.04 容器。这是你看到上方内核版本中有 “pve” 字符的原因。如果你正在使用 Ubuntu 实体(或者虚拟)机,你将看到系统版本为 **5.15.35-3-generic** 。 内核版本需要不低于最低要求的版本,并且是 64 位机器。这样不会有任何问题,我们能顺利安装并使用 Docker 。 请注意你使用哪一个 Ubuntu 系统不重要。并且你使用 Ubuntu 桌面或服务器版本,亦或者其他 Ubuntu 变种如 Lubuntu 、Kubuntu 、Xubuntu ,都不重要。 -Docker 会正常运行,只要你的系统内核版本不低于 3.10 ,并且是 64 位系统。 +只要你的系统内核版本不低于 3.10 ,并且是 64 位系统,Docker 都会正常运行。 ### 在 Ubuntu 22.04 LTS 中安装 Docker 首先,更新你的 Ubuntu 系统。 -#### 1. 更新 Ubuntu +#### 1、更新 Ubuntu 打开终端,依次运行下列命令: ``` $ sudo apt update -``` - -``` $ sudo apt upgrade -``` - -``` $ sudo apt full-upgrade ``` -#### 2. 添加 Docker 库 +#### 2、添加 Docker 库 首先,安装必要的证书并允许 apt 包管理器使用以下命令通过 HTTPS 使用存储库: @@ -114,9 +108,9 @@ $ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/doc $ sudo apt update ``` -#### 3. 安装 Docker +#### 3、安装 Docker -最后,运行下列命令在 Ubuntu 22.04 LTS 服务器中安装最新 Docker CE 。 +最后,运行下列命令在 Ubuntu 22.04 LTS 服务器中安装最新 Docker CE: ``` $ sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin @@ -130,7 +124,7 @@ $ sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin $ apt-cache madison docker-ce ``` -**输出样例:** +输出样例: ``` docker-ce | 5:20.10.17~3-0~ubuntu-jammy | https://download.docker.com/linux/ubuntu jammy/stable amd64 Packages @@ -199,7 +193,7 @@ $ sudo systemctl enable docker $ sudo docker version ``` -**输出样例:** +输出样例: ``` Client: Docker Engine - Community @@ -234,7 +228,7 @@ Server: Docker Engine - Community ![Check Docker Version][4] -#### 4. 测试 Docker +#### 4、测试 Docker 让我们继续,测试 Docker 是否运行正常: @@ -244,9 +238,9 @@ Server: Docker Engine - Community $ sudo docker run hello-world ``` -上述命令会下载一个 Docker 测试镜像,并在容器内执行一个 **hello_world** 样例程序。 +上述命令会下载一个 Docker 测试镜像,并在容器内执行一个 “hello_world” 样例程序。 -如果你看到类似下方的输出,那么祝贺你!Docker 正常运行在你的 Ubuntu 系统中。 +如果你看到类似下方的输出,那么祝贺你!Docker 正常运行在你的 Ubuntu 系统中了。 ``` Unable to find image 'hello-world:latest' locally @@ -281,9 +275,9 @@ For more examples and ideas, visit: 很好!可以使用 Docker 了。 -#### 5. 作为非 root 用户运行 Docker (选做) +#### 5、作为非 root 用户运行 Docker (选做) -默认情况下,Docker 守护进程(Docker daemon)绑定到 Unix 套接字而不是 TCP 端口。由于 **Unix 套接字由 root** 用户拥有,Docker 守护程序将仅以 root 用户身份运行。因此,普通用户无法执行大多数 Docker 命令。 +默认情况下,Docker 守护进程绑定到 Unix 套接字而不是 TCP 端口。由于 **Unix 套接字由 root 用户拥有**,Docker 守护程序将仅以 root 用户身份运行。因此,普通用户无法执行大多数 Docker 命令。 如果你想要在 Linux 中作为非 root 用户运行 Docker ,参考下方链接: @@ -297,7 +291,7 @@ For more examples and ideas, visit: 下列任何方式都可以安装 Docker Compose 。 -#### 方式 1 - 使用二进制文件安装 Docker Compose +#### 方式 1、使用二进制文件安装 Docker Compose 从 [这里][7] 下载最新 Docker Compose 。 @@ -317,22 +311,22 @@ $ sudo curl -L "https://github.com/docker/compose/releases/download/v2.6.1/docke $ sudo chmod +x /usr/local/bin/docker-compose ``` -运行下列命令检查安装的 Docker Composer 版本: +运行下列命令检查安装的 Docker Compose 版本: ``` $ docker-compose version Docker Compose version v2.6.1 ``` -#### 方式 2 - 使用 PiP 安装 Docker Compose +#### 方式 2、使用 Pip 安装 Docker Compose -或许,我们可以使用 **PIP** 安装 Docker Compose 。Pip 是 Python 包管理器,用来安装使用 Python 编写的应用程序。 +或许,我们可以使用 **Pip** 安装 Docker Compose 。Pip 是 Python 包管理器,用来安装使用 Python 编写的应用程序。 参考下列链接安装 Pip 。 * [如何使用 Pip 管理 Python 包][8] -安装 pip 后,运行以下命令安装 Docker Compose。下列命令对于所有 Linux 发行版都是相同的! +安装 Pip 后,运行以下命令安装 Docker Compose。下列命令对于所有 Linux 发行版都是相同的! ``` $ pip install docker-compose @@ -350,8 +344,7 @@ $ docker-compose --version docker-compose version 2.6.1, build 8a1c60f6 ``` -恭喜你!我们已经成功安装了 Docker Community 版本和 Docker Compose 。 - +恭喜你!我们已经成功安装了 Docker 社区版和 Docker Compose 。 安装了 Docker,然后呢?查看本系列的下一篇文章,了解 Docker 基础知识。 @@ -365,7 +358,7 @@ docker-compose version 2.6.1, build 8a1c60f6 在这篇教程中,我们讨论了 Docker 是什么,如何在 Ubuntu 22.04 LTS Jammy Jellyfish 中安装 Docker 。然后学习了如何通过运行 hello-world Docker 镜像测试 Docker 是否成功安装。最后,我们通过使用两种不同的方式安装 Docker Compose 作为本教程的结尾。 -**资料:** +### 资料 * [Docker 主页][11] @@ -376,7 +369,7 @@ via: https://ostechnix.com/install-docker-ubuntu/ 作者:[sk][a] 选题:[lkxed][b] 译者:[Donkey](https://github.com/Donkey-Hao) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/published/20220627 Kuro- An Unofficial Microsoft To-Do Desktop Client for Linux.md b/published/202207/20220627 Kuro- An Unofficial Microsoft To-Do Desktop Client for Linux.md similarity index 100% rename from published/20220627 Kuro- An Unofficial Microsoft To-Do Desktop Client for Linux.md rename to published/202207/20220627 Kuro- An Unofficial Microsoft To-Do Desktop Client for Linux.md diff --git a/published/20220627 Make a temporary file on Linux with Bash.md b/published/202207/20220627 Make a temporary file on Linux with Bash.md similarity index 100% rename from published/20220627 Make a temporary file on Linux with Bash.md rename to published/202207/20220627 Make a temporary file on Linux with Bash.md diff --git a/published/20220628 HandBrake- Free Tool for Converting Videos from Any Format.md b/published/202207/20220628 HandBrake- Free Tool for Converting Videos from Any Format.md similarity index 100% rename from published/20220628 HandBrake- Free Tool for Converting Videos from Any Format.md rename to published/202207/20220628 HandBrake- Free Tool for Converting Videos from Any Format.md diff --git a/published/20220629 Finding Your Router-s IP Address -Default Gateway- in Ubuntu and Other Linux.md b/published/202207/20220629 Finding Your Router-s IP Address -Default Gateway- in Ubuntu and Other Linux.md similarity index 100% rename from published/20220629 Finding Your Router-s IP Address -Default Gateway- in Ubuntu and Other Linux.md rename to published/202207/20220629 Finding Your Router-s IP Address -Default Gateway- in Ubuntu and Other Linux.md diff --git a/published/20220630 6 New Changes Coming to Nautilus File Manager in GNOME 43.md b/published/202207/20220630 6 New Changes Coming to Nautilus File Manager in GNOME 43.md similarity index 100% rename from published/20220630 6 New Changes Coming to Nautilus File Manager in GNOME 43.md rename to published/202207/20220630 6 New Changes Coming to Nautilus File Manager in GNOME 43.md diff --git a/published/20220630 Hide Files and Folders in Linux Without Renaming Them.md b/published/202207/20220630 Hide Files and Folders in Linux Without Renaming Them.md similarity index 100% rename from published/20220630 Hide Files and Folders in Linux Without Renaming Them.md rename to published/202207/20220630 Hide Files and Folders in Linux Without Renaming Them.md diff --git a/published/20220630 The Top Trends Changing The Data Center Industry.md b/published/202207/20220630 The Top Trends Changing The Data Center Industry.md similarity index 100% rename from published/20220630 The Top Trends Changing The Data Center Industry.md rename to published/202207/20220630 The Top Trends Changing The Data Center Industry.md diff --git a/published/20220630 With Extensions, GNOME Web is Slowly Becoming an Attractive Option on Desktop Linux.md b/published/202207/20220630 With Extensions, GNOME Web is Slowly Becoming an Attractive Option on Desktop Linux.md similarity index 100% rename from published/20220630 With Extensions, GNOME Web is Slowly Becoming an Attractive Option on Desktop Linux.md rename to published/202207/20220630 With Extensions, GNOME Web is Slowly Becoming an Attractive Option on Desktop Linux.md diff --git a/published/20220703 10 Necessary Ubuntu Apps For Everyone [Part 3].md b/published/202207/20220703 10 Necessary Ubuntu Apps For Everyone [Part 3].md similarity index 100% rename from published/20220703 10 Necessary Ubuntu Apps For Everyone [Part 3].md rename to published/202207/20220703 10 Necessary Ubuntu Apps For Everyone [Part 3].md diff --git a/published/20220704 Darktable 4.0.0 is Here with a Revamped UI and Improved Color Saturation.md b/published/202207/20220704 Darktable 4.0.0 is Here with a Revamped UI and Improved Color Saturation.md similarity index 100% rename from published/20220704 Darktable 4.0.0 is Here with a Revamped UI and Improved Color Saturation.md rename to published/202207/20220704 Darktable 4.0.0 is Here with a Revamped UI and Improved Color Saturation.md diff --git a/published/20220704 Docker Commands Tutorial - Getting Started With Docker In Linux.md b/published/202207/20220704 Docker Commands Tutorial - Getting Started With Docker In Linux.md similarity index 100% rename from published/20220704 Docker Commands Tutorial - Getting Started With Docker In Linux.md rename to published/202207/20220704 Docker Commands Tutorial - Getting Started With Docker In Linux.md diff --git a/published/20220704 Fixing -cannot find signatures with metadata for snap- Error in Ubuntu and other Linux.md b/published/202207/20220704 Fixing -cannot find signatures with metadata for snap- Error in Ubuntu and other Linux.md similarity index 100% rename from published/20220704 Fixing -cannot find signatures with metadata for snap- Error in Ubuntu and other Linux.md rename to published/202207/20220704 Fixing -cannot find signatures with metadata for snap- Error in Ubuntu and other Linux.md diff --git a/published/20220704 Manage your files in your Linux terminal with ranger.md b/published/202207/20220704 Manage your files in your Linux terminal with ranger.md similarity index 100% rename from published/20220704 Manage your files in your Linux terminal with ranger.md rename to published/202207/20220704 Manage your files in your Linux terminal with ranger.md diff --git a/published/20220704 massCode- A Free and Open-Source Code Snippet Manager.md b/published/202207/20220704 massCode- A Free and Open-Source Code Snippet Manager.md similarity index 100% rename from published/20220704 massCode- A Free and Open-Source Code Snippet Manager.md rename to published/202207/20220704 massCode- A Free and Open-Source Code Snippet Manager.md diff --git a/published/20220705 StarFighter- A Linux Laptop with a 4K 10-bit IPS Display is Coming Soon.md b/published/202207/20220705 StarFighter- A Linux Laptop with a 4K 10-bit IPS Display is Coming Soon.md similarity index 100% rename from published/20220705 StarFighter- A Linux Laptop with a 4K 10-bit IPS Display is Coming Soon.md rename to published/202207/20220705 StarFighter- A Linux Laptop with a 4K 10-bit IPS Display is Coming Soon.md diff --git a/published/20220705 Why I love Tig for visualizing my Git workflows.md b/published/202207/20220705 Why I love Tig for visualizing my Git workflows.md similarity index 100% rename from published/20220705 Why I love Tig for visualizing my Git workflows.md rename to published/202207/20220705 Why I love Tig for visualizing my Git workflows.md diff --git a/published/20220707 Check disk usage in Linux.md b/published/202207/20220707 Check disk usage in Linux.md similarity index 100% rename from published/20220707 Check disk usage in Linux.md rename to published/202207/20220707 Check disk usage in Linux.md diff --git a/published/20220707 Google Summer of Code + Zephyr RTOS.md b/published/202207/20220707 Google Summer of Code + Zephyr RTOS.md similarity index 100% rename from published/20220707 Google Summer of Code + Zephyr RTOS.md rename to published/202207/20220707 Google Summer of Code + Zephyr RTOS.md diff --git a/published/20220707 More Linux Developers Joining Microsoft, Systemd Creator Adds to the List.md b/published/202207/20220707 More Linux Developers Joining Microsoft, Systemd Creator Adds to the List.md similarity index 100% rename from published/20220707 More Linux Developers Joining Microsoft, Systemd Creator Adds to the List.md rename to published/202207/20220707 More Linux Developers Joining Microsoft, Systemd Creator Adds to the List.md diff --git a/published/20220707 Raspberry Pi 4 Support is Coming to Fedora Linux.md b/published/202207/20220707 Raspberry Pi 4 Support is Coming to Fedora Linux.md similarity index 100% rename from published/20220707 Raspberry Pi 4 Support is Coming to Fedora Linux.md rename to published/202207/20220707 Raspberry Pi 4 Support is Coming to Fedora Linux.md diff --git a/published/202207/20220707 Use secret keyboard keys on Linux.md b/published/202207/20220707 Use secret keyboard keys on Linux.md new file mode 100644 index 0000000000..93cb065735 --- /dev/null +++ b/published/202207/20220707 Use secret keyboard keys on Linux.md @@ -0,0 +1,146 @@ +[#]: subject: "Use secret keyboard keys on Linux" +[#]: via: "https://opensource.com/article/22/7/linux-compose-key-cheat-sheet" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "Donkey-Hao" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14882-1.html" + +在 Linux 中使用组合键输入隐藏的字形 +====== + +> 使用组合键,你不会被键盘所限制住。 + +![](https://img.linux.net.cn/data/attachment/album/202207/31/095532p72762ekberw7eb6.jpg) + +典型的键盘只有约 100 个键位。 + +由于 `Shift` 键,许多键得以有两个字符(也称之为 字形glyph)。字形常用于键入带有重音和变音符号的字母,生成数学公式或者货币中的符号,或者添加有趣的表情符号。在一些地区,有些键甚至有三个字形。 + +然而,不论你身处何处,有一些字形不会出现在你的键盘上。幸运的是,Linux 提供了使用 组合键Compose Key 来获取这些字形。 + +在你的键盘上没有组合键这个键,至少默认情况下没有,但是你可以设定一个你不用的键作为组合键。我在电脑上使用空格键旁边的 `Alt` 键,而在平板上使用菜单键,来作为组合键。 + +> **[下载 Linux 组合键速查表][2]** + +### 在 GNOME 中设置组合键 + +![A screenshot shows the keyboard and mouse options visible. The "Compose Key" option is set to Right Alt.][3] + +在 GNOME 桌面,从软件库中安装 优化Tweaks 应用。你也可以从终端安装(基于 Debian 发行版用 `apt` 命令,Fedora 用 `dnf`): + +``` +$ sudo dnf install gnome-tweaks +``` + +启动优化应用后: + +1. 单击左侧栏中的 键盘和鼠标Keyboard & Mouse类别 +2. 找到 组合键Compose key 设置并指定一个键 +3. 关闭优化应用 + +### 在 KDE Plasma 桌面设置组合键 + +![A screenshot shows the advanced options threaded under Keyboard settings. "Configure keyboard options" is checked, "Position of Compose Key" is checked within that menu, and "Right Alt" is checked within that menu.][4] + +在 KDE Plasma 桌面上,打开 系统设置System Settings,找到 输入设备Input Devices 控制界面。然后: + +1. 在 输入设备Input Devices 界面,点击 “高级Advanced” 标签 +2. 找到 组合键Compose key 列表项并指定一个键 +3. 点击右下角 “应用Apply” 按钮,然后关闭 系统设置System Settings + +### 使用组合序列 + +为了输入隐藏字符,需要按下组合键后松开。这样就可以进入组合模式。处于组合模式,你按下然后松开键,然后再按下一个键来组合字符。 + +例如: + +1. 按下组合键并释放,你会进入组合模式 +2. 按下单引号(`'`)并松开 +3. 按下 `E` 并松开,这是一个有效的组合,所以现在退出了组合模式 + +你输入了一个字符:`É`! + +一些组合序列只需要两个键的组合,然而还有一些需要三个键,并且至少有一个特殊字符要按四次键。 + +### 变音字符 + +这是一个很小众的世界,所以你的朋友的名字很有可能使用的字形不是你的键盘原生的字形。你现在可以跳过变音符号并使用适当的修饰符输入名字。 + +以下是常见变音符号的组合序列示例: + +* `' + <字母>` = `á é í ó ú ć ń ý j́́ ẃ ź` +* "\` + <字母>" = `à è ì ò ù ǹ ỳ ẁ` +* `~ + <字母>` = `ã ẽ ĩ õ ũ ñ ỹ` +* `^ + <字母>` = `â ê î ô û ĉ ŷ ĵ ŵ ẑ` +* `u + <字母>` = `ă ĕ ĭ ŏ ŭ` +* `c + c` = `č` +* `- + <字母>` = `ā ē ī ō ū đ` +* `, + <字母>` = `ą ę į ǫ ų ç ḑ ţ` + +这里仅仅罗列了常见的几个,并不是所有的组合。 + +#### 货币符号 + +得益于组合键,国际银行业务也变得容易: + +* `- + Y` = `¥` +* `- + L` = `£` +* `= + E` = `€` +* `= + L` = `₤` +* `= + N` = `₦` +* `= + R` = `₹` +* `= + W` = `₩` +* `/ + m` = `₥` +* `R + s` = `₨` +* `C + r` = `₢` +* `F + r` = `₣` + +重申,这不是完整的列表,但是一个好的开始。 + +#### 有趣的字形 + +变音符号和货币符号具有实用性,但是组合键也可以用来娱乐: + +* `< + 3` = `♥` +* `< + >` = `⋄` +* `# + q` = `♩` +* `: + )` = `☺` +* `: + (` = `☹` +* `p + o + o` = `💩` + +#### 长寿和繁荣 + +在 Linux 中我最喜欢的“秘密”字形是传统的 Vulcan 称呼,“长寿和繁荣”。 + +* `L + L + A + P` = `🖖` + +### 找到所有的字形 + +通过组合键可以使用更多字形,你可以通过按随机组合序列来发现新的字形。查找字形的一种更有条理的方法是参考位于 `/usr/share/X11/locale/en_US.UTF-8` 中的 `Compose` 文件(需要根据你键盘使用的语言环境调整绝对路径)。 + +这个文件令人崩溃,因为它包含超过 6000 行的组合序列,其中许多是 ASCII 和 Unicode 的复杂组合。要快速轻松地参考常见和基础序列,你可以 [下载我们的组合键速查表][5]。它提供涵盖数学、排版、音乐、箭头、变音符号、货币等的序列。 + +现在你知道了这个秘密,你可以表达更多内容了。 + +*(图片源自:Seth Kenlon, CC BY-SA 4.0)* + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/linux-compose-key-cheat-sheet + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[Donkey](https://github.com/Donkey-Hao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/linux_keyboard_desktop.png +[2]: https://opensource.com/downloads/linux-compose-key-cheat-sheet +[3]: https://opensource.com/sites/default/files/2022-04/gnome-tweaks-compose.jpeg +[4]: https://opensource.com/sites/default/files/2022-04/kde-settings-input-advanced-compose.jpeg +[5]: https://opensource.com/downloads/linux-compose-key-cheat-sheet diff --git a/published/20220708 Do You Miss Firefox Send- Internxt Send is Ready as a Replacement.md b/published/202207/20220708 Do You Miss Firefox Send- Internxt Send is Ready as a Replacement.md similarity index 100% rename from published/20220708 Do You Miss Firefox Send- Internxt Send is Ready as a Replacement.md rename to published/202207/20220708 Do You Miss Firefox Send- Internxt Send is Ready as a Replacement.md diff --git a/published/20220708 Meet Free Software Foundation Executive Director Zoë Kooyman.md b/published/202207/20220708 Meet Free Software Foundation Executive Director Zoë Kooyman.md similarity index 100% rename from published/20220708 Meet Free Software Foundation Executive Director Zoë Kooyman.md rename to published/202207/20220708 Meet Free Software Foundation Executive Director Zoë Kooyman.md diff --git a/published/20220708 Meta-s AI Model That Helps Overcome Language Barrier Is Now Open-Source.md b/published/202207/20220708 Meta-s AI Model That Helps Overcome Language Barrier Is Now Open-Source.md similarity index 100% rename from published/20220708 Meta-s AI Model That Helps Overcome Language Barrier Is Now Open-Source.md rename to published/202207/20220708 Meta-s AI Model That Helps Overcome Language Barrier Is Now Open-Source.md diff --git a/published/20220709 Monitoring tiny web services.md b/published/202207/20220709 Monitoring tiny web services.md similarity index 100% rename from published/20220709 Monitoring tiny web services.md rename to published/202207/20220709 Monitoring tiny web services.md diff --git a/published/20220710 How to Install yay AUR Helper in Arch Linux [Beginner-s Guide].md b/published/202207/20220710 How to Install yay AUR Helper in Arch Linux [Beginner-s Guide].md similarity index 100% rename from published/20220710 How to Install yay AUR Helper in Arch Linux [Beginner-s Guide].md rename to published/202207/20220710 How to Install yay AUR Helper in Arch Linux [Beginner-s Guide].md diff --git a/published/20220711 7 Reasons Why Ubuntu 22.04 LTS is the Most Secure Release Yet.md b/published/202207/20220711 7 Reasons Why Ubuntu 22.04 LTS is the Most Secure Release Yet.md similarity index 100% rename from published/20220711 7 Reasons Why Ubuntu 22.04 LTS is the Most Secure Release Yet.md rename to published/202207/20220711 7 Reasons Why Ubuntu 22.04 LTS is the Most Secure Release Yet.md diff --git a/published/20220711 Manual Renewal of SSL Certificates- A Simple Guide.md b/published/202207/20220711 Manual Renewal of SSL Certificates- A Simple Guide.md similarity index 100% rename from published/20220711 Manual Renewal of SSL Certificates- A Simple Guide.md rename to published/202207/20220711 Manual Renewal of SSL Certificates- A Simple Guide.md diff --git a/published/20220711 Nokia Targets An Amateur Linux Phone Project -NOTKIA- for a Name Change.md b/published/202207/20220711 Nokia Targets An Amateur Linux Phone Project -NOTKIA- for a Name Change.md similarity index 100% rename from published/20220711 Nokia Targets An Amateur Linux Phone Project -NOTKIA- for a Name Change.md rename to published/202207/20220711 Nokia Targets An Amateur Linux Phone Project -NOTKIA- for a Name Change.md diff --git a/published/202207/20220712 7 kinds of garbage collection for Java.md b/published/202207/20220712 7 kinds of garbage collection for Java.md new file mode 100644 index 0000000000..e353e8dba1 --- /dev/null +++ b/published/202207/20220712 7 kinds of garbage collection for Java.md @@ -0,0 +1,121 @@ +[#]: subject: "7 kinds of garbage collection for Java" +[#]: via: "https://opensource.com/article/22/7/garbage-collection-java" +[#]: author: "Jayashree Huttanagoudar https://opensource.com/users/jayashree-huttanagoudar" +[#]: collector: "lkxed" +[#]: translator: "Veryzzj" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14862-1.html" + +Java 的七种垃圾收集器 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/25/075744nw0c9c4vtvkgiuct.jpg) + +> 了解 Java 中的内存管理。 + +用 C 或 C++ 这样的编程语言写一个应用时,需要编写代码来销毁内存中不再需要的对象。当应用程序扩展得越来越复杂时,未使用对象被忽略释放的可能性就越大。这会导致内存泄露,最终内存耗尽,在某个时刻将没有更多的内存可以分配。结果就是应用程序运行失败并出现 OutOfMemoryError 错误。但在 Java 中,垃圾收集器Garbage Collection(GC)会在程序执行过程中自动运行,减轻了手动分配内存和可能的内存泄漏的任务。 + +垃圾收集器并不只有一种,Java 虚拟机(JVM)有七种不同的垃圾收集器,了解每种垃圾收集器的目的和优点是很有用的。 + +### 1、Serial 收集器 + +![Serial threaded garbage collection][1] + +垃圾收集器的原始实现,使用单线程。当垃圾收集器运行时,会停止应用程序(通常称为“stop the world”事件)。适用于能够承受短暂停顿的应用程序。该垃圾收集器占用内存空间比较小,因此这是嵌入式应用程序的首选垃圾收集器类型。在运行时使用以下命令启用该垃圾收集器: + +``` +$ java -XX:+UseSerialGC +``` + +### 2、Parallel 收集器 + +![Parallel garbage collection][2] + +像 Serial 收集器一样,Parallel 收集器也使用“stop the world”方法。这意味着,当垃圾收集器运行时,应用程序线程会停止。但是不同的是,Parallel 收集器运行时有多个线程执行垃圾收集操作。这种类型的垃圾收集器适用于在多线程和多处理器环境中运行中到大型数据集的应用程序。 + +这是 JVM 中的默认垃圾收集器,也被称为*吞吐量收集器*。使用该垃圾收集器时可以通过使用各种合适的 JVM 参数进行调优,例如吞吐量、暂停时间、线程数和内存占用。如下: + +* 线程数:`-XX:ParallelGCThreads=` +* 暂停时间:`-XX:MaxGCPauseMillis=` +* 吞吐量(垃圾收集花费的时间与实际应用程序执行的时间相比):`-XX:GCTimeRatio=` +* 最大堆内存:`-Xmx` + +Parallel 收集器可以使用该命令显式启用:`java -XX:+UseParallelGC` 。使用这个命令,指定在新生代中通过多个线程进行垃圾回收,而老年代中的垃圾收集和内存压缩仍使用单个线程完成的。 + +还有一个版本的的 Parallel 收集器叫做 “Parallel Old GC”,它对新生代和老年代都使用多线程,启用命令如下: + +``` +$ java -XX:+UseParallelOldGC +``` + +### 3、Concurrent Mark Sweep(CMS)收集器 + +![Concurrent garbage collection][3] + +Concurrent Mark Sweep(CMS)垃圾收集器与应用程序并行运行。对于新生代和老年代都使用了多线程。在 CMS 垃圾收集器删除无用对象后,不会对存活对象进行内存压缩。该垃圾收集器和应用程序并行运行,会降低应用程序的响应时间,适用于停顿时间较短的应用程序。这个收集器在 Java8 已过时,并在 Java14 中被移除。如果你仍在使用有这个垃圾收集器的 Java 版本,可以使用如下命令启用: + +``` +$ java -XX:+UseConcMarkSweepGC +``` + +在 CMS 垃圾收集器使用过程中,应用程序将暂停两次。首次暂停发生在标记可直接访问的存活对象时,这个暂停被称为*初始标记*。第二次暂停发生在 CMS 收集器结束时期,来修正在并发标记过程中,应用程序线程在 CMS 垃圾回收完成后更新对象时被遗漏的对象。这就是所谓的*重新标记*。 + +### 4、G1 收集器 + +![Garbage first][4] + +G1 垃圾收集器旨在替代 GMS。G1 垃圾收集器具备并行、并发以及增量压缩,且暂停时间较短。与 CMS 收集器使用的内存布局不同,G1 收集器将堆内存划分为大小相同的区域,通过多个线程触发全局标记阶段。标记阶段完成后,G1 知道哪个区域可能大部分是空的,并首选该区域作为清除/删除阶段。 + +在 G1 收集器中,一个对象如果大小超过半个区域容量会被认为是一个“大对象” 。这些对象被放置在老年代中,在一个被称为“humongous region”的区域中。 启用 G1 收集器的命令如下: + +``` +$ java -XX:+UseG1GC +``` + +### 5、Epsilon 收集器 + +该垃圾收集器是在 Java11 中引入的,是一个 *no-op*(无操作)收集器。它不做任何实际的内存回收,只负责管理内存分配。Epsilon 只在当你知道应用程序的确切内存占用情况并且不需要垃圾回收时使用。启用命令如下: + +``` +$ java -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC +``` + +### 6、Shenandoah 收集器 + +Shenandoah 是在 JDK12 中引入的,是一种 CPU 密集型垃圾收集器。它会进行内存压缩,立即删除无用对象并释放操作系统的空间。所有的这一切与应用程序线程并行发生。启用命令如下: + +``` +$ java -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC +``` + +### 7、ZGC 收集器 + +ZGC 为低延迟需要和大量堆空间使用而设计,允许当垃圾回收器运行时 Java 应用程序继续运行。ZGC 收集器在 JDK11 引入,在 JDK12 改进。在 JDK15,ZGC 和 Shenandoah 都被移出了实验阶段。启用 ZGC 收集器使用如下命令: + +``` +$ java -XX:+UnlockExperimentalVMOptions -XX:+UseZGC +``` + +### 灵活的垃圾收集器 + +Java 为我们提供了灵活的内存管理方式,熟悉不同的可用方法有助于为正在开发或运行的应用程序选择最合适的内存管理方式。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/garbage-collection-java + +作者:[Jayashree Huttanagoudar][a] +选题:[lkxed][b] +译者:[Veryzzj](https://github.com/Veryzzj) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jayashree-huttanagoudar +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/2022-07/jaya-java-gc-serial.webp +[2]: https://opensource.com/sites/default/files/2022-07/jaya-java-gc-parallel.webp +[3]: https://opensource.com/sites/default/files/2022-07/jaya-java-gc-concurrent.webp +[4]: https://opensource.com/sites/default/files/2022-07/g1.png +[5]: https://opensource.com/home-page-new diff --git a/translated/tech/20220712 List Upgradable Packages With apt Command in Ubuntu.md b/published/202207/20220712 List Upgradable Packages With apt Command in Ubuntu.md similarity index 63% rename from translated/tech/20220712 List Upgradable Packages With apt Command in Ubuntu.md rename to published/202207/20220712 List Upgradable Packages With apt Command in Ubuntu.md index b5a866848a..2e4c7f3ed0 100644 --- a/translated/tech/20220712 List Upgradable Packages With apt Command in Ubuntu.md +++ b/published/202207/20220712 List Upgradable Packages With apt Command in Ubuntu.md @@ -3,14 +3,16 @@ [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lkxed" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14861-1.html" 在 Ubuntu 中使用 apt 命令列出可升级的软件包 ====== -[apt 命令][1] 用于 Debian 和 Ubuntu 中的包管理。虽然你可能已经熟悉安装和删除选项,但 apt 还提供了一些额外的功能。 +![](https://img.linux.net.cn/data/attachment/album/202207/24/230954qjko0c0sn55ohjf0.jpg) + +[apt 命令][1] 用于 Debian 和 Ubuntu 中的包管理。虽然你可能已经熟悉安装和删除选项,但 `apt` 还提供了一些额外的功能。 其中之一是能够查看系统上所有可升级的软件包。要显示它们,你所要做的就是在终端中使用以下命令: @@ -18,9 +20,9 @@ apt list --upgradable ``` -如你所见,你甚至不需要 sudo 来列出可更新的包。它只是列出了可以更新的包。它不会更新它们。 +如你所见,你甚至不需要使用 `sudo` 来列出可更新的包。它只是列出了可以更新的包,而不会更新它们。 -实际上,当你运行 `sudo apt update` 命令更新本地包仓库缓存时,apt 命令会添加此提示。 +实际上,当你运行 `sudo apt update` 命令更新本地包仓库缓存时,`apt` 命令会添加此提示。 ``` Fetched 1,243 kB in 17s (71.4 kB/s) @@ -30,17 +32,17 @@ Reading state information... Done 30 packages can be upgraded. Run 'apt list --upgradable' to see them. ``` -我不记得在旧的 apt-get 命令中有任何类似的直接选项来列出所有可升级的包。这是 apt 在旧的 apt-get 命令之上添加的几个新功能之一。 +我不记得在旧的 `apt-get` 命令中有任何类似的直接选项来列出所有可升级的包。这是 `apt` 在旧的 `apt-get` 命令之上添加的几个新功能之一。 让我们更详细地讨论一下。 ### 列出所有可升级的包 -你在这里应该知道的是**你只能通过 APT 包管理器列出可用的更新**。 因此,如果你已将 PPA 或[外部仓库][2]添加到系统的 sources.list,你将查看它们的更新。 +你在这里应该知道的是**你只能列出通过 APT 包管理器可用的更新**。因此,如果你已将 PPA 或 [外部仓库][2] 添加到系统的 `sources.list`,你也将看到来自它们的更新。 -但是你不会在这里获得 AppImage、Flatpak、Snap 或其他一些打包格式的更新。 +但是你不会在这里获得 AppImage、Flatpak、Snap 或一些其他打包格式的更新。 -换句话说,它只适用于 apt 包。 +换句话说,它只适用于 APT 包。 因此,要列出 Ubuntu 或 Debian 系统上的所有可升级包,你应该首先更新本地包缓存: @@ -48,10 +50,10 @@ Reading state information... Done sudo apt update ``` -然后你的系统将知道可用的软件包更新。 apt 命令告诉你在 update 命令结束时可以升级多少个软件包: +然后你的系统将知道可用的软件包更新。`apt` 命令告诉你在 update 命令结束时可以升级多少个软件包: ![The apt command shows the number of upgradable packages at the bottom of the apt update command output][3] -To see what package can be upgraded, run the command: + 要查看可以升级的软件包,请运行以下命令: ``` @@ -61,7 +63,7 @@ apt list --upgradable 你应该看到这样的输出: ``` -[email protected]:~$ apt list --upgradable +~$ apt list --upgradable Listing... Done apparmor/jammy-updates 3.0.4-2ubuntu2.1 amd64 [upgradable from: 3.0.4-2ubuntu2] brave-browser/stable 1.40.113 amd64 [upgradable from: 1.40.107] @@ -89,11 +91,11 @@ brave-browser/stable 1.40.113 amd64 [upgradable from: 1.40.107] sudo apt upgrade ``` -它列出了将要升级的软件包,然后要求按回车或 Y 确认升级。 +它列出了将要升级的软件包,然后要求按回车或 `Y` 确认升级。 ![Upgrade all packages][5] -如果你确定要升级所有软件包,则可以通过在命令中添加 -y 来跳过 “Do you want to continue” 部分。 +如果你确定要升级所有软件包,则可以通过在命令中添加 `-y` 来跳过 “Do you want to continue” 部分。 ``` sudo apt upgrade -y @@ -101,27 +103,27 @@ sudo apt upgrade -y ### 模拟升级(但不升级任何包) -这是人们在 apt list 命令之前所做的。使用模拟选项,你实际上不会进行任何更改。它仅显示运行升级时将安装或升级的软件包。 +这是人们在 `apt list` 命令之前所做的。使用模拟选项,你实际上不会进行任何更改。它仅显示运行升级时将安装或升级的软件包。 ``` apt -s upgrade ``` -你不需要使用 sudo(即使我在下面的截图中使用了它)。 +你不需要使用 `sudo`(即使我在下面的截图中使用了它)。 ![Running an upgrade simulation with apt command][6] ### 仅升级选定的包 -如果你正在管理一个 Ubuntu 服务器,并且你不想升级所有软件包,而只想升级少数选定的软件包中的一个(如 MySQL/Ngnix),你可以使用 apt 命令轻松完成。 +如果你正在管理一个 Ubuntu 服务器,并且你不想升级所有软件包,而只想升级少数选定的软件包中的一个(如 MySQL/Ngnix),你可以使用 `apt` 命令轻松完成。 ``` sudo apt --only-upgrade install package_name ``` -实际上,如果你在已安装且有可用更新的软件包上运行 apt install 命令,它将升级该软件包。 +实际上,如果你在已安装且有可用更新的软件包上运行 `apt install` 命令,它将升级该软件包。 -使用 `--only-upgrade` 标志,你可以确保仅升级软件包(如果已安装)。如果尚未安装,它将不会安装给定的包。 +使用 `--only-upgrade` 标志,你可以确保**仅升级**软件包(如果已安装)。如果尚未安装,它将不会安装给定的包。 你还可以通过提供名称来升级选定的几个包: @@ -129,7 +131,7 @@ sudo apt --only-upgrade install package_name sudo apt --only-upgrade install package1 package2 ``` -你也可以做相反的事情并[保留升级中的选定软件包][7]。 +你也可以做相反的事情,[升级时保留选定的软件包][7]。 ``` sudo apt-mark hold package_name @@ -137,7 +139,7 @@ sudo apt-mark hold package_name 这样,当你升级所有系统包时,将不会升级给定的包。 -你可以使用以下命令删除保留: +你可以使用以下命令删除保留设置: ``` sudo apt-mark unhold package_name @@ -147,15 +149,15 @@ sudo apt-mark unhold package_name 这有点棘手。 -当你运行“apt list –upgradable”命令时,它会显示所有可以升级的包。 +当你运行 `apt list –upgradable` 命令时,它会显示所有可以升级的包。 -但是如果有新的内核版本可用,它们可能不会显示,因为内核包名称以 linux-headers-x-y 开头。这是因为系统将它们视为新包,而不是对已安装的包 linux-headers-a-b 的升级。 +但是如果有新的内核版本可用,它们可能不会显示,因为内核包名称以 `linux-headers-x-y` 开头。这是因为系统将它们视为新包,而不是对已安装的包 `linux-headers-a-b` 的升级。 -但是,你仍然会在可升级包列表中看到 “linux-generic-hwe” 类型的包。因为该软件包将被升级(使用较新的内核)。 +但是,你仍然会在可升级包列表中看到 `linux-generic-hwe` 类型的包,因为该软件包将被升级(使用较新的内核)。 ### 总结 -列出可升级包的能力是 apt 命令为旧的 apt-get 命令带来的几个新功能之一。有关此主题的更多信息,你可以阅读我的文章[解释 apt 和 apt-get 命令之间的区别][8]。 +列出可升级包的能力是 `apt` 命令为旧的 `apt-get` 命令带来的几个新功能之一。有关此主题的更多信息,你可以阅读我 [解释 apt 和 apt-get 命令之间的区别][8] 的文章。 作为桌面用户,我并不总是检查可以升级的软件包。我直接去升级。但是,当我管理服务器时,我更喜欢查看可用的更新,然后决定是否进行升级。 @@ -168,7 +170,7 @@ via: https://itsfoss.com/apt-list-upgradable/ 作者:[Abhishek Prakash][a] 选题:[lkxed][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/tech/20220713 How I create music playlists on Linux.md b/published/202207/20220713 How I create music playlists on Linux.md similarity index 75% rename from translated/tech/20220713 How I create music playlists on Linux.md rename to published/202207/20220713 How I create music playlists on Linux.md index 4b43793dea..708acec8c8 100644 --- a/translated/tech/20220713 How I create music playlists on Linux.md +++ b/published/202207/20220713 How I create music playlists on Linux.md @@ -3,32 +3,31 @@ [#]: author: "Rikard Grossman-Nielsen https://opensource.com/users/rikardgn" [#]: collector: "lkxed" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14868-1.html" -如何在 Linux 上创建音乐播放列表 +如何编写 C 程序在 Linux 上创建音乐播放列表 ====== -使用我在 Linux 上制作的这个 C 程序在旅途中聆听你喜爱的歌曲。 -![Open source software helps artists create music][1] +![](https://img.linux.net.cn/data/attachment/album/202207/26/223349t4yiqd1yikb9k117.jpg) -图片来源:Opensource.com +> 使用我在 Linux 上制作的这个 C 程序在旅途中聆听你喜爱的歌曲。 -我最近在 Linux 中编写了一个 C 程序,从我广泛的 MP3 库中创建一个较小的随机 MP3 文件选择。该程序会遍历一个包含我的 MP3 库的目录,然后创建一个包含随机的、较小的歌曲选择的目录。然后我将 MP3 文件复制到我的智能手机上,以便随时随地收听。 +我最近在 Linux 中编写了一个 C 程序,从我广泛的 MP3 库中创建一个较小的随机 MP3 文件选集。该程序会遍历一个包含我的 MP3 库的目录,然后创建一个包含随机的、较小的歌曲选集的目录。然后我将这些 MP3 文件复制到我的智能手机上,以便随时随地收听。 瑞典是一个人口稀少的国家,有许多农村地区没有完整的手机覆盖。这就是在智能手机上拥有 MP3 文件的原因之一。另一个原因是我并不总是有钱购买流媒体服务,所以我喜欢拥有自己喜欢的歌曲的副本。 -你可以从它的 [Git 仓库][2]下载我的应用。我专门为 Linux 编写了它,部分原因是在 Linux 上很容易找到经过良好测试的文件 I/O 例程。多年前,我尝试使用专有的 C 库在 Windows 上编写相同的程序,但在尝试文件复制时遇到了困难。 Linux 使用户可以轻松直接地访问文件系统。 +你可以从它的 [Git 仓库][2] 下载我的应用。我专门为 Linux 编写了它,部分原因是在 Linux 上很容易找到经过良好测试的文件 I/O 例程。多年前,我尝试使用专有的 C 库在 Windows 上编写相同的程序,但在尝试文件复制时遇到了困难。Linux 使用户可以轻松直接地访问文件系统。 本着开源的精神,我没费多少力气就找到了 Linux 的文件 I/O 代码来激发我的灵感。我还发现了一些启发了我的分配内存的代码。我编写了随机数生成的代码。 该程序的工作方式如下所述: -1. 请求源目录和目标目录。 -2. 请求 MP3 文件目录下的文件个数。 -3. 搜索你希望复制的收藏的百分比(从 1.0% 到 88.0%)。如果你有 1000 个文件的集合并希望从你的集合中复制 125 个文件而不是 120 个文件,你也可以输入 12.5% 之类的数字。我将上限设置为 88%,因为复制超过 88% 的库将基本生成与你的基础库相似的库。当然,代码是开源的,因此你可以根据自己的喜好自由修改。 -4. 使用指针和 malloc 分配内存。一些操作需要内存,包括代表音乐收藏中文件的字符串列表。还有一个列表来保存随机生成的数字。 +1. 询问源目录和目标目录。 +2. 询问存放 MP3 文件的目录下的文件个数。 +3. 搜索你希望复制的收藏的百分比(从 1.0% 到 88.0%)。如果你有 1000 个文件的集合,并希望从你的集合中复制 125 个文件而不是 120 个文件,你也可以输入 12.5% 之类的数字。我将上限设置为 88%,因为复制超过 88% 的库将基本生成与你的基础库相似的库。当然,代码是开源的,因此你可以根据自己的喜好自由修改。 +4. 使用指针和 `malloc` 分配内存。一些操作需要内存,包括代表音乐收藏中文件的字符串列表。还有一个列表来保存随机生成的数字。 5. 生成所有文件范围内的随机数列表(例如,如果集合有 1000 个文件,则为 1 到 1000)。 6. 复制文件。 @@ -181,13 +180,13 @@ while(1) { } ``` -这将从指定的文件中读取多个字节 (readByteCount) 到字符缓冲区中。该函数的第一个参数是文件名(srcFileDesc)。第二个参数是一个指向字符缓冲区的指针,这之前在程序中声明过。该函数的最后一个参数是缓冲区的大小。 +这将从指定的文件中读取多个字节(`readByteCount`)到字符缓冲区中。该函数的第一个参数是文件名(`srcFileDesc`)。第二个参数是一个指向字符缓冲区的指针,这之前在程序中声明过。该函数的最后一个参数是缓冲区的大小。 程序返回读取的字节数(在本例中为 4 个字节)。如果返回的数字为 0 或更少,则第一个 `if` 子句会跳出循环。 如果读取字节数为 0,则所有写入完成,循环中断以写入下一个文件。如果读取的字节数小于 0,则发生错误并退出程序。 -当读取 4 个字节时,它会写入它们。write 函数接受三个参数。第一个是要写入的文件,第二个是字符缓冲区,第三个是要写入的字节数(4 个字节) .该函数返回写入的字节数。 +当读取 4 个字节时,它会写入它们。`write` 函数接受三个参数。第一个是要写入的文件,第二个是字符缓冲区,第三个是要写入的字节数(4 个字节) .该函数返回写入的字节数。 如果写入了 0 个字节,则发生了写入错误,因此第二个 `if` 子句退出程序。 @@ -206,7 +205,7 @@ via: https://opensource.com/article/22/7/c-linux-mp3 作者:[Rikard Grossman-Nielsen][a] 选题:[lkxed][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/published/202207/20220714 5 ways to learn C programming on Linux.md b/published/202207/20220714 5 ways to learn C programming on Linux.md new file mode 100644 index 0000000000..4b7cc34de2 --- /dev/null +++ b/published/202207/20220714 5 ways to learn C programming on Linux.md @@ -0,0 +1,104 @@ +[#]: subject: "5 ways to learn C programming on Linux" +[#]: via: "https://opensource.com/article/22/7/learn-c-linux" +[#]: author: "Alan Smithee https://opensource.com/users/alansmithee" +[#]: collector: "lkxed" +[#]: translator: "Donkey-Hao" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14869-1.html" + +在 Linux 上学习 C 语言的五种方式 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/26/232122wc4c5g55363bgj5g.jpg) + +> 请下载我们的电子书获得在 Linux 和 FreeDOS 上 C 语言编程的提示和技巧。 + +有许多关于为什么 C 语言能够经久不衰的说法。或许是因为它语法简单明了。又或许是因为它常被认为是实用的语言,因为它不基于其他高级语言,可以在任何平台上编译运行。C 显然是一种强大的语言,并且我认为它经久不衰与它作为其他技术的基础的方式相关。这里有 5 项我喜爱的基于 C 语言的技术,希望它们能够帮助你更多的了解 C 语言。 + +### 1、GObject 和 GTK + +C 语言不是面向对象编程的语言。它没有 `class` 关键字。 一些人用 C++ 进行面向对象编程,但是还有一些人坚持用 C 和 GObject 库。GObject 库为 C 语言提供了一个 `class` 结构体,GTK 项目以提供可通过 C 访问的工具包而闻名。没有 GTK ,就没有 GIMP (GTK 就是为此开发的)、GNOME 和其他成千上百流行的开源应用。 + +#### 了解更多 + +GObject 和 GTK 是使用 C 开始进行 GUI 编程的绝佳方式。它们“装备精良”,可以让你用 C 语言进行图形应用的编程,因为开发者为你做了许多“繁重工作”。他们定义了类和数据类型,创建了工具包,你所要做的就是将所有东西放在一起。 + +### 2、Ncurses + +如果 GTK 超过了你的需求,你或许认为一个终端用户界面terminal user interface(TUI)更适合你。Ncurses 库可以在终端创建“小部件”,创建一种在终端窗口上绘制图形的应用程序。你可以使用方向键控制界面,选择按钮和元素,就像不用鼠标来使用 GUI 应用一样。 + +#### 了解更多 + +利用 Ncurses 库使用 C 语言写一个 [猜数字][3] 游戏。 + +### 3、Lua 和 Moonscript + +Lua 是一种脚本语言,它可以使用内置的 C API 访问 C 语言库。它十分精巧、快捷以及简单,拥有约 30 个函数和少量内置库。你可以使用 Lua 进行系统自动化、游戏修改和脚本编写、使用 LÖVE 之类的前端进行游戏开发,或者使用 GTK 进行一般应用程序开发(例如 [Howl 文本编辑器][4])。 + +#### 了解更多 + +Lua 十分好的一点是你可以从它开始学习掌握基本的编程理念,然后当你有足够勇气直面基础编程语言时,再探索它的 C 语言 API 。另一方面,如果你只会 Lua ,那也没事儿。Lua 有很多的 [外部库][5] ,使其成为各种开发方式的绝佳选择。 + +### 4、Cython + +Lua 不是唯一带有 C 接口的编程语言。[Cython][6] 是一种编译器和编程语言,旨在使为 Python 编写 C 扩展就像编写 Python 代码一样容易。本质上,你可以编写 Python 并最终得到 C 语言程序。最简单的示例: + +``` +print("hello world") +``` + +创建一个 `setup.py` 脚本: + +``` +from setuptools import setup +from Cython.Build import cythonize + +setup( + ext_modules = cythonize("hello.pyx") +) +``` + +运行该 `setup` 脚本: + +``` +$ python3 ./setup.py +``` + +最后你会在同一个目录中得到一个 `hello.c` 和 `hello.cpython-39-x86_64-linux-gnu.so` 文件。 + +#### 了解更多 + +[Cython][7] 是 Python 的一个超集,支持 C 语言的函数和数据类型。它不可能帮你直接学习 C 语言,但它为希望学习 C 代码并将其集成到 Python 中的 Python 开发人员开辟了新的可能性。 + +### 5、FreeDOS + +了解更多 C 语言的最好方式是编写 C 代码,没有什么比写你可以真正使用的代码更令人激动的了。FreeDOS 项目是 DOS 的开源实现, 而 DOS 是 Windows 的前身。或许你已经用过 FreeDOS 了,或者作为运行 BIOS 更新程序的便捷开源方法,或者在模拟器中玩经典的计算机游戏。你可以用 FreeDOS 做更多事情。它是学习 C 语言的理想平台,其中包含一系列工具,鼓励你编写自己的命令和简单(或不那么简单,如果你愿意)的应用程序。当然你可以在任何系统上写 C 代码,但是 FreeDOS 的便利可能会让你感到耳目一新。天空有极限,但即使在地面上,你也可以用 C 做一些非常有趣的事情。 + +### 下载电子书 + +你可以从我们编写的新 [电子书][8] 中学到更多 C 语言,并在我们的电子书中了解有关 FreeDOS 上 C 语言的更多信息。这些是编程文章的集合,可帮助你学习 C 语言,并演示如何以有用的方式用 C 写一些代码。 + +> **[下载电子书][8]** + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/learn-c-linux + +作者:[Alan Smithee][a] +选题:[lkxed][b] +译者:[Donkey](https://github.com/Donkey-Hao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alansmithee +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/laptop_screen_desk_work_chat_text.png +[2]: https://opensource.com/downloads/guide-c-programming +[3]: https://opensource.com/article/21/8/guess-number-game-ncurses-linux +[4]: https://opensource.com/article/20/12/howl +[5]: https://opensource.com/article/19/11/getting-started-luarocks +[6]: http://cython.org +[7]: https://opensource.com/article/21/4/cython +[8]: https://opensource.com/downloads/guide-c-programming diff --git a/translated/tech/20220714 Fixing -Command -python- not found- Error in Ubuntu Linux.md b/published/202207/20220714 Fixing -Command -python- not found- Error in Ubuntu Linux.md similarity index 69% rename from translated/tech/20220714 Fixing -Command -python- not found- Error in Ubuntu Linux.md rename to published/202207/20220714 Fixing -Command -python- not found- Error in Ubuntu Linux.md index 376f049a57..9531c34ad2 100644 --- a/translated/tech/20220714 Fixing -Command -python- not found- Error in Ubuntu Linux.md +++ b/published/202207/20220714 Fixing -Command -python- not found- Error in Ubuntu Linux.md @@ -3,13 +3,15 @@ [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lkxed" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14878-1.html" 修复 Ubuntu Linux 中 “Command ‘python’ not found” 的错误 ====== +![](https://img.linux.net.cn/data/attachment/album/202207/30/071627r176w1k1y5dkkw6w.jpg) + 如何在 Linux 终端中运行一个 Python 程序?像这样,对吗? ``` @@ -18,31 +20,33 @@ python program.py 然而,如果你试图在 Ubuntu(和其他一些发行版)中使用 `python` 命令,它会抛出一个错误。 +``` command ‘python’ not found, did you mean: command ‘python3’ from deb python3 command ‘python’ from deb python-is-python3 +``` -如果你注意这个错误信息,它可以清除很多东西。**这里的 python 命令实际上是 python3**。 +如果你注意这个错误信息,它说明了很多东西。**这里的 `python` 命令实际上是 `python3`**。 如果你不理解,不用担心。我将在这里详细解释。 ### 为什么在 Ubuntu 上没有发现 python 命令? -这是因为 Python 语言不是以 python 的形式安装的,而是以 python3 或 python2 的形式安装的(在一些老的 Ubuntu 版本中)。 +这是因为 Python 语言不是以 `python` 的形式安装的,而是以 `python3` 或 `python2` 的形式安装的(在一些老的 Ubuntu 版本中)。 在遥远的过去的某个时间点,Python 实际上是作为 `python` 包/可执行文件提供的。当 Python 发布第二版时,Ubuntu 和其他发行版不得不同时支持 Python 1.x 和 2.x 版本。 -因此,他们将较新的 Python 版本命名为 `python2`,以区分这两个版本。其他应用或库也在其代码中指定 python 或 python2。 +因此,他们将较新的 Python 版本命名为 `python2`,以区分这两个版本。其他应用或库也在其代码中指定 `python` 或 `python2`。 -最终,Python 1 版本被完全停用,但软件包继续被命名为 python2。 +最终,Python 1 版本被完全停用,但软件包继续被命名为 `python2`。 类似地,当 Python 3 版本发布时,发行版开始同时提供 `python2` 和 `python3` 包。 -Python 2 不再被支持,Python 3.x 是你在 Ubuntu 上安装的版本。该软件包仍被命名为 python3。 +Python 2 不再被支持,Python 3.x 是你在 Ubuntu 上安装的版本。该软件包仍被命名为 `python3`。 -**总结一下,你已经在 Ubuntu 上安装了 Python。它可以作为 python3 软件包使用。** +**总结一下,你已经在 Ubuntu 上安装了 Python。它是以 `python3` 软件包方式使用的。** -那么,当你[在 Ubuntu 上看到 Python command not found 的错误][1]时,你有什么选择?让我来介绍一下。 +那么,当你 [在 Ubuntu 上看到 “Python command not found” 的错误][1] 时,你有什么选择?让我来介绍一下。 ### 确保你的系统中已经安装了 Python @@ -66,7 +70,7 @@ sudo apt install python3 ### 使用 python3 而不是 python -如果对你来说不是太麻烦,在需要的地方使用 python3 命令而不是 python。 +如果对你来说不是太麻烦,在需要的地方使用 `python3` 命令而不是 `python`。 想检查已安装的 Python 版本吗?请这样输入: @@ -77,7 +81,7 @@ python3 --version 然后你会在输出中得到版本的详细信息: ``` -[email protected]:~$ python3 --version +~$ python3 --version Python 3.10.4 ``` @@ -91,7 +95,7 @@ python3 program.py ### 将 python3 链接为 python -你可以在你的 .bashrc 文件中创建一个永久别名,像这样: +你可以在你的 `.bashrc` 文件中创建一个永久别名,像这样: ``` alias python='python3' @@ -99,9 +103,9 @@ alias python='python3' 这样,你可以运行 `python` 命令,而你的系统运行 `python3`。 -这在大多数情况下都会起作用,除非某些程序期望运行 /usr/bin/python。现在,你可以在 /usr/bin/python 和 /usr/bin/python3 之间建立符号链接,但对于 Ubuntu 用户来说,存在一个更简单的选择。 +这在大多数情况下都会起作用,除非某些程序期望运行 `/usr/bin/python`。现在,你可以在 `/usr/bin/python` 和 `/usr/bin/python3` 之间建立符号链接,但对于 Ubuntu 用户来说,存在一个更简单的选择。 -对于 Ubuntu 20.04 和更高版本,如果你安装了 python-is-python3 软件包,你有一个软件包可以自动完成所有链接创建。这也是原始错误信息所提示的。 +对于 Ubuntu 20.04 和更高版本,如果你安装了 `python-is-python3` 软件包,你有一个软件包可以自动完成所有链接创建。这也是原始错误信息所提示的。 ``` sudo apt install python-is-python3 @@ -109,7 +113,7 @@ sudo apt install python-is-python3 ![install python is python3 ubuntu][3] -你可以看到符号链接已经被创建,你可以使用 python 命令(实际上是运行 python3),没有任何问题。 +你可以看到符号链接已经被创建,你可以使用 `python` 命令(实际上是运行 `python3`),没有任何问题。 ![checking python ubuntu][4] @@ -122,7 +126,7 @@ via: https://itsfoss.com/python-not-found-ubuntu/ 作者:[Abhishek Prakash][a] 选题:[lkxed][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/published/20220716 Guide- How to Share A Folder Between Ubuntu-Linux and Windows.md b/published/202207/20220716 Guide- How to Share A Folder Between Ubuntu-Linux and Windows.md similarity index 100% rename from published/20220716 Guide- How to Share A Folder Between Ubuntu-Linux and Windows.md rename to published/202207/20220716 Guide- How to Share A Folder Between Ubuntu-Linux and Windows.md diff --git a/published/202207/20220716 How to Install Deepin Desktop in Arch Linux [Complete Guide].md b/published/202207/20220716 How to Install Deepin Desktop in Arch Linux [Complete Guide].md new file mode 100644 index 0000000000..aca08fc6d4 --- /dev/null +++ b/published/202207/20220716 How to Install Deepin Desktop in Arch Linux [Complete Guide].md @@ -0,0 +1,314 @@ +[#]: subject: "How to Install Deepin Desktop in Arch Linux [Complete Guide]" +[#]: via: "https://www.debugpoint.com/deepin-arch-linux-install-20/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14867-1.html" + +如何在 Arch Linux 中安装深度桌面(DDE) +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/26/170414x01pmevoo8o8b6ob.jpg) + +> 在本指南中,我们将解释在 Arch Linux 中安装漂亮的深度桌面(DDE)所需的步骤。 + +指南的第一部分解释了安装 Arch 基本系统的步骤。第二部分是在 Arch Linux 的基础上安装完整的深度桌面。 + +### 什么是深度桌面(DDE)? + +[深度操作系统][1] 是一个基于 Debian 稳定分支的、功能丰富且漂亮的桌面环境。深度桌面环境(DDE)是深度操作系统自主开发的桌面环境。它由它自己的 dde-kwin 窗口管理器驱动。深度桌面带有漂亮的停靠区和许多预装的深度原生的应用程序。 + +这个令人眼花缭乱的桌面环境 [可在 Arch 仓库中找到][2];这篇文章介绍了如何在 Arch Linux 中安装深度桌面。 + +本指南安装深度桌面环境 20.1。然而,其他版本的步骤也应该是类似的。 + +### 第一部分:安装 Arch Linux + +如果你已经安装了 Arch Linux,你可以跳过这一步,直接进入安装深度桌面部分。 + +要快速安装基本的 Arch Linux,请按照以下步骤进行。你也可以访问 [本指南][3] 了解以双启动或在虚拟机上安装 Arch Linux 的完整教程。 + +#### 下载 Arch Linux + +从下面的链接下载 Arch Linux 的 .iso 文件。这里有磁力链和 BT 链接。一旦你下载好了,就把 ISO 写入 U 盘。然后从该驱动器启动。 + +> **[下载 Arch Linux][4]** + +如果你打算通过 [GNOME Boxes][5]、[virt-manager][6] 将其安装为虚拟机镜像 —— 那么你不需要将其写入 U 盘。 + +#### 启动和配置分区 + +从 Arch Linux ISO 启动后,你必须运行一系列的命令来安装基本系统。 + +首先,运行下面的命令,找出设备的标识符。 + +``` +fdisk -l +``` + +![fdisk -l 之前的分区][7] + +然后用此设备标识符,运行下面的命令,开始对你的磁盘进行分区。请确保根据你的系统而修改下面的 `/dev/sda` 参数。 + +``` +cfdisk /dev/sda +``` + +在下一个提示中选择 `label type = dos`。 + +选择可用空间,并从底部选择 “NEW” 选项。在这个例子中,我将创建三个分区,如下所示: + +``` +/dev/sda1 - 1G - for /boot +/dev/sda2 - 5G - for root +/dev/sda3 - 1G - for swap +``` + +![cfdisk][8] + +在下一个屏幕中,提供启动分区(`/boot`)的大小(在这个例子中,我给出了 1GB)。选择它作为主分区。 + +对 5GB 大小的主根分区(`/`)重复同样的步骤。 + +![改变交换分区的类型][9] + +用同样的步骤创建一个大小为 1G 的交换分区(你可以根据你的需要改变大小)。创建交换分区后,确保在底部选择类型,并将其标记为 “Linux Swap/Solaris” 选项的交换分区。 + +![cfdisk 的最终分区列表][10] + +完成后,用底部的 “Write” 选项将变化写到磁盘上。确保你在写之前做一个备份,因为这是你系统中的一个永久性的改变。 + +在你继续之前,运行下面的命令来检查。在这个例子中,你可以看到,列出了三个分区。 + +``` +fdisk -l +``` + +![fdisk 中的最终分区列表][11] + +依次运行下面的命令,在上面新创建的分区中格式化并创建一个 ext4 文件系统。确保你根据你的需要改变 `/dev/sda1` 和 `/dev/sda2` 参数。 + +``` +mkfs.ext4 /dev/sda1 +mkfs.ext4 /dev/sda2 +mkswap /dev/sda3 +swapon /dev/sda3 +``` + +完成后,挂载系统并创建必要的目录。 + +``` +mount /dev/sda2 /mnt +mkdir /mnt/boot /mnt/var /mnt/home +mount /dev/sda1 /mnt/boot +``` + +同样,确保你根据你的系统改变 `/dev/sda1`、`/dev/sda2` 和 `/dev/sda3` 参数。 + +![准备文件系统][12] + +#### 安装基本系统 + +我希望你已经连接到互联网了。如果没有,请尝试使用 USB 网卡或有线网络连接,Arch 安装程序会自动配置和检测。如果你没有可用的有线连接,请按照本指南使用 Arch Linux 安装程序配置无线 Wi-Fi 网络。 + +依次运行下面的命令,将基本系统安装到挂载的分区中。下载的大小约为 400MB。 + +``` +pacman -Syy +pacstrap /mnt base base-devel linux linux-firmware nano dhcpcd net-tools grub +``` + +![安装基本系统][13] + +一旦完成,生成一个文件系统表,没有这个表你就无法启动系统。 + +``` +genfstab -U /mnt >> /mnt/etc/fstab +``` + +#### 配置基本系统 + +依次按照下面的命令来配置基本系统。这包括设置你的地区和语言,添加一个登录用户,以及设置互联网。 + +``` +arch-chroot /mnt +nano /etc/locale.gen +``` + +去掉开头的 `#`,取消对你选择的语言环境的注释。在本指南中,我选择了 `en_US.UTF-8 UTF-8`。按 `CTRL+O`、回车和 `CTRL+X` 退出 nano。 + +![改变语言环境][14] + +使用以下方法生成语言环境数据。 + +``` +locale-gen +``` + +使用下面的命令设置语言。 + +``` +echo LANG=en_US.UTF-8 > /etc/locale.conf +export LANG=en_US.UTF-8 +``` + +设置本地时区。 + +``` +ln -s /usr/share/zoneinfo/America/New_York /etc/localtime +``` + +同样,你可以根据你的需要来选择它们。你可以通过以下命令列出本地时区。 + +``` +ls /usr/share/zoneinfo +ls /usr/share/zoneinfo/America +``` + +依次使用下面的命令设置硬件时钟、创建主机名并启用互联网的 DHCP。你可以根据你的想法把 `debugpoint-pc` 改为任何主机名。 + +``` +hwclock --systohc --utc +echo debugpoint-pc > /etc/hostname +systemctl enable dhcpcd +``` + +下一步是设置 `root` 用户的密码、创建一个管理员用户,并将该用户添加到 `sudoers` 文件中。 + +按照下面的命令依次进行。确保根据你的需要将用户名`debugpoint` 改为其他名称。 + +``` +passwd rootuseradd -m -g users -G wheel -s /bin/bash debugpointpasswd debugpoint +``` + +![创建用户][15] + +打开 `sudoers` 文件,添加以下几行。 + +``` +nano /etc/sudoers +``` + +添加下面几行。由于你已经创建了 `root` 用户,该条目应该已经有了。 + +``` +root ALL=(ALL) ALL +debugpoint ALL=(ALL) ALL +``` + +![更新 sudoers 文件][16] + +安装 GRUB,建立初始的 Ramdisk 环境,并使用下面的命令卸载系统。 + +``` +grub-install /dev/sda +grub-mkconfig -o /boot/grub/grub.cfg +mkinitcpio -p linux +exit +``` + +![配置 GRUB][17] + +然后重新启动你的系统。 + +``` +umount /mnt/boot +umount /mnt +reboot +``` + +现在你已经成功地安装了 Arch Linux 基本系统。现在是安装完整的深度桌面的时候了。 + +### 第二部分:在 Arch Linux 中安装深度桌面 + +重新启动后,从 GRUB 中选择 Arch Linux。在 Arch Linux 的提示符下,开始依次运行以下命令。这些命令安装 Xorg 服务器、Lightdm 显示管理器和深度桌面组件。 + +对于所有的命令,使用默认的包版本,即在询问时按回车。 + +安装 Xorg 和显示管理器。大约安装大小为 80 MB。 + +``` +sudo pacman -S --need xorg lightdm +``` + +安装额外的组件和应用程序(约 550 MB)。 + +``` +sudo pacman -S --need deepin deepin-extra +``` + +安装完成后,通过修改 Lightdm 配置文件启用深度欢迎页。按照下面的命令。 + +``` +nano /etc/lightdm/lightdm.conf +``` + +并添加下面这一行。保存该文件(`CTRL+O`、`CTRL+X`)。 + +``` +greeter-session=lightdm-deepin-greeter +``` + +![在 Lightdm 登录页中添加深度欢迎欢迎页][18] + +现在是时候把显示管理器和网络管理器作为服务启用了。这样,下次登录时,它们就可以由 systemd 自动运行。 + +``` +systemctl enable lightdm +systemctl enable NetworkManager +``` + +![启用 Lightdm 和网络][19] + +使用 `reboot` 命令重新启动系统。 + +``` +reboot +``` + +如果一切顺利,你应该看到深度桌面的登录提示。使用你刚刚在上面的步骤中创建的凭证登录。你应该会看到最新的深度桌面环境。 + +![Arch Linux 中的深度 20.1 登录屏幕][20] + +![Arch Linux中的深度桌面 20.1][21] + +### 总结 + +我希望这个指南能帮助你在 Arch Linux 中安装深度桌面。虽然它不是我的日常环境,我觉得深度的桌面在本质上有些慢。可能是因为有太多的颜色渲染和动画,而且尽管它是建立在 Qt 上的,但没有为深度桌面进行适当的优化。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/deepin-arch-linux-install-20/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/2020/09/deepin-20-review/ +[2]: https://archlinux.org/groups/x86_64/deepin/ +[3]: https://www.debugpoint.com/2020/11/install-arch-linux/ +[4]: https://www.archlinux.org/download/ +[5]: https://www.debugpoint.com/2020/05/install-use-gnome-boxes/ +[6]: https://www.debugpoint.com/2020/11/virt-manager/ +[7]: https://www.debugpoint.com/wp-content/uploads/2020/12/fdisk-l-before.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2020/12/cfdisk-1024x159.jpg +[9]: https://www.debugpoint.com/wp-content/uploads/2020/12/Swap-parition-type-change.jpg +[10]: https://www.debugpoint.com/wp-content/uploads/2020/12/final-partition-list-in-cfdisk-1024x178.jpg +[11]: https://www.debugpoint.com/wp-content/uploads/2020/12/final-partition-list-in-fdisk.jpg +[12]: https://www.debugpoint.com/wp-content/uploads/2020/12/prepare-file-system.jpg +[13]: https://www.debugpoint.com/wp-content/uploads/2020/12/Install-base-system-1024x205.jpg +[14]: https://www.debugpoint.com/wp-content/uploads/2020/12/change-locale.jpg +[15]: https://www.debugpoint.com/wp-content/uploads/2020/12/create-user.jpg +[16]: https://www.debugpoint.com/wp-content/uploads/2020/12/update-sudoers-file.jpg +[17]: https://www.debugpoint.com/wp-content/uploads/2020/12/configure-grub-1024x639.jpg +[18]: https://www.debugpoint.com/wp-content/uploads/2021/01/add-deepin-greeter-in-lightdm-login.jpg +[19]: https://www.debugpoint.com/wp-content/uploads/2020/12/Enable-lightdm-and-network-Install-Xfce-Desktop-in-Arch-Linux.jpg +[20]: https://www.debugpoint.com/wp-content/uploads/2021/01/Deepin-20.1-Login-screen-in-Arch-Linux-1024x771.jpg +[21]: https://www.debugpoint.com/wp-content/uploads/2021/01/Deepin-Desktop-20.1-in-Arch-Linux-1024x770.jpg diff --git a/translated/tech/20220716 Listen to music on Linux with Rhythmbox.md b/published/202207/20220716 Listen to music on Linux with Rhythmbox.md similarity index 65% rename from translated/tech/20220716 Listen to music on Linux with Rhythmbox.md rename to published/202207/20220716 Listen to music on Linux with Rhythmbox.md index 145e63d2a2..2fa8c8a204 100644 --- a/translated/tech/20220716 Listen to music on Linux with Rhythmbox.md +++ b/published/202207/20220716 Listen to music on Linux with Rhythmbox.md @@ -3,25 +3,24 @@ [#]: author: "Jim Hall https://opensource.com/users/jim-hall" [#]: collector: "lkxed" [#]: translator: "duoluoxiaosheng" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14865-1.html" -在 Linux 上使用 Rhythbox 听音乐 +在 Linux 上使用 Rhythmbox 听音乐 ====== -下面我将介绍我是如何在 Linux 的 GNOME 桌面上使用 Rhythmbox 听在线音乐和 MP3 列表的。 -![Woman programming][1] +![](https://img.linux.net.cn/data/attachment/album/202207/25/234644f4rgrx1vrpgfk86n.jpg) -Image by: WOCinTech Chat. Modified by Opensource.com. CC BY-SA 4.0 +> 下面我将介绍我是如何在 Linux 的 GNOME 桌面上使用 Rhythmbox 听在线音乐和 MP3 列表的。 对我来说,在完全安静的环境下工作是很困难的。我需要某种背景音,最好是一些熟悉的音乐。我在音乐上的需求很简单:我只需要一个音乐播放器,可以播放我的 MP3 音乐库和少数几个我喜欢的网站的在线音乐。 -我在 Linux 上尝试了多个音乐播放器,最终我还是选择了 Rhythmbox。 Rhythmbox 是一个 GNOME 桌面音乐播放器。如果你的 Linux 发行版使用的是 GNOME 桌面,很可能它已经安装了 Rhythmbox。它很简单,用来播放我本地的音乐库和广播网站的在线音乐。我很乐意在 Linux 上使用 Rhythmbox 收听在线音乐和我自己的音乐库。 +我在 Linux 上尝试了多个音乐播放器,最终我还是选择了 Rhythmbox。 Rhythmbox 是一个 GNOME 桌面音乐播放器。如果你的 Linux 发行版使用的是 GNOME 桌面,很可能已经安装了 Rhythmbox。它很简单,用来播放我本地的音乐库和广播网站的在线音乐。我很乐意在 Linux 上使用 Rhythmbox 收听在线音乐和我自己的音乐库。 ### 在 Linux 上收听在线音乐 -Rhythmbox 支持多个在线音乐服务商。如果你拥有一个 Last.fm 或者 Libre.fm 的帐号,你可以点击左侧的标签登录。或者,你想收听在线广播,点击左侧的广播标签,在预设的广播网站中选择一个。在我写代码的时候我通常喜欢听迷幻舞曲,HBR1 Tranceponder 是我最喜欢的一个在线广播网站。 +Rhythmbox 支持多个在线音乐服务商。如果你拥有一个 Last.fm 或者 Libre.fm 的帐号,你可以点击左侧的标签登录。或者,你想收听在线广播,点击左侧的“广播Radio”标签,在预设的广播网站中选择一个。在我写代码的时候我通常喜欢听迷幻舞曲,HBR1 Tranceponder 是我最喜欢的一个在线广播网站。 ![Streaming HBR1 Traceponder][2] @@ -29,21 +28,21 @@ Rhythmbox 支持多个在线音乐服务商。如果你拥有一个 Last.fm 或 在过去的几年中,我收集了大量的 MP3 音乐。由于几年前 MP3 的专利在美国已经到期,它在 Linux 是一种很好用的开放的音乐格式。 -我把我 20GB 的 MP3 音乐保存在我的主目录之外,在 `/usr/local/music` 。要把音乐导入 Rhythmbox,点击 **导入** 按钮,选择 `usr/local/music` 目录,或者任何你保存音乐的目录,让 Rhythmbox 去识别 MP3 音乐。结束以后点击 **导入列出的曲目** 按钮导入就完成了。 +我把我 20GB 的 MP3 音乐保存在我的主目录之外,在 `/usr/local/music` 。要把音乐导入 Rhythmbox,点击 “导入Import” 按钮,选择 `usr/local/music` 目录,或者任何你保存音乐的目录,让 Rhythmbox 去识别 MP3 音乐。结束以后点击 “导入列出的曲目Import listed tracks” 按钮导入就完成了。 ![Use the Import button to add music to Rhythmbox][3] ![Rhythmbox identifies new music files][4] -Rhythmbox 播放我的音乐,并通过类型,艺术家和专辑组织歌曲,所以我可以很容易找到我想听的音乐。 +Rhythmbox 可以播放我的音乐,并通过类型,艺术家和专辑组织歌曲,所以我可以很容易找到我想听的音乐。 ![Listening to a music library in Rhythmbox][5] -### 旋律永存 +### 旋律永存 我愿意在 Linux 上使用 Rhythmbox 作为我的音乐播放器,它是如此简洁,不会影响到我。而且听音乐可以帮我和谐掉日常的噪音,让我每一天都可以过的快一点。 -Image by: Streaming HBR1 Tranceponder in Rhythmbox (image: Jim Hall, license: CC BY SA) +*(文内图片来自 Jim Hall,CC BY SA)* -------------------------------------------------------------------------------- @@ -52,7 +51,7 @@ via: https://opensource.com/article/22/7/listen-music-rhythmbox-linux 作者:[Jim Hall][a] 选题:[lkxed][b] 译者:[duoluoxiaosheng](https://github.com/duoluoxiaosheng) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/published/20220718 Monitor your Linux firewall with nftwatch.md b/published/202207/20220718 Monitor your Linux firewall with nftwatch.md similarity index 100% rename from published/20220718 Monitor your Linux firewall with nftwatch.md rename to published/202207/20220718 Monitor your Linux firewall with nftwatch.md diff --git a/published/20220719 How to Install Discord on Manjaro and Other Arch Linux Derivatives.md b/published/202207/20220719 How to Install Discord on Manjaro and Other Arch Linux Derivatives.md similarity index 100% rename from published/20220719 How to Install Discord on Manjaro and Other Arch Linux Derivatives.md rename to published/202207/20220719 How to Install Discord on Manjaro and Other Arch Linux Derivatives.md diff --git a/published/202207/20220720 How much JavaScript do you need to know before learning ReactJS-.md b/published/202207/20220720 How much JavaScript do you need to know before learning ReactJS-.md new file mode 100644 index 0000000000..7369b9a6b1 --- /dev/null +++ b/published/202207/20220720 How much JavaScript do you need to know before learning ReactJS-.md @@ -0,0 +1,77 @@ +[#]: subject: "How much JavaScript do you need to know before learning ReactJS?" +[#]: via: "https://opensource.com/article/22/7/learn-javascript-before-reactjs" +[#]: author: "Sachin Samal https://opensource.com/users/sacsam005" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14874-1.html" + +学习 ReactJS 之前,你需要了解多少 JavaScript? +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/29/082104d5zn1xn77r1n8p1n.jpg) + +> 最主要的是要精通 JavaScript,这样你就可以减少 ReactJS 之旅的复杂性。 + +React 是一个建立在 HTML、CSS 和 JavaScript 之上的 UI 框架,其中 JavaScript(JS)负责大部分的逻辑。如果你对变量、数据类型、数组函数、回调、作用域、字符串方法、循环和其他 JS DOM 操作相关的主题有一定了解,这些将极大地加快学习 ReactJS 的步伐。 + +你对现代 JavaScript 的概念将决定你能多快地掌握 ReactJS 的步伐。你不需要成为一个 JavaScript 专家来开始你的 ReactJS 之旅,但就像对食材的了解是任何希望掌握烹饪的厨师所必须的一样,学习 ReactJS 也是如此。它是一个现代的 JavaScript UI 库,所以你需要了解一些 JavaScript。问题是,需要多少? + +### 示例解释 + +假设我被要求用英语写一篇关于“牛”的文章,但我对这种语言一无所知。在这种情况下,为了让我成功地完成任务,我不仅要对主题有概念,还要对指定的语言有概念。 + +假设我获得了一些关于主题(牛)的知识,我如何计算我需要知道多少英语才能写出规定的主题?如果我必须用英语写一篇关于其他复杂话题的文章呢? + +这很难搞清楚,不是吗?我不知道我要写关于这个话题的什么东西,但它可能是任何东西。所以要想开始,我必须要有适当的英语知识,但还不止于此。 + +### 极端现实 + +在开始使用 ReactJS 之前,所需的 JavaScript 数量也是如此。根据我的例子情景,ReactJS 是话题“牛”,而 JavaScript 是英语。要想在 ReactJS 中获得成功,对 JavaScript 的掌握很重要。如果没有适当的 JavaScript 基础,一个人是很难专业地掌握 ReactJS 的。无论我对这个主题有多少知识,如果我不知道语言的基础,我就不能正确地表达自己。 + +### 多少才算够? + +根据我的经验,当你开始你的 ReactJS 之旅时,你应该已经熟悉了: + +* 变量 +* 数据类型 +* 字符串方法 +* 循环 +* 条件式 + +你应该对这些具体的 JavaScript 熟悉。但这些只是最基本的先决条件。当你试图创建一个简单的 React 应用时,你将不可避免地需要处理事件。所以,普通函数、函数表达式、语句、箭头函数的概念,箭头函数和普通函数的区别,以及这两类函数中 `this` 关键字的词义范围,这确实很重要。 + +但问题是,如果我必须使用 ReactJS 创建一个复杂的应用怎么办? + +### 获得启发 + +在 JavaScript 中处理事件、传播操作符、解构、命名导入和默认导入将帮助你理解 React 代码的工作机制。 + +最重要的是,你必须了解 JavaScript 本身背后的核心概念。JavaScript 在设计上是异步的。当出现在文件底部的代码在文件顶部的代码之前执行时,不要惊讶。像 promise、callback、async-await、map、filter 和 reduce 这样的结构,是 ReactJS 中最常见的方法和概念,尤其是在开发复杂的应用时。 + +最主要的是要精通 JavaScript,这样你可以减少 ReactJS 之旅的复杂性。 + +### 越来越好 + +我很容易说出你需要知道的东西,但你去学习它完全是另一回事。大量练习 JavaScript 是必不可少的,但你可能会感到惊讶,我认为这并不意味着你必须等到掌握它。有些概念事先很重要,但你可以在学习过程中学到很多东西。练习的一部分是学习,所以你可以开始使用 JavaScript,甚至是 React 的一些基础知识,只要你以舒适的速度移动并理解在你尝试任何严肃的事情之前做你的“家庭作业”是一个要求。 + +### 立即开始使用 JavaScript + +不要费心等到你了解了 JavaScript 的所有方面。那永远不会发生。如果这样做,你将陷入学习 JavaScript 的永远循环中。你们都知道技术领域是如何不断发展和迅速变化的。如果你想开始学习 JavaScript,请尝试阅读 Mandy Kendall 的介绍性文章 [通过编写猜谜游戏学习 JavaScript][2]。这是一种快速入门的好方法,当你看到了可能的情况,我认为你可能会发现很难停下来。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/learn-javascript-before-reactjs + +作者:[Sachin Samal][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/sacsam005 +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/OSDC_women_computing_5.png +[2]: https://opensource.com/article/21/1/learn-javascript diff --git a/published/202207/20220720 What happens when you press a key in your terminal.md b/published/202207/20220720 What happens when you press a key in your terminal.md new file mode 100644 index 0000000000..777f436d96 --- /dev/null +++ b/published/202207/20220720 What happens when you press a key in your terminal.md @@ -0,0 +1,289 @@ +[#]: subject: "What happens when you press a key in your terminal?" +[#]: via: "https://jvns.ca/blog/2022/07/20/pseudoterminals/" +[#]: author: "Julia Evans https://jvns.ca/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14863-1.html" + +当你在终端上按下一个键时会发生什么? +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/25/110217dlbzqvm9lltkq244.jpg) + +我对终端Terminal是怎么回事困惑了很久。 + +但在上个星期,我使用 [xterm.js][1] 在浏览器中显示了一个交互式终端,我终于想到要问一个相当基本的问题:当你在终端中按下键盘上的一个键(比如 `Delete`,或 `Escape`,或 `a`),发送了哪些字节? + +像往常一样,我们将通过做一些实验来回答这个问题,看看会发生什么 : ) + +### 远程终端是非常古老的技术 + +首先,我想说的是,用 `xterm.js` 在浏览器中显示一个终端可能看起来像一个新事物,但它真的不是。在 70 年代,计算机很昂贵。因此,一个机构的许多员工会共用一台电脑,每个人都可以有自己的 “终端” 来连接该电脑。 + +例如,这里有一张 70 年代或 80 年代的 VT100 终端的照片。这看起来像是一台计算机(它有点大!),但它不是 —— 它只是显示实际计算机发送的任何信息。 + +[![DEC VT100终端][2]][3] + +当然,在 70 年代,他们并没有使用 Websocket 来做这个,但来回发送的信息的方式和当时差不多。 + +(照片中的终端是来自西雅图的 [活电脑博物馆][4] Living Computer Museum,我曾经去过那里,并在一个非常老的 Unix 系统上用 `ed` 编写了 FizzBuzz,所以我有可能真的用过那台机器或它的一个兄弟姐妹!我真的希望活电脑博物馆能再次开放,能玩到老式电脑是非常酷的。) + +### 发送了什么信息? + +很明显,如果你想连接到一个远程计算机(用 `ssh` 或使用 `xterm.js` 和 Websocket,或其他任何方式),那么需要在客户端和服务器之间发送一些信息。 + +具体来说: + + **客户端** 需要发送用户输入的键盘信息(如 `ls -l`)。 + **服务器** 需要告诉客户端在屏幕上显示什么。 + +让我们看看一个真正的程序,它在浏览器中运行一个远程终端,看看有哪些信息会被来回发送! + +### 我们将使用 goterm 来进行实验 + +我在 GitHub 上发现了这个叫做 [goterm][5] 的小程序,它运行一个 Go 服务器,可以让你在浏览器中使用 `xterm.js` 与终端进行交互。这个程序非常不安全,但它很简单,很适合学习。 + +我 [复刻了它][6],使它能与最新的 `xterm.js` 一起工作,因为它最后一次更新是在 6 年前。然后,我添加了一些日志语句,以打印出每次通过 WebSocket 发送/接收的字节数。 + +让我们来看看在几个不同的终端交互过程中的发送和接收情况吧! + +### 示例:ls + +首先,让我们运行 `ls`。下面是我在 `xterm.js` 终端上看到的情况: + +``` +~:/play$ ls +file +~:/play$ +``` + +以下是发送和接收的内容:(在我的代码中,我记录了每次客户端发送的字节:`sent: [bytes]`,每次它从服务器接收的字节:`recv: [bytes]`) + +``` +sent: "l" +recv: "l" +sent: "s" +recv: "s" +sent: "\r" +recv: "\r\n\x1b[?2004l\r" +recv: "file\r\n" +recv: "\x1b[~:/play$ " +``` + +我在这个输出中注意到 3 件事: + +1. 回显:客户端发送 `l`,然后立即收到一个 `l` 发送回来。我想这里的意思是,客户端真的很笨 —— 它不知道当我输入`l` 时,我想让 `l` 被回显到屏幕上。它必须由服务器进程明确地告诉它来显示它。 +2. 换行:当我按下回车键时,它发送了一个 `\r'(回车)符号,而不是 `\n'(换行)。 +3. 转义序列:`\x1b` 是 ASCII 转义字符,所以 `\x1b[?2004h` 是告诉终端显示什么或其他东西。我想这是一个颜色序列,但我不确定。我们稍后会详细讨论转义序列。 + +好了,现在我们来做一些稍微复杂的事情。 + +### 示例:Ctrl+C + +接下来,让我们看看当我们用 `Ctrl+C` 中断一个进程时会发生什么。下面是我在终端中看到的情况: + +``` +~:/play$ cat +^C +~:/play$ +``` + +而这里是客户端发送和接收的内容。 + +``` +sent: "c" +recv: "c" +sent: "a" +recv: "a" +sent: "t" +recv: "t" +sent: "\r" +recv: "\r\n\x1b[?2004l\r" +sent: "\x03" +recv: "^C" +recv: "\r\n" +recv: "\x1b[?2004h" +recv: "~:/play$ " +``` + +当我按下 `Ctrl+C` 时,客户端发送了 `\x03`。如果我查 ASCII 表,`\x03` 是 “文本结束”,这似乎很合理。我认为这真的很酷,因为我一直对 `Ctrl+C` 的工作原理有点困惑 —— 很高兴知道它只是在发送一个 `\x03` 字符。 + +我相信当我们按 `Ctrl+C` 时,`cat` 被中断的原因是服务器端的 Linux 内核收到这个 `\x03` 字符,识别出它意味着 “中断”,然后发送一个 `SIGINT` 到拥有伪终端的进程组。所以它是在内核而不是在用户空间处理的。 + +### 示例:Ctrl+D + +让我们试试完全相同的事情,只是用 `Ctrl+D`。下面是我在终端看到的情况: + +``` +~:/play$ cat +~:/play$ +``` + +而这里是发送和接收的内容: + +``` +sent: "c" +recv: "c" +sent: "a" +recv: "a" +sent: "t" +recv: "t" +sent: "\r" +recv: "\r\n\x1b[?2004l\r" +sent: "\x04" +recv: "\x1b[?2004h" +recv: "~:/play$ " +``` + +它与 `Ctrl+C` 非常相似,只是发送 `\x04` 而不是 `\x03`。很好!`\x04` 对应于 ASCII “传输结束”。 + +### Ctrl + 其它字母呢? + +接下来我开始好奇 —— 如果我发送 `Ctrl+e`,会发送什么字节? + +事实证明,这只是该字母在字母表中的编号,像这样。 + + * `Ctrl+a` => 1 + * `Ctrl+b` => 2 + * `Ctrl+c` => 3 + * `Ctrl+d` => 4 + * ... + * `Ctrl+z` => 26 + +另外,`Ctrl+Shift+b` 的作用与 `Ctrl+b` 完全相同(它写的是`0x2`)。 + +键盘上的其他键呢?下面是它们的映射情况: + + * `Tab` -> 0x9(与 `Ctrl+I` 相同,因为 I 是第 9 个字母) + * `Escape` -> `\x1b` + * `Backspace` -> `\x7f` + * `Home` -> `\x1b[H` + * `End` -> `\x1b[F` + * `Print Screen` -> `\x1b\x5b\x31\x3b\x35\x41` + * `Insert` -> `\x1b\x5b\x32\x7e` + * `Delete` -> `\x1b\x5b\x33\x7e` + * 我的 `Meta` 键完全没有作用 + +那 `Alt` 呢?根据我的实验(和一些搜索),似乎 `Alt` 和 `Escape` 在字面上是一样的,只是按 `Alt` 本身不会向终端发送任何字符,而按 `Escape` 本身会。所以: + + * `alt + d` => `\x1bd`(其他每个字母都一样) + * `alt + shift + d` => `\x1bD`(其他每个字母都一样) + * 诸如此类 + +让我们再看一个例子! + +### 示例:nano + +下面是我运行文本编辑器 `nano` 时发送和接收的内容: + +``` +recv: "\r\x1b[~:/play$ " +sent: "n" [[]byte{0x6e}] +recv: "n" +sent: "a" [[]byte{0x61}] +recv: "a" +sent: "n" [[]byte{0x6e}] +recv: "n" +sent: "o" [[]byte{0x6f}] +recv: "o" +sent: "\r" [[]byte{0xd}] +recv: "\r\n\x1b[?2004l\r" +recv: "\x1b[?2004h" +recv: "\x1b[?1049h\x1b[22;0;0t\x1b[1;16r\x1b(B\x1b[m\x1b[4l\x1b[?7h\x1b[39;49m\x1b[?1h\x1b=\x1b[?1h\x1b=\x1b[?25l" +recv: "\x1b[39;49m\x1b(B\x1b[m\x1b[H\x1b[2J" +recv: "\x1b(B\x1b[0;7m GNU nano 6.2 \x1b[44bNew Buffer \x1b[53b \x1b[1;123H\x1b(B\x1b[m\x1b[14;38H\x1b(B\x1b[0;7m[ Welcome to nano. For basic help, type Ctrl+G. ]\x1b(B\x1b[m\r\x1b[15d\x1b(B\x1b[0;7m^G\x1b(B\x1b[m Help\x1b[15;16H\x1b(B\x1b[0;7m^O\x1b(B\x1b[m Write Out \x1b(B\x1b[0;7m^W\x1b(B\x1b[m Where Is \x1b(B\x1b[0;7m^K\x1b(B\x1b[m Cut\x1b[15;61H" +``` + +你可以看到一些来自用户界面的文字,如 “GNU nano 6.2”,而这些 `\x1b[27m` 的东西是转义序列。让我们来谈谈转义序列吧! + +### ANSI 转义序列 + +上面这些 `nano` 发给客户端的 `\x1b[` 东西被称为“转义序列”或 “转义代码”。这是因为它们都是以 “转义”字符 `\x1b` 开头。它们可以改变光标的位置,使文本变成粗体或下划线,改变颜色,等等。[维基百科介绍了一些历史][7],如果你有兴趣的话可以去看看。 + +举个简单的例子:如果你在终端运行 + +``` +echo -e '\e[0;31mhi\e[0m there' +``` + +它将打印出 “hi there”,其中 “hi” 是红色的,“there” 是黑色的。[本页][8] 有一些关于颜色和格式化的转义代码的例子。 + +我认为有几个不同的转义代码标准,但我的理解是,人们在 Unix 上使用的最常见的转义代码集来自 VT100(博客文章顶部图片中的那个老终端),在过去的 40 年里没有真正改变。 + +转义代码是为什么你的终端会被搞乱的原因,如果你 `cat` 一些二进制数据到你的屏幕上 —— 通常你会不小心打印出一堆随机的转义代码,这将搞乱你的终端 —— 如果你 `cat` 足够多的二进制数据到你的终端,那里一定会有一个 `0x1b` 的字节。 + +### 可以手动输入转义序列吗? + +在前面几节中,我们谈到了 `Home` 键是如何映射到 `\x1b[H` 的。这 3 个字节是 `Escape + [ + H`(因为 `Escape` 是`\x1b`)。 + +如果我在 `xterm.js` 终端手动键入 `Escape` ,然后是 `[`,然后是 `H`,我就会出现在行的开头,与我按下 `Home` 完全一样。 + +我注意到这在我的电脑上的 Fish shell 中不起作用 —— 如果我键入 `Escape`,然后输入 `[`,它只是打印出 `[`,而不是让我继续转义序列。我问了我的朋友 Jesse,他写过 [一堆 Rust 终端代码][9],Jesse 告诉我,很多程序为转义代码实现了一个 **超时** —— 如果你在某个最小的时间内没有按下另一个键,它就会决定它实际上不再是一个转义代码了。 + +显然,这在 Fish shell 中可以用 `fish_escape_delay_ms` 来配置,所以我运行了 `set fish_escape_delay_ms 1000`,然后我就能用手输入转义代码了。工作的很好! + +### 终端编码有点奇怪 + +我想在这里暂停一下,我觉得你按下的键被映射到字节的方式是非常奇怪的。比如,如果我们今天从头开始设计按键的编码方式,我们可能不会把它设置成这样: + + * `Ctrl + a` 和 `Ctrl + Shift + a` 做的事情完全一样。 + * `Alt` 与 `Escape` 是一样的 + * 控制序列(如颜色/移动光标)使用与 `Escape` 键相同的字节,因此你需要依靠时间来确定它是一个控制序列还是用户只是想按 `Escape`。 + +但所有这些都是在 70 年代或 80 年代或什么时候设计的,然后需要永远保持不变,以便向后兼容,所以这就是我们得到的东西 :) + +### 改变窗口大小 + +在终端中,并不是所有你能做的事情都是通过来回发送字节发生的。例如,当终端被调整大小时,我们必须以不同的方式告诉 Linux 窗口大小已经改变。 + +下面是 [goterm][10] 中用来做这件事的 Go 代码的样子: + +``` +syscall.Syscall( + syscall.SYS_IOCTL, + tty.Fd(), + syscall.TIOCSWINSZ, + uintptr(unsafe.Pointer(&resizeMessage)), +) +``` + +这是在使用 `ioctl` 系统调用。我对 `ioctl` 的理解是,它是一个系统调用,用于处理其他系统调用没有涉及到的一些随机的东西,通常与 IO 有关,我猜。 + +`syscall.TIOCSWINSZ` 是一个整数常数,它告诉 `ioctl` 我们希望它在本例中做哪件事(改变终端的窗口大小)。 + +### 这也是 xterm 的工作方式。 + +在这篇文章中,我们一直在讨论远程终端,即客户端和服务器在不同的计算机上。但实际上,如果你使用像 xterm 这样的终端模拟器,所有这些工作方式都是完全一样的,只是很难注意到,因为这些字节并不是通过网络连接发送的。 + +### 文章到此结束啦 + +关于终端,肯定还有很多东西要了解(我们可以讨论更多关于颜色,或者原始与熟化模式,或者 Unicode 支持,或者 Linux 伪终端界面),但我将在这里停止,因为现在是晚上 10 点,这篇文章有点长,而且我认为我的大脑今天无法处理更多关于终端的新信息。 + +感谢 [Jesse Luehrs][11] 回答了我关于终端的十亿个问题,所有的错误都是我的 :) + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2022/07/20/pseudoterminals/ + +作者:[Julia Evans][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://xtermjs.org/ +[2]: https://upload.wikimedia.org/wikipedia/commons/thumb/9/99/DEC_VT100_terminal.jpg/512px-DEC_VT100_terminal.jpg +[3]: https://commons.wikimedia.org/wiki/File:DEC_VT100_terminal.jpg (Jason Scott, CC BY 2.0 , via Wikimedia Commons) +[4]: https://livingcomputers.org/ +[5]: https://github.com/freman/goterm +[6]: https://github.com/jvns/goterm +[7]: https://en.wikipedia.org/wiki/ANSI_escape_code +[8]: https://misc.flogisoft.com/bash/tip_colors_and_formatting +[9]: https://github.com/doy/vt100-rust +[10]: https://github.com/freman/goterm/blob/a644c10e180ce8af789ea3e4e4892dcf078e97e2/main.go#L110-L115 +[11]: https://github.com/doy/ diff --git a/published/20220721 Dell XPS 13 Plus -Developer Edition- Gets Certified for Ubuntu 22.04 LTS.md b/published/202207/20220721 Dell XPS 13 Plus -Developer Edition- Gets Certified for Ubuntu 22.04 LTS.md similarity index 100% rename from published/20220721 Dell XPS 13 Plus -Developer Edition- Gets Certified for Ubuntu 22.04 LTS.md rename to published/202207/20220721 Dell XPS 13 Plus -Developer Edition- Gets Certified for Ubuntu 22.04 LTS.md diff --git a/published/202207/20220726 Debian May Consider Including Non-Free Firmware in Official Releases.md b/published/202207/20220726 Debian May Consider Including Non-Free Firmware in Official Releases.md new file mode 100644 index 0000000000..ac911d46d4 --- /dev/null +++ b/published/202207/20220726 Debian May Consider Including Non-Free Firmware in Official Releases.md @@ -0,0 +1,71 @@ +[#]: subject: "Debian May Consider Including Non-Free Firmware in Official Releases" +[#]: via: "https://news.itsfoss.com/debian-non-free/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14873-1.html" + +Debian 可能会考虑在官方版本中包含非自由固件 +====== + +> Debian 会考虑在官方版本中添加非自由固件吗?如果他们想解决 Debian 开发人员重点提出的问题,这似乎是一种可能性。 + +![debian][1] + +由于 Debian 的稳定性和新功能之间的平衡,它是最受欢迎的 Linux 发行版之一。 + +此外,它不附带任何非自由固件。 + +但是,对于想要在较新硬件上使用 Debian 的用户来说,这已成为一个问题。 + +大多数最新的设备和配置都需要非自由固件才能正常工作,其中包括 Wi-Fi、图形等。 + +为了解决这个问题,Debian 开发人员、前 Debian 项目负责人 Steve McIntyre 已经积极讨论了一段时间。 + +正如 [Geeker's Digest][2] 所发现的,在 DebConf 22 会议上,Steve 最近向用户和开发人员着重谈到了修复固件混乱这件事。 + +### 在官方版本中包含非自由固件 + +至于目前的情况,你可以找到带有非自由固件的非官方 Debian 镜像。 + +然而,并不是每个用户都知道它,即使它在 Debian 的下载页面上被宣传,“非官方”也不是用户更喜欢推荐的镜像的东西。 + +此外,当用户可以选择 Ubuntu 或任何基于 Ubuntu 的发行版作为替代方案时,期望用户安装非自由固件也是违反直觉的。 + +不仅限于这些问题,Steve 在他的 [博客][3] 中还提到了其他一些问题,包括: + +* 维护单独的非自由镜像非常耗时。 +* 由于缺乏非自由固件,许多用户不喜欢官方镜像。 + +如果我们希望更多用户在通用硬件上使用 Debian,Steve 建议尽早解决这个问题。 + +可能会通过安装程序中的提示让用户安装非自由固件,类似于 Ubuntu 所做的。 + +此外,在他在 DebConf 22 的演讲中,似乎大多数开发人员投票支持在官方 Debian 镜像中添加非自由固件。 + +随着他重点提出这件事,Steve 得到了寻找解决这个问题的社区用户/开发人员的更多关注。 + +**简单/方便的出路**:在官方发布的镜像中添加非自由固件。 + +那么,Debian 最终会在其新版本中添加对非自由固件的支持吗? Debian 12 会让这成为现实吗? + +在下面的评论中分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/debian-non-free/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/07/debian-non-free-firmware.jpg +[2]: https://www.geekersdigest.com/debian-on-the-verge-to-include-non-free-firmware-in-official-releases/ +[3]: https://blog.einval.com/2022/04/19#firmware-what-do-we-do diff --git a/published/202207/20220727 Pop!_OS 22.04 Linux Distro is Finally Adding Raspberry Pi 4 Support.md b/published/202207/20220727 Pop!_OS 22.04 Linux Distro is Finally Adding Raspberry Pi 4 Support.md new file mode 100644 index 0000000000..ac4bd0efb9 --- /dev/null +++ b/published/202207/20220727 Pop!_OS 22.04 Linux Distro is Finally Adding Raspberry Pi 4 Support.md @@ -0,0 +1,70 @@ +[#]: subject: "Pop!_OS 22.04 Linux Distro is Finally Adding Raspberry Pi 4 Support" +[#]: via: "https://news.itsfoss.com/pop-os-22-04-raspberry-pi-4/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14880-1.html" + +Pop!_OS 22.04 Linux 发行版现在支持树莓派 4 了 +====== + +> System76 终于为其最新的 Pop!_OS 22.04 LTS 增加了对树莓派 4 的支持。 + +![Pop os][1] + +Pop!_OS 是 [最好的初学者友好的 Linux 发行版][2] 之一。 + +它基于 Ubuntu,显然,Pop!_OS 22.04 LTS 是基于 [Ubuntu 22.04 LTS][3] 的。 + +然而,与 Ubuntu 不同,Pop!_OS 22.04 在发布时并没有正式支持树莓派。 + +因此,期待 [Pop!_OS 22.04 LTS][4] 版本对树莓派的支持是合理的。 + +如果你还记得,System76 在 **Pop!_OS 21.10** 中首次增加了对树莓派的支持。我们在测试时也 [报道过][5]。 + +而且,据 System76 的首席工程师 Jeremy Soller 透露, System76 最新的 Pop!_OS 版本现在正准备支持树莓派 4。 + +### Pop!_OS 22.04 LTS for Raspberry Pi 4 + +如果你一直在你的树莓派 4 上使用 Pop!_OS 21.10,这对你来说是个好消息。 + +而且,对于任何想在树莓派 4 上尝试 Pop!_OS 的人来说,它终于有了一个 LTS 版本。 + +截至目前,该 ISO 是作为技术预览版提供的。因此,如果你想试试它,你应该有出现错误和可用性问题的心理预期。请注意,目前还 **只限于树莓派 4**,不支持其他树莓派设备,这是个遗憾。 + +我们不知道 System76 是否计划在这个 LTS 版本中支持其他树莓派板,或者他们是否坚持只支持树莓派 4。 + +然而,考虑到树莓派 4 现在相当流行,对于许多寻求替代 Ubuntu 的 [树莓派的替代操作系统][6] 的爱好者们来说,这应该是一个很好的进展。 + +有了 Pop!_OS 22.04 LTS,树莓派 4 的用户应该能够体验到一些最令人兴奋的升级,以及更新的 [Linux 内核 5.15 LTS][7]。 + +要下载该技术预览版,请前往 Pop!_OS 的 [官方网站][8],点击下载按钮,找到该选项。 + +![Pop OS][9] + +你对树莓派 4 上的 Pop!_OS 22.04 有什么期望?请在下面的评论中告诉我们你的想法。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/pop-os-22-04-raspberry-pi-4/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/07/pop-os-raspberry-pi-4.jpg +[2]: https://itsfoss.com/best-linux-beginners/ +[3]: https://news.itsfoss.com/ubuntu-22-04-release/ +[4]: https://news.itsfoss.com/pop-os-22-04-release/ +[5]: https://news.itsfoss.com/pop-os-raspberry-pi-coming-soon/ +[6]: https://itsfoss.com/raspberry-pi-os/ +[7]: https://news.itsfoss.com/linux-kernel-5-15-release/ +[8]: https://pop.system76.com/ +[9]: https://news.itsfoss.com/wp-content/uploads/2022/07/pop-os-raspberry-pi-4-download-1024x526.png diff --git a/published/202207/20220728 It-s Time to Ditch 32-Bit Linux for 64-Bit.md b/published/202207/20220728 It-s Time to Ditch 32-Bit Linux for 64-Bit.md new file mode 100644 index 0000000000..594a70e68d --- /dev/null +++ b/published/202207/20220728 It-s Time to Ditch 32-Bit Linux for 64-Bit.md @@ -0,0 +1,86 @@ +[#]: subject: "It’s Time to Ditch 32-Bit Linux for 64-Bit" +[#]: via: "https://news.itsfoss.com/64-bit-linux/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14876-1.html" + +是时候抛弃 32 位的 Linux,改用 64 位的了 +====== + +> 如果你想获得安全的体验,你可能不会再继续使用 32 位 Linux 内核。 + +![](https://news.itsfoss.com/wp-content/uploads/2022/07/linux-64-bit.jpg) + +我们有很多 [为 32 位系统定制的 Linux 发行版][1]。 + +那么,为什么我想要不鼓励使用 32 位,而升级到 64 位 Linux 呢? + +有几个原因,其中一个最大的原因,在本周引发了很多关注。 + +### 32 位:古老的电子垃圾硬件? + +没错,与其他操作系统不同的是,Linux 发行版允许你重新利用旧硬件。 + +你能够将一个老机器转换为 [媒体服务器][2]、存储服务器,等等。 + +在这里,我并不是要给你一些如何贡献更多的电子垃圾的思路。尽可能长地利用你的硬件,而不更换它们总是好的。 + +然而,不使用 32 位系统的理由可能比以往更有说服力。关键的问题是在安全和维护方面。 + +### 利用 64 位 Linux 提高安全性 + +2018 年,危险的处理器安全问题 Spectre 漏洞引发了热议。虽然英特尔和 AMD 对这个漏洞进行了修复,但情况并不乐观。 + +不幸的是,一个新的漏洞 Retbleed,它是 Spectre 的一个变种,正在影响英特尔和 AMD 芯片。 + +你可以在下面由发现它的研究人员分享的视频中看到它的情况。 + +![][3] + +因此,我们自然需要适当的措施来解决这个新的安全漏洞的修复问题。 + +**令人震惊的事情来了**。64 位 Linux 内核已经收到了对它的修复,以保护有关的英特尔/AMD 的处理器。但是,正如 [Phoronix][4] 所报道的,Linux 32 位内核仍然容易受到 Retbleed 漏洞的影响。 + +英特尔的 Pawan Gupta 在 [内核邮件列表][5] 中回应了这些担忧,他提到: + +> 英特尔不知道还有谁在 Skylake 那一代的 CPU 上使用 32 位模式的生产环境。所以这不应该是一个问题。 + +另外,很少看到为 32 位维护所做的任何努力。所以,这应该不算什么意外。 + +因此,如果你使用你的系统进行任何可能受到安全问题影响的任务,你应该避开 32 位内核。 + +当然,如果你有一个完全离线的环境可以算做例外。所以,你可以这样做,但不建议这样做。 + +### 不关心安全问题? + +即使你认为得不到像 Retbleed 这样的关键安全修复没有关系,2022 年的 32 位系统也会有更多的麻烦。 + +软件维护者们最终会放弃对 32 位系统上的工具和 Linux 发行版的更新。 + +因此,你的 32 位 Linux 系统可能很快就不会再有积极维护的程序了。 + +因此,现在进行转换(和升级)将是一个好主意。 + +_你还在使用 32 位的 Linux 吗?你对此有什么看法?在下面的评论中分享你的想法。_ + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/64-bit-linux/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/32-bit-linux-distributions/ +[2]: https://itsfoss.com/best-linux-media-server/ +[3]: https://i.ytimg.com/vi/dmSPvJxPm80/hqdefault.jpg +[4]: https://www.phoronix.com/news/Linux-x86-Retbleed +[5]: https://lore.kernel.org/lkml/20220715221901.xm3c4w4idqt67uja@desk/ diff --git a/published/20220716 How to Clean Up Snap Versions to Free Up Disk Space.md b/published/20220716 How to Clean Up Snap Versions to Free Up Disk Space.md new file mode 100644 index 0000000000..22831f875e --- /dev/null +++ b/published/20220716 How to Clean Up Snap Versions to Free Up Disk Space.md @@ -0,0 +1,108 @@ +[#]: subject: "How to Clean Up Snap Versions to Free Up Disk Space" +[#]: via: "https://www.debugpoint.com/clean-up-snap/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14904-1.html" + +如何清理 Snap 保留的旧软件包以释放磁盘空间 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/07/105824nyac4m66a6886x6q.jpg) + +> 这个带有脚本的快速指南有助于清理旧的 Snap 软件包,并释放 Ubuntu 系统中的一些磁盘空间。 + +我的 Ubuntu 测试系统中出现磁盘空间不足。因此,我通过 GNOME 的磁盘使用分析器进行调查,以找出哪个软件包正在消耗宝贵的 SSD 空间。除了通常的缓存和主目录,令我惊讶的是,我发现 Snap 和 Flatpak 消耗了大量的存储空间。 + +![Snap size – before cleanup][1] + +我始终坚持一个规则:除非必要,否则不要使用 Snap 或 Flatpak。这主要是因为它们的安装大小和一些其他问题。我更喜欢原生 deb 和 rpm 包。多年来,我在这个测试系统中安装和移除了一些 Snap 包。 + +问题出现在卸载后。Snap 在系统中保留了一些残留文件,而一般用户不知道。 + +所以我打开了 Snap 文件夹 `/var/lib/snapd/snaps`,发现 Snap 会保留以前安装/卸载的软件包的旧版本。 + +例如,在下图中,你可以看到 GNOME 3.28、3.34 和 Wine 这些都被删除了。但它们还在那里。这是因为 Snap 设计上在正确卸载后保留已卸载软件包的版本。 + +![Files under snaps directory][2] + +或者,你可以在终端中使用: + +``` +snap list --all +``` + +![snap list all][3] + +对于保留的版本数量,默认值为 3。这意味着 Snap 会保留每个软件包的 3 个旧版本,包括当前安装版本。如果你对磁盘空间没有限制,这是可以的。 + +但是对于服务器和其他场景,这很容易遇到成本问题,消耗你的磁盘空间。 + +不过,你可以使用以下命令轻松修改计数。该值可以在 2 到 20 之间。 + +``` +sudo snap set system refresh.retain=2 +``` + +### 清理 Snap 版本 + +在 SuperUser 的一篇文章中,Canonical 的前工程经理 Popey [提供了一个简单的脚本][4] 可以清理旧的 Snap 版本并保留最新版本。 + +这是我们将用来清理 Snap 的脚本。 + +``` +#!/bin/bash + #Removes old revisions of snaps + #CLOSE ALL SNAPS BEFORE RUNNING THIS + set -eu + LANG=en_US.UTF-8 snap list --all | awk '/disabled/{print $1, $3}' | + while read snapname revision; do + snap remove "$snapname" --revision="$revision" + done +``` + +将上述脚本以 .sh 格式保存在目录中(例如 `clean_snap.sh`),赋予其可执行权限并运行。 + +``` +chmod +x clean_snap.sh +``` + +当我运行脚本时,它减少了很多磁盘空间。该脚本还将显示要删除的包的名称。 + +![Executing the script][5] + +![Snaps size after cleanup][6] + +### 结束语 + +关于 Snap 的设计效率如何,人们总是争论不休。许多人说,它的设计是糟糕的,是臃肿的,且消耗系统资源。该论点的某些部分是正确的,我不会否认。如果正确实施和增强,沙盒应用的整个概念就很棒。我相信,与 Snap 相比,Flatpak 做得更好。 + +也就是说,我希望这可以帮助你清理一些磁盘空间。尽管它只在 Ubuntu 中进行了测试,但它应该适用于所有支持 Snap 的 Linux 发行版。 + +此外,请查看我们关于 [如何清理 Ubuntu][7] 的指南以及其他步骤。 + +最后,如果你正在寻找清理 **Flatpak** 应用,请参阅 [这个指南][8]。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/clean-up-snap/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2021/03/Snap-size-before-cleanup.jpg +[2]: https://www.debugpoint.com/wp-content/uploads/2021/03/Files-under-snaps-directory.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2021/03/snap-list-all.jpg +[4]: https://superuser.com/a/1330590 +[5]: https://www.debugpoint.com/wp-content/uploads/2021/03/Executing-the-script.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2021/03/Snaps-size-after-cleanup.jpg +[7]: https://www.debugpoint.com/2018/07/4-simple-steps-clean-ubuntu-system-linux/ +[8]: https://www.debugpoint.com/clean-up-flatpak/ diff --git a/published/20220718 AppFlowy- An Open-Source Alternative to Notion.md b/published/20220718 AppFlowy- An Open-Source Alternative to Notion.md new file mode 100644 index 0000000000..3775e83c7f --- /dev/null +++ b/published/20220718 AppFlowy- An Open-Source Alternative to Notion.md @@ -0,0 +1,167 @@ +[#]: subject: "AppFlowy: An Open-Source Alternative to Notion" +[#]: via: "https://itsfoss.com/appflowy/" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14888-1.html" + +AppFlowy:Notion 的开源替代品 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/02/102316f1g6p369uyeeybgo.jpg) + +> AppFlowy 旨在成为 Notion 的开源替代品,为你提供更好的隐私保护。让我们了解一下它。 + +虽然项目管理/笔记工具 Notion 功能非常出色,但它并不是一个开源解决方案。此外,它没有 Linux 桌面客户端。 + +那么,对于 Linux 用户来说,更透明、更私密和可用的替代方案是什么? + +这就是 AppFlowy 大放异彩的地方! + +AppFlowy 使用 Rust 和 Flutter 构建,遵循极简原则,但提供了足够的调整空间。 + +### AppFlowy 是隐私和用户体验的完美结合 + +![appflowy][1] + +AppFlowy 是相当新的。在它去年首次推出后,我们曾 [报告][2] 了它的发展状况。 + +这是一个开源项目,旨在克服 [Notion][3] 在安全和隐私方面的一些限制。它可以帮助你管理任务、添加待办事项列表、截止日期、跟踪事件、添加页面,以及为你的笔记/任务设置文本格式。 + +不仅仅是安全性。用户体验也很重要。而 AppFlowy 在这方面做得很好,甚至比 Notion 更好。 + +请注意,该项目仍处于 **测试阶段**。 + +目前,该项目的目标不是提供更好的设计和功能,而是数据隐私、原生体验和社区驱动。 + +### Notion 与 AppFlowy,如何选择? + +虽然它旨在作为取代 Notion 的开源解决方案,但它可能并不适合所有人。 + +因此,如果你要选择 AppFlowy 而不是 Notion,你将获得以下好处: + +#### 透明度 + +AppFlowy 是一个开源项目,因此你可以随时查看和修改代码。 + +#### 隐私 + +作为闭源软件,Notion 可以直接访问你在云中的私有数据。与之相比,你可以根据自己的喜好自行托管 AppFlowy。 + +你的所有个人数据都将保留在你身边,你可以完全控制它。开发人员还提到他们正在使用离线模式来更好的支持本地安装。 + +#### 性能和原生体验 + +AppFlowy 使用 Rust 和 Flutter 构建,在提供现代用户体验的同时将性能置于优先位置。 + +不仅限于此,你还可以在 Linux 上获得良好的原生体验,这是 Notion 所没有的。 + +### AppFlowy 的功能 + +![appflowy screenshot 1][4] + +AppFlowy 在功能方面可能并不优越,但它确实提供了基本的功能。 + +随着开发的继续,你可以期待它会添加更多的功能。一些现有的功能包括: + +* 原生的跨平台支持。 +* 能够自行托管或将其安装在你的本地计算机上。 +* 可定制。 +* 数据隐私(重中之重)。 +* 单一代码库,便于更好地维护。 +* 社区驱动的可扩展性。 +* 简约的用户界面。 +* 可以添加待办事项、管理任务。 +* 文本高亮和基本的格式化。 +* 用于编辑单元格/网格的键盘快捷键。 +* 支持深色模式。 + +#### 在 Linux 上安装 AppFlowy + +由于它仍处于测试阶段,在默认仓库中还不可用,并且没有维护任何 PPA,也没有 Flatpak/Snap 包。 + +但是,你可以通过给定的命令轻松安装 AppFlowy(仅在 Ubuntu 20.04 LTS 和 Arch X86_64 上测试过): + +``` +wget https://github.com/AppFlowy-IO/AppFlowy/releases/download/0.0.4/AppFlowy-linux-x86.tar.gz +tar -xzvf AppFlowy-linux-x86.tar.gz +cd AppFlowy +``` + +要运行 AppFlowy,请使用该命令: + +``` +./app_flowy +``` + +要在你的系统菜单中注册 AppFlowy,你必须执行以下附加步骤: + +首先,你必须更改 AppFlowy 徽标的默认名称: + +``` +mv flowy_logo.svg app_flowy.svg +``` + +现在,你必须将 Linux 桌面文件模板复制为正式的 Linux 桌面文件。 + +``` +cp appflowy.desktop.temp app_flowy.desktop +``` + +然后对配置文件进行一些更改。 + +``` +sudo nano appflowy.desktop +``` + +在这里,你必须将 `[CHANGE_THIS]` 替换为图标和可执行文件的对应路径。 + +![add location of icon and exec file][5] + +使用 `CTRL + O` 保存更改并使用 `CTRL + X` 退出。 + +最后,移动桌面文件,以便你的系统可以读取它。 + +``` +mv app_flowy.desktop ~/.local/share/applications/. +``` + +它应该是这样的: + +![appflowy in system menu][6] + +无论哪种情况,你都可以查看 AppFlowy 的 [官方文档][7] 以从源代码构建它。在其官方网站上了解更多关于它的信息。 + +> **[AppFlowy][8]** + +### 总结 + +如果你需要具有原生 Linux 体验的简单的类 Notion 应用,AppFlowy 是一个有趣的选择。 + +考虑到它正在积极开发中,并且远非 Notion 的完全替代品,肯定会出现一些错误/问题。 + +作为 Notion 的开源替代品?它可以的!你可以使用它来管理任务、添加笔记和制作待办事项列表。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/appflowy/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2022/07/AppFlowy.png +[2]: https://news.itsfoss.com/appflowy-development/ +[3]: https://www.notion.so/ +[4]: https://itsfoss.com/wp-content/uploads/2022/07/appflowy-screenshot-1.png +[5]: https://itsfoss.com/wp-content/uploads/2022/07/Add-location-of-icon-and-exec-file-800x524.png +[6]: https://itsfoss.com/wp-content/uploads/2022/07/AppFlowy-in-System-menu-1.png +[7]: https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy/software-contributions/environment-setup/building-on-linux +[8]: https://www.appflowy.io/ diff --git a/published/20220718 How to Install Rocky Linux 9 Step by Step with Screenshots.md b/published/20220718 How to Install Rocky Linux 9 Step by Step with Screenshots.md new file mode 100644 index 0000000000..077a9f1326 --- /dev/null +++ b/published/20220718 How to Install Rocky Linux 9 Step by Step with Screenshots.md @@ -0,0 +1,216 @@ +[#]: subject: "How to Install Rocky Linux 9 Step by Step with Screenshots" +[#]: via: "https://www.linuxtechi.com/how-to-install-rocky-linux-9-step-by-step/" +[#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/" +[#]: collector: "lkxed" +[#]: translator: "robsean" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14909-1.html" + +图解 Rocky Linux 9 安装步骤 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/08/172822s7zwhj7wuzzjfm25.jpg) + +> 这篇教程中,我们将图解 Rocky Linux 9 安装步骤。 + +Rocky 企业软件基金会Rocky Enterprise Software Foundation 已经发布了它的最新的操作系统 “Rocky Linux 9”。Rocky Linux 是针对工作站和服务器的自由而开源的操作系统。它被认为是 CentOS Linux 的继承者。 + +Rocky Linux 9 是 RHEL 9 的复制品,其开发代号是“Blue Onyx”。Rocky Linux 和 RHEL 之间的主要不同是,它有它自己的名为 “Peridot” 的开源构建系统。 + +### Rocky Linux 9 的更新和特色 + +* Gnome 40 是默认的桌面环境 +* 在 XFS 文件系统上支持直接访问Direct Access(DAX)操作 +* 更新了运行时和编译器,如 GCC 11.2.1 、LLVM 13.0.1 、Rust 1.58.1 和 Go 1.17.1 +* 更新了开发工具链,如 Python 3.9 、Node.js 16 、Ruby 3.0.3 、Perl 5.32 和 PHP 8.0 +* ssh 默认禁用了 root 用户身份验证 +* 更新了 OpenSSL 3.0,改进了 Cockpit 网页主控台 +* 社区提供支持到 2032 年 05 月 31 日 + +### 前置条件 + +* 2 GB 及更多的内存 +* 2 个 CPU 核心(1.1 GHz 及更高) +* 20 GB 硬盘空间 +* 可启动介质(USD 或 DVD) +* 互联网连接(可选) + +不再耽误时间,让我们直接进入 Rocky Linux 9 的安装步骤: + +### 1、下载 Rocky Linux 9 的 ISO 文件 + +使用下面的官方网址来下载 ISO 文件 + +> **[Rocky Linux 9 ISO][1]** + +在你下载 ISO 文件后,使用已下载的 ISO 文件制作一个可启动介质(USB/DVD)。 + +在 Windows 中,你可以利用 Rufus 软件来使用 ISO 文件来制作可启动 USB 驱动器。在 Linux 中,参考下面的内容: + +> **[在 Ubuntu / Linux Mint 上,如何创建可启动 USB 驱动器][2]** + +### 2、使用可启动媒介盘启动系统 + +在你计划安装 Rocky Linux 9 的硬件系统上,BIOS 设置中将可启动介质从硬盘驱动器更改为 USB 驱动器, 重新启动它。 + +在硬件系统使用可启动介质启动后,我们将看到下面的屏幕, + +![Select-Install-Rocky-Linux-9-option][3] + +选择第一个选项, 安装 Rocky Linux 9.0Install Rocky Linux 9.0 ,并按下 回车enter 按键。 + +### 3、选择首选语言 + +选择**安装过程**的首选语言,然后单击 继续Continue 按钮, + +![Preferred-Language-for-RockyLinux9-Installation][4] + +### 4、安装过程摘要 + +在这个步骤中,我们将看到如下的初始安装摘要。要开始安装,首先,我们必须完成标记项目,如 安装目标Installation Destination用户设置User settings。 + +除了已标记的项目外,我们也可以更改现有的项目,只需要按照你的要求单击它们就可以进行更改。 + +![Initial-Installation-Summary-Rocky-Linux9][5] + +#### 配置安装目标 + +在这个项目中,我们将为 Rocky Linux 具体指定分区方案。单击 安装目标Installation Destination。 + +在这里,我们可以为 存储配置storage configuration分区方案partition scheme 选择 自动automatic 选项或 自定义custom 选项。 + +在自动选项中,安装程序将在磁盘上自动地创建分区,而自定义选项允许我们在磁盘上手动创建分区。 + +![Choose-custom-Storage-Configuration-Rocky-Linux9][6] + +在这篇指南中,我将使用 自定义Custom 选项,单击 执行Done 按钮。 + +![Standard-Partition-Scheme-RockyLinux9][7] + +在该 40 GB 的磁盘上,我们将创建以下分区, + +* `/boot`:2GB(xfs 文件系统) +* `/`:10 GB(xfs 文件系统) +* `/home`:25 GB(xfs 文件系统) +* 交换分区:2 GB + +开始创建分区,选择 标准分区Standard Partition 方案,然后单击 “+” 符号。 + +创建第一个分区,大小为 2 GB 的 `/boot` 分区, + +![Boot-Partition-RockyLinux9-Installation][8] + +单击 添加挂载点Add mount point 按钮。 + +类似地,接下来分别创建大小为 10 GB 的 `/` 分区和 25 GB 的 `/home` 分区。 + +![Slash-Partition-Rocky-Linux9-installation][9] + +![Home-Partition-Rocky-Linux9-Installation][10] + +现在,创建最后一个分区,大小为 2 GB 的交换分区,(LCTT 校注:如果你的内存非常多,你可以选择不创建交换分区。另外,对于生产环境,建议将存储数据的目录单独划分分区。) + +![Swap-Partition-RockyLinux9-Installation][11] + +在你完成手动分区后,单击 执行Done 按钮来完成这个项目。 + +![Finish-Manual-Partitioning-RockyLinux9-Installation][12] + +选择 接受更改Accept Changes 按钮来将这些更改写入磁盘。它也将返回到安装摘要屏幕。 + +![Accept-Changes-to-Write-on-Disk-RockyLinux9][13] + +#### 配置用户设置 + +在 用户设置User Settings 下,单击 root 密码 Root Password 按钮。 + +![Set-Root-Password-RockyLinux9-Instalation][14] + +设置 root 用户的密码,并单击 执行Done 按钮。 + +再次回到 用户设置User Settings 下,单击 用户创建User Creation 按钮,具体指定本地用户的详细信息,例如用户名称和密码。 + +![Local-User-Create-During-RockyLinux9-Installation][15] + +单击 执行Done 按钮,它也将返回到安装摘要。 + +现在,我们准备开始安装,单击开始安装Begin Installation 按钮, + +![Begin-Installation-Option-RockyLinux9][16] + +### 5、安装过程开始 + +在这一步骤中,安装程序已经开始了,并在正在进行中, + +![RockyLinux9-Installation-Progress][17] + +在安装过程完成后,安装程序将提示你重新启动系统。 + +![Reboot-System-after-RockyLinux9-Installation][18] + +单击 重新启动系统Reboot System 按钮。 + +注意:不要忘记在 BIOS 设置中将可启动介质从 USB 启动更改为硬盘驱动器启动。 + +### 6、安装后的登录屏幕和桌面环境 + +在成功安装后,当系统启动时,我们将看到下面的登录屏幕: + +![RockyLinux9-Loginscreen-Post-Installation][19] + +使用我们在安装期间创建的用户名称和密码,按下 回车enter 按键来登录。 + +![Desktop-Env-RockyLinux9][20] + +打开终端,依次运行下面的命令: + +``` +$ sudo dnf install epel-release -y +$ sudo dnf install neofetch -y +``` + +现在,来验证系统的详细信息,运行 `neofetch` 命令: + +``` +$ neofetch +``` + +![neofetch-rockylinux9-post-installation][21] + +这就是这篇指南的全部内容,我希望它对你有用。请在下面的评论区贴出你的疑问和反馈。 + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/how-to-install-rocky-linux-9-step-by-step/ + +作者:[Pradeep Kumar][a] +选题:[lkxed][b] +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/pradeep/ +[b]: https://github.com/lkxed +[1]: https://rockylinux.org/download +[2]: https://www.linuxtechi.com/create-bootable-usb-disk-dvd-ubuntu-linux-mint/ +[3]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Select-Install-Rocky-Linux-9-option.png +[4]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Preferred-Language-for-RockyLinux9-Installation.png +[5]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Initial-Installation-Summary-Rocky-Linux9.png +[6]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Choose-custom-Storage-Configuration-Rocky-Linux9.png +[7]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Standard-Partition-Scheme-RockyLinux9.png +[8]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Boot-Partition-RockyLinux9-Installation.png +[9]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Slash-Partition-Rocky-Linux9-installation.png +[10]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Home-Partition-Rocky-Linux9-Installation.png +[11]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Swap-Partition-RockyLinux9-Installation.png +[12]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Finish-Manual-Partitioning-RockyLinux9-Installation.png +[13]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Accept-Changes-to-Write-on-Disk-RockyLinux9.png +[14]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Set-Root-Password-RockyLinux9-Instalation.png +[15]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Local-User-Create-During-RockyLinux9-Installation.png +[16]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Begin-Installation-Option-RockyLinux9.png +[17]: https://www.linuxtechi.com/wp-content/uploads/2022/07/RockyLinux9-Installation-Progress.png +[18]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Reboot-System-after-RockyLinux9-Installation.png +[19]: https://www.linuxtechi.com/wp-content/uploads/2022/07/RockyLinux9-Loginscreen-Post-Installation.png +[20]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Desktop-Env-RockyLinux9.png +[21]: https://www.linuxtechi.com/wp-content/uploads/2022/07/neofetch-rockylinux9-post-installation.png diff --git a/published/20220719 How to Uninstall Deb Packages in Ubuntu.md b/published/20220719 How to Uninstall Deb Packages in Ubuntu.md new file mode 100644 index 0000000000..5f4040f977 --- /dev/null +++ b/published/20220719 How to Uninstall Deb Packages in Ubuntu.md @@ -0,0 +1,133 @@ +[#]: subject: "How to Uninstall Deb Packages in Ubuntu" +[#]: via: "https://itsfoss.com/uninstall-deb-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14885-1.html" + +如何在 Ubuntu 中卸载 deb 包 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/01/180906afaqifcsqqsfsxyq.jpg) + +[从 .deb 文件安装应用][1] 非常简单。双击它,它会在软件中心中打开,然后从那里安装它。 + +但是如何在 Ubuntu 或 Debian 中卸载 deb 包呢?如何删除一段时间前安装的软件包呢。 + +虽然这有几个如果和但是,但删除 .deb 文件的最简单和最可靠的方法是使用 `apt remove` 命令。 + +``` +sudo apt remove program_name +``` + +如你所见,**你需要在这里知道确切的包名称**。这可能并不总是显而易见的。例如,如果你在 Ubuntu 上安装 Google Chrome,则该程序在命令行中称为 “google-chrome-stable”。你已经知道了吗?我猜你不知道。 + +在本教程中,我将详细介绍如何找到确切的包名称,然后使用它来删除应用。我还将讨论使用图形方法删除 deb 包。 + +### 从 Ubuntu 中删除通过 .deb 文件安装的软件包 + +在我向你展示如何从命令行删除 deb 包之前,让我们在软件中心应用中快速查看它。 + +#### 方法 1:检查应用是否可以从软件中心移除 + +Ubuntu 有软件中心 GUI 应用,允许搜索、安装和删除应用。 + +搜索时,软件中心可能不会显示已安装的应用。 + +![Searching for installed applications may not show any results in Ubuntu Software Center][2] + +但是,如果向下滚动,你仍可能在“已安装”部分下找到它。外部应用通常不带徽标显示。 + +![Some installed applications can be found in the ‘installed’ tab of the Software Center][3] + +如果找到它,你可以通过单击“垃圾桶”图标或“删除”按钮来删除该应用。 + +![Removing applications from the Ubuntu software center][4] + +**一句话:检查是否可以从软件中心删除应用。** + +#### 方法 2:使用 apt 命令删除应用 + +我假设你不知道该应用命令的确切名称。你可能不知道 Google Chrome 安装为 google-chrome-stable 而 Edge 安装为 microsoft-edge-stable,这很正常。 + +如果你知道前几个字母,那么 tab 补全可能会有所帮助。否则,你可以 [使用 apt 命令列出已安装的应用][5] 并使用 `grep` 搜索应用程序名称: + +``` +apt list --installed | grep -i possible_package_name +``` + +例如,你可以智能地猜测 Google Chrome 包的名称中应该包含 chrome。你可以这样搜索: + +``` +apt list --installed | grep -i chrome +``` + +在某些情况下,你可能会得到多个结果。 + +![check if google chrome installed in ubuntu][6] + +如果你不确定这些软件包的作用,你可以随时通过以下方式获取它们的详细信息: + +``` +apt info exact_package_name +``` + +获得确切的软件包名称后,你可以使用 `apt remove` 命令将其删除。 + +``` +sudo apt remove exact_package_name +``` + +你还可以使用 `apt-get remove` 或 `dpkg uninstall` 命令来删除。 + +![Removing applications installed via .deb files using the apt command][7] + +#### 方法 3:使用 Synaptic 包管理器删除 deb 应用 + +另一种方法是使用 [Synaptic 包管理器][8]。在 GNOME 以“软件中心”的形式创建其图形包管理器之前,Synaptic 是 Ubuntu 和许多其他发行版中的默认 GUI 包管理器。 + +它仍然是 [Xfce 桌面环境][9] 上的推荐工具。 + +首先安装它: + +``` +sudo apt install synaptic +``` + +打开 Synaptic 并搜索包名称。查找标记为绿色的已安装软件包。右键单击它们,然后单击“标记为删除”。之后点击应用。 + +![Removing Deb packages using Synaptic package manager][10] + +### 对你有帮助吗? + +我非常乐意使用 `apt` 命令删除从 .deb 文件中安装的软件包。但我可以理解,并不是每个人都喜欢使用命令行。 + +在删除从外部 .deb 文件安装的应用时,我发现软件中心中找不到它。软件中心还可以做的更好一些。 + +我希望你现在对删除 deb 包有更好的了解。如果你有任何问题,请告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/uninstall-deb-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/install-deb-files-ubuntu/ +[2]: https://itsfoss.com/wp-content/uploads/2022/07/search-for-installed-applications-ubuntu-software-center.png +[3]: https://itsfoss.com/wp-content/uploads/2022/07/installed-applications-in-ubuntu-software-center-scaled.webp +[4]: https://itsfoss.com/wp-content/uploads/2022/07/removing-applications-from-ubuntu-software-center-scaled.webp +[5]: https://itsfoss.com/list-installed-packages-ubuntu/ +[6]: https://itsfoss.com/wp-content/uploads/2022/07/check-if-google-chrome-installed-in-Ubuntu.png +[7]: https://itsfoss.com/wp-content/uploads/2022/07/removing-deb-files-applications-ubuntu.png +[8]: https://itsfoss.com/synaptic-package-manager/ +[9]: https://www.xfce.org/ +[10]: https://itsfoss.com/wp-content/uploads/2022/07/removing-deb-files-using-synaptic-scaled.webp diff --git a/published/20220719 Top 10 Features of Linux Mint 21 -Vanessa-.md b/published/20220719 Top 10 Features of Linux Mint 21 -Vanessa-.md new file mode 100644 index 0000000000..651a28a227 --- /dev/null +++ b/published/20220719 Top 10 Features of Linux Mint 21 -Vanessa-.md @@ -0,0 +1,188 @@ +[#]: subject: "Top 10 Features of Linux Mint 21 “Vanessa”" +[#]: via: "https://www.debugpoint.com/linux-mint-21-features/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "robsean" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14894-1.html" + +Linux Mint 21 “Vanessa” 的 10 大特色 +====== + +> 我们总结了 Linux Mint 21 “Vanessa” 的 10 大特色,你可以看看有哪些是为你而准备的。 + +![](https://www.debugpoint.com/wp-content/uploads/2022/07/mint21feature.jpg) + +Linux Mint 21 “Vanessa” 是 [Linux Mint][2] 的第 36 个发布版本,它带来了一系列特色,以及对桌面上的有用改善。这些特色散落在 Cinnamon 桌面、内核变化、Xapps 更新等处。 + +我在这份 Linux Mint 21 的重要特色列表对它们做了个总结。 + +### Linux Mint 21 “Vanessa” 的重要特色 + +![Linux Mint 21 Cinnamon Desktop][1] + +#### 1、Ubuntu 22.04 及其相关更新 + +也许最重要的变化就是 Linux Mint 21 的基础了,它现在基于 [Ubuntu 22.04 “Jammy Jellyfish”][3] 。上一次的主要版本,即 Linux Mint 20 “Ulyana” ,是基于四年前发布的 Ubuntu 20.04 “Focal Fossa” 。沧海桑田,现在与 2020 年的世界已然完全不同。 + +因此,大量的软件包、版本升级、新的性能改善 —— 所有的这些底层更新都来到了 Linux Mint 21 。这包括最新的长期支持的 [Linux 内核 5.15][4] ,这带来了更多硬件系列的支持、以及针对编程、开发和网络的工具链的更新。 + +#### 2、Timeshift 备份工具的重大变化 + +几个月前,Mint 开发团队 [宣布][5] :他们将接管著名的备份工具 Timeshift,并将其作为一个 “XApps” 继续开发。这是一个重大变化。你可能会问为什么? + +好吧,Timeshift 工具的开发者 Tony George 正忙于其它的项目。你可能听说过 Linux 的 “[TeeJeeTech][6]” 应用。它是由 Tony 创建的,并且有一些很酷的应用。因此,他没有足够多的时间来专注于 Timeshift 的开发和改进。 + +![Timeshift creating snapshot][7] + +说到这里,由于 Linux Mint 现在在维护它,这个发布版本带来了一些新的功能,例如,在 rsync 模式(不是 btrfs 模式)时,现在 Timeshift 可以确定进行下一次备份需要多少磁盘空间。此外,如果它看到磁盘空间在备份后小于 1 GB ,会停止备份过程。 + +#### 3、WebP 支持 + +WebP 图像是谷歌为 Web 创建的一种相当新的图像格式。它带来了更好的压缩率,在保持与传统的 JPEG 和 PNG 图片相当的良好质量的同时,减少了文件大小。 + +在 Linux 桌面支持 WebP(如查看图像、缩略图或编辑)需要 [额外安装][8] 一些软件包。考虑到其流行程度,Linux Mint 开发团队为桌面应用及这个衍生发行版带来了开箱即用的 WebP 支持。 + +这意味着,在 Nemo 文件管理器中可以显示 WebP 图像的缩略图,并可以在 xviewer 中查看它们。Mint 开发团队总是优先考虑到最终用户,而诸如 Ubuntu 之类的其它发行版在默认支持 WebP 方面仍然落后。不仅如此,新的应用程序 [xapp-thumbnailers][9] 现在还能帮助 Nemo 文件管理器预览更多的文件类型,如: + +* ePub +* 带有专辑封面的 MP3 +* RAW 图像 +* AppImage + +#### 4、进程监视器 + +一个名称为 进程监视器process monitor 的小巧方便的工具,将会告知你系统中正在发生什么。当你的系统正在自动更新或通过 Timeshift 备份时,系统托盘上的这个小图标就会显示出来。在这些情况下,你的系统可能会变慢,而这个漂亮的图标可以告诉你原因。 + +#### 5、改善打印支持 + +Linux Mint 针对硬件设备配置了各种驱动程序,默认情况下就支持打印机。这个版本的 Mint 带来 [网络打印协议][10]Internet Printing Protocol(IPP)支持,可以免驱动进行打印和扫描。 + +另外,它也默认安装了 HP 的驱动程序 HPLIP 的最新版本 3.21.12 。 + +所有的这些变化都简化了打印机和扫描仪的使用,而像你这样的最终用户可以轻松地打印和扫描。这是一个 Linux 发行版的一个重要的方面,但并不是总是能顺利工作的。在 [点评过很多发行版][11] 后,我发现很多发行版无法检测到打印机,乃至不能打印。 + +很高兴看到 Mint 开发团队对这个关键功能做出了贡献。 + +#### 6、窗口动画更新 + +窗口和桌面动画效果有一些相当大的变化。首先,合并了窗口和桌面的效果设置。先前,是在不同的部分对动画进行细微的控制。 + +这里是对比视图: + +![][12] + +![][13] + +其次,取消了映射窗口和桌面效果选项。 + +第三,带来一个新的控件,用于更改整体动画的快慢速度。 + +最后,还有一个可以禁用或启用在整个桌面上的所有动画的全局开关,给予你更多的控制选项。 + +我相信这是一个经过精心设计的、可以让人更清楚地了解的对话框和高级选项。 + +#### 7、Mutter 重新构建 + +让我们来看一下随 Linux Mint 21 而来的 [Cinnamon 桌面环境版本 5.4][14]。它是最新的 Cinnamon 发布版本,Mint 是第一个将其带给用户的的发行版(除了传统的 Arch Linux 用户,他们得到它 [有点超早][15])。 + +最后,开发团队对 Cinnamon 5.4 中的窗口管理器 Muffin 根据上游的 Mutter 进行了重新构建。由于 Muffin 最初是从 Mutter 复刻出来的,所以它总是落后于上游的 Mutter 的功能,即使是有一些后期移植的改变。为使 Muffin 尽可能地接近 Mutter 代码库,团队在包含的特色功能、错误修复及清理方面付出了大量的努力。 + +因此,在未来,更容易从 Mutter 上游移植变化和在需要的时候清理 Muffin。 + +#### 8、窗口管理器和 GTK 主题 + +伴随着 Muffin 的变化,开发团队也将 GNOME 控制中心的一些显示设置移动到了 Cinnamon 控制中心。此外,在 Cinnamon 5.4 中,来自 csd-xrandr 的显示配置移动到了 Muffin 窗口管理器中。显然,你不会在显示设置窗口中看到什么不同。不过,在缩放显示或在高分辨率窗口中时,你可能会发现一些性能的提升,以及错误或问题更少一些。 + +Mint 开发团队在 Cinnamon 5.4 引入的另外一个关键变化是,在应用程序中实现 GTK 窗口的统一渲染。先前,如果一个 GTK 应用程序使用了标题栏,那么对话框会是一个 CSD (客户端样式)和 GTK 主题的混合体. + +现在随着 Cinnamon 5.4 的到来,所有的窗口都使用 GTK 主题进行渲染,而不再与它们的设计相关联。于是,传统的 Metacity 主题也被抛弃。 + +顺便说一句,我喜欢 Metacity 及其 “传统外观”,它们是 GNOME 的早期 [产物][16] 。 + +#### 9、软件包管理器更新 + +跟随 Debian、KDE Plasma 桌面的趋势,Linux Mint 也开始保护你的系统不会卸载重要的依赖关系软件包。 + +当你尝试卸载软件包时,Mint 现在会检查依赖关系,并检查重要的桌面软件包是否将会被移除。 + +如果发现这种情况,你将会得到一条阻止你继续卸载软件包的错误信息。 + +在另一方面,当成功地卸载一个软件包时,它会清理所有与之同时安装的依赖软件包。 + +#### 10、禁用 systemd OOMD 服务 + +自从 Ubuntu 22.04 LTS 发布以来,有一些对内存不足守护进程(`systemd-oomd`)不好的反馈。网上的很多用户都 [报告][17] 说:在没有任何警告或用户干预的情况下,会突然关闭应用程序(例如 Firefox)。进一步的调查表明,`systemd-oomd` 的实现情况“不是很好”。 + +理论上说,[systemd-oomd.service][18] 会监视你的系统的内存不足的情况,并且它有权杀死任何多过消耗系统资源的进程。Ubuntu 开发团队并没有和用户强调这一点,最后导致了不愉快的用户的体验。 + +基于这一认识,Linux Mint 21 决定 [不提供][19] 这种服务,禁用它。因为 Linux Mint 的用户群体是普通用户、学生等,如果应用程序意外关闭,对用户来说将是一种不好的体验。 + +![Systemd OOMD service is not enabled][20] + +#### 11、其它变化 + +最后,让我们归纳一些微小却有影响的变化来结束这篇 Linux Mint 21 特色介绍。 + +* 默认的文档阅读器应用程序 Xreader 现在能够进行微小注释。这是一个很方便的功能。 +* WebApp 管理器现在带来了一些自定义的浏览器参数。 +* Warpinator 文件传输器实用工具现在可以向你显示来自 Windows 、Android 和 iOS 设备上的其它的源文件。 +* Mint 将 Firefox 浏览器打包为 .deb 版本,而不是 Ubuntu 22.04 LTS 中的默认 .Snap 版本。感谢 Mint 开发团队,用户不必为卸载 Jammy 中的 Firefox 的 .Snap 版本的而运行 [一套复杂的命令][21]。 + + ![Firefox 102 in Linux Mint 21 – Exclusively packaged as deb executable][22] + +* 批量重命名应用程序 Thingy 在用户界面上做了一些改善。 +* GRUB2 的操作系统检测程序(`os-prober`)现在能够检测出你的硬件系统上所有的操作系统(对双启动或多启动有用)。 +* 蓝牙管理器 Blueman 取代了 Blueberry ,为连接和管理你的蓝牙设备带来了其它的功能。 +* 最后,在这个发布版本中也有为你的新桌面而准备的新壁纸。 + + ![New Wallpapers in Linux Mint 21][23] + +### 没有变化的部分 + +从表明上来看,你可能会觉着 Linux Mint 21 的绝大部分功能与先前的版本相同。默认桌面外观和默认壁纸保持不变。Xfce 和 MATE 桌面也没有发布任何重要的功能。因此,它们是完全一样的。此外,默认图标主题、应用程序菜单等等都可能会给你一种似曾相识的感觉。 + +### 总结 + +总体来说,最终用户需要的是一套完好的特色功能,而不是花哨的手势之类的东西。鉴于此,对初学者或最终用户来说,Linux Mint 是当今最好的 Linux 发行版。至此,这篇 Linux Mint 21 特色的总结就此结束了。 + +你认为 Linux mint 21 的新特色怎么样?在这个发布版本中,是否有一些你所求而未得的特色?让我们在下面的评论区讨论这个问题。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/linux-mint-21-features/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/07/Linux-Mint-21-Cinnamon-Desktop.jpg +[2]: https://www.debugpoint.com/linux-mint/ +[3]: https://www.debugpoint.com/web-stories/ubuntu-22-04-review/ +[4]: https://www.debugpoint.com/linux-kernel-5-15/ +[5]: https://blog.linuxmint.com/?p=4323 +[6]: https://teejeetech.com/ +[7]: https://www.debugpoint.com/wp-content/uploads/2022/07/Timeshift-creating-snapshot.jpg +[8]: https://www.debugpoint.com/view-webp-ubuntu-linux/ +[9]: https://github.com/linuxmint/xapp-thumbnailers +[10]: https://datatracker.ietf.org/doc/html/rfc8011 +[11]: https://www.debugpoint.com/tag/linux-distro-review/ +[12]: https://www.debugpoint.com/wp-content/uploads/2022/07/Effects-in-Linux-Mint-20.jpg +[13]: https://www.debugpoint.com/wp-content/uploads/2022/07/Effects-in-Linux-Mint-21.jpg +[14]: https://github.com/linuxmint/cinnamon-desktop/releases/tag/5.4.0 +[15]: https://www.debugpoint.com/cinnamon-arch-linux-install/ +[16]: https://www.debugpoint.com/gnome-classic-ubuntu-22-04/ +[17]: https://askubuntu.com/questions/1404888/how-do-i-disable-the-systemd-oom-process-killer-in-ubuntu-22-04 +[18]: https://www.freedesktop.org/software/systemd/man/systemd-oomd.service.html +[19]: https://debugpointnews.com/linux-mint-21-systemd-oom/ +[20]: https://www.debugpoint.com/wp-content/uploads/2022/07/Systemd-OOMD-service-is-not-enabled.jpg +[21]: https://www.debugpoint.com/remove-firefox-snap-ubuntu/ +[22]: https://www.debugpoint.com/wp-content/uploads/2022/07/Firefox-102-in-Linux-Mint-21-Exclusively-packaged-as-deb-executable.jpg +[23]: https://www.debugpoint.com/wp-content/uploads/2022/07/New-Wallpapers-in-Linux-Mint-21.jpg +[24]: https://github.com/linuxmint/mint21-beta/issues diff --git a/published/20220720 Update a Single Package With apt Command in Ubuntu and Debian.md b/published/20220720 Update a Single Package With apt Command in Ubuntu and Debian.md new file mode 100644 index 0000000000..30d11e48d2 --- /dev/null +++ b/published/20220720 Update a Single Package With apt Command in Ubuntu and Debian.md @@ -0,0 +1,98 @@ +[#]: subject: "Update a Single Package With apt Command in Ubuntu and Debian" +[#]: via: "https://itsfoss.com/apt-upgrade-single-package/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14895-1.html" + +在 Ubuntu 和 Debian 中使用 apt 命令更新单个软件包 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/04/165705li66yephvx464ivt.jpg) + +如何 [在命令行中更新你的 Ubuntu 系统][1]?你可以使用 `apt update`(刷新包缓存)和 `apt upgrade` 命令。 + +``` +sudo apt update && sudo apt upgrade +``` + +它会更新所有可以立即升级的已安装 apt 包。这也包括 Linux 内核版本。 + +这似乎是一件好事,尤其是对于桌面用户。但对于运行关键 Web 服务的 Ubuntu 服务器用户而言,情况可能并非如此。 + +如果你想对更新有选择性,并且**只想升级单个软件包**,请使用以下命令: + +``` +sudo apt install --only-upgrade package_name +``` + +让我们更详细地了解一下。 + +### 使用 apt 命令升级单个包 + +第一步是更新本地包仓库缓存,以便你的系统知道有新版本的软件包可用。 + +``` +sudo apt update +``` + +**这是可选的**。查看一下你要升级的软件包是否在 [可升级软件包列表][2] 中。 + +``` +apt list --upgradable +``` + +如果所需的软件包有可用的新版本,你可以选择使用以下命令仅升级该单个软件包: + +``` +sudo apt install --only-upgrade package_name +``` + +如果你对已安装的软件包运行 `apt install` 命令,它将升级到下一个可用版本。 + +但如果该软件包尚未安装,`apt` 命令也会安装它。 + +这就是为什么 `--only-upgrade` 部分是必要的。使用该选项,`apt` 命令只会升级已安装的软件包。如果尚未安装,它将不会安装该软件包。 + +这不是最适合 Ubuntu 服务器用户的示例,但你仍然可以在下面的截图中看到我如何只升级了七个可升级包中的一个。 + +![Update only a single package in Ubuntu][3] + +### 仅升级选定的软件包 + +如果要升级选定的几个软件包,那么不必一一更新。只需使用前面提到的命令提供包名称。 + +``` +sudo apt install --only-upgrade package1 package2 package3 +``` + +这是一个例子。 + +![Upgrade selected packages in Ubuntu][4] + +### 总结 + +当你面临必须升级选定软件包的情况时,你可以使用带有 `–only-upgrade` 选项的 `apt install` 命令。 + +我建议阅读 [如何更有效地使用 apt 命令][5]。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/apt-upgrade-single-package/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/update-ubuntu/ +[2]: https://itsfoss.com/apt-list-upgradable/ +[3]: https://itsfoss.com/wp-content/uploads/2022/07/update-single-package-ubuntu-scaled.webp +[4]: https://itsfoss.com/wp-content/uploads/2022/07/upgrade-selected-packages-ubuntu.png +[5]: https://itsfoss.com/apt-command-guide/ diff --git a/published/20220721 How I use the Linux fmt command to format text.md b/published/20220721 How I use the Linux fmt command to format text.md new file mode 100644 index 0000000000..878a820f83 --- /dev/null +++ b/published/20220721 How I use the Linux fmt command to format text.md @@ -0,0 +1,97 @@ +[#]: subject: "How I use the Linux fmt command to format text" +[#]: via: "https://opensource.com/article/22/7/fmt-trivial-text-formatter" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: "perfiffer" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14886-1.html" + +我是如何使用 Linux fmt 命令来格式化文本 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/01/184300zbyfjayeyqa5pmcb.jpg) + +> fmt 命令是一个简单的文本格式化程序。我将在这里展示如何使用它来格式化文本和邮件回复。 + +当我为项目编写文档时,我经常以纯文本的形式编写自述文件和安装说明。我不需要使用 HTML 或者 Markdown 之类的标记语言来描述项目的功能或如何编译它。但是维护这样的文档可能会很痛苦。如果我需要更新我的 `Readme` 文件中的一个句子的中间位置,我需要重新格式化文本,以避免在我的其它文本中间出现一个很长或很短的行,而其它的行的格式是整整齐齐的 75 列。一些编辑器包含可以自动重新格式化文本以填充段落的功能,但并非所有的编辑器都这样做。这就是 Linux `fmt` 命令的用武之地。 + +### 使用 Linux fmt 命令格式化文本 + +`fmt` 命令是一个简单的文本格式化程序;它收集单词并填充段落,但不应用任何其它文本样式,例如斜体或粗体。这一切都是纯文本。使用 `fmt` 命令,你可以快速调整文本,使其更易于阅读。让我们从这个熟悉的示例文本开始: + +``` +$ cat trek.txt +Space: the final +frontier. These are the voyages +of the starship Enterprise. Its +continuing mission: to explore +strange new worlds. To +seek out new life and new +civilizations. To boldly go +where no one has gone before! +``` + +在这个实例文件中,每行都有不同的长度,并且它们以一种奇怪的方式换行。如果你对纯文本文件进行大量更改,你可以会遇到类似的奇怪的换行。要重新格式化此文本,你可以使用 `fmt` 命令将段落的行填充为统一长度: + +``` +$ fmt trek.txt +Space: the final frontier. These are the voyages of the starship +Enterprise. Its continuing mission: to explore strange new worlds. To +seek out new life and new civilizations. To boldly go where no one has +gone before! +``` + +默认情况下,`fmt` 会将文本格式化为 75 的列宽大小,但你可以使用 `-w` 或 `--width` 选项进行更改: + +``` +$ fmt -w 60 trek.txt +Space: the final frontier. These are the voyages of +the starship Enterprise. Its continuing mission: to +explore strange new worlds. To seek out new life and new +civilizations. To boldly go where no one has gone before! +``` + +### 使用 Linux fmt 命令格式化电子邮件回复 + +我加入了一个邮件列表,这里更喜欢纯文本电子邮件,这使得在列表服务器上归档电子邮件变得更加容易。但现实是并非每个人都以纯文本形式发送电子邮件。有时候,当我以纯文本形式回复这些电子邮件时,我的电子邮件客户端会将整个段落放在一行中。这使得在电子邮件中“引用”回复变得困难。 + +这是一个简单的例子。当我以纯文本形式回复电子邮件时,我的电子邮件客户端通过在每行前添加 `>` 字符来“引用”对方的电子邮件。对于一条短消息,可能如下所示: + +``` +> I like the idea of the interim development builds. +``` + +没有正确“换行”的长行将无法在我的纯文本电子邮件回复中正确显示,因为它只是前面带有 `>` 字符的长行,如下所示: + +``` +> I like the idea of the interim development builds. This should be a great way to test new changes that everyone can experiment with. +``` + +为了解决这个问题,我打开了一个终端并将引用的文本复制并粘贴到一个新文件中。然后我使用 `-p` 或 `--prefix` 选项来告诉 `fmt` 在每一行之前使用什么字符作为“前缀”。 + +``` +$ cat > email.txt +> I like the idea of the interim development builds. This should be a great way to test new changes that everyone can experiment with. +^D +$ fmt -p '>' email.txt +> I like the idea of the interim development builds. This should be a +> great way to test new changes that everyone can experiment with. +``` + +`fmt` 命令是一个非常简单的文本格式化程序,但它可以做很多有用的事情,可以帮助以纯文本形式编写和更新文档。要了解其它选项,例如 `-c` 或 `--crown-margin` 以匹配段落前两行缩进,例如项目列表。还可以尝试使用 `-t` 或者 `--tagged-paragraph` 来保留段落中第一行的缩进,就像缩进的段落一样。`-u` 或 `--uniform-spacing` 选项在单词之间使用一个空格,在句子之间使用两个空格。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/fmt-trivial-text-formatter + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[perfiffer](https://github.com/perfiffer) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/osdc-docdish-typewriterkeys-3-series.png diff --git a/published/20220722 Fixing the -Pending Update of Firefox snap- Error in Ubuntu.md b/published/20220722 Fixing the -Pending Update of Firefox snap- Error in Ubuntu.md new file mode 100644 index 0000000000..8ff9757d64 --- /dev/null +++ b/published/20220722 Fixing the -Pending Update of Firefox snap- Error in Ubuntu.md @@ -0,0 +1,117 @@ +[#]: subject: "Fixing the “Pending Update of Firefox snap” Error in Ubuntu" +[#]: via: "https://itsfoss.com/pending-update-firefox-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14908-1.html" + +修复 Ubuntu 中的 “Pending Update of Firefox snap” 错误 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/08/154842wquoflgffwyyn2cw.jpg) + +如果你使用的是 Ubuntu 22.04,你可能已收到过此通知。 + +![Notification about pending Firefox app][1] + +它会通知你 Firefox 更新正在等待中,并要求你关闭应用以避免中断。 + +因此,就像一个听话的 Ubuntu 用户一样,你在保存或完成工作后关闭了 Firefox 浏览器。 + +你认为 Firefox 已在后台更新,重启浏览器将运行较新版本。 + +只是,并非如此。 + +**即使在你重启浏览器甚至计算机后,它仍可能显示相同的 “pending update of Firefox” 通知**。 + +令人沮丧么?我可以告诉你发生了什么。 + +让我解释一下为什么会发生这种情况,以及你可以做些什么来“修复”它。 + +### 修复 “pending update of Firefox snap” 问题 + +早些时候,Firefox 曾经在后台更新,然后要求你重启浏览器。在你重启浏览器之前 [不能][2] 打开任何网站。 + +![Firefox forced restart in the past][3] + +在将 [Firefox 浏览器切换为默认 Snap 包格式][4] 后,Ubuntu 团队对更新流程进行了一些改动。 + +此通知是“改进的用户体验”的一部分。现在,Firefox 不再阻止你浏览。你可以在方便时重新启动浏览器以进行更新。 + +但是为什么即使在你重新启动浏览器或系统后它仍然显示这个通知? + +因为这是一条糟糕的通知消息,无法为你提供完整的信息。 + +#### Firefox 更新还没有开始 + +当你看到 “pending Firefox update” 时,你错误地认为应用已在后台更新,重启会将其升级到较新的版本。 + +而对于现在这种情况,Ubuntu 中的 Snap 包每天会自动刷新(更新)一次或几次。为了避免在重新启动安装更新之前 Firefox 不允许你浏览任何内容而导致工作中断,Ubuntu 甚至不会在后台更新 Firefox Snap 包。 + +相反,当 Snap 包刷新时,**它会显示通知并希望你立即关闭浏览器**,以便可以使用其他 Snap 包进行更新。 + +但像你我这样的用户不能这样做,对吧?看到通知,立即关闭浏览器?并不是很方便。 + +而当你有时间关闭浏览器时,Snap 刷新却不会马上更新浏览器。 + +你可以看到更新的 Snap 版本的 Firefox 可用,但只要 Firefox 正在运行,它就不会自动安装。 + +![Firefox snap won’t be updated automatically if the browser is running][5] + +#### 更新 Firefox Snap + +这是你摆脱每天不断出现的更新通知所需要做的事情。 + +* 关闭 Firefox 浏览器 +* 手动运行 Snap 刷新(更新已安装的 Snap 包) + +确保你在 Firefox 浏览器中的工作已保存。现在,使用鼠标关闭所有 Firefox 浏览器或在终端中运行以下命令: + +``` +sudo killall firefox +``` + +现在 Firefox 不再运行,更新 Snap 软件包: + +``` +sudo snap refresh +``` + +你会看到它开始下载更新的 Firefox 包。 + +![Firefox is being updated with Snap][6] + +更新完成后,你将看到 Firefox 已升级到更新版本的摘要信息。 + +![Updated Firefox snap version][7] + +### 总结 + +安装非 Snap 版本的 Firefox 也可能是个解决方案,但不是每个人都可以走这条路。 + +Firefox 和 Snap 的开发人员必须齐心协力改进这个模棱两可的更新过程。他们应该提供更好的机制,不仅显示待处理更新的通知,还提供启动更新的选项。 + +这是我们最近在 Ubuntu 上看到的许多奇怪的事情之一。这必须改变才能使 Ubuntu (再次)成为一个对初学者友好的发行版。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/pending-update-firefox-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2022/07/pending-update-firefox-ubuntu.png +[2]: https://news.itsfoss.com/mozilla-annoying-new-tab/ +[3]: https://itsfoss.com/wp-content/uploads/2022/07/firefox-restart.webp +[4]: https://news.itsfoss.com/ubuntu-firefox-snap-default/ +[5]: https://itsfoss.com/wp-content/uploads/2022/07/pending-Firefox-update-issue-Ubuntu.png +[6]: https://itsfoss.com/wp-content/uploads/2022/07/updating-firefox-snap-package-ubuntu.png +[7]: https://itsfoss.com/wp-content/uploads/2022/07/firefox-snap-update-ubuntu.png diff --git a/published/20220725 Koodo is an All-in-one Open Source eBook Reader App for Linux.md b/published/20220725 Koodo is an All-in-one Open Source eBook Reader App for Linux.md new file mode 100644 index 0000000000..42f7201a9a --- /dev/null +++ b/published/20220725 Koodo is an All-in-one Open Source eBook Reader App for Linux.md @@ -0,0 +1,108 @@ +[#]: subject: "Koodo is an All-in-one Open Source eBook Reader App for Linux" +[#]: via: "https://itsfoss.com/koodo-ebook-reader/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14902-1.html" + +Koodo:一款适用于 Linux 的一体化开源电子书阅读器应用 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/06/200116wwgeawub7ge0tard.jpg) + +有几个可供桌面 Linux 用户使用的 [电子书阅读器][1]。 + +几乎所有发行版都带有可以打开 PDF 文件的文档阅读器。它还可能支持其他文件格式,例如 epub 或 Mobi,但不一定。 + +这就是为什么需要像 [Foliate][2] 和 Calibre 这样的专门应用来阅读和管理各种格式的电子书的原因。 + +最近,我遇到了另一个开源软件,它为电子书阅读器提供了几个令人兴奋的功能。 + +### Koodo:它有你能想到的一切 + +[Koodo][3] 是一款多合一的开源电子书阅读器,具有帮助你更好地管理和阅读电子书的功能。它是一个跨平台应用,你可以在 Linux、Windows 和 macOS 上下载。你甚至可以 [在浏览器中使用它][4]。 + +它的用户界面看起来很现代,可能是因为它是一个 Electron 应用。你必须导入书籍并将它们添加到 Koodo。它不按文件夹导入书籍。不过,你可以选择多个文件进行导入。书太多了?可以将一些添加到你的收藏夹以便快速访问。 + +![Koodo ebook reader interface][5] + +我使用了 AppImage 格式的软件包,但由于未知原因,它没有显示文件的缩略图。 + +![Koodo ebook reader dark mode interface][6] + +它支持流行的电子书文件格式,如 PDF、Mobi 和 Epub。但不止这些,它还支持 CBR、CBZ 和 CBT 等漫画书格式,它还支持更多。它还可以阅读 FictionBooks(.fb2)、Markdown 和富文本格式(RTF)以及微软 Office Word 文档(.docx)。 + +除了支持很多文件格式外,它还提供了多种功能来改善你的阅读体验。 + +你可以高亮显示文本并使用文本注释对其进行注释。你还可以在当前文档或谷歌上搜索选定的文本。 + +![Annotate, highlight or translate selected text][7] + +你可以从主应用窗口的侧边栏中访问高亮显示的文本和注释。 + +也有文本到语音和翻译选定文本的选项。但是,这两个功能在我的测试中都不起作用。我使用的是 Koodo 的 AppImage 版本。 + +Koodo 支持各种布局。你可以以单列、双列或连续滚动布局阅读文档。对于 ePub 和 Mobi 格式,它会自动以双列布局打开。对于 PDF,默认选择单列布局。 + +你可以根据自己的喜好自定义 UI。更改字体、大小、段落间距、文本颜色、背景颜色、行间距、亮度等。 + +![koodo additional features][8] + +Koodo 支持夜间阅读模式以及五个不同的主题。你可以根据自己的喜好在主题之间切换。 + +你还可以使用 Dropbox 或其他支持 Webdav 协议的 [云服务][9] 跨设备同步你的书籍和阅读数据(如高亮、笔记等)。 + +![You can backup your data in your preferred cloud service][10] + +### 在 Linux 上获取 Koodo + +如果你想体验一下 Koodo,你可以试试它的在线版本。你可以在浏览器中使用 Koodo。你的数据本地存储在浏览器中,如果你清理浏览器缓存,你会丢失数据(高亮、笔记等,但不会丢失计算机上存储的书籍)。 + +> **[在线尝试 Koodo][11]** + +如果你喜欢它的功能,可以选择在您的计算机上安装 Koodo。 + +Linux 用户有多种选择。你有 Debian 和基于 Ubuntu 的发行版的 deb 文件、Red Hat 和 Fedora 的 RPM,以及面向所有发行版的 Snap、AppImage 和可执行文件。 + +你可以从项目主页获取你选择的安装程序。 + +> **[下载 Koodo][12]** + +### 总结 + +Koodo 并不完美。它有大量功能,但并非所有功能都能完美运行,正如我在测试中发现的那样。 + +尽管如此,它仍然是一个很好的应用,有可能在用户中流行起来。只有少数几个应用包含如此多的功能。 + +感谢 Koodo 开发人员为桌面用户创建了一个有前途的开源应用。 + +你可以 [访问该项目的仓库][13] 来查看源代码、报告 bug 或者通过给项目加星来向开发者表达喜爱。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/koodo-ebook-reader/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/best-ebook-readers-linux/ +[2]: https://itsfoss.com/foliate-ebook-viewer/ +[3]: https://koodo.960960.xyz/en +[4]: https://reader.960960.xyz/#/manager/empty +[5]: https://itsfoss.com/wp-content/uploads/2022/07/koodo-ebook-reader-interface.webp +[6]: https://itsfoss.com/wp-content/uploads/2022/07/koodo-interface.png +[7]: https://itsfoss.com/wp-content/uploads/2022/07/koobo-ebook-reader-features.webp +[8]: https://itsfoss.com/wp-content/uploads/2022/07/koodo-additional-features.webp +[9]: https://itsfoss.com/cloud-services-linux/ +[10]: https://itsfoss.com/wp-content/uploads/2022/07/koodo-backup-restore-feature.png +[11]: https://reader.960960.xyz/ +[12]: https://koodo.960960.xyz/en +[13]: https://github.com/troyeguo/koodo-reader diff --git a/published/20220728 How To Build Custom Docker Image Using Dockerfile.md b/published/20220728 How To Build Custom Docker Image Using Dockerfile.md new file mode 100644 index 0000000000..f6a94145d7 --- /dev/null +++ b/published/20220728 How To Build Custom Docker Image Using Dockerfile.md @@ -0,0 +1,298 @@ +[#]: subject: "How To Build Custom Docker Image Using Dockerfile" +[#]: via: "https://ostechnix.com/a-brief-introduction-to-dockerfile/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: "Donkey-Hao" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14896-1.html" + +如何使用 Dockerfile 创建自定义 Docker 镜像 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/04/172001acb136363vi6vcgk.jpg) + +在这份指南中,我们将看到 **Dockerfile** 的简要介绍以及如何在 Linux 中使用 Dockerfile 来自动的 **创建自定义 Docker 镜像** 。 + +### 什么是 Dockerfile ? + +Dockerfile 是附有构建 Docker 镜像说明的易于理解的文本文件。它囊括了用户在创建镜像时可以调用的所有命令。 + +我们可以使用 Dockerfile 创建自定义的镜像。可以通过 Docker Hub 分享的自定义 Docker 镜像。 + +如果你还不知道,Docker Hub 是 Docker 提供的托管存储库服务,用于团队查找和共享容器镜像,当然世界上任何人也都可以访问。 + +想象一下,早期如果我们想用 **Nginx**,我们要通过很多步骤,才能安装和配置好 Nginx 。得益于 Docker Hub ,现在我们可以在几分钟内,下载并运行 Nginx 的预置容器镜像。 + +![Nginx Docker Image In Dockerhub][1] + +运行如下命令从 Docker Hub 上拉取 Nginx 镜像: + +``` +# docker pull nginx +``` + +一旦我们拉取了 Docker 镜像,可以运行如下命令使用它: + +``` +# docker run -it -d -p 8080:8080 nginx +``` + +就这样,十分简单! + +参考下方链接,了解更多使用 Docker 的方式: + +* [开始使用 Docker][2] + +Docker Hub 上有超过十万个来自软件供应商、开源项目以及社区的容器镜像。 + +你可以从 Docker Hub 上下载你选择的镜像,并且使用上面的命令开始使用它。 + +### 理解 Dockerfile 格式 + +Docker 可以读取 Dockerfile 中的 **指令** 来自动的创建镜像。 + +典型的 Dockerfile 包含如下指令: + +1、`FROM` —— 这会设置容器的基础镜像。 + +例如: + +``` +FROM ubuntu:22.04 +``` + +这会将容器的基础镜像设置为 Ubuntu 。如果 ‘22.04’ 这个标志没有特别指明,则会设为最新版本(`latest`)。 + +2、`LABEL` —— 这是用来明确镜像的元数据信息的键值对。 + +例如: + +``` +LABEL ENV=“DEVELOPMENT” +``` + +3、`RUN` —— 这会在基础镜像中执行指令并创建一个新层。 + +例如: + +``` +RUN apt-get update +RUN apt-get install tomcat +``` + +4、`CMD` —— 这用来设置容器启动后先执行的命令。 + +例如: + +``` +CMD ["java", "-jar", "app.jar"] +``` + +5、`EXPOSE` —— 设置用于访问容器的端口。容器将会监听该端口。我们可以用来获得输出。 + +例如: + +``` +EXPOSE 8080 +``` + +6、``MAINTAINER` —— 显示创建镜像作者的信息。 + +例如: + +``` +MAINTAINER info@ostechnix.com +``` + +7、`ENV` —— 用来设置环境变量的键值对。这些变量在镜像创建的时候设置,并在容器创建好后可以使用。 + +例如: + +``` +ENV DB_NAME=”MySQL” +ENV DB_VERSION=”8.0” +``` + +8、`COPY` —— 用来拷贝本地文件至容器中。 + +例如: + +``` +COPY /target/devops.jar devops.jar +``` + +9、`ADD` —— 具有与拷贝相同的功能,不过更进一步还可以提取本地的 tar 文件或者从 URL 拷贝文件。 + +例如: + +``` +ADD devops.tar.xz / . +ADD http://example.com/abc.git /usr/local/devops/ +``` + +10、`ENTRYPOINT` —— 用来设置镜像的主要命令。与 CMD 指令功能相同。不同的是 `ENTRYPOINT` 中的指令不会被重写。 + +例如: + +``` +ENTRYPOINT ["java", "-jar", "app.jar"] +``` + +11、`VOLUME` —— 该指令用来创建指定位置的挂载点。 + +例如: + +``` +VOLUME /app/devops +``` + +12、`USER` —— 将设置运行镜像并使用的用户名称以及用户组。 + +例如: + +``` +USER dhruv +USER admin +``` + +13、`WORKDIR` —— 这会设置工作目录。如果目录不存在,则会创建。 + +例如: + +``` +WORKDIR /var/lib/ +``` + +这是一个 Dockerfile 的样本,可以参考一下: + +``` +FROM ubuntu:latest +MAINTAINER Senthilkumar Palani "info@ostechnix.com" +RUN apt-get install -y software-properties-common python +RUN add-apt-repository ppa:chris-lea/node.js +RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ jammy universe" >> +/etc/apt/sources.list +RUN apt-get update +RUN apt-get install -y nodejs +RUN mkdir /var/www +ADD app.js /var/www/app.js +CMD ["/usr/bin/node", "/var/www/app.js"] +``` + +我将向你展示创建一个 Dockerfile 、创建并使用镜像的简单例子。 + +### 创建一个 Dockerfile + +创建一个名为 `dockerfile` 的文件: + +``` +# nano dockerfile +``` + +添加下面几行命令。我们将更新并安装 `vim` 和 `curl` 包: + +``` +FROM alpine + +RUN apk update +RUN apk add vim +RUN apk add curl +``` + +![Dockerfile For Alpine Linux][3] + +按下 `CTRL+O` 和 `CTRL+X` 键保存文件并关闭。 + +现在 Dockerfile 已经就位。让我们继续,用该 Dockerfile 创建一个镜像。 + +> **注意:** 如果你在使用 [Docker 桌面版][4],你可以以一个普通用户运行 `docker` 命令。 + +### 使用 Dockerfile 创建 Docker 镜像 + +只需运行以下命令,便可以使用 Dockerfile 创建 Docker 镜像: + +``` +# docker build -t alpine . +``` + +请注意最后有一个 **点**(`.`)。 + +输出示例: + +``` +[+] Building 51.2s (8/8) FINISHED + => [internal] load build definition from Dockerfile 0.1s + => => transferring dockerfile: 104B 0.0s + => [internal] load .dockerignore 0.1s + => => transferring context: 2B 0.0s + => [internal] load metadata for docker.io/library/alpine:latest 38.8s + => [1/4] FROM docker.io/library/alpine@sha256:7580ece7963bfa863801466c0a 2.7s + => => resolve docker.io/library/alpine@sha256:7580ece7963bfa863801466c0a 0.0s + => => sha256:d7d3d98c851ff3a95dbcb70ce09d186c9aaf7e25d48 1.47kB / 1.47kB 0.0s + => => sha256:530afca65e2ea04227630ae746e0c85b2bd1a179379 2.80MB / 2.80MB 2.4s + => => sha256:7580ece7963bfa863801466c0a488f11c86f85d9988 1.64kB / 1.64kB 0.0s + => => sha256:9b2a28eb47540823042a2ba401386845089bb7b62a9637d 528B / 528B 0.0s + => => extracting sha256:530afca65e2ea04227630ae746e0c85b2bd1a179379cbf2b 0.2s + => [2/4] RUN apk update 4.3s + => [3/4] RUN apk add vim 3.5s + => [4/4] RUN apk add curl 1.3s + => exporting to image 0.4s + => => exporting layers 0.4s + => => writing image sha256:14231deceb6e8e6105d2e551799ff174c184e8d9be8af 0.0s + => => naming to docker.io/library/alpine 0.0s + +Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them +``` + +按照上面的命令, Docker 会通过保存在当前工作目录中的 Dockerfile 中的命令开始自动的创建镜像。还记得我们在 Dockerfile 中保存的 `apk update`、`apk add vim` 和 `apk add curl` 命令吗?这些命令也将会自动的执行。 + +如果 Dockerfile 保存在其他目录,你可以使用 `-f` 标志来指定路径,例如: + +``` +# docker build -f /path/to/a/Dockerfile . +``` + +创建好镜像后,我们可以使用如下命令运行它: + +``` +# docker run -it alpine +``` + +该命令会启动这个 Alpine 容器并连接到它。 + +``` +/ # uname -a +Linux 8890fec82de8 5.10.104-linuxkit #1 SMP Thu Mar 17 17:08:06 UTC 2022 x86_64 Linux +/ # cat /etc/alpine-release +3.16.1 +/ # +``` + +如果你使用 Docker 桌面版,你可以通过容器Containers标签页界面来查看运行中的容器。 + +![View Containers In Docker Desktop][5] + +这就是使用 Dockerfile 构建自定义容器映像的方式。 + +我们仅仅讲了基础内容。你可以用 Dockerfile 做到很多东西。建议你参考一下官方 [Dockerfile 参考][6] ,以了解更多内容。 + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/a-brief-introduction-to-dockerfile/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[Donkey](https://github.com/Donkey-Hao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/wp-content/uploads/2022/07/Nginx-Docker-Image-In-Dockerhub.png +[2]: https://ostechnix.com/getting-started-with-docker/ +[3]: https://ostechnix.com/wp-content/uploads/2022/07/Dockerfile-For-Alpine-Linux.png +[4]: https://ostechnix.com/docker-desktop-for-linux/ +[5]: https://ostechnix.com/wp-content/uploads/2022/07/View-Containers-In-Docker-Desktop-1024x524.png +[6]: https://docs.docker.com/engine/reference/builder/ diff --git a/published/20220730 How to Install Latest Vim 9.0 on Ubuntu Based Linux Distributions.md b/published/20220730 How to Install Latest Vim 9.0 on Ubuntu Based Linux Distributions.md new file mode 100644 index 0000000000..1e7e201821 --- /dev/null +++ b/published/20220730 How to Install Latest Vim 9.0 on Ubuntu Based Linux Distributions.md @@ -0,0 +1,122 @@ +[#]: subject: "How to Install Latest Vim 9.0 on Ubuntu Based Linux Distributions" +[#]: via: "https://itsfoss.com/install-latest-vim-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14899-1.html" + +如何在基于 Ubuntu 的 Linux 发行版上安装最新的 Vim 9.0 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/05/174903f3zu3nqrrnwclwrz.jpg) + +> 这个快速教程展示了在 Ubuntu Linux 上安装最新版本的 Vim 的步骤。 + +Vim 是最 [流行的基于终端的文本编辑器][1] 之一。然而,它在 Ubuntu 上没有被默认安装。 + +Ubuntu 使用 Nano 作为默认的终端编辑器。Nano 也是一个优秀的工具,我并不打算参与 [Nano 与 Vim 孰优孰劣的辩论][2]。 + +如果你已经花了一些时间掌握了 Vim 的快捷键,你就不必忘记它们,而开始使用一个新的编辑器。 + +你可以在终端使用以下命令在 Ubuntu 上安装 Vim: + +``` +sudo apt install vim +``` + +这很简单,对吗?这种方法的主要问题是,你不会得到最新的 Vim 版本。 + +你可以用以下命令检查已安装的 Vim 版本: + +``` +vim --version +``` + +而如果你查看 [Vim 网站][3],你会发现 Vim 已经发布了更新的版本。 + +在写这篇文章的时候,[Vim 9.0 已经发布][4],但在 Ubuntu 仓库中还没有。 + +好消息是,你可以使用一个 [非官方的,但积极维护的 PPA][5] 安装最新的 Vim。 + +### 使用 PPA 在 Ubuntu 上安装 Vim 9 + +如果你有特定的 Vim 配置文件,为它们做个备份也无妨。 + +现在,要安装最新的 Vim 版本,先添加 PPA 仓库: + +``` +sudo add-apt-repository ppa:jonathonf/vim +``` + +![Adding the PPA to get the latest Vim version][6] + +你不需要在 Ubuntu 上更新软件包缓存,但其他发行版如 Mint 可能仍然需要: + +``` +sudo apt update +``` + +现在,使用下面的命令来安装 PPA 提供的最新 Vim 版本: + +``` +sudo apt install vim +``` + +如果你已经安装了一个较早的 Vim 版本,它将被升级。你可以用以下方法检查已安装的 Vim 版本: + +``` +vim --version +``` + +![Checking installed Vim version][7] + +这是一个维护得非常好的 PPA,适用于所有活跃的 Ubuntu 版本。 + +如果你是 PPA 的新手,我有一个关于这个主题的详细指南。你应该阅读以对 [Ubuntu 中 PPA 的概念][8] 了解更多。 + +### 降级或删除 + +如果你想回到 Ubuntu 提供的旧版 Vim,你应该删除现有的版本,删除 PPA 并重新安装它。 + +在删除 Vim 之前,如果你做了自定义修改并打算再次使用 Vim,你应该复制 vimrc 或其他类似的配置文件。 + +那么,打开一个终端,使用以下命令: + +``` +sudo apt remove vim +``` + +现在删除 PPA,否则你会再次得到最新的 Vim(如果你尝试安装旧版本的 Vim): + +``` +sudo add-apt-repository -r ppa:jonathonf/vim +``` + +现在,如果你想要旧的、官方的 Ubuntu 版本的 Vim,只需再次 [使用 apt 命令][9] 安装它。 + +享受 Ubuntu 上的 Vim 吧。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-latest-vim-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/command-line-text-editors-linux/ +[2]: https://itsfoss.com/vim-vs-nano/ +[3]: https://www.vim.org/ +[4]: https://news.itsfoss.com/vim-9-0-release/ +[5]: https://launchpad.net/~jonathonf/+archive/ubuntu/vim +[6]: https://itsfoss.com/wp-content/uploads/2022/07/install-latest-vim-on-ubuntu-using-ppa.png +[7]: https://itsfoss.com/wp-content/uploads/2022/07/vim-9-ubuntu.png +[8]: https://itsfoss.com/ppa-guide/ +[9]: https://itsfoss.com/apt-command-guide/ diff --git a/published/20220731 The Much Awaited Linux Mint 21 is Released and Available to Download.md b/published/20220731 The Much Awaited Linux Mint 21 is Released and Available to Download.md new file mode 100644 index 0000000000..e4c491c54c --- /dev/null +++ b/published/20220731 The Much Awaited Linux Mint 21 is Released and Available to Download.md @@ -0,0 +1,128 @@ +[#]: subject: "The Much Awaited Linux Mint 21 is Released and Available to Download" +[#]: via: "https://news.itsfoss.com/linux-mint-21-release/" +[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14884-1.html" + +期待已久的 Linux Mint 21 发布 +====== + +> Linux Mint 终于发布了基于 Ubuntu 22.04 LTS 的 “Vanessa”,并带来了很多有用的改进。 + +![linux mint 21][1] + +Linux Mint 是 [最受欢迎的 Linux 发行版之一][2]。它使用 Ubuntu 作为其基础,特别是它基于 [长期支持][3] 的 Ubuntu 版本,以获得长达 5 年的软件支持。 + +现在,我们有一个新的版本升级,即 **Linux Mint 21 “Vanessa”**,它基于 4 月份最新发布的 [Ubuntu 22.04 LTS 版本][4]。因此,用户可以预期它的安全更新可以支持到 2027 年。 + +让我们来看看这个版本的亮点。 + +### Linux Mint 21 Vanessa 的新亮点 + +![][5] + +它采用了稳定的、改进的 [Linux 5.15 LTS 内核][6],Linux Mint 21 带来了一系列新的增加、变化和完善。 + +#### 现有用户的升级工具 + +![][7] + +现有的 Mint 20.3 用户可以使用新的基于 GUI 的升级工具轻松更新他们的系统。 + +用户会看到一个需要安装或升级的新软件包的列表,这也包括了对你可能手动添加的第三方 PPA 库的检查。 + +#### 新的蓝牙管理器 + +![][8] + +Blueman 现在取代了图形界面的 GNOME 蓝牙管理器 Blueberry。 + +之所以这样做,主要是因为 Blueman 提供了更多的功能和连接选项,以及对多种桌面环境的更好支持。此外,Blueman 的用户界面与 Linux Mint 完美地融合在一起。 + +Blueman 包括一些高级选项,可能大多数用户用不到,但它是一个好工具。 + +#### 新的进程监控托盘图标 + +![][9] + +不管是对于资深用户还是初级用户来说,一个非常有用的功能是引入了一个新的托盘图标,可以监控进程! + +这个托盘图标将通知用户是否有任何自动化进程(如更新和系统快照)在后台运行。 + +当系统变得缓慢时,Mint 用户将很容易知道该去哪里找到问题! + +#### 增强的缩略图支持 + +![][10] + +以前,一些文件类型没有任何缩略图显示,这样的用户体验不是很好。 + +为了解决这个问题,这个版本引入了一个新的项目 *xapp-thumbnails*,并为包括 AppImage、ePub、MP3、RAW 图片和 WebP 在内的文件类型带来了缩略图支持。 + +#### XApp 的改进 + +以前的 Timeshift 备份工具现在成为了一个 XApp,并由 Mint 团队正式维护。此外,在 rsync 模式下,如果快照导致磁盘上的可用空间少于 1GB,则会计算出下一次快照所需的空间并跳过下一次快照。 + +Xviewer、Warpinator、Thingy 和 WebApp 管理器也有了其他改进。 + +#### Cinnamon 5.4.2 + +Linux Mint 的旗舰桌面环境 Cinnamon 得到了良好的内部升级。 + +默认的窗口管理器 Muffin 现在重新基于较新的 Mutter 3.36 代码库开发。 + +窗口 UI 也有一些细微的改进,包括主题和动画。 + +![][11] + +### 其他增加的功能和改进 + +其他一些变化包括: + +* 改进了对 AppImage 的支持,这与 Ubuntu 22.04 不同 +* 目录中出现了一组新的漂亮的壁纸 + +你可以在我们专门的 [Linux Mint 21 功能][12] 文章中探索更多关于它的新亮点。 + +### 获取 Linux Mint 21 + +如果你正在使用 Mint 20.3,你应该能在几天内升级到 Mint 21。图形化的更新过程应该会在几天后出现。 + +你可以选择从 Linux Mint 的下载页面下载 ISO,进行全新安装。 + +> **[获取 Linux Mint 21][13]** + +如果你的网络速度慢或不稳定,你也可以 [用这个种子链接][14]。 + +享受新鲜的 Mint 吧 🙂 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/linux-mint-21-release/ + +作者:[Rishabh Moharir][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/rishabh/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/07/linux-mint-21-release.jpg +[2]: https://itsfoss.com/best-linux-distributions/ +[3]: https://itsfoss.com/long-term-support-lts/ +[4]: https://news.itsfoss.com/ubuntu-22-04-release/ +[5]: https://news.itsfoss.com/wp-content/uploads/2022/07/linux-mint-21-new.jpg +[6]: https://news.itsfoss.com/linux-kernel-5-15-release/ +[7]: https://news.itsfoss.com/wp-content/uploads/2022/07/upgradetool.webp +[8]: https://news.itsfoss.com/wp-content/uploads/2022/07/blueman.png +[9]: https://news.itsfoss.com/wp-content/uploads/2022/07/monitor.png +[10]: https://news.itsfoss.com/wp-content/uploads/2022/07/thumbnails.png +[11]: https://news.itsfoss.com/wp-content/uploads/2022/07/animations.png +[12]: https://itsfoss.com/linux-mint-21-features/ +[13]: https://linuxmint.com/download.php +[14]: https://linuxmint.com/torrents/ diff --git a/published/20220802 Secure Boot Disabled- GNOME Will Soon Warn You About it.md b/published/20220802 Secure Boot Disabled- GNOME Will Soon Warn You About it.md new file mode 100644 index 0000000000..a4fd67ff80 --- /dev/null +++ b/published/20220802 Secure Boot Disabled- GNOME Will Soon Warn You About it.md @@ -0,0 +1,93 @@ +[#]: subject: "Secure Boot Disabled? GNOME Will Soon Warn You About it!" +[#]: via: "https://news.itsfoss.com/gnome-secure-boot-warning/" +[#]: author: "Anuj Sharma https://news.itsfoss.com/author/anuj/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14892-1.html" + +如果禁用了安全启动,GNOME 就会发出警告 +====== + +> GNOME 正计划通知用户其固件安全状态,来保护不安全的硬件。 + +![](https://news.itsfoss.com/wp-content/uploads/2022/08/gnome-secure-boot-warning.jpg) + +当你在支持 UEFI 的电脑上安装 Linux 时,你必须禁用“安全启动Secure Boot”,因为启用该选项后,不能使用现场 USBLive USB 启动。 + +一些主流的 Linux 发行版支持安全启动,但对于许多其他发行版(以及板载的 Nvidia 硬件)来说,它的设置仍然具有挑战性。 + +虽然一年又一年,情况似乎并没有改善,但总的来说,安全启动是一个必不可少的保护功能。 + +因此,正如 [Phoronix][1] 所发现的,为了方便和让用户意识到这一点,GNOME 和红帽的开发者正在努力在安全启动被禁用时通知(或警告)用户。 + +### 它有什么用? + +UEFI/安全启动被批评为 DRM,因为它剥夺了用户的自由。开源社区的许多人仍然不赞同实施 UEFI/安全启动和 TPM,因为它带来了不便。这就催生了像 [Coreboot][2] 这样的项目在开源世界中蓬勃发展。 + +当然,如果你每天都用 Linux,我会建议你购买支持 Coreboot 的新硬件,这是一个不同的故事。 + +话虽如此,但可以肯定的是,安全启动是最简单的方法。 + +考虑到捆绑的专有固件,安全启动的安全性仍然值得商榷。但是,它是一个确保系统的固件安全的基本保护机制。 + +所以,开发者准备在启动闪屏([Plymouth][3])、GNOME 显示管理器(GDM)和 GNOME 控制中心显示警告。 + +![图片来源:GNOME 博客][4] + +GNOME 的一位开发者在 [博客文章][5] 中分享了它的更多细节,同时给出了其中的一些屏幕截图。 + +![][6] + +一位来自红帽的开发者在 [合并请求][7] 中提到。 + +> 安全启动被用来对付一些恶意软件试图感染系统的固件的安全威胁。用户可能会无意中禁用或软件可能会有意禁用安全启动。因此,配置不正确的话,系统就运行在一个不安全的平台上。如果启动闪屏能向用户提供一个警告,用户可以重新启动并重新配置他们的系统,或者立即寻求帮助。 + +所以,作为一个 GNOME 用户,当它进入 GNOME 43 的最终版本或任何未来的版本时,我乐于看到它所带来的变化。 + +如果你也想看看,你可以在 GNOME 控制中心的“隐私Privacy”标签下的“设备安全Device Security”部分找到这个选项,如下图所示,我的机器在 Arch Linux 上运行 GNOME 43 alpha。 + +![][8] + +该菜单还可以显示 TPM、英特尔 BootGuard 和 IOMMU 保护的细节。 + +![][9] + +看来我的系统并不像我想象的那么安全……但也许这就是这个功能的意义所在? + +如果你只在你的 Linux 发行版上使用 UEFI 模式,并且为了方便而关闭了安全保护功能,这能让你意识到这一点吗? + +有可能。但是,看看 Linux 发行版的状况和启用安全启动的问题。我不觉得这可能会是一个大问题。我们很快就会知道了。 + +### 如何禁用这个警告? + +正如在 GNOME Gitlab 的 [合并请求][10] 中提到的,在你的内核参数中添加 `sb-check=false` 就可以禁用这些警告。 + +不过,作为终端用户,你不需要担心这个问题。 + +你对即将在 GNOME 43 或更高版本中增加的这个功能有什么看法?你对 UEFI/安全启动有什么看法? + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/gnome-secure-boot-warning/ + +作者:[Anuj Sharma][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/anuj/ +[b]: https://github.com/lujun9972 +[1]: https://www.phoronix.com/news/GNOME-Secure-Boot-Warning +[2]: https://www.coreboot.org/ +[3]: https://gitlab.freedesktop.org/plymouth +[4]: https://news.itsfoss.com/wp-content/uploads/2022/08/gnome-secure-boot-mockup.png +[5]: https://blogs.gnome.org/hughsie/2022/07/29/emulated-host-profiles-in-fwupd/ +[6]: https://news.itsfoss.com/wp-content/uploads/2022/08/boot-security.png +[7]: https://gitlab.freedesktop.org/plymouth/plymouth/-/merge_requests/176 +[8]: https://news.itsfoss.com/wp-content/uploads/2022/07/secure-boot-gnome.png +[9]: https://news.itsfoss.com/wp-content/uploads/2022/07/secure-boot-gnome1.png +[10]: https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2333 diff --git a/published/20220804 Peppermint OS Now Also Offers a Systemd-free Devuan Variant!.md b/published/20220804 Peppermint OS Now Also Offers a Systemd-free Devuan Variant!.md new file mode 100644 index 0000000000..15704a4724 --- /dev/null +++ b/published/20220804 Peppermint OS Now Also Offers a Systemd-free Devuan Variant!.md @@ -0,0 +1,74 @@ +[#]: subject: "Peppermint OS Now Also Offers a Systemd-free Devuan Variant!" +[#]: via: "https://news.itsfoss.com/peppermint-os-devuan/" +[#]: author: "Sagar Sharma https://news.itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14906-1.html" + +Peppermint OS 现在也提供无 systemd 的 Devuan 变体了! +====== + +> 基于 Devuan 的 Peppermint OS 可能是无 systemd 发行版中一个令人振奋的新成员。听起来不错吧? + +![peppermint][1] + +作为 [最轻量级和最灵活的 Linux 发行版之一][2],Peppermint OS 现在提供一个基于 Devuan 的 ISO,可以让高级用户对他们的系统有更多的控制。 + +随着他们发布了 Peppermint OS 11,[他们放弃使用 Ubuntu][3] 作为基础,而使用 Debian,使 Peppermint OS 更加稳定和可靠。 + +### 基于 Devuan 的 Peppermint OS + +![Peppermint OS devuan][4] + +那么,首先 Devuan 是什么? + +Devuan 是 Debian 的一个分叉,没有 systemd,所以用户可以拥有移植性和选择的自由。 + +是否使用 systemd 经常发生争论,这就是为什么我们有一个 [无 systemd 的 Linux 发行版][5] 的列表,但只有少数几个可以提供开箱即用的精良体验。 + +现在,基于 Devuan 的 Peppermint OS 版本应该是这个列表中令人振奋的补充。 + +如果你想要一个无 systemd 的发行版,给你的操作系统更多的自由,这应该是一个不错的尝试。 + +别担心,Peppermint OS 的 Debian 版将会继续存在。所以,你可以期待基于 Devuan 和基于 Debian 的 ISO 都可以使用。 + +### 你需要无 systemd 发行版吗? + +systemd 是一个初始化系统。当你启动你的 Linux 机器时,初始化系统是最先启动的程序之一,并将一直运行到你使用电脑为止。 + +但 [systemd 不仅仅是一个初始系统][6],它还包含其他软件,如 logind、networkd 等,用于管理 Linux 系统的不同方面。 + +总的来说,它演变成了一个复杂的初始模块。虽然它使许多事情变得简单,但在一些用户看来,它是一个臃肿的解决方案。 + +因此,有用户开始喜欢 Devuan 这样的选项。而且,Peppermint OS 的开发者现在正试图通过使用 Devuan 作为另一个版本的基础,来改善桌面用户的体验。 + +### 下载基于 Devuan 的 Peppermint OS + +对于习惯于无 systemd 的用户来说,这是一个很好的选择。 + +但是,如果你从来没有尝试过无 systemd 的发行版,除非你知道自己在做什么,否则进行切换可能不是一个明智的主意。 + +> **[Peppermint OS (Devuan)][7]** + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/peppermint-os-devuan/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/08/peppermint-devuan.jpg +[2]: https://itsfoss.com/lightweight-linux-beginners/ +[3]: https://news.itsfoss.com/peppermint-11-release/ +[4]: https://news.itsfoss.com/wp-content/uploads/2022/08/Peppermint-OS-Devuan-edition.png +[5]: https://itsfoss.com/systemd-free-distros/#systemd-or-not +[6]: https://freedesktop.org/wiki/Software/systemd/ +[7]: https://peppermintos.com/2022/08/peppermint-os-releases-for-08-02-2022/ diff --git a/published/20220804 Slax Linux Re-Introduces a Slackware Variant With Slax 15 Release.md b/published/20220804 Slax Linux Re-Introduces a Slackware Variant With Slax 15 Release.md new file mode 100644 index 0000000000..491d1d0b2c --- /dev/null +++ b/published/20220804 Slax Linux Re-Introduces a Slackware Variant With Slax 15 Release.md @@ -0,0 +1,72 @@ +[#]: subject: "Slax Linux Re-Introduces a Slackware Variant With Slax 15 Release" +[#]: via: "https://news.itsfoss.com/slax-15-release/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14900-1.html" + +Slax Linux 的 Slackware 变体重新复活 +====== + +> 基于 Slackware 的 Slax 版本在 Slackware 15.0 的基础上进行了升级,并带来一些基本的改进。 + +![](https://news.itsfoss.com/wp-content/uploads/2022/08/slax-15.jpg) + +Slax 是最有趣的 [轻量级 Linux 发行版][1] 之一。 + +它是基于 Slackware 的,是 32 位系统的一个合适选择。如果你尚不知道,Slackware 是最古老的、活跃的 Linux 发行版,并在 6 年后见证了一次重大版本升级,即 [Slackware 15][2] 的发布。 + +此外,Slax 还提供了一个基于 Debian 的替代版本,该版本正在积极维护。正如创作者在博文中提到的,这是由于基于 Slackware 的版本(Slax 14)在很长一段时间内(9 年)没有得到更新。 + +因此,看到最终以 **Slax 15.0** 的形式发布了重大升级版本,以及也对其 Debian 版本(即 **Slax 11.4.0**)进行小幅更新,还是令人感动。 + +有趣的是,这个版本早在 2022 年 7 月就向其支持者提供了。而现在,所有人都可以下载和试用了。 + +让我来介绍一下新的变化。 + +### Slax 15.0 和 Slax 11.4 发布 + +为了解决关键的升级问题,Slax 15.0 带来了 Slackware 15.0 中添加的改进。 + +这应该包括增加了 [Linux 内核 5.15 LTS][3],即增强的 NTFS 驱动支持,以及对英特尔/AMD 处理器的支持改进。你可以看看这个内核变体,提供了更多内置驱动程序,或者了解一下节省内存和启动时警告的通用选项。 + +该个发布版本通过插件支持 slackpkg,这意味着你可以从各种软件库中安装软件,包括官方的 Slackware 仓库和 SlackOnly 仓库。 + +Slax 15.0 还涉及到一个更新的关机程序,对设备的卸载处理更加完善。 + +考虑到 Slax 不再是一个基于 KDE 的发行版。因此,当你下载 Slackware 或 Debian 版本的 ISO 时,你得到的是一个基于 Fluxbox 的版本。 + +而对于 Debian 版本,你会发现它的更新是基于 **Debian 11.4** “Bullseye” 的。 + +### 下载 Slax 15.0 和 Slax 11.4 + +你无法找到基于 Slackware 的版本的 32 位版本,而只能找到基于 Debian 的。 + +其 ISO 文件可以在其官方网站上下载。如果你想以某种方式支持该项目,也可以选择购买。 + +> **[Slax 15.0][4]** + +无论哪种情况,你都可以前往其 [Patreon 页面][5] 以示支持。 + +你对 Slax 15.0 的发布有什么看法?你试过了吗? + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/slax-15-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/lightweight-linux-beginners/ +[2]: https://news.itsfoss.com/slackware-15-release/ +[3]: https://news.itsfoss.com/linux-kernel-5-15-release/ +[4]: https://www.slax.org/ +[5]: https://patreon.com/slax/ diff --git a/sources/talk/20191106 How Much of a Genius-Level Move Was Using Binary Space Partitioning in Doom.md b/sources/talk/20191106 How Much of a Genius-Level Move Was Using Binary Space Partitioning in Doom.md deleted file mode 100644 index 38496565a4..0000000000 --- a/sources/talk/20191106 How Much of a Genius-Level Move Was Using Binary Space Partitioning in Doom.md +++ /dev/null @@ -1,173 +0,0 @@ -[#]: subject: "How Much of a Genius-Level Move Was Using Binary Space Partitioning in Doom?" -[#]: via: "https://twobithistory.org/2019/11/06/doom-bsp.html" -[#]: author: "Two-Bit History https://twobithistory.org" -[#]: collector: "lujun9972" -[#]: translator: "aREversez" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How Much of a Genius-Level Move Was Using Binary Space Partitioning in Doom? -====== - -In 1993, id Software released the first-person shooter _Doom_, which quickly became a phenomenon. The game is now considered one of the most influential games of all time. - -A decade after _Doom_’s release, in 2003, journalist David Kushner published a book about id Software called _Masters of Doom_, which has since become the canonical account of _Doom_’s creation. I read _Masters of Doom_ a few years ago and don’t remember much of it now, but there was one story in the book about lead programmer John Carmack that has stuck with me. This is a loose gloss of the story (see below for the full details), but essentially, early in the development of _Doom_, Carmack realized that the 3D renderer he had written for the game slowed to a crawl when trying to render certain levels. This was unacceptable, because _Doom_ was supposed to be action-packed and frenetic. So Carmack, realizing the problem with his renderer was fundamental enough that he would need to find a better rendering algorithm, started reading research papers. He eventually implemented a technique called “binary space partitioning,” never before used in a video game, that dramatically sped up the _Doom_ engine. - -That story about Carmack applying cutting-edge academic research to video games has always impressed me. It is my explanation for why Carmack has become such a legendary figure. He deserves to be known as the archetypal genius video game programmer for all sorts of reasons, but this episode with the academic papers and the binary space partitioning is the justification I think of first. - -Obviously, the story is impressive because “binary space partitioning” sounds like it would be a difficult thing to just read about and implement yourself. I’ve long assumed that what Carmack did was a clever intellectual leap, but because I’ve never understood what binary space partitioning is or how novel a technique it was when Carmack decided to use it, I’ve never known for sure. On a spectrum from Homer Simpson to Albert Einstein, how much of a genius-level move was it really for Carmack to add binary space partitioning to _Doom_? - -I’ve also wondered where binary space partitioning first came from and how the idea found its way to Carmack. So this post is about John Carmack and _Doom_, but it is also about the history of a data structure: the binary space partitioning tree (or BSP tree). It turns out that the BSP tree, rather interestingly, and like so many things in computer science, has its origins in research conducted for the military. - -That’s right: E1M1, the first level of _Doom_, was brought to you by the US Air Force. - -### The VSD Problem - -The BSP tree is a solution to one of the thorniest problems in computer graphics. In order to render a three-dimensional scene, a renderer has to figure out, given a particular viewpoint, what can be seen and what cannot be seen. This is not especially challenging if you have lots of time, but a respectable real-time game engine needs to figure out what can be seen and what cannot be seen at least 30 times a second. - -This problem is sometimes called the problem of visible surface determination. Michael Abrash, a programmer who worked with Carmack on _Quake_ (id Software’s follow-up to _Doom_), wrote about the VSD problem in his famous _Graphics Programming Black Book_: - -> I want to talk about what is, in my opinion, the toughest 3-D problem of all: visible surface determination (drawing the proper surface at each pixel), and its close relative, culling (discarding non-visible polygons as quickly as possible, a way of accelerating visible surface determination). In the interests of brevity, I’ll use the abbreviation VSD to mean both visible surface determination and culling from now on. - -> Why do I think VSD is the toughest 3-D challenge? Although rasterization issues such as texture mapping are fascinating and important, they are tasks of relatively finite scope, and are being moved into hardware as 3-D accelerators appear; also, they only scale with increases in screen resolution, which are relatively modest. - -> In contrast, VSD is an open-ended problem, and there are dozens of approaches currently in use. Even more significantly, the performance of VSD, done in an unsophisticated fashion, scales directly with scene complexity, which tends to increase as a square or cube function, so this very rapidly becomes the limiting factor in rendering realistic worlds.[1][1] - -Abrash was writing about the difficulty of the VSD problem in the late ’90s, years after _Doom_ had proved that regular people wanted to be able to play graphically intensive games on their home computers. In the early ’90s, when id Software first began publishing games, the games had to be programmed to run efficiently on computers not designed to run them, computers meant for word processing, spreadsheet applications, and little else. To make this work, especially for the few 3D games that id Software published before _Doom_, id Software had to be creative. In these games, the design of all the levels was constrained in such a way that the VSD problem was easier to solve. - -For example, in _Wolfenstein 3D_, the game id Software released just prior to _Doom_, every level is made from walls that are axis-aligned. In other words, in the Wolfenstein universe, you can have north-south walls or west-east walls, but nothing else. Walls can also only be placed at fixed intervals on a grid—all hallways are either one grid square wide, or two grid squares wide, etc., but never 2.5 grid squares wide. Though this meant that the id Software team could only design levels that all looked somewhat the same, it made Carmack’s job of writing a renderer for _Wolfenstein_ much simpler. - -The _Wolfenstein_ renderer solved the VSD problem by “marching” rays into the virtual world from the screen. Usually a renderer that uses rays is a “raycasting” renderer—these renderers are often slow, because solving the VSD problem in a raycaster involves finding the first intersection between a ray and something in your world, which in the general case requires lots of number crunching. But in _Wolfenstein_, because all the walls are aligned with the grid, the only location a ray can possibly intersect a wall is at the grid lines. So all the renderer needs to do is check each of those intersection points. If the renderer starts by checking the intersection point nearest to the player’s viewpoint, then checks the next nearest, and so on, and stops when it encounters the first wall, the VSD problem has been solved in an almost trivial way. A ray is just marched forward from each pixel until it hits something, which works because the marching is so cheap in terms of CPU cycles. And actually, since all walls are the same height, it is only necessary to march a single ray for every _column_ of pixels. - -This rendering shortcut made _Wolfenstein_ fast enough to run on underpowered home PCs in the era before dedicated graphics cards. But this approach would not work for _Doom_, since the id team had decided that their new game would feature novel things like diagonal walls, stairs, and ceilings of different heights. Ray marching was no longer viable, so Carmack wrote a different kind of renderer. Whereas the _Wolfenstein_ renderer, with its ray for every column of pixels, is an “image-first” renderer, the _Doom_ renderer is an “object-first” renderer. This means that rather than iterating through the pixels on screen and figuring out what color they should be, the _Doom_ renderer iterates through the objects in a scene and projects each onto the screen in turn. - -In an object-first renderer, one easy way to solve the VSD problem is to use a z-buffer. Each time you project an object onto the screen, for each pixel you want to draw to, you do a check. If the part of the object you want to draw is closer to the player than what was already drawn to the pixel, then you can overwrite what is there. Otherwise you have to leave the pixel as is. This approach is simple, but a z-buffer requires a lot of memory, and the renderer may still expend a lot of CPU cycles projecting level geometry that is never going to be seen by the player. - -In the early 1990s, there was an additional drawback to the z-buffer approach: On IBM-compatible PCs, which used a video adapter system called VGA, writing to the output frame buffer was an expensive operation. So time spent drawing pixels that would only get overwritten later tanked the performance of your renderer. - -Since writing to the frame buffer was so expensive, the ideal renderer was one that started by drawing the objects closest to the player, then the objects just beyond those objects, and so on, until every pixel on screen had been written to. At that point the renderer would know to stop, saving all the time it might have spent considering far-away objects that the player cannot see. But ordering the objects in a scene this way, from closest to farthest, is tantamount to solving the VSD problem. Once again, the question is: What can be seen by the player? - -Initially, Carmack tried to solve this problem by relying on the layout of _Doom_’s levels. His renderer started by drawing the walls of the room currently occupied by the player, then flooded out into neighboring rooms to draw the walls in those rooms that could be seen from the current room. Provided that every room was convex, this solved the VSD issue. Rooms that were not convex could be split into convex “sectors.” You can see how this rendering technique might have looked if run at extra-slow speed [in this video][2], where YouTuber Bisqwit demonstrates a renderer of his own that works according to the same general algorithm. This algorithm was successfully used in Duke Nukem 3D, released three years after _Doom_, when CPUs were more powerful. But, in 1993, running on the hardware then available, the _Doom_ renderer that used this algorithm struggled with complicated levels—particularly when sectors were nested inside of each other, which was the only way to create something like a circular pit of stairs. A circular pit of stairs led to lots of repeated recursive descents into a sector that had already been drawn, strangling the game engine’s speed. - -Around the time that the id team realized that the _Doom_ game engine might be too slow, id Software was asked to port _Wolfenstein 3D_ to the Super Nintendo. The Super Nintendo was even less powerful than the IBM-compatible PCs of the day, and it turned out that the ray-marching _Wolfenstein_ renderer, simple as it was, didn’t run fast enough on the Super Nintendo hardware. So Carmack began looking for a better algorithm. It was actually for the Super Nintendo port of _Wolfenstein_ that Carmack first researched and implemented binary space partitioning. In _Wolfenstein_, this was relatively straightforward because all the walls were axis-aligned; in _Doom_, it would be more complex. But Carmack realized that BSP trees would solve _Doom_’s speed problems too. - -### Binary Space Partitioning - -Binary space partitioning makes the VSD problem easier to solve by splitting a 3D scene into parts ahead of time. For now, you just need to grasp why splitting a scene is useful: If you draw a line (really a plane in 3D) across your scene, and you know which side of the line the player or camera viewpoint is on, then you also know that nothing on the other side of the line can obstruct something on the viewpoint’s side of the line. If you repeat this process many times, you end up with a 3D scene split into many sections, which wouldn’t be an improvement on the original scene except now you know more about how different parts of the scene can obstruct each other. - -The first people to write about dividing a 3D scene like this were researchers trying to establish for the US Air Force whether computer graphics were sufficiently advanced to use in flight simulators. They released their findings in a 1969 report called “Study for Applying Computer-Generated Images to Visual Simulation.” The report concluded that computer graphics could be used to train pilots, but also warned that the implementation would be complicated by the VSD problem: - -> One of the most significant problems that must be faced in the real-time computation of images is the priority, or hidden-line, problem. In our everyday visual perception of our surroundings, it is a problem that nature solves with trivial ease; a point of an opaque object obscures all other points that lie along the same line of sight and are more distant. In the computer, the task is formidable. The computations required to resolve priority in the general case grow exponentially with the complexity of the environment, and soon they surpass the computing load associated with finding the perspective images of the objects.[2][3] - -One solution these researchers mention, which according to them was earlier used in a project for NASA, is based on creating what I am going to call an “occlusion matrix.” The researchers point out that a plane dividing a scene in two can be used to resolve “any priority conflict” between objects on opposite sides of the plane. In general you might have to add these planes explicitly to your scene, but with certain kinds of geometry you can just rely on the faces of the objects you already have. They give the example in the figure below, where \\(p_1\\), \\(p_2\\), and \\(p_3\\) are the separating planes. If the camera viewpoint is on the forward or “true” side of one of these planes, then \\(p_i\\) evaluates to 1. The matrix shows the relationships between the three objects based on the three dividing planes and the location of the camera viewpoint—if object \\(a_i\\) obscures object \\(a_j\\), then entry \\(a_{ij}\\) in the matrix will be a 1. - -![][4] - -The researchers propose that this matrix could be implemented in hardware and re-evaluated every frame. Basically the matrix would act as a big switch or a kind of pre-built z-buffer. When drawing a given object, no video would be output for the parts of the object when a 1 exists in the object’s column and the corresponding row object is also being drawn. - -The major drawback with this matrix approach is that to represent a scene with \\(n\\) objects you need a matrix of size \\(n^2\\). So the researchers go on to explore whether it would be feasible to represent the occlusion matrix as a “priority list” instead, which would only be of size \\(n\\) and would establish an order in which objects should be drawn. They immediately note that for certain scenes like the one in the figure above no ordering can be made (since there is an occlusion cycle), so they spend a lot of time laying out the mathematical distinction between “proper” and “improper” scenes. Eventually they conclude that, at least for “proper” scenes—and it should be easy enough for a scene designer to avoid “improper” cases—a priority list could be generated. But they leave the list generation as an exercise for the reader. It seems the primary contribution of this 1969 study was to point out that it should be possible to use partitioning planes to order objects in a scene for rendering, at least _in theory_. - -It was not until 1980 that a paper, titled “On Visible Surface Generation by A Priori Tree Structures,” demonstrated a concrete algorithm to accomplish this. The 1980 paper, written by Henry Fuchs, Zvi Kedem, and Bruce Naylor, introduced the BSP tree. The authors say that their novel data structure is “an alternative solution to an approach first utilized a decade ago but due to a few difficulties, not widely exploited”—here referring to the approach taken in the 1969 Air Force study.[3][5] A BSP tree, once constructed, can easily be used to provide a priority ordering for objects in the scene. - -Fuchs, Kedem, and Naylor give a pretty readable explanation of how a BSP tree works, but let me see if I can provide a less formal but more concise one. - -You begin by picking one polygon in your scene and making the plane in which the polygon lies your partitioning plane. That one polygon also ends up as the root node in your tree. The remaining polygons in your scene will be on one side or the other of your root partitioning plane. The polygons on the “forward” side or in the “forward” half-space of your plane end up in the left subtree of your root node, while the polygons on the “back” side or in the “back” half-space of your plane end up in the right subtree. You then repeat this process recursively, picking a polygon from your left and right subtrees to be the new partitioning planes for their respective half-spaces, which generates further half-spaces and further sub-trees. You stop when you run out of polygons. - -Say you want to render the geometry in your scene from back-to-front. (This is known as the “painter’s algorithm,” since it means that polygons further from the camera will get drawn over by polygons closer to the camera, producing a correct rendering.) To achieve this, all you have to do is an in-order traversal of the BSP tree, where the decision to render the left or right subtree of any node first is determined by whether the camera viewpoint is in either the forward or back half-space relative to the partitioning plane associated with the node. So at each node in the tree, you render all the polygons on the “far” side of the plane first, then the polygon in the partitioning plane, then all the polygons on the “near” side of the plane—”far” and “near” being relative to the camera viewpoint. This solves the VSD problem because, as we learned several paragraphs back, the polygons on the far side of the partitioning plane cannot obstruct anything on the near side. - -The following diagram shows the construction and traversal of a BSP tree representing a simple 2D scene. In 2D, the partitioning planes are instead partitioning lines, but the basic idea is the same in a more complicated 3D scene. - -![][6] _Step One: The root partitioning line along wall D splits the remaining geometry into two sets._ - -![][7] _Step Two: The half-spaces on either side of D are split again. Wall C is the only wall in its half-space so no split is needed. Wall B forms the new partitioning line in its half-space. Wall A must be split into two walls since it crosses the partitioning line._ - -![][8] _A back-to-front ordering of the walls relative to the viewpoint in the top-right corner, useful for implementing the painter’s algorithm. This is just an in-order traversal of the tree._ - -The really neat thing about a BSP tree, which Fuchs, Kedem, and Naylor stress several times, is that it only has to be constructed once. This is somewhat surprising, but the same BSP tree can be used to render a scene no matter where the camera viewpoint is. The BSP tree remains valid as long as the polygons in the scene don’t move. This is why the BSP tree is so useful for real-time rendering—all the hard work that goes into constructing the tree can be done beforehand rather than during rendering. - -One issue that Fuchs, Kedem, and Naylor say needs further exploration is the question of what makes a “good” BSP tree. The quality of your BSP tree will depend on which polygons you decide to use to establish your partitioning planes. I skipped over this earlier, but if you partition using a plane that intersects other polygons, then in order for the BSP algorithm to work, you have to split the intersected polygons in two, so that one part can go in one half-space and the other part in the other half-space. If this happens a lot, then building a BSP tree will dramatically increase the number of polygons in your scene. - -Bruce Naylor, one of the authors of the 1980 paper, would later write about this problem in his 1993 paper, “Constructing Good Partitioning Trees.” According to John Romero, one of Carmack’s fellow id Software co-founders, this paper was one of the papers that Carmack read when he was trying to implement BSP trees in _Doom_.[4][9] - -### BSP Trees in Doom - -Remember that, in his first draft of the _Doom_ renderer, Carmack had been trying to establish a rendering order for level geometry by “flooding” the renderer out from the player’s current room into neighboring rooms. BSP trees were a better way to establish this ordering because they avoided the issue where the renderer found itself visiting the same room (or sector) multiple times, wasting CPU cycles. - -“Adding BSP trees to _Doom_” meant, in practice, adding a BSP tree generator to the _Doom_ level editor. When a level in _Doom_ was complete, a BSP tree was generated from the level geometry. According to Fabien Sanglard, the generation process could take as long as eight seconds for a single level and 11 minutes for all the levels in the original _Doom_.[5][10] The generation process was lengthy in part because Carmack’s BSP generation algorithm tries to search for a “good” BSP tree using various heuristics. An eight-second delay would have been unforgivable at runtime, but it was not long to wait when done offline, especially considering the performance gains the BSP trees brought to the renderer. The generated BSP tree for a single level would have then ended up as part of the level data loaded into the game when it starts. - -Carmack put a spin on the BSP tree algorithm outlined in the 1980 paper, because once _Doom_ is started and the BSP tree for the current level is read into memory, the renderer uses the BSP tree to draw objects front-to-back rather than back-to-front. In the 1980 paper, Fuchs, Kedem, and Naylor show how a BSP tree can be used to implement the back-to-front painter’s algorithm, but the painter’s algorithm involves a lot of over-drawing that would have been expensive on an IBM-compatible PC. So the _Doom_ renderer instead starts with the geometry closer to the player, draws that first, then draws the geometry farther away. This reverse ordering is easy to achieve using a BSP tree, since you can just make the opposite traversal decision at each node in the tree. To ensure that the farther-away geometry is not drawn over the closer geometry, the _Doom_ renderer uses a kind of implicit z-buffer that provides much of the benefit of a z-buffer with a much smaller memory footprint. There is one array that keeps track of occlusion in the horizontal dimension, and another two arrays that keep track of occlusion in the vertical dimension from the top and bottom of the screen. The _Doom_ renderer can get away with not using an actual z-buffer because _Doom_ is not technically a fully 3D game. The cheaper data structures work because certain things never appear in _Doom_: The horizontal occlusion array works because there are no sloping walls, and the vertical occlusion arrays work because no walls have, say, two windows, one above the other. - -The only other tricky issue left is how to incorporate _Doom_’s moving characters into the static level geometry drawn with the aid of the BSP tree. The enemies in _Doom_ cannot be a part of the BSP tree because they move; the BSP tree only works for geometry that never moves. So the _Doom_ renderer draws the static level geometry first, keeping track of the segments of the screen that were drawn to (with yet another memory-efficient data structure). It then draws the enemies in back-to-front order, clipping them against the segments of the screen that occlude them. This process is not as optimal as rendering using the BSP tree, but because there are usually fewer enemies visible than there is level geometry in a level, speed isn’t as much of an issue here. - -Using BSP trees in _Doom_ was a major win. Obviously it is pretty neat that Carmack was able to figure out that BSP trees were the perfect solution to his problem. But was it a _genius_-level move? - -In his excellent book about the _Doom_ game engine, Fabien Sanglard quotes John Romero saying that Bruce Naylor’s paper, “Constructing Good Partitioning Trees,” was mostly about using BSP trees to cull backfaces from 3D models.[6][11] According to Romero, Carmack thought the algorithm could still be useful for _Doom_, so he went ahead and implemented it. This description is quite flattering to Carmack—it implies he saw that BSP trees could be useful for real-time video games when other people were still using the technique to render static scenes. There is a similarly flattering story in _Masters of Doom_: Kushner suggests that Carmack read Naylor’s paper and asked himself, “what if you could use a BSP to create not just one 3D image but an entire virtual world?”[7][12] - -This framing ignores the history of the BSP tree. When those US Air Force researchers first realized that partitioning a scene might help speed up rendering, they were interested in speeding up _real-time_ rendering, because they were, after all, trying to create a flight simulator. The flight simulator example comes up again in the 1980 BSP paper. Fuchs, Kedem, and Naylor talk about how a BSP tree would be useful in a flight simulator that pilots use to practice landing at the same airport over and over again. Since the airport geometry never changes, the BSP tree can be generated just once. Clearly what they have in mind is a real-time simulation. In the introduction to their paper, they even motivate their research by talking about how real-time graphics systems must be able to create an image in at least 1/30th of a second. - -So Carmack was not the first person to think of using BSP trees in a real-time graphics simulation. Of course, it’s one thing to anticipate that BSP trees might be used this way and another thing to actually do it. But even in the implementation Carmack may have had more guidance than is commonly assumed. The [Wikipedia page about BSP trees][13], at least as of this writing, suggests that Carmack consulted a 1991 paper by Chen and Gordon as well as a 1990 textbook called _Computer Graphics: Principles and Practice_. Though no citation is provided for this claim, it is probably true. The 1991 Chen and Gordon paper outlines a front-to-back rendering approach using BSP trees that is basically the same approach taken by _Doom_, right down to what I’ve called the “implicit z-buffer” data structure that prevents farther polygons being drawn over nearer polygons. The textbook provides a great overview of BSP trees and some pseudocode both for building a tree and for displaying one. (I’ve been able to skim through the 1990 edition thanks to my wonderful university library.) _Computer Graphics: Principles and Practice_ is a classic text in computer graphics, so Carmack might well have owned it. - -Still, Carmack found himself faced with a novel problem—”How can we make a first-person shooter run on a computer with a CPU that can’t even do floating-point operations?”—did his research, and proved that BSP trees are a useful data structure for real-time video games. I still think that is an impressive feat, even if the BSP tree had first been invented a decade prior and was pretty well theorized by the time Carmack read about it. Perhaps the accomplishment that we should really celebrate is the _Doom_ game engine as a whole, which is a seriously nifty piece of work. I’ve mentioned it once already, but Fabien Sanglard’s book about the _Doom_ game engine (_Game Engine Black Book: DOOM_) is an excellent overview of all the different clever components of the game engine and how they fit together. We shouldn’t forget that the VSD problem was just one of many problems that Carmack had to solve to make the _Doom_ engine work. That he was able, on top of everything else, to read about and implement a complicated data structure unknown to most programmers speaks volumes about his technical expertise and his drive to perfect his craft. - -_If you enjoyed this post, more like it come out every four weeks! Follow [@TwoBitHistory][14] on Twitter or subscribe to the [RSS feed][15] to make sure you know when a new post is out._ - -_Previously on TwoBitHistory…_ - -> I've wanted to learn more about GNU Readline for a while, so I thought I'd turn that into a new blog post. Includes a few fun facts from an email exchange with Chet Ramey, who maintains Readline (and Bash): -> -> — TwoBitHistory (@TwoBitHistory) [August 22, 2019][16] - - 1. Michael Abrash, “Michael Abrash’s Graphics Programming Black Book,” James Gregory, accessed November 6, 2019, . [↩︎][17] - - 2. R. Schumacher, B. Brand, M. Gilliland, W. Sharp, “Study for Applying Computer-Generated Images to Visual Simulation,” Air Force Human Resources Laboratory, December 1969, accessed on November 6, 2019, . [↩︎][18] - - 3. Henry Fuchs, Zvi Kedem, Bruce Naylor, “On Visible Surface Generation By A Priori Tree Structures,” ACM SIGGRAPH Computer Graphics, July 1980. [↩︎][19] - - 4. Fabien Sanglard, Game Engine Black Book: DOOM (CreateSpace Independent Publishing Platform, 2018), 200. [↩︎][20] - - 5. Sanglard, 206. [↩︎][21] - - 6. Sanglard, 200. [↩︎][22] - - 7. David Kushner, Masters of Doom (Random House Trade Paperbacks, 2004), 142. [↩︎][23] - - - - --------------------------------------------------------------------------------- - -via: https://twobithistory.org/2019/11/06/doom-bsp.html - -作者:[Two-Bit History][a] -选题:[lujun9972][b] -译者:[aREversez](https://github.com/aREversez) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://twobithistory.org -[b]: https://github.com/lujun9972 -[1]: tmp.eMwywbWYsp#fn:1 -[2]: https://youtu.be/HQYsFshbkYw?t=822 -[3]: tmp.eMwywbWYsp#fn:2 -[4]: https://twobithistory.org/images/matrix_figure.png -[5]: tmp.eMwywbWYsp#fn:3 -[6]: https://twobithistory.org/images/bsp.svg -[7]: https://twobithistory.org/images/bsp1.svg -[8]: https://twobithistory.org/images/bsp2.svg -[9]: tmp.eMwywbWYsp#fn:4 -[10]: tmp.eMwywbWYsp#fn:5 -[11]: tmp.eMwywbWYsp#fn:6 -[12]: tmp.eMwywbWYsp#fn:7 -[13]: https://en.wikipedia.org/wiki/Binary_space_partitioning -[14]: https://twitter.com/TwoBitHistory -[15]: https://twobithistory.org/feed.xml -[16]: https://twitter.com/TwoBitHistory/status/1164631020353859585?ref_src=twsrc%5Etfw -[17]: tmp.eMwywbWYsp#fnref:1 -[18]: tmp.eMwywbWYsp#fnref:2 -[19]: tmp.eMwywbWYsp#fnref:3 -[20]: tmp.eMwywbWYsp#fnref:4 -[21]: tmp.eMwywbWYsp#fnref:5 -[22]: tmp.eMwywbWYsp#fnref:6 -[23]: tmp.eMwywbWYsp#fnref:7 diff --git a/sources/talk/20220723 Why Design Thinking is a box office hit for open source teams.md b/sources/talk/20220723 Why Design Thinking is a box office hit for open source teams.md new file mode 100644 index 0000000000..0802c68ce1 --- /dev/null +++ b/sources/talk/20220723 Why Design Thinking is a box office hit for open source teams.md @@ -0,0 +1,56 @@ +[#]: subject: "Why Design Thinking is a box office hit for open source teams" +[#]: via: "https://opensource.com/article/22/7/design-thinking-open-source-teams" +[#]: author: "Aoife Moloney https://opensource.com/users/aoifemoloney4" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Why Design Thinking is a box office hit for open source teams +====== +You need the freedom to express your opinion at work. Why should planning processes try to box us into silos and acquiescence? + +![4 hot skills for Linux pros in 2017][1] + +Image by: Internet Archive Book Images. Modified by Opensource.com. CC BY-SA 4.0 + +For the past several years, Design Thinking has been providing a way to enhance problem solving within teams, to ensure learning goals are met, and to increase team engagement. In our [previous article][2], we discussed how we used movie posters to "pitch" our projects to stakeholders. In this article, we're going to review the many lessons we've learned from Design Thinking. + +### The box office reviews + +"If you love what you do, then you’ll never work a day in your life" was the angle we were going for when we decided to break our self-imposed ceiling of needing to be formal and business-like to be able to both plan and deliver work. Our planning team was loving the reaction and engagement we were getting from our stakeholders and wider team from using the movie posters instead of documents. It was at this point that we began to realize how we created this arduous and quite frankly boring way of planning our team's work. We had imposed requirements on ourselves of needing to write up documents, transpose that information into a spreadsheet, and then (yes, a third time) into a slide deck. Product owners and planning teams have to do this four times a year, and the cycle was starting to feel heavy and burdensome to us. + +It's crucial for a product owner or a manager (or whoever is planning a development team's work) to present information about what their team could potentially deliver to stakeholders so that the best decision on where to invest time and resources can be made. But that information had begun to feel like it was just text on a page or screen. Stakeholders weren't really buying into what our planning team was half-heartedly selling. If we didn't enjoy talking about our projects, how could we expect our stakeholders to enjoy discussing them? Our project planning team quickly realized we not only needed to introduce the movie posters for the wider teams' and stakeholders' best interests, but for our own sense of enjoyment in our roles, too. We needed to Kill Bill. + +So with Uma Thurman leading the way in our new concept of using movie posters as cover stories, we found ourselves getting excited about creating new ones for each project request. We were going into each call looking forward to the few moments when the movie posters were unveiled, and those on the calls got a laugh about what was chosen. If they hadn't seen a particular movie before, they often shared that, which resulted in a side conversation where people shared movie trivia and began getting to know each other better. All of this from a software project brief in the style of a *Kill Bill Vol. 2* movie poster. It was incredible to watch the interactions happen and relationships form. The conversations in those calls were freeform, unreserved, and extremely valuable to our planning team. Movie posters got everyone talking, which made it easier for participants on the call to ask for more detail about the project, too. + +Our new and improved planning calls were a "box office smash" and the results spoke for themselves. Our quarterly planning calls went from being 90 plus minutes to under 45 minutes, with both team and stakeholders commenting on how included they felt in the decision making process. A lot of this came from developing and expanding on the requirements and insight gathering sessions we'd conducted in the run up to our quarterly planning calls. This was the last remnant of our formal, stiff approach but there was no denying how useful the information gained from those sessions could be to our projects. So we kept it simple again, and started to introduce the movie posters during what we coined the "insight sessions" instead. Our insight sessions were making a big difference by providing space for people to meet and converse about technical details, potential blockers, risks, and opportunities to leverage one piece of technology against another. This was all happening naturally. The ice had been broken with a reveal of a *Ghostbusters* poster or *A Bugs Life*. People turned on cameras and mics to get involved in the conversation about whether they had seen the movies, the remakes, or the original. It became easy for our planning team to guide the already flowing conversations back to the work at hand. + +### That's a wrap + +We were now delivering valuable, enjoyable, and important calls that were generating a lot of success for our team. Our project delivery success rate hit, and stayed at, 100%. We have never, for three years now, had to halt or drop a project once it's been actioned from quarterly planning. We attribute the high engagement levels on our calls, and we believe people are engaged because our calls are novel and fun while still being informative. We're capturing crucial information about each project before it even begins development, so our teams are able to hit the ground running. + +Yes, planning needs to be considered and measured and thorough, but it's to no one's benefit when only one person is doing the thinking, talking, and measuring. It's important to create a culture of open communication and trust for product owners and project managers, so that they can plan work for their teams and bring real value to their stakeholders and end users. It's even more critical for development teams to have the space and tools to plan openly and collaboratively, both with each other and with adjacent teams. + +You need the freedom to express your opinion at work. Why should planning processes try to box us into silos and acquiescence? That's a quick way to lose friends and gain robots. + +Our team is of the firm belief that people deliver projects. We made some changes when we realized that we needed people, with all of their personalities and perspectives, to see what each project meant to them. Then we could determine which ones to work on. We needed the heart and spirit of Agile methodologies in a process that was open, collaborative, and fun for everyone. + +This way of planning and working together is based on using visuals, and trying to enjoy the work we do and the time we spend together at work. It's a means to promote discussion and move those in planning roles from drivers to facilitators so that a unanimous decision can be reached through shared understanding of the work, and the potential trade-offs that comes with it. We chose movie posters, but the concept can be expanded to just about anything! This is our whole point. You don't have to limit your creativity to plan work. If you like music, make an album! Comics? Design one! Or maybe TV shows are more your speed. Take your pick, my friend—it's your cover story. Tell it in the way you enjoy the most, and enjoy not only the informative projects you will generate for your team, but also the sense of camaraderie everyone will feel from having the freedom and safety to grab a coffee or tea, join a call, and talk amongst friends about movies and technology. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/design-thinking-open-source-teams + +作者:[Aoife Moloney][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/aoifemoloney4 +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/lightbulb-idea-think-yearbook-lead.png +[2]: https://opensource.com/article/22/7/design-thinking-engagement-movie-poster diff --git a/sources/talk/20220724 Wayland Core Protocol is Tailored Only for GNOME and That-s Not a Good Thing [Opinion].md b/sources/talk/20220724 Wayland Core Protocol is Tailored Only for GNOME and That-s Not a Good Thing [Opinion].md new file mode 100644 index 0000000000..1a373cc32e --- /dev/null +++ b/sources/talk/20220724 Wayland Core Protocol is Tailored Only for GNOME and That-s Not a Good Thing [Opinion].md @@ -0,0 +1,135 @@ +[#]: subject: "Wayland Core Protocol is Tailored Only for GNOME and That’s Not a Good Thing [Opinion]" +[#]: via: "https://news.itsfoss.com/wayland-core-protocol-issue/" +[#]: author: "Community https://news.itsfoss.com/author/team/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Wayland Core Protocol is Tailored Only for GNOME and That’s Not a Good Thing +====== +And the idea of protocol extensions doesn’t work + +![Wayland GNOME][1] + +Wayland is a display server system based on the idea of [protocols][2]. That means that there is no Wayland display server that clients need to talk to. Instead, Wayland defines a protocol for creating display servers. Any client application that is programmed to use this protocol can work on any display server(or compositor) that fully supports this protocol. It’s like the [world wide web protocols][3], where any website can work on any browser as long as the browser is completely supporting the web protocols. So you don’t create websites for specific browsers. + +That also means that the functions defined in the protocol decide what applications (aka clients) can do & what they can’t do. Returning to the example of the website, if the protocol doesn’t define necessary functions, it will limit the web developers. Take CSS as an example; if it wasn’t available in the web protocols, all websites would have looked the same and boring. So the protocol must include all necessary basics in a way that doesn’t limit developers to a few cases and uses. + +When Wayland developers started defining the protocol, they had to decide what functionalities to include in the protocol. Their decision was to make the protocol as minimal as possible, and compositors shall create new protocols for their specific use cases if they desire to offer more functionality not included in the main protocol. The main protocol was called [Wayland Core protocol][4], and other protocols are called [protocol extensions][5]. All compositors are expected to support the core protocol, and they may not support other protocol extensions. That means that applications that depend on certain functionality defined in one of the protocol extensions will not work on all compositors. + +All of the above is what Wayland developers intended for the Wayland world to be. Now let’s delve into more detail. How much is Wayland core protocol minimal? In other words, what determines what shall be in the core protocol and what shall not be? In this article, I’m going to give you an answer to this question based on my opinion, which is in turn based on a group of simple facts. + +**My opinion is that Wayland’s Core protocol is tailored only for GNOME needs.** + +I mean that the functionalities which exist in Wayland’s core protocol are the bare minimum required for GNOME desktop and apps to work on Wayland. + +That’s bad (still in my opinion) because it’s simply not enough for other desktop environments and apps other than GNOME desktop and apps, as I will show you in this article. + +### 1. The core protocol requires that desktop visual components be drawn by the compositor + +First, let’s explain something. In most desktop environments, desktop components (like dock, panel, wallpaper, desktop icons, etc.) are regular clients. For those components to work, they need certain functions to be implemented by the compositor; those functions include: + +* Ability to move the window +* Ability to tell the compositor to not draw decorations around said windows. +* Ability to keep it above all windows(in case of the panel) or keep it below all windows (in case of the background). +* In addition to some other functionalities. + +On X11, those were defined in the ICCCM specification, which allows X11 clients to tell the compositor to do any of the above. On Wayland, there is not anything in the core protocol that allows that. This means that desktop environment creators have to draw all these in the compositor. + +GNOME is the only desktop that does that, while many other desktops (KDE, XFCE, Lxqt, etc.) draw their components outside the compositor (an exception to that is Cinnamon because it started as a fork of GNOME 3). The situation is even worse. Apps like [plank dock][6], [latte dock][7] and other independent desktop components can’t exist in Wayland. There are protocol extensions that fix that, and I will discuss them later. + +In summary, the situation is: + +* Desktop environments have to draw everything in the compositor. +* It’s impossible to create cross-desktop desktop components like Plank and Latte dock + +### 2. CSD is implementable, although clients can’t move their window + +We have known before that the core protocol doesn’t define a way for clients to move their windows. So how is CSD implemented? Well, there is a [function in the protocol][8] that tells the compositor to start dragging the window. So instead of having a function for moving the window, which would had been useful in many cases, they resorted to having a function only helpful in implementing CSD. + +### 3. CSD is a must in Wayland core protocol + +On X11, the situation was that apps expect to get decorated by the compositor (which is SSD) and if they wish to decorate themselves (by CSD) they tell the compositor to not draw its decorations. On Wayland, compositors are free to draw their decorations if they wish. + +The problem is that there is no way (inside the core protocol) for apps to know whether they are being decorated or not. In other words, clients can’t tell the compositor whether they prefer CSD or SSD, which is problematic for both CSD and SSD (in theory). But in practice, GNOME decided not to decorate clients at all. So apps have to assume that they are not decorated due to GNOME’s decision, so they must go for CSD. Again, there is a protocol extension that fixes that; more on that later. + +### To summarize + +The above three facts regarding the core protocol in summary are: + +1. Desktop components need to be drawn by the compositor +2. CSD is a must. +3. CSD is implementable, although clients can’t move their windows. + +According to these 3 facts, I’ve concluded my opinion that Wayland’s core protocol is tailored only for GNOME needs. + +What if you wanted some functionalities not available in the core protocol. Wayland or GNOME developers’ answer to this is Wayland’s protocol extensions. That simply means that compositors can offer extra functionality by creating new protocols. The problem with this approach is that means that some apps may work on some compositors and may not work on the rest of the compositors (that’s if it needs some of the protocol extensions). That may have resulted in severe fragmentation in theory, but the reality is less than worse thanks to the efforts of [wlroots project][9] and KDE. + +### Wlroots has mostly saved the situation + +[Wlroots][10] is a library created by [Sway compositor][11] developers. It enables developers to create Wayland/X11 compositors easily. Their main focus is Wayland. There are already many compositors available based on wlroots. What is interesting though is the protocol extensions that wlroots implement. + +Wlroots has many protocol extensions, including: + +* [LayerShell][12] protocol +* [xdg-decoration][13] protocol + +The LayerShell protocol enables desktop components to be drawn outside the compositor. Which also makes it possible to create independent cross-desktop desktop components. Many projects utilize this protocol that you can explore in the following repositories: + +* [nwg-shell][14] +* [wf-shell][15] +* [awesome-wayland][16] + +Also, have a look at [GtkLayerShell library][17]. Which is a library for writing Gtk apps with LayerShell protocol.Because LayerShell protocol is not a part of the core protocol apps using it work on wlroots based compositors and KDE, it’s not supported only on GNOME. + +The second protocol is xdg-decoration protocol. Made by wlroots and KDE, it enables apps to choose between CSD and SSD. + +These protocols work on wlroots compositor and KDE. The only obstacle preventing the unification of Linux desktop is GNOME. They have decided not to implement any of these protocol extensions. Which put all apps that use SSD in a situation where they have to use SSD in supporting environments and CSD in gnome. The people actually feeling the pain are toolkits developers. To give you more context, have a look at the “CSD initiative” started by Tobias Bernard from GNOME, and this blog post from Martin’s blog (kwin’s developer). Also, have a look at this issue. The situation is mostly solved by now, that Qt and Gtk draw CSD always on GNOME and utilize the xdg-decoration on other environments. However, in my opinion, that is not good because it makes the platform less standardized/unified for no good reason. After all, in the future, toolkits developers may decide to just go for CSD to avoid the pain. + +### The root of all these problems + +The root of all these is GNOME or Wayland developers’ decision to have the core as minimum as possible and require the creation of protocol extensions. + +Imagine if the web worked in a similar way. That means that websites would not be able to target the standardized (minimal) protocols because they are not enough and will rely on protocols created by certain browsers. So websites would target specific browsers, not the core protocol. That would had been a nightmare, right? Well, that’s the current Wayland situation. + +### What is the solution? + +The solution, in my opinion, is to put all these protocol extensions in the core protocol, or that might not be necessary if GNOME implements the above protocols (Which is not likely to happen anytime soon.)In simple words, GNOME is the root cause of the problem, and it can solve the problem if it decides to do so. + +Author Info: This article has been contributed by It’s FOSS reader Hamza Algohary. Hamza is a computer engineering student and a Linux and open source enthusiast. He also develops apps for Linux desktop. You can find his work on [his GitHub profile][18]. + +*The views and opinions expressed are those of the authors and do not necessarily reflect the official policy or position of It’s FOSS.* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/wayland-core-protocol-issue/ + +作者:[Community][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/team/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/07/wayland-core-protocol-gnome.png +[2]: https://wayland.freedesktop.org/docs/html/ch04.html +[3]: https://www.w3.org/standards/ +[4]: https://wayland.app/protocols/wayland +[5]: https://wayland.app/protocols/ +[6]: https://github.com/ricotz/plank +[7]: https://github.com/KDE/latte-dock +[8]: https://wayland-book.com/xdg-shell-in-depth/interactive.html +[9]: https://gitlab.freedesktop.org/wlroots/wlroots +[10]: https://gitlab.freedesktop.org/wlroots/wlroots +[11]: https://swaywm.org/ +[12]: https://wayland.app/protocols/wlr-layer-shell-unstable-v1 +[13]: https://wayland.app/protocols/xdg-decoration-unstable-v1 +[14]: https://github.com/nwg-piotr/nwg-shell +[15]: https://github.com/WayfireWM/wf-shell +[16]: https://github.com/natpen/awesome-wayland +[17]: https://github.com/wmww/gtk-layer-shell +[18]: https://github.com/hamza-Algohary diff --git a/sources/talk/20220726 Open Source Software- Is There an Easy Path to Success-.md b/sources/talk/20220726 Open Source Software- Is There an Easy Path to Success-.md new file mode 100644 index 0000000000..b9c7838853 --- /dev/null +++ b/sources/talk/20220726 Open Source Software- Is There an Easy Path to Success-.md @@ -0,0 +1,100 @@ +[#]: subject: "Open Source Software: Is There an Easy Path to Success?" +[#]: via: "https://www.opensourceforu.com/2022/07/open-source-software-is-there-an-easy-path-to-success/" +[#]: author: "Jules Graybill https://www.opensourceforu.com/author/jules-graybill/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Open Source Software: Is There an Easy Path to Success? +====== +There’s so much that goes on behind the scenes while developing open source software. So how does one make an open source project successful? Is there a shortcut? This article indicates there isn’t one. + +![team work working together][1] + +Open source has become all the rage now. Many entrepreneurs are drawn to it by the allure of quick success. But the truth is, there is no easy path to such success. There is no one thing that you can do to get all of open source right. + +In fact, a lot of the challenges that companies face early on are not technology challenges, but are people and cultural challenges. + +There are many layers of open source that need to be worked on to build a project that can become a hit in the market. And maintaining that success is an ongoing process. But at the crux of it all lies finding the right answer to a very basic question: what exactly is open source? + +### Open source is the code + +For many new users who may not be fully aware of the layers that make open source, the answer is fairly simple: open source is software! And that is not wrong, of course, since that is how most of us are using it. But there’s just so much more to open source than merely being touted as software. + +The essence of any open source project still remains the code. It is what makes the project special and useful for the user. When you’re working in open source, the code is just as much a part of the product as the software. + +Developing a project from the ground up, or even creating a fork of an existing project, requires thousands and thousands of lines of code to be written, even while handling such a large and complex codebase. Especially in the case of creating a fork, care must be taken to remove any prior licences, marketing material, or anything that might not be useful for the user anymore. After all, it is the features of a project that attract its user base and what retains it. When end users are deciding whether to use open source software, they will read the source code, and what they see there should be something that builds their confidence. + +### Open source is the community + +How you engage with the community is also a part of the task of building a product. Building a community and maintaining a healthy relationship with it is one of the most crucial aspects of open source, but is also often the hardest for most leaders as there is very little one can do to control it. One can try to lay the foundation and can be supportive but, ultimately, it’s the people who decide whether they want to join a community. + +It is important to maintain a level of transparency with the community and keep it in the loop. The community can get involved at any step that it wants to. It’s really important that you show most of your work to the community while you are doing it, apart from things that need to be done confidentially, like setting up security, signing certificates, branding, and so on. This helps in winning its trust because, in the end, it is the community that you are liable to, and it can make or break your project. This may make the project work a lot more deliberate, slower and exposed, but it works well in the end. + +Making your work-in-progress so open can seem daunting, especially when you are worried about the repercussions of a delay in updates or having a bug. Yet, making the community members privy to your moves will not only help you build a trustful relationship with them, but also make them feel appreciated. + +However, making your workflow public will also invite scrutiny from the community members, who will often have their opinions and offer you their feedback. Taking note of this feedback is important, because that is how you can make your open source project truly for them. They are the end users and their feedback will reflect how they see your project panning out for them in the long run, and ultimately, how successful and mainstream your software becomes. + +As an example, when we are thinking about a new feature, we publish a request for comments at RFC. We get a lot of feedback, and we have to think hard about how we can incorporate it. + +Since open source is a largely collaborative work, there will be initiatives by the community to offer their support in making the project the best version possible. Not all of it will work out. But as long you are listening, the community will feel involved. + +Engaging with the community has its pitfalls too. There may be differences of opinion within the community, and also between the maintainer and the community, especially when it comes to the matter of governance. Governance is something which is really important for an open source project to have. That is why it is important to have clear documented governance practices, which also include the community. + +Community governance is a tough, but essential, nut to crack. Delegation in itself requires a lot of trust. For a project with millions of lines of code, it can be cumbersome to find someone in the community who can meaningfully lead it. But open source projects often consist of smaller sub-projects, which are better left handled by someone from the community. This helps the community to be more closely involved too. + +| - | +| :- | +| Building a community always has its highs and lows. Let me list some of the tricks that helped maintain a healthy balance between the community’s and my team’s vision. +State your principle: Especially in the early stage of the open source project when the source code is still coming together and things are not exactly going perfectly, it is hard for somebody coming from outside to really understand why you are making the decisions that you are making. Communicating the principles on which you take actions helps you to be upfront about your thought process so that the community does not interpret things incorrectly. +This practice is really helpful. It is also important to follow through and show that when you make a decision, it is guided by one of these principles. +Decide how you are going to collaborate: This may be through channels like Discord, Slack, or simply emails. But if you try to use all of them, you will immediately diffuse the community. People will be communicating with each other all over the place. Choose one or two collaboration tools, and really invest in them for synchronised communication. +Treasure the feedback: Listen to feedback from the community and act on it. Show tat you care about what the community says, even if it requires you to make tough decisions. +Maintain a code of conduct: If you interact with a community, you need to define what is going to be acceptable conduct. Having that in place helps warn people in case they go out of line. You can avoid a lot of trouble if you can just define this early on. +Think about how you will distribute your project: There may be instances when you may not be willing to make your project available to the public because you do not have a certain component in place, or you have features you may not want to make accessible to everyone. Creating distribution terms that suit your preference without compromising on what the user wants is key, so that people who want certain features can access these while those who can do without them also have the option to start using the project without having to compromise. +Avoid polls as much as you can: This is because, often, certain members vote for an option that may not be what the majority goes with. This can create a sense of failure in these members and make them feel excluded from the project. Instead, try asking them what problems they would like to be solved, and then try to invent a solution that does not involve trade-offs. | + +**State your principle:** Especially in the early stage of the open source project when the source code is still coming together and things are not exactly going perfectly, it is hard for somebody coming from outside to really understand why you are making the decisions that you are making. Communicating the principles on which you take actions helps you to be upfront about your thought process so that the community does not interpret things incorrectly. + +This practice is really helpful. It is also important to follow through and show that when you make a decision, it is guided by one of these principles. + +*Decide how you are going to collaborate:* This may be through channels like Discord, Slack, or simply emails. But if you try to use all of them, you will immediately diffuse the community. People will be communicating with each other all over the place. Choose one or two collaboration tools, and really invest in them for synchronised communication. + +*Treasure the feedback:* Listen to feedback from the community and act on it. Show tat you care about what the community says, even if it requires you to make tough decisions. + +**Maintain a code of conduct:** If you interact with a community, you need to define what is going to be acceptable conduct. Having that in place helps warn people in case they go out of line. You can avoid a lot of trouble if you can just define this early on. + +*Think about how you will distribute your project:* There may be instances when you may not be willing to make your project available to the public because you do not have a certain component in place, or you have features you may not want to make accessible to everyone. Creating distribution terms that suit your preference without compromising on what the user wants is key, so that people who want certain features can access these while those who can do without them also have the option to start using the project without having to compromise. + +*Avoid polls as much as you can:* This is because, often, certain members vote for an option that may not be what the majority goes with. This can create a sense of failure in these members and make them feel excluded from the project. Instead, try asking them what problems they would like to be solved, and then try to invent a solution that does not involve trade-offs. + +### Open source is licensing + +Open source is about giving your users autonomy over how they want to use your software, and licensing provides just that. What’s great about an open source licence is that regardless of what you as a maintainer do, all your end users and stakeholders can always maintain a certain set of forks, which are important forks. + +Licensing gives people the option to take the project into a different direction if they deem it fit. They have the right to create a fork, which results in a lot of amazing software being developed. Maintainers have more responsibility to listen to their community members and to run the project in a way that works for them. + +It’s advisable to make use of the many licences available instead of setting your own terms separately, simply because stakeholders and users are usually familiar with commonly used licences, so you do not have to waste time explaining them. This also helps you to focus your energy on the other parts of the project. + +### Finally, open source is a movement + +Open source involves many, many dimensions and people. Most importantly, it is about understanding what these people want and creating an environment that encourages collaboration and transparency. It is about building communities that help to build the open source project the way they want it to be. The more opportunity maintainers create to let them do that, the better the product is and the more successful it gets. + +Open source is all of these things and the more expansive view you take, the better you can leverage it. Think about how you can excel in every dimension of open source because, at the end of the day, there is no easy path to open source success. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/07/open-source-software-is-there-an-easy-path-to-success/ + +作者:[Jules Graybill][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/jules-graybill/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/07/team-work-working-together-1.jpg diff --git a/sources/talk/20220727 My honest review of the HP Dev One.md b/sources/talk/20220727 My honest review of the HP Dev One.md new file mode 100644 index 0000000000..fce898e82d --- /dev/null +++ b/sources/talk/20220727 My honest review of the HP Dev One.md @@ -0,0 +1,121 @@ +[#]: subject: "My honest review of the HP Dev One" +[#]: via: "https://opensource.com/article/22/7/hp-dev-one-review" +[#]: author: "Anderson Silva https://opensource.com/users/ansilva" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +My honest review of the HP Dev One +====== +Here are my first impressions of the hardware, running the pre-installed Pop!_OS, and running Fedora on HP's new Linux-based laptop. + +![Working from home at a laptop][1] + +Image by: + +Opensource.com + +A few weeks ago, HP joined the bandwagon of major laptop manufacturers releasing a Linux-based laptop, the [HP Dev One][2]. The brand joins others such as Lenovo and Dell, offering a laptop with a pre-installed distribution of Linux in the US market. HP joined forces with smaller Linux-based laptop brand System76 to pre-install Pop!_OS as their distribution of choice on the device. Pop!_OS is a Ubuntu-based distribution, which System76 started (and is currently the primary maintainer) to maximize the features of its own laptops sold on its website. + +This article is a quick look at the HP Dev One, including first impressions of the hardware itself and running the pre-installed Pop!_OS and then Fedora on it after a few days. It is not about comparing them, just a few notes on how well they did on the HP Dev One. + +### HP Dev One hardware + +I haven’t owned an HP laptop in over a decade. I don’t even remember why I distanced myself from the brand, but somehow it just happened. So, when I read about the HP Dev One, several things sparked my interest. Here’s a list of them. Some may be silly or nit-picking, but they still carried some weight in my decision: + +* The most obvious reason was it came with Linux and not Windows. +* I have never used Pop!_OS, so the fact that HP chose Pop!_OS made me curious to use it. +* I have never owned an AMD-based laptop. The HP Dev One comes with an AMD RYZEN™ 7 PRO 5850U Processor with eight cores and 16 threads. +* The specs versus price seemed good. The price is $1099 USD, which is very reasonable compared to other brands with similar specs. +* No Windows key on the keyboard. Instead, it says “super,” which I think is cool. +* Upgradeable RAM. The laptop comes with 16 GB of RAM, but unlike so many laptops nowadays, it is not soldered on the board, so you can upgrade it (more on upgrading below). +* The laptop was in stock with a commitment for fast shipping. +* Reviews were favorable. + +For all of the reasons above, I ordered it, and two days later, I had the HP Dev One on my doorstep. + +![HP Dev One super key][3] + +Image by: + +(Anderson Silva, CC BY-SA 4.0) + +By the time the laptop arrived, the extra 64 GB of RAM I had ordered had also arrived, so the first thing I wanted to do was upgrade the RAM. It turned out that the bottom plate of the HP Dev One has very small, special (yet not proprietary) screws, so I had to run to the hardware store to get the proper screwdriver. + +![HP Dev One RAM upgrade][4] + +Image by: + +(Anderson Silva, CC BY-SA 4.0) + +I agree with [other online reviews][5] regarding the quality of the laptop. It does feel sturdy. The trackpad feel is good enough, and I had no issue with it. I found the keyboard not to be as good as some other reviewers claim. To me, the keys are a little heavy, and they feel almost a bit like silicone or rubber. I didn't find it terribly comfortable. In fact, I am typing this article in the HP Dev One, and I almost feel like I need to take a break here and there to let my fingertips rest. + +The 1080p screen is bright, but also very reflective. If you are a Thinkpad trackpoint fan, you will definitely enjoy this feature on the HP Dev One. The backlit keyboard is nice, and the built-in camera cover is something more laptops should adopt. + +![HP Dev One top view][6] + +Image by: + +(Anderson Silva, CC BY-SA 4.0) + +One question or possible issue I have with the HP Dev One is the fact that their website talks about the one-year customer service and warranty on the machine, but I haven’t been able to find a way to extend that warranty or even upgrade to something more premium like an onsite or next day part replacement in case I were ever to need it. + +### Pop!_OS on HP Dev One + +As previously mentioned, I’ve never used Pop!_OS. I’ve used Ubuntu and many other distributions, but to me, Pop!_OS was a relatively familiar yet new experience. Here are a few notes: + +#### The good + +* Coming from a Fedora and mostly vanilla GNOME background, the four-finger gesture in Pop!_OS took a little getting used to, but once I got into it, it made navigating their implementation of GNOME borderline fun. +* The Pop!_OS’s software shop is called Pop!_Shop. It contains a great variety of software without any need to enable special repositories. It is easy to use, and installation is fast. +* The integration between Pop!_OS and the hardware really is well done. Congratulations to both System76 and HP engineers for putting this machine together. +* Pop!_OS has a nice built-in feature for backup and restoring your installation w/o destroying your home directory. +* I installed Steam and a few games, and it worked pretty well. +* I ran a couple of test containers with podman, and it worked very nicely as well. +* I installed a virtual machine, and it ran very smoothly, too. + +#### The not so good + +* The default wallpaper that comes with the HP Dev One looks a bit fuzzy to me. For such a nice machine, it feels like the wallpaper is running at the wrong resolution. To be fair, there are other wallpapers to choose from in the Settings. +* The out-of-the-box fonts for Pop!_OS could be better. I find them hard to read, and in my opinion, it makes the UI too crammed. +* Adding the USB-C powered 4K monitor worked OK, but my eyes noticed slight flickering in some parts of the screen. Could this be an X11 issue, given that Pop!_OS defaults to X11? + +### Fedora on HP Dev One + +I played around with Pop!_OS for about two days before deciding to boot into Fedora using a live USB media. I did that first to see what type of hardware detection Fedora could do out of the box. To my surprise, everything worked right away. That’s when I decided to wipe the entire 1 TB SSD and install Fedora on the HP Dev One. As promised, this is not a Fedora vs. Pop!_OS comparison article; it is merely a few notes on both distributions running on this Linux-focused hardware. + +In case you haven’t read my bio in this article, and for the sake of transparency, I am a Fedora contributor, so it is fair for me to say that I am biased towards the Fedora distribution, but don’t let that make you think I recommend Fedora over Pop!_OS on the HP Dev One. They are both great distributions, and they both run very nicely on it. Take your pick! + +I can tell you that Fedora runs smoothly on the HP Dev One, and although there may be some performance tuning to match some of the benchmark numbers against Pop!_OS, I have been very pleased with its performance. Using the three-finger gestures to move between virtual desktops is a lot more natural to me than the four-finger ones in Pop!_OS, and I’ve been able to run Steam and Proton-based games on Fedora just like Pop!_OS. + +The only comparison I will make is that when using the secondary USB-C 4K monitor with Fedora, I did not experience any flickering. Was it because of Wayland? + +### Final thoughts + +I’ve had the HP Dev One for a little over four days now, and I’ve run Pop!_OS and Fedora on it so far. I even restored Pop!_OS after a full Fedora installation, which was a very easy process. Somehow, Pop!_OS detected it was an HP Dev One and did all the needed installation, including the HP-based wallpapers, without me having to do any extra steps. + +As I finished this article, yet again, I went back to Fedora (force of habit), but I wouldn’t have any issue staying on Pop!_OS on the HP Dev One. Who knows, maybe I might even try different distributions in the future. + +At the end of the day, the HP Dev One is a solid Linux laptop without a Windows key and no AMD, Intel, or Windows stickers on it. It is fast, feels well built, and is reasonably priced especially given how quickly it ships to you (US only). I would love to see HP provide more documentation on their website about extending the warranty, and I hope they will be able to make this laptop available in other parts of the world. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/hp-dev-one-review + +作者:[Anderson Silva][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ansilva +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/wfh_work_home_laptop_work.png +[2]: https://hpdevone.com/ +[3]: https://opensource.com/sites/default/files/2022-07/superkey.jpg +[4]: https://opensource.com/sites/default/files/2022-07/ram.jpg +[5]: https://www.techrepublic.com/article/system76-hp-perfect-dev-one/ +[6]: https://opensource.com/sites/default/files/2022-07/topview.jpg diff --git a/sources/talk/20220801 What Made Fedora Choose To Use CC0 Licensed Code As The Boot.md b/sources/talk/20220801 What Made Fedora Choose To Use CC0 Licensed Code As The Boot.md new file mode 100644 index 0000000000..cb08fb17d5 --- /dev/null +++ b/sources/talk/20220801 What Made Fedora Choose To Use CC0 Licensed Code As The Boot.md @@ -0,0 +1,49 @@ +[#]: subject: "What Made Fedora Choose To Use CC0 Licensed Code As The Boot" +[#]: via: "https://www.opensourceforu.com/2022/08/what-made-fedora-choose-to-use-cc0-licensed-code-as-the-boot/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +What Made Fedora Choose To Use CC0 Licensed Code As The Boot +====== +![fedora-1024x614][1] + +Open source is a challenging concept. Many people interpret this to mean that they can use a specific piece of software however they choose and that it is free to download. The actual rights you as a user are granted, however, depend largely on which licence the developers chose to share their code under. Open source software can be expensive, can restrict how you can use it, and in rare circumstances, can even land you in legal trouble. + +The Fedora Project recently decided to reject all code that is licenced under the Creative Commons “Public Domain Dedication” CC0 licence in an effort to avoid precisely this situation. CC0 will soon be removed from the list of permissible code licences for all new submissions, however it will still be permitted for material like artwork and there might even be exceptions made for current packages on a case-by-case basis. + +It wouldn’t ordinarily make the news if Fedora objected to a software licence. In fact, the project rejects a number of licences that are on a fairly extensive list. The unexpected aspect of this situation is that CC0 was originally regarded as a valid licence, and is only now being reclassified as a result of a shift in perspective within the greater free and open source (FOSS) community. + +What exactly is wrong with CC0 that Fedora decided to stop supporting it, and does this indicate you shouldn’t use the licence for your own projects? + +The part of this narrative that may surprise those who are familiar with Creative Commons and its family of licences the most is that the Fedora Project formerly approved CC0 for software in the first place. After all, the goal from the beginning was to develop a range of licences expressly for artistic works. The organization’s mission and licence requirements are stated in the name itself. + +To “overcome legal hurdles to the sharing of information and creativity” by offering a free framework under which people and organisations might share things like music, artwork, or educational material, Creative Commons, the forerunner of the previous Open Content Project, was established in 2001. Software, however, was never a factor. Why might that be? At that time, important software licences like the MIT License and the GNU General Public License had already been around for more than ten years. + +It seems obvious that you should probably believe a company if they go out of their way to warn you that something they have made is unsuitable for a particular use. The Creative Commons FAQ lists a number of compelling arguments against using their licences for software, but one in particular jumps out for users like the Fedora Project: patent rights. + +This may seem contradictory given that the CC0 licence is meant for works in the public domain and that by using it, the creator expressly “waives all of his or her rights to the work globally under copyright law.” However, the issue is that copyright legislation does not apply to patents. In fact, a review of the license’s complete wording reveals that it directly tackles this in a worrying section that reads, “No trademark or patent rights held by Affirmer are waived, abandoned, relinquished, leased or otherwise modified by this document.” + +In other words, even while the author of something that has been licenced under CC0 may be willing to give up the rights to it, they are still free to patent it. What’s even worse is that they still retain the ability to use that patent however they see fit. Theoretically, this means that the creator of a piece of source code that was first made available under CC0 may later assert that anyone who utilised the code violated their patent and could demand royalties. + +It’s very obvious why something like this would worry the Fedora Project. Consider a scenario where CC0-licensed code is incorporated into a system’s core package and then made available to millions of users. Out of nowhere, the original creator appears, alleges patent violation, and wants payment. Could Red Hat’s or Fedora’s attorneys refute such a claim? Maybe. Is it worth it to use CC0 code in order to find out for sure? Zero chance. + +It’s important to note that this is not at anyway a new issue. In fact, back in 2012, the patent clause prevented the Open Source Initiative’s (OSI) License Review Committee from conclusively determining if CC0 genuinely complied with their definition of an open source licence. The Committee was unable to come to an agreement because its members believed that included such terms in a software licence would create a risky precedent. Fedora’s decision to ever accept CC0 in the first place is even more puzzling given its turbulent history. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/08/what-made-fedora-choose-to-use-cc0-licensed-code-as-the-boot/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/08/fedora-1024x614-1-e1659346500461.jpg diff --git a/sources/talk/20220808 How open organizations can harness energy disruptions.md b/sources/talk/20220808 How open organizations can harness energy disruptions.md new file mode 100644 index 0000000000..795d39d2f0 --- /dev/null +++ b/sources/talk/20220808 How open organizations can harness energy disruptions.md @@ -0,0 +1,168 @@ +[#]: subject: "How open organizations can harness energy disruptions" +[#]: via: "https://opensource.com/open-organization/22/8/energy-disruption" +[#]: author: "Ron McFarland https://opensource.com/users/ron-mcfarland" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How open organizations can harness energy disruptions +====== +Learn strategies for communities on the use of electric vehicles over internal combustion engined cars, the use of self-driving vehicles over human-driving vehicles, and the use of solar power generation over nuclear power generation. + +![Solar panels][1] + +Image by: Photo by Jason Hibbets + +Many people talk a lot about the values of [Open Organization Principles][2], but in many ways, they require people to change how they do things, which can be difficult. That is true for businesses and industries as well. Disruption in many sectors is coming. How do we use Open Principles to address them? This article looks at what's happening in industries related to energy and transportation when it comes to drastic costing changes that will lead to industrial disruption. + +Business disruption is happening through new technology or methods, which will slash costs. This is forcing industrial change. Consider the oil, coal, natural gas, nuclear, petroleum, biofuels, and charcoal (the primary energy in many developing countries) industries. All these industries are grouped in the fossil fuel-burning energy-generating industry. Imagine them all becoming obsolete and totally replaced by the solar and wind industries in the next decade or so because of costs. That is industrial disruption. + +As a resource, I have read, [Clean Disruption of Energy and Transportation,][3] by Tony Seba. + +The book was written before 2014, but many of his concepts are valid today. In his book, Seba presents an energy-usage case for electric vehicles (EV) replacing internal combustion engine vehicles (ICE), and the entire automotive industry shrinking with autonomous (self-driving) car disruption strictly on cost factors. If this is true, adapting to those changes will be required, and Open Organization Principles can be helpful. + +He also builds a case for current electrical power generation being completely replaced in the years ahead by solar and wind with battery storage based strictly on cost competitive advantages. I discussed this in my article on [Jeremy Rifkin's][4] book [The Zero Marginal Cost Society: The Internet of Things, the Collaborative Commons, and the Eclipse of Capitalism.][5] + +Seba's book reminds me too of [Michael E Porter's five competitive forces the force of substitutes][6]. + +For example, automobiles replaced the horse and carriage in about a decade in the early 1900s, and digital cameras replaced all film cameras on the market. This replacement was due to: + +1. A cost advantage with prices coming down at exponential rates (from dollars to pennies like computer sizes to computing capacity) through increased innovation, scale, and competition. +2. Superior product features. +3. Added new product features, +4. Central control replaced by distributed/shared control. + +For these reasons, in the past, products became obsolete by something innovative. They were disrupted. + +Imagine wanting to make an open organization community that can produce its own electricity instead of being forced to buy electricity at much higher prices. Could such a community be formed? Throughout his book, Seba makes a case that this is possible using the four above factors. + +This article is the first of a two-part series on this topic. This article gives strategies for open organization communities on the use of electric vehicles over internal combustion engined (ICE) cars, the use of self-driving vehicles over human-driving vehicles, and the use of solar power generation over nuclear power generation. I'll give more in the second part of this series. + +### A question of power + +Seba assumes that electrical power is a commodity with no distinct quality difference and that there is no such thing as high-quality and low-quality electricity to the user. The only difference is the price of electricity at a given time. + +The price of electricity fluctuates greatly. He also assumes that the automotive industry only has one quality, the movement of goods and people. Therefore, Seba's whole book looks at the cost (particularly end-user price) of both electricity (in kilowatt/hours) and movement (miles/kilometers over the life of a vehicle). He does a wonderful job of breaking down indirect and direct costs in great detail, including many costs I had never considered. This seems to be the same conclusion Jeremy Rifkin came to, calling it marginal costs in his book, *The Zero Marginal Cost Society* (cited above). + +By providing general cost breakdowns, Seba enables readers to seriously consider how they and their community might use solar and wind electric power generation. One could build an open organization community based on the information this book makes available. + +Coincidentally, I've just read Bill Gates' book, [How to Avoid a Climate Disaster][7]. Gates' book has one primary goal: To remove 51 billion tons of greenhouse gases from the atmosphere by 2050. Gates would love it if Seba's prediction comes true. + +Seba believes that by 2030, all electricity generation and vehicles on the road will be carbon-free. Seba believes that over a 10-15 year period disruptive forces will penetrate industries in an "S" shaped growth. They will start slowly while the users adjust to this new purchasing option. + +Then, once several success stories are in operation, disruption will take off like a rocket, making all old technology and processes obsolete. After several decades, the demand will flatten when the disruptive technology fully serves the market. + +![S demand chart relating growth and time][8] + +Image by: + +(Ronald McFarland, CC BY-SA 4.0) + +Here is how the "S" demand works for electrical energy according to Seba: + +1. Some solar and wind systems are accepted in the market, making capital more available and less costly. +2. More creative financing plans are developed and offered. +3. Local, distributed energy generation increases. +4. The business structure of energy flips from centralized to distributed. +5. Enabling technologies, such as sensors, artificial intelligence, big data, and mobile communications, improve exponentially. Sensors, smaller and more energy efficient than ever before, will have more information on energy usage than any conventional utility could ever obtain. +6. The increasing cost of resource-based energy will push more people away from them. +7. Complementary markets, such as wind power generation, electric vehicles, and self-driving cars will increase exponentially. +8. Investments in other storage technologies for shared solar facilities, wind operations, electric vehicles, and self-driving cars will increase. +9. The business environment of energy will become more and more distributed. +10. The conventional command-and-control energy business model will enter a vicious cycle of rising prices and obsolete assets. + +Seba writes, "World demand for energy is expected to be 16.9 TW by 2030, according to the US Energy Information Agency." That may seem dire, but Seba adds, "Should solar continue on its exponential trajectory, the energy generation will be 100% solar by 2030." + +I'm sure that Gates would be delighted if that turns out to be true, but he is taking no chances on just those predictions. Gates is investing in future nuclear power plants and carbon capture systems for current fossil fuel burning plants to reduce carbon dioxide emissions further. + +### Building a community + +Assume we want to build an open organization community to introduce three things: + +* The use of electric vehicles (EV) over internal combustion engined (ICE) vehicles. +* Self-driving vehicles over human-driven vehicles. +* Solar power generation over nuclear power generation. + +Here is additional detail on Seba's arguments for each. + +#### 1. Use of electric over internal combustion engined vehicles + +Consider the following attributes of EV over ICE vehicles: + +* Seba presents that an electric vehicle is inexpensive to operate. An EV is five times more efficient in energy use than ICE vehicles. That makes an EV 10 times cheaper than ICE. +* An electric vehicle is cheaper to maintain because it contains few moving parts. +* In the future, there will be wireless charging stations along the road, so vehicles need not stop to charge. ICE vehicles will always have to stop at filling stations. +* Electric vehicles are safer, with more safety sensors. +* By 2025, EVs will likely be cheaper to purchase than ICE, with battery costs coming down rapidly. +* Battery performance and range are increasing with new developments. +* Electric vehicles can gather driving data in real-time for added safety, performance analytics, and future improvements. +* Electric vehicles can use excess electricity in the owners' home solar system or sell the excess to the local utility company. +* An EV company can offer free fuel and maintenance for five years if it wants to. No ICE vehicle manufacturer can do this. + +#### 2. Use of self-driving vehicles over human-driving vehicles + +Young people are moving away from owning vehicles in favor of Uber or Lyft services. It is becoming cheaper in the long term. Ride-sharing offers many advantages, including: + +* Each Uber/Lyft vehicle on the road is estimated to replace around 15 cars purchased. This result shrinks the overall vehicle numbers, impacting the need for parking lots and vehicle insurance. +* Owning an asset used less than 10% of the time is not practical. Most cars are parked most of the time, except for commercial vehicles that operate during work hours. + +The next step is self-driving cars, according to Seba. When self-driving cars are fully in the market, there will be disruption in the automotive, transportation, logistics, and oil industries. Self-driving cars will be mainly purchased, owned, and operated by corporations with fleets, not individuals. + +Self-driving cars provide many advantages, a few of which are listed here: + +* Self-driving cars expand the transportation of people. Children, the elderly, and those with disabilities will be new customers. +* The benefits of self-driving cars include: + * Save lives (no human error, advanced machine learning, and sensing). + * Save time (less time on the road with less congestion or looking for parking spaces). + * Save space (fewer roads, garages, and parking spaces required). + * Save energy (lower fuel consumption). + * Save money (in purchasing, operating, maintaining, and insuring for transportation). +* The cost of transportation will be cheaper, safer, and easier. + +#### 3. Use of solar power generation over nuclear power generation + +Solar power generation pricing is falling rapidly and is projected to continue falling with more use. This is where the Internet of Things (IoT) comes in. While nuclear power costs will also come down, it's not competitive, particularly as decommissioning is extremely expensive. + +Here are some considerations for solar power generation: + +* Solar cost has improved by 1,540 times since 1970. Based on Seba's research, solar costs are expected to come down by another two-thirds by 2020 (at the time the book was written in 2014). +* Currently, operating nuclear power plants' costs are increasing and are continually over budget in cost. If their costs don't come down, they will phase out. Bill Gates is betting on improved low-cost designs. +* Solar panel costs have dropped by a factor of US$100/Wh (Watt-hour) to 65¢/Wh from 1970 to around 2012, far lower than nuclear prices. +* New nuclear power plants are expected to provide electricity at 25¢/kWh-30¢/kWh. That is not competitive, with solar being around 12.5¢/kWh. In the United States, residential customers pay around 12.5¢/kWh, and some solar power suppliers expect to reach 5.79¢/kWh soon. +* Nuclear power generation uses twice as much water as natural gas, which is 10,000 times more than solar. This places added stress on the freshwater supply. +* There are now solar manufacturing companies providing power 24 hours/day. [Torresol Gemasolar][9] is a company in Spain putting one of these facilities into operation. They use safer and cheaper molten salt thermal energy storage. This energy storage method is a tenth of the cost of Li-on batteries. +* Seba says, "Large, centralized, top-down, supplier-centric energy is on the way out. It is being replaced by modular, distributed, bottom-up, open, knowledge-based, consumer-centric energy." For solar, many users will also be producers and sharers of electricity and information. +* Solar now regularly provides 20-35% of Germany's power. That will continue with improved battery storage, especially as Germany moves away from Russian oil and gas due to the war in Ukraine. Both for residential and commercial solar plants, tens of thousands of power generation units are being installed in the United States, Europe, and Australia. +* In 2014, 430 reactors in 31 countries provided 370 GW of nuclear power capacity, mainly in France, Japan, Russia, and the United States. These most likely will be replaced with solar, wind, or [4th generation][10] nuclear, which uses waste as fuel. Europe will shut down 80% of its 186 nuclear power plants by 2030 ([Global Data][11]). Many current nuclear power plants are close to their shutdown age. +* Nuclear power plants are not insurable at any premium, so only governments protect them. + +### Wrap up + +In the second part of this series, I'll discuss ideas regarding the use of solar power generation over oil power generation, the use of solar power generation over natural gas (with methane) power generation, the use of solar power generation over biofuels power generation, the use of solar power generation over coal power generation, and distributed electricity generation (small and simple) over conventional large utilities. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/22/8/energy-disruption + +作者:[Ron McFarland][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ron-mcfarland +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/LIFE_solar_panels_520x292_JH.png +[2]: https://theopenorganization.org/definition/open-organization-definition/ +[3]: https://www.amazon.co.jp/Clean-Disruption-Energy-Transportation-Conventional/dp/B00RWNDUZA +[4]: https://en.wikipedia.org/wiki/Jeremy_Rifkin +[5]: https://www.goodreads.com/book/show/18594514-the-zero-marginal-cost-society +[6]: https://www.youtube.com/watch?v=mYF2_FBCvXw +[7]: https://www.gatesnotes.com/Energy/My-new-climate-book-is-finally-here +[8]: https://opensource.com/sites/default/files/2022-07/s-demand.png +[9]: https://www.youtube.com/watch?v=QN-8DMZLpyI +[10]: https://en.wikipedia.org/wiki/Generation_IV_reactor +[11]: https://www.globaldata.com/ diff --git a/sources/tech/20210809 What is Firefox Multi-Account Containers- Why and How to Use It.md b/sources/tech/20210809 What is Firefox Multi-Account Containers- Why and How to Use It.md deleted file mode 100644 index 38c4bdf10b..0000000000 --- a/sources/tech/20210809 What is Firefox Multi-Account Containers- Why and How to Use It.md +++ /dev/null @@ -1,130 +0,0 @@ -[#]: subject: "What is Firefox Multi-Account Containers? Why and How to Use It?" -[#]: via: "https://itsfoss.com/firefox-containers/" -[#]: author: "Hunter Wittenborn https://itsfoss.com/author/hunter/" -[#]: collector: "lujun9972" -[#]: translator: "hanszhao80" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -What is Firefox Multi-Account Containers? Why and How to Use It? -====== - -As the needs of users who use various programs on their devices becomes increasingly complex, the programs themselves are also needing to follow suit to keep up with the demand that users are wanting and expecting. - -Something that I find I need on a daily basis is an easy way to be able to stay logged in to multiple accounts inside my web browser at the same time. I _could_ just log in and out of each of my accounts as needed, but this becomes extremely tedious when I’m moving across multiple accounts in a short period of time. - -Originally, I was using Google Chrome’s ability to have multiple accounts, which worked, but was a tad too tedious to manage, and it felt a bit clunky to create an entire new Google account just to do what I considered something that should be able to be done from a _single_ account. - -This is the point where I moved to Firefox’s Multi-Account Containers feature. Not only is it so much more flexible than my setup on Google Chrome, but I am also using something that is created by my browser’s developers themselves, making for an overall smoother and simpler experience. - -![Illustration of containers in Firefox][1] - -### What is Multi-Account Container in Firefox? - -Mutli-Account Containers also works tremendously well if you want to separate parts of your digital life from each other. When you are using containers, your browsing activity from one container is not shared with other containers. This isolation means that you can log into two separate accounts on the same website in different containers. Your login session, site preference and tracking data will be confined to the container where you used a certain website. - -What other advantage does it have? Imagine you were shopping on Amazon or some other e-commerce. You browsed a few items but did not buy anything. Now if you browse the web, you’ll see ads related to products you browsed. Some websites show ads despite ad-blockers. With containers, you can separate your shopping websites with other websites. - -Let me share another example with you. Firefox provides a Facebook container by default. This container includes Facebook, Messenger and Instagram websites by default. This means when you open any of these three websites, they are opened in ‘Facebook container’. Thus, Facebook won’t be able to track your activity on other websites. - -This is one of the [Firefox features that not many people know or use][2]. - -### Using Multi-Account Containers - -Installing Firefox Multi-Account containers is an extremely simple process, and only takes a few clicks. - -First, head over to the [extension’s page][3] on the Firefox Add-ons website. The only thing you need to do after that is click the `Add to Firefox` button. - -![][4] - -And you’re done! Now we can get straight into actually using the new extension. - -If you didn’t notice already, there should now be a new icon to the right of your search bar: - -![][5] - -This is the icon that you’ll use to interact with Firefox Multi-Account containers. If you then click the icon, you’ll be greeted with a little menu: - -![][6] - -With that, let’s try some examples out so we can see how Multi-Account Containers actually works. - -#### Setting up the container - -First off, we need to make a container. We can do this by going to `Manage Containers -> New Container` in the Multi-Account Containers menu. - -![][7] - -![][8] - -Next, enter the name for the new container, and select a color and icon. Then, hit `OK` to save the new container. - -![][9] - -And that’s it! We can now go back to the main menu to open a new tab inside the new container: - -![][10] - -You will also notice that the new tab has some styling to denote that it’s running inside of a container: - -![][11] - -#### Watching the container work in action - -Let’s now look at what the container actually does when you use it. - -We’re going to go to the Linode manager website in a normal browser tab, where I’m currently signed in: - -![][12] - -Let’s now try opening the same page inside our Firefox container, at which point I’m redirected to the Linode login screen: - -![][13] - -Why was I redirected? Because now I am not logged in. That’s one of the joys of Firefox containers: be able to be signed in inside of one browser session, and then enter a container, and it’s like you’ve never visited the site before. - -If you were to sign in to a website within the container however, you would stay signed in while vising websites from the container. You could also use this feature to sign in to a website from inside the container, thus keeping all the data from that site away from your normal browser data. - -Note - -Things like your browser history itself will still be exposed to your normal browser session. The container feature simply provides a way to separate things like signed-in accounts as mentioned in this article. - -### Wrapping Up - -Mutli-Account Containers prove to be a wonderful feature for those who are conscious about their privacy, or just want to really try to get stringent on the security of their systems. - -For example, you could sign in to your Google account inside of a container, and Google would never know who you whenever you aren’t inside the container. - -And then lastly, this extension is just a great choice for people who want to sign into to multiple accounts at once, without resorting to making separate browser accounts for each thing you want to use. - -And there you go, that’s the premise of Firefox’s Multi-Account Containers. - -Need any help getting everything going, or just got a general question? Feel free to leave any of it in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/firefox-containers/ - -作者:[Hunter Wittenborn][a] -选题:[lujun9972][b] -译者:[hanszhao80](https://github.com/hanszhao80) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/hunter/ -[b]: https://github.com/lujun9972 -[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Firefox-container.png?resize=800%2C450&ssl=1 -[2]: https://itsfoss.com/firefox-useful-features/ -[3]: https://addons.mozilla.org/en-US/firefox/addon/multi-account-containers/?utm_source=addons.mozilla.org&utm_medium=referral&utm_content=search -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-install-page.png?resize=800%2C366&ssl=1 -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-searchbar-icon-1.png?resize=800%2C48&ssl=1 -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-main-menu.png?resize=302%2C474&ssl=1 -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-manage-containers-1.png?resize=291%2C402&ssl=1 -[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-new-container.png?resize=290%2C399&ssl=1 -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-new-container-itsfoss.png?resize=292%2C401&ssl=1 -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-opening-new-container.png?resize=290%2C398&ssl=1 -[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-new-container-styling.png?resize=800%2C370&ssl=1 -[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-linode.png?resize=800%2C114&ssl=1 -[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-linode-login.png?resize=800%2C405&ssl=1 diff --git a/sources/tech/20210823 Write a chess game using bit-fields and masks.md b/sources/tech/20210823 Write a chess game using bit-fields and masks.md deleted file mode 100644 index 0b0ee7c631..0000000000 --- a/sources/tech/20210823 Write a chess game using bit-fields and masks.md +++ /dev/null @@ -1,166 +0,0 @@ -[#]: subject: "Write a chess game using bit-fields and masks" -[#]: via: "https://opensource.com/article/21/8/binary-bit-fields-masks" -[#]: author: "Jim Hall https://opensource.com/users/jim-hall" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Write a chess game using bit-fields and masks -====== -Using bit-fields and masks is a common method to combine data without -using structures. -![Chess pieces on a chess board][1] - -Let's say you were writing a chess game in C. One way to track the pieces on the board is by defining a structure that defines each possible piece on the board, and its color, so every square contains an element from that structure. For example, you might have a structure that looks like this: - - -``` -struct chess_pc { -   int piece; -   int is_black; -} -``` - -With this programming structure, your program will know what piece is in every square and its color. You can quickly identify if the piece is a pawn, rook, knight, bishop, queen, or king—and if the piece is black or white. But there's a more straightforward way to track the same information while using less data and memory. Rather than storing a structure of two `int` values for every square on a chessboard, we can store a single `int` value and use binary _bit-fields_ and _masks_ to identify the pieces and color in each square. - -### Bits and binary - -When using bit-fields to represent data, it helps to think like a computer. Let's start by listing the possible chess pieces and assigning a number to each. I'll help us along to the next step by representing the number in its binary form, the way the computer would track it. Remember that binary numbers are made up of _bits_, which are either zero or one. - - * `00000000:` empty (0) - * `00000001:` pawn (1) - * `00000010:` rook (2) - * `00000011:` knight (3) - * `00000100:` bishop (4) - * `00000101:` queen (5) - * `00000110:` king (6) - - - -To list all pieces on a chessboard, we only need the three bits that represent (from right to left) the values 1, 2, and 4. For example, the number 6 is binary `110`. All of the other bits in the binary representation of 6 are zeroes. - -And with a bit of cleverness, we can use one of those extra always-zero bits to track if a piece is black or white. We can use the number 8 (binary `00001000`) to indicate if a piece is black. If this bit is 1, it's black; if it's 0, it's white. That's called a _bit-field_, which we can pull out later using a binary _mask_. - -### Storing data with bit-fields - -To write a chess program using bit-fields and masks, we might start with these definitions: - - -``` -/* game pieces */ - -#define EMPTY 0 -#define PAWN 1 -#define ROOK 2 -#define KNIGHT 3 -#define BISHOP 4 -#define QUEEN 5 -#define KING 6 - -/* piece color (bit-field) */ - -#define BLACK 8 -#define WHITE 0 - -/* piece only (mask) */ - -#define PIECE 7 -``` - -When you assign a value to a square, such as when initializing the chessboard, you can assign a single `int` value to track both the piece and its color. For example, to store a black rook in position 0,0 of an array, you would use this code: - - -``` -  int board[8][8]; - -.. - -  board[0][0] = BLACK | ROOK; -``` - -The `|` is a binary OR, which means the computer will combine the bits from two numbers. For every bit position, if that bit from _either_ number is 1, the result for that bit position is also 1. Binary OR of the value `BLACK` (8, or binary `00001000`) and the value `ROOK` (2, or binary `00000010`) is binary `00001010`, or 10: - - -``` -    00001000 = 8 - OR 00000010 = 2 -    ________ -    00001010 = 10 -``` - -Similarly, to store a white pawn in position 6,0 of the array, you could use this: - - -``` -`  board[6][0] = WHITE | PAWN;` -``` - -This stores the value 1 because the binary OR of `WHITE` (0) and `PAWN` (1) is just 1: - - -``` -    00000000 = 0 - OR 00000001 = 1 -    ________ -    00000001 = 1 -``` - -### Getting data out with masks - -During the chess game, the program will need to know what piece is in a square and its color. We can separate the piece using a binary mask. - -For example, the program might need to know the contents of a specific square on the board during the chess game, such as the array element at `board[5][3]`. What piece is there, and is it black or white? To identify the chess piece, combine the element's value with the `PIECE` mask using the binary AND: - - -``` -  int board[8][8]; -  int piece; - -.. - -  piece = board[5][3] & PIECE; -``` - -The binary AND operator (`&`) combines two binary values so that for any bit position, if that bit in _both_ numbers is 1, then the result is also 1. For example, if the value of `board[5][3]` is 11 (binary `00001011`), then the binary AND of 11 and the mask PIECE (7, or binary `00000111`) is binary `00000011`, or 3. This is a knight, which also has the value 3. - - -``` -    00001011 = 11 -AND 00000111 = 7 -    ________ -    00000011 = 3 -``` - -Separating the piece's color is a simple matter of using binary AND with the value and the `BLACK` bit-field. For example, you might write this as a function called `is_black` to determine if a piece is either black or white: - - -``` -int -is_black(int piece) -{ -  return (piece & BLACK); -} -``` - -This works because the value `BLACK` is 8, or binary `00001000`. And in the C programming language, any non-zero value is treated as True, and zero is always False. So `is_black(board[5][3])` will return a True value (8) if the piece in array element `5,3` is black and will return a False value (0) if it is white. - -### Bit fields - -Using bit-fields and masks is a common method to combine data without using structures. They are worth adding to your programmer's "tool kit." While data structures are a valuable tool for ordered programming where you need to track related data, using separate elements to track single On or Off values (such as the colors of chess pieces) is less efficient. In these cases, consider using bit-fields and masks to combine your data more efficiently. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/8/binary-bit-fields-masks - -作者:[Jim Hall][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jim-hall -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life-chess-games.png?itok=U1lWMZ0y (Chess pieces on a chess board) diff --git a/sources/tech/20210910 MAKE MORE with Inkscape - Ink-Stitch.md b/sources/tech/20210910 MAKE MORE with Inkscape - Ink-Stitch.md deleted file mode 100644 index 6469a1de35..0000000000 --- a/sources/tech/20210910 MAKE MORE with Inkscape - Ink-Stitch.md +++ /dev/null @@ -1,212 +0,0 @@ -[#]: subject: "MAKE MORE with Inkscape – Ink/Stitch" -[#]: via: "https://fedoramagazine.org/make-more-with-inkscape-ink-stitch/" -[#]: author: "Sirko Kemter https://fedoramagazine.org/author/gnokii/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -MAKE MORE with Inkscape – Ink/Stitch -====== - -![MAKE more with Inkscape - Ink/Stitch][1] - -Inkscape, the most used and loved tool of Fedora’s Design Team, is not just a program for doing nice vector graphics. With vector graphics (in our case SVG) a lot more can be done. Many programs can import this format. Also, Inkscape can do a lot more than just graphics. The first article of this [series][2] showed how to [produce GCode with Inkscape][3]. This article will examine another Inkscape extension – [Ink/Stitch][4]. Ink/Stitch is an extension for designing embroidery with Inkscape. - -### DIY Embroidery - -In the last few years the do-it-yourself or maker scene has experienced a boom. You could say it all began with the inexpensive option of [3D printing][5]; followed by also not expensive [CNC][6] machines and laser cutters/engravers. Also the prices for more _“_traditional_”_ machines such as embroidery machines have fallen during recent years. [Home embroidery machines are now available for 500 US dollars][7]. - -If you don’t want to or can’t buy one yourself, the nearest [MakerSpace][8] often has one. Even the prices for commercial single-head embroidery machines are down to 5,000 US dollars. They are an investment that can pay off quickly. - -### Software for Embroidery Design - -Some of the home machines include their own software for designing embroidery. But most, if not all, of these applications are Windows-only. Also, the most used manufacturer-independent software of this area – [Embird][9] – is only available for Windows. But you could run it in Wine. - -Another solution for Linux – [Embroidermodde][10] – is not really developed anymore. And this is after having had a fundraising campaign. - -Today, only one solution is left – [Ink/Stitch][4] - -![The logo of the Ink/Stitch project][11] - -### Open Source and Embroidery Design - -Ink/Stitch started out using [libembroidery][12]. Today [pyembroidery][13] is used. The manufacturers can’t be blamed for the prices of these machines and the number of Linux users. It is hardly worthwhile to develop applications for Linux. - -#### The Embroidery File Format Problem - -There is a problem with the proliferation of file formats for embroidery machines; especially among manufacturers that cook their own file format for their machines. In some cases, even a single manufacturer may use several different file formats. - - * **.10o** – Toyota embroidery machines - * **.100** – Toyota embroidery machines - * **.CSD** – Poem, Huskygram, and Singer EU embroidery home sewing machines. - * **.DSB** – Baruda embroidery machines - * **.JEF** – MemoryCraft 10000 machines. - * **.SEW** – MemoryCraft 5700, 8000, and 9000 machines. - * **.PES** – Brother and Babylock embroidery home sewing machines. - * **.PEC** – Brother and Babylock embroidery home sewing machines. - * **.HUS** – Husqvarna/Viking embroidery home sewing machines. - * **.PCS** – Pfaff embroidery home sewing machines. - * **.VIP** – old Pfaff format also used by Husqvarna machines. - * **.VP3** – newer Pfaff embroidery home sewing machines. - * **.DST** – Tajima commercial embroidery sewing machines. - * **.EXP** – Melco commercial embroidery sewing machines. - * **.XXX** – Compucon, Singer embroidery home sewing machines. - * **.ZSK** – ZSK machines on the american market - - - -This is just a small selection of the file formats that are available for embroidery. You can find a more complete list [here][14]. If you are interested in [deeper knowledge about these file formats, see here for more information][15]. - -#### File Formats of Ink/Stitch - -Ink/Stitch can currently read the following file formats: 100, 10o, BRO, DAT, DSB, DST, DSZ, EMD, EXP, EXY, FXY, GT, INB, JEF, JPX, KSM, MAX, MIT, NEW, PCD, PCM, PCQ, PCS, PEC, PES, PHB, PHC, SEW, SHV, STC, STX, TAP, TBF, U01, VP3, XXX, ZXY and also GCode as TXT file. - -For the more important task of writing/saving your work, Ink/Stitch supports far fewer formats: DST, EXP, JEF, PEC, PES, U01, VP3 and of course SVG, CSV and GCode as TXT - -Besides the problem of all these file formats, there are other problems that a potential stitch program has to overcome. - -Working with the different kinds of stitches is one difficulty. The integration of tools for drawing and lettering is another. But why invent such a thing from scratch? Why not take an existing vector program and just add the functions for embroidery to it? That was the idea behind the [Ink/Stitch project][4] over three years ago. - -### Install Ink/Stitch - -Ink/Stitch is an [extension for Inkscape][16]. Inkscape’s new functionality for downloading and installing extensions is still experimental. And you will not find Ink/Stitch among the extensions that are offered there. You must [download][17] the extension manually. After it is downloaded, unzip the package into your directory for Inkscape extensions. The default location is _~/.config/Inkscape/extensions_ (or _/usr/share/inkscape/extensions_ for system-wide availability). If you have changed the defaults, you may need to check Inkscape’s settings to find the location of the extensions directory. - -### Customization – Install Add-ons for Ink/Stitch - -The Ink/Stitch extension provides a function called Install Add-Ons for Inkscape, which you should run first. - -The execution of this function – _Extensions > Ink/Stitch > Thread Color Management > Install thread color palettes for Inkscape_ – will take a while. - -Do not become nervous as there is no progress bar or a similar thing to see. - -This function will install 70 color palettes of various yarn manufacturers and a symbol library for Ink/Stitch. - -![Inkscape with the swatches dialogue open, which shows the Madeira Rayon color palette][18] - -If you use the download from Github version 2.0.0, the ZIP-file contains the color palette files. You only need to unpack them into the right directory (_~/.config/inkscape/palettes/_). If you need a [hoop template, you can download][19] one and save it to _~/.config/inkscape/templates_. - -The next time you start Inkscape, you will find it under _File > New From Template_. - -### Lettering with Ink/Stitch - -The way that is by far the easiest and most widely used, is to get a embroidery design using the _Lettering_ function of Ink/Stitch. It is located under _Extensions > Ink/Stitch > Lettering_. Lettering for embroidery is not simple. What you expect are so called satin stitched letters. For this, special font settings are needed. - -![Inkscape with a “Chopin” glyph for satin stitching defined for the Lettering function][20] - -You can convert paths to satin stitching. But this is more work intensive than using the Lettering function. Thanks to the work of an active community, the May 2021 release of Ink/Stitch 2.0 brought more predefined fonts for this. An English tutorial on how to create such fonts can be found [here][21]. - -Version 2.0 also brings functions (_Extensions > Ink/Stitch > Font Management_) to make managing these kinds of fonts easier. There are also functions for creating these kinds of fonts. But you will need knowledge about font design with Inkscape to do so. First, you create an an entire SVG font. It is then feed through a JSON script which converts the SVG font into the type of files that Ink/Stitch’s font management function works with. - -![On the left side the Lettering dialogue and on the right the preview of this settings][22] - -The function will open a dialogue window where you just have to put in your text, choose the size and font, and then it will render a preview. - -### Embroider Areas/Path-Objects - -The easiest thing with Ink/Stitch, is to embroider areas or paths. Just draw your path. When you use shapes then you have to convert them and then run _Extensions > Ink/Stitch > Fill Tools > Break Apart Fill Objects…_ - -This breaks apart the path into its different parts. You have to use this function. The _Path > Break apart_ function of Inkscape won’t work for this. - -Next, you can run Ink/Stitch’s built-in simulator: _Extensions > Ink/Stitch > Visualise and Export > Simulator/Realistic Preview_. - -![The new Fedora logo as Stitch Plan Preview][23] - -Be careful with the simulator. It takes a lot system resources and it will take a while to start. You may find it easier to use the function _Extensions > Ink/Stitch > Visualise and Export > Stitch Plan Preview_. The latter renders the threading of the embroidery outside of the document. - -![Nicubunu’s Fedora hat icon as embroidery. The angles for the stitches of the head part and the brim are different so that it looks more realistic. The outline is done in Satin stitching][24] - -### Simple Satin and Satin Embroidery - -Ink/Stitch will convert each stroke with a continuous line (no dashes) to what they call Zig-Zag or Simple Satin. Stitches are created along the path using the stroke width you have specified. This will work as long there aren’t too many curves on the path. - -![Parameter setting dialogue and on the right the Fedora logo shape embroidered as Zig-Zag line][25] - -This is simple. But it is by far not the best way. It is better to use the Satin Tools for this. The functions for the Satin embroidery can be found under _Extensions > Satin Tools_. The most important is the conversion function which converts paths to satin strokes. - -![Fedora logo shape as Satin Line embroidery][26] - -You can also reverse the stitch direction using _Extensions > Satin Tools > Flip Satin Column Rails_. This underlines the 3D effect satin embroidery gets, especially when you make puff embroidery. For machines that have this capability, you can also set the markings for the trims of jump stitches. To visualize these trims, Ink/Stitch uses the symbols that where installed from its own symbol library. - -### The Ink/Stitch Stitch Library - -What is called the stitch library is simply the kind of stitches that Ink/Stitch can create. The Fill Stitch and Zig-Zag/Satin Stitch have already been introduced. But there are more. - - * **Running Stitches**: These are used for doing outline designs. The running stitch produces a series of small stitches following a line or curve. Each dashed line will be converted into a Running Stitch. The size of the dashes does not matter. - - - -![A running stitch – each dashed line will be converted in such one][27] - - * **Bean Stitches**: These can also be used for outline designs or add details to a design. The bean stitch describes a repetition of running stitches back and forth. This results in thicker threading. - - - -![Bean Stitches – creating a thicker line][28] - - * **Manual Stitch**: In this mode, Ink/Stitch will use each node of a path as a needle penetration point; exactly as they are placed. - - - -![In manual mode – each node will be the needle penetration point][29] - - * **E-Stitch**: The main use for e-stitch is a simple but strong cover stitch for applique items. It is often used for baby cloths because their skin tends to be more sensitive. - - - -![E-Stitch mostly used for applications on baby cloths, soft but strong connection][30] - -### Embroidery Thread List - -Some embroidery machines (especially those designed for commercial use) allow different threads to be fitted in advance according to what will be needed for the design. These machines will automatically switch to the right thread when needed. Some file formats for embroidery support this feature. But some do not. Ink/Stitch can apply custom thread lists to an embroidery design. - -If you want to work on an existing design, you can import a thread list: _Extensions > Ink/Stitch > Import Threadlist_. Thread lists can also be exported: _Save As different file formats as *.zip_. You can also print them: _Extensions > Ink/Stitch > Visualise and Export > Print PDF_. - -### Conclusion - -Writing software for embroidery design is not easy. Many functions are needed and diverse (sometimes closed-source) file formats make the task difficult. Ink/Stitch has managed to create a useful tool with many functions. It enables the user to get started with basic embroidery design. Some things could be done a little better. But it is definitely a good tool as-is and I expect that it will become better over time. Machine embroidery can be an interesting hobby and with Ink/Stitch the Fedora Linux user can begin designing breathtaking things. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/make-more-with-inkscape-ink-stitch/ - -作者:[Sirko Kemter][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/gnokii/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2021/08/drawing2-816x345.png -[2]: https://fedoramagazine.org/series/make-more/ -[3]: https://fedoramagazine.org/make-more-with-inkscape-g-code-tools/ -[4]: https://inkstitch.org/ -[5]: https://fedoramagazine.org/3d-printing-in-fedora-from-an-idea-to-the-thing/ -[6]: https://en.wikipedia.org/wiki/Numerical_control -[7]: https://www.amazon.com/-/de/dp/B07VZ2YBLL/ref=sr_1_11?__mk_de_DE=%C3%85M%C3%85%C5%BD%C3%95%C3%91&crid=1MFJJWXMKQD6R&dchild=1&keywords=home+embroidery+machine&qid=1628388092&rnid=2941120011&s=arts-crafts&sprefix=home+embroider+%2Caps%2C-1&sr=1-11 -[8]: https://www.fablabs.io/labs/map -[9]: https://www.embird.net/ -[10]: https://embroidermodder.org/ -[11]: https://fedoramagazine.org/wp-content/uploads/2021/08/inkstitch_logo.png -[12]: https://github.com/Embroidermodder/libembroidery -[13]: https://github.com/inkstitch/pyembroidery -[14]: http://www.needlework.ru/page/embroidery.htm -[15]: http://edutechwiki.unige.ch/en/Embroidery_format -[16]: https://inkscape.org/~wwderw/%E2%98%85inkstitch-embroidery-extension -[17]: https://github.com/inkstitch/inkstitch/releases/tag/v2.0.0 -[18]: https://fedoramagazine.org/wp-content/uploads/2021/08/swatches-1024x556.png -[19]: https://inkstitch.org/assets/images/tutorials/templates/hoop-template.svg -[20]: https://fedoramagazine.org/wp-content/uploads/2021/08/satinfont-1024x556.png -[21]: https://inkstitch.org/tutorials/font-creation/ -[22]: https://fedoramagazine.org/wp-content/uploads/2021/08/lettering-1024x523.png -[23]: https://fedoramagazine.org/wp-content/uploads/2021/08/stitch-preview-1024x556.png -[24]: https://fedoramagazine.org/wp-content/uploads/2021/08/nicu-stitch.gif -[25]: https://fedoramagazine.org/wp-content/uploads/2021/08/zigzag-1024x463.png -[26]: https://fedoramagazine.org/wp-content/uploads/2021/08/satin.png -[27]: https://fedoramagazine.org/wp-content/uploads/2021/08/running-stitch-detail.jpg -[28]: https://fedoramagazine.org/wp-content/uploads/2021/08/bean-stitch-detail.jpg -[29]: https://fedoramagazine.org/wp-content/uploads/2021/08/manual-stitch-detail.png -[30]: https://fedoramagazine.org/wp-content/uploads/2021/08/e-stitch-detail.jpg diff --git a/sources/tech/20211109 relaying mail to multiple smarthosts with opensmtpd.md b/sources/tech/20211109 relaying mail to multiple smarthosts with opensmtpd.md deleted file mode 100644 index f0d165e51a..0000000000 --- a/sources/tech/20211109 relaying mail to multiple smarthosts with opensmtpd.md +++ /dev/null @@ -1,85 +0,0 @@ -[#]: subject: "relaying mail to multiple smarthosts with opensmtpd" -[#]: via: "https://jao.io/blog/2021-11-09-relaying-mail-to-multiple-smarthosts.html" -[#]: author: "jao https://jao.io" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -relaying mail to multiple smarthosts with opensmtpd -====== - -I like to use a local smtp daemon for sending email from my laptop, because that way i can send emails even while disconnected and, even when the network is up, because i don't have to wait for the network protocol to be completed with a remote smarthost. Oh, and i also need local mail delivery. - -For many years i've used postfix to those ends; it has an acceptably simply-ish configuration; but recently i've become fond of VPNs ([mullvad][1], if you want to know), and was annoyed by its getting confused when `/etc/resolv.conf` changes (for instance, because you get the VPN up after postfix's service has started). I've found a pleasantly simple alternative: [OpenSMTPD][2]. - -Say i want to use the SMTP server fencepost.gnu.org when sending an email as [jao@gnu.org][3] and smtp.jao.io when writing with [mail@jao.io][4] or [news@xmobar.org][5] in my `From` header. OpenSMTPD let's you do that with a very simple configuration file in `/etc/smtpd.conf`[1][6]: - -``` - - table aliases file:/etc/aliases - table secrets db:/etc/mail/secrets.db - - table sendergnu { jao@gnu.org } - table senderjao { mail@jao.io, news@xmobar.org } - - listen on localhost - - action "local" mbox alias - action "relaygnu" relay host smtp+tls://gnu@fencepost.gnu.org:587 auth - action "relayjao" relay host smtps://jao@smtp.jao.io:465 auth - - match for local action "local" - match for any from mail-from action "relaygnu" - match for any from mail-from action "relaygan" - -``` - -where we have also configured local delivery for a good measure. That's the full configuration file! The only other thing needed is generating the `secrets.db` file with the users and passwords corresponding to the keys `gnu` and `jao` (those are just arbitrary names). To that end, we create a plain text file with them, using entries of the form ` :`: - -``` - - gnu jao:my fencepost password - jao mail@jao.io:xxxxxxxxxxxxxxxxx - -``` - -where my user for `fencepost.gnu.org` is `jao` and for `smtp.jao.io` is `mail@jao.io` (you see there's no need of escaping spaces or ats). Then we use the program `makemap` to create the secrets db: - -``` - - makemap secrets && rm secrets - -``` - -### Footnotes: - -[1][7] - -That's the default configuration file in my debian box; other popular alternative is `/etc/openstmpd.conf`. - -[Tags][8]: [sundry][9] - --------------------------------------------------------------------------------- - -via: https://jao.io/blog/2021-11-09-relaying-mail-to-multiple-smarthosts.html - -作者:[jao][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://jao.io -[b]: https://github.com/lujun9972 -[1]: https://en.wikipedia.org/wiki/Mullvad -[2]: https://www.opensmtpd.org/ -[3]: mailto:jao@gnu.org -[4]: mailto:mail@jao.io -[5]: mailto:news@xmobar.org -[6]: tmp.zHAc8OxDnm#fn.1 -[7]: tmp.zHAc8OxDnm#fnr.1 -[8]: https://jao.io/blog/tags.html -[9]: https://jao.io/blog/tag-sundry.html diff --git a/sources/tech/20211115 Linux tips for using cron to schedule tasks.md b/sources/tech/20211115 Linux tips for using cron to schedule tasks.md index 7366456bd1..293343467d 100644 --- a/sources/tech/20211115 Linux tips for using cron to schedule tasks.md +++ b/sources/tech/20211115 Linux tips for using cron to schedule tasks.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/11/cron-linux" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "Veryzzj" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " diff --git a/sources/tech/20211122 7 key components of observability in Python.md b/sources/tech/20211122 7 key components of observability in Python.md deleted file mode 100644 index 9ae46b153c..0000000000 --- a/sources/tech/20211122 7 key components of observability in Python.md +++ /dev/null @@ -1,188 +0,0 @@ -[#]: subject: "7 key components of observability in Python" -[#]: via: "https://opensource.com/article/21/11/observability-python" -[#]: author: "Moshe Zadka https://opensource.com/users/moshez" -[#]: collector: "lujun9972" -[#]: translator: "MCGA" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -7 key components of observability in Python -====== -Learn why observability is important for Python and how to implement it -into your software development lifecycle. -![Searching for code][1] - -The applications you write execute a lot of code, in a way that's essentially invisible. So how can you know: - - * Is the code working? - * Is it working well? - * Who's using it, and how? - - - -Observability is the ability to look at data that tells you what your code is doing. In this context, the main problem area is server code in distributed systems. It's not that observability isn't important for client applications; it's that clients tend not to be written in Python. It's not that observability does not matter for, say, data science; it's that tooling for observability in data science (mostly Juptyter and quick feedback) is different. - -### Why observability matters - -So why does observability matter? Observability is a vital part of the software development life cycle (SDLC). - -Shipping an application is not the end; it is the beginning of a new cycle. In that cycle, the first stage is to confirm that the new version is running well. Otherwise, a rollback is probably needed. Which features are working well? Which ones have subtle bugs? You need to know what's going on to know what to work on next. Things fail in weird ways. Whether it's a natural disaster, a rollout of underlying infrastructure, or an application getting into a strange state, things can fail at any time, for any reason. - -Outside of the standard SDLC, you need to know that everything is still running. If it's not running, it's essential to have a way to know how it is failing. - -### Feedback - -The first part of observability is getting feedback. When code gives information about what it is doing, feedback can help in many ways. In a staging or testing environment, feedback helps find problems and, more importantly, triage them in a faster way. This improves the tooling and communication around the validation step. - -When doing a canary deployment or changing a feature flag, feedback is also important to let you know whether to continue, wait longer, or roll it back. - -### Monitor - -Sometimes you suspect that something has gone wrong. Maybe a dependent service is having issues, or maybe social media is barraging you with questions about your site. Maybe there's a complicated operation in a related system, and you want to make sure your system is handling it well. In those cases, you want to aggregate the data from your observability system into dashboards. - -When writing an application, these dashboards need to be part of the design criteria. The only way they have data to display is when your application shares it with them. - -### Alerts - -Watching dashboards for more than 15 minutes at a time is like watching paint dry. No human should be subjected to this. For that task, we have alerting systems. Alerting systems compare the observability data to the expected data and send a notification when it doesn't match up. Fully delving into incident management is beyond the scope of this article. However, observable applications are alert-friendly in two ways: - - * They produce enough data, with enough quality, that high-quality alerts can be sent. - * The alert has enough data, or the receiver can easily get the data, to help triage the source. - - - -High-quality alerts have three properties: - - * Low false alarms: If there's an alert, there's definitely a problem. - * Low missing alarms: When there's a problem, an alert is triggered. - * Timely: An alert is sent quickly to minimize time to recovery. - - - -These three properties are in a three-way conflict. You can reduce false alarms by raising the threshold of detection at the cost of increasing missing alarms. You can reduce missing alarms by lowering the threshold of detection at the expense of increasing false alarms. You can reduce both false alarms and missing alarms by collecting more data at the cost of timeliness. - -Improving all three parameters is harder. This is where the quality of observability data comes in. Higher quality data can reduce all three. - -### Logging - -Some people like to make fun of print-based debugging. But in a world where most software runs on not-your-local-PC, print debugging is all you can do. Logging is a formalization of print debugging. The Python logging library, for all of its faults, allows standardized logging. Most importantly, it means you can log from libraries. - -The application is responsible for configuring which logs go where. Ironically, after many years where applications were literally responsible for configuration, this is less and less true. Modern applications in a modern container orchestration environment log to standard error and standard output and trust the orchestration system to manage the log properly. - -However, you should not rely on it in libraries, or pretty much anywhere. If you want to let the operator know what's going on, _use logging, not print_. - -#### Logging levels - -One of the most important features of logging is _logging levels_. Logging levels allow you to filter and route logs appropriately. But this can only be done if logging levels are consistent. At the very least, you should make them consistent across your applications. - -With a little help, libraries that choose incompatible semantics can be retroactively fixed by appropriate configuration at the application level. Do this by using the most important universal convention in Python: using the `getLogger(__name-_)`. - -Most reasonable libraries follow this convention. Filters can modify logging objects in place before they are emitted. You can attach a filter to the handler that will modify the messages based on the name to have appropriate levels. - - -``` - - -import logging - -LOGGER=logging.getLogger(__name__) - -``` - -With this in mind, you now have to actually specify semantics for logging levels. There are a lot of options, but the following are my favorite: - - * Error: This sends an immediate alert. The application is in a state that requires operator attention. (This means that Critical and Error are folded.) - * Warning: I like to call these “Business hours alerts.” Someone should look at this within one business day. - * Info: This is emitted during normal flow. It's designed to help people understand what the application is doing if they already suspect a problem. - * Debug: This is not emitted in the production environment by default. It might or might not be emitted in development or staging, and it can be turned on explicitly in production if more information is needed. - - - -In no case should you include PII (Personal Identifiable Information) or passwords in logs. This is true regardless of levels. Levels change, debug levels are activated, and so on. Logging aggregation systems are rarely PII-safe, especially with evolving PII regulation (HIPAA, GDPR, and others). - -#### Log aggregation - -Modern systems are almost always distributed. Redundancy, scaling, and sometimes jurisdictional needs mean horizontal distribution. Microservices mean vertical distribution. Logging into each machine to check the logs is no longer realistic. It is often a bad idea for proper control reasons: allowing developers to log into machines gives them too many privileges. - -All logs should be sent into an aggregator. There are commercial offerings, you can configure an ELK stack, or you can use any other database (SQL or no-SQL). As a really low-tech solution, you can write the logs to files and ship them to an object storage. There are too many solutions to explain, but the most important thing is choosing one and aggregating everything. - -#### Logging queries - -After logging everything to one place, there are too many logs. The specific aggregator defines how to write queries, but whether it's grepping through storage or writing NoSQL queries, logging queries to match source and details are useful. - -### Metric scraping - -Metrics scraping is a server pull model. The metrics server connects to the application periodically and pulls the metrics. - -At the very least, this means the server needs connectivity and discovery for all relevant application servers. - -#### Prometheus as a standard - -The [Prometheus][2] format as an endpoint is useful if your metrics aggregator is Prometheus. But it is also useful if it is not! Almost all systems contain a compatibility shim for Prometheus endpoints. - -Adding a Prometheus shim to your application using the client Python library allows it to be scraped by most metrics aggregators. Prometheus expects to find, once it discovers the server, a metrics endpoint. This is often part of the application routing, often at `/metrics`. Regardless of the platform of the web application, if you can serve a custom byte stream with a custom content type at a given endpoint, you can be scraped by Prometheus. - -For the most popular framework, there is also a middleware plugin or something equivalent that automatically collects some metrics, like latency and error rates. This is not usually enough. You want to collect custom application data: for example, cache hit/miss rates per endpoint, database latency, and so on. - -#### Using counters - -Prometheus supports several data types. One important and subtle type is the counter. Counters always advance—with one caveat. - -When the application resets, the counter goes back to zero. These “epochs” in counters are managed by having the counter “creation time” sent as metadata. Prometheus will know not to compare counters from two different epochs. - -#### Using gauges - -Gauges are much simpler: They measure instantaneous values. Use them for measurements that go up and down: for example, total allocated memory, size of cache, and so on. - -#### Using enums - -Enums are useful for states of the application as a whole, although they can be collected on a more granular basis. For example, if you are using a feature-gating framework, a feature that can have several states (e.g., in use, disabled, shadowing) might be useful to have as an enum. - -### Analytics - -Analytics are different from metrics in that they correspond to coherent events. For example, in network servers, an event is one outside request and its resulting work. In particular, the analytics event cannot be sent until the event is finished. - -An event contains specific measurements: latency, number and possibly details of resulting requests to other services, and so on. - -#### Structured Logging - -One current possible option is structured logging. The send event is just sending a log with a properly formatted payload. This data can be queried from the log aggregator, parsed, and ingested into an appropriate system for allowing visibility into it. - -### Error tracking - -You can use logs to track errors, and you can use analytics to track errors. But a dedicated error system is worthwhile. A system optimized for errors can afford to send more data since errors are rare. It can send the right data, and it can do smart things with the data. Error-tracking systems in Python usually hook into a generic exception handler, collect data, and send it to a dedicated error aggregator. - -#### Using Sentry - -In many cases, running Sentry yourself is the right thing to do. When an error has occurred, something has gone wrong. Reliably removing sensitive data is not possible, since these are precisely the cases where the sensitive data might have ended up somewhere it shouldn't. - -It is often not a big load: exceptions are supposed to be rare. Finally, this is not a system that needs high-quality, high-reliability backups. Yesterday's errors are already fixed, hopefully, and if they are not—you'll know! - -### Fast, safe, repeatable: choose all three - -Observable systems are faster to develop since they give you feedback. They are safer to run since, when they go wrong, they let you know sooner. Finally, observability lends itself to building repeatable processes around it since there is a feedback loop. Observability gives you knowledge about your application. And knowing is half the battle. - -#### Upfront investment pays off - -Building all the observability layers is hard work. It also often feels like wasted work, or at least like “nice to have but not urgent.” - -Can you build it later? Maybe, but you shouldn't. Building it right lets you speed up the rest of development so much at all stages: testing, monitoring, and even onboarding new people. In an industry with as much churn as tech, just reducing the overhead of onboarding a new person is worth it. - -The fact is, observability is important, so write it in early in the process and maintain it throughout. In turn, it will help you maintain your software. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/11/observability-python - -作者:[Moshe Zadka][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/moshez -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/search_find_code_python_programming.png?itok=ynSL8XRV (Searching for code) -[2]: https://opensource.com/article/21/7/run-prometheus-home-container diff --git a/sources/tech/20220520 Ubuntu vs Manjaro- Comparing the Different Linux Experiences.md b/sources/tech/20220520 Ubuntu vs Manjaro- Comparing the Different Linux Experiences.md index caee2de033..b7f84b65a5 100644 --- a/sources/tech/20220520 Ubuntu vs Manjaro- Comparing the Different Linux Experiences.md +++ b/sources/tech/20220520 Ubuntu vs Manjaro- Comparing the Different Linux Experiences.md @@ -2,16 +2,19 @@ [#]: via: "https://itsfoss.com/ubuntu-vs-manjaro/" [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lkxed" -[#]: translator: " " +[#]: translator: "Return7g" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " Ubuntu vs Manjaro: Comparing the Different Linux Experiences +对比 Ubuntu 和 Manjaro :比较不同 Linux 发行版体验 ====== Ubuntu is the most popular Debian-based Linux distribution for desktops and servers. +Ubuntu 是基于 Debian 最流行的桌面和服务器 Linux 发行版 And Manjaro Linux is an Arch-based distro tailored for desktops. +Manjaro Linux 是基于 Arch 量身定制的桌面发行版 Both are entirely different when it comes to user experience and features. diff --git a/sources/tech/20220614 Build a Smart Parking System for a Metro Station.md b/sources/tech/20220614 Build a Smart Parking System for a Metro Station.md deleted file mode 100644 index 45b3dbdb8b..0000000000 --- a/sources/tech/20220614 Build a Smart Parking System for a Metro Station.md +++ /dev/null @@ -1,141 +0,0 @@ -[#]: subject: "Build a Smart Parking System for a Metro Station" -[#]: via: "https://www.opensourceforu.com/2022/06/build-a-smart-parking-system-for-a-metro-station/" -[#]: author: "Dr Maheswari R. https://www.opensourceforu.com/author/dr-maheswari-r/" -[#]: collector: "lkxed" -[#]: translator: "Maisie-x " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Build a Smart Parking System for a Metro Station -====== -This article will help you design a Web based application that automates a smart parking system for cars in a metro station using Node-RED. - -![Smart car parking][1] - -A Web application is software that gets executed on a Web server. Every Web application is accessed by the end user through a Web browser. These Web applications are programmed using a client-server architecture, where the user (client) is provided services through a remotely located server that might be hosted by a third-party. A Web API (application programming interface) is available across the Web and can be accessed by the user using the HTTP protocol, as shown in Figure 1. - -This article will demonstrate how to design a Web based application for an automated smart parking system for cars in a metro station. It is designed using open source Node-RED. This system creates an interactive and stylish user login form using a template node, where HTML and CSS are coded to get car owner details to automate the parking system. We can see the login and submission form flow diagrams in Figures 2 and 3. - -The nodes used are as follows: - -**[Metro smart parking node flow design][2]** -Node-RED is triggered using the command ‘node-red’. Through the URL *http://127.0.0.1:1880/*, the node-RED UI flow browser is enabled. We have considered that the Node-RED setup is done and working. - -![table function][3] - -![Figure 1: Web API][4] - -Follow the steps given below to create the login and submission forms. - -![Figure 2: Login form flow diagram][5] - -![Figure 3: Submission form flow diagram][6] - -*Login form* -1) From the node palette, drag and drop http in node, which creates an HTTP end point for creating Web services. -2) Connect http in node to function node. The latter helps to code JavaScript functions to run against the messages being received by the node. - -![Figure 4: Login form for smart parking for cars][7] - -3) Connect function node to template node, where the latter creates a Web API based on the provided template. -4) Connect template node to http response node; the latter sends responses back to requests received from an http input node. - -![Figure 5: Submission form for smart parking for cars][8] - -**Submission form** -1) Drag and drop http in node and connect it to json node, which converts and communicates the data as JSON string. -2) Connect http in node to debug node, which gives output in a debug monitor. -3) Place and connect json node to function node and connect the latter to http response node. - -After the creation of a complete flow, click on the Deploy button in the top right corner of the Node-RED window. To view the user interface, go to the link*127.0.0.1:1880/ui/.* -Once you enter and then click Submit, it will take you to the next page where you can read all the news articles. - -**Node-RED workflow** -In a single flow of Node-RED, you can create both the login form and submission form, as shown in Figures 4 and 5. - -Now we will configure the Node properties. - -*Login form:* Edit the http in property by choosing the method ‘Get’ and set the URL to ‘/MetroStation’ and configure the name as ‘Smart Parking’. - -![Figure 6: Http in node property configurations][9] - -| - | -| :- | -| Note: The URL can be any user defined local variable. | - -Now select the function node and edit its properties by coding the ‘msg.url = project’ and configure the name field with ‘Project Submission’. - -![Figure 7: Function node property configurations][10] - -In the Property window of the template node, configure the appropriate HTML code required for the login form and specify the name as ‘Display panel’. The Mustache template format is being used in this flow. Mustache is a simple Web template system that is described as a logicless template engine. It does not have any explicit control flow statements, such as ‘if’ and ‘else’ conditionals or ‘for’ loops. Looping and conditional evaluation can be achieved using section tags processing lists and lambdas. - -![Figure 8: Template node property configurations][11] - -Configure the edit property of http response node with the name ‘Smart Parking’ (Figure 9). - -![Figure 9: Http response node property configurations][12] - -*Submission form:*In the edit property window of http in node, choose the method ‘POST’ and the URL ‘/project’. - -![Figure 10: Http in node property configurations][13] - -In the JSON node edit window, set *Action* as ‘Convert between JSON String & Object’. Refer to Figure 11. - -![Figure 11: JSON node property configurations][14] - -The function node is configured as specified in Figure 12. - -![Figure 12: Function node property configurations][15] - -In http response node, edit the property name as ‘Project Submitted’. - -![Figure 13: Http response node property configurations][16] - -| - | -| :- | -| Note: Also add the comment node with comments as ‘Login Form’ and ‘Submission Form’ | - -![Figure 14: Debug node property configurations][17] - -**Dashboard UI Web page** -When the user clicks on Submit, the data given will be displayed in the UI and the debug node. If Reset is clicked, the details will be cleared, allowing the user to enter new details (Figure 15). - -![Figure 15: User login UI][18] - -Metro parking rates are provided through a hyperlink, and the tariff output is displayed in the UI. So the smart parking for cars is automated with appropriate hyperlinks to exhibit the parking tariff at the metro station. The final outputs of this automated system are retrieved and displayed in the Node-RED dashboard UI and debug monitor. - -![Figure 16: Metro parking tariff][19] - --------------------------------------------------------------------------------- - -via: https://www.opensourceforu.com/2022/06/build-a-smart-parking-system-for-a-metro-station/ - -作者:[Dr Maheswari R.][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.opensourceforu.com/author/dr-maheswari-r/ -[b]: https://github.com/lkxed -[1]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Smart-car-parking.jpg -[2]: https://www.opensourceforu.com/wp-content/uploads/2022/04/table-function-node-red.jpg -[3]: https://www.opensourceforu.com/wp-content/uploads/2022/04/table-function-node-red.jpg -[4]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-1-Web-Application-Programming-Interface300.jpg -[5]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-2-Login-Form-Flow-Diagram300.jpg -[6]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-3-Submission-Form-Flow-Diagram300.jpg -[7]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-4-Login-Form-of-Metro-Smart-Car-Parking300.jpg -[8]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-5-Submission-Form-of-Metro-Smart-Car-Parking300.jpg -[9]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-6-Http-in-Node-Property-Configurations300.jpg -[10]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-7-Function-Node-Property-Configurations300.jpg -[11]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-8-Template-Node-Property-Configurations300.jpg -[12]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-9-Template-Node-Property-Configurations300.jpg -[13]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-10-Http-in-Node-Property-Configurations300.jpg -[14]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-11-Json-Node-Property-Configurations300.jpg -[15]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-12-Function-Node-Property-Configurations300.jpg -[16]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-13-Http-Response-Node-Property-Configurations300.jpg -[17]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-14-Debug-Node-Property-Configurations300.jpg -[18]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-15-User-Login-UI300.jpg -[19]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-16-Parking-Tariff-Metro300.jpg diff --git a/sources/tech/20220626 An open source project that opens the internet for all.md b/sources/tech/20220626 An open source project that opens the internet for all.md deleted file mode 100644 index 4f4e509eab..0000000000 --- a/sources/tech/20220626 An open source project that opens the internet for all.md +++ /dev/null @@ -1,60 +0,0 @@ -[#]: subject: "An open source project that opens the internet for all" -[#]: via: "https://opensource.com/article/22/6/equalify-open-internet-accessibility" -[#]: author: "Blake Bertuccelli https://opensource.com/users/blake" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -An open source project that opens the internet for all -====== -Equalify is an open source project with the goal of making the open internet more accessible. - -![Plumeria by Bernard Spragg][1] - -Image by: "Plumeria (Frangipani)" by Bernard Spragg is marked with CC0 1.0. - -Accessibility is key to promoting an open society. - -We learn online. We bank online. Political movements are won and lost online. Most importantly, the information we access online inspires us to make a better world. When we ignore accessibility requirements, people born without sight or who lost limbs in war are restricted from online information that others enjoy. - -*We must ensure that everyone has access to the open internet*, and I am doing my part to work toward that goal by building [Equalify][2]. - -### What is Equalify? - -Equalify is "the accessibility platform." - -The platform allows users to run multiple accessibility scans on thousands of websites. With our latest version, users can also filter millions of alerts to create a dashboard of statistics that are meaningful to them. - -The project is just getting started. Equalify aims to open source all the premium features that expensive services like SiteImprove provide. With better tools, we can ensure that the internet is more accessible and our society is more open. - -### How do we judge website accessibility? - -W3C's Web Accessibility publishes the Web Content Accessibility Guideline (WCAG) report that sets standards for accessibility. Equalify, and others, including the US Federal Government, use WCAG to meter website accessibility. The more websites we scan, the more we can understand the shortcomings and potentials of WCAG standards. - -### How do I use Equalify? - -Take a few minutes to browse our GitHub and learn more about the product. Specifically, the [README][3] provides steps on how to begin supporting and using Equalify. - -### Our goal - -Our ultimate goal is to make the open internet more accessible. 96.8% of homepages do not meet WCAG guidelines, according to [The WebAIM Million][4]. As more people build and use Equalify, we combat inaccessible pages. Everyone deserves equal access to the open internet. Equalify is working toward that goal as we work toward building a stronger and more open society for all. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/6/equalify-open-internet-accessibility - -作者:[Blake Bertuccelli][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/blake -[b]: https://github.com/lkxed -[1]: https://opensource.com/sites/default/files/2022-06/plumeria-frangipani-bernard-spragg.jpg -[2]: https://equalify.app/ -[3]: https://github.com/bbertucc/equalify -[4]: https://webaim.org/projects/million/ diff --git a/sources/tech/20220707 Use secret keyboard keys on Linux.md b/sources/tech/20220707 Use secret keyboard keys on Linux.md deleted file mode 100644 index 05aadb7731..0000000000 --- a/sources/tech/20220707 Use secret keyboard keys on Linux.md +++ /dev/null @@ -1,151 +0,0 @@ -[#]: subject: "Use secret keyboard keys on Linux" -[#]: via: "https://opensource.com/article/22/7/linux-compose-key-cheat-sheet" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Use secret keyboard keys on Linux -====== -With a compose key, you're not limited to what's on your keyboard. Download the cheat sheet. - -![Linux keys on the keyboard for a desktop computer][1] - -A typical computer keyboard has only about 100 keys on it. - -Most keys double up on characters, also called glyphs, thanks to the Shift key. Glyphs are frequently used to type letters with accents and umlauts, to produce characters used in mathematic or monetary expressions, or just to add fun emojis. In some regions there are even three glyphs available on select keys. - -Regardless of your region, however, some glyphs don't make it onto your keyboard. Fortunately, Linux provides access to these through a compose key. - -There's no compose key on your keyboard, at least not by default, but you can designate a key you're not otherwise using as your compose key. I use the Alt key to the right of the spacebar on my desktop keyboard and the Menu key on my laptop. - -**[[ Download the cheat sheet: Linux compose key ]][2]** - -### Setting a Compose key in GNOME - -![A screenshot shows the keyboard and mouse options visible. The "Compose Key" option is set to Right Alt.][3] - -Image by: - -(Seth Kenlon, CC BY-SA 4.0) - -On the GNOME desktop, install the Tweaks application from your software repository. You can also install it from a terminal (use `apt` for Debian-based distributions, `dnf` for Fedora and similar): - -``` -$ sudo dnf install gnome-tweaks -``` - -After you launch Tweaks: - -1. Click on the Keyboard & Mouse category in the left column. -2. Locate the Compose key setting and choose a key to designate. -3. Close Tweaks. - -### Setting a Compose key in KDE Plasma Desktop - -![A screenshot shows the advanced options threaded under Keyboard settings. "Configure keyboard options" is checked, "Position of Compose Key" is checked within that menu, and "Right Alt" is checked within that menu.][4] - -Image by: - -(Seth Kenlon, CC BY-SA 4.0) - -On the KDE Plasma Desktop, open System Settings and navigate to the Input Devices control panel. Then: - -1. In the Input Devices panel, click the Advanced tab. -2. Find the Compose key list item and choose a key to designate. -3. Click the Apply button in the bottom right corner of the window and then close System Settings. - -### Using compose sequences - -To enter a hidden character, press the compose key and then release it. You're now in compose mode. While in compose mode, you can press and release one key and then another to combine characters. - -For instance: - -1. Press the compose key and release it. You are now in compose mode. -2. Press an apostrophe (') and then release it. -3. Press the letter E and then release it. This is a valid combination, so you are now out of compose mode. - -You've just typed the letter É! - -Some compose sequences are a combination of just two keys, while others require three keys, and at least one special glyph uses a series of four key presses. - -### The secret glyphs - -It's a small world, so there's a good chance you've got friends whose names use glyphs that aren't native to your keyboard. You can now stop skipping over diacritics and type names using the appropriate modifiers. - -Here's a sample list of compose sequences for common diacritics: - -* ' + = á é í ó ú ć ń ý j́́ ẃ ź -* ` + = à è ì ò ù ǹ ỳ ẁ -* ~ + = ã ẽ ĩ õ ũ ñ ỹ -* ^ + = â ê î ô û ĉ ŷ ĵ ŵ ẑ -* u + = ă ĕ ĭ ŏ ŭ -* c + c = č -* - + = ā ē ī ō ū đ -* , + = ą ę į ǫ ų ç ḑ ţ - -That's not a complete list, but it covers a lot of the common ones. - -#### Currency - -International banking gets a little easier thanks to the compose key, too: - -* - + Y = ¥ -* - + L = £ -* = + E = € -* = + L = ₤ -* = + N = ₦ -* = + R = ₹ -* = + W = ₩ -* / + m = ₥ -* R + s = ₨ -* C + r = ₢ -* F + r = ₣ - -Once again, that's not a complete list, but it's a good start. - -#### Fun glyphs - -Diacritics and currency are useful, but the compose key can be used just for fun, too. - -* < + 3 = ♥ -* < + > = ⋄ -* # + q = ♩ -* : + ) = ☺ -* : + ( = ☹ -* p + o + o = 💩 - -#### Live long and prosper - -My favorite "secret" glyph in Linux is the traditional Vulcan salutation, "Live long and prosper." - -* L + L + A + P = 🖖 - -### Finding all the glyphs - -There are many more glyphs available through the compose key, and you can have fun discovering new ones by pressing random compose sequences. A more methodical method for finding glyphs is to refer to the `Compose` file, located in `/usr/share/X11/locale/en_US.UTF-8` (adjust the exact path depending on the locale your keyboard uses). - -That file can admittedly be overwhelming, as it consists of over 6,000 lines of compose sequences, many of which are complex combinations of ASCII and Unicode. For a quick and easy reference of common and foundational sequences, you can [download our compose key cheat sheet][5]. It provides sequences covering mathematics, typography, music, arrows, diacritics, currency, and more. - -Now that you're in on the secret, your range of expression just got a whole lot bigger. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/7/linux-compose-key-cheat-sheet - -作者:[Seth Kenlon][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lkxed -[1]: https://opensource.com/sites/default/files/lead-images/linux_keyboard_desktop.png -[2]: https://opensource.com/downloads/linux-compose-key-cheat-sheet -[3]: https://opensource.com/sites/default/files/2022-04/gnome-tweaks-compose.jpeg -[4]: https://opensource.com/sites/default/files/2022-04/kde-settings-input-advanced-compose.jpeg -[5]: https://opensource.com/downloads/linux-compose-key-cheat-sheet diff --git a/sources/tech/20220712 7 kinds of garbage collection for Java.md b/sources/tech/20220712 7 kinds of garbage collection for Java.md deleted file mode 100644 index 603cfaa5a8..0000000000 --- a/sources/tech/20220712 7 kinds of garbage collection for Java.md +++ /dev/null @@ -1,120 +0,0 @@ -[#]: subject: "7 kinds of garbage collection for Java" -[#]: via: "https://opensource.com/article/22/7/garbage-collection-java" -[#]: author: "Jayashree Huttanagoudar https://opensource.com/users/jayashree-huttanagoudar" -[#]: collector: "lkxed" -[#]: translator: "Veryzzj" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -7 kinds of garbage collection for Java -====== -Learn about the choices you have in Java for memory management. - -An application written using programming languages like C and C++ requires you to program the destruction of objects in memory when they're no longer needed. The more your application grows, the great the probability that you'll overlook releasing unused objects. This leads to a memory leak and eventually the system memory gets used up, and at some point there's no further memory to allocate. This results in a situation where the application fails with an OutOfMemoryError. But in the case of Java, Garbage Collection (GC) happens automatically during application execution, so it alleviates the task of manual deallocation and possible memory leaks. - -Garbage Collection isn't a single task. The Java Virtual Machine (JVM) has eight different kinds of Garbage Collection, and it's useful to understand each one's purpose and strength. - -### 1. Serial GC - -![Serial threaded garbage collection][1] - -A primitive implementation of GC using just a single thread. When Garbage Collection happens, it pauses the application (commonly known as a "stop the world" event.) This is suitable for applications that can withstand small pauses. Garbage Collection has a small footprint, so this is the preferred GC type for embedded applications. This Garbage Collection style can be enabled at runtime: - -``` -$ java -XX:+UseSerialGC -``` - -### 2. Parallel GC - -![Parallel garbage collection][2] - -Like Serial GC, this also uses a "stop the world" method. That means that while GC is happening, application threads are paused. But in this case, there are multiple threads performing GC operation. This type of GC is suitable for applications with medium to large data sets running in a multithreaded and multiprocessor environment. - -This is the default GC in JVM, and is also known as the *Throughput Collector*. Various GC parameters, like throughput, pause time, number of threads, and footprint, can be tuned with suitable JVM flags: - -* Number of threads: `-XX:ParallelGCThreads=` -* Pause time: `-XX:MaxGCPauseMillis=` -* Throughput (time spent for GC compared to actual application execution): `-XX:GCTimeRatio=` -* Maximum heap footprint: `-Xmx` -* Parallel GC can be explicitly enabled: `java -XX:+UseParallelGC`. With this option, minor GC in the young generation is done with multiple threads, but GC and compaction is done with a single thread in the old generation. - -There's also a version of Parallel GC called *Parallel Old GC*, which uses multiple threads for both young and old generations: - -``` -$ java -XX:+UseParallelOldGC -``` - -### 3. Concurrent Mark Sweep (CMS) - -![Concurrent garbage collection][3] - -Concurrent Mark Sweep (CMS) garbage collection is run alongside an application. It uses multiple threads for both minor and major GC. Compaction for live objects isn't performed in CMS GC after deleting the unused objects, so the time paused is less than in other methods. This GC runs concurrently with the application, which slows the response time of the application. This is suitable for applications with low pause time. This GC was deprecated in Java 8u, and completely removed from 14u onwards. If you're still using a Java version that has it, though, you can enable it with: - -``` -$ java -XX:+UseConcMarkSweepGC -``` - -In the case of CMS GC, the application is paused twice. It's paused first when it marks a live object that's directly reachable. This pause is known as the *initial-mark*. It's paused a second time at the end of the CMS GC phase, to account for the objects that were missed during the concurrent cycle, when application threads updated the objects after CMS GC were completed. This is known as the *remark phase*. - -### 4. G1 (Garbage First) GC - -![Garbage first][4] - -Garbage first (G1) was meant to replace CMS. G1 GC is parallel, concurrent, and incrementally compacting, with low pause-time. G1 uses a different memory layout than CMS, dividing the heap memory into equal sized regions. G1 triggers a global mark phase with multiple threads. After the mark phase is complete, G1 knows which region might be mostly empty and chooses that region for a sweep/deletion phase first. - -In the case of G1, an object that's more than half a region size is considered a "humongous object." These objects are placed in the Old generation, in a region appropriately called the *humongous region*. To enable G1: - -``` -$ java -XX:+UseG1GC -``` - -### 5. Epsilon GC - -This GC was introduced in 11u and is a *no-op* (do nothing) GC. Epsilon just manages memory allocation. It doesn’t do any actual memory reclamation. Epsilon is intended only when you know the exact memory footprint of your application, and knows that it is garbage collection free. - -``` -$ java -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC -``` - -### 6. Shenandoah - -Shenandoah was introduced in JDK 12, and is a CPU intensive GC. It performs compaction, deletes unused objects, and release free space to the OS immediately. All of this happens in parallel with the application thread itself. To enable Shenandoah: - -``` -$ java -XX:+UnlockExperimentalVMOptions \ --XX:+UseShenandoahGC -``` - -### 7. ZGC - -ZGC is designed for applications that have low latency requirements and use large heaps. ZGC allows a Java application to continue running while it performs all garbage collection operations. ZGC was introduced in JDK 11u and improved in JDK 12. Both Shenandoah and ZGC have been moved out of the experimental stage as of JDK 15. To enable ZGC: - -``` -$ java -XX:+UnlockExperimentalVMOptions -XX:+UseZGC -``` - -### Flexible garbage collection - -Java provides flexibility for memory management. It's useful to get familiar with the different methods available so you can choose what's best for the application you're developing or running. - -Image by: [Opensource.com][5] - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/7/garbage-collection-java - -作者:[Jayashree Huttanagoudar][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jayashree-huttanagoudar -[b]: https://github.com/lkxed -[1]: https://opensource.com/sites/default/files/2022-07/jaya-java-gc-serial.webp -[2]: https://opensource.com/sites/default/files/2022-07/jaya-java-gc-parallel.webp -[3]: https://opensource.com/sites/default/files/2022-07/jaya-java-gc-concurrent.webp -[4]: https://opensource.com/sites/default/files/2022-07/g1.png -[5]: https://opensource.com/home-page-new diff --git a/sources/tech/20220714 5 ways to learn C programming on Linux.md b/sources/tech/20220714 5 ways to learn C programming on Linux.md deleted file mode 100644 index 4d517f42a6..0000000000 --- a/sources/tech/20220714 5 ways to learn C programming on Linux.md +++ /dev/null @@ -1,101 +0,0 @@ -[#]: subject: "5 ways to learn C programming on Linux" -[#]: via: "https://opensource.com/article/22/7/learn-c-linux" -[#]: author: "Alan Smithee https://opensource.com/users/alansmithee" -[#]: collector: "lkxed" -[#]: translator: "Donkey" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -5 ways to learn C programming on Linux -====== -Download our new eBook for tips and tricks for C programming on Linux and FreeDOS. - -![Person using a laptop][1] - -There are many theories about why the C programming language has endured for as long as it has. Maybe it's the austerity of its syntax or the simplicity of its vocabulary. Or maybe it's that C is often seen as a utilitarian language, something that's rugged and ready to be used as a building material for something that needs no platform because it's going to be its own foundation. C is clearly a powerful language, and I think its longevity has a little something to do with the way it serves as a springboard for other popular technologies. Here are five of my favorite technologies that utilize and rely upon C, and how they can each help you learn more about C yourself. - -### 1. GObject and GTK - -C is not an object-oriented programming language. It has no `class` type. Some folks use C++ for object-oriented programming, but others stick with C along with the GObject libraries. The GObject subsystem provides a `class` structure for C, and the GTK project famously provides widgets accessible through C. Without GTK, there would be no GIMP (for which GTK was developed), GNOME, and hundreds of other popular open source applications.) - -#### Learn more - -GObject and GTK are excellent ways to start using C for GUI programming. They're well-equipped to get you programming graphical applications using C because they do so much of the "heavy lifting" for you. The classes and data types are defined, the widgets have been made, and all you have to do is put everything together. - -### 2. Ncurses - -If GTK is more than you need, you might decide a terminal user interface (TUI) is more your speed. The ncurses library creates "widgets" in a terminal, creating a kind of graphical application that gets drawn over your terminal window. You can control the interface with your arrow keys, selecting buttons and elements much the same way you might use a GUI application without a mouse. - -#### Learn more - -Get started by writing a [guessing game in C][3] using the ncurses library as your display. - -### 3. Lua and Moonscript - -Lua is a scripting language with access to C libraries through a built-in C API. It's a tiny, fast, and simple language with about 30 functions and just a handful of built-in libraries. You can get started with Lua for system automation, game modding and scripting, game development with a frontend like LÖVE, or general application development (like the [Howl text editor][4]) using GTK. - -#### Learn more - -The nice thing about Lua is that you can start out with it to learn the basic concepts of programming, and then start exploring its C API when you feel brave enough to interface directly with the foundational language. If, on the other hand, you never grow out of Lua, that's OK too. There's a wealth of [extra libraries][5] for Lua to make it a great choice for all manner of development. - -### 4. Cython - -Lua isn't the only language that interfaces with C. [Cython][6] is a compiler and language designed to make writing C extensions for Python as easy as writing Python code. Essentially, you can write Python and end up with C. The simplest possible example: - -``` -print("hello world") -``` - -Create a `setup.py` script: - -``` -from setuptools import setup -from Cython.Build import cythonize - -setup( - ext_modules = cythonize("hello.pyx") -) -``` - -Run the setup script: - -``` -$ python3 ./setup.py -``` - -And you end up with a `hello.c` and `hello.cpython-39-x86_64-linux-gnu.so` file in the same directory. - -#### Learn more - -The [Cython][7] language is a superset of Python with support for C functions, and datatypes. It isn't likely to directly help you learn C, but it opens up new possibilities for the Python developer looking to learn and integrate C code into Python. - -### 5. FreeDOS - -The best way to learn more about C is to write code in C, and there's nothing more exciting than writing code you can actually use. The FreeDOS project is an open source implementation of DOS, the predecessor to Windows. You may have already used FreeDOS, either as a handy open source method of running a BIOS updater, or maybe in an emulator to play a classic computer game. You can do a lot more with FreeDOS than that, though. It makes an ideal platform to learn C with a collection of tools that encourage you to write your own commands and simple (or not-so-simple, if you prefer) applications. Of course you can write C code on any OS, but there's a simplicity to FreeDOS that you might find refreshing. The sky's the limit, but even at ground level, you can do some amazingly fun things with C. - -### Download the eBook - -You can learn more about C in our **[new eBook][8]**, and more about C on FreeDOS in our eBook. These are collections of programming articles to help you learn C and to demonstrate how you can implement C in useful ways. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/7/learn-c-linux - -作者:[Alan Smithee][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/alansmithee -[b]: https://github.com/lkxed -[1]: https://opensource.com/sites/default/files/lead-images/laptop_screen_desk_work_chat_text.png -[2]: https://opensource.com/downloads/guide-c-programming -[3]: https://opensource.com/article/21/8/guess-number-game-ncurses-linux -[4]: https://opensource.com/article/20/12/howl -[5]: https://opensource.com/article/19/11/getting-started-luarocks -[6]: http://cython.org -[7]: https://opensource.com/article/21/4/cython -[8]: https://opensource.com/downloads/guide-c-programming diff --git a/sources/tech/20220716 Does an Ethernet splitter slow down speed-.md b/sources/tech/20220716 Does an Ethernet splitter slow down speed-.md deleted file mode 100644 index eb68d4089e..0000000000 --- a/sources/tech/20220716 Does an Ethernet splitter slow down speed-.md +++ /dev/null @@ -1,99 +0,0 @@ -[#]: subject: "Does an Ethernet splitter slow down speed?" -[#]: via: "https://www.debugpoint.com/ethernet-splitter-speed/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Does an Ethernet splitter slow down speed? -====== -This post summarises detailed information about ethernet splitter, their speed, and different FAQ to help you choose the best hardware. - -Switches, hubs, and ethernet splitters are just some of the networking equipment that helps to expand a network. Small ethernet splitters are the most basic of these devices. Ethernet splitters are small network devices that split one Ethernet signal into two. They are cost-effective while being easier to use. These are also some of the simplest networking devices, as they don’t need a power source and don’t have specific buttons or status LEDs on their bodies. There are just three ethernet ports on this tiny gadget, two on one side and one on the other. A short ethernet cable with an [RJ45][1] connection on one end and two ethernet ports on the other is included with some kinds. - -Although splitters have been around for a long time in the networking world, many people still don’t know how to utilize them efficiently. Contrary to popular belief, ethernet splitters should always be purchased in pairs. Directly attaching one end of the splitter to the router and then connecting two devices to the splitter’s two ethernet ports on the other side will not work. There is a correct technique to set up ethernet splitters in a network to function correctly. - -### How to do a Basic Setup using Ethernet Splitter - -Ethernet splitters are handy for connecting two devices located in different rooms from the primary signal source. In most situations, they assist in conserving wires and network wall outlets and provide dependable connections. Ethernet splitters are sold in pairs, as previously stated. One splitter combines two signals from a device (usually the router), while the other separates the signals into two channels, allowing two devices to communicate. - -You have a router in Room A and two PCs in Room B, but each room has just one ethernet wall jack. In this scenario, you’ll need one splitter, two cables connected to the router, the other end of the wires connected to the splitter, and one end of the splitter connected to the wall jack in Room A. This is where the router’s two signals are combined into one. Next, connect the side with one port to Room B’s wall jack via the other splitter. The combined signal from Room A will now be split into two, giving you two ethernet ports for the two devices in Room B. - -The advantage of the splitter is it can significantly reduce the number of wall ports and cables you may require for your setup. It helps you to avoid “cable hell” because it reduces your required ports/cable by a factor of 2. - -![sample diagram using ethernet splitter][2] - -### Does an Ethernet splitter slow down speed? - -Will my network connection become slow? This is one of the common questions that may arise in your mind. Well, the answer depends on the type of network you have. Ideally, splitters are of BASE-T standard, aka [Fast Ethernet][3]. And they support up to Mbps speed. - -To answer, no, the splitters will not slow down the connection if utilized in a 100Mbps network. However, if your router can deliver 1Gbps and you put a splitter in the middle, the bandwidth will be limited to 100Mbps. The splitters did restrict the speed in this case, and the connection will be slower. - -### Advantages and Disadvantages of Ethernet Splitters - -Ethernet splitters can be helpful in some situations, but they also have several disadvantages. For starters, each ethernet port can only give a maximum speed of 100Mbps. Due to this limitation, resources in a network capable of providing more than 100Mbps will not be properly optimized. Furthermore, because the number of devices you may connect to is limited to just two, ethernet splitters are not the most greatest option if you have more than two devices connected. - -Furthermore, if your router has one remaining ethernet port, using the splitters would be impractical; some sacrifices must be made. Furthermore, even though they reduce the number of cables required to join two networks, the arrangement still requires two splitters to function. - -Ethernet splitters, on the other hand, have a few advantages. They are much less expensive than conventional networking devices and do not require a complex setup. Unlike other network devices, they also don’t need any software or configuration. In residential networks with fewer devices connected, such as a maximum of two devices in one room, Ethernet splitters are an excellent choice. Ethernet splitters are the greatest option if you only need a 100Mbps connection and only have two devices to connect. - -Ethernet splitters have been around for a long time, but as simple as they are, there isn’t much that can be done to improve them. They’re still based on the outdated Fast Ethernet standard, which may or may not be as relevant in today’s demand for higher speeds. Even if they have their advantages, they aren’t a realistic solution in most circumstances. With today’s technical advancements, the future of ethernet splitters remains bright. A genius may be able to raise it to a [Gigabit Ethernet][4] standard. - -Now that you get some idea about Ethernet Splitters, here are some of the frequently asked questions (FAQ) about them. - -### Frequently Asked Questions - -#### Can you split an Ethernet cable into two devices? - -This is conceivable if you want to split an Ethernet wire across two devices. This will, however, necessitate the acquisition of an Ethernet cable sharing splitter kit. A splitter kit allows multiple devices to use the same Ethernet cable simultaneously. If you want to connect a PC and a laptop to the same cable or a PC and a game console, this is a good option. - -An Ethernet cable will outperform any other sort of connection when it comes to connection speeds. When you require quick connectivity for activities like gaming, an Ethernet cable is always the best option. - -It’s worth mentioning that you can’t connect two devices with a single Ethernet cable because they’re only designed for one, which is why you’ll need an Ethernet cable splitter. It attaches to an existing Ethernet wire and provides a connection between two devices. - -#### How do I connect two devices to one Ethernet port? - -Two devices can be connected to a single Ethernet port. However, as previously stated, you will require the usage of a cable-sharing kit. This is because each Ethernet connection is dedicated to a single device. - -With an Ethernet cable sharing kit, you may connect many devices to a single Ethernet port, which is very handy for your home network. It’s beneficial if you’re throwing a LAN party and have a few Ethernet connections available. - -It’s also worth mentioning that you could have more than one Ethernet port accessible. If this is the case, using one port for each device is always the best option. When this isn’t possible, a cable sharing kit or splitter is an excellent backup alternative. - -#### What’s the difference between an Ethernet splitter and a switch? - -An Ethernet splitter and a switch perform similar functions but are fundamentally distinct. An Ethernet splitter allows two independent connections to be made over the same Ethernet cable. It does, however, limit you to two connections. If you want to connect one additional device to the Ethernet connection, this is a good option. However, it is not compatible with any other devices. - -If you want to connect many devices to a single Ethernet connection, you’ll need to buy an Ethernet switch. These are similar to Ethernet splitters, except they allow for connecting more than two devices. This is especially handy if you have a lot of devices to connect but only a few Ethernet ports, such as if you’re having a LAN party. - -While they support stacking, it’s worth remembering that they’ll also require power. Another difference between them and a basic Ethernet splitter is that they do not require any electricity and may be attached directly to the Ethernet port. - -#### Do I need an Ethernet switch or splitter? - -The number of devices you want to connect will determine whether you need an Ethernet switch or a splitter. You can use an Ethernet splitter if you need to connect two devices and don’t want to utilize a power source. - -On the other hand, an Ethernet switch is an ideal solution if you need to connect several devices. It allows you to connect several devices to a single Ethernet port, but it requires electricity. - -I hope this guide helps you to get an idea about ethernet splitters and how to use them. You can buy them at any online store at low prices. However, if you need a speed of more than a hundred Mbps, you might need to set up wiring for your network. *[This post is part of our hardware guides.][5]* - -*Featured Photo by Jainath Ponnala on Unsplash* - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/ethernet-splitter-speed/ - -作者:[Arindam][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lkxed -[1]: https://en.wikipedia.org/wiki/Registered_jack -[2]: https://www.debugpoint.com/wp-content/uploads/2021/10/sample-diagram-using-ethernet-splitter-1024x896.jpg -[3]: https://en.wikipedia.org/wiki/Fast_Ethernet -[4]: https://en.wikipedia.org/wiki/Gigabit_Ethernet -[5]: https://www.debugpoint.com/category/hardware diff --git a/sources/tech/20220716 How to Clean Up Snap Versions to Free Up Disk Space.md b/sources/tech/20220716 How to Clean Up Snap Versions to Free Up Disk Space.md deleted file mode 100644 index 6e1ea02f35..0000000000 --- a/sources/tech/20220716 How to Clean Up Snap Versions to Free Up Disk Space.md +++ /dev/null @@ -1,105 +0,0 @@ -[#]: subject: "How to Clean Up Snap Versions to Free Up Disk Space" -[#]: via: "https://www.debugpoint.com/clean-up-snap/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to Clean Up Snap Versions to Free Up Disk Space -====== -This quick guide with a script helps to clean up old snap versions and free some disk space in your Ubuntu systems. - -I was running out of disk space in my test system with Ubuntu. So I was investigating via GNOME’s Disk Usage Analyser to find out which package is consuming the precious SSD space. Apart from the usual cache and home directory – to my surprise, I found that Snap and Flatpak consume a considerable amount of storage space. - -![Snap size – before cleanup][1] - -Although, I always maintain a rule – not to use Snap or Flatpak unless necessary. This is mainly because of their installation size and other issues. I prefer vanilla deb and rpm packages. Over the years, I have installed and removed a certain amount of Snap packages in this test system. - -The problem arises after uninstallation; Snap keeps some residue files in the system, unknown to the general users. - -So I opened the Snap folder `/var/lib/snapd/snaps` and discovered that Snap is keeping track of older versions of previously installed/uninstalled packages. - -For example, in the below image, you can see GNOME 3.28, 3.34, and Wine – all of these are removed long back. But they are still there. Its happening because of the Snap design which keeps versions of uninstalled packages after a proper uninstallation. - -![Files under snaps directory][2] - -Alternatively, you can get the same in terminal using: - -``` -snap list --all -``` - -![snap list all][3] - -The default value is 3 for several revisions for retention. That means Snap keeps 3 older versions of each package, including the active version. This is okay if you do not have constraints on your disk space. - -But for servers and other use cases, this can easily run into cost issues, consuming your disk space. - -However, you can easily modify the count using the following command. The value can be between 2 to 20. - -``` -sudo snap set system refresh.retain=2 -``` - -### Clean Up Snap Versions - -In a post in SuperUser, Popey, the ex-Engineering Manager at Canonical, [provided a simple script][4] that can clean up old versions of Snaps and keep the latest one. - -Here’s the script we will use to clean the Snap up. - -``` -#!/bin/bash - #Removes old revisions of snaps - #CLOSE ALL SNAPS BEFORE RUNNING THIS - set -eu - LANG=en_US.UTF-8 snap list --all | awk '/disabled/{print $1, $3}' | - while read snapname revision; do - snap remove "$snapname" --revision="$revision" - done -``` - -Save the above script as .sh in a directory (for example`clean_snap.sh` ), give it executable permission and run. - -``` -chmod +x clean_snap.sh -``` - -When I ran the script, it reduced a lot of disk space. The script would also show the name of the package being removed. - -![Executing the script][5] - -![Snaps size after cleanup][6] - -### Closing Notes - -There are always debates on how efficient Snap’s design is. Many say it is broken by design, bloated, and heavy on systems. Some part of that argument is true, I would not deny it. The whole concept of sandboxing applications is great if implemented and enhanced properly. I believe, Flatpak does a better job compared to Snap. - -That said, I hope this helps you clean up some disk space. Although it is tested in Ubuntu, it should work in all Linux distribution that supports Snap. - -Also, check out our guide on [how to clean up Ubuntu][7] with additional steps. - -Finally, if you are looking for cleaning up **Flatpak** apps, refer [this guide][8]. - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/clean-up-snap/ - -作者:[Arindam][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lkxed -[1]: https://www.debugpoint.com/wp-content/uploads/2021/03/Snap-size-before-cleanup.jpg -[2]: https://www.debugpoint.com/wp-content/uploads/2021/03/Files-under-snaps-directory.jpg -[3]: https://www.debugpoint.com/wp-content/uploads/2021/03/snap-list-all.jpg -[4]: https://superuser.com/a/1330590 -[5]: https://www.debugpoint.com/wp-content/uploads/2021/03/Executing-the-script.jpg -[6]: https://www.debugpoint.com/wp-content/uploads/2021/03/Snaps-size-after-cleanup.jpg -[7]: https://www.debugpoint.com/2018/07/4-simple-steps-clean-ubuntu-system-linux/ -[8]: https://www.debugpoint.com/clean-up-flatpak/ diff --git a/sources/tech/20220716 How to Install Deepin Desktop in Arch Linux [Complete Guide].md b/sources/tech/20220716 How to Install Deepin Desktop in Arch Linux [Complete Guide].md deleted file mode 100644 index c2aae6dbcf..0000000000 --- a/sources/tech/20220716 How to Install Deepin Desktop in Arch Linux [Complete Guide].md +++ /dev/null @@ -1,297 +0,0 @@ -[#]: subject: "How to Install Deepin Desktop in Arch Linux [Complete Guide]" -[#]: via: "https://www.debugpoint.com/deepin-arch-linux-install-20/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to Install Deepin Desktop in Arch Linux [Complete Guide] -====== -In this guide, we explain the steps required to install the beautiful Deepin Desktop in Arch Linux. - -The first part of the guide explains the steps for installing the base Arch system. The second part is installing the complete Deepin desktop on top of Arch Linux. - -### What is the Deepin Desktop? - -[Deepin][1] is a feature-rich and beautiful desktop environment based on Debian stable branch. Deepin desktop is a homegrown desktop environment by Deepin. It is powered by its own `dde-kwin` Window manager. Deepin desktop comes with nice looking dock and many native Deepin applications pre-loaded. - -This eye candy desktop environment is [available in the Arch repository][2]; this is how you can install Deepin Desktop Environment in Arch Linux. - -This guide installs Deepin 20.1 Desktop Environment. However, the steps should be similar for other versions as well. - -### Install Deepin Desktop in Arch Linux - -#### Part 1: Install Arch Linux - -If you have already Arch Linux installed, you can skip this step and directly go to the install Deepin Desktop section . - -For a quick Arch Linux base installation, follow the below steps. You can also visit [this guide][3] for a complete tutorial on installing Arch Linux as Dual Boot or on a virtual machine. - -##### Download Arch Linux - -Download Arch Linux .iso from the below link. There are magnet and torrent links available. Once you download it, write the ISO to a USB drive. And then boot from the drive. - -[Download Arch Linux][4] - -If you are planning to install it as a virtual machine image via [GNOME Boxes][5], [virt-manager][6] – then you do not need to write it to a USB drive. - -##### Boot and Configure Partitions - -After you boot from the Arch Linux iso, you have to run a series of commands to install the base system. - -First, run the below command to find out the device identifier. - -``` -fdisk -l -``` - -![fdisk -l before][7] - -Then with the device identifier, run the below command to start partitioning your disk. Make sure to change `/dev/sda` as per your system. - -``` -cfdisk /dev/sda -``` - -Select `label type = dos` the next prompt. - -Select the free space and choose the option NEW from the bottom. In this example, I will create three partitions as per below. - -``` -/dev/sda1 - 1G - for /boot/dev/sda2 - 5G - for root/dev/sda3 - 1G - for swap -``` - -![cfdisk][8] - -In the next screen, provide the partition size for the boot partition (for this example, I gave 1 GB). Select it as the primary partition. - -Repeat the same step for the main root partition of size 5GB. - -![Swap partition type change][9] - -Create a swap partition using the same steps with size 1G (you may change it as per your need). After you create the swap partition, make sure to choose Type at the bottom and mark it as a swap with the option “Linux Swap/Solaris”. - -![final partition list in cfdisk][10] - -Once done, write the changes to the disk using the Write option at the bottom. Make sure you take a backup before you write, as this is a permanent change in your system. - -Run the below command to check before you proceed. You can see in this example, that three partitions are listed. - -``` -fdisk -l -``` - -![final partition list in fdisk][11] - -Run the following commands in sequence to format and create an ext4 file system in the newly created partition above. Make sure you change the /dev/sda1 and /dev/sda2 as per your need. - -``` -mkfs.ext4 /dev/sda1mkfs.ext4 /dev/sda2mkswap /dev/sda3swapon /dev/sda3 -``` - -After completion, mount the system and create the necessary directories. - -``` -mount /dev/sda2 /mntmkdir /mnt/boot /mnt/var /mnt/homemount /dev/sda1 /mnt/boot -``` - -Again, make sure you change /dev/sda1, /dev/sda2 and /dev/sda3 as per your system. - -![prepare file system][12] - -##### Install the base system - -I hope you are already connected to the internet. If not, try using a USB dongle or wired internet connection which the Arch installer automatically configures and detect. If you do not have a wired connection available, follow this guide to configure a wireless or wifi network using the Arch Linux installer. - -Run the below commands in sequence to install the base system in the mounted partition. The download size is approx 400 MB. - -``` -pacman -Syypacstrap /mnt base base-devel linux linux-firmware nano dhcpcd net-tools grub -``` - -![Install base system][13] - -Once complete, generate a file system table without which you can’t boot the system. - -``` -genfstab -U /mnt >> /mnt/etc/fstab -``` - -##### Configure the base system - -Follow the below commands in sequence to configure the base system. This involves setting up your locale and language, adding a login user, and setting up the internet. - -``` -arch-chroot /mntnano /etc/locale.gen -``` - -Uncomment the locale of your choice by removing # at the beginning. For this guide, I have chosen en_US.UTF-8 UTF-8. Press CTRL+O, Enter, and CTRL+X to exit from nano. - -![change locale][14] - -Generate the locale using: - -``` -locale-gen -``` - -Set up the language using the below command. - -``` -echo LANG=en_US.UTF-8 > /etc/locale.confexport LANG=en_US.UTF-8 -``` - -Set up the local time zone. - -``` -ln -s /usr/share/zoneinfo/America/New_York /etc/localtime -``` - -Again, you can choose them as per your need. You can list the local time zones via the below commands. - -``` -ls /usr/share/zoneinfo -ls /usr/share/zoneinfo/America -``` - -Set up the hardware clock, create a hostname and enable the DHCP for the internet using the below commands in sequence. You can change `"arindam-pc"` to any hostname as per your desire. - -``` -hwclock --systohc --utc -echo debugpoint-pc > /etc/hostname -systemctl enable dhcpcd -``` - -The next step is to set up the root user password, create an admin user, and add the user to the sudoers file. - -Follow the below commands in sequence. Make sure to change the user name `debugpoint` to something else as per your need. - -``` -passwd rootuseradd -m -g users -G wheel -s /bin/bash debugpointpasswd debugpoint -``` - -![create user][15] - -Open the sudoers file and add the below lines. - -``` -nano /etc/sudoers -``` - -Add the below lines. As you already created the root user, the entry should be there. - -``` -root ALL=(ALL) ALLdebugpoint ALL=(ALL) ALL -``` - -![update sudoers file][16] - -Install grub, set up the initial ramdisk environment, and unmount the system using the below commands. - -``` -grub-install /dev/sdagrub-mkconfig -o /boot/grub/grub.cfgmkinitcpio -p linuxexit -``` - -![configure grub][17] - -Then reboot your system. - -``` -umount /mnt/bootumount /mntreboot -``` - -You have now successfully installed the Arch Linux base system. It’s time to install the complete Deepin desktop. - -#### Part 2: Install Deepin Desktop in Arch Linux - -After reboot, choose Arch Linux from grub. In the Arch Linux prompt, start running the following commands in sequence. These commands install the Xorg server, lightdm display manager and Deepin desktop components. - -For all the commands, use default as package versions, i.e. press enter when asked. - -* Install Xorg and display manager. Approx install size is 80 MB. - -``` -sudo pacman -S --needed xorg lightdm -``` - -* Install additional components and applications (approx 550 MB) - -``` -sudo pacman -S --needed deepin deepin-extra -``` - -After the installation, enable the Deepin greeter by modifying the lightdm configuration file. Follow the below commands. - -``` -nano /etc/lightdm/lightdm.conf -``` - -And add the below line. Save the file (CTRL+O, CTRL+X). - -``` -greeter-session=lightdm-deepin-greeter -``` - -![add deepin-greeter in lightdm login - install Deepin desktop in Arch Linux][18] - -Now it’s time to enable the display manager and network manager as service. So that next time you log on, they can run automatically by systemd. - -``` -systemctl enable lightdm -systemctl enable NetworkManager -``` - -![Enable lightdm and network][19] - -Reboot the system using the reboot command. - -``` -reboot -``` - -If all goes well, you should see the Deepin desktop login prompt. Login using the credentials you just created in the above steps. You should be greeted with the latest Deepin desktop environment. - -![Deepin 20.1 Login screen in Arch Linux][20] - -![Deepin Desktop 20.1 in Arch Linux][21] - -### Wrapping Up - -I hope this guide helped you to install the Deepin desktop in Arch Linux. Although it is not my daily driver, I feel Deepin’s desktop is somewhat slow in nature. Probably because of too much colour rendering and animation and not properly optimized by `dde-desktop` despite it being built on Qt. - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/deepin-arch-linux-install-20/ - -作者:[Arindam][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lkxed -[1]: https://www.debugpoint.com/2020/09/deepin-20-review/ -[2]: https://archlinux.org/groups/x86_64/deepin/ -[3]: https://www.debugpoint.com/2020/11/install-arch-linux/ -[4]: https://www.archlinux.org/download/ -[5]: https://www.debugpoint.com/2020/05/install-use-gnome-boxes/ -[6]: https://www.debugpoint.com/2020/11/virt-manager/ -[7]: https://www.debugpoint.com/wp-content/uploads/2020/12/fdisk-l-before.jpg -[8]: https://www.debugpoint.com/wp-content/uploads/2020/12/cfdisk-1024x159.jpg -[9]: https://www.debugpoint.com/wp-content/uploads/2020/12/Swap-parition-type-change.jpg -[10]: https://www.debugpoint.com/wp-content/uploads/2020/12/final-partition-list-in-cfdisk-1024x178.jpg -[11]: https://www.debugpoint.com/wp-content/uploads/2020/12/final-partition-list-in-fdisk.jpg -[12]: https://www.debugpoint.com/wp-content/uploads/2020/12/prepare-file-system.jpg -[13]: https://www.debugpoint.com/wp-content/uploads/2020/12/Install-base-system-1024x205.jpg -[14]: https://www.debugpoint.com/wp-content/uploads/2020/12/change-locale.jpg -[15]: https://www.debugpoint.com/wp-content/uploads/2020/12/create-user.jpg -[16]: https://www.debugpoint.com/wp-content/uploads/2020/12/update-sudoers-file.jpg -[17]: https://www.debugpoint.com/wp-content/uploads/2020/12/configure-grub-1024x639.jpg -[18]: https://www.debugpoint.com/wp-content/uploads/2021/01/add-deepin-greeter-in-lightdm-login.jpg -[19]: https://www.debugpoint.com/wp-content/uploads/2020/12/Enable-lightdm-and-network-Install-Xfce-Desktop-in-Arch-Linux.jpg -[20]: https://www.debugpoint.com/wp-content/uploads/2021/01/Deepin-20.1-Login-screen-in-Arch-Linux-1024x771.jpg -[21]: https://www.debugpoint.com/wp-content/uploads/2021/01/Deepin-Desktop-20.1-in-Arch-Linux-1024x770.jpg diff --git a/sources/tech/20220718 AppFlowy- An Open-Source Alternative to Notion.md b/sources/tech/20220718 AppFlowy- An Open-Source Alternative to Notion.md deleted file mode 100644 index f642a15f21..0000000000 --- a/sources/tech/20220718 AppFlowy- An Open-Source Alternative to Notion.md +++ /dev/null @@ -1,164 +0,0 @@ -[#]: subject: "AppFlowy: An Open-Source Alternative to Notion" -[#]: via: "https://itsfoss.com/appflowy/" -[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" -[#]: collector: "lkxed" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -AppFlowy: An Open-Source Alternative to Notion -====== -Brief: AppFlowy aims to be an open-source replacement to Notion, providing you with better privacy. Let us explore more about it. - -While Notion (project management/note-taking tool) is exceptionally good in what it does, it is not an open-source solution. Moreover, it is not available for Linux as a desktop client. - -So, what about an alternative that is more transparent, private, and available for Linux? - -That’s where AppFlowy shines! - -Build with Rust and Flutter, AppFlowy follows a minimal approach to simplify things yet with enough room for tweaks. - -### AppFlowy is a Perfect Blend of Privacy and User Experience - -![appflowy][1] - -AppFlowy is fairly new. We [reported][2] its development status last year after its initial launch. - -It is an open-source project that aims to overcome some limitations of [Notion][3] in terms of security and privacy. It helps you manage tasks, add to-do lists, add due dates, track the events, add pages, and format text for your notes/tasks. - -But there’s more to it than security; the user experience also matters. And, AppFlowy does a decent job at it, if not better than Notion. - -Note that the project is still in its **beta phase**. - -Currently, the project’s aim is not for better design and functionality but for data privacy, native experience, and community-driven opportunities. - -#### Notion vs. AppFlowy: What Are Your Priorities? - -While it is meant to replace Notion as an open-source solution, it may not be for everyone. - -So, if you are going to choose AppFlowy over Notion, you will get the following benefits: - -##### Transparency - -AppFlowy is an open-source project, so you are always welcome to view and modify the code. - -##### Privacy - -Notion can directly access your private data in the cloud as closed-source software. Compared to this, you can host AppFlowy as per your preference. - -All your personal data will remain with you, and you’re in total control of it. The developers also mention that they are working on offline mode to bring better support for local installations. - -##### Performance and Native Experience - -AppFlowy is built using Rust and Flutter, which provides a modern user experience while keeping performance in mind. - -Not just limited to that, you also get a good native experience on Linux, which you do not get with Notion. - -### Features of AppFlowy - -![appflowy screenshot 1][4] - -AppFlowy may not be superior in terms of functionality, but it does offer several essential features. - -You can expect more feature additions as the development continues. Some existing highlights include: - -* Native cross-platform support. -* Ability to self-host it or install it on your computer. -* Customizability. -* Data privacy (top priority). -* A single code base for better maintenance. -* Community-driven extensibility. -* Minimalist UI. -* Add to-do list, and manage tasks. -* Highlight texts and essential formatting. -* Keyboard shortcuts for editing cell/grid. -* Dark mode support. - -#### Installing AppFlowy on Linux - -As this is still in the beta phase, it is unavailable in default repositories and doesn’t have any maintained PPAs, nor do you get any Flatpak/Snap packages. - -However, you can easily install AppFlowy through the given commands (Only tested on Ubuntu 20.04 LTS and Arch X86_64): - -``` -wget https://github.com/AppFlowy-IO/AppFlowy/releases/download/0.0.4/AppFlowy-linux-x86.tar.gz -tar -xzvf AppFlowy-linux-x86.tar.gz -cd AppFlowy -``` - -To run AppFlowy, use the given command: - -``` -./app_flowy -``` - -To register AppFlowy in your system menu, you have to perform additional steps as given below: - -First, you have to change the default name of the AppFLowy logo: - -``` -mv flowy_logo.svg app_flowy.svg -``` - -Now, you’ve to copy the temporary Linux desktop file to a usable Linux desktop file. - -``` -cp appflowy.desktop.temp app_flowy.desktop -``` - -It’s time to introduce some changes to the config file. - -``` -sudo nano appflowy.desktop -``` - -Here, you have to replace [CHANGE_THIS] with the path where the icon and executable file has been stored. - -![add location of icon and exec file][5] - -Save changes with CTRL + O and exit with CTRL + X. - -Finally, move the desktop file so your system can pick it up. - -``` -mv app_flowy.desktop ~/.local/share/applications/. -``` - -And here’s what it should look like: - -![appflowy in system menu][6] - -In either case, you can check AppFlowy’s [official documentation][7] to build it from the source. Explore more about it on its official website. - -[AppFlowy][8] - -### Wrapping Up - -If you need a simple Notion-like application with a native Linux experience, AppFlowy is an interesting choice. - -You should expect bugs/issues considering it is under active development and far from being a complete replacement to Notion. - -As an open-source alternative to Notion? It works! You can use it to manage tasks, add notes, and make a to-do list. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/appflowy/ - -作者:[Sagar Sharma][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/sagar/ -[b]: https://github.com/lkxed -[1]: https://itsfoss.com/wp-content/uploads/2022/07/AppFlowy.png -[2]: https://news.itsfoss.com/appflowy-development/ -[3]: https://www.notion.so/ -[4]: https://itsfoss.com/wp-content/uploads/2022/07/appflowy-screenshot-1.png -[5]: https://itsfoss.com/wp-content/uploads/2022/07/Add-location-of-icon-and-exec-file-800x524.png -[6]: https://itsfoss.com/wp-content/uploads/2022/07/AppFlowy-in-System-menu-1.png -[7]: https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy/software-contributions/environment-setup/building-on-linux -[8]: https://www.appflowy.io/ diff --git a/sources/tech/20220718 How to Install Rocky Linux 9 Step by Step with Screenshots.md b/sources/tech/20220718 How to Install Rocky Linux 9 Step by Step with Screenshots.md deleted file mode 100644 index 543d84038f..0000000000 --- a/sources/tech/20220718 How to Install Rocky Linux 9 Step by Step with Screenshots.md +++ /dev/null @@ -1,213 +0,0 @@ -[#]: subject: "How to Install Rocky Linux 9 Step by Step with Screenshots" -[#]: via: "https://www.linuxtechi.com/how-to-install-rocky-linux-9-step-by-step/" -[#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/" -[#]: collector: "lkxed" -[#]: translator: "robsean" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to Install Rocky Linux 9 Step by Step with Screenshots -====== -In this guide, we will cover how to install Rocky Linux 9 step by step with screenshots. - -Rocky Enterprise Software Foundation has released its latest operating system ‘Rocky Linux 9’. Rocky Linux is free and open-source operating system for workstation and servers. It is considered as drop-in replacement for CentOS Linux. - -‘Blue Onyx’ is the Code name for Rocky Linux 9, it is the clone of RHEL 9. The main difference between Rocky Linux and RHEL is that it has its own open-source build system called ‘Peridot’. - -##### New Updates and Features of Rocky Linux 9 - -* Gnome 40 is the default Desktop Environment. -* Support for Direct Access (DAX) operations on XFS file system -* Updated runtime and compilers like GCC 11.2.1, LLVM (13.0.1), Rust (1.58.1), and Go (1.17.1). -* Updated development tool chain like Python 3.9, Node.js 16, Ruby 3.0.3, Perl 5.32 & PHP 8.0 -* By Default, root user authentication disabled over ssh. -* Updated OpenSSL 3.0 and improved cockpit web console. -* Community support till May 31st, 2032. - -##### Prerequisites - -* 2 GB RAM or more -* 2 CPU Core (1.1 GHz Processor or higher) -* 20 GB hard disk space -* Boot Media (USD or DVD) -* Internet Connectivity (Optional) - -Without any delay, let’s jump into Rocky Linux 9 installation steps, - -### 1) Download Rocky Linux 9 ISO File - -Use the following official URL to download ISO file, - -* [Rocky Linux 9 ISO][1] - -Once you have downloaded the iso file, make a bootable media (USB/DVD) using the downloaded iso. - -In Windows, you can use ‘Rufus’ software to make bootable USB drive using ISO file. In Linux, refer the following - -* [How to Create Bootable USB Drive on Ubuntu / Linux Mint][2] - -### 2) Boot System with Bootable Media - -Head to the system on which you are planning to install Rocky Linux 9, reboot it and change the boot medium from hard disk to USB from its bios settings. - -Once the system boots up with bootable media then we will get the following screen, - -![Select-Install-Rocky-Linux-9-option][3] - -Choose the first option, ‘Install Rocky Linux 9.0’ and hit enter. - -### 3) Choose Preferred Language - -Select your preferred language for the installation and then click on Continue, - -![Preferred-Language-for-RockyLinux9-Installation][4] - -### 4) Installation Summary - -In this step, we will get the following initial installation summary. To begin the installation, first we must complete marked items like ‘Installation Destination’ and ‘User settings’. - -Apart from the marked items, we can also change the existing items, just click on them and change it as per your requirement. - -![Initial-Installation-Summary-Rocky-Linux9][5] - -##### Configure Installation Destination - -In this item, we will specify the partition scheme for Rocky Linux. Click on ‘Installation Destination’. - -Here we can choose either automatic or custom option for storage configuration or partition scheme. - -In automatic option, partitions will be created automatically by installer on the disk whereas custom option allows us to create manual partitions on disk. - -![Choose-custom-Storage-Configuration-Rocky-Linux9][6] - -In this guide, I am going with ‘Custom’ option, Click on ‘Done’ - -![Standard-Partition-Scheme-RockyLinux9][7] - -On the 40 GB disk, we will create following partitions, - -* /boot          :  2GB   (xfs file system) -* /                 : 10 GB  (xfs file system) -* /home         : 25 GB (xfs file system) -* Swap           : 2 GB - -To start creating partitions, choose ‘Standard Partition’ scheme and then click on + symbol. - -Create first partition as /boot of size 2 GB, - -![Boot-Partition-RockyLinux9-Installation][8] - -Click on ‘Add mount point’ - -Similarly create next two partitions / and /home of size 10 GB and 25 GB respectively. - -![Slash-Partition-Rocky-Linux9-installation][9] - -![Home-Partition-Rocky-Linux9-Installation][10] - -Now create last partition as swap of size 2GB, - -![Swap-Partition-RockyLinux9-Installation][11] - -Once you are done with manual partitioning, click on Done to finish this item. - -![Finish-Manual-Partitioning-RockyLinux9-Installation][12] - -Choose ‘Accept Changes‘ to write changes to the disk. It will also take back to installation summary screen. - -![Accept-Changes-to-Write-on-Disk-RockyLinux9][13] - -##### Configure User Settings - -Under User Settings, Click on ‘Root Password’. - -![Set-Root-Password-RockyLinux9-Instalation][14] - -Set the root password and then click on Done, - -From ‘User Settings’ again , click on ‘User Creation’, Specify the local user details like username and password. - -![Local-User-Create-During-RockyLinux9-Installation][15] - -Click on ‘Done’, it will take back to installation summary. - -Now, we are ready to initiate the installation, click on ‘Begin Installation’. - -![Begin-Installation-Option-RockyLinux9][16] - -### 5) Installation Started - -In this step, installation got started and is in progress, - -![RockyLinux9-Installation-Progress][17] - -Once the installation is completed, installer will instruct to reboot the system. - -![Reboot-System-after-RockyLinux9-Installation][18] - -Click on ‘Reboot System’. - -Note: Don’t forget to change the boot medium from USB to hard disk from bios settings. - -### 6) Login Screen and Desktop Environment Post Installation - -When the system boots up after the successful installation, we will get following login screen, - -![RockyLinux9-Loginscreen-Post-Installation][19] - -Use the same user’s credentials that we have created during the installation, press enter to login. - -![Desktop-Env-RockyLinux9][20] - -Open the terminal, run following commands one after the another, - -``` -$ sudo dnf install epel-release -y -$ sudo dnf install neofetch -y -``` - -Now, to verify the system details, run neofetch command, - -``` -$ neofetch -``` - -![neofetch-rockylinux9-post-installation][21] - -That’s all from this guide, I hope you found it useful. Kindly do post your queries and feedback in below comments section. - --------------------------------------------------------------------------------- - -via: https://www.linuxtechi.com/how-to-install-rocky-linux-9-step-by-step/ - -作者:[Pradeep Kumar][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linuxtechi.com/author/pradeep/ -[b]: https://github.com/lkxed -[1]: https://rockylinux.org/download -[2]: https://www.linuxtechi.com/create-bootable-usb-disk-dvd-ubuntu-linux-mint/ -[3]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Select-Install-Rocky-Linux-9-option.png -[4]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Preferred-Language-for-RockyLinux9-Installation.png -[5]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Initial-Installation-Summary-Rocky-Linux9.png -[6]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Choose-custom-Storage-Configuration-Rocky-Linux9.png -[7]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Standard-Partition-Scheme-RockyLinux9.png -[8]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Boot-Partition-RockyLinux9-Installation.png -[9]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Slash-Partition-Rocky-Linux9-installation.png -[10]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Home-Partition-Rocky-Linux9-Installation.png -[11]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Swap-Partition-RockyLinux9-Installation.png -[12]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Finish-Manual-Partitioning-RockyLinux9-Installation.png -[13]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Accept-Changes-to-Write-on-Disk-RockyLinux9.png -[14]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Set-Root-Password-RockyLinux9-Instalation.png -[15]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Local-User-Create-During-RockyLinux9-Installation.png -[16]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Begin-Installation-Option-RockyLinux9.png -[17]: https://www.linuxtechi.com/wp-content/uploads/2022/07/RockyLinux9-Installation-Progress.png -[18]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Reboot-System-after-RockyLinux9-Installation.png -[19]: https://www.linuxtechi.com/wp-content/uploads/2022/07/RockyLinux9-Loginscreen-Post-Installation.png -[20]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Desktop-Env-RockyLinux9.png -[21]: https://www.linuxtechi.com/wp-content/uploads/2022/07/neofetch-rockylinux9-post-installation.png diff --git a/sources/tech/20220719 How to Uninstall Deb Packages in Ubuntu.md b/sources/tech/20220719 How to Uninstall Deb Packages in Ubuntu.md deleted file mode 100644 index 7405ebbfdc..0000000000 --- a/sources/tech/20220719 How to Uninstall Deb Packages in Ubuntu.md +++ /dev/null @@ -1,132 +0,0 @@ -[#]: subject: "How to Uninstall Deb Packages in Ubuntu" -[#]: via: "https://itsfoss.com/uninstall-deb-ubuntu/" -[#]: author: "Abhishek Prakash https://itsfoss.com/" -[#]: collector: "lkxed" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to Uninstall Deb Packages in Ubuntu -====== -Installing applications from a deb file is quite simple. You double click on it and it opens in the Software Center application and you install it from there. - -[Installing applications from a deb file][1] is quite simple. You double click on it and it opens in the Software Center application and you install it from there. - -But what about uninstalling a .deb package in Ubuntu or Debian? How do you remove the package you installed some time back. - -While there are several ifs and buts around it, the simplest and most reliable way of deleting a deb file is by using the apt remove command. - -``` -sudo apt remove program_name -``` - -As you can see, **you need to know the exact package name here**. This may not always be straightforward. For example, if you install Google Chrome on Ubuntu, the program is known as ‘google-chrome-stable’ in the command line. Did you already know that? I guess not. - -In this tutorial, I’ll go into detail about finding the exact package name and then using it to remove the application. I’ll also discuss using a graphical method for deleting .deb packages. - -### Removing package installed via deb files from Ubuntu - -Before I show you how to remove deb packages from the command line, let’s just quickly look at it in the Software Center application. - -#### Method 1: Check if the application can be removed from the software center - -Ubuntu has the Software Center GUI application that allows to search for applications, install them and remove them. - -The Software Center may not show the application installed when you search for it. - -![Searching for installed applications may not show any results in Ubuntu Software Center][2] - -However, you may still find it under the “Installed” section if you scroll down. The external applications are usually displayed without their logo. - -![Some installed applications can be found in the ‘installed’ tab of the Software Center][3] - -If you find it, you can remove the application by clicking the trash icon or remove button. - -![Removing applications from the Ubuntu software center][4] - -**Bottom line: Check if the application can be removed from the software center.** - -#### Method 2: Delete applications using apt command - -I am presuming that you don’t know the exact name of the application command. It is only natural that you may not know that Google Chrome is installed as google-chrome-stable and Edge is installed as microsoft-edge-stable. - -The tab completion may help if you have the first few letters. Otherwise, you can [list the installed applications with apt command][5] and use grep to search for the application name: - -``` -apt list --installed | grep -i possible_package_name -``` - -For example, you can intelligently guess that the Google Chrome package should have chrome in its name. You may search it like this: - -``` -apt list --installed | grep -i chrome -``` - -You may get more than one result in some cases. - -![check if google chrome installed in ubuntu][6] - -If you are not sure what the packages do, you can always get their details with: - -``` -apt info exact_package_name -``` - -Once you have the exact package name, you can delete it using the apt remove command. - -``` -sudo apt remove exact_package_name -``` - -You can also use apt-get remove or dpkg uninstall commands. - -![Removing applications installed via deb files using the apt command][7] - -#### Method 3: Use Synaptic Package Manager to remove deb applications - -Another method is to use the [Synaptic Package Manager][8]. Before GNOME created its graphical package manager in the form of the Software Center, Synaptic was the default GUI package manager in Ubuntu and many other distributions. - -It is still the recommended tool on the [Xfce desktop environment][9]. - -Install it first: - -``` -sudo apt install synaptic -``` - -Open Synaptic and search for the package name. Look for the installed packages that are marked green. Right-click on them and click on ‘mark for removal’. Hit apply after that. - -![Removing Deb packages using Synaptic package manager][10] - -### Did it help you? - -I am more than comfortable using the apt command to remove the packages installed from .deb files. But I can understand that not everyone is comfortable using the command line. - -I find the Software Center lacking when it comes to the removal of applications installed from external deb files. It could do a better job here. - -I hope you have a better understanding of removing deb packages now. Let me know if you have any questions. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/uninstall-deb-ubuntu/ - -作者:[Abhishek Prakash][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/ -[b]: https://github.com/lkxed -[1]: https://itsfoss.com/install-deb-files-ubuntu/ -[2]: https://itsfoss.com/wp-content/uploads/2022/07/search-for-installed-applications-ubuntu-software-center.png -[3]: https://itsfoss.com/wp-content/uploads/2022/07/installed-applications-in-ubuntu-software-center-scaled.webp -[4]: https://itsfoss.com/wp-content/uploads/2022/07/removing-applications-from-ubuntu-software-center-scaled.webp -[5]: https://itsfoss.com/list-installed-packages-ubuntu/ -[6]: https://itsfoss.com/wp-content/uploads/2022/07/check-if-google-chrome-installed-in-Ubuntu.png -[7]: https://itsfoss.com/wp-content/uploads/2022/07/removing-deb-files-applications-ubuntu.png -[8]: https://itsfoss.com/synaptic-package-manager/ -[9]: https://www.xfce.org/ -[10]: https://itsfoss.com/wp-content/uploads/2022/07/removing-deb-files-using-synaptic-scaled.webp diff --git a/sources/tech/20220719 Top 10 Features of Linux Mint 21 -Vanessa-.md b/sources/tech/20220719 Top 10 Features of Linux Mint 21 -Vanessa-.md deleted file mode 100644 index 49495b5065..0000000000 --- a/sources/tech/20220719 Top 10 Features of Linux Mint 21 -Vanessa-.md +++ /dev/null @@ -1,189 +0,0 @@ -[#]: subject: "Top 10 Features of Linux Mint 21 “Vanessa”" -[#]: via: "https://www.debugpoint.com/linux-mint-21-features/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lkxed" -[#]: translator: "robsean" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Top 10 Features of Linux Mint 21 “Vanessa” -====== -We round up the top features of the upcoming Linux Mint 21 “Vanessa”. Find out what’s in store for you. - -![Linux Mint 21 Cinnamon Desktop][1] - -Linux Mint 21 “Vanessa” is the 36th release of [Linux Mint][2], which carries a good list of features along with several usability improvements across the desktop. The features are scattered across the Cinnamon desktop, core changes, Xapps updates and more. - -I have summarized all of them in this list of top features of Linux Mint 21. - -### Top Features of Linux Mint 21 “Vanessa” - -#### 1. Ubuntu 22.04 and associated updates - -Perhaps the most crucial change is the base of Linux Mint 21, which is now based upon [Ubuntu 22.04 “Jammy Jellyfish”][3]. The last major release, i.e. Linux Mint 20 “Ulyana”, was based on Ubuntu 20.04 “Focal Fossa”, when released four years back. The state of the world in 2020 was utterly different, considering everything going on. - -Hence, a lot of packages, version upgrades, and new performance improvements – all these under-the-hood updates come to Linux Mint 21. That includes the latest LTS [Linux Kernel 5.15][4], which brings further hardware lineup support, and toolchain updates for programming, development and networking. - -#### 2. Major changes in the Timeshift backup tool - -A few months back, the Mint team [announced][5] that they are taking over the development of the popular backup tool Timeshift and continuing its development as a “XApps”. So, this is a significant change. Why, may you ask? - -Well, the developer of the Timeshift tool, Tony George, is busy with other projects. You may have heard about “[TeeJeeTech][6]” apps for Linux. It was created by Tony and had some cool apps. However, he doesn’t have the time to concentrate on Timeshift development and enhancement. - -![Timeshift creating snapshot][7] - -With that said, since Linux Mint now maintains it, some new features land in this release, such as Timeshift now determining how much disk space you need for the next backup in rsync mode (not in btrfs mode). In addition, it stops the backup process if it seems the disk space is less than 1 GB after the backup. - -#### 3. WebP Support - -WebP image is a reasonably new image format created by Google for the web. It beings better compression and reduced size while maintaining good quality than traditional JPEG or PNG images. - -WebP support (view images, thumbnail or edit) in Linux Desktop requires some [additional installation][8] of packages. Looking at the popularity Linux Mint team brings out-of-the-box WebP support across the desktop apps and flavours. - -That means Nemo file manager can show thumbnails of WebP images and view them in xviewer. The mint team always think about the end-user first because other distros are still behind on supporting WebP by default, such as Ubuntu, etc. Not only that, the new app [xapp-thumbnailers][9] now helps Nemo file manager to preview additional file types as well: - -* ePub -* MP3 with Album Arts -* RAW Images -* AppImage - -#### 4. Process Monitor - -A small but handy tool called process monitor will give you a heads-up on what’s happening in your system. This little icon at the system tray shows up when your system is undergoing automatic updates or backup by TImeshift. In those situations, your system may become slow, and this nifty icon can show you why. - -#### 5. Improved printing support - -Linux Mint is well equipped for devices, and the printer supports it by default. This edition of Mint brings [Internet Printing Protocol (IPP)][10] for driverless printing and scanning. - -In addition, HP’s driver, HPLIP’s latest edition (3.21.12), is also installed by default. - -All these changes streamline printer and scanner usage. And users like you can enjoy effortless printing and scanning. It is such an essential aspect of a Linux distro, but it doesn’t work all the time. While [reviewing many distros][11], I found many fails to detect the printers or even print. - -It’s good to see that the mint team contributed to this critical functionality. - -#### 6. Window Animation updates - -There are some considerable changes come in the Window and desktop animation effects. Firstly, the Effects settings for Windows and desktop are merged now. Earlier, there were separate sections which gave more granular control of the animations. - -Here’s a side-by-side view. - -![][12] - -![][13] - -Secondly, the mapping windows and desktop effects options are removed. - -Third, a new control arrives to change the overall animation speed from slower to faster. - -Finally, a global switch to disable or enable all the animation on the entire desktop gives you the option for more control. - -I believe this is a well-designed dialog and advanced options for better clarity. - -#### 7. Mutter rebase - -Let’s talk about [Cinnamon desktop version 5.4][14], which comes with Linux Mint 21. It’s the latest Cinnamon release, and Mint is the first distro to bring it to the user (other than traditional Arch Linux folks, who got it [a little early][15]). - -Finally, the team completed the rebase of Mutter into its window manager, Muffin in Cinnamon 5.4. Since Muffin was initially forked from Mutter, it was always lagging behind the upstream Mutter features, despite the backporting of changes. A significant amount of effort went to feature inclusion, bug fixes & clean up to make Muffin as close to the Mutter code base. - -Hence, in the future, it is now easier to port back changes from Mutter upstream and clean things in Muffin as needed. - -#### 8. Window manager and GTK Themes - -With the changes in Muffin, the team also moved some of the display settings from gnome-control-center to cinnamon-control-center. In addition, the display configs from csd-xrandr moved into the Muffin window manager in Cinnamon 5.4. Apparently, you may not see any difference in the Display settings window. However, you may see some performance boost and fewer bugs or issues while scaling displays or in high-res windows. - -Another critical change that the Mint team introduced via CInnamon 5.4 is the uniform render of GTK dialogs in apps. Earlier, if a GTK app used a header bar, then the dialog was a mix of CSD (client side decoration) and GTK themes. - -Now with Cinnamon 5.4, all the windows are rendered using the GTK theme irrespective of their design. And with that, the legacy Metacity themes also dropped. - -On a side note, I loved the Metacity, and its “legacy look” when [they were a thing][16] in the early days of GNOME. - -#### 9. Package Management updates - -Following the trends of Debian, KDE Plasma desktop, Linux Mint also protects your system from uninstalling critical dependent packages. - -When you try to uninstall, Mint now checks the dependencies and whether critical desktop packages will be removed. - -If found, you get an error message that stops you from going further. - -On the other hand, when you successfully uninstall a package, it cleans up all the dependencies with it installed. - -#### 10. Disable the Systemd OOMD (out-of-memory daemon) service - -The “systemd-oomd” had some bad feedback recently since the Ubuntu 22.04 LTS release. Users across the web [reported][17] the sudden closing of applications (such as Firefox) without any warning or user intervention. Further investigation pointed to the “not so well” implementation of the systemd-oomd service. - -In theory, the [systemd-oomd.service][18] monitors your system for out-of-memory situations, and it has the authority to kill any processes which consume more system resources. Ubuntu team did not communicate this with importance, which eventually led to an unpleasant user experience. - -With that knowledge, Linux Mint 21 decides [not to feature][19] this service and disables it. Because the user base of Linux Mint is general users, students, etc., it would be a bad experience for users if apps closed unexpectedly. - -![Systemd OOMD service is not enabled][20] - -#### 11. Other Changes - -Finally, let’s round up some tiny yet impactful changes to wrap up the Linux Mint 21 features. - -* The default document reader app Xreader is now capable of minor annotation. This is a handy feature. -* The WebApp manager now brings custom browser parameters. -* Warpinator file transfer utility now shows you other sources on Windows, Android and iOS devices. -* Mint packages Firefox web browser as deb and not the Snap version, which defaults in Ubuntu 22.04 LTS. Thanks to Mint team, users need not worry about the [complex set of commands][21] to remove the Firefox Snap from Jammy. - -![Firefox 102 in Linux Mint 21 – Exclusively packaged as deb executable][22] - -* The bulk renamer app Thingy gets some UI improvements. -* The os-prober of GRUB2 is now available to detect all the operating systems in your hardware (handy for dual boot or more systems). -* The Bluetooth manager Blueman replaces Blueberry, bringing additional features for connecting and managing your Bluetooth devices. -* Finally, new wallpapers for your new desktop arrive in this release. - -![New Wallpapers in Linux Mint 21][23] - -### Things that are NOT changing - -From a very high level, you might feel that most of the Linux Mint 21 remains the same as its predecessors. The default desktop looks and default wallpaper remains the same. Xfce and MATE desktop didn’t have any major releases. Hence they are precisely the same. In addition, the default icon theme, application menu, etc., may give you a similar feel to the entire desktop. - -### Wrapping Up - -Overall, a good set of features is beneficial for end users rather than being fancy gestures and stuff. For this very fact, Linux Mint is the best Linux distro today for beginners or end users. So, that concludes the feature highlights of Linux Mint 21. - -The BETA testing is in progress, and there are a [few bugs reported][24]. The final release is due soon, within a few weeks from now. - -You can download/update to Linux Mint 21 when released. Also, stay tuned for our detailed distro review of Linux Mint 21 after the official release. - -What do you think about the new features of Linux mint 21? Is there any feature you expected but didn’t arrive in this release? Let’s discuss this in the comment box below. - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/linux-mint-21-features/ - -作者:[Arindam][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lkxed -[1]: https://www.debugpoint.com/wp-content/uploads/2022/07/Linux-Mint-21-Cinnamon-Desktop.jpg -[2]: https://www.debugpoint.com/linux-mint/ -[3]: https://www.debugpoint.com/web-stories/ubuntu-22-04-review/ -[4]: https://www.debugpoint.com/linux-kernel-5-15/ -[5]: https://blog.linuxmint.com/?p=4323 -[6]: https://teejeetech.com/ -[7]: https://www.debugpoint.com/wp-content/uploads/2022/07/Timeshift-creating-snapshot.jpg -[8]: https://www.debugpoint.com/view-webp-ubuntu-linux/ -[9]: https://github.com/linuxmint/xapp-thumbnailers -[10]: https://datatracker.ietf.org/doc/html/rfc8011 -[11]: https://www.debugpoint.com/tag/linux-distro-review/ -[12]: https://www.debugpoint.com/wp-content/uploads/2022/07/Effects-in-Linux-Mint-20.jpg -[13]: https://www.debugpoint.com/wp-content/uploads/2022/07/Effects-in-Linux-Mint-21.jpg -[14]: https://github.com/linuxmint/cinnamon-desktop/releases/tag/5.4.0 -[15]: https://www.debugpoint.com/cinnamon-arch-linux-install/ -[16]: https://www.debugpoint.com/gnome-classic-ubuntu-22-04/ -[17]: https://askubuntu.com/questions/1404888/how-do-i-disable-the-systemd-oom-process-killer-in-ubuntu-22-04 -[18]: https://www.freedesktop.org/software/systemd/man/systemd-oomd.service.html -[19]: https://debugpointnews.com/linux-mint-21-systemd-oom/ -[20]: https://www.debugpoint.com/wp-content/uploads/2022/07/Systemd-OOMD-service-is-not-enabled.jpg -[21]: https://www.debugpoint.com/remove-firefox-snap-ubuntu/ -[22]: https://www.debugpoint.com/wp-content/uploads/2022/07/Firefox-102-in-Linux-Mint-21-Exclusively-packaged-as-deb-executable.jpg -[23]: https://www.debugpoint.com/wp-content/uploads/2022/07/New-Wallpapers-in-Linux-Mint-21.jpg -[24]: https://github.com/linuxmint/mint21-beta/issues diff --git a/sources/tech/20220719 Turn your Python script into a command-line application.md b/sources/tech/20220719 Turn your Python script into a command-line application.md index c703b2b61f..28a1a1e933 100644 --- a/sources/tech/20220719 Turn your Python script into a command-line application.md +++ b/sources/tech/20220719 Turn your Python script into a command-line application.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/22/7/bootstrap-python-command-line-application" [#]: author: "Mark Meyer https://opensource.com/users/ofosos" [#]: collector: "lkxed" -[#]: translator: " " +[#]: translator: "MjSeven" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " diff --git a/sources/tech/20220720 How much JavaScript do you need to know before learning ReactJS-.md b/sources/tech/20220720 How much JavaScript do you need to know before learning ReactJS-.md deleted file mode 100644 index 1aea98bbbd..0000000000 --- a/sources/tech/20220720 How much JavaScript do you need to know before learning ReactJS-.md +++ /dev/null @@ -1,74 +0,0 @@ -[#]: subject: "How much JavaScript do you need to know before learning ReactJS?" -[#]: via: "https://opensource.com/article/22/7/learn-javascript-before-reactjs" -[#]: author: "Sachin Samal https://opensource.com/users/sacsam005" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How much JavaScript do you need to know before learning ReactJS? -====== -The main idea is to be good in JavaScript so you can reduce the complexity of your ReactJS journey. - -React is a UI framework built on top of HTML, CSS, and JavaScript, where JavaScript (JS) is responsible for most of the logic. If you have knowledge of variables, data types, array functions, callbacks, scopes, string methods, loops, and other JS DOM manipulation-related topics, these will tremendously speed up the pace of learning ReactJS. - -Your concept of modern JavaScript will dictate the pace of how soon you can get going with ReactJS. You don't need to be a JavaScript expert to start your ReactJS journey, but just as knowledge of ingredients is a must for any chef hoping to master cooking, the same is true for learning ReactJS. It's a modern JavaScript UI library, so you need to know some JavaScript. The question is, how much? - -### Example explanation - -Suppose I'm asked to write an essay about a "cow" in English, but that I know nothing about the language. In this case, for me to successfully complete the task, I should not only have an idea about the topic but also the specified language. - -Assuming that I acquire some knowledge about the topic (a cow), how can I calculate the amount of English I need to know to be able to write about the proscribed topic? What if I have to write an essay on some other complex topics in English? - -It’s difficult to figure that out, isn’t it? I don’t know what things I'm going to write about the topic, but it could be anything. So to get started, I have to have a proper knowledge of the English language, but it doesn't end there. - -### Extreme reality - -The same is true for the amount of JavaScript required before getting started with ReactJS. According to my example scenario, ReactJS is the topic "cow" while JavaScript is the English language. It's important to have a strong grasp of JavaScript to be successful in ReactJS. One is very unlikely to master ReactJS professionally without having the proper foundation of JavaScript. No matter how much knowledge I might have about the topic, I won’t be able to express myself properly if I don't know the fundamentals of the language. - -### How much is enough? - -In my experience, when you start your ReactJS journey, you should already be familiar with: - -* variables -* data types -* string methods -* loops -* conditionals - -You should be familiar with these specifically in JavaScript. But these are just the bare minimum prerequisites. When you try to create a simple React app, you'll inevitably need to handle events. So, the concept of normal functions, function expressions, statements, arrow function, the difference between an arrow function and a regular function, and the lexical scoping of `this` keyword in both types of function is really important. - -But the question is, what if I have to create a complex app using ReactJS? - -### Get inspired - -Handling events, spread operators, destructuring, named imports, and default imports in JavaScript will help you understand the working mechanism of React code. - -Most importantly, you must understand the core concepts behind JavaScript itself. JavaScript is asynchronous by design. Don't be surprised when code appearing at the bottom of a file executes before code at the top of the file does. Constructs like promises, callbacks, async-await, map, filter, and reduce, are the most common methods and concepts in ReactJS, especially when developing complex applications. - -The main idea is to be good in JavaScript so you can reduce the complexity of your ReactJS journey. - -### Getting good - -It's easy for me to say what you need to know, but it's something else entirely for you to go learn it. Practicing a lot of JavaScript is essential, but you might be surprised that I don't think it means you necessarily have to wait until you master it. There are certain concepts that are important beforehand, but there's a lot you can learn as you go. Part of practicing is learning, so you get started with JavaScript and even with some of the basics of React, as long as you move at a comfortable pace and understand that doing your "homework" is a requirement before you attempt anything serious. - -### Get started with JavaScript now - -Don't bother waiting until you cover all aspects of JavaScript. That's never going to happen. If you do that, you'll get trapped in that forever-loop of learning JavaScript. And you all know how constantly evolving and rapidly changing the tech field is. If you want to start learning JavaScript, try reading Mandy Kendall's introductory article [Learn JavaScript by writing a guessing game][2]. It's a great way to get started quickly, and once you see what's possible I think you're likely to find it difficult to stop. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/7/learn-javascript-before-reactjs - -作者:[Sachin Samal][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/sacsam005 -[b]: https://github.com/lkxed -[1]: https://opensource.com/sites/default/files/lead-images/OSDC_women_computing_5.png -[2]: https://opensource.com/article/21/1/learn-javascript diff --git a/sources/tech/20220720 Update a Single Package With apt Command in Ubuntu and Debian.md b/sources/tech/20220720 Update a Single Package With apt Command in Ubuntu and Debian.md deleted file mode 100644 index cf6b1e5bfc..0000000000 --- a/sources/tech/20220720 Update a Single Package With apt Command in Ubuntu and Debian.md +++ /dev/null @@ -1,96 +0,0 @@ -[#]: subject: "Update a Single Package With apt Command in Ubuntu and Debian" -[#]: via: "https://itsfoss.com/apt-upgrade-single-package/" -[#]: author: "Abhishek Prakash https://itsfoss.com/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Update a Single Package With apt Command in Ubuntu and Debian -====== - -How do you [update your Ubuntu system in the command line][1]? You use the apt update (to refresh the package cache) and apt upgrade commands. - -``` -sudo apt update && sudo apt upgrade -``` - -It updates all the installed apt packages that can be upgraded at once. This includes the Linux kernel version, too. - -This seems like a good thing, especially for desktop users. That may not be the case for Ubuntu server users where you have crucial web services running. - -If you want to be selective about the updates and **only want to upgrade a single package**, use this command: - -``` -sudo apt install --only-upgrade package_name -``` - -Let’s see it in a bit more detail. - -### Upgrade single package using apt command - -The first step is to update the local package repository cache so that your system knows about the availability of new package versions. - -``` -sudo apt update -``` - -**This is optional**. Check if the package you want to upgrade is in the [list of upgradable packages][2]. - -``` -apt list --upgradable -``` - -If the desired package has a new version available, you can choose to upgrade only this single package with this command: - -``` -sudo apt install --only-upgrade package_name -``` - -If you run the apt install command on an already installed package, it will be upgraded to the next available version. - -But if the package is not installed already, the apt command will also install it. - -This is why the `--only-upgrade` part is necessary. With that option, the apt command will only upgrade an already installed package. It will not install the package if it is not already installed. - -Not the best-suited example for Ubuntu server users, but you can still see how I upgraded only one of the seven upgradable packages in the below screenshot. - -![Update only a single package in Ubuntu][3] - -### Upgrade selected packages only - -If you want to upgrade a selected few packages, you don’t have to update them one by one. Just provide the package names with the command mentioned earlier. - -``` -sudo apt install --only-upgrade package1 package2 package3 -``` - -Here’s an example. - -![Upgrade selected packages in Ubuntu][4] - -### Conclusion - -When you are faced with a situation where you have to upgrade selected packages, you can use the apt install command with –only-upgrade option. - -I recommend reading on [using apt command to use it more effectively][5]. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/apt-upgrade-single-package/ - -作者:[Abhishek Prakash][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/ -[b]: https://github.com/lkxed -[1]: https://itsfoss.com/update-ubuntu/ -[2]: https://itsfoss.com/apt-list-upgradable/ -[3]: https://itsfoss.com/wp-content/uploads/2022/07/update-single-package-ubuntu-scaled.webp -[4]: https://itsfoss.com/wp-content/uploads/2022/07/upgrade-selected-packages-ubuntu.png -[5]: https://itsfoss.com/apt-command-guide/ diff --git a/sources/tech/20220720 What happens when you press a key in your terminal.md b/sources/tech/20220720 What happens when you press a key in your terminal.md deleted file mode 100644 index 8225823e69..0000000000 --- a/sources/tech/20220720 What happens when you press a key in your terminal.md +++ /dev/null @@ -1,317 +0,0 @@ -[#]: subject: "What happens when you press a key in your terminal?" -[#]: via: "https://jvns.ca/blog/2022/07/20/pseudoterminals/" -[#]: author: "Julia Evans https://jvns.ca/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -What happens when you press a key in your terminal? -====== - -I’ve been confused about what’s going on with terminals for a long time. - -But this past week I was using [xterm.js][1] to display an interactive terminal in a browser and I finally thought to ask a pretty basic question: when you press a key on your keyboard in a terminal (like `Delete`, or `Escape`, or `a`), which bytes get sent? - -As usual we’ll answer that question by doing some experiments and seeing what happens :) - -### remote terminals are very old technology - -First, I want to say that displaying a terminal in the browser with `xterm.js` might seem like a New Thing, but it’s really not. In the 70s, computers were expensive. So many employees at an institution would share a single computer, and each person could have their own “terminal” to that computer. - -For example, here’s a photo of a VT100 terminal from the 70s or 80s. This looks like it could be a computer (it’s kind of big!), but it’s not – it just displays whatever information the actual computer sends it. - -[![DEC VT100 terminal][2]][3] - -Of course, in the 70s they didn’t use websockets for this, but the information being sent back and forth is more or less the same as it was then. - -(the terminal in that photo is from the [Living Computer Museum][4] in Seattle which I got to visit once and write FizzBuzz in `ed` on a very old Unix system, so it’s possible that I’ve actually used that machine or one of its siblings! I really hope the Living Computer Museum opens again, it’s very cool to get to play with old computers.) - -### what information gets sent? - -It’s obvious that if you want to connect to a remote computer (with `ssh` or using `xterm.js` and a websocket, or anything else), then some information needs to be sent between the client and the server. - -Specifically: - - * the **client** needs to send the keystrokes that the user typed in (like `ls -l`) - * the **server** needs to tell the client what to display on the screen - - - -Let’s look at a real program that’s running a remote terminal in a browser and see what information gets sent back and forth! - -### we’ll use `goterm` to experiment - -I found this tiny program on GitHub called [goterm][5] that runs a Go server that lets you interact with a terminal in the browser using `xterm.js`. This program is very insecure but it’s simple and great for learning. - -I [forked it][6] to make it work with the latest xterm.js, since it was last updated 6 years ago. Then I added some logging statements to print out every time bytes are sent/received over the websocket. - -Let’s look at sent and received during a few different terminal interactions! - -### example: `ls` - -First, let’s run `ls`. Here’s what I see on the `xterm.js` terminal: - -``` - - [email protected]:/play$ ls - file - [email protected]:/play$ - -``` - -and here’s what gets sent and received: (in my code, I log `sent: [bytes]` every time the client sends bytes and `recv: [bytes]` every time it receives bytes from the server) - -``` - - sent: "l" - recv: "l" - sent: "s" - recv: "s" - sent: "\r" - recv: "\r\n\x1b[?2004l\r" - recv: "file\r\n" - recv: "\x1b[[email protected]:/play$ " - -``` - -I noticed 3 things in this output: - - 1. Echoing: The client sends `l` and then immediately receives an `l` sent back. I guess the idea here is that the client is really dumb – it doesn’t know that when I type an `l`, I want an `l` to be echoed back to the screen. It has to be told explicitly by the server process to display it. - 2. The newline: when I press enter, it sends a `\r` (carriage return) symbol and not a `\n` (newline) - 3. Escape sequences: `\x1b` is the ASCII escape character, so `\x1b[?2004h` is telling the terminal to display something or other. I think this is a colour sequence but I’m not sure. We’ll talk a little more about escape sequences later. - - - -Okay, now let’s do something slightly more complicated. - -### example: `Ctrl+C` - -Next, let’s see what happens when we interrupt a process with `Ctrl+C`. Here’s what I see in my terminal: - -``` - - [email protected]:/play$ cat - ^C - [email protected]:/play$ - -``` - -And here’s what the client sends and receives. - -``` - - sent: "c" - recv: "c" - sent: "a" - recv: "a" - sent: "t" - recv: "t" - sent: "\r" - recv: "\r\n\x1b[?2004l\r" - sent: "\x03" - recv: "^C" - recv: "\r\n" - recv: "\x1b[?2004h" - recv: "[email protected]:/play$ " - -``` - -When I press `Ctrl+C`, the client sends `\x03`. If I look up an ASCII table, `\x03` is “End of Text”, which seems reasonable. I thought this was really cool because I’ve always been a bit confused about how Ctrl+C works – it’s good to know that it’s just sending an `\x03` character. - -I believe the reason `cat` gets interrupted when we press `Ctrl+C` is that the Linux kernel on the server side receives this `\x03` character, recognizes that it means “interrupt”, and then sends a `SIGINT` to the process that owns the pseudoterminal’s process group. So it’s handled in the kernel and not in userspace. - -### example: `Ctrl+D` - -Let’s try the exact same thing, except with `Ctrl+D`. Here’s what I see in my terminal: - -``` - - [email protected]:/play$ cat - [email protected]:/play$ - -``` - -And here’s what gets sent and received: - -``` - - sent: "c" - recv: "c" - sent: "a" - recv: "a" - sent: "t" - recv: "t" - sent: "\r" - recv: "\r\n\x1b[?2004l\r" - sent: "\x04" - recv: "\x1b[?2004h" - recv: "[email protected]:/play$ " - -``` - -It’s very similar to `Ctrl+C`, except that `\x04` gets sent instead of `\x03`. Cool! `\x04` corresponds to ASCII “End of Transmission”. - -### what about Ctrl + another letter? - -Next I got curious about – if I send `Ctrl+e`, what byte gets sent? - -It turns out that it’s literally just the number of that letter in the alphabet, like this: - - * `Ctrl+a` => 1 - * `Ctrl+b` => 2 - * `Ctrl+c` => 3 - * `Ctrl+d` => 4 - * … - * `Ctrl+z` => 26 - - - -Also, `Ctrl+Shift+b` does the exact same thing as `Ctrl+b` (it writes `0x2`). - -What about other keys on the keyboard? Here’s what they map to: - - * Tab -> 0x9 (same as Ctrl+I, since I is the 9th letter) - * Escape -> `\x1b` - * Backspace -> `\x7f` - * Home -> `\x1b[H` - * End: `\x1b[F` - * Print Screen: `\x1b\x5b\x31\x3b\x35\x41` - * Insert: `\x1b\x5b\x32\x7e` - * Delete -> `\x1b\x5b\x33\x7e` - * My `Meta` key does nothing at all - - - -What about Alt? From my experimenting (and some Googling), it seems like `Alt` is literally the same as “Escape”, except that pressing `Alt` by itself doesn’t send any characters to the terminal and pressing `Escape` by itself does. So: - - * alt + d => `\x1bd` (and the same for every other letter) - * alt + shift + d => `\x1bD` (and the same for every other letter) - * etcetera - - - -Let’s look at one more example! - -### example: `nano` - -Here’s what gets sent and received when I run the text editor `nano`: - -``` - - recv: "\r\x1b[[email protected]:/play$ " - sent: "n" [[]byte{0x6e}] - recv: "n" - sent: "a" [[]byte{0x61}] - recv: "a" - sent: "n" [[]byte{0x6e}] - recv: "n" - sent: "o" [[]byte{0x6f}] - recv: "o" - sent: "\r" [[]byte{0xd}] - recv: "\r\n\x1b[?2004l\r" - recv: "\x1b[?2004h" - recv: "\x1b[?1049h\x1b[22;0;0t\x1b[1;16r\x1b(B\x1b[m\x1b[4l\x1b[?7h\x1b[39;49m\x1b[?1h\x1b=\x1b[?1h\x1b=\x1b[?25l" - recv: "\x1b[39;49m\x1b(B\x1b[m\x1b[H\x1b[2J" - recv: "\x1b(B\x1b[0;7m GNU nano 6.2 \x1b[44bNew Buffer \x1b[53b \x1b[1;123H\x1b(B\x1b[m\x1b[14;38H\x1b(B\x1b[0;7m[ Welcome to nano. For basic help, type Ctrl+G. ]\x1b(B\x1b[m\r\x1b[15d\x1b(B\x1b[0;7m^G\x1b(B\x1b[m Help\x1b[15;16H\x1b(B\x1b[0;7m^O\x1b(B\x1b[m Write Out \x1b(B\x1b[0;7m^W\x1b(B\x1b[m Where Is \x1b(B\x1b[0;7m^K\x1b(B\x1b[m Cut\x1b[15;61H" - -``` - -You can see some text from the UI in there like “GNU nano 6.2”, and these `\x1b[27m` things are escape sequences. Let’s talk about escape sequences a bit! - -### ANSI escape sequences - -These `\x1b[` things above that `nano` is sending the client are called “escape sequences” or “escape codes”. This is because they all start with `\x1b`, the “escape” character. . They change the cursor’s position, make text bold or underlined, change colours, etc. [Wikipedia has some history][7] if you’re interested. - -As a simple example: if you run - -``` - - echo -e '\e[0;31mhi\e[0m there' - -``` - -in your terminal, it’ll print out “hi there” where “hi” is in red and “there” is in black. [This page][8] has some nice examples of escape codes for colors and formatting. - -I think there are a few different standards for escape codes, but my understanding is that the most common set of escape codes that people use on Unix come from the VT100 (that old terminal in the picture at the top of the blog post), and hasn’t really changed much in the last 40 years. - -Escape codes are why your terminal can get messed up if you `cat` a bunch of binary to your screen – usually you’ll end up accidentally printing a bunch of random escape codes which will mess up your terminal – there’s bound to be a `0x1b` byte in there somewhere if you `cat` enough binary to your terminal. - -### can you type in escape sequences manually? - -A few sections back, we talked about how the `Home` key maps to `\x1b[H`. Those 3 bytes are `Escape + [ + H` (because Escape is `\x1b`). - -And if I manually type Escape, then [, then H in the `xterm.js` terminal, I end up at the beginning of the line, exactly the same as if I’d pressed `Home`. - -I noticed that this didn’t work in `fish` on my computer though – if I typed `Escape` and then `[`, it just printed out `[` instead of letting me continue the escape sequence. I asked my friend Jesse who has written [a bunch of Rust terminal code][9] about this and Jesse told me that a lot of programs implement a **timeout** for escape codes – if you don’t press another key after some minimum amount of time, it’ll decide that it’s actually not an escape code anymore. - -Apparently this is configurable in fish with `fish_escape_delay_ms`, so I ran `set fish_escape_delay_ms 1000` and then I was able to type in escape codes by hand. Cool! - -### terminal encoding is kind of weird - -I want to pause here for a minute here and say that the way the keys you get pressed get mapped to bytes is pretty weird. Like, if we were designing the way keys are encoded from scratch today, we would probably not set it up so that: - - * `Ctrl + a` does the exact same thing as `Ctrl + Shift + a` - * `Alt` is the same as `Escape` - * control sequences (like colours / moving the cursor around) use the same byte as the `Escape` key, so that you need to rely on timing to determine if it was a control sequence of the user just meant to press `Escape` - - - -But all of this was designed in the 70s or 80s or something and then needed to stay the same forever for backwards compatibility, so that’s what we get :) - -### changing window size - -Not everything you can do in a terminal happens via sending bytes back and forth. For example, when the terminal gets resized, we have to tell Linux that the window size has changed in a different way. - -Here’s what the Go code in [goterm][10] to do that looks like: - -``` - - syscall.Syscall( - syscall.SYS_IOCTL, - tty.Fd(), - syscall.TIOCSWINSZ, - uintptr(unsafe.Pointer(&resizeMessage)), - ) - -``` - -This is using the `ioctl` system call. My understanding of `ioctl` is that it’s a system call for a bunch of random stuff that isn’t covered by other system calls, generally related to IO I guess. - -`syscall.TIOCSWINSZ` is an integer constant which which tells `ioctl` which particular thing we want it to to in this case (change the window size of a terminal). - -### this is also how xterm works - -In this post we’ve been talking about remote terminals, where the client and the server are on different computers. But actually if you use a terminal emulator like `xterm`, all of this works the exact same way, it’s just harder to notice because the bytes aren’t being sent over a network connection. - -### that’s all for now! - -There’s defimitely a lot more to know about terminals (we could talk more about colours, or raw vs cooked mode, or unicode support, or the Linux pseudoterminal interface) but I’ll stop here because it’s 10pm, this is getting kind of long, and I think my brain cannot handle more new information about terminals today. - -Thanks to [Jesse Luehrs][11] for answering a billion of my questions about terminals, all the mistakes are mine :) - --------------------------------------------------------------------------------- - -via: https://jvns.ca/blog/2022/07/20/pseudoterminals/ - -作者:[Julia Evans][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://jvns.ca/ -[b]: https://github.com/lujun9972 -[1]: https://xtermjs.org/ -[2]: https://upload.wikimedia.org/wikipedia/commons/thumb/9/99/DEC_VT100_terminal.jpg/512px-DEC_VT100_terminal.jpg -[3]: https://commons.wikimedia.org/wiki/File:DEC_VT100_terminal.jpg (Jason Scott, CC BY 2.0 , via Wikimedia Commons) -[4]: https://livingcomputers.org/ -[5]: https://github.com/freman/goterm -[6]: https://github.com/jvns/goterm -[7]: https://en.wikipedia.org/wiki/ANSI_escape_code -[8]: https://misc.flogisoft.com/bash/tip_colors_and_formatting -[9]: https://github.com/doy/vt100-rust -[10]: https://github.com/freman/goterm/blob/a644c10e180ce8af789ea3e4e4892dcf078e97e2/main.go#L110-L115 -[11]: https://github.com/doy/ diff --git a/sources/tech/20220721 How I use the Linux fmt command to format text.md b/sources/tech/20220721 How I use the Linux fmt command to format text.md deleted file mode 100644 index 6c20109d86..0000000000 --- a/sources/tech/20220721 How I use the Linux fmt command to format text.md +++ /dev/null @@ -1,94 +0,0 @@ -[#]: subject: "How I use the Linux fmt command to format text" -[#]: via: "https://opensource.com/article/22/7/fmt-trivial-text-formatter" -[#]: author: "Jim Hall https://opensource.com/users/jim-hall" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How I use the Linux fmt command to format text -====== -The fmt command is a trivial text formatter. Here's how I use it to format text and email replies. - -When I write documentation for a project, I often write the Readme file and Install instructions in plain text. I don't need to use markup languages like HTML or Markdown to describe what a project does or how to compile it. But maintaining this documentation can be a pain. If I need to update the middle of a sentence in my `Readme` text file, I need to reformat the text so I don't end up with a really long or short line in the middle of my other text that's otherwise formatted to 75 columns. Some editors include a feature that will automatically reformat text to fill paragraphs, but not all do. That's where the Linux `fmt` command comes to the rescue. - -### Format text with Linux fmt - -The `fmt` command is a trivial text formatter; it collects words and fills paragraphs, but doesn't apply any other text styling such as italics or bold. It's all just plain text. With `fmt`, you can quickly adjust text so it's easier to read. Let's say I start with this familiar sample text: - -``` -$ cat trek.txt -Space: the final -frontier. These are the voyages -of the starship Enterprise. Its -continuing mission: to explore -strange new worlds. To -seek out new life and new -civilizations. To boldly go -where no one has gone before! -``` - -In this sample file, lines have different lengths, and they are broken up in an odd way. You might have similar odd line breaks if you make lots of changes to a plain text file. To reformat this text, you can use the `fmt` command to fill the lines of the paragraph to a uniform length: - -``` -$ fmt trek.txt -Space: the final frontier. These are the voyages of the starship -Enterprise. Its continuing mission: to explore strange new worlds. To -seek out new life and new civilizations. To boldly go where no one has -gone before! -``` - -By default, `fmt` will format text to 75 columns wide, but you can change that with the -w or --width option: - -``` -$ fmt -w 60 trek.txt -Space: the final frontier. These are the voyages of -the starship Enterprise. Its continuing mission: to -explore strange new worlds. To seek out new life and new -civilizations. To boldly go where no one has gone before! -``` - -### Format email replies with Linux fmt - -I participate in an email list where we prefer plain text emails. That makes archiving emails on the list server much easier. But the reality is not everyone sends emails in plain text. And sometimes, when I reply to those emails as plain text, my email client puts an entire paragraph on one line. That makes it difficult to "quote" a reply in an email. - -Here's a simple example. When I'm replying to an email as plain text, my email client "quotes" the other person's email by adding a > character before each line. For a short message, that might look like this: - -``` -> I like the idea of the interim development builds. -``` - -A long line that doesn't get "wrapped" properly will not display correctly in my plain text email reply, because it will be just one long line with a > character at the front, like this: - -``` -> I like the idea of the interim development builds. This should be a great way to test new changes that everyone can experiment with. -``` - -To fix this, I bring up a terminal and copy and paste the quoted text into a new file. Then I use the -p or --prefix option to tell `fmt` what character to use as a "prefix" before each line. - -``` -$ cat > email.txt -> I like the idea of the interim development builds. This should be a great way to test new changes that everyone can experiment with. -^D -$ fmt -p '>' email.txt -> I like the idea of the interim development builds. This should be a -> great way to test new changes that everyone can experiment with. -``` - -The`fmt` command is a very simple text formatter, but it can do lots of useful things that help in writing and updating documentation in plain text. Explore the other options such as -c or --crown-margin to match the indentation of the first two lines of a paragraph, such as bullet lists. Also try -t or --tagged-paragraph to preserve the indentation of the first line in a paragraph, like indented paragraphs. And the -u or --uniform-spacing option to use one space between words and two spaces between sentences. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/7/fmt-trivial-text-formatter - -作者:[Jim Hall][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jim-hall -[b]: https://github.com/lkxed -[1]: https://opensource.com/sites/default/files/lead-images/osdc-docdish-typewriterkeys-3-series.png diff --git a/sources/tech/20220722 Create conditional pipelines with CEL.md b/sources/tech/20220722 Create conditional pipelines with CEL.md new file mode 100644 index 0000000000..aee4430708 --- /dev/null +++ b/sources/tech/20220722 Create conditional pipelines with CEL.md @@ -0,0 +1,152 @@ +[#]: subject: "Create conditional pipelines with CEL" +[#]: via: "https://opensource.com/article/22/7/conditional-tekton-pipelines-cel" +[#]: author: "Camilla Conte https://opensource.com/users/spotlesstofu" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Create conditional pipelines with CEL +====== +Control when automated builds happen in Tekton with CEL. + +![Plumbing tubes in many directions][1] + +You just followed a guide to start your Tekton pipeline (or task) when a merge request is created or updated on your GitLab project. So you configured GitLab to send merge request **events** as **webhooks**. And you deployed some **Tekton** components: + +* EventListener: receives webhooks from GitLab +* Trigger: starts your Pipeline every time the EventListener receives a new webhook from GitLab +* Pipeline: fetches the source code from GitLab and builds it + +Then you notice that any event in your merge request (a new comment, a tag change) triggers the pipeline. That's not the behavior you desire. You don't need to build a comment or a tag, after all. You only want the pipeline to run when there is actual new code to build. Here's how I use Tekton's CEL Interceptor to create conditionals for my pipelines. + +### Have your trigger ready + +I expect you have a trigger already defined. It's probably something similar to the snippet below. + +The trigger's interceptor rejects anything that's not coming from a merge request. Still, the interceptor is not able to differentiate between code and non-code updates (like new comments). + +``` +apiVersion: triggers.tekton.dev/v1beta1 +kind: Trigger +metadata: +  name: webhook-listener-trigger +spec: +  interceptors: +    # reject any payload that's not a merge request webhook +    - name: "filter-event-types" +      ref: +        name: "gitlab" +        kind: ClusterInterceptor +      params: +        - name: eventTypes +          value: +            - "Merge Request Hook" +  bindings: +    - ref: binding +  template: +    ref: template +``` + +### Add a CEL interceptor + +Here comes the `cel` interceptor. This interceptor filters the webhook payload using the CEL expression language. If the filter expression evaluates to `true`, the pipeline starts. + +Here I'm checking for the `object_attributes.oldrev` field to exist in the JSON body of the webhook payload. If `object_attributes.oldrev` exists, then that means this event is about a code change. If there wasn't a code change, there's no previous revision (`oldrev` ) to refer to. + +``` +spec: +  interceptors: +    - name: "allow-code-changes-only" +      ref: +        name: cel +        kind: ClusterInterceptor +      params: +        - name: filter +          value: > +            has(body.object_attributes.oldrev) +``` + +Add the new interceptor to your trigger. Now your trigger looks like this: + +``` +apiVersion: triggers.tekton.dev/v1beta1 +kind: Trigger +metadata: +  name: gitlab-listener-trigger +spec: +  interceptors: +    - name: "verify-gitlab-payload" +      ref: +        name: "gitlab" +        kind: ClusterInterceptor +      params: +        - name: eventTypes +          value: +            - "Merge Request Hook" +    - name: "allow-code-changes-only" +      ref: +        name: "cel" +        kind: ClusterInterceptor +      params: +        - name: filter +          value: > +            has(body.object_attributes.oldrev) +  bindings: +    - ref: binding +  template: +    ref: template +``` + +Deploy this new version of the trigger and enjoy the powers of automation. From now on, your pipeline only starts if there is some new code to build. + +### Tips + +There are no limits to the conditions you can set in a CEL filter. + +You may check that the merge request is currently open: + +``` +body.object_attributes.state in ['opened'] +``` + +You can make sure the contributor finished their work on the code: + +``` +body.object_attributes.work_in_progress == false +``` + +You just have to concatenate multiple conditions correctly: + +``` +- name: filter +  value: > +    has(body.object_attributes.oldrev) && +    body.object_attributes.state in ['opened'] && +    body.object_attributes.work_in_progress == false +``` + +Check out the [merge request events][2] documentation to get inspired to write your own conditions. + +You may need the [CEL language definition][3] to know how to translate your thoughts into code. + +To evaluate types other than strings, you want to know the [mapping between JSON and CEL][4] types. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/conditional-tekton-pipelines-cel + +作者:[Camilla Conte][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/spotlesstofu +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/plumbing_pipes_tutorial_how_behind_scenes.png +[2]: https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html#merge-request-events +[3]: https://github.com/google/cel-spec/blob/master/doc/langdef.md +[4]: https://github.com/google/cel-spec/blob/master/doc/langdef.md#json-data-conversion diff --git a/sources/tech/20220723 Nala – A Feature-rich Commandline Frontend For APT Package Manager.md b/sources/tech/20220723 Nala – A Feature-rich Commandline Frontend For APT Package Manager.md new file mode 100644 index 0000000000..f941cf9e1d --- /dev/null +++ b/sources/tech/20220723 Nala – A Feature-rich Commandline Frontend For APT Package Manager.md @@ -0,0 +1,561 @@ +[#]: subject: "Nala – A Feature-rich Commandline Frontend For APT Package Manager" +[#]: via: "https://ostechnix.com/nala-commandline-frontend-for-apt/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Nala – A Feature-rich Commandline Frontend For APT Package Manager +====== +Nala is a feature-rich package management tool for Debian, Ubuntu and its derivatives + +**Apt**, stands for "**A**dvanced **P**ackage **T**ool", is the default, command line package manager for Debian, Ubuntu and its derivatives such as Elementary OS, Linux Mint and Pop!_OS. Using apt, we can search, install, update, upgrade and remove packages in a DEB-based system. There are a few APT frontends exists. Two popular APT front-ends are Aptitude and Synaptic. Today, we will talk about yet another APT frontend tool called **"Nala"**. + +### What Is Nala? + +Nala is a commandline frontend for the APT package manager. Nala uses `python-apt` api to interact with APT. + +The main goal of Nala is to format the output better, use colors to show what will happen with a package during install, removal, and upgrade. + +The functionality of Nala is same as APT, however Nala includes a few additional features. The developer of Nala took the inspiration from DNF package manager and implemented some of its features in Nala. + +Nala formats the output to be more human readable i.e. **prettier output**. Also, Nala hides unnecessary redundant messages that you will see in APT output. + +Nala supports the **history function**, just like Fedora's `dnf history` feature. Using the Nala's history function, we can see the past transactions and easily undo or redo them. You can easily undo the previous transaction and/or rollback to previous working version when something goes wrong. + +Another notable feature of Nala is **Parallel downloads**. As far as I know, APT package manager doesn't has this feature yet. We should rely on third-party tools like **["Apt-fast"][1]** to speed up the package downloads in Ubuntu. Fortunately, the parallel download feature is enabled by default in Nala. So package download process is bit faster when using Nala. + +The other useful feature included in Nala is **fetching fastest APT mirrors**. Currently, we can use Synaptic or some third-party tools to **[choose the best APT mirror][2]** in Ubuntu. If you use Nala, you don't need to rely on any external tools. By default, Nala will help you to choose the fastest mirrors and write them in a file. + +In summary, Nala ships with the following distinct features out of the box. + +* Pretty output formatting, +* History function, +* Parallel downloads, +* Fetch fastest mirror. + +Nala is an opensource program written in **Python**. The code is freely hosted in GitLab. + +### How To Install Nala + +We can install Nala from a PPA, or using Pacstall or apt/dpkg package managers. + +#### Install Nala Using PPA + +Nala can be installed from **Volian Scar repository** in Debian, Ubuntu and its variants such as Linux Mint, Pop!_OS. + +To add Volian Scar repo in Debian, Ubuntu and its derivatives, run the following command: + +``` +$ echo "deb http://deb.volian.org/volian/ scar main" | sudo tee /etc/apt/sources.list.d/volian-archive-scar-unstable.list +``` + +Add the GPG key: + +``` +$ wget -qO - https://deb.volian.org/volian/scar.key | sudo tee /etc/apt/trusted.gpg.d/volian-archive-scar-unstable.gpg > /dev/null +``` + +Update the sources list: + +``` +$ sudo apt update +``` + +And install Nala in Ubuntu 22.04 / Debian Sid and newer using command: + +``` +$ sudo apt install nala +``` + +For Debian 11 stable, Ubuntu 21.04 and older versions, you need to install the `nala-legacy` package + +``` +$ sudo apt install nala-legacy +``` + +**Heads Up:** It looks like Nala is added to the Debian [Testing] repository and the default repositories of Debian Sid. I don't have Debian Sid, so I can't confirm it though. + +#### Install Nala Using Pacstall + +Nala developer has created a pacscript for **[Pacstall][3]**. + +First, install Pacstall as described in the link above. + +Once that is complete, simply run the following command to install Nala. + +``` +$ pacstall -I nala-deb +``` + +#### Install Nala From Binaries + +Download Nala latest `.deb` file from the **[releases][4]** page. + +And install it locally through `apt` or `dpkg`. + +``` +$ sudo apt install /path/to/nala_version_arch.deb +$ sudo apt install -f +``` + +Or + +``` +$ sudo dpkg -i /path/to/nala_version_arch.deb$ sudo apt install -f +``` + +### Nala Commands Usage + +As stated already, Nala usage is pretty much same as Apt. The Nala commands are identical to the apt variant, but the output is formatted differently. + +Let us start by displaying Nala help manual. + +#### View Nala Help + +To display nala command help section, use `-h` or `--help` flag like below: + +``` +$ nala --help +``` + +**Sample output:** + +``` +Usage: nala [OPTIONS] COMMAND [ARGS]... + + Each command has its own help page. + + For Example: `nala history --help` + +Options: + --version Show program's version number and exit. + --license Reads the GPLv3 which Nala is licensed under. + --install-completion Install completion for the current shell. + --show-completion Show completion for the current shell, to copy it or + customize the installation. + -h, --help Show this message and exit. + +Commands: + autopurge Autopurge packages that are no longer needed. + autoremove Autoremove packages that are no longer needed. + clean Clear out the local archive of downloaded package files. + fetch Fetch fast mirrors to speed up downloads. + history Show transaction history. + install Install packages. + list List packages based on package names. + purge Purge packages. + remove Remove packages. + search Search package names and descriptions. + show Show package details. + update Update package list. + upgrade Update package list and upgrade the system. +``` + +As you can see in the above output, Nala has all essential commands for basic package management operations in Debian-based systems. + +Each Nala sub-command has its own help section. For instance, to view the help section of the `update` command, you can use the following command: + +``` +$ nala update -h +``` + +#### Update Repositories + +To update the software repositories using Nala, run: + +``` +$ sudo nala update +``` + +**Sample output:** + +``` +$ sudo nala update +╭─ Updating Package List ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ +│No Change: http://in.archive.ubuntu.com/ubuntu jammy InRelease │ +│No Change: https://download.docker.com/linux/ubuntu jammy InRelease │ +│No Change: http://in.archive.ubuntu.com/ubuntu jammy-updates InRelease │ +│No Change: http://in.archive.ubuntu.com/ubuntu jammy-backports InRelease │ +│No Change: http://deb.volian.org/volian scar InRelease │ +│Updated: http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB] │ +│No Change: https://ppa.launchpadcontent.net/flexiondotorg/quickemu/ubuntu jammy InRelease │ +│No Change: https://ppa.launchpadcontent.net/yannick-mauray/quickgui/ubuntu jammy InRelease │ +│Fetched 110 kB in 6s (2555 B/s) │ +╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ +1 packages can be upgraded. Run 'nala list --upgradable' to see them. +``` + +![Nala Update Command][5] + +Now, run the actual `apt update` command and compare the output of both commands: + +``` +$ sudo apt update +``` + +![Nala Update Vs Apt Update Command][6] + +Did you get the difference? The `nala update` command's output is more human-friendly than the `apt update` command's output. + +Nala displays a title to describe the actual purpose of the given command. As you in the above output, Nala displays "Updating Package List" on the top. The user will easily understand know what the given command will do. + +The other minor difference is Nala displays "No change" message if the repository is not changed or updated. It also eliminates the following lines from the output. + +``` +[...] +Reading package lists... Done +Building dependency tree... Done +Reading state information... Done +[...] +``` + +Apt will display these three lines in all commands. + +#### Upgrade Packages + +To upgrade your Debian or Ubuntu system, run: + +``` +$ sudo nala upgrade +``` + +**Sample output:** + +``` +╭─ Updating Package List ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ +│No Change: http://in.archive.ubuntu.com/ubuntu jammy InRelease │ +│Updated: https://download.docker.com/linux/ubuntu jammy InRelease [48.9 kB] │ +│No Change: http://in.archive.ubuntu.com/ubuntu jammy-updates InRelease │ +│No Change: http://in.archive.ubuntu.com/ubuntu jammy-backports InRelease │ +│Updated: http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB] │ +│No Change: http://deb.volian.org/volian scar InRelease │ +│No Change: https://ppa.launchpadcontent.net/flexiondotorg/quickemu/ubuntu jammy InRelease │ +│No Change: https://ppa.launchpadcontent.net/yannick-mauray/quickgui/ubuntu jammy InRelease │ +│Fetched 159 kB in 0s (0 B/s) │ +╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ +================================================================================================================================================== + Upgrading +================================================================================================================================================== + Package: Old Version: New Version: Size: + libfreetype6 2.11.1+dfsg-1build1 2.11.1+dfsg-1ubuntu0.1 389 kB + +================================================================================================================================================== + Summary +================================================================================================================================================== + Upgrade 1 Packages + + +Do you want to continue? [Y/n] y +╭─ Updating Packages ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ +│Unpacking: libfreetype6:amd64 (2.11.1+dfsg-1ubuntu0.1) over (2.11.1+dfsg-1build1) │ +│Setting up: libfreetype6:amd64 (2.11.1+dfsg-1ubuntu0.1) │ +│Processing: triggers for libc-bin (2.35-0ubuntu3) │ +│╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│ +││✔ Running dpkg … ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100.0% • 0:00:00 • 3/3││ +│╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│ +╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ +Finished Successfully +``` + +![Nala Upgrade Command][7] + +The output is quite descriptive and self-explanatory, right? Indeed! You won't see these details in Apt command. + +Nala will display a descriptive title for each action, for example "Updating Package List", "Downloading", "Installing Packages" etc. + +#### Install Packages + +To install a package using Nala, for example **Vim**, simply run: + +``` +$ sudo nala install vim +``` + +**Sample output:** + +![Nala Install Command][8] + +To view the usage of and available options in `nala install` command, simply run: + +``` +$ nala install -h +``` + +#### List Packages + +You can list all packages or specific packages based on their name with `nala list` command. + +To list all packages, simply run `nala list` without any flags. + +``` +$ nala list +``` + +You can also list only the packages that are installed with `-i` , `--installed` flag. + +``` +$ nala list -i +``` + +What if you want to list only the packages that are **explicitly** installed with Nala? That's also possible. Use `-N`, `--nala-installed` flag. + +``` +$ nala list -N +``` + +**Sample output:** + +``` +vim 2:8.2.3995-1ubuntu2 [Ubuntu/jammy main] +├── is installed +└── Vi IMproved - enhanced vi editor +``` + +To view only packages that are upgradable, use `-u`, `--upgradable` option. + +``` +$ nala list -u +``` + +To show all versions of a given package, you can use `-a`, `--all-versions` flag. + +``` +$ nala list -a +``` + +#### Search Packages + +You can search package names and descriptions using a word or REGEX. This command has the same options as the `nala list` command. The only additional flag it has is `-A`, `--all-arches` flag which shows all architectures of a package. + +To search for packages that has "vim" in their name, run: + +``` +$ nala search vim +``` + +When you run nala search without any options, it will show both package names and descriptions. + +To search only the names, use `-n`, `--names` flag. + +``` +$ nala search -n vim +``` + +To show all architectures of a given package, use `-A` (Note it is Uppercase A). + +``` +$ nala search -n -A vim +``` + +Similarly, you can use `-i` to list only the installed packages, use `-N` to list only packages explicitly with Nala, use `-u` to list only upgradable packages. + +You can view all supported options from the `nala search` help section by running the following command. + +``` +$ nala search -h +``` + +#### Show Package Details + +The `show` command displays the information about the given package such as the name, version and dependencies etc. + +``` +$ nala show vim +``` + +![Nala Show Command][9] + +As you see, the `nala show` command is very similar to `apt show` except the package information is highlighted for better readability. + +#### Parallel Downloads + +This is an useful feature of Nala. + +Currently, Apt package manager doesn't has parallel downloads support. However, we can enhance the Apt download speed using a third-party tool called **Apt-fast**. The Apt-fast application is used to **[speed up downloading of packages in Ubuntu][10]** and its derivatives. + +Nala supports parallel downloads out of the box. So we don't need any external tools. By default, Nala will **download 3 packages per unique mirror** in your `sources.list` file. + +#### Fetch Fastest Mirrors + +The another useful addition in Nala features list is fetching the fastest APT mirror. The `nala fetch` command works very similar to **apt-select**, **apt-smart**, **netselect**, and **netselect-apt** CLI tools. + +Before I know about Nala, I used the aforementioned tools to **[find the best and fastest APT mirror][11]** in my Ubuntu systems. Fortunately, Nala has included this feature by default. + +First, Nala will check if your distribution is either Debian or Ubuntu. And then, it get all the mirrors from the respective master list. After getting the master list, it will test the latency and score each mirror. + +Depending on the latency and speed, Nala will list the fastest 16 mirrors. Type the index number of the mirrors (separated by space) that you want to keep and hit ENTER key + +![List Fastest APT Mirrors With Nala][12] + +Nala will display a confirmation message. If you're OK with the selected mirrors, press Y to confirm and ENTER. + +![Confirm Selected Mirrors][13] + +The selected sources will be written to `/etc/apt/sources.list.d/nala-sources.list` file. + +Update the sources list by running the following command: + +``` +$ sudo nala update +``` + +If you don't want the mirrors selected by Nala, simply delete it. + +``` +$ sudo rm /etc/apt/sources.list.d/nala-sources.list +``` + +#### Show Transaction History + +This is one of the flagship feature of Nala package manager. This feature is actually inspired by the **history** function from the **[DNF][14]** package manager. + +Using the `nala history` command, we can easily undo or redo previous APT transactions. + +Whenever, you install, remove or upgrade packages, the APT transaction is stored in `/var/lib/nala/history.json` file with a unique **ID** number. + +Let us view the current history using command: + +``` +$ nala history + ID Command Date and Time Altered Requested-By + 1 upgrade libfreetype6 2022-07-22 18:14:55 IST 1 ostechnix (1000) + 2 install vim 2022-07-22 18:20:11 IST 2 ostechnix (1000) +``` + +As you can see, we have done two APT transactions using Nala. Here, 1 and 2 are the transaction IDs. + +You can show information about a specific transaction using `nala history info [ID]` command. + +``` +$ nala history info 2 +``` + +**Sample output:** + +``` +================================================================================================================================================== + Installed +================================================================================================================================================== + Package: Version: Size: + vim 2:8.2.3995-1ubuntu2 1.7 MB + vim-runtime 2:8.2.3995-1ubuntu2 6.8 MB + +================================================================================================================================================== + Summary +================================================================================================================================================== + Installed 2 Packages +``` + +![View Apt Transaction Details][15] + +Now let me undo the installation Vim package. + +To do so, simply run: + +``` +$ sudo nala history undo 2 +``` + +Here, 2 is the index of the "install vim" command. + +![Nala History Undo Command][16] + +See? We just undo the Vim installation. In other words, we simply removed the Vim package. + +Let us run the history command again: + +``` +$ nala history + ID Command Date and Time Altered Requested-By + 1 upgrade libfreetype6 2022-07-22 18:14:55 IST 1 ostechnix (1000) + 2 install vim 2022-07-22 18:20:11 IST 2 ostechnix (1000) + 3 history undo 2 2022-07-23 17:12:34 IST 2 ostechnix (1000) +``` + +![Nala History Command][17] + +As you see in the above output, we have a new entry (i.e. `history undo 2` ) in the `nala history` output. + +Let us install the vim package again. To put it another way, let us **redo** the "install vim" command. + +To redo the "install vim" transaction, run: + +``` +$ sudo nala history redo 2 +``` + +![Nala History Redo Command][18] + +Now, the Vim package is installed again. + +If you don't want any transaction in the history, you can remove it using `nala history clear` command: + +``` +$ sudo nala history clear 3 +``` + +#### Remove Packages + +To remove or purge an installed package that are no longer needed with Nala, run: + +``` +$ sudo nala purge vim +``` + +Or, + +``` +$ sudo nala remove --purge vim +``` + +if you want to automatically remove any packages that are no longer needed, add `--autoremove` flag. + +``` +$ sudo nala purge vim --autoremove +``` + +### Conclusion + +Using Nala, we can have prettier output, faster downloads of packages, and a history! If you do only a basic package management operations, such as install, update, upgrade, list, search, and remove etc., you can use Nala. For other advanced package management operations, use Apt. + +The developer of Nala has also planned to rewrite Nala in **Rust** programming language. Let us hope it will be out soon and with more features. + +**Resource:** + +* [Nala GitLab Repository][19] + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/nala-commandline-frontend-for-apt/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/apt-fast-speed-up-downloading-of-packages-in-ubuntu/ +[2]: https://ostechnix.com/how-to-find-best-ubuntu-apt-repository-mirror/ +[3]: https://github.com/pacstall/pacstall +[4]: https://gitlab.com/volian/nala/-/releases +[5]: https://ostechnix.com/wp-content/uploads/2022/07/Nala-Update-Command.png +[6]: https://ostechnix.com/wp-content/uploads/2022/07/Nala-Update-Vs-Apt-Update-Command.png +[7]: https://ostechnix.com/wp-content/uploads/2022/07/Nala-Upgrade-Command.png +[8]: https://ostechnix.com/wp-content/uploads/2022/07/Nala-Install-Command.png +[9]: https://ostechnix.com/wp-content/uploads/2022/07/Nala-Show-Command.png +[10]: https://ostechnix.com/how-to-speed-up-dnf-package-manager-in-fedora/ +[11]: https://ostechnix.com/how-to-find-best-ubuntu-apt-repository-mirror/ +[12]: https://ostechnix.com/wp-content/uploads/2022/07/List-Fastest-APT-Mirrors-With-Nala.png +[13]: https://ostechnix.com/wp-content/uploads/2022/07/Confirm-Selected-Mirrors.png +[14]: https://ostechnix.com/dnf-command-examples-beginners/ +[15]: https://ostechnix.com/wp-content/uploads/2022/07/View-Apt-Transaction-Details.png +[16]: https://ostechnix.com/wp-content/uploads/2022/07/Nala-History.png +[17]: https://ostechnix.com/wp-content/uploads/2022/07/Nala-History-Command.png +[18]: https://ostechnix.com/wp-content/uploads/2022/07/Nala-History-Redo-Command.png +[19]: https://gitlab.com/volian/nala diff --git a/sources/tech/20220723 Top 10 Best Music Players for Linux in 2022.md b/sources/tech/20220723 Top 10 Best Music Players for Linux in 2022.md new file mode 100644 index 0000000000..6027b80543 --- /dev/null +++ b/sources/tech/20220723 Top 10 Best Music Players for Linux in 2022.md @@ -0,0 +1,204 @@ +[#]: subject: "Top 10 Best Music Players for Linux in 2022" +[#]: via: "https://itsfoss.com/best-music-players-linux/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Top 10 Best Music Players for Linux in 2022 +====== + +While many of us rely on music streaming services, several users prefer to use the good-old music player on their Linux system. + +Of course, you already get a music player program pre-installed with every Linux distribution. + +However, depending on your requirements, you might want to try a variety of music players, providing you with more features or a better user experience. + +You could save time organizing your collections, sorting the best playlist, and other things. + +So, to save you from trouble, I highlight the best music player applications for Ubuntu and other Linux distributions. + +### 1. Amberol + +![amberol music player interface][1] + +Looking for something to simply play music with no fancy features? + +Amberol is your best bet. It provides a super intuitive user experience and offers essential music controls to shuffle, have a playlist, navigate through the song, and more. + +We also have a dedicated article on [Amberol][2], if you want to explore more about it. + +[Amberol][3] + +### 2. Elisa + +![elisa music player][4] + +Elisa is a fantastic music player developed by KDE. Primarily, it is tailored for KDE-powered distributions, but it should work fine on other Linux distributions. I tried it with Ubuntu 22.04 LTS GNOME. + +Elisa could be the perfect candidate for you if you wanted a fast, good-looking, and feature-rich music player. It gives you some control over the layout, allowing you to choose to access all the options available or switch to an immersive mode to focus on playing music. + +It is available for Linux, BSD derivatives, and Windows. For Linux, you can find it available in the official repositories of major distributions and install it via the terminal. + +Furthermore, you can find it listed in the software center of respective distributions. + +[Elisa][5] + +### 3. Rythmbox + +![rythmbox][6] + +Rythmbox is a popular music player considering it comes pre-installed with many Linux distributions, including Ubuntu. + +It is a simple feature-rich player where you can access internet radio, manage a music library, and stream music services like Last.fm and Magnatune. + +Moreover, you can expand its capabilities with plugins. + +The best way to get it installed is to use the Flatpak package from Flathub, and you can also find it in the software center. + +[Rythmbox][7] + +### 4. Sayonara Player + +![sayonara player 2022][8] + +Sayonara Player is an underrated option if you are looking for a customizable and lightweight music player focused on performance. + +Even though the user interface is simple, it supports multiple libraries, album view, directory view, genre organization, dynamic playback, equalizer, lyrics, internet streams, podcasts, and more. + +You can install it using the official PPA, AppImage file, Snap package, or explore other options on its download page. + +[Sayonara Player][9] + +### 5. Strawberry Music Player + +![strawberry music player][10] + +Strawberry Music Player is a fork of Clementine (which was a popular music player but hasn’t seen any new releases since 2016). + +It supports various music file formats and easily lets you organize/manage playlists. You can also edit tags on audio files and get album cover art support. + +Additionally, it offers an audio analyzer and equalizer. + +It is available for Linux, Windows, and macOS. For Linux, you can use its official PPA or grab the deb package from its [GitHub releases section][11]. + +[Strawberry Music Player][12] + +### 6. DeaDBeef Player + +![deadbeef 2022][13] + +DeaDBeef Player is one of the oldest options that is still actively maintained for multiple platforms, including Linux, Windows, and macOS. + +You can edit music tags, read all the details, play all kinds of files, and install additional plugins to enhance your experience. It also lets you split albums into tracks and helps you manage multiple playlists. + +Interestingly, you can also use it to transcode files to other formats. + +For Ubuntu, you can download the deb package from its official website and get it installed. If you have Arch Linux or any other distro, explore the available packages on its website. + +[DeaDBeef Player][14] + +### 7. cmus (Terminal Music Player) + +![cmus 2022][15] + +Fret not, if you would rather not leave the terminal for anything else, cmus is an option. + +It gets you all the essential features right from the command line. You will have to browse for the correct directory and set it up to start using the music player. + +It may not be easy for new users. So, you will have to explore its built-in tutorial and refer to our dedicated article on [cmus music player][16] to know how to add a playlist, manage tracks, and more. It is available in the official repositories, so you can find it in the software center or install it through the terminal on Ubuntu. + +[cmus][17] + +### 8. VLC Media Player + +![vlc linux][18] + +VLC Media Player is one of the most popular options for any platform, including Linux. + +You know what it does if you are already a fan of it. It supports many file formats and has excellent features like transcoding. Unlike other options, it is not just a music player but also supports videos, DVDs, and some streaming protocols. It is primarily a video player but it can also handle music files pretty well. + +VLC provides packages for almost every popular Linux distribution, including Debian, Ubuntu, openSUSE, Arch, and Fedora. You can find the packages on its [official download page][19]. + +Alternatively, you can easily [install VLC media player][20] from the terminal. + +[VLC][21] + +### 9. Museeks + +![museeks][22] + +Museeks is a cross-platform music player with a clean user interface. It supports the major file formats and helps you manage playlists, queues, loops, album covers, and more. + +It does support a dark mode theme along with playback speed controls. + +Additionally, it supports .m3u import/export. You can find packages for Linux (deb/rpm/AppImage) in its [GitHub releases section][23]. + +[Museeks][24] + +### 10. Audacious + +![audacious player][25] + +Audacious is another music player that has existed for over a decade and is available for Linux and Windows. + +It utilizes Qt to offer a responsive user interface without affecting much of your system resources. Interestingly, you get to equip some Winamp Classic skins as well. In any case, the user experience is rather straightforward. + +Audacious supports a few plugins for lyrics, VU meter, and more. You can install it directly through the official repositories via the terminal or search for it in the software center. + +[Audacious][26] + +### Wrapping Up + +Music players are here to stay, even if we switch to streaming applications. + +Unfortunately, some native Linux applications like [Mellow Player][27], [Nuvola][28], and [Nuclear][29], that allowed access to streaming services are no longer actively maintained. So, if you are thinking of accessing Spotify/SoundCloud on Linux, you should look for any of their official/unofficial clients available. + +Music players are perfect for users who want to play around with their local collection, organize playlists, and customize their native desktop experience while protecting their privacy! + +Did we miss any of your favorite music players? Let us know in the comments! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/best-music-players-linux/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2022/06/amberol-music-player-interface-800x693.png +[2]: https://itsfoss.com/amberol-music-player/ +[3]: https://gitlab.gnome.org/World/amberol +[4]: https://itsfoss.com/wp-content/uploads/2022/07/elisa-music-player.png +[5]: https://elisa.kde.org/en-gb/ +[6]: https://itsfoss.com/wp-content/uploads/2022/07/rythmbox-2022-800x626.png +[7]: https://wiki.gnome.org/Apps/Rhythmbox +[8]: https://itsfoss.com/wp-content/uploads/2022/07/sayonara-player-2022.png +[9]: https://sayonara-player.com/ +[10]: https://itsfoss.com/wp-content/uploads/2022/07/strawberry-music-player.png +[11]: https://github.com/strawberrymusicplayer/strawberry/releases +[12]: https://www.strawberrymusicplayer.org/ +[13]: https://itsfoss.com/wp-content/uploads/2022/07/deadbeef-2022.png +[14]: https://deadbeef.sourceforge.io/ +[15]: https://itsfoss.com/wp-content/uploads/2022/07/cmus-2022.png +[16]: https://itsfoss.com/cmus-linux-terminal-music-player/ +[17]: https://cmus.github.io/ +[18]: https://itsfoss.com/wp-content/uploads/2022/07/vlc-linux.png +[19]: https://www.videolan.org/vlc/#download +[20]: https://itsfoss.com/install-latest-vlc/ +[21]: https://www.videolan.org/ +[22]: https://itsfoss.com/wp-content/uploads/2022/07/museeks.png +[23]: https://github.com/martpie/museeks/releases +[24]: https://museeks.io +[25]: https://itsfoss.com/wp-content/uploads/2022/07/audacious-player.png +[26]: https://audacious-media-player.org/ +[27]: https://colinduquesnoy.gitlab.io/MellowPlayer/ +[28]: https://nuvola.tiliado.eu/ +[29]: https://github.com/nukeop/nuclear diff --git a/sources/tech/20220725 Feren OS Review- Clever KDE Distro for Easy Migration from Windows.md b/sources/tech/20220725 Feren OS Review- Clever KDE Distro for Easy Migration from Windows.md new file mode 100644 index 0000000000..9407901e3e --- /dev/null +++ b/sources/tech/20220725 Feren OS Review- Clever KDE Distro for Easy Migration from Windows.md @@ -0,0 +1,141 @@ +[#]: subject: "Feren OS Review: Clever KDE Distro for Easy Migration from Windows" +[#]: via: "https://www.debugpoint.com/feren-os-review/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Feren OS Review: Clever KDE Distro for Easy Migration from Windows +====== +A review of Feren OS – a KDE Plasma and Ubuntu fusion, specially designed for Windows users to help them migrate. + +Over the years, many readers commented about Feren OS and its advantages on this website. I never got a chance to try this distribution in terms of its benefits and why it stands out among hundreds of distros. + +So, here’s a review of the great Feren OS. + +### Feren OS Review + +First and foremost, its creators designed and marketed it as an ideal replacement for Windows and macOS. At its core, it’s based on Ubuntu LTS with a base KDE Plasma desktop and additional tweaks. However, it does bring several goodies specially designed for Windows users. A lot on that a little later. Let’s download and install it. + +#### Download and Install + +The Feren OS (20.04) ISO file is about 2.5 GB, and it has only one variant for KDE Plasma – which is the only offering. However, the download took around 6 hours from SourceForge. + +A few interesting things happened when I booted this up in a VM ([virt-manager][1]). During my years of [distro review][2], I haven’t seen any distro do this. + +First, the LIVE medium understood that I was using the virtual machine and changed the compositor by itself to Xrender for better performance in VM. Second, it also gave the option to install guest additions for VirtualBox and VM Tools for VM Ware for additional functionalities. + +![Virtual Machine detected by Feren OS installer][3] + +Moreover, Feren OS gave options to transfer files from the Windows partition before installing the system! And an option to choose the desktop layout if you are installing it on a touch-based device. + +![You can take backups of Windows data before install][4] + +The installer is Calamares and not Ubuntu’s Ubiquity, although it depends on Ubuntu LTS. While installing the system, Feren OS doesn’t do the account creation, keyboard and other selections. It prompts you for user account creation and additional info after the first reboot and post-installation. Fedora Linux workstation edition does this via the Anaconda installer. + +Apparently, it is probably nothing. But from a Windows user’s perspective, an “easy install” experience is important, and I believe the team made an excellent decision on this. + +Finally, the installation went smooth, and no such surprises there. + +#### First boot and looks + +During the first boot, you need to set up the user accounts and other initial settings. The wizard gives you options to choose the light/dark theme, desktop layouts and different initial configs. This is a nice touch and looks professional. + +The KDE Plasma desktop is nice and clean with the pre-configured taskbar and the Breeze theme. The taskbar has the application menu on the left side. In the middle of the taskbar, you find the shortcut to Vivaldi, File manager and homegrown Store. And at the right is a traditional system tray. + +![Feren OS Desktop][5] + +Feren OS pre-loads a good set of Plasma Global Themes other than the usual Breeze variants. All of them are perfect and give your desktop a nice touch with just one click. As of the current version, you get Feren OS, Hooman, Dooars and Mac n’ Cheese theme. In addition, you also can get the Tablet and Classic settings of the desktop. It also features the Inspire icon theme and DMZ cursor theme by default. + +#### Workspaces and Full-screen Application View + +One of the unique features I want to highlight is the default workspace configuration that Feren OS brings. By default, there are four desktops to work with. At the taskbar, there is an icon which brings up the new workspaces in the KDE Plasma desktop. + +![Feren OS – Default four desktops][6] + +If you apply the pre-defined macOS theme, the application view is quite spectacular (which is a KDE widget, btw). It even searches the apps and individual settings when you start typing. See the image below. + +![Fullscreen app menu with dynamic search][7] + +Also, the global menu gives you the extra edge and precious screen space for your workflow. + +#### Native and Installed Applications + +Let’s talk about some exciting app choices that Feren OS installs by default. + +Although it’s based on KDE Plasma, some apps are chosen carefully based on their features and performances. For example, the file manager is Nemo instead of Dolphin, which is a good choice since Nemo is an awesome file manager. + +In addition, Feren OS packages Geary [email desktop client][8], GDebi package manager, Timeshift backup utility, and VLC Media player – some of the essential non-KDE Apps. + +The native apps are quite interesting. + +A native app called “Store” manages application search, installation and uninstall. It’s a homegrown tool which looks similar to GNOME’s Software. It supports usual categories and one-click installation. However, it seems it doesn’t support managing software sources. I belives that’s the reason Synaptic package manager is installed by default. + +![Natively designed Store manager][9] + +Other than that, there is an app, “Web Browser Manager”, which lets you install additional browsers with just one click. It’s interesting to see a dedicated app to manage just the web browsers. + +#### A note about the Transfer Tool + +Since its target audiences are Windows users, it brings a dedicated tool to transfer data from your Windows partitions and helps you to take backups to a custom target drive or device. The tool can easily detect generic Windows folders such as Documents, Users, Pictures, Videos etc. + +![Feren OS Transfer Tool][10] + +It’s a handy tool if you want a quick backup of your Windows partition. More importantly, you can use this in a LIVE medium without installing Feren OS. + +#### Performance + +You might have guessed about FerenOS’s performance as it’s based on Ubuntu LTS and KDE Plasma desktop. The performance, in simple words, is the same as that of Kubuntu. + +In an idle state (i.e. desktop is boot and kept inactive), it consumes around 1.8 GB of memory, and the CPU is at 4% to 8%. The latte dock consumes most system resources and plasma desktop, followed by the KWin. This is when the macOS theme is enabled. + +![Feren OS – Performance at Idle State][11] + +Next, I make it run through heavy workload situations with one instance each for File manager, media player, Vivaldi browser, image editor, LibreOffice and Console application. At this heavy performance stage, Feren OS consumes around 2.1 GB of system memory, and the CPU is hovering at 8 to 10 %. + +![Feren OS – Performance at Heavy workload State][12] + +I think it’s an impressive performance metric in the heavy workflow state. I was expecting a little higher memory and CPU consumption. + +The only reason I believe the performance is better in a heavy workflow state is not to use Firefox or Chrome. Vivaldi is performing better in the memory utilization space than that Firefox or Chrome. + +### Wrapping Up + +Feren OS is one of those Linux distros which packs a default look with Stability together. It’s one of the “not-so-popular” & mainstream distros with many prospects. Its unique way of implementing several critical items, from installation to the first experience for a new or migrated Windows user, is a great touch. + +Besides, its in-house apps and utilities are one of the best implementations for a distro targeted at Windows users. And the Ubuntu LTS base gives them an edge over the players. + +The only drawback I can see is the major release is a little delayed. For example, the Ubuntu 22.04 LTS version is not yet out. Perhaps the delay is because of a small dev team. + +But, besides that, it’s a perfect and ready-to-use daily driver. You may give it a try. + +You can download Feren OS from the [official website][13]. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/feren-os-review/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/virt-manager/ +[2]: https://www.debugpoint.com/tag/linux-distro-review +[3]: https://www.debugpoint.com/wp-content/uploads/2022/07/Virtual-Machine-detected-by-Feren-OS-installer.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2022/07/You-can-take-backups-of-Windows-data-before-install.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/07/Feren-OS-Desktop.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2022/07/Feren-OS-Default-four-desktops.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2022/07/Fullscreen-app-menu-with-dynamic-search.jpg +[8]: https://www.debugpoint.com/best-email-client-linux-windows/ +[9]: https://www.debugpoint.com/wp-content/uploads/2022/07/Natively-designed-Store-manager.jpg +[10]: https://www.debugpoint.com/wp-content/uploads/2022/07/Feren-OS-Transfer-Tool.jpg +[11]: https://www.debugpoint.com/wp-content/uploads/2022/07/Feren-OS-Performance-at-Idle-State.jpg +[12]: https://www.debugpoint.com/wp-content/uploads/2022/07/Feren-OS-Performance-at-Heavy-workload-State.jpg +[13]: https://ferenos.weebly.com/get-feren-os.html diff --git a/sources/tech/20220726 How I use Bash to automate tasks on Linux.md b/sources/tech/20220726 How I use Bash to automate tasks on Linux.md new file mode 100644 index 0000000000..0a3635e515 --- /dev/null +++ b/sources/tech/20220726 How I use Bash to automate tasks on Linux.md @@ -0,0 +1,143 @@ +[#]: subject: "How I use Bash to automate tasks on Linux" +[#]: via: "https://opensource.com/article/22/7/use-bash-automate-tasks-linux" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How I use Bash to automate tasks on Linux +====== +Bash has a few handy automation features that make my life easier when working with files on Linux. + +![bash logo on green background][1] + +Image by: Opensource.com + +The Bash command line is a great way to automate tasks. Whether you are running Linux on a server and need to manipulate log files or other data, or you're a desktop user who just wants to keep files tidy, you can use a few automation features in Bash to make your work easier. + +### Linux for command: Automate tasks on a files + +If you have a bunch of files to work on at once, and you need to do the same thing with every file, use the `for` command. This command iterates across a list of files, and executes one or more commands. The `for` command looks like this: + +``` +for variable in list +do +    commands +done +``` + +I've added some extra spacing in there to help separate the different parts of the `for` command. That multi-line command might look difficult to run on the command line, but you can use `;` to put everything on one line, like this: + +``` +for variable in list ; do commands ; done +``` + +Let's see it in action. One way I use the `for` command is to rename a bunch of files. Most recently, I had a bunch of screenshots that I wanted to rename. The screenshots had names like `filemgr.png` or `terminal.png` and I wanted to put `screenshot` before each name instead. I ran a single `for` command to rename thirty files at once. Here's an example with just two files: + +``` +$ ls +filemgr.png  terminal.png +$ for f in *.png ; do mv $f screenshot-$f ; done +$ ls +screenshot-filemgr.png  screenshot-terminal.png +``` + +The `for` command makes it easy to perform one or more actions on a set of files. You can use a variable name that is meaningful to you, such as `image` or `screenshot`, or you can use a "shorthand" variable like `f`, as I did in my example. When I write scripts that use a `for` loop, I try to use meaningful variable names. But when I'm using `for` on the command line, I'll usually use a short variable name like `f` for files or `d` for directories. + +Whatever name you choose for your variable, be sure to reference the variable using `$` in the command. This expands the variable to the name of the file you are acting on. Type `help for` at your Bash prompt to learn more about the `for` command. + +### Linux conditional execution (if) + +Looping across a set of files with `for` is helpful when you need to do the same thing with every file. But what if you need to do something different for certain files? For that, you need conditional execution with the `if` statement. The `if` statement looks like this: + +``` +if test +then +    commands +fi +``` + +You can also do *if/else* tests by using the `else` keyword: + +``` +if test +then +    commands +else +    commands +fi +``` + +For more complicated processing, you can use *if/else-if/else* evaluations. I might use this in a script, when I need to automate a job to process a collection of files at once: + +``` +if test +then +    commands +elif test2 +then +    commands +elif test3 +then +    commands +else +    commands +fi +``` + +The `if` command allows you to perform many different tests, such as *if* a file is really a file, or *if* a file is empty (zero size). Type `help test` at your Bash prompt to see the different kinds of tests you can use in an `if` statement. + +For example, let's say I wanted to clean up a log directory that had several dozen files in it. A common task in log management is to delete any empty logs, and compress the other logs. The easiest way to tackle this is to just delete the empty files. There isn't an `if` test that exactly matches that, but we have `-s` file to test *if* something is a file, and *if* the file is not empty (it has a size). That's the opposite of what we want, but we can negate the test with `!` to see *if* something is not a file or is empty. + +Let's look at an example to see this at work. I've created two test files: one is empty, and the other contains some data. We can use `if` to print the message "empty" *if* the file is empty: + +``` +$ ls +datafile  emptyfile +$ if [ ! -s datafile ] ; then echo "empty" ; fi +$ if [ ! -s emptyfile ] ; then echo "empty" ; fi +empty +``` + +We can combine this with for to examine a list of log files to delete the empty files for us: + +``` +$ ls -l +total 20 +-rw-rw-r--. 1 jhall jhall 2 Jul  1 01:02 log.1 +-rw-rw-r--. 1 jhall jhall 2 Jul  2 01:02 log.2 +-rw-rw-r--. 1 jhall jhall 2 Jul  3 01:02 log.3 +-rw-rw-r--. 1 jhall jhall 0 Jul  4 01:02 log.4 +-rw-rw-r--. 1 jhall jhall 2 Jul  5 01:02 log.5 +-rw-rw-r--. 1 jhall jhall 0 Jul  6 01:02 log.6 +-rw-rw-r--. 1 jhall jhall 2 Jul  7 01:02 log.7 +$ for f in log.* ; do if [ ! -s $f ] ; then rm -v $f ; fi ; done +removed 'log.4' +removed 'log.6' +$ ls -l +total 20 +-rw-rw-r--. 1 jhall jhall 2 Jul  1 01:02 log.1 +-rw-rw-r--. 1 jhall jhall 2 Jul  2 01:02 log.2 +-rw-rw-r--. 1 jhall jhall 2 Jul  3 01:02 log.3 +-rw-rw-r--. 1 jhall jhall 2 Jul  5 01:02 log.5 +-rw-rw-r--. 1 jhall jhall 2 Jul  7 01:02 log.7 +``` + +Using the `if` command can add some intelligence to scripts, to perform actions only when needed. I often use `if` in scripts when I need to test *if* a file does or does not exist on my system, or *if* the entry the script is examining is a file or directory. Using `if` allows my script to take different actions as needed. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/use-bash-automate-tasks-linux + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/bash_command_line.png diff --git a/sources/tech/20220726 How To Change GRUB Theme In Linux.md b/sources/tech/20220726 How To Change GRUB Theme In Linux.md new file mode 100644 index 0000000000..1ed6a50c75 --- /dev/null +++ b/sources/tech/20220726 How To Change GRUB Theme In Linux.md @@ -0,0 +1,356 @@ +[#]: subject: "How To Change GRUB Theme In Linux" +[#]: via: "https://ostechnix.com/change-grub-theme-in-linux/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: "robsean" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How To Change GRUB Theme In Linux +====== +Install And Apply Modern, Beautiful GRUB Themes In Linux + +**GRUB**, stands for **GR**and **U**nified **B**ootloader, is default boot loader for most Linux operating systems. GRUB boot loader is the first program that runs when the computer starts. As you may noticed, the default theme of the GRUB menu is bland. It's just a black background with white characters on it. Some of you may not like the default GRUB theme. In this tutorial, I will demonstrate how to **change GRUB theme** or apply gorgeous themes in-order to make your GRUB menu more beautiful and elegant in Linux. + +A few years ago, we published a guide that explained how to **[configure GRUB2 bootloader settings][1]** in Ubuntu. In that article, we showed you how to change the GRUB background. + +But, changing background is not the real customization. In this guide, we are going to change not only the wallpaper but also the fonts, theme and the overall design of GRUB. + +**Disclaimer:** Installing GRUB themes may break you system. I strongly recommend you to try and test a theme in a VM and see if it works without any issues. And then install the theme in the actual system. + +### Introduction + +There are many Community-developed GRUB themes available on Internet. However, they are all scattered across different websites. So finding a good GRUB theme might be little difficult and time-consuming. + +One of the notable contributor for GRUB themes is **Pling** website. But the majority of the themes in Pling are either very basic or outdated. + +Fortunately, I've come across a project called **"Gorgeous GRUB"**, a place for finding various elegant GRUB themes. Trust me, the author has put a good effort to collect these themes and you will definitely like one of them. + +### Gorgeous GRUB - A Place To Find Decent GRUB Themes + +**Gorgeous GRUB** is a collection of decent GRUB community themes created by various users. The developer of this project has hand-picked beautiful GRUB themes from **Pling**, **/r/unixporn** and many other forums and put them all together to make it easy for the users to browse them. + +As stated already, so many themes in Pling are just crappy and outdated. The author of Gorgeous GRUB repository dug through the entire GRUB section of Pling, and a few other forums and put together all good GRUB theme in one place. + +FYI, these aren't some low-quality, poorly made themes. They had a fair amount of effort put into them, with custom backgrounds, fonts, and colours. + +Please note that Gorgeous GRUB isn't an application to install your favorite GRUB theme. It is just a curated list of decent working GRUB themes. + +This project is hosted in GitHub. If you've any cool GRUB theme, you can add it to the Gorgeous GRUB theme list as well. + +### How To Change GRUB Theme + +Applying or changing GRUB themes is not that difficult. + +Go to the **[Gorgeous GRUB GitHub page][2]** and click on the title of any theme you want to apply. And then you will be taken to the theme's actual home page. Some themes are hosted in **Pling** and some are hosted in **GitHub**. We will see how to install GRUB themes from Pling and GitHub. + +First, let use see how to apply **Descent** theme, which is hosted in Pling. + +#### 1. Install GRUB Theme From Pling + +If the themes are hosted in Pling site, follow these instructions. + +From the theme home page, click the **Files** tab. You will find this tab right under the image preview. Click on the file link to download it. + +![Download GRUB Theme From Pling][3] + +Go to the download location and extract the archive file. + +``` +$ tar xzf 173860-20150926\ descent.tar.gz +``` + +The contents of the archive will be extracted to a directory called **"descent"** in the current working directory. + +Copy the "descent" directory to `/boot/grub/themes/` directory using the following command. + +``` +$ sudo cp -r descent/ /boot/grub/themes/ +``` + +If the "themes" directory is not available, just create it. + +``` +$ sudo mkdir /boot/grub/themes +``` + +And assign proper ownership to the "themes" directory. + +``` +$ sudo chown $USER /boot/grub/themes/ +``` + +And then copy the contents of the "descent" directory to "themes" directory as shown above. + +You should now have a folder in the themes directory named after the theme. + +``` +$ ls /boot/grub/themes/ +descent +``` + +And that theme folder (i.e. descent) should include the `theme.txt` and any other relevant files (e.g. background image, customization files) that theme came with. + +``` +$ ls /boot/grub/themes/descent/ +background1280x800.png descent_score_14.pf2 menu_ne.png menu_s.png progresshigh_c.png scrollframe_c.png scroll_thumb_n.png +background_original.jpg descent_score_18.pf2 menu_n.png menu_sw.png progresshigh_e.png scrollframe_n.png scroll_thumb_s.png +copyright menu_c.png menu_nw.png menu_w.png progresshigh_w.png scrollframe_s.png select_os.png +descent_logo_bold_18.pf2 menu_e.png menu_se.png progressbar_c.png readme scroll_thumb_c.png theme.txt +``` + +After copying the downloaded theme to `/boot/grub/themes/` directory, edit `/etc/default/grub` file. + +Before any changes, please backup the grub file, just in case: + +``` +$ sudo cp /etc/default/grub /etc/default/grub.bak +``` + +Now edit the file with your preferred editor: + +``` +$ sudo nano /etc/default/grub +``` + +Find the `GRUB_THEME=` line and add the path to the `theme.txt` of the theme you want to use. And also, uncomment the `GRUB_GFXMODE=` line and enter the background image resolution. Usually, the filename of background image contains its resolution (e.g. background1280x800.png). + +``` +[...] +GRUB_THEME=/boot/grub/themes/descent/theme.txt +GRUB_GFXMODE=1280x800 +[...] +``` + +![Enter Theme Txt File Path And Background Image Resolution][4] + +Again, if those lines does not exist, simply add them. Press **CTRL+O** and **CTRL+X** to save the changes and close the file. + +Now, apply the changes to the GRUB using command: + +``` +$ sudo update-grub +``` + +**Sample output:** + +``` +Sourcing file `/etc/default/grub' +Sourcing file `/etc/default/grub.d/init-select.cfg' +Generating grub configuration file ... +Found theme: /boot/grub/themes/descent/theme.txt +Found linux image: /boot/vmlinuz-5.15.0-41-generic +Found initrd image: /boot/initrd.img-5.15.0-41-generic +Found linux image: /boot/vmlinuz-5.15.0-39-generic +Found initrd image: /boot/initrd.img-5.15.0-39-generic +Found memtest86+ image: /boot/memtest86+.elf +Found memtest86+ image: /boot/memtest86+.bin +Warning: os-prober will not be executed to detect other bootable partitions. +Systems on them will not be added to the GRUB boot configuration. +Check GRUB_DISABLE_OS_PROBER documentation entry. +done +``` + +![Update GRUB][5] + +If you're on RPM-based systems (E.g. Fedora), run the following command to update GRUB: + +``` +$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg instead +``` + +Reboot your system. You will be pleased with the updated GRUB theme. If the GRUB menu doesn't appear, power on the system and immediately hit the ESC key until the boot menu appears. + +This is the default GRUB menu in my Ubuntu 22.04 LTS desktop. + +![Ubuntu Default Grub Menu][6] + +And here is the updated GRUB menu with Descent theme. + +![Updated GRUB Menu With Descent Theme][7] + +Cool, yeah? + +##### 1.1. Remove GRUB Theme + +To remove a theme, simply delete the theme folder: + +``` +$ sudo rm -fr /boot/grub/themes/descent/ +``` + +And then edit `/etc/default/grub` file: + +``` +$ sudo nano /etc/default/grub +``` + +Remove the following lines: + +``` +[...] +GRUB_THEME=/boot/grub/themes/descent/theme.txt +GRUB_GFXMODE=1280x800 +[...] +``` + +Save the file and close it. + +Finally, apply the changes to the GRUB and reboot your system: + +``` +$ sudo update-grub +``` + +``` +$ sudo reboot +``` + +#### 2. Install GRUB Themes From GitHub + +If a GRUB theme is hosted in GitHub, it will probably has the installer and uninstaller scripts. Let us take **[Modern GRUB Themes][8]** as an example. It is hosted in GitHub. + +Git clone the project's GitHub repository: + +``` +$ git clone https://github.com/vinceliuice/grub2-themes.git +``` + +Go to the project's folder: + +``` +$ cd grub2-themes/ +``` + +Run the installer script: + +``` +$ sudo ./install.sh +``` + +Select your preferred GRUB theme background (E.g. tela). + +![Choose GRUB Theme Background][9] + +Select icon style: + +![Choose Icon Style][10] + +Select your display resolution. + +![Choose Display Resolution][11] + +Now the chosen GRUB theme will be installed and applied. + +``` +Checking for the existence of themes directory... + + Installing tela color 1080p theme... + + Setting tela as default... + + Updating grub config... + +Sourcing file `/etc/default/grub' +Sourcing file `/etc/default/grub.d/init-select.cfg' +Generating grub configuration file ... +Found theme: /usr/share/grub/themes/tela/theme.txt +Found linux image: /boot/vmlinuz-5.15.0-41-generic +Found initrd image: /boot/initrd.img-5.15.0-41-generic +Found linux image: /boot/vmlinuz-5.15.0-39-generic +Found initrd image: /boot/initrd.img-5.15.0-39-generic +Found memtest86+ image: /boot/memtest86+.elf +Found memtest86+ image: /boot/memtest86+.bin +Warning: os-prober will not be executed to detect other bootable partitions. +Systems on them will not be added to the GRUB boot configuration. +Check GRUB_DISABLE_OS_PROBER documentation entry. +done + + * All done! + + * At the next restart of your computer you will see your new Grub theme: 'tela' +``` + +![Install Tela Modern Grub Theme][12] + +Reboot your system to see the changes. + +![Tela GRUB Theme][13] + +This is one of the pretty GRUB theme ever I've seen. + +You can also explicitly give the name of the theme with screen resolution like below. + +``` +$ sudo ./install.sh -t whitesur -s 1080p +``` + +This will apply a theme called "Whitesur" with 1080p screen resolution. You can mention other resolutions, for example 2k, 4k, ultrawide, ultrawide2k. If you don't mention the resolution, 1080p will be applied by default. + +Install Tela theme to `/boot/grub/themes` folder: + +``` +$ sudo ./install.sh -b -t whitesur +``` + +Reboot your system to see the changes. + +![Whitesur GRUB Theme][14] + +##### 2.1. Remove GRUB Themes + +To remove an installed theme, go to the project's cloned directory: + +``` +$ cd grub2-themes/ +``` + +And, run: + +``` +$ sudo ./install.sh -r -t tela +``` + +Replace "tela" with the name of your installed theme. + +Please note that the installation instructions for each theme might be different. Refer the project's respective GitHub page carefully and install the theme accordingly. + +### Conclusion + +Some people prefer to use stylized Linux distributions. They feel good and took pride in beautifying their Linux distributions. If you're one of them, you can look into the Gorgeous GRUB project to beautify your GRUB menu. + +Got to the Gorgeous GRUB theme site, pick your favorite theme from the list and follow the instructions provided in the respective project's home page to install and apply the GRUB theme. + +**Resource:** + +* [Gorgeous GRUB GitHub Repository][15] + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/change-grub-theme-in-linux/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/configure-grub-2-boot-loader-settings-ubuntu-16-04/ +[2]: https://github.com/jacksaur/Gorgeous-GRUB +[3]: https://ostechnix.com/wp-content/uploads/2022/07/Download-GRUB-Theme-From-Pling.png +[4]: https://ostechnix.com/wp-content/uploads/2022/07/Enter-Theme-Txt-File-Path-And-Background-Image-Resolution.png +[5]: https://ostechnix.com/wp-content/uploads/2022/07/Update-GRUB.png +[6]: https://ostechnix.com/wp-content/uploads/2022/07/Ubuntu-Default-Grub-Menu.png +[7]: https://ostechnix.com/wp-content/uploads/2022/07/Updated-GRUB-Menu.png +[8]: https://github.com/vinceliuice/grub2-themes +[9]: https://ostechnix.com/wp-content/uploads/2022/07/Choose-GRUB-Theme-Background.png +[10]: https://ostechnix.com/wp-content/uploads/2022/07/Choose-Icon-Style.png +[11]: https://ostechnix.com/wp-content/uploads/2022/07/Choose-Display-Resolution.png +[12]: https://ostechnix.com/wp-content/uploads/2022/07/Install-Tela-Modern-Grub-Theme.png +[13]: https://ostechnix.com/wp-content/uploads/2022/07/Tela-GRUB-Theme.png +[14]: https://ostechnix.com/wp-content/uploads/2022/07/Whitesur-GRUB-Theme-1.png +[15]: https://github.com/jacksaur/Gorgeous-GRUB diff --git a/sources/tech/20220726 Shrink PDFs with this Linux tool.md b/sources/tech/20220726 Shrink PDFs with this Linux tool.md new file mode 100644 index 0000000000..76785afd37 --- /dev/null +++ b/sources/tech/20220726 Shrink PDFs with this Linux tool.md @@ -0,0 +1,95 @@ +[#]: subject: "Shrink PDFs with this Linux tool" +[#]: via: "https://opensource.com/article/22/7/shrink-pdfs-minuimus-linux" +[#]: author: "Howard Fosdick https://opensource.com/users/howtech" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Shrink PDFs with this Linux tool +====== +Minuimus is an open source program used to reduce PDF storage space by 10% to 20% without altering the data. + +![Filing cabinet for organization][1] + +Excluding HTML, PDF files are probably the most popular document format on the web. Unfortunately, they're not compact. For example, I like to download free eBooks. A quick glance at my eBook directory shows that its 75 PDF files consume about 500 megabytes. On average, that's over 6.6 MB for each PDF file. + +Couldn't I save some storage space by compressing those files? What if I want to send a bundle of them through email? Or host them for download on a website? The transmission would be faster if these files were made smaller. This article shows a simple way to reduce PDF file size. The benefit is that it shrinks your PDFs transparently without altering the data content in any way. Plus, you can also compact many PDF files with a single command. + +Compare this to the alternatives. You could upload your PDF files to one of the many online file compression websites. Several are free, but you risk the privacy of your documents by uploading them to an unknown website. More importantly, most websites shrink PDFs by tampering with the images they contain. They either change their resolution or their sizes. So you trade lower image quality to get smaller PDF files. That's the same trade-off you face using interactive apps like LibreOffice, or Ghostscript line commands like`gs` and `ps2pdf`. The technique we'll illustrate in this article compacts PDFs without altering either the images they contain or their data content. And you can reduce many PDFs with a single line command. Let's get started. + +### Identify and delete big unused PDFs on Linux + +Before you spend time and effort compacting PDF files, identify your largest ones and delete those you don't need. This command lists the 50 biggest PDFs in its directory tree, ordered by descending size: + +``` +$ find  -type f  -exec  du -Sh {} +  |  grep .pdf | sort -rh  |  head -n 50 +``` + +From the output, you can easily identify and eliminate duplicates. You can also delete obsolete files. Getting rid of these space hogs yields big benefits. Now you know which PDFs are the high payback candidates for the reduction technique we'll now cover. + +### Transparently compact PDFs + +We'll use the open source [Minuimus][2] program to compact PDFs. Minuimus is a generalized command-line utility that performs all sorts of useful file conversions and compressions. To shrink PDFs, Minuimus unloads and then rebuilds them, gaining numerous efficiencies along the way. It does this transparently, without altering your data in any way. + +To use Minuimus, download its [zip file.][3] Then install it as its documentation explains, with these commands: + +``` +$ make deps      # Installs all required supporting packages +$ make all       # Compiles helper binaries +$ make install   # Copies all needed files to /usr/bin +``` + +Minuimus is a Perl script, so you run it like this: + +``` +$ minuimus.pl  input_file.pdf    # replaces the input file with compressed output +``` + +When it runs, Minuimus immediately makes a backup of your original input file. It only replaces the input file with its compacted version after it fully verifies data accuracy by comparing before and after bitmaps representing the data. + +A big benefit to Minuimus is that it validates any PDF file it works on. I've found that it gives intelligent, helpful error messages if it encounters any problems. For example, on one of my computers, Minuimus said that it couldn't properly invoke a utility it uses called `leanify`. Yet it still shrunk the PDFs and ran to successful completion. + +Here's how to compact many files in one command. This compresses all the PDF files in a directory: + +``` +$ minuimus.pl *.pdf +``` + +If you have lots of PDFs to convert, Minuimus might process for a while. So if you're converting hundreds of PDFs, for example, you might want to run Minuimus as a background job. Schedule it for off-hours through your GUI scheduler or as a Cron job. + +Be sure to redirect its output from the terminal to files so that you can easily review it later: + +``` +$ minuimus.pl *.pdf  1>output_messages.txt  2>error_messages.txt +``` + +### How much space will you reclaim? + +Unfortunately, there's no way to predict how much space Minuimus can save. That's because PDFs contain anything from text to images of all different kinds. They vary enormously. I ran Minuimus on my download directory of PDF books. The directory contained 75 PDFs consuming about 500 MB. Minuimus reduced it by about 11%, to about 445 MB. That's impressive for an algorithm that doesn't change the data. + +Across a large group of PDFs, size reduction of 10% to 20% appears common. The biggest files often shrink the most. Processing a collection of big PDFs often reclaims much more space than processing many small PDFs. Some PDF files show really dramatic space savings. That's because some applications create absolutely hideous PDFs. I call those files "PDF monsters." You can slay them with a single Minuimus command. + +For example, while writing this article, Minuimus knocked an 85 megabyte PDF down to 32 meg. That's just 38% of its original size. The program slimmed several other monsters by 50%, recovering tens of megabytes. This is why I began this article by introducing a command to list your biggest PDF files. If Minuimus identifies a few monsters you can slay, you can reclaim major disk space for free. + +### Shrink PDFs with Minuimus + +PDF files are useful and ubiquitous. But they often consume a good deal of storage space. Minuimus makes it easy to reduce PDF storage space by 10% to 20% without altering the data. Perhaps its biggest benefit is identifying and transforming malformed "PDF monsters" into smaller, more manageable files. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/shrink-pdfs-minuimus-linux + +作者:[Howard Fosdick][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/howtech +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/files_documents_organize_letter.png +[2]: http://birds-are-nice.me/software/minuimus.html +[3]: http://birds-are-nice.me/software/minuimus.zip diff --git a/sources/tech/20220727 6 Tips and Tools to Enhance Your Flatpak Experience in Linux.md b/sources/tech/20220727 6 Tips and Tools to Enhance Your Flatpak Experience in Linux.md new file mode 100644 index 0000000000..1363de2605 --- /dev/null +++ b/sources/tech/20220727 6 Tips and Tools to Enhance Your Flatpak Experience in Linux.md @@ -0,0 +1,192 @@ +[#]: subject: "6 Tips and Tools to Enhance Your Flatpak Experience in Linux" +[#]: via: "https://itsfoss.com/flatpak-tips-tweaks/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +6 Tips and Tools to Enhance Your Flatpak Experience in Linux +====== + +Slowly and steadily, [Flatpak][1] has a growing acceptance in the desktop Linux world. + +It is well integrated into Fedora and many other distributions like Linux Mint, elementary, Solus, etc. prefer it over Ubuntu’s Snap. + +If you love using Flatpak applications, let me share a few tips, tools, and tweaks to make your Flatpak experience better and smoother. + +### 1. Use Flathub to explore new Flatpak applications + +This one goes without saying. + +If you are looking for new applications in Flatpak packaging, browse the [Flathub website][2]. + +This is the official website from the Flatpak project and it lists and distributes a huge number of Flatpak applications. + +You can look for recommended apps in the “Editor’s choice” section, recently updated apps, new apps and popular apps. + +![Flathub website homepage][3] + +You can have the application screenshots, description, developer information, and installation instructions on the individual application webpages. + +**Bonus tip**: Make sure to add the Flathub repo in your system. Otherwise, you’ll see [“no remote refs found similar to flathub][4]” error while installing applications from Flathub. + +``` +flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +``` + +### 2. Use Flatline extension to install Flatpak from the browser + +The Flathub website provides command line instructions to install the application. + +There is also an Install button but it doesn’t install the application for you. It downloads a .flatpakref file and then you’ll have to use the command line to install from the flatpakref file. + +![The install button doesn’t provide a quick installation by default][5] + +If you have to use the command line ultimately, it doesn’t make sense to download the fltapakref file. + +You can make things better by using [Flatline][6]. It’s a Mozilla Firefox extension and it makes that Install button useful by converting it into appstream link. One more reason to use Firefox? + +![Flatline browser extension][7] + +This way, when you click on the Install button for any application on the Flathub website, it will ask you to open the link in an XDG application like the Software Center. + +![You can choose to install Flatpak package in software center][8] + +This also means that you should have the Fltapak support integrated into the software center. + +### 3. Integrate Flatpak with the software center (for GNOME) + +Apart from Fedora, a handful of distributions provide Flatpak support by default. You can find and install Flatpak apps from the graphical software manager. + +Not all distros have that. If you are running some other distribution with GNOME desktop environment, you can enable Flatpak support in the software center. + +``` +sudo apt install gnome-software-plugin-flatpak +``` + +Note that Ubuntu has switched to Snap for the software center. The above command will also install a deb version of GNOME Software Center. You’ll have two software center applications in the system. + +If you enable the Flatpak support in the software, you can couple it with Flatline and install Fltapak apps from the web browser directly. + +Recently, there was an independent, standalone Flatpak app store called [Souk][9]. However, it is no longer actively developed. + +![Souk GUI software manager for Flatpak][10] + +There is also [Bauh][11] that can manage Flatpak, Snap and AppImages from a single interface. + +### 4. Manage Flatpak permissions graphically With Flatseal + +[Flatseal][12] is a graphical utility to review and modify your Flatpak applications’ permissions. This makes things a lot easier than going through the commands. + +![Control permissions of individual Flatpak apps][13] + +It lists all the installed Flatpak applications and shows what kind of permissions the selected application has. + +You may enable or disable the permissions. Please bear in mind that disabling some permissions might impact the normal functioning of the application. You should know what you are doing. + +You can install Flatseal using Flatpak, of course. + +``` +flatpak install flathub com.github.tchx84.Flatseal +``` + +### 5. Apply GTK system themes to Flatpak applications + +You might have already noticed that most Flatpak apps don’t change their appearance as per the current system theme. + +Why? Because Flatpak apps run inside a ‘container’ and don’t have access to the host filesystem, network, or physical devices. + +You can choose to install themes as Flatpak to solve this issue. However, your favorite theme might not be available in Flatpak format. + +Alternatively, you can make some manual effort and force the Flatpak applications to use a given theme. Here’s how to do that. + +**Step 1**: Give Flatpak access to the folder where theme files are kept: + +``` +sudo flatpak override --filesystem=$HOME/.themes +``` + +**Step 2**: List all the themes available in ~/.themes location and then provide the folder name of the selected theme to Flatpak: + +``` +sudo flatpak override --env=GTK_THEME=chosen-theme +``` + +![flatpak adwaita][14] + +![flatpak canta dark][15] + +If you change the system theme later, you can change the theme for Flatpak in the same manner. + +You can revert the changes using this command: + +``` +sudo flatpak override --reset +``` + +Read more about [applying GTK theme to Flatpak apps in this article][16]. + +### 6. Update Flatpak apps and clean them + +This is more for Flatpak unfriendly distributions like Ubuntu. If your distro doesn’t come baked in with Flatpak and you don’t have it integrated with the Software center, your installed Flatpak apps won’t be updated with system updates. + +You can update all your installed Flatpak apps simultaneously with: + +``` +flatpak update +``` + +![Update Flatpak applications][17] + +Not only it will update the applications, but it will also [remove any unused runtimes][18]. You**don’t need to run this command manually anymore**. + +``` +flatpak uninstall –unused +``` + +**Bonus tip**: While removing a Flatpak application, you can make it remove personal application data that are usually left behind in the home directory. + +``` +flatpak uninstall --delete-data package_name +``` + +### Conclusion + +I deliberately didn’t add [more Flatpak command tips][19] though I was tempted to. Probably there are a few more applications and tweaks for Flatpak packages. I shared my favorite ones. + +If you know any good tips related to Flatpak packages, do share them with us in the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/flatpak-tips-tweaks/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/what-is-flatpak/ +[2]: https://flathub.org/home +[3]: https://itsfoss.com/wp-content/uploads/2022/07/flathub-website.png +[4]: https://itsfoss.com/no-remote-ref-found-flatpak/ +[5]: https://itsfoss.com/wp-content/uploads/2022/07/apps-on-flathub.png +[6]: https://addons.mozilla.org/en-US/firefox/addon/flatline-flatpak/ +[7]: https://itsfoss.com/wp-content/uploads/2022/07/flatline-extension.png +[8]: https://itsfoss.com/wp-content/uploads/2022/07/installing-flatpak-from-web-browser.png +[9]: https://gitlab.gnome.org/haecker-felix/souk +[10]: https://itsfoss.com/wp-content/uploads/2022/07/souk-app-details.png +[11]: https://itsfoss.com/bauh-package-manager/ +[12]: https://flathub.org/apps/details/com.github.tchx84.Flatseal +[13]: https://itsfoss.com/wp-content/uploads/2021/11/flatpak-permission-control-flatseal.png +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/11/flatpak-adwaita.webp?ssl=1 +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/11/flatpak-canta-dark.webp?ssl=1 +[16]: https://itsfoss.com/flatpak-app-apply-theme/ +[17]: https://itsfoss.com/wp-content/uploads/2022/07/update-flatpak-applications.png +[18]: https://blogs.gnome.org/mwleeds/2021/01/11/cleaning-up-unused-flatpak-runtimes/ +[19]: https://docs.flatpak.org/en/latest/tips-and-tricks.html diff --git a/sources/tech/20220727 An Introduction to Sentiment Analysis Using NLP and ML.md b/sources/tech/20220727 An Introduction to Sentiment Analysis Using NLP and ML.md new file mode 100644 index 0000000000..e2ab6ad78c --- /dev/null +++ b/sources/tech/20220727 An Introduction to Sentiment Analysis Using NLP and ML.md @@ -0,0 +1,283 @@ +[#]: subject: "An Introduction to Sentiment Analysis Using NLP and ML" +[#]: via: "https://www.opensourceforu.com/2022/07/an-introduction-to-sentiment-analysis-using-nlp-and-ml/" +[#]: author: "Mir H.S. Quadri https://www.opensourceforu.com/author/shah-quadri/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +An Introduction to Sentiment Analysis Using NLP and ML +====== +Would you like to understand how Google uses NLP and ML for creating brilliant apps such as Google Translate? Would you like to build the ‘next big thing’ in the natural language understanding space? Then this article is for you. It introduces you to sentiment analysis of text based data with a case study, which will help you get started with building your own language understanding models. + +![An-Introduction-to-Sentiment-Analysis-Using-NLP-and-ML][1] + +We live in the age of Big Data. There is no shortage of text based data. If anything, one can argue that we have too much of it. Everything, from tweets on Twitter to comments on YouTube to customer reviews on Amazon, can be considered as text based data. As human beings, it’s easy for us to read a piece of text in a language that we are familiar with, and understand what emotions are being expressed and what specifications are being shared. However, it’s not as simple for a machine such as a computer to do the same. + +### Natural language understanding + +While computers have been able to deconstruct and analyse syntactic rules of a language for decades, with software such as MS Word being able to recognise spelling and punctuation errors, semantic understanding of a language is a whole different ball game. This is where natural language processing (NLP) and machine learning come into the picture. For decades, researchers have been working hard to make machines that are able to understand what is being expressed and the underlying emotions that are being exhibited in a human language. Although the techniques for creating such a technology have been known for quite a while, i.e., smart algorithms that can learn from data, what was lacking was the real-time ‘data’ required to train the algorithms. Additionally, there was an element of computational complexity that required smarter devices with faster processing speed to be able to analyse a piece of text in real-time and share the results instantly. + +In 2022, we have the data, the speed, and the algorithms to finally make this happen. The past decade (2010 onwards) has been monumental for natural language processing. With the advent of cloud technology, coupled with Big Data frameworks, scientists have made immense strides in achieving ‘natural language understanding’. This has been achieved by using natural language processing in conjunction with smart machine learning algorithms that can work with both structured and unstructured data. + +### Sentiment analysis of text + +In the field of natural language processing of textual data, sentiment analysis is the process of understanding the sentiments being expressed in a piece of text. As humans, we communicate both the facts as well as our emotions relating to it by the way we structure a sentence and the words that we use. This is a complex process that, albeit seems simple to us, is not as easy for a computer to deconstruct and analyse. Sentiment analysis of text requires using sophisticated natural language processing techniques coupled with advanced machine learning algorithms that have the ability to learn from structured as well as unstructured data. + +There is huge economic value in solving the problem of sentiment analysis in text. Companies that sell products hugely depend on the customer reviews. If there are tools and mechanisms in place by which they are able to analyse the customer’s sentiments, the sellers can get a granular look at the issues that their product is facing. This removes a lot of the human labour involved in tasks such as this, and also optimises the process for a myriad of other features such as product recommendations, increasing user acquisition while decreasing user attrition rate. For social media companies, natural language understanding is crucial in identifying posts with abuse, hate-speech, inciteful content and spam. + +### Types of sentiment analysis for text based data + +Sentiment analysis of text is a broad based term that covers many different techniques used for specific types of sentiment analysis. In general, it focuses on understanding the polarity of a given piece of text, i.e., positivity, negativity or neutrality conveyed in the text. However, there can be more depth to understanding the sentiments conveyed in the text. + +*Graded sentiment analysis:* Graded sentiment analysis takes the generalised search for polarity in text to a deeper level. For example, let us say A and B are two sample texts. It is possible that both convey a negative sentiment. But it is also possible that A is more negative than B. In such a case, graded sentiment analysis can be used to not only understand the polarity of a piece of text but also grade it for the level of polarity it holds, such as: + +* Very negative +* Negative +* Somewhat negative +* Somewhat neutral +* Neutral +* Very neutral +* Somewhat positive +* Positive +* Very positive + +*Emotion and sentiment analysis:* In some cases, understanding the polarity of a text is not enough. You may also like to understand the specific emotions that are being conveyed in it. For instance, a text can be negative but, specifically, it may express more sadness than anger or vice versa. This can be crucial when trying to detect hate speech on social media or to understand how your product made your customer feel on an e-commerce platform. + +Emotion detection in sentiment analysis can be done to understand emotions expressed in text such as: + +* Anger (Negative) +* Sadness (Negative) +* Joy (Positive) +* Happiness (Positive) +* Gratitude (Neutral) +* Honesty (Neutral + +*Aspect based sentiment analysis:* In certain cases, it is not enough to understand the polarity and emotion in a piece of text; we also require some context in the form of aspects or features. For instance, it isn’t enough for a seller selling a washing machine on Amazon to know whether a user review contained negativity and anger. The seller would instead like to know the specific features or aspects of the product that actually caused the anger or frustration in the customer. Was it the new ‘timer system’ or the ‘product size’ or the ‘product design’ that caused the issue for the customer? These are all aspects of the washing machine, and if the computer is able to understand not just the sentiments of the customer but also the reasons for the sentiment, this can provide the seller with a lot more context. Amazon reviews are one of many use cases for aspect based sentiment analysis. + +*Multilingual sentiment analysis:* Things can get very complicated very fast for machine learning algorithms when you introduce more than one language into the mix. Every language has its own set of rules and methods of expression. There may be overlap in certain regards but every language brings its own unique baggage. For instance, both Spanish and French have their roots in Latin. However, sentence construction and the spelling of words have their own methods and rules. How is a computer supposed to understand the sentiments of a text when a bilingual user uses some words in French and other words in Spanish? In India we tend to write ‘Hindi’ and ‘Urdu’ using the English alphabet. From texting to making comments on YouTube, this is a very common practice in India. To understand such a piece of text can be extremely challenging. This is where multilingual sentiment analysis comes in. Breakthroughs are being made every day but there is a lot that still needs to be done in this particular field. + +### How to use NLP and ML for sentiment analysis of text based data + +Now that we have a clear understanding of what NLP is and why it is a crucial field of research in AI and ML, we shall now shift our focus to discussing how you as a beginner in NLP and ML can get started by building your own language understanding models. + +In sentiment analysis using AI, building a language understanding model requires three things: + +1. A specific problem to solve +2. A relevant data set +3. An appropriate machine learning algorithm + +In this article, we will use a case study to show how you can get started with NLP and ML. The example used below is super simple and easy to follow. But before we get started with the case study, let me introduce you to the Multinomial Naïve Bayes algorithm that we shall be using to build our machine learning model. + +### The Multinomial Naïve Bayes algorithm + +The Naïve Bayes algorithm is a probabilistic classifier used for predictive analysis. It is simpler as compared to other algorithms and has been known to have a higher success rate. Naïve Bayes makes the assumption that all input attributes are conditionally independent. It is highly scalable and works on the principle of learning by doing. + +It takes preprocessed data with the extracted features required as input for training. Once trained, it can be used to provide polarity of a given input text, i.e., if the text is positive, negative or neutral. + +Bayes theorem states that the posterior probability P(A|B) is calculated from P(A), P(B), and P(B|A). Naive Bayes classifiers assume that the effect of the value of a predictor (y) on a given class (X) is independent of the values of other predictors. What makes Naïve Bayes distinct from the more traditional Bayes Belief Networks (BBN) is that it assumes complete conditional independence of all input attributes. The Bayes theorem is given as: + +![Equation][2] + +where A and B are two events that are independent of each other and make an equal contribution to the outcome. + +If we generalise the Naïve Bayes algorithm, we get: + +![][3] + +where y is the class variable and X is the feature vector of size ‘n’, i.e., X = (x1, x2, x3, …, xn). + +In sentiment analysis, for certain cases, finding the word frequency or discrete count can be beneficial in increasing the accuracy of the machine learning model. In such cases, Multinomial Naïve Bayes, a variant of the standard Naïve Bayes can be used. In MNB, the assumption is that the distribution of each feature, i.e., P(fi|C), is a multinomial distribution. + +Multinomial distribution is defined as: + +![][4] + +where n is the total number of events, n1 … nx are the number of outcomes for each event, and P1 … Px are the probabilities of the occurrence of each event. + +### Case study: Sentiment analysis of statements made in ‘finance’ related news using the Multinomial Naïve Bayes algorithm + +For the purpose of this case study, I have made use of a data set that is freely available on Kaggle. This is a simple data set that is extremely ideal for beginners who are just getting started with sentiment analysis. It contains two features, namely, the sentences and their corresponding sentiments. The sentiment for each sentence can either be positive, negative or neutral. This data set contains 5322 unique sentences, which are plenty for training and testing our algorithm. + +You can download the data set for free from *https://www.kaggle.com/code/turankeskin/financialsenti/data*. Now place it in the same folder as your notebook or Python file to make things easier. + +*Step 1:* We will start by importing the Python libraries necessary for this project: + +``` +import numpy as np +import pandas as pd +import seaborn as sns +import matplotlib.pyplot as plt +import re +import string +import nltk + +nltk.download(‘stopwords’) +nltk.download(‘punkt’) +nltk.download(‘wordnet’) +nltk.download(‘averaged_perceptron_tagger’) +nltk.download(‘maxent_ne_chunker’) +nltk.download(‘words’) + +from wordcloud import WordCloud + +from nltk.tokenize import sent_tokenize, word_tokenize +from nltk.corpus import stopwords +from nltk.stem import WordNetLemmatizer, PorterStemmer +from nltk import pos_tag, ne_chunk +from nltk.chunk import tree2conlltags + +import warnings +warnings.filterwarnings(“ignore”) +``` + +*Step 2:* Using pandas, we will read the *csv* file and create an instance: + +``` +Data = pd.read_csv(“/kaggle/input/financial-sentiment-analysis/data.csv”) +df = data.copy() +``` + +*Step 3:* To get an idea of how many positive, negative and neutral sentences we have in the data set, we are going to plot the data into a bar chart: + +``` +print(df[“Sentiment”].value_counts()) +sns.countplot(x=”Sentiment”,data=df); +``` + +Figure 1 shows the distribution of positive, negative and neutral sentences in the data set. + +![Figure 1: Distribution of positive, negative and neutral sentences in the data set][5] + +*Step 4:* Next, we will start with cleaning and pre-processing the text before applying the MNB algorithm to boost the accuracy and precision of the training data: + +``` +stop_words = set(stopwords.words(“english”)) +df[“Sentence”] = df[“Sentence”].str.replace(“\d”,””) +def cleaner(data): + + # Tokens + tokens = word_tokenize(str(data).replace(“’”, “”).lower()) + + # Remove Puncs + without_punc = [w for w in tokens if w.isalpha()] + + # Stopwords + without_sw = [t for t in without_punc if t not in stop_words] + + # Lemmatize + text_len = [WordNetLemmatizer().lemmatize(t) for t in without_sw] + # Stem + text_cleaned = [PorterStemmer().stem(w) for w in text_len] + + return “ “.join(text_cleaned) +df[“Sentence”] = df[“Sentence”].apply(cleaner) +``` + +*Step 5:* Now we need to filter out the rare words that are used in the sentences. + +``` +rare_words = pd.Series(“ “.join(df[“Sentence”]).split()).value_counts() +rare_words = rare_words[rare_words <= 2] + +df[“Sentence”] = df[“Sentence”].apply(lambda x: “ “.join([i for i in x.split() if i not in rare_words.index])) +``` + +*Step 6:* As a next step, we can generate a word cloud to see the most commonly occurring words in the text. This is an option step and more for our own understanding of the data set than anything else. Figure 2 shows the word cloud generated as a result of the code in Step 6. + +![Figure 2: Word cloud showing 500 most commonly used terms in the data set][6] + +``` +plt.figure(figsize=(16,12)) +wordcloud = WordCloud(background_color=”black”,max_words=500, width=1500, height=1000).generate(‘ ‘.join(df[‘Sentence’])) +plt.imshow(wordcloud, interpolation=’bilinear’) +plt.axis(“off”) +plt.show() +``` + +*Step 7:* Before we execute the algorithm, we need to divide the data set into two parts. One part will be used for training the algorithm and the other for testing it. + +``` +from sklearn.model_selection import train_test_split +from sklearn.metrics import confusion_matrix,classification_report,accuracy_score +from sklearn.naive_bayes import MultinomialNB + +X = df[“Sentence”] +y = df[“Target”] + +X_train,X_test,y_train,y_test = train_test_split(X,y, test_size = 0.25,random_state= 42,stratify=y) +``` + +*Step 8:* Finally, we will execute the Multinomial Naïve Bayes algorithm on the training data: + +``` +nb_model = MultinomialNB() +nb_model.fit(X_train_count,y_train) +``` + +*Step 9:* Let us evaluate the performance of the trained MNB algorithm using the test data: + +``` +nb_pred = nb_model.predict(X_test_count) +nb_train_pred = nb_model.predict(X_train_count) +print(“X Test”) +print(classification_report(y_test,nb_pred)) +print(“X Train”) +print(classification_report(y_train,nb_train_pred)) +``` + +The output of the code above has been shown in Figure 3. We have successfully trained and tested the Multinomial Naïve Bayes algorithm on the data set, which can now predict the sentiment of a statement from financial news with 80 per cent accuracy. + +![Figure 3: Results from testing the trained MNB algorithm][7] + +*Step 10:*We can visualise these results in the form of a heat map for more clarity: + +``` +plt.figure(figsize=(8,8)) +sns.heatmap(confusion_matrix(y_test,nb_pred),annot = True,fmt = “d”) +``` + +Figure 4 shows the results of the MNB algorithm in the form of a heat map. + +![Figure 4: MNB algorithm accuracy for data set][8] + +*Step 11:* We can also visualise these results using a precision-recall curve: + +``` +from yellowbrick.classifier import PrecisionRecallCurve +viz = PrecisionRecallCurve(MultinomialNB(), + classes=nb_model.classes_, + per_class=True, + cmap=”Set1”) +viz.fit(X_train_count,y_train) +viz.score(X_test_count, y_test) +viz.show(); +``` + +Figure 5 shows the precision-recall curve of the MNB algorithm. + +![Figure 5: Precision-recall curve of the MNB algorithm][9] + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/07/an-introduction-to-sentiment-analysis-using-nlp-and-ml/ + +作者:[Mir H.S. Quadri][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/shah-quadri/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/06/An-Introduction-to-Sentiment-Analysis-Using-NLP-and-ML.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Equation.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Equation-2-3.jpg +[4]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Equation-3.jpg +[5]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-1-Distribution-of-positive-negative-and-neutral-sentences-in-the-data-set-3.jpg +[6]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-2-Word-cloud-showing-500-most-commonly-used-terms-in-the-data-set.jpg +[7]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-3-Results-from-testing-the-trained-MNB-algorithm.jpg +[8]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-4-MNB-algorithm-accuracy-for-data-set.jpg +[9]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-5-Precision-recall-curve-of-the-MNB-algorithm.jpg diff --git a/sources/tech/20220727 How I manage files from the Linux command line.md b/sources/tech/20220727 How I manage files from the Linux command line.md new file mode 100644 index 0000000000..27f076ba08 --- /dev/null +++ b/sources/tech/20220727 How I manage files from the Linux command line.md @@ -0,0 +1,191 @@ +[#]: subject: "How I manage files from the Linux command line" +[#]: via: "https://opensource.com/article/22/7/manage-files-linux-command-line" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How I manage files from the Linux command line +====== +If you prefer to interact with your system through the terminal, check out my favorite Linux commands for managing files. + +![Files in a folder][1] + +Managing files in a graphical desktop like GNOME or KDE is an exercise in point-and-click. To move a file into a folder, you click and drag the icon to its new home. To remove a file, you drag it into the “Trash” icon. The graphical interface makes desktop computing easy to use. + +But we don't always interact with Linux systems with a graphical interface. If you work on a server, you likely need to use the command line to get around. Even desktop users like me might prefer to interact with their system through a terminal and command line. I tend to rely on a few commands to manage my files from the command line: + +### List files with Linux ls + +``` +ls +``` + +For anyone who uses the command line, you can't get far without seeing what's there. The [ls command][2] lists the contents of a directory. For example, to look at what's in a web server's document root in `/var/www/html`, you can type: + +``` +ls /var/www/html +``` + +Most of the time, I use `ls` to look at the directory I'm in. To do that, just type `ls` to list everything. For example, when I'm in the root directory of my web project, I might see this: + +``` +$ ls +about fontawesome fonts index.php styles +docs fontawesome.zip images prism +``` + +The `ls` command has about 60 command line options that can list files and directories in all kinds of ways. One useful option is `-l` to provide a long or detailed listing, including permissions, file size, and owner: + +``` +$ ls -l + +total 6252 +drwxrwxr-x. 2 jhall jhall 4096 Jun 22 16:18 about +drwxr-xr-x. 2 jhall jhall 4096 Jun 25 16:35 docs +drwxr-xr-x. 2 jhall jhall 4096 Jun 7 00:00 fontawesome +-rw-r--r--. 1 jhall jhall 6365962 Jun 2 16:26 fontawesome.zip +drwxrwxr-x. 2 jhall jhall 4096 Jun 22 16:17 fonts +drwxr-xr-x. 2 jhall jhall 4096 Jun 25 13:03 images +-rw-rw-r--. 1 jhall jhall 327 Jun 22 16:38 index.php +drwxrwxr-x. 2 jhall jhall 4096 Jun 22 16:18 prism +drwxrwxr-x. 2 jhall jhall 4096 Jun 22 16:17 styles +``` + +File sizes are shown in bytes, which may not be useful if you are looking at very large files. To see file sizes in a format that is helpful to humans, add the `-h` or `--human-readable` option to print sizes with `G` for Gigabyte, `M` for Megabyte, and `K` for Kilobyte: + +``` +$ ls -l --human-readable +total 6.2M +drwxrwxr-x. 2 jhall jhall 4.0K Jun 22 16:18 about +drwxr-xr-x. 2 jhall jhall 4.0K Jun 25 16:35 docs +drwxr-xr-x. 2 jhall jhall 4.0K Jun 7 00:00 fontawesome +-rw-r--r--. 1 jhall jhall 6.1M Jun 2 16:26 fontawesome.zip +drwxrwxr-x. 2 jhall jhall 4.0K Jun 22 16:17 fonts +drwxr-xr-x. 2 jhall jhall 4.0K Jun 25 13:03 images +-rw-rw-r--. 1 jhall jhall 327 Jun 22 16:38 index.php +drwxrwxr-x. 2 jhall jhall 4.0K Jun 22 16:18 prism +drwxrwxr-x. 2 jhall jhall 4.0K Jun 22 16:17 styles +``` + +Rather than `6365962` for the file size, `ls` now displays the zip file as `6.1M` or just over 6 MB in size. + +### View files with Linux cat, head, and tail + +``` +cat +``` + +``` +head +``` + +``` +tail +``` + +The next step after listing files is examining what each file contains. For that, I use a few commands. Starting with the `docs` directory on my web server: + +``` +$ ls docs +chapter1.tex chapter4.tex chapter7.tex lorem.txt +chapter2.tex chapter5.tex chapter8.tex readme.txt +chapter3.tex chapter6.tex chapter9.tex workbook.tex +``` + +What are these files? Fortunately, this directory has a `readme.txt` file, which I might assume contains a description of the files in this project directory. If the file is not too long, I can view it using the `cat` command: + +``` +$ cat docs/readme.txt +This is the workbook for the C programming self-paced +video series. The main file is the workbook.tex file, +which includes the other chapters. +``` + +If a file is very long, I can look at just the first few lines using the `head` command. This displays a certain number of lines from the file, usually the first 10 lines unless you tell `head` otherwise with the `-n` or `--lines` option. For example, these two versions of the `head` command examine the first three lines of the `lorem.txt` file: + +``` +$ head -n 3 docs/lorem.txt +Lorem ipsum dolor sit amet, consectetur adipiscing +elit. Nullam at ligula eget nunc feugiat pharetra. Nullam +nec vulputate augue. Suspendisse tincidunt aliquet +$ head --lines=3 docs/lorem.txt +Lorem ipsum dolor sit amet, consectetur adipiscing +elit. Nullam at ligula eget nunc feugiat pharetra. Nullam +nec vulputate augue. Suspendisse tincidunt aliquet +``` + +If I instead wanted to see the last few lines of a file, I can use the `tail` command in the same way. Again, these two `tail` commands each show the last three lines of the `lorem.txt` file: + +``` +$ tail -n 3 docs/lorem.txt +egestas sodales. Vivamus tincidunt ex sed tellus tincidunt +varius. Nunc commodo volutpat risus, vitae luctus lacus +malesuada tempor. Nulla facilisi. +$ tail --lines=3 docs/lorem.txt +egestas sodales. Vivamus tincidunt ex sed tellus tincidunt +varius. Nunc commodo volutpat risus, vitae luctus lacus +malesuada tempor. Nulla facilisi. +``` + +Using `head` and `tail` are also useful when examining log files on a server. I have a small web server I run on my at-home network to test websites before I make them live. I recently discovered that the web server's log is quite long, and I wondered how old it was. Using `head`, I printed just the first line to see that the log file was created in December 2020: + +``` +$ ls -l --human-readable /var/log/httpd +total 13M +-rw-r--r--. 1 root root 13M Jun 25 16:23 access_log +-rw-r--r--. 1 root root 45K Jun 2 00:00 error_log +$ sudo head -n 1 /var/log/httpd/access_log +10.0.0.177 - - [05/Dec/2020:14:58:35 -0600] "GET / HTTP/1.1" 403 5564 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36" +``` + +**[[ Related read: Getting started with the Linux cat command ]][3]** + +### Delete files with Linux rm + +``` +rm +``` + +In my directory with the sample text files, the `lorem.txt` file contains *Lorem Ipsum* text. This is just dummy text used in the printing industry, so the `lorem.txt` file doesn't really belong in this project. Let's delete it. The `rm` command removes a file like this: + +``` +$ ls docs +chapter1.tex chapter4.tex chapter7.tex lorem.txt +chapter2.tex chapter5.tex chapter8.tex readme.txt +chapter3.tex chapter6.tex chapter9.tex workbook.tex +$ rm docs/lorem.txt +$ ls docs +chapter1.tex chapter4.tex chapter7.tex readme.txt +chapter2.tex chapter5.tex chapter8.tex workbook.tex +chapter3.tex chapter6.tex chapter9.tex +``` + +The `rm` command is dangerous, because it removes a file without the intervention of a trash or recycle bin. It's much safer to install a trash command, such as [trashy][4] or [trash-cli][5]. Then you can send files to a staging area before deleting them forever: + +``` +$ rm docs/lorem.txt +``` + +Managing files on the command line requires only a few commands. The `ls` command lists the contents of a directory, and `cat`, `head` and `tail` show the contents of files. Use `rm` or a safe "trash" command to remove files you don't need. These five commands will help you manage your files on any Linux system. To learn more, including the options available, use the `--help` option to see a summary of how to use each command, such as `ls --help` to see how to use the `ls` command. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/manage-files-linux-command-line + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/files_documents_paper_folder.png +[2]: https://opensource.com/article/19/7/master-ls-command +[3]: https://opensource.com/article/19/2/getting-started-cat-command +[4]: https://gitlab.com/trashy/trashy +[5]: https://github.com/andreafrancia/trash-cli diff --git a/sources/tech/20220727 How to Install Pamac GUI Package Manager in Arch Linux.md b/sources/tech/20220727 How to Install Pamac GUI Package Manager in Arch Linux.md new file mode 100644 index 0000000000..1fdf998079 --- /dev/null +++ b/sources/tech/20220727 How to Install Pamac GUI Package Manager in Arch Linux.md @@ -0,0 +1,155 @@ +[#]: subject: "How to Install Pamac GUI Package Manager in Arch Linux" +[#]: via: "https://itsfoss.com/install-pamac-arch-linux/" +[#]: author: "Anuj Sharma https://itsfoss.com/author/anuj/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Install Pamac GUI Package Manager in Arch Linux +====== + +[Pamac][1] is the package manager of [Manjaro][2] based on [libalpm][3] which also supports Appstream, [AUR][4], [Flatpak][5] and [Snaps][6]. Being an alternative to [pacman][7] it focuses on providing an easy-to-use interface whether it is GUI or CLI. + +Arch Linux relies on the [pacman commands for package management][8]. You may get a GUI-based software center from your desktop environment. + +However, if you want to install the fabulous Pamac package manager in Arch Linux, you could do that. + +In this tutorial, I’ll show you two methods to do that: + +* Installing from the AUR +* Installing from the [Chaotic-AUR][9] (Recommended as the developers of Garuda Linux sign packages) + +Both are command line methods, but you are an Arch user, and I believe you can handle the command line a bit, can you not? + +### Method 1: Installing Pamac from the AUR + +If you have an AUR helper like Yay installed already, getting Pamac is really easy. + +``` +yay -S pamac-aur +``` + +**Otherwise, you’ll have to go the challenging route.** + +First, update your system as Arch is a rolling release distribution and [do not support partial upgrades][10]. Enter the following command in the terminal to [update your Arch Linux system][11]. + +``` +sudo pacman -Syu +``` + +Then you need to install all the packages of the [base-devel][12] package group and [git][13] by entering the command below. + +``` +sudo pacman -S --needed base-devel git +``` + +Now you need to build and install [archlinux-appstream-data-pamac][14], [libpamac-aur][15] and [pamac-aur][16] respectively. + +Enter the following commands replacing the package name with packages you want to install for all the 3 packages. + +``` +git clone https://aur.archlinux.org/archlinux-appstream-data-pamac.git +cd archlinux-appstream-data-pamac +makepkg -si +``` + +In this case, the AUR package `pamac-aur` have other AUR packages as dependencies. So you have to build and install them before installing the main package. This hassle can be avoided by using an [AUR helper][17]. + +Building and installing packages from AUR may fail due to outdated [PKGBUILD][18] and there are plenty of them in the AUR. Also, you need to manually update AUR packages if there is an update, as AUR packages don’t update when you update your system with Pacman. + +In my opinion, you should use the next method. You don’t have to bother building and updating Pamac manually when there is an update. + +### Method 2: Installing Pamac from the Chaotic-AUR (Recommended) + +Chaotic-AUR is a repository for Arch Linux maintained by the developers of [Garuda Linux][19]. Packages of this repo are signed and can be trusted. When you add this repo, you can install Pamac using Pacman directly. + +Let’s add the repo by entering the following commands. + +``` +sudo pacman-key --recv-key FBA220DFC880C036 --keyserver keyserver.ubuntu.com +sudo pacman-key --lsign-key FBA220DFC880C036 +sudo pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst' +``` + +The above command just installs the keyring and mirrorlist for the repo. You also have to add the repo to the end of */etc/pacman.conf*. Here I will use nano to edit the file. + +``` +sudo nano /etc/pacman.conf +``` + +The resulting file should look something like this. + +``` +... +# An example of a custom package repository. See the pacman manpage for +# tips on creating your own repositories. +#[custom] +#SigLevel = Optional TrustAll +#Server = file:///home/custompkgs + +[chaotic-aur] +Include = /etc/pacman.d/chaotic-mirrorlist +``` + +Now update your system using Pacman and install Pamac by the entering the following command. + +``` +sudo pacman -Syu pamac-aur +``` + +Once installed, you can access the GUI from Application Menu and CLI using the pamac command. + +![Pamac GUI][20] + +![Pamac CLI][21] + +In case you don’t like Pamac, you can remove it along with its dependencies and configuration files using pacman via the following command: + +``` +sudo pacman -Rns pamac-aur +``` + +### Conclusion + +When I started using Arch Linux, I was also very skeptical about installing AUR packages as they took a long time to build and many times refused to build due to outdated PKGBUILD. I wish we had Chaotic-AUR earlier kudos to the Garuda Linux developers. + +Note that there are other variants of Pamac available in the AUR which support Flatpak and Snaps. But in this tutorial, I have mentioned the variant with only Appstream and AUR support. + +What’s your opinion on adding a 3rd party repos like Chaotic-AUR on Arch Linux? Which method would you use to install Pamac? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-pamac-arch-linux/ + +作者:[Anuj Sharma][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/anuj/ +[b]: https://github.com/lkxed +[1]: https://wiki.manjaro.org/index.php/Pamac +[2]: https://manjaro.org/ +[3]: https://man.archlinux.org/man/libalpm.3.en +[4]: https://aur.archlinux.org +[5]: http://flatpak.org +[6]: https://snapcraft.io/ +[7]: https://wiki.archlinux.org/title/Pacman +[8]: https://itsfoss.com/pacman-command/ +[9]: https://aur.chaotic.cx/ +[10]: https://wiki.archlinux.org/title/System_maintenance#Partial_upgrades_are_unsupported +[11]: https://itsfoss.com/update-arch-linux/ +[12]: https://archlinux.org/groups/x86_64/base-devel/ +[13]: https://git-scm.com/ +[14]: https://aur.archlinux.org/packages/archlinux-appstream-data-pamac +[15]: https://aur.archlinux.org/packages/libpamac-aur +[16]: https://aur.archlinux.org/packages/pamac-aur +[17]: https://wiki.archlinux.org/title/AUR_helpers +[18]: https://wiki.archlinux.org/title/PKGBUILD +[19]: http://garudalinux.org +[20]: https://itsfoss.com/wp-content/uploads/2022/07/pamac-gui.png +[21]: https://itsfoss.com/wp-content/uploads/2022/07/pamac-cli-terminal.png diff --git a/sources/tech/20220728 A Few Tools that Help Machines to Learn.md b/sources/tech/20220728 A Few Tools that Help Machines to Learn.md new file mode 100644 index 0000000000..f0bee339ac --- /dev/null +++ b/sources/tech/20220728 A Few Tools that Help Machines to Learn.md @@ -0,0 +1,141 @@ +[#]: subject: "A Few Tools that Help Machines to Learn" +[#]: via: "https://www.opensourceforu.com/2022/07/a-few-tools-that-help-machines-to-learn/" +[#]: author: "Dr Anand Nayyar https://www.opensourceforu.com/author/anand-nayyar/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +A Few Tools that Help Machines to Learn +====== +Artificial intelligence, machine learning, and deep learning have evolved over decades to help computers perform tasks in the way humans do. This article briefly describes three open source machine learning frameworks — OpenCV, PyTorch and OpenNN – in the context of these technologies. + +![Machine-learning-tools][1] + +Artificial intelligence (AI) aims to mimic the functions of the human brain using computers. It uses mathematical and statistical models (e.g., probability) to do so. Machine learning (ML) improves the behaviour of AI models using programming models of brain functions, and storing the results of these models for future predictions. + +These technologies are inspired by the human neural network, which is the core storage layer of our brain. The processing efficiency of these neural network based solutions is improved by implementing a distributed model for faster processing, as well as simulation of various brain functions like object detection, analytical ability, etc. + +Genetic algorithms improve deep learning models. These have a self-learning ability and are intuitive, hence maximising the applications of AIML (artificial intelligence modelling language) models and reducing the effort in training them. They improve the knowledge base in neural networks. + +![Figure 1: AIML model functions][2] + +All these technologies are helping computer based applications to improve their ability to come closer to human-like thinking, while reducing the effort needed to build and train models. + +### Common features of AIML tools + +Many tech giants are investing large sums in deep learning projects. These include Facebook, Intel and Google, to name a few. Google Brain is the AI research team in Google, which was first formed in early 2010 to design deep learning solutions using Google platforms. The first software built by this team was DistBelief. Later, it was instrumental in releasing many popular projects like TensorFlow, Google Analytics and Google Translate. + +There are many popular machine learning frameworks available in the market, many of which are open source. However, we cannot blindly select a machine learning tool or framework based on convenience. We need to look at the problem scenario, data requirements, data volume to process, training data availability, trainability, algorithm support, visualisation and reporting facility, capability to auto-build the knowledge or training model, processing speed required (CPU/GPU), to name a few, before we make a choice. + +In machine learning, building the model is a time consuming task as a lot of training is needed to get higher accuracy in processing the model for the given problem. For example, a lot of training needs to be done to build the neural network of data sets to get greater accuracy in recognising images. + +![Figure 2: Cognitive intelligence types][3] + +Computational problems are largely solved using a traditional approach like statistical and scientific algorithms. However, some of these problems prove to be costly in terms of time and effort if solved in this way. Pretrained machine learning models can handle such problems using less time and money. + +### Vision API, image API and face detection + +AI grew in importance from the early 1950s to the late 1980s, when engineers developed intelligent machines and programs to address particular problems. + +Since training AI models was costly and time consuming, and the accuracy rate or efficiency of the AI algorithms remained static, ML evolved in the 1980s as a subset of AI. ML models learn by themselves without being explicitly programmed, as a self-training capability is slowly built into them. They address specific problems and can be used for image or speech recognition with higher accuracy. + +Deep learning (DL) is a subset of ML, which uses a multi-layered neural network and improves accuracy and efficiency by learning from its experience (called historical data). It builds a model based on the history, and is very efficient for large volumes of data. Deep learning started to emerge in the late 2010s and is widely used in speech recognition, image or pattern recognition, object detection in videos and images, and language translation, to name a few. + +![Figure 3: Machine learning API types][4] + +Cognitive services help to quickly develop AI models for applications to manage human-like decision making services such as pattern recognition, speech recognition and search facilities. Machine learning cognitive services can be grouped into five major categories of activities, as given below. + +*Vision API:* This service helps to handle image and video processing in face detection, object detection, and pattern recognition with specific use case features like celebrity/landmark detection, handwritten character recognition and OCR activities. + +*Language API:* This service handles sentiment analysis, language understanding (termed as LUIS), bot facilities for answering questions from the knowledge base, language detection, language translation, phonetic analysis, etc. + +*Speech API:*This service handles speech-to-text and text-to-speech translation, real-time speech translation and transcribing, custom voice moderation, etc. + +*Knowledge API:* This service facilitates bot services, contact centre AI facilities for knowledge base creation, QA extraction from textual documentation, self-training from voice answers, content customisation, personalised learning, semantic matching, anomaly detection in content search, etc. + +**Search API:** Based on Bing or Google search APIs, this service offers a search facility for images, videos, text and audio content; image identification, extraction and classification; lead generation based on search results, etc. + +### OpenCV + +OpenCV is one of the most popular vision API facilitated open source machine learning frameworks. It provides various libraries and hardware simulators for building, deploying and testing machine learning models. One of the most important implementers of OpenCV is the Microsoft Azure platform, which uses it for its MMLSpark framework for advanced Big Data services. + +Microsoft has contributed to the Apache Spark framework by introducing the Microsoft Machine Learning for Apache Spark (MMLSpark) framework. MMLSpark expands the distributed machine learning solution of Apache Spark by adding OpenCV, Microsoft Cognitive Toolkit (CNTK) and many other machine learning framework capabilities to the Spark framework in Big Data processing using the enterprise data lake solution. + +MMLSpark comprises a group of machine learning libraries. These are listed below. + +1. Vowpal Wabbit: Library services for machine learning to enable text analytics like sentiment analysis in tweets. +2. Cognitive services on Spark: These combine the features of Microsoft cognitive services in SparkML pipelines in order to get a solution design for cognitive data modelling services like anomaly detection. +3. LightBGM: Machine learning model to enable training for predictive analysis like face ID detection. +4. Spark Serving: Provides a REST API facility to use Spark streaming resources at ease. +5. HTTP on Spark: Enables distributed microservices orchestration in integrating Spark and HTTP protocol based accessibility. +6. Cognitive Toolkit (CNTK): Deep learning framework from Microsoft to enable a Spark solution for data validation in streaming data. +7. Lime: Classifier and modelling solution for distributed models in Spark streaming data. +8. Spark Binding Auto-generation: Enables PySpark (Python) and SparklyR (R programming) coding facility for modelling Spark streaming data models. + +MMLSpark enables data processing with Spark for modelling solutions using machine learning libraries for image processing, video analytics, text analytics, etc. + +*Latest version:* 4.5.5 +*Official website:* *https://opencv.org/* + +### PyTorch + +PyTorch is an open source machine learning framework based on the Torch library and is primarily used for computer vision and natural language processing (NLP). Developed by the Facebook AI Research Lab, it facilitates building deep learning models and allows them to be expressed in idiomatic Python. It is an optimised tensor library for deep learning using GPUs and CPUs. Functionality can be extended with common Python libraries such as NumPy and SciPy. The easiest way to get started with PyTorch is to use NGC containers. The PyTorch NGC container comes with all the dependencies that are useful to design applications for conversational AI, natural language processing, recommendation systems and computer vision. + +It has two good features: + +* Tensor computations with strong GPU acceleration. +* Deep neural networks are built on a tape-based autograd system. + +The PyTorch library comprises the following components: + +* Torch: This is considered a tensor library like NumPy. +* Torch.autograd: This is a tape based automatic differentiation library. +* Torch.jit: Torch script to create serialisable and optimisable models from code. +* Torch.nm: This is a neural network library. +* Torch.multiprocessing: Python multiprocessing and useful for data loading and Hogwild training. +* Torch.utils: Miscellaneous utilities for developers for using code. + +*Features:* + +1. Production ready: Easy to use and has flexibility to integrate code in runtime environments. +2. Torchserve: Strong tool for deploying PyTorch in an easy manner. +3. Mobile support: Supports end-to-end workflow — from Python to deployment on iOS and Android environments. +4. Robustness in integration of tools and libraries. +5. With a C++ frontend, design and architecture becomes easy to understand, and has low latency. +6. Cloud computing ready: PyTorch is well supported for cloud API-based seamless integration. + +*Latest version:* 1.11.0 +*Website: https://pytorch.org/* + +### OpenNN + +OpenNN is a C++ based software library designed for advanced analytics and implements neural networks. The library is stable and very fast in memory allocation. It is constantly optimised and parallelised to attain efficiency in code. It implements data mining methods. + +**Features:** + +a. High processing speed +b. Easy design and implementation +c. Proof-of-concept +d. C++ oriented + +*Website:* *https://www.opennn.net/* + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/07/a-few-tools-that-help-machines-to-learn/ + +作者:[Dr Anand Nayyar][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/anand-nayyar/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Machine-learning-tools.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-1-AIML-model-functions-3.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-2-Cognitive-intelligence-types-1.jpg +[4]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-3-Machine-learning-API-types-1.jpg diff --git a/sources/tech/20220728 A toy remote login server.md b/sources/tech/20220728 A toy remote login server.md new file mode 100644 index 0000000000..4d5bda2cfd --- /dev/null +++ b/sources/tech/20220728 A toy remote login server.md @@ -0,0 +1,444 @@ +[#]: subject: "A toy remote login server" +[#]: via: "https://jvns.ca/blog/2022/07/28/toy-remote-login-server/" +[#]: author: "Julia Evans https://jvns.ca/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +A toy remote login server +====== + +Hello! The other day we talked about [what happened when you press a key in your terminal][1]. + +As a followup, I thought it might be fun to implement a program that’s like a tiny ssh server, but without the security. You can find it [on github here][2], and I’ll explain how it works in this blog post. + +### the goal: “ssh” to a remote computer + +Our goal is to be able to login to a remote computer and run commands, like you do with SSH or telnet. + +The biggest difference between this program and SSH is that there’s literally no security (not even a password) – anyone who can make a TCP connection to the server can get a shell and run commands. + +Obviously this is not a useful program in real life, but our goal is to learn a little more about how terminals works, not to write a useful program. + +(I will run a version of it on the public internet for the next week though, you can see how to connect to it at the end of this blog post) + +### let’s start with the server! + +We’re also going to write a client, but the server is the interesting part, so let’s start there. We’re going to write a server that listens on a TCP port (I picked 7777) and creates remote terminals for any client that connects to it to use. + +When the server receives a new connection it needs to: + + 1. create a pseudoterminal for the client to use + 2. start a `bash` shell process for the client to use + 3. connect `bash` to the pseudoterminal + 4. continuously copy information back and forth between the TCP connection and the pseudoterminal + + + +I just said the word “pseudoterminal” a lot, so let’s talk about what that means. + +### what’s a pseudoterminal? + +Okay, what the heck is a pseudoterminal? + +A pseudoterminal is a lot like a bidirectional pipe or a socket – you have two ends, and they can both send and receive information. You can read more about the information being sent and received in [what happens if you press a key in your terminal][1] + +Basically the idea is that on one end, we have a TCP connection, and on the other end, we have a `bash` shell. So we need to hook one part of the pseudoterminal up to the TCP connection and the other end to bash. + +The two parts of the pseudoterminal are called: + + * the “pseudoterminal master”. This is the end we’re going to hook up to the TCP connection. + * the “slave pseudoterminal device”. We’re going to set our bash shell’s `stdout`, `stderr`, and `stdin` to this. + + + +Once they’re conected, we can communicate with `bash` over our TCP connection and we’ll have a remote shell! + +### why do we need this “pseudoterminal” thing anyway? + +You might be wondering – Julia, if a pseudoterminal is kind of like a socket, why can’t we just set our bash shell’s `stdout` / `stderr` / `stdin` to the TCP socket? + +And you can! We could write a TCP connection handler like this that does exactly that, it’s not a lot of code ([server-notty.go][3]). + +``` + + func handle(conn net.Conn) { + tty, _ := conn.(*net.TCPConn).File() + // start bash with tcp connection as stdin/stdout/stderr + cmd := exec.Command("bash") + cmd.Stdin = tty + cmd.Stdout = tty + cmd.Stderr = tty + cmd.Start() + } + +``` + +It even kind of works – if we connect to it with `nc localhost 7778`, we can run commands and look at their output. + +But there are a few problems. I’m not going to list all of them, just two. + +**problem 1: Ctrl + C doesn’t work** + +The way Ctrl + C works in a remote login session is + + * you press ctrl + c + * That gets translated to `0x03` and sent through the TCP connection + * The terminal receives it + * the Linux kernel on the other end notes “hey, that was a Ctrl + C!” + * Linux sends a `SIGINT` to the appropriate process (more on what the “appropriate process” is exactly later) + + + +If the “terminal” is just a TCP connection, this doesn’t work, because when you send `0x04` to a TCP connection, Linux won’t magically send `SIGINT` to any process. + +**problem 2: `top` doesn’t work** + +When I try to run `top` in this shell, I get the error message `top: failed tty get`. If we strace it, we see this system call: + +``` + + ioctl(2, TCGETS, 0x7ffec4e68d60) = -1 ENOTTY (Inappropriate ioctl for device) + +``` + +So `top` is running an `ioctl` on its output file descriptor (2) to get some information about the terminal. But Linux is like “hey, this isn’t a terminal!” and returns an error. + +There are a bunch of other things that go wrong, but hopefully at this point you’re convinced that we actually need to set bash’s stdout/stderr to be a terminal, not some other thing like a socket. + +So let’s start looking at the server code and see what creating a pseudoterminal actually looks like. + +### step 1: create a pseudoterminal + +Here’s some Go code to create a pseudoterminal on Linux. This is copied from [github.com/creack/pty][4], but I removed some of the error handling to make the logic a bit easier to follow: + +``` + + pty, _ := os.OpenFile("/dev/ptmx", os.O_RDWR, 0) + sname := ptsname(p) + unlockpt(p) + tty, _ := os.OpenFile(sname, os.O_RDWR|syscall.O_NOCTTY, 0) + +``` + +In English, what we’re doing is: + + * open `/dev/ptmx` to get the “pseudoterminal master” Again, that’s the part we’re going to hook up to the TCP connection + * get the filename of the “slave pseudoterminal device”, which is going to be `/dev/pts/13` or something. + * “unlock” the pseudoterminal so that we can use it. I have no idea what the point of this is (why is it locked to begin with?) but you have to do it for some reason + * open `/dev/pts/13` (or whatever number we got from `ptsname`) to get the “slave pseudoterminal device” + + + +What do those `ptsname` and `unlockpt` functions do? They just make some `ioctl` system calls to the Linux kernel. All of the communication with the Linux kernel about terminals seems to be through various `ioctl` system calls. + +Here’s the code, it’s pretty short: (again, I just copied it from [creack/pty][5]) + +``` + + func ptsname(f *os.File) string { + var n uint32 + ioctl(f.Fd(), syscall.TIOCGPTN, uintptr(unsafe.Pointer(&n))) + return "/dev/pts/" + strconv.Itoa(int(n)) + } + + func unlockpt(f *os.File) { + var u int32 + // use TIOCSPTLCK with a pointer to zero to clear the lock + ioctl(f.Fd(), syscall.TIOCSPTLCK, uintptr(unsafe.Pointer(&u))) + } + +``` + +### step 2: hook the pseudoterminal up to `bash` + +The next thing we have to do is connect the pseudoterminal to `bash`. Luckily, that’s really easy – here’s the Go code for it! We just need to start a new process and set the stdin, stdout, and stderr to `tty`. + +``` + + cmd := exec.Command("bash") + cmd.Stdin = tty + cmd.Stdout = tty + cmd.Stderr = tty + cmd.SysProcAttr = &syscall.SysProcAttr{ + Setsid: true, + } + cmd.Start() + +``` + +Easy! Though – why do we need this `Setsid: true` thing, you might ask? Well, I tried commenting out that code to see what went wrong. It turns out that what goes wrong is – Ctrl + C doesn’t work anymore! + +`Setsid: true` creates a new **session** for the new bash process. But why does that make `Ctrl + C` work? How does Linux know which process to send `SIGINT` to when you press `Ctrl + C`, and what does that have to do with sessions? + +### how does Linux know which process to send Ctrl + C to? + +I found this pretty confusing, so I reached for my favourite book for learning about this kind of thing: [the linux programming interface][6], specifically chapter 34 on process groups and sessions. + +That chapter contains a few key facts: (#3, #4, and #5 are direct quotes from the book) + + 1. Every process has a **session id** and a **process group id** (which may or may not be the same as its PID) + 2. A session is made up of multiple process groups + 3. All of the processes in a session share a single controlling terminal. + 4. A terminal may be the controlling terminal of at most one session. + 5. At any point in time, one of the process groups in a session is the **foreground process group** for the terminal, and the others are background process groups. + 6. When you press `Ctrl+C` in a terminal, SIGINT gets sent to all the processes in the foreground process group + + + +What’s a process group? Well, my understanding is that: + + * processes in the same pipe `x | y | z` are in the same process group + * processes you start on the same shell line (`x && y && z`) are in the same process group + * child processes are by default in the same process group, unless you explicitly decide otherwise + + + +I didn’t know most of this (I had no idea processes had a session ID!) so this was kind of a lot to absorb. I tried to draw a sketchy ASCII art diagram of the situation + +``` + + (maybe) terminal --- session --- process group --- process + | |- process + | |- process + |- process group + | + |- process group + +``` + +So when we press Ctrl+C in a terminal, here’s what I think happens: + + * `\x04` gets written to the “pseudotermimal master” of a terminal + * Linux finds the **session** for that terminal (if it exists) + * Linux find the **foreground process group** for that session + * Linux sends `SIGINT` + + + +If we don’t create a new session for our new bash process, our new pseudoterminal actually won’t have **any** session associated with it, so nothing happens when we press `Ctrl+C`. But if we do create a new session, then the new pseudoterminal will have the new session associated with it. + +### how to get a list of all your sessions + +As a quick aside, if you want to get a list of all the sessions on your Linux machine, grouped by session, you can run: + +``` + + $ ps -eo user,pid,pgid,sess,cmd | sort -k3 + +``` + +This includes the PID, process gruoup ID, and session ID. As an example of the output, here are the two processes in the pipeline: + +``` + + bork 58080 58080 57922 ps -eo user,pid,pgid,sess,cmd + bork 58081 58080 57922 sort -k3 + +``` + +You can see that they share the same process group ID and session ID, but of course they have different PIDs. + +That was kind of a lot but that’s all we’re going to say about sessions and process groups in this post. Let’s keep going! + +### step 3: set the window size + +We need to tell the terminal how big to be! + +Again, I just copied this from `creack/pty`. I decided to hardcode the size to 80x24. + +``` + + Setsize(tty, &Winsize{ + Cols: 80, + Rows: 24, + }) + +``` + +Like with getting the terminal’s pts filename and unlocking it, setting the size is just one `ioctl` system call: + +``` + + func Setsize(t *os.File, ws *Winsize) { + ioctl(t.Fd(), syscall.TIOCSWINSZ, uintptr(unsafe.Pointer(ws))) + } + +``` + +Pretty simple! We could do something smarter and get the real window size, but I’m too lazy. + +### step 4: copy information between the TCP connection and the pseudoterminal + +As a reminder, our rough steps to set up this remote login server were: + + 1. create a pseudoterminal for the client to use + 2. start a `bash` shell process + 3. connect `bash` to the pseudoterminal + 4. continuously copy information back and forth between the TCP connection and the pseudoterminal + + + +We’ve done 1, 2, and 3, now we just need to ferry information between the TCP connection and the pseudoterminal. + +There are two `io.Copy` calls, one to copy the input _from_ the tcp connection, and one to copy the output _to_ the TCP connection. Here’s what the code looks like: + +``` + + go func() { + io.Copy(pty, conn) + }() + io.Copy(conn, pty) + +``` + +The first one is in a goroutine just so they can both run in parallel. + +Pretty simple! + +### step 5: exit when we’re done + +I also added a little bit of code to close the TCP connection when the command exits + +``` + + go func() { + cmd.Wait() + conn.Close() + }() + +``` + +And that’s it for the server! You can see all of the Go code here: [server.go][2]. + +### next: write a client + +Next, we have to write a client. This is a lot than the server because we don’t need to do quite as much terminal setup. there are just 3 steps: + + 1. Put the terminal into raw mode + 2. copy stdin/stdout to the TCP connection + 3. reset the terminal + + + +### client step 1: put the terminal into “raw” mode + +We need to put the client terminal into “raw” mode so that every time you press a key, it gets sent to the TCP connection immediately. If we don’t do this, everything will only get sent when you press enter. + +“Raw mode” isn’t actually a single thing, it’s a bunch of flags that you want to turn off. There’s a good tutorial explaining all the flags we have to turn off called [Entering raw mode][7]. + +Like everything else with terminals, this requires `ioctl` system calls. In this case we get the terminal’s current settings, modify them, and save the old settings so that we can restore them later. + +I figured out how to do this in Go by going to and typing in `syscall.TCSETS` to find some other Go code that was doing the same thing. + +``` + + func MakeRaw(fd uintptr) syscall.Termios { + // from https://github.com/getlantern/lantern/blob/devel/archive/src/golang.org/x/crypto/ssh/terminal/util.go + var oldState syscall.Termios + ioctl(fd, syscall.TCGETS, uintptr(unsafe.Pointer(&oldState))) + + newState := oldState + newState.Iflag &^= syscall.ISTRIP | syscall.INLCR | syscall.ICRNL | syscall.IGNCR | syscall.IXON | syscall.IXOFF + newState.Lflag &^= syscall.ECHO | syscall.ICANON | syscall.ISIG + ioctl(fd, syscall.TCSETS, uintptr(unsafe.Pointer(&newState))) + return oldState + } + +``` + +### client step 2: copy stdin/stdout to the TCP connection + +This is exactly like what we did with the server. It’s very little code: + +``` + + go func() { + io.Copy(conn, os.Stdin) + }() + io.Copy(os.Stdout, conn) + +``` + +### client step 3: restore the terminal’s state + +We can put the terminal back into the mode it started in like this (another `ioctl`!): + +``` + + func Restore(fd uintptr, oldState syscall.Termios) { + ioctl(fd, syscall.TCSETS, uintptr(unsafe.Pointer(&oldState))) + } + +``` + +### we did it! + +We have written a tiny remote login server that lets anyone log in! Hooray! + +Obviously this has zero security so I’m not going to talk about that aspect. + +### it’s running on the public internet! you can try it out! + +For the next week or so I’m going to run a demo of this on the internet at `tetris.jvns.ca`. It runs tetris instead of a shell because I wanted to avoid abuse, but if you want to try it with a shell you can run it on your own computer :). + +If you want to try it out, you can use `netcat` as a client instead of the custom Go client program we wrote, because copying information to/from a TCP connection is what netcat does. Here’s how: + +``` + + stty raw -echo && nc tetris.jvns.ca 7777 && stty sane + +``` + +This will let you play a terminal tetris game called `tint`. + +You can also use the [client.go program][8] and run `go run client.go tetris.jvns.ca 7777`. + +### this is not a good protocol + +This protocol where we just copy bytes from the TCP connection to the terminal and nothing else is not good because it doesn’t allow us to send over information information like the terminal or the actual window size of the terminal. + +I thought about implementing telnet’s protocol so that we could use telnet as a client, but I didn’t feel like figuring out how telnet works so I didn’t. (the server 30% works with telnet as is, but a lot of things are broken, I don’t quite know why, and I didn’t feel like figuring it out) + +### it’ll mess up your terminal a bit + +As a warning: using this server to play tetris will probably mess up your terminal a bit because it sets the window size to 80x24. To fix that I just closed the terminal tab after running that command. + +If we wanted to fix this for real, we’d need to restore the window size after we’re done, but then we’d need a slightly more real protocol than “just blindly copy bytes back and forth with TCP” and I didn’t feel like doing that. + +Also it sometimes takes a second to disconnect after the program exits for some reason, I’m not sure why that is. + +### other tiny projects + +That’s all! There are a couple of other similar toy implementations of programs I’ve written here: + + * [toy tls 1.3 implementation][9] + * [toy dns resolver][10] + + + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2022/07/28/toy-remote-login-server/ + +作者:[Julia Evans][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://jvns.ca/blog/2022/07/20/pseudoterminals/ +[2]: https://github.com/jvns/tiny-remote-login/blob/main/server.go +[3]: https://github.com/jvns/tiny-remote-login/blob/main/server-notty.go +[4]: https://github.com/creack/pty/blob/7de28cee0d53510e719c1aeb1850af0fa647c343/pty_linux.go +[5]: https://github.com/creack/pty/blob/7de28cee0d53510e719c1aeb1850af0fa647c343/pty_linux.go#L41-L54 +[6]: https://man7.org/tlpi/ +[7]: https://viewsourcecode.org/snaptoken/kilo/02.enteringRawMode.html +[8]: https://github.com/jvns/tiny-remote-login/blob/main/client.go +[9]: https://jvns.ca/blog/2022/03/23/a-toy-version-of-tls/ +[10]: https://jvns.ca/blog/2022/02/01/a-dns-resolver-in-80-lines-of-go/ diff --git a/sources/tech/20220728 LibreOffice vs OpenOffice- All You Need to Know-.md b/sources/tech/20220728 LibreOffice vs OpenOffice- All You Need to Know-.md new file mode 100644 index 0000000000..f63fa208eb --- /dev/null +++ b/sources/tech/20220728 LibreOffice vs OpenOffice- All You Need to Know-.md @@ -0,0 +1,207 @@ +[#]: subject: "LibreOffice vs OpenOffice: All You Need to Know?" +[#]: via: "https://itsfoss.com/libreoffice-vs-openoffice/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +LibreOffice vs OpenOffice: All You Need to Know? +====== + +LibreOffice and OpenOffice are two popular [open-source alternatives to Microsoft Office][1]. + +Any of them can be recommended if you are looking for an open-source office suite with a word processor, spreadsheet, presentation, and a few other programs. + +However, to make the best of an office suite, you should know the differences between them to decide what’s best for you. + +Should you use LibreOffice or OpenOffice? What are the differences? Here, I explore more about that. + +### LibreOffice vs. OpenOffice: Origins + +![libreoffice vs openoffice][2] + +OpenOffice.org was a project developed by Sun Microsystems. It was introduced as an open-source version of StarOffice (acquired by them initially) to compete with Microsoft Office. + +Later, Oracle acquired Sun Microsystems and eventually ditched OpenOffice.org while submitting the code base to Apache. + +When Apache started maintaining it, the name of the office suite was tweaked to “OpenOffice” or Apache OpenOffice. + +During this transition period, The Document Foundation forked OpenOffice.org to create LibreOffice, fearing that Oracle would discontinue the project. + +So, LibreOffice was created as a replacement for OpenOffice.org. + +But, now that OpenOffice still exists and is actively maintained, why should you choose LibreOffice? Isn’t OpenOffice good enough? What are the similarities between them? + +### What’s Common in LibreOffice and Apache OpenOffice? + +LibreOffice and OpenOffice have a few things in common. + +You can use any of them if all you need is to create a basic document, spreadsheet, or presentation without requiring any complex operations or shortcuts to improve productivity. + +Simply put, you can count on both if you require an open-source office suite on Linux, Windows, and macOS. + +LibreOffice and OpenOffice are capable enough to open various file formats that include Microsoft’s DOCX, PPT, and more. + +Unfortunately, the similarities fade away as you look for **various features, user interface, file format compatibility, export capabilities**, and other characteristics. + +Of course, if you start using them extensively, you shall notice the differences. + +But, to save you from the trouble, let me highlight the differences here: + +### Installation and Platform Availability + +The first step to the user experience is the installation procedure and platform availability. + +The program is a big let-down if it is tricky to install and not supported for multiple platforms. + +In this case, LibreOffice and Apache OpenOffice are officially available for **Linux, Windows, and macOS**. + +When it comes to mobile platforms, you can find [Collabora Office][3] (based on LibreOffice) on the Play Store (Android) and the App Store (iOS). It comes close to an official port of LibreOffice, considering Collabora is its commercial partner. + +While you can also use them or any other community/third-party port as a replacement for OpenOffice on mobiles, **it has no official ports available**. + +Now that you know the supported platforms, how easy is it to install them? + +**For Linux,**LibreOffice is available in the official repositories and listed in the software center and package managers. So, you are a couple of clicks away from setting it up on your Linux system. + +![libreoffice software center][4] + +Unfortunately, OpenOffice is a hassle to install. It is not available in the repositories, nor you can find it in the software center. Moreover, if you already have LibreOffice pre-installed, you will have to remove any traces before attempting to install OpenOffice (to avoid installation conflict). + +You will have to download the official packages (per your Linux distribution) from its website, extract it, and use a couple of commands to [install OpenOffice on Linux][5]. + +![openoffice debs linux][6] + +**For Windows and macOS**, the installation is easy, where [you download the installer package][7] and follow the on-screen instructions. + +[LibreOffice also offers an alternative way][8] (through its partners) to get it, using the Microsoft Store and the Mac App Store. You will have to pay for them, though. Part of it is donated to the Document Foundation and part of it helps the development of LibreOffice. + +Not to forget, LibreOffice can also be used on Chromebooks, thanks to [Collabora Office][9]. + +**To sum up, LibreOffice provides better platform availability and easier installation procedure, which can make OpenOffice a tough choice to recommend.** + +### User Experience + +LibreOffice presents a pleasing user interface that blends in with modern standards. LibreOffice should look fine on most modern hardware, whether you have a 2K display or a 4K display. + +![libreoffice home 1][10] + +You can access all the tools quickly from its main launcher, which is a good experience. The Writer Document, Spreadsheet, and other programs offer an easy-to-use interface that looks well-organized. + +![libreoffice writer][11] + +Apache OpenOffice provides a dated user interface. So, if you are looking for a modern open-source office suite, LibreOffice takes the cake. + +![openoffice home][12] + +Of course, some users prefer the classic user interface, considering they are quite familiar with it, and their usage is limited on older hardware. + +![openoffice writer][13] + +In other words, OpenOffice is still usable, but it may not be an intuitive experience for most modern users. + +If you closely compare the user interface elements, it will vary based on the latest version available at the time you are reading this article; hence, we avoid making specific visual comparisons. + +### Features + +The need for a robust feature-set depends on the type of files you work with. + +By default, you get the following programs with OpenOffice and LibreOffice: + +* Math (Scientific formula) +* Writer (Documents) +* Impress (Presentations) +* Draw (Drawings, Flow Charts, etc.) +* Calc (Spreadsheets) +* Base (Database) + +Whether you utilize the word processor (Writer), spreadsheet (Calc), or presentations, you get all the same standard features. + +However, LibreOffice gets the edge if you work with complex documents requiring access to **more templates, functions, import/export options, and advanced formatting**. + +### File Format Compatibility + +![file format illustration][14] + +OpenOffice supports almost all the same file extensions you can expect with LibreOffice. + +However, LibreOffice also supports exporting in some of the same file formats, which OpenOffice does not. + +For instance, you can open a **.DOCX** file with OpenOffice without hiccups, but you cannot save it/export the document preserving the file extension. + +You can only save it as .odt/.doc./.ott and a few similar file formats. + +Similarly, you do not get support for .xslx and .pptx, modern file formats usually used for spreadsheets and presentations. + +Sure, if you do not rely on these file formats, you can try using OpenOffice. Still, when collaborating with a user with a newer file format, you will encounter compatibility/formatting issues that could affect your work. + +Considering OpenOffice lacks numerous features, it may not be wise to depend on it to access newer file formats; you could lose significant details due to bad compatibility. + +### Updates + +![software update illustration][15] + +To improve your productivity with the program and get enhanced performance, newer features, and security fixes, opting for a software tool that gets regular updates is recommended. + +Technically, both receive regular updates. But, OpenOffice is limited to bug fixes and minor updates. + +LibreOffice has more development activity, frequent bug fixes/minor updates, regular major upgrades with newer features, and improved user experience. + +No wonder why [LibreOffice wrote an open letter to Apache][16] to discontinue OpenOffice and divert those resources to help LibreOffice development. + +### Enterprise Support and Online Collaboration Options + +![enterprise illustration][17] + +Thanks to [Collabora Office][18], you can get enterprise support while being able to use LibreOffice at your workplace. You can also deploy LibreOffice on your servers for a collaborative workspace, thanks to [Collabora Online][19]. + +Unfortunately, Apache OpenOffice does not have any enterprise support options. So, it is best suited for home users, if at all. + +### Licensing + +There are no licensing issues that would stop you or discourage you from using any of these programs. However, this information could be useful for contributors to the project. + +LibreOffice utilizes Mozilla Public License v2.0 while Apache OpenOffice is available under the Apache License 2.0. + +### LibreOffice vs. OpenOffice: What Should You Pick? + +LibreOffice is an easy choice to recommend for its modern design, more functionalities, and support for newer file formats. + +OpenOffice can be a solution for users acquainted with older office suite interfaces and who want it to work without hiccups in their 32-bit systems. Otherwise, it should remain an alternative solution in cases where LibreOffice fails to work for some reason. + +We could tell you that the choice depends on your personal preferences, but I’d be lying if I do not mention LibreOffice is the better choice if you regularly work with documents. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/libreoffice-vs-openoffice/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/best-free-open-source-alternatives-microsoft-office/ +[2]: https://itsfoss.com/wp-content/uploads/2022/07/libreoffice-vs-openoffice.jpg +[3]: https://www.collaboraoffice.com/ +[4]: https://itsfoss.com/wp-content/uploads/2022/07/libreoffice-software-center.png +[5]: https://itsfoss.com/install-openoffice-ubuntu-linux/ +[6]: https://itsfoss.com/wp-content/uploads/2022/07/openoffice-debs-linux.png +[7]: https://www.libreoffice.org/download/download/ +[8]: https://www.libreoffice.org/download/libreoffice-from-microsoft-and-mac-app-stores/ +[9]: https://www.collaboraoffice.com/press-releases/collabora-office-ships-for-chromebooks/ +[10]: https://itsfoss.com/wp-content/uploads/2022/07/libreoffice-home-1.png +[11]: https://itsfoss.com/wp-content/uploads/2022/07/libreoffice-writer.png +[12]: https://itsfoss.com/wp-content/uploads/2022/07/openoffice-home.png +[13]: https://itsfoss.com/wp-content/uploads/2022/07/openoffice-writer.png +[14]: https://itsfoss.com/wp-content/uploads/2022/07/file-format-illustration.jpg +[15]: https://itsfoss.com/wp-content/uploads/2022/07/software-update-illustration.jpg +[16]: https://itsfoss.com/libreoffice-letter-openoffice/ +[17]: https://itsfoss.com/wp-content/uploads/2022/07/enterprise-illustration.jpg +[18]: https://www.collaboraoffice.com/ +[19]: https://www.collaboraoffice.com/collabora-online/ diff --git a/sources/tech/20220728 Top 10 32-Bit Linux Distributions in 2022 [Compared].md b/sources/tech/20220728 Top 10 32-Bit Linux Distributions in 2022 [Compared].md new file mode 100644 index 0000000000..d7f1d4e2d2 --- /dev/null +++ b/sources/tech/20220728 Top 10 32-Bit Linux Distributions in 2022 [Compared].md @@ -0,0 +1,257 @@ +[#]: subject: "Top 10 32-Bit Linux Distributions in 2022 [Compared]" +[#]: via: "https://www.debugpoint.com/32-bit-linux-distributions/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Top 10 32-Bit Linux Distributions in 2022 [Compared] +====== +We list the best 32-bit Linux distributions that still support ancient systems. + +![][0] + +### What is happening with 32-bit Linux Distros? + +Linux always supports older hardware, thanks to the community. But more and more Linux operating systems are dropping support for 32-bit systems mainly because it takes additional testing effort to keep another build apart from 64-bit, and the number of 32-bit systems is reducing daily. + +Most of the older hardware manufactured before 2007 has 32-bit architecture-based CPUs, which we mostly know as i386, i586, i486 and x86. However, the hardware manufactured after 2007 are primarily 64-bit and may term as modern. + +Recently, many famous and lightweight Linux distros dropped support for 32-bit architecture. But some projects are still strong and provide users with an option to run the older machines with full functionality. + +I will list the ten best Linux distros that still support 32-bit systems. + +### Top 10 32-bit Linux distros in 2022 + +#### 1. Debian + +Debian Linux is the foundation of hundreds of Linux distributions across multiple architectures. Millions use it as a desktop and server operating system. Debian is a “universal operating system” because it supports x86-64, arm64, armel,armhf, i386, mips, mipsel, mips64el, ppc64el, s390x architectures with work in progress for riscv64. + +In addition, it supports a wide range of hardware and includes free and non-free packages. On the desktop side, all the major [desktop environments][1] are available for you to install on your older hardware. + +Perhaps, it is the safest choice if you are looking for a vanilla 32-bit Linux distro experience. + +![Debian Logo][2] + +#### Why is Debian the best 32-bit distro? + +* Most popular and widely used +* Dependable and used by millions +* Well documentation, tutorials and user guides +* Proper framed future roadmap +* [Support for all architectures and platforms][3] + +[Download Debian][4] + +#### 2. MX Linux + +MX Linux is a systemd-free distro based on Debian stable branch. It is recently trending among users who want a clean system that supports older to modern hardware. + +MX Linux is popular because it’s carefully created to give you a perfect and stable system with its native applications and tools. + +![MX Linux][5] + +The team behind it gives a lot of thought while packaging the applications in this distro. Besides that, it is also based on antiX components and comes with KDE Plasma desktop, Xfce and Fluxbox. + +MX Linux is probably the best choice in this list because it is easy to download and use in older systems. + +![mx linux logo][6] + +#### Why is MX Linux the best? + +* Systemd free, hence faster +* Based on Debian stable, it gives a more stable system +* Unique in-house applications to help users with generic tasks +* 3 desktop flavour options to choose from +* Well-supported community and user-base + +[Download MX Linux][7] + +#### 3. Q4OS + +The third 32-bit Linux distro in this list is Q4OS. Q4OS is a unique Linux operating system based on Debian and brings KDE and Trinity desktop environments. It comes with a 32-bit installer which can be used to install. In addition, Q4OS also features a Windows installer where you can parallel run this distro inside WIndows. + +An exciting and related trivia about Q4OS is that it was created as an alternative to Windows XP when Microsoft discontinued it on 2014. And it’s still going strong and providing a stable 32-bit alternative to many users. + +![Q4OS Logo][8] + +#### Here are some of the critical advantages of Q4OS + +* Well-defined roadmap and unlikely to be discontinued +* Based on Debian and long-term support has been available for more than five years +* Provides KDE and Trinity desktop both (for those who like KDE 3) +* The unique installer gives the ability to install it inside Windows and take advantage of the entire hardware (not like in VM) +* Themes, Software centre, and third-party app installers are available + +[Download Q4OS][9] + +#### 4. NixOS + +The fourth Linux distro in this list of 32-bit distributions is NixOS, built on top of the Nix Package manager. This independent Linux distribution is perfect for DevOps and deployment pipeline tasks and supports atomic updates. It uses a configuration script for several tasks, including installation. + +That said, NixOS is not for the beginner or average Linux users, although it functions like other Linux distributions. It’s not designed to be an end-user Linux operating system. + +However, since it provides a 32-bit variant, it’s perfect for some use cases where you need to set up a remote server or pipeline in older hardware. You can learn more and download using the below link. + +[Download NixOS][10] + +#### 5. Void Linux + +Void Linux is an independent Linux distro (not depending on Debian or Fedora, etc.) which follows a unique rolling release model. It comes with X Binary Package System (XBPS), which helps you to install apps and packages directly from sources. In addition, it uses run unit as init system, instead of systemd. + +Void Linux provides a 32-bit installer with the latest packages alongside the usual 64-bit and ARM installation methods. Hence, you can quickly try it out on your older hardware. Moreover, Void Linux also support all major desktop environments, such as Xfce, Cinnamon, LXDE, LXQt and more. + +![Void Linux Logo][11] + +#### Here are some of the advantages of Void Linux + +* Independent distribution and free from Debian, Ubuntu or Fedora base +* Well-defined path for future updates and continuity +* Excellent XBPS package management system +* A rolling release-based distro which is stable +* All major desktop environments supported + +[Download Void Linux][12] + +#### 6. Zorin OS Lite 15.3 + +Zorin OS is an excellent and popular Linux distribution, a fusion of Xfce and GNOME 3 desktop. It comes with a Pro and Lite version. The Zorin OS Lite version provides a 32-bit installer at the moment. + +![Zorin OS][13] + +But there is a catch. Currently, the Zorin OS 15.3 Lite version only supports the 32-bit version. And its support ends on April 2023. + +After that, Zorin OS will not be supporting the 32-bit version anymore. The reason is it is based on Ubuntu LTS. And Ubuntu discontinued the 32-bit image from Ubuntu 20.04 LTS Focal Fossa version. + +Hence, you can use Zorin OS 15.3 Lite until April 2023 and take advantage of its beautiful desktop and additional features. + +[Download Zorin OS 15.3 Lite (32 bit)][14] + +#### 7. Porteus + +If you are a fan of the Old-KDE desktop and looking for a 32-bit operating system, then you can try Porteus Linux. Porteus is a Slackware Linux spin that features a KDE 4.0+ desktop environment. It is based on bleeding edge Slackware Linux and provides a fast desktop experience. Moreover, it can run from a Live USB/CD. The installer size is 300 MB, perfect for CD-based older hardware. + +![Porteus Logo][15] + +#### The reason why Porteus can be an ideal 32-bit Linux OS + +* Based on bleeding-edge Slackware Linux +* Enjoy the simplicity of Slackware +* Installer size can fit into a CD (300 MB only) +* Legacy KDE 4.0 Desktop support +* Can run off a USB or CD + +[Download Porteus Linux][16] + +#### 8. antiX + +The antiX Linux is slightly different on the desktop level than other 32-bit distros in this list. It is a lightweight Linux distribution based on Debian stable branch and brings some exciting features. First and foremost, it comes with a 32-bit installer, which has four variants – Full, Core, Base and Net. Secondly, it features famous primarily Windows Managers and Not desktop environments. Hence it is faster. + +The antiX Linux features IceWM, Fluxbox, and ROX desktop options. In addition, it is free of systemd and uses sysVinit & runit as init system. + +A perfect 32-bit Linux distribution that brings window manager, sydtemd-free and Debian base. + +![Antix Logo][17] + +#### Why is antiX an excellent 32-bit distro? + +* Provides stability with Debian stable branch +* Provides a 32-bit installer with four variants +* Systemd free distribution +* Window manager support, rather than desktops + +[Download antiX][18] + +#### 9. BunsenLabs Linux + +Remember the famous Crunchbang project? The BunsenLabs Linux is a successor of the Crunchbang project based on the Debian stable branch. Like antiX, it also features Windows Manager rather than desktop environments. It brings Openbox Window manager with an excellent tin2 panel at its core. In addition, some goodies such as Conky presets, jgmenu makes it a well-designed 32-bit distro for that ancient hardware. + +![BunsenLabs Logo][19] + +#### Why is BunsenLabs the best? + +* Powered by Debian stable branch +* Openbox Window manager is for the desktop experience +* Pre-configured Concky with tin2 panel, jgmenu +* A good amount of help and support is available + +[Download BunsenLabs][20] + +#### 10. Alpine Linux + +A list of 32-bit Linux distributions is incomplete without Alpine Linux. Alpine Linux is an almost two-decade-old Linux distro created for developers and power users. It’s unique and provides a 32-bit variant among other architectures. + +At its core, it uses musl and BusyBox instead of GNU tools and packages. Also, Alpine uses OpenRC as init system. + +This independent Linux is perfect for containers and hypervisors and boasts about its security. Perhaps, not so suitable for usual desktop usage. However, the popular PostmarketOS mobile Linux OS platform is based on Alpine Linux. + +![Alpine Logo][21] + +#### Alpine Linux advantages + +* Independent Linux distro +* Not based on GNU toolchain (uses musl and BusyBox) +* APK package manager +* Suitable for containers and Hypervisors +* Well secured at the core level + +[Download AlpineLinux][22] + +### List of significant distros that dropped support of 32-bit recently + +Since you went thru the above list, it’s always to remember that a bunch of distros which depended on Ubuntu dropped their 32-bit support. From the version Ubuntu 20.04 Focal Fossa, Ubuntu officially closed the support for 32-bit. Hence all the Ubuntu-LTS variants are also forced to follow this decision. + +Here’s a brief list of awesome distros which unfortunately discontinued the 32-bit support in the recent past. + +* Linux Mint 20 and above +* Puppy Linux 9.5 and above +* Ubuntu 20.04 LTS Focal Fossa and above +* All the official Ubuntu flavours (such as Lubuntu and Xubuntu) from 20.04 onwards + +### Closing Notes + +You can rest assured that there will always be support for 32-bit Linux distributions to support older hardware. If a day comes when all distro stops support, Debian will always support all hardware possible. That’s the beauty of Debian. + +Also, other niche distros, such as Puppy and Void Linux – will continue to support 32-bit hardware in the coming days. Because they are built with this purpose only. + +Finally, I hope this list helps you to pick the best 32-bit distro for your PC or hardware. Also, don’t forget to check out the [best lightweight distros][23] for older hardware which contain 64-bit distros for older hardware. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/32-bit-linux-distributions/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[0]: https://www.debugpoint.com/wp-content/uploads/2022/07/32bitdistrohd.jpg +[1]: https://www.debugpoint.com/category/desktop-environment +[2]: https://www.debugpoint.com/wp-content/uploads/2022/07/512_debian.png +[3]: https://www.debugpoint.com/install-debian-buster/ +[4]: https://www.debian.org/distrib/ +[5]: https://www.debugpoint.com/wp-content/uploads/2022/05/MX-Linux.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2022/07/mx-linux-logo-2.png +[7]: https://mxlinux.org/download-links/ +[8]: https://www.debugpoint.com/wp-content/uploads/2022/07/512_q4os_lightblue.png +[9]: https://www.q4os.org/downloads1.html +[10]: https://nixos.org/ +[11]: https://www.debugpoint.com/wp-content/uploads/2022/07/512_void.png +[12]: https://voidlinux.org/download/ +[13]: https://www.debugpoint.com/wp-content/uploads/2022/05/Zorin-OS.jpg +[14]: https://zorin.com/os/download/15/lite/32/ +[15]: https://www.debugpoint.com/wp-content/uploads/2022/07/Porteus-Logo.png +[16]: http://www.porteus.org/ +[17]: https://www.debugpoint.com/wp-content/uploads/2022/07/512_antix.png +[18]: https://antixlinux.com/download/ +[19]: https://www.debugpoint.com/wp-content/uploads/2022/07/512_bunsenlabs_yellow_black.png +[20]: https://www.bunsenlabs.org/installation.html +[21]: https://www.debugpoint.com/wp-content/uploads/2022/07/512_alpine.png +[22]: https://alpinelinux.org/downloads/ +[23]: https://www.debugpoint.com/lightweight-linux-distributions-2022/ diff --git a/sources/tech/20220728 Use this nifty Unix tool to process text on Linux.md b/sources/tech/20220728 Use this nifty Unix tool to process text on Linux.md new file mode 100644 index 0000000000..ade2a7defa --- /dev/null +++ b/sources/tech/20220728 Use this nifty Unix tool to process text on Linux.md @@ -0,0 +1,213 @@ +[#]: subject: "Use this nifty Unix tool to process text on Linux" +[#]: via: "https://opensource.com/article/22/7/process-text-linux-pr" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Use this nifty Unix tool to process text on Linux +====== +The pr tool prepares text documents for printing. + +![5 trends in open source documentation][1] + +Image by: Internet Archive Book Images. Modified by Opensource.com. CC BY-SA 4.0 + +Unix has always excelled at processing text, and Linux is no different. And the tools to work with and transform text files still exist on all Linux systems. + +Like other computer systems, early Unix printed on paper, using a typewriter-style printing device. These printers provided limited formatting options, but with clever application of Unix tools, you could prepare professional-looking documents. + +One such tool was the `pr` tool, to prepare text documents for printing. Let's explore how to use standard Unix tools, such as the `pr` processor and the `fmt` text formatter, to prepare text files for printing on a typewriter-style printer. + +### Printing a plain text file + +Let's say we wanted to print the MIT license, stored in a file called mit.txt. This file is already formatted for optimal screen display; lines are almost 80 columns wide, which fits well on a standard terminal. + +``` +$ cat mit.txt +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +``` + +![Image of standard 80 column terminal][3] + +Image by: (Jim Hall, CC BY-SA 40) + +Printer paper is also 80 columns wide, at least on the classic printers. So we can also print the file to our printer using a command like `lpr`. But that's not a very interesting way to print the file, and it won't be very nice to read. For example, the document will start on the first line of the printed page, and immediately on the left edge of the paper. + +We can make the document easier to read by using the `pr` command to add a top margin. By default, `pr` includes the date and time, the name of the file, and the page number in the top header. For example, the top of our file might look like this: + +``` +$ pr mit.txt | head + + +2022-06-24 18:27 mit.txt Page 1 + + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +``` + +In this example, I've used the `head` command to look at just the first ten lines of the `pr` output. The `pr` command also adds extra blank lines at the bottom of the page, to provide a bottom margin. The old-style typewriter printers used 66 lines per page, so the `pr` output assumes that too. But this file prints on one page, so I don't need to show the bottom of the file; it's just some blank lines. + +### Adding a left and right margin + +Adding the top margin makes the document easier to read, but we can do better by adding space on the left and right of the printed page. This effectively adds a left and right margin to our document. + +The first step is to use the `fmt` command to reformat the text file to a different width. Using `fmt -w 70` reformats the text file to use lines that are 70 columns wide. We can add some blank space on the left of the document to create a left margin. Using `pr -o 5` adds 5 spaces to the start of each line of the output. With the narrower text, we'll also have about 5 spaces in the right margin. + +``` +$ fmt -w 70 mit.txt | pr -o 5 | head + + + 2022-06-24 18:35 Page 1 + + + Copyright (c) + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including +``` + +This is how Unix users printed plain text files. You can use the same set of commands to print text files on a modern laser printer, but your printer may *expect a page feed* command instead of using blank lines. To do that, add the `-f` option to the `pr` command, like this: + +``` +$ fmt -w 70 mit.txt | pr -f -o 5 | lpr +``` + +I'll omit the `-f` in the rest of this article, but remember to add `-f` to the `pr` command if you want to print documents to a modern laser printer. + +### Changing the header + +You may notice that when we redirect the output of `fmt` to the `pr` command, the `pr` output no longer shows the name of the file. That's because when we chain several commands together like this, the `pr` command doesn't know the filename, so it's left blank. We can add the filename to the header by using the `-h` option: + +``` +$ fmt -w 70 mit.txt | pr -h 'mit.txt' -o 5 | head + + + 2022-06-24 18:45 mit.txt Page 1 + + + Copyright (c) + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including +``` + +You can make other changes to the header, such as the -D option to change the date and time format, or replace it with new text. + +``` +$ fmt -w 70 mit.txt | pr -D '6/24/2022' -h 'mit.txt' -o 5 | head -30 + + + 6/24/2022 mit.txt Page 1 + + + Copyright (c) + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject + to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY + KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR + IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +``` + +### Printing two columns + +What if you wanted to make a text document look really fancy on the printed page? Certain documents such as technical articles might need to be printed in a two-column layout. The `pr` command can print text in multiple columns. For example, `-2` prints in two columns and -3 will print in three columns. + +However, be careful when printing text in multiple columns. If the lines are too long, `pr` may simply overlap one column with another, effectively losing text in the output. But we can leverage the `fmt` command to reformat the text to a narrower width, suitable for printing in two column format. + +Let's do the math: If the printed page is 80 columns wide, and we've left 5 spaces on the left and right as page margins, that leaves 70 columns for our text. Using `fmt -w 35` would cut the text neatly in half for two columns, but we may not leave much space between the columns. Instead, let's use `fmt -w 33` to reformat the text width to 33 before sending the output to the `pr` command: + +``` +$ fmt -w 33 mit.txt | pr -2 -D '6/24/2022' -h 'mit.txt' -o 5 | head -30 + + + 6/24/2022 mit.txt Page 1 + + + Copyright (c) substantial portions of the + Software. + Permission is hereby granted, + free of charge, to any person THE SOFTWARE IS PROVIDED + obtaining a copy of this "AS IS", WITHOUT WARRANTY OF + software and associated ANY KIND, EXPRESS OR IMPLIED, + documentation files (the INCLUDING BUT NOT LIMITED TO THE + "Software"), to deal in the WARRANTIES OF MERCHANTABILITY, + Software without restriction, FITNESS FOR A PARTICULAR PURPOSE + including without limitation the AND NONINFRINGEMENT. IN NO + rights to use, copy, modify, EVENT SHALL THE AUTHORS OR + merge, publish, distribute, COPYRIGHT HOLDERS BE LIABLE + sublicense, and/or sell copies FOR ANY CLAIM, DAMAGES OR OTHER + of the Software, and to permit LIABILITY, WHETHER IN AN ACTION + persons to whom the Software is OF CONTRACT, TORT OR OTHERWISE, + furnished to do so, subject to ARISING FROM, OUT OF OR IN + the following conditions: CONNECTION WITH THE SOFTWARE + OR THE USE OR OTHER DEALINGS IN + The above copyright notice and THE SOFTWARE. + this permission notice shall + + + + +$ +``` + +Unix is a great platform for processing text. While we use other tools today, including HTML in web browsers and PDF for printable content, it's nice to know how to use the existing Unix tools to create professional plain text documents. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/process-text-linux-pr + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/documentation-type-keys-yearbook.png +[2]: https://opensource.com/article/22/7/fmt-trivial-text-formatter +[3]: https://opensource.com/sites/default/files/2022-07/Imageofstandardterminal.png diff --git a/sources/tech/20220729 7 Docks to Customize Your Linux Desktop.md b/sources/tech/20220729 7 Docks to Customize Your Linux Desktop.md new file mode 100644 index 0000000000..8312558944 --- /dev/null +++ b/sources/tech/20220729 7 Docks to Customize Your Linux Desktop.md @@ -0,0 +1,188 @@ +[#]: subject: "7 Docks to Customize Your Linux Desktop" +[#]: via: "https://itsfoss.com/best-linux-docks/" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +7 Docks to Customize Your Linux Desktop +====== +A dock has been an important part of the Linux desktop experience for decades. It provides a handy way of quickly accessing your favorite, frequently used applications. + +Unfortunately, the popular desktop environment GNOME doesn’t provide a dock. + +Fret not. You can always install a Docking application on your Linux desktop. + +And this is not just limited to GNOME. If you don’t like the dock provided by your distribution and the [desktop environment][1], you can replace it with another one of your choices. + +Speaking of choices, let me share some of my favorite docks that will help you change the default look of your desktop Linux. + +I have added installation instructions for Ubuntu. You may find these docks in your distribution’s repositories and install it using your distribution’s package manager. + +### 1. Plank + +![plank][2] + +Plank is the default dock in Elementary OS, one of the most [beautiful Linux distros][3]. But this was not the only reason why Plank exists on this list. + +It gives you the simplest dock you can get for its functionality. + +Hence, it is also light on system resources, so pairing it with your favorite window manager can be a good idea (sadly, you won’t get many customization options). + +You can also experience the fine implementation of Plank dock in other distros such as Ubuntu MATE and others. + +To install Plank on Ubuntu derivatives, use the given command: + +``` +sudo apt install plank +``` + +[Plank][4] + +### 2. Latte + +![Latte Dock][5] + +Being part of the KDE ecosystem, Latte is one of the most configurable docks available. From having various custom profiles to changing the behavior of each element, Latte surely deserves to be on this list. + +The only drawback of Latte is dependencies. Latte can be a bit heavy on system resources as it will be bundled with various KDE apps by default and Wayland is still not supported. + +But if you are already using some apps from KDE or if dependencies don’t concern you, Latte will be good for its looks and customization options. + +You can [install Latte on Ubuntu-based distributions][6] using: + +``` +sudo apt install latte +``` + +[Latte][7] + +### 3. Dash to Dock + +![Dash to Dock on Ubuntu][8] + +A popular GNOME extension that allows users to change the behavior of how the default dash on GNOME behaves. + +As an extension, it is easy to install, and you do not have much to worry about regarding dependencies at all. Extensions are extremely light on resources. You can use the [Extension Manager][9] or follow our guide to [install the GNOME extension][10]. + +For more information, you can visit their [official GNOME extension page][11]. + +[Dash to Dock][12] + +### 4. Cairo + +![Cairo Dock on Ubuntu][13] + +If you prefer old-school animation and theming like myself, nothing beats Cairo! This may look a bit outdated but by default, you get various themes pre-installed to match your desktop. + +Rather than compiling each customization option in a single menu, we get subsections for customizing one element at a time and trust me, it nails it. + +Unlike other options in the list, you get various add-ons and sections from which you can enhance the functionality of the dock and also get some pre-installed themes to start with. + +It’s a bit heavy on system resources as it will constantly utilize animations. To install Cairo on an Ubuntu-based system, use the given command: + +``` +sudo apt install cairo-dock cairo-dock-plug-ins +``` + +[Cairo][14] + +### 5. DockbarX + +![DockbarX][15] + +**Note:** The last release was in 2019. + +So if you are looking for a dock that can also function in panel mode, DockbarX can be your next dock, especially if you are using Xfce DE. + +It is a simple dock you can try with any desktop environment. + +DockbarX is one of those docks which enables you to tweak the way you interact with it. From the dock’s background, and themes to notifications, everything can be tweaked. + +The installation is basic, and if you are using an Ubuntu-based distro, you can easily install DockbarX by using the given command: + +``` +sudo apt install dockbarx-themes-extra +``` + +[DockbarX][16] + +### 6. KSmoothDock + +![KSmoothDock][17] + +If you want something that adds a glassy-finish/premium touch to your Linux desktop, KSmoothDock is what you’re looking for. + +KSmoothDock is meant to be paired with KDE Plasma, but it blends quite well with GNOME too. It brings a parabolic effect similar to macOS and has an application launcher, pages, and other helpful features for daily usage. + +The major disadvantage of KSmoothDock is that it requires a modern set of software and will not work on old kernels. Installation is complex, especially if you are not using Debian derivatives. + +To download the .deb file, visit their [official download page][18]. In either case, you can choose to compile it from scratch if you’re comfortable. + +[KSmoothDock][19] + +### 7. Tint2: Dock for Window Managers + +![Tint2 Dock][20] + +**Note:** Its last release was in 2019. + +Tint2 is a widely used dock/panel, when coupled with window managers, and in terms of customization, probably no one comes close to this. + +This might not be a good choice if you are a beginner but suitable for advanced users who love to tinker with each element available on DE. + +You will find Tint2 in default repositories of almost every Linux distribution and if you are still confused about how to install Tint2 on Ubuntu, type the following command: + +``` +sudo apt install tint2 +``` + +To reduce your efforts in customization, I found a set of pre-defined themes on [Github][21] which is created by considering each type of user in mind. + +[Tint2][22] + +### What’s Your Favorite Linux Dock? + +Docks are one of the several ways you can customize your desktop. Other methods include using different icons and themes, wallpapers, terminal colors, extensions and more. + +I have listed the best Linux docks, in my opinion. Some of the popular options haven’t seen a new release in the last few years but they may still be found in your distribution’s repositories. + +What do you prefer to use among the listed Linux docks? Did we miss any of your favorites? Please let me know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/best-linux-docks/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/what-is-desktop-environment/ +[2]: https://itsfoss.com/wp-content/uploads/2022/07/Plank.png +[3]: https://itsfoss.com/beautiful-linux-distributions/ +[4]: https://github.com/ricotz/plank +[5]: https://itsfoss.com/wp-content/uploads/2022/07/Latte.png +[6]: https://itsfoss.com/install-use-latte-dock-ubuntu/ +[7]: https://github.com/KDE/latte-dock +[8]: https://itsfoss.com/wp-content/uploads/2022/07/desk-to-dock.png +[9]: https://itsfoss.com/extension-manager/ +[10]: https://itsfoss.com/gnome-shell-extensions/ +[11]: https://extensions.gnome.org/extension/307/dash-to-dock/ +[12]: https://github.com/micheleg/dash-to-dock +[13]: https://itsfoss.com/wp-content/uploads/2022/07/cairo.png +[14]: https://glx-dock.org/ +[15]: https://itsfoss.com/wp-content/uploads/2022/07/dockbarx-1.png +[16]: https://github.com/M7S/dockbarx +[17]: https://itsfoss.com/wp-content/uploads/2022/07/KsmoothDOck.png +[18]: https://store.kde.org/p/1081169/ +[19]: https://store.kde.org/p/1081169/ +[20]: https://itsfoss.com/wp-content/uploads/2022/07/Tint2.png +[21]: https://github.com/addy-dclxvi/tint2-theme-collections +[22]: https://github.com/o9000/tint2/blob/master/doc/tint2.md diff --git a/sources/tech/20220729 Fix bugs in Bash scripts by printing a stack trace.md b/sources/tech/20220729 Fix bugs in Bash scripts by printing a stack trace.md new file mode 100644 index 0000000000..2199fc74f0 --- /dev/null +++ b/sources/tech/20220729 Fix bugs in Bash scripts by printing a stack trace.md @@ -0,0 +1,254 @@ +[#]: subject: "Fix bugs in Bash scripts by printing a stack trace" +[#]: via: "https://opensource.com/article/22/7/print-stack-trace-bash-scripts" +[#]: author: "Evan "Hippy" Slatis https://opensource.com/users/hippyod" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Fix bugs in Bash scripts by printing a stack trace +====== +Automatically printing a stack trace on unhandled errors in your scripts can make finding and fixing bugs in your code much easier. + +![Bug tracking magnifying glass on computer screen][1] + +Image by: Pixabay, testbytes, CC0 + +No one wants to write bad code, but inevitably bugs will be created. Most modern languages like Java, JavaScript, Python, etc., automatically print a stack trace when they encounter an unhandled exception, but not shell scripts. It would make it much easier to find and fix bugs in shell scripts if you could print a stack trace, and, with a little work, you can. + +Shell scripts can span multiple files, and well-written code is further broken down into functions. Tracing issues when something goes wrong in a shell script can be difficult when these scripts get large enough. A stack trace that walks the code backward from the error to the beginning can show you where your code failed and give you a better understanding of why so you can fix it properly. + +To implement the stack trace, I use the [trap][2] in the following manner at the beginning of my script: + +``` +set -E + +trap 'ERRO_LINENO=$LINENO' ERR +trap '_failure' EXIT +``` + +This example accomplishes a few things, but I'll address the second one, **trap 'ERRO_LINENO=$LINENO' ERR**, first. This line ensures the script traps all commands that exit with a non-zero exit code (i.e., an error), and saves the line number of the command in the file where the error was signaled. This is not captured on exit. + +The first line above (**set -E**) ensures that the error trap is inherited throughout the script. Without this, whenever you drop into an **if** or **until** block, for example, you'd lose track of the correct line number. + +The second trap captures the exit signal from the script and sends it to the **_failure** function, which I'll define in a moment. But why on exit and not error if you're trying to debug the script? In bash scripts, command failures are often used in control logic or can be ignored outright as unimportant by design. For example, say at the beginning of your script, you're looking to see if a particular program is already installed before asking the user whether they'd like you to install it for them: + +``` +if [[ ! -z $(command -v some_command) ]] +then +   # CAPTURE LOCATION OF some_command +   SOME_COMMAND_EXEC=$(which some_command) +else +   # echo $? would give us a non-zero value here; i.e. an error code +   # IGNORE ERR: ASK USER IF THEY WANT TO INSTALL some_command +fi +``` + +If you were to stop processing on every error and some_command is not installed, this would prematurely end the script, which is obviously not what you want to do here, so in general, you only want to log an error and stack trace when the script has exited unintentionally because of an error. + +To force your script to exit whenever there's an unexpected error, use the **set -e** option: + +``` +set -e +# SCRIPT WILL EXIT IF ANY COMMAND RETURNS A NON-ZERO CODE +# WHILE set -e IS IN FORCE +set +e +# COMMANDS WITH ERRORS WILL NOT CAUSE THE SCRIPT TO EXIT HERE +``` + +The next question is, what are some examples where you would probably like your script to exit and highlight a failure? Common examples include the following: + +1. An unreachable remote system +2. Authentication to a remote system fail +3. Syntax errors in config or script files being sourced +4. Docker image builds +5. Compiler errors + +Combing through many pages of logs after a script completes looking for any possible errors that may be hard to spot can be extremely frustrating. It's even more frustrating when you discover something is wrong long past the time you ran the script and now have to comb through multiple sets of logs to find what might have gone wrong and where. Worst is when the error has been around for a while, and you only discover it at the worst possible time. In any case, pinpointing the problem as quickly as possible and fixing it is always the priority. + +Look at the sample stack trace code (available for [download here][3]): + +``` +# Sample code for generating a stack trace on catastrophic failure + +set -E + +trap 'ERRO_LINENO=$LINENO' ERR +trap '_failure' EXIT + +_failure() { +  ERR_CODE=$? # capture last command exit code +  set +xv # turns off debug logging, just in case +  if [[  $- =~ e && ${ERR_CODE} != 0 ]] +  then +      # only log stack trace if requested (set -e) +      # and last command failed +      echo +      echo "========= CATASTROPHIC COMMAND FAIL =========" +      echo +      echo "SCRIPT EXITED ON ERROR CODE: ${ERR_CODE}" +      echo +      LEN=${#BASH_LINENO[@]} +      for (( INDEX=0; INDEX<$LEN-1; INDEX++ )) +      do +          echo '---' +          echo "FILE: $(basename ${BASH_SOURCE[${INDEX}+1]})" +          echo "  FUNCTION: ${FUNCNAME[${INDEX}+1]}" +          if [[ ${INDEX} > 0 ]] +          then +           # commands in stack trace +              echo "  COMMAND: ${FUNCNAME[${INDEX}]}" +              echo "  LINE: ${BASH_LINENO[${INDEX}]}" +          else +              # command that failed +              echo "  COMMAND: ${BASH_COMMAND}" +              echo "  LINE: ${ERRO_LINENO}" +          fi +      done +      echo +      echo "======= END CATASTROPHIC COMMAND FAIL =======" +      echo +  fi +} + +# set working directory to this directory for duration of this test +cd "$(dirname ${0})" + +echo 'Beginning stacktrace test' + +set -e +source ./testfile1.sh +source ./testfile2.sh +set +e + +_file1_function1 +``` + +In the `stacktrace.sh` above, the first thing the **_failure** function does is capture the exit code of the last command using the built-in shell value **$?**. It then checks whether the exit was unexpected by checking the output of **$-**, a built-in shell value that holds the current bash shell settings, to see if **set -e** is in force. If the script exited on an error and the error was unexpected, the stack trace is output to the console. + +The following built-in shell values are used to build the stack trace: + +1. BASH_SOURCE: Array of filenames where each command was called back to the main script. +2. FUNCNAME: Array of line numbers matching each file in BASH_SOURCE. +3. BASH_LINENO: Array of line numbers per file matching BASH_SOURCE. +4. BASH_COMMAND: Last command executed with flags and arguments. + +If the script exits with an error in an unexpected manner, it loops over the above variables and outputs each one in order so a stack trace can be built. The line number of the failed command is not held in the above arrays, but that's why you captured the line number each time a command failed with the first trap statement above. + +### Putting it all together + +Create the following two files to support the test, so you can see how the information is gathered across multiple files. First, `testfile1.sh` : + +``` +_file1_function1() { +   echo +   echo "executing in _file1_function1" +   echo + +   _file2_function1 +} + +# adsfadfaf + +_file1_function2() { +   echo +   echo "executing in _file1_function2" +   echo +  +   set -e +   curl this_curl_will_fail_and_CAUSE_A_STACK_TRACE + +   # function never called +   _file2_does_not_exist +} +``` + +And next, `testfile2.sh` : + +``` +_file2_function1() { +   echo +   echo "executing in _file2_function1" +   echo + +   curl this_curl_will_simply_fail + +   _file1_function2 +} +``` + +NOTE: If you create these files yourself, make sure to make the `stacktrace.sh` file executable. + +Executing `stacktrace.sh` will output the following: + +``` +~/shell-stack-trace-example$./stracktrace.sh +Beginning stacktrace test + +executing in _file1_function1 + +executing in _file2_function1 +curl: (6) Could not resolve host: this_curl_will_simply_fail + +executing in _file1_function2 +curl: (6) Could not resolve host: this_curl_will_fail_and_CAUSE_A_STACK_TRACE + +========= CATASTROPHIC COMMAND FAIL ========= + +SCRIPT EXITED ON ERROR CODE: 6 + +--- +FILE: testfile1.sh +  FUNCTION: _file1_function2 +  COMMAND: curl this_curl_will_fail_and_CAUSE_A_STACK_TRACE +  LINE: 15 +--- +FILE: testfile2.sh +  FUNCTION: _file2_function1 +  COMMAND: _file1_function2 +  LINE: 7 +--- +FILE: testfile1.sh +  FUNCTION: _file1_function1 +  COMMAND: _file2_function1 +  LINE: 5 +--- +FILE: stracktrace.sh +  FUNCTION: main +  COMMAND: _file1_function1 +  LINE: 53 + +======= END CATASTROPHIC COMMAND FAIL ======= +``` + +For extra credit, try uncommenting the line in `testfile1.sh` and executing `stacktrace.sh` again: + +``` +# adsfadfaf +``` + +Then re-comment the line, and instead comment out the following line in `testfile1.sh` that caused a stack trace and run `stacktrace.sh` one last time: + +``` +curl this_curl_will_fail_and_CAUSE_A_STACK_TRACE +``` + +This exercise should give you an idea of the output and when it occurs if you have typos in your scripts. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/print-stack-trace-bash-scripts + +作者:[Evan "Hippy" Slatis][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/hippyod +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/bug_software_issue_tracking_computer_screen.jpg +[2]: https://man7.org/linux/man-pages/man1/trap.1p.html +[3]: https://github.com/hippyod-labs/shell-stack-trace-example diff --git a/sources/tech/20220729 Learn Rust by debugging Rust.md b/sources/tech/20220729 Learn Rust by debugging Rust.md new file mode 100644 index 0000000000..0abe7c217e --- /dev/null +++ b/sources/tech/20220729 Learn Rust by debugging Rust.md @@ -0,0 +1,242 @@ +[#]: subject: "Learn Rust by debugging Rust" +[#]: via: "https://opensource.com/article/22/7/learn-rust-rustlings" +[#]: author: "Gaurav Kamathe https://opensource.com/users/gkamathe" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Learn Rust by debugging Rust +====== +Rustlings is an open source project by the Rust team that helps you learn Rust through the process of debugging. + +![Ferris the crab under the sea, unofficial logo for Rust programming language][1] + +Image by: Opensource.com + +In my previous [article about rustup][2], I showed you how to install the Rust toolchain. Well, what good is the toolchain if you won’t be using it to get more hands-on with Rust? Learning any language involves reading existing code and writing a lot of sample programs. That's a good way to become proficient in a language. However, there's a third way: debugging code. + +Learning through debugging involves trying to compile a pre-written (buggy) sample program, understanding the errors generated by the compiler, fixing the sample code, and then re-compiling it. Repeat that process until the code successfully compiles and runs. + +[Rustlings][3] is an open source project by the Rust team that helps you learn Rust through the process of debugging. It also provides you with a lot of hints along the way. If you're a beginner to Rust and have either started or completed reading the Rust book, then rustlings is the ideal next step. Rustlings helps you apply what you've learned from the book, and move to working on bigger projects. + +### Installing rustlings + +I'm using (and recommend) a Fedora machine to try rustlings, but any Linux distribution works. To install rustlings, you must download and run its install script. It's recommended that you do this as a normal user (not root) without any special privileges. + +Remember, for you to be able to use rustlings, you need the Rust toolchain available on your system. If you don't have that already, please refer to my [article on rustup][4]. + +Once you're ready, download the installation script: + +``` +$ curl -L https://raw.githubusercontent.com/rust-lang/rustlings/main/install.sh  > rustlings_install.sh +$ file rustlings_install.sh +rustlings_install.sh: Bourne-Again shell script, ASCII text executable +``` + +Inspect the script to learn what it does: + +``` +$ less rustlings_install.sh +``` + +And then run it to install: + +``` +$ bash rustlings_install.sh +[...] +Installing /home/tux/.cargo/bin/rustlings +Installed package `rustlings v4.8.0 (/home/tux/rustlings)` (executable `rustlings`) +All done! +``` + +Run 'rustlings' to get started. + +### Rustlings exercises + +The installation provides you with the `rustlings` command. Run it along with the `--help` flag to see what options are available. + +``` +$ rustlings --help +``` + +The installation script also clones the rustlings Git repository, and installs all the dependencies required to run the sample programs. You can view the sample programs within the exercises directory under `rustlings` : + +``` +$ cd rustlings +$ pwd +/home/tux/rustlings +$ ls +AUTHORS.md  Cargo.toml        CONTRIBUTING.md  info.toml install.sh README.md  target Cargo.lock  CHANGELOG.md  exercises install.ps1  LICENSE src tests +$ ls -m exercises/ +advanced_errors, clippy, collections, conversions, enums, error_handling, functions, generics, if, intro, macros, mod.rs, +modules, move_semantics, option, primitive_types, quiz1.rs, quiz2.rs, quiz3.rs, quiz4.rs, README.md, +standard_library_types, strings, structs, tests, threads, traits, variables +``` + +### List all exercises from the command line + +The `rustlings` command provides you with a `list` command which displays each sample program, its complete path, and the status (which defaults to **pending**.) + +``` +$ rustlings list +Name         Path                                 Status +intro1       exercises/intro/intro1.rs            Pending +intro2       exercises/intro/intro2.rs            Pending +variables1   exercises/variables/variables1.rs    Pending +variables2   exercises/variables/variables2.rs    Pending +variables3   exercises/variables/variables3.rs    Pending +[...] +``` + +Near the end of the output, you're given a progress report so you can track your work. + +``` +Progress: You completed 0 / 84 exercises (0.00 %). +``` + +### View sample programs + +The `rustings list` command shows you what programs are available, so at any time you can view the code of those programs by copying the complete paths into your terminal as an argument for the [cat][5] or [less][6] commands: + +``` +$ cat exercises/intro/intro1.rs +``` + +### Verify your programs + +Now you can start debugging programs. You can do that using the `verify` command. Notice that rustlings chooses the first program in the list (`intro1.rs` ), tries to compile it, and succeeds: + +``` +$ rustlings verify +Progress: [-----------------------------------] 0/84 +✅ Successfully ran exercises/intro/intro1.rs! + +You can keep working on this exercise, +or jump into the next one by removing the `I AM NOT DONE` comment: + + 6 |  // Execute the command `rustlings hint intro1` for a hint. + 7 |   + 8 |  // I AM NOT DONE + 9 | +``` + +As you can see from the output, even though the sample code compiles, there's work yet to be done. Each sample program has the following comment in its source file: + +``` +$ grep "NOT DONE" exercises/intro/intro1.rs +// I AM NOT DONE +``` + +Although the compilation of the first program worked fine, rustlings won't move to the next program until you remove the `I AM NOT DONE` comment. + +### Moving to the next exercise + +Once you have removed the comment from `intro1.rs`, you can move to the next exercise by running the `rustlings verify` command again. This time, you may notice that rustlings tries to compile the next program (`intro2.rs` ) in the series, but runs into an error. You're expected to debug that issue, fix it, and then move forward. This is a critical step, allowing you to understand why Rust says a program has bugs. + +``` +$ rustlings verify +Progress: [>------------------------] 1/84 +⚠️  Compiling of exercises/intro/intro2.rs failed! Please try again. Here's the output: +error: 1 positional argument in format string, but no arguments were given + --> exercises/intro/intro2.rs:8:21 +  | +8 |         println!("Hello {}!"); +  |                         ^^ + +error: aborting due to previous error +``` + +### Getting a hint + +Rustlings has a handy `hint` argument, which tells you exactly what's wrong with the sample program, and how to fix it. You can think of it as an add-on help option, in addition to what the compiler error message tells you. + +``` +$ rustlings hint intro2 +Add an argument after the format string. +``` + +Based on the above hint, fixing the program is easy. All you need to do is add an additional argument to the `println` statement. This diff should help you understand the changes: + +``` +< println!("Hello {}!", "world"); +--- +> println!("Hello {}!"); +``` + +Once you make that change, and removed the `NOT DONE` comment from the source code, you can run `rustlings verify` again to compile and run the code. + +``` +$ rustlings verify +Progress: [>-------------------------------------] 1/84 +✅ Successfully ran exercises/intro/intro2.rs! +``` + +### Track progress + +You aren't going to finish all of the exercises in a day, and it's easy to lose track of where you left off. You can run the `list` command to see the status of your work. + +``` +$ rustlings list +Name         Path                                  Status +intro1       exercises/intro/intro1.rs             Done   +intro2       exercises/intro/intro2.rs             Done   +variables1   exercises/variables/variables1.rs     Pending +variables2   exercises/variables/variables2.rs     Pending +variables3   exercises/variables/variables3.rs     Pending +[...] +``` + +### Run specific exercises + +If you don't want to start from the beginning and skip a few exercises, rustlings allows you to focus on specific exercises using the `rustlings run` command. This runs a specific program without requiring the previous lesson to be verified. For example: + +``` +$ rustlings run intro2 +Hello world! +✅ Successfully ran exercises/intro/intro2.rs +$ rustlings run variables1 +``` + +Typing exercise names can become tedious, but rustlings provides you with a handy `next` command so you can move to the next exercise in the series. + +``` +$ rustlings run next +``` + +### Alternative watch command + +If you don't want to keep typing `verify` after each modification you make, you can run the `watch` command in a terminal window, and then keep modifying the source code to fix issues. The `watch` command detects these modifications, and keeps re-compiling the program to see whether the issue has been fixed. + +``` +$ rustlings watch +``` + +### Learn by debugging + +The Rust compiler is known to provide very meaningful error messages, which helps you understand issues in your code. This usually leads to faster debugging. Rustlings is a great way to practice Rust, to get used to reading error messages, and understand the Rust language. Check out the recent features of Rustlings 5.0.0 on [GitHub][7]. + +**[[ Practice programming with Rust. Download our Rust cheat sheet. ]][8]** + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/learn-rust-rustlings + +作者:[Gaurav Kamathe][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/gkamathe +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/rust_programming_crab_sea.png +[2]: https://opensource.com/article/22/6/rust-toolchain-rustup +[3]: https://github.com/rust-lang/rustlings +[4]: https://opensource.com/article/22/6/rust-toolchain-rustup +[5]: https://opensource.com/article/19/2/getting-started-cat-command +[6]: https://opensource.com/article/18/4/using-less-view-text-files-command-line +[7]: https://github.com/rust-lang/rustlings/releases/tag/5.0.0 +[8]: https://opensource.com/downloads/rust-cheat-sheet diff --git a/sources/tech/20220730 SpiralLinux- The New Distro Making Debian Easier for Beginners.md b/sources/tech/20220730 SpiralLinux- The New Distro Making Debian Easier for Beginners.md new file mode 100644 index 0000000000..e3d21f6092 --- /dev/null +++ b/sources/tech/20220730 SpiralLinux- The New Distro Making Debian Easier for Beginners.md @@ -0,0 +1,199 @@ +[#]: subject: "SpiralLinux: The New Distro Making Debian Easier for Beginners" +[#]: via: "https://itsfoss.com/spirallinux-review/" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +SpiralLinux: The New Distro Making Debian Easier for Beginners +====== +SpiralLinux is a new entrant in the world of desktop-focused Linux distributions. + +It is based on Debian Linux and created by the unnamed developer of [GeckoLinux][1]. + +Gecko what? [GeckoLinux][2] is a derivative of openSUSE and focuses on providing out-of-the-box usability to desktop users. + +The aim for [SpiralLinux][3] is also the same. Provide an out-of-the-box usable Debian experience to desktop users. + +Is Debian really that complex? While Debian is considered the most stable distro, the vanilla Debian often overwhelms new users with multiple download options. The focus on FOSS-only software by default policy also makes things difficult for beginners. It requires various tweaks after the first boot to make it useful. + +And those are the areas where SpiralLinux shines! + +Through this article, I’m going to walk you through the features of SpiralLinux and share my experience, so you can have a better idea of what to expect from SpiralLinux. + +### SpiralLinux: Debian simplified + +The first question that will come to your mind is why another [Debian-based distro][4]? The core idea behind SpiralLinux is to get you a well-tuned Debian that can be used out of the box. + +If you [try installing Debian][5], you’ll notice a number of download options but they do not include proprietary drivers and codecs which are necessary for modern hardware (including mine). Getting the right ISO itself is the first struggle. + +Not to forget that you’ll have to further tweak your vanilla Debian system to make it work with your hardware. + +SpiralLinux aims to address those pain points by providing several pre-installed software, performance tweaks and proprietary drivers and codecs support. + +Some key highlighting features are as follows: + +* Ships with a wide range of drivers to support a variety of hardware +* zRAM is enabled by default for better performance +* It can be upgraded to Debian testing Unstable branches with just a few clicks +* It uses Linux kernel 5.18 out of the box to support the most recent hardware +* Proprietary media codecs are pre-installed +* Third-party Debian repositories are enabled by default +* ISOs available for Cinnamon, Xfce, GNOME, KDE, MATE, Budgie, and LXQt desktop environments +* An experimental “builder” ISO for experts + +![SpiralLinux DE offerings][6] + +#### System Requirements + +There’s no mention of 32-bit or ARM support in the official documentation. You only get a single download option for a 64-bit system. + +As SpiralLinux is entirely based on Debian stable, these are the standard system requirements for 64-bit machines: + +* RAM: 2 GB or higher (Depends on the [desktop environment][7] you choose) +* Processor: Dual-core or higher +* Disk: 15 GB or higher + +#### Installation + +![Calamares installer for SpiralLinux][8] + +As you expect from any easy-to-use Linux distro, SpiralLinux provides a graphical installer. Avid distrohoppers can easily see that it uses Calamares installer. + +The installer has all the necessary features you expect such as manual/auto partitioning, disk encryption, changing bootloader location, and so on. + +You can choose Btrfs as the default file system while installing SpiralLinux. + +### My Experience with SpiralLinux + +Experience. This is what really matters in the end because adding tons of features can only reduce steps after the first boot. + +Like any other thing in the world, SpiralLinux has some good and some bad points. I’ll be addressing both pros and cons so that you can have a better idea. + +#### Positives + +Let’s start this review with positives, which includes the parts which I enjoyed. + +##### Hardware support + +My system is equipped with modern hardware and requires a modern kernel. By far, I never thought I would be able to boot into Debian 11, but this changed my mind. + +By default, you get Linux Kernel 5.18, which is newer than what you get on vanilla Debian (5.10 series) and works well on my 12th gen Intel CPU. + +![Linux kernel 5.18][9] + +##### Non-free repositories + +![Non-free repos][10] + +Once in a while, we all need to install proprietary packages that are not available in default repositories. + +These non-free repositories include closed-source firmware and drivers, which will help install proprietary microcodes and other software unavailable in the default repository. + +##### Switching from Stable to Sid and Testing + +![Using Debian Sid][11] + +This is my favorite feature from the entire catalog. Just imagine, you can switch between stable, unstable, and testing branches without using a single command. + +The best part is that users are given simple instructions on how they can switch between branches. You can access them from [here.][12] + +##### Performance + +SpiralLinux is well optimized in terms of RAM consumption and makes it an ideal choice for low-end hardware if you choose the right desktop environment. + +I’ll show you what you can expect from [different desktop environments][13]. So if you are someone with decent hardware, you can opt for Cinnamon, as it only consumes around 900 MB of RAM in idle usage. + +![idle ram consumption on cinnamon de][14] + +But what if you are looking for something lighter? change your current DE to Xfce and as we already know, it is one of the most lightweight DEs; idle RAM consumption will only be around 600 MB. + +![Idle ram consumption on Xfce de][15] + +Either way, I didn’t encounter any performance issues, and things went well. + +#### Negatives + +SpiralLinux shines in various scenarios but I also encountered a few hiccups. Let me share them with you. + +##### Hardware Acceleration Issue in VM + +Once you boot into a VM without any hardware acceleration, you will be advised to enable it, as you may experience poor performance and high CPU usage. + +![Requires hardware acceleration for better performance][16] + +And once you enable hardware acceleration, you will find your VM is often crashing while booting. It’s no minor crash and makes your VM unstable. + +![VM Hardware acceleration issue][17] + +You can easily use SpiralLinux without enabling any hardware acceleration. I found no issues at all while using it without any acceleration enabled. + +##### Snap Issues + +While Snaps are not my go-to choice, I use them when I want to get away from building packages from source. But this was a below-average experience with snaps in SpiralLinux. + +I had two issues. One is that many of the snap packages were not even working. I even tried switching between other branches. + +This was the issue with the fresh installation, without even changing a single config file. I noticed that many of my favorite apps, such as Spotify and Slack were not working in Snap form. + +Some packages did work though. I use Shutter for screenshots and when I installed it using snaps, I was introduced to a quite outdated UI. + +![Shutter][18] + +The second problem was that any installed snap packed are not listed in the system menu by default. You can easily solve that issue by utilizing the given command: + +``` +sudo cp /var/lib/snapd/desktop/applications/*.desktop ~/.local/share/applications/ +``` + +But this was only with Snap packages. Flatpaks were working quite smoothly and none of the problems I mentioned above were faced with Flatpaks. + +### Final Thoughts + +I like the imagination of the developer. GeckoLinux is based on openSUSE. Since openSUSE logo/mascot is a chameleon, the developer named it Gecko (a type of lizard). + +The logo of Debian is a swirl, so the developer named the Debian variant SpiralLinux. + +Both have the intention of simplifying the experience of their popular parent distro. + +[Many other Debian-based distributions][19] have the same purpose as SpiralLinux. Linux Mint Debian Edition ([LMDE][20]) is one such example. + +Personally, I would prefer using the main distribution instead of its derivative. But I understand that a few users may find it more convenient to use these derivatives. + +I leave the comments open for you now. Do you think SpiralLinux has the potential to carve out a niche for itself or is it one of those distributions that will be lost in oblivion? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/spirallinux-review/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/geckolinux-review/ +[2]: https://geckolinux.github.io/ +[3]: https://spirallinux.github.io/ +[4]: https://itsfoss.com/debian-based-distros/ +[5]: https://itsfoss.com/install-debian-easily/ +[6]: https://itsfoss.com/wp-content/uploads/2022/07/spirallinux-flavors.png +[7]: https://itsfoss.com/what-is-desktop-environment/ +[8]: https://itsfoss.com/wp-content/uploads/2022/07/Calamares-installer-1.png +[9]: https://itsfoss.com/wp-content/uploads/2022/07/Linux-Kernel-5.18-1.png +[10]: https://itsfoss.com/wp-content/uploads/2022/07/Non-free-repos.png +[11]: https://itsfoss.com/wp-content/uploads/2022/07/Using-Debian-sid.png +[12]: https://github.com/SpiralLinux/SpiralLinux-project/wiki#switching-from-debian-stable-to-the-testing-or-unstable-branch +[13]: https://itsfoss.com/best-linux-desktop-environments/ +[14]: https://itsfoss.com/wp-content/uploads/2022/07/idle-RAM-consumption-on-Cinnamon-DE.png +[15]: https://itsfoss.com/wp-content/uploads/2022/07/idle-RAM-consumption-on-Xfce-DE.png +[16]: https://itsfoss.com/wp-content/uploads/2022/07/Reuires-hardware-acceleration-for-better-performance.png +[17]: https://itsfoss.com/wp-content/uploads/2022/07/VM-3D-acceleration-issue.png +[18]: https://itsfoss.com/wp-content/uploads/2022/07/Shutter.png +[19]: https://itsfoss.com/debian-based-distros/ +[20]: https://linuxmint.com/download_lmde.php diff --git a/sources/tech/20220730 Top 10 Kdenlive Features for Faster Video Editing [Beginner-s Guide].md b/sources/tech/20220730 Top 10 Kdenlive Features for Faster Video Editing [Beginner-s Guide].md new file mode 100644 index 0000000000..b01954ca1f --- /dev/null +++ b/sources/tech/20220730 Top 10 Kdenlive Features for Faster Video Editing [Beginner-s Guide].md @@ -0,0 +1,201 @@ +[#]: subject: "Top 10 Kdenlive Features for Faster Video Editing [Beginner’s Guide]" +[#]: via: "https://www.debugpoint.com/kdenlive-features/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Top 10 Kdenlive Features for Faster Video Editing [Beginner’s Guide] +====== +In this article, I will show you how easy to learn Kdenlive features and create awesome videos. + +![][0] + +Kdenlive is a free and open-source video editor for Linux, Windows and macOS. It’s a [KDE application][1] and is considered one of the best feature-rich video editors. Although other excellent contenders exist in the [free video editor][2] space, such as Blender and Da Vinci Resolve, Kdenlive is the “OG” of all. I think it has all the features you get for free instead of buying costly licenses from commercial video editors. + +Basic video editing in Kdenlive is easy if you know how to do it. Each of these Kdenlive features probably takes less than a minute to learn. + +In this article, I will show you some basic video editing operations in Kdenlive in the easiest way. + +### Top 10 Kdenlive Features + +#### 1. Create Title + +Titles are labels or simple texts which show on top of videos. They are similar to subtitles to explain the context of a frame or scene. It’s straightforward to create a custom title. + +From the menu, select `Project > Add Title Clip`. In the title clip window, you should see a canvas. It’s the size of your video. Now, you can write anything for your title. Moreover, you can change font, colour, size and other text attributes from the right pane. You can add a background via the custom shapes at the top if you wish to add a background. + +Once done, you can click the `Create Title` button, which should be added to your video. Now you can drag the title to the timeline for further manipulation. + +If you want to change something on the Title again, you can `Right-Click` on the title and select `Edit Clip`. + +![Create Title Clip in Kdenlive][3] + +#### 2. Animation in titles + +Suppose you want to do some basic animations of titles, such as zoom-in, zoom-out, and vertical/horizontal scrolling. In that case, it’s super easy via the Animation tab in the edit title dialogue. + +The Animation tab has two main buttons – `Edit Start viewport` and `Edit End viewport`. You can use these two buttons to animate your title. + +For example, click the Edit Start Viewport if you want to scroll a text from bottom to top. It will give you GREEN Canvas. Using the mouse, drag the canvas to the top of the screen. + +Similarly, click on the Edit End Viewport and drag the RED canvas to the bottom, as shown below. + +![Basic Title Animation in Kdenlive][4] + +Now, press Update TItle to change it. The animation happens as if the camera is moving from Start (top) to the End viewport (Bottom) – effectively making your title go from bottom to top. + +![Sample Animation with the above example viewport][5] + +Now you can also play around with several options, such as the duration of the animation. In addition, if you want to zoom in or out, you can change the aspect ratio as well similarly. Moreover, you can also rotate the titles via the X, Y and Z axis as well. + +Finally, you can use all the above features to get the desired animations. + +#### 3. One-click transition (fade in and fade out) + +In Kdenlive, you can easily apply the fade-in and fade-out transition in any clip with just one click. Select any clip (video, audio or title) and mouseover. On the left top section, you should see a green circle. Drag that green circle to the right on how long you want the transition. + +Similarly, on the right-top, you should see a red circle. And you can repeat the steps easily. + +See the below image. + +![How easy to add fade-in and fade-out in Kdenlive][6] + +Additionally, you can further change the time or ‘fade to black’ effect in your transitions with settings on the right side. + +![Fade-in and Fade-out example][7] + +See how easy it is to add a transition? + +#### 4. Cut video, audio & anything + +The most used operation in any video editing is cutting the clips. Kdenlive makes it so easy for you. It is required for better storytelling and composition. + +To cut a clip, simple use the `Razor tool` or press `X` after selecting the clip. Then click on the timestamp where you want it to happen. And that’s it. You can now use the pointer tool to move around the clipped part or delete them. + +See it in action below. + +![Slicing the clips is super easy in Kdenlive][8] + +#### 5. Moving a section of blocks + +When working on a complex edit, such as movies or short films, you create hundreds of small clips across tracks in the timeline. Moving them as a single or a group might feel tedious at first. But Kdenlive makes it easy. + +You can quickly move a single clip, or a set of clips together left or right via the `spacer tool` or by pressing `M` from the keyboard. Click on the spacer tool and drag your mouse for easy movement. Keep the mouse pointer in the proper place to move them around. + +In addition, you can also press Left Shift from the keyboard and select a select of clips to move. + +![Moving the clips using the spacer tool][9] + +#### 6. Reusing a title + +Reusing stuff saves time and money for everyone. Especially when you spend some hours creating that stunning title animation, and next time, you can import it to your next project and use it. + +So to save a title animation, open the `Edit Title Clip` window and click on the `Save As` button in the toolbar. Then give a name and save it. The file saves in your home `Videos > Titles` folder. + +Next time, you can open `Project Bin > Add Template Title` and select the one you saved. + +![Saving the title clips][10] + +It’s super easy. Also, you may want to download a massive list of pre-made titles from the [Kde Store][11]! + +#### 7. Changing colour profiles + +Colour grading is an important aspect of movie making or video editing. It often comes during the post-production phase. Kdenlive brings a vast list of colour effects you can combine and use for your target story. + +To apply the colour effects, go to the `Effects` tab in the project Bin. Then drag any `Colour and Image Correction` effect to the target clip. And now, you can apply or tweak various settings for that effect using the right panel. + +All the changes are live in the canvas for easy preview. + +![Colour Grading in Kdenlive][12] + +#### 8. Audio volume controls + +Similar to video or colour profiles, audio is also an essential item to consider in storytelling. The actual camera footage may have noises or volume problems. In Kdenlive, you can easily change the volume decibels. Select the audio track; on the right side, you should see the left and right channels. Also, the master control allows you to change the audio channels’ decibels. + +You can also add various effects to the Audio from the effects tab. + +![Changing Audio track properties][13] + +#### 9. Pan and Zoom + +The Pan and Zoom effect is easy to apply if you know how to use it in Kdenlive. Here’s how you can apply a zoom animation to a video section. + +* Drag the Transform, `Distort and Perspective > Transform` effect to the clip. +* Move the pointer to a position where you want the zoom to effect (say up to 200%). +* Click on `add Keyframe`. On this, the keyframe changes its size to 200%. +* Now, if you play from the beginning, you should see the video zooming in to 200%. + +* Similarly, if you want to Pan, move the pointer to the specific position. Then click add a keyframe. +* On the preview canvas, there is a red circle in the centre. Drag the circle to the position where you want to pan into. And that’s it. + +If you play it now, you can see the video pans into your keyframe timestamp. + +Now there are various options such as X, Y and Z axis change of the clip, keyframe interpolation and compositing, which you can play around with. + +Here’s a quick video demonstrating the above two pan and zoom methods – the easiest way. + +![][14] + +#### 10. Freeze frame + +If you want a still frame from a video, you can also do that using Kdenlive. To do that, go to the video timestamp you want to freeze. `Right-click` on the preview and select `Extract Frame to Project`. It creates a jpg file of the frame of the video and adds it to the project bin. + +Once done, you can cut the clip using the Razor tool, drag the image down and append the rest of the clips. So, effectively you now have a freeze frame of a single moment in your video. + +![][15] + +### Bonus Tip: Create vertical videos for Instagram Reels and others + +The entire world’s concentration time narrowed down to 30 seconds of vertical videos. And that’s why Instagram, Tiktok and other social feeds or reels are becoming popular. + +Using Kdenlive, you can easily create these vertical videos. + +Create a new project, and select the Settings tab in the project settings window. Various project profiles are available for your project or target resolutions inside the settings. Select Custom > Vertical HD 60fps. You can also change the pre-sets and create a new profile. And then, you can create titles and animations like any other videos. + +![Project Settings in Kdenlive][16] + +### Wrapping Up + +If you went through all the Kdenlive features above, then I guess you are ready to create incredible videos for YouTube or streaming platforms. They are super easy to use and help you to save time for faster video creation. + +Remember that the above list of features is just scratching the surface since it’s for beginners only. There are hundreds of features of Kdenlive if you want to learn. + +Once you know the basics, you can learn & experience more to create stunning videos and movies. + +That’s why I said Kdenlive is an underrated tool and “OG” of all video editors. Finally, I hope this article helps you learn KDenlive quickly. + +Also, do you want similar articles or deep-dive in each feature for other open-source apps? Let me know the names in the comment box below. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/kdenlive-features/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[0]: https://www.debugpoint.com/wp-content/uploads/2022/07/kdenlive-head.jpg +[1]: https://www.debugpoint.com/tag/kde-apps +[2]: https://www.debugpoint.com/best-free-video-editors-linux-ubuntu/ +[3]: https://www.debugpoint.com/wp-content/uploads/2022/07/Create-Title-Clip-in-Kdenlive.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2022/07/Basic-Title-Animation-in-Kdenlive.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/07/Sample-Animation-with-above-example-viewport.gif +[6]: https://www.debugpoint.com/wp-content/uploads/2022/07/How-easy-to-add-fade-in-and-fade-out-in-Kdenlive.gif +[7]: https://www.debugpoint.com/wp-content/uploads/2022/07/Fade-in-and-Fade-out-example.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2022/07/Slicing-the-clips-are-super-easy-in-Kdenlive.gif +[9]: https://www.debugpoint.com/wp-content/uploads/2022/07/Moving-the-clips-using-spacer-tool.gif +[10]: https://www.debugpoint.com/wp-content/uploads/2022/07/Saving-the-title-clips.png +[11]: https://store.kde.org/browse?cat=335 +[12]: https://www.debugpoint.com/wp-content/uploads/2022/07/Colour-Grading-in-Kdenlive.jpg +[13]: https://www.debugpoint.com/wp-content/uploads/2022/07/Changing-Audio-track-properties.jpg +[14]: https://www.debugpoint.com/wp-content/uploads/2022/07/How-to-Pan-and-Zoom-in-Kdenlive-easy-way.mp4 +[15]: https://www.debugpoint.com/wp-content/uploads/2022/07/Freeze-frame-in-Kdenlive.mp4 +[16]: https://www.debugpoint.com/wp-content/uploads/2022/07/Project-Settings-in-Kdenlive.jpg diff --git a/sources/tech/20220801 AI, ML and DL- What-s the Difference-.md b/sources/tech/20220801 AI, ML and DL- What-s the Difference-.md new file mode 100644 index 0000000000..e6bd5be065 --- /dev/null +++ b/sources/tech/20220801 AI, ML and DL- What-s the Difference-.md @@ -0,0 +1,62 @@ +[#]: subject: "AI, ML and DL: What’s the Difference?" +[#]: via: "https://www.opensourceforu.com/2022/08/ai-ml-and-dl-whats-the-difference/" +[#]: author: "Bala Kalavala https://www.opensourceforu.com/author/bala-kalavala/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +AI, ML and DL: What’s the Difference? +====== +We often use the terms artificial intelligence, machine learning and deep learning interchangeably, even though we read or hear about them almost each day. This article explains how these technologies evolved and in what ways they differ. + +![AI ML and DL What’s the Difference][1] + +Artificial intelligence (AI), machine learning (ML), and deep learning (DL) are often used interchangeably; however, they are not quite the same things. AI is the broadest concept of all, and gives a machine the ability to imitate human behaviour. ML is the application of AI into a system or machine, which helps it to self-learn and improve continually. Lastly, DL uses complex algorithms and deep neural networks to repetitively train a specific model or pattern. + +Let’s look at the evolution and journey of each term to get a better understanding of what AI, ML and DL actually refer to. + +#### Artificial intelligence + +AI has a come a long way since the last 70-odd years, infiltrating into every aspect of our life, whether we know it, and like it or not. Advancements in machine learning and deep learning over the last decade have created an AI boom across industries and organisations of all sizes. Cloud service providers have added to the momentum by developing open source services that are available for free and by offering new use cases. + +![Figure 1: Overview of AI, ML and DL][2] + +AI is perhaps the most worked upon concept since 1956. By 2015, the wide availability of GPUs made parallel processing faster, powerful and cheaper. Cheaper options led to humongous storage of Big Data (plain text to images, to mapping, etc). This created the need for data analytics, more popularly known as data science, leading to the evolution of machine learning as an approach to achieving artificial intelligence. + +#### Machine learning + +ML is the use of algorithms to process, learn and make sense or predict the pattern of available data. More recently, the low-code and no-code concepts of software development are being used in machine learning as self-learning processes that give specific instructions to accomplish particular tasks. The machine is ‘trained’ by using data and algorithms, giving it the ability to learn how to perform the task and, more importantly, apply the learning to evolve continuously. + +![Figure 2: Evolution of AI, ML and DL][3] + +ML was evolved when the developer community focused on AI, and then developed algorithmic decision-tree learning, logic programming, clustering, parallel processing and reinforcement learning. ML was evolved when the developer community focused on AI, and then developed algorithmic decision-tree learning, logic programming, clustering, parallel processing and reinforcement learning. These were all good steps in the right direction but not enough to solve use cases that were of interest to the world. + +#### Deep learning + +DL is an evolution of neural networks and machine learning, and the brainchild of the AI community. It learns about how the human mind works in specific scenarios, and then gets better at that job than humans! As an example, IBM’s Watson played chess against itself and improved at the game so much to eventually beat the world champion. Google’s AlphaGo also learnt how to play the Go board game by playing it over and over to better itself, and became the champion. + +AI, ML and DL are evolving continuously. It’s the intent of everyone involved with data science to advance these concepts to better our daily lives.  The good thing is that the open source community, private enterprises, scientists, and government agencies are all working together for this. + +![Figure 3: Types of AI, ML and DL][4] + +To conclude, while AI helps to create smart intelligent machines, ML helps to build AI-driven applications. DL is a subset of ML; it trains a specific model by leveraging complex algorithms for large volumes of data.  As narrow AI is extremely difficult to develop, ML is addressing the opportunities in this space with rigid computing. DL helps to bring AI and ML together, at least for realising general AI. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/08/ai-ml-and-dl-whats-the-difference/ + +作者:[Bala Kalavala][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/bala-kalavala/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/06/AIML-and-DL-Whats-the-Difference.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-1-Overview-of-AI-ML-and-DL.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-2-Evolution-of-AI-ML-and-DL.jpg +[4]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-3-Types-of-AI-ML-and-DL.jpg diff --git a/sources/tech/20220802 How I use the Linux sed command to automate file edits.md b/sources/tech/20220802 How I use the Linux sed command to automate file edits.md new file mode 100644 index 0000000000..fec2299637 --- /dev/null +++ b/sources/tech/20220802 How I use the Linux sed command to automate file edits.md @@ -0,0 +1,176 @@ +[#]: subject: "How I use the Linux sed command to automate file edits" +[#]: via: "https://opensource.com/article/22/8/automate-file-edits-sed-linux" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How I use the Linux sed command to automate file edits +====== +Here are some tips and tricks to automating file edits from the Linux command line. + +![computer screen][1] + +Image by: Opensource.com + +When I use the Linux command line, whether I'm writing a new program on my desktop computer or managing a website on my web server, I often need to process text files. Linux provides powerful tools that I leverage to get my work done. I frequently use `sed`, an editor that can modify text according to a pattern. + +`sed` stands for *stream editor*, and it edits text in a file and prints the results. One way to use `sed` is to identify several occurrences of one string in a file and replace them with a different string. You can use `sed` to process text files to a seemingly endless degree, but I'd like to share a few ways I use `sed` to help me manage files. + +### Search and replace text in a file on Linux + +To use `sed`, you need to use a *regular expression*. A regular expression is a set of special characters that define a pattern. My most frequent example of using `sed` is replacing text in a file. The syntax for replacing text looks like this: `s/originaltext/newtext/`. The `s` tells sed to perform text replacement or swap occurrences of text. Provide the original text and new text between slashes. + +This syntax will only replace the first occurrence of `originaltext` on each line. To replace every occurrence, even if the original text appears more than once on a line, append `g` to the end of the expression. Here is an example: `s/originaltext/newtext/g`. + +To use this with `sed`, specify this regular expression with the `-e` option: + +``` +$ sed -e 's/originaltext/newtext/g' +``` + +For example, let's say I have a Makefile for a program called **game**, which simulates Conway's Game of Life: + +``` +.PHONY: all run clean + +all: game + +game: game.o +        $(CC) $(CFLAGS) -o game game.o $(LDFLAGS) + +run: game +        ./game + +clean: +        $(RM) *~ +        $(RM) *.o +        $(RM) game +``` + +The name **game** isn't very descriptive, so I might choose to rename it **life**. Renaming the `game.c` source file to `life.c` is easy enough, but now I need to modify the Makefile to use the new name. I can use `sed` to change every occurrence of **game** to **life**: + +``` +$ sed -e 's/game/life/g' Makefile +.PHONY: all run clean + +all: life + +life: life.o +        $(CC) $(CFLAGS) -o life life.o $(LDFLAGS) + +run: life +        ./life + +clean: +        $(RM) *~ +        $(RM) *.o +        $(RM) life +``` + +This prints the `sed` output to the screen, which is a good way to check if the text replacement will do what you want. To make these changes to the Makefile, first, make a backup of the file, then run `sed` and save the output to the original filename: + +``` +$ cp Makefile Makefile.old +$ sed -e 's/game/life/g' Makefile.old > Makefile +``` + +If you are confident that your changes are exactly what you want, use the `-i` or `--in-place` option to edit the file in place. However, I recommend adding a backup filename suffix like `--in-place=.old` to save a copy of the original file in case you need to restore it later. It looks like this: + +``` +$ sed --in-place=.old -e 's/game/life/g' Makefile +$ ls Makefile* +Makefile  Makefile.old +``` + +### Quoting files with sed on Linux + +You can use other features of regular expressions to match specific instances of text. For example, you might need to replace text that occurs at the start of a line. With `sed`, you can match the beginning of a line with **^**, the caret character. + +One way I use "start of line" in replacing text is when I need to quote a file in an email. Let's say I want to share my Makefile in an email, but I don't want to include it as a file attachment. Instead, I prefer to "quote" the file in the body of an email, using **>** before each line. I can use the following `sed` command to print out an edited version to my terminal, which I can copy and paste into a new email: + +``` +$ sed -e 's/^/>/' Makefile +>.PHONY: all run clean +> +>all: life +> +>life: life.o +>       $(CC) $(CFLAGS) -o life life.o $(LDFLAGS) +> +>run: life +>       ./life +> +>clean: +>       $(RM) *~ +>       $(RM) *.o +>       $(RM) life +``` + +The `s/^/>/` regular expression matches the start of each line (**^**) and places a **>** there. Effectively, this starts each line with the **>** symbol. + +The tabs might not show up correctly in an email, but I can replace all tabs in the Makefile with a few spaces by adding another regular expression: + +``` +$ sed -e 's/^/>/' -e 's/\t/  /g' Makefile +>.PHONY: all run clean +> +>all: life +> +>life: life.o +>  $(CC) $(CFLAGS) -o life life.o $(LDFLAGS) +> +>run: life +>  ./life +> +>clean: +>  $(RM) *~ +>  $(RM) *.o +>  $(RM) life +``` + +The `\t` indicates a literal tab, so `s/\t/ /g` tells sed to replace all tabs in the input with two spaces in the output. + +If you need to apply lots of edits to files, you can save your `-e` commands in a file and use `-f` to tell `sed` to use that file as a "script." This approach is especially useful if you need to make the same edits frequently. I might have prepared the Makefile for quoting in email using a script file called `quotemail.sed` : + +``` +$ cat quotemail.sed +s/^/>/ +s/\t/  /g +$ sed -f quotemail.sed Makefile +>.PHONY: all run clean +> +>all: life +> +>life: life.o +>  $(CC) $(CFLAGS) -o life life.o $(LDFLAGS) +> +>run: life +>  ./life +> +>clean: +>  $(RM) *~ +>  $(RM) *.o +>  $(RM) life +``` + +### Learn to work with sed on Linux + +`sed` is a great tool to keep in your Linux command-line toolkit. Explore the `sed` manual page and learn more about how to use it. Type `man sed` at the command line to get complete documentation about the different command line options and how to use `sed` to process text files. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/automate-file-edits-sed-linux + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/features_solutions_command_data.png diff --git a/sources/tech/20220802 Pandas- The Popular Python Library for Data Analysis and Data Science.md b/sources/tech/20220802 Pandas- The Popular Python Library for Data Analysis and Data Science.md new file mode 100644 index 0000000000..a7a8859ec7 --- /dev/null +++ b/sources/tech/20220802 Pandas- The Popular Python Library for Data Analysis and Data Science.md @@ -0,0 +1,100 @@ +[#]: subject: "Pandas: The Popular Python Library for Data Analysis and Data Science" +[#]: via: "https://www.opensourceforu.com/2022/08/pandas-the-popular-python-library-for-data-analysis-and-data-science/" +[#]: author: "Phani Kiran https://www.opensourceforu.com/author/phani-kiran/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Pandas: The Popular Python Library for Data Analysis and Data Science +====== + +*Pandas is a popular Python library. This article describes a few features and functions available in this library, and encourages readers to use it for practical business problems.* + +Pandas provides fundamental and high-level building blocks for practical, real world data analysis in Python. It is one of the most powerful and flexible open source tools for data analysis and manipulation, and provides data structures for modelling and manipulating tabular data (data in rows and columns). + +Pandas has two primary data structures. The first is a ‘series’ data structure that helps to retrieve data from the array or dictionary of Python objects. Data can be retrieved either by position or by specifying the index name. The second is the ‘dataframes’ data structure to store data in rows and columns. Columns have column names and rows are accessed using indexes. Columns can have different types of data including lists, dictionaries, pandas series, another dataframe, NumPy arrays, etc. + +### Processing various file types + +Data is often available in various formats. It is imperative that the tool used for data analysis is able to provide a wide range of methods for handling it. + +With Pandas, one can read various file types like CSV, JSON, XML, Parquet, SQL (see Table 1). + +| | Write | Read | +| :- | :- | :- | +| CSV | to_csv | read_csv | +| JSON | to_json | Read_json | +| Parquet | to_parquet | read_parquet | +| SQL | to_sql | read_sql, read_sql_query, read_sql_table | +| XML | to_xml | read_xml | + +### Data cleansing using Pandas + +In real-world scenarios, data is often incomplete and includes bad data. It is sometimes duplicated. Also, data includes sensitive and confidential information, which needs to be masked. Pandas offers ways to handle bad data by using methods like cleaning, dropping, replacing, masking, etc. + +a.  Empty rows can be removed with the *df.dropna(inplace=True)* operation. + +b.  Empty values can be replaced with *df.fillna(, inplace=True)*. We can specify the column name to be placed in a particular column. + +c. You can mask the values for sensitive and non-public data for all items NOT satisfying the condition *my_list.where(my_list < 5)*. Masking of values satisfying the condition can be done with*my_list.mask(my_list < 5)*. + +d. Duplicates can be dropped from a dataframe using: + +``` +df.drop_duplicates(‘’, keep = False) +df.drop_duplicates(‘’, keep = ‘first’) +df.drop_duplicates(‘’, keep = ‘last’) +``` + +### Data analysis using Pandas + +Table 2 lists the various functions in Pandas that perform data analysis as well as the syntax for usage. (Note: df stands for dataframe.) + +| Function | Description | Syntax | +| :- | :- | :- | +| Head | Head() function returns the first five rows | df.head(x) | +| tail | tail() function returns the last five rows by default | df.tail(x) | +| Loc | Loc function returns a particular row. Slicing of the data is also possible | loc(x:y) | +| Groupby | Groups data on a particular column | groupby(‘’) | +| Sum | Sum of values in a particular column | df[‘column’].sum() | +| Mean | Average of values in a particular column | df[‘column’]. mean() | +| Min | Minimum value in a particular column | df[‘column’].min() | +| Max | Maximum value in a particular column | df[‘column’].max() | +| Sort | Sorts dataframe in a column | df.sort_values([‘column’]) | +| Size | Rows * columns | df.size | +| Describe | Describes details of the dataframe | df.describe | +| Crosstab | Creates a frequency tabulation of rows and columns | pd.crosstab(df[‘column1’], df[‘column2’], margins = True) | +| Duplicated | Returns True or False based on duplicate values in Column1 and Column2 | df.duplicated([column1, ‘column2’]) | + +### Advantages of Pandas + +* It supports multi-index (hierarchical index) used for easy analysis of data having a large number of dimensions. +* It supports the creation of pivot tables, stack and unstack operations. +* Categorical data containing finite values can be processed with Pandas. +* It supports grouping and aggregations. +* Sorting can be explicitly disabled. +* It supports filtering at both row-level (gets the rows satisfying the filter condition) and column-level (selects only the required columns). +* Helps in reshaping of data sets. You can also transpose the values of the array and convert to a List. When you are processing data using Python, you can convert the Pandas dataframe to a multi-dimensional NumPy array; the values member variable is used for this. +* Supports label-oriented slicing of data. + +### The disadvantages + +The code and syntax of Pandas is different from Python, which leads to a steep learning curve for some users. Also, a few concepts like three dimensional data are better handled in other libraries like NumPy. + +Pandas really elevates the data analysis process in an efficient manner. Its compatibility with other libraries makes it very conducive for use in various scenarios. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/08/pandas-the-popular-python-library-for-data-analysis-and-data-science/ + +作者:[Phani Kiran][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/phani-kiran/ +[b]: https://github.com/lkxed diff --git a/sources/tech/20220803 A sysadmin-s guide to network interface configuration files.md b/sources/tech/20220803 A sysadmin-s guide to network interface configuration files.md new file mode 100644 index 0000000000..bce8ab3cf6 --- /dev/null +++ b/sources/tech/20220803 A sysadmin-s guide to network interface configuration files.md @@ -0,0 +1,284 @@ +[#]: subject: "A sysadmin's guide to network interface configuration files" +[#]: via: "https://opensource.com/article/22/8/network-configuration-files" +[#]: author: "David Both https://opensource.com/users/dboth" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +A sysadmin's guide to network interface configuration files +====== +Simplify the complex world of interface configuration files with this handy tutorial. + +![Why the operating system matters even more in 2017][1] + +Image by: Internet Archive Book Images. Modified by Opensource.com. CC BY-SA 4.0 + +In the first article of this series, [Get started with NetworkManager on Linux][2], I looked at what NetworkManager does and some of the tools it provides for viewing network connections and devices. I discussed using the `nmcli` command to view the status of network devices and connections on a host. I also mentioned that NetworkManager does not need interface configuration files for most hosts. However, it can create its own INI-style connection configuration files, and it recognizes the older and now deprecated network interface configuration files. + +This article explores three questions: + +* Why do I not use interface configuration files? +* Why do I use interface configuration files? +* Why do I use the old network interface configuration files? + +Sound confusing? Read on. + +### My network philosophy + +I talk about philosophy a lot. I even wrote a book, [The Linux Philosophy for SysAdmins][3], which has tenets that apply to the design and structure of computers, operating systems, and networks. I won't bore you with all the details, but there are some things to consider when designing–or redesigning–a network. + +As a "Lazy SysAdmin," I like to "Find the Simplicity"–yes, those are two of the tenets–and create an elegant network design. This is not just about the physical design and layout of the network components and wiring, although the best, most elegant, and easiest networks to work on are well laid out physically and look good. However, this discussion is about the logical structure of the network. + +### Why I don't use interface configuration files? + +I don't use interface configuration files on my network mostly because each host is dynamically configured at boot time using the [Dynamic Host Configuration Protocol (DHCP) server][4]. This allows centralized configuration and management of a few computers up to hundreds or even thousands of systems. The bottom line is that all the configuration data necessary for each host is stored in the DHCP configuration file, `/etc/dhcp/dhcpd.conf`, where it is centrally managed. + +I impose simplicity on my network by using tools that provide central management for most of the connected hosts–all except for hosts that work as routers and provide server services. The idea is that using DHCP to provide all of the network configuration data needed by most of the network hosts simplifies my job and allows me to be the "Lazy SysAdmin." Suppose something changes on the network, such as the IP address to the default gateway or the primary name server? Changing that information in a single location, the `dhcpd.conf` file, is much less work than changing a static configuration on ten or a thousand hosts. + +NetworkManager does not need local configuration files when DHCP provides the network configuration information. By default, all Fedora and Red Hat hosts obtain their network configuration from a DHCP server. This makes installing new hosts on a network easy and simple. All you need is a DHCP server. + +For most networks with a single host, such as in a home office with one or two laptops and a few other devices, the wireless router provided by the ISP contains the DHCP server required to offer a complete set of configuration data to all your devices. The router's DHCP server provides the network configuration data even if you use the 4-port wired switch on the back of most wireless routers to connect a wired desktop computer. + +### Why I do use interface configuration files? + +Most of my network hosts don't need static network configurations and use DHCP. + +However, there are two hosts on which I do use static network configuration: My network server–the one that runs the DHCP server–and the Linux host I use for my network/firewall. These two hosts are best configured using static setups that don't depend upon external configurations. + +Think about this for a minute. If the DHCP server must have an IP address to send network configuration information, including an IP address, to itself… Well, that just won't work—sort of the network equivalent of the chicken and egg situation. + +DHCP clients request network configuration using a broadcast on the network, and the server responds to that request using the MAC address of the requesting client. The DHCP server cannot also be a DHCP client, so this just won't work. + +Even if using the DHCP server to set its own IP address–and other network configuration attributes–could be made to work, all of the recommendations I see on the Internet suggest that it would be a really terrible idea and that no good administrator would even consider doing such a thing. + +The Linux host I use for a router and firewall has four network interfaces, three of which are currently active, and one on the motherboard, which is defective. It also has a set of forwarding and routing rules that must always be consistent. This configuration is best dealt with using static network settings. + +For example, one interface on my router connects to the WAN side of my wireless router. The wireless router provides an internal DHCP server for hosts connected to its LAN and WiFi side but depends upon either static or DHCP configuration on the WAN side. So I configure both the WAN side of the wireless router and the NIC that connects it to my Linux router using a static setup. + +Another interface on that Linux router connects to the outside world via a static IP address provided by my ISP. If I set that interface to be configured by DHCP, the ISP's router would serve it one of the remaining other IP addresses in the eight-address block I have been assigned. + +Any type of static network configuration, as opposed to DHCP, requires network configuration files. + +### Why I still use the old style ifcfg- files + +The answer to this is really simple. I just have not gotten around to making the switch. These files are located in the `/etc/sysconfig/network-scripts` directory, and–fortunately for me–NetworkManager will still search for and use these if it has none of its own network connection files. There won't be any network connection files because they do not get created automatically, and I have not needed to create them. + +I intend to make the switch in Part 3 of this series and bring my network up to current configuration practices. For now, however, it is still a good idea to know about the old-style network configuration files because there are still a lot of them around. + +### What I have now + +I'll review the current state of the network on my router. Aside from the local loop (`lo` )–which is always present on Unix and Linux hosts–this host currently has three active network interface cards (NICs). Due to the problems with the on-board NIC described in Part 1 of this series, I deactivated it in UEFI/BIOS of this host so that it no longer shows up. I have also [disabled IPv6][5] on my network as I don't need it. + +The following is the `nmcli` command showing the state of the NICs on my router/firewall host: + +``` +[root@wally ~]# nmcli +np4s0: connected to enp4s0 +        "Realtek RTL8111/8168/8411" +        ethernet (r8169), 84:16:F9:04:44:03, hw, mtu 1500 +        ip4 default +        inet4 45.20.209.41/29 +        route4 45.20.209.40/29 metric 102 +        route4 default via 45.20.209.46 metric 102 +  +enp1s0: connected to enp1s0 +        "Realtek RTL8111/8168/8411" +        ethernet (r8169), 84:16:F9:03:E9:89, hw, mtu 1500 +        inet4 192.168.10.1/24 +        route4 192.168.10.0/24 metric 101 +  +enp2s0: connected to enp2s0 +        "Realtek RTL8111/8168/8411" +        ethernet (r8169), 84:16:F9:03:FD:85, hw, mtu 1500 +        inet4 192.168.0.254/24 +        route4 192.168.0.0/24 metric 100 +  +lo: unmanaged +        "lo" +        loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 +  +DNS configuration: +        servers: 192.168.0.52 8.8.8.8 8.8.4.4 +        interface: enp4s0 +  +        servers: 192.168.0.52 8.8.8.8 +        interface: enp2s0 +  +        servers: 192.168.0.52 8.8.8.8 +        interface: enp1s0 +``` + +Each of these NICs has an interface configuration file in the `/etc/sysconfig/network-scripts/` directory. This is because they were originally installed at a time when NetworkManager—or the earlier network service—created those files automatically during installation. Since NetworkManager continues to recognize these files, there is no pressing need for me to do anything different. + +### Interface configuration file naming + +Fortunately, most of you missed out on some of the fun all us old-time sysadmins used to have when adding, removing, or just moving the NIC hardware in hosts with multiple NICs. It seemed like all of the NICs would get renamed whenever anything changed. That meant I would need to determine which name each NIC was given and modify the interface configuration files to match the correct names. + +There are now very consistent NIC naming conventions based on the NIC's logical position on the PCIe or USB data busses. This convention was created around 2009 to eliminate those problems. + +#### How it works–sort of + +The `udev` device manager detects when a new device has been added to the system, such as a new NIC, and creates a rule to identify and name it if one does not already exist. During the early part of the startup phase, the Linux kernel uses `udev` to identify connected devices, including network interface controllers. At this stage, the devices are still known by their traditional names of **ethX**. Shortly after that, `systemd` renames the devices according to a series of hierarchical naming schemes. + +I used my firewall system as an example of a system with multiple network connections. You can also do this on your own Linux hosts. + +``` +[root@wally ~]# dmesg | grep eth +[    2.081738] r8169 0000:01:00.0 eth0: RTL8168e/8111e, 84:16:f9:03:e9:89, XID 2c2, IRQ 126 +[    2.081830] r8169 0000:01:00.0 eth0: jumbo features [frames: 9194 bytes, tx checksumming: ko] +[    2.089218] r8169 0000:02:00.0 eth1: RTL8168e/8111e, 84:16:f9:03:fd:85, XID 2c2, IRQ 127 +[    2.089303] r8169 0000:02:00.0 eth1: jumbo features [frames: 9194 bytes, tx checksumming: ko] +[    2.094383] r8169 0000:04:00.0 eth2: RTL8168e/8111e, 84:16:f9:04:44:03, XID 2c2, IRQ 128 +[    2.094467] r8169 0000:04:00.0 eth2: jumbo features [frames: 9194 bytes, tx checksumming: ko] +[    2.142068] r8169 0000:01:00.0 enp1s0: renamed from eth0 +[    2.152128] r8169 0000:04:00.0 enp4s0: renamed from eth2 +[    2.161346] r8169 0000:02:00.0 enp2s0: renamed from eth1 + +[root@wally ~]# +``` + +This example shows that a little over two seconds into the Linux startup sequence, the **ethX** network devices were located, and less than a second later, they were renamed **enpXs0**. + +All current releases of RHEL, CentOS, and Fedora use the newest NIC naming conventions. Most other distros also use this naming convention. + +The NIC naming convention for these distributions is described in detail in the RHEL 7 document, "Networking Guide," with an explanation of how the names are derived. Using the NetworkManager tools to manage networking is covered in the RHEL 8 document, "Configuring and Managing Networking." + +The following is an excerpt from Chapter 11 of the RHEL 7 "Networking Guide": + +* Scheme 1: Names incorporating Firmware or BIOS provided index numbers for on-board devices (example: eno1), are applied if that information from the firmware or BIOS is applicable and available, else falling back to scheme 2. +* Scheme 2: Names incorporating Firmware or BIOS provided PCI Express hotplug slot index numbers (example: ens1) are applied if that information from the firmware or BIOS is applicable and available, else falling back to scheme 3. +* Scheme 3: Names incorporating physical location of the connector of the hardware (example: enp2s0), are applied if applicable, else falling directly back to scheme 5 in all other cases. +* Scheme 4: Names incorporating interface's MAC address (example: enx78e7d1ea46da), is not used by default, but is available if the user chooses. +* Scheme 5: The traditional unpredictable kernel naming scheme, is used if all other methods fail (example: eth0). + +The primary function of the revised naming schemes is to provide a consistent set of NIC names so that installing a new NIC or even just a reboot would not cause the NIC names to change. This by itself is well worth the changes. I have had plenty of opportunities to fight with the apparently random renaming of multiple **ethX** devices on a single host. That was much less fun than learning the revised naming schemes. + +### Understanding interface configuration files + +These interface configuration files are easy to create and modify. The following configuration files on my firewall/router host are all located in the `/etc/sysconfig/network-scripts` directory. This directory previously contained all of the scripts used to manage the network connections, but NetworkManager has made them obsolete. Only the deprecated interface configuration files might remain in this directory. + +``` +-rw-r--r-- 1 root root 381 Jan 11 +2021 ifcfg-enp1s0 +-rw-r--r-- 1 root root 507 Jul 27 +2020 ifcfg-enp2s0 +-rw-r--r-- 1 root root 924 Mar 31 14:24 ifcfg-enp4s0 +``` + +This is the configuration file for the interface that connects the firewall host to my home network, as you can see from the comment: + +``` +[root@wally network-scripts]# cat ifcfg-enp2s0 +# Interface configuration file for enp2s0 / 192.168.0.254 +# This interface is for the internal network +# Correct as of 20220711 +HWADDR=84:16:f9:03:fd:85 +NAME="enp2s0" +TYPE=Ethernet +ONBOOT=yes +BOOTPROTO=static +IPADDR=192.168.0.254 +PREFIX=24 +DNS1=192.168.0.52 +DNS2=8.8.8.8 +DEFROUTE=no +PEERDNS=yes +PEERROUTES=no +IPV4_FAILURE_FATAL=no +``` + +This file is for a fairly simple static configuration that provides the IP address, the CIDR prefix, and two DNS server IP addresses. No default route (gateway) IP address is specified as that is configured in one of the other interface configuration files. + +The code block below shows the interface configuration file for the connection from my Linux router to the ISP's router. It uses one of the static IP addresses provided to me by my ISP. + +``` +############################################################################## +# Interface configuration file for enp4s0 / 45.20.209.41 +# This NIC was installed to circumvent problems with motherboard NIC, eno1. +------------------------------------------------------------------------------ +# This interface is for the WAN - the AT&T fiber optic external network +# Correct as of 20220711 +############################################################################## +TYPE= "Ethernet" +BOOTPROTO="static" +NM_CONTROLLED= "yes" +DEFROUTE= "yes" +NAME=enp4s0 +UUID="fa2117dd-6c7a-44e0-9c9d-9c662716a352" +ONBOOT= "yes" +HWADDR=84:16:f9:04:44:03 +IPADDR=45.20.209.41 +PREFIX=29 +GATEWAY=45.20.209.46 +DNS1=192.168.0.52 +DNS2=8.8.8.8 +DNS3=8.8.4.4 +PEERDNS=no +IPv6INIT=no +IPv6_AUTOCONF=no +IPv6_DEFROUTE=no +``` + +Since I don't use IPv6 and have disabled it, I could delete the IPv6 statement in both files. + +#### Network configuration variables + +The table below lists the most common network configuration variables, along with some brief explanations for each. Many IPv6 options are functionally equivalent to the similarly named IPv4 ones. Local configuration variable settings override those provided by a DHCP server. You can use DHCP for configuring a host but use an interface configuration file to override one or more of the DHCP configuration variables. + +| Configuration variable | Description | +| :- | :- | +| TYPE | Type of network such as Ethernet or token ring. | +| PROXY_METHOD | Proxy configuration method. "none" means no proxy is in use. | +| BROWSER_ONLY | Whether a proxy configuration is for browsers only. | +| BOOTPROTO | Options are dhcp, bootp, none, and static. The "none" option implies DHCP. | +| DEFROUTE | This interface is the default route for this host to the outside world. | +| IPv4_FAILURE_FATAL | If this is set to "no" failure to obtain an IPv4 connection will not affect any attempt to make an IPv6 connection. | +| NAME | The interface name, such as enp0s3. This should match the interface name in the interface configuration file name. | +| UUID | A Universally Unique Identifier for the interface. It is created with a hash of the interface name. The HWADDR is an older means of bonding the file to the hardware interface, and I have found that the UUID can be commented out or deleted without issues. | +| DEVICE | The name of the interface to which this configuration file is bound. | +| ONBOOT | If yes, this starts the interface at boot (really startup time). If set to no, the interface is not started until a user logs in at the GUI or manually starts the interface. | +| HWADDR | The MAC address of the interface. This is one of the more important fields in the file as it is used to bond the file to the correct hardware interface. The UUID is a more recent addition and can also be used, but the HWADDR was first and is more widely used. | +| DNS1, DNS2 | Up to two name servers may be specified. | +| USERCTL | Specifies whether non-privileged users may start and stop this interface. Options are yes/no. | +| IPADDR | The IP Address assigned to this NIC. | +| BROADCAST | The broadcast address for this network such as 10.0.2.255. | +| NETMASK | The netmask for this subnet such as 255.255.255.0. Use either NETMASK or PREFIX but not both. | +| PREFIX | The CIDR prefix for the network such as 24. Use either NETMASK or PREFIX but not both. | +| NETWORK | The network ID for this subnet such as 10.0.2.0. | +| SEARCH | The DNS domain name to search when doing lookups on unqualified hostnames such as using studentvm1 instead of studentvm1.example.com. | +| GATEWAY | The network router or default gateway for this subnet, such as 10.0.2.1. | +| PEERDNS | The yes value indicates that /etc/resolv.conf is to be modified by inserting the DNS server entries specified by DNS1 and DNS2 options in this file. No means do not alter the resolv.conf file. Yes is the default when DHCP is specified in the BOOTPROTO line. | +| IPv6INIT | Whether to initialize IPv6 or not. The default is yes. | +| IPv6_AUTOCONF | Yes means use DHCP for configuration of IPv6 on this interface. | +| IPv6_DEFROUTE | This interface is the IPv6 default route for this host to the outside world. | +| IPv6_FAILURE_FATAL | If this is set to "no" failure to obtain an IPv6 connection will not affect any attempt to make an IPv4 connection. | +| IPv6_ADDR_GEN_MODE | Configure IPv6 Stable Privacy addressing. | + +There are many more configuration variables than are listed here, but these are the ones that are most frequently used. + +### Final thoughts + +There are still plenty of Linux hosts around that use the interface configuration files described in this article. Despite being deprecated, NetworkManager still recognizes these files and can use them to configure network interfaces. However, most modern Linux systems use NetworkManager, so no configuration files are needed unless they serve a special use case, like a server or a router. + +I have a few hosts that require more than just the standard NetworkManager configuration. For me, it has just not been a priority to change from the old interface configuration files to the current connection configuration files used by NetworkManager. To prevent future problems with my network, I need to switch to the NetworkManager network connection files. The next article in this series will describe how I make that switch. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/network-configuration-files + +作者:[David Both][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dboth +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/yearbook-haff-rx-linux-file-lead_0.png +[2]: https://opensource.com/article/22/4/networkmanager-linux +[3]: http://www.both.org/?p=855 +[4]: https://opensource.com/article/22/7/configure-dhcp-server +[5]: https://opensource.com/article/22/8/disable-ipv6 diff --git a/sources/tech/20220803 Play Crossword Puzzle Games on Linux Desktop With this Brand New GNOME App.md b/sources/tech/20220803 Play Crossword Puzzle Games on Linux Desktop With this Brand New GNOME App.md new file mode 100644 index 0000000000..e72ff605f6 --- /dev/null +++ b/sources/tech/20220803 Play Crossword Puzzle Games on Linux Desktop With this Brand New GNOME App.md @@ -0,0 +1,121 @@ +[#]: subject: "Play Crossword Puzzle Games on Linux Desktop With this Brand New GNOME App" +[#]: via: "https://itsfoss.com/crosswords/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Play Crossword Puzzle Games on Linux Desktop With this Brand New GNOME App +====== +I suck at word games. + +Scrabble, spelling bees, and crosswords are certainly not my cup of tea. + +But I know people who are crazy about these games. People who like to spend their tea time solving crossword puzzles. + +You’ll love this new GNOME app if you are one of those [cruciverbalists][1]. + +### Crosswords: GNOME app for solving crossword puzzles + +As reported by [LWN][2], longtime GNOME contributor Jonathan Blandford is developing a new crossword puzzle game for Linux users. It’s called Crosswords, no surprises there. + +There are a few puzzles provided by the game. In addition to that, you can download and play puzzles from popular news outlets like Atlantic, Guardian, etc. You can also open .ipuz and .puz files to play the puzzles you have downloaded or created. + +![crosswords interface][3] + +When you choose the puzzles from a news outlet, Crosswords downloads the puzzle for the current day. + +![Crossword puzzles from The Atlantic][4] + +While there is no scope for downloading the puzzles for the days in the past, your downloaded puzzles are saved in the game, and you can revisit them anytime. + +![Downloaded puzzles are saved for each outlet][5] + +So, all you have to do is download the crossword puzzles daily. You can visit them later if you don’t get time to play it the same day. + +Do note that puzzles may not be downloaded for all the outlets. It showed me an error when I tried downloading from The New Yorker. + +![Crosswords may not be able to download puzzles all the time][6] + +If you are stuck, you can take hints or show incorrect guesses. The ? in the top menu gives you a few options in that regard. + +![Hints are also available][7] + +Your games are saved automatically. You can close the game and resume playing it whenever you get time. + +Sounds promising? Let’s see how you can install it in your Linux distribution. + +### Installing Crosswords + +**The application is under development and you may notice a few issues**. For some reason, the application interface prefers the portrait mode. When I resized the application window, hitting the back button to select some other puzzle made the interface switch to vertical, portrait mode. + +If you can get past this annoyance, you can enjoy Crosswords. + +It is available in Flatpak packing format. If your [distribution has Flatpak support enabled][8], you can install it using the following commands. + +Add the Flathub repository first. + +``` +flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +``` + +Install the package now. + +``` +flatpak install flathub org.gnome.Crosswords +``` + +![crosswords installed linux][9] + +Once installed, you can look for the game in the menu and start it. + +![crossword puzzle game linux][10] + +#### Removing Crosswords + +If you don’t like Crosswords, you can remove it from your system using the following command: + +``` +flatpak uninstall org.gnome.Crosswords +``` + +Press Y when you are asked to confirm. + +![Removing Crosswords][11] + +### Conclusion + +There are plenty of puzzle and board games available for Linux users. [Wordle][12], [2048][13], Sudoku, Mahjong, or even the classic Solitaire game are there for you when you want to kill some time to exercise your brain. + +Tiny games like these do not require heavy graphics and system resources. It’s good to see one more addition to the list of such games. + +If you try Crosswords, don’t forget to share your experience in the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/crosswords/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://www.dictionary.com/browse/cruciverbalist +[2]: https://lwn.net/Articles/903475/ +[3]: https://itsfoss.com/wp-content/uploads/2022/08/crosswords-interface.png +[4]: https://itsfoss.com/wp-content/uploads/2022/08/daily-corssword-puzzle.png +[5]: https://itsfoss.com/wp-content/uploads/2022/08/downloaded-puzzles-crosswords.png +[6]: https://itsfoss.com/wp-content/uploads/2022/08/problem-downloading-crossword-puzzle-from-new-yorker.png +[7]: https://itsfoss.com/wp-content/uploads/2022/08/hints-crosswords.png +[8]: https://itsfoss.com/flatpak-guide/ +[9]: https://itsfoss.com/wp-content/uploads/2022/08/crosswords-installed-linux.png +[10]: https://itsfoss.com/wp-content/uploads/2022/08/crossword-puzzle-game-linux.png +[11]: https://itsfoss.com/wp-content/uploads/2022/08/uninstall-crosswords.png +[12]: https://itsfoss.com/wordle-game-linux/ +[13]: https://itsfoss.com/2048-game/ diff --git a/sources/tech/20220804 3 ways to take screenshots on Linux.md b/sources/tech/20220804 3 ways to take screenshots on Linux.md new file mode 100644 index 0000000000..93a4a48ca3 --- /dev/null +++ b/sources/tech/20220804 3 ways to take screenshots on Linux.md @@ -0,0 +1,71 @@ +[#]: subject: "3 ways to take screenshots on Linux" +[#]: via: "https://opensource.com/article/22/8/screenshots-linux" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +3 ways to take screenshots on Linux +====== +Save time by taking screenshots on Linux with one of my favorite tools. + +![Digital creative of a browser on the internet][1] + +When writing about open source software, I prefer to show a few screenshots to help demonstrate what I'm talking about. As the old saying goes, a picture is worth a thousand words. If you can show a thing, that's often better than merely trying to describe it. + +There are a few ways you can take screenshots in Linux. Here are three methods I use to capture screenshots on Linux: + +### 1. GNOME + +GNOME has a great built-in screenshot tool. Just hit the **PrtScr** key on your keyboard, and GNOME displays a screenshot dialog: + +![Image of GNOME screenshot tool][2] + +The default action is to grab a screenshot of a region. This is an incredibly useful way to crop a screenshot as you make it. Just move the highlight box to where you need it, and use the "grab" corners to change the size. Or select one of the other icons to take a screenshot of the entire screen, or just a single window on your system. Click the circle icon to take the screenshot, similar to the "take photo" button on mobile phones. The GNOME screenshot tool saves screenshots in a Screenshots folder inside your Pictures folder. + +### 2. GIMP + +If you need more options for screenshots, you can grab a screenshot using GIMP, the popular image editor. To take a screenshot, go to **File**and choose the **Create**submenu, and then choose **Screenshot**. + +![Image of the GIMP screenshot menu][3] + +The dialog allows you to take a screenshot of a single window, the entire screen, or just a region. I like that this tool lets you set a delay: how long until you select the window, and how long after that to take the screenshot. I use this feature a lot when I want to grab a screenshot of a menu action, so I have enough time to go to the window and open the menu. + +GIMP opens the screenshot as a new image, which you can edit and save to your preferred location. + +### 3. Firefox + +If you need to take a screenshot of a website, try Firefox's built-in screenshot utility. Right-click anywhere in the web page body, and select **Take Screenshot** from the menu: + +![Image of screenshot utility][4] +​ +Firefox switches to a modal display and prompts you to click or drag on the page to select a region, or use one of the icons to save a copy of the full page or just what's visible in the browser: + +![Image of Firefox modal display][5] + +As you move your mouse around the screen, you may notice that Firefox highlights certain areas. These are block elements on the page, such as a  `
` or another block element. Click on the element to take a screenshot of it. Firefox saves the screenshot to your **Downloads** folder, or wherever you have set as your "download" location. + +If you're trying to document a process, a screenshot can save you a lot of time. Try using one of these methods to take a screenshot on Linux. + +Image by: (Jim Hall, CC BY-SA 40) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/screenshots-linux + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/browser_web_internet_website.png +[2]: https://opensource.com/sites/default/files/2022-07/screenshot-gnome.png +[3]: https://opensource.com/sites/default/files/2022-07/gimp-screenshot.png +[4]: https://opensource.com/sites/default/files/2022-07/firefox-screenshot_cropped_0.png +[5]: https://opensource.com/sites/default/files/2022-07/firefox-screenshot_1.png diff --git a/sources/tech/20220804 How to Install Linux Mint 21 Xfce Edition Step-by-Step.md b/sources/tech/20220804 How to Install Linux Mint 21 Xfce Edition Step-by-Step.md new file mode 100644 index 0000000000..c95603a78a --- /dev/null +++ b/sources/tech/20220804 How to Install Linux Mint 21 Xfce Edition Step-by-Step.md @@ -0,0 +1,224 @@ +[#]: subject: "How to Install Linux Mint 21 Xfce Edition Step-by-Step" +[#]: via: "https://www.linuxtechi.com/how-to-install-linux-mint-21-xfce-edition/" +[#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Install Linux Mint 21 Xfce Edition Step-by-Step +====== +Are you looking for an easy guide for Linux Mint 21 Installation? + +The step-by-step guide on this page will show you how to install Linux Mint 21 Xfce Edition along with screenshots. + +The much-awaited Linux Mint 21 operating system has been released, this is a LTS release (Long Term Support) and will get support and updates until 2027. Vanessa is the code name for Linux Mint 21, it is based on Ubuntu 22.04 and comes with three different desktop environments like Cinnamon, Mate and Xfce. + +##### Linux Mint 21 Features & Updates + +* New Linux Kernel 5.15 +* Introduction of Blueman for connecting Bluetooth devices +* Improved Thumbnails +* Artwork Improvements +* Sticky notes support duplicate notes +* Timeshift is maintained as XApp. + +##### System Requirements for Linux Mint 21 + +* 2 GB RAM or more +* 20 GB free hard disk space or more +* 64-bit Dual core processor or more +* Bootable Media (USB Stick) +* Internet Connectivity (Optional) + +Without any further delay, let’s jump into Linux Mint 21 Xfce Edition installation steps. + +### Step 1) Download Linux Mint 21 Xfce Edition ISO file + +Use the following official web portal to download ISO file. + +* [Download Linux Mint 21 Xfce Edition][1] + +Once ISO file is downloaded, make a bootable USB stick using the ISO file. On Linux desktop use following to create bootable USB, + +* [How to Create Bootable USB Drive on Ubuntu / Linux Mint][2] + +On windows system, use Rufus software to make bootable USB using ISO file. + +### Step 2) Boot System using Bootable USB Stick + +Reboot the system on which you want to install Linux Mint 21, change the boot medium from hard disk to USB from it’s bios settings. + +When the system boots up with bootable USB stick, we will get following beneath screen. + +![Choose-Option-Start-LinuxMint21-Xfce][3] + +Select the first option ‘Start Linux Mint 21 Xfce 64-bit’ and press enter then we will be presented the following screen, + +![Double-click-on-Install-LinuxMint][4] + +Double Click on ‘Install Linux Mint’ + +### Step 3) Choose Language for Installation + +Choose your preferred language and click Continue + +![Language-Selection-for-LinuxMint21-Installation][5] + +### Step 4) Select Keyboard Layout + +Select the keyboard layout as per your setup and then click on Continue + +![Select-Keyboard-Layout-LinuxMint21-Installation][6] + +### Step 5) Install Multimedia Codecs + +This step is optional if you want to install multimedia codecs and system is connected to internet then click on the checkbox, else you can skip it. + +![Install-Multimedia-codecs-LinuxMint21-Installation][7] + +Click on Continue to proceed further + +### Step 6) Choose Installation Type + +On this step, you are required to choose the installation type, basically there are two types, + +* Erase disk and Install Linux Mint: In this type, installer will erase all the data on disk and will create partitions automatically for you. +* Something else: Using this, we can create manual partitions as per our need. + +![Something-Else-Installation-type-Linux-Mint21][8] + +In this guide, we will go with something else option and will create following partitions on 40 GB hard disk. + +* /boot      : 2 GB (xfs file system) +* /              : 10 GB (xfs file system) +* /home     : 25 GB (xfs file system) +* Swap       : 2 GB + +Before start creating partitions, first create a partition table, + +![New-Partition-Table-Linux-Mint21-Installation][9] + +First click on ‘New Partition Table’ and then click Continue + +Now start creating first partition as /boot, select the free space and then click on ‘+’ symbol. + +![Boot-Partition-During-Linux-Mint21-Installation][10] + +Click on OK to finish /boot partition creation. + +In the same way, create next two partitions / and /home of 10G and 25G respectively. + +![mSlash-Partition-During-LinuxMint21-Installation][11] + +![Home-Partition-During-LinuxMint21-Installation][12] + +Create Swap partition of size 2G + +![Swap-Partition-LinuxMint21-Installation][13] + +Click on Ok, + +Note : When you are using UEFI mode then you must create following two additional partitions: + +* EFI System Partition: 100 – 550 MB +* Reserved BIOS Boot Area: 1 MB (This is used to store bootloader code) + +![EFI-System-Partition-Linux-Mint21-Installation][14] + +![Reserved-Bios-Boot-Area-Linux-Mint21-Installation][15] + +Click on OK. + +Once you are done with manual partitions then click on ‘Install Now’ + +![Click-On-Install-Now-Option-Linux-Mint21-Installation][16] + +Click Continue to write changes to disk and to proceed further with installation. + +![Write-changes-to-Disk-Linux-Mint21-Installation][17] + +### Step 7) Choose Your Preferred Timezone + +As per geographical location of your system choose the location and click continue + +![Geographical-Location-Linux-Mint21-Installation][18] + +### Step 8) Enter Local User Details + +In this step, you are requested to enter local user details along with hostname of your system. So, fill in the details as per requirements, + +![Enter-Local-User-Details-LinuxMint21-Installation][19] + +Click Continue to begin the actual installation. + +### Step 8) Linux Mint 21 Installation Started + +As we can see that Linux Mint 21 installation is started and is in progress, + +![Linux-Mint21-Installation-Progress][20] + +Once the installation is completed then installer will instruct you to reboot the system. + +![Restart-Post-Linux-Mint21-Installation][21] + +Click on “Restart Now” + +Note : During the reboot don’t forget to change boot medium from USB to hard disk via bios settings. + +### Step 9) Login Screen and Desktop Environment + +When the system rebooted post installation then we will get following login screen. Use the same user credentials that you have created during the installation. + +![Linux-Mint21-Login-Screen-Post-Installation][22] + +After entering the credentials, following desktop environment screen will appear, + +![Desktop-screen-Linux-Mint21][23] + +Open the terminal and run neofetch command to verify the installation. + +![Neofetch-Command-Verify-Linux-Mint21-Installation][24] + +Great, above output confirms that we have successfully installed Linux Mint 21 Xfce Edition. + +That’s all from this guide, kindly post your queries and feedback in below comments section. + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/how-to-install-linux-mint-21-xfce-edition/ + +作者:[Pradeep Kumar][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/pradeep/ +[b]: https://github.com/lkxed +[1]: https://linuxmint.com/download.php +[2]: https://www.linuxtechi.com/create-bootable-usb-disk-dvd-ubuntu-linux-mint/ +[3]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Choose-Option-Start-LinuxMint21-Xfce.png +[4]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Double-click-on-Install-LinuxMint.png +[5]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Language-Selection-for-LinuxMint21-Installation.png +[6]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Select-Keyboard-Layout-LinuxMint21-Installation.png +[7]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Install-Multimedia-codecs-LinuxMint21-Installation.png +[8]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Something-Else-Installation-type-Linux-Mint21.png +[9]: https://www.linuxtechi.com/wp-content/uploads/2022/08/New-Partition-Table-Linux-Mint21-Installation.png +[10]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Boot-Partition-During-Linux-Mint21-Installation.png +[11]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Slash-Partition-During-LinuxMint21-Installation.png +[12]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Home-Partition-During-LinuxMint21-Installation.png +[13]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Swap-Partition-LinuxMint21-Installation.png +[14]: https://www.linuxtechi.com/wp-content/uploads/2022/08/EFI-System-Partition-Linux-Mint21-Installation.png +[15]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Reserved-Bios-Boot-Area-Linux-Mint21-Installation.png +[16]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Click-On-Install-Now-Option-Linux-Mint21-Installation.png +[17]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Write-changes-to-Disk-Linux-Mint21-Installation.png +[18]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Geographical-Location-Linux-Mint21-Installation.png +[19]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Enter-Local-User-Details-LinuxMint21-Installation.png +[20]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Linux-Mint21-Installation-Progress.png +[21]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Restart-Post-Linux-Mint21-Installation.png +[22]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Linux-Mint21-Login-Screen-Post-Installation.png +[23]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Desktop-screen-Linux-Mint21.png +[24]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Neofetch-Command-Verify-Linux-Mint21-Installation.png diff --git a/sources/tech/20220804 Install Spotify on Manjaro and Other Arch Linux Based Distros.md b/sources/tech/20220804 Install Spotify on Manjaro and Other Arch Linux Based Distros.md new file mode 100644 index 0000000000..23cd04b73b --- /dev/null +++ b/sources/tech/20220804 Install Spotify on Manjaro and Other Arch Linux Based Distros.md @@ -0,0 +1,158 @@ +[#]: subject: "Install Spotify on Manjaro and Other Arch Linux Based Distros" +[#]: via: "https://itsfoss.com/install-spotify-arch/" +[#]: author: "Anuj Sharma https://itsfoss.com/author/anuj/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Install Spotify on Manjaro and Other Arch Linux Based Distros +====== +Spotify needs no introduction. It is the most popular music streaming service. + +You can [play Spotify in a web browser][1], but using the desktop application would be a better option if you use it extensively. + +Why? Because you can control the playback with the media key, get notifications for the songs, and don’t need to worry about accidentally closing the browser tab or window. The desktop client gives a wholesome experience. + +Spotify [provides a repository][2] for Ubuntu and Debian. But what about installing Spotify on Arch Linux? + +Actually, it is even simpler to get the Spotify desktop application on Arch Linux. Just use this command: + +``` +sudo pacman -Syu spotify-launcher +``` + +That’s one of the many ways of installing Spotify on Arch-based Linux distros like Manjaro, [Endeavour OS][3], [Garuda Linux][4], etc. + +In this tutorial, I’ll discuss the following methods of installing Spotify: + +* Using [pacman][5] (you already saw it above but we’ll dig deeper) +* Installing using [Pamac][6] (the package manager from Manjaro) +* Installing using [Flatpak][7] (the universal packaging format) +* Using Snap (official package by the Spotify team) + +### Method 1: Install Spotify using pacman + +Spotify is [available][8] from the Community repository of Arch Linux. It’s actually a Rust implementation of the APT repository provided by Spotify. + +Open your terminal and [use the pacman command][9] in the following manner: + +``` +sudo pacman -Syu spotify-launcher +``` + +Once installed, launch it from the Application Menu and log in to start listening. + +![Spotify on Arch Linux][10] + +Enter the following command to remove it along with its dependencies and config files. + +``` +sudo pacman -Rns spotify-launcher +``` + +### Method 2: Install Spotify using Pamac + +If you are using Manjaro or [have installed Pamac in your system][11], you can use it to install Spotify graphically. + +Open Add/Remove Software from Applications menu. Click on the search icon on the top left and search for Spotify. Then, select the package named `spotify-launcher` and click Apply to install as shown below. + +![Using Pamac to install Spotify][12] + +You can also deselect the package when installed and click Apply to remove it. + +#### Using Pamac CLI + +yes, Pamac also has a command line interface and you can use it in the following manner to get Spotify. + +``` +pamac install spotify-launcher +``` + +And to remove later, use: + +``` +pamac remove spotify-launcher +``` + +### Method 3: Install Spotify using Flatpak + +Many users prefer to install proprietary applications using Flatpak for the sandbox it provides. + +Enter the following command in the terminal to update your system and install Flatpak (if you don’t have it already). + +``` +sudo pacman -Syu flatpak +``` + +Then, enable [Flathub repository][13] using the following command. + +``` +flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo +``` + +Now, install Spotify by entering the command below. + +``` +flatpak install spotify +``` + +To remove the Flatpak for Spotify you can use the command below. + +``` +flatpak remove spotify +``` + +### Method 4: Install Spotify using Snap + +I understand that many people have a strong dislike for the Snap packaging format for its ‘closed’ nature. However, Spotify provides a Snap package officially. You are getting it from the Spotify developers themselves. + +If you have Snap package support on your system, use the following command: + +``` +sudo snap install spotify +``` + +If you want to remove it later, use this command: + +``` +sudo snap remove spotify +``` + +#### Conclusion + +The Arch package discussed in the first method is developed and maintained by [kpcyrd][14]. You can check out the source code for the same [here][15]. + +Please consider donating to the project if you like Arch Linux and want to support it. All the work is done by the community members, who are unpaid volunteers. + +Let me know if you have any issues installing Spotify on Arch. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-spotify-arch/ + +作者:[Anuj Sharma][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/anuj/ +[b]: https://github.com/lkxed +[1]: https://open.spotify.com/ +[2]: https://www.spotify.com/us/download/linux/ +[3]: https://endeavouros.com/ +[4]: https://garudalinux.org/ +[5]: https://wiki.archlinux.org/title/Pacman +[6]: https://wiki.manjaro.org/index.php/Pamac +[7]: https://itsfoss.com/what-is-flatpak/ +[8]: https://archlinux.org/packages/community/x86_64/spotify-launcher/ +[9]: https://itsfoss.com/pacman-command/ +[10]: https://itsfoss.com/wp-content/uploads/2022/07/spotify-e1658764973807.png +[11]: https://itsfoss.com/install-pamac-arch-linux/ +[12]: https://itsfoss.com/wp-content/uploads/2022/07/pamac-spotify-e1658764946532.png +[13]: https://flathub.org +[14]: https://github.com/kpcyrd +[15]: https://github.com/kpcyrd/spotify-launcher diff --git a/sources/tech/20220804 Lengthen the life of your hardware with Linux.md b/sources/tech/20220804 Lengthen the life of your hardware with Linux.md new file mode 100644 index 0000000000..5d938dc594 --- /dev/null +++ b/sources/tech/20220804 Lengthen the life of your hardware with Linux.md @@ -0,0 +1,64 @@ +[#]: subject: "Lengthen the life of your hardware with Linux" +[#]: via: "https://opensource.com/article/22/8/lengthen-hardware-linux" +[#]: author: "Don Watkins https://opensource.com/users/don-watkins" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Lengthen the life of your hardware with Linux +====== +Keep hardware out of landfills by using an operating system that stretches the usable life of your devices. + +![How Linux became my job][1] + +Image by: Opensource.com + +Sustainability is an increasingly important problem when it comes to computing. Reduce, reuse, recycle is a popular motto for environmentally responsible consumption, but applying that to your computer hardware can be challenging. + +Many proprietary operating systems essentially force a hardware upgrade upon you long before your old hardware is used up. If you own a computer with Windows, you've probably needed to purchase a new one to upgrade because your old one didn't meet the hardware requirements of the latest OS. Apple doesn't do any better, either. A MacBook Air I owned was essentially rendered obsolete by an upgrade to macOS Mojave in 2019. + +By contrast, I run Linux on my three-and-a-half-year-old laptop, and it still runs like new. Because the Linux kernel is more efficient with resources than either Windows or macOS, it can run successfully on older hardware. I've never been forced to purchase new hardware in order to upgrade Linux. + +The advantage of Linux is that it is free and open source. With a few notable exceptions, most Linux distributions are available free of charge, and they are not the product of a large technology company with profit in mind. Even businesses that offer Linux products know that profitability doesn't lie in selling software and forcing updates but in stellar support of what their customers are trying to do with that software. + +Simply put, Linux is the best bet for a [sustainable operating system][2]. + +### Making Linux accessible + +There was a time when Linux users were required to be more technologically savvy than the average computer user, but those days are a thing of the past. Most Linux distributions are as plug-and-play as their proprietary counterparts. Better yet, computers that are 10 or more years old can easily run any of the popular Linux distributions without modification. Instead of defining a computer's lifespan with the arbitrary benchmark of operating system support, you can measure it instead by the life of the hardware itself. That's how it should be. Hardware, like everything else, eventually fails, but software we can control. + +This improved sustainability doesn't impede my workflow, either. I have access to a wide range of free and open source software and cloud-based systems that afford me ample opportunities to be creative while keeping my aging hardware out of the landfill. + +### Reuse hardware, reduce electronic waste + +When deciding to refurbish an older computer, first [determine how it will be used][3]. You don't need lots of processing power if you are just surfing the web and writing with a word processor. But if you are working from home and using your computer for [video conferencing][4] with Jitsi or one of the proprietary solutions, you will need more RAM and processing power. In that case, I suggest (based on what's available in 2022) looking for an Intel i5 or AMD Ryzen 5 with at least 8 GB of RAM. + +I put this concept to the test with that old MacBook Air I mentioned earlier. That system was given new life when [I installed Linux][5] in January 2020. + +### Hardware purchases + +If you're not refurbishing and just need a computer, using Linux frees you from purchasing the latest hardware. It's easy to find serviceable laptops and desktops on [FreeGeek][6] and elsewhere that provide good hosts for Linux distributions. If you buy a computer from FreeGeek, it comes with Linux preinstalled and tested, and you're contributing to a community whose mission is "to sustainably reuse technology, enable digital access, and provide education to create a community that empowers people to realize their potential." + +However you get to Linux, it's well worth learning and supporting. It's a sustainable OS that puts you in control of your data, your purchases, and the way you affect the environment. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/lengthen-hardware-linux + +作者:[Don Watkins][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/linux_penguin_green.png +[2]: https://opensource.com/article/22/1/linux-sustainable-os +[3]: https://opensource.com/article/20/8/linux-laptop-video-conferencing +[4]: https://opensource.com/article/20/5/open-source-video-conferencing +[5]: https://opensource.com/article/20/2/macbook-linux-elementary +[6]: https://opensource.com/article/21/4/linux-free-geek diff --git a/sources/tech/20220805 Keep IT Services Up and Running with AI Based Digital Assistants.md b/sources/tech/20220805 Keep IT Services Up and Running with AI Based Digital Assistants.md new file mode 100644 index 0000000000..7d83b0659d --- /dev/null +++ b/sources/tech/20220805 Keep IT Services Up and Running with AI Based Digital Assistants.md @@ -0,0 +1,178 @@ +[#]: subject: "Keep IT Services Up and Running with AI Based Digital Assistants" +[#]: via: "https://www.opensourceforu.com/2022/08/keep-it-services-up-and-running-with-ai-based-digital-assistants/" +[#]: author: "K. Narasimha Sekhar https://www.opensourceforu.com/author/k-narasimha-sekhar/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Keep IT Services Up and Running with AI Based Digital Assistants +====== +*There are many ways AI based digital assistants help in IT operations. Traditionally, they have been deployed to improve helpdesk services. Today you can use them to reduce the mean time to repair (MTTR) of an IT service.* + +enterprises deploy many IT services such as microservices, line of business services, virtual desktop services, and database services for their customers, business groups and employees. In case critical IT services break down, there is a huge negative impact in terms of enterprise revenue, and loss of productivity and reputation. Many of these services are hosted in the enterprise data centre, and can go down due to infrastructure, process, or human failures. Even in the case of public cloud hosting, enterprise integration is a weak link in the chain. + +### Need of the hour + +When a critical IT service is down, IT teams are under enormous pressure to restore it as quickly as possible. Faster root cause analysis is the need of the hour. Teams from various verticals — infrastructure, security, network, storage, and other relevant teams — get into the war room to find the root cause. Tons of logs, event sources, and traces are collected. It is a humongous task for the team to analyse huge data in a short time under panic conditions. Teams need reliable, intelligent, and faster tools to analyse data and provide dependable conclusions. Artificial intelligence based assistants can help in this situation. + +Table 1 lists the typical questions teams need to answer during root cause analysis of IT operations after a critical service becomes unavailable. + +### AI powered digital assistants + +A digital assistant, also called virtual assistant, is an application program that understands natural language voice or chat commands and completes tasks for the user. In the context of root cause analysis or IT operations, the tasks are complex. To execute these tasks, virtual assistants adopt artificial intelligence. + +Administrators, instead of logging in to individual layer consoles, pulling data manually and analysing it, can take the help of digital assistants. These assistants can do all the heavy lifting for IT staff. They assist in accelerating the process, thereby reducing mean time to repair (MTTR). + +Typically, virtual assistants can do the following: + +* On-demand interaction +* Context-driven recommendation +* Automated task execution +* Real-time reporting +* Pull the requested data quickly from multiple sources +* Remove noise and highlight contextual information +* Apply AI algorithms to find required results +* Search for anomaly patterns in huge data +* Correlate events from multiple sources to find relations and cumulative issues +* Enable automation at scale +* Run audit scripts and eliminate false negatives +* Analyse time series data for variations +* Analyse segment failures + +AI based digital assistants can improve regular IT operations as well. They can: + +* Estimate future capacity requirements based on current trends +* Enable automated rolling updates and roll-backs +* Automate mundane admin tasks +* Find anomalies + +| IT phase | Inquiries/Functions/Operations | +| :- | :- | +| Root cause analysis | What is the scope and impact of the issue? +Is the issue specific to one client, group of clients, entire site, or many locations? +Is there any common pattern with respect to the failed devices? +Are there any X, Y, Z events recorded in server logs? +How is the storage performance while users face performance degradation? +Are there any suspicious patterns in CPU, RAM, resource utilisation time series data, etc? +Were there any patches applied on any component in the past 24 hours? +Did new firewall configurations block critical ports? +How many connection failures were there in west region sites? +When X event occurred in component N, what was the database response time? | +| Regular IT operations | Create an upgrade schedule for all regions. +Where should I host the new desktop/app among the available 20 host servers? +How many extra servers are needed in the next quarter? +I am starting patching, informing active users, and sending reminders till they log off. +Detect anomalies. +With API driven interfaces, trigger external tasks like creating a helpdesk ticket, without manual intervention. +Create a management report. | + +* What is the scope and impact of the issue? +* Is the issue specific to one client, group of clients, entire site, or many locations? +* Is there any common pattern with respect to the failed devices? +* Are there any X, Y, Z events recorded in server logs? +* How is the storage performance while users face performance degradation? +* Are there any suspicious patterns in CPU, RAM, resource utilisation time series data, etc? +* Were there any patches applied on any component in the past 24 hours? +* Did new firewall configurations block critical ports? +* How many connection failures were there in west region sites? +* When X event occurred in component N, what was the database response time? + +* Create an upgrade schedule for all regions. +* Where should I host the new desktop/app among the available 20 host servers? +* How many extra servers are needed in the next quarter? +* I am starting patching, informing active users, and sending reminders till they log off. +* Detect anomalies. +* With API driven interfaces, trigger external tasks like creating a helpdesk ticket, without manual intervention. +* Create a management report. + +Table 1 + +### Architecture layers + +Figure 1 shows the blueprint of a typical digital assistant. + +Teams can give commands or query the virtual assistant by voice. The non-linguistic platforms available today are mature enough to understand user utterances and translate them into meaningful intents. A conversational engine can be built with advanced cognitive computing technology that allows virtual assistants to understand and carry out multi-step requests. + +The AI layer is the core part. It understands the intent and structures, and triggers the workflow to capture the required data. It applies suitable AI algorithms to analyse the data, the results of which are communicated back to the user. + +![Figure 1: Digital assistant layers][1] + +IT services are complex and composed of many heterogeneous components. To integrate with these components, virtual assistants must implement different types of interfaces. The widely used interfaces are PowerShell, REST, OData, SQL, SNMP, etc. + +| Inquiry | AI algorithms in scope | +| :- | :- | +| Translate utterances to intents (Conversational engine) | NLP | +| When X event occurred in server N, how was the dependant storage service performance? | Log, event analysis | +| Data stream analysis | Statistical analysis | +| Identify causes of issues by calculating highest probability of the issue occurring | Bayesian algorithm | +| Prioritise root cause options | Bayesian algorithm | +| Find anomaly patterns in resource utilisation | Time series analysis (e.g.,ARIMA) | +| Classify issues | Text analysis | +| Find out optimal resource groups | Segmentation (e.g.,K-Means) | +| IT operations accelerators | Automation | + +Table 2 + +Table 2 summarises the AI algorithms that are suitable for responding to typical inquiries that get triggered during a typical IT service root cause analysis and IT operations. The AI algorithms mentioned are indicative. There are a lot of algorithms available in each segment. We need to choose the right algorithm based on context. A detailed explanation of AI algorithms is beyond the scope of this article. Tons of reference literature is available publicly about AI algorithms. + +![Figure 2: Digital assistant for virtual desktop service][2] + +Figure 2 gives an illustration of how to build a digital assistant for a virtual desktop service. This service consists of many layers, and each one has different types of interfaces. Digital assistants should implement interfaces to interact with all these layers. + +### Advanced auto-heal AI assistant + +Digital assistants can be extended to detect, analyse and auto-heal issues arising during regular operations. In this case no human interaction is needed. Figure 3 shows logical layers of the auto-heal assistant. We need to use many AI algorithms to analyse the issues and trigger correct resolutions. We can make use of neural networks to learn and adapt to dynamic changes. + +![Figure 3: Logical design of an auto-heal assistant][3] + +*State/Condition:* This part defines the rule. The rule is evaluated and if the condition is true, then the state is generated. State can be evaluated when a condition occurs, and is checked on a periodic basis. For example, when an application or system event occurs, then it will be evaluated. If the condition is evaluated as true, the state is processed. In another case, the performance metrics are checked on a periodic basis (for example, once in a minute), the condition is evaluated and state is generated based on the result. + +*Action:* This part defines what action is to be taken in case the trigger occurs. Typically, these are remedial actions (such as restarting a service, increasing resource allocation, etc) to rectify an issue and heal it automatically without human intervention. In case self-healing is not available or it fails, then the administrator can be notified and the service tickets raised automatically. + +| Function | Open source modules | Cloud native deployments | +| :- | :- | :- | +| Chatbot, NLP engine | ChatSDK, +ChatterBot, NTLK | Azure BOT Service, Amazon Lex, Alexa | +| Automation | Ansible, Python, +PowerShell scripts | Serverless functions | +| Visualisation | D3.js, Grafana | Power BI | +| Tracing, Dependency analysis | Jaeger | Azure Monitor, AWS CloudWatch | +| Telemetry | Prometheus, Istio | Azure Monitor, AWS CloudWatch | +| Security | Python libraries | AWS Security Hub, Azure Sentinel, Security Center | +| Infrastructure automation | Ansible, Terraform, Jenkins, Chef, Selenium | ARM, Cloud Foundation | +| AIOPs | Seldon, Logilizer, Aiopstools, Whylogs | Vendor SaaS services | + +Table 3 + +### Challenges + +There are multiple challenges teams can face in implementing and deploying AI based virtual assistants. + +Cost could be a major factor. There are many commercial tools available in the market, but they are expensive. Additionally, we need to buy plugins to interface with enterprise systems. One commercial tool may not be sufficient. For small- and medium-sized companies this cost can be a challenge. Open source modules, and customised orchestration engines suitable for specific enterprise needs, can help reduce these costs. Table 3 lists the recommended open source modules for on-premises deployments. In case of public cloud deployments, we can consider utilising native SaaS services from the cloud provider. + +Integrating virtual assistants into your existing systems and applications can be a challenge as some level of in-house development effort is required. Home-grown scripts need to be maintained and updated as and when systems change. The return on investment of these efforts is high and justifiable. + +Overcoming resistance can be another challenge. Team members may think AI can pose a risk to their jobs. But AI is all about relieving employees of repetitive work and freeing them up to be more creative and perform to their real potential. + +The reasons for each IT service failure can be unique and root cause analysis might yield unexpected results. AI assistants help to analyse data systematically, learn from earlier failures and provide a quick resolution. They help in accelerating root cause analysis and restoring IT services that fail. In addition, these assistants help to fast-track IT admin operations with less manual intervention. Small companies can use open source platforms to build AI digital assistants. + +*Disclaimer:* *The views expressed in this article are that of the author and Wipro does not subscribe to the substance, veracity or truthfulness of the said opinion.* + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/08/keep-it-services-up-and-running-with-ai-based-digital-assistants/ + +作者:[K. Narasimha Sekhar][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/k-narasimha-sekhar/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-1-Digital-assistant.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-2-Digital-assistant-for-virtual-desktop-service.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-3-Logical-design-of-an-auto-heal-assistant.jpg diff --git a/sources/tech/20220806 Fixing Could not get lock -var-lib-dpkg-lock Error in Ubuntu.md b/sources/tech/20220806 Fixing Could not get lock -var-lib-dpkg-lock Error in Ubuntu.md new file mode 100644 index 0000000000..a78da5dde7 --- /dev/null +++ b/sources/tech/20220806 Fixing Could not get lock -var-lib-dpkg-lock Error in Ubuntu.md @@ -0,0 +1,131 @@ +[#]: subject: "Fixing Could not get lock /var/lib/dpkg/lock Error in Ubuntu" +[#]: via: "https://www.debugpoint.com/could-not-get-lock/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Fixing Could not get lock /var/lib/dpkg/lock Error in Ubuntu +====== +We explain some steps and methods by which you can quickly fix the Could not get lock /var/lib/dpkg/lock error, which is common in Ubuntu Linux. + +![][0] + +### The Backstory + +It happens more than you can imagine. One fine morning you boot up your shiny Ubuntu Linux and try to install something or upgrade your system. And you run into this error – `"Could not get lock /var/lib/dpkg/lock ....".` + +Reason? The reason is simple and happens with the “[Advanced Package Tool (apt)][1]“. The apt package tool is busy doing other operations while you asked it to do something. When apt does some package operation, it creates a lock file to prevent this scenario. As per OS principle, a critical resource should be locked while performing system upgrades/updates so that no other process can access it. This is to prevent any unwanted system behaviour. + +There are several variations of this error. But the root cause is the same what I described above. + +Here are some of the errors. + +### Some Sample Errors + +``` +E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it? +``` + +``` +Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 10162 (unattended-upgr) +``` + +``` +E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)E: Unable to lock directory /var/lib/apt/lists/ +``` + +![Sample Could Not Get Lock Error][2] + +### How to Fix: Could not get lock Error + +#### Method 1 (recommended) + +The safest and recommended way to fix this is to wait. Since the apt is running in the background, it’s better you wait for a few minutes. And then, you can try to perform the operation. Most of the time, it resolves the issue by letting the system take care of it. + +#### Method 2 + +The second method is to remove the lock file manually. This requires admin privileges. Open a terminal prompt and run the following command to clear the lock. + +After you run the command, try to perform the operation which caused the error. And you should be fine. + +``` +sudo rm -f /var/lib/dpkg/lock +``` + +#### Method 3 + +The third method is to manually find the process ID of apt, holding the lock and terminate it. + +You can filter all the processes which have apt using the command below. + +``` +ps aux | grep apt +``` + +![process id and process list for apt][3] + +Once you do that, you can get the process ID (2nd column in the above image) and kill it using the following sample command. + +``` +kill -9 processnumber +``` + +#### Method 4 + +The fourth method is to disable the daily auto update check timer [systemd][4] service to try your operation. To do that, open a terminal and disable the service using the following command. + +``` +sudo systemctl stop apt-daily.timer +``` + +Now, reboot the system and try your operation. If you are all set and the error is gone, you can enable the timer service again using the following command. And you should be all set. + +``` +sudo systemctl start apt-daily.timer +``` + +#### Method 5 + +The final method is specific to additional errors which come with apt lock file. + +If the error contains a line like – “E: Unable to lock directory /var/lib/apt/lists/”, then try the following command. + +``` +sudo rm /var/lib/apt/lists/* -vf +``` + +Finally, if nothing works, try cleaning the apt archive lock using the following command. + +``` +sudo rm -f /var/cache/apt/archives/lock +``` + +So, that’s all. + +### Wrapping Up + +In this article, I have explained various ways to resolve this typical error in Ubuntu Linux and related distributions. I am sure any one of the methods should work for you. + +Do let me know in the comment box which command worked out for you for the benefit of others. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/could-not-get-lock/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[0]: https://www.debugpoint.com/wp-content/uploads/2022/08/could-not-head.jpg +[1]: https://wiki.debian.org/Apt +[2]: https://www.debugpoint.com/wp-content/uploads/2022/08/Sample-Could-Not-Get-Lock-Error-1024x547.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2018/07/ps-aux.png +[4]: https://www.debugpoint.com/tag/systemd/ diff --git a/sources/tech/20220806 Old-school technical writing with groff.md b/sources/tech/20220806 Old-school technical writing with groff.md new file mode 100644 index 0000000000..2825c07f35 --- /dev/null +++ b/sources/tech/20220806 Old-school technical writing with groff.md @@ -0,0 +1,209 @@ +[#]: subject: "Old-school technical writing with groff" +[#]: via: "https://opensource.com/article/22/8/old-school-technical-writing-groff" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Old-school technical writing with groff +====== +Take a trip back in time to experience text formatting from a bygone era. + +![Compute like it's 1989][1] + +Image by: LSE Library. Modified by Opensource.com. CC BY-SA 4.0 + +One of my favorite stories about Unix is how it turned into a text processing system. Brian Kernighan [tells the story in his book][2] Unix: A History and a Memoir (chapter 3) but to summarize: The Unix team at Bell Labs ran the original Unix on a PDP-7 computer, but it was a tiny system and didn't have sufficient resources to support new work. So Ken Thompson and others lobbied to purchase a new PDP-11 computer. Management denied the request. Around the same time, the Patents department planned to buy a new computer platform to produce patent applications using proprietary document formatting software. The Unix group proposed that the Patents department instead buy a new PDP-11 for the Unix team, and the Unix team would create formatting software for them. + +That new formatting system was called `nroff`, short for "New Roff," an updated version of a text formatting program called Roff from a 1960s computer system. The name Roff came from the old expression, "I'll run off a document." + +### Basic formatting with nroff + +By default, `nroff`  collects words and fills paragraphs. When `nroff`  encounters a blank line, it starts a new paragraph. For example, start with this article's introduction, which is only a few paragraphs long: + +``` +$ cat intro +Old-school technical writing with groff +Jim Hall +  +One of my favorite stories about Unix is how it turned +into a text processing system. Brian Kernighan tells the +story in his book Unix: A History and a Memoir (chapter 3) +but to summarize: +The Unix team at Bell Labs ran the original Unix on +a PDP-7 computer, but it was a tiny system and didn't +have sufficient resources to support new work. So Ken +Thompson and others lobbied to purchase a new PDP-11 +computer. Management denied the request. Around the same +time, the Patents department planned to buy a new computer +platform to produce patent applications using proprietary +document formatting software. The Unix group proposed +that the Patents department instead buy a new PDP-11 for +the Unix team, and the Unix team would create formatting +software for them. +  +That new formatting system was called nroff, short for +"New Roff," an updated version of a text formatting program +called Roff from a 1960s computer system. The name Roff +came from the old expression, "I'll run off a document." +``` + +If you process this file with `nroff`, lines are "glued" together so the output is paragraphs with full justification. Using `nroff` also hyphenates words, if that helps balance lines in the text: + +``` +$ nroff intro | head +Old‐school technical writing with groff Jim Hall +  +One  of  my  favorite  stories about Unix is how it turned into a +text processing system. Brian Kernighan tells the  story  in  his +book  Unix:  A History and a Memoir (chapter 3) but to summarize: +The Unix team at Bell Labs ran the original Unix on a PDP‐7  com‐ +puter,  but  it  was a tiny system and didn’t have sufficient re‐ +sources to support new work. So Ken Thompson and  others  lobbied +to purchase a new PDP‐11 computer. Management denied the request. +Around the same time, the Patents department planned to buy a new +``` + +Original Unix systems used a typewriter-style printer that used 66 lines of 80 columns on a US Letter page, and `nroff` makes the same assumptions. It also adds empty lines so each page of output is 66 lines per page, but I've used the `head` command to show just the first few lines of output because my sample text isn't very long. + +### Breaking lines and centering text + +The first two lines were meant to be separate lines of text. You can insert a formatting instruction to tell `nroff` to add a line break. All `nroff` instructions start with a dot, followed by a brief command. To add a line break, use the `.br` instruction between the first and second line: + +``` +Old-school technical writing with groff +.br +Jim Hall +``` + +When you process this new file, `nroff` prints the title and author on separate lines: + +``` +$ nroff intro | head +Old‐school technical writing with groff +Jim Hall +  +One  of  my  favorite  stories about Unix is how it turned into a +text processing system. Brian Kernighan tells the  story  in  his +book  Unix:  A History and a Memoir (chapter 3) but to summarize: +The Unix team at Bell Labs ran the original Unix on a PDP‐7  com‐ +puter,  but  it  was a tiny system and didn’t have sufficient re‐ +sources to support new work. So Ken Thompson and  others  lobbied +to purchase a new PDP‐11 computer. Management denied the request. +``` + +You can add other formatting to make this document look better. To center the top two lines, use the `.ce` formatting request. This takes a number argument, to indicate how many lines `nroff` should center. Here, you can center the top two output lines with the `.ce 2` request: + +``` +.ce 2 +Old-school technical writing with groff +.br +Jim Hall +``` + +With this added instruction, `nroff`  correctly centers the first two lines: + +``` +$ nroff intro | head +             Old‐school technical writing with groff +                            Jim Hall +  +One  of  my  favorite  stories about Unix is how it turned into a +text processing system. Brian Kernighan tells the  story  in  his +book  Unix:  A History and a Memoir (chapter 3) but to summarize: +The Unix team at Bell Labs ran the original Unix on a PDP‐7  com‐ +puter,  but  it  was a tiny system and didn’t have sufficient re‐ +sources to support new work. So Ken Thompson and  others  lobbied +to purchase a new PDP‐11 computer. Management denied the request. +``` + +### Adding page margins + +Printing this to a printer results in text starting on the first line of the page, and against the left edge. To add a few lines of extra space from the top of the page, use the `.sp` request, with the number of blank lines to add: + +``` +.sp 5 +.ce 2 +Old-school technical writing with groff +.br +Jim Hall +``` + +By default, `nroff` formats the output so each line is 65 columns wide. Printing to an 80 column US Letter page leaves 15 empty columns. Adding 7 spaces on the left side neatly balances the output with equal left and right page margins. You can create this page offset using the `.po 7` request: + +``` +.po 7 +.sp 5 +.ce 2 +Old-school technical writing with groff +.br +Jim Hall +``` + +Processing the new file with `nroff` produces a plain text page that's ready to print: + +``` +$ nroff intro | head + + + + + + Old‐school technical writing with groff + Jim Hall + + One of my favorite stories about Unix is how it turned into a + text processing system. Brian Kernighan tells the story in his +``` + +### Printing to a laser printer + +Later, the Unix team at Bell Labs acquired a phototypesetting machine, capable of producing printed text similar to a laser printer. To support the typesetter's new capabilities, the Unix team updated `nroff` to become the typesetter-specific `troff` program, and a few years later updated it again to become `ditroff`, the device-independent version of `troff`. + +Linux systems provide modern versions of `nroff` and `troff` using the GNU `groff` program. You can still use the old `nroff` program name to generate plain text output, or `troff` to produce `ditroff` compatible output. Using the `groff` program, you can also prepare documents for other kinds of output files, such as Postscript. + +You can process the same input file using `groff` to print on a Postscript-compatible laser printer by selecting a suitable output type using the `-T` option, such as `-Tps` to generate a Postscript file. For example, I can print to a printer with the [lpr command][3] and the `HP_LaserJet_CP1525nw` device, because that's how my Linux system [recognizes my laser printer][4]: + +``` +$ groff -Tps intro | lpr -P "HP_LaserJet_CP1525nw" +``` + +### Generating other kinds of output + +If you instead want to save the output as a PDF file, you can convert the Postscript using the `ps2pdf` tool: + +``` +$ groff -Tps intro | ps2pdf - > intro.pdf +``` + +To generate a web page from the same file, use `-Thtml` to set the output type to HTML: + +``` +$ groff -Thtml intro > index.html +``` + +The `groff` command supports lots of other built-in formatting requests to provide other kinds of document formatting. If you want to learn the other default formatting requests available to you in the GNU `groff` implementations of `nroff` and `troff`, refer to chapter 5 in the [The GNU Troff Manual][5]. + +Formatting documents using these built-in commands takes a lot of effort to keep everything looking the same. Technical writers who use `groff` instead use a collection of formatting requests called *macros*, which provide their own commands to generate section headings, paragraphs, block quotes, footnotes, lists, and other useful document formatting. To learn more about one popular macro package, read [How to format academic papers on Linux with groff -me][6] on Opensource.com. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/old-school-technical-writing-groff + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/1980s-computer-yearbook.png +[2]: https://opensource.com/article/20/8/unix-history +[3]: https://opensource.com/article/21/9/print-files-linux +[4]: https://opensource.com/article/18/3/print-server-raspberry-pi +[5]: https://www.gnu.org/software/groff/manual/groff.html#gtroff-Reference +[6]: https://opensource.com/article/18/2/writing-academic-papers-groff-me diff --git a/sources/tech/20220807 How to Upgrade to Linux Mint 21 [Step by Step Tutorial].md b/sources/tech/20220807 How to Upgrade to Linux Mint 21 [Step by Step Tutorial].md new file mode 100644 index 0000000000..c0d0688386 --- /dev/null +++ b/sources/tech/20220807 How to Upgrade to Linux Mint 21 [Step by Step Tutorial].md @@ -0,0 +1,411 @@ +[#]: subject: "How to Upgrade to Linux Mint 21 [Step by Step Tutorial]" +[#]: via: "https://itsfoss.com/upgrade-linux-mint-version/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: "robsean" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Upgrade to Linux Mint 21 [Step by Step Tutorial] +====== +This is a regularly updated guide for upgrading an existing Linux Mint install to a new available version. + +There are three sections in this article that show the steps for upgrading between various major versions of Linux Mint: + +* Section 1 is about upgrading to Mint 21 from Mint 20.3 (GUI upgrade tool) +* Section 2 is about upgrading to Mint 20 from Mint 19.3 (Command-line based upgrader) +* Section 3 is about upgrading to Mint 19 from Mint 18.3 (if someone is still using it) + +You can follow the appropriate steps based on your current Mint version and requirement. + +This is a regularly updated guide for upgrading an existing Linux Mint install to a new available version. + +The guide has been updated with the steps for upgrading to Linux Mint 21 from Mint 20.3. Linux Mint now has a GUI tool to upgrade to the latest version. + +### Things to know before you upgrade to Linux Mint 21 + +Before you go on upgrading to Linux Mint 21, you should consider the following: + +* Do you really need to upgrade? Linux Mint 20.x is supported for several more years. +* You’ll need a good speed internet connection to download upgrades of around 1.4 GB. +* It may take a couple of hours to complete the upgrade procedure based on your internet speed. You must have patience. +* It is a good idea to make a live USB of Linux Mint 21 and try it in a live session to see if it is compatible with your hardware. Newer kernels might have issues with older hardware, so testing it before the real upgrade or install can save you a lot of frustration. +* A fresh installation is always better than a major version upgrade but installing Linux Mint 21 from scratch would mean losing your existing data. You must take backup on an external disk. +* Though upgrades are mostly safe, it’s not 100% failproof. You must have system snapshots and proper backups. +* You can upgrade to Linux Mint 21 only from Linux Mint 20.3 Cinnamon, Xfce and MATE. [Check your Linux Mint version][1] first. If you are using Linux Mint 20.2 or 20.1, you need to upgrade to 20.3 first from the Update Manager. If you are using Linux Mint 19, I advise you to go for a fresh installation rather than upgrading to several Mint versions. + +Once you know what you will do, let’s see how to upgrade to Linux Mint 21. + +### Upgrading to Linux Mint 21 from 20.3 + +Check your Linux Mint version and ensure that you are using Mint 20.3. You cannot upgrade to Mint 21 from Mint 20.1 or 20.2. + +#### Step 1: Update your system by installing any available updates + +Launch the Update Manager with Menu -> Administration -> Update Manager. Check if there are any package updates available. If yes, install all the software updates first. + +![Check for Pending Software Updates][2] + +You may also use this command in the terminal for this step: + +``` +sudo apt update && sudo apt upgrade -y +``` + +#### Step 2: Make a backup of your files on an external disk [Optional yet recommended] + +Timeshift is a good tool for creating system snapshots, but it’s not the ideal tool for your documents, pictures, and other such non-system, personal files. I advise making a backup on an external disk. It’s just for the sake of data safety. + +When I say making a backup on an external disk, I mean to simply copy and paste your Pictures, Documents, Downloads, and Videos directory on an external USB disk. + +If you don’t have a disk of that much size, at least copy the most important files you cannot afford to lose. + +#### Step 3: Install the upgrade tool + +Now that your system is updated, you are ready to upgrade to Linux Mint 21. Linux Mint team provides a GUI tool called [mintupgrade][3] for upgrading Linux Mint 20.3 to Linux Mint 21. + +You can install this tool using the command below: + +``` +sudo apt install mintupgrade +``` + +#### Step 4: Run GUI Tool from the terminal + +You cannot find the new GUI tool listed in the App menu. To launch, you need to enter the following command in the terminal: + +``` +sudo mintupgrade +``` + +This simple yet comprehensive tool takes you through the upgrading process. + +![Mint Upgrade Tool Home Page][4] + +After some initial tests, it will prompt for a Timeshift Backup. If you already have a backup created, you are good to go. + +![Upgrade Tool Prompting No Timeshift Snapshots][5] + +Else, you need to [create a backup][6] here since it is mandatory to continue. + +![Taking Snapshot With Timeshift][7] + +Some PPAs might be already available for Ubuntu 22.04 and thus for Mint 21. But if the PPA or repository is not available for the new version, it may impact the upgrade procedure with broken dependencies. You will be prompted the same within the upgrade tool. + +![Kazam PPA Does Not Support Jammy][8] + +Here, I used [Kazam latest versio][9]n through its PPA. The same PPA is supported only up to Impish, showing the error since Linux Mint 21 is based on Jammy. + +You will be given the option to disable the PPAs through Software Sources within the upgrade tool. + +![Disable Unsupported PPAs in Software Sources][10] + +Since the PPA is disabled, the package becomes ‘foreign’ because the version available from the repository doesn’t match the ones from Mint repositories. So you need to downgrade the packages to a version available on the repository. + +![Downgrade Package to Avoid Conflicts][11] + +The upgrade tool now lists the changes that need to be carried out. + +![List Changes That Need to be Done][12] + +Upon accepting, the tool will start downloading packages. + +![Phase 2 – Simulation and Package Download][13] + +![Package Downloading][14] + +![Upgrading Phase][15] + +It will list orphan packages, that can be removed. You can either remove the whole suggestions by pressing the “Fix” button or will keep certain packages. + +#### Keep Certain Orphan packages + +In order to keep packages from the orphan packages list, you need to go to the preferences from the hamburger menu on top left. + +![Selecting Orphan Packages You Want to Keep with Preferences][16] + +From the preference dialog box, you need to go to **Orphan Packages** and use the “plus” symbol to add packages by name. + +![Specify Name of the Package to Keep][17] + +Once done, it will continue upgrading and after some time, you will be prompted a successful update notification. + +![Upgrade Successful][18] + +At this point, you need to reboot your system. Upon rebooting, you will be in the new Linux Mint 21. + +![Neofetch Output Linux Mint 21][19] + +### How to upgrade to Linux Mint 20 + +Before you go on upgrading to Linux Mint 20, you should consider the following: + +* Do you really need to upgrade? Linux Mint 19.x is supported till 2023. +* If you [have a 32-bit system][20], you cannot install or upgrade to Mint 20. +* You’ll need a good speed internet connection to download upgrades of around 1.4 GB in size. +* Based on your internet speed, it may take a couple of hours to complete the upgrade procedure. You must have patience. +* It is a good idea to make a live USB of Linux Mint 20 and try it in a live session to see if it is compatible with your hardware. Newer kernels might have issues with older hardware and hence testing it before the real upgrade or install can save you a lot of frustration. +* A fresh installation is always better than a major version upgrade but [installing Linux Mint][21] 20 from scratch would mean you’ll lose your existing data. You must take backup on an external disk. +* Though upgrades are mostly safe, it’s not 100% fail proof. You must have system snapshots and proper backups. +* You can upgrade to Linux Mint 20 only from Linux Mint 19.3 Cinnamon, Xfce and MATE. [Check your Linux Mint version][22] first. If you are using Linux Mint 19.2 or 19.1, you need to upgrade to 19.3 first from the Update Manager. If you are using Linux Mint 18, I advise you go for a fresh installation rather than upgrading to several Mint versions. +* The upgrade process is done via command line utility. If you don’t like using terminal and commands, avoid upgrading and go for a fresh installation. + +Once you know what you are going to do, let’s see how to upgrade to Linux Mint 20. + +![A Video from YouTube][23] + +[Subscribe to our YouTube channel for more Linux videos][24] + +#### Step 1: Make sure you have a 64-bit system + +Linux Mint 20 is a 64-bit only system. If you have a 32-bit Mint 19 installed, you cannot upgrade to Linux Mint 20. + +In a terminal, use the following command to see whether you are using 64-bit operating system or not. + +``` +dpkg --print-architecture +``` + +![Mint 20 Upgrade Check Architecture][25] + +#### Step 2: Update your system by installing any available updates + +Launch the Update Manager with Menu -> Administration -> Update Manager. Check if there are any package updates available. If yes, install all the software updates first. + +![Check for pending software updates][26] + +You may also use this command in the terminal for this step: + +``` +sudo apt update && sudo apt upgrade -y +``` + +#### Step 3: Create a system snapshot with Timeshift [Optional yet recommended] + +[Creating a system snapshot with Timeshift][27] will save you if your upgrade procedure is interrupted or if you face any other issue. **You can even revert to Mint 19.3 this way**. + +Suppose your upgrade failed for power interruption or some other reason and you end up with a broken, unusable Linux Mint 19. You can plug in a live Linux Mint USB and run Timeshift from the live environment. It will automatically locate your backup location and will allow you to restore your broken Mint 19 system. + +This also means that you should keep a live Linux Mint 19 USB handy specially if you don’t have access to a working computer that you can use to create live Linux Mint USB in the rare case the upgrade fails. + +![Create a system snapshot in Linux Mint][28] + +#### Step 4: Make a backup of your files on an external disk [Optional yet recommended] + +Timeshift is a good tool for creating system snapshots but it’s not the ideal tool for your documents, pictures and other such non-system, personal files. I advise making a backup on an external disk. It’s just for the sake of data safety. + +When I say making a backup on an external disk, I mean to simply copy and paste your Pictures, Documents, Downloads, Videos directory on an external USB disk. + +If you don’t have a disk of that much of a size, at least copy the most important files that you cannot afford to lose. + +#### Step 5: Disable PPAs and third-party repositories [Optional yet recommended] + +It’s natural that you might have installed applications using some [PPA][29] or other repositories. + +Some PPAs might be already available for Ubuntu 20.04 and thus for Mint 20. But if the PPA or repository is not available for the new version, it may impact the upgrade procedure with broken dependencies. + +For this reason, it is advised that you disable the PPAs and third-party repositories. You may also delete the applications installed via such external sources if it is okay with you and doesn’t result in config data loss. + +In the Software Sources tool, disable additional repositories, disable PPAs. + +![Disable Ppa Mint Upgrade][30] + +You should also **downgrade and then remove foreign packages** available in the maintenance tab. + +For example, I installed Shutter using a PPA. I disabled its PPA. Now the package becomes ‘foreign’ because the version available from the repository doesn’t match the ones from Mint repositories. + +![Foreign Package Linux Mint][31] + +#### Step 6: Install the upgrade tool + +Now that your system is updated, you are ready for upgrading to Linux Mint 20. Linux Mint team provides a command line tool called [mintupgrade][32] for the sole purpose of upgrading Linux Mint 19.3 to Linux Mint 20. + +You can install this tool using the command below: + +``` +sudo apt install mintupgrade +``` + +#### Step 7: Run an upgrade sanity check + +The mintupgrade tool lets you run a sanity check by simulating initial part of the upgrade. + +You can run this check to see what kind of changes will be made to your system, which packages will be upgraded. It will also show the packages that cannot be upgraded and must be removed. + +``` +mintupgrade check +``` + +There won’t be any real changes on your system yet (even if it feels like it is going to make some changes). + +This step is important and helpful in determining whether your system can be upgrade to Mint 20 or not. + +![Mint Upgrade Check][33] + +If this steps fails half-way through type **mintupgrade restore-sources** to go back to your original APT configuration. + +#### Step 8: Download package upgrades + +Once you are comfortable with the output of mintupgrade check, you can download the Mint 20 upgrade packages. + +Depending on your internet connection, it may take some time in downloading these upgrades. Make sure your system is connected to a power source. + +While the packages are being downloaded, you can continue using your system for regular work. + +``` +mintupgrade download +``` + +![Mint 20 Upgrade Download][34] + +Note that this command points your system to the Linux Mint 20 repositories. If you want to go back to Linux Mint 19.3 after using this command, you still can do that with the command “**mintupgrade restore-sources**“. + +#### Step 9: Install the Upgrades [Point of no return] + +Now that you have everything ready, you can upgrade to Linux Mint 20 using this command: + +``` +mintupgrade upgrade +``` + +Give it some time to install the new packages and upgrade your Mint to the newer version. Once the procedure finishes, it will ask you to reboot. + +![Linux Mint 20 Upgrade Finish][35] + +#### Enjoy Linux Mint 20 + +Once you reboot your system, you’ll see the Mint 20 welcome screen. Enjoy the new version. + +![Welcome To Linux Mint 20][36] + +### Upgrading to Mint 19 from Mint 18 + +The steps for upgrading to Linux Mint 19 from 18.3 is pretty much the same as the steps you saw for Mint 20. The only change is in checking for display manager. + +I’ll quickly mention the steps here. If you want more details, you can refer to Mint 20 upgrade procedure. + +**Step1:** Create a system snapshot with Timeshift [Optional yet recommended] + +**Step2:** Make a backup of your files on an external disk [Optional yet recommended] + +**Step 3: Make sure you are using LightDM** + +You must use [LightDM display manager][37] for Mint 19. To check which display manager you are using, type the command: + +``` +cat /etc/X11/default-display-manager +``` + +If the result is “/usr/sbin/**lightdm**“, you have LightDM and you are good to go. + +![LightDM Display Manager in Linux Mint][38] + +On the other hand, if the result is “/usr/sbin/**mdm**“, you need to install LightDM, [switch to LightDM][39] and removing MDM. Use this command to install LightDM: + +``` +apt install lightdm lightdm-settings slick-greeter +``` + +While installing, it will ask you to choose the display manager. You need to select LightDM. + +Once you have set LightDM as your display manager, remove MDM and reboot using these commands: + +``` +apt remove --purge mdm mint-mdm-themes* +sudo dpkg-reconfigure lightdm +sudo reboot +``` + +**Step 4: Update your system by installing any available updates** + +``` +sudo apt update && sudo apt upgrade -y +``` + +**Step 5: Install the upgrade tool** + +``` +sudo apt install mintupgrade +``` + +**Step 6: Check upgrade** + +``` +mintupgrade check +``` + +**Step 7: Download package upgrades** + +``` +mintupgrade download +``` + +**Step 8: Apply upgrades** + +``` +mintupgrade upgrade +``` + +Enjoy Linux Mint 19. + +### Did you upgrade to Linux Mint 21? + +Upgrading to Linux Mint 20 might not be a friendly experience but upgrading to Mint 21 is made a lot more simple with the new dedicated GUI upgrade tool. + +I hope you find the tutorial helpful. Did you upgrade to Linux Mint 21 or you opted for a fresh installation? + +If you faced any issues or if you have any questions about the upgrade procedure, please feel free to ask in the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/upgrade-linux-mint-version/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/check-linux-mint-version/ +[2]: https://itsfoss.com/wp-content/uploads/2022/08/check-for-pending-software-updates.png +[3]: https://github.com/linuxmint/mintupgrade/blob/master/usr/bin/mintupgrade +[4]: https://itsfoss.com/wp-content/uploads/2022/08/mint-upgrade-tool-home-page.png +[5]: https://itsfoss.com/wp-content/uploads/2022/08/upgrade-tool-prompting-no-timeshift-snapshots.png +[6]: https://itsfoss.com/backup-restore-linux-timeshift/ +[7]: https://itsfoss.com/wp-content/uploads/2022/08/taking-snapshot-with-timeshift.png +[8]: https://itsfoss.com/wp-content/uploads/2022/08/kazam-ppa-does-not-support-jammy.png +[9]: https://itsfoss.com/kazam-screen-recorder/ +[10]: https://itsfoss.com/wp-content/uploads/2022/08/disable-unsupported-ppas-in-software-sources.png +[11]: https://itsfoss.com/wp-content/uploads/2022/08/downgrade-package-to-avoid-conflicts.png +[12]: https://itsfoss.com/wp-content/uploads/2022/08/list-changes-that-need-to-be-done.png +[13]: https://itsfoss.com/wp-content/uploads/2022/08/phase-2-simulation-and-package-download-.png +[14]: https://itsfoss.com/wp-content/uploads/2022/08/package-downloading.png +[15]: https://itsfoss.com/wp-content/uploads/2022/08/upgrading-phase.png +[16]: https://itsfoss.com/wp-content/uploads/2022/08/selecting-orphan-packages-you-want-to-keep-with-preferences.png +[17]: https://itsfoss.com/wp-content/uploads/2022/08/specify-name-of-the-package-to-keep.png +[18]: https://itsfoss.com/wp-content/uploads/2022/08/upgrade-successful-800x494.png +[19]: https://itsfoss.com/wp-content/uploads/2022/08/neofetch-output-linux-mint-21.png +[20]: https://itsfoss.com/32-bit-64-bit-ubuntu/ +[21]: https://itsfoss.com/guide-install-linux-mint-16-dual-boot-windows/ +[22]: https://itsfoss.com/check-linux-mint-version/ +[23]: https://youtu.be/LYnXEaiAjsk +[24]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[25]: https://itsfoss.com/wp-content/uploads/2020/07/mint-20-upgrade-check-architecture.jpg +[26]: https://itsfoss.com/wp-content/uploads/2020/07/update-manager-linux-mint.jpg +[27]: https://itsfoss.com/backup-restore-linux-timeshift/ +[28]: https://itsfoss.com/wp-content/uploads/2018/07/snapshot-linux-mint-timeshift.jpeg +[29]: https://itsfoss.com/ppa-guide/ +[30]: https://itsfoss.com/wp-content/uploads/2020/07/disable-ppa-mint-upgrade.jpg +[31]: https://itsfoss.com/wp-content/uploads/2020/07/foreign-package-linux-mint.jpg +[32]: https://github.com/linuxmint/mintupgrade/blob/master/usr/bin/mintupgrade +[33]: https://itsfoss.com/wp-content/uploads/2020/07/mint-upgrade-check.jpg +[34]: https://itsfoss.com/wp-content/uploads/2020/07/mint-upgrade-download.jpg +[35]: https://itsfoss.com/wp-content/uploads/2020/07/linux-mint-20-upgrade-finish.jpg +[36]: https://itsfoss.com/wp-content/uploads/2020/07/welcome-to-linux-mint-20.jpg +[37]: https://wiki.archlinux.org/index.php/LightDM +[38]: https://itsfoss.com/wp-content/uploads/2018/07/lightdm-linux-mint.jpeg +[39]: https://itsfoss.com/switch-gdm-and-lightdm-in-ubuntu-14-04/ diff --git a/sources/tech/20220807 List Files and Directories in Style Using lsd and exa.md b/sources/tech/20220807 List Files and Directories in Style Using lsd and exa.md new file mode 100644 index 0000000000..3c9bca92ed --- /dev/null +++ b/sources/tech/20220807 List Files and Directories in Style Using lsd and exa.md @@ -0,0 +1,157 @@ +[#]: subject: "List Files and Directories in Style Using lsd and exa" +[#]: via: "https://www.debugpoint.com/list-files-directories-style/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +List Files and Directories in Style Using lsd and exa +====== +Reimagine and style your file and directories list using two ls utilities – lsd and exa. + +![][0] + +The ls command in Linux is the most used command. This command lists files and directories in the terminal. So, as you can see, it’s pretty popular and perhaps used by everyone. + +But the command outputs a large set of information, and it’s sometimes easier to view them colourfully. + +For example, if you run the ls command in the most basic way, it should look somewhat like this. + +![The default list files and directories view via ls command][1] + +It seems a little bland, isn’t it? What if you can style it a bit so that it becomes more readable while looking nice? + +### List Files and Directories in Style + +#### lsd + +The first application I want to show you is called “lsd” aka “LSDeluxe”. It’s a rewrite of the GNU `ls` command with additional features such as column heading, colours for various items, font and icon support. + +Here’s how it looks after installation. + +``` +lsd -l --header +``` + +![lsd command showing list of files][2] + +As you can see, it looks stunning with different colour codes for permission, file types, and folders and even adds icons beside a file name. + +The application is full of features such as tree view (see below) which even gives you a list of files inside a folder as well in a single command. + +``` +lsd -l --header --tree +``` + +![lsd command showing a tree view][3] + +You can learn more about its feature on the [official GitHub page][4]. + +I’m sure you are excited. Let’s see how you can install it. + +You can download the deb file from here for Ubuntu and related distribution. And after that, simply run dpkg to install. + +``` +sudo dpkg -i lsd_vvvv_amd64.deb +``` + +For Fedora Linux, use the following command. + +``` +sudo dnf install lsd +``` + +And Arch Linux users can get it using the below command. + +``` +pacman -S lsd +``` + +The application is also available for other distros, macOS, BSD and Windows. For those instructions, you can [find them here][5]. + +For a better experience, use it with the [Zsh shell with Oh My Zsh][6] program. + +#### exa + +The next program is `exa`, similar to `lsd` but with more features. The `exa` command can colourize your ls output, detect various file types in Unix systems, headings, tree view and many more features. + +Exa is a single binary and has a small resource footprint. Here’s how it looks with some sample commands. + +``` +exa -al +``` + +``` +exa -abghHliS +``` + +``` +exa -abghHliS --long --tree +``` + +![Various exa commands][7] + +You can learn more about exa parameters and switches on [GitHub][8]. + +Installation of exa is easy and requires just one command. For Ubuntu and related distributions, you can install it using the below command. + +``` +sudo apt install exa +``` + +For Fedora and Arch Linux, use the following commands, respectively. + +``` +sudo dnf install exa +``` + +``` +pacman -S exa +``` + +Likewise, all other installation instructions for various OSes can be [found here][9]. + +### Copying from the terminal as HTML + +One of the interesting tips is that all the above colourful lists can be copied as HTML via the default Ubuntu terminal. And you can use it for your web pages or documents. + +For example, I copied a sample from the above to a LibreOffice Writer document. + +It’s one of the best features, although it depends on the terminal program and NOT the above utilities. + +![Exporting the command output as HTML][10] + +### Wrapping Up + +I explained the inner workings of two programs – ls and exa to list files and directories in style. I hope you get to use them for different needs. + +Do let me know in the comment box if you like them, Or if you know any such utility. + +Cheers. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/list-files-directories-style/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[0]: https://www.debugpoint.com/wp-content/uploads/2022/08/cool-ls.jpg +[1]: https://www.debugpoint.com/wp-content/uploads/2022/08/The-default-list-files-and-directories-view-via-ls-command.jpg +[2]: https://www.debugpoint.com/wp-content/uploads/2022/08/lsd-command-showing-list-of-files-2.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2022/08/lsd-command-showing-a-tree-view.jpg +[4]: https://github.com/Peltoche/lsd +[5]: https://github.com/Peltoche/lsd#installation +[6]: https://www.debugpoint.com/install-use-zsh/ +[7]: https://www.debugpoint.com/wp-content/uploads/2022/08/Various-exa-commands.jpg +[8]: https://github.com/ogham/exa#command-line-options +[9]: https://github.com/ogham/exa#installation +[10]: https://www.debugpoint.com/wp-content/uploads/2022/08/Exporting-the-command-output-as-HTML.jpg diff --git a/sources/tech/20220807 Why we chose the Clojure programming language for Penpot.md b/sources/tech/20220807 Why we chose the Clojure programming language for Penpot.md new file mode 100644 index 0000000000..118fdcf967 --- /dev/null +++ b/sources/tech/20220807 Why we chose the Clojure programming language for Penpot.md @@ -0,0 +1,152 @@ +[#]: subject: "Why we chose the Clojure programming language for Penpot" +[#]: via: "https://opensource.com/article/22/7/why-we-chose-clojure-penpot" +[#]: author: "Andrey Antukh https://opensource.com/users/niwinz" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Why we chose the Clojure programming language for Penpot +====== +Though it is not a mainstream language, Clojure was the right language for Penpot to choose because of its key features: stability, backwards compatibility, and syntactic abstraction. + +![Person using a laptop][1] + +"Why Clojure?" is probably the question we've been asked the most at Penpot. We have a vague explanation on our FAQ page, so with this article, I'll explain the motivations and spirit behind our decision. + +It all started in a *PIWEEK*. Of course! + +During one of our [Personal Innovation Weeks (PIWEEK)][2] in 2015, a small team had the idea to create an open source prototyping tool. They started work immediately, and were able to release a working prototype after a week of hard work (and lots of fun). This was the first static prototype, without a backend. + +I was not part of the initial team, but there were many reasons to choose [ClojureScript][3] back then. Building a prototype in just a one-week hackathon isn't easy and ClojureScript certainly helped with that, but I think the most important reason it was chosen was because it's fun. It offered a functional paradigm (in the team, there was a lot of interest in functional languages). + +It also provided a fully interactive development environment. I’m not referring to post-compilation browser auto-refresh. I mean refreshing the code *at runtime* without doing a page refresh and without losing state! Technically, you could be developing a game, and change the behavior of the game while you are still playing it, just by touching a few lines in your editor. With ClojureScript (and Clojure) you don't need anything fancy. The language constructs are already designed with hot reload in mind from the ground up. + +![Image of the first version of UXBOX (Penpot's original concept) in 2016][4] + +I know, today (in 2022), you can also have something similar with React on plain JavaScript, and probably with other frameworks that I’m not familiar with. Then again, it's also probable that this capability support is limited and fragile, because of intrinsic limitations in the language, sealed modules, the lack of a proper REPL. + +### About REPL + +In other dynamic languages, like JavaScript, Python, [Groovy][5] (and so on), REPL features are added as an afterthought. As a result, they often have issues with hot reloading. The language patterns are fine in real code, but they aren't suitable in the REPL (for example, a `const` in JavaScript evaluates the same code twice in a REPL). + +These REPLs are usually used to test code snippets made for the REPL. In contrast, REPL usage in Clojure rarely involves typing or copying into the REPL directly, and it is much more common to evaluate small code snippets from the actual source files. These are frequently left in the code base as comment blocks, so you can use the snippets in the REPL again when you change the code in the future. + +In the Clojure REPL, you can develop an entire application without any limitations. The Clojure REPL doesn't behave differently from the compiler itself. You're able to do all kinds of runtime introspection and hot replacement of specific functions in any namespace in an already running application. In fact, it's not uncommon to find backend applications in a production environment exposing REPL on a local socket to be able to inspect the runtime and, when necessary, patch specific functions without even having to restart the service. + +### From prototype to the usable application + +After PIWEEK in 2015, Juan de la Cruz (a designer at Penpot, and the original author of the project idea) and I started working on the project in our spare time. We rewrote the entire project using all the lessons learned from the first prototype. At the beginning of 2017, we internally released what could be called the second functional prototype, this time with a backend. And the thing is, we were still using Clojure and ClojureScript! + +The initial reasons were still valid and relevant, but the motivation for such an important time investment reveals other reasons. It's a very long list, but I think the most important features of all were: stability, backwards compatibility, and syntactic abstraction (in the form of macros). + +![Image of the current Penpot interface][6] + +### Stability and backwards compatibility + +Stability and backwards compatibility are one of the most important goals of the Clojure language. There's usually not much of a rush to include all the trendy stuff into the language without having tested its real usefulness. It's not uncommon to see people running production on top of an alpha version of the Clojure compiler, because it's rare to have instability issues even on alpha releases. + +In Clojure or ClojureScript, if a library doesn't have commits for some time, it's most likely fine as is. It needs no further development. It works perfectly, and there's no use in changing something that functions as intended. Contrarily, in the JavaScript world, when you see a library that hasn't had commits in several months, you tend to get the feeling that the library is abandoned or unmaintained. + +There are numerous times when I've downloaded a JavaScript project that has not been touched in 6 months only to find that more than half of the code is already deprecated and unmaintained. On other occasions, it doesn’t even compile because some dependencies have not respected semantic versioning. + +This is why each dependency of [Penpot][7] is carefully chosen, with continuity, stability, and backwards compatibility in mind. Many of them have been developed in-house. We delegate to third party libraries only when they have proven to have the same properties, or when the effort to time ratio of doing it in-house wasn't worth it. + +I think a good summary is that we try to have the minimum necessary external dependencies. React is probably a good example of a big external dependency. Over time, it has shown that they have a real concern with backwards compatibility. Each major release incorporates changes gradually and with a clear path for migration, allowing for old and new code to coexist. + +### Syntactic abstractions + +Another reason I like Clojure is its clear syntactic abstractions (macros). It's one of those characteristics that, as a general rule, can be a double-edged sword. You must use it carefully and not abuse it. But with the complexity of Penpot as a project, having the ability to extract certain common or verbose constructs has helped us simplify the code. These statements cannot be generalized, and the possible value they provide must be seen on a case-by-case basis. Here are a couple of important instances that have made a significant difference for Penpot: + +* When we began building Penpot, React only had components as a class. But those components were modeled as functions and decorators in a [rumext library][8]. When React released versions with hooks that greatly enhanced the functional components, we only had to change the implementation of the macro and 90% of Penpot's components could be kept unmodified. Subsequently, we've gradually moved from decorators to hooks completely without the need for a laborious migration. This reinforces the same idea of the previous paragraphs: stability and backwards compatibility. +* The second most important case is the ease of using native language constructs (vectors and maps) to define the structure of the virtual DOM, instead of using a JSX-like custom DSL. Using those native language constructs would make a macro end up generating the corresponding calls to `React.createElement` at compile time, still leaving room for additional optimizations. Obviously, the fact that the language is expression-oriented makes it all more idiomatic. + +Here's a simple example in JavaScript, based on examples from React documentation: + +``` +function MyComponent({isAuth, options}) { +    let button; +    if (isAuth) { +        button = ; +    } else { +        button = ; +    } + +    return ( +       
+          {button} +         
    +            {Array(props.total).fill(1).map((el, i) => +             
  • {{item + i}}
  • +            )} +         
+       
+    ); +} +``` + +Here's the equivalent in ClojureScript: + +``` +(defn my-component [{:keys [auth? options]}] +  [:div +   (if auth? +     [:& logout-button {}] +     [:& login-button {}]) +   [:ul +    (for [[i item] (map-indexed vector options)] +      [:li {:key i} item])]]) +``` + +All these data structures used to represent the virtual DOM are converted into the appropriate `React.createElement` calls at compile time. + +The fact that Clojure is so data-oriented made using the same native data structures of the language to represent the virtual DOM a natural and logical process. Clojure is a dialect of [LISP][9], where the syntax and AST of the language use the same data structures and can be processed with the same mechanisms. + +For me, working with React through ClojureScript feels more natural than working with it in JavaScript. All the extra tools added to React to use it comfortably, such as JSX, immutable data structures, or tools to work with data transformations, and state handling, are just a part of the ClojureScript language. + +### Guest Language + +Finally, one of the fundamentals of Clojure and ClojureScript ​​is that they were built as *Guest Languages*. That is, they work on top of an existing platform or runtime. In this case, Clojure is built on top of the JVM and ClojureScript on top of JavaScript, which means that interoperability between the language and the runtime is very efficient. This allowed us to take advantage of the entire ecosystem of both Clojure plus everything that's done in Java (the same is true for ClojureScript and JavaScript). + +There are also pieces of code that are easier to write when they're written in imperative languages, like Java or JavaScript. Clojure can coexist with them in the same code base without any problems. + +There's also an ease of sharing code between frontend and backend, even though each one can be running in a completely different runtime (JavaScript and JVM). For Penpot, almost all the most important logic for managing a file's data is written in code and executed both in the frontend and in the backend. + +Perhaps you could say we have chosen what some people call a "boring" technology, but without it actually being boring at all. + +### Trade-offs + +Obviously, every decision has trade-offs. The choice to use Clojure and ClojureScript is not an exception. From a business perspective, the choice of Clojure could be seen as risky because it's not a mainstream language, it has a relatively small community compared to Java or JavaScript, and finding developers is inherently more complicated. + +But in my opinion, the learning curve is much lower than it might seem at first glance. Once you get rid of the *it's different* fear (or as I jokingly call it: *fear of the parentheses*), you start to gain fluency with the language very quickly. There are tons of learning resources, including books and training courses. + +The real obstacle I have noticed is the paradigm shift, rather than the language itself. With Penpot, the necessary and inherent complexity of the project makes the programming language the least of our problems when facing development: building a design platform is no small feat. + +*[This article originally appeared on the Kaleidos blog and has been republished with permission.][10]* + +Image by: (Andrey Antukh, CC BY-SA 4.0) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/why-we-chose-clojure-penpot + +作者:[Andrey Antukh][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/niwinz +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/laptop_screen_desk_work_chat_text.png +[2]: https://piweek.com/ +[3]: https://clojurescript.org/ +[4]: https://opensource.com/sites/default/files/2022-07/First%20version%20of%20UXBOX%20%28Penpot%E2%80%99s%20original%20concept%29%20in%202016.png +[5]: https://opensource.com/article/20/12/groovy +[6]: https://opensource.com/sites/default/files/2022-07/Current%20Penpot%20interface.png +[7]: https://github.com/penpot/penpot +[8]: https://github.com/funcool/rumext +[9]: https://opensource.com/article/21/5/learn-lisp +[10]: https://blog.kaleidos.net/penpot-chose-clojure-as-its-language-and-here-is-why/ diff --git a/sources/tech/20220808 Fix file permission errors on Linux.md b/sources/tech/20220808 Fix file permission errors on Linux.md new file mode 100644 index 0000000000..eafdca17a7 --- /dev/null +++ b/sources/tech/20220808 Fix file permission errors on Linux.md @@ -0,0 +1,75 @@ +[#]: subject: "Fix file permission errors on Linux" +[#]: via: "https://opensource.com/article/22/8/fix-file-permission-errors-linux" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Fix file permission errors on Linux +====== +Don't let file permissions slow you down. Here's how to manage them on Linux and macOS. + +![open source button on keyboard][1] + +Image by: Opensource.com + +If you're sharing files between two users over the network or "sneaker net" (saving a file to a hard drive and copying it to a computer), you may encounter permission errors when you try to read or write the file. Even if you understand the concept of , you may not know exactly how to diagnose the problem or solve it. I used to perform data migration as a service, so I've run into my fair share of permission errors and ownership conflicts. Here's how I fix them fast. + +### 1. Determine the correct user + +Before you can fix a permission error, you must determine who requires permission. You might think you already know that, but what you may not realize is that the user *name* isn't the most definitive attribute of user identity. Your computer doesn't see you as a person so much as it sees you as a number. To learn your number, take a look at your user ID: + +``` +$ id --user +1005 +``` + +### 2. Get the current owner + +Next, determine the owner of the file you're unable to interact with. Because there's a file permission problem happening, you may need to use the `sudo` command to see the information about the file: + +``` +$ sudo ls --numeric-uid-gid +-rw------- 1 1000 100  23041 Aug  2 05:26 bar +-rw------- 1 1000 100  54281 Aug  2 04:58 baz +-rw------- 1 1000 100    822 Aug  2 08:19 foo +``` + +In this example, the user owning the files is identified as user ID 1000, and that's why user ID 1005 can't interact with them. Worse yet, the files are marked as readable and writable only by the user that owns them, so not even members of the same group can interact with the files. + +### 3. Change permissions to match + +You know the user requiring permission, so you can change the current owner to match your current user: + +``` +$ sudo chown 1005 foo +``` + +You can also grant members of your group, and possibly other users on the system, access to the files by changing the file mode. For instance, to maintain read and write permissions (7) while granting read permissions (4) to the group and any other user: + +``` +$ sudo chmod 744 foo +``` + +### Learn more + +File permissions can seem tricky when you're not comfortable with them. For more information on how file ownership works, read [Introduction to chown][2]. For more information on how file permissions work, read [Introduction to chmod][3]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/fix-file-permission-errors-linux + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/button_push_open_keyboard_file_organize.png +[2]: https://opensource.com/article/19/8/linux-chown-command +[3]: https://opensource.com/article/19/8/linux-chmod-command diff --git a/sources/tech/20220808 Sunamu- Display Lyrics for Currently Playing Music on the Desktop in Linux.md b/sources/tech/20220808 Sunamu- Display Lyrics for Currently Playing Music on the Desktop in Linux.md new file mode 100644 index 0000000000..975ba657ca --- /dev/null +++ b/sources/tech/20220808 Sunamu- Display Lyrics for Currently Playing Music on the Desktop in Linux.md @@ -0,0 +1,141 @@ +[#]: subject: "Sunamu: Display Lyrics for Currently Playing Music on the Desktop in Linux" +[#]: via: "https://itsfoss.com/sunamu-music-widget/" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Sunamu: Display Lyrics for Currently Playing Music on the Desktop in Linux +====== + +Being an eye candy **music widget** (or controller). + +That’s the only focus of Sunamu, and it does its job pretty well. + +Sunamu is an intriguing tool. It is not a music player but lets you display the music you’re playing and control it. + +I’m not a fan of having a floating widget on my primary workspace, but Sunamu’s minimal yet elegant approach changed my mind! + +So, I will walk you through its features, installation, configuration tweaks, and my experience with it. + +### Sunamu: An Open-Source Music Controller + +![playing music with sunamu][1] + +As you can notice in the screenshot above, it looks like a pretty nice way to display the music being played, with the lyrics, while having the basic controls. + +You can play/pause, go to the next/previous track, shuffle, and enable a loop. + +Sunamu supports a wide range of audio platforms, including Spotify. It also detects music from your local collection, supporting some of the [best music players][2] available for Linux. + +Additionally, it supports Windows. So, if you are streaming something through the Microsoft Edge browser on Windows, it should work well. + +You can check the [compatibility list][3] on its GitHub page to learn more about the supported players and browsers. + +Fortunately, you do not have to be limited by what it offers by default. It provides an easy way to tweak the config file (learn more about it on its [GitHub page][4]). This makes it possible for newbies to tweak some settings and have fun. + +I’ll mention a few tips about it in the later section of this article. + +### Features of Sunamu + +![Sunamu on empty workspace][5] + +Sunamu comes with a set of promising features, and some of them are: + +* Detects and display the song that is currently playing. +* Fetch color schemes from the album art and use the same color palette for better visuals. +* Customizable through its config file. +* Integrates well with Discord. +* Consumes minimal system resources. + +### Install Sunamu on Linux + +![Disable lyrics in sunamu][6] + +It provides AppImage, deb, and rpm packages for easy installation across various Linux distributions. I used AppImage for testing, and it worked like a charm. + +You can also benefit from our guide on [how to use AppImage][7] or [install deb packages][8] and [rpm packages][9], if you are new to Linux. + +Interestingly, Sunamu is one of the few open-source music tools that provide direct support for ARM-based machines. + +Visit their [GitHub releases page][10] to download packages or build it from the source. + +**Let me show you a quick installation method** for a Debian-based distro via the terminal. Just follow the given instructions, and you’ll be good to go: + +First, let’s download the .deb package using wget command as follows: + +``` +wget https://github.com/NyaomiDEV/Sunamu/releases/download/v2.0.0/sunamu_2.0.0_amd64.deb +``` + +Once you are done downloading the package, use the given command for installation: + +``` +sudo dpkg -i sunamu_2.0.0_amd64.deb +``` + +![install sunamu in ubuntu][11] + +### Tip: Tweak the Configuration file + +By default, Sunamu won’t fetch colors from the album art but show the lyrics for each song. And like many others, I like to avoid reading lyrics. + +Config file of Sunamu is usually located at **~/.config/sunamu/config.json5**. + +To open the Sunamu config file, type the given command: + +``` +nano ~/.config/sunamu/config.json5 +``` + +Make changes in the electron section as given below (to enable colors and disable lyrics): + +``` +electron: { + type: 'electron', + widgetMode: true, + colors: true, + font: '', + theme: 'default', + showLyrics: false, + } +``` + +Here’s what the final config file should look like: + +![modify config file of sunamu][12] + +### Final Thoughts + +Unless you are someone who avoids electron-based apps, Sunamu is a good enough app to enhance your music experience on Linux. After, [Amberol][13], this is the second Music-related app I have liked recently. + +If you try it, don’t forget to share your experience in the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/sunamu-music-widget/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2022/08/playing-music-with-sunamu.png +[2]: https://itsfoss.com/best-music-players-linux/ +[3]: https://github.com/NyaomiDEV/Sunamu/blob/master/COMPATIBILITY.md +[4]: https://github.com/NyaomiDEV/Sunamu/blob/master/assets/config.json5 +[5]: https://itsfoss.com/wp-content/uploads/2022/08/song-with-no-lyrics-min.png +[6]: https://itsfoss.com/wp-content/uploads/2022/08/playing-music-with-sunamu-inclusing-lyrics-min1.png +[7]: https://itsfoss.com/use-appimage-linux/ +[8]: https://itsfoss.com/install-deb-files-ubuntu/ +[9]: https://itsfoss.com/install-rpm-files-fedora/ +[10]: https://github.com/NyaomiDEV/Sunamu/releases/tag/v2.0.0 +[11]: https://itsfoss.com/wp-content/uploads/2022/08/install-sunamu-in-ubuntu.png +[12]: https://itsfoss.com/wp-content/uploads/2022/08/modified-config-file-of-sunamu.png +[13]: https://itsfoss.com/amberol-music-player/ diff --git a/translated/talk/20191106 How Much of a Genius-Level Move Was Using Binary Space Partitioning in Doom.md b/translated/talk/20191106 How Much of a Genius-Level Move Was Using Binary Space Partitioning in Doom.md new file mode 100644 index 0000000000..fe25d972d5 --- /dev/null +++ b/translated/talk/20191106 How Much of a Genius-Level Move Was Using Binary Space Partitioning in Doom.md @@ -0,0 +1,173 @@ +[#]: subject: "How Much of a Genius-Level Move Was Using Binary Space Partitioning in Doom?" +[#]: via: "https://twobithistory.org/2019/11/06/doom-bsp.html" +[#]: author: "Two-Bit History https://twobithistory.org" +[#]: collector: "lujun9972" +[#]: translator: "aREversez" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +在《毁灭战士》中应用二叉空间分割技术是何等天才之举? +====== + +1993 年,游戏开发公司 id Software 发行了一款第一人称射击游戏 _《毁灭战士》_,游戏一经发行迅速爆火。在今天看来,《毁灭战士》可谓有史以来最具影响力的游戏之一。 + +_《毁灭战士》_ 发行之后的第十年(2003 年),记者大卫·库什纳出版了一本关于 id Software 的书,书名为 _《Doom 启示录》_,后被奉为记录 _Doom_ 创作史的典范读物。几年前我曾读过这本书,如今内容已记得不太真切了,但是书中有一个关于 id Software 首席程序员约翰·卡马克的故事,我印象特别深刻。这里只对故事做粗略描述(具体情节请往下阅读)。实际上,早在 _《毁灭战士》_ 开发前期,卡马克就发现自己为这款游戏编写的 3D 渲染器在渲染某些关卡时,出现速度缓慢的问题。对于 _《毁灭战士》_ 这一对动感和速度有着相当高要求的射击游戏来说,这是一个非常严重的问题。意识到了这一问题的严重性,卡马克需要一个更加有效的渲染算法,于是他开始阅读相关文献。最后,他采用“二叉空间分割”技术,极大地提升了《毁灭战士》游戏引擎的运行速度,而这项技术此前从未用于电子游戏当中。 + +一直以来,我对这个故事的印象十分深刻。卡马克将学术前沿研究运用于电子游戏之中,我觉得这正是他之所以成为传奇人物的原因。无论从哪个角度来看,卡马克都应该是电子游戏行业中人尽皆知的典型天才程序员,只不过上面这个故事是我最先能够想到的理由。 + +显而易见,“二叉空间分割”这个术语听起来就是难度相当高的课题,能够自行阅读文献并将其付诸实施实属不易,所以这个故事给我留下了深刻的印象。我一直认为卡马克的做法十分具有创见性,不过由于我既不懂二叉空间分割到底是怎样的一项技术,也不晓得这项技术在当时究竟有多么革新,所以我也并不确定自己的观点是否正确。如果按照从荷马·辛普森到爱因斯坦的顺序为天才列出一套级别体系,那么卡马克将二叉空间分割技术运用于 _《毁灭战士》_ 的做法究竟属于什么级别的天才之举呢? + +同时,我也在想,二叉空间分割这个概念最初是从哪儿来的,又是怎样吸引到卡马克的?因此,本篇文章不仅仅会讲述约翰·卡马克和 _《毁灭战士》_ 的故事,也会探讨二叉空间分割树(BSP 树)数据结构的发展历史。有意思的是,BSP 树和计算机科学领域其他许多技术一样,最初都起源于军事研究领域。 + +没错,_《毁灭战士》_ 的第一关卡 E1M1 就受到了美国空军的启发。 + +### VSD 难题 + +BSP 树是计算机图形领域最具挑战性难题的解决方案之一。举个例子,为了渲染出三维场景,渲染器必须能够区分可见物体和不可见物体。如果渲染时间比较充足,这一要求也算不上大问题;但是理想来说,实时游戏引擎在 1 秒内至少需要完成 30 次区分任务。 + +这一问题有时被称为可见表面检测问题。当时,卡马克与迈克尔·亚伯拉什携手合作,一起开发 _《雷神之锤》_(id Software 继 _《毁灭战士》_ 之后开发的游戏)。关于可见表面检测问题,亚伯拉什在自己的著作 _《图形程序开发人员指南》_ 中写道: + +> 我想探讨一下在我看来 3D 中最棘手的一个问题:可见表面检测问题(在每个像素点上绘制合适的表面)以及与之密切相关的隐面消除问题(迅速去除不可见的多边形,用于加快可见表面检测速度)。简略起见,我将在下文采用缩写 VSD 来表示可见表面检测和隐面消除。 + +> 为什么我会认为 VSD 是 3D 中最棘手的问题呢?尽管纹理映射等光栅化问题更让人感兴趣而且也更重要,但是相对而言,这些问题比较容易解决。随着 3D 加速器的出现,它们逐渐被归为硬件范围内的问题。同时,它们只受到屏幕分辨率的影响,而这种影响相对较为稳定。 + +> 相反,VSD 却像是一个无底洞,目前应对方案也有很多。但实际上,在采用简单的方法处理 VSD 时,其性能会直接受到场景复杂程度的影响,而场景的复杂程度通常会以平方级或立方级的形式增大。所以在渲染过程中,VSD 很快就会成为制约因素。[1][1] + +_《毁灭战士》_ 这款游戏告诉我们,普通人盼望着能用自家电脑玩很吃图形配置的游戏。之后数年,即上个世纪九十年代,亚伯拉什讨论了复杂的 VSD 问题。同时代早期,id Software 成立后发行了一些游戏。尽管当时的计算机还只是用来处理文字与表格或者执行其他任务,未尝想过要在上面运行游戏,id Software 必须对发行的游戏进行编程,使其能在计算机上流畅运行。为了实现这一飞跃,尤其是为了能让在 _《毁灭战士》_ 之前发行的少数 3D 游戏在电脑上运行,id Software 必须做出革新。在这些游戏中,所有的关卡在设计时都施加了一定的限制,以便更容易解决 VSD 问题。 + +例如,在 _《毁灭战士》_ 之前,id Software 发行了 _《德军总部 3D》_,该游戏的每一个关卡都是由与坐标轴平齐的墙壁组成。换言之,在《德军总部 3D》的游戏画面里,你看到的只有南北方向或者东西方向的墙壁。在游戏中,墙壁与墙壁之间有着固定的间隔,所有过道的宽度或是一个方格,或是两个方格等等,但绝不会出现 2.5 个方格。如此一来,尽管 id Software 团队只能设计出外观十分相似的关卡,但这也让卡马克为 _《德军总部 3D》_ 编写渲染器的工作简单了不少。 + +通过将屏幕上的光线“齐射”入虚拟游戏世界,_《德军总部》_ 的渲染器解决了 VSD 问题。通常来说,使用光线的渲染器叫做“光线投射”渲染器。这种渲染器的速度一般较慢,因为解决内部的 VSD 问题涉及到在光线和游戏中的物体之间找到第一个交点,这通常需要进行大量的计算。但在 _《德军总部》_,由于所有的墙壁都与网格平齐,所以光线与墙壁相交的位置只能在网格线上。如此一来,渲染器只需逐个检查这些交点即可。如果渲染器先从离玩家视角最近的交点开始检查,接着检查下一个最近的交点,以此类推,最后遇到第一面墙壁时停止检查。这样,VSD 问题便轻而易举地得到了解决。光线从每一个像素点向前投射,与画面物体接触时停止运动,这一方法是可行的。因为结合 CPU 周期来看,投射的成本很低。事实上,由于每面墙壁高度相同,因此针对同列的像素点,投射的光线只需一条。 + +尽管当时还没有专业的图形显卡,_《德军总部》_ 凭借这一取巧之法得以在配置较低的个人电脑上正常运行起来。然而,这个办法并不适用于 _《毁灭战士》_。id Software 为这款新游戏增添了许多新元素——倾斜的墙面、楼梯以及高低不一的天花板。光线投射的办法自然也就不好用了,于是卡马克编写出了一个新的渲染器。_《德军总部》_ 的渲染器关注的是图像,将光线投射到屏幕像素表示的列上,而 _《毁灭战士》_ 关注的则是物体。换句话说,_《毁灭战士》_ 的渲染器会记录游戏场景中的所有物体,继而将其投射到屏幕当中;而非记录屏幕上的像素点,判断每个像素点的颜色。 + +对于强调物体的渲染器来说,可以使用 Z 缓冲器来解决 VSD 问题,比较简单。每次将物体投射到屏幕上时,需要对每个用于绘制的像素点进行检查。如果你想绘制出的物体的部分和已经绘制在目标像素点上的物体相比更加接近玩家,可以将其覆盖。否则,必须保持像素不变。尽管办法很简单,但是 Z 缓冲器对内存的要求较高,投射关卡几何图形时渲染器仍会消耗大量的 CPU 资源,虽然玩家无法看到这些几何图形。 + +在 20 世纪 90 年代,使用 Z 缓冲器的方法还存在着其他缺陷:与 IBM 公司机器兼容的个人电脑搭载了显示适配器系统 VGA,在这类电脑上,将图像写入帧缓冲器的成本非常之高。因此,消耗在绘制像素点上的大量时间可能会让渲染器崩溃,而且像素点经过绘制后,只能在后期才能覆盖。 + +考虑到将图像写入帧缓冲器的成本非常之高,理想的渲染器需要首先绘制离玩家最近的物体,接着是比较近的物体,以此类推,直到屏幕上每个像素点都写入了信息。这时,渲染器会停止运行,大幅缩短远处不可见物体的渲染时间。这种由近及远对物体进行排序的方法也可以解决 VSD 问题。那么问题又来了:什么才是玩家可以看到的? + +最初,卡马克打算依靠 _《毁灭战士》_ 的关卡布局来解决 VSD 问题。首先用渲染器绘制出玩家目前所在房间的墙壁,之后玩家冲进隔壁房间,再绘制出隔壁房间的墙壁。由于每个房间互不遮挡,这一办法也能解决 VSD 问题。而互相遮挡的房间可以分割成若干互不遮挡的“区域”。在 YouTube 上的一个 [视频][2] 中,Bisqwit 展示了自己制作出来的使用了相同算法的渲染器。可以看到,如果玩家移动速度非常慢,便能一睹渲染的具体过程。这一算法同样运用到了《毁灭公爵 3D》当中,这款游戏在 _《毁灭战士》_ 推出三年之后发行,当时 CPU 的性能也更加强大了。1993 年,尽管在硬件上已经可以运行游戏了,但是使用这一算法的 _《毁灭战士》_ 渲染器在复杂的层级结构上依旧表现吃力,尤其是在房间分割出来的各部分相互嵌套的情况下。不巧的是,这类层级结构正是构造环形楼梯等物体的唯一办法。沿着环形楼梯走下去,直到走入已经绘制好的区域,由于这其中涉及多次循环下降运动,导致游戏引擎的运行速度大幅降低。 + +在 id Software 团队意识到 _《毁灭战士》_ 游戏引擎的速度可能过慢时,公司还面临着其他任务:将 _《德军总部 3D》_ 移植到超级任天堂游戏机(简称“超任”)上。那时,超任的性能比兼容 IBM 公司机器的个人电脑还要差。结果表明,尽管光线投射渲染器非常简单,但是想要在超任上快速运行是不可能的。于是,卡马克着手研究更为高效的算法。事实上,也正是为了顺利将 _《德军总部》_ 移植到超任,卡马克首次研究了二叉空间分割技术,并将其付诸应用。由于 _《德军总部》_ 的墙壁与坐标轴平齐,所以二叉空间分割技术应用起来也比较简单直接;但是 _《毁灭战士》_ 的情况则比较复杂。不过,卡马克发现,二叉空间分割树同样可以用来解决 _《毁灭战士》_ 速度过慢的问题。 + +### 二叉空间分割 + +二叉空间分割会提前将 3D 场景分割为若干部分,借以解决 VSD 问题。讲到这里,你需要先了解一下为什么分割场景可以奏效:如果你在场景上画条线(对应 3D 空间里的一个平面),你就可以指出玩家或者摄像机视角在这条线的哪一侧,在这条线另一侧的物体无法遮挡玩家所在一侧的物体。如果多次重复这一操作,该 3D 场景最终会被分割为多个区域。最后,你要明白场景中不同的部分是会相互遮挡的,这样才能理解为什么这些区域可以起到优化原来场景的作用。 + +首次阐述上述 3D 场景分割的是美国空军的研究员,他们曾尝试向美国空军证明计算机图形已经非常先进,可以应用到飞行模拟器领域。1969 年,他们将研究发现发表在一份题为《计算机生成图像在图形仿真中的应用研究》的报告中。该报告的总结部分指出,计算机图形可用于训练飞行员,但其实际应用可能会受制于 VSD 问题: + +> 实时图像处理需要解决的一个关键问题就是优先级问题或者隐藏线问题。在我们平时用眼睛观察外界时,大自然替我们轻易地解决了这一问题:注视不透明物体上一点时,同一视觉方向的物体以及距离较远的物体就会变得模糊。但在计算机中,这项任务却非常困难。图像处理通常需要解决优先级问题,随着环境复杂程度的增加,计算量会呈指数级增长,随即就会超过绘制物体透视图所需得计算负载。[2][3] + +他们在报告中提出了一项基于构造“遮挡矩阵”的方案,这一方案早些时候曾被应用于 NASA 的项目当中。研究员指出,平面将场景一分为二,可用来解决平面两侧物体之间存在的“任何优先级问题”】。通常情况下,可能需要将实实在在的平面添加到场景中,但是有了几何图形,只需借助几何物体的表面即可。他们举了一个例子,如下图:\\(p_1\\)、\\(p_2\\) 以及 \\(p_3\\) 是三个不同的平面,如果摄像机视角位于其中一个平面的前方或“正”面,\\(p_i\\) 的值就等于 1。这种矩阵展示出基于三个不同平面和摄像机视角位置的三个物体之间的关系——如果物体 \\(a_i\\) 遮挡了物体 \\(a_j\\),那么 \\(a_{ij}\\) 在此矩阵中的数值等于 1。 + +![][4] + +研究员指出,这种矩阵可以应用到硬件中,对每一帧进行重新评估。该矩阵基本上可以用作大型交换器,或者一种预置的 Z 缓冲器。在绘制给定的物体时,如果在物体所在列上得出数值 1,并且所在行已经在绘制中,那么物体被遮挡的部分就不会绘制出来。 + +不过,该矩阵方法的主要缺点在于,为了在场景中表示出 \\(n\\) 个物体,需要将矩阵的尺寸调整为 \\(n^2\\)。于是,研究员们继续深入,探究使用遮挡矩阵作为“优先级顺序表”的可行性。遮挡矩阵的尺寸还是 \\(n\\),可确定物体绘制的顺序。他们随即发现,诸如上图此类场景根本无法确定顺序(因为它存在循环阻塞的现象)。因此,他们不遗余力,讲明“合适”与“不合适”场景之间在数学方面的区别。最后,他们得出了一个结论:在“合适的”场景下,优先级顺序表是可以制作出来的;而对场景设计师来说,避免设计出“不合适”的场景也不是一件难事。但是,他们并没有说明如何生成顺序表。可以说,这份研究的首要贡献在于提出了可以采用平面分割的方法,对场景中的物体进行渲染排顺。至少,这在 _理论上_ 是可行的。 + +直到 1980 年,一份题为《基于优先级树结构的可见表面生成》的论文提出了解决该问题的具体算法。在这份论文中,作者亨利·福克斯、泽维·凯德姆以及布鲁斯·内勒介绍了 BSP 树。他们指出这种新的数据结构“可以替代十年前首次使用但由于一些问题未得到广泛发展的方案”(此处即前文 1969 年美国空军相关研究中的方案)。[3][5] BSP 树一经生成,即可用于确定场景中物体的优先级顺序。 + +三人在论文中详细明了地解释了 BSP 树的工作原理。在本文,我将尝试使用更加通俗具体的语言,介绍给大家。 + +首先,在场景中选定一个多边形,将该多边形所在的平面作为分割平面。同时,该多边形充当树的根节点。场景中剩下的多边形会分散在分割平面的两侧。位于分割表面“前方”或者与分割平面相交后位于“前”半部分的多边形落在了根节点左侧的左子树上;位于分割表面“后方”或者与分割平面相交后位于“后”半部分的多边形落在了右子树上。接着,递归重复这一过程:在左子树和右子树上各选定一个多边形,作为各自空间新的分割平面,继而二分出来更多的子空间和子树。等到全部的多边形均选定之后,二叉空间分割也就结束了。 + +由后向前将场景中的几何图形进行渲染就是所谓的“画家算法”。因为在绘制时,距离摄像机较远的多边形会被距离摄像机较近的多边形所覆盖,借此正确进行渲染任务。如果想要实现这一算法,必须按中序遍历 BSP 树,左右子树的渲染顺序由摄像机视角与节点所在分割平面的位置关系决定的。因此,针对树上的每个节点,首先渲染距离分割平面较“远”一侧的所有多边形,接着是位于平面上的多边形,最后是距离平面较“近”一侧的所有多边形——“远”与“近”相对于摄像机视角而言。根据前文,距离分割平面较远一侧的多边形无法遮挡近侧的物体,所以这种方法可以解决 VSD 问题。 + +下图表示一个简单的 2D 场景的 BSP 树的构造与遍历过程。在 2D 中,分割平面变成了分割线,但就基本原理而言,与复杂的 3D 场景并无二质。 + +![][6] _第一步:根分割线落在 D 墙上,将剩下的几何图形分为两组。_ + +![][7] _第二步:继续分割位于 D 墙两侧的空间。C 墙是其中一侧的唯一一堵墙壁,因此无需再分。另一侧,B 墙形成新的分割平面。因为 A 墙与新的分割平面相交,所以必须将其分割为两堵墙。_ + +![][8] _第三步:参照右上方视角,由后向前对墙壁进行排序,对执行画家算法很有帮助。这就是树的中序遍历过程。_ + +福克斯、凯德姆以及内勒多次强调了 BSP 树的优势:无需重复构建。可能有些难以置信,但实际上无论摄像机视角位于何处,场景的渲染只需一棵 BSP 树。只要场景中的多边形没有移动,BSP 树就不会失效。因此,BSP 树在实时渲染任务中非常实用——构建树时的所有艰巨任务都可以在渲染工作开展之前完成。 + +同时,三人也提到了一项需要进一步深入研究的问题:究竟怎样才能构建出一棵“高质量的” BSP 树?BSP 树的质量取决于用作分割平面的多边形的选择。我在前文跳过了这一问题,不过如果用作分割平面的多边形与其他多边形相交,那么为了避免 BSP 算法失效,必须将相交的多边形一分为二,这样两部分就可以分在不同的空间。但是如果这种现象反复出现,BSP 树的构建势必会大幅增加场景中多边形的数量。 + +内勒后来在其 1993 年的论文《构建高质量的分割树Constructing Good Partitioning Trees》中提及这一问题。与卡马克一同建立 id Software 的约翰·罗梅洛指出,这篇论文是卡马克在 _《毁灭战士》_ 中引入 BSP 树时读到的论文之一。[4][9] + +### 《毁灭战士》中的 BSP 树 + +别忘了,卡马克首次为 _《毁灭战士》_ 设计渲染器时,通过让渲染器渲染玩家所在房间之外的临近房间,试图为关卡几何图形建立一套渲染顺序。对此,BSP 树是个不错的选择,因为在玩家进入之前的房间(区域)时,BSP 树能够避免让渲染器重复劳动,从而节省 CPU 资源。 + +实际上,“将 BSP 树引入 _《毁灭战士》_”意味着将 BSP 树生成器引入 _《毁灭战士》_ 的关卡编辑器中。_《毁灭战士》_ 的关卡制作完成之时,BSP 树就会在关卡几何图形的基础上生成。根据程序员法比安·桑格勒德的说法,在原版 _《毁灭战士》_ 中,一个关卡的 BSP 树生成时间需要 8 秒,全部关卡合计共需 11 分钟 [5][10]。之所以生成时间较长,部分原因在于卡马克所用的 BSP 生成算法,该算法尝试使用各种启发式方法找出“高质量” BSP 树。在运行时,8 秒的延时可能让人无法接受;但是在线下等 8 秒,时间并不算长,尤其是考虑到 BSP 树提升了渲染器的性能。每个关卡生成的 BSP 树将在游戏启动时作为关卡数据载入。 + +卡马克非常赞赏 1980 年论文中提出的 BSP 树算法,因为在 _《毁灭战士》_ 开始运行时,当前关卡的 BSP 树就会读取到内存中,渲染器通过 BSP 树由前向后绘制物体,而非由后向前进行绘制。福克斯、凯德姆以及内勒在那篇论文中演示了 BSP 树可用于执行由后向前的画家算法,但是画家算法会造成许多重复的绘制任务,对于与 IBM 机器兼容的个人电脑来说负担较大。因此,_毁灭战士_ 的渲染器换了个方向,首先绘制距离玩家较近的图形,之后再绘制离玩家较远的。采用这种相反的顺序,更有利于 BSP 树的应用,因为在树的每个节点都可以进行反向遍历。为了避免绘制出来的远处图形遮挡到近处的图形,_《毁灭战士》_ 的渲染器使用了一种内置的 Z 缓冲器,这种缓冲器不仅具备普通 Z 缓冲器的优势,而且对内存的要求也较低。Z 缓冲器有两组数组,一组记录水平方向的遮挡关系,另一组自屏幕由上及下记录垂直方向的遮挡关系。_《毁灭战士》_ 的渲染器就算不使用真正的 Z 缓冲器也无伤大雅,因为从技术上来看它并不是真正的 3D 游戏。BSP 树数据结构的成本虽然不高,但却能够起作用,其原因在于 _《毁灭战士》_ 不会发生以下问题:水平方向的遮挡数组能够运行,是因为该游戏中没有倾斜的墙体;垂直方向的遮挡数组能够运行,是因为该游戏不存在有着一上一下两扇窗户的墙体。 + +剩下比较棘手的问题是如何将 _《毁灭战士》_ 中处于运动中的角色融入到借助 BSP 树绘制的静止的关卡几何图形中。该游戏中的敌人不可能纳入 BSP 树之中,因为他们会移动,而 BSP 树只对静止的几何形状起作用。所以渲染器首先绘制静止的关卡几何图形,同时与另一个内存使用效率较高的数据结构协作,记录屏幕上分割出来用于绘制的区域。之后,渲染器按照由后往前的顺序绘制敌人,并消除被屏幕上的区域遮挡住的敌人。这一过程与使用 BSP 树进行渲染相比,效果稍差一些。但是由于关卡中能看到的敌人的数量少于几何图形的数量,所以速度问题并没有那么重要。 + +将 BSP 树应用到 _《毁灭战士》_ 中可谓一大成功。卡马克能够想到 BSP 树是解决 VSD 问题的最佳方案,无疑非常高明。但是这可以称得上是天才之举吗? + +桑格勒德在其关于 _《毁灭战士》_ 游戏引擎的书中引用了罗梅洛的话:内勒的论文《构建高质量的分割树》主要讲述使用 BSP 树消除 3D 模型的背面。[6][11] 根据罗梅洛所言,卡马克认为这种算法对 _《毁灭战士》_ 依然有效,所以他放手一试,将 BSP 技术应用到了该游戏中。不过这话说得有些奉承的意味——意在暗示卡马克在别人仍然使用 BSP 树渲染静止的场景时,发现该技术可以用于实时游戏领域。在 _《Doom 启示录》_ 也有给卡马克戴高帽的故事。该书作者库什纳认为,卡马克在阅读内勒的论文之后,问了自己,“如果使用 BSP 技术创造一整个虚拟世界,而不仅仅是一张 3D 图像,会怎么样呢?” [7][12]。 + +这些“片面之词”忽视了 BSP 树的发展历史。当美国空军研究人员开始意识到场景分割可能会加快渲染任务的时候,他们就对提升 _实时_ 渲染的速度产生了兴趣,毕竟他们当时想要开发出飞行模拟器。1980 年,同样的案例再次出现在了福克斯等人的论文中,他们探讨了 BSP 树如何应用于飞行模拟器中,帮助飞行员进行训练:重复将飞机降至同一空港。由于空港的地形不会发生改变,BSP 树只需生成一次,即可一劳永逸。很明显,他们考虑的是实时模拟。在论文的引言部分,福克斯等人还谈到实时图形系统必须在至少 1/30 秒内生成一张图像,由此介绍了他们的研究动机。 + +因此,卡马克不是第一个想到在实时图形模拟中应用 BSP 树的人。诚然,设想与付诸实践是两码事。但是即使在实施的过程中,卡马克受到的帮助与指导可比人们想象中的要多得多。至少是到这篇文章写成之时,BSP 树的 [维基百科词条][13] 页面显示,卡马克参考了 1991 年陈和戈登的一篇论文以及 1990 年的一本教材 _《计算机图形学:原理及实践》_。尽管该页面并未提供引用信息,但是基本上不会出错。陈和戈登的论文介绍了运用 BSP 树由前向后的渲染方法,这种方法与 _《毁灭战士》_ 用到的方法基本一致,还包括我称之为“内置缓冲器”的数据结构,可用于防止远处的图形在绘制时遮挡近处的图形。_《计算机图形学:原理及实践》_ 详细介绍了 BSP 树以及一些构建并展示 BSP 树的伪代码(非常感谢我大学的图书馆,让我能够一睹这本教材的 1990 年的版本)。因为这本书是计算机图形学的经典之作,所以卡马克很可能也有一本。 + +然而,卡马克发现自己遇到一个新问题:如何让第一人称射击游戏在一台 CPU 甚至都无法进行浮点操作的电脑上运行呢?通过调查研究,他证明了 BSP 树的数据结构非常适用于实时游戏渲染。尽管 BSP 树早已提出,而且到了卡马克的时代,相关理论已经非常成熟了,但我始终认为,卡马克的做法可谓惊人之壮举。也许,得到人们称誉的应该是整个 _《毁灭战士》_ 的游戏引擎,毕竟它的确非常精致。我在前文也提及过,但是桑格勒德的 _《游戏引擎黑皮书:毁灭战士》_ 很好地讲解了这款游戏引擎的非凡之处以及这些优势相互契合之法。要明白,VSD 问题只是卡马克在编写 _《毁灭战士》_ 游戏引擎时需要解决的诸多问题之一。不得不说,面对不为大多数程序员所知的复杂的数据结构,卡马克能够查阅相关文献,将其付诸实践,仅此一点就足以说明其技术之精湛、匠心之独到。 + +_如果你喜欢这篇文章,欢迎关注推特 [@TwoBitHistory][14],也可通过 [RSS feed][15] 订阅,获取最新文章(每四周更新一篇)。_ + +_TwoBitHistory 文章回顾……_ + +> 我曾想花上一段时间深入了解 GNU Readline,所以我以此为主题写了一篇新博客,包括在与 Readline 库(以及 Bash)的维护者切特·雷米通过邮件交流时了解到的一些趣事: +> +> — TwoBitHistory (@TwoBitHistory) [2019 年 8 月 22 日][16] + + 1. Michael Abrash, “Michael Abrash’s Graphics Programming Black Book,” James Gregory, accessed November 6, 2019, . [↩︎][17] + + 2. R. Schumacher, B. Brand, M. Gilliland, W. Sharp, “Study for Applying Computer-Generated Images to Visual Simulation,” Air Force Human Resources Laboratory, December 1969, accessed on November 6, 2019, . [↩︎][18] + + 3. Henry Fuchs, Zvi Kedem, Bruce Naylor, “On Visible Surface Generation By A Priori Tree Structures,” ACM SIGGRAPH Computer Graphics, July 1980. [↩︎][19] + + 4. Fabien Sanglard, Game Engine Black Book: DOOM (CreateSpace Independent Publishing Platform, 2018), 200. [↩︎][20] + + 5. Sanglard, 206. [↩︎][21] + + 6. Sanglard, 200. [↩︎][22] + + 7. David Kushner, Masters of Doom (Random House Trade Paperbacks, 2004), 142. [↩︎][23] + + + + +-------------------------------------------------------------------------------- + +via: https://twobithistory.org/2019/11/06/doom-bsp.html + +作者:[Two-Bit History][a] +选题:[lujun9972][b] +译者:[aREversez](https://github.com/aREversez) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://twobithistory.org +[b]: https://github.com/lujun9972 +[1]: tmp.eMwywbWYsp#fn:1 +[2]: https://youtu.be/HQYsFshbkYw?t=822 +[3]: tmp.eMwywbWYsp#fn:2 +[4]: https://twobithistory.org/images/matrix_figure.png +[5]: tmp.eMwywbWYsp#fn:3 +[6]: https://twobithistory.org/images/bsp.svg +[7]: https://twobithistory.org/images/bsp1.svg +[8]: https://twobithistory.org/images/bsp2.svg +[9]: tmp.eMwywbWYsp#fn:4 +[10]: tmp.eMwywbWYsp#fn:5 +[11]: tmp.eMwywbWYsp#fn:6 +[12]: tmp.eMwywbWYsp#fn:7 +[13]: https://en.wikipedia.org/wiki/Binary_space_partitioning +[14]: https://twitter.com/TwoBitHistory +[15]: https://twobithistory.org/feed.xml +[16]: https://twitter.com/TwoBitHistory/status/1164631020353859585?ref_src=twsrc%5Etfw +[17]: tmp.eMwywbWYsp#fnref:1 +[18]: tmp.eMwywbWYsp#fnref:2 +[19]: tmp.eMwywbWYsp#fnref:3 +[20]: tmp.eMwywbWYsp#fnref:4 +[21]: tmp.eMwywbWYsp#fnref:5 +[22]: tmp.eMwywbWYsp#fnref:6 +[23]: tmp.eMwywbWYsp#fnref:7 diff --git a/translated/tech/20210809 What is Firefox Multi-Account Containers- Why and How to Use It.md b/translated/tech/20210809 What is Firefox Multi-Account Containers- Why and How to Use It.md new file mode 100644 index 0000000000..081ce8e41f --- /dev/null +++ b/translated/tech/20210809 What is Firefox Multi-Account Containers- Why and How to Use It.md @@ -0,0 +1,127 @@ +[#]: subject: "What is Firefox Multi-Account Containers? Why and How to Use It?" +[#]: via: "https://itsfoss.com/firefox-containers/" +[#]: author: "Hunter Wittenborn https://itsfoss.com/author/hunter/" +[#]: collector: "lujun9972" +[#]: translator: "hanszhao80" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +浅议 Firefox 多账户容器 +====== + +随着在设备上使用各种程序的用户的需求变得越来越复杂,程序本身也需要跟上用户的现实需求和未来期望。 + +我发现我每天都需要的东西是用一个简便的方法在网页浏览器保持登录多个账号。我 _可以_ 根据需要对我的每个账号进行登录和注销操作,但在短时间内切换多个账号时,这变得非常乏味。 + +最初,我使用谷歌浏览器,它拥有管理多个帐户的能力。这很有效,但管理起来略显繁琐,而且明明只需 _一个_ 账号就能搞定的事却要创建一个新的谷歌账号来完成,这显得有点儿笨拙。 + +这是我转而使用 Firefox 多账户容器Multi-Account Containers 功能的原因。它不仅比我在谷歌 Chrome 浏览器上的设置灵活得多,而且我还使用了由我的浏览器开发者自己创建的工具,从而在整体上获得了更流畅和更简单的体验。 + +![Firefox 中的容器图示][1] + +### Firefox 中的多帐户容器是什么? + +如果你想将数字生活的各个部分彼此分开,多账户容器也非常有效。当你使用容器时,你在一个容器中的浏览活动不会与其他容器共享。这种隔离意味着你可以在不同容器中登录同一网站上的两个不同帐户。你的登录会话、网站偏好和跟踪数据将被限制在你使用某个网站的容器中。 + +它还有什么其他优势?想象一下,你在亚马逊或其他电子商务网站上购物。你浏览了一些商品,但没有购买任何东西。现在,如果你浏览网络,你会看到与你浏览的产品相关的广告。尽管有广告拦截器,一些网站仍会显示广告。使用容器,你可以将你的购物网站与其他网站分开。 + +再给大家分享一个例子。Firefox 默认提供一个 Facebook 容器。默认情况下,此容器包括 Facebook、Messenger 和 Instagram 网站。这意味着当你打开这三个网站中的任何一个时,它们都只会在“Facebook 容器”中打开。因此,Facebook 将无法跟踪你在其他网站上的活动。 + +这是 [很少有人知道或使用的 Firefox 功能][2] 之一。 + +### 使用多账户容器 + +安装 Firefox 多账户容器是一个非常简单的过程,只需点击几下。 + +首先,前往 Firefox 附加组件网站上的 [扩展程序页面][3]。之后你唯一需要做的就是单击 `添加到 Firefox` 按钮。 + +![][4] + +安装完成!现在我们可以实际使用一下这个新的扩展。 + +可能你还没有注意到,你的搜索栏右侧应该会出现一个新图标: + +![][5] + +这是你将用于与 Firefox 多帐户容器交互的图标。如果你单击该图标,你将看到一个小菜单: + +![][6] + +让我们使用这个扩展尝试一些例子,看看多账户容器是如何工作的。 + +#### 设置容器 + +首先,我们需要生成一个容器。点击多账户容器菜单中的 `管理容器Manage Containers,然后点击 新建容器New Container。 + +![][7] + +![][8] + +接着输入新容器的名称,选择颜色和图标。然后,点击 `OK` 保存新容器。 + +![][9] + +大功告成!我们现在可以返回主菜单在新容器中打开一个新选项卡: + +![][10] + +你还会注意到新选项卡有一些样式,表示它正在容器内运行: + +![][11] + +#### 观察容器工作 + +现在让我们看看容器在使用时实际做了什么。 + +我们将在一个普通的浏览器选项卡中访问 Linode 管理网站,我已经在其中登录: + +![][12] + +现在让我们尝试在 Firefox 容器中打开相同的页面,此时我被重定向到 Linode 登录页面: + +![][13] + +为什么我被重定向了?因为现在我没有登录。这就是 Firefox 容器的乐趣之一:在一个浏览器会话中登录后,再进入一个容器,就好像你以前从未访问过该站点一样。 + +如果你在容器内完成对某个网站的登录,你从容器中访问该网站时将会保持登录状态。你还可以使用此功能从容器内登录网站,从而使该网站的所有数据远离你的正常浏览器数据。 + +注意:你的浏览器历史记录本身之类的内容仍会暴露给你的正常浏览器会话。容器功能只是提供了一种方法来分离本文中提到的登录帐户等内容。 + +### 总结 + +对于那些在乎自己的隐私,或者只是想真正尝试对其系统的安全性进行严格控制的人来说,多账户容器被证明是一个很棒的功能。 + +例如,你可以在容器内登录你的 Google 帐户,Google 永远不会知悉你在容器外的信息。 +个帐户的人来说,此扩展程序是一个不错的选择。有了它无需为你要使用的每样东西创建单独的浏览器帐户。 + +好了,这就是 Firefox 的多帐户容器的基本知识。 + +需要任何帮助,或者只是有一个一般的问题?请随时在评论区指出。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/firefox-containers/ + +作者:[Hunter Wittenborn][a] +选题:[lujun9972][b] +译者:[hanszhao80](https://github.com/hanszhao80) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/hunter/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Firefox-container.png?resize=800%2C450&ssl=1 +[2]: https://itsfoss.com/firefox-useful-features/ +[3]: https://addons.mozilla.org/en-US/firefox/addon/multi-account-containers/?utm_source=addons.mozilla.org&utm_medium=referral&utm_content=search +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-install-page.png?resize=800%2C366&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-searchbar-icon-1.png?resize=800%2C48&ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-main-menu.png?resize=302%2C474&ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-manage-containers-1.png?resize=291%2C402&ssl=1 +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-new-container.png?resize=290%2C399&ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-new-container-itsfoss.png?resize=292%2C401&ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-opening-new-container.png?resize=290%2C398&ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-new-container-styling.png?resize=800%2C370&ssl=1 +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-linode.png?resize=800%2C114&ssl=1 +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-linode-login.png?resize=800%2C405&ssl=1 diff --git a/translated/tech/20210823 Write a chess game using bit-fields and masks.md b/translated/tech/20210823 Write a chess game using bit-fields and masks.md new file mode 100644 index 0000000000..93acc16746 --- /dev/null +++ b/translated/tech/20210823 Write a chess game using bit-fields and masks.md @@ -0,0 +1,160 @@ +[#]: subject: "Write a chess game using bit-fields and masks" +[#]: via: "https://opensource.com/article/21/8/binary-bit-fields-masks" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lujun9972" +[#]: translator: "FYJNEVERFOLLOWS" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +使用位字段和掩码写一个国际象棋游戏 +====== +使用位字段和掩码是不用数据结构组合数据的常用方法。 +![Chess pieces on a chess board][1] + +假设你在用 C 语言写一个国际象棋游戏。追踪棋盘上棋子的一种方法是定义一个结构,该结构定义了棋盘上每个可能的棋子及其颜色,因此每个格子都包含该结构中的一个元素。例如,你可以将结构定义成下面这样: + + +``` +struct chess_pc { +   int piece; +   int is_black; +} +``` + +有了这个数据结构,你的程序就会知道每个格子里是什么棋子及棋子的颜色。你可以快速识别出棋子是兵、车、马、象、后还是王,以及棋子是黑还是白。但是,有一种更直接的方法来跟踪这些信息,同时只用更少的数据和内存。与为棋盘上的每个方格存储两个 `int` 值的结构不同,我们可以存储单个 `int` 值,并使用二进制位字段和掩码来标识每个方格中的棋子和颜色。 + + +### 比特和二进制 + +当使用位字段表示数据时,我们最好像计算机一样思考。让我们从列出可能的棋子开始,并为每个棋子分配一个数字。我将帮助我们进入下一个步骤,用二进制表示这个数字,也就是按照计算机追踪它的方式。记住,二进制数是由比特组成的,比特要么是 0,要么是 1。 + + * `00000000:` 空 (0) + * `00000001:` 兵 (1) + * `00000010:` 车 (2) + * `00000011:` 马 (3) + * `00000100:` 象 (4) + * `00000101:` 后 (5) + * `00000110:` 王 (6) + + + +要列出一个棋盘上的所有棋子,我们只需要三个比特从右到左依次代表值 1、2 和 4。例如,数字 6 是二进制的 110。6 的二进制表示中的其他所有位都是 0。 + +一个聪明一点的方法:我们可以使用那些额外的总为零的比特来跟踪一个棋子是黑还是白。我们可以使用数字 8(二进制 `00001000`)来表示棋子是否为黑色。如果这一位是 1,则代表该棋子是黑色;如果是 0,则代表该棋子是白色。这被称为**位字段**,稍后我们可以使用二进制**掩码**将其取出。 + +### 用位字段存储数据 + +要编写一个使用位字段和掩码的国际象棋程序,我们可以从以下定义开始: + + +``` +/* 棋子 */ + +#define EMPTY 0 // 空 +#define PAWN 1 // 兵 +#define ROOK 2 // 车 +#define KNIGHT 3 // 马 +#define BISHOP 4 // 象 +#define QUEEN 5 // 后 +#define KING 6 // 王 + +/* 棋色 */ + +#define BLACK 8 // 黑 +#define WHITE 0 // 白 + +/* 掩码 */ + +#define PIECE 7 +``` + +当你为一个棋格赋值时,比如初始化棋盘,你可以赋一个 `int` 类型的值来跟踪棋子及其颜色。例如,要在棋盘的 0,0 位置存储棋子黑车,你可以使用下面的代码: + + +``` +  int board[8][8]; + +.. + +  board[0][0] = BLACK | ROOK; +``` +`|` 是二进制或符号,这意味着计算机将合并两个数字的比特。对于每个比特的位置,如果**任意一个**数字的比特为 1,该位置比特的结果也是 1。`BLACK` 的值(8,即二进制下的 `00001000`)和 `ROOK` 的值(2,即二进制下的 `00000010`)的二进制或结果是二进制下的 `00001010`,即 10: + + +``` +    00001000 = 8 + OR 00000010 = 2 +    ________ +    00001010 = 10 +``` + +类似地,要在棋盘的 6,0 位置存储一个白色兵,你可以这样做: + + +``` +  board[6][0] = WHITE | PAWN; +``` +这样存储的值就是 `WHITE` (0) 和 `PAWN` (1) 的二进制或的结果,也即是 1。 + + +``` +    00000000 = 0 + OR 00000001 = 1 +    ________ +    00000001 = 1 +``` + +### 用掩码获取数据 + +在下棋过程中,程序需要知道棋格中的棋子和它的颜色。我们可以使用二进制掩码来分离这部分。 + +举个例子,程序可能需要知道棋局中棋盘上特定棋格的内容,例如位于 `board[5][3]` 的数组元素。这个是什么棋子,是黑的还是白的?为了识别棋子,使用二进制和 (AND) 将元素的值与掩码 `PIECE` 结合起来: + + +``` +  int board[8][8]; +  int piece; + +.. + +  piece = board[5][3] & PIECE; +``` +二进制与 (AND) 操作符 (`&`) 将两个二进制值结合,这样对于任意位,如果两个数字中的那个位**都是** 1,那么结果也是 1。例如,如果 `board[5][3]` 的值是 11(二进制下的 `00001011`),那么 11 和 掩码 `PIECE`(7,二进制下的 `00000111`)二进制与的结果为二进制下的 `00000011`,也即 3。这代表马,马的值是 3。 + + +``` +    00001011 = 11 +AND 00000111 = 7 +    ________ +    00000011 = 3 +``` +解析棋子的颜色是一个简单的事情,只需要将棋子的值与 `BLACK` 位字段进行二进制与操作。比如,你可以写一个名为 `is_black` 的函数来确定棋子是黑还是白: + + +``` +int +is_black(int piece) +{ +  return (piece & BLACK); +} +``` +这样之所以有效,是因为 `BLACK` 的值为 8(二进制下的 `00001000`)。在 C 语言中,任何非零值都被视为 True,零总是 False。所以如果 `5,3` 处的棋子是黑色的,则 `is_black(board[5][3])` 返回 True 值 (8);如果是白色的,则返回 False 值 (0)。 + +### 位字段 +使用位字段和掩码是不使用结构组合数据的常用方法。它们值得被程序员收藏到“工具包”中。虽然数据结构对于需要跟踪相关数据的有序编程是一种有价值的工具,但是使用单独的元素来跟踪单个的 On 或 Off 值(例如棋子的颜色)的效率较低。在这些情况下,可以考虑使用位字段和掩码来更高效地组合数据。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/binary-bit-fields-masks + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[FYJNEVERFOLLOWS](https://github.com/FYJNEVERFOLLOWS) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life-chess-games.png?itok=U1lWMZ0y (Chess pieces on a chess board) diff --git a/translated/tech/20210910 MAKE MORE with Inkscape - Ink-Stitch.md b/translated/tech/20210910 MAKE MORE with Inkscape - Ink-Stitch.md new file mode 100644 index 0000000000..40211cb668 --- /dev/null +++ b/translated/tech/20210910 MAKE MORE with Inkscape - Ink-Stitch.md @@ -0,0 +1,212 @@ +[#]: subject: "MAKE MORE with Inkscape – Ink/Stitch" +[#]: via: "https://fedoramagazine.org/make-more-with-inkscape-ink-stitch/" +[#]: author: "Sirko Kemter https://fedoramagazine.org/author/gnokii/" +[#]: collector: "lujun9972" +[#]: translator: "aREversez" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +MAKE MORE with Inkscape – Ink/Stitch +====== + +![MAKE more with Inkscape - Ink/Stitch][1] + +Inkscape 是 Fedora 设计团队最喜爱最常用的软件,它的功能可不止于制作精美的矢量图形。矢量图形(也就是 SVG 文件)可以帮助实现更多操作,许多软件也支持这一格式。不过,Inkscape 还有其他功能有待发掘。[本系列][2] 第一篇文章介绍了如何 [使用 Inkscape 生成 GCode 文件][3];本篇文章将探索 Inkscape 的另一项拓展功能:用于绣花设计的 [Ink/Stitch][4]。 + +### 绣花 DIY + +在过去数年里,DIY 风靡一时。可以说,这一现象始于廉价的 [3D 打印][5] 技术,以及后来的 [数控][6] 机床与激光切割机、激光雕刻机。这些设备都算不上非常昂贵。同时,绣花机等“传统”机器的价格也有下降。[家用绣花机现在只需 500 美元就能买到了][7]。 + +如果你不想买或者买不到绣花机,离你最近的 [创客空间][8] 一般也会有。即便是一台商用单头绣花机,价格也下降到了 5000 美元。对于购置绣花机这种投资来说,一般很快就能看到回报。 + +### 绣花设计软件 + +一些家用绣花机附有配套的绣花设计软件,不过大部分都只能在 Windows 系统上运行,就算该领域最常用的、独立于各绣花机制造商的软件 [Embird][9] 也是如此。不过,你也可以通过 Wine 来运行这些软件。 + +在 Linux 上,另一个办法就是使用 [Embroidermodde][10]。不过,该软件在 2014 年的募捐活动之后,就停止了开发活动。 + +到今天,只剩下一个办法:[Ink/Stitch][4] + +![The logo of the Ink/Stitch project][11] + +### 开源与绣花设计 + +绣花机价格高以及 Linux 用户少都怪不得制造商,毕竟为 Linux 开发应用的确不太值得。 + +#### 绣花文件格式问题 + +绣花机所用文件格式大量涌现,甚至还有一些制造商为自家机器定制了文件格式。在某些情况下,即便是一家制造商,可能也会使用多种文件格式。 + + * **.10o** – 丰田绣花机 + * **.100** – 丰田绣花机 + * **.CSD** – Poem,Huskygram 和胜家家用绣花缝纫机 + * **.DSB** – 百灵达绣花机 + * **.JEF** – 车乐美 MemoryCraft 10000 + * **.SEW** – 车乐美 MemoryCraft 5700, 8000, and 9000 + * **.PES** – 兄弟和 Babylock 家用绣花缝纫机 + * **.PEC** – 兄弟和 Babylock 家用绣花缝纫机 + * **.HUS** – 好时运家用绣花缝纫机 + * **.PCS** – 百福家用绣花缝纫机 + * **.VIP** – 百福旧格式 & 好时运格式 + * **.VP3** – 百福家用缝纫机新格式 + * **.DST** – 田岛商用绣花缝纫机 + * **.EXP** – 美高商用绣花缝纫机 + * **.XXX** – Compucon 和 胜家家用绣花缝纫机 + * **.ZSK** – 美国市场的 ZSK 绣花机 + + + +关于绣花机会用到的文件格式,上面列出来的只是九牛一毛,可 [在此][14] 查看全部格式。如果你想进一步了解这些文件格式,可点击 [此处][15] 获取更多信息。 + +#### Ink/Stitch 文件格式 + +Ink/Stitch 最初使用的是 [libembroidery][12] 库,现在则使用 [pyembroidery][13] 库。在 pyembroidery 库的支持下,Ink/Stitch 目前可以读取以下格式:100, 10o, BRO, DAT, DSB, DST, DSZ, EMD, EXP, EXY, FXY, GT, INB, JEF, JPX, KSM, MAX, MIT, NEW, PCD, PCM, PCQ, PCS, PEC, PES, PHB, PHC, SEW, SHV, STC, STX, TAP, TBF, U01, VP3, XXX, ZXY 以及 TXT(内容为 GCode 代码)。 + +不过,Ink/Stitch 支持的储存格式则比较少:DST, EXP, JEF, PEC, PES, U01, VP3 and of course SVG, CSV 以及 TXT(内容为 GCode 代码)。 + +除了文件格式,绣花缝纫软件还需解决其它一些问题。 + +支持繁杂多样的线迹类型是一个难题,绘制工具与缝制工具的搭配使用又是另一个难题。不过,为什么非要从无到有搞出一套新应用?为什么不依赖现有的矢量软件?这样一来,开发者只需要在其基础上增添绣花拓展功能即可。后者就是 [Ink/Stitch 项目][4] 过去四年来的设计理念。 + +### 安装 Ink/Stitch + +Ink/Stitch 是 [Inkscape 的一个拓展功能][16]。不过,由于 Inkscape 下载安装拓展的新功能还处于测试阶段,在其提供的拓展功能中可能无法找到 Ink/Stitch。因此,你需要自行手动 [下载][17] 该拓展。下载后,将压缩包解压到 Inkscape 拓展所在路径,默认路径为 _~/.config/Inkscape/extensions_(或者放置在系统全局路径:_/usr/share/inkscape/extensions_)。若你改变了默认路径,则需检查 Inkscape 设置选项,找到拓展文件的存放位置。 + +### 自定义:为 Ink/Stitch 安装插件 + +Ink/Stitch 提供了为 Inkscape 安装插件的功能,用户需首先执行这一功能。 + +依次点击如下选项:_扩展Extensions > Ink/Stitch > 线条颜色管理Thread Color Management > 为 Inkscape 安装线条调色板Install thread color palettes for Inkscape_,之后等待片刻。 + +虽然这一过程不会出现进度条之类的提示,不过也无需着急。 + +该功能执行后,将会安装来自不同纱线制造商的 70 套色板,以及一套符号库。 + +![Inkscape with the swatches dialogue open, which shows the Madeira Rayon color palette][18] + +如果你使用的 Ink/Stitch 是从 Github 下载的 2.0.0 版本,那么下载下来的 ZIP 文件里就包括了色板文件。你只需将其解压到正确的路径:_~/.config/inkscape/palettes/_。如果你需要环形模板,可以点击 [此处][19] 下载,并将其保存到 _~/.config/inkscape/templates_ 目录下. + +重新启动 Inkscape,可在 _文件File > 由模板新建New From Template_ 下找到该模板。 + +### Ink/Stitch 绣字 + +到目前为止,绣花设计最简单也最常用的方法就是使用 Ink/Stitch 的 _文字缝制Lettering_ 功能。该功能位于 _拓展Extensions > Ink/Stitch > 文字缝制Lettering_。绣花文字缝制可不是一件简单事儿,它其实就是所谓的缎面绣字,需要做好特殊的文字设置。 + +![Inkscape with a “Chopin” glyph for satin stitching defined for the Lettering function][20] + +你可以将路径转换为缎面绣,但是这种方法比使用文字缝制功能还要繁琐许多。多亏了社区的活跃,2021 年 5 月份发布的 Ink/Stitch 2.0 版本预置了更多的字体。2.0 版本还增加了 _拓展Extensions > Ink/Stitch > 字体管理Font Management_ 功能,让用户更方便地管理这些字体。 + +此外,还有制作字体的功能,但是你需要了解如何使用 Inkscape 设计字体,可在 [此处][21] 浏览相关英文教程。这里只给出大概的介绍:首先创建一个 SVG 字体,接着将其储存在 JSON 文件中,这样便可以在 Ink/Stitch 字体管理功能中使用。 + +![On the left side the Lettering dialogue and on the right the preview of this settings][22] + +该功能将打开一个对话窗口,你可以把文字输进去,调整字体及其大小,然后即可将输入的文字渲染出来。 + +### 绣制区域、路径等对象 + +Ink/Stitch 最容易实现的就是绣制区域或者路径。你需要做的只是画出路径。如果你使用的是形状,那么你需要将其转换成路径,然后执行如下操作:_拓展Extensions > Ink/Stitch > 填充工具Fill Tools > 分离填充对象Break Apart Fill Objects…_,将路径分割成若干部分。 + +虽然 Inkscape 也有 _路径Path > 分离Break apart_ 功能,但是在这种情况下并不可行。 + +接下来,运行 Ink/Stitch 内置模拟器:_拓展Extensions > Ink/Stitch > 可视化并导出Visualise and Export > 模拟器/实际预览Simulator/Realistic Preview_. + +![The new Fedora logo as Stitch Plan Preview][23] + +注意,模拟器运行时需要占用大量的系统资源,而且启动时间也比较长。其实,以下功能操作起来会更加简便:_拓展Extensions > Ink/Stitch > 可视化并导出Visualise and Export > 线迹计划预览Stitch Plan Preview_。该功能会在文件外部对线条进行渲染。 + +![Nicubunu’s Fedora hat icon as embroidery. The angles for the stitches of the head part and the brim are different so that it looks more realistic. The outline is done in Satin stitching][24] + +### 简单的缎面及缎面绣 + +Ink/Stitch 会使用连续的线条(非虚线)将每个笔画转换成之字形或简单的缎面。依照预先设置好的描边宽度,沿着路径绣出线迹。只要路径上没有过多的曲线,使用这一方法就没问题。 + +![Parameter setting dialogue and on the right the Fedora logo shape embroidered as Zig-Zag line][25] + +这个方法虽然简单,但绝不是最好的选择。最好的选择是使用缎面工具,该功能可以在 _拓展Extensions > 缎面工具Satin Tools_ 找到。其中,转换功能又是重中之重,它可以将路径转换为缎面笔画。 + +![Fedora logo shape as Satin Line embroidery][26] + +通过 _拓展Extensions > 缎面工具Satin Tools > 旋转缎纹路径Flip Satin Column Rails_,你还可以改变线迹的方向。这样做可以凸显缎面绣的立体感,典型的例子就是泡芙刺绣(一种非常具有立体感的刺绣)。支持这种功能的机器还可以为绣花时产生的多余的连线线迹标记出修剪记号。这些记号正是从 Ink/Stitch 自身符号库里安装得到的符号。 + +### Ink/Stitch 线迹库 + +线迹库包括了 Ink/Stitch 可以创建的线迹类型。在前文,填充式线迹和之字形/缎纹线迹已经介绍过了,不过其他还有很多。 + + * **平针**:平针用于边缘装饰,沿直线或曲线缝制出一排短小的线迹,由此组成的一条条虚线就是平针。虚线的尺寸可大可小。 + + + +![A running stitch – each dashed line will be converted in such one][27] + + * **豆针**:豆针可用于边缘装饰或添加设计细节。使用平针来回缝制就是豆针,这种缝法会增加线迹的厚度。 + + + +![Bean Stitches – creating a thicker line][28] + + * **手工针**:在该模式下,Ink/Stitch 会将路径的每个节点当作穿针点;这些节点也正是针穿入的位置。 + + + +![In manual mode – each node will be the needle penetration point][29] + + * **E 字针**:E 字针是一种简单但十分好用的绷缝线迹,用于贴花织物。这种线迹多用于婴儿装,因为婴儿的皮肤比较敏感。 + + + +![E-Stitch mostly used for applications on baby cloths, soft but strong connection][30] + +### 绣花用线列表 + +有些绣花机,尤其是商用的绣花机,根据设计的需要,可以提前适配不同的针线。必要时,这类机器会自动切换使用合适的针线。有些绣花文件格式支持这一功能,但有些并不支持。Ink/Stitch 可以将用户设置好的线条列表应用到绣花设计中。 + +如果你想在现有的设计上导入线条列表,可执行如下操作:_拓展Extensions > Ink/Stitch > 导入线条列表Import Threadlist_。同样的,线条列表也可以导出:_另存为 zip 文件,打包多种不同的文件格式Save As different file formats as *.zip_。当然,也可以将其打印出来:_拓展Extensions > Ink/Stitch > 可视化并导出Visualise and Export > 打印 PDFPrint PDF_。 + +### 结语 + +为绣花设计编写软件可不是一件简单的事儿,软件需要支持很多功能,还要应对不同文件格式(有些属于闭源文件格式)带来的难题。Ink/Stitch 已经做得很好了,尽力打造出了一款功能多样的绣花工具,让用户能够进行基础的绣花设计。当然,它也不是完美的,有些功能还需要完善。但是,Ink/Stitch 绝对是一款十分优秀的工具,我也希望它能越来越好。绣花是个不错的兴趣爱好,有了 Ink/Stitch,Fedora Linux 用户便可开启天马行空的设计之门。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/make-more-with-inkscape-ink-stitch/ + +作者:[Sirko Kemter][a] +选题:[lujun9972][b] +译者:[aREversez](https://github.com/aREversez) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/gnokii/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/08/drawing2-816x345.png +[2]: https://fedoramagazine.org/series/make-more/ +[3]: https://fedoramagazine.org/make-more-with-inkscape-g-code-tools/ +[4]: https://inkstitch.org/ +[5]: https://fedoramagazine.org/3d-printing-in-fedora-from-an-idea-to-the-thing/ +[6]: https://en.wikipedia.org/wiki/Numerical_control +[7]: https://www.amazon.com/-/de/dp/B07VZ2YBLL/ref=sr_1_11?__mk_de_DE=%C3%85M%C3%85%C5%BD%C3%95%C3%91&crid=1MFJJWXMKQD6R&dchild=1&keywords=home+embroidery+machine&qid=1628388092&rnid=2941120011&s=arts-crafts&sprefix=home+embroider+%2Caps%2C-1&sr=1-11 +[8]: https://www.fablabs.io/labs/map +[9]: https://www.embird.net/ +[10]: https://embroidermodder.org/ +[11]: https://fedoramagazine.org/wp-content/uploads/2021/08/inkstitch_logo.png +[12]: https://github.com/Embroidermodder/libembroidery +[13]: https://github.com/inkstitch/pyembroidery +[14]: http://www.needlework.ru/page/embroidery.htm +[15]: http://edutechwiki.unige.ch/en/Embroidery_format +[16]: https://inkscape.org/~wwderw/%E2%98%85inkstitch-embroidery-extension +[17]: https://github.com/inkstitch/inkstitch/releases/tag/v2.0.0 +[18]: https://fedoramagazine.org/wp-content/uploads/2021/08/swatches-1024x556.png +[19]: https://inkstitch.org/assets/images/tutorials/templates/hoop-template.svg +[20]: https://fedoramagazine.org/wp-content/uploads/2021/08/satinfont-1024x556.png +[21]: https://inkstitch.org/tutorials/font-creation/ +[22]: https://fedoramagazine.org/wp-content/uploads/2021/08/lettering-1024x523.png +[23]: https://fedoramagazine.org/wp-content/uploads/2021/08/stitch-preview-1024x556.png +[24]: https://fedoramagazine.org/wp-content/uploads/2021/08/nicu-stitch.gif +[25]: https://fedoramagazine.org/wp-content/uploads/2021/08/zigzag-1024x463.png +[26]: https://fedoramagazine.org/wp-content/uploads/2021/08/satin.png +[27]: https://fedoramagazine.org/wp-content/uploads/2021/08/running-stitch-detail.jpg +[28]: https://fedoramagazine.org/wp-content/uploads/2021/08/bean-stitch-detail.jpg +[29]: https://fedoramagazine.org/wp-content/uploads/2021/08/manual-stitch-detail.png +[30]: https://fedoramagazine.org/wp-content/uploads/2021/08/e-stitch-detail.jpg diff --git a/translated/tech/20220716 Does an Ethernet splitter slow down speed-.md b/translated/tech/20220716 Does an Ethernet splitter slow down speed-.md new file mode 100644 index 0000000000..5efe411d77 --- /dev/null +++ b/translated/tech/20220716 Does an Ethernet splitter slow down speed-.md @@ -0,0 +1,100 @@ +[#]: subject: "Does an Ethernet splitter slow down speed?" +[#]: via: "https://www.debugpoint.com/ethernet-splitter-speed/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "MCGA" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +以太网分离器会降低网速吗? +====== + +这批文章详细总结了以太网分离器,以及它们的速度,还有常见问题等信息,来帮助你选择最合适的硬件。 + +交换机Switch集线器Hub,还有以太网分离器Ethernet Splitter是用来帮助扩展网络的网络设备。这其中,最基础的设备就是小巧的以太网分离器了。它们是可以将一个以太网信号分成两个的小型设备。它们简单易用,并且还便宜。这可以算是最简单的网络设备之一了,因为他们不需要提供电源,也不需要特定的按键或者 LED 灯来提示状态。只是在一个小设备上有三个以太网端口,其中两个在一侧,另一个在另一侧。有些品种是在一侧有带着一小段 [RJ45][1] 网线的连接,另一侧是两个以太网端口。 + +尽管在网络世界中,分离器已经存在了相当长一段时间了,很多人还是不知道如何有效使用它们。与普遍的看法相反的是,以太网分离器应该总是成对购买。直接把分离器的一端和路由器连接,再把两个设备与分离器的两个端口连接,这样是不行的。想让分离器在网络中正常工作,是有一个正确的设置技巧的。 + +### 如何使用以太网分离器进行一个基本的设置 + +要从主信号源连接两个在不同房间的设备,以太网分离器是非常方便的。大多数情况下,它们可以节约网线、墙上的网络出口,以及提供可靠的连接 。就像之前说的,以太网分离器是成对卖的。一个分离器把信号从设备(通常是路由器)上合并,然后另一个把信号分成两个信道,这样就可以让两个设备通信了。 + +路由器在房间 A,两个 PC 在房间 B,但是每个房间的墙上只有一个以太网接口。这种情况下,就需要一个分离器,两条网线网线连到路由器上,网线的另外一端连到分离器上,然后分离器的另一端连到房间 A 墙上的接口。这样路由器的两个信号就合并到一起了。接下来,另一个分离器只有一个端口的那一端接到房间 B 墙上的接口上。从房间 A 合并的信号现在就会分成两个,这样在房间 B 里面,你就可以有两个以太网端口了。 + +分离器的优势是它可以大量减少墙上的接口,也会大量减少你这种情况下所需的网线。它会帮你避免“网线地狱”,因为这样会以 2 的倍数降低所需要的端口/网线。 + +![sample diagram using ethernet splitter][2] + +### 以太网分离器会降低网速吗? + +网络连接会变慢吗?这可能是你想到的常见问题之一。好吧,答案取决于你的网络类型。理想情况下,分离器是 BASE-T 标准,也就是快速以太网Fast Ethernet。它们可以支持高达 Mbps 的速度。 + +答案是不,如果分离器在一个 100Mbps 的网络中使用,它是不会降低网速的。然而,如果你的路由器可以传输 1Gbps,然后你在中间用了一个分离器,那么带宽将被限制在 100Mbps。这种情况下,分离器确实会限制速度,连接会变慢。 + +### 以太网分离器的优势和劣势 + +以太网分离器在一些情况下很有用,但是它们也有一些缺点。对于小白来说,每个以太网端口只能提供最高 100Mbps 的速度。因为这个限制,网络中能够提供高于 100Mbps 的资源就不能被合理优化了。另外,因为你能连接的设备数量被限制在两个,如果你有两个以上的设备,以太网分离器并不是最佳选择。 + +此外,如果路由器只剩下一个以太网端口,使用分离器是不现实的;这时候就只能做一些牺牲了。然后,尽管它们可以减少把两个网络合并所需要的网线,这种方式需要两个分离器才能工作。 + +相反的,以太网分离器也有一些优势。它们比起常见的网络设备要便宜,也不需要复杂的设置。不像其他网络设备,它们也不需要软件和其他配置。在设备不多的家庭网络中,比如说一个房间最多两个设备,以太网分离器是一个绝佳的选择。如果你只需要 100Mbps 的网络,只有两个设备要连接,以太网分离器是最好的选项。 + +以太网分离器出现已经很长时间了,但是由于非常简单,也没有太多可以改进的空间。它们仍然是基于过时的快速以太网Fast Ethernet标准,这也许和今天高速网络的需求有点格格不入。尽管有它们的优势,大多数情况下,它们还真不是一个现实的解决方案。随着现在技术的进步,以太网分离器的前景依然光明。也许某个天才可以让他用在千兆以太网Gigabit Ethernet标准上。 + +现在你已经对以太网分离器有一些了解了,下面是一些常见问题(FAQ)。 + +### 常见问题 + +#### 可以把一条以太网线分到两个设备上吗? + +如果你想把一条以太网线分到两个设备上,这是可以想象的。然而,这就需要买一个以太网线共享分离套件。分离器套件可以让多个设备同时使用同一条网线。如果你想把 PC 和笔记本,或者 PC 和游戏主机,同时连到同一个网线上,这是个不错的选择。 + +说到连接速度,以太网线会超过其他连接方式。当有些东西需要快速连接,比如说游戏,以太网线通常都是最好的选择。 + +需要指出的是,你不能用一个网线连接两个设备,因为它们只是为一个设备而设计的,这也就是为什么你需要一个以太网分离器。它会连到一个已有的网线上,然后为两个设备提供连接。 + +#### 我怎么把两个设备连到一个以太网端口? + +两个设备可以连到一个以太网端口。然而,就像之前说的,你需要使用网线共享套件。这是因为每个以太网连接是为一个单个设备设计的。 + +有了以太网线共享套件,你就可以给一个以太网端口连上多个设备了,这对于家庭网络来说是非常方便的。如果你有几个以太网连接可用,然后需要很多的 LAN 连接,这肯定有用。 + +还需要说的一点是,如果你有多余的以太网端口可用,如果是这种情况,最好的选择是给每个设备分配一个端口。当这种情况不行的时候,网线共享套件或者分离器是一个完美的备选方案。 + +#### 以太网分离器和交换机有什么区别? + +以太网分离器和交换机工作起来差不多,但是从根本上是不同的。以太网分离器可以在同一根以太网线上运行两个独立的连接。然而,这最多就是两个连接。如果你只想要一个另外的设备连到这个以太网上,这是个不错的选择。但是,再有其他设备就不行了。 + +如果你想往一个以太网连接上连很多个设备,就需要买一个以太网交换机。除了可以允许多于两个设备连接外,交换机和以太网分离起相似。如果有很多要连接的设备,但是只有几个以太网端口,交换机是非常方便的,比如说你正在连接很多设备到 LAN。 + +在他们支持多个设备的时候,需要记住的是,它们也需要供电。交换机和分离器的另一个不同是,分离器不要供电,可以直接连到以太网端口。 + +#### 我需要以太网交换机还是分离器? + +你要连接的设备的数量决定了是需要一个交换机还是分离器。如果只需要连两个设备,可以用以太网分离器,也不用给他供电。 + +相反的,如果需要连好几设备,以太网交换机是一个理想的解决方案。它可以连接几个设备到同一个以太网端口,但是它需要供电。 + +我希望这篇指南能帮你了解以太网分离器以及如果使用它们。从网上可以以很低的价格买到。然而,如果需要超过 100Mbps 的速度,也许你需要给你的网络配置一下线路。 *[这篇文章是我们硬件指南的一部分。][5]* + +*Featured Photo by Jainath Ponnala on Unsplash* + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/ethernet-splitter-speed/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[Yufei-Yan](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://en.wikipedia.org/wiki/Registered_jack +[2]: https://www.debugpoint.com/wp-content/uploads/2021/10/sample-diagram-using-ethernet-splitter-1024x896.jpg +[3]: https://en.wikipedia.org/wiki/Fast_Ethernet +[4]: https://en.wikipedia.org/wiki/Gigabit_Ethernet +[5]: https://www.debugpoint.com/category/hardware diff --git a/translated/tech/20220725 How to use LibreOffice Writer templates.md b/translated/tech/20220725 How to use LibreOffice Writer templates.md new file mode 100644 index 0000000000..ca58a612b5 --- /dev/null +++ b/translated/tech/20220725 How to use LibreOffice Writer templates.md @@ -0,0 +1,102 @@ +[#]: subject: "How to use LibreOffice Writer templates" +[#]: via: "https://opensource.com/article/22/7/libreoffice-writer-templates" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +如何使用 LibreOffice Writer 模板 +====== +使用 LibreOffice 模板快速开始在 Linux 上写作。 + +![Typewriter in the grass][1] + +图片来源:jetheriot 提供原始照片。由 Rikki Endsley 修改。 CC BY-SA 2.0。 + +任何办公软件套件中的主要部件都是文字处理器。无论你的需求是大是小,从记笔记到写书,文字处理器都能完成工作。大多数 Linux 发行版都包含 [LibreOffice][2] 套件,我使用 LibreOffice Writer 作为我的文字处理器。 + +LibreOffice Writer 通过其工具栏、键盘快捷键和菜单提供了很大的灵活性。但是,如果你只是想轻松地开始一个文档,你可以使用其中一个预加载的模板。以下是如何使用 LibreOffice Writer 模板让你的工作更轻松。 + +### 开始一个新文档 + +LibreOffice Writer 从一个空白文档开始。大多数人刚开始写作,但这也是从模板创建新文档的地方。 + +首先,打开**文件**菜单,然后选择**新建**和**模板**。此选项会打开**模板**选项: + +![Open templates from the File menu][3] + +图片来源: + +(Jim Hall,CC BY-SA 4.0) + +**模板**选择对话框显示系统上可用的不同模板。默认的 LibreOffice Writer 安装包括用于不同类型的商务信函、简历和其他文档的模板。你可以使用对话框顶部的过滤器选项浏览列表或缩小结果范围。 + +![Select a template][4] + +图片来源: + +(Jim Hall,CC BY-SA 4.0) + +Click on the template you want and click **Open** to start a new Writer document using this template. Some templates include boilerplate text or other sample material you can use to get started in your new document. For example, the **Modern business letter** consists of this "lorem ipsum" sample text: +单击你想要的模板,然后单击**打开**以使用此模板开始一个新的 Writer 文档。一些模板包括样板文本或其他示例材料,你可以使用这些材料开始编写新文档。例如,**现代商务信函**由以下 “lorem ipsum” 示例文本组成: + +![Modern business letter template][5] + +图片来源: + +(Jim Hall,CC BY-SA 4.0) + +其他文档模板只是为你提供了一个具有一些漂亮默认设置的空文档的起点。例如,**现代**文档模板对文本正文使用无衬线字体(例如 Linux 系统上的 Carlito): + +![Modern template][6] + +图片来源: + +(Jim Hall,CC BY-SA 4.0) + +### 下载模板 + +如果你在内置选项中没有找到所需的模板,你可以从 LibreOffice 的网站下载合适的文档模板。进入 [LibreOffice 扩展][7]以开始使用 LibreOffice 扩展和模板库。 + +![Templates and extensions options][8] + +图片来源: + +(Jim Hall,CC BY-SA 4.0) + +在框中输入搜索词以查找你需要的文档模板。例如,学生可能会搜索 “APA” 来查找已经为 APA 样式设置的文档模板,这是学术论文的常见样式。 + +![APA format template][9] + +图片来源: + +(Jim Hall,CC BY-SA 4.0) + +### 总结 + +如果你需要编写文档,请浏览 LibreOffice 模板以找到适合你的模板。使用模板意味着你可以花费更少的时间来设置文档以使其具有某种外观,并且可以更快地工作。在支持你的工作的 LibreOffice 扩展和模板库中查找其他文档模板。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/libreoffice-writer-templates + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/doc-dish-lead.png +[2]: https://www.libreoffice.org/ +[3]: https://opensource.com/sites/default/files/2022-07/1new-file-template.png +[4]: https://opensource.com/sites/default/files/2022-07/2templates-selection.png +[5]: https://opensource.com/sites/default/files/2022-07/3modern-bus-letter.png +[6]: https://opensource.com/sites/default/files/2022-07/4modern-template.png +[7]: https://templates.libreoffice.org/ +[8]: https://opensource.com/sites/default/files/2022-07/5temps-and-extensions.png +[9]: https://opensource.com/sites/default/files/2022-07/6apa-template.png diff --git a/translated/tech/20220727 How To Automatically Update Running Docker Containers Using Watchtower.md b/translated/tech/20220727 How To Automatically Update Running Docker Containers Using Watchtower.md new file mode 100644 index 0000000000..91d72d7886 --- /dev/null +++ b/translated/tech/20220727 How To Automatically Update Running Docker Containers Using Watchtower.md @@ -0,0 +1,181 @@ +[#]: subject: "How To Automatically Update Running Docker Containers Using Watchtower" +[#]: via: "https://ostechnix.com/automatically-update-running-docker-containers/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: "Donkey" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +如何使用 Watchtower 自动更新正在运行的 Docker 容器 +====== +使用 Watchtower 自动更新 Docker 容器基础镜像 + +对开发运维人员来说,保持 Docker 容器为最新版本是重要工作之一。手动更新 Docker 容器是一项耗时的工作。这篇文章解释了 **Watchtower** 是什么,如何安装它,以及在 Linux 中如何 **使用 Watchtower 自动更新正在运行的 Docker 容器** 。 + +### Watchtower 是什么? + +**Watchtower** 是一款免费、开源的应用,用来监控运行中的 Docker 容器,并且当它发现基础镜像被更改后,可以自动的更新容器。 + +若 watchtower 发现一个运行中的容器需要更新,它会以发送 SIGTERM 信号的方式,优雅的结束运行中容器的运行。 + +它会下载新镜像,然后以最初部署时使用的方式,重启容器。所有文件会在后台自动下载,因此不需要用户的介入。 + +在这份指南中,我们将会明白如何在类 Unix 系统中使用 Watchtower 自动更新正在运行的 Docker 容器。 + +我已经在 CentOS 和 Ubuntu 中测试了这份指南,所有的 Linux 发行版中操作过程都一样。 + +### 在 Linux 中安装 Watchtower + +可以通过 Docker 镜像的方式下载 Watchtower 。因此,部署它小事一桩。在你的 Linux 中安装 Docker 镜像,然后运行 Watchtower 立即开始监控 Docker 容器。 + +参考下方指导在基于 PRM 和 DEB 包管理系统中安装 Docker + +* [如何在 CentOS 中安装 Docker][1] +* [如何在 Ubuntu 中安装 Docker][2] +* [适用于 Linux 的 Docker 桌面初学者手册][3] + + +安装 Docker 后,你可以使用以下命令以 **root** 用户身份部署 Watchtower 容器: + +``` +# docker run -d --name watchtower -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower +``` + +如果你已经安装了 Docker 桌面版,以普通用户运行 Watchtower 容器。 + +``` +$ docker run -d --name watchtower -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower +``` + +该命令会拉取最新版的 watchtower 镜像,并运行 watchtower 容器。 + +**输出样例:** + +``` +Unable to find image 'containrrr/watchtower:latest' locally +latest: Pulling from containrrr/watchtower +1045b2f97fda: Pull complete +35a104a262d3: Pull complete +1a0671483169: Pull complete +Digest: sha256:bbf9794a691b59ed2ed3089fec53844f14ada249ee5e372ff0e595b73f4e9ab3 +Status: Downloaded newer image for containrrr/watchtower:latest +91c104ef0e9896e8cd5ff30d9f13e728dbfad66443830ec2ac85dde6d7d37564 +``` + +![Run Watchtower Docker Container][4] + +### 使用 Watchtower 自动更新 Docker 容器 + +你系统上,Watchtower 正在和其他容器一起运行。你可以使用一下命令查看运行中的 Docker 容器列表: + +``` +$ docker ps +``` + +**输出样例:** + +``` +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +91c104ef0e98 containrrr/watchtower "/watchtower" 14 minutes ago Up 14 minutes 8080/tcp watchtower +f90b462b0712 bitnami/wordpress-nginx:6 "/opt/bitnami/script…" 19 minutes ago Up 19 minutes 0.0.0.0:80->8080/tcp, 0.0.0.0:443->8443/tcp ostechnix-wordpress-1 +``` + +正如上方输出所示,watchtower 容器正在和名为 **"ostechnix-wordpress-1"** 的容器一起运行。从现在开始,watchtower 会每隔几分钟会检查该容器。 + +如果 watchtower 发现该容器的基础镜像的任何变化,它会优雅的关闭 "ostechnix-wordpress-1" 容器,然后使用与最初启动它时使用的相同方式,启动新的镜像。 + +类似的,它会自动地每隔几分钟检查所有的运行中容器,并自动更新它们。 + +### Watchtower 如何更新多连接的容器? + +在监视多连接容器时,Watchtower 十分智能。 + +假设我们现在运行两个容器。 + +``` +$ docker ps +``` + +**输出样例:** + +``` +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +91c104ef0e98 containrrr/watchtower "/watchtower" 14 minutes ago Up 14 minutes 8080/tcp watchtower +f90b462b0712 bitnami/wordpress-nginx:6 "/opt/bitnami/script…" 19 minutes ago Up 19 minutes 0.0.0.0:80->8080/tcp, 0.0.0.0:443->8443/tcp ostechnix-wordpress-1 +a895f082438a bitnami/mariadb:10.6 "/opt/bitnami/script…" 20 minutes ago Up 19 minutes 3306/tcp ostechnix-mariadb-1 +``` + +![View Running Docker Containers][5] + +正如你看到的,我们正在运行 "ostechnix-wordpress-1" 和 "ostechnix-mariadb-1" 这两个容器。Mariadb 容器链接到 wordpress 容器。 + +如果 Watchtower 发现 "wordpress" 容器有个新版本,它会先关闭与之相连接的 "mariadb" 容器 ,然后才会关闭 "wordpress" 容器。 + +更新 wordpress 容器后,Watchtower 会以正确的顺序,且与最初启动它们时使用的相同方式,重启这两个容器,以便应用程序正确恢复。在我们的例子中,首先启动的是 mariadb 容器,然后是 wordpress 容器,以确保连接能够继续运行。 + +### 监控特定容器 + +默认情况下,Watchtower 将监控在它所指向的 Docker 守护进程中运行的所有 Docker 容器。 + +不过,你可以像下面这样,通过指定容器名称限制 watchtower 监视特定的 Docker 容器。 + +``` +$ docker run -d --name watchtower -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower ostechnix-wordpress-1 +``` + +在上方的例子中,watchtower 会忽略其他容器,只监视名为 "ostechnix-wordpress-1" 的容器更新情况。 + +如果你不指定任何参数,watchtower 会照常监视所有运行中的 Docker 容器。 + +### 发送提示 Sending Notifications + +或许你想收到容器更新的通知。你可以通过电子邮件、Slack 、MSTeams 以及 Gotify 发送通知。 + +下面这个例子展示了如何通过电子邮件发送通知。假设你已经设置了 SMTP 服务器。 + +``` +docker run -d \ + --name watchtower \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -e WATCHTOWER_NOTIFICATIONS=email \ + -e WATCHTOWER_NOTIFICATION_EMAIL_FROM=fromaddress@gmail.com \ + -e WATCHTOWER_NOTIFICATION_EMAIL_TO=toaddress@gmail.com \ + -e WATCHTOWER_NOTIFICATION_EMAIL_SERVER=smtp.gmail.com \ + -e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PORT=587 \ + -e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_USER=fromaddress@gmail.com \ + -e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD=app_password \ + -e WATCHTOWER_NOTIFICATION_EMAIL_DELAY=2 \ + containrrr/watchtower +``` + +参考下方 Watchtower Github 仓库和 Watchtower 官方主页获取更多信息: + +**资料** + +* [Watchtower GitHub][6] +* [Watchtower 主页][7] + +> **推荐下载** — [免费电子书: "Docker Containerization Cookbook"][8] + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/automatically-update-running-docker-containers/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[Donkey](https://github.com/Donkey-Hao) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/install-docker-centos/ +[2]: https://ostechnix.com/install-docker-ubuntu/ +[3]: https://ostechnix.com/docker-desktop-for-linux/ +[4]: https://ostechnix.com/wp-content/uploads/2022/07/Run-Watchtower-Docker-Container.png +[5]: https://ostechnix.com/wp-content/uploads/2022/07/View-Running-Docker-Containers.png +[6]: https://github.com/v2tec/watchtower +[7]: https://containrrr.dev/watchtower/ +[8]: https://ostechnix.tradepub.com/free/w_java39/prgm.cgi diff --git a/translated/tech/20220801 Padloc- An Intuitive Open-Source Password Manager.md b/translated/tech/20220801 Padloc- An Intuitive Open-Source Password Manager.md new file mode 100644 index 0000000000..a0bcdc61da --- /dev/null +++ b/translated/tech/20220801 Padloc- An Intuitive Open-Source Password Manager.md @@ -0,0 +1,114 @@ +[#]: subject: "Padloc: An Intuitive Open-Source Password Manager" +[#]: via: "https://itsfoss.com/padloc/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Padloc:一个直观的开源密码管理器 +====== +简介:探索具有令人愉悦的用户界面、跨平台可用的开源密码管理器。 + +有大量适用于个人和团队的免费和高级密码管理器。 + +然而,当谈到开源方案时,它通常仅限于几个好的方案,如 [Seahorse][1]、[KeePassXC][2] 和 [Bitwarden][3]。 + +如果您已阅读我们的 [Linux 最佳密码管理器][4]列表,你可能已经知道其中的一些。 + +我偶然发现了另一个有趣的开源密码管理器,它可以因其用户体验而进入该列表,即 **Padloc**。 + +### Padloc:安全的跨平台密码管理器应用 + +![padloc screenshot][5] + +虽然 Padloc 不是超级流行,但它不仅仅是另一个开源密码管理器。 + +你可以通过应用和端到端加密来保护密码,从而获得令人耳目一新的用户体验。它旨在提供一个干净简单的界面来使用。 + +![padloc light mode][6] + +免费开始,但提供付费订阅以解锁大多数功能。 + +它支持所有主要平台,包括 Linux、Windows、macOS、Android 和 iOS。 + +你还可以获得 Mozilla Firefox 和 Google Chrome 的浏览器扩展以及所有可用的应用。因此,你也可以随时选择在网络浏览器上访问/使用它。 + +有趣的是,直到最近,该项目近两年都没有看到任何重大更新。但是,它是一个积极维护的开源项目。 + +### Padloc 的特点 + +![padloc active sessions][7] + +Padloc 提供一系列免费和高级功能。根据你的要求,你可以选择使用付费订阅进行升级。 + +一些功能包括: + +* 无限保管库项目 +* 无限设备 +* 通过电子邮件进行两因素身份验证 +* 添加标签 +* 生成唯一密码 +* Favicon 支持识别保管库项目 +* 暗/亮模式主题 +* 主动会话管理 +* 导入/导出功能(加密容器/CSV) +* 团队支持(付费) +* 多重身份验证(付费) +* 记笔记(付费) +* 文件附件(付费) +* 安全报告(付费) + +从技术上讲,你可以获得所有基本功能。但是,要充分利用它,你需要订阅起价为**每月 3.49 美元或每年 34.9 美元**的高级订阅。 + +### 在 Linux 上安装 Padloc + +![padloc app screenshot 1][8] + +Padloc 为你提供了多种适用于 Linux 的选项。你可以下载 AppImage、.deb、Snap 或 Flatpak 包。 + +此外,你可以下载非 electron 桌面客户端版本,这很好! + +我测试了 AppImage 文件,它运行良好。你可以按照我们的指南[使用 AppImage][9]、[设置 Flatpak][10] 或[安装 deb 包][11]开始使用。 + +你可以查看其[官方网站][12]或 [GitHub 页面][13]了解更多信息。 + +[Padloc][14] + +### 一个略显昂贵的密码管理器带来良好的用户体验 + +它的用户界面和你使用它的整体体验给我留下了深刻的印象。 + +如果你优先考虑用户界面、极简主义和开源技术,无论你决定免费使用还是付费使用,Padloc 都是一个有用的选择。 + +当然,如果你想要物有所值(或更便宜)的东西,你可以随时选择 [Bitwarden][15] 之类的东西。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/padloc/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/seahorse/ +[2]: https://itsfoss.com/keepassxc/ +[3]: https://itsfoss.com/bitwarden/ +[4]: https://itsfoss.com/password-managers-linux/ +[5]: https://itsfoss.com/wp-content/uploads/2022/08/padloc-screenshot.png +[6]: https://itsfoss.com/wp-content/uploads/2022/08/padloc-light-mode.png +[7]: https://itsfoss.com/wp-content/uploads/2022/08/padloc-active-sessions.png +[8]: https://itsfoss.com/wp-content/uploads/2022/08/padloc-app-screenshot-1.png +[9]: https://itsfoss.com/use-appimage-linux/ +[10]: https://itsfoss.com/flatpak-guide/ +[11]: https://itsfoss.com/install-deb-files-ubuntu/ +[12]: https://padloc.app/ +[13]: https://github.com/padloc/padloc +[14]: https://padloc.app/ +[15]: https://itsfoss.com/bitwarden/ diff --git a/translated/tech/20220805 Delete the local reference to a remote branch in Git.md b/translated/tech/20220805 Delete the local reference to a remote branch in Git.md new file mode 100644 index 0000000000..eabe45aa6b --- /dev/null +++ b/translated/tech/20220805 Delete the local reference to a remote branch in Git.md @@ -0,0 +1,102 @@ +[#]: subject: "Delete the local reference to a remote branch in Git" +[#]: via: "https://opensource.com/article/22/8/delete-local-reference-remote-branch-git" +[#]: author: "Agil Antony https://opensource.com/users/agantony" +[#]: collector: "lkxed" +[#]: translator: "Yufei-Yan" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +删除 Git 上远程分支的本地引用 +====== + +遵循几个简单的步骤来保持 Git 仓库的整洁 + +![A diagram of a branching process][1] + +Image by: Opensource.com + +图片来源:Opensource.com + +在合并一个 GibLab 或 GitHub 的 pull request 后,通常需要从远程仓库中删掉这个主题分支来保持仓库的整洁。然而,这只会删掉远程仓库的主题分支。本地 Git 仓库也会从例行清理中收益。 + +要同步本地仓库和远程仓库的信息,可以执行 `git prune` 命令来删除本地仓库中远程分支的本地引用。 + +按照以下三个简单的步骤: + +### 1. 检出仓库中的核心分支(比如 main 或者 master) + +``` +$ git checkout +``` + +### 2. 列出所有远程和本地分支 + +``` +$ git branch -a +``` + +示例输出: + +``` +4.10.z +* master +  remotes/mydata/4.9-stage +  remotes/mydata/4.9.z +  remotes/mydata/test-branch +``` + +在这个例子中,`test-branch` 是从远程仓库中删除的主题分支的名字。 + +### 3. 删除远程分支的本地引用 + +首先,列出所有可以从本地仓库中删除的分支: + +``` +$ git remote prune origin --dry-run +``` + +示例输出: + +``` +Pruning origin +URL: git@example.com:myorg/mydata-4.10.git +* [would prune] origin/test-branch +``` + +然后,删除远程分支的本地引用: + +``` +$ git remote prune origin +``` + +示例输出: + +``` +Pruning origin +URL: git@example.com:myorg/mydata-4.10.git +* [pruned] origin/test-branch +``` + +就是这样! + +### 维护 Git 仓库 + +保持 Git 仓库的整洁,一开始似乎并不紧急,但是随着仓库规模的增长,删除不必要的数据就变得更为重要。不要因为需要从无用的数据中挣脱出来而降低你的节奏。 + +经常删除远程分支的本地引用,对于维护一个可用的 Git 仓库是一个非常好的习惯。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/delete-local-reference-remote-branch-git + +作者:[Agil Antony][a] +选题:[lkxed][b] +译者:[https://github.com/Yufei-Yan](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/agantony +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/freesoftwareway_law3.png