Merge pull request #31 from LCTT/master

update
This commit is contained in:
SamMa 2021-11-01 09:03:03 +08:00 committed by GitHub
commit 890c8aa064
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
110 changed files with 8724 additions and 2150 deletions

View File

@ -0,0 +1,82 @@
[#]: collector: (lujun9972)
[#]: translator: (unigeorge)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13891-1.html)
[#]: subject: (How to process real-time data with Apache)
[#]: via: (https://opensource.com/article/20/2/real-time-data-processing)
[#]: author: (Simon Crosby https://opensource.com/users/simon-crosby)
如何使用 Apache 软件处理实时数据
======
> 开源以丰富的项目画布引领着处理实时事件的方向。
![](https://img.linux.net.cn/data/attachment/album/202110/17/105502opl53qrmj950j3mv.jpg)
在“永不下线”的未来,入网设备规模可能会达到数十亿。存储原始数据,日后再进行分析的方案将不再能满足需求,因为用户需要实时且准确的响应。要对故障等对环境敏感的状况进行预测,实时处理数据也必不可少 —— 数据到达数据库后再处理肯定是来不及的。
有人可能会说,“云可扩展性”能够满足实时处理流数据的需求,但一些简单的例子就能表明它永远无法满足对无界数据流进行实时响应的需求。从移动设备到物联网,都需要一种新的范式来满足需求。尽管云计算依赖于对大数据“先存储后分析”的方案,但也迫切需要一种能够处理持续、杂乱和海量数据流的软件框架,并在数据流到达时立即对其进行处理,以保证实时的响应、预测和对数据的洞悉。
例如,在加利福尼亚州的帕洛阿尔托市,每天从基础交通设施产生的流数据比 Twitter Firehose 还要多。这是很大的数据量。为 Uber、Lyft 和 FedEx 等消费者预测城市交通需要实时的分析、学习和预测。云处理不可避免地导致每个事件大约会有半秒的延迟。
我们需要一个简单而强大的编程范式,让应用程序在类似下面的情况时能够动态处理无界数据流:
* 数据量巨大,或原始数据的移动成本很高。
* 数据由广泛分布的资产(例如移动设备)生成。
* 数据具有转瞬即逝的价值,即时分析迫在眉睫。
* 需要始终洞悉最新数据情况,外推法行不通。
### 发布和订阅
事件驱动系统领域中有一个关键架构模式:<ruby>发布/订阅<rt>publish/subscribe</rt></ruby> 消息传递模式。这是一种异步通信方法,其中消息会从 _发布者_(数据产生方)传递到 _订阅者_(处理数据的应用程序)。发布/订阅模式可以将消息发送者与消费者分离开来。
在发布/订阅模式中,消息源会 _发布_ 针对某个 <ruby>主题<rt>topic</rt></ruby><ruby>事件<rt>event</rt></ruby><ruby>服务端<rt>broker</rt></ruby>,后者按接收顺序存储它们。应用程序可以 _订阅_ 一个或多个 _主题_,然后 _服务端_ 会转发匹配的事件。 Apache Kafka 和 Pulsar 以及 CNCF NATS 是发布/订阅系统。 发布/订阅的云服务包括 Google Pub/Sub、AWS Kinesis、Azure Service Bus、Confluent Cloud 等。LCTT 译注:本段部分术语英文名称更为泛用,针对这些术语,采用了中英文标注。)
发布/订阅系统不会 _运行_ 订阅者应用程序,它们只是 _传递_ 数据给相应主题的订阅者。
流数据通常包含应用程序或基础架构状态更新的事件。在选择架构来处理数据时,发布/订阅框架等数据分发系统的作用是有限的。消费者应用程序的“处理方式”超出了发布/订阅系统的范围。这让开发人员的管理变得极具复杂性。所谓的流处理器是一种特殊的订阅者,可以动态分析数据并将结果返回给同一个服务端。
### Apache Spark
[Apache Spark][2] 是用于大规模数据处理的统一分析引擎。通常将 Apache Spark Streaming 用作流处理器例如给机器学习模型提供新数据。Spark Streaming 将数据分成小批量,每个小批量都由 Spark 模型或其他系统独立分析。事件流可以被分组成小批量以进行分析,但流处理器本身必须具有弹性:
* 流处理器必须能够根据数据速率进行扩展,甚至要能够跨越服务器和云,并且还可以跨实例实现负载均衡,以确保弹性和其他应用层的需求。
* 它必须能够分析来自不同来源的数据,这些数据源的报告速率可能相差很大。这意味着它必须是有状态的,或者将状态存储在数据库中。当使用 Spark Streaming 作为流处理器时,通常会使用后一种方法,这种方法在需要超低延迟响应时可能会存在性能问题。
相关项目 [Apache Samza][3] 也提供了一种处理实时事件流的方法,并使用 [Hadoop Yarn][4] 或 [Apache Mesos][5] 来管理计算资源,以便进行弹性扩展。
### 解决数据扩展问题
需要注意的是,即使是 Samza 也不能完全减轻开发人员的数据处理需求。扩展数据规模意味着处理事件的任务需要跨多个实例进行负载均衡,而使用数据库是实例间共享结果应用层状态的唯一方法。然而,当应用程序任务之间的状态协调转移到数据库时,对性能会产生不可避免的连锁反应。此外,数据库的选择也至关重要。随着系统的扩展,数据库的集群管理会成为下一个潜在的瓶颈。
这个问题可以通过有状态、有弹性的替代方案来解决并且这样的解决方案可以用来代替流处理器。在应用程序级别容器或实例内这些解决方案依据流的更新动态构建并发、互连的“web 代理”的有状态模型。代理是并发的“微服务”,它们消费单一来源的原始数据并维护它们的状态。基于数据中发现的源之间的真实关系(如包含和临近),代理实现互连以共享状态。代理也因此形成了一个并发服务图,可以分析它们自己的状态和链接到的代理的状态。数据源将原始数据转换为状态,并根据自身及其链接子图的变化进行分析、学习和预测,每个代理都为单个这样的数据源提供微服务。
这些解决方案允许大量的代理(真实数据源的数字类比)分布,甚至还有在应用层使代理互连的分布式图,从而简化了应用架构。这是因为代理之间互连的本质,是映射到解决方案的当前运行时执行实例和代理本身的 URL。通过这种方式应用程序可以跨实例无缝扩展而无需担心 DevOps 问题。代理消费数据并维护状态,还会计算自己和其他代理的状态。由于代理是有状态的,因此不需要数据库,并且数据洞察是以内存速度计算的。
### 使用开源阅读数据世界
我们查看数据的方式正在发生翻天覆地的变化:不再将数据库用作记录系统,取而代之的是现实世界,现实世界事物的数字类比可以不断地传输它们的状态。幸运的是,开源社区在处理实时事件的项目丰富度方面处于领先地位。从发布/订阅模式(其中最活跃的社区是 Apache Kafka、Pulsar 和 CNCF NATS到持续处理流数据的分析框架包括 Apache Spark、[Flink][6]、[Beam][7]、Samza以及 Apache 许可的 [SwimOS][8] 和 [Hazelcast][9],对开发人员来说,可选择项目非常之多。可以说,没有什么地方比开源社区的专有软件框架更多了。试看软件的未来,必是开源的天下。
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/2/real-time-data-processing
作者:[Simon Crosby][a]
选题:[lujun9972][b]
译者:[unigeorge](https://github.com/unigeorge)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/simon-crosby
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/clocks_time.png?itok=_ID09GDk (Alarm clocks with different time)
[2]: https://spark.apache.org/
[3]: https://samza.apache.org/
[4]: https://hadoop.apache.org/
[5]: http://mesos.apache.org/
[6]: https://flink.apache.org/
[7]: https://beam.apache.org
[8]: https://github.com/swimos/swim
[9]: https://hazelcast.com/

View File

@ -0,0 +1,141 @@
[#]: collector: (lujun9972)
[#]: translator: (unigeorge)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13908-1.html)
[#]: subject: (Define and optimize data partitions in Apache Cassandra)
[#]: via: (https://opensource.com/article/20/5/apache-cassandra)
[#]: author: (Anil Inamdar https://opensource.com/users/anil-inamdar)
在 Apache Cassandra 中定义和优化数据分区
======
> 速度和可扩展性是 Apache Cassandra 不变的追求;来学习一下如何充分发挥它的专长吧。
![](https://img.linux.net.cn/data/attachment/album/202110/22/103651gse3iyiajyaagk34.jpg)
Apache Cassandra 是一个数据库但又不是一个简单的数据库它是一个复制数据库专为可扩展性、高可用性、低延迟和良好性能而设计调整。Cassandra 可以帮你的数据在区域性中断、硬件故障时,以及很多管理员认为数据量过多的情况下幸免于难。
全面掌握数据分区知识,你就能让 Cassandra 集群实现良好的设计、极高的性能和可扩展性。在本文中我将探究如何定义分区Cassandra 如何使用这些分区,以及一些你应该了解的最佳实践方案和已知问题。
基本概念是这样的: 供数据库关键函数(如数据分发、复制和索引化)使用的原子单元,单个这样的数据块就是一个分区。分布式数据系统通常会把传入的数据分配到这些分区中,使用简单的数学函数(例如 identity 或 hashing 函数)执行分区过程,并用得到的 “分区键” 对数据分组,进一步再形成分区。例如,假设传入数据是服务器日志,使用 “identity” 分区函数和每个日志的时间戳(四舍五入到小时值)作为分区键,我们可以对这些数据进行分区,实现每个分区各保存一小时的日志的目的。
### Cassandra 中的数据分区
Cassandra 作为分布式系统运行,并且符合前述数据分区原则。使用 Cassandra数据分区依赖于在集群级别配置的算法和在表级别配置的分区键。
![Cassandra data partition][2]
Cassandra 查询语言CQL使用大家很熟悉的 SQL 表、行、列等术语。在上面的示例图中,表配置的主键中包含了分区键,具体格式为:<ruby>主键<rt>Primary Key</rt></ruby> = <ruby>分区键<rt>Partition Key</rt></ruby> + [<ruby>聚簇列<rt>Clustering Columns</rt></ruby>] 。
Cassandra 中的主键既定义了唯一的数据分区,也包含着分区内的数据排列依据信息。数据排列信息取决于聚簇列(非必需项)。每个唯一的分区键代表着服务器(包括其副本所在的服务器)中管理的若干行。
### 在 CQL 中定义主键
接下来的四个示例演示了如何使用 CQL 语法表示主键。定义主键会让数据行分到不同的集合里,通常这些集合就是分区。
#### 定义方式 1分区键log_hour聚簇列
```
CREATE TABLE server_logs(
   log_hour TIMESTAMP PRIMARYKEY,
   log_level text,
   message text,
   server text
   )
```
这里,有相同 `log_hour` 的所有行都会进入同一个分区。
#### 定义方式 2分区键log_hour聚簇列log_level
```
CREATE TABLE server_logs(
   log_hour TIMESTAMP,
   log_level text,
   message text,
   server text,
   PRIMARY KEY (log_hour, log_level)
   )
```
此定义方式与方式 1 使用了相同的分区键,但此方式中,每个分区的所有行都会按 `log_level` 升序排列。
#### 定义方式 3分区键log_hourserver聚簇列
```
CREATE TABLE server_logs(
   log_hour TIMESTAMP,
   log_level text,
   message text,
   server text,
   PRIMARY KEY ((log_hour, server))
   )
```
在此定义中,`server` 和 `log_hour` 字段都相同的行才会进入同一个分区。
#### 定义方式 4分区键log_hourserver聚簇列log_level
```
CREATE TABLE server_logs(
   log_hour TIMESTAMP,
   log_level text,
   message text,
   server text,
   PRIMARY KEY ((log_hour, server),log_level)
   )WITH CLUSTERING ORDER BY (column3 DESC);
```
此定义方式与方式 3 分区相同,但分区内的行会依照 `log_level` 降序排列。
### Cassandra 如何使用分区键
Cassandra 依靠分区键来确定在哪个节点上存储数据以及在需要时定位数据。Cassandra 通过查看表中的分区键来执行这些读取和写入操作,并使用<ruby>令牌<rt>tokens</rt></ruby>(一个 $-2^{63}$ 到 $+2^{63}-1$ 范围内的 long 类型值来进行数据分布和索引。这些令牌通过分区器映射到分区键分区器使用了将分区键转换为令牌的分区函数。通过这种令牌机制Cassandra 集群的每个节点都拥有一组数据分区。然后分区键在每个节点上启用数据索引。
![Cassandra cluster with 3 nodes and token-based ownership][3]
图中显示了一个三节点的 Cassandra 集群以及相应的令牌范围分配。这只是一个简单的示意图:具体实现过程使用了 [Vnodes][4]。
### 数据分区对 Cassandra 集群的影响
用心的分区键设计对于实现用例的理想分区大小至关重要。合理的分区可以实现均匀的数据分布和强大的 I/O 性能。分区大小对 Cassandra 集群有若干需要注意的影响:
* 读取性能 —— 为了在磁盘上的 SSTables 文件中找到分区Cassandra 使用缓存、索引和索引摘要等数据结构。过大的分区会降低这些数据结构的维护效率从而对性能产生负面影响。Cassandra 新版本在这方面取得了长足的进步:特别是 3.6 及其以上版本的 Cassandra 引擎引入了存储改进,针对大型分区,可以提供更好的性能,以及更强的应对内存问题和崩溃的弹性。
* 内存使用 —— 大分区会对 JVM 堆产生更大的压力,同时分区的增大也降低了垃圾收集机制的效率。
* Cassandra 修复 —— 大分区使 Cassandra 执行修复维护操作(通过跨副本比较数据来保持数据一致)时更加困难。
* “墓碑”删除 —— 听起来可能有点骇人Cassandra 使用称为“<ruby>墓碑<rt>tombstones</rt></ruby>”的独特标记来记录要删除的数据。如果没有合适的数据删除模式和压缩策略,大分区会使删除过程变得更加困难。
虽然这些影响可能会让人更倾向于简单地设计能产生小分区的分区键,但数据访问模式对理想的分区大小也有很大影响(有关更多信息,请阅读关于 [Cassandra 数据建模][5] 的深入讲解)。数据访问模式可以定义为表的查询方式,包括表的所有 `select` 查询。 理想情况下CQL 选择查询应该在 `where` 子句中只使用一个分区键。也就是说当查询可以从单个分区而不是许多较小的分区获取所需数据时Cassandra 是最有效率的。
### 分区键设计的最佳实践
遵循分区键设计的最佳实践原则这会帮你得到理想的分区大小。根据经验Cassandra 中的最大分区应保持在 100MB 以下。理想情况下,它应该小于 10MB。虽然 Cassandra 3.6 及其以上版本能更好地支持大分区,但也必须对每个工作负载进行仔细的测试和基准测试,以确保分区键设计能够支持所需的集群性能。
具体来说,这些最佳实践原则适用于任何分区键设计:
* 分区键的目标必须是将理想数量的数据放入每个分区,以支持其访问模式的需求。
* 分区键应禁止无界分区:那些大小可能随着时间无限增长的分区。例如,在上面的 `server_logs` 示例中,随着服务器日志数量的不断增加,使用服务器列作为分区键就会产生无界分区。相比之下,使用 `log_hour` 将每个分区限制为一个小时数据的方案会更好。
* 分区键还应避免产生分区倾斜,即分区增长不均匀,有些分区可能随着时间的推移而不受限制地增长。在 `server_logs` 示例中,在一台服务器生成的日志远多于其他服务器的情况下使用服务器列会产生分区倾斜。为了避免这种情况,可以从表中引入另一个属性来强制均匀分布,即使要创建一个虚拟列来这样做,也是值得的。
* 使用时间元素和其他属性的组合分区键,这对时间序列数据分区很有帮助。这种方式可以防止无界分区,使访问模式能够在查询特定数据时使用时间属性,而且能够对特定时间段内的数据进行删除。上面的每个示例都使用了 `log_hour` 时间属性来演示这一点。
还有一些工具可用于帮助测试、分析和监控 Cassandra 分区,以检查所选模式是否高效。通过仔细设计分区键,使解决方案的数据和需求保持一致,并遵循最佳实践原则来优化分区大小,你就可以充分利用数据分区,更好地发挥 Cassandra 的可扩展性和性能潜力。
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/5/apache-cassandra
作者:[Anil Inamdar][a]
选题:[lujun9972][b]
译者:[unigeorge](https://github.com/unigeorge)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/anil-inamdar
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data)
[2]: https://opensource.com/sites/default/files/uploads/apache_cassandra_1_0.png (Cassandra data partition)
[3]: https://opensource.com/sites/default/files/uploads/apache_cassandra_2_0.png (Cassandra cluster with 3 nodes and token-based ownership)
[4]: https://www.instaclustr.com/cassandra-vnodes-how-many-should-i-use/
[5]: https://www.instaclustr.com/resource/6-step-guide-to-apache-cassandra-data-modelling-white-paper/

View File

@ -0,0 +1,363 @@
[#]: collector: (lujun9972)
[#]: translator: (YungeG)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13881-1.html)
[#]: subject: (Managing resources with cgroups in systemd)
[#]: via: (https://opensource.com/article/20/10/cgroups)
[#]: author: (David Both https://opensource.com/users/dboth)
在 systemd 中使用控制组管理资源
======
> 控制组可以按照应用管理资源,而不是按照组成应用的单个进程。
![](https://img.linux.net.cn/data/attachment/album/202110/14/114622by5jdu87u4vng272.jpg)
作为一个系统管理员,没有事情比意外地耗尽计算资源让我更觉得沮丧。我曾不止一次填满了一个分区的所有可用磁盘空间、耗尽内存、以及没有足够的 CPU 时间在合理的时间内处理我的任务。资源管理是系统管理员最重要的工作之一。
资源管理的关键是保证所有的进程能够相对公平的访问需要的系统资源。资源管理还包括确保在需要时添加内存、硬盘驱动器空间、还有 CPU 处理能力;或者在无法添加时限制资源的使用。此外,应该阻止独占系统资源的用户,无论其是否有意。
系统管理员可以通过一些工具监控和管理不同的系统资源。例如,[top][2] 和类似的工具允许你监控内存、I/O、存储磁盘、SSD 等、网络、交换空间、CPU 的用量等。这些工具,尤其是那些以 CPU 为中心的工具,大部分基于以运行的进程为基本单位进行控制的模型。它们最多只是提供了一种方式来调整 `nice` 数字,从而修改优先级,或者杀死一个运行的进程。(要了解 `nice` 数字的信息,查看 [使用 Glances 监控 Linux 和 Windows 主机][3])。
SystemV 环境中基于传统的资源管理的其他工具,由 `/etc/security/limits.conf` 文件和 `/etc/security/limits.d` 中的本地配置文件控制。资源可以按照用户或组以一种相对粗糙但实用的方式限制。可以管理的资源包括内存的各个方面、每日的总 CPU 时间、数据总量、优先级、`nice` 数字、并发登录的数量、进程数、文件大小的最大值等。
### 使用控制组管理进程
[systemd 和 SystemV][4] 之间的一个主要差异是管理进程的方式。SystemV 将每个进程视作一个独立的实体。systemd 将相关的进程集中到一个控制组,简写做 [cgroup][5],并将控制组作为一个整体管理系统资源。这意味着资源能够基于应用管理,而不是由组成应用的各个进程来管理。
控制组的控制单元称作<ruby>切片单元<rt>slice unit</rt></ruby>。切片是允许 systemd 以树状格式控制程序次序,从而简化管理的概念化。
### 查看控制组
我将从一些允许你查看不同类型控制组信息的命令开始。 `systemctl status <service>` 命令显示一个特定服务的切片信息,包括服务的切片。这个例子展示了 `at` 守护进程:
```
[root@testvm1 ~]# systemctl status atd.service
● atd.service - Deferred execution scheduler
Loaded: loaded (/usr/lib/systemd/system/atd.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2020-09-23 12:18:24 EDT; 1 day 3h ago
Docs: man:atd(8)
Main PID: 1010 (atd)
Tasks: 1 (limit: 14760)
Memory: 440.0K
CPU: 5ms
CGroup: /system.slice/atd.service
└─1010 /usr/sbin/atd -f
Sep 23 12:18:24 testvm1.both.org systemd[1]: Started Deferred execution scheduler.
[root@testvm1 ~]#
```
这是一个我感到 systemd 比 SystemV 和旧的初始化程序更好用的原因的绝佳示例。这里的信息远比 SystemV 能够提供的丰富。`CGroup` 项包括的层级结构中,`system.slice` 是 systemdPID 1`atd.service` 在下一层,是 `system.slice` 的一部分。`CGroup` 项的第二行还显示了进程 IDPID和启动守护进程使用的命令。
`systemctl` 命令可以列出多个控制组项,`--all` 参数列出所有的切片,包括当前没有激活的切片:
```
[root@testvm1 ~]# systemctl -t slice --all
UNIT LOAD ACTIVE SUB DESCRIPTION
-.slice loaded active active Root Slice
system-getty.slice loaded active active system-getty.slice
system-lvm2\x2dpvscan.slice loaded active active system-lvm2\x2dpvscan.slice
system-modprobe.slice loaded active active system-modprobe.slice
system-sshd\x2dkeygen.slice loaded active active system-sshd\x2dkeygen.slice
system-systemd\x2dcoredump.slice loaded inactive dead system-systemd\x2dcoredump.slice
system-systemd\x2dfsck.slice loaded active active system-systemd\x2dfsck.slice
system.slice loaded active active System Slice
user-0.slice loaded active active User Slice of UID 0
user-1000.slice loaded active active User Slice of UID 1000
user.slice loaded active active User and Session Slice
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
11 loaded units listed.
To show all installed unit files use 'systemctl list-unit-files'.
[root@testvm1 ~]#
```
关于这个数据,第一个需要注意的是数据显示了 UID 0root和 UID 1000 的用户切片UID 1000 是我登录的用户。这里列出了组成每个切片的切片部分,而不是服务。还说明了每个用户登录时都会为其创建一个切片,这为将一个用户的所有任务作为单个控制组项进行管理提供了一种方式。
### 探索控制组的层次结构
目前为止一切顺利,但是控制组是分层的,所有的服务单元作为其中一个控制组的成员运行。要查看这个层次结构很简单,使用一个旧命令和 systemd 的一个新命令即可。
`ps` 命令可以用于映射进程的和其所处的控制组层次。注意使用 `ps` 命令时需要指明想要的数据列。我大幅削减了下面命令的输出数量,但是试图保留足够的数据,以便你能够对自己系统上的输出有所感受:
```
[root@testvm1 ~]# ps xawf -eo pid,user,cgroup,args
PID USER CGROUP COMMAND
2 root - [kthreadd]
3 root - \_ [rcu_gp]
4 root - \_ [rcu_par_gp]
6 root - \_ [kworker/0:0H-kblockd]
9 root - \_ [mm_percpu_wq]
10 root - \_ [ksoftirqd/0]
11 root - \_ [rcu_sched]
12 root - \_ [migration/0]
13 root - \_ [cpuhp/0]
14 root - \_ [cpuhp/1]
<删节>
625406 root - \_ [kworker/3:0-ata_sff]
625409 root - \_ [kworker/u8:0-events_unbound]
1 root 0::/init.scope /usr/lib/systemd/systemd --switched-root --system --deserialize 30
588 root 0::/system.slice/systemd-jo /usr/lib/systemd/systemd-journald
599 root 0::/system.slice/systemd-ud /usr/lib/systemd/systemd-udevd
741 root 0::/system.slice/auditd.ser /sbin/auditd
743 root 0::/system.slice/auditd.ser \_ /usr/sbin/sedispatch
764 root 0::/system.slice/ModemManag /usr/sbin/ModemManager
765 root 0::/system.slice/NetworkMan /usr/sbin/NetworkManager --no-daemon
767 root 0::/system.slice/irqbalance /usr/sbin/irqbalance --foreground
779 root 0::/system.slice/mcelog.ser /usr/sbin/mcelog --ignorenodev --daemon --foreground
781 root 0::/system.slice/rngd.servi /sbin/rngd -f
782 root 0::/system.slice/rsyslog.se /usr/sbin/rsyslogd -n
<删节>
893 root 0::/system.slice/sshd.servi sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
1130 root 0::/user.slice/user-0.slice \_ sshd: root [priv]
1147 root 0::/user.slice/user-0.slice | \_ sshd: root@pts/0
1148 root 0::/user.slice/user-0.slice | \_ -bash
1321 root 0::/user.slice/user-0.slice | \_ screen
1322 root 0::/user.slice/user-0.slice | \_ SCREEN
1323 root 0::/user.slice/user-0.slice | \_ /bin/bash
498801 root 0::/user.slice/user-0.slice | | \_ man systemd.resource-control
498813 root 0::/user.slice/user-0.slice | | \_ less
1351 root 0::/user.slice/user-0.slice | \_ /bin/bash
123293 root 0::/user.slice/user-0.slice | | \_ man systemd.slice
123305 root 0::/user.slice/user-0.slice | | \_ less
1380 root 0::/user.slice/user-0.slice | \_ /bin/bash
625412 root 0::/user.slice/user-0.slice | | \_ ps xawf -eo pid,user,cgroup,args
625413 root 0::/user.slice/user-0.slice | | \_ less
246795 root 0::/user.slice/user-0.slice | \_ /bin/bash
625338 root 0::/user.slice/user-0.slice | \_ /usr/bin/mc -P /var/tmp/mc-root/mc.pwd.246795
625340 root 0::/user.slice/user-0.slice | \_ bash -rcfile .bashrc
1218 root 0::/user.slice/user-1000.sl \_ sshd: dboth [priv]
1233 dboth 0::/user.slice/user-1000.sl \_ sshd: dboth@pts/1
1235 dboth 0::/user.slice/user-1000.sl \_ -bash
<删节>
1010 root 0::/system.slice/atd.servic /usr/sbin/atd -f
1011 root 0::/system.slice/crond.serv /usr/sbin/crond -n
1098 root 0::/system.slice/lxdm.servi /usr/sbin/lxdm-binary
1106 root 0::/system.slice/lxdm.servi \_ /usr/libexec/Xorg -background none :0 vt01 -nolisten tcp -novtswitch -auth /var/run/lxdm/lxdm-:0.auth
370621 root 0::/user.slice/user-1000.sl \_ /usr/libexec/lxdm-session
370631 dboth 0::/user.slice/user-1000.sl \_ xfce4-session
370841 dboth 0::/user.slice/user-1000.sl \_ /usr/bin/ssh-agent /bin/sh -c exec -l bash -c "/usr/bin/startxfce4"
370911 dboth 0::/user.slice/user-1000.sl \_ xfwm4 --display :0.0 --sm-client-id 2dead44ab-0b4d-4101-bca4-e6771f4a8ac2
370930 dboth 0::/user.slice/user-1000.sl \_ xfce4-panel --display :0.0 --sm-client-id 2ce38b8ef-86fd-4189-ace5-deec1d0e0952
370942 dboth 0::/user.slice/user-1000.sl | \_ /usr/lib64/xfce4/panel/wrapper-2.0 /usr/lib64/xfce4/panel/plugins/libsystray.so 6 23068680 systr
ay Notification Area Area where notification icons appear
370943 dboth 0::/user.slice/user-1000.sl | \_ /usr/lib64/xfce4/panel/wrapper-2.0 /usr/lib64/xfce4/panel/plugins/libpulseaudio-plugin.so 8 2306
8681 pulseaudio PulseAudio Plugin Adjust the audio volume of the PulseAudio sound system
370944 dboth 0::/user.slice/user-1000.sl | \_ /usr/lib64/xfce4/panel/wrapper-2.0 /usr/lib64/xfce4/panel/plugins/libxfce4powermanager.so 9 2306
8682 power-manager-plugin Power Manager Plugin Display the battery levels of your devices and control the brightness of your display
370945 dboth 0::/user.slice/user-1000.sl | \_ /usr/lib64/xfce4/panel/wrapper-2.0 /usr/lib64/xfce4/panel/plugins/libnotification-plugin.so 10 2
3068683 notification-plugin Notification Plugin Notification plugin for the Xfce panel
370948 dboth 0::/user.slice/user-1000.sl | \_ /usr/lib64/xfce4/panel/wrapper-2.0 /usr/lib64/xfce4/panel/plugins/libactions.so 14 23068684 acti
ons Action Buttons Log out, lock or other system actions
370934 dboth 0::/user.slice/user-1000.sl \_ Thunar --sm-client-id 2cfc809d8-4e1d-497a-a5c5-6e4fa509c3fb --daemon
370939 dboth 0::/user.slice/user-1000.sl \_ xfdesktop --display :0.0 --sm-client-id 299be0608-4dca-4055-b4d6-55ec6e73a324
370962 dboth 0::/user.slice/user-1000.sl \_ nm-applet
<删节>
```
你可以使用 `systemd-cgls` 命令查看整个层次结构,这个命令不需要任何的复杂参数,更加简单。
我也大幅缩短了这个树状结构,但是保留了足够多的输出,以便你能够了解在自己的系统上执行这个命令时应该看到的数据总量和条目类型。我在我的一个虚拟机上执行了这个命令,输出大概有 200 行;我的主要工作站的输出大概有 250 行。
```
[root@testvm1 ~]# systemd-cgls
Control group /:
-.slice
├─user.slice
│ ├─user-0.slice
│ │ ├─session-1.scope
│ │ │ ├─ 1130 sshd: root [priv]
│ │ │ ├─ 1147 sshd: root@pts/0
│ │ │ ├─ 1148 -bash
│ │ │ ├─ 1321 screen
│ │ │ ├─ 1322 SCREEN
│ │ │ ├─ 1323 /bin/bash
│ │ │ ├─ 1351 /bin/bash
│ │ │ ├─ 1380 /bin/bash
│ │ │ ├─123293 man systemd.slice
│ │ │ ├─123305 less
│ │ │ ├─246795 /bin/bash
│ │ │ ├─371371 man systemd-cgls
│ │ │ ├─371383 less
│ │ │ ├─371469 systemd-cgls
│ │ │ └─371470 less
│ │ └─user@0.service …
│ │ ├─dbus-broker.service
│ │ │ ├─1170 /usr/bin/dbus-broker-launch --scope user
│ │ │ └─1171 dbus-broker --log 4 --controller 12 --machine-id 3bccd1140fca488187f8a1439c832f07 --max-bytes 100000000000000 --max-fds 25000000000000 --max->
│ │ ├─gvfs-daemon.service
│ │ │ └─1173 /usr/libexec/gvfsd
│ │ └─init.scope
│ │ ├─1137 /usr/lib/systemd/systemd --user
│ │ └─1138 (sd-pam)
│ └─user-1000.slice
│ ├─user@1000.service …
│ │ ├─dbus\x2d:1.2\x2dorg.xfce.Xfconf.slice
│ │ │ └─dbus-:1.2-org.xfce.Xfconf@0.service
│ │ │ └─370748 /usr/lib64/xfce4/xfconf/xfconfd
│ │ ├─dbus\x2d:1.2\x2dca.desrt.dconf.slice
│ │ │ └─dbus-:1.2-ca.desrt.dconf@0.service
│ │ │ └─371262 /usr/libexec/dconf-service
│ │ ├─dbus-broker.service
│ │ │ ├─1260 /usr/bin/dbus-broker-launch --scope user
│ │ │ └─1261 dbus-broker --log 4 --controller 11 --machine-id
<删节>
│ │ └─gvfs-mtp-volume-monitor.service
│ │ └─370987 /usr/libexec/gvfs-mtp-volume-monitor
│ ├─session-3.scope
│ │ ├─1218 sshd: dboth [priv]
│ │ ├─1233 sshd: dboth@pts/1
│ │ └─1235 -bash
│ └─session-7.scope
│ ├─370621 /usr/libexec/lxdm-session
│ ├─370631 xfce4-session
│ ├─370805 /usr/bin/VBoxClient --clipboard
│ ├─370806 /usr/bin/VBoxClient --clipboard
│ ├─370817 /usr/bin/VBoxClient --seamless
│ ├─370818 /usr/bin/VBoxClient --seamless
│ ├─370824 /usr/bin/VBoxClient --draganddrop
│ ├─370825 /usr/bin/VBoxClient --draganddrop
│ ├─370841 /usr/bin/ssh-agent /bin/sh -c exec -l bash -c "/usr/bin/startxfce4"
│ ├─370910 /bin/gpg-agent --sh --daemon --write-env-file /home/dboth/.cache/gpg-agent-info
│ ├─370911 xfwm4 --display :0.0 --sm-client-id 2dead44ab-0b4d-4101-bca4-e6771f4a8ac2
│ ├─370923 xfsettingsd --display :0.0 --sm-client-id 261b4a437-3029-461c-9551-68c2c42f4fef
│ ├─370930 xfce4-panel --display :0.0 --sm-client-id 2ce38b8ef-86fd-4189-ace5-deec1d0e0952
│ ├─370934 Thunar --sm-client-id 2cfc809d8-4e1d-497a-a5c5-6e4fa509c3fb --daemon
│ ├─370939 xfdesktop --display :0.0 --sm-client-id 299be0608-4dca-4055-b4d6-55ec6e73a324
<删节>
└─system.slice
├─rngd.service
│ └─1650 /sbin/rngd -f
├─irqbalance.service
│ └─1631 /usr/sbin/irqbalance --foreground
├─fprintd.service
│ └─303383 /usr/libexec/fprintd
├─systemd-udevd.service
│ └─956 /usr/lib/systemd/systemd-udevd
<删节>
├─systemd-journald.service
│ └─588 /usr/lib/systemd/systemd-journald
├─atd.service
│ └─1010 /usr/sbin/atd -f
├─system-dbus\x2d:1.10\x2dorg.freedesktop.problems.slice
│ └─dbus-:1.10-org.freedesktop.problems@0.service
│ └─371197 /usr/sbin/abrt-dbus -t133
├─sshd.service
│ └─893 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
├─vboxservice.service
│ └─802 /usr/sbin/VBoxService -f
├─crond.service
│ └─1011 /usr/sbin/crond -n
├─NetworkManager.service
│ └─765 /usr/sbin/NetworkManager --no-daemon
├─switcheroo-control.service
│ └─787 /usr/libexec/switcheroo-control
<删节>
```
这个树状视图显示了所有的用户和系统切片,以及每个控制组内正在运行的服务和程序。注意叫作 `scope`(范围)的单元,它将相关的程序组成一个管理单元,在上面列出的结果中就是 `user-1000.slice`。`user-1000.slice/session-7.scope` 控制组包含了 GUI 桌面程序层次结构,以 LXDM 显示管理器会话和其所有的子任务开始,包括像 Bash 命令行解释器和 Thunar GUI 文件管理器之类的程序。
配置文件中不定义范围单元,而是作为启动相关程序组的结果程序化生成的。范围单元不创建或启动作为控制组的组成部分运行的进程。范围内的所有进程都是平等的,没有内部的层次结构。一个范围的生命周期在第一个进程创建时开始,在最后一个进程销毁时结束。
在你的桌面打开多个窗口比如终端模拟器、LibreOffice、或者任何你想打开的然后切换到一个可用的虚拟控制台启动类似 `top` 或 [Midnight Commander][11] 的程序。在主机运行 `systemd-cgls` 命令,留意整体的层次结构和范围单元。
`systemd-cgls` 命令提供的控制组层次结构表示(以及组成控制组单元的细节),比我见过的其他任何指令都要完整。和 `ps` 命令提供的输出相比,我喜欢 `systemd-cgls` 命令更简洁的树形表示。
### 来自朋友们的一点帮助
介绍完这些基础知识后,我曾计划过深入研究控制组的更多细节,以及如何使用,但是我在 Opensource.com 的姐妹网站 [Enable Sysadmin][13] 上发现了一系列四篇优秀文章,由 Red Hat 公司的 [Steve Ovens][12] 所作。与其从头重写 Steve 的文章,我觉得倒不如通过链接到这些文章,利用他的控制组专业知识:
1. [一个 Linux 系统管理员对控制组的介绍][14]
2. [如何用 CPUShares 管理控制组][15]
3. [用更难的方式,手动管理控制组][16]
4. [用 systemd 管理控制组][17]
像我一样享受这些文章并从中汲取知识吧。
### 其他资源
互联网上充斥着大量关于 systemd 的信息,但大部分都简短生硬、愚钝、甚至令人误解。除了本文提到的资源,下面的网页提供了关于 systemd 启动更详细可靠的信息。自从我开始这一系列的文章来反映我所做的研究以来,这个的列表已经变长了。
* Fedora 项目有一个优质实用的 [systemd 指南][18],几乎有你使用 systemd 配置、管理、维护一个 Fedora 计算机需要知道的一切。
* Fedora 项目还有一个好用的 [速查表][19],交叉引用了古老的 SystemV 命令和对应的 systemd 命令。
* [systemd.unit(5) 手册页][20] 包含了一个不错的单元文件中各个节的列表,以及这些节的配置选项和简洁的描述。
* Red Hat 文档包含了一个 [单元文件结构][21] 的有用描述,还有一些其他的重要信息。
* 要获取 systemd 的详细技术信息和创立的原因,查看 Freedesktop.org 的 [systemd 描
述][22]。这个使我发现过的最棒页面之一,因为其中包含了许多指向其他重要准确文档的链接。
* Linux.com 上 “systemd 的更多乐趣” 提供了更高级的 systemd [信息和提示][23]。
* 查看 [systemd.resource-control(5)][24] 的手册页
* 查看 [_Linux 内核用户和管理员指南_][25] 中的 [控制组 v2 条目][26]。
还有一系列针对系统管理员的深度技术文章,由 systemd 的设计者和主要开发者 Lennart
Poettering 所作。这些文章写于 2010 年 4 月到 2011 年 9 月之间,但在当下仍然像当时一样有
价值。关于 systemd 及其生态的许多其他优秀的作品都是基于这些文章的。
* [Rethinking PID 1][27]
* [systemd for Administrators, Part I][28]
* [systemd for Administrators, Part II][29]
* [systemd for Administrators, Part III][30]
* [systemd for Administrators, Part IV][31]
* [systemd for Administrators, Part V][32]
* [systemd for Administrators, Part VI][33]
* [systemd for Administrators, Part VII][34]
* [systemd for Administrators, Part VIII][35]
* [systemd for Administrators, Part IX][36]
* [systemd for Administrators, Part X][37]
* [systemd for Administrators, Part XI][38]
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/10/cgroups
作者:[David Both][a]
选题:[lujun9972][b]
译者:[YungeG](https://github.com/YungeG)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/dboth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-concentration-focus-windows-office.png?itok=-8E2ihcF (Woman using laptop concentrating)
[2]: https://en.wikipedia.org/wiki/Top_(software)
[3]: https://opensource.com/article/19/11/monitoring-linux-glances
[4]: https://opensource.com/article/20/4/systemd
[5]: https://en.wikipedia.org/wiki/Cgroups
[6]: mailto:user@0.service
[7]: mailto:user@1000.service
[8]: mailto:1.2-org.xfce.Xfconf@0.service
[9]: mailto:1.2-ca.desrt.dconf@0.service
[10]: mailto:1.10-org.freedesktop.problems@0.service
[11]: https://midnight-commander.org/
[12]: https://www.redhat.com/sysadmin/users/steve-ovens
[13]: https://www.redhat.com/sysadmin/
[14]: https://www.redhat.com/sysadmin/cgroups-part-one
[15]: https://www.redhat.com/sysadmin/cgroups-part-two
[16]: https://www.redhat.com/sysadmin/cgroups-part-three
[17]: https://www.redhat.com/sysadmin/cgroups-part-four
[18]: https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/index.html
[19]: https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet
[20]: https://man7.org/linux/man-pages/man5/systemd.unit.5.html
[21]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/managing-services-with-systemd_configuring-basic-system-settings#Managing_Services_with_systemd-Unit_File_Structure
[22]: https://www.freedesktop.org/wiki/Software/systemd/
[23]: https://www.linux.com/training-tutorials/more-systemd-fun-blame-game-and-stopping-services-prejudice/
[24]: https://man7.org/linux/man-pages/man5/systemd.resource-control.5.html
[25]: https://www.kernel.org/doc/html/latest/admin-guide/index.html
[26]: https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html
[27]: http://0pointer.de/blog/projects/systemd.html
[28]: http://0pointer.de/blog/projects/systemd-for-admins-1.html
[29]: http://0pointer.de/blog/projects/systemd-for-admins-2.html
[30]: http://0pointer.de/blog/projects/systemd-for-admins-3.html
[31]: http://0pointer.de/blog/projects/systemd-for-admins-4.html
[32]: http://0pointer.de/blog/projects/three-levels-of-off.html
[33]: http://0pointer.de/blog/projects/changing-roots
[34]: http://0pointer.de/blog/projects/blame-game.html
[35]: http://0pointer.de/blog/projects/the-new-configuration-files.html
[36]: http://0pointer.de/blog/projects/on-etc-sysinit.html
[37]: http://0pointer.de/blog/projects/instances.html
[38]: http://0pointer.de/blog/projects/inetd.html

View File

@ -0,0 +1,200 @@
[#]: subject: "Play with model trains in OpenTTD"
[#]: via: "https://opensource.com/article/21/9/model-trains-openttd"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lujun9972"
[#]: translator: "unigeorge"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13924-1.html"
在 OpenTTD 中玩模型火车
======
> 想玩实体模型火车,却没有足够大的空间?试试 OpenTTD 中的虚拟火车吧。
![](https://img.linux.net.cn/data/attachment/album/202110/27/100255emc3x33icci0cacc.jpg)
我父亲一直很喜欢火车模型,我记得我小时候,曾看着他在圣诞树周围建了一整条轨道。当 [乐高][2] 火车套装发布时,因其便利性和固有可扩展性,我们转而投向了乐高火车的怀抱。多年来,我们热衷于建造和改装乐高火车及单轨轨道。我经常想象,未来我会有一个车库或地下室,专门用于微型景观和电动汽笛火车。强调一下,我沉迷于另一个爱好的可能性非常低,所以当发现 _虚拟_ 模型铁路可以为我提供相同的满足感时,我很开心。我的虚拟爱好引擎是 [OpenTTD][3],这是一款基于名为 **Transport Tycoon Deluxe** 的 90 年代老游戏的开源模拟游戏。
### 安装 OpenTTD
你可以在 [openttd.org/downloads][4] 下载适用于 Linux、macOS 和 Windows 的 OpenTTD。
如果你正使用 Debian Linux 或其衍生产品,甚至是[在使用 Chromebook][5],你可以下载 `.deb` 包。使用 `apt` 命令安装它:
```
$ sudo apt install ./openttd*deb
```
如果你在使用其他 Linux 发行版,请下载通用安装程序,并使用 [tar 命令][6]解压缩包:
```
$ tar xvf openttd-x.yy.z-linux*.tar.xz
```
OpenTTD 已经在 Linux、macOS 和 Windows 的 [Steam][7] 中上架Steam 是一个非开源的,但是很常见的跨平台游戏客户端)。
### 启动 OpenTTD
如果你安装了 OpenTTD可以从应用程序菜单启动它。
如果你是下载了通用包,可以切换到游戏目录,使用本地的 `openttd` 命令启动游戏:
```
$ cd openttd*
$ ./openttd &amp;
```
首次启动 OpenTTD 时,游戏会提示必须下载图像集,在 Steam 版中会自动安装,但在独立应用程序中需要单击一下鼠标。无论如何,因为 OpenTTD 是开源的,经过了很好的改进,所以在默认图像之外,你最终还会下载的还有很多其他图像。
下载图像集后,你会看到一个古色古香的小型界面。我觉得 640x480 的界面有点小,虽然旧图像界面确实更有年代感(那时计算能力还比较弱),但一些适配现代屏幕的轻度升级还是很好用的。因此,你的第一步操作就是点击“<ruby>检查在线内容<rt>Check online content</rt></ruby>”按钮。
### 加载模组
<ruby>内容下载<rt>Content downloading</rt></ruby>”界面是一个查看已通过审查的 OpenTTD <ruby>模组<rt>mod</rt></ruby>的窗口,可以提供个性化的改进图像界面、全新音乐、火车模型和地图名称。我使用了新西兰全套配置,所以对我来说,生成的所有城市都很熟悉,尽管 2020 年我转而开始使用“辐射 3”套装了。模组 _非常多_,可以使用右上角的搜索栏来缩小选择范围。
下面是一些个人认为必备的模组:
* **abase** - 高分辨率图像。将近 300 MB这可能是你玩此游戏需要的最大一次下载游戏本身只有 50 MB
* **OpenSFX** - 一个声音合集。让你能听到城市中的交通声、船运的喇叭声以及很棒的火车汽笛声。
* **Town names** - 城镇名称。默认的城市名称很有趣,但我认为记一些本地化的名称更容易。
* **Trains** - 火车模组。OpenTTD 有一组运行良好的默认火车模型,但如果你已经是一名火车观察员,那你可能会喜欢下载一些额外的火车模型。我使用的是 NZR 火车合集,但还有很多火车也是可用的,包括来自英国、美国、奥地利、比利时、捷克共和国的车,以及按字母表顺序排列的许多其他火车。
* **Beginner tutorial** - 新手教程。是一个帮你学习游戏及界面的引导场景。
### 游戏引擎默认值
下载新素材后,你需要将它们设置为默认值。有两个设置的地方:游戏引擎默认值、游戏内脚本与素材。
![OpenTTD main menu][8]
*OpenTTD 菜单Seth Kenlon, [CC BY-SA 4.0][9]*
单击“<ruby>游戏选项<rt>Game Options</rt></ruby>”按钮。 在游戏选项屏幕中,调整以下设置:
* 将<ruby>屏幕分辨率<rt>screen resolution</rt></ruby>设置为你喜欢的界面尺寸。
* 将<ruby>基础图像集 <rt>base graphics set</rt></ruby>设置为 **abase**。
* 将<ruby>基础声音设置<rt>base sounds set</rt></ruby>设置为 **OpenSFX**。
关闭游戏选项屏幕。你的改动会自动保存。
### 游戏选项
在主菜单界面,单击“<ruby>NewGRF 设置<rt>NewGRF Settings</rt></ruby>”按钮。
![NewGRF settings window][10]
*NewGRF 设置菜单Seth Kenlon, [CC BY-SA 4.0][9]*
未活动的模组显示在 NewGRF 设置窗口的下半部分。要激活一个未活动的模组,请选择它并单击左下角的“<ruby>添加<rt>Add</rt></ruby>”按钮。选择要激活的模组后,再单击“<ruby>应用<rt>Apply</rt></ruby>”按钮。
### 教程
如果你下载了“<ruby>初学者教程<rt>Beginner tutorial</rt></ruby>”场景,可以通过它来学习 OpenTTD。开始教程请单击主菜单屏幕顶部附近的“<ruby>播放场景<rt>Play scenario</rt></ruby>” 按钮,然后选择该教程并开始。
初学者教程有着游戏界面的完整浏览流程,全部完成需要花费一些时间。
### 快速开始
现在我们快速介绍一下,此处你要了解以下内容:车辆出自仓库,一切活动都需要时间表。记住这两条规则,你可以立即开始建造火车(以及道路、海港和机场)。
#### 建造车站
要在两个城市之间建立一条简单的铁路线,请单击顶部图标栏中的铁路轨道图标。
![New icon bar - railway option][11]
*新建图标栏——铁路选项Seth Kenlon, [CC BY-SA 4.0][9]*
铁路以车站开始和结束,所以我通常在预定线路的两端各放置一个车站。单击火车站图标(将鼠标悬停在其上方可查看其标签)。一个火车站要服务于一个地区,其作用范围必须与该地区尽量多地重叠。要查看车站的覆盖范围,请通过单击车站对话框底部的“<ruby>开启<rt>On</rt></ruby>”按钮以启用<ruby>覆盖区域高亮<rt>Coverage area highlight</rt></ruby>功能。
![Station coverage window][12]
*车站覆盖信息窗口Seth Kenlon, [CC BY-SA 4.0][9]*
黑色网格表示覆盖范围,而白色网格显示车站的物理占据范围。当你将鼠标悬停在一个区域上时,车站的覆盖范围所需耗材会在弹出窗口中列出。从简单的开始,创建一个单轨 4 辆车的站台。在地图上的两个城市之间重复执行此操作两次。
![create station menu][13]
*创建车站菜单Seth Kenlon, [CC BY-SA 4.0][9]*
### 铺设铁轨
接下来,用铁轨连接车站。 OpenTTD 的等距视图需要一些时间来适应但是在单击铁路图标并在地图上单击拖动之后你就开始大概有所了解了。X-rail 图标提供了“自动轨道”模式,该模式会根据用户单击的方块位置对齐轨道。
铺设导轨时要细心。OpenTTD 是不可撤回的,所以一旦点击一个正方形,轨道就会被构造出来。你必须使用炸药图标来移除导轨。和现实生活中一样,没有撤消按钮。
### 火车车库
火车来自<ruby>车库<rt>depot</rt></ruby>。因此,要在铁路上添加火车,必须在沿线的某处添加一个车库。单击车库图标并在现有铁路附近放置。将车库连接到现有轨道,以确保你的火车可以从车库到达适当线路的(在此简单示例中,线路是唯一的)。
![create depot menu][14]
*建造车库菜单Seth Kenlon, [CC BY-SA 4.0][9]*
### 模型火车
终于,你可以将虚拟模型火车添加到虚拟铁路中了。要创建火车,请单击车库。
单击站点窗口底部的“<ruby>新建车辆<rt>New Vehicle</rt></ruby>”按钮,会列出可用的火车引擎和汽车。列表会部分取决于你从可下载内容中添加的模型。一般来说,发动机分为三种:蒸汽发动机、柴油发动机和电动发动机。游戏内时间从 1950 年开始,所以早期你只有蒸汽可选。随着时间推进,你会获得可用于升级的创新型新模型。
![create train menu][15]
*创建火车菜单Seth Kenlon, [CC BY-SA 4.0][9]*
现在创建一个简单的火车,其中包括一节引擎、一节客车和一节邮车。如果想添加其他类型的车厢,请单击站点以确认它们的可提供车型(由其覆盖区域决定)
### 创建火车时刻表
现在有了铁路和火车,还需要创建一个火车时刻表。时间表与车辆关联,因此无论何时添加新车,都要记得添加时间表,以让新车投入使用。
要为火车添加时刻表,请单击其车库列表中列车左侧的编号。这样可以打开火车视口,窗口右侧会有按钮。单击箭头图标即可查看该列车的时刻表。
![create schedule menu][16]
*创建时刻表菜单Seth Kenlon, [CC BY-SA 4.0][9]*
要创建时间表,请单击时间表窗口底部的“<ruby>前往<rt>Go To</rt></ruby>”按钮,然后单击要设置成第一个目的地的车站。然后点击下一站。你可以在时间表中选择一个停靠点,浏览“<ruby>满载<rt>Full load</rt></ruby>”和“<ruby>卸载<rt>Unload</rt></ruby>”下拉菜单中的选项,以此调整装卸要求,并且可以在“<ruby>无停靠<rt>Non-stop</rt></ruby>”下拉菜单中调整路线(如果开发了新路线)。选项有很多,随着城市发展和地图完善,你可能需要随时调整策略。
但是现在,单击火车视口底部的红色“<ruby>已停止<rt>Stopped</rt></ruby>”按钮,让火车投入使用吧!
![train moving from station to station][17]
*在役中的火车Seth Kenlon, [CC BY-SA 4.0][9]*
### 试试 OpenTTD 吧
OpenTTD 是一个模拟器,同时也是一个游戏,所以确实会有一些限制,比如你可能想要优化的预算和参数。例如,你可以单击一个城市、农场或工厂,了解其可接受的进出口类型。你可以通过单击 OpenTTD 窗口右下角的预算按钮来借钱。它不仅仅是一个虚拟的火车集合游戏。你还可以建造道路、机场、海港等。记得所有车辆都需要车库和时间表,你就在实现虚拟企业的路上成功了一半。
OpenTTD 有着活跃而热情的社区,以及[详细的维基][18],并且有大量的资源和教程在线可用。下载游戏并试试吧!
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/9/model-trains-openttd
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[unigeorge](https://github.com/unigeorge)
校对:[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/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/train-plane-speed-big-machine.png?itok=f377dXKs (Old train)
[2]: https://opensource.com/article/20/6/open-source-virtual-lego
[3]: http://openttd.org
[4]: https://www.openttd.org/downloads/openttd-releases/latest.html
[5]: https://opensource.com/article/21/2/chromebook-linux
[6]: https://opensource.com/article/17/7/how-unzip-targz-file
[7]: https://store.steampowered.com/app/1536610/OpenTTD/
[8]: https://opensource.com/sites/default/files/openttd-menu.jpg (OpenTTD menu)
[9]: https://creativecommons.org/licenses/by-sa/4.0/
[10]: https://opensource.com/sites/default/files/openttd-newgrf.jpg (The NewGRF settings menu)
[11]: https://opensource.com/sites/default/files/openttd-iconbar-railway.jpg (The new icon bar - railway option)
[12]: https://opensource.com/sites/default/files/openttd-window-station.jpg (Station coverage information window)
[13]: https://opensource.com/sites/default/files/openttd-create-station.jpg (The create station menu)
[14]: https://opensource.com/sites/default/files/openttd-create-depot.jpg (Create depot menu)
[15]: https://opensource.com/sites/default/files/openttd-create-train.jpg (The create train menu)
[16]: https://opensource.com/sites/default/files/openttd-create-schedule.png (The create schedule menu)
[17]: https://opensource.com/sites/default/files/openttd-train.jpg (Train in service)
[18]: https://wiki.openttd.org/en/

View File

@ -3,44 +3,45 @@
[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma"
[#]: collector: "lujun9972"
[#]: translator: "perfiffer"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13875-1.html"
使用 Jekyll 构建你的网站
======
Jekyll 是一个开源的静态的网站生成器。你可以使用 Markdown 编写内容,使用 HTML/CSS 来构建和展示Jekyll 会将其编译为静态的 HTML。
![Person using a laptop][1]
静态网站生成器和 JAMStack 近年来开始流行。而且理由很充分。不需要复杂的后端,只需要静态的 HTML、CSS 和 Javascript。没有后端意味着更好的安全性、更低的运营开销和更便宜的托管。双赢
> Jekyll 是一个开源的静态网站生成器。你可以使用 Markdown 编写内容,使用 HTML/CSS 来构建和展示Jekyll 会将其编译为静态的 HTML。
在本文中,我将讨论 Jekyll。在撰写本文时[我的个人网站使用 Jekyll][2]。Jekyll 使用 Ruby 引擎将用 Markdown 编写的文章转换成 HTML。[Sass][3] 可以将复杂的 CSS 规则应用到平面文件中。[Liquid][4] 允许对静态内容进行编程控制。
![](https://img.linux.net.cn/data/attachment/album/202110/12/145349rblj459naj74j5nr.jpg)
近年来开始流行静态网站生成器和 JAMStack而且理由很充分它们不需要复杂的后端只需要静态的 HTML、CSS 和 Javascript。没有后端意味着更好的安全性、更低的运营开销和更便宜的托管。双赢
在本文中,我将讨论 Jekyll。在撰写本文时[我的个人网站使用的是 Jekyll][2]。Jekyll 使用 Ruby 引擎将用 Markdown 编写的文章转换成 HTML。[Sass][3] 可以将复杂的 CSS 规则应用到普通文本文件中。[Liquid][4] 允许对静态内容进行编程控制。
### 安装 Jekyll
[Jekyll 网站][5] 提供 Linux、MacOS 和 Windows 安装说明。安装完成之后,[快速引导][6] 将会安装一个基础的 Hello-World 项目。
[Jekyll 网站][5] 提供 Linux、MacOS 和 Windows 安装说明。安装完成之后,[快速引导][6] 将会安装一个基础的 Hello-World 项目。
现在在你的浏览器访问 `http://localhost:4000`。你可以看到一个默认的很棒的博客。
现在在你的浏览器访问 `http://localhost:4000`,你可以看到你的默认“真棒”博客。
![Default "awesome" blog][7]
### 目录结构
站点默认包含以下的文件和文件夹:
这个默认站点包含以下的文件和文件夹:
* `_posts`: 你的博客条目
* `_site`: 最终编译的静态网站文件。
* `about.markdown`: 关于页面内容。
* `index.markdown`: 主页页面内容。
* `404.html`: 404 页面内容。
* `_posts`: 你的博客文章
* `_site`: 最终编译的静态网站文件。
* `about.markdown`: “关于页”的内容。
* `index.markdown`: “主页”的内容。
* `404.html`: “404 页”的内容。
* `_config.yml`: Jekyll 的全站配置文件。
### 创建新的博客条目
### 创建新的博客帖子
创建帖子很简单。你需要做的就是在 `_post` 目录下使用正确的格式和扩展名创建一个新文件,这样就完成了。
有效的文件名像 `2021-08-29-welcome-to-jekyll.markdown`这样。一个博客文件必须包含 Jekyll 所称的 YAML 前置。它是包含元数据的文件开头的一个特殊部分。如果你看到默认的帖子,你可以看到以下内容:
有效的文件名像 `2021-08-29-welcome-to-jekyll.markdown` 这样。一个博客文件必须包含 Jekyll 所谓的 YAML <ruby>卷首块<rt>Front Matter</rt></ruby>。它是文件开头的一个包含元数据的特殊部分。如果你查看默认的帖子,你可以看到以下内容:
```
---
@ -51,7 +52,7 @@ categories: jekyll update
---
```
Jekyll 使用上面的元数据,你可以自定义 `key: value` 键值对。如果你需要一些灵感,[请查看我的网站前置内容][9]。除了前面的问题,你还可以[使用内置的 Jekyll 变量][10] 来自定义你的网站。
Jekyll 使用上面的元数据,你可以自定义 `key: value` 键值对。如果你需要一些提示,[请查看我的网站的卷首][9]。除了前面的问题,你还可以 [使用内置的 Jekyll 变量][10] 来自定义你的网站。
让我们创建一个新的帖子。在 `_posts` 文件夹下创建 `2021-08-29-ayushsharma.markdown`。内容如下:
@ -73,11 +74,11 @@ This is a [link](<http://notes.ayushsharma.in>)
This is my category:
```
如果 `jekyll serve` 命令仍在运行,刷新页面,你将看到下面的新条目
如果 `jekyll serve` 命令仍在运行,刷新页面,你将看到下面的新帖子
![New blog entry][11]
恭喜你创建了你的第一篇文章!这个过程看起来很简单,但是你可以通过 Jekyll 做很多事情。使用简单的 Markdown你可以归档博客、代码片段的高亮显示以及帖子的分类管理。
恭喜你创建了你的第一篇帖子!这个过程看起来很简单,但是你可以通过 Jekyll 做很多事情。使用简单的 Markdown你可以归档博客、高亮显示代码片段以及分类管理帖子
### 草稿
@ -85,17 +86,17 @@ This is my category:
### 布局和包含
请注意 `_post` 文件夹中两篇文章的前面内容,你将在前置内容中看到 `layout: post`。`_layout` 文件夹中包含所有布局。你不会在源代码中找到它们,因为 Jekyll 默认加载它们。Jekyll 使用的默认源代码在[这里][12]。如果你点击链接,你可以看到博客布局使用默认布局。默认布局包含 `{{ content }}` 注入内容的代码。布局文件还将包含 `include` 指令。它们从[包含文件夹][14]加载文件并允许使用不同的组件组成页面。
请注意 `_post` 文件夹中两篇文章的卷首块,你将在其中看到 `layout: post`。`_layout` 文件夹中包含所有布局。你不会在源代码中找到它们,因为 Jekyll 默认加载它们。Jekyll 使用的默认源代码在 [这里][12]。如果你点击该链接,你可以看到 `post` 的布局使用了默认(`default`)布局。默认布局包含的代码 `{{ content }}` 是注入内容的地方。布局文件还将包含 `include` 指令。它们从 [`include` 文件夹][14] 加载文件,并使用不同的组件组成页面。
总的来说,这就是布局的工作方式-你在最前面定义它们并将你的内容注入其中。Includes 提供页面的其它部分以组成整个页面。这是一种标准的网页设计技术--定义页眉、页脚、旁白和内容元素,然后在其中注入内容。这就是静态站点生成器的真正威力--完全以编程的方式控制将你的网站组装起来并最终编译成静态的 HTML。
总的来说,这就是布局的工作方式:你在卷首块定义它们并将你的内容注入其中。而包含则提供了页面的其它部分以组成整个页面。这是一种标准的网页设计技术:定义页眉、页脚、旁白和内容元素,然后在其中注入内容。这就是静态站点生成器的真正威力,完全以编程的方式控制,将你的网站组装起来并最终编译成静态的 HTML。
### 页面
你网站上的所有内容并不都是文章或博客。你将需要关于页面、联系页面、项目页面或投资组合页面。这就是 Pages 的用武之地。它们的工作方式与 Posts 完全一样,这意味着它们是带有前置块的 Markdown 文件。但它们不会进入 `_posts` 目录。它们要么保留在你的项目根目录中,要么保留在它们自己的文件夹中。对于布局和包含,你可以使用与帖子相同的布局或创建新帖子。 Jekyll 非常灵活,你可以随心所欲地发挥你的创意!你的默认博客已经有 `index.markdown``about.markdown`。随意自定义它们。
你网站上的所有内容并不都是文章或博客。你需要“关于”页面、“联系”页面、“项目”页面或“作品”页面。这就是“页面”的用武之地。它们的工作方式与“帖子”完全一样,这意味着它们是带有卷首块的 Markdown 文件。但它们不会放到 `_posts` 目录。它们要么保留在你的项目根目录中,要么保留在它们自己的文件夹中。对于布局和包含,你可以使用与帖子相同的布局或创建新帖子。 Jekyll 非常灵活,你可以随心所欲地发挥你的创意!你的默认博客已经有 `index.markdown``about.markdown`随意自定义它们。
### 数据文件
数据文件位于 `_data` 目录中,可以是 `.yml``.json``.csv` 格式文件。例如,一个 `_data/members.yml` 文件可能包含:
数据文件位于 `_data` 目录中,可以是 `.yml`、`.json`、`.csv` 等格式的文件。例如,一个 `_data/members.yml` 文件可能包含:
```
- name: A
@ -110,7 +111,6 @@ This is my category:
Jekyll 在网站生成的时候读取这些内容。你可以通过 `site.data.members` 访问它们。
```
<ul>
{ % for member in site.data.members % }
@ -129,19 +129,15 @@ Jekyll 在网站生成的时候读取这些内容。你可以通过 `site.data.m
### 构建你最终的网站
命令 `jekyll serve` 非常适合本地测试。但是一旦你完成了本地测试,你将需要构建要发布的最终工作。命令 `jekyll build --source source_dir --destination destination_dir` 将你的网站构建到 `_site` 文件夹中。请注意,此文件夹在每次构建之前都会被清理,所以不要将重要的东西放在那里。获得内容后,你可以将其托管在你的静态托管服务上。
命令 `jekyll serve` 非常适合本地测试。但是一旦你完成了本地测试,你将需要构建要发布的最终工作。命令 `jekyll build --source source_dir --destination destination_dir` 将你的网站构建到 `_site` 文件夹中。请注意,此文件夹在每次构建之前都会被清理,所以不要将重要的东西放在那里。生成内容后,你可以将其托管在你的静态托管服务上。
你现在应该对 Jekyll 的功能以及主要部分的功能有一个全面的了解。如果你正在寻找灵感,官方 [JAMStack 网站上有一些很棒的例子][17]。
![Example Jekyll sites from JAMStack][18]
快乐编码 :)
编码快乐。
* * *
本文首发于[作者个人博客][19],经授权改编。
了解 Jekyll一个静态 HTML 文件的开源生成器,如何让运行博客变得像...
本文首发于 [作者个人博客][19],经授权改编。
--------------------------------------------------------------------------------
@ -150,7 +146,7 @@ via: https://opensource.com/article/21/9/build-website-jekyll
作者:[Ayush Sharma][a]
选题:[lujun9972][b]
译者:[perfiffer](https://github.com/perfiffer)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,129 @@
[#]: subject: "How I use Ansible and anacron for automation"
[#]: via: "https://opensource.com/article/21/9/ansible-anacron-automation"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13879-1.html"
我如何使用 Ansible 和 anacron 实现自动化
======
> 有了 anacron我可以把脚本和 Ansible 剧本放到合适的地方,以完成各种琐碎的任务。
![](https://img.linux.net.cn/data/attachment/album/202110/13/155036tc0c7th906cc96mm.jpg)
自动化是伟大的 IT 和 DevOps 理想,但根据我的经验,可能根本不存在什么不方便的东西。有很多次,我为某些任务想出了一个很好的解决方案,我甚至会编写脚本,但我没有让它真正实现自动化,因为在我工作的机器上不存在易于自动化的基础设施。
我最喜欢的简易自动化工具曾经是 cron 系统它古老、可靠、面向用户而且简单除了一个我永远无法记住的调度语法之外。然而cron 的问题是,它假定一台电脑每天 24 小时都在工作。在错过了太多预定的备份之后,我发现了 [anacron][2],一个基于时间戳而非预定时间的 cron 系统。如果你的电脑在通常情况下运行时处于关闭状态anacron 会确保它在电脑重新开启时运行。创建一个作业只需要简单地把一个 shell 脚本放到三个目录中:`cron.day`、`cron.weekly` 或者 `cron.monthly` (如果你想的话,你可以定义更多)。有了 anacron我发现自己把脚本和 Ansible 剧本用在了各种琐碎的任务中,包括弹出到期和事件提醒。
这是一个现代问题的简单而明显的解决方案,但如果 anacron 没有安装在电脑上,那它对我就没有用。
### 用 Ansible 进行软件设置
任何时候我设置一台新的计算机,无论是笔记本电脑、工作站还是服务器,我都会安装 anacron。这很简单但是 anacron 的安装只提供了 `anacron` 命令。它并没有设置 anacron 的用户环境。所以我创建了一个 Ansible 剧本来设置用户需要什么来使用 anacron 并安装 `anacron` 命令。
首先,标准的 Ansible 模板:
```
---
- hosts: localhost
tasks:
```
### 用 Ansible 创建目录
接下来,我创建了用于 Anacron 的目录树。你可以把它看成是一种透明的 crontab。
```
- name: create directory tree
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
- '~/.local/etc/cron.daily'
- '~/.local/etc/cron.weekly'
- '~/.local/etc/cron.monthly'
- '~/.var/spool/anacron'
```
这个语法可能看起来有点奇怪,但它实际上是一个循环。`with_items:` 指令定义了四个要创建的目录Ansible 在 `ansible.buildin.file:` 指令中为每个目录迭代一次(目录名填充了 `{{ item }}` 变量)。与 Ansible 中的一切一样,如果目录已经存在,不会有错误或冲突。
### 用 Ansible 复制文件
`ansible.buildin.copy` 模块将文件从一个地方复制到另一个地方。为了让它工作,我需要创建一个叫做 `anacrontab` 的文件。它不是 Ansible 剧本,所以我把它放在我的 `~/Ansible/data` 目录下,那里是我的剧本的支持文件。
```
- name: copy anacrontab into place
ansible.builtin.copy:
src: ~/Ansible/data/anacrontab
dest: ~/.local/etc/anacrontab
mode: '0755'
```
我的 `anacrontab` 文件很简单,模仿了一些发行版默认安装在 `/etc/anacron` 中的文件:
```
SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
1 0 cron.day run-parts $HOME/.local/etc/cron.daily/
7 0 cron.wek run-parts $HOME/.local/etc/cron.weekly/
30 0 cron.mon run-parts $HOME/.local/etc/cron.monthly/
```
### 登录时运行 anacron
大多数 Linux 发行版将 anacron 配置为从 `/etc/anacron` 读取作业。我主要是作为一个普通用户使用 anacron所以我从我的登录账号 `~/.profile` 启动 anacron。我不想让自己记住这些配置所以我让 Ansible 来做。我使用 `ansible.buildin.lineinfile` 模块,它会在 `~/.profile` 不存在时创建它,并插入 anacron 的启动行。
```
- name: add local anacrontab to .profile
ansible.builtin.lineinfile:
path: ~/.profile
regexp: '^/usr/sbin/anacron'
line: '/usr/sbin/anacron -t ~/.local/etc/anacrontab'
create: true
```
### 用 Ansible 安装 anacron
对于我的大多数系统来说,`dnf` 模块可以用来安装软件包,但我的工作站运行的是 Slackware使用 `slackpkg`),有时不同的 Linux 发行版也会进入我的收藏。`ansible.buildin.package` 模块提供了一个安装软件包的通用接口,所以我把它用在这个剧本上。幸运的是,我还没有遇到一个名为 `anacron` 的仓库不是 `anacron`,所以现在,我不必考虑软件包名称的潜在差异。
这实际上是一个单独的剧本,因为软件包的安装需要权限升级,它由 `becomes: true` 指令提供。
```
- hosts: localhost
become: true
tasks:
- name: install anacron
ansible.builtin.package:
name: anacron
state: present
```
### 使用 anacron 和 Ansible 实现轻松自动化
为了用 Ansible 安装 anacron我运行该剧本
```
$ ansible-playbook ~/Ansible/setup-anacron.yaml
```
从此,我就可以编写 shell 脚本来执行一些琐碎但重复的任务,然后把它复制到 `~/.local/etc/cron.daily`,让它每天自动运行一次(或者大约如此)。我还为诸如 [清理下载文件夹][3] 之类的任务编写了 Ansible 剧本。我把我的剧本放在 `~/Ansible` 里,这是我保存 Ansible 剧本的地方,然后在 `~/.local/etc/cron.daily` 里创建一个 shell 脚本来执行这个剧本。这很简单,不费吹灰之力,而且很快成为习惯。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/9/ansible-anacron-automation
作者:[Seth Kenlon][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://opensource.com/users/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming-code-keyboard-laptop-music-headphones.png?itok=EQZ2WKzy (Woman programming)
[2]: https://opensource.com/article/21/2/linux-automation
[3]: https://opensource.com/article/21/9/keep-folders-tidy-ansible

View File

@ -0,0 +1,77 @@
[#]: subject: "/e/ cloud is a deGoogled Alternative to Google Drive"
[#]: via: "https://news.itsfoss.com/e-cloud/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13874-1.html"
/e/ 云:一个去谷歌化的 Google Drive 替代方案
======
![](https://img.linux.net.cn/data/attachment/album/202110/12/122933awf0z9vnqdzslv1q.jpg)
> /e/ 云是 e.foundation 使用 Nextcloud 等开源工具创立的,以作为 Google Drive 和 Gmail 的替代品。
![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/ecloud-ft.png?w=1200&ssl=1)
Google Drive 是一种流行的云存储服务,在大多数情况下效果很好。
然而,它可能不是最关注隐私的选择。因此,要完全控制你的数据,最好的办法是启动一个 [Nextcloud][1] 实例,存储你的基本数据,并可以访问其他协作工具。
虽然这听起来不错,但不是每个人都能投入精力来创建和维护他们的实例。这就是 /e/ 云上场的时候了,它是由 [去谷歌化的安卓操作系统 /e/ 操作系统][2] 背后的同一个团队建立的。
/e/ 云主要将自己定位为一个新的 Google Drive 私人替代品,并提供一个取代 Gmail 的邮箱。
### /e/ 云:带有邮箱的 Nextcloud 及 OnlyOffice
![][3]
当你创建一个 /e/ 账户时,它会给你一个私人电子邮件地址 [xyz@e.email][4]。
而且,同邮箱地址一起,你会得到 1GB 的免费 /e/ 云存储空间和一个由 Nextcloud 和 OnlyOffice 为核心的协作平台。
因此,如果你想利用 Nextcloud 和 OnlyOffice 来取代谷歌的工具套件,而不需要自己全部设置,/e/ 云可以成为一个引人注目的以隐私为中心的选择。
![][5]
除了 OnlyOffice 的文件存储和文档支持外,你还可以使用日历,存储笔记,并添加任务。
因此,它也可以成为一个正式的以隐私为中心的协作平台,你可以免费使用。
如果你想要更多的存储空间,你可以将你的订阅升级到付费计划,你可以根据需要选择 20 到 1TB 的存储空间,并按月/年计费。定价计划起价低至 3 美元/月。
毫无疑问,如果你在手机上使用 /e/ 操作系统或使用一个 /e/ 智能电话,这应该是一种无缝体验。
但是,你也可以使用第三方邮件客户端和 Nextcloud 移动应用在任何设备上使用它。
- [注册 /e/ 云][6]
### 总结
考虑到它相对较新,正计划增加几个功能,包括端到端加密,从 Google Drive 迁移等。
你可以注册一个帐户并免费试用。
对于像 /e/ 云这样以 Nextcloud 为核心的主流解决方案,除了电子邮件和协作服务外,还能帮助你安全地管理/存储文件,你觉得怎么样?
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/e-cloud/
作者:[Ankush Das][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://news.itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/nextcloud/
[2]: https://itsfoss.com/e-os-review/
[3]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/ecloud.png?resize=1568%2C772&ssl=1
[4]: mailto:xyz@e.email
[5]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/ecloud-files.png?resize=1568%2C787&ssl=1
[6]: https://e.foundation/e-email-invite/

View File

@ -0,0 +1,160 @@
[#]: subject: "How to Install Google Chrome on Debian and Kali Linux"
[#]: via: "https://itsfoss.com/install-chrome-debian-kali-linux/"
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13895-1.html"
如何在 Debian 和 Kali Linux 上安装 Chrome 浏览器
======
> Debian 和基于 Debian 的 Kali Linux 将 Firefox 作为默认的网页浏览器。但这并不意味着你不能在其中安装其他网页浏览器。
![](https://img.linux.net.cn/data/attachment/album/202110/18/175716cfvxnvf05b5je1ax.jpg)
Chrome 浏览器非常流行,你可能已经在其他系统上使用它了。如果你想在 Debian 上安装 Chrome你肯定可以这样做。
你在 Debian 的软件库中找不到 Chrome因为它不是开源软件但你可以从 Chrome 网站下载并安装它。
在本教程中,我将向你展示在 Debian 上安装 Chrome 的两种方法:
* GUI 方法
* 命令行方法
让我们先从 GUI 方法开始。
> 注意:我在这里的例子中使用的是 Debian但由于 Kali Linux 是基于 Debian 的,所以同样的方法也适用于 Kali Linux。
### 方法 1: 在 Debian 上以图形方式安装 Chrome 浏览器
这是一个不费吹灰之力的方法。你去 Chrome 网站,下载 deb 文件,然后双击它来安装它。我将详细地展示这些步骤,这样你就能很容易地掌握了。
前往 Chrome 的网站。
[Get Google Chrome][1]
你会看到下载 Chrome 的选项。
![Click on the Download Chrome button][2]
当你点击下载按钮时,它会给你两个下载安装文件的选项。选择写着 Debian/Ubuntu 的那个。
![Download the Chrome installer file for Debian][3]
**请注意Chrome 浏览器不适用于 32 位系统。**
接下来,你应该选择将文件保存到电脑中,而不是在软件中心打开进行安装。这样一来,下载的文件将被保存在下载文件夹中,而不是临时目录中。
![Save the downloaded DEB file for Google Chrome][4]
进入下载文件夹,右击下载的 DEB 文件,选择用 “Software Install” 打开它。
![Right click on the downloaded DEB file and open with Software Install][5]
它将打开软件中心,你应该看到现在安装 Chrome 浏览器的选项。点击安装按钮。
![Click on the install button][6]
你会被要求输入账户的密码。这是你用来登录系统的同一密码。
![Enter your accounts password][7]
在不到一分钟的时间里Chrome 就会安装完毕。你现在应该看到一个删除选项,这表明软件已经安装完毕。
![Chrome is now installed][8]
当 Chrome 在 Debian 上安装完毕,在系统菜单中搜索它并启动它。
![Start Google Chrome][9]
它将要求成为你的默认浏览器,并将崩溃报告发送给谷歌。你可以取消勾选这两个选项。然后你就可以看到谷歌浏览器的窗口。
![][10]
如果你登录了你的谷歌账户,你应该可以在这里同步你的密码、书签和其他浏览数据。好好体验吧!
还有一点,安装完 Chrome 后,你可以从系统中删除下载的 DEB 文件。不再需要它了,甚至在卸载 Chrome 时也不需要。
### 方法 2在 Debian 上从终端安装 Chrome
你刚才看到的内容可以在终端中轻松实现。
首先,确保你的软件包缓存已经刷新,并且你已经安装了 `wget`,用于 [在终端中从网上下载文件][11]。
```
sudo apt update && sudo apt install wget
```
接下来是下载 Chrome 的 .deb 文件。
```
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
```
下载后,你可以用 `apt` 命令 [在终端安装 deb 文件][12],像这样:
```
sudo apt install ./google-chrome-stable_current_amd64.deb
```
安装完成后,你就可以开始使用 Chrome 了。
### 额外提示:更新 Chrome
这两种方法都会将谷歌的软件库添加到你的系统中。你可以在你的 `sources.list.d` 目录中看到它:
```
cat /etc/apt/sources.list.d/google-chrome.list
```
这意味着 Chrome 将与 Debian 和 Kali Linux 中的其他系统更新一起被更新。你知道 [如何在命令行中更新你的 Kali Linux][13] 或 Debian 系统么?只要使用这个命令:
```
sudo apt update && sudo apt upgrade -y
```
### 从你的系统中卸载 Chrome
即使你选择用 GUI 方法在 Debian 上安装 Chrome你也必须使用终端来删除它。
不要担心。这其实只是一个命令:
```
sudo apt purge google-chrome-stable
```
根据要求输入你的账户密码。当你输入密码时,屏幕上没有任何显示。这没关系。输入它并按回车键,确认删除。
![][14]
好了,就这些了。我希望你觉得这个教程有帮助。
--------------------------------------------------------------------------------
via: https://itsfoss.com/install-chrome-debian-kali-linux/
作者:[Abhishek Prakash][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://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://www.google.com/chrome/
[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/download-chrome-on-debian.webp?resize=800%2C344&ssl=1
[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/downloading-google-chrome.webp?resize=800%2C512&ssl=1
[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/save-downloaded-chrome-installer-file-debian.webp?resize=800%2C430&ssl=1
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/open-deb-file-with-software-install.webp?resize=800%2C419&ssl=1
[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/installing-chrome-debian.webp?resize=800%2C408&ssl=1
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/enter-account-password-while-installing-deb-file.webp?resize=800%2C420&ssl=1
[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/chrome-installed-debian.webp?resize=800%2C384&ssl=1
[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/start-chrome-debian.webp?resize=800%2C276&ssl=1
[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/Chrom-in-Debian.webp?resize=800%2C450&ssl=1
[11]: https://itsfoss.com/download-files-from-linux-terminal/
[12]: https://itsfoss.com/install-deb-files-ubuntu/
[13]: https://linuxhandbook.com/update-kali-linux/
[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/remove-google-chrome-ubuntu.webp?resize=800%2C450&ssl=1

View File

@ -0,0 +1,57 @@
[#]: subject: "Open Source Changed Linux Otherwise It Was Done: Linus Torvalds"
[#]: via: "https://news.itsfoss.com/open-source-changed-linux-torvalds/"
[#]: author: "Abhishek https://news.itsfoss.com/author/root/"
[#]: collector: "lujun9972"
[#]: translator: "zd200572"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13890-1.html"
Linus Torvalds :开源改变了 Linux, 否则它就完了
======
> Linux 本来会像其他业余项目一样被抛在后面,但开源改变了这一点。
![](https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/torvalds-linux-kernel.png?w=1200&ssl=1)
你可能已经知道这个故事30 年前,芬兰学生 Linus Torvalds 开发了一个业余项目,创建了一个类 UNIX 操作系统。
你不知道的是Torvalds 认为这个业余项目已经完成了,他本想把它抛在脑后,做一些新的、有趣的项目。
那么,是什么让他在这个“业余项目”上工作了 30 年呢?答案是开源。
### 开源改变了 Linux
在最近结束的 [北美开源峰会][1] 上Linus Torvalds 分享了一些关于 Linux 项目过去、现在和未来的见解。
当回忆起这个项目的最初情况时,[Torvalds 说][2] 他本以为会以“已完成的状态”抛下 Linux 这个项目,而去做些新的、有趣的事情。
> 显然是开源改变了这一切。这个项目,如果是由我来决定,我可能会把它抛在一边,但是突然间,我开始收到各种问题,最后还有人们提交的补丁,这使得我的动力不断持续。现在 30 年过去了,这仍然是动力所在。
Torvalds 还补充说就他而言Linux 在过去 29 年里已经完成了。以后添加的每一个其他的功能,都是其他人需要、想要或感兴趣的。
许多开发人员都会遇到这种情况。你在一个项目上工作,认为它已经达到“完成”的状态了,如果这个项目没有足够的吸引力,你就会对它失去兴趣,转而去做一些“新的、有趣的”事情。实际上继续这个项目的真正动力来自用户和认可。
当被问及 Linux 50 周年要做些什么时Torvalds 说,他不认为自己在 70 岁的时候还能继续做内核编程。然后他还补充说,他也没想过自己在 50 岁还在做内核编程,但他现在却在做这个事情。
> “不知何故,我不认为我 70 岁还能做内核编程。但是另一方面,几年前,我也没想到自己 50 岁还在做内核编程,所以……我们拭目以待。”
我们总是愿意听 Torvalds 谈论 Linux作为一个热心的 Linux 用户,我们还有如此多需要学习和交流的东西!
来源:[The News Stack][2]
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/open-source-changed-linux-torvalds/
作者:[Abhishek][a]
选题:[lujun9972][b]
译者:[zd200572](https://github.com/zd200572)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/root/
[b]: https://github.com/lujun9972
[1]: https://events.linuxfoundation.org/open-source-summit-north-america/
[2]: https://thenewstack.io/linus-torvalds-on-community-rust-and-linuxs-longevity/

View File

@ -2,29 +2,29 @@
[#]: via: "https://opensource.com/article/21/10/linux-logrotate"
[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: translator: "perfiffer"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13909-1.html"
Rotate and archive logs with the Linux logrotate command
使用 logrotate 命令轮转和归档日志
======
Keep log files fresh with this Linux command. Download the new logrotate
cheat sheet.
![Logs stacked up and to the right in front of a green tree forest][1]
Logs are great for finding out what an application is doing or troubleshooting a possible problem. Almost every application we deal with generates logs, and we want the applications we develop ourselves to generate them too. The more verbose the logs, the more information we have. But left to themselves, logs can grow to an unmanageable size, and they can, in turn, become a problem of their own. So it's a good idea to keep them trimmed down, keep the ones we're going to need, and archive the rest.
> 使用此 Linux 命令保持日志文件更新。
### Basics
![](https://img.linux.net.cn/data/attachment/album/202110/22/113833i6ikk4dzdm3y3hkk.jpg)
The `logrotate` utility is excellent at managing logs. It can rotate them, compress them, email them, delete them, archive them, and start fresh ones when you need them.
日志非常适合找出应用程序在做什么或对可能的问题进行故障排除。几乎我们处理的每个应用程序都会生成日志,我们希望我们自己开发的应用程序也生成日志。日志越详细,我们拥有的信息就越多。但放任不管,日志可能会增长到无法管理的大小,反过来,它们可能会成为它们自己的问题。因此,最好将它们进行裁剪,保留我们需要的那些,并将其余的归档。
Running `logrotate` is pretty simple—just run `logrotate -vs state-file config-file`. In the above command, the `v` option enables verbose mode, `s` specifies a state file, and the final `config-file` mentions the configuration file, where you specify what you need done.
### 基本功能
### Hands-on
`logrotate` 实用程序在管理日志方面非常出色。它可以轮转日志、压缩日志、通过电子邮件发送日志、删除日志、归档日志,并在你需要时开始记录最新的。
Let's check out a `logrotate` configuration that is running silently on our system, managing the wealth of logs we find in the `/var/log` directory. Check out the current files in that directory. Do you see a lot of `*.[number].gz` files? Thats what `logrotate` is doing. You can find the configuration file for this under `/etc/logrotate.d/rsyslog`. Mine looks like this:
运行 `logrotate` 非常简单——只需要运行 `logrotate -vs state-file config-file`。在上面的命令中,`v` 选项开启详细模式,`s` 指定一个状态文件,最后的 `config-file` 是配置文件,你可以指定需要做什么。
### 实战演练
让我们看看在我们的系统上静默运行的 `logrotate` 配置,它管理我们在 `/var/log` 目录中找到的大量日志。查看该目录中的当前文件。你是否看到很多 `*.[number].gz` 文件?这就是 `logrotate` 正在做的。你可以在 `/etc/logrotate.d/rsyslog` 下找到此配置文件。我的配置文件如下:
```
/var/log/syslog
@ -36,7 +36,7 @@ Let's check out a `logrotate` configuration that is running silently on our sy
        delaycompress
        compress
        postrotate
                reload rsyslog &gt;/dev/null 2&gt;&amp;1 || true
                reload rsyslog > /dev/null 2>&1 || true
        endscript
}
@ -62,29 +62,26 @@ Let's check out a `logrotate` configuration that is running silently on our sy
        delaycompress
        sharedscripts
        postrotate
                reload rsyslog &gt;/dev/null 2&gt;&amp;1 || true
                reload rsyslog > /dev/null 2>&1 || true
        endscript
}
```
The file starts with defining the instructions for rotating the `/var/log/syslog` file and the instructions are contained within the curly braces that follow. Heres what they mean:
该文件首先定义了轮转 `/var/log/syslog` 文件的说明,这些说明包含在后面的花括号中。以下是它们的含义:
* `rotate 7`: Keep logs from the last seven rotations. Then start deleting them.
* `daily`: Rotate the log daily. Along with `rotate 7`, this would mean that logs would be kept for the last seven days. Other options are `weekly`, `monthly`, `yearly`. There is also a `size` parameter that will rotate log files if their size increases beyond a specified limit—for example, `size 10k`, `size 10M`, `size 10G`, etc. If nothing is specified, logs will be rotated whenever `logrotate` runs. You can even run `logrotate` in a `cron` to use it at more specific time intervals.
* `missingok`: Its okay if the log file is missing. Dont Panic.
* `notifempty`: Dont rotate if the log file is empty.
* `delaycompress`: If compression is on, delay compression until the next rotation. This allows at least one rotated but uncompressed file to be present. Useful if you want yesterdays logs to stay uncompressed for troubleshooting. It is also helpful if some program might still write to the old file until it is restarted/reloaded, like Apache.
* `compress`: Compression is on. Use `nocompress` to turn it off.
* `postrotate/endscript`: Run the script within this section after rotation. Helpful in doing cleanup stuff. There is also a `prerotate/endscript` for doing things before rotation begins.
* `rotate 7`: 保留最近 7 次轮转的日志。然后开始删除超出的。
* `daily`: 每天轮转日志,与 `rotate 7` 一起使用,这意味着日志将保留过去 7 天。其它选项是每周、每月、每年。还有一个大小参数,如果日志文件的大小增加超过指定的限制(例如,大小 10k、大小 10M、大小 10G 等),则将轮转日志文件。如果未指定任何内容,日志将在运行 `logrotate` 时轮转。你甚至可以在 cron 中运行 `logrotate` 以便在更具体的时间间隔内使用它。
* `missingok`: 如果日志文件缺失也没关系。不要惊慌。
* `notifempty`: 日志文件为空时不轮转。
* `compress`: 开启压缩,使用 `nocompress` 关闭它。
* `delaycompress`: 如果压缩已打开,则将压缩延迟到下一次轮转。这允许至少存在一个轮转但未压缩的文件。如果你希望昨天的日志保持未压缩以便进行故障排除,那么此配置会很有用。如果某些程序在重新启动/重新加载之前可能仍然写入旧文件,这也很有帮助,例如 Apache。
* `postrotate/endscript`: 轮转后运行此部分中的脚本。有助于做清理工作。还有一个 `prerotate/endscript` 用于在轮转开始之前执行操作。
你能弄清楚下一节对上面配置中提到的所有文件做了什么吗?第二节中唯一多出的参数是 `sharedscripts`,它告诉 `logrotate` 在所有日志轮转完成之前不要运行 `postrotate/endscript` 中的部分。它可以防止脚本在每一次轮转时执行,只在最后一次轮转完成时执行。
### 看点新的东西
Can you figure out what the next section does for all those files mentioned in the configuration above? The only additional parameter in the second section is `sharedscripts`, which tells `logrotate` to not run the section within `postrotate/endscript` until all log rotation is complete. It prevents the script from being executed for every log rotated and runs once at the end.
### Something New
Im using the following configuration for dealing with Nginx access and error logs on my system.
我使用下面的配置来处理我系统上的 `Nginx` 的访问和错误日志。
```
/var/log/nginx/access.log
@ -106,15 +103,13 @@ Im using the following configuration for dealing with Nginx access and error
}
```
The above script can be run using:
上面的脚本可以使用如下命令运行:
```
logrotate -vs state-file /tmp/logrotate
```
Running the command for the first time gives this output:
第一次运行该命令会给出以下输出:
```
reading config file /tmp/logrotate
@ -141,8 +136,7 @@ running postrotate script
* Reloading nginx configuration nginx
```
And running it a second time:
第二次运行它:
```
reading config file /tmp/logrotate
@ -168,8 +162,7 @@ running postrotate script
* Reloading nginx configuration nginx
```
And running it a third time:
第三次运行它:
```
reading config file /tmp/logrotate
@ -195,8 +188,7 @@ running postrotate script
* Reloading nginx configuration nginx
```
The contents of the state file look like this:
状态文件的内容如下所示:
```
logrotate state -- version 2
@ -204,11 +196,9 @@ logrotate state -- version 2
"/var/log/nginx/access.log" 2021-08-27-9:11:56
```
[**Download the Linux logrotate cheat sheet.**][2]
- [下载 Linux logrotate 备忘单][2]
* * *
_This article was originally published on the [author's personal blog][3] and has been adapted with permission._
本文首发于[作者个人博客][3],经授权改编。
--------------------------------------------------------------------------------
@ -216,8 +206,8 @@ via: https://opensource.com/article/21/10/linux-logrotate
作者:[Ayush Sharma][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
译者:[perfiffer](https://github.com/perfiffer)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -3,44 +3,46 @@
[#]: author: "Daniel Huigens https://opensource.com/users/twiss"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13888-1.html"
最新 OpenPGP.js 版本的 3 个新功能
======
OpenPGP.js 是一个实现了 OpenPGP 标准的密码学库,最常用于电子邮件加密。
![email or newsletters via inbox and browser][1]
[OpenPGP.js][2]是一个实现了 [OpenPGP 标准][3]的密码学库,最常用于电子邮件加密。ProtonMail、Mailvelope 和 FlowCrypt 都使用 OpenPGP.js这仅仅是其中一些。这意味着 OpenPGP.js 库对数百万用户的信息进行了加密。
> OpenPGP.js 是一个实现了 OpenPGP 标准的密码学库,最常用于电子邮件加密。
OpenPGP 标准首次发布于 20 世纪 90 年代,像几乎任何东西一样,需要维护和更新,以保证安全和可用性。该标准的“加密刷新”[正在进行中][4],它增加了现代的加密算法并废除了过时的算法。为了提高可用性,各种电子邮件应用程序现在允许用户无缝加密他们的通信,用户无需管理他们的密钥或他们的联系人的密钥。
![](https://img.linux.net.cn/data/attachment/album/202110/16/115721k1vi1ekzip1kpqkg.jpg)
OpenPGP.js 于 2014 年首次发布,开始基于一个名为 GPG4Browsers 的早期原型,该原型基于 Herbert Hanewinkel以及其他贡献者的几个脚本。OpenPGP.js 的第二个版本于 2016 年发布,完全重新设计,使用 Uint8Arrays 而不是字符串(这大大增加了其性能),并在内部使用现代 ES6 模块而不是 CommonJS 模块。第 3 和第 4 版都是在 2018 年发布的分别增加了对椭圆曲线加密法ECC和流媒体的支持。
[OpenPGP.js][2] 是一个实现了 [OpenPGP 标准][3] 的密码学库最常用于电子邮件加密。ProtonMail、Mailvelope 和 FlowCrypt 都使用 OpenPGP.js这还仅仅是其中一些。也就是说 OpenPGP.js 库对数百万用户的信息进行了加密。
OpenPGP 标准首次发布于 20 世纪 90 年代,像几乎任何东西一样,需要维护和更新,以保证安全和可用性。该标准的“加密刷新” [正在进行中][4],它增加了现代的加密算法并废除了过时的算法。为了提高可用性,各种电子邮件应用程序现在允许用户无缝加密他们的通信,用户无需管理他们的密钥或他们的联系人的密钥。
OpenPGP.js 于 2014 年首次发布,开始基于一个名为 GPG4Browsers 的早期原型,该原型基于 Herbert Hanewinkel以及其他贡献者的几个脚本。OpenPGP.js 的第二个版本于 2016 年发布,完全重新设计,使用 Uint8Arrays 而不是字符串(这大大增加了其性能),并在内部使用现代 ES6 模块而不是 CommonJS 模块。第 3 和第 4 版都是在 2018 年发布的分别增加了对椭圆曲线加密法ECC和流的支持。
我和我的团队继续在 OpenPGP.js 上工作,以确保其发展为一个易于使用的强加密库。
### 1\. 默认的椭圆曲线加密
### 1默认的椭圆曲线加密
在 OpenPGP.js 第 4 版中,生成新密钥时默认使用 RSA。虽然 ECC 更快、更安全,但 Curve25519 还没有在 OpenPGP 规范中得到标准化。加密刷新草案包括了 Curve25519并且预计它将“按原样”包含在下一版本的 OpenPGP 规范中,因此 OpenPGP.js 第 5 版现在默认使用 ECC 生成密钥。
### 2\. 只导入你需要的模块
### 2只导入你需要的模块
同样,虽然 OpenPGP.js 内部使用 ES6 模块多年,但第 4 版仍然没有发布一个合适的 ES6 模块。相反它只发布了一个通用模块定义UMD模块可以在浏览器和 Node.js 上运行。在第 5 版中,这种情况有所改变,为浏览器和 Node.js 发布了单独的模块(包括 ES6 和非 ES6使库用户更容易在所有平台上导入 OpenPGP.js ,且(当使用 ES6 模块时)只导入他们需要的部分。这在很大程度上是通过将构建系统切换到 [rollup][5] 来实现的。
同样,虽然 OpenPGP.js 内部使用 ES6 模块多年,但第 4 版仍然没有发布一个合适的 ES6 模块。相反,它只发布了一个<ruby>通用模块定义<rt>Univeral Module Definition</rt></ruby>UMD模块可以在浏览器和 Node.js 上运行。在第 5 版中,这种情况有所改变,为浏览器和 Node.js 发布了单独的模块(包括 ES6 和非 ES6使库用户更容易在所有平台上导入 OpenPGP.js ,且(当使用 ES6 模块时)只导入他们需要的部分。这在很大程度上是通过将构建系统切换到 [rollup][5] 来实现的。
### 3\. 拒绝弱加密技术
### 3拒绝弱加密技术
还有许多其他的安全改进。例如1024 位 RSA 密钥、ElGamal 和 DSA 密钥被认为是不安全的,并被默认拒绝。此外,第 4 版已经默认使用 AES 加密,第 5 版现在完全默认拒绝使用较弱的算法进行加密,即使公钥声称只支持较弱的算法。相反,它假定所有的 OpenPGP 实现都支持 AES这种情况已经存在很长时间了
### OpenPGP.js 的下一步是什么?
展望未来,有一些安全方面的改进要做。用于识别公钥的密钥指纹仍然使用 SHA-1尽管在加密技术更新中计划对此进行修复。同时建议使用不同的方法来确定用于加密的任何公钥的真实性例如使用提议的[网络密钥目录 WKD][6]标准直接从收件人的域中获取整个密钥,这已经由各种[电子邮件提供商][7]实现。WKD 支持内置于 OpenPGP.js 第 4 版,但在第 5 版中是一个单独的模块,以保持主库的精简。
展望未来,有一些安全方面的改进要做。用于识别公钥的密钥指纹仍然使用 SHA-1尽管在加密技术更新中计划对此进行修复。同时建议使用不同的方法来确定用于加密的任何公钥的真实性例如使用提议的 <ruby>[网络密钥目录][6]<rt>Web Key Directory</rt></ruby>WKD标准直接从收件人的域中获取整个密钥这已经由各种 [电子邮件提供商][7] 实现。WKD 支持内置于 OpenPGP.js 第 4 版,但在第 5 版中是一个单独的模块,以保持主库的精简。
同样,当用密码而不是公钥加密信息或文件时(例如:在使用 OpenPGP 进行电子邮件加密时不常见但在用于加密备份时更常见密码会使用相对较弱的密钥衍生函数KDF转换为对称密钥。因此建议应用在将用户的密码传递给 OpenPGP.js 之前,先通过一个强大的 KDF如 [Argon2][8] 或 [scrypt][9]。希望加密技术的刷新会包括这些算法中的一种,以便在未来的 OpenPGP.js 版本中实现。
同样,当用密码而不是公钥加密信息或文件时(例如:在使用 OpenPGP 进行电子邮件加密时不常见,但在用于加密备份时更常见),密码会使用相对较弱的<ruby>密钥衍生函数<rt>Key Derivation Function</rt></ruby>KDF转换为对称密钥。因此建议应用在将用户的密码传递给 OpenPGP.js 之前,先通过一个强大的 KDF如 [Argon2][8] 或 [scrypt][9]。希望加密刷新草案会包括这些算法中的一种,以便在未来的 OpenPGP.js 版本中实现。
### 如何使用 OpenPGP.js 第 5 版
不过现在OpenPGP.js 第 5 版已经[发布][10]到 npm 仓库。如果你喜欢,可以随时试用!欢迎在 GitHub 的[讨论标签][11]中进行反馈。然而,请注意,虽然 OpenPGP.js 是一个通用的加密库,但它的主要使用情况是在需要与 OpenPGP 规范兼容的情况下(例如,在发送或接收 PGP 加密的电子邮件时)。对于其他的使用情况,不同的库可能是一个更合适或性能更好的选择。当然,总的来说,在推广任何加密技术时都要小心。
不过现在OpenPGP.js 第 5 版已经 [发布][10] 到 npm 仓库。如果你喜欢,可以随时试用!欢迎在 GitHub 的 [讨论版][11] 中进行反馈。然而,请注意,虽然 OpenPGP.js 是一个通用的加密库,但它的主要使用情况是在需要与 OpenPGP 规范兼容的情况下(例如,在发送或接收 PGP 加密的电子邮件时)。对于其他的使用情况,不同的库可能是一个更合适或性能更好的选择。当然,总的来说,在尝试使用任何加密技术时都要小心。
感谢阅读,这里是保护电子邮件的未来!
@ -51,7 +53,7 @@ via: https://opensource.com/article/21/10/openpgpjs
作者:[Daniel Huigens][a]
选题:[lujun9972][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/) 荣誉推出

View File

@ -3,36 +3,38 @@
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
[#]: collector: "lujun9972"
[#]: translator: "imgradeone"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13877-1.html"
如何在 Ubuntu 和其他 Linux 发行版中安装 Vivaldi 浏览器
[初级] 如何在 Ubuntu 中安装 Vivaldi 浏览器
======
> 您将在本篇新手教程中学习如何在 Ubuntu、Debian 及其他 Linux 发行版中安装 Vivaldi 网页浏览器,同时本教程也将介绍如何更新和卸载该软件。
![](https://img.linux.net.cn/data/attachment/album/202110/13/142545reotvtqgqpfvmmvp.jpg)
[Vivaldi][1] 是一款关注度逐步上升的网页浏览器。它基于 Chromium 内核,因此它拥有和 Chrome 类似的功能,但它也新增了一些其他特色功能,让这款浏览器与众不同、更为直观
> 你将在本篇新手教程中学习如何在 Ubuntu、Debian 及其他 Linux 发行版中安装 Vivaldi 网页浏览器,同时本教程也将介绍如何更新和卸载该软件
它内置了标签组、广告拦截、鼠标手势、笔记管理,甚至还有命令连锁。你甚至可以借助页面平铺来一次性浏览多个页面。当然,相比于 ChromeVivaldi 更加尊重你的隐私
[Vivaldi][1] 是一款日益流行的网页浏览器。它基于 Chromium 内核,因此它拥有和 Chrome 类似的功能,但它也新增了一些其他特色功能,让这款浏览器与众不同、更为直观
![页面平铺,一次性浏览多个页面][2]
它内置了标签组、广告拦截、鼠标手势、笔记管理,甚至还有命令连锁。你甚至可以借助切分视图来一次性浏览多个页面。当然,相比于 ChromeVivaldi 更加尊重你的隐私。
你可以从 [Manjaro Linux 近期使用 Vivaldi 取代 Firefox 作为部分分支的默认浏览器][3] 这件事来了解 Vivaldi 浏览器的受欢迎程度。
![标签平铺,一次性分割浏览多个页面][2]
[Manjaro Linux 近期使用 Vivaldi 取代 Firefox 作为其部分变体的默认浏览器][3],你可以从这件事来了解 Vivaldi 浏览器的受欢迎程度。
如果你想尝试一下这款浏览器的话,接下来让我告诉你,如何在 Linux 上安装 Vivaldi。你将了解到
* 安装 Vivaldi 的 GUI 和命令行方式
* 将 Vivaldi 更新到最新版本的提示
* 将 Vivaldi 更新到最新版本的技巧
* 在 Ubuntu 中卸载 Vivaldi 的方式
> 非自由软件Non-FOSS警告!
> **非自由软件警告!**
>
> Vivaldi 并非完全的开源软件。它的 UI 界面是闭源的。之所以在这里介绍这款浏览器,是因为 Vivaldi 团队正努力让该软件在 Linux 平台上可用。
### 在 Ubuntu 中安装 Vivaldi [GUI 方式]
### 方式 1在 Ubuntu 中安装 Vivaldi [GUI 方式]
好消息是Vivaldi 提供了预先构建好的安装包,包括 Ubuntu/Debian 的 DEB 文件,以及 Fedora、Red Hat、SUSE 的 RPM 文件
好消息是Vivaldi 提供了预先构建好的安装包,包括 Ubuntu/Debian 的 DEB 文件,以及 Fedora、Red Hat、SUSE 的 RPM 文件
它支持 32 位和 64 位平台,也支持 [像树莓派之类的 ARM 设备][4]。
@ -46,7 +48,7 @@
前往 Vivaldi 的下载页面,下载支持 Ubuntu 的 DEB 格式安装包。
[下载 Vivaldi][6]
- [下载 Vivaldi][6]
![下载支持 Ubuntu/Debian 的 DEB 安装包][7]
@ -60,11 +62,11 @@
![点击安装按钮][10]
将需要输入系统账户的密码输入密码授权后Vivaldi 很快就能完成安装,随后安装按钮也变成了移除按钮。这表明 Vivaldi 已经安装完成了。
将需要输入系统账户的密码输入密码授权后Vivaldi 很快就能完成安装,随后安装按钮也变成了移除按钮。这表明 Vivaldi 已经安装完成了。
#### 第 3 步:使用 Vivaldi
按下 SuperWindows键打开系统菜单搜索 Vivaldi然后单击 Vivaldi 的图标。
按下 `Super``Windows`)键打开系统菜单,搜索 Vivaldi然后单击 Vivaldi 的图标。
![在系统菜单中搜索 Vivaldi][11]
@ -76,7 +78,7 @@
### 方式 2借助终端在 Ubuntu/Debian 上安装 Vivaldi
打开终端,确认你已经安装了用于 [在命令行下下载文件][13] 的 wget。
打开终端,确认你已经安装了用于 [在命令行下下载文件][13] 的 `wget`
```
sudo apt install wget
@ -116,13 +118,13 @@ GUI 和命令行这两种方式都会在系统里添加 Vivaldi 的仓库。这
如果你不喜欢 Vivaldi 或者不再使用,你可以直接卸载。现在,如果你想 [在 Ubuntu 中卸载软件][17],你可能会想到软件中心,但软件中心不会查找到外部和第三方的软件包。
目前你必须使用终端卸载 Vivaldi即便你使用 GUI 方式安装。其实这也很简单,打开终端,输入以下命令:
目前你必须使用终端卸载 Vivaldi即便你使用 GUI 方式安装。其实这也很简单,打开终端,输入以下命令:
```
sudo apt remove vivaldi-stable
```
sudo 会 [在 Ubuntu 中给予你 root 权限][18]。你需要输入当前账户的密码。输入密码时,你可能不会在屏幕上看见输入密码的痕迹。这是正常现象,直接输入密码即可,随后 Vivaldi 将被卸载。
`sudo` 会 [在 Ubuntu 中给予你 root 权限][18]。你需要输入当前账户的密码。输入密码时,你可能不会在屏幕上看见输入密码的痕迹。这是正常现象,直接输入密码即可,随后 Vivaldi 将被卸载。
希望这篇关于如何在 Linux 安装 Vivaldi 的教程对你有用。
@ -132,8 +134,8 @@ via: https://itsfoss.com/install-vivaldi-ubuntu-linux/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
译者:[imgradeone](https://github.com/imgradeone)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,113 @@
[#]: subject: "What is a hostname?"
[#]: via: "https://opensource.com/article/21/10/what-hostname"
[#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13897-1.html"
浅谈主机名
======
> 主机名是人类用来指代特定计算机的标签。
![](https://img.linux.net.cn/data/attachment/album/202110/19/134329lwni9tlq9h3u4f4o.jpg)
计算机有网络地址,但人类通常很难记住它们。主机名是帮助人类参考特定计算机的标签。例如,你可能不会导航到 `192.168.1.4`,而是导航到 `linuxlaptop``linuxlaptop.local`
### 地址和名称
所有联网的计算机(也被称为<ruby>主机<rt>host</rt></ruby>)都需要一个地址:一个与之相关的唯一数字,以使数据报文能够在它们之间进行正确的数据通信。这就是所谓的<ruby>互联网协议<rt>Internet Protocol</rt></ruby>IP地址。数字 `54.204.39.132` 是一个<ruby>互联网协议第四版<rt>Internet Protocol version 4</rt></ruby>IPv4地址。较新的 IPv6 地址要长得多,像这样:`2001:0db6:3c4d:0017:0000:0000:2a2f:1a2b`。 哇!这将是很难记住的!
```
$ ip addr show
```
计算机也可以被赋予标签。被称为<ruby>主机名<rt>hostname</rt></ruby>,这些是友好的名称,便于参考。我可以把我的计算机的主机名设置为 `copperhead`。只要这个名字在网络上是唯一的,所有其他用户和计算机都可以把 `copperhead` 作为地址,而不是 IP 地址。
```
$ hostname -s
```
你可以更新你的计算机的主机名。
阅读 Seth Kenlon 的文章 [如何在 Linux 上更改主机名][2],了解如何在 Linux 上这样做。
#### 完全限定域名
从技术上讲,主机名包括一个域名。如果我的域名是 `mycompany.com`,那么我的计算机的主机名是 `copperhead.mycompany.com`,以句点分隔。这就形成了一个<ruby>完全限定域名<rt>fully qualified domain name</rt></ruby>FQDN。这很重要因为 IP 地址可以解析为 FQDN。
```
host.domain.topleveldomain
```
例如:`www.example.com` 是一个完全限定域名。
你的域名一般已经确定了,所以你只负责提供主机部分。本文的重点是主机。
#### 名称解析
将 IP 地址转换为相应的主机名的过程被称为名称解析。这个过程首先发生在本地主机表中。Linux 使用文件 `/etc/hosts` 来存储这个表。
```
cat /etc/hosts
```
还有一个分层的、去中心化的基于网络的系统提供解析,称为<ruby>域名系统<rt>Domain Name System</rt></ruby>DNS。这时 FQDN 变得非常重要。
```
$ dig www.opensource.com
```
### 名称的乐趣
为我们的计算机起名字可能很有趣。如果你有很多,你可以使用一个主题。我曾经为一家公司工作,该公司将所有的服务器都以蛇命名。
后来我工作的一家公司,我是一个数据中心经理,使用啤酒品牌。当我们收到一个新的服务器时,这很令人兴奋,因为我会给开发团队发邮件征求建议。我们大约有 100 台服务器。这些提供了一个有趣的清单,反映了公司的多样性。我们有从库尔斯和百威到阿姆斯特尔和浅粉象的一切。我们有虎牌啤酒、胜狮啤酒和札幌啤酒等等!
我们认为这很酷!然后,想象一下,当你试图记住卢云堡是拥有最多内存的虚拟化服务器,佩罗尼是 SQL 数据库服务器,喜力是新的域控制器时,会发生什么,特别是对于一个快速发展的公司的新员工。
### 惯例
当然,主机名是所有者的选择,所以请尽情发挥。然而,根据环境的不同,使用容易记忆的名字或基于命名惯例的名字可能更有意义,因为这些名字有利于描述主机。
#### 有用的名字
如果你想放弃有趣的东西,并对你的系统进行有益的命名,也许可以考虑它们的功能。数据库服务器可以被命名为 `database1`、`database2`、`database3` 等等。Web 服务器可以命名为 `webserver1`、`webserver2` 等等。
#### 位置名称
我在许多客户那里使用了一种技术用一组字符的位置来命名服务器主机这些字符描述了该系统的一个方面有助于识别。例如如果我正在为内政部DOI开发一个业务流程管理BPM系统我就会在命名规则中加入他们的缩写词。
此外,就像许多大型企业、金融机构和政府一样,他们可能有不同的数据中心,位于不同的地理位置,以达到性能或灾难恢复的目的。因此,比如说,位于北美大陆东海岸的数据中心被称为 EDEast Data center而位于西海岸的数据中心则是 WDWest Data center
所有这些信息将汇集到一个名称中,如 `doibpm1ed``doibpm1wd`。因此,虽然这些名字看起来不长,但在这个项目上工作的人可以很容易地识别它们的目的和位置,而且这个名字甚至可以对潜在的恶意者混淆它们的用途。换句话说,业主可以选择只对内部人员有意义的命名方式
### 互联网标准
有几个标准管理着主机名。你可以在<ruby>互联网工程任务组<rt>Internet Engineering Task Force</rt></ruby>IETF维护的<ruby>意见征求<rt>Requests for Comment</rt></ruby>RFC中找到这些标准。由此请遵守以下规定
* 主机名的长度应该在 1 到 63 个 ASCII 字符之间
* 一个 FQDN 的最大长度为 253 个 ASCII 字符
* 不区分大小写
* 允许的字符:`a` 到 `z``0` 到 `9``-`(连字符),和 `_`(下划线)。
我希望这篇文章能帮助你澄清主机名。玩得开心,发挥创意。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/10/what-hostname
作者:[Alan Formy-Duval][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://opensource.com/users/alanfdoss
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_screen_windows_files.png?itok=kLTeQUbY (Computer screen with files or windows open)
[2]: https://opensource.com/article/21/10/how-change-hostname-linux

View File

@ -0,0 +1,92 @@
[#]: subject: "Seahorse: Manage Your Passwords & Encryption Keys in Linux"
[#]: via: "https://itsfoss.com/seahorse/"
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13884-1.html"
Seahorse在 Linux 中管理你的密码和加密密钥
======
![](https://img.linux.net.cn/data/attachment/album/202110/15/120409ltfmw33c5xpw5bcx.jpg)
> Seahorse 是一个简洁的开源密码和加密密钥管理器,让我们来探讨一下它的功能和如何安装它。
我们经常倾向于忽视许多默认/预装的应用,尤其是在内置了大量工具和实用程序时。
你可以在各种 Linux 发行版上使用的这样一个有用的工具是 **GNOME 的 Seahorse**
### SeahorseGNOME 的密码及加密密钥管理器
![][1]
主要来说Seahorse 是一个预装在 GNOME 桌面的应用,并为其量身定做。
然而,你可以在你选择的任何 Linux 发行版上使用它。它是一个简单而有效的工具,可以在本地管理你的密码和加密密钥/钥匙环。
如果你是第一次使用,你可能想读一下 [Linux 中钥匙环的概念][2]。
如果你不喜欢基于云的密码管理器Seahorse 可以很好地解决你的要求。尽管它看起来很简单,但有几个基本功能你可能会觉得很有用。
当然,如果你的不太涉及管理加密密钥(或本地存储),你也应该探索一些 [可用于 Linux 的最佳密码管理器][3] 。
### Seahorse 的特点
虽然你可以很容易地把它作为一个本地(离线)密码管理器,但在处理加密密钥时,你也可以用 Seahorse 做一些事情来加强你的安全管理。
![][4]
一些关键的亮点是:
* 能够存储 SSH 密钥(用于访问远程计算机/服务器)
* 存储用于保护电子邮件和文件的 GPG 密钥
* 支持为应用和网络添加密码钥匙环
* 安全地存储证书的私钥
* 存储一个密码/密语
* 能够导入文件并快速存储它们
* 查找远程密钥
* 同步和发布密钥
* 能够查找/复制 VPN 密码
![][5]
### 在 Linux 中安装 Seahorse
如果你使用的是基于 GNOME 的发行版,你应该已经安装了它。你可以搜索 “Seahorse” 或者 “Passwords” 来找到它。
在其他情况下,你可以在软件中心搜索到它。根据我的快速测试,它在 KDE、LXQt 和不同的桌面环境下应该可以正常工作。
![][6]
此外,你可以找到它的 [Flatpak 包][7]。所以,无论你使用的是哪种 Linux 发行版,都可以安装 Seahorse。
如果你使用的是 Arch Linux你也应该在 [AUR][8] 中找到它。
- [Seahorse][9]
你对使用 Seahorse 来取代其他密码管理器有何看法?你是否已经用它来管理加密密钥?请在下面的评论中告诉我你的想法。
--------------------------------------------------------------------------------
via: https://itsfoss.com/seahorse/
作者:[Ankush Das][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://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/seahorse-password-keys.png?resize=800%2C613&ssl=1
[2]: https://itsfoss.com/ubuntu-keyring/
[3]: https://itsfoss.com/password-managers-linux/
[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/seahorse-login.png?resize=800%2C583&ssl=1
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/seahorse-keys.png?resize=800%2C579&ssl=1
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/seahorse-software.png?resize=800%2C508&ssl=1
[7]: https://www.flathub.org/apps/details/org.gnome.seahorse.Application
[8]: https://itsfoss.com/aur-arch-linux/
[9]: https://wiki.gnome.org/Apps/Seahorse/

View File

@ -0,0 +1,83 @@
[#]: subject: "5 markdown editors I recommend trying"
[#]: via: "https://opensource.com/article/21/10/markdown-editors"
[#]: author: "Don Watkins https://opensource.com/users/don-watkins"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13904-1.html"
我推荐尝试的 5 个 Markdown 编辑器
======
> 每个人都有自己喜欢的 Markdown 编辑器。这里有几个我已经试过的。
![](https://img.linux.net.cn/data/attachment/album/202110/21/095837n8q1s3hqc1og1fsq.jpg)
你可以用 Markdown 做任何事情:给网站排版、编写书籍和撰写技术文档只是它的一些用途。我喜欢它创建富文本文档可以如此简单。每个人都有自己喜欢的 Markdown 编辑器。在我的 Markdown 之旅中,我使用了好几个。下面是我考虑过的五个 Markdown 编辑器。
### Abricotine
[Abricotine][2] 是一个在 [GPLv][3] 下发布的开源编辑器。你可以手动输入格式,或者使用菜单插入 [GitHub 风格的 Markdown][4]。Abricotine 允许你在输入时预览文本元素,如标题、图片、数学、嵌入式视频和待办事项。该编辑器只能将文件导出为 HTML。你可以在 Linux、macOS 和 Windows 上使用 Abricotine。
![Abricontine][5]
### MarkText
[MarkText][7] 是一个简单的 Markdown 编辑器。它有很多功能,而且在处理 Markdown 格式的文件方面做得很好。MarkText 也支持 GitHub 风格的 Markdown它允许你添加表格和带有语法高亮的代码块。它支持实时预览并且有一个简单的界面。MarkText 是在 [MIT][8] 下授权的。它支持 HTML 和 PDF 格式的输出。MarkText 可以在 Linux、macOS 和 Windows 上使用。
![MarkText][9]
### Ghostwriter
[Ghostwriter][10] 是一个用于 Linux 和 Windows 的 Markdown 编辑器。根据其网站用户的说法。“享受无干扰的写作体验,包括全屏模式和简洁的界面。有了 Markdown你可以现在写以后再格式化”。它有内置的默认的浅色和深色主题或者你可以自己编写。你可以将文件实时按 HTML 预览你可以直接复制和粘贴到博客中或导出为其他格式。Ghostwriter 是在 [GPLv3][11] 下发布的。
![Ghostwriter][12]
### Atom
[Atom][13] 被称为 21 世纪的可自定义文本编辑器。它也可以作为一个 Markdown 编辑器使用。它可以在 Linux、Windows 和 macOS上运行并以 [MIT][14] 许可证发布。它支持 GitHub 风格的 Markdown并且按下 `Ctrl+Shift+M` 可以打开一个预览面板,这样你就可以轻松地看到 HTML 预览。你可以通过创建一个文件并以 `.md` 文件扩展名保存来轻松入门。这告诉 Atom 它是一个 Markdown 文件。Atom 会自动应用正确的包和语法高亮。
![Atom][15]
### VSCodium
[VSCodium][16] 是微软的 VSCode 编辑器的自由开源版本,没有内置在微软产品中的遥测技术。它以 [MIT][17] 许可证发布,并提供了 VSCode 的所有功能而没有专有特性。除了其他功能外VSCodium 还可以作为一个 Markdown 编辑器。创建一个新文件,点击 “选择一个语言”,选择 “Markdown”然后开始写你的代码。通过按 `Ctrl-Shift+V` 轻松预览文本,然后再切换回编辑器。你也可以通过添加一个扩展来轻松地扩展 Markdown 编辑器。我最喜欢的插件是 [Markdown editor][18],它是 [MIT][19] 许可证。
![VSCodium][20]
你最喜欢的 Markdown 编辑器是什么? 让我们在评论中知道。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/10/markdown-editors
作者:[Don Watkins][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://opensource.com/users/don-watkins
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-docdish-typewriter-pink.png?itok=OXJBtyYf (A pink typewriter)
[2]: https://abricotine.brrd.fr/
[3]: https://github.com/brrd/abricotine/blob/develop/LICENSE
[4]: https://guides.github.com/features/mastering-markdown/
[5]: https://opensource.com/sites/default/files/uploads/1_abricontine.png (Abricontine)
[6]: https://creativecommons.org/licenses/by-sa/4.0/
[7]: https://marktext.app/
[8]: https://github.com/marktext/marktext/blob/develop/LICENSE
[9]: https://opensource.com/sites/default/files/uploads/2_marktext.png (MarkText)
[10]: https://wereturtle.github.io/ghostwriter/
[11]: https://github.com/wereturtle/ghostwriter/blob/master/COPYING
[12]: https://opensource.com/sites/default/files/uploads/3_ghostwriter.png (Ghostwriter)
[13]: https://atom.io/
[14]: https://github.com/atom/atom/blob/master/LICENSE.md
[15]: https://opensource.com/sites/default/files/uploads/4_atom.png (Atom)
[16]: https://vscodium.com/
[17]: https://github.com/VSCodium/vscodium/blob/master/LICENSE
[18]: https://github.com/zaaack/vscode-markdown-editor
[19]: https://github.com/zaaack/vscode-markdown-editor/blob/master/LICENSE
[20]: https://opensource.com/sites/default/files/uploads/5_vscodium.png (VSCodium)

View File

@ -0,0 +1,405 @@
[#]: subject: "5 common bugs in C programming and how to fix them"
[#]: via: "https://opensource.com/article/21/10/programming-bugs"
[#]: author: "Jim Hall https://opensource.com/users/jim-hall"
[#]: collector: "lujun9972"
[#]: translator: "unigeorge"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13894-1.html"
C 语言编程中的 5 个常见错误及对应解决方案
======
> 增强 C 语言程序的弹性和可靠性的五种方法。
![](https://img.linux.net.cn/data/attachment/album/202110/18/174123p4cz99skp9zz4nf4.jpg)
即使是最好的程序员也无法完全避免错误。这些错误可能会引入安全漏洞、导致程序崩溃或产生意外操作,具体影响要取决于程序的运行逻辑。
C 语言有时名声不太好,因为它不像近期的编程语言(比如 Rust那样具有内存安全性。但是通过额外的代码一些最常见和严重的 C 语言错误是可以避免的。下文讲解了可能影响应用程序的五个错误以及避免它们的方法:
### 1、未初始化的变量
程序启动时,系统会为其分配一块内存以供存储数据。这意味着程序启动时,变量将获得内存中的一个随机值。
有些编程环境会在程序启动时特意将内存“清零”,因此每个变量都得以有初始的零值。程序中的变量都以零值作为初始值,听上去是很不错的。但是在 C 编程规范中,系统并不会初始化变量。
看一下这个使用了若干变量和两个数组的示例程序:
```
#include <stdio.h>
#include <stdlib.h>
int
main()
{
int i, j, k;
int numbers[5];
int *array;
puts("These variables are not initialized:");
printf(" i = %d\n", i);
printf(" j = %d\n", j);
printf(" k = %d\n", k);
puts("This array is not initialized:");
for (i = 0; i < 5; i++) {
printf(" numbers[%d] = %d\n", i, numbers[i]);
}
puts("malloc an array ...");
array = malloc(sizeof(int) * 5);
if (array) {
puts("This malloc'ed array is not initialized:");
for (i = 0; i < 5; i++) {
printf(" array[%d] = %d\n", i, array[i]);
}
free(array);
}
/* done */
puts("Ok");
return 0;
}
```
这个程序不会初始化变量,所以变量以系统内存中的随机值作为初始值。在我的 Linux 系统上编译和运行这个程序,会看到一些变量恰巧有“零”值,但其他变量并没有:
```
These variables are not initialized:
i = 0
j = 0
k = 32766
This array is not initialized:
numbers[0] = 0
numbers[1] = 0
numbers[2] = 4199024
numbers[3] = 0
numbers[4] = 0
malloc an array ...
This malloc'ed array is not initialized:
array[0] = 0
array[1] = 0
array[2] = 0
array[3] = 0
array[4] = 0
Ok
```
很幸运,`i` 和 `j` 变量是从零值开始的,但 `k` 的起始值为 32766。在 `numbers` 数组中,大多数元素也恰好从零值开始,只有第三个元素的初始值为 4199024。
在不同的系统上编译相同的程序,可以进一步显示未初始化变量的危险性。不要误以为“全世界都在运行 Linux”你的程序很可能某天在其他平台上运行。例如下面是在 FreeDOS 上运行相同程序的结果:
```
These variables are not initialized:
i = 0
j = 1074
k = 3120
This array is not initialized:
numbers[0] = 3106
numbers[1] = 1224
numbers[2] = 784
numbers[3] = 2926
numbers[4] = 1224
malloc an array ...
This malloc'ed array is not initialized:
array[0] = 3136
array[1] = 3136
array[2] = 14499
array[3] = -5886
array[4] = 219
Ok
```
永远都要记得初始化程序的变量。如果你想让变量将以零值作为初始值,请额外添加代码将零分配给该变量。预先编好这些额外的代码,这会有助于减少日后让人头疼的调试过程。
### 2、数组越界
C 语言中,数组索引从零开始。这意味着对于长度为 10 的数组,索引是从 0 到 9长度为 1000 的数组,索引则是从 0 到 999。
程序员有时会忘记这一点,他们从索引 1 开始引用数组,产生了<ruby>“大小差一”<rt>off by one</rt></ruby>错误。在长度为 5 的数组中程序员在索引“5”处使用的值实际上并不是数组的第 5 个元素。相反,它是内存中的一些其他值,根本与此数组无关。
这是一个数组越界的示例程序。该程序使用了一个只含有 5 个元素的数组,但却引用了该范围之外的数组元素:
```
#include <stdio.h>
#include <stdlib.h>
int
main()
{
int i;
int numbers[5];
int *array;
/* test 1 */
puts("This array has five elements (0 to 4)");
/* initalize the array */
for (i = 0; i < 5; i++) {
numbers[i] = i;
}
/* oops, this goes beyond the array bounds: */
for (i = 0; i < 10; i++) {
printf(" numbers[%d] = %d\n", i, numbers[i]);
}
/* test 2 */
puts("malloc an array ...");
array = malloc(sizeof(int) * 5);
if (array) {
puts("This malloc'ed array also has five elements (0 to 4)");
/* initalize the array */
for (i = 0; i < 5; i++) {
array[i] = i;
}
/* oops, this goes beyond the array bounds: */
for (i = 0; i < 10; i++) {
printf(" array[%d] = %d\n", i, array[i]);
}
free(array);
}
/* done */
puts("Ok");
return 0;
}
```
可以看到,程序初始化了数组的所有值(从索引 0 到 4然后从索引 0 开始读取,结尾是索引 9 而不是索引 4。前五个值是正确的再后面的值会让你不知所以
```
This array has five elements (0 to 4)
  numbers[0] = 0
  numbers[1] = 1
  numbers[2] = 2
  numbers[3] = 3
  numbers[4] = 4
  numbers[5] = 0
  numbers[6] = 4198512
  numbers[7] = 0
  numbers[8] = 1326609712
  numbers[9] = 32764
malloc an array ...
This malloc'ed array also has five elements (0 to 4)
  array[0] = 0
  array[1] = 1
  array[2] = 2
  array[3] = 3
  array[4] = 4
  array[5] = 0
  array[6] = 133441
  array[7] = 0
  array[8] = 0
  array[9] = 0
Ok
```
引用数组时,始终要记得追踪数组大小。将数组大小存储在变量中;不要对数组大小进行<ruby>硬编码<rt>hard-code</rt></ruby>。否则,如果后期该标识符指向另一个不同大小的数组,却忘记更改硬编码的数组长度时,程序就可能会发生数组越界。
### 3、字符串溢出
字符串只是特定类型的数组。在 C 语言中,字符串是一个由 `char` 类型值组成的数组,其中用一个零字符表示字符串的结尾。
因此,与数组一样,要注意避免超出字符串的范围。有时也称之为 _字符串溢出_
使用 `gets` 函数读取数据是一种很容易发生字符串溢出的行为方式。`gets` 函数非常危险,因为它不知道在一个字符串中可以存储多少数据,只会机械地从用户那里读取数据。如果用户输入像 `foo` 这样的短字符串,不会发生意外;但是当用户输入的值超过字符串长度时,后果可能是灾难性的。
下面是一个使用 `gets` 函数读取城市名称的示例程序。在这个程序中,我还添加了一些未使用的变量,来展示字符串溢出对其他数据的影响:
```
#include <stdio.h>
#include <string.h>
int
main()
{
char name[10]; /* Such as "Chicago" */
int var1 = 1, var2 = 2;
/* show initial values */
printf("var1 = %d; var2 = %d\n", var1, var2);
/* this is bad .. please don't use gets */
puts("Where do you live?");
gets(name);
/* show ending values */
printf("<%s> is length %d\n", name, strlen(name));
printf("var1 = %d; var2 = %d\n", var1, var2);
/* done */
puts("Ok");
return 0;
}
```
当你测试类似的短城市名称时,该程序运行良好,例如伊利诺伊州的 `Chicago` 或北卡罗来纳州的`Raleigh`
```
var1 = 1; var2 = 2
Where do you live?
Raleigh
<Raleigh> is length 7
var1 = 1; var2 = 2
Ok
```
威尔士的小镇 `Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch` 有着世界上最长的名字之一。这个字符串有 58 个字符,远远超出了 `name` 变量中保留的 10 个字符。结果,程序将值存储在内存的其他区域,覆盖了 `var1``var2` 的值:
```
var1 = 1; var2 = 2
Where do you live?
Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch
<Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch> is length 58
var1 = 2036821625; var2 = 2003266668
Ok
Segmentation fault (core dumped)
```
在运行结束之前,程序会用长字符串覆盖内存的其他部分区域。注意,`var1` 和 `var2` 的值不再是起始的 `1``2`
避免使用 `gets` 函数,改用更安全的方法来读取用户数据。例如,`getline` 函数会分配足够的内存来存储用户输入,因此不会因输入长值而发生意外的字符串溢出。
### 4、重复释放内存
“分配的内存要手动释放”是良好的 C 语言编程原则之一。程序可以使用 `malloc` 函数为数组和字符串分配内存,该函数会开辟一块内存,并返回一个指向内存中起始地址的指针。之后,程序可以使用 `free` 函数释放内存,该函数会使用指针将内存标记为未使用。
但是,你应该只使用一次 `free` 函数。第二次调用 `free` 会导致意外的后果,可能会毁掉你的程序。下面是一个针对此点的简短示例程序。程序分配了内存,然后立即释放了它。但为了模仿一个健忘但有条理的程序员,我在程序结束时又一次释放了内存,导致两次释放了相同的内存:
```
#include <stdio.h>
#include <stdlib.h>
int
main()
{
int *array;
puts("malloc an array ...");
array = malloc(sizeof(int) * 5);
if (array) {
puts("malloc succeeded");
puts("Free the array...");
free(array);
}
puts("Free the array...");
free(array);
puts("Ok");
}
```
运行这个程序会导致第二次使用 `free` 函数时出现戏剧性的失败:
```
malloc an array ...
malloc succeeded
Free the array...
Free the array...
free(): double free detected in tcache 2
Aborted (core dumped)
```
要记得避免在数组或字符串上多次调用 `free`。将 `malloc``free` 函数定位在同一个函数中,这是避免重复释放内存的一种方法。
例如,一个纸牌游戏程序可能会在主函数中为一副牌分配内存,然后在其他函数中使用这副牌来玩游戏。记得在主函数,而不是其他函数中释放内存。将 `malloc``free` 语句放在一起有助于避免多次释放内存。
### 5、使用无效的文件指针
文件是一种便捷的数据存储方式。例如,你可以将程序的配置数据存储在 `config.dat` 文件中。Bash shell 会从用户家目录中的 `.bash_profile` 读取初始化脚本。GNU Emacs 编辑器会寻找文件 `.emacs` 以从中确定起始值。而 Zoom 会议客户端使用 `zoomus.conf` 文件读取其程序配置。
所以,从文件中读取数据的能力几乎对所有程序都很重要。但是假如要读取的文件不存在,会发生什么呢?
在 C 语言中读取文件,首先要用 `fopen` 函数打开文件,该函数会返回指向文件的流指针。你可以结合其他函数,使用这个指针来读取数据,例如 `fgetc` 会逐个字符地读取文件。
如果要读取的文件不存在或程序没有读取权限,`fopen` 函数会返回 `NULL` 作为文件指针,这表示文件指针无效。但是这里有一个示例程序,它机械地直接去读取文件,不检查 `fopen` 是否返回了 `NULL`
```
#include <stdio.h>
int
main()
{
FILE *pfile;
int ch;
puts("Open the FILE.TXT file ...");
pfile = fopen("FILE.TXT", "r");
/* you should check if the file pointer is valid, but we skipped that */
puts("Now display the contents of FILE.TXT ...");
while ((ch = fgetc(pfile)) != EOF) {
printf("<%c>", ch);
}
fclose(pfile);
/* done */
puts("Ok");
return 0;
}
```
当你运行这个程序时,第一次调用 `fgetc` 会失败,程序会立即中止:
```
Open the FILE.TXT file ...
Now display the contents of FILE.TXT ...
Segmentation fault (core dumped)
```
始终检查文件指针以确保其有效。例如,在调用 `fopen` 打开一个文件后,用类似 `if (pfile != NULL)` 的语句检查指针,以确保指针是可以使用的。
人都会犯错,最优秀的程序员也会产生编程错误。但是,遵循上面这些准则,添加一些额外的代码来检查这五种类型的错误,就可以避免最严重的 C 语言编程错误。提前编写几行代码来捕获这些错误,可能会帮你节省数小时的调试时间。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/10/programming-bugs
作者:[Jim Hall][a]
选题:[lujun9972][b]
译者:[unigeorge](https://github.com/unigeorge)
校对:[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/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bug_software_issue_tracking_computer_screen.jpg?itok=6qfIHR5y (Bug tracking magnifying glass on computer screen)
[2]: http://www.opengroup.org/onlinepubs/009695399/functions/puts.html
[3]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html
[4]: http://www.opengroup.org/onlinepubs/009695399/functions/malloc.html
[5]: http://www.opengroup.org/onlinepubs/009695399/functions/free.html
[6]: http://www.opengroup.org/onlinepubs/009695399/functions/gets.html
[7]: http://www.opengroup.org/onlinepubs/009695399/functions/strlen.html
[8]: http://www.opengroup.org/onlinepubs/009695399/functions/fopen.html
[9]: http://www.opengroup.org/onlinepubs/009695399/functions/fgetc.html
[10]: http://www.opengroup.org/onlinepubs/009695399/functions/fclose.html

View File

@ -0,0 +1,126 @@
[#]: subject: "KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements"
[#]: via: "https://news.itsfoss.com/kde-plasma-5-23-release/"
[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/"
[#]: collector: "lujun9972"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13885-1.html"
纪念 25 周年KDE Plasma 5.23 发布
======
![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/kde-plasma-5-23-ft.png?w=1200&ssl=1)
多年来KDE Plasma 一直是最常用的桌面环境之一。这是因为它似乎有无穷无尽的定制选项、华丽的外观和有料的更新。
随着 KDE Plasma 5.23 的发布,这个桌面环境已经工作了 25 年。因此,这个版本也被称为 “Plasma 25 周年版”。
让我们回想一下1996 年 10 月 14 日KDE 的创始人 Matthias Ettrich [向一个新闻组][1] 发出了呼唤,为他的 “<ruby>Kool 桌面环境<rt>Kool Desktop Environment</rt></ruby>KDE” 项目寻求其他程序员的帮助。
而你看KDE 现在呢?
在这次更新中,我们可以看到包括 Plasma 内部和第三方应用程序在内的一些重大 UI 改进。
### KDE Plasma 5.23: 有什么新东西?
这次更新带来了许多改进,包括:
* 桌面重点颜色
* 新的 Breeze 主题
* 新的电源管理快速控制
* 应用程序启动器有更多的自定义选项
* 数以百计的错误修复
在这里,我们将看到所有这些新的改进:
![视频](https://youtu.be/RMXViPlehAo)
#### 桌面重点颜色
![][3]
在系统设置中,你会发现有一个可以改变你的桌面重点颜色的选项,你可以选择一个你喜欢的自定义颜色或与默认应用的主题相融合的颜色。
#### 新的 Breeze 主题
![][4]
这次更新带来了全新的 Breeze 主题Breeze - Blue Ocean。默认主题经过多年的改进这一次它侧重于使视觉效果更加清晰和易于识别。
总的来说,新的主题提供了顺滑的外观。除了主题之外,图标也变得更加突出;增加了一个加载齿轮图标。而且,许许多多这样的细微变化已经进入了 KDE Plasma 5.23,以增强桌面的外观和感觉。
正如开发者 Nate Graham 在测试版发布时所说:
> 还有很多时间可以根据需要调整最终的外观,但总的来说,我认为它真的很棒了,我希望你和我一样喜欢它。
#### 系统设置中增强的搜索功能
为了更容易找到你要找的东西KDE Plasma 5.23 增加了更多的关键词组合,以使你使用搜索栏寻找时可以快速提示你相关设置。
#### 系统托盘的改进
![][5]
虽然系统托盘已经提供了许多控制,但现在监控你连接的网络以及访问剪贴板有了更精细的选项。
系统托盘也改进了显示正在播放的活动媒体时的整体外观。
#### 新的电源管理快速控制
随着 Linux 5.12 的发布增加了一个电源管理功能。现在KDE 引入了一种简单的调整方式,它出现在新的快速控制中。
它有三个选项:节电、平衡和性能。只需要一次点击就可以节省电池电力并根据需要调整性能。
#### 应用程序启动器的改进
![][6]
在 Plasma 5.21 中KDE 引入了一个新的应用程序启动器,叫做 Kickoff。虽然它受到了普遍欢迎但一些用户也抱怨与旧的启动器相比自定义选项较少。
好在 Plasma 5.23 解决了这个问题,为 Kickoff 引入了一些全新的自定义选项。这些选项包括以下能力:
* 图标化电源和用户控件
* 所有项目都采用选择列表或网格视图,而不仅仅是收藏夹菜单
* 新的键盘快捷键 `CTRL+F` 可以快速聚焦到搜索栏
* 在右上角添加了一个新的按针状按钮,以保持应用程序启动器处于活动状态
总的来说,我预计用户会相当受欢迎这些新选项,特别是那些因为它有如此之多的定制选项而使用 KDE 的用户。
### 其他改进措施
其他的常规改进包括:
* 优化了 Wayland 会话
* 通过“反馈”程序提高了数据透明度
* 改进了 KDE 的 Discover应用中心的性能
要探索更多关于该版本的信息,你可以查看 [官方公告][7] 及其 [更新日志][8]。
### 总结
虽然不是有史以来最大的版本,但这是一个重要的版本,具有纪念其 25 周年的宝贵补充。像往常一样,你应该在未来几个月内的某个时候收到更新,这取决于你的发行版。
你对 KDE Plasma 5.23 的改进有什么看法?请在下面的评论中告诉我。
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/kde-plasma-5-23-release/
作者:[Jacob Crume][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/jacob/
[b]: https://github.com/lujun9972
[1]: https://groups.google.com/g/de.comp.os.linux.misc/c/SDbiV3Iat_s/m/zv_D_2ctS8sJ?pli=1
[2]: https://i0.wp.com/i.ytimg.com/vi/RMXViPlehAo/hqdefault.jpg?w=780&ssl=1
[3]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/system-settings-accent-colour.png?w=743&ssl=1
[4]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/breeze-application-style.png?w=368&ssl=1
[5]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/plasma-nm.png?w=466&ssl=1
[6]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/kickoff.png?w=699&ssl=1
[7]: https://kde.org/announcements/plasma/5/5.23.0/
[8]: https://kde.org/announcements/changelogs/plasma/5/5.22.5-5.23.0/

View File

@ -0,0 +1,135 @@
[#]: subject: "Ubuntu 21.10 is Available Now! Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist"
[#]: via: "https://news.itsfoss.com/ubuntu-21-10-release/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13887-1.html"
Ubuntu 21.10 版现已发布!终于带来了 Ubuntu 特色的 GNOME 40
======
![](https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/ubuntu-21-10-release-date.png?w=1200&ssl=1)
> Ubuntu 21.10 是一个激动人心的版本,包含了 GNOME 40 和几个显著的变化。准备已经驶向了 Ubuntu 22.04 LTS 吗?
Ubuntu 21.10 是下一个大型 LTS 更新之前的最后一个非 LTS 版本。代号为 Impish Indri 的 Ubuntu 21.10 将被支持**九个月,直到 2022 年 7 月**。
除非你想尝试最新和最棒的功能,否则你应该坚持使用 Ubuntu 20.04 LTS 并等待 Ubuntu 22.04 LTS。
现在你可以下载 Ubuntu 21.10 并在你的系统上安装,让我重点介绍一下这次更新的几个亮点。
### Ubuntu 21.10 “Impish Indri” 有何新变化?
![][1]
Ubuntu 21.10 出炉时有几个重大变化。一些最有影响的改进包括:
* 新的安装程序
* 增加了 GNOME 40
* 抛弃了混合主题,选择了浅色/深色主题
* 包括 Linux 内核 5.13
* 加入了支持蓝牙 LDAC 的 PulseAudio 15
* 带有 Nvidia 专有驱动程序的 Wayland 会话
GNOME 40 可以说是 Ubuntu 中令人耳目一新的变化,但你只有在体验之后才能知道。为了让你快速感受一下,下面是这个版本中你可以期待的所有变化。
#### 粉饰一新的安装程序
![][2]
虽然 Ubuntu 的安装程序很容易使用,对新手也很友好,但 Canonical 希望通过对安装程序进行视觉和技术上的改造,使其更上一层楼。
开发团队利用 Flutter 使安装程序在所有其他 Ubuntu 口味和系统配置中保持一致。
![][3]
#### GNOME 40
![][5]
Ubuntu 的桌面体验与 GNOME 40 融为一体,没有提供任何混乱的布局。停靠区依然存在,水平活动概览也与之无缝衔接。
当然,[GNOME 40][4] 中的所有改进,如核心应用程序的更新、工作区的改变等等,都会延续到 Ubuntu 21.10 中,只是 Canonical 做了一些改动。
就我个人而言,我并不喜欢 GNOME 40 的工作流程,但你可能会想体验一下。
#### 主题的变化
![][9]
我喜欢改进后的颜色方案,其目的是为了更好地与 Canonical 的 Ubuntu 品牌相融合。
然而,当涉及到与应用程序和整体主题选择的一致性时,混合(标准)主题是有点问题的。
在 Ubuntu 21.10 中,你会看到深色和浅色主题,而浅色是开箱即用的默认选择。如果你想进一步了解,你可以阅读我们的 [过去的报道以更多了解这一变化][6]。
#### Linux 内核 5.13
Linux 内核 5.13 的加入增加了对未来的英特尔和 AMD 芯片的支持,以及对苹果 M1 的初步支持。
你可以就一步了解 [Linux 内核 5.13][7] 的信息,但总的来说,它应该给你更好的硬件兼容性。
#### PulseAudio 15 支持蓝牙 LDAC
考虑到现在有更多的蓝牙耳机支持 LDAC当你在桌面上使用 Ubuntu 21.10 时,你可以利用这一功能。
别担心,如果你不想尝试非 LTS 版本Ubuntu 22.04 LTS 将包括同样的改进。所以,你必须耐心等待,直到明年才能利用这一点。
除此之外PulseAudio 15 还带来了一系列的改进,你可以参考它的 [官方更新日志以了解更多信息][8] 。
#### Wayland 会话与 NVIDIA 专有驱动程序
现在,即使你使用 NVIDIA 专有的驱动程序,如果你需要也可以切换到 Wayland 会话。
#### Ubuntu 21.10 中的其他变化
![][14]
Ubuntu 21.10 版本为其云镜像、树莓派支持和安全性带来了一系列高质量的变化。
其中一些值得注意的变化包括:
* [Firefox 默认采用 Snap][10]
* LibreOffice、Thunderbird 更新
* Ubuntu Sever 的改进
* 新的 PHP 默认为 8.0.8
如果你想探索所有的技术细节,你可能想参考一下 [官方发布说明][11]。
### 下载并升级到 Ubuntu 21.10
你可以选择全新安装或使用软件升级器 [从 Ubuntu 21.04 升级][12] 到 Ubuntu 21.10。
请注意,如果你正在使用 Ubuntu 20.04 LTS建议等待下一个 LTS 版本,除非你知道自己在做什么。
- [下载Ubuntu 21.10][13]
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/ubuntu-21-10-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://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/ubuntu-21-10-full.png?w=1200&ssl=1
[2]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/02/new-ubuntu-installer.png?w=1012&ssl=1
[3]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/ubuntu-new-installer.png?w=960&ssl=1
[4]: https://news.itsfoss.com/gnome-40-release/
[5]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/ubuntu-21-10-new-gnome-40.png?resize=1568%2C776&ssl=1
[6]: https://news.itsfoss.com/ubuntu-21-10-theme-change/
[7]: https://news.itsfoss.com/linux-kernel-5-13-release/
[8]: https://www.freedesktop.org/wiki/Software/PulseAudio/Notes/15.0/
[9]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/ubuntu-21-10-appearance.png?w=1062&ssl=1
[10]: https://news.itsfoss.com/ubuntu-firefox-snap-default/
[11]: https://discourse.ubuntu.com/t/impish-indri-release-notes/21951
[12]: https://itsfoss.com/upgrade-ubuntu-to-newer-version/
[13]: https://releases.ubuntu.com/21.10/
[14]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/ubuntu-21-10-about.png?w=1054&ssl=1

View File

@ -0,0 +1,123 @@
[#]: subject: "How to Find and Kill Zombie Process in Linux"
[#]: via: "https://itsfoss.com/kill-zombie-process-linux/"
[#]: author: "Marco Carmona https://itsfoss.com/author/marco/"
[#]: collector: "lujun9972"
[#]: translator: "zengyi1001"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13919-1.html"
如何找到并杀掉 Linux 系统中的僵尸进程
======
![][5]
> 这是一个关于如何寻找 Linux 系统僵尸进程并杀死它们的小知识。你也可以从中了解到关于进程和僵尸进程的一些知识。
在了解僵尸进程之前,让我们来复习一下什么是 Linux 进程。
简而言之,[进程][1] 是一个程序的运行实例。它可能运行在前端(比如有交互的进程),也可能运行在后端(比如无交互或自动运行的进程)。它可能是一个父进程(运行期间创建了其他进程),也可能是一个子进程(由其他进程所创建)。
在 Linux 系统中,除 PID 为 0 的第一个 `init` 进程(或 `systemd`)外,其余进程都有父进程。进程也可以拥有自己的子进程。
不相信?可以试试在终端中使用 `pstree` 命令查看进程的树型结构,你能看到系统各个进程的“家族树”。
### Linux系统里的僵尸进程是什么
子进程死亡后,它的父进程会接收到通知去执行一些清理操作,如释放内存之类。然而,若父进程并未察觉到子进程死亡,子进程就会进入到“<ruby>僵尸<rt>zombie</rt></ruby>”状态。从父进程角度看,子进程仍然存在,即使子进程实际上已经死亡。这就是“<ruby>僵尸进程<rt>zombie process</rt></ruby>”(也被称为“<ruby>已消失进程<rt>defunct process</rt></ruby>”)是如何产生并存在于系统中的。
这里有一个来自 [Turnoff.us](https://turnoff.us/geek/zombie-processes/) 的关于僵尸进程的非常有趣的看法:
![Image credit: Turnoff.us][2]
### 你真的需要关心僵尸进程吗?
重点要说的是,僵尸进程并没有像它的名称那样看起来可怕。
但如果系统的内存已经所剩不多或者有太多的僵尸进程在吃掉内存,问题会变得糟糕。同样,大部分 Linux 系统进程最大 PID 设置为 32768如果过多僵尸进程导致其他重要任务没有 PID 可用,你的系统会发生崩溃。
这是真实可能发生的,它有一定的概率,特别当存在一个编码糟糕的程序开始大量产生僵尸进程的时候。
在这种情况下,找到并杀死僵尸进程是一个明智的做法。
### 如何找到僵尸进程
Linux 系统中的进程可能处于如下状态中的一种:
* `D` = 不可中断的休眠
* `I` = 空闲
* `R` = 运行中
* `S` = 休眠
* `T` = 被调度信号终止
* `t` = 被调试器终止
* `Z` = 僵尸状态
那如何查看进程和它的当前状态呢?一个简单的方法是在终端中使用 [top 命令][3]。
![Top command show processes and their status][4]
正如你在上面截图中看到的,截图中共有 250 个任务(进程),其中 1 个处在 “<ruby>运行中<rt>running</rt></ruby>” 状态248 个进程处于 “<ruby>休眠<rt>sleep</rt></ruby>” 状态,还有一个处于 “<ruby>僵尸<rt>zombie</rt></ruby>” 状态。
现在问题进入下一步,如何杀死 “僵尸” 进程?
### 如何找到并杀死一个僵尸进程?僵尸进程能被杀死吗?
僵尸进程已经死了,要如何才能杀死一个已经死亡的进程呢?
在僵尸电影中,你可以射击僵尸的头部或烧掉它们,但在这里是行不通的。你可以一把火烧了系统来杀死僵尸进程,但这并不是一个可行的方案。
一些人建议发送 `SIGCHLD` 给父进程,但这个信号很可能会被忽略。还有一个方法是杀死父进程来杀死僵尸进程,这听起来很野蛮,但它却是唯一能确保杀死僵尸进程的方法。
首先,通过在终端中 [使用 ps 命令][6] 我们列举僵尸进程,得到它们的进程 ID
```
ps ux | awk '{if($8=="Z+") print}'
```
`ps ux` 命令输出的第 8 列显示了进程状态。上述命令只会打印所有处在 Z+ 状态(表示僵尸状态)的进程。
确认了进程 ID 后,我们可以得到它的父进程 ID
```
ps -o ppid= -p <child_id>
```
你也可以将上述两个命令结合在一起,直接得到僵尸进程的 PID 及其父进程的 PID
```
ps -A -ostat,pid,ppid | grep -e '[zZ]'
```
现在你得到了父进程 ID使用命令行和得到的 ID 号 [终于可以杀死进程了][7]
```
kill -9 <parent_process_ID>
```
![Killing parent process][8]
再次运行 `ps` 命令或 `top` 命令,你可以验证僵尸进程是否已经被杀死。
恭喜!现在你知道怎么清理僵尸进程了。
--------------------------------------------------------------------------------
via: https://itsfoss.com/kill-zombie-process-linux/
作者:[Marco Carmona][a]
选题:[lujun9972][b]
译者:[zengyi1001](https://github.com/zengyi1001)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/marco/
[b]: https://github.com/lujun9972
[1]: https://tldp.org/LDP/tlk/kernel/processes.html
[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/zombies-turnoff.webp?resize=800%2C467&ssl=1
[3]: https://linuxhandbook.com/top-command/
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/top-command-view.png?resize=800%2C474&ssl=1
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/kill-zombie-process-linux.jpg?resize=800%2C450&ssl=1
[6]: https://linuxhandbook.com/ps-command/
[7]: https://itsfoss.com/how-to-find-the-process-id-of-a-program-and-kill-it-quick-tip/
[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/killing-parent-process.png?resize=800%2C180&ssl=1

View File

@ -0,0 +1,67 @@
[#]: subject: "How to Upgrade to Ubuntu 21.10 Right Now"
[#]: via: "https://itsfoss.com/upgrade-ubuntu-to-newer-version/"
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13902-1.html"
如何现在就升级到 Ubuntu 21.10
======
[Ubuntu 21.10 “Impish Indri” 刚刚发布][1]。如果你正在使用 Ubuntu 21.04,你应该有升级到 Ubuntu 21.10 的选项。
![](https://img.linux.net.cn/data/attachment/album/202110/20/105035l6ig4lkjnk5cipuw.jpg)
然而,这种推出将是逐步的。这意味着不是每个人都会立即得到新版本可用的通知。在你看到升级选项之前,可能需要几周的时间。
但是,如果你迫不及待地想获得带有 GNOME 40 和其他新功能的 Ubuntu 21.10 呢?你真的需要等待吗?不用。
### 现在就从 Ubuntu 21.04 升级到 Ubuntu 21.10
以下是你要做的。打开“<ruby>软件和更新<rt>Software & Updates</rt></ruby>”应用:
![Start the Software & Updates application][3]
并确保你在“<ruby>更新<rt>Updates</rt></ruby>”标签下将“<ruby>通知我新的 Ubuntu 版本<rt>Notify me of a new Ubuntu version</rt></ruby>”设置为“<ruby>任何新版本<rt>For any new version</rt></ruby>”。
![Make sure that settings are right for new Ubuntu version notification][4]
现在打开终端,输入以下命令,以确保你的系统已经更新:
```
sudo apt update && sudo apt upgrade
```
当你的 Ubuntu 21.04 系统安装了所有的更新,运行更新管理器来寻找开发版本(本例中为 Ubuntu 21.10)。
```
update-manager -d
```
它将打开寻找更新的“<ruby>更新管理器<rt>Update Manager</rt></ruby>”。由于你已经更新了系统,它不会找到新的更新来安装。然而,它将看到 Ubuntu 21.10 现在已经可用。
![Hit the upgrade button][2]
你可以点击“<ruby>升级<rt>Upgrade</rt></ruby>”按钮,按照屏幕上的选项开始升级程序。你需要有良好的网络速度来下载 2GB 的更新。确保你的系统在升级过程中保持与电源的连接。
享受 Ubuntu 21.10
--------------------------------------------------------------------------------
via: https://itsfoss.com/upgrade-ubuntu-to-newer-version/
作者:[Abhishek Prakash][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://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://linux.cn/article-13887-1.html
[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/upgrade-to-Ubuntu-21-10.webp?resize=797%2C287&ssl=1
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/software-and-updates.webp?resize=800%2C166&ssl=1
[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/ubuntu-upgrade-settings.webp?resize=800%2C338&ssl=1

View File

@ -0,0 +1,111 @@
[#]: subject: "helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release"
[#]: via: "https://news.itsfoss.com/hellosystem-towards-first-release/"
[#]: author: "John Paul Wohlscheid https://news.itsfoss.com/author/john/"
[#]: collector: "lujun9972"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13915-1.html"
helloSystem一款类似 Mac 的 FreeBSD 系统
======
![](https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/hello-system-bsd.jpg?w=1200&ssl=1)
最近helloSystem 的开发者发布了他们操作系统的最新版本。helloSystem 是一个较新的项目,希望以 FreeBSD 为基础创建一个简单易用的操作系统。让我们来看看这对你我意味着什么。
### helloSystem 简介
![helloSystem 的关于屏幕][1]
你们中的大多数人可能以前从未听说过 [helloSystem][2]。该项目是由 [AppImage 的创建者][3] [Simon Peter][4] 在去年年初启动的。Simon 的目标是创建一个“友好的 [自由桌面][5] 操作系统,重点是简单、简约优雅和可用性。”
Simon 从上世纪 80 、90 年代更为简单的操作系统中获得了灵感,特别是 **早期的 MacOS**,比如 [System 1][6]。如果你只是看一下系统运行的截图,你可能会想说,“我不明白这有什么好大惊小怪的。有一堆 Linux 发行版或主题,看起来就像 MacOS。”
该项目不仅仅是看起来像 MacOS它想回归到更简单、更容易使用的设计。据 [其网站][7] 上讲“helloSystem 是一个面向创作者的桌面系统,注重简单、优雅和实用性。它的设计遵循 ‘少而精’ 的理念。它的目的是为 ‘普通人’ 提供一个系统,欢迎从 Mac 切换过来的人”。你可以通过观看 Simon 在 [FOSDEM 21][8] 上的演讲,了解更多关于他对 helloSystem 计划的想法。
就像 [Suckless 项目][9] 一样Simon 创建了一个 “[欢迎和不欢迎的技术][10]” 列表。被批准的技术清单包括:
* Qt
* mDNSResponder
* Python
* Go
![helloSystem 的欢迎屏幕][12]
“不受欢迎的技术”清单包括 Simon 认为“太复杂或被认为不美观”的东西。这些技术包括:
* 触摸
* btrfs
* Gnome
* GTK
* 客户端窗口装饰
* Wayland
* Pipewire
* XDG 桌面规范
* 与原始字体在度量上兼容的字体,但不试图在视觉上与原始字体相似
* 最终用户应用程序的包管理器
* 配置文件、IP 地址
* D-Bus
* 通过限制用户或应用程序可以做的事情而提供的安全性
* Polkit
* 大写锁定键
* 本地文件的 URI
![在 helloSystem 上安装 Inkscape][13]
### helloSystem 如何工作
我最好解释一下 helloSystem 的工作方式。就像 MacOS 一样,桌面在屏幕顶部有一个全局菜单,底部有一个 Dock。与 MacOS 的 Finder 一样helloSystem 也有一个文件管理器(名为 Filer它也负责窗口管理。
在左上方,你会发现一个 “<ruby>系统<rt>System</rt></ruby>” 菜单你可以用它来访问应用程序。你也可以在左上角的搜索框中输入应用程序的名称。helloSystem 只安装了几个开箱即用的基本应用程序。如果你点击一个未安装的应用程序helloSystem 会下载并安装该应用程序的 AppImage。
helloSystem 基于 FreeBSD 12.2。它默认启用了 ZFS。它没有密码或用户账户系统但这并不意味着他们无视安全。据 [其网站][10] 讲,“这并不是说一般的安全问题不重要。而是说它需要以一种不会限制设备的合法用户(所有者)真正 ‘拥有’ 该设备的方式来实现。”
### 最新版本中的新功能
![helloSystem 的实用程序窗口][14]
最新版本的 helloSystem 包括不少图形方面的更新和小的变化,包括:
* 从 Openbox 切换到 KWin 窗口管理器
* 合理的窗口标题居中
* 当窗口被拖到屏幕边缘时,会缩放到一定大小,类似于 “Aero Snap”。
* 简化了 “<ruby>桌面设置<rt>Desktop Settings</rt></ruby>” 的用户界面;现在更改会立即应用
* 移除文件管理器中的标签以简化用户界面
* 为菜单添加新的电池小程序,以显示电池充电量
* 桌面上的垃圾箱图标不再有 “<ruby>移动到垃圾箱<rt>Move to Trash</rt></ruby>” 的上下文菜单项
* 最小化窗口和取消最小化窗口时的动画
* 窗口大小调整时的动画
* 调整内核配置以优化声音
* 简化了文件管理器中的 “<ruby>获取信息<rt>Get Info</rt></ruby>” 对话框
你可以在 [这里][11] 看到其余的变化。你也可以从同一个链接下载最新的 .iso 文件。试一试,让我们知道你的想法。
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/hellosystem-towards-first-release/
作者:[John Paul Wohlscheid][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/john/
[b]: https://github.com/lujun9972
[1]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/hello-about.jpg?w=850&ssl=1
[2]: https://github.com/helloSystem/hello
[3]: https://itsfoss.com/appimage-interview/
[4]: https://github.com/probonopd
[5]: https://medium.com/@probonopd/bring-back-the-ease-of-80s-and-90s-personal-computing-393738c5e2a1
[6]: https://github.com/helloSystem/hello/wiki#design-principles
[7]: https://hellosystem.github.io/docs/
[8]: https://fosdem.org/2021/schedule/event/hello_bsd/
[9]: https://suckless.org/sucks/
[10]: https://github.com/helloSystem/hello/wiki/Welcome-and-unwelcome-technologies
[11]: https://github.com/helloSystem/ISO/releases/tag/r0.6.0
[12]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/hello-welcome.jpg?w=850&ssl=1
[13]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/hello-install.jpg?w=850&ssl=1
[14]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/hello-utillities.jpg?w=850&ssl=1

View File

@ -0,0 +1,116 @@
[#]: subject: "4 Linux tools to erase your data"
[#]: via: "https://opensource.com/article/21/10/linux-tools-erase-data"
[#]: author: "Don Watkins https://opensource.com/users/don-watkins"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13913-1.html"
4 个用来擦除数据的 Linux 工具
======
> 用这些开源工具从你的硬盘驱动器中擦除数据。
![](https://img.linux.net.cn/data/attachment/album/202110/23/113918sdojp6sj0odgis16.jpg)
保持数据安全的最好方法之一是只向加密的硬盘驱动器写入数据。在一个标准的硬盘上,只要把硬盘挂载就可以查看数据,就像 U 盘一样,甚至可以用 [Scalpel][2] 和 [Testdisk][3] 等工具显示和恢复已删除的数据。但是在一个加密的驱动器上,如果没有解密密钥(通常是你在挂载驱动器时输入的密码),数据是无法被读取的。
加密可以在你安装操作系统时建立,有些操作系统甚至可以在安装后的任何时候激活加密功能。
但是,当你卖掉一台电脑或更换一个一开始就没有被加密的驱动器时,你该怎么办呢?
与从一开始就加密你的数据相比,最好的办法是在你用完硬盘后删除数据。
### 负责任的看管者
我经常被要求帮助客户升级一台旧电脑。无一例外,他们更愿意帮助我回收它们,使它们能被别人使用。我很乐意翻新这些旧电脑,用较新的固态驱动器来改装它们,极大地提高性能。
然而,把一个旧驱动器扔进垃圾桶并不是一个好主意。它需要被擦除,然后被妥善处理。我没有把硬盘留在原来的电脑里,而是把它们取出来,放在一个硬盘盒里,然后把它们连接到我的 Linux 电脑上。有几个 Linux 工具可以很容易地完成这个任务。其中一个是 **Gnu Shred**
### GNU Shred
```
$ sudo shred -vfz /dev/sdX
```
Shred 有许多选项:
* `-n` - 覆盖的次数。默认是三次。
* `-u` - 覆盖并删除。
* `-s` - 要粉碎的字节数。
* `-v` - 显示扩展信息。
* `-f` - 必要时强制改变权限以允许写入。
* `-z` - 最后用 0 覆盖来隐藏粉碎。
使用 `shred --help` 获取更多信息
### ShredOS
ShredOS 是一个<ruby>即用<rt>Live</rt></ruby> Linux 发行版,它的唯一目的是清除驱动器的全部内容。它是在一个名为 DBAN 的类似发行版停止维护后开发的。它使用 `nwipe` 应用,它是 DBAN 的 `dwipe` 的一个分叉。你可以通过下载 32 位或 64 位镜像,并在 Linux 和 macOS 上使用 `dd` 命令将其写入驱动器来制作一个可启动的 USB 驱动器:
```
$ sudo dd if=shredos.img of=/dev/sdX bs=4M status=progress
```
另外,你可以在 Linux、macOS 和 Windows 上使用 [Etcher][4] 工具烧录。
### dd 命令
清除驱动器的一个常见方法是使用 Linux 的 `dd` 命令。几乎所有的 Linux 安装都安装了 `dd` 工具。确保该驱动器没有被挂载。
```
$ sudo umount /dev/sdXY -l
```
如果你想在整个目标磁盘上写零,执行以下命令。这可能需要一个整个通宵。
```
$ sudo dd if=/dev/urandom of=/dev/sdX bs=10M
```
**警告**:请确保你知道你在系统中的位置,并以正确的驱动器为目标,这样你就不会意外地删除自己的数据。
### Nvme-cli
如果你的计算机包含一个较新的 NVMe 驱动器,你可以安装 [nvme-cli][5] 程序,并使用 `sanitize` 选项来清除你的驱动器。
`nvme sanitize help` 命令提供了选项列表:
* `--no-dealloc`、`-d` - 净化后不解除分配。
* `--oipbp`、`-i` - 每次覆写后反转模式。
* `--owpass=`、`-n` - 覆写次数。
* `--ause`、`-u` - 允许无限制净化退出。
* `--sanact=`、`-a` - 净化动作。
* `--ovrpat=`、`-p` - 覆写模式。
下面是我使用的命令:
```
$ sudo nvme sanitize /dev/nvme0nX
```
这里的警告与格式化过程相同:首先备份重要的数据,因为这个命令会擦除这些数据!
### 信息管理
你保存在计算机上的信息是很重要的。它属于你,也属于其他任何人。当你卖掉一台电脑或处理一个硬盘时,确保你已经用这些很棒的工具之一清除了你的数据。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/10/linux-tools-erase-data
作者:[Don Watkins][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://opensource.com/users/don-watkins
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cloud_tools_hardware.png?itok=PGjJenqT (Tools in a cloud)
[2]: https://www.redhat.com/sysadmin/find-lost-files-scalpel
[3]: https://www.redhat.com/sysadmin/recover-partition-files-testdisk
[4]: https://opensource.com/article/18/7/getting-started-etcherio
[5]: https://opensource.com/article/21/9/nvme-cli

View File

@ -0,0 +1,113 @@
[#]: subject: "Get memory use statistics with this Linux command-line tool"
[#]: via: "https://opensource.com/article/21/10/memory-stats-linux-smem"
[#]: author: "Tomasz Waraksa https://opensource.com/users/tomasz"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13918-1.html"
用 smem 命令获取内存使用统计信息
======
> smem 命令允许你快速查看你的网页应用的内存使用情况。
![](https://img.linux.net.cn/data/attachment/album/202110/25/101843emjjkmvk88gvyqgv.jpg)
在我的编程工作中,我经常需要了解网页应用的内存使用情况。在深入研究细节和浏览器剖析工具之前,一个粗略的估计通常就足够了。
为了了解 Linux 或 macOS 上的内存使用情况,人们通常使用 [top][2] 或 [htop][3]。我很想看到一个单一的数字:一个进程占用了多少内存。但这些工具所显示的统计数据可能很难理解。对于网页浏览器来说,它甚至更加复杂,因为它们经常运行许多独立的进程。它们在 `top` 输出中显示为一个长长的列表,每一个都有自己的单独指标。
![Memory usage using htop][4]
### smem 命令
幸运的是有 [smem][6],另一个用于查看内存使用统计的命令行工具。用你选择的包管理器安装它,例如:
```
sudo apt install smem
```
要获得 [Firefox][7] 的总内存使用量,请执行:
```
smem -c pss -P firefox -k -t | tail -n 1
```
这些开关做了什么?
* `-c` 开关指定要显示的列。我只对 `pss` 列感兴趣,它显示一个进程分配的内存。
* `-P` 开关过滤进程,只包括那些名字里有 `firefox` 的进程。
* `-k` 开关显示以 MB/GB 为单位的内存使用情况,而不是单纯的字节数。
* `-t` 开关显示总数。
* `tail -n 1` 过滤器只输出最后一行,也就是总数的地方。
输出是非常简单的:
```
$ smem -t -k -c pss -P firefox | tail -n 1
4.9G
```
开门见山!而且,经过又一天忙碌的工作,打开了 50 多个选项卡Firefox 仍然只使用 5 GB。看看吧Google Chrome。
#### 用一个脚本更容易
为了方便起见,我创建一个名为 `memory-use` 的小脚本,它将进程名称作为参数。我把所有的脚本都放在 `~/bin` 里,所以:
```
echo 'smem -c pss -P "$1" -k -t | tail -n 1' > ~/bin/memory-use && chmod +x ~/bin/memory-use
```
现在我可以很容易地测量任何应用的内存使用:
```
memory-use firefox
memory-use chrome
memory-use slack
```
#### 还有更多!
该工具不仅可以显示总的内存使用情况。它甚至可以生成图形输出。
比如:
```
smem --pie name -c pss
```
显示类似这样的内容:
![Pie chart output from smem][8]
关于更多的细节,我建议查看 [smem 手册页][6]。
你可以在 <https://linoxide.com/memory-usage-reporting-smem/> 上找到另一个很棒的教程。
希望你喜欢!
本文最初发表在[作者的博客][9]上,并经许可转载。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/10/memory-stats-linux-smem
作者:[Tomasz Waraksa][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://opensource.com/users/tomasz
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_code_keyboard_orange_hands.png?itok=G6tJ_64Y (Programming at a browser, orange hands)
[2]: https://linux.die.net/man/1/top
[3]: https://linux.die.net/man/1/htop
[4]: https://opensource.com/sites/default/files/uploads/1_htop.png (Memory usage using htop)
[5]: https://creativecommons.org/licenses/by-sa/4.0/
[6]: https://linux.die.net/man/8/smem
[7]: https://www.mozilla.org/en-US/firefox/
[8]: https://opensource.com/sites/default/files/uploads/2_smem-pie-chart.png (Pie chart output from smem)
[9]: https://letsdebug.it/post/26-measure-application-memory-use-on-linux/

View File

@ -0,0 +1,114 @@
[#]: subject: "PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android"
[#]: via: "https://news.itsfoss.com/pinephone-pro-introduced/"
[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/"
[#]: collector: "lujun9972"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13901-1.html"
PinePhone Pro一款价位适中的 Linux 旗舰智能手机
======
> 售价 399 美元的 PinePhone Pro 是一款 Linux 智能手机,或许有潜力取代一些预算相当的 Android 设备。但作为消费者,还需要等待几个月。
![](https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/PinePhone-Pro-ft.png?w=1200&ssl=1)
早在 2019 年,当 Pine64 宣布推出 PinePhone 时没有人想到它会变得如此受欢迎。在短短两年间Pine64 已经成功建立了一个由数万名开发者和用户组成的社区,大家一起努力使 Linux 完美地跑在了手机上。
现在,随着 PinePhone Pro 的宣布Pine64 正在扩大 Linux 手机的受众范围。这个设备有许多令人难以置信的新功能,所有这些都使它可以与许多中档 Android 手机相提并论。
- [视频](https://img.linux.net.cn/static/video/Meet%20the%20PinePhone%20Pro%20_%20PINE64-wP2-6Z74W44.mp4)
### PinePhone Pro 功能
![][1]
与原来的 PinePhone 相比PinePhone Pro 带来了巨大的升级。这些升级中最值得注意的是使用了 Rockchip 的六核 RK3399S SoC 芯片,这应该能显著地提升性能。其他一些值得注意的功能和升级还有:
* 4GB LPDDR4 内存
* 128GB 存储 + microSD 卡插槽
* 6 英寸 IPS 显示屏,采用 **大猩猩 4 号玻璃**。
* 1300 万像素(后置)+ 500 万像素(前置)的摄像头
让我们来探讨一下这方面的更多细节。
#### 性能更好
![][2]
到目前为止,最重要的升级是 RK3399S SoC 的加入,它是 Pine64 和 Rockchip 合作的结果。这个令人印象深刻的强大 SoC 包含 6 个 CPU 核心,以及一个四核 Mali T860 GPU。
这一组合带来了显著的性能提升,使得 PinePhone Pro 的性能与大多数中档安卓手机相当。这带来了一个更快的系统,能够运行许多桌面级应用程序,如用于照片编辑的 GIMP 和用于仿真游戏的 RetroArch。
总的来说,这次升级将大大改善开发者和消费者的用户体验。
#### 内存更多
考虑到智能手机已经开始提供 6GB 内存作为基本变体时Linux 智能手机也应该使用更多的内存来保持流畅。虽然在优化方面已经做了很多工作,但更多的内存总是有益的。
PinePhone Pro 提供了 4GB 的内存,当放在基座上时可以有更大的通用性,当作为手机使用时可以多打开几个应用程序。我对此感到非常兴奋,因为它应该能够模拟更多的游戏,增加 PinePhone Pro 作为娱乐设备的吸引力。
#### 存储空间升级
我的原版的 PinePhone 面临的最大挑战之一是存储空间不足。从看电影到玩仿真游戏,我不得不不断地删除文件以获得足够的存储空间。
然而,在 PinePhone Pro 上Pine64 已经解决了这个问题,它提供了 128GB 的闪存,这对任何人来说都足够了。
#### 显示屏改进
![][4]
虽然这并不是原版 PinePhone 的痛点,但 PinePhone Pro 的显示屏已经升级,变得更大,采用了大猩猩 4 号玻璃。这是非常值得欢迎的,这款手机现在应该可以提供明显改善的防刮伤性能和更多可用的屏幕空间。
虽然 AMOLED 面板会很好,但这在一定程度上会提高价格,可能会降低设备的吸引力。总的来说,我对这次升级很满意,我相信许多用户也是这样。
#### 相机升级
至少对我来说,原版的 PinePhone 的摄像头是一个相当大的痛点。主摄像头只有 500 万像素,还有一个小小的 200 万像素的前置摄像头,这两个摄像头都不能拍出非常高质量的图像。
原版的 PinePhone 的主摄像头已被移到 PinePhone Pro 的前面。它与一个 1300 万像素的索尼摄像头传感器相配,能够录制 4K 视频和提供更高的图像质量。
用户终于可以用他们的 Linux 智能手机来拍摄照片,在社交媒体平台上分享了。
### 你可以升级你的原版 PinePhone 吗?
这是我看到该公告时问的第一个问题。不幸的是,将你的 PinePhone 升级到 PinePhone Pro 主板是不可行的。我认为 Pine64 解释得很好:
> 虽然 PinePhone Pro 的主板尺寸适合 PinePhone但机框、IPS 显示面板、摄像头、子板和散热系统都不同。例如PinePhone Pro 的摄像头就不适合 PinePhone 的机框,而且与 PinePhone Pro 的主板在电气上不兼容。散热是另一个重要的考虑因素,因为在原来的 PinePhone 的机框中,较高的热量输出可能不能简单地忽略,这需要克服解决。
虽然 Pine64 不建议升级你原来的 PinePhone 的主板但我认为尝试一下还是很有意思的。虽然令人失望但也应该注意到Pine64 并不打算停止原来的 PinePhone 开发,因为它对于想要一个便宜的 Linux 手机作为基本用途的人来说是完美的。
### 总结
总的来说,我非常兴奋地看到又一个设备进入 Linux 手机市场,尤其是像 PinePhone Pro 这样将得到良好支持(希望是这样)的设备。尽管其价格是 399 美元,但我认为很多人都会蜂拥而至购买这款手机。
如果你认为你可能是这些人中的一员,但你得等待几个月后的正式发布。
然而,想要获得早期设备的开发者现在可以点击下面的按钮来预购 PinePhone Pro。
- [预购PinePhone Pro][6]
关于 PinePhone Pro 的可用性和规格的更多细节,你应该去他们的 [官方网站][5] 看看。
你要买 PinePhone Pro 吗?请在下面的评论中告诉我!
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/pinephone-pro-introduced/
作者:[Jacob Crume][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/jacob/
[b]: https://github.com/lujun9972
[1]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/pinephone-pro.png?w=1024&ssl=1
[2]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/pinephoneProMainBoard.jpg?w=1024&ssl=1
[3]: https://i0.wp.com/i.ytimg.com/vi/pCxDcMdr_fo/hqdefault.jpg?w=780&ssl=1
[4]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/PinePhonePro.png?w=465&ssl=1
[5]: https://www.pine64.org/pinephonepro/
[6]: https://preorder.pine64.org/

View File

@ -0,0 +1,69 @@
[#]: subject: "Dash to Dock is Finally Available for GNOME 40"
[#]: via: "https://news.itsfoss.com/dash-to-dock-gnome-40/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13905-1.html"
Dash to Dock 终于可以在 GNOME 40 上使用了
======
> Dash to Dock v70 增加了对 GNOME 40 的支持,并放弃了对较旧版本的 GNOME Shell 的支持。但是,你可以继续使用旧版本。
![](https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/ubuntu-dock.png?w=1200&ssl=1)
Dash to Dock 是多年来最 [有用的 GNOME 扩展][1] 之一。随着 [GNOME 40][2] 的引入,很多人都没能让这个扩展在它上面工作起来。
当然,作为一个流行的扩展,对 GNOME 40 的支持预计很快就会被加入。终于,它来了!
如果你不知道GNOME 40 包括一个水平工作区视图,这影响了一些人的工作流程,但 Ubuntu 即使在 GNOME 40 中也没有移动 Dock 的打算。
所以,你仍然可以使用 Dash to Dock 来从概览区得到一个水平的 Dock。
### Dash to Dock v70 放弃了对旧的 GNOME Shell 的支持
![][3]
Dash to Dock v70对 GNOME 40 和特定的 3.34 版的 GNOME Shell 提供了支持。
然而,为了支持 GNOME 40 而对扩展所做的技术修改也意味着新版本的扩展不能再与旧版本的 GNOME Shell 一起工作。
如果你没有运行 GNOME 40你仍然可以使用旧的 v69它应该可以很好地工作。而且除了增加了对 GNOME 40 的支持,在功能上也没有什么不同。
该扩展的未来发展可能很有趣,他们是否会考虑为不同的 GNOME Shell 版本而增加不同的扩展软件包,并提供新的功能?让我们拭目以待。
### 安装 Dash to Dock 的方法
![][4]
你可以从 [GNOME 扩展网站][5] 中通过简单的切换按钮来安装这个扩展。如果你是新手,我建议通过我们的 [GNOME 扩展安装指南][6] 来开始。
- [Dash to Dock GNOME 扩展][5]
值得注意的是,你需要使用一个兼容的网页浏览器来安装这个扩展。虽然它应该可以在大多数浏览器上使用([基于 Chromium 的浏览器][7] 应该可以),但正如 [OMG! Ubuntu][8] 最初报道的那样Ubuntu 21.10 中 Snap 打包的 Firefox 浏览器可能无法使用。
你试过这个扩展了吗?欢迎在下面的评论中告诉我你的想法。
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/dash-to-dock-gnome-40/
作者:[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/best-gnome-extensions/
[2]: https://news.itsfoss.com/gnome-40-release/
[3]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/dash-to-dock.jpeg?w=1366&ssl=1
[4]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/gnome-dash-dock-extension.png?w=1259&ssl=1
[5]: https://extensions.gnome.org/extension/307/dash-to-dock/
[6]: https://itsfoss.com/gnome-shell-extensions/
[7]: https://news.itsfoss.com/chrome-like-browsers-2021/
[8]: https://www.omgubuntu.co.uk/2021/10/dash-to-dock-official-gnome-40-support?

View File

@ -0,0 +1,114 @@
[#]: subject: "Linux Tablets: What are Your Options?"
[#]: via: "https://itsfoss.com/linux-tablets/"
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
[#]: collector: "lujun9972"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13929-1.html"
有哪些 Linux 平板电脑可供选择
======
![](https://img.linux.net.cn/data/attachment/album/202110/28/180114mism33m44sibmsc9.jpg)
有很多 [基于 Linux 的笔记本电脑][1],也有 [预装了 Linux 的迷你 PC][2],而市场上还有一些 [基于 Linux 的智能手机][3]。
那平板电脑呢?有没有一些不错的基于 Linux 的平板电脑?这可能不能用一句话说清楚。
许多仅使用 Linux 的系统制造商专注于制造台式电脑。这主要是由于触摸设备上的 Linux 体验与安卓和 iOS 提供的体验相距甚远。
但这是否意味着你不能在平板电脑上使用 Linux并非如此。对于早期尝试用户和 DIY 爱好者来说,还有一些选择的。让我们来看看在这些 Linux 平板电脑中,你有哪些选择。
### Ubuntu Touch
![BQ 平板电脑上的 Ubuntu Touch 操作系统][4]
好吧!这不是一个平板电脑,而是一个操作系统。但它确实让你可以在一些旧的安卓平板电脑上安装一个适合触摸操作的 Ubuntu 版本。
注意“一些”这个词。Ubuntu Touch 官方 [支持][5] Nexus 7、联想 M10、Xperia Z4 和 BQ Aquaris 平板。你甚至可以尝试在你的其他平板电脑上安装 Ubuntu Touch。它可能无法 100% 工作,但仍然非常有用。
[Ubuntu Touch][8] 是 Ubuntu 团队的一个项目,但是他们 [在 2017 年中止了它][6]。[UBports][7] 承担了继续这个项目的责任,他们在有限的资源下做的很棒。
总而言之如果你喜欢各种实验想让你的旧安卓平板电脑获得新生Ubuntu Touch 可能是你的周末项目。
### PineTab
![PineTab][9]
Pine64 始于其单板计算机 Pine A64以作为 [树莓派的替代品][10]。随着时间的推移,它推出了几个 Pine 品牌的产品。这份名单里包括低调的 [PineTime 智能手表][11]、PineBook 笔记本电脑、PinePhone 智能手机和 PineTab 平板电脑。
这些 Pine 设备通常价格低廉,并允许用户对这些小设备进行完全控制。这种可魔改的特性帮助它聚集了一大批开源 DIY 爱好者的粉丝。
[PineTab][12] 基本上使用了与带有触摸屏和键盘的 Pine64 单板计算机相同的组件。它不是看起来最漂亮的平板电脑,也不打算成为这样的。
它的规格很一般,有一个高清 IPS 电容式触摸屏、全志 A64 芯片组、四核 CPU 和 2GB 内存。
它无法与 iPad 或 Galaxy Tab 竞争,但它允许你安装你选择的发行版,并按你的要求进行配置。
请记住Pine 的库存有限,所以如果你能看到这个设备可以购买,那你很幸运。
### PineNote
![PineNote][13]
另一个 Pine 设备,与你在上一节看到的 PineTab 略有不同。
PineTab 是一款用于浏览互联网、使用应用程序和玩游戏的 Linux 平板电脑,而 [PineNote][14] 是用来做笔记和阅读书籍和文件的。
它有一个电子墨水显示屏,你可能在 Kindle 等电子书阅读器上见过。除了电子书阅读器之外PineNote 还可以你用 Wacom 笔做笔记。
PineNote 拥有四核 Rockchip、多点触控电子墨水面板、4GB 内存和 128GB eMMC 存储。它也是为数不多的价格高于通常的 399 美元的平板点之一。
请记住PineNote 正处于早期开发阶段,只接受开发者的订单。
### RasPad
![RasPad][18]
[RasPad][19] 是一个用于树莓派设备的套件,可以把它变成一个基于触摸功能的设备。与普通的平板不同,这不是一个扁平的设备,而是有一个楔形的身体。这使得它更容易在办公桌上使用。
RasPad 是专门为树莓派设备创建的,你可以轻松使用它的大部分端口。它有一个专门的 RasPad 操作系统,但你可以自由使用常规的树莓派操作系统或 Ubuntu 或任何其他适合树莓派的操作系统。在选择操作系统时请考虑触控友好性。
请记住,树莓派设备不包括在套件中。你必须要单独购买。
### 你的选择是什么?
我知道我们离一个优秀的 Linux 平板电脑还很远,但它们至少可以和市场上的安卓平板电脑竞争。至少我们有一些可用的选择,这也是一线希望。
你是否已经拥有以上列出的设备之一了?你的体验如何?
如果你只能选择其中之一,那么你选择哪一款 Linux 平板电脑?
--------------------------------------------------------------------------------
via: https://itsfoss.com/linux-tablets/
作者:[Abhishek Prakash][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://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://linux.cn/article-13672-1.html
[2]: https://itsfoss.com/linux-based-mini-pc/
[3]: https://linux.cn/article-13711-1.html
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/ubuntu-touch.jpg?resize=755%2C537&ssl=1
[5]: https://devices.ubuntu-touch.io/
[6]: https://itsfoss.com/ubuntu-unity-shutdown/
[7]: https://ubports.com/
[8]: https://ubuntu-touch.io/
[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/PineTab.jpg?resize=800%2C742&ssl=1
[10]: https://itsfoss.com/raspberry-pi-alternatives/
[11]: https://itsfoss.com/pinetime-linux-smartwatch/
[12]: https://pine64.com/product/pinetab-10-1-linux-tablet-with-detached-backlit-keyboard/?v=0446c16e2e66
[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/PineNote-tab.jpg?resize=800%2C615&ssl=1
[14]: https://www.pine64.org/pinenote/
[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingpad-keyboard-angle.webp?resize=800%2C600&ssl=1
[16]: https://itsfoss.com/jingpad-a1-review/
[17]: https://en.jingos.com/jingpad-a1/
[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/raspad.webp?resize=800%2C614&ssl=1
[19]: https://raspad.com/products/raspadv3

View File

@ -0,0 +1,92 @@
[#]: subject: "Why Mark Text is my favorite markdown editor"
[#]: via: "https://opensource.com/article/21/10/mark-text-markdown-editor"
[#]: author: "Don Watkins https://opensource.com/users/don-watkins"
[#]: collector: "lujun9972"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13926-1.html"
Mark Text我最喜欢的 Markdown 编辑器
======
> Mark Text 拥有的工具使得撰写 Markdown 变得容易,同时又提供了一个不会打扰我的简单的界面。
![](https://img.linux.net.cn/data/attachment/album/202110/27/141244m9os557ss7au6oas.jpg)
几年前,当我开始使用 Jupyter 笔记本时,我接触到了 Markdown 格式。许多作者都知道 Markdown但这是我不熟悉的一种技能。
Markdown 是一种标准的文本写作方式,在这种方式中,你可以用精简的符号来标记你想要的文本样式。例如,你不用点击一个按钮来使一个词变粗体,而是用两个星号(`**word**`)包围这个词。这有两种效果:
* 当作为纯文本查看时,视觉上显示出强调的文本
* 如果有一个好的文本转换器或渲染器(如 Pandoc 或一个好的 Markdown 文本编辑器),就会显示为加粗。
Markdown 最大的优点之一是它的大部分符号都是直观的,并且来自我们大多数人已有的习惯。它使得用星号强调单词,用字符标记标题以区分它们等等变得很自然。
每个人都对它评价很高,但我不确定为什么我需要学习和使用 Markdown。然而我是一个好奇的人我开始探索 Markdown以及它如何在我的写作中发挥作用。
### 学习 Markdown
我很喜欢在学习时使用 [Markdown 速查表][2]。我发现 Markdown 是一个很好的工具,可以写任何内容,而且我很喜欢甚至不需要一个专门的 Markdown 编辑器这一点。任何文本编辑器都可以写 Markdown因为 Markdown 使用标准文本来表示样式。我开始使用简单的编辑器,如 Vim 或 gedit或任何其他编辑器并查阅这个速查表以记住简单的格式化规则。
今年我一直在写日记,作为组织我的想法和学习更多关于 Markdown 的方法。我最近尝试了 [Ghostwriter][3] 文本编辑器,这是一个优秀的编辑器,有一些额外的 Markdown 特定功能。Markdown 现在已经变得非常流行了,许多编辑器都加入了语法高亮、提示和其他使 Markdown 编写变得容易的功能,或者将其作为重点。它们不是必须的功能,但当你拥有它们时,还是很好的。 
### 尝试 Mark Text
在阅读一个博客时,我发现了 [Mark Text][4]。Mark Text 使写 Markdown 变得很容易同时提供了一个简单的界面而且又不影响我。Mark Text 有六个主题,三个浅色和三个深色主题。深色主题对我来说更容易使用。它的 [用户文档][5] 非常好,而且也提供了 Markdown 的 [语法帮助][6]。 
### Markdown 的实时预览
Mark Text 以简洁的界面提供了实时预览功能。它支持 [Commonmark][7] 规范、Github 风格的 Markdown 规范,以及 Pandoc Markdown。据其网站说Mark Text 还支持 KaTex、front matter 和 emoji 等 Markdown 扩展。它还可以输出 HTML 和 PDF 文件。 
Mark Text 有各种编辑模式,如打字模式、源代码模式和专注模式。添加图片是一件很容易的事,因为你可以简单地从剪贴板上复制和粘贴它们。
在 Mark Text 窗口的左上方有一个弹出窗口,显示迄今为止输入的字符和段落数量。作为一个作家,这真的很有帮助。
从 Mark Text 窗口左上方的菜单或使用 `Ctrl+S` 保存文件很容易。事实上Mark Text 的菜单对任何习惯于基本文本编辑器或文字处理器的人来说都是友好和熟悉的。
![Mark Text 文件菜单][8]
我喜欢 Mark Text 用简单的快捷键支持各种格式,包括表格块、图表、行内格式、数学公式块和其他代码块。
你可以从以下链接中为你的操作系统下载 Mark Text
* [Linux][10]
* [macOS][11]
* [Windows][12]
Mark Text 以 [MIT][13] 许可证开源。你可以随时 [下载][14] 最新的版本。
另外,你可以用 `brew install --cask mark-text` 在 macOS 上安装 Mark Text在 Windows 上用 [Chocolatey][15] 输入 `choco install marktext` 来安装它。
Mark Text 一直在寻找赞助商和开发者。该项目有一个给贡献者的 [指南][16]。此外,你可以在 Patreon 和 Open Collective 上支持该项目。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/10/mark-text-markdown-editor
作者:[Don Watkins][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://opensource.com/users/don-watkins
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-docdish-typewriterkeys-3.png?itok=NyBwMdK_ (Typewriter keys in multicolor)
[2]: https://opensource.com/downloads/cheat-sheet-markdown
[3]: https://wereturtle.github.io/ghostwriter/
[4]: https://marktext.app/
[5]: https://github.com/marktext/marktext/blob/master/docs/README.md
[6]: https://github.com/marktext/marktext/blob/master/docs/MARKDOWN_SYNTAX.md
[7]: https://commonmark.org/
[8]: https://opensource.com/sites/default/files/uploads/mark-test-file-menu.png (Mark Text file menu)
[9]: https://creativecommons.org/licenses/by-sa/4.0/
[10]: https://github.com/marktext/marktext/releases/latest/download/marktext-x86_64.AppImage
[11]: https://github.com/marktext/marktext/releases/latest/download/marktext.dmg
[12]: https://github.com/marktext/marktext/releases/latest/download/marktext-setup.exe
[13]: https://github.com/marktext/marktext/blob/develop/LICENSE
[14]: https://github.com/marktext/marktext/releases
[15]: https://chocolatey.org/
[16]: https://github.com/marktext/marktext/blob/develop/CONTRIBUTING.md

View File

@ -0,0 +1,102 @@
[#]: subject: "GitUI: A Blazing Fast Terminal Client for Git Written in Rust"
[#]: via: "https://itsfoss.com/gitui/"
[#]: author: "Marco Carmona https://itsfoss.com/author/marco/"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13922-1.html"
GitUI: 用 Rust 编写的 Git 的快速命令行客户端
======
![](https://img.linux.net.cn/data/attachment/album/202110/26/111605achvngqr6ix6vv0p.jpg)
[基本的 Git 命令][1] 对于通常的克隆、添加、提交推送已经足够好了。
但如果你在一个有多个贡献者的大型项目上工作你可能需要将事情可视化。GUI 工具可以让你更好地了解 `diff`、`stash` 和 `blame` 的情况。
但是,如果你常用终端,又想要 Git 的舒适性,我为你准备了一个好工具。
它叫 GitUI它提供了类似于 Git GUI 的用户体验和舒适度,但就在你的终端中。它是可移植的、快速的、自由而开源的。
### GitUI一个基于终端的 Git 工具
[GitUI][2] 并不是第一个用于 Linux 终端的 Git 客户端。那么,是什么让 GitUI 与其他类似项目如 [lazygit][3] 或 [tig][4] 不同?
GitUI 的开发者在项目的 README 文件中分享了一些基准数据。
名称 | 时间 |内存GB| 二进制MB| 冻结 | 崩溃
---|---|---|---|---|---
gitui | 24 s | 0.17 | 1.4 | 否 | 否
lazygit | 57 s | 2.6 | 16 | 是 | 有时
tig | 4 m 20 s | 1.3 | 0.6 | 有时 | 否
*GitUI、LazyGit 和 Tig 之间的比较。*
这种优化大部分来自于 Rust 语言的使用。
**注意:该程序处于早期开发阶段,还没有为生产做好准备。**
### 在 Linux 上安装 GitUI
不用说,你应该已经 [在你的系统上安装了 Git][5]。
要使用 GitUI首先需要 [为你的 Linux 发行版安装 Rust 支持][6]。
在终端中,使用以下命令:
```
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```
![Installing Rust on Linux][7]
当你被要求选择时,请选择选项 1。当脚本完成安装后用这个命令正确设置配置
```
source $HOME/.cargo/env
```
现在你已经安装了 Rust 和它的包管理器 Cargo使用 Cargo 命令来安装 GitUI
```
cargo install gitui
```
然后你就可以使用 GitUI了只需在终端输入 `gitui` 就可以运行了。我做了一些示例文件来测试 Git 和 GitUI。
![Starting gitui on terminal][8]
值得一提的是,这个界面有一个快速而直观的纯键盘控制。一切都很简单,只需输入正确的字母即可将文件暂存、提交、分支或推送到 git 仓库中。
真正让我兴奋的是,你不仅可以做之前的四个动作,还可以**编辑**每个文件,**拉取**它,**追溯** 它,在其中**导航**等等,这一切都无需退出界面。 很棒,不是吗?
![More functions inside the interface][9]
祝贺你! 现在你知道了如何安装 GitUI 以及它在你的终端中的样子。
如果你喜欢这个项目,请在 [GitHub][2] 上点赞它的仓库。如果你使用其他工具来管理 Git请在评论区提出你的建议。
--------------------------------------------------------------------------------
via: https://itsfoss.com/gitui/
作者:[Marco Carmona][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://itsfoss.com/author/marco/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/basic-git-commands-cheat-sheet/
[2]: https://github.com/Extrawurst/gitui
[3]: https://github.com/jesseduffield/lazygit
[4]: https://jonas.github.io/tig/
[5]: https://itsfoss.com/install-git-ubuntu/
[6]: https://itsfoss.com/install-rust-cargo-ubuntu-linux/
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/Installing-Rust-step-1.png?resize=800%2C471&ssl=1
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/Starting-GitUI-on-terminal.png?resize=800%2C471&ssl=1
[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/More-functions-inside-the-interface.png?resize=800%2C471&ssl=1

View File

@ -0,0 +1,174 @@
[#]: subject: "How to Install Rust and Cargo on Ubuntu and Other Linux Distributions"
[#]: via: "https://itsfoss.com/install-rust-cargo-ubuntu-linux/"
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
[#]: collector: "lujun9972"
[#]: translator: "perfiffer"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13938-1.html"
如何在 Ubuntu 和其它的 Linux 发行版安装 Rust 和 Cargo
======
> 了解在 Linux 上安装 Rust 编程语言及其包管理器 Cargo 的各种方法。
![](https://img.linux.net.cn/data/attachment/album/202110/31/150031j9e0xgeg9jpxeip0.jpg)
自从 Mozilla 贡献了 [Rust][1] 语言之后,它就获得了更加突出和受欢迎的地位。口说无凭。[Rust 将被使用在 Linux 内核中][2],它是继 C 语言之后的第二种编程语言。
许多开发人员也开始使用 Rust 语言制作很棒的基于命令行的工具。这些工具通常可以通过 [Cargo 包管理器][3] 获得。
这就是为什么在 Linux 中安装 Rust 支持对程序员和最终用户都很重要的原因。
官方 Rust 文档建议通过以下这种方式下载并执行安装程序脚本在 Linux 中安装 Rust
```
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```
这是可行的。但是,你的发行版可能已经打包了 Rust。使用你的发行版的 [包管理器][4] 也是一种选择。
让我向你介绍官方 Rust 方式和包管理器方式的 Rust 安装步骤。
### 方法1使用官方方法在任意的 Linux 上安装 Rust
这种方法有几个优点:
* 你可以获取最新的 Rust 和 Cargo 版本
* Rust 仅仅是为当前的用户安装,并不是所有用户
* 你并不需要 root 用户或者 `sudo` 权限就可以为自己安装 Rust
一些人不喜欢从互联网下载并 [运行 shell][5] 脚本,即使它来自官方。但是,由于它不需要 root 访问权限并且脚本来自官方,因此以这种方式安装它应该是安全的。
首先,确保你已经安装了 `curl`。如果没安装,使用你的发行版的包管理器安装它。你可以使用 `apt` 命令在 [Ubuntu 和 Debian 上安装 Curl][6]。
```
sudo apt install curl
```
接下来,使用这条命令下载脚本并运行它:
```
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```
![][7]
它会询问你输入所需的安装类型。选择选项 `1`
![][8]
脚本完成安装后,你需要获取配置文件的来源,以使更改应用于你的 shell。
![][9]
应用文件:
```
source $HOME/.cargo/env
```
完成后,通过检查已安装的版本来验证 Rust 是否可用:
```
rustc --version
```
![Verifying Rust installation][10]
太酷了。如果 Rust 发布了新版本,你可以使用如下命令更新已安装的版本:
```
rustup update
```
在你看到其它安装方法之前,让我快速展示如何移除以这种方式安装的 Rust。
#### 删除以官方方式安装的 Rust
在终端中,使用如下的命令从系统中移除 Rust
```
rustup self uninstall
```
询问时按 `Y`,你将从系统中删除 Rust。
![Removing Rust from Linux][11]
官方方式安装已经完成。让我们看看如何使用 `apt` 命令在 Ubuntu 上安装 Rust。
### 方法2使用 apt 命令在 Ubuntu 上安装 Rust
为什么要使用包管理器?
* 它在整个系统范围内安装 Rust可供系统上的所有用户使用
* 它与其它系统更新一起集中更新(如果你的发行版添加了新版本的 Rust
Ubuntu 中有两个主要的 Rust 包:
* `rustc`:用于 Rust 编程语言的 Rust 编译器
* `cargo`Cargo 是 Rust 的包管理器,它会自动安装 `rustc`
作为一个普通用户,你将使用 Cargo 来安装基于 Rust 的应用程序。作为程序员,你需要 Cargo 来获取其它 Rust 包或创建自己的包。
由于 `cargo` 包含 `rustc`,所以我建议安装它,以便一次性安装所有必需的软件包。
```
sudo apt install cargo
```
系统会要求你输入账号密码。
![][12]
当然,你可以自由使用 `apt install rustc`,只安装 Rust。这取决于你的选择。
你可以验证是否为你和所有其他用户安装了 Rust如果你愿意
![][13]
很好。让我也快速展示卸载步骤。
#### 使用 apt remove 移除 Rust
要移除 Rust你可以先移除 Cargo然后使用 `autoremove` 命令移除随它安装的依赖项。
```
sudo apt remove cargo
```
现在运行 `autoremove`
```
sudo apt autoremove
```
就是这样。你现在了解了在 Ubuntu 和其它 Linux 发行版上安装 Rust 的所有基本知识。随时欢迎提出问题和建议。
--------------------------------------------------------------------------------
via: https://itsfoss.com/install-rust-cargo-ubuntu-linux/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[perfiffer](https://github.com/perfiffer)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://www.rust-lang.org/
[2]: https://www.zdnet.com/article/rust-in-the-linux-kernel-why-it-matters-and-whats-happening-next/
[3]: https://crates.io/
[4]: https://itsfoss.com/package-manager/
[5]: https://itsfoss.com/run-shell-script-linux/
[6]: https://itsfoss.com/install-curl-ubuntu/
[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/installing-rust-linux-1.png?resize=800%2C448&ssl=1
[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/installing-rust-linux-2.png?resize=800%2C448&ssl=1
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/installing-rust-linux-3.png?resize=800%2C448&ssl=1
[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/verify-rust-version.png?resize=800%2C236&ssl=1
[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/remove-rust-linux.png?resize=800%2C378&ssl=1
[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/install-rust-using-apt-ubuntu.png?resize=759%2C481&ssl=1
[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/verify-rust-install-ubuntu.png?resize=741%2C329&ssl=1

View File

@ -0,0 +1,133 @@
[#]: subject: "How to Convert a Webpage to PDF in Linux"
[#]: via: "https://itsfoss.com/convert-webpage-pdf-linux/"
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13928-1.html"
如何在 Linux 下将网页转换为 PDF 文件
======
![](https://img.linux.net.cn/data/attachment/album/202110/28/111738tncncbml6jwcz6s8.jpg)
当你将某些资源存档或用于教育目的时,将网页保存为 PDF 是很方便的。
但是,你如何在 Linux 中把一个网页转换成 PDF
你可以选择使用每个 Linux 发行版上的网页浏览器GUI或者使用终端将网页变成 PDF 文件。
在这里,我将提到这两种方法来帮助你完成工作。
### 方法 1使用网页浏览器将网页转换为 PDF 文件
尽管我在本教程中使用的是 Mozilla Firefox但你也可以用任何 [可用于 Linux 的最佳浏览器][1] 做同样的事情。
![][2]
1、加载你想转换的网页。
2、在浏览器菜单中找到“**打印**”选项,或使用键盘快捷键 `Ctrl + P`
3、默认情况下它应该让你把它保存为 PDF。你需要点击“保存”然后选择目的地并保存网页。
![Save webpage as PDF in Mozilla Firefox][3]
这种简单方法的一个主要问题是,它包括页面上的所有元素。这可能包括评论、页脚等。你可以用一个 PDF 编辑器来删除部分内容,但这是一个额外的任务。
更好的选择是利用一个浏览器扩展,如 [Print Friendly][4]。它允许你在下载 PDF 之前编辑和删除网页的部分内容。
### 方法 2使用终端将网页转换为 PDF 或图片
你可能已经知道,你可以 [在 Linux 终端浏览互联网][5],甚至 [使用命令行下载文件][6]。这并不奇怪,因为你可以在终端中做更多的事情,包括将网页下载为 PDF。
一个灵巧的开源命令行工具 `wkhtmltopdf``wkhtmltoimage` 可以帮到你,让你把任何 HTML 网页转换成 PDF 或图像文件。
它使用 Qt WebKit 渲染引擎来完成这个任务。你可以浏览它的 [GitHub页面][7] 了解更多信息。
你应该能够从你的 Linux 发行版的默认仓库中安装它。对于基于 Ubuntu 的发行版,你可以输入以下命令:
```
sudo apt install wkhtmltopdf
```
无论你想把它转换为 PDF 还是图像文件,它的使用都是非常直接的:
![][8]
要将一个网页转换成 PDF请输入
```
wkhtmltopdf URL/domain filename.pdf
```
比如,类似于这样:
```
wkhtmltopdf linuxmint.com mint.pdf
```
你可以选择使用 `https://linuxmint.com` 这样完整的 URL 或使用域名,如上面的例子所示。
默认情况下,生成的文件将保存在主目录下。
在转换网页时,你还可以得到一些好玩的选项。
例如,你可以**对 PDF 文件应用灰度过滤器**,在同一文件中**制作多个页面副本**,以及在转换过程中**排除**图像。
灰度过滤器不一定对每个网页都有效,但你可以用命令试试:
```
wkhtmltopdf -g google.com googlepage.pdf
```
要在同一个 PDF 文件中复制多个页面,命令是:
```
wkhtmltopdf --copies 2 linuxmint.com mint.pdf
```
而且,如果你想排除网页中的图像,只需输入:
```
wkhtmltopdf --no-images linuxmint.com mint.pdf
```
此外,如果你想把一个网页转换为图像,命令是这样的:
```
wkhtmltoimage linuxmint.com mint.png
```
注意,与使用浏览器的 GUI 方法不同,通过终端使用这些工具有其局限性。它似乎不能成功转换利用任何 `<iframe>` 代码片段的网页。
像我们的网站,甚至 DuckDuckGo 都没有转换为 PDF 或图像。然而,简单的 HTML 网站,如 Linuxmint.com、Ubuntu.com、Google.com 则非常有效。
### 总结
使用浏览器将网页保存为 PDF 似乎是个好办法。但是,如果你想有更多的选择并通过终端,`wkhtmltopdf` 工具应该会派上用场。
你喜欢如何在 Linux 中把网页转换为 PDF欢迎在评论中分享你的想法。
--------------------------------------------------------------------------------
via: https://itsfoss.com/convert-webpage-pdf-linux/
作者:[Ankush Das][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://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/best-browsers-ubuntu-linux/
[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/mozilla-save-webpage-pdf.png?resize=800%2C536&ssl=1
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/mozilla-firefox-print-pdf-1.png?resize=602%2C584&ssl=1
[4]: https://www.printfriendly.com/
[5]: https://itsfoss.com/terminal-web-browsers/
[6]: https://itsfoss.com/download-files-from-linux-terminal/
[7]: https://github.com/wkhtmltopdf/wkhtmltopdf
[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/htmltopdf-mint.png?resize=736%2C344&ssl=1

View File

@ -0,0 +1,87 @@
[#]: subject: "MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition"
[#]: via: "https://news.itsfoss.com/mx-linux-21-release/"
[#]: author: "Omar Maarof https://news.itsfoss.com/author/omar/"
[#]: collector: "lujun9972"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13912-1.html"
MX Linux 21 稳定版发布
======
> 基于 Debian 的 MX Linux 21 现已经推出,带来了一些不错的改进。
![](https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/mx-linux-21-release-ft.png?w=1200&ssl=1)
[MX Linux][1] 是一个基于 Debian 的 Linux/GNU 发行版,旨在追求优雅、稳定和性能。
我们之前报道过它的 [尚处于测试阶段的新 Fluxbox 版][2],但现在稳定版出来了。让我们来探讨一下 MX Linux 21 “Wildflower” 的新内容。
### MX Linux 21 主要亮点
![][3]
MX Linux 21 基于 Debian 11 “Bullseye”运行 Linux 5.10LTS 内核。在这次的新更新中,你可以发现一些新的应用和对当前应用的升级。
![][4]
“Wildflower” 系列包括一个带有 Fluxbox 1.3.7 的新版本它可以使旧电脑重新焕发活力。补充一下Fluxbox 是一个窗口管理器,可以在高端计算机上无缝工作,但资源占用很少。
它的安装程序有一个新的分区选择区,支持 LVM逻辑卷管理器
![MX Linux 21 有一个漂亮的图形化安装程序][3]
当启动系统时,无论你是使用<ruby>临时启动<rt>live boot</rt></ruby>还是持久化使用,你都可以选择使用新的 UEFI 临时系统启动菜单,而不是旧的控制台菜单。
对于桌面环境Xfce 4.16 和 KDE Plasma 5.20 都是最新版本。
然而,还没有 Xfce 版。
它新提供的一个方便的工具是在管理任务中默认使用管理员密码。然而,如果你不需要它,你可以把它关掉。
### 其他改进
* 安装程序和临时系统已经更新到最新版本。
* 大部分的翻译仍在进行中。另一方面,有些部分的翻译工作完成的很好的。
* 默认软件包集现在包括 [Mesa Vulkan][5] 驱动。
* 对某些 Realtek 硬件的 Wi-Fi 有了更好的支持。
* 已默认启用 Debian 安全库。
* Xfce 有了一些改进,其中之一是为 Thunar 文件管理器增加了一个 samba 共享插件。
* KDE 对其文件管理器 Dolphin 进行了修复。
![][3]
### 总结
MX Linux 21 是它目前最新的稳定版本。更加优雅,性能更强,因此更加适合作为日常使用。
尽管与其他流行的选择相比MX Linux 是一个相对较新的 Linux/GNU 发行版,但它在提供一个由 Debian、MX 存储库和 [antiX Linux][6] 支持的完整操作系统方面有很大的潜力。
你可以参考 [官方公告][7] 了解更多细节。
- [下载 MX Linux 21][8]
你对这个版本有什么看法?你碰巧在使用 MX Linux 吗?请在下面的评论中分享你的想法。
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/mx-linux-21-release/
作者:[Omar Maarof][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/omar/
[b]: https://github.com/lujun9972
[1]: https://mxlinux.org/
[2]: https://news.itsfoss.com/mx-linux-21-fluxbox-beta-release/
[3]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/MX_Linux_21-1.png?w=1366&ssl=1
[4]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/08/mx-linux-21-fluxbox.png?w=902&ssl=1
[5]: https://www.mesa3d.org/
[6]: https://antixlinux.com/
[7]: https://mxlinux.org/blog/mx-21-wildflower-released/
[8]: https://mxlinux.org/download-links/

View File

@ -0,0 +1,115 @@
[#]: subject: "How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment"
[#]: via: "https://itsfoss.com/install-themes-xfce-xubuntu/"
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13932-1.html"
如何在使用 Xfce 桌面环境的 Xubuntu 上安装主题
======
![](https://img.linux.net.cn/data/attachment/album/202110/29/103958hrv6vruu163zrtvr.png)
> 这是一个循序渐进的初学者教程,展示了如何在 Xubuntu 和其他使用 Xfce 桌面环境的 Linux 发行版中安装主题和图标。
在 Xubuntu 上安装主题与 Ubuntu 或其他 Linux 发行版类似。你把主题文件放在 `~/.themes` 文件夹中,然后用一个工具来改变它。
然而,考虑到 Xubuntu 使用 [Xfce 桌面环境][1],一些选项或用户界面看起来会有所不同。这就是为什么我创建了这个教程,用适当的截图来展示步骤。
### 在 XubuntuXfce中安装新主题
开始前,你需要在主目录下创建一个 `.themes` 文件夹。注意文件夹名称前的点(`.`)。它很重要,可以从正常的视图中隐藏该文件夹。
要检查你是否已经有了它,你可以 [启用查看隐藏文件][2],然后在它不存在的时候创建它。
![][3]
完成后,你需要下载一个主题。
1、你可以在 [Xfce-look][4] 门户网站上浏览 XFCE 主题。你所要做的就是下载存档(压缩)文件。
2、接下来你需要 [解压缩文件][5],如下面的截图所示。
![][6]
3、解压后你会发现出现一个文件夹你要复制它。
![][7]
4、然后你要把这个文件夹粘贴到你最初创建的 `.themes` 目录中。
![][8]
5、最后你需要到外观设置中找到它并选择它/应用它以使其生效。
![][9]
正如你在下面的截图中注意到的,新的主题已经被添加和应用:
![][10]
除了主题之外,如果你需要定制你的 Xubuntu 桌面的图标,你需要在主目录中创建另一个 `.icons` 文件夹。
就像你安装主题一样,你将不得不遵循一个类似的过程来应用图标主题。
为了给你一个例子,让我在这里强调这些步骤:
### 在 XubuntuXfce 中添加图标主题
你可以浏览同样的 [xfce-look portal][11] 来寻找完整的图标主题。
或者,你可以寻找一些最好的 [可用于 Ubuntu 的图标主题][12],它们应该也适用于 Xubuntu。
一旦你找到了你喜欢的,就下载它,并按下面的方式解压。
![][13]
接下来,你需要把这个文件夹复制并粘贴到 `.icons` 文件夹中。
![][14]
现在,你可以回到外观设置中,找到列在“图标”下的可用图标。
为了向你展示区别,**我把默认的 Xubuntu 主题改为 adwaita-dark**,你可以在这里看到:
![][15]
**注意**:一些图标或主题文件可能包含有不同变体的嵌套文件夹。你会注意到它们并没有出现在外观工具中。如果是这种情况,直接将内部文件夹复制到 `~/.themes``~/.icons` 文件夹中。
### 总结
通过对风格和图标的调整,你可以 [定制你的 Xubuntu 体验][16] 以融入你的品味。
你是喜欢默认的 Xubuntu 外观还是使用不同的主题/图标来定制它的外观?请在评论中告诉我你的想法。
--------------------------------------------------------------------------------
via: https://itsfoss.com/install-themes-xfce-xubuntu/
作者:[Ankush Das][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://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://xfce.org/
[2]: https://itsfoss.com/hide-folders-and-show-hidden-files-in-ubuntu-beginner-trick/
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/xubuntu-hidden-files.png?resize=674%2C300&ssl=1
[4]: https://www.xfce-look.org/browse?cat=138&ord=latest
[5]: https://itsfoss.com/unzip-linux/
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/extract-xubuntu-theme.png?resize=719%2C537&ssl=1
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/extracted-xubuntu-theme.png?resize=709%2C272&ssl=1
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/copy-theme-xubuntu.png?resize=705%2C328&ssl=1
[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/appearance-xfce.png?resize=703%2C544&ssl=1
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/xpro-xubuntu-theme.png?resize=1162%2C599&ssl=1
[11]: https://www.xfce-look.org/browse?cat=132&ord=latest
[12]: https://itsfoss.com/best-icon-themes-ubuntu-16-04/
[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/xubuntu-icon-theme.png?resize=756%2C560&ssl=1
[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/xubuntu-icon-theme-selection.png?resize=739%2C534&ssl=1
[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/xubuntu-icon-theme-change.png?resize=1154%2C619&ssl=1
[16]: https://itsfoss.com/customize-xfce/

View File

@ -0,0 +1,280 @@
[#]: subject: "Use Rust for embedded development"
[#]: via: "https://opensource.com/article/21/10/rust-embedded-development"
[#]: author: "Alan Smithee https://opensource.com/users/alansmithee"
[#]: collector: "lujun9972"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13921-1.html"
使用 Rust 进行嵌入式开发
======
> Rust 的高性能、高可靠性和高生产力使它适合于嵌入式系统。
![](https://img.linux.net.cn/data/attachment/album/202110/26/103848djcdhjk0d2z1hc52.jpg)
在过去的几年里Rust 在程序员中获得了热情的追捧。技术潮流来来去去,所以很难将仅仅因为某项新技术而产生的兴奋与对某项技术的优点的兴奋区分开来,但我认为 Rust 是一种真正设计良好的语言。它的目标是帮助开发者建立可靠和高效的软件,而且它从一开始就是为这个目的设计的。你可能听过一些 Rust 的关键特性,在这篇文章中,我会证明这些特性正是 Rust 也恰好适合嵌入式系统的原因。比如:
* 高性能:它速度快,内存利用率高
* 可靠性:在编译过程中可以消除内存错误
* 生产力:很棒的文档,友好的编译器,有用的错误信息,以及一流的工具化。它有一个集成的包管理器和构建工具,智能的多编辑器支持自动补完和类型检查、自动格式化等等。
### 为什么使用 Rust 进行嵌入式开发?
Rust 的设计是为了保证安全和高性能。嵌入式软件会出现的问题主要是内存的问题。从某种程度上说Rust 是一种面向编译器的语言,所以你可以确保在编译时安全使用内存。以下是使用 Rust 在嵌入式设备上开发的一些好处:
* 强大的静态分析
* 灵活的内存
* 无畏的并发性
* 互操作性
* 可移植性
* 社区驱动
在这篇文章中,我使用开源的 [RT-Thread 操作系统][2] 来演示如何使用 Rust 进行嵌入式开发。
### 如何在 C 语言中调用 Rust
在 C 代码中调用 Rust 代码时,你必须将 Rust 源代码打包成静态库文件。当 C 代码编译时,将其链接进去。
#### 用 Rust 创建一个静态库
在这个过程中,有两个步骤:
1、使用 `cargo init --lib rust_to_c` 在 Clion 中建立一个 `lib` 库。在 `lib.rs` 中加入以下代码。下面的函数计算两个类型为 `i32` 的值的总和并返回结果:
```
#![no_std]
use core::panic::PanicInfo;
#[no_mangle]
pub extern "C" fn sum(a: i32, b: i32) -> i32 {
a + b
}
#[panic_handler]
fn panic(_info:&PanicInfo) -> !{
loop{}
}
```
2、在你的 `Cargo.toml` 文件中添加以下代码,以告诉 Rustc 要生成什么类型的库:
```
[lib]
name = "sum"
crate-type = ["staticlib"]
path = "src/lib.rs"
```
#### 交叉编译
你可以针对你的目标平台进行交叉编译。假设你的嵌入式系统是基于 Arm 的,步骤很简单:
```
$ rustup target add armv7a-none-eabi
```
生成静态库文件:
```
$ cargo build --target=armv7a-none-eabi --release --verbose
Fresh rust_to_c v0.1.0
Finished release [optimized] target(s) in 0.01s
```
#### 生成头文件
你也需要头文件:
1、安装 [cbindgen][3]。`cbindgen` 工具会从 Rust 库中生成一个 C 或 C++11 的头文件:
```
$ cargo install --force cbindgen
```
2、在你的项目文件夹下创建一个新的 `cbindgen.toml` 文件。
3、生成一个头文件
```
$ cbindgen --config cbindgen.toml --crate rust_to_c --output sum.h
```
#### 调用 Rust 库文件
现在你可以对你的 Rust 库进行调用了。
1、把生成的 `sum.h``sum.a` 文件放到 `rt-thread/bsp/qemu-vexpress-a9/applications` 目录下。
2、修改 `SConscript` 文件并添加一个静态库:
```
   from building import *
   
   cwd     = GetCurrentDir()
   src     = Glob('*.c') + Glob('*.cpp')
   CPPPATH = [cwd]
   
   LIBS = ["libsum.a"]
   LIBPATH = [GetCurrentDir()]
   
   group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH, LIBS = LIBS, LIBPATH = LIBPATH)
   
   Return('group')
```
3、在主函数中调用 `sum` 函数,得到返回值,并 `printf` 该值:
```
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <rtthread.h>
#include "sum.h"
int main(void)
{
int32_t tmp;
tmp = sum(1, 2);
printf("call rust sum(1, 2) = %d\n", tmp);
return 0;
}
```
4、在 RT-Thread [Env][4] 环境中,使用 `scons` 来编译项目并运行:
```
$ scons -j6
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
[...]
scons: done building targets.
$ qemu.sh
\ | /
- RT - Thread Operating System
/ | \ 4.0.4 build Jul 28 2021
2006 - 2021 Copyright by rt-thread team
lwIP-2.1.2 initialized!
[...]
call rust sum(1, 2) = 3
```
### 加、减、乘、除
你可以在 Rust 中实现一些复杂的数学运算。在 `lib.rs` 文件中,使用 Rust 语言来实现加、减、乘、除:
```
#![no_std]
use core::panic::PanicInfo;
#[no_mangle]
pub extern "C" fn add(a: i32, b: i32) -> i32 {
a + b
}
#[no_mangle]
pub extern "C" fn subtract(a: i32, b: i32) -> i32 {
a - b
}
#[no_mangle]
pub extern "C" fn multiply(a: i32, b: i32) -> i32 {
a * b
}
#[no_mangle]
pub extern "C" fn divide(a: i32, b: i32) -> i32 {
a / b
}
#[panic_handler]
fn panic(_info:&PanicInfo) -> !{
loop{}
}
```
构建你的库文件和头文件,并把它们放在应用程序目录中。使用 `scons` 来编译。如果在链接过程中出现错误,请在官方 [Github 页面][5] 中找到解决方案。
修改 `rtconfig.py` 文件,并添加链接参数 `--allow-multiple-definition`
```
DEVICE = ' -march=armv7-a -marm -msoft-float'
CFLAGS = DEVICE + ' -Wall'
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -D__ASSEMBLY__ -I.'
LINK_SCRIPT = 'link.lds'
LFLAGS = DEVICE + ' -nostartfiles -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,system_vectors,--allow-multiple-definition'+\
' -T %s' % LINK_SCRIPT
CPATH = ''
LPATH = ''
```
编译并运行 QEMU 来看看你的工作。
### 在 Rust 中调用 C 语言
Rust 可以在 C 代码中调用,但是如何在你的 Rust 代码中调用 C 呢?下面是一个在 Rust 代码中调用 `rt_kprintf` C 函数的例子。
首先,修改 `lib.rs` 文件:
```
// The imported rt-thread functions list
extern "C" {
pub fn rt_kprintf(format: *const u8, ...);
}
#[no_mangle]
pub extern "C" fn add(a: i32, b: i32) -> i32 {
unsafe {
rt_kprintf(b"this is from rust\n" as *const u8);
}
a + b
}
```
接下来,生成库文件:
```
$ cargo build --target=armv7a-none-eabi --release --verbose
Compiling rust_to_c v0.1.0
Running `rustc --crate-name sum --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type staticlib --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no -C metadata=a
Finished release [optimized] target(s) in 0.11s
```
而现在,要运行代码,将 Rust 生成的库文件复制到应用程序目录中,然后重新构建:
```
$ scons -j6 scons: Reading SConscript files ... scons: done reading SConscript files. [...]
scons: Building targets ... scons: done building targets.
```
再次运行 QEMU可以在你的嵌入式镜像中看到结果。
### 你可以拥有这一切
在你的嵌入式开发中使用 Rust你可以获得 Rust 的所有功能,而不需要牺牲灵活性或稳定性。今天就在你的嵌入式系统上试试 Rust 吧。关于嵌入式 Rust 的过程(以及 RT-Thread 本身)的更多信息,请查看 RT-Thread 项目的 [YouTube 频道][6]。请记住,嵌入式也可以是开放的。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/10/rust-embedded-development
作者:[Alan Smithee][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://opensource.com/users/alansmithee
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rust_programming_crab_sea.png?itok=2eWLz8A5 (Ferris the crab under the sea, unofficial logo for Rust programming language)
[2]: https://github.com/RT-Thread/rt-thread
[3]: https://github.com/eqrion/cbindgen
[4]: https://www.rt-thread.io/download.html?download=Env
[5]: https://github.com/rust-lang/compiler-builtins/issues/353
[6]: https://www.youtube.com/channel/UCdDHtIfSYPq4002r27ffqP

View File

@ -0,0 +1,118 @@
[#]: subject: "Fixing “Unable to acquire dpkg frontend lock. Are You Root?” Error on Ubuntu and Other Linux Distributions"
[#]: via: "https://itsfoss.com/fixed-are-you-root-error/"
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13936-1.html"
修复在 Ubuntu 上 “Unable to acquire dpkg frontend lock. Are You Root?” 的错误
======
![](https://img.linux.net.cn/data/attachment/album/202110/30/092452w21q1lyl1ntyy7t3.jpg)
我假设你对 Linux 很陌生。
你按照网上的一些教程,告诉你要安装某个程序或运行某个命令。可能是与服务器有关的东西。
但当你运行这个命令时,你遇到了这个错误:
```
E: Could not open lock file /var/lib/dpkg/lock-frontend open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
```
或者类似的错误:
```
dpkg: error: required read/write access to the dpkg database directory /var/lib/dpkg
E: Sub-process dpkg set-selections returned an error code (2)
E: Executing dpkg failed. Are you root?
```
这两个错误都在问你同一个问题:你是 root 吗?而这就是这个问题的答案。成为 root。
### 成为 root 以避免这个错误
你如何 [在 Ubuntu][1] 或 Debian 中成为 root你使用 `sudo` 命令。
是的,就是这样。无论你在运行什么命令,只要在它前面加上 `sudo` 即可。
```
sudo your_command
```
![Running command with sudo][2]
它将要求你输入你的用户账户密码。请记住,当你输入密码时,屏幕上不会显示任何东西,这也没关系。
你的系统没有任何问题。在大多数 Linux 系统中,输入密码时不会显示通常的星号或其他东西是一种“安全特性”。
只要输入密码,并在密码后按下回车键即可。如果密码输入正确,你现在应该可以运行该命令了。
你甚至可以使用这个方便的 [Linux 命令行技巧][3],用 `sudo` 运行以前的命令:
```
sudo !!
```
这很简单,而且立即生效,除非你没有 sudo 权限。然后,你会看到一个不同的错误。
### 看到一个 “User is not in sudoer file” 的错误?
![Some users cannot run commands with sudo][4]
当你 [安装 Ubuntu][5] 时,你必须创建一个用户账户。这个用户被自动授予 `sudo` 权限,在需要时以 root 身份运行命令。
这发生在 Ubuntu 桌面上,而不是服务器上。大多数服务器发行版会有一个单独的 root 账户。如果你单独创建了一个普通账户,你就必须把这个用户添加到 `sudoer` 中,以便这个普通用户可以使用 `sudo`
在上面的截图中,我已经创建了这个额外的用户,但没有将其添加到 sudo 组中。这意味着这里的用户 `prakash` 没有使用 `sudo` 命令的权限,因此系统抱怨 “prakash is not in sudoers file”。
#### 该事件在哪里报告?
错误的 `sudo` 尝试会被添加到系统日志中。它记录了用户名、虚拟终端号、运行命令的位置和运行的命令。
![Incorrect sudo attempts are logged into the system][6]
这些日志的位置在不同的发行版中有所不同。
通常,在 Ubuntu 中你可以在 `journalctl` 日志或 `/var/log/auth.log` 文件中找到它,在 Fedora 中可以在 `/var/log/audit/audit.log` 文件中找到它。
#### 如果一个用户不在 sudoer 列表中,你能做什么?
当你不能用当前的用户账户使用 `sudo` 时,你能做什么?首先,[验证该用户是否有 sudo 权限。如果没有,你可以有一些选择][7]
* 以 root 身份登录或切换 root 身份(如果你有 root 密码)。
* [将该用户加入 sudoer 列表][8] (如果你有其他用户账户的管理或 `sudo` 权限)。
* 如果你在多用户的 Linux 系统中,自己没有 root 或 `sudo` 权限,请你的系统管理员授予你的用户 sudo 权限或安装你想安装的应用。
### 这有帮助吗?
`sudo` 是一个非常全面的安全机制,它不仅仅是允许一个普通用户成为 root。它有助于对系统进行审计了解哪个用户用 `sudo` 运行了哪个命令。它还可以被配置为只允许某个用户用 `sudo` 运行某些命令。
你不会在桌面 Linux 上看到如此细化的 `sudo` 配置,在桌面 Linux 上,它被预先配置为允许 `sudo` 组中的任何用户以 `root` 的身份运行任何命令。关于 `sudo` 的更多信息,请参见其他文章。
我希望在解决这个经典的初学者问题时,你能对 `sudo` 命令有一些初步的了解。如果你对这个主题有进一步的问题,请在评论区告诉我。
--------------------------------------------------------------------------------
via: https://itsfoss.com/fixed-are-you-root-error/
作者:[Abhishek Prakash][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://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/root-user-ubuntu/
[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/running-commands-with-sudo.webp?resize=800%2C450&ssl=1
[3]: https://itsfoss.com/linux-command-tricks/
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/not-in-sudoer-file-error-800x289.png?resize=800%2C289&ssl=1
[5]: https://itsfoss.com/install-ubuntu/
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/sudo-incident-reported.png?resize=800%2C339&ssl=1
[7]: https://linuxhandbook.com/check-if-user-has-sudo-rights/
[8]: https://linuxhandbook.com/create-sudo-user/

View File

@ -0,0 +1,112 @@
[#]: subject: "Raspberry Pi Zero 2 W is Here!"
[#]: via: "https://news.itsfoss.com/raspberry-pi-zero-2-w-launch/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13931-1.html"
树莓派 Zero 2 W 来了!
======
> 树莓派 Zero W 的继任者来了!仅售 15 美元,它包括一些承诺的升级和改进。
![](https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/raspberry-pi-zero-2-w-ft.png?w=1200&ssl=1)
树莓派 Zero W 是最实惠的包括了无线和蓝牙连接的单板计算机之一。
虽然 [树莓派 Zero 与树莓派 Zero W][1] 之间有一些区别,但考虑到它们分别以 5 美元和 10 美元的价格推出,两者都是靠谱的选择。
现在,树莓派在大约 6 年后推出了这个系列的继任者,即树莓派 Zero 2 W售价为 **$15**。
即使 [树莓派提高了价格][2],我想说 15 美元买一块改进了多线程性能的新一代电路板应该是个不错的选择。
让我们来看看它有什么优点和新的东西。
### 树莓派 Zero 2 W 的规格
![][3]
树莓派 Zero 2 W 使用了在树莓派 3 发布版中使用的相同芯片。
虽然频率略微降低到了 1GHz它仍然能够保证其性能是原来树莓派 Zero 的 5 倍。
下面是它的规格:
* 博通 BCM2710A1四核 64 位SoCArm Cortex-A53 @ 1GHz
* 512MB LPDDR2 SDRAM
* 2.4GHz IEEE 802.11b/g/n 无线网络、蓝牙 4.2BLE
* 1×USB 2.0 接口,带 OTG
* 与 HAT 兼容的 40 针 I/O 针脚
* MicroSD 卡插槽
* mini HDMI 接口
* 复合的视频和复位引脚焊点
* CSI-2 相机连接器
* H.264MPEG-4 解码1080p30H.264 编码1080p30
* OpenGL ES 1.12.0 图形
看看这些规格,考虑到它的外形尺寸,它足够令人印象深刻。不要忘了,他们增加了更多的铜覆层来处理升级后的处理器产生的热量。
![][4]
此外,无线电路是用金属屏蔽密封的,这应该使它容易用于商业终端产品。
![video][5]
如果你已经有了树莓派 Zero 的外壳,那么它应该很有可能适用于 Zero 2 W。
根据 [官方公告][6],树莓派提到:
> 与 Zero 相比,确切的性能提升因工作负载而异,但对于多线程的 [sysbench][7] 来说,它几乎正好是五倍的速度。
小巧的外形和性能的提升应该使它成为安全摄像机和许多其他物联网项目的理想板卡。你可以了解一下我们的 [树莓派 Zero W 的 DIY 项目][8] 清单,看看有什么灵感。
### 一个新的 USB 电源
![][9]
除了新的电路板,树莓派还推出了一个改进的 USB 电源,峰值电流为 2.5A。
该电源配备了一个 micro USB 接口,而不是 USB-C。尽管这不是为新的 Zero 2 W 准备的,而是为树莓派 3B 或 3B+ 准备的。
### 可用性 & 价格
![][10]
树莓派基金会已经澄清,他们在 2026 年 1 月之前不会停产树莓派 Zero 和 Zero W。
因此,如果你想省钱做实验,你可以继续使用旧板。
新的 Zero 2 W 将在官方经销商处以 15 美元的价格出售。目前供货范围仅限于英国、欧盟、美国、加拿大和香港。
它应该在 11 月在澳大利亚和新西兰上市,在接下来的几个月里会有更多国家加入。
- [树莓派 Zero 2 W][11]
你对最新的微型树莓派 Zero 2 W 有什么看法?欢迎在下面的评论中分享你的想法。
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/raspberry-pi-zero-2-w-launch/
作者:[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/raspberry-pi-zero-vs-zero-w/
[2]: https://news.itsfoss.com/raspberry-pi-price-hike/
[3]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/Raspberry-Pi-Zero-2-W.jpg?w=800&ssl=1
[4]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/raspberry-pi-zero-2-w-wireless.jpg?w=800&ssl=1
[5]: https://youtu.be/V2frBYX62LU
[6]: https://www.raspberrypi.com/news/new-raspberry-pi-zero-2-w-2/
[7]: https://github.com/akopytov/sysbench
[8]: https://itsfoss.com/raspberry-pi-zero-projects/
[9]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/rp-power-supply.png?w=800&ssl=1
[10]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/Raspberry-Pi-Zero-2-W-Lifestyle.jpg?w=800&ssl=1
[11]: https://www.raspberrypi.com/products/raspberry-pi-zero-2-w/

View File

@ -0,0 +1,89 @@
[#]: subject: "Microsoft Edge Stable Build is Now Available to Download for Linux"
[#]: via: "https://news.itsfoss.com/microsoft-edge-stable-release/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13935-1.html"
现可下载微软 Edge 的 Linux 稳定版了
=====
![](https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/microsoft-edge-beta-linux-ft.png?w=1200&ssl=1)
> 微软 Edge 的 Linux 最终版本终于亮相了。对于涉足 Linux 的 Windows 用户来说,这似乎是一个值得考虑的选择。
早在 5 月,[微软就启动了 Linux 版的 Edge 的公开测试][1]。
现在,就在正式宣布之前,其稳定版已经被推送到官方仓库。
![][2]
注意:微软 Edge 不是一个开源的浏览器,但它基于开源的组件。我们报道这个是因为它可以用于 Linux。
### 微软 Edge 的 Linux 版本:有什么值得喜欢的?
![][3]
微软 Edge 基于开源的 Chromium这一点并不奇怪。所以是的它只是又一个 [基于 Chromium 的 Linux 浏览器][4]。
然而,与谷歌 Chrome 浏览器相比,微软 Edge 提供了良好的用户体验和一些对 Windows 用户来说可能很方便的额外功能。
根据我在 Windows 10 上的经验,与谷歌 Chrome 浏览器相比,微软 Edge 似乎性能更好,但我还没有为此比较过任何基准。
那么,它对 Linux 是否有用?有什么理由让你去尝试吗?
当然,如果你不喜欢使用微软的服务,那就完全是另一回事了。但是,总的来说,微软 Edge 看起来是一个有前途的基于 Chromium 的浏览器,具有一些有用的功能。
一些可用于 Linux 的关键功能包括:
* 睡眠标签(以节省资源)
* 垂直标签
* 收藏
* 防止跟踪
![][5]
虽然它在配置你的微软账户时也支持家庭安全选项,但并不是每项功能都适用于 Linux。
此外,我没有发现可以派上用场的 Linux 的“儿童模式”。
而且,如果你在使用 Linux 的同时还使用其他桌面平台,微软 Edge 可以是跨平台冒险的一个好选择。
但如果你只想在 Linux 上试用它,你可能想在作出决定之前将它与其他浏览器进行比较。
### 下载微软 Edge Linux 版
想知道 [如何在 Linux 上安装微软 Edge 浏览器][6]?尽管 [微软 Edge 的官方网站][7] 没有列出 Linux 版本,但你可以在他们的官方资源库中找到它。
DEB 和 RPM 两种软件包都是可用的。你可以使用下面的链接下载这些软件包:
- [微软 Edge (deb)][8]
- [微软 Edge (rpm)][9]
Via: [Sophos][10]
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/microsoft-edge-stable-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://news.itsfoss.com/microsoft-edge-beta/
[2]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/microsoft-edge-download.png?w=829&ssl=1
[3]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/microsoft-edge-linux.png?w=1097&ssl=1
[4]: https://news.itsfoss.com/chrome-like-browsers-2021/
[5]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/microsoft-edge-linux-privacy.png?w=1277&ssl=1
[6]: https://itsfoss.com/microsoft-edge-linux/
[7]: https://www.microsoft.com/en-us/edge
[8]: https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/
[9]: https://packages.microsoft.com/yumrepos/edge/
[10]: https://nakedsecurity.sophos.com/2021/10/29/microsoft-edge-finally-arrives-on-linux-official-build-lands-in-repos/

View File

@ -0,0 +1,194 @@
[#]: subject: "Print a Halloween greeting with ASCII art on Linux"
[#]: via: "https://opensource.com/article/21/10/ascii-linux-halloween"
[#]: author: "Jim Hall https://opensource.com/users/jim-hall"
[#]: collector: "lujun9972"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13939-1.html"
在 Linux 上用 ASCII 艺术打印万圣节问候语
======
> 使用 Linux 或 FreeDOS 从一个 C 程序中生成彩色的 ASCII 艺术。
![FreeDOS 上的庆祝万圣节 ASCII 艺术][1]
利用扩展 ASCII 字符集和它的绘画元素集合的全彩 ASCII 艺术在 DOS 上曾经相当流行。你可以在你的下一个 FreeDOS 程序中加入 ASCII 艺术,作为一个很酷的“欢迎”屏幕,或者作为一个提供了更多程序信息的彩色“退出”屏幕,来增加一点视觉上的乐趣。
但是,这种 ASCII 艺术的风格并不仅仅局限于 FreeDOS 程序。你可以在 Linux 终端模式的程序中使用同样的方法。虽然 Linux 使用 [ncurses][2] 来控制屏幕,而不是 DOS 的 [conio][3],但相关的概念也适用于 Linux 程序。本文探讨了如何从 C 语言程序中生成彩色 ASCII 艺术。
### ASCII 艺术文件
你可以使用各种工具来绘制你的 ASCII 艺术。在这个例子中,我使用了一个叫做 TheDraw 的老式 DOS 应用程序,但是你可以在 Linux 上找到现代的开源 ASCII 艺术程序,比如 [Moebius][4]Apache 许可证)或者 [PabloDraw][5]MIT 许可证)。只要你知道保存的数据是什么样子的,你使用什么工具并不重要。
下面是一个 ASCII 艺术文件样本的一部分,以 C 源代码保存。请注意,这个代码片段定义了几个值。`IMAGEDATA_WIDTH` 和 `IMAGEDATA_DEPTH` 定义了屏幕上的列数和行数。在这里,它是一个 80x25 的 ASCII 艺术“图像”。`IMAGEDATA_LENGTH` 定义了 `IMAGEDATA` 数组中的条目数量。ASCII 艺术画面中的每个字符可以用两个字节的数据表示。要显示的字符和包含该字符的前景和背景颜色的颜色属性。对于一个 80x25 的屏幕,每个字符都与一个属性配对,该数组包含 4000 个条目(即 `80*25*2=4000`)。
```
#define IMAGEDATA_WIDTH 80
#define IMAGEDATA_DEPTH 25
#define IMAGEDATA_LENGTH 4000
unsigned char IMAGEDATA [] = {
    '.', 0x08,  ' ', 0x08,  ' ', 0x08,  ' ', 0x08,  ' ', 0x08,  ' ', 0x08,
    ' ', 0x08,  ' ', 0x08,  '.', 0x0F,  ' ', 0x08,  ' ', 0x08,  ' ', 0x08,
    ' ', 0x08,  ' ', 0x08,  ' ', 0x08,  ' ', 0x08,  ' ', 0x08,  '.', 0x0F,
    ' ', 0x08,  ' ', 0x08,  ' ', 0x08,  ' ', 0x08,  ' ', 0x08,  ' ', 0x08,
    ' ', 0x08,  ' ', 0x08,  ' ', 0x08,  ' ', 0x08,  ' ', 0x08,  ' ', 0x08,
```
数组的其它部分依此类推。
为了在屏幕上显示这种 ASCII 艺术,你需要写一个小小的程序来读取数组并以正确的颜色打印每个字符。
### 设置一个颜色属性
这个 ASCII 艺术文件中的颜色属性在一个字节中定义了背景和前景的颜色,用十六进制的值表示,如 `0x08``0x6E`。十六进制是适合表达这样的颜色“对”的紧凑方式。
像 Linux 上的 ncurses 或 DOS 上的 conio 这样的字符模式系统 [只能显示 16 种颜色][6]。这就是十六种可能的文本颜色和八种背景颜色。用二进制计算十六个值(从 0 到 15只需要四个二进制位。
> `1111` 是二进制的 15
而且方便的是,十六进制可以用一个字符表示 0 到 15`0`、`1`、`2`、`3`、`4`、`5`、`6`、`7`、`8`、`9`、`A`、`B`、`C`、`D`、`E` 和 `F`。所以十六进制的值 `F` 是数字 15或二进制的 `1111`
通过颜色对,你可以用一个八位的字节来编码背景和前景的颜色。这就是文本颜色的四个二进制位(十六进制中的 0 到 15 或 0 到 F和背景颜色的三个二进制位十六进制中的 0 到 7 或 0 到 E。字节中剩余的二进制位在这里没有使用所以我们可以忽略它。
为了将颜色对或属性转换成你的程序可以使用的颜色值,你需要 [使用位掩码][7],只指定用于文字颜色或背景颜色的位。使用 FreeDOS 上的 OpenWatcom C 编译器,你可以编写这个函数,从颜色属性中适当地设置颜色。
```
void
textattr(int newattr)
{
_settextcolor(newattr & 15); /* 0000xxxx */
_setbkcolor((newattr >> 4) & 7); /* 0xxx0000 */
}
```
`_settextcolor` 函数只设置文本颜色,`_setbkcolor` 函数设置背景颜色。两者都定义在 `graph.h` 中。注意,由于颜色属性在一个字节值中包括了背景色和前景色,`textattr` 函数使用 `&`(二进制的“与”运算)来设置一个位掩码,只隔离了属性中的最后四个位。这就是颜色对存储前景颜色的值 0 到 15 的地方。
为了得到背景色,该函数首先执行了一个位移,将位“推”到右边。这就把“上”位放到了“下”位范围,所以任何像 `0xxx0000` 这样的位都变成了 `00000xxx`。我们可以用另一个的位掩码 7二进制 `0111`)来挑选出背景颜色值。
### 显示 ASCII 艺术
`IMAGEDATA` 数组包含整个 ASCII 艺术屏幕和每个字符的颜色值。为了在屏幕上显示 ASCII 艺术,你的程序需要扫描该数组,设置颜色属性,然后一次在屏幕上显示一个字符。
让我们在屏幕的底部留出空间,以便向用户提供单独的信息或提示。也就是说,我不想显示一个 80 列 ASCII 屏幕的所有 25 行,而只想显示前 24 行。
```
/* print one line less than the 80x25 that's in there:
80 x 24 x 2 = 3840 */
for (pos = 0; pos < 3840; pos += 2) {
...
}
```
`for` 循环里面我们需要设置颜色然后打印字符。OpenWatcom C 编译器提供了一个函数 `_outtext` 来显示带有当前颜色值的文本。然而,这需要传递一个字符串,如果我们需要一个一个地处理每个字符,在一行中的每个字符需要不同颜色的情况下,效率就会很低。
相反OpenWatcom 有一个类似的函数,叫做 `_outmem`,允许你指示要显示多少个字符。对于一次一个字符,我们可以在 `IMAGEDATA` 数组中提供一个字符值的指针,并告诉 `_outtext` 只显示一个字符。这将使用当前的颜色属性显示该字符,这就是我们需要的。
```
for (pos = 0; pos < 3840; pos += 2) {
ch = &IMAGEDATA[pos]; /* pointer assignment */
attr = IMAGEDATA[pos + 1];
textattr(attr);
_outmem(ch, 1);
}
```
这个更新的 `for` 循环通过向 `IMAGEDATA` 数组分配一个指针来设置字符 `ch`。接下来, 循环设置文本属性, 然后用 `_outmem` 显示字符.
### 整合起来
有了 `textattr` 函数和处理数组的 `for` 循环, 我们可以编写一个完整的程序来显示 ASCII 艺术文件的内容。对于这个例子,将 ASCII 艺术文件保存为 `imgdata.inc`,并用 `#include` 语句将其包含在源文件中。
```
#include <stdio.h>
#include <conio.h>
#include <graph.h>
#include "imgdata.inc"
void
textattr(int newattr)
{
_settextcolor(newattr & 15); /* 0000xxxx */
_setbkcolor((newattr >> 4) & 7); /* 0xxx0000 */
}
int
main()
{
char *ch;
int attr;
int pos;
if (_setvideomode(_TEXTC80) == 0) {
fputs("Error setting video mode", stderr);
return 1;
}
/* draw the array */
_settextposition(1, 1); /* top left */
/* print one line less than the 80x25 that's in there:
80 x 24 x 2 = 3840 */
for (pos = 0; pos < 3840; pos += 2) {
ch = &IMAGEDATA[pos]; /* pointer assignment */
attr = IMAGEDATA[pos + 1];
textattr(attr);
_outmem(ch, 1);
}
/* done */
_settextposition(25, 1); /* bottom left */
textattr(0x0f);
_outtext("Press any key to quit");
getch();
textattr(0x00);
return 0;
}
```
在 FreeDOS 上使用 OpenWatcom C 编译器编译该程序,你会得到一个显示这个节日信息的新程序。
![ASCII艺术中的万圣节信息][8]
*万圣节快乐Jim Hall, [CC-BY-SA 4.0][9])*
万圣节快乐,各位!
- [在此下载 inc 代码文件][10]
- [在此下载 C 代码文件][11]
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/10/ascii-linux-halloween
作者:[Jim Hall][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://opensource.com/users/jim-hall
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/freedos-halloween-4x3.jpg?itok=6e_42rs9 (Happy Halloween ASCII art on FreeDOS)
[2]: https://opensource.com/article/21/8/ncurses-linux
[3]: https://opensource.com/article/21/9/programming-dos-conio
[4]: https://blocktronics.github.io/moebius/
[5]: https://github.com/blocktronics/pablodraw
[6]: https://opensource.com/article/21/6/freedos-sixteen-colors
[7]: https://opensource.com/article/21/8/binary-bit-fields-masks
[8]: https://opensource.com/sites/default/files/freedos-halloween-4x3.png
[9]: https://creativecommons.org/licenses/by-sa/4.0/
[10]: https://opensource.com/sites/default/files/uploads/imgdata.inc_.txt
[11]: https://opensource.com/sites/default/files/uploads/hallown.c.txt

View File

@ -1,88 +0,0 @@
[#]: subject: "SuperTuxKart 1.3 Release: Open Source Game for Linux Adds Switch Support"
[#]: via: "https://news.itsfoss.com/supertuxkart-1-3-release/"
[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
SuperTuxKart 1.3 Release: Open Source Game for Linux Adds Switch Support
======
One of the most popular open-source games, SuperTuxKart, has finally received a significant update after a gap of almost a year. It is a free and cross-platform 3D kart-racing game available for Linux, macOS, Windows, and Android.
Just like Mario Kart, you can choose from a vast catalog of characters (based on mascots of open-source projects) racing in unique karts using special items to win races in various arenas. The game also features various racing modes, including a story Mode and an online Mode, to keep you engaged.
Let us see whats new with the latest release.
### Nintendo Switch Port
![Source: blog.supertuxkart.net][1]
SuperTuxKart is now (unofficially) playable on the Switch. This has been possible due to the SDL2 implementation that was already used in the previous 1.2 release. To play the game, you will need to have **Homebrew** installed on your console.
Moreover, the game also supports force feedback for the Joy-Cons and other controllers. This will undoubtedly make the game more lively whenever there are effects on-screen.
### New Arenas
Two new arenas — Ancient Colosseum Labyrinth and Alien Signal — have been introduced.
![Source: blog.supertuxkart.net][2]
The Ancient Colosseum Labyrinth is based on the Roman Colosseum with a dark setting and a secret tunnel. On the other hand, the Alien Signal is another arena inspired by a SETI-styled location with strange markings on the ground.
The Las Dunas Soccer Stadium has also been updated and now houses a symmetrical soccer field.
Lastly, lap line extensions have been added to various tracks. This means the lap will be counted even if you drive slightly off the main road.
### GUI Improvements
A major feature that will improve the gameplay experience is the introduction of **render resolution**. Using the slider, you can sacrifice the resolution for better frame rates on low-end systems.
The high score selection screen now has its independent menu and displays the best times for normal races, egg hunts, and time trials.
You can also open links in the game. Specifically, the links in a text/instruction that pops up in the game. This is possible, thanks to the SDL2 SDL_OpenURL.
Blender 2.8 was officially used by artists to create tracks, maps, and more.
### Redesigned Karts
![Source: blog.supertuxkart.net][3]
Your favorite characters like GNU, Adiumy and Emule have undergone visual changes. Sara the Racer is now replaced by Pepper, the mascot of Pepper&amp;Carrot.
You can refer to the [official release notes][4] for detailed information about the update.
[Download SuperTuxKart 1.3][5]
### Wrapping Up
Overall, SuperTuxKart 1.3 has brought in exciting changes and fixes. Nintendo Switch users will now have something fresh to try out and play!
What do you think about this release? Will you be willing to try it out on your Switch? Do share your thoughts below.
#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
I'm not interested
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/supertuxkart-1-3-release/
作者:[Rishabh Moharir][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://news.itsfoss.com/author/rishabh/
[b]: https://github.com/lujun9972
[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjczMiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM2NSIgd2lkdGg9IjY0OSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI2NCIgd2lkdGg9IjI0MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[4]: https://blog.supertuxkart.net/2021/09/supertuxkart-13-release.html
[5]: https://github.com/supertuxkart/stk-code/releases/tag/1.3

View File

@ -1,59 +0,0 @@
[#]: subject: "Open Source Changed Linux Otherwise It Was Done: Linus Torvalds"
[#]: via: "https://news.itsfoss.com/open-source-changed-linux-torvalds/"
[#]: author: "Abhishek https://news.itsfoss.com/author/root/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Open Source Changed Linux Otherwise It Was Done: Linus Torvalds
======
You probably already know the story. 30 years ago, Finnish student Linus Torvalds created a UNIX-like operating system as a hobby project.
What you do not know is that Torvalds thought that the hobby project was done, and he would have left it behind to work on some new and interesting project.
So, what made his work on this hobby project for 30 years? The answer is open source.
### Open source changed Linux
At the recently concluded [Open Source Summit North America event][1], Linus Torvalds shared some insights into the past, present and future of the Linux project.
While remembering the beginning of the project, [Torvalds said][2] that hed expected to leave behind Linux in a done state to work for something new and interesting.
> That was clearly then what open source changed. Because suddenly this project — that I probably wouldve left behind, if it was only up to me — I started getting questions about, and eventually patches — that just kept the motivation going. And here we are 30 years later, and its still what keeps the motivation going.
Torvalds also added that as far as he is concerned, Linux is done for the past 29 years. Every other feature that has been added later is about what other people needed, wanted or were interested in.
Many developers would relate to this. You work on a project and think that it has reached a done state. If the project does not get enough traction, you lose interest to work on it and move to something new and exciting. The real motivation to continue the project comes from the users and the recognition.
When asked about what they should be doing for the 50th anniversary of Linux, Torvalds said that he doesnt see himself doing kernel programming at the age of 70. Then he also chipped in that he didnt imagine himself doing kernel programming at the age of 50 as well and yet he is doing that at present.
> “Somehow I dont see myself doing kernel programming when Im 70. But on the other hand, I didnt see myself doing kernel programming when I was 50 either, a few years back. So… well see.”
It is always endearing to listen to Torvalds talking about Linux. So much to learn and to relate as an ardent Linux user, right?
_Source: [The News Stack][2]_
#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
I'm not interested
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/open-source-changed-linux-torvalds/
作者:[Abhishek][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://news.itsfoss.com/author/root/
[b]: https://github.com/lujun9972
[1]: https://events.linuxfoundation.org/open-source-summit-north-america/
[2]: https://thenewstack.io/linus-torvalds-on-community-rust-and-linuxs-longevity/

View File

@ -1,79 +0,0 @@
[#]: subject: "It Seems Pop OS Linux Will Soon be Available on Raspberry Pi and Other ARM Devices"
[#]: via: "https://news.itsfoss.com/pop-os-raspberry-pi-coming-soon/"
[#]: author: "Abhishek https://news.itsfoss.com/author/root/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
It Seems Pop OS Linux Will Soon be Available on Raspberry Pi and Other ARM Devices
======
There was a time when only lightweight [operating systems were available for ARM devices like Ra][1]spberry Pi. Why? Because earlier ARM devices had low end hardware with limited RAM and CPU.
It all changed when Raspberry Pi 4 targeted desktop users with its 8 GB variant and doubled down on it with the introduction of Raspberry Pi 400.
This resulted in bringing the support of mainstream desktop Linux distributions to Raspberry Pi. Thanks to that, you can now [install Ubuntu desktop on Raspberry Pi][2].
Since Ubuntu desktop now supports ARM devices, other Ubuntu-based distros should join the ARM bandwagon soon. And it seems Pop!_OS is ready to board it.
### Pop OS coming soon on Raspberry Pi!
System76s Principal Engineer and maintainer of Pop!_OS, Jeremy Soller shared a teaser photo on Twitter recently. The image is basically a screenshot of Neofetch running in terminal.
> <https://t.co/OXg3Md0erk> [pic.twitter.com/ehfGXwtsBf][3]
>
> — Jeremy Soller (@jeremy_soller) [September 28, 2021][4]
If you look closely, you can see that some details that indicate that it is running on a Raspberry Pi device.
![][5]
The host name indicates Raspberry Pi and so does the BCM2835 CPU (chip used on Raspberry Pi devices). You can also notice the aarch64 in the OS name.
In addition to that, Jeremy also shared a repository link that contains Pop OS packages for ARM devices. Heres the [link][6].
> 😉 <https://t.co/pKIbxX2iFk>
>
> — Jeremy Soller (@jeremy_soller) [September 28, 2021][7]
### How soon?
There is no other information available from Systm76 on this front. But if I have to make a guess, I would say that the upcoming Pop!_OS 21.10 version will have an ARM version for Raspberry Pi like devices.
This is not a blind guess. The ARM repository link shared by Jeremy clearly mentions impish in its directory structure. Impish Indri is the codename for the upcoming [Ubuntu 21.10 slated for release][8] on 14th October.
Pop!_OS 21.10 follows the release of Ubuntu 21.10 and should be released soon afterwards. All this gives us enough clue to surmise that Pop!_OS is coming to Raspberry Pi devices this month.
This is indeed a good thing because Pop!_OS is popular among developers. This could mean more developers using Raspberry Pi as their development environment.
I am delighted to see this development. How about you?
#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
I'm not interested
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/pop-os-raspberry-pi-coming-soon/
作者:[Abhishek][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://news.itsfoss.com/author/root/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/raspberry-pi-os/
[2]: https://itsfoss.com/install-ubuntu-desktop-raspberry-pi/
[3]: https://t.co/ehfGXwtsBf
[4]: https://twitter.com/jeremy_soller/status/1442977756623429640?ref_src=twsrc%5Etfw
[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[6]: https://apt.pop-os.org/release/dists/impish/main/binary-arm64/
[7]: https://twitter.com/jeremy_soller/status/1442976088053796870?ref_src=twsrc%5Etfw
[8]: https://news.itsfoss.com/ubuntu-21-10-release-schedule/

View File

@ -1,79 +0,0 @@
[#]: subject: "GNOME 42 to Introduce a System-wide Dark Style Preference, Thanks to elementary OS"
[#]: via: "https://news.itsfoss.com/gnome-42-dark-style-preference/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
GNOME 42 to Introduce a System-wide Dark Style Preference, Thanks to elementary OS
======
Theres still time for GNOME 42, but it looks like it will implement a system-wide dark mode preference similar to [elementary OS 6][1].
If you have been reading our coverages, you must have noticed mentioning it as one of the [best elementary OS 6 features][2].
And for all the right reasons. Unlike a GTK theme change, elementary OS 6 approached the dark style preference as an opt-in preference that application developers can detect and choose to respect.
Even though this means that theres more to be expected from the app developers, but when successful, it should result in a consistent dark mode experience.
In a [blog post][3] by GNOME developer _Alex_, he mentioned that GNOME would be following elementary OSs approach while making it a standard to introduce a system-wide dark style preference in GNOME 42.
### Consistent Dark Mode Experience Even with Flatpak Sandbox
When it comes to a GTK theme, it is often a problem for Flatpak applications to inherit it because of the sandboxing.
However, with an implementation planned for GNOME 42, any application (including Flatpak apps) can access the settings portal and know the dark style preference without cutting down the security provided by the sandboxing.
This work aims to ensure that every type of application (built with any toolkit) and on any desktop should be able to detect and respect the dark style preference.
The only difference between elementary OS and GNOMEs implementation will be the use of libadwaita API with GNOME 42. You may want to check out an older [blog post][4] by Adrien, another GNOME developer, to know more about Libadwaita.
Alex also shared a video giving a sneak peek at how the transitions may look like (which is, of course, a work in progress).
![][5]
As you can notice, application developers need to update their applications to respect this preference to make the switch/transition from light/dark mode a seamless experience.
And, further, to bring this change to GNOME 42, there is a couple of significant development work remaining:
* A preference option in the settings menu thats easy to use (probably under “Background/Appearance” settings)
* A switch in gnome-shell to quickly toggle the preference
* Day/night scheduling option
* A dark mode version of the wallpaper synchronized to the preference
### Wrapping Up
The core and first-party applications will have to support the dark style preference before GNOME 42 release to kick things off.
While third-party developers should also get on the bandwagon, given the difference this makes, it would take time for all your essential/favorite tools to support it.
_What do you think about GNOME 42 bringing a system-wide dark mode preference, following the footsteps of elementary OS? You are welcome to share your thoughts in the comments down below_.
#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
I'm not interested
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/gnome-42-dark-style-preference/
作者:[Ankush Das][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://news.itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://news.itsfoss.com/elementary-os-6-release/
[2]: https://news.itsfoss.com/elementary-os-6-features/
[3]: https://blogs.gnome.org/alexm/2021/10/04/dark-style-preference/
[4]: https://aplazas.pages.gitlab.gnome.org/blog/blog/2021/03/31/introducing-libadwaita.html
[5]: https://i0.wp.com/i.ytimg.com/vi/urXch15ySGU/hqdefault.jpg?w=780&ssl=1

View File

@ -1,93 +0,0 @@
[#]: subject: "Feren OS 2021.10 Release Introduces a New Firefox Configuration and UI Improvements"
[#]: via: "https://news.itsfoss.com/feren-os-2021-10-release/"
[#]: author: "Omar Maarof https://news.itsfoss.com/author/omar/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Feren OS 2021.10 Release Introduces a New Firefox Configuration and UI Improvements
======
Feren OS is a Linux/GNU distribution based on Ubuntu.
The latest 2021.10 release, codenamed Gallium, presents new features and changes. Lets take a look at them.
### Feren OS 2021.10: Whats New?
#### A New Configuration For Mozilla Firefox
![][1]
Feren OS 2021.10 aims to offer a hassle-free Mozilla web browsing experience by removing the unnecessary elements of the browser.
For new users, Mozilla Firefox comes pre-installed with a new configuration. Things like [removing the title bar from Mozilla Firefox][2], getting rid of distractions in a new tab, are some of the configurations made.
Overall, these are the changes made to Firefox:
* Compact Mode and no title bar by default
* No Pocket by default
* The Library is now in the toolbar (as was intended by Mozilla themselves during early Proton design ideas) instead of Pockets button
* Skipped Welcome Screens to allow you to get right into the action
If you have never launched Firefox (or have a fresh install of Feren OS), you will get the configuration out-of-the-box. In either case, you will have to install the **firefox-config-feren** package from the web browser manager.
#### New Splash Screen
The new update comes with a redesigned splash screen. As a consequence, now it looks smoother and more elegant, especially when transitioning from the login screen to the desktop.
![][3]
#### Refreshed Lock Screen
The new lock screen is a mixture of the Feren OS login screens design style and KDE plasmas lock screen features.
![Feren OS 2021.10 Lock Screen][4]
As a result, it combines elegance and functionality. From the lock screen, you will have access to your music, a virtual keyboard, and more.
![Feren OS 2021.10 Login Screen][4]
#### New Wallpapers
With every new release, you can notice some new wallpapers. And, Feren OS 2021.10 is no exception.
Some interesting wallpapers have been added from sources like Unsplash and some were removed.
### Upgrading &amp; Downloading
You should be easily able to get the new update from the update manager. In case you run into issues, you can refer to the [official blog post][5] for a solution to fix the most common problem encountered when updating.
For more details on this release, refer to [the official announcement][6].
[Download Feren OS 2021.10][7]
#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
I'm not interested
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/feren-os-2021-10-release/
作者:[Omar Maarof][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://news.itsfoss.com/author/omar/
[b]: https://github.com/lujun9972
[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[2]: https://itsfoss.com/remove-title-bar-firefox/
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM5MyIgd2lkdGg9IjcwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM1OCIgd2lkdGg9IjcwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[5]: https://medium.com/feren-os/the-repository-keyring-expired-heres-how-to-renew-it-bd50dd874aac
[6]: https://medium.com/feren-os/feren-os-2021-10-iterative-improvements-993aab5dba51
[7]: https://ferenos.weebly.com/get-feren-os.html

View File

@ -1,85 +0,0 @@
[#]: subject: "TUXEDOs Linux Gaming Ultrabook “InfinityBook Pro 14” Now Sports an RTX 3050 Ti and 3K Display"
[#]: via: "https://news.itsfoss.com/tuxedos-infinitybook-14/"
[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
TUXEDOs Linux Gaming Ultrabook “InfinityBook Pro 14” Now Sports an RTX 3050 Ti and 3K Display
======
Tuxedo has recently unveiled its latest and exciting revision to its InfinityBook Pro 14. Despite weighing just around one kg, this sleek-looking ultrabook packs in impressive specs and can pretty much run various AAA games. Lets take a look at what this laptop has to offer.
### Updated Specifications
![Source: Tuxedo][1]
#### Processor Upgrade
The refreshed offering has updated the processors to high-performance **Intel Core i5-11300H and Core i7-11370H** instead of the power-saving chips in the previous iteration.
In case you didnt know, the performance-oriented chips can utilize up to 60 watts (TDP) to provide you the enhanced performance.
#### New-Gen RTX Graphics
As for the graphics side, youll find NVIDIAs mid-range **GeForce RTX 3050 Ti** along with the integrated Iris Xe graphics. This is a power-efficient MaxQ variant that promises a TGP of 35 watts.
Considering this as a mid-tier GPU, it should be enough for gaming with 1080p settings.
Do note there are no 3050ti available in the market separately. It is currently limited to OEMs/laptops.
This graphics card is very beneficial for gamers on the go as it supports NVIDIAs DLSS, like all RTX GPUs, for a stepped-up gaming experience.
Also, its never been a better time because Linux gamers can now [enable DLSS for DX11/12 and Vulkan-based games like Cyberpunk 2077][2].
### Other Features
If youre worried about cooling, fret not. The laptop comes with an all-new cooling system that contains two heat pipes and two fans. Thus, working under heavy workloads is no longer an issue.
As for the storage and memory, two M.2 NVME SSD slots and dual-channel RAM up to 64 GB can be seen.
The I/O ports include an HDMI 2.0, USB-C 3.2 Gen2, two USB-A 3.2 Gen1 ports, an SD card reader, and a Thunderbolt 4 port.
Finally, a large **53 Wh battery** is also included that ensures 12 hours (idle) of runtime. This is pretty helpful to that stunning 14 inch **Omnia 3K IPS display.**
### Availability and Pricing
The InfinityBook Pro 14 **starts at 1180 EUR** and goes all the way **up to 1770 EUR** if you need the 3K Omnia display and Core i7-11370H.
Preorders have already started from Oct 6th. You can head to its official website to explore more about the product and its availability.
[TUXEDO Computers][3]
### Wrapping Up
This is one beast of an ultrabook that doubles as a gaming laptop. However, I dont understand the inclusion of 3050ti with a 3K display. So, if you are looking for other options, I would suggest [exploring other places to buy Linux laptops][4].
Users frequently on the go will find this laptop useful for both work and play, thanks to the laptops weight and power.
_What do you think about this laptop? Do share your thoughts below_.
#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
I'm not interested
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/tuxedos-infinitybook-14/
作者:[Rishabh Moharir][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://news.itsfoss.com/author/rishabh/
[b]: https://github.com/lujun9972
[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU2NyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[2]: https://news.itsfoss.com/nvidia-dlss-dx-11-12-proton/
[3]: https://www.tuxedocomputers.com/en/Linux-Hardware/Linux-Notebooks/10-14-inch/TUXEDO-InfinityBook-Pro-14-Gen6.tuxedo#
[4]: https://itsfoss.com/get-linux-laptops/

View File

@ -1,151 +0,0 @@
[#]: subject: "Heres Why You Can Consider Linux as a Content Creator"
[#]: via: "https://news.itsfoss.com/linux-content-creator-choice/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Heres Why You Can Consider Linux as a Content Creator
======
Rewind to four/five years back, I did not use Linux as my daily driver. Yes, in a virtual machine or dual-boot, sure.
I stuck with Windows saying “Linux isnt user-friendly, and its all about the commands/terminal.”
In my defense, I did not know a lot of things back then. But, when I finally took the leap of faith and started using Linux as a daily driver, I began to explore how things work and was blown away by many things.
Including some of the compelling reasons why [Linux is better than Windows][1].
It took me a couple of days to understand the fundamentals and learn about the software utilities not available for Linux.
But, surprisingly, I did not need to use Windows for most of my tasks, except multiplayer gaming. And, thanks to Valve, thats about to change with the [support for BattleEye, and Easy-Anti Cheat added to Linux][2].
Fret not; Im not one of those who recommends ditching other operating systems. You should always use what you are comfortable with.
But, in this article, I want to highlight a few things why you may want to switch to Linux as a content creator like myself.
### Efficient System Resource Usage
![][3]
Im not exaggerating here, but if you are going to use [one of the best Linux distributions][4], your system resources will thank you for choosing Linux.
Considering my scenario, I have an i5-7400 processor coupled with 16 GB of RAM.
When I boot into Windows, the startup programs like the antivirus, software tools for peripherals, and others already eat up about 30-40% of my RAM.
And, when I start using the browser or any other resource-intensive application, I barely get to multi-task freely.
When it comes to Linux, unless I open many tabs in the browser or multiple programs, it does not consume a lot of memory out-of-the-box.
Windows has a lot of services/processes running in the background, and you need to put in some effort to “de-bloat” your experience. But, Linux does not require such tweaks to manage the resources; it already does it well.
I know it isnt exactly an “Apples to Apples” comparison. Still, I would consider myself somewhat a power user with a lot of browser tabs active to research and multiple applications (communication, productivity, virtual machine program, etc.) while constantly monitoring system performance.
Hence, in my experience, _I feel I can do more with Linux using the same resources compared to Windows._
And, as a content creator, you probably know how important it is to have an efficient system that maximizes your productivity without being a strain on your life.
### Is It All About the Web Browsers?
![][3]
Lets face it—most of the tools are being available as web services. While some programs/utilities may stick to native offerings, everything else is increasingly relying on cloud computing to help you get things done via the web browser.
So, you should evaluate the tools you use and whether they are platform-dependent or not.
If not, all you need to use is the web browser.
To give you an example, I utilize a lot of tools right from the web browser like:
* [Canva][5]
* [Microsoft Office 365][6]
* Web-based feed readers like Feedly, Inoreader
* Todist
* [CryptPad][7]
And, if thats the case, do you think theres any reason to consider Windows? Ill leave that up to you.
Linux supports all the major web browsers, including Microsoft Edge.
### Hassle-free Experience
![][3]
As a content creator, the less you worry about troubleshooting issues on your computer, the more time you save.
Im sure you know how Microsofts Windows fairs when it comes to buggy updates. Now and then, I will have to re-configure my audio settings or update the graphics driver, re-install programs, and clean junk files after an update.
And, there have been a few instances where I just get stuck looking at the welcome screen after an update, annoyed by a feature added by Microsoft, and some more.
Regarding my Linux experience, other than some NVIDIA graphics drivers issues (for some distributions like Fedora), I never had to troubleshoot for anything else. It has been a hassle-free journey so far!
So, I focus on my work without even worrying about an update screwing up my system.
The only inconvenience I found with Linux was developing the habit of “_Distro hopping_,” meaning trying new Linux distributions. Considering there are a lot of choices for your desktop OS, you may be encouraged to try another distribution looking at its features.
Here, let me point you to [Zorin OS 16][8] and [elementary OS 6][9] if you arent already using them (good luck!).
### Applications for Audio, Video, and Digital Art/Photo
While some users may warn you that Linux does not offer good application support, the answer isnt that straightforward.
Yes, you do not have the support for the Adobe suite and some commercial applications. But you do have alternatives.
Of course, if you swear by a specific software tool, Linux is a big no for you. But, if you do not have specific requirements, you can always choose to explore the exciting alternatives available.
You can find capable video editors like Kdenlive, tools like GIMP, and several other applications used by professionals.
To get a better idea, you might want to check:
* [Free video editors for Linux][10]
* [Tools for digital artists][11]
* [Audio editing tools][12]
There are some decent, social media specific, browser-based video editors are also available.
### Wrapping Up
Overall, I believe that Linux can be a perfectly suitable choice for content creators and creative professionals.
Linux as a desktop platform has improved a lot. And, with several Linux distributions pushing forward to enhance user experience, security, and reliability, it is an uncommon but beneficial choice that comes with benefits!
What do you think about Linux as a choice for content creators? Let me know what you think in the comments!
#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
I'm not interested
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/linux-content-creator-choice/
作者:[Ankush Das][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://news.itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/linux-better-than-windows/
[2]: https://news.itsfoss.com/easy-anti-cheat-linux/
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[4]: https://itsfoss.com/best-linux-distributions/
[5]: http://partner.canva.com/yRbxmN
[6]: https://www.office.com
[7]: https://itsfoss.com/cryptpad/
[8]: https://news.itsfoss.com/zorin-os-16-features/
[9]: https://news.itsfoss.com/elementary-os-6-features/
[10]: https://itsfoss.com/best-video-editing-software-linux/
[11]: https://itsfoss.com/best-linux-graphic-design-software/
[12]: https://itsfoss.com/best-audio-editors-linux/

View File

@ -0,0 +1,88 @@
[#]: subject: "Reach your open source community with content marketing"
[#]: via: "https://opensource.com/article/21/10/content-marketing-open-source-community"
[#]: author: "Will Kelly https://opensource.com/users/willkelly"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Reach your open source community with content marketing
======
Technology and content marketing teams can work together to reach the
community around an open source software project.
![people in different locations who are part of the same team][1]
Both startups and more established firms are increasingly turning to content marketing as a way of reaching prospective customers.
However, corporate marketers often consider the open source software (OSS) community a challenge to reach. This article features ways your technology and content marketing teams can work together to target and reach the community around an OSS project your organization supports.
### Content marketing: a definition
You can find multiple definitions of content marketing online. For this article, I define content marketing as the creation and sharing of online content, such as blog posts, white papers, videos, and social media posts. This content doesn't explicitly promote a brand or products, but it is still designed to gain the attention of prospective buyers for a company's products and solutions.
Content marketing and [thought leadership][2] have become intertwined, which you can use to your advantage by taking content marketing targeting other audiences and repurposing it for the OSS community. Publish content to your OSS community that helps the community around your OSS project. Think of tutorials, code snippets, and other content that can help your OSS users become more effective.
Software vendors can also be thought leaders through content marketing. Enterprises are seeking solutions for their technology, digital transformation, and other challenges. While there are paid media publishers doing excellent work, there's always more work to be done. Vendor-sponsored content can be a valuable source of information.
### Content marketing in an OSS world
Vendors with open source and enterprise products need to approach content marketing for open source users, focusing on the values and development practices of the open source community.
#### Treat content as another contribution to the open source community
Content plays a vital role in the open source community. Your content can serve as another contribution to the open source communities you serve as long as you focus on the key elements:
* Ensuring your content has technical depth
* Excluding anything sales from your content such as pricing or information about how to upgrade to the enterprise version of your software
* Keeping marketing of your enterprise's products out of your content such as talk of a feature thats only in your enterprise version but not your OSS
Your content marketing to the open source community shouldn't be about driving sales. Instead, think about contributing to the community you want to build around your open source software. If you're treating your blog posts and white papers as vendor agnostic, with a focus on education and outreach, you've already taken a step towards content marketing suited to an open source community.
#### Partner your marketing team with open source advocates
Marketing teams may not be familiar with the ways of the open source community. If that's the case in your organization, consider partnering your content marketing manager with your open source advocates. Partnering could take a few forms:
* Partner your content marketing manager with your developer relations team
* Join your content marketing with your [open source program office][3] efforts
* Involve your in-house open source developers with your content marketing projects as content creators and technical reviewers
Open source is about community. Partnering your content marketing with employees already active in OSS gives your content marketing manager an entry into the community. While you can't expect your marketing team to be OSS advocates, you can set expectations for them to learn firsthand about the community in much the same way they learned about the industry.
#### Create open source personas and messaging
While personas and messaging remain challenges for some software vendors, publishing content to an open source community means reaching a new audience. You need to create new open source personas and messaging to go along with your marketing team's other personas and messaging.
To get open source messaging right, you need to involve your in-house open source advocates and SMEs in the ideation and creation of the messaging. Avoid outsourcing these crucial steps to a third-party marketing consultant. People who work directly with your open source community are the best resources to understand the audience and what messages may resonate with them. Open source experts tapped to help with corporate messaging should be prepared to educate their marketing colleagues in the [open source ethos.][4]
#### Keep listening and iterating
Content marketing to your open source community shouldn't be a one-time effort. Blogging is an ideal content marketing channel for the open source community for this reason. Take the time to listen to what's going on in your OSS community and what they still need to learn about your open source offerings. A straightforward way to do this is to have your content marketing manager or other marketing representation join your online community.
Iteration is a necessity with content marketing to the OSS community. In particular, take time to police your content drafts for anything that sounds like selling. Dont forget to update your police your messaging, blogs, and blog calendar for selling too. Consider segmenting your blogs OSS content in its own category if you havent done so already.** **
### Last thoughts
Content marketing to an open source community requires becoming an educator and thought leader delivering content that contributes to your open source users' experiences and product journey. While your salespeople will be looking for customer conversions through your open source content marketing (and they should be!), keep your focus on community content and collaboration.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/10/content-marketing-open-source-community
作者:[Will Kelly][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/willkelly
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/connection_people_team_collaboration.png?itok=0_vQT8xV (people in different locations who are part of the same team)
[2]: https://thoughtleadershiplab.com/what-is-a-thought-leader/
[3]: https://opensource.com/article/20/5/open-source-program-office
[4]: https://www.agrowingculture.org/open-source-ethos/

View File

@ -0,0 +1,97 @@
[#]: subject: "This Game Developer Loves the Linux Community for an Unusual Reason"
[#]: via: "https://news.itsfoss.com/game-dev-loves-linux/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
This Game Developer Loves the Linux Community for an Unusual Reason
======
The Linux community, in general, is one of the most active and helpful communities out there.
And, a significant chunk of that can also be toxic or aggressive to newbies or someone who tries to break traditions.
However, a game developer seems to be appreciating the Linux community for complaining too much…
Yes, you heard that right! But, thats not the entire picture. Let me tell you more about it.
### Reporting Bugs is Essential for Game Improvement
Whether it is an indie game or a full-fledged AAA title, every game arrives with several bugs.
For some studios, game testers try to spot the bugs before launch. But, no matter the effort, players will always notice something that the developers may not have.
So, it is important for developers to work on the reported bugs for a better gaming experience.
But, what if you do not get any bug reports even if the game encounters issues?
Of course, you can invest a lot of time to find out the potential issues faced by players. Unfortunately, it is not possible to iron out everything yourself.
This is why bug reports from players are an essential part of game development.
And, to emphasize the importance of bug reports, the game developer of “**[ΔV: Rings of Saturn][1]**” shared some interesting information.
### Linux Gamers Reported Over 38% Bug Reports With 5.8% Userbase
![][2]
Even though [gaming on Linux][3] is improving with the [addition of Easy Anti-Cheat, BattleEye][4], and many other new advancements, the user base is tiny when compared to Windows.
However, the developer of “**ΔV: Rings of Saturn**” shares an insight where he mentions that out of all the players, Linux gamers reported a significant section of bugs considering the user base.
![][5]
Heres what he said in a [Reddit thread][6]:
> Percentages are easy to talk about, but when I read just them, I always wonder what is the sample size? Is it small enough for the percentage to be just noise?
>
> As of today, I sold a little over 12,000 units of ΔV in total. 700 of these units were bought by Linux players.
>
> Thats 5.8%. I got 1040 bug reports in total, out of which roughly 400 are made by Linux players. Thats one report per 11.5 users on average, and one report per 1.75 Linux players. Thats right, an average Linux player will get you 650% more bug reports.
Not just limited to the number of bug reports, most of the issues reported were well-detailed and could be reproduced or isolated with the details provided.
So, the minority group of Linux gamers turns out to be more valuable in terms of giving feedback and helping improve the game compared to Windows users.
Also, the issues spotted were hardly platform-specific. So, these reports will equally help gamers using Windows to play the game as well.
The game developer adds:
> Its worth it to get the massive feedback boost and free, hundred-people strong QA team on your side. An invaluable asset for an independent game studio.
Of course, no gamer is obliged to report errors in a game. But, this example highlighted by the game developer goes to show how passionate the Linux community can be along with the importance of bug reports.
### Closing Thoughts
Overall, I believe that you can always count on the Linux community. While some can be toxic, the majority of the users work towards helping each other and growing together as Linux users.
What do you think about this particular insight of Linux users reporting more bug reports despite the number of users? Please dont hesitate to share your thoughts in the comments down below.
#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
I'm not interested
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/game-dev-loves-linux/
作者:[Ankush Das][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://news.itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://store.steampowered.com/app/846030/V_Rings_of_Saturn/
[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[3]: https://itsfoss.com/linux-gaming-guide/
[4]: https://news.itsfoss.com/easy-anti-cheat-linux/
[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUzNiIgd2lkdGg9Ijc2MyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[6]: https://www.reddit.com/r/gamedev/comments/qeqn3b/despite_having_just_58_sales_over_38_of_bug/

View File

@ -0,0 +1,112 @@
[#]: subject: "Global communication in open source projects"
[#]: via: "https://opensource.com/article/21/10/global-communication-open-source"
[#]: author: "Rachel Naegele https://opensource.com/users/ranaegele"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Global communication in open source projects
======
An interview with FreeDOS Project founder Jim Hall on communicating
effectively around the world.
![Globe up in the clouds][1]
I am a current graduate student at the University of Minnesota, Twin Cities in the Scientific and Technical Communication MS program. The following is an interview I conducted with [Jim Hall][2] to learn about international professional communication strategies in the multinational group, the FreeDOS Project.
**You started the [FreeDOS project][3] in 1994. How did you communicate with the global network of developers for this project at the beginning? How have your communication strategies for international communication changed over the years?**
We've gone through a few different ways to communicate with each other.
In the early 1990s, USENET was a common way to communicate with a group of people. USENET was very similar to a message forum, but it was globally distributed. Topics were arranged in groups. You could post a message in a USENET group, and someone else would see it and possibly reply to it.
I posted the [first announcement][4] about FreeDOS on the comp.os.msdos.apps group. As we got started on FreeDOS, we used that group to discuss our development work. There are a few benefits of using a group like that:
* It was global, so everyone could participate.
* It was asynchronous, so it didn't matter what timezone you lived in.
* It was open, so everyone could see the conversation.
Around 1996, we moved from USENET to an email list. Email lists were very common at the time, and they remain popular for some uses, such as ours. With an email list, whenever someone sends a message to the list, everyone gets a copy. The downside is that very active email lists can fill up your inbox. But the FreeDOS email lists aren't as active these days as they once were, so our email lists don't tend to have a high bandwidth.
Over the years, folks have experimented with other ways to communicate. Robert Riebisch at BTTR Software set up a general web-based discussion board called ["DOS Ain't Dead"][5] to discuss DOS projects in 1997, and it's still a popular forum for general DOS topics. You can also find FreeDOS topics discussed there. That's not our official discussion board, however; the official place for all FreeDOS development discussions is the [freedos-devel email list][6].
We use freedos-devel to discuss upcoming changes to the FreeDOS distribution, announce new versions of programs, ask for programming help, and generally talk about DOS development.
**What communication issues have you run into while working with a global team? How did you resolve these issues?**
With developers all around the world, in so many languages, from so many cultures, we have had our share of communication issues.
Our de facto language on the email list is English. We never set that as a rule, but almost everyone communicates in English anyway. Sometimes a new subscriber to the email list sends a message in another language, but usually someone who speaks that language can reply to them.
Inevitably, we do have miscommunication issues, usually because of cultural or language problems. For example, someone who doesn't speak English fluently might say something in an awkward way, and someone else might respond negatively to that. But these instances are pretty rare, I think. And we have strong [email list rules][7] that say (among other things) that you need to be nice to each other. And folks police each other pretty well; if there's an issue, it's usually short-lived.
Other issues include culture clash. In international communication, there's a concept of [high-context and low-context][8] communicators. Germany is a typical example of a low-context culture: They get right to the point with very little small talk. Other cultures might see the German style as speaking bluntly, but to a German, that's just a natural way to communicate. On the other hand, Korea or Japan is a typical example of a high-context culture; it would be very unusual for a high-context communicator to talk about a problem in a very direct way.
In the United States, we're more low context than high context, at about the one-quarter mark.
One example of this culture clash is when a user from a high-context country emailed the list to report a bug. I suppose this person viewed a program bug as an embarrassment for the developer, so the person didn't address the bug directly. They didn't provide a specific description of the bug. The other developers on the email list didn't respond well to that. I recall replies along the lines of "What's the problem here?" or "What are you talking about?" All because we communicate differently depending on our background.
**What have been the biggest challenges in creating a DOS for an international audience?**
I'm really glad that we have some very active people in FreeDOS who are working on translating messages in all these programs. There are a few folks who contribute to FreeDOS by translating messages from one language to another and sharing those message files so we can use them in the FreeDOS distribution.
FreeDOS is a small operating system with low memory constraints, so actually our biggest challenge has been technical.
In a more modern system like Linux, you can provide message translation through a service like [catgets][9] or [gettext][10]. Both are programming libraries where the program says, "I need this string [text] in the user's preferred language," and the library gives the program that string. This is an example of internationalization, by providing translations in different languages.
But writing a library like that can take a lot of memory, and a 16-bit operating system like DOS doesn't have a lot of memory to spare. So most early FreeDOS programs didn't bother dealing with it. If the programmer spoke English, they probably wrote their program to use English messages and to accept English input (such as "y" for "yes," and so on).
Unfortunately, that meant someone in Spain or France or Portugal who didn't understand English would have a hard time using FreeDOS. So, I wrote a simplified version of catgets for FreeDOS called Cats. It provided the same catgets function feature set, which meant if you were porting or translating a program from Linux to run on FreeDOS, the catgets function would do the same thing. The programmer wouldn't need to change anything in the source code for the program to work on FreeDOS; they just used FreeDOS Cats.
Catgets looks up a message or string using a _message catalog_ (a file that contains a list of messages in a specific language) and a pair of numbers called the _message set_ and the _message number._ The name catgets comes from the catalog to get a string in the user's preferred language. For example, a message to say "Hello" to the user might be stored in message set 1, as message number 2 in that message set. So you'd have this line in an English catalog file:
`1.2:Hello`
And you'd have other language catalog files that had the same messages translated to other languages. A Spanish catalog might have this line to represent the same message:
`1.2:Hola`
Tom Ehlert modified Cats to be even smaller but also much simpler. This version was named Kitten. Cats and Kitten solved the problem pretty well. A translator could create a message catalog by editing a plain text file, and someone else could use that right away. A lot of FreeDOS programs adopted Cats or Kitten to provide message internationalization. That solved a huge problem for us!
Kitten is not the only solution. Different developers might solve the language problem in different ways. But Kitten is probably the most popular way to do it.
**What are some of the main factors that you consider when communicating interculturally?**
For me, I need to be aware of who I'm talking to when I send a message. If I'm emailing a specific person, I'll use the email they sent me as a guide to guess whether they prefer a high-context or low-context answer. If I don't know, I'll probably default to a lower context mode. That means I'll get to the point quickly, but it's okay to set up some context.
If I'm writing for a more general audience (such as sending emails to our email list, posting an announcement to our website, or whatever), I'll also adopt the lower context communication mode. That's more important on a website, where many readers will probably click off the site if it's too wordy.
**Using your time working on the FreeDOS project as a reference, what advice would you give to someone looking to increase their intercultural communication competence?**
Ever since I learned about high-context vs. low-context communication styles, I've used that as a guide. For anyone who wants to increase their intercultural communication competence, I recommend learning the high- vs. low-context spectrum. Build your own understanding of where different cultures are placed on this spectrum: Italy tends to be around the middle, the UK tends to be around the one-third mark, and so on.
Beyond that, I would recommend always assuming positive intent. If someone reached out to you in an email, read past any preconceptions about how that person communicated and find the message they wanted to convey. A high-context communicator will rarely hit an issue head-on, so you may need to read more carefully. A low-context communicator will probably seem very blunt, but they are just trying to get to the point quickly.
Don't assume based on your own context.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/10/global-communication-open-source
作者:[Rachel Naegele][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/ranaegele
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cloud-globe.png?itok=_drXt4Tn (Globe up in the clouds)
[2]: https://opensource.com/users/jim-hall
[3]: https://www.freedos.org/
[4]: https://groups.google.com/g/comp.os.msdos.apps/c/oQmT4ETcSzU/m/O1HR8PE2u-EJ
[5]: https://www.bttr-software.de/forum/board.php
[6]: http://lists.sourceforge.net/lists/listinfo/freedos-user
[7]: http://freedos.sourceforge.net/freedos/lists/remind.txt
[8]: https://en.wikipedia.org/wiki/High-context_and_low-context_cultures
[9]: https://www.ibm.com/docs/en/i/7.3?topic=functions-catgets-retrieve-message-from-message-catalog
[10]: https://www.gnu.org/software/gettext/manual/gettext.html

View File

@ -137,7 +137,7 @@ via: https://www.linux.com/blog/learn/intro-to-linux/2018/6/systemd-services-mon
作者:[Paul Brown][a]
选题:[lujun9972][b]
译者:[silentdawn-zz](https://github.com/译者ID)
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: (zpl1025)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -1,87 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (unigeorge)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to process real-time data with Apache)
[#]: via: (https://opensource.com/article/20/2/real-time-data-processing)
[#]: author: (Simon Crosby https://opensource.com/users/simon-crosby)
How to process real-time data with Apache
======
Open source is leading the way with a rich canvas of projects for
processing real-time events.
![Alarm clocks with different time][1]
In the "always-on" future with billions of connected devices, storing raw data for analysis later will not be an option because users want accurate responses in real time. Prediction of failures and other context-sensitive conditions require data to be processed in real time—certainly before it hits a database.
It's tempting to simply say "the cloud will scale" to meet demands to process streaming data in real time, but some simple examples show that it can never meet the need for real-time responsiveness to boundless data streams. In these situations—from mobile devices to IoT—a new paradigm is needed. Whereas cloud computing relies on a "store then analyze" big data approach, there is a critical need for software frameworks that are comfortable instantly processing endless, noisy, and voluminous streams of data as they arrive to permit a real-time response, prediction, or insight.
For example, the city of Palo Alto, Calif. produces more streaming data from its traffic infrastructure per day than the Twitter Firehose. That's a lot of data. Predicting city traffic for consumers like Uber, Lyft, and FedEx requires real-time analysis, learning, and prediction. Event processing in the cloud leads to an inescapable latency of about half a second per event.
We need a simple yet powerful programming paradigm that lets applications process boundless data streams on the fly in these and similar situations:
* Data volumes are huge, or moving raw data is expensive.
* Data is generated by widely distributed assets (such as mobile devices).
* Data is of ephemeral value, and analysis can't wait.
* It is critical to always have the latest insight, and extrapolation won't do.
### Publish and subscribe
A key architectural pattern in the domain of event-driven systems is the concept of pub/sub or publish/subscribe messaging. This is an asynchronous communication method in which messages are delivered from _publishers_ (anything producing data) to *subscribers (*applications that process data). Pub/sub decouples arbitrary numbers of senders from an unknown set of consumers.
In pub/sub, sources _publish_ events for a _topic_ to a _broker_ that stores them in the order in which they are received. An application _subscribes_ to one or more _topics_, and the _broker_ forwards matching events. Apache Kafka and Pulsar and CNCF NATS are pub/sub systems. Cloud services for pub/sub include Google Pub/Sub, AWS Kinesis, Azure Service Bus, Confluent Cloud, and others.
Pub/sub systems do not _run_ subscriber applications—they simply _deliver_ data to topic subscribers.
Streaming data often contains events that are updates to the state of applications or infrastructure. When choosing an architecture to process data, the role of a data-distribution system such as a pub/sub framework is limited. The "how" of the consumer application lies beyond the scope of the pub/sub system. This leaves an enormous amount of complexity for the developer to manage. So-called stream processors are a special kind of subscriber that analyzes data on the fly and delivers results back to the same broker.
### Apache Spark
[Apache Spark][2] is a unified analytics engine for large-scale data processing. Often, Apache Spark Streaming is used as a stream processor, for example, to feed machine learning models with new data. Spark Streaming breaks data into mini-batches that are each independently analyzed by a Spark model or some other system. The stream of events is grouped into mini-batches for analysis, but the stream processor itself must be elastic:
* The stream processor must be capable of scaling with the data rate, even across servers and clouds, and also balance load across instances, ensuring resilience and other application-layer needs.
* It must be able to analyze data from sources that report at widely different rates, meaning it must be stateful—or store state in a database. This latter approach is often used when Spark Streaming is used as the stream processor and can cause performance problems when ultra-low latency responses are needed.
A related project, [Apache Samza][3], offers a way to process real-time event streams, and to scale elastically using [Hadoop Yarn][4] or [Apache Mesos][5] to manage compute resources.
### Solving the problem of scaling data
It's important to note that even Samza cannot entirely alleviate data processing demands for the application developer. Scaling data rates mean that tasks to process events need to be load-balanced across many instances, and the only way to share the resulting application-layer state between instances is to use a database. However, the moment state coordination between tasks of an application devolves to a database, there is an inevitable knock-on effect upon performance. Moreover, the choice of database is crucial. As the system scales, cluster management for the database becomes the next potential bottleneck.
This can be solved with alternative solutions that are stateful, elastic, and can be used in place of a stream processor. At the application level (within each container or instance), these solutions build a stateful model of concurrent, interlinked "web agents" on the fly from streaming updates. Agents are concurrent "nano-services" that consume raw data for a single source and maintain their state. Agents interlink to share state based on real-world relationships between sources found in the data, such as containment and proximity. Agents thus form a graph of concurrent services that can analyze their own state and the states of agents to which they are linked. Each agent provides a nano-service for a single data source that converts from raw data to state and analyzes, learns, and predicts from its own changes and those of its linked subgraph.
These solutions simplify application architecture by allowing agents—digital twins of real-world sources—to be widely distributed, even while maintaining the distributed graph that interlinks them at the application layer. This is because the links are URLs that map to the current runtime execution instance of the solution and the agent itself. In this way, the application seamlessly scales across instances without DevOps concerns. Agents consume data and maintain state. They also compute over their own state and that of other agents. Because agents are stateful, there is no need for a database, and insights are computed at memory speed.
### Reading world data with open source
There is a sea change afoot in the way we view data: Instead of the database being the system of record, the real world is, and digital twins of real-world things can continuously stream their state. Fortunately, the open source community is leading the way with a rich canvas of projects for processing real-time events. From pub/sub, where the most active communities are Apache Kafka, Pulsar, and CNCF NATS, to the analytical frameworks that continually process streamed data, including Apache Spark, [Flink][6], [Beam][7], Samza, and Apache-licensed [SwimOS][8] and [Hazelcast][9], developers have the widest choices of software systems. Specifically, there is no richer set of proprietary software frameworks available. Developers have spoken, and the future of software is open source.
Introduction to Apache Hadoop, an open source software framework for storage and large scale...
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/2/real-time-data-processing
作者:[Simon Crosby][a]
选题:[lujun9972][b]
译者:[unigeorge](https://github.com/unigeorge)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/simon-crosby
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/clocks_time.png?itok=_ID09GDk (Alarm clocks with different time)
[2]: https://spark.apache.org/
[3]: https://samza.apache.org/
[4]: https://hadoop.apache.org/
[5]: http://mesos.apache.org/
[6]: https://flink.apache.org/
[7]: https://beam.apache.org
[8]: https://github.com/swimos/swim
[9]: https://hazelcast.com/

View File

@ -1,150 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Define and optimize data partitions in Apache Cassandra)
[#]: via: (https://opensource.com/article/20/5/apache-cassandra)
[#]: author: (Anil Inamdar https://opensource.com/users/anil-inamdar)
Define and optimize data partitions in Apache Cassandra
======
Apache Cassandra is built for speed and scalability; here's how to get
the most out of those benefits.
![Person standing in front of a giant computer screen with numbers, data][1]
Apache Cassandra is a database. But it's not just any database; it's a replicating database designed and tuned for scalability, high availability, low-latency, and performance. Cassandra can help your data survive regional outages, hardware failure, and what many admins would consider excessive amounts of data.
Having a thorough command of data partitions enables you to achieve superior Cassandra cluster design, performance, and scalability. In this article, I'll examine how to define partitions and how Cassandra uses them, as well as the most critical best practices and known issues you ought to be aware of.
To set the scene: partitions are chunks of data that serve as the atomic unit for key database-related functions like data distribution, replication, and indexing. Distributed data systems commonly distribute incoming data into these partitions, performing the partitioning with simple mathematical functions such as identity or hashing, and using a "partition key" to group data by partition. For example, consider a case where server logs arrive as incoming data. Using the "identity" partitioning function and the timestamps of each log (rounded to the hour value) for the partition key, we can partition this data such that each partition holds one hour of the logs.
### Data partitions in Cassandra
Cassandra operates as a distributed system and adheres to the data partitioning principles described above. With Cassandra, data partitioning relies on an algorithm configured at the cluster level, and a partition key configured at the table level.
![Cassandra data partition][2]
Cassandra Query Language (CQL) uses the familiar SQL table, row, and column terminologies. In the example diagram above, the table configuration includes the partition key within its primary key, with the format: Primary Key = Partition Key + [Clustering Columns].
A primary key in Cassandra represents both a unique data partition and a data arrangement inside a partition. Data arrangement information is provided by optional clustering columns. Each unique partition key represents a set of table rows managed in a server, as well as all servers that manage its replicas.
### Defining primary keys in CQL
The following four examples demonstrate how a primary key can be represented in CQL syntax. The sets of rows produced by these definitions are generally considered a partition.
#### Definition 1 (partition key: log_hour, clustering columns: none)
```
CREATE TABLE server_logs(
   log_hour TIMESTAMP PRIMARYKEY,
   log_level text,
   message text,
   server text
   )
```
Here, all rows that share a **log_hour** go into the same partition.
#### Definition 2 (partition key: log_hour, clustering columns: log_level)
```
CREATE TABLE server_logs(
   log_hour TIMESTAMP,
   log_level text,
   message text,
   server text,
   PRIMARY KEY (log_hour, log_level)
   )
```
This definition uses the same partition key as Definition 1, but here all rows in each partition are arranged in ascending order by **log_level**.
#### Definition 3 (partition key: log_hour, server, clustering columns: none)
```
CREATE TABLE server_logs(
   log_hour TIMESTAMP,
   log_level text,
   message text,
   server text,
   PRIMARY KEY ((log_hour, server))
   )
```
In this definition, all rows share a **log_hour** for each distinct **server** as a single partition.
#### Definition 4 (partition key: log_hour, server, clustering columns: log_level)
```
CREATE TABLE server_logs(
   log_hour TIMESTAMP,
   log_level text,
   message text,
   server text,
   PRIMARY KEY ((log_hour, server),log_level)
   )WITH CLUSTERING ORDER BY (column3 DESC);
```
This definition uses the same partition as Definition 3 but arranges the rows within a partition in descending order by **log_level**.
### How Cassandra uses the partition key
Cassandra relies on the partition key to determine which node to store data on and where to locate data when it's needed. Cassandra performs these read and write operations by looking at a partition key in a table, and using tokens (a long value out of range -2^63 to +2^63-1) for data distribution and indexing. These tokens are mapped to partition keys by using a partitioner, which applies a partitioning function that converts any partition key to a token. Through this token mechanism, every node of a Cassandra cluster owns a set of data partitions. The partition key then enables data indexing on each node.
![Cassandra cluster with 3 nodes and token-based ownership][3]
A Cassandra cluster with three nodes and token-based ownership. This is a simplistic representation: the actual implementation uses [Vnodes][4].
### Data partition impacts on Cassandra clusters
Careful partition key design is crucial to achieving the ideal partition size for the use case. Getting it right allows for even data distribution and strong I/O performance. Partition size has several impacts on Cassandra clusters you need to be aware of:
* Read performance—In order to find partitions in SSTables files on disk, Cassandra uses data structures that include caches, indexes, and index summaries. Partitions that are too large reduce the efficiency of maintaining these data structures and will negatively impact performance as a result. Cassandra releases have made strides in this area: in particular, version 3.6 and above of the Cassandra engine introduce storage improvements that deliver better performance for large partitions and resilience against memory issues and crashes.
* Memory usage— Large partitions place greater pressure on the JVM heap, increasing its size while also making the garbage collection mechanism less efficient.
* Cassandra repairs—Large partitions make it more difficult for Cassandra to perform its repair maintenance operations, which keep data consistent by comparing data across replicas.
* Tombstone eviction—Not as mean as it sounds, Cassandra uses unique markers known as "tombstones" to mark data for deletion. Large partitions can make that deletion process more difficult if there isn't an appropriate data deletion pattern and compaction strategy in place.
While these impacts may make it tempting to simply design partition keys that yield especially small partitions, the data access pattern is also highly influential on ideal partition size (for more information, read this in-depth guide to [Cassandra data modeling][5]). The data access pattern can be defined as how a table is queried, including all of the table's **select** queries. Ideally, CQL select queries should have just one partition key in the **where** clause—that is to say, Cassandra is most efficient when queries can get needed data from a single partition, instead of many smaller ones.
### Best practices for partition key design
Following best practices for partition key design helps you get to an ideal partition size. As a rule of thumb, the maximum partition size in Cassandra should stay under 100MB. Ideally, it should be under 10MB. While Cassandra versions 3.6 and newer make larger partition sizes more viable, careful testing and benchmarking must be performed for each workload to ensure a partition key design supports desired cluster performance.
Specifically, these best practices should be considered as part of any partition key design:
* The goal for a partition key must be to fit an ideal amount of data into each partition for supporting the needs of its access pattern.
* A partition key should disallow unbounded partitions: those that may grow indefinitely in size over time. For instance, in the **server_logs** examples above, using the server column as a partition key would create unbounded partitions as the number of server logs continues to increase. In contrast, using **log_hour** limits each partition to an hour of data.
* A partition key should also avoid creating a partition skew, in which partitions grow unevenly, and some are able to grow without limit over time. In the **server_logs** examples, using the server column in a scenario where one server generates considerably more logs than others would produce a partition skew. To avoid this, a useful technique is to introduce another attribute from the table to force an even distribution, even if it's necessary to create a dummy column to do so.
* It's helpful to partition time-series data with a partition key that uses a time element as well as other attributes. This protects against unbounded partitions, enables access patterns to use the time attribute in querying specific data, and allows for time-bound data deletion. The examples above each demonstrate this by using the **log_hour** time attribute.
Several tools are available to help test, analyze, and monitor Cassandra partitions to check that a chosen schema is efficient and effective. By carefully designing partition keys to align well with the data and needs of the solution at hand, and following best practices to optimize partition size, you can utilize data partitions that more fully deliver on the scalability and performance potential of a Cassandra deployment.
Dani and Jon will give a three hour tutorial at OSCON this year called: Becoming friends with...
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/5/apache-cassandra
作者:[Anil Inamdar][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/anil-inamdar
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data)
[2]: https://opensource.com/sites/default/files/uploads/apache_cassandra_1_0.png (Cassandra data partition)
[3]: https://opensource.com/sites/default/files/uploads/apache_cassandra_2_0.png (Cassandra cluster with 3 nodes and token-based ownership)
[4]: https://www.instaclustr.com/cassandra-vnodes-how-many-should-i-use/
[5]: https://www.instaclustr.com/resource/6-step-guide-to-apache-cassandra-data-modelling-white-paper/

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (MjSeven)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -2,7 +2,7 @@
[#]: via: "https://opensource.com/article/21/8/linux-terminal"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lujun9972"
[#]: translator: "fisherue "
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
@ -108,7 +108,7 @@ via: https://opensource.com/article/21/8/linux-terminal
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[译者ID][c]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
@ -126,5 +126,4 @@ via: https://opensource.com/article/21/8/linux-terminal
[9]: https://opensource.com/article/21/7/terminal-basics-rename-file-linux-terminal
[10]: https://opensource.com/article/21/7/terminal-basics-copying-files-linux-terminal
[11]: https://opensource.com/article/21/7/terminal-basics-removing-files-and-folders-linux-terminal
[12]: https://opensource.com/downloads/bash-scripting-ebook
[c]: https://github.com/fisherue
[12]: https://opensource.com/downloads/bash-scripting-ebook

View File

@ -2,7 +2,7 @@
[#]: via: "https://opensource.com/article/21/8/share-printer-cups"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lujun9972"
[#]: translator: "fisherue "
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
@ -99,7 +99,7 @@ via: https://opensource.com/article/21/8/share-printer-cups
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/fisherue)
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -2,7 +2,7 @@
[#]: via: "https://itsfoss.com/change-terminal-color-ubuntu/"
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: translator: "robsean"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "

View File

@ -2,7 +2,7 @@
[#]: via: "https://itsfoss.com/set-java-home-ubuntu/"
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: translator: "robsean"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "

View File

@ -1,206 +0,0 @@
[#]: subject: "Play with model trains in OpenTTD"
[#]: via: "https://opensource.com/article/21/9/model-trains-openttd"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Play with model trains in OpenTTD
======
Don't have room for a physical model train set? Try virtual trains with
OpenTTD.
![Old train][1]
My father has always been fond of model trains, and I remember watching him building a track around the Christmas tree when I was young. When [Lego][2] train sets were released, he and I transitioned to them for their convenience and inherent extensibility. We built and operated Lego trains and monorail tracks over the course of many years. I've often imagined a possible future in which I have a garage or a basement dedicated to miniature landscapes and electric whistling trains. Then again, the probability of me diving that severely into yet another hobby is pretty low, so I was very happy to discover that _virtual_ model railways can provide me with much of the same satisfaction. The engine for my virtualized hobby is [OpenTTD][3], an open source simulation game based on an old '90s game called **Transport Tycoon Deluxe**.
### Installing OpenTTD
You can download OpenTTD for Linux, macOS, and Windows from [openttd.org/downloads][4].
If you're running Debian Linux or one of its derivatives, or even [running it on a Chromebook][5], you can download the `.deb` package. Install it with `apt`:
```
`$ sudo apt install ./openttd*deb`
```
If you're using any other Linux distribution, download the generic installer and extract the package with [the `tar command`][6]:
```
`$ tar xvf openttd-x.yy.z-linux*.tar.xz`
```
OpenTTD is also available on [Steam][7] for Linux, macOS, and Windows (Steam isn't open source, but it's a common cross-platform gaming client).
### Launch OpenTTD
If you installed OpenTTD, you can launch it from your application menu.
If you're downloaded the generic package, change into the directory and launch the game using the local `openttd` command:
```
$ cd openttd*
$ ./openttd &amp;
```
The first time you launch OpenTTD, it alerts you that you must download a graphic set. This is automatically installed in the Steam edition, but it's a single-click in the stand-alone app. And anyway, because OpenTTD is open source, it's well modded, so you'll end up downloading a lot more than just the default graphics.
After the graphics have been downloaded, you're presented with the quaintly diminutive interface. I find a 640x480 interface a little small, and while the old graphics do hearken back to simpler computing days, a slight upgrade for modern screens is helpful. For that reason, your first stop is the **Check online content** button.
### Loading mods
The **Content downloading** screen provides you with a window to approved OpenTTD mods, giving improved graphics, new music, train models, and map names appropriate to your location or interests. I use the New Zealand set, so all of my generated cities sound familiar, although, since 2020, I've started using the Fallout 3 set. There are _a lot_ of mods, so use the search bar in the top right to narrow your choices.
Here are the mods I consider essential:
* **abase** \- High res graphics. At nearly 300 MB, this is the largest download you're likely to need (the game itself is barely 50 MB).
* **OpenSFX** \- A sound set so you can hear the traffic in cities, the horns of the boating industry, and the very satisfying whistles of trains.
* **Town names** \- The default names of cities are fun, but I find it easier to remember names that feel local.
* **Trains** \- OpenTTD has a default set of train models that work perfectly well, but if you're a trainspotter already, then you might enjoy downloading some additional train sets. I use the NZR set, but there are many trains available, including trains from the UK, the USA, Austria, Belgium, Czech Republic, and on and on down the alphabet.
* **Beginner tutorial** \- A scenario to help you learn the game and its interface.
### Game engine defaults
Once you download your new assets, you must set them as your defaults. There are two places for this: Game engine defaults and in-game scripts and assets.
![OpenTTD main menu][8]
The OpenTTD menu (Seth Kenlon, [CC BY-SA 4.0][9])
Click the **Game Options** button. In the **Game Options** screen, adjust these settings:
* Set the **screen resolution** to your preferred interface size.
* Set **base graphics set** to **abase.**
* Set **base sounds set** to **OpenSFX.**
Close the **Game Options** screen. Your changes are saved automatically.
### Game options
From the main menu screen, click the **NewGRF Settings** button.
![NewGRF settings window][10]
The NewGRF settings menu (Seth Kenlon, [CC BY-SA 4.0][9])
Inactive mods are listed at the bottom of the **NewGRF Settings** window. To activate one, select it and click the **Add** button in the bottom left. Once you've chosen the mods to activate, click the **Apply** button.
### Tutorial
If you downloaded the **Beginner tutorial** scenario, you could learn OpenTTD by playing through it. To start the tutorial, click the **Play scenario** button near the top of the main menu screen. Select the tutorial and begin.
The tutorial gives you a full tour of the game's interface, and it takes some time to get through it.
### Quickstart
By way of a quicker introduction, here's what you need to know: vehicles come from depots, and everything needs a schedule. By remembering those two rules, you can start building trains (and roads and seaports and airports) right away.
#### **Build stations**
To build a simple rail line between two cities, click the railway track icon in the top icon bar.
![New icon bar - railway option][11]
The new icon bar - railway option (Seth Kenlon, [CC BY-SA 4.0][9])
Railways start and end with stations, so I usually place a station at each end of my intended line. Click the train station icon (mouse over it to see its label). For a train station to serve a region, its area of effect must overlap with as much of the region as possible. To see a station's coverage, enable **Coverage area highlight** by clicking the **On** button at the bottom of the station dialog box.
![Station coverage window][12]
Station coverage information window (Seth Kenlon, [CC BY-SA 4.0][9])
The dark grid overlay represents coverage, while the white grid overlay shows the physical footprint of the station. As you hover over an area, the supplies that a station's coverage enables are listed in the station popup window. Start simple and create a single-track, 4-car platform. Do this twice between two cities on the map.
![create station menu][13]
The create station menu (Seth Kenlon, [CC BY-SA 4.0][9])
### Lay the rails
Next, connect the stations with rails. The isometric view of OpenTTD takes some getting used to, but after clicking on the rail icons and clicking and dragging on the map, you start to get a feel for it. The X-rail icon provides an "autorail" mode, which aligns the track based on where in a square you click.
Be careful as you lay your rails. OpenTTD is rather unforgiving, so once you click in a square, rails are constructed. You must use the dynamite icon to remove rails. Just like in real life, there's no undo button.
### Train depot
Trains come from a depot. So to add a train to your railway, you must add a depot somewhere along the line. Click the depot icon and place a depot near an existing rail. Connect the depot to an existing track to ensure your trains can get from the depot to the appropriate (in this simple example, the only) line.
![create depot menu][14]
The create depot menu (Seth Kenlon, [CC BY-SA 4.0][9])
### Model trains
At long last, you get to add a virtual model train to your virtual railway. To create a train, click on your depot.
Click the **New Vehicle** button at the bottom of the depot window to list available train engines and cars. The list you get depends partly on what models you've added from the downloadable content. Generally, there are three types of engines: Steam, diesel, and electric. Early in the game, which starts in the year 1950, you have only steam. As the years progress, you get innovative new models you can use as upgrades.
![create train menu][15]
The create train menu (Seth Kenlon, [CC BY-SA 4.0][9])
For now, create a simple train that includes an engine, a passenger car, and a mail car. If you want to add other kinds of cars, click on your stations to confirm the types of supplies they're able to accept (as determined by its area of coverage).
### Create a train schedule
Now that you have a railway and a train, you must create a train schedule. Schedules are attached to vehicles, so any time you add a new vehicle of any kind, you must add a schedule for it to be useful.
To add a schedule to your train, click the number to the left of the train in its depot listing. This opens a viewport for the train, with buttons along the right side of the window. Click the arrow icon to see that train's schedule.
![create schedule menu][16]
The create schedule menu (Seth Kenlon, [CC BY-SA 4.0][9])
To create a schedule, click the **Go To** button at the bottom of the schedule window, and then click on the station you want to set as the first destination. Then click the next station. You can adjust loading and unloading requirements by selecting a stop in the schedule and browsing the options in the **Full load** and **Unload** drop-down menus, and you can adjust routes (should you develop new routes) in the **Non-stop** drop-down menu. The options are plentiful, and as cities grow and your map becomes more developed, you may have to adjust your strategy.
But for now, click the red **Stopped** button at the bottom of your train viewport to put your train into service!
![train moving from station to station][17]
Train in service (Seth Kenlon, [CC BY-SA 4.0][9])
### Try OpenTTD
OpenTTD is a simulator, but it's also a game, so you do have constraints, including a budget and parameters you might want to optimize. For instance, you can click on a city, farm, or factory to discover what kind of imports and exports are acceptable to it. You can borrow money by clicking the budget button in the bottom right corner of the OpenTTD window. And it's not just a virtual train set. You can build roads, airports, seaports, and more. Just remember that all vehicles need depots and schedules, and you're halfway to a successful virtual enterprise.
OpenTTD has an active and enthusiastic community, [an extensive wiki][18], and there are lots of resources and tutorials available online. Download the game and give it a try!
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/9/model-trains-openttd
作者:[Seth Kenlon][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/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/train-plane-speed-big-machine.png?itok=f377dXKs (Old train)
[2]: https://opensource.com/article/20/6/open-source-virtual-lego
[3]: http://openttd.org
[4]: https://www.openttd.org/downloads/openttd-releases/latest.html
[5]: https://opensource.com/article/21/2/chromebook-linux
[6]: https://opensource.com/article/17/7/how-unzip-targz-file
[7]: https://store.steampowered.com/app/1536610/OpenTTD/
[8]: https://opensource.com/sites/default/files/openttd-menu.jpg (OpenTTD menu)
[9]: https://creativecommons.org/licenses/by-sa/4.0/
[10]: https://opensource.com/sites/default/files/openttd-newgrf.jpg (The NewGRF settings menu)
[11]: https://opensource.com/sites/default/files/openttd-iconbar-railway.jpg (The new icon bar - railway option)
[12]: https://opensource.com/sites/default/files/openttd-window-station.jpg (Station coverage information window)
[13]: https://opensource.com/sites/default/files/openttd-create-station.jpg (The create station menu)
[14]: https://opensource.com/sites/default/files/openttd-create-depot.jpg (Create depot menu)
[15]: https://opensource.com/sites/default/files/openttd-create-train.jpg (The create train menu)
[16]: https://opensource.com/sites/default/files/openttd-create-schedule.png (The create schedule menu)
[17]: https://opensource.com/sites/default/files/openttd-train.jpg (Train in service)
[18]: https://wiki.openttd.org/en/

View File

@ -1,135 +0,0 @@
[#]: subject: "How I use Ansible and anacron for automation"
[#]: via: "https://opensource.com/article/21/9/ansible-anacron-automation"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How I use Ansible and anacron for automation
======
With anacron, I can drop scripts and Ansible playbooks into place for
all manner of trivial tasks.
![Woman programming][1]
Automation is the great IT and DevOps ideal, but in my experience, anything that's not immediately convenient may as well not exist at all. There have been many times when I've come up with a pretty good solution for some task, and I'll even script it, but I stop short of making it literally automated because the infrastructure for easy automation doesn't exist on the machine I'm working on.
My favorite easy automation tool used to be the cron system—old, reliable, user-facing, and (aside from a scheduling syntax I can never commit to memory) simple. However, the problem with cron is that it assumes a computer is on 24 hours a day, every day. After missing one too many scheduled backups, I discovered [anacron][2], the cron system based on timestamps rather than scheduled times. If your computer is off when a job would typically have run, anacron ensures that it's run when the computer is back on. Creating a job is as easy as dropping a shell script into one of three directories: `cron.daily`, `cron.weekly`, or `cron.monthly` (you can define more if you want). With anacron, I find myself dropping scripts and Ansible playbooks into place for all manner of trivial tasks, including pop-up reminders of upcoming due dates or events.
It's a simple and obvious solution to a modern problem, but it does me no good if anacron isn't installed on the computer.
### Software setup with Ansible
Any time I set up a new computer, whether it's a laptop, workstation, or server, I install anacron. That's easy, but an anacron install only provides the anacron command. It doesn't set up the anacron user environment. So I created an Ansible playbook to set up what the user needs to use anacron and install the anacron command.
First, the standard Ansible boilerplate:
```
\---
\- hosts: localhost
  tasks:
```
### Creating directories with Ansible
Next, I create the directory tree I use for anacron. You can think of this as a sort of transparent crontab.
```
    - name: create directory tree
      ansible.builtin.file:
        path: "{{ item }}"
        state: directory
      with_items:
        - '~/.local/etc/cron.daily'
        - '~/.local/etc/cron.weekly'
        - '~/.local/etc/cron.monthly'
        - '~/.var/spool/anacron'
```
The syntax of this might seem a little strange, but it's actually a loop. The `with_items:` directive defines four directories to create, and Ansible iterates over the `ansible.builtin.file:` directive once for each directory (the directory name populates the `{{ item }}` variable). As with everything in Ansible, there's no error or conflict if the directory already exists.
### Copying files with Ansible
The `ansible.builtin.copy` module copies files from one location to another. For this to work, I needed to create a file called `anacrontab`. It's not an Ansible playbook, so I keep it in my `~/Ansible/data` directory, where I keep support files for my playbooks.
```
    - name: copy anacrontab into place
      ansible.builtin.copy:
        src: ~/Ansible/data/anacrontab
        dest: ~/.local/etc/anacrontab
        mode: '0755'
```
My `anacrontab` file is simple and mimics the one some distributions install by default into `/etc/anacron`:
```
SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
1  0  cron.day    run-parts $HOME/.local/etc/cron.daily/
7  0  cron.wek    run-parts $HOME/.local/etc/cron.weekly/
30 0  cron.mon    run-parts $HOME/.local/etc/cron.monthly/
```
### Running anacron on login
Most Linux distributions configure anacron to read jobs from `/etc/anacron`. I mostly use anacron as a regular user, so I launch anacron from my login `~/.profile`. I don't want to have to remember to configure that myself, so I have Ansible do it. I use the `ansible.builtin.lineinfile` module, which creates `~/.profile` if it doesn't already exist and inserts the anacron launch line.
```
    - name: add local anacrontab to .profile
      ansible.builtin.lineinfile:
        path: ~/.profile
        regexp: '^/usr/sbin/anacron'
        line: '/usr/sbin/anacron -t ~/.local/etc/anacrontab'
        create: true
```
### Installing anacron with Ansible
For most of my systems, the `dnf` module would work for package installation, but my workstation runs Slackware (which uses `slackpkg`), and sometimes a different Linux distro makes its way into my collection. The `ansible.builtin.package` module provides a generic interface to package installation, so I use it for this playbook. Luckily, I haven't come across a repo that names `anacron` anything but `anacron`, so for now, I don't have to account for potential differences in package names.
This is actually a separate play because package installation requires privilege escalation, provided by the `becomes: true` directive.
```
\- hosts: localhost
  become: true
  tasks:
    - name: install anacron
      ansible.builtin.package:
        name: anacron
        state: present
```
### Using anacron and Ansible for easy automation
To install anacron with Ansible, I run the playbook:
```
`$ ansible-playbook ~/Ansible/setup-anacron.yaml`
```
From then on, I can write shell scripts to perform some trivial but repetitive task and copy it into `~/.local/etc/cron.daily` to have it automatically run once a day (or thereabouts). I also write Ansible playbooks for tasks such as [cleaning out my downloads folder][3]. I place my playbooks in `~/Ansible`, which is where I keep my Ansible plays, and then create a shell script in `~/.local/etc/cron.daily` to execute the play. It's easy, painless, and quickly becomes second nature.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/9/ansible-anacron-automation
作者:[Seth Kenlon][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/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming-code-keyboard-laptop-music-headphones.png?itok=EQZ2WKzy (Woman programming)
[2]: https://opensource.com/article/21/2/linux-automation
[3]: https://opensource.com/article/21/9/keep-folders-tidy-ansible

View File

@ -1,160 +0,0 @@
[#]: subject: "How to Install Google Chrome on Debian and Kali Linux"
[#]: via: "https://itsfoss.com/install-chrome-debian-kali-linux/"
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Install Google Chrome on Debian and Kali Linux
======
Debian and Debian-based Kali Linux come with Firefox as the default web browser. But this does not mean that you cannot install other web browsers in it.
Google Chrome is hugely popular and you probably already use it on other systems. If you want to install Chrome on Debian, you can surely do so.
You wont find Google Chrome in the repositories of Debian because it is not open source software but you can download and install it from Chrome website.
In this tutorial, Ill show you two methods of installing Chrome on Debian:
* GUI method
* Command line method
Lets start with the GUI method first.
_**Note: I am using Debian in the examples here but since Kali Linux is based on Debian, the same methods are also applicable to Kali Linux.**_
### Method 1: Installing Chrome on Debian Graphically
This is a no-brainer. You go to the Google Chrome website, download the deb file and double lick on it to install it. I am going to show the steps in detail so that it is easy for you to follow it.
Go to Google Chromes website.
[Get Google Chrome][1]
Youll see the option to download Google Chrome.
![Click on the Download Chrome button][2]
When you click on the download button, it gives you two options for downloading the installer file. Go with the one that says Debian/Ubuntu.
![Download the Chrome installer file for Debian][3]
**Please note that Google Chrome is NOT available for 32-bit systems.**
In the next screen, you should opt for saving the file to the computer instead of opening it in software center for installation. This way, the downloaded file will be saved in the Downloads folder instead of the temp directory.
![Save the downloaded DEB file for Google Chrome][4]
Go to the Download folders and right click on the downloaded deb file and choose to open it with Software Install.
![Right click on the downloaded DEB file and open with Software Install][5]
It will then open the software center and you should see the option to install Chrome now. Click on the install button.
![Click on the install button][6]
Youll be asked to enter your accounts password. This is the same password you use to log into your system.
![Enter your accounts password][7]
In less than a minute, Google Chrome will be installed. You should see a remove option now which indicates that the software is installed.
![Chrome is now installed][8]
Once Chrome is installed on Debian, search for it in the system menu and start it.
![Start Google Chrome][9]
It will ask to be your default browser and send the crash reports to Google. You can uncheck either or both options. And then you can see Google Chrome browser window.
![][10]
If you log into your Google account, you should be able to sync your passwords, bookmarks and other browsing data here. Enjoy it!
Another thing, after installing Chrome, you can delete the downloaded DEB file from your system. It is not needed anymore, not even for uninstalling Chrome.
### Method 2: Install Google Chrome on Debian from the terminal
What you just saw above can be easily achieved in the terminal.
First, make sure that your package cache is refreshed and you have wget installed for [downloading files from the web in the terminal][11].
```
sudo apt update && sudo apt install wget
```
The next option is to download the .deb file of Google Chrome:
```
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
```
Once downloaded, you can [install the deb file in the terminal][12] with apt command like this:
```
sudo apt install ./google-chrome-stable_current_amd64.deb
```
Once the installation completes, you can start using Chrome.
### Bonus tip: Updating Google Chrome
Both methods add Googles repository to your system. You can see it in your sources.lis.d directory:
```
cat /etc/apt/sources.list.d/google-chrome.list
```
This means that Google Chrome will be updated with other system updates in Debian and Kali Linux. You know [how to update your Kali Linux][13] or Debian system in command line? Just use this command:
```
sudo apt update && sudo apt upgrade -y
```
### Uninstall Google Chrome from your system
Even if you chose to install Chrome on Debian using the GUI method, youll have to use the terminal to remove it.
Dont worry. Its really just one command:
```
sudo apt purge google-chrome-stable
```
Enter your account password when asked. Nothing is displayed on the screen when you type the password. Thats okay. Type it and press enter and confirm the deletion.
![][14]
Well, thats about it. I hope you find this tutorial helpful.
--------------------------------------------------------------------------------
via: https://itsfoss.com/install-chrome-debian-kali-linux/
作者:[Abhishek Prakash][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://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://www.google.com/chrome/
[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/download-chrome-on-debian.webp?resize=800%2C344&ssl=1
[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/downloading-google-chrome.webp?resize=800%2C512&ssl=1
[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/save-downloaded-chrome-installer-file-debian.webp?resize=800%2C430&ssl=1
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/open-deb-file-with-software-install.webp?resize=800%2C419&ssl=1
[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/installing-chrome-debian.webp?resize=800%2C408&ssl=1
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/enter-account-password-while-installing-deb-file.webp?resize=800%2C420&ssl=1
[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/chrome-installed-debian.webp?resize=800%2C384&ssl=1
[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/start-chrome-debian.webp?resize=800%2C276&ssl=1
[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/Chrom-in-Debian.webp?resize=800%2C450&ssl=1
[11]: https://itsfoss.com/download-files-from-linux-terminal/
[12]: https://itsfoss.com/install-deb-files-ubuntu/
[13]: https://linuxhandbook.com/update-kali-linux/
[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/remove-google-chrome-ubuntu.webp?resize=800%2C450&ssl=1

View File

@ -1,117 +0,0 @@
[#]: subject: "What is a hostname?"
[#]: via: "https://opensource.com/article/21/10/what-hostname"
[#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
What is a hostname?
======
Hostnames are labels for humans to refer to a specific computer.
![Computer screen with files or windows open][1]
Computers have network addresses, but they're usually difficult for humans to remember. Hostnames are labels intended to help humans refer to a specific computer. Instead of navigating to 192..168.1.4, for instance, you might navigate to `linuxlaptop`or `linuxlaptop.local`.
### Addresses and Names
All networked computers (also referred to as hosts) need an address—a unique number associated with it that allows for datagrams to route among them for correct data communications. This is known as the Internet Protocol (IP) address. The number 54.204.39.132 is an Internet Protocol version 4 (IPv4) address. The newer IPv6 addresses are much longer, like this: 2001:0db6:3c4d:0017:0000:0000:2a2f:1a2b. WHOA! That is going to be hard to memorize!
```
`$ ip addr show`
```
Computers can also be given labels. Known as the hostname, these are friendly names for easier reference. I could set my computer's hostname to be _copperhead_. As long as that name is unique on the network, all other users and computers can refer to it as copperhead instead of the IP address number.
```
`$ hostname -s`
```
You can update your computer's hostname.
Read Seth Kenlon's article [How to change a hostname on Linux][2] to learn how to do that on Linux.
#### Fully qualified domain name
Technically, the hostname includes a domain name. If my domain name is mycompany.com, then together—delimited by periods, my computer's hostname is copperhead.mycompany.com. This forms a fully qualified domain name (FQDN). This is important because the IP address resolves to the FQDN.
```
`host.domain.topleveldomain`
```
For example: `www.example.com` is a fully qualified domain name.
Your domain name is generally determined already, so you're only responsible for providing the host portion. This article focuses on the host. 
#### Name resolution
The process of translating the IP address to the corresponding hostname is known as name resolution. The first place that this occurs is in a local hosts table. Linux uses the file `/etc/hosts` to store this table.
```
`cat /etc/hosts`
```
There is also a hierarchical and decentralized network-based system that provides resolution called the Domain Name System (DNS). This is when the FQDN becomes really important.
```
`$ dig www.opensource.com`
```
### Fun with names
It can be fun to think up names for our computers. If you have many, you could use a theme. I once worked for a company that named all of its servers after snakes.
A later company I worked for, where I was a data center manager, used beer brands. It was exciting when we received a new server because I would email the development team for suggestions. We had roughly 100 servers. These provided an interesting list that reflected the diversity of the company. We had everything from coors and bud to amstel and deleriumtremens. We had tiger and singha and sapporo and many others too!
We thought it was cool! Then again, imagine what happens when you try to remember that lowenbrau is the virtualization server with the most RAM and peroni is the SQL database server and heineken is the new domain controller, particularly for new employees in a rapidly growing company.
### Conventions
Hostnames are the choice of the owner, of course, so have fun with it. However, depending on the environment, it might make more sense to use names that are easy to remember or based on a naming convention that lends to being descriptive to the host. 
#### Useful names
If you want to forego the fun and helpfully name your systems, perhaps consider their function. Database servers might be named database1, database2, database3, and so on. Web servers might be webserver1, webserver2, and so on.
#### Positional names
I have used a technique with many clients to name server hosts with sets of characters in positions that describe an aspect of that system that helps identification. For example, if I were working on a Business Process Management (BPM) system for the Department of the Interior (DOI), I would incorporate their acronyms in the naming convention.
Furthermore, just as with many large corporations, financial institutions, and governments, they might have various data centers located in disparate geographical locations for purposes of performance or disaster recovery. So, say, a data center on the East coast of the North American continent is referred to as ED, and those on the West coast are WD. East Data center and West Data center.
All of this information would come together in a name such as doibpm1ed or doibpm1wd. So, while these names don't look like much, someone working on this project would readily be able to identify each as to their purpose and location, and the name may even help to obfuscate their usage to would-be mal-actors. In other words, the owner could choose naming that would only make sense to insiders. 
### Internet standards
Several standards govern hostnames. You can find these in Requests for Comment (RFC) maintained by The Internet Engineering Task Force (IETF). As of now, adhere to the following:
*  A hostname should be between 1 and 63 ASCII characters in length
*  A FQDN has a maximum length of 253 ASCII characters
*  Case-insensitive
*  Allowed characters: a to z, 0 to 9, - (hyphen), and _ (underscore)
I hope this article helps to clarify hostnames. Have some fun and be creative.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/10/what-hostname
作者:[Alan Formy-Duval][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/alanfdoss
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_screen_windows_files.png?itok=kLTeQUbY (Computer screen with files or windows open)
[2]: https://opensource.com/article/21/10/how-change-hostname-linux

View File

@ -0,0 +1,277 @@
[#]: subject: "Create a timer on Linux"
[#]: via: "https://opensource.com/article/21/10/linux-timers"
[#]: author: "Stephan Avenwedde https://opensource.com/users/hansic99"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Create a timer on Linux
======
A tutorial showing how to create a POSIX-compliant interval timer.
![Team checklist][1]
The timing of certain events is a common task for a developer. Common scenarios for timers are watchdogs, cyclic execution of tasks, or scheduling events for a specific time. In this article, I show how to create a POSIX-compliant interval timer using [timer_create(...)][2].
You can download the source code for the following examples from [GitHub][3].
### Prepare Qt Creator
I used [Qt Creator][4] as the IDE for this example. To run and debug the example code in Qt Creator, clone the [GitHub][3] repository, open Qt Creator, and go to **File -&gt; Open File or Project...** and choose the **CMakeLists.txt**:
![Qt Creator open project][5]
Open a project in Qt Creator (CC-BY-SA 4.0)
After selecting the toolchain, click on **Configure Project**. The project contains three independent examples (we will only cover two of them in this article). With the green-marked menu, switch between the configurations for each example and activate **Run in terminal** for each of them (see the yellow mark below). The currently active example for building and debugging can be selected over the **Debug** button on the bottom left corner (see the orange mark below):
![Project configuration][6]
Project configuration (CC-BY-SA 4.0)
### Threading timer
Let's take a look at the _simple_threading_timer.c_ example. This is the simplest one: It shows how an interval timer is created, which calls the function **expired** on expiration. On each expiration, a new thread is created in which the function **expiration** is called.
```
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;time.h&gt;
#include &lt;signal.h&gt;
#include &lt;unistd.h&gt;
#include &lt;string.h&gt;
#include &lt;errno.h&gt;
void expired(union sigval timer_data);
pid_t gettid(void);
struct t_eventData{
    int myData;
};
int main()
{
    int res = 0;
    timer_t timerId = 0;
    struct t_eventData eventData = { .myData = 0 };
    /*  sigevent specifies behaviour on expiration  */
    struct sigevent sev = { 0 };
    /* specify start delay and interval
     * it_value and it_interval must not be zero */
    struct itimerspec its = {   .it_value.tv_sec  = 1,
                                .it_value.tv_nsec = 0,
                                .it_interval.tv_sec  = 1,
                                .it_interval.tv_nsec = 0
                            };
    [printf][7]("Simple Threading Timer - thread-id: %d\n", gettid());
    sev.sigev_notify = SIGEV_THREAD;
    sev.sigev_notify_function = &amp;expired;
    sev.sigev_value.sival_ptr = &amp;eventData;
    /* create timer */
    res = timer_create(CLOCK_REALTIME, &amp;sev, &amp;timerId);
    if (res != 0){
        [fprintf][8](stderr, "Error timer_create: %s\n", [strerror][9](errno));
        [exit][10](-1);
    }
    /* start timer */
    res = timer_settime(timerId, 0, &amp;its, NULL);
    if (res != 0){
        [fprintf][8](stderr, "Error timer_settime: %s\n", [strerror][9](errno));
        [exit][10](-1);
    }
    [printf][7]("Press ETNER Key to Exit\n");
    while([getchar][11]()!='\n'){}
    return 0;
}
void expired(union sigval timer_data){
    struct t_eventData *data = timer_data.sival_ptr;
    [printf][7]("Timer fired %d - thread-id: %d\n", ++data-&gt;myData, gettid());
}
```
The advantage of this approach is its small footprint, in terms of code and simple debugging. The disadvantage is the additional overhead due to the creation of a new thread on expiration and, consequently, the less deterministic behavior.
### Interrupt Signal Timer
Another possibility to be notified by an expired timer is based on a [kernel signal][12]. Instead of creating a new thread each time the timer expires, the kernel sends a signal to the process, the process is interrupted, and the corresponding signal handler is called.
As the default action when receiving a signal is to terminate the process (see [signal][13] man page), we have to prepare Qt Creator in advance so that properly debugging is possible.
The default behavior of Qt Creator when the debuggee receives a signal is:
* Interrupt execution and switch to the debugger context.
* Display a pop-up window that notifies the user about the reception of a signal.
Both actions are not wanted as the reception of a signal is part of our application.
Qt Creator uses GDB in the background. In order to prevent GDB from stopping the execution when the process receives a signal, go to **Tools** -&gt; **Options**, select **Debugger**, and navigate to **Locals &amp; Expressions**. Add the following expression to _Debugging Helper Customization_:
```
`handle SIG34 nostop pass`
```
![Signal no stop with error][14]
Sig 34 no stop with error (CC-BY-SA 4.0)
You can find more information about GDB signal handling in the [GDB documentation][15].
Next, we want to suppress the pop-up window that notifies us every time a signal is received when we stop in the signal handler:
![Signal 34 pop up box][16]
Signal 34 pop-up box (CC-BY-SA 4.0)
To do so, navigate to the tab **GDB** and uncheck the marked checkbox:
![Timer signal windows][17]
Timer signal windows (CC-BY-SA 4.0)
Now you can properly debug the _signal_interrupt_timer_. The actual implementation of the signal timer is a bit more complex:
```
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;signal.h&gt;
#include &lt;unistd.h&gt;
#include &lt;signal.h&gt;
#include &lt;time.h&gt;
#include &lt;unistd.h&gt;
#include &lt;errno.h&gt;
#include &lt;string.h&gt;
#define UNUSED(x) (void)(x)
static void handler(int sig, siginfo_t *si, void *uc);
pid_t gettid(void);
struct t_eventData{
    int myData;
};
int main()
{
    int res = 0;
    timer_t timerId = 0;
    struct sigevent sev = { 0 };
    struct t_eventData eventData = { .myData = 0 };
    /* specifies the action when receiving a signal */
    struct sigaction sa = { 0 };
    /* specify start delay and interval */
    struct itimerspec its = {   .it_value.tv_sec  = 1,
                                .it_value.tv_nsec = 0,
                                .it_interval.tv_sec  = 1,
                                .it_interval.tv_nsec = 0
                            };
    [printf][7]("Signal Interrupt Timer - thread-id: %d\n", gettid());
    sev.sigev_notify = SIGEV_SIGNAL; // Linux-specific
    sev.sigev_signo = SIGRTMIN;
    sev.sigev_value.sival_ptr = &amp;eventData;
    /* create timer */
    res = timer_create(CLOCK_REALTIME, &amp;sev, &amp;timerId);
    if ( res != 0){
        [fprintf][8](stderr, "Error timer_create: %s\n", [strerror][9](errno));
        [exit][10](-1);
    }
    /* specifz signal and handler */
    sa.sa_flags = SA_SIGINFO;
    sa.sa_sigaction = handler;
    /* Initialize signal */
    sigemptyset(&amp;sa.sa_mask);
    [printf][7]("Establishing handler for signal %d\n", SIGRTMIN);
    /* Register signal handler */
    if (sigaction(SIGRTMIN, &amp;sa, NULL) == -1){
        [fprintf][8](stderr, "Error sigaction: %s\n", [strerror][9](errno));
        [exit][10](-1);
    }
    /* start timer */
    res = timer_settime(timerId, 0, &amp;its, NULL);
    if ( res != 0){
        [fprintf][8](stderr, "Error timer_settime: %s\n", [strerror][9](errno));
        [exit][10](-1);
    }
    [printf][7]("Press ENTER to Exit\n");
    while([getchar][11]()!='\n'){}
    return 0;
}
static void
handler(int sig, siginfo_t *si, void *uc)
{
    UNUSED(sig);
    UNUSED(uc);
    struct t_eventData *data = (struct t_eventData *) si-&gt;_sifields._rt.si_sigval.sival_ptr;
    [printf][7]("Timer fired %d - thread-id: %d\n", ++data-&gt;myData, gettid());
}
```
In contrast to the threading timer, we have to initialize the signal and register a signal handler. This approach is more performant as it won't cause the creation of additional threads. For this reason, the execution of the signal handler is also more deterministic. The drawback is clearly the extra configuration effort to debug this properly.
### Summary
Both methods described in this article are close-to-the-kernel implementations of timers. Even if the [timer_create(...)][2] function is part of the POSIX specification, it is not possible to compile the sample code on a FreeBSD system due to small differences in data structures. Besides this drawback, such an implementation gives you fine-grained control for general-purpose timing applications.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/10/linux-timers
作者:[Stephan Avenwedde][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/hansic99
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_todo_clock_time_team.png?itok=1z528Q0y (Team checklist)
[2]: https://linux.die.net/man/2/timer_create
[3]: https://github.com/hANSIc99/posix_timers
[4]: https://www.qt.io/product/development-tools
[5]: https://opensource.com/sites/default/files/posix_timers_open_project_0.png
[6]: https://opensource.com/sites/default/files/posix_timers_project_configuration_2.png
[7]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html
[8]: http://www.opengroup.org/onlinepubs/009695399/functions/fprintf.html
[9]: http://www.opengroup.org/onlinepubs/009695399/functions/strerror.html
[10]: http://www.opengroup.org/onlinepubs/009695399/functions/exit.html
[11]: http://www.opengroup.org/onlinepubs/009695399/functions/getchar.html
[12]: https://man7.org/linux/man-pages/man3/signal.3p.html
[13]: https://linux.die.net/man/7/signal
[14]: https://opensource.com/sites/default/files/posix_timers_sig34_nostop_pass.png
[15]: https://sourceware.org/gdb/onlinedocs/gdb/Signals.html
[16]: https://opensource.com/sites/default/files/posix_timers_sig34_pop_up_2.png
[17]: https://opensource.com/sites/default/files/posix_timers_signal_windows.png

View File

@ -1,92 +0,0 @@
[#]: subject: "Seahorse: Manage Your Passwords & Encryption Keys in Linux"
[#]: via: "https://itsfoss.com/seahorse/"
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Seahorse: Manage Your Passwords & Encryption Keys in Linux
======
_**Brief:**_ _A simple open-source password and encryption key manager app, lets explore what it has to offer and how you can get it installed._
We often tend to ignore many default/pre-installed applications, especially when numerous tools and utilities are baked in.
One such helpful tool that you can use on various Linux distributions is **GNOMEs Seahorse**.
### Seahorse: GNOMEs Password &amp; Encryption Key Manager
![][1]
Primarily, Seahorse is an application that comes pre-installed with GNOME desktop and tailored for the same.
However, you can use it on just about any Linux distribution of your choice. It is a simple and effective utility to manage your passwords and encryption keys / keyring locally.
You might want to read about the [concept of keyring in Linux][2] if its a first for you.
If you are not a fan of cloud-based password managers, Seahorse can be a great solution to your requirements. Even though it looks straightforward, there are a few essential features that you may find useful.
Of course, you should also explore some of the [best password managers available for Linux][3] if your priority doesnt involve managing encryption keys (or local storage).
### Features of Seahorse
While you can easily use it as a local (offline) password manager, there are a couple of things that you can do with Seahorse to step up your security management when dealing with encryption keys as well.
![][4]
Some key highlights are:
* Ability to store Secure Shell key (used to access remote computers/servers)
* Store GPG keys used to secure emails and files
* Supports adding password keyring for application and networks
* Securely store private key of a certificate
* Store a password / secret phrase
* Ability to import files and quickly store them
* Find remote keys
* Sync and publish keys
* Ability to find/copy VPN password
![][5]
### Installing Seahorse in Linux
If you are using a GNOME-based distribution, you should already have it installed. You need to look for “Seahorse” or “Passwords” to find it.
In other cases, you can search for it in the software center. It should work fine with KDE, LXQt, and different desktop environments as per my quick tests.
![][6]
Moreover, you can find its [Flatpak package][7] available. So, no matter the Linux distribution you are using, Seahorse can be installed.
If you are using Arch Linux, you should also find it in [AUR][8].
[Seahorse][9]
What do you think about using Seahorse to replace other password managers? Were you already using it to manage encryption keys? Let me know your thoughts in the comments below.
--------------------------------------------------------------------------------
via: https://itsfoss.com/seahorse/
作者:[Ankush Das][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://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/seahorse-password-keys.png?resize=800%2C613&ssl=1
[2]: https://itsfoss.com/ubuntu-keyring/
[3]: https://itsfoss.com/password-managers-linux/
[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/seahorse-login.png?resize=800%2C583&ssl=1
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/seahorse-keys.png?resize=800%2C579&ssl=1
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/seahorse-software.png?resize=800%2C508&ssl=1
[7]: https://www.flathub.org/apps/details/org.gnome.seahorse.Application
[8]: https://itsfoss.com/aur-arch-linux/
[9]: https://wiki.gnome.org/Apps/Seahorse/

View File

@ -0,0 +1,211 @@
[#]: subject: "Beginners Guide to Installing Pop!_OS Linux"
[#]: via: "https://itsfoss.com/install-pop-os/"
[#]: author: "Pratham Patel https://itsfoss.com/author/pratham/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Beginners Guide to Installing Pop!_OS Linux
======
_**Brief: Learn to install Pop OS Linux distribution by replacing all other operating systems on your computer.**_
[Pop!_OS][1] is the Linux distribution created by System76 and is based on Ubuntu. Since System76 sells [Linux-first laptops and desktops][2], their Linux distribution, even though is based on Ubuntu, provides support for bleeding edge hardware (only if the newer Linux kernel does not create a conflict for currently supported hardware).
Out of all the new Linux distributions out there, the user-base of Pop!_OS just “popped” out of nowhere. Considering it is a _relatively_ new distro among a plethora of other “well established distros” like Ubuntu, Manjaro, Mint etc; this is a big achievement!
This isnt an opinion article on why you should [use Pop OS over Ubuntu][3], but a guide, for you to get started with Linux on your PC by installing Pop!_OS on it.
### Choosing the instllation method for Pop OS
There are multiple ways to install Pop!_OS (and all other Linux distros) on your computer.
1. Install Pop!_OS as a Virtual Machine [using VirtualBox][4] on your PC **without affecting your current Windows install**.
2. Install Pop!_OS alongside Windows; AKA [dual boot][5] (even though the linked guide is for Ubuntu, it should work for Pop!_OS; **make sure to turn off “Secure Boot”**).
3. Replace Windows 10/11 with Pop!_OS.
I highly recommend that you [try out Pop!_OS in VirtualBox][4] before installing it on your computer, specially if you are new to Linux.
_**This tutorial covers installation of Pop!_OS replacing Windows**_, and below are the hardware requirements for Pop!_OS.
* A 4 GB USB drive to create a Live USB drive
* Any 64-bit x86 CPU (any 64-bit Intel or AMD CPU)
* At least 4 GB of RAM is recommended
* A minimum of 20 GB of storage (to store the OS)
_**WARNING: This guide assumes you want to replace Windows on your PC with a Linux distro of your choice (Pop!_OS in this case) and it results in wiping your drive clean. Please make sure you have backed up all of your important data before proceeding further.**_
### Choose the version of Pop!_OS to install
![][6]
Just like Ubuntu, Pop!_OS comes in two variants. All LTS releases are supported for 5 years from release date. Canonical releases a LTS version of Ubuntu in April of every even numbered year.
A new Non-LTS version is released every 6 months (in April and September, every year) and that particular version is supported only for 9 months from release date.
As of writing this article, Pop!_OS is available in two (technically four, but we will get to that later) versions. Current LTS release is “Pop!_OS 20.04 LTS” and “Pop!_OS 21.04”. And soon enough, version 21.10 will be released.
Because Nvidia does not have open source drivers, installing Nvidia GPU Drivers ends up causing problems to your Linux installation if not done correctly. Therefore, System76 offers two variants for each version of Pop!_OS.
Pop!_OS 20.04 LTS is [available in two variants][7] (more details in next section).
* For users with a Nvidia GPU in their computer
* For users with an AMD (and/or an Intel for iGPU and for the [upcoming dGPU][8]) users.
If you are not sure, [check the graphics card][9] on your system and choose the appropriate version while downloading.
### Installing Pop!_OS
In this guide, Ill be using the non-Nvidia version of Pop!_OS 20.04 LTS (but the installer steps will be the same for every variant of the same version).
#### Step 1: Create a live USB
Visit System76s website to download a copy of Pop!_OS.
[Download Pop!_OS][1]
![Pop!_OS ISO selection menu][10]
Select “Pop!_OS 20.04 LTS” (#1) and then click on either the normal ISO (#2) or the Nvidia-specific ISO (#3) to start downloading it.
After you have downloaded a copy of ISO that is suitable for your use case and machine, your next step will be to create a live installer for Pop!_OS. A live installer is a full copy of the OS for you to tinker with, before you feel that the OS of your liking and also compatible with your hardware.
Sometimes the distribution of your choice might not have good support for the proprietary components like WiFi, GPU etc included in your laptop/desktop. Now is the time to test your hardware compatibility.
_**NOTE: Any data stored on your USB stick will be erased at this step, make sure you do not have anything important on the flash drive.**_
You have access to numerous tools to create a live USB stick. Some of them are:
* [balenaEtcher][11] (available on Mac, Windows and Linux)
* [UNetbootin][12] (available on Mac, Windows and Linux)
* [Rufus][13] (available only on Windows)
* [Ventoy][14] (available on Windows and Linux)
On Windows, you can use Rufus to [create a live USB from Windows][15]. You may also use Etcher for Windows, Linux and macOS. It is really simple. Just start the application, browse the downloaded ISO and hit the flash button.
![A generic example of creating live Linux USB with Etcher][16]
#### Step 2: Booting from the live Pop OS USB
Once you have created the live USB, you need to tell our computer to boot from the USB stick instead of the disk on which Windows is installed.
To do that, restart your computer. And once you see your computer vendors logo (HP, Dell, Asus, Gigabyte, ASRock etc) press either the F2 or F10 or F12 or Delete key to enter your computers BIOS/UEFI. This key will differ based on your computer vendor, for most desktops it is usually the Delete key, and for most laptops it is the F2 key. If still in doubt, a quick web search should tell you which key to press for your system.
![BIOS/UEFI boot menu keys][17]
On modern computers with UEFI, you dont even need to go in UEFI. You can directly hit a specific key like F12 (my computer vendor has F12) and youll see a boot menu. From there directly select your USB stick.
![UEFI boot menu][18]
For people who have an older BIOS/UEFI, go under the section where it says Boot (do note, the steps will vary from vendor to vendor) and select your USB drive instead of your SSD/HDD. And reboot.
![UEFI/BIOS boot drive selection][19]
Your computer should now boot from the live USB you just created.
#### Step 4: Start installing Pop!_OS
You should be in the Pop!_OS live environment now. On your computer screen, you will see an installer asking you for setup details like your preferred Language, Country and Keyboard Layout.
![Pop!_OS Installation screen][20]
Once you have selected your Language, Country and Keyboard Layout, you will see this screen. You technically have 3 options.
![Pop!_OS Installation types, plus Demo Mode][21]
* Clean Install (#1): This option will erase your entire disk and install Pop!_OS on it.
* Custom (Advanced) (#2): This option will allow you to specify things like root partition, if you want a different home partition, use another file system for your root partition, resize partitions, use a different sized swap partition etc.
* Try Demo Mode (#3): An option in the bottom left of the installer that allows you to test drive Pop!_OS as if it was actually installed on your computer without actually touching your drive contents.
**For the scope of this tutorial, proceed by selecting Clean Install.**
Next up, specify a drive where you want to install Pop!_OS on. In case your computer has multiple drives, you will see each drive labelled along with its size so you can be assured if the drive you have selected is the one you have decided to install Pop!_OS on.
![Pop!_OS Drive selection options][22]
You will be prompted to provide your name and a username for your user. Your username will be the name of your home folder.
![Pop!_OS Users Name and username input][23]
Up next, set a password for your user.
![Pop!_OS User password input][24]
The final step includes setting up Drive Encryption. If someone has physical access to your computer, your data on the disk can be accessed using a live operating system (like the live USB you created).
The disk encryption prevents that. However, you must never forget the password or youll never be able to use the disk again.
It is up to you if you want to encrypt the disk.
![Pop!_OS Drive Encryption options][25]
The installer will give you three options for encryption.
* Dont Encrypt (#1): Does not encrypt your drive. Not recommended for security conscious users
* Use user password for drive encryption (#2): This will tell the installer to use the same password for your user and for drive encryption. If you use this option, make sure your user has a strong password.
* Set Password (#3): Use a different password for encrypting drive.
Whichever you choose, the installation should start now. Below is a screenshot showing the installer screen.
![Pop!_OS Installation screen, plus log button][26]
Just in case you encounter any error(s) during this step, click on the button placed at the bottom right edge of installer with “$_” (annotated as “Log” in the screenshot above) in it. It is the installer log. Posting a few lines from the bottom of this log should help others from [our community forum][27] or any other forums help you diagnose the issue causing installation errors.
Please wait for a few minutes for the installer to finish installing and it will provide you with two options, Reboot or Shut Down. Power off your computer and remove the USB drive.
Congratulations! You just installed Pop!_OS on your computer! Let me know if you face any issues.
--------------------------------------------------------------------------------
via: https://itsfoss.com/install-pop-os/
作者:[Pratham Patel][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://itsfoss.com/author/pratham/
[b]: https://github.com/lujun9972
[1]: https://pop.system76.com/
[2]: https://itsfoss.com/get-linux-laptops/
[3]: https://itsfoss.com/pop-os-vs-ubuntu/
[4]: https://itsfoss.com/install-linux-in-virtualbox/
[5]: https://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/POP_OS-Installation.png?resize=800%2C450&ssl=1
[7]: https://pop.system76.com
[8]: https://www.phoronix.com/scan.php?page=news_item&px=Intel-DG1-Status-XDC2021
[9]: https://itsfoss.com/check-graphics-card-linux/
[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/pop-os-download-options.webp?resize=800%2C740&ssl=1
[11]: https://www.balena.io/etcher/
[12]: https://unetbootin.github.io
[13]: https://rufus.ie/en/
[14]: https://www.ventoy.net/en/index.html
[15]: https://itsfoss.com/create-live-usb-of-ubuntu-in-windows/%5D
[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/11/balena-etcher-create-linux-live-usb.png?resize=800%2C450&ssl=1
[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/03-01-bios-uefi-boot-menu-keys.webp?resize=732%2C366&ssl=1
[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/03-02-boot-menu.webp?resize=731%2C364&ssl=1
[19]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/03-03-select-boot-drive-3.webp?resize=800%2C399&ssl=1
[20]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/04-01-installer-init.webp?resize=800%2C595&ssl=1
[21]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/04-02-installation-options.webp?resize=800%2C595&ssl=1
[22]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/04-03-drive-selection.webp?resize=800%2C595&ssl=1
[23]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/04-04-name-and-username-selection.webp?resize=800%2C595&ssl=1
[24]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/04-05-password-setup-screen.webp?resize=800%2C595&ssl=1
[25]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/04-06-drive-encryption-options.webp?resize=800%2C595&ssl=1
[26]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/04-08-installation.webp?resize=800%2C595&ssl=1
[27]: https://itsfoss.community/

View File

@ -0,0 +1,112 @@
[#]: subject: "9 ways to use open source every day"
[#]: via: "https://opensource.com/article/21/10/open-source-tools"
[#]: author: "Don Watkins https://opensource.com/users/don-watkins"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
9 ways to use open source every day
======
You may be surprised to learn that the tools you use every day are open
source.
![Tools illustration][1]
Recently I was invited to present on free and open resources that are available on the web. This presentation was part of a local effort to keep our community working—sponsored by the [Foster Center][2] at St. Bonaventure University near my home. Some of the resources I shared were not open source and merely cost $0, but many of the tools were also open source.
It was interesting to see how many folks recognized the tools I mentioned. Many people are unaware that the tools they use every day are open source, and they can share them with others. 
### Open source browsers
Using the web requires a good browser, and [Firefox is open source][3], which some of the folks I was presenting to were unaware of. In addition to being open source, Firefox is strongly conscious of privacy, which is a growing concern for many users. Interestingly, though, even Microsoft's new browser is based on the open source Chromium project. 
### Open source web privacy
Another way to protect your privacy and improve your web experience, in general, is to use uBlock Origin to block advertisements. According to their website:
> uBlock Origin is a free and open source, cross-platform browser extension for content filtering—primarily aimed at neutralizing privacy invasion in an efficient, user-friendly method.
The code is [GPL v. 3.0][4]. 
The Electronic Frontier Foundation (EFF) also maintains [Privacy Badger][5], a web browser extension licensed under the GPL v.3.0. According to their Github repository, it's:
> A browser extension that automatically learns to block invisible trackers. Instead of keeping lists of what to block, Privacy Badger automatically discovers trackers based on their behavior.
In addition to privacy, my presentation shared the importance of secure passwords. My audience learned about [Bitwarden][6]. Many folks had no idea how to generate secure passwords, differentiate from one website to another, and store them securely. I demonstrated how the software worked to create passwords and use Bitwarden to store those passwords in the cloud. I explained how users could access those credentials as browser plugins, desktop and laptop applications, and on Android or iOS mobile devices. 
### Open source messaging
I spoke of the ubiquity of text messaging but also its inherent insecurity. The audience was not aware of [Signal][7]. I have been using Signal for a couple of years and regularly encourage others to consider it as a secure messaging platform. It is easy to [install Signal][8] on Linux, macOS, Windows, [Android][9], and [iOS][10], and it offers excellent support [documentation][11] with detailed installation instructions for each operating system. Signal uses your existing mobile number, provided it can send and receive SMS and phone calls. The first time you set up Signal on your mobile phone, the application can search your address books for any of your contacts using Signal. 
### Open source office tools
No presentation on open source tools is complete without mentioning my favorite content creation tool, which is [LibreOffice][12]. Despite its popularity, many are unaware that it exists and the freedom that comes with its use. I use it every day to write articles. I use it instead of Excel, and sometimes I used it for presentations. You can download it and install it for Linux, macOS, and Windows. One of the beauties of LibreOffice is that you really own your documents. You don't need an expensive program to access them.
### Open source blog builder
[WordPress][13] is my favorite blogging engine, and there are myriad ways you can use it, whether sharing your own opinions on world events, a low-cost writing platform for your [students][14], or a web presence for your [business][15].
### Open source media repository
While creating content, you will need images that you can easily and legally share to illustrate your work. [OpenClipart][16] is my go-to. There are thousands of images available in various popular formats for inclusion in your LibreOffice documents and blog posts. In addition, you can find images that you can share with the proper attribution by visiting [Creative Commons][17]. Creative Commons offers licensing that makes sharing easier. Creative Commons is an extension of copyright that makes sharing easier. Be sure to familiarize yourself with the nuances of the licenses. 
### Open source video conferencing
The pandemic has changed the paradigm for conferences and meetups. Jitsi, Big Blue Button, and several others have revolutionized how we interact and learn as reported [here][18] by Chris Hermansen. 
### Open source educational resources
Open educational resources have liberated learning. With [OER Commons][19], you can find content to meet your needs, from pre-kindergarten to graduate and professional degrees, and it is openly licensed so that you can use it and share it with others. Massachusetts Institute of Technology (MIT) Open Courseware is nearly all of MIT's undergraduate and graduate content offered under a Creative Commons [non-commercial share-alike][20] license. [OpenStax][21], an open textbook initiative at Rice University, offers peer-reviewed textbooks that are openly licensed and available for free. 
### Open source podcast tools
Podcasts have become a great way to catch up on the latest [open source news][22] for me. Have you thought of starting your own podcast? There are a couple of great open source tools that I am familiar with that provide ways to make that a reality. [Audacity][23] is my favorite recording application. I have used it to flip my classroom instruction, record interviews, and experiment with sound effects. It is a 16-track audio editor that you can use in a variety of ways. If you have something to say or a skill to teach, you should use [Open Broadcaster Software][24].
### Linux
Finally, introduce your friends to Linux, which many of them still don't know about, and let them experience all the readily available free software. 
In addition to the talk recorded and shared on [YouTube][25], I compiled a list of links to the resources and shared them on [GitHub][26].
There are lots of non-code ways to contribute to open source: Here are three alternatives.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/10/open-source-tools
作者:[Don Watkins][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/don-watkins
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tools_hardware_purple.png?itok=3NdVoYhl (Tools illustration)
[2]: https://www.sbu.edu/academics/schools-at-sbu/school-of-business/foster-center-for-responsible-leadership/foster-center-events
[3]: https://opensource.com/article/21/9/switch-to-firefox
[4]: https://github.com/gorhill/uBlock
[5]: https://privacybadger.org/
[6]: https://github.com/bitwarden
[7]: https://opensource.com/article/19/10/secure-private-messaging
[8]: https://signal.org/download/
[9]: https://play.google.com/store/apps/details?id=org.thoughtcrime.securesms&referrer=utm_source%3DOWS%26utm_medium%3DWeb%26utm_campaign%3DNav
[10]: https://apps.apple.com/us/app/signal-private-messenger/id874139669
[11]: https://support.signal.org/
[12]: https://opensource.com/article/21/9/libreoffice-tips
[13]: https://opensource.com/article/18/10/setting-wordpress-raspberry-pi
[14]: https://opensource.com/article/20/4/wordpress-virtual-machine
[15]: https://opensource.com/article/21/3/wordpress-plugins-retail
[16]: https://openclipart.org/
[17]: https://search.creativecommons.org/
[18]: https://opensource.com/article/20/5/open-source-video-conferencing
[19]: https://www.oercommons.org/
[20]: https://ocw.mit.edu/help/faq-cite-ocw-content/
[21]: https://openstax.org/
[22]: https://opensource.com/article/19/10/linux-podcasts-Jupiter-Broadcasting
[23]: https://opensource.com/article/20/4/audacity
[24]: https://opensource.com/article/20/4/open-source-live-stream
[25]: https://youtu.be/aUgaYtN_sUU
[26]: https://github.com/donwatkins/Presentations/blob/master/fostercenter.md

View File

@ -0,0 +1,250 @@
[#]: subject: "3 ways to manage RPG character sheets with open source"
[#]: via: "https://opensource.com/article/21/10/manage-rpg-character-sheets"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
3 ways to manage RPG character sheets with open source
======
Learn about two terminal commands and a desktop application.
![Dice on a keyboard][1]
It's that time of year again for gamers everywhere.
Tomorrow is [Free RPG Day][2], a day when publishers across the tabletop role-playing game industry release games for players both new and experienced, and they're all completely free. Although Free RPG Day was canceled in 2020, it's back this year as a live event with some virtual support by way of free RPG sampler downloads from [Dungeon Crawl Classics][3] and [Paizo][4]. And if the event's virtual offerings aren't enough, you might check out my list of [open source tabletop RPGs.][5]
Over the past two years, like most people, I've been playing my tabletop games online. I use [open source video conferencing][6] and some [shared mapping software][7]. Don't get me wrong: I love my pen and paper for analog games. To this day, I rarely leave home without my 2E5 quad book so I can sketch out dungeon maps on the go. But I find my computer desk gets pretty cluttered between RPG sourcebooks, splat books, random tables, dice tower, dice, and character sheets. To clear some space, I've recently adopted a digital system for my character sheets, for both my player characters and non-player characters when I DM.
### Digital character sheets
Typically, a character sheet is filled out in pencil on old-fashioned physical paper. It's a time-honored tradition that I've done since the late '80s, and even more experienced players have been doing since the late '70s. Going digital can be a big step away from something that might feel like an intrinsic part of the game. I sympathize with that sentiment, and I don't take my digital character sheets lightly.
When I decide to maintain a character with the aid of a computer, I insist on substantial benefit for my divergence. I've tried two different options for digital character sheets, and one of my players invented a third. They're all open source, and I believe they each have unique advantages that make them worth trying out.
### pc
The `pc` command reads character data as an INI file, then lets you query it by category or by attribute. The format is relatively flexible, making it suitable for most RPG systems, whether you play D&amp;D, Swords &amp; Wizardry, Pathfinder, Starfinder, Stardrifter, or something else.
The syntax for an INI file is so simple that it's almost intuitive. Each heading is enclosed in brackets, and each stat is a key and value pair.
Here's a small sample:
```
[Character]
Name=Skullerix
Level=5
Class=Fighter
Ancestry=Human
[Health]
AC=14
HP=43
Max=66
```
The limitation to this format is that you can't have single-value attributes. That means that if you want to list attributes that get a proficiency bonus in D&amp;D 5th Edition, you can't just list the attributes:
```
[Save]
DEX
INT
```
Instead, you must force them to be a pair.
In D&amp;D 5e, it's easy to come up with a value. These saving throws are highlighted only because your proficiency bonus applies to them, so I just make a note of the character's current bonus:
```
[Save]
DEX=3
INT=3
```
In other systems, there may be attributes that simply don't have a value and really are meant just to be listed. In that case, you can either set a value to itself or to `True`:
```
[Save]
DEX=DEX
INT=True
```
Once you've entered your character's data into the INI format, you can query it with the `pc` command. The command requires the `--character` or `-c option` along with the character sheet file you want to query. With no further arguments, you get a listing of the entire character sheet.
Add a heading name to view all stats within one category:
```
$ pc -c skullerix.ini Character
Character:
Name: Skullerix
Level: 5
Class: Fighter
Ancestry: Human
```
Provide a heading name plus a key name to view the value of a specific stat:
```
$ pc -c skullerix.ini Character Level
Level: 5
```
If you're like me and play lots of games, you can keep all of your characters in the default location `~/.local/share/pc,` then query them without the path or file extension.
For instance, say you have `froese.ini, kitaro.ini`, and `wendy.ini<` in `~/.local/share/pc`:
```
$ pc -c kitaro Character Class
Class: Wizard
$ pc -c wendy Health AC
23
$ pc -c froese Save INT
3
```
To see the characters in your default folder, use the `--list` or `-l` option:
```
$ pc --list
froese.ini
kitaro.ini
wendy.ini
```
The pc project is written in Lua and is available from its [Gitlab repository][8].
### PCGen
PCGen is an application designed to help you build and maintain characters. It even has knowledge of the rules of the system it's assisting you with. Far from just a configuration file generator, PCGen is a database of open source rules and how they relate to one another over the course of a character's life.
PCGen can build characters for D&amp;D 5e, Pathfinder 1e, Starfinder, and Fantasy Craft. When you first launch PCGen, you can download rule definitions for each game. The files are small, but depending on what you want to install, there can be a lot of files to download.
You only have to do it once, though, and PCGen tends to everything else but clicking the button to start the download for each system.
Once you have everything downloaded, you can start creating characters by selecting **New** from the **File** menu.
PCGen keeps track of incomplete tasks in the panel labeled **Things to be done**, and it helps you proceed through the process of satisfying each requirement until you've got a complete character.
![PCGen dashboard showing a character summary][9]
(Seth Kenlon, CC BY-SA 4.0)
PCGen does all calculations for you, so you don't have to figure out your skill ranks, how a proficiency bonus affects your rolls, and other computations. Better yet, you don't have to calculate how your scores change as you level up or even what benefits you get with each new level. You'll have choices to make at each level, but you don't have to flip through your rulebook in hopes you're not missing anything significant.
One of my favorite things about PCGen is its ability to render your character sheet when finished.
On paper, your eyes probably know exactly where to look to find your proficiency bonus, or skill ranks, or other character stats. In some formats, you lose that when you go digital. PCGen has a built-in renderer and can show you your character in standard character sheet layouts that an experienced player will likely find familiar.
![A traditional-looking RPG character sheet rendered by PC Gen][10]
(Seth Kenlon, CC BY-SA 4.0)
PCGen is an ENnie award winner, and it's well deserved. Maintaining a character is easy with PCGen, and it's an application I find myself opening on lazy afternoons just for the fun of building something new.
* On Linux, download PCGen's universal installer from [pcgen.org.][11] You must have [Java installed][12].) Run `pcgen.sh` to launch the application.
* On macOS, download PCGen's universal installer from [pcgen.org][11]. You must have [Java installed][13].) Run `pcgen.sh` to launch the application.
* On Windows, download PCGen's Windows installer from [pcgen.org][11]. You must also [install Java][14].
### Player character XML
One of the advantages of using a terminal command to query character sheets is that you gain independence from the layout.
Playing several game systems can be taxing, because nearly every system has its own layout. With a terminal command, however, instead of looking over sheets of paper for data, you look up the same information quickly by letting your computer do the scanning.
One of the projects I've been enjoying lately for character tracking is the d project, which uses XML to express character stats and the `xmllint` command to query it. The d project features a few utilities:
* `d` command rolls dice (include FUDGE die).
* `v` command queries character sheets.
* The `e` command initializes your home directory by placing files in predictable locations.
Because [XML is so flexible][15], this format allows you to devise your own schema, depending on what works best for your system.
For example, a class-based system like D&amp;D or Pathfinder may benefit from a section for special class features, while a skill-based system might have a simple schema with no categories.
Here's a simple example:
```
&lt;char&gt;
  &lt;name&gt;Robin Hood&lt;/name&gt;
  &lt;health&gt;20&lt;/health&gt;
  &lt;acrobat&gt;5&lt;/acrobat&gt;
  &lt;archery&gt;8&lt;/archery&gt;
  &lt;disguise&gt;3&lt;/disguise&gt;
&lt;/char&gt;
```
First, export the location of the character sheet:
```
`$ export CHAR_SHEET=~/.config/char/robin.xml`
```
Alternately, you can initialize your home directory with the `e` command, which creates the `~/.config/char` directory and defines the `CHAR_SHEET` variable in your `.bashrc` file:
```
`$ e init`
```
After you've got your environment configured, you can query your character sheet:
```
$ ./v char.name
&lt;name&gt;Robin Hood&lt;/name&gt;
$ ./v char.archery
&lt;archery&gt;7&lt;/archery&gt;
```
Functionally, `v` is similar to the `pc` script, but because it uses XML, there are a lot of possibilities for how you view it. With XSL, you could style your XML-based character sheet and give it a layout for users who aren't comfortable in the terminal but still retain the XML source for those who are.
### Open source at the open table
Whether you're looking for a complex application like PCGen to guide you through character creation or simple utilities like pc or d to quickly query character stats, open source has plenty of options for you.
And the choice of tooling is precisely what makes it such a pleasure to do your analog game in a digital remote setting.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/10/manage-rpg-character-sheets
作者:[Seth Kenlon][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/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/dice-keys_0.jpg?itok=PGEs3ZXa (Dice on a keyboard)
[2]: https://www.freerpgday.com/
[3]: https://goodman-games.com/blog/2021/10/06/pdf-previews-of-our-free-rpg-day-releases/
[4]: https://paizo.com/community/blog/v5748dyo6shte
[5]: https://opensource.com/article/20/7/free-rpg-day
[6]: https://opensource.com/article/21/9/alternatives-zoom
[7]: https://opensource.com/article/19/6/how-use-maptools
[8]: https://gitlab.com/slackermedia/pc
[9]: https://opensource.com/sites/default/files/uploads/pcgen-build.png (Character building with PCGEN)
[10]: https://opensource.com/sites/default/files/uploads/pcgen-render.png (rendered character sheet)
[11]: http://pcgen.org/download/
[12]: https://opensource.com/article/19/11/install-java-linux
[13]: https://opensource.com/article/20/7/install-java-mac
[14]: https://access.redhat.com/documentation/pt-br/openjdk/11/html-single/installing_and_using_openjdk_11_for_windows/index
[15]: https://opensource.com/article/21/7/what-xml

View File

@ -0,0 +1,122 @@
[#]: subject: "5 open source tabletop RPGs you should try"
[#]: via: "https://opensource.com/article/21/10/rpg-tabletop-games"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
5 open source tabletop RPGs you should try
======
Open source games to download for both casual and experienced gamers.
![Gaming on a grid with penguin pawns][1]
Open source arrived in the pen-and-paper RPG industry back at the turn of the century, when Wizards of the Coast, publisher of [Magic: The Gathering][2] and Dungeons &amp; Dragons, developed the [Open Game License (OGL)][3]. Many publishers have since adopted the OGL themselves or use similar licenses, such as [Creative Commons][4].
Today is [Free RPG Day][5]. It's the one day a year you can go to your friendly local game store and pick up, at no cost, a free tabletop role-playing game from some of the biggest publishers in the hobby. If you don't have a local game store or can't get out to a game store, some free RPG sampler downloads are available from [Dungeon Crawl Classics][6] and [Paizo][7]. But not everything for Free RPG Day is available as a download, so I've collected five of my favorite open source tabletop games that you can download and play.
![OSRIC][8]
Image ©2021 OSRIC project
### OSRIC
The Old School Reference and Index Compilation (OSRIC) project effectively reimplements the rules for the world's first role-playing game: the original edition of Dungeons &amp; Dragons. These are the rules used in the late 1970s to early 1980s, so players can experience role-playing games as they were when they were just getting started.
There's nothing wrong with the original D&amp;D rules, of course. You can still find copies of the original books on the bookshelves of many gamers (myself included). However, the original rules aren't in print anymore, so they're not easy to obtain, and they certainly aren't being developed or updated to account for omissions.
The gaming industry has also come a long way since the early '80s. [Instruction books for games][9] used to be written more like encyclopedia entries than entertainment, but OSRIC seeks to bring the fun of the original game to a new generation of gamers, and to gamers looking to return to the glory of gaming days past. Regardless of which category you fit into, OSRIC is worth downloading.
Get it from [osricrpg.com][10].
### Stardrifter
Not all RPG is high fantasy.
The Stardrifter project is a rules-light science fiction game that helps your gaming group experience stories in the style of rousing space operas like _Star Trek, The Repairman_ by Harry Harrison, _Foundation_, and _Blake 7_, or tales you might read in _Amazing Stories_ or _Starlog._
Character creation is quick, and it's mostly skill-based. It took me a few minutes to roll up a character and a little longer to mull over what kind of background and skillset my character would have.
The dice system is easy: roll under your attribute score on a d20 for success. The gamemaster doesn't have to set difficulty classes or other thresholds, although situational modifiers can be applied to reflect extreme circumstances (sometimes in your favor, sometimes to your detriment).
It's an elegant system, and its rulebook is an easy and entertaining read. I especially enjoy the artwork, which consists of scans from classic (now public domain) science fiction comic books.
But wait, there's more!
A natural characteristic of many open source RPGs is that they don't feature extensive worldbuilding. Sometimes that's by design because the game intends for the gamemaster to do the worldbuilding, but sometimes it's down to a lack of staffing. Stardrifter, however, is unique because it became an RPG only after it was a series of novels. As a result, there's plenty of worldbuilding already done for the Stardrifter universe. You can start exploring Stardrifter by [downloading the books and short stories][11] in either print or audio form, and you can get a detailed overview of daily life in the Stardrifter universe from the [Voice from the Void][11] podcast.
The game was developed and released on [GitLab][12], and the whole production studio responsible for this miniature multimedia empire runs on Linux.
![One-Page Dungeon][13]
CC BY-SA Keith Indi Salamunia
### One-Page Dungeon Contest
Did I mention today is Free RPG Day?
Well, it's also the reveal of the [One-Page Dungeon Contest][14] winners! The One-Page Dungeon Contest is an annual event in which inventive gamemasters devise a dungeon that fits on one page and submit it for judging. There are officially winners, but really everyone wins, because all submissions are published in a Creative Commons collection that you can download and play through over the course of—probably—years.
As fun as adventure modules are, many gaming groups actually don't get all the way through a 64- or 250-page adventure. It's often more realistic to aim for just a single dungeon crawl. Play one dungeon every weekend, and one collection of One-Page Dungeon Contest entries will last you at least a full year.
I love how inventive the One-Page Dungeons are, too. Sure, some are straightforward dungeon delves, and those are welcome stalwarts of each collection, but others are daring and experimental. It makes for an unexpected game every time. The published dungeons tend to be indifferent to system, too, so as long as you're playing a game in which dungeons are an expected story vehicle, you can use these.
And because it's an annual community project, you can start planning your submission for next year!
### Dungeon of the Dungeons
When you have a one-page dungeon, it might be convenient to have a one-page rulebook.
The [Dungeon of the Dungeons][15] project is _technically_ one page (front and back). It's a Creative Commons-licensed game system based around a mechanic that gives bonuses to players for answering questions relating to their character's motivations.
For example, if you're playing a Bard and you're taking an action that draws attention to yourself, you add a bonus point to your dice roll. On the other hand, if you're taking an action that does _not_ draw attention to yourself, you gain no bonus point to your roll.
The result is that players are compelled to roleplay their characters true to their character class.
Because the class definitions consist of one sentence, it's trivial to invent custom ones between games. With rules as simple as two sparse pages, this is an easy and fun system for a casual game or for new players.
### FATE
The [FATE][16] system is a simple and elegant game that relies on a point-buy mechanic enabling players to influence their rolls. Using _Fate points_, players can change the narrative of a game when it matters the most.
And the narrative is paramount in FATE. It's considered a game system that's light on rules so that players can focus on collaborative storytelling and gaming.
FATE is licensed under the Creative Commons license, so it's the foundation for many variants. It's been documented in as little as [a single page][17], so there's no excuse not to get started with a FATE game if it sounds like something you'd enjoy.
### Open gaming
Open source gaming drives the modern tabletop RPG industry, but open source being what it is, it's also the product of independent creators everywhere.
Enjoy this year's Free RPG Day with a new game system or a new adventure for a system you already play.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/10/rpg-tabletop-games
作者:[Seth Kenlon][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/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/game_pawn_grid_linux.png?itok=4gERzRkg (Gaming on a grid with penguin pawns)
[2]: https://opensource.com/article/21/9/magic-the-gathering-assistant
[3]: http://www.opengamingfoundation.org/licenses.html
[4]: https://opensource.com/article/20/1/what-creative-commons
[5]: http://freerpgday.com/
[6]: https://goodman-games.com/blog/2021/10/06/pdf-previews-of-our-free-rpg-day-releases/
[7]: https://paizo.com/community/blog/v5748dyo6shte
[8]: https://opensource.com/sites/default/files/osric-splash.jpg (OSRIC)
[9]: https://opensource.com/life/16/11/software-documentation-tabletop-gaming
[10]: https://osricrpg.com/get.php
[11]: https://davidcollinsrivera.com/#stardrifter
[12]: https://gitlab.com/x1101/stardrifter-rpg
[13]: https://opensource.com/sites/default/files/keith-indi-salamunia.png (One-Page Dungeon)
[14]: https://www.dungeoncontest.com/
[15]: https://thedevteam.itch.io/dungeons-of-the-dungeons
[16]: https://www.faterpg.com/licensing/licensing-fate-cc-by/
[17]: https://zanrick.itch.io/pocket-fate

View File

@ -0,0 +1,111 @@
[#]: subject: "How I use open source to play RPGs"
[#]: via: "https://opensource.com/article/21/10/open-source-rpgs"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How I use open source to play RPGs
======
Find an open source tool for almost every element of role-playing games.
![Dice as a random number generator][1]
I play a lot of tabletop role-playing games (RPGs), in terms of both frequency and variety. Generally, I prefer playing RPGs in person with friends, but over the past two years, I've been playing online.
At first, I wasn't sure how to run a long-term game online. I knew there were a lot of tools out there to make it possible, but none of them interested me until I discovered the world of open source online tabletop gaming. With a small collection of open source applications, I've been able to run all my games exclusively on open source.
It's a good time of year for it, too, because it was recently [Free RPG Day][2]. On FreeRPG Day, publishers across the tabletop role-playing game industry release, free of charge, games to encourage players to try new games and new adventures. Although it was canceled in 2020, it's back this year as a live event with some virtual support by way of free RPG sampler downloads from [Dungeon Crawl Classics][3] and [Paizo][4].
And if the event's virtual offerings aren't enough, I've compiled a list of [5 open source tabletop RPGs you may not have tried yet][5].
When you're ready to start playing, try some of these open source tools and see how much they can enhance your gameplay.
### Chat
The most basic—and technically speaking, the only—requirement for an RPG game online is communication. It's the medium of the game: players need a way to talk.
There are a few good options for this. I find that [Mumble][6] is the tool with the lowest demand on bandwidth. It's a voice-only chat application that can use the very efficient Opus codec to get everyone talking for hours at a time without interruption.
![Mumble client][7]
CC BY-SA Seth Kenlon
There are public instances all around the world, so after downloading the Mumble client, you can join any of them that are open and use it to run a game online. There's a push-to-talk setting, so you can cut out background noise, which is a welcome feature when the rest of your household doesn't halt all of its activity just for your tabletop session.
There's also a text chat client for asides. My gaming groups usually use the chat to post links relevant to the game, but you could also use it for off-topic chatter in an attempt to keep the spoken game on topic.
If your players prefer facial cues or are just used to video chat web apps, then [Jitsi][8] is an excellent substitute for in-person gatherings around a table. Jitsi is mostly like every other video chat application you've ever used, except possibly even easier. You can set up a room, invite friends, keep out strangers, and play for hours. Muting and going off-camera are intuitive, the interface is attractive, and new features are being developed and introduced regularly.
![Jitsi][9]
CC BY-SA Seth Kenlon
Both Mumble and Jitsi have clients for both desktop and mobiles, so anyone can play no matter what device they're on.
### Character sheets
I've already posted about my [digital character sheet][10] solutions, but any RPG player knows that there's more to managing a character than just stats.
During a game online that spanned several sessions, I found there was a lot of downtime between games. It occurred to me that, while I found it unreasonable to demand that my players calculate encumbrance during a live pen-and-paper game, it's pretty easy to request them to track encumbrance when everything's digital.
There are plenty of spreadsheets available online, but the open source option is [Ethercalc][11]. With instances all over the world, it's easy to find a free Ethercalc host. Alternately, you can use Podman or Docker to easily install and run your own instance.
![Ethercalc spreadsheet of inventory][12]
Seth Kenlon, CC-BY-SA 4.0
Ethercalc provides the essentials: a shared ledger so players can track the items their party is carrying (and who's holding one at any given time), the weight of each item, and the value. Items get entered as the party collects loot during the game, so they know when they're too burdened to pick up something new.
Between sessions, the shared spreadsheet can be referenced and organized so that the PCs know what to sell or stuff into a bag of holding or what they can safely drop when better loot presents itself next session.
### Maps
Mythic Table is an open source shared mapping system for tabletop games. That means you can load an image to serve as the map of your game and move digital tokens on the map to represent where players' characters are located.
Since [last I wrote about Mythic Table][13], it's run a successful Kickstarter campaign to ensure its continued development. It's also gained several new features, most notably a "fog of war" feature that allows the dungeon master to blank out the map and reveal only the parts that players have explored.
![A dungeon map rendered by Mythic Table and user interface choices for chat, maps, and characters][14]
Seth Kenlon, CC-BY-SA 4.0
I've been running two games on Mythic Table for the past few months, and it's been an excellent and straightforward map system. Conveniently, it also features a digital dice roller, so if your players lack dice or you prefer to roll dice in the open, you have a shared dice pool.
You can try Mythic Table at [mythictable.com][15] or visit their code repository on [Github][16].
### Open gaming on open source
The open source tools I use are universal, so they work with whatever game system you decide to play. Because they're all open source, they can be used online by all your players regardless of what OS they use, and they can all be self-hosted.
If you're a programmer as well as a gamer, visit their Git repositories and see if there's anything you can contribute. If you're a gamer or a gamemaster, try the tools out the next time you sit down at a digital game table. You might be surprised at just how few online accounts you actually need to have to use some of the best applications available for gaming.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/10/open-source-rpgs
作者:[Seth Kenlon][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/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/header_dice.png?itok=dOMrHopO (Dice as a random number generator)
[2]: https://www.freerpgday.com/
[3]: https://goodman-games.com/blog/2021/10/06/pdf-previews-of-our-free-rpg-day-releases/
[4]: https://paizo.com/community/blog/v5748dyo6shte
[5]: https://opensource.com/article/21/10/rpg-tabletop-games
[6]: http://mumble.info/
[7]: https://opensource.com/sites/default/files/mumble-client.png (Mumble client)
[8]: https://jitsi.org/
[9]: https://opensource.com/sites/default/files/jitsi-client.jpg (Jitsi)
[10]: https://opensource.com/article/21/10/3-ways-manage-your-character-sheets-open-source
[11]: http://ethercalc.net/
[12]: https://opensource.com/sites/default/files/uploads/ethercalc.jpeg (Ethercalc)
[13]: https://opensource.com/article/20/11/open-source-battle-maps
[14]: https://opensource.com/sites/default/files/uploads/mythic.jpeg (Mythic Table)
[15]: http://mythictable.com/
[16]: https://gitlab.com/mythicteam/mythictable

View File

@ -0,0 +1,103 @@
[#]: subject: "Visual Studio Code or Atom? Which Code Editor Should You Use?"
[#]: via: "https://itsfoss.com/visual-studio-code-vs-atom/"
[#]: author: "Pratham Patel https://itsfoss.com/author/pratham/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Visual Studio Code or Atom? Which Code Editor Should You Use?
======
Finding a [good open source code editor][1] is not hard these days, choosing one can be.
Microsofts [Visual Studio Code][2] and GitHubs [Atom][3] are two of the most popular, feature-rich, IDE-like code editors that have a huge user base and fan following.
Both VS Code and Atom belong to Microsoft now because Atoms original developer GitHub is now owned by Microsoft. They have an interesting, modern UI with a pretty looking native dark theme. Both editors use [Electron][4] for the user interface.
The similarities are plenty and this is why it is easy to get confused between choosing one of them for your coding set up.
If you cannot make up your mind and want to compare and choose between one VS Code and Atom, this article should help you decide for yourself.
### Visual Studio Code
![Visual Studio Codes User Interface with a busy project interface][5]
[Visual Studio Code][2] (A.K.A. VS Code) is one of the modern open source code editors. Its user-base explode because of its IDE-like features but still remaining relatively light on resources.
Visual Studio Code was made by Microsoft and is available on Linux, macOS and Windows. Microsoft released _most_ of the source code of Visual Studio Code on [GitHub][6] under the MIT License on 18th November 2015.
VS Code developers have done some fantastic optimizations with Electron to make it as lightweight and efficient as possible. And since Electron apps work on a majority of operating systems, users of Linux, macOS and Windows can all benefit from these optimizations.
[Installing VS Code on Linux][7] is pretty simple too. It is in fact available in the software center of many distributions.
#### Why you should opt for Visual Studio Code
* Visual Studio Code is [generally] chosen by folks who want a near-IDE functionality from the start and do not want to fiddle with their code editor.
* Visual Studio Code, even though based on Electron, has very little overhead compared to other Electron apps (GitHubs Atom).
* More out-of-the-box functionality like Microsofts IntelliSense auto-complete, Git integration, Markdown support.
* Plug-ins can only add features, themes and add support for new languages; and this plug-in constraint ensures the editors core stays familiar even after adding new plug-ins.
The binary releases [distributed by Microsoft][8] are still proprietary freeware. [VSCodium][9] builds upon the publicly open source code of Visual Studio Code. However, the discussion on VSCodium is beyond the scope of this article, except for considering it as a viable alternative to Visual Studio Code if you want the functionality Visual Studio Code offers, but without any proprietary elements to it.
### Atom
![User Interface of the Atom editor][10]
[GitHubs Atom][3] is another free and open source code editor available for Linux, macOS and Windows. Atom is a desktop application made with Electron for easy package development using JavaScript.
Atoms source code was released under the MIT License [on GitHub][11]. Since Atom is a GitHub product, it has Git Control embedded in it.
Atom is dubbed as the “hackable text editor for the 21st Century” because of it complete customizability using HTML, CSS and JS.
Like VS Code, you can easily [install Atom on Linux][12] and other platforms.
#### Reasons to choose Atom
* Atom is preferred by people who want a bare-bones editor and want to build upon it because of Atoms hackable nature.
* In-built Git and complete GitHub integration; not surprising considering it is developed by GitHub
* [Atoms plug-ins][13] are very easy to search, install and upgrade, from the app itself.
* Plug-ins available for Atom are very extensible, and can end up completely changing the editors functionality and end up creating almost a new editor; It truly is “hackable”.
* Atoms binary releases and its source code are fully open source (unlike Visual Studio Codes binary releases containing proprietary parts + telemetry).
* You can [turn Atom from a code editor to IDE][14] with smarter context-aware auto-completion, code navigation features, document formatting and more.
### Conclusion
Both Atom and VS Code are built on Electron. But Microsoft has done more optimization on VS Code to make it as lightweight as possible.
At this point, VS Code is like Ubuntu, ships with almost everything out of the box. While Atom is like Arch, minimal and extremely hackable (extendable).
Both, Atom and VS Code technically are under Microsoft and eventually will reach feature parity. Hence, it is best to go with the editor your community (Web dev/Soft dev) leans towards and pave the path ahead. Maybe you end up with Vim!
--------------------------------------------------------------------------------
via: https://itsfoss.com/visual-studio-code-vs-atom/
作者:[Pratham Patel][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://itsfoss.com/author/pratham/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/
[2]: https://code.visualstudio.com/
[3]: https://atom.io/
[4]: https://www.electronjs.org/
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/04_visual_studio_code.png?resize=800%2C544&ssl=1
[6]: https://github.com/microsoft/vscode
[7]: https://itsfoss.com/install-visual-studio-code-ubuntu/
[8]: https://code.visualstudio.com/Download
[9]: https://vscodium.com/
[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/05_atom.png?resize=800%2C527&ssl=1
[11]: https://github.com/atom/atom
[12]: https://itsfoss.com/install-atom-ubuntu/
[13]: https://itsfoss.com/install-packages-in-atom/
[14]: https://ide.atom.io/

View File

@ -0,0 +1,114 @@
[#]: subject: "What is Build Essential Package in Ubuntu? How to Install it?"
[#]: via: "https://itsfoss.com/build-essential-ubuntu/"
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
What is Build Essential Package in Ubuntu? How to Install it?
======
_**Brief: This is a quick tip to inform new Ubuntu users about the build-essential package, its usefulness and the installation steps.**_
Installing build-essential package in Ubuntu is as simple as typing this command in the terminal:
```
sudo apt update && sudo apt install build-essential
```
But there are several questions around it that you may want answers to:
* What is build essential package?
* What does it contain?
* Why should you install it (if install at all)?
* How to install it?
* How to remove it?
### What is build-essential package in Ubuntu?
The build-essential package actually belongs to Debian. It is not a piece of software in itself. It contains a list of packages that are required to create a Debian package (deb). These packages are libc, gcc, g++, make, dpkg-dev etc. The build-essential package contains those required packages as dependencies, so when you install build-essential, you install all those packages in one single command.
Please do NOT consider build-essential to be a super package that will magically install all kind of development tools from Ruby to Go for you in a single command. It has some development tool but not all.
#### Why would you want to install build-essential package?
It is used for creating DEB packages from the source code of an application. An average user does not go around creating DEB packages everyday, right?
However, some users may use their Ubuntu Linux system for software development. You want to [run c program in Ubuntu][1], you need gcc compiler. You want to [run C++ programs in Ubuntu][2], you need g++ compiler. If you have to use an unusual software that is only available from the source code, your system will throw [make command not found error][3] because you need to install make tool first.
All this can be installed individually, of course. However, it is much easier to take advantage of the build-essential package and install all these development tools at once. Thats the benefit you get.
It is like the [ubuntu-restricted-extras package that allows you to install several media codecs][4] at once.
Now that you know the advantage of this package, lets see how to install it.
### Installing build-essential package in Ubuntu Linux
![][5]
Open a terminal in Ubuntu by pressing the Ctrl+Alt+T shortcut and enter the following command:
```
sudo apt update
```
With sudo command, youll be asked to enter your accounts password. When you type it, nothing is displayed on the screen. That is fine. Thats how it works in most Linux systems. Type your password blindly and press enter.
![][6]
The apt update command refreshes the local package cache. This is essential for a fresh Ubuntu install.
After that, run the following command to install build-essential tool:
```
sudo apt install build-essential
```
It should show all the packages it is going to install. Press Y when asked for confirmation:
![][7]
Wait a bit for the installation to complete. Thats it.
### Removing build-essential tool from Ubuntu
Keeping those development tools wont harm your system. but if you are running low on the disk space, you may consider removing it.
Removing software is easy in Ubuntu thanks to the apt remove command:
```
sudo apt remove build-essential
```
It will be a good idea to run the autoremove command to remove the residual dependency packages as well:
```
sudo apt autoremove
```
You know all the essential about build-essential package now (pun intended). Enjoy it :)
--------------------------------------------------------------------------------
via: https://itsfoss.com/build-essential-ubuntu/
作者:[Abhishek Prakash][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://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/run-c-program-linux/
[2]: https://itsfoss.com/c-plus-plus-ubuntu/
[3]: https://itsfoss.com/make-command-not-found-ubuntu/
[4]: https://itsfoss.com/install-media-codecs-ubuntu/
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/Build-Essential-Ubuntu.png?resize=800%2C450&ssl=1
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/apt-update.png?resize=800%2C467&ssl=1
[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/install-build-essential-ubuntu.png?resize=800%2C434&ssl=1

View File

@ -0,0 +1,162 @@
[#]: subject: "Diagnose connectivity issues with the Linux ping command"
[#]: via: "https://opensource.com/article/21/10/linux-ping-command"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Diagnose connectivity issues with the Linux ping command
======
One of the most fundamental diagnostic tools for networked connectivity
is the ping command.
![World locations with red dots with a sun burst background][1]
Networked computers are so common these days that most of us take it for granted that a computer on one side of a room can contact one on the other side of the room, much less the other side of the world. When it works as designed, networking is what makes the Internet, the cloud, file shares, media streaming, remote administration, printing, and much more possible. When something goes wrong, it can sometimes be challenging to diagnose. One of the most fundamental diagnostic tools for networked connectivity is the `ping` command.
### The basic ping
When you can't reach a computer on your local network, or a server on the Internet, you can ping it. A ping sends an Internet Control Message Protocol (ICMP) packet to a destination IP address. ICMP is, by design, a rudimentary format used mostly for diagnostics: It's essentially a call and response signal.
But there's an order to troubleshooting, and it starts as close to home as possible. When in doubt, first ping your own computer to ensure you're running a networking stack. The computer you're operating is also called your _localhost_, and it has a special IP address assigned for speaking to itself: 12.0.0.1.
The `ping`** **command understands the _localhost_ hostname, its IP address, and a shortcut of just `0`.
You can control how many signals you send with the `-c` (as in _count_)** **option.
```
$ ping 0 -c1
PING 0 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.069 ms
\--- 0 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.069/0.069/0.069/0.000 ms
```
After you've established that your local networking stack is up and running, you can ping your router. The address of a router usually starts with 192,168, or 10. The exact IP address depends on your router's configuration.
When you don't specify how many pings to send, you can stop `ping` from running with **Ctrl**+**C**.
```
$ ping 192.168.0.1 
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
From 192.168.0.100: icmp_seq=2 Redirect Host(New nexthop: 192.168.0.1)
From 192.168.0.100: icmp_seq=3 Redirect Host(New nexthop: 192.168.0.1)
From 192.168.0.100: icmp_seq=4 Redirect Host(New nexthop: 192.168.0.1)
From 192.168.0.100: icmp_seq=5 Redirect Host(New nexthop: 192.168.0.1)
^C
```
If you can reach your router, that means your wired or wireless connection is working. 
What about other hosts on my network? You can ping all kinds of devices. Not all are guaranteed to respond (some devices drop ICMP packets), but many do. For instance, I can ping my printer:
```
`$ ping 192.168.0.4 `
```
### Pinging beyond your network
Beyond establishing that your own network is working as expected, you can also ping out into the wider world beyond your router. Again, not all servers are permitted to receive, much less respond to, ICMP. However, there are some that do, and a vital server to the working of the Internet is a nameserver.
Google's DNS server is relatively easy to remember, and it does respond to pings:
```
$ ping -c 2 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=116 time=53.3 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=116 time=53.5 ms
\--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 53.304/53.424/53.544/0.120 ms
```
When a site has apparently disappeared, you might be able to probe the worldwide DNS network to find out what its host server's address is, and then ping that server. This at least tells you whether the host is down or whether it's just a web server issue.
For example, say you're trying unsuccessfully to reach example.com. First, find the IP address using the `host` command:
```
$ host example.com
example.com has address 93.184.216.34
example.com has IPv6 address 2606:2800:220:1:248:1893:25c8:1946
example.com mail is handled by 0
```
And then ping the website's host by IP:
```
`$ ping 93.184.216.34 -c 1`
```
### Ping and IPv6
Ping works over IPv4 as well as IPv6. Using only one of them explicitly can be enforced by specifying `-4` or `-6`. 
### Packet size
You can change the size of the ICMP packets you're sending with the `-s` option. The default packet size is 56, which translates into 64 ICMP data bytes when combined with the 8-byte header. This command sends 43 bytes:
```
`$ ping -s 35 -c 5 8.8.8.8`
```
You can print a timestamp before each ping report in your terminal with the `-D` option. This provides the UNIX epoch time, plus microseconds:
```
$ ping -D 8.8.8.8 
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
[1634013430.297468] 64 bytes from 8.8.8.8: icmp_seq=1 ttl=116 time=53.3 ms
[1634013431.298738] 64 bytes from 8.8.8.8: icmp_seq=2 ttl=116 time=53.1 ms
```
### Ping time
You can change the time interval between pings using the `-i` option. This changes the ping interval to two seconds:
```
`$ ping -s 2 `
```
You can also stop pinging after some value of time (in seconds) with the `-w` option:
```
`$ ping -w 6`
```
### Variants
There are many implementations of ping. The `iputils` package provides a `ping` command, [Busybox ][2]has a `ping` command, and there's one from BSD and others. There's even a GUI for `ping`: Gping is available for Linux, macOS, and Windows. You can find more information for `gping` on [Github][3]. 
### Learn to ping
The `ping` command is simple, but it can be eyes and ears out on the vast expanse that is your network. Next time you have connectivity issues, let `ping` be the first tool you turn to.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/10/linux-ping-command
作者:[Seth Kenlon][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/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/world_remote_teams.png?itok=Wk1yBFv6 (World locations with red dots with a sun burst background)
[2]: https://opensource.com/article/21/8/what-busybox
[3]: https://github.com/orf/gping

View File

@ -0,0 +1,324 @@
[#]: subject: "Inspect the capabilities of ELF binaries with this open source tool"
[#]: via: "https://opensource.com/article/21/10/linux-elf-capa"
[#]: author: "Gaurav Kamathe https://opensource.com/users/gkamathe"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Inspect the capabilities of ELF binaries with this open source tool
======
Use capa to reveal all the mysteries of ELF binaries.
![Puzzle pieces coming together to form a computer screen][1]
If Linux is your primary working environment, then you might be familiar with the Executable and Linkable Format ([ELF][2]), the main file format used for executables, libraries, core-dumps, and more, on Linux. I've written articles covering native Linux tools to understand ELF binaries, beginning with [how ELF binaries are built][3], followed by some general tips on how to [analyze ELF binaries][4]. If you are not familiar with ELF and executables in general, I suggest reading these articles first.
### Introducing Capa
Capa is an [open-source project][5] from Mandiant (a cybersecurity company). In the project's own words, _capa detects capabilities in executable files_. Although the primary target of Capa is unknown and possibly malicious executables, the examples in this article run Capa on day-to-day Linux utilities to see how the tool works.
Given that most malware is Windows-based, earlier Capa versions only supported the PE file format, a dominant Windows executable format. However, starting with v3.0.0, support for ELF files has been added (thanks to [Intezer][6]).
### What are capabilities?
What does the concept of _capabilities_ actually mean, especially in the context of executable files? Programs or software fulfill certain computing needs or solve a problem. To keep things simple, our requirements could vary from finding a file, reading/writing to a file, running a program, logging some data to a log file, opening a network connection, etc. We then use a programming language of our choice with specific instructions to fulfill these tasks and compile the program. The resulting binary or executables then performs these tasks on the user's behalf, so the resulting executable is _capable_ of carrying out the above tasks.
Looking at the source code, it's easy to identify what a program does or what its intent is. However, once the program is compiled as an executable, the source code is converted to machine language and is no longer part of the resulting executable (unless compiled with debug info). We can still make some sense of it by looking at the equivalent assembly instructions backed by some knowledge of the Linux API (glibc/system calls), however, it's difficult. Tools like de-compilers do exist which try to convert the assembly to a pseudo-code of what might have been the original source code. However, it isn't a one-to-one match, and it is only a best-effort attempt.
### Why another tool?
If we have multiple native Linux tools to analyze binaries, why do we need another one? The existing tools aid developers in troubleshooting and debugging issues that might arise during development. They are often the first step for initial analysis on unknown binaries, however, they are not sufficient.
Sometimes what is needed isn't lengthy disassembly or long pseudo-code, but just a quick summary of the capabilities seen in the binary based on its API usage. Often, malicious binaries and malware employ some anti-analysis or anti-reversing techniques that render such native tools helpless.
Capa's primary audience is malware or security researchers who often come across unknown binaries for which source code isn't available. They need to identify if it's malware or a benign executable. An initial first step is finding out what the executable can do before moving to dynamic analysis. This can be done with some pre-defined rule sets matched against a popular framework (ATT&amp;CK). Native Linux tools were not designed for such uses.
### Getting Capa
Download a pre-built Capa Linux program from [here][7]. You must use v3.0.0 or above. Capa is programmed in Python, however the downloaded program isn't a `.py` file that the Python interpreter can execute. It is instead an ELF executable that runs directly from the Linux command line.
```
$ pwd
/root/CAPA
$
$ wget -q <https://github.com/mandiant/capa/releases/download/v3.0.2/capa-v3.0.2-linux.zip>
$
$ file capa-v3.0.2-linux.zip
capa-v3.0.2-linux.zip: Zip archive data, at least v2.0 to extract
$
$ unzip capa-v3.0.2-linux.zip
Archive:  capa-v3.0.2-linux.zip
  inflating: capa                    
$
$ ls -l capa
-rwxr-xr-x. 1 root root 41282976 Sep 28 18:29 capa
$
$ file capa
capa: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=1da3a1d77c7109ce6444919f4a15e7e6c63d02fa, stripped
```
### Command line options
Capa comes with a variety of command line options. This article visits a few of them, beginning with the help content:
```
$ ./capa -h
usage: capa [-h] [--version] [-v] [-vv] [-d] [-q] [--color {auto,always,never}] [-f {auto,pe,elf,sc32,sc64,freeze}]
            [-b {vivisect,smda}] [-r RULES] [-s SIGNATURES] [-t TAG] [-j]
            sample
The FLARE team's open-source tool to identify capabilities in executable files.
&lt;&lt; snip &gt;&gt;
$
```
Use this command to check if the required version of Capa (v3 and above) is running:
```
$ ./capa --version
capa v3.0.2-0-gead8a83
```
### Capa output and the MITRE ATT&amp;CK framework
Capa output can be a bit overwhelming, so first run it on a simple utility, such as `pwd`. The `pwd` command on Linux prints the current working directory and is a common command. Please note that `pwd` might be a shell-inbuilt for you (no separate executable) depending on the distro you are using. Identify its path using the `which` command first and then provide the complete path to Capa. Here is an example:
```
$ which pwd
/usr/bin/pwd
$
$ file /usr/bin/pwd
/usr/bin/pwd: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=ec306ddd72ce7be19dfc1e62328bb89b6b3a6df5, for GNU/Linux 3.2.0, stripped
$
$ ./capa -f elf /usr/bin/pwd
loading : 100%| 633/633 [00:00&lt;00:00, 2409.72 rules/s]
matching: 100%| 76/76 [00:01&lt;00:00, 38.87 functions/s, skipped 0 library functions]
+------------------------+------------------------------------------------------------------------------------+
| md5                    | 8d50bbd7fea04735a70f21cca5063efe                                                   |
| sha1                   | 7d9df581bc3d34c9fb93058be2cdb9a8c04ec061                                           |
| sha256                 | 53205e6ef4e1e7e80745adc09c00f946ae98ccf6f8eb9c4535bd29188f7f1d91                   |
| os                     | linux                                                                              |
| format                 | elf                                                                                |
| arch                   | amd64                                                                              |
| path                   | /usr/bin/pwd                                                                       |
+------------------------+------------------------------------------------------------------------------------+
+------------------------+------------------------------------------------------------------------------------+
| ATT&amp;CK Tactic          | ATT&amp;CK Technique                                                                   |
|------------------------+------------------------------------------------------------------------------------|
| DISCOVERY              | File and Directory Discovery:: T1083                                               |
+------------------------+------------------------------------------------------------------------------------+
+-----------------------------+-------------------------------------------------------------------------------+
| MBC Objective               | MBC Behavior                                                                  |
|-----------------------------+-------------------------------------------------------------------------------|
| FILE SYSTEM                 | Writes File:: [C0052]                                                         |
+-----------------------------+-------------------------------------------------------------------------------+
+------------------------------------------------------+------------------------------------------------------+
| CAPABILITY                                           | NAMESPACE                                            |
|------------------------------------------------------+------------------------------------------------------|
| enumerate files on Linux (2 matches)                 | host-interaction/file-system/files/list              |
| write file on Linux                                  | host-interaction/file-system/write                   |
+------------------------------------------------------+------------------------------------------------------+
```
Run Capa with the `-f elf` argument to tell it that the executable to analyze is in the ELF file format. This option might be required for unknown binaries; however, Capa is perfectly capable of detecting the format on its own and doing the analysis, so you can skip this option if required. In the beginning, you will see a loading/matching message as Capa loads its rules from the backend and then analyzes the executable and matches those rules against it. Skip displaying this by adding the `-q` option to all commands.
Capa output is divided into various sections. The first section uniquely identifies the binary using its md5, sha1, or sha256 hash followed by the operating system, file format, and architecture information. This information is often critical when dealing with executables. In the following sections, Capa uses the ATT&amp;CK Tactic and Technique to match the capabilities. If you are unfamiliar with what ATT&amp;CK means, please refer to the [MITRE ATT&amp;CK Framework here][8].
MITRE ATT&amp;CK is best described in the project's own words:
> MITRE ATT&amp;CK® is a globally-accessible knowledge base of adversary tactics and techniques based on real-world observations.
You can match the output of Capa in the following two sections with that of the MITRE ATT&amp;CK framework. I shall skip this part in this article.
Finally, in the Capability section, you can see two specific capabilities listed out:
```
enumerate files on Linux
write file on Linux
```
Compare this with the nature of the `pwd` program, which needs to show the current directory. Here it matches the first capability (remember the concept of everything is a file in Linux). What about the second part, which says _writing file_? We certainly haven't written `pwd` output to any file. However, remember `pwd` needs to write the current directory location to the terminal; how else will the output be printed? If you are still unsure of how this works, run the following command and match the output. If you are unfamiliar with `strace` or what it does, I have an article covering it [here][9]. Focus on the _write_ system call toward the end of the article where the `pwd` executable needs to write the directory path (string) to **1**, which stands for standard out. In our case, that is the terminal.
```
$ strace -f  /usr/bin/pwd
execve("/usr/bin/pwd", ["/usr/bin/pwd"], 0x7ffd7983a238 /* 49 vars */) = 0
brk(NULL)
&lt;&lt; snip &gt;&gt;
write(1, "/root/CAPA\n", 11/root/CAPA
)            = 11
close(1)                                = 0
close(2)                                = 0
exit_group(0)                           = ?
+++ exited with 0 +++
```
### Running Capa on different Linux utilities
Now that you know how to run Capa, I highly recommend you try it on various day-to-day Linux utilities. When choosing utilities try to be as diverse as possible. For example, select utilities that work with file systems or storage commands, such as `ls`, `mount`, `cat`, `echo`, etc. Next, move to network utilities, like `netstat`, `ss`, `telnet`, etc., where you will find the network capabilities of an executable. Extend it to more extensive programs daemons like `sshd` to see crypto-related capabilities, followed by `systemd`, `bash`, etc.
A word of caution, don't be too spooked if you see rules that match malware for these native utilities. For example, when analyzing systemd, Capa showed matches for COMMAND AND CONTROL based on the capability to receive data from a network. This capability could be used by genuine programs for legitimate cases, while malware could use it for malicious purposes.
### Running in Debug mode
If you wish to see how Capa finds all these capabilities in an executable, provide the `-d` flag, which displays additional information on the screen that might help understand its inner working. Use this data and look for clues in the source code on GitHub.
```
`$ ./capa -q /usr/sbin/sshd -d`
```
The first thing to notice is that Capa saves rules to a temp directory and reads them from there:
```
`DEBUG:capa:reading rules from directory /tmp/_MEIKUG6Oj/rules`
```
The debug output shows it loaded various rules from this directory. As an example, see how it tried to identify the hostname of a machine:
```
`DEBUG:capa:loaded rule: 'get hostname' with scope: function`
```
With this information, it's easy to look up the rule. Simply go to the `rules` directory and `grep` for the specific rule name like the example below. The rule is stated in a .yml file.
```
$ grep -irn "name: get hostname" *
rules/host-interaction/os/hostname/get-hostname.yml:3:    name: get hostname
```
Check for the `-api` sections where various APIs are listed. Capa looks for the `gethostname` API usage (on Linux), and you can see the Windows equivalent listed there, too.
```
$ cat _MEIKUG6Oj/rules/host-interaction/os/hostname/get-hostname.yml
rule:
  meta:
    name: get hostname
    namespace: host-interaction/os/hostname
&lt;&lt; snip &gt;&gt;
  features:
    - or:
      - api: kernel32.GetComputerName
      - api: kernel32.GetComputerNameEx
      - api: GetComputerObjectName
      - api: ws2_32.gethostname
      - api: gethostname
```
You can find more information about this specific system call on Linux using the man page.
```
$ man 2 gethostname
GETHOSTNAME(2)                          Linux Programmer's Manual                               GETHOSTNAME(2)
NAME
       gethostname, sethostname - get/set hostname
&lt;&lt; snip &gt;&gt;
```
### Verbose usage
Another good way to identify which API's Capa is looking for is using the verbose mode, as shown below. This simple example displays the usage of `opendir`, `readdir`, and `fwrite` APIs:
```
$ ./capa  -q /usr/bin/pwd -vv
enumerate files on Linux (2 matches)
&lt;&lt; snip &gt;&gt;
        api: opendir @ 0x20052E8
        api: readdir @ 0x2005369, 0x200548A
write file on Linux
&lt;&lt; snip &gt;&gt;
    os: linux
    or:
      api: fwrite @ 0x2002CB5
```
### Custom rules
As with other good tools, Capa allows you to extend it by adding your own rules. This hint was also given in the debug output, if you noticed.
```
`$ capa --signature ./path/to/signatures/ /path/to/executable`
```
### Specific rules only
You can also look for specific rules instead of having Capa trying to match every rule. Do this by adding the `-t` flag followed by the exact rule name:
```
`$ ./capa -t "create process on Linux" /usr/sbin/sshd -q -j`
```
Display the rule name from the .yml files within the `rules` directory. For example:
```
$ grep name rules/host-interaction/process/create/create-process-on-linux.yml
    name: create process on Linux
```
### Output format
Finally, Capa allows output in JSON format using the `-j` flag. This flag helps consume the information quickly and aid automation. This example command requires that the [jq command][10] is installed:
```
`$ ./capa -t "create process on Linux" /usr/sbin/sshd -q -j | jq .`
```
### Wrap up
Capa is a worthy addition to the much-needed tools for ELF executables. I say _much-needed_ because we regularly see cases of Linux malware now. Tools on Linux must catch up to tackle these threats. You can play around with Capa and try it on various executables, and also write your own rules and add them upstream for the benefit of the community.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/10/linux-elf-capa
作者:[Gaurav Kamathe][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/gkamathe
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/puzzle_computer_solve_fix_tool.png?itok=U0pH1uwj (Puzzle pieces coming together to form a computer screen)
[2]: https://en.wikipedia.org/wiki/Executable_and_Linkable_Format
[3]: https://opensource.com/article/19/10/gnu-binutils
[4]: https://opensource.com/article/20/4/linux-binary-analysis
[5]: https://github.com/mandiant/capa
[6]: https://www.intezer.com/
[7]: http://github.com/mandiant/capa/releases
[8]: https://attack.mitre.org/
[9]: https://opensource.com/article/19/10/strace
[10]: https://stedolan.github.io/jq/

View File

@ -0,0 +1,194 @@
[#]: subject: "7 handy tricks for using the Linux wget command"
[#]: via: "https://opensource.com/article/21/10/linux-wget-command"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lujun9972"
[#]: translator: "zengyi1001"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
7 handy tricks for using the Linux wget command
======
Download files from the internet in your Linux terminal. Get the most
out of the wget command with our new cheat sheet.
![Computer screen with files or windows open][1]
Wget is a free utility to download files from the web. It gets data from the Internet and saves it to a file or displays it in your terminal. This is literally also what web browsers do, such as Firefox or Chromium, except by default, they _render_ the information in a graphical window and usually require a user to be actively controlling them. The `wget` utility is designed to be non-interactive, meaning you can script or schedule `wget` to download files whether you're at your computer or not.
### Download a file with wget
You can download a file with `wget` by providing a link to a specific URL. If you provide a URL that defaults to `index.html`, then the index page gets downloaded. By default, the file is downloaded into a file of the same name in your current working directory.
```
$ wget <http://example.com>
\--2021-09-20 17:23:47-- <http://example.com/>
Resolving example.com... 93.184.216.34, 2606:2800:220:1:248:1893:25c8:1946
Connecting to example.com|93.184.216.34|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1256 (1.2K) [text/html]
Saving to: 'index.html'
```
You can make `wget` send the data to standard out (`stdout`) instead by using the `--output-document` with a dash `-` character:
```
$ wget <http://example.com> \--output-document - | head -n4
&lt;!doctype html&gt;
&lt;html&gt;
&lt;head&gt;
   &lt;title&gt;Example Domain&lt;/title&gt;
```
You can use the `--output-document` option (`-O` for short) to name your download whatever you want:
```
`$ wget http://example.com --output-document foo.html`
```
### Continue a partial download
If you're downloading a very large file, you might find that you have to interrupt the download. With the `--continue` (`-c` for short), `wget` can determine where the download left off and continue the file transfer. That means the next time you download a 4 GB Linux distribution ISO you don't ever have to go back to the start when something goes wrong.
```
`$ wget --continue https://example.com/linux-distro.iso`
```
### Download a sequence of files
If it's not one big file but several files that you need to download, `wget` can help you with that. Assuming you know the location and filename pattern of the files you want to download, you can use Bash syntax to specify the start and end points between a range of integers to represent a sequence of filenames:
```
`$ wget http://example.com/file_{1..4}.webp`
```
### Mirror a whole site
You can download an entire site, including its directory structure, using the `--mirror` option. This option is the same as running `--recursive --level inf --timestamping --no-remove-listing`, which means it's infinitely recursive, so you're getting everything on the domain you specify. Depending on how old the website is, that could mean you're getting a lot more content than you realize.
If you're using `wget` to archive a site, then the options `--no-cookies --page-requisites --convert-links` are also useful to ensure that every page is fresh, complete, and that the site copy is more or less self-contained.
### Modify HTML headers
Protocols used for data exchange have a lot of metadata embedded in the packets computers send to communicate. HTTP headers are components of the initial portion of data. When you browse a website, your browser sends HTTP request headers. Use the `--debug` option to see what header information `wget` sends with each request:
```
$ wget --debug example.com
\---request begin---
GET / HTTP/1.1
User-Agent: Wget/1.19.5 (linux-gnu)
Accept: */*
Accept-Encoding: identity
Host: example.com
Connection: Keep-Alive
\---request end---
```
You can modify your request header with the `--header` option. For instance, it's sometimes useful to mimic a specific browser, either for testing or to account for poorly coded sites that only work correctly for specific user agents.
To identify as Microsoft Edge running on Windows:
```
`$ wget --debug --header="User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36 Edg/91.0.864.59" http://example.com`
```
You can also masquerade as a specific mobile device:
```
$ wget --debug \
\--header="User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Mobile/15E148 Safari/604.1" \
<http://example.com>
```
### Viewing response headers
In the same way header information is sent with browser requests, header information is also included in responses. You can see response headers with the `--debug` option:
```
$ wget --debug example.com
[...]
\---response begin---
HTTP/1.1 200 OK
Accept-Ranges: bytes
Age: 188102
Cache-Control: max-age=604800
Content-Type: text/html; charset=UTF-8
Etag: "3147526947"
Server: ECS (sab/574F)
Vary: Accept-Encoding
X-Cache: HIT
Content-Length: 1256
\---response end---
200 OK
Registered socket 3 for persistent reuse.
URI content encoding = 'UTF-8'
Length: 1256 (1.2K) [text/html]
Saving to: 'index.html'
```
### Responding to a 301 response
A 200 response code means that everything has worked as expected. A 301 response, on the other hand, means that an URL has been moved permanently to a different location. It's a common way for a website admin to relocate content while leaving a "trail" so people visiting the old location can still find it. By default, `wget` follows redirects, and that's probably what you normally want it to do.
However, you can control what `wget` does when it encounters a 301 response with the `--max-redirect` option. You can set it to `0` to follow no redirects:
```
$ wget --max-redirect 0 <http://iana.org>
\--2021-09-21 11:01:35-- <http://iana.org/>
Resolving iana.org... 192.0.43.8, 2001:500:88:200::8
Connecting to iana.org|192.0.43.8|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: <https://www.iana.org/> [following]
0 redirections exceeded.
```
Alternately, you can set it to some other number to control how many redirects `wget` follows.
#### Expand a shortened URL
The `--max-redirect` option is useful for looking at shortened URLs before actually visiting them. Shortened URLs can be useful for print media, in which users can't just copy and paste a long URL, or on social networks with character limits (this isn't as much of an issue on a modern and [open source social network like Mastodon][2]). However, they can also be a little dangerous because their destination is, by nature, concealed. By combining the `--head` option to view just the HTTP headers, and the `--location` option to unravel the final destination of an URL, you can peek into a shortened URL without loading the full resource:
```
$ wget --max-redirect 0 "<https://bit.ly/2yDyS4T>"
\--2021-09-21 11:32:04-- <https://bit.ly/2yDyS4T>
Resolving bit.ly... 67.199.248.10, 67.199.248.11
Connecting to bit.ly|67.199.248.10|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: <http://example.com/> [following]
0 redirections exceeded.
```
The penultimate line of output, starting with **Location**, reveals the intended destination.
### Use wget
Once you practice thinking about the process of exploring the web as a single command, `wget` becomes a fast and efficient way to pull information you need from the Internet without bothering with a graphical interface. To help you build it into your usual workflow, we've created a cheat sheet with common `wget` uses and syntax, including an overview of using it to query an API. [**Download the Linux `wget` cheat sheet here.**][3]
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/10/linux-wget-command
作者:[Seth Kenlon][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/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_screen_windows_files.png?itok=kLTeQUbY (Computer screen with files or windows open)
[2]: https://opensource.com/article/17/4/guide-to-mastodon
[3]: https://opensource.com/downloads/linux-wget-cheat-sheet

View File

@ -0,0 +1,86 @@
[#]: subject: "What you need to know about Kubernetes NetworkPolicy"
[#]: via: "https://opensource.com/article/21/10/kubernetes-networkpolicy"
[#]: author: "Mike Calizo https://opensource.com/users/mcalizo"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
What you need to know about Kubernetes NetworkPolicy
======
Understanding Kubernetes NetworkPolicy is one of the fundamental
requirements to learn before deploying an application to Kubernetes.
![Parts, modules, containers for software][1]
With a growing number of cloud-native applications going to production through Kubernetes adoption, security is an important checkpoint that you must consider early in the process. When designing a cloud-native application, it is very important to embed a security strategy up front. Failure to do so leads to lingering security issues that can cause project delays and ultimately cost you unnecessary stress and money.
For years, people left security at the end—until their deployment was about to go into production. That practice causes delays on deliverables because each organization has security standards to adhere to, which are either bypassed or not followed with a lot of accepted risks to make the deliverables.
Understanding Kubernetes NetworkPolicy can be daunting for people just starting to learn the ins and outs of Kubernetes implementation. But this is one of the fundamental requirements that you must learn before deploying an application to your Kubernetes cluster. When learning Kubernetes and cloud-native application patterns, make your slogan "Don't leave security behind!"
## The NetworkPolicy concept
[NetworkPolicy][2] replaces firewall appliances in the data center context that you know—as pods to compute instances, network plugins to router and switches, and volumes to storage area network (SAN).
By default, the Kubernetes NetworkPolicy allows [pods][3] to receive traffic from anywhere. If you are not concerned about security for your pods, then that might be OK. But if you are running a critical workload, then you need to secure your pods. The way to control the traffic flow within the cluster (including ingress and egress traffic) is through NetworkPolicies.
To enable NetworkPolicy, you need a [network plugin][4] that supports NetworkPolicy. Otherwise, any rules you applied become useless.
There a different network plugins [listed on Kubernetes.io][4]:
* CNI plugins: adhere to the [Container Network Interface][5] (CNI) specification, designed for interoperability.
* Kubernetes follows the [v0.4.0][6] release of the CNI specification.
* Kubernetes plugin: implements basic `cbr0` using the `bridge` and `host-local` CNI plugins.
## Applying a network policy
To apply a network policy, you need a working Kubernetes cluster with a network plugin that supports NetworkPolicy.
But first, you need to understand how to use NetworkPolicy in the context of Kubernetes. The Kubernetes NetworkPolicy allows [pods][3] to receive traffic from anywhere. This is not ideal. To secure the pods, you must understand the endpoints pods can communicate within the Kubernetes construct.
1. Pod-to-pod communication using `podSelector`. [code] - namespaceSelector:
    matchLabels:
      project: myproject
```
2. Namespace-to-namespace communication and namespace-to-pod communication using `namespaceSelector` and/or a combination of `podSelector` and `namespaceSelector`. [code] - namespaceSelector:
    matchLabels:
      project: myproject
\- podSelector:
    matchLabels:
      role: frontend
```
3. IP blocks communication for pods using `ipBlock` to define which `IP CIDR` blocks dictate the source and destination. [code] - ipBlock:
        cidr: 172.17.0.0/16
        except:
        - 172.17.1.0/24
```
Note the difference between pod, namespace, and IP-based policy. For pod and namespace-based NetworkPolicy, you use `selector` to control traffic, while for IP-based NetworkPolicy, controls get defined using `IP blocks` (CIDR ranges).
Putting it together, a NetworkPolicy should look like the following:
```
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: test-network-policy
  namespace: default
spec:
  podSelector:
    matchLabels:
      app: backend
  policyTypes:
  - Ingress
  - Egress
  ingress:
  - from:
    - ipBlock:
        cidr: 172.17.0.0/16
        except:
        - 192.168.1.0/24
    - namespaceSelector:
        matchLabels:
          projec

View File

@ -0,0 +1,37 @@
[#]: subject: "3 tips for printing with Linux"
[#]: via: "https://opensource.com/article/21/10/print-linux"
[#]: author: "Lauren Pritchett https://opensource.com/users/lauren-pritchett"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
3 tips for printing with Linux
======
Learn how to set up your printer, print from anywhere, and print files
from your terminal all on Linux.
![Files in a folder][1]
I have a confession to make. This may be an unpopular opinion. I actually enjoy reading documents on a piece of paper as opposed to digitally. When I want to try a new recipe, I print it out to follow it so I don't have to continually swipe my mobile device to keep up with the steps. I store all my favorite recipes in sheet protectors in a binder. I also like to print out coloring pages or activity sheets for my kids. There are a ton of options online or we [create our own][2]!
Though I have a fond appreciation for printed documents, I have also had my fair share of printing nightmares. Paper jams, low ink, printer not found, the list of frustrating errors goes on and on.
Thankfully, it is possible to print frustration-free on Linux. Below are three tutorials you need to get started printing on Linux. The first article walks through how to connect your printer to your Linux computer. Then, learn how to print from anywhere in your house using your home network. The last article teaches you how to print from your Linux terminal so you can live out all your productivity dreams. If you are in the market for a new printer, check out this article about [choosing a printer for Linux][3].
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/10/print-linux
作者:[Lauren Pritchett][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/lauren-pritchett
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/files_documents_paper_folder.png?itok=eIJWac15 (Files in a folder)
[2]: https://opensource.com/article/20/8/edit-images-python
[3]: https://opensource.com/article/18/11/choosing-printer-linux

View File

@ -0,0 +1,142 @@
[#]: subject: "How to Install Visual Studio Code Extensions"
[#]: via: "https://itsfoss.com/install-vs-code-extensions/"
[#]: author: "Pratham Patel https://itsfoss.com/author/pratham/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Install Visual Studio Code Extensions
======
_**Brief: Learn how to search for extensions and install them in Visual Studio Code editor. Both GUI and command line methods have been discussed.**_
Microsofts [Visual Studio Code][1] is perhaps the most popular [open source code editor][2], after Vim (of course).
Visual Studio Code provides an amazing “out of the box” experience by providing almost all of the IDE like features. But there are always things you wish Visual Studio Code could do. _“The grass is always greener on the other side.”_
The [Visual Studio Code Marketplace][3] is exactly where you will find the extensions for Visual Studio Code. Extensions that are published on the Visual Studio Code Marketplace are scanned for viruses before they are published. So these extensions can be [trusted][4].
### Installing extensions in Visual Studio Code
You dont need to go to the Marketplace website for installing extensions. You can install and manage extensions right from the editor itself.
I hope you have [Visual Studio Code installed on Linux][5] or whichever operating system you are using.
Open Visual Studio Code, and to the left most side, is the Activity Bar. The last button on the Activity Bar is the Extensions button. Clicking on that will expose you to the enormous wealth of the extensions available for installation on Visual Studio Code.
![Accessing the Extensions tab in VS Code][6]
_**You can also press the Shortcut Key combination `Ctrl + Shift + X` to launch the Extensions side pane.**_
If you do not have any extensions installed, you will see a list of the most popular extensions available on the Visual Studio Code Marketplace. There are extensions you wish Visual Studio Code already had. And then, some day you will discover an extension and wonder how you lived without it!
#### Find an extension and install it from the editor (GUI method)
Now is the time to try out that `vim` thing Linux people talk about *nudge nudge* ;)
Just kidding. Let us install something more beginner friendly and something that a beginner can easily take advantage of, without much practice.
Click on **Visual Studio IntelliCode** (#1) extension from the list presented of the most popular extensions.
![How to install an extension like Visual Studio IntelliCode][7]
Simply clicking on the **Install** button (#2) will install the **Visual Studio IntelliCode** extension. This extension gives you AI-predicted suggestions while you are writing code.
Once installed, you will be able to take full advantage of this extension. Try typing a block of code in your preferred programming language and check if the suggested AI autocomplete is working out for you, and not causing any kind of slowdown in your workflow.
![Managing an installed extension in Visual Studio Code][8]
If you dislike any of the installed extension, you can simply click on the **Uninstall** button (#2) to completely remove the unwanted extension.
If you have multiple extensions installed, and if you feel like one of the installed extensions is causing you problems say like sudden crashes; You can simply disable one (or multiple) extension(s) simply by clicking on the **Disable** button (#1) and check if extension _x_ was acting up or was it extension _y_, or was it something different altogether.
Considering that extension removal and re-installation takes a long time, disabling extensions can be handy when you have multiple extensions installed.
#### Alternate method: Install extensions using the terminal
Did you know you could install a Visual Studio Code extension from the terminal itself? Well, now you do!
To install an extension from your terminal, you need to know the extension name and publisher name in the order of `publisher.extension`. For an example, if you want to install the same extension as you did before, Visual Studio IntelliCode, its publisher name and extension name is `VisualStudioExptTeam.vscodeintellicode`.
To find out this unique identifier of any extension, firstly, [visit the Visual Studio Code Marketplace][9] in your browser of choice.
![A screenshot of what Visual Studio Code Marketplace looks like][10]
Then search for any extension, for this tutorial, I will focus on installing Visual Studio IntelliCode. And then open the page of the extension that you want to install.
![Search for Visual Studio IntelliCode and open the extension webpage][11]
Once you have the web page of your extension open, you will see a code block. In the screenshot of the extension web page below is the highlighted unique identifier of the extension.
![Unique identifier of the extension Visual Studio Code][12]
Once you have the unique code of the extension you desire to install **VisualStudioExptTeam.vscodeintellicode** in this case, you can proceed by running the following command in your terminal.
```
code --install-extension VisualStudioExptTeam.vscodeintellicode
```
Like the GUI, the command line interface also allows you to install, disable, remove and manage extensions.
There is a handy flag that will give you a list of all the extensions you have installed. You can do that by running the following command:
```
code --list-extensions
```
To disable a single extension, run this command:
```
code --disable-extension <YOUR-EXTENSION-ID>
```
If you want to disable all extensions, you can run the following command:
```
code --disable-extensions
```
The above command will disable **all** installed extensions. This will help you diagnose if extensions are causing problems or is it Visual Studio Code itself.
Now, if you want to completely remove any extension, use this command:
```
code --uninstall-extension <YOUR-EXTENSION-ID>
```
### Conclusion
I find it much easier to use the editor for installing VS Code extensions. Its straight in the editor where I code after all.
Once you are comfortable tinkering with Visual Studio Code, maybe checkout this article pointing out some [useful keyboard shortcuts for Visual Studio Code][13] that might help you get even more productive!
Happy coding, fellow *nix user! :)
--------------------------------------------------------------------------------
via: https://itsfoss.com/install-vs-code-extensions/
作者:[Pratham Patel][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://itsfoss.com/author/pratham/
[b]: https://github.com/lujun9972
[1]: https://code.visualstudio.com/
[2]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/
[3]: https://marketplace.visualstudio.com/VSCode
[4]: https://code.visualstudio.com/docs/editor/extension-marketplace#_can-i-trust-extensions-from-the-marketplace
[5]: https://itsfoss.com/install-visual-studio-code-ubuntu/
[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/01-all-extensions-1.webp?resize=800%2C450&ssl=1
[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/02-select-intellicode-1.webp?resize=800%2C450&ssl=1
[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/03-intellicode-installation-done-1.webp?resize=800%2C450&ssl=1
[9]: https://marketplace.visualstudio.com/
[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/visual_studio_code_marketplace.webp?resize=800%2C450&ssl=1
[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/visual_stuido_code_ext_search.webp?resize=800%2C450&ssl=1
[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/vs_code_extension_identifier.webp?resize=800%2C450&ssl=1
[13]: https://itsfoss.com/vs-code-shortcuts/

View File

@ -0,0 +1,75 @@
[#]: subject: "Open source gets dirty with 3D printing"
[#]: via: "https://opensource.com/article/21/10/open-source-soil-science"
[#]: author: "Joshua Pearce https://opensource.com/users/jmpearce"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Open source gets dirty with 3D printing
======
3D printing and open source technology enable advanced research for soil
science.
![Green sprout grass in dirt soil][1]
Open source has touched a lot of scientific disciplines, but one area where it is missing is soil science. Until recently, you could only find it [in educational materials][2]. A team from the Université de Lorraine, INRAE in France, and Western University in Canada [bring open source to the soil science community][3].
Soil science experiments saw significant impact by the technological advances developed over the past decades. However, support for these experiments evolved very slowly, and soil science literally languished in the dirt. Researchers still take soil samples in the "traditional" way from specific fields. For this purpose, agricultural researchers determine which areas might contain the most suitable soil for an experiment in advance. This method leads to many approximations and uncontrolled parameters, which significantly complicates the analysis of the results. Thus, some studies require identical replicates. 3D printing offers an excellent opportunity to meet this need.
![Collecting soil samples][4]
Farmer-scientist field collaboration in collecting soil
and plant samples ([Flickr][5], [CC BY-NC-SA 4.0][6])
Modeling a porous structure for soil science must consider a combination of specifications (nature of the material, porosity, and location of specific substances or living organisms). In addition, using an engineering design approach improves the modeling process, and these become customizable and reproducible models—some of the bedrock properties of open source science. The model's main characteristics are identified and studied according to the complexity of the specific soil phenomena. With that modeling, you can achieve a design approach for defining a manufacturing process.
One main challenge to support this design approach is developing software that allows soil scientists to create soil models according to their needs in terms of the soil structure. This software should be dedicated to scientific research and promote data sharing and exchange across an international community.
Reproducing soil samples digitally helps academics and researchers conduct reproducible and participatory research networks that help better understand the specific soil parameters. One of the most critical challenges for soil modeling is the manufacturing of a soil structure. Until now, the most widespread method to replicate porous soil structures is using X-ray tomography to scan an actual sample. This process is expensive and time-consuming and does not readily provide an approach to customization. A new open source approach makes it possible for any soil scientist to design a porous soil structure. It is based on mathematical models rather than the dirty samples themselves—allowing researchers to design and parameterize their samples according to their desired experiments.
![Settings and model of monolith with mix of different grain sizes][7]
Settings and model of monolith with mix of different
grain sizes (Joshua Pearce, [CC BY-SA 4.0][8])
Developing an open source toolchain using a [Lua script][9], in the [IceSL][10] slicer with a GUI enables researchers to create and configure their digital soil models, called monoliths. Done without using meshing algorithms or STereoLithography (STL) files because those reduce the model's resolution. 
Monolith examples are fabricated in polylactic acid using [open source fused filament fabrication technology][11] with a layer thickness of 0.20, 0.12, and 0.08 mm. The images generated from the digital model slicing are analyzed using open source [ImageJ][12] software. ImageJ provides information about internal geometrical shape (porosity, tortuosity, grain size distribution, and hydraulic conductivities). The results show that the developed script enables designing reproducible numerical models that imitate soil structures with defined pore and grain sizes in a range between coarse sand (from 1 mm diameter) to fine gravel (up to 12 mm diameter).
![Monolith with offset root system][13]
Monolith with offset root system 
(Joshua Pearce, [CC BY-SA 4.0][8])
Samples generated using the developed script would be expected to increase reproducibility and be more accessible because of the open source and low-cost methods involved.
You can read the complete open access study here: [Open-Source Script for Design and 3D Printing of Porous Structures for Soil Science][14] by Romain Bedell, Alaa Hassan, Anne-Julie Tinet, Javier Arrieta-Escobar, Delphine Derrien, Marie-France Dignac, Vincent Boly, Stéphanie Ouvrard, and Joshua M. Pearce 2021, published in _Technologies_ 9, no. 3: 67.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/10/open-source-soil-science
作者:[Joshua Pearce][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/jmpearce
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/roman-synkevych-unsplash.jpg?itok=lIeB57IW (Green sprout grass in dirt soil)
[2]: https://doi.org/10.4195/nse2017.06.0013
[3]: https://doi.org/10.3390/technologies9030067
[4]: https://opensource.com/sites/default/files/uploads/collecting_soil_samples.jpg (Collecting soil samples)
[5]: https://www.flickr.com/photos/cgiarclimate/38600771315/in/photostream/
[6]: https://creativecommons.org/licenses/by-nc-sa/4.0/
[7]: https://opensource.com/sites/default/files/uploads/monolith-w-mix-grain-sizes.png (Settings and model of monolith with mix of different grain sizes)
[8]: https://creativecommons.org/licenses/by-sa/4.0/
[9]: https://github.com/RomainBedell/Porous_medium_generator
[10]: https://icesl.loria.fr/
[11]: https://www.reprap.org/wiki/RepRap
[12]: https://imagej.nih.gov/ij/
[13]: https://opensource.com/sites/default/files/uploads/monolith-w-offset-roots.png (Monolith with offset root system)
[14]: https://www.mdpi.com/2227-7080/9/3/67

View File

@ -0,0 +1,161 @@
[#]: subject: "Deploy Quarkus applications to Kubernetes using a Helm chart"
[#]: via: "https://opensource.com/article/21/10/quarkus-helm-chart"
[#]: author: "Daniel Oh https://opensource.com/users/daniel-oh"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Deploy Quarkus applications to Kubernetes using a Helm chart
======
A developer's guide to serverless function deployment with Quarkus Helm
chart.
![Ships at sea on the web][1]
Serverless functions are driving the fast adoption of DevOps development and deployment practices today. [Knative][2] on [Kubernetes][3] is one of the most popular serverless platforms to adopt serverless function architectures successfully. But developers must understand how serverless capabilities are specified using a combination of Kubernetes APIs, Knative resources, and function-oriented programming. DevOps teams also need to standardize runtime stacks (that is, application runtime, builder image, deployment configuration, and health check) to execute the functions on Kubernetes. What if you, a developer, could set this up with familiar technology and practice?
This article guides you on the way developers can get started with serverless function deployment with the [Quarkus][4] [Helm][5] chart on Kubernetes. Furthermore, developers can avoid the extra work of developing a function from scratch, optimizing the application, and deploying it to Kubernetes.
If you haven't experienced using Helm for cloud-native application deployments on Kubernetes, I will tell you what Helm is and what benefits you have with it. Helm is one of the most popular package managers for Kubernetes. Helm provides a chart that simplifies Kubernetes resources within a single package file for an application build and deployment. Developers can install the chart to Kubernetes using the Helm command-line interface or graphical dashboard.
### Install Quarkus Helm chart
In this article, you'll use [OpenShift Kubernetes Distribution][6] (OKD) built on Kubernetes with application lifecycle management functionality and DevOps tooling. If you haven't installed the Helm feature on your OKD cluster yet, follow the [installation document][7].
Before building a Quarkus application using a Quarkus Helm chart, you need to create pull and push secrets in your OKD cluster. You use the secrets to pull a builder image from an external container registry and then push it to the registry. 
**Note:** You can skip this step if you don't need to use an external container registry during application build or deploy the application to the OKD cluster.
Create a pull secret using the following [oc command][8]:
```
$ oc create secret docker-registry my-pull-secret \
\--docker-server=$SERVER_URL \
\--docker-username=$USERNAME \
\--docker-password=$PASSWORD \
\--docker-email=$EMAIL
```
Then, create a push secret using the following command:
```
$ oc create secret docker-registry my-push-secret \
\--docker-server=$SERVER_URL \
\--docker-username=$USERNAME \
\--docker-password=$PASSWORD \
\--docker-email=$EMAIL
```
Install the Quarkus Helm chart:
```
$ helm repo add quarkus \
<https://github.com/redhat-developer/redhat-helm-charts>
```
### Build and deploy Quarkus application using Helm chart
Go to the **Developer** console in the OKD cluster, click on Helm chart in **+Add** menu. Then type in _quarkus_ in the search box. Click on the **Quarkus v0.0.3** helm chart, as shown below.
**Note:** You'll need to create a _quarkus-helm project_ (namespace) to install a Quarkus Helm chart in your OKD cluster.
![Search Quarkus Helm chart][9]
(Daniel Oh, [CC BY-SA 4.0][10])
Click on **Install Helm Chart**, as shown below.
![Install Helm chart][11]
(Daniel Oh, [CC BY-SA 4.0][10])
Switch the editor to **YAML** view, then paste the following build and deploy configurations:
```
build:
  uri: <https://github.com/redhat-mw-demos/todo-demo-app.git>
  ref: master
  env:
    - name: S2I_SOURCE_DEPLOYMENTS_FILTER
      value: "*-runner.jar lib*"
deploy:
  readinessProbe:
    httpGet:
      path: /health/ready
      port: http
    tcpSocket: null
  livenessProbe:
    httpGet:
      path: /health/live
      port: http
    tcpSocket: null
```
Then, click on the **Install** button, as shown below.
![YAML editor][12]
(Daniel Oh, [CC BY-SA 4.0][10])
Find more values to configure the Quarkus helm chart [here][13].
Once the chart gets installed successfully, you'll see the following Quarkus pod in the Topology view, as shown below.
![Topology view][14]
(Daniel Oh, [CC BY-SA 4.0][10])
**Note:** You might see _ErrImagePull_ and _ImagePullBackOff_ in **Deployments** while the build is processing. Once the build completes, your image gets automatically rolled out.
Click on the **Open URL** icon. It brings you to the **todos** application. Let's try to add a few items for fun, as shown below.
![Todos applications][15]
(Daniel Oh, [CC BY-SA 4.0][10])
### Conclusion
You've learned the way developers can build Quarkus applications and deploy them to Kubernetes/OpenShift cluster in a few minutes using a Helm chart. The developers can manage the application runtime stack in terms of upgrade, rollback, uninstall, and add new configurations such as application health check, replication without changing the application source code or developing new Kubernetes manifestos with YAML files. This minimizes developers' burden to keep leveraging application runtimes other than implementing business logic on Kubernetes. For more information to follow on Quarkus journey here:
* [A Java developer's guide to Quarkus][16]
* [3 reasons Quarkus 2.0 improves developer productivity on Linux][17]
* [Optimize Java serverless functions in Kubernetes][18]
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/10/quarkus-helm-chart
作者:[Daniel Oh][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/daniel-oh
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/kubernetes_containers_ship_lead.png?itok=9EUnSwci (Ships at sea on the web)
[2]: https://knative.dev/docs/
[3]: https://opensource.com/article/19/6/reasons-kubernetes
[4]: https://quarkus.io/
[5]: https://helm.sh/
[6]: https://www.okd.io/
[7]: https://docs.okd.io/latest/applications/working_with_helm_charts/installing-helm.html
[8]: https://docs.okd.io/latest/cli_reference/openshift_cli/getting-started-cli.html
[9]: https://opensource.com/sites/default/files/uploads/search-quarkus-helm-chart.png (Search Quarkus Helm chart)
[10]: https://creativecommons.org/licenses/by-sa/4.0/
[11]: https://opensource.com/sites/default/files/uploads/install-hel-chart.png (Install Helm chart)
[12]: https://opensource.com/sites/default/files/uploads/yaml-editor.png (YAML editor)
[13]: https://github.com/redhat-developer/redhat-helm-charts/tree/master/alpha/quarkus-chart#values
[14]: https://opensource.com/sites/default/files/uploads/topology-view.png (Topology view)
[15]: https://opensource.com/sites/default/files/uploads/todos-applications.png (Todos applications)
[16]: https://opensource.com/article/21/8/java-quarkus-ebook
[17]: https://opensource.com/article/21/7/developer-productivity-linux
[18]: https://opensource.com/article/21/6/java-serverless-functions-kubernetes

View File

@ -0,0 +1,386 @@
[#]: subject: "How I made an automated Jack-o'-lantern with a Raspberry Pi"
[#]: via: "https://opensource.com/article/21/10/halloween-raspberry-pi"
[#]: author: "Jessica Cherry https://opensource.com/users/cherrybomb"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How I made an automated Jack-o'-lantern with a Raspberry Pi
======
Here's my recipe for the perfect pumpkin Pi.
![A vignette of green, orange, and yellow pumpkins in front of a brick wall][1]
It's almost Halloween, one of my favorite days and party times. This year, I decided to (pumpkin) spice up some of my decorations with automated motion sensing. This spooktacular article shows you how I made them, step by step, from building and wiring to coding. This is not your average weekend project—it takes a lot of supplies and building time. But it's a fun way to play around with Raspberry Pi and get in the spirit of this haunting holiday.
### What you need for this project
* One large plastic pumpkin
* One Raspberry Pi 4 (with peripherals)
* One Arduino starter kit that works with Raspberry Pi
* One hot glue gun
* Ribbon, ideally in holiday theme colors
The items you'll need in the starter kit are one infrared motion sensor, a breadboard, two small LED lights, a ribbon to connect the breadboard to the Raspberry Pi, and cabling to configure all of these pieces together. You can find each of these items online, and I suggest the starter kit for the entertaining things you can do beyond this project.
![Raspberry Pi computer board][2]
Jess Cherry CC BY-SA 4.0
![Cables and and LEDs for the project][3]
Jess Cherry CC BY-SA 4.0
![Project supplies including breadboard, cables, LEDs, and elements of the Arduino starter kit][4]
Jess Cherry CC BY-SA 4.0
### Installing the Raspberry Pi OS and preconfiguration
After receiving my Pi, including the SD card, I went online and followed the Raspberry Pi imager [instructions][5]. This allowed for quick installation of the OS onto the SD card. Note: you need the ability to put the SD card in an SD card-reader slot. I have an external attached SD card reader, but some computers have them built in. On your local computer, you also need a VNC viewer.
After installing the OS and running updates, I had some extra steps to get everything to work correctly. To do this, you'll need the following:
* Python 3
* Python3-devel
* Pip
* RPi GPIO (pip install RPi.GPIO)
* A code editor (Thonny is on the Raspberry Pi OS)
Next, set up a VNCviewer, so you can log in when you have the Pi hidden in your pumpkin.
To do this, run the below command, then follow the instructions below.
`sudo raspi-config`
When this menu pops up, choose Interface Options:
![Raspberry Pi Software Configuration Tool menu][6]
Jess Cherry CC BY-SA 4.0
Next, choose VNC and enable it on the pop-up:
![Raspberry Pi Software Configuration Tool menu of interface options][7]
Jess Cherry CC BY-SA 4.0
You can also use Secure Shell (SSH) for this, but during the troubleshooting phase, I used VNC. When logged into your Raspberry Pi, gather the IP address and use it for SSH and a VNC connection. If you've moved rooms, you can also use your router or WiFi switch to tell you the IP address of the Pi.
Now that everything is installed, you can move on to building your breadboard with lights.
### Everyone should try pumpkin bread(board)
Many people haven't seen or worked with a breadboard, so I've added pictures of my parts, starting with my base components.
![GPIO Extension Board and Ribbon Cable][8]
Jess Cherry CC BY-SA 4.0
![Breadboard][9]
Jess Cherry CC BY-SA 4.0
These two pieces are put together with the extension shield in the center, as shown.
![Breadboard with cables, pins, and ribbons, partially set up for the project][10]
Jess Cherry CC BY-SA 4.0
The ribbon connects to the pin slot in the Raspberry Pi, making the board a new extension we can code and play with. The ribbon isn't required, it's just makes working with the GPIO pins convenient. If you don't want to purchase a ribbon, you can connect female-to-male jumper cables directly from the pins on the Pi to the breadboard. Here are the components you need:
* Raspberry Pi (version 4 or 3)
* Breadboard
* GPIO expansion ribbon cable
* Jumper cables (x6 male-to-male)
* Resistor 220Ω
* HC-SR501 or any similar proximity sensor (x1)
* LED (x2)
### Putting the board together
Once you have all of the pieces, you can put everything together. First, take a look at how the pins are defined on the board. This is my personal extension board; the one you have may be different. The pin definitions matter when you get to coding, so keep very good track of your cabling. Below is the schematic of my extension.
As you can see, the schematic has both the defined BCM (Broadcom SOC Channel) GPIO numbering on the physical board and the physical numbering you use within the code to create routines and functions.
![Schematic of Raspberry Pi extension board][11]
Jess Cherry CC BY-SA 4.0
Now it's time to connect some cabling. First, start with the sensor. I was provided with cables to connect in my kit, so I'll add pictures as I go. This is the sensor with a power(+) ground(-) and sensor connection to extension board(s).
![Sensor illustration with power, ground, and sensor connection][12]
Jess Cherry CC BY-SA 4.0
For the cable colors: power is red, ground is black, and yellow carries the sensor data.
![Photo of a hand holding the sensor with black, red, and yellow cables][13]
Jess Cherry CC BY-SA 4.0
I plug in the cables with power/red to the 5V pin, ground/black to the GRN pin, and sensor/yellow to the GPIO 17 pin, later to be defined as 11 in the code.
![Breadboard with sensor cables attached][14]
Jess Cherry CC BY-SA 4.0
Next, it's time to set up the lights. Each LED light has two pins, one shorter than the other. The long side (anode) always lines up with the pin cable, and the shorter (cathode) with the ground and resistor.
![LED light with pin, cables, and resistor][15]
Jess Cherry CC BY-SA 4.0
For the first light, I use GPIO18 (pin 12) and GPIO25 for the signal. This is important because the code communicates with these pins. You can change which pin you use, but then you must change the code. Here's a diagram of the end result:
![Illustration of connections from breadboard to Raspberry Pi, sensor, and LEDs][16]
Jess Cherry CC BY-SA 4.0
Now that everything is cabled up, it's time to start working on the code.
### How to use a snake to set up a pumpkin
If you've already installed Python 3, you have everything you need to start working through this line by line. In this example, I am using Python 3 with the RPI package. Start with the imported packages, RPI and time from sleep (this helps create the flicker effect described later in the tutorial). I called my Python file senseled.py, but you can name your file whatever you want.
```
#!/usr/bin/env python3
import RPi.GPIO as GPIO
import os
from time import sleep
```
Next, define your two LED pins and sensor pin. Earlier in this post, I provided these pin numbers while wiring the card, so you can see those exact numbers below.
```
ledPin1 = 12 # define ledPins
ledPin2 = 22
sensorPin = 11 # define sensorPin
```
Since you have two lights to set up to flicker together in this example, I also created a defined array to use later:
`leds = [ledPin1, ledPin2]`
Next, define the setup of the board and pins using the RPi.GPIO package. To do this, set the mode on the board. I chose to use the physical numbering system in my setup, but you can use the BCM if you prefer. Remember that you can never use both. Here's an example of each:
```
# for GPIO numbering, choose BCM
GPIO.setmode(GPIO.BCM)
 
# or, for pin numbering, choose BOARD
GPIO.setmode(GPIO.BOARD)
```
For this example, use the pin numbering in my setup. Set the two pins to output mode, which means all commands output to the lights. Then, set the sensor to input mode so that as the sensor sees movement, it inputs the data to the board to output the lights. This is what these definitions look like:
```
def setup():
 GPIO.setmode(GPIO.BOARD) # use PHYSICAL GPIO Numbering
 GPIO.setup(ledPin1, GPIO.OUT) # set ledPin to OUTPUT mode
 GPIO.setup(ledPin2, GPIO.OUT) # set ledPin to OUTPUT mode
 GPIO.setup(sensorPin, GPIO.IN) # set sensorPin to INPUT mode
```
Now that the board and pins are defined, you can put together your main function. For this, I use the array in a `for` loop, then an if statement based on the sensor input. If you are unfamiliar with these functions, you can check out this [quick guide][17].
If the sensor receives input, the LED output is high (powered on) for .03 seconds, then low (powered off) while printing the message `led turned on.` If the sensor receives no input, the LEDs are powered down while printing the message `led turned off`.
```
def main():
 while True:
 for led in leds:
 if GPIO.input(sensorPin)==GPIO.HIGH:
 GPIO.output(led, GPIO.HIGH)
 sleep(.05)
 GPIO.output(led, GPIO.LOW)
 print ('led turned on &gt;&gt;&gt;')
 else :
 GPIO.output(led, GPIO.LOW) # turn off led
 print ('led turned off &lt;&lt;&lt;')
```
While you can mathematically choose the brightness level, I found it easier to set the sleep timer between powering on and powering off. I set this after many tests of the amount of time needed to create a flickering candle effect.
Finally, you need some clean up to release your resources when the program is ended:
```
def destroy():
 GPIO.cleanup() # Release GPIO resource
```
Now that everything has been defined to run, you can run your code. Start the program, run the setup, try your main, and if a KeyboardInterrupt is received, destroy and clean everything up.
```
if __name__ == '__main__': # Program entrance
 print ('Program is starting...')
 setup()
 try:
 main()
 except KeyboardInterrupt: # Press ctrl-c to end the program.
 destroy()
```
Now that you've created your program, the final result should look like this:
```
#!/usr/bin/env python3
import RPi.GPIO as GPIO
import os
from time import sleep
ledPin1 = 12 # define ledPins
ledPin2 = 22
sensorPin = 11 # define sensorPin
leds = [ledPin1, ledPin2]
def setup():
 GPIO.setmode(GPIO.BOARD) # use PHYSICAL GPIO Numbering
 GPIO.setup(ledPin1, GPIO.OUT) # set ledPin to OUTPUT mode
 GPIO.setup(ledPin2, GPIO.OUT) # set ledPin to OUTPUT mode
 GPIO.setup(sensorPin, GPIO.IN) # set sensorPin to INPUT mode
 
def main():
 while True:
 for led in leds:
 if GPIO.input(sensorPin)==GPIO.HIGH:
 GPIO.output(led, GPIO.HIGH)
 sleep(.05)
 GPIO.output(led, GPIO.LOW)
 print ('led turned on &gt;&gt;&gt;')
 else :
 GPIO.output(led, GPIO.LOW) # turn off led
 print ('led turned off &lt;&lt;&lt;')
 
def destroy():
 GPIO.cleanup() # Release GPIO resource
if __name__ == '__main__': # Program entrance
 print ('Program is starting...')
 setup()
 try:
 main()
 except KeyboardInterrupt: # Press ctrl-c to end the program.
 destroy()
```
When it runs, it should look similar to this. (Note: I was still testing with sleep time during this recording.)
### Time to bake that pumpkin
To start, I had a very large plastic pumpkin gifted by our family to my husband and me.
![A large, smiling orange jack o'lantern][18]
Jess Cherry CC BY-SA 4.0
Originally, it had a plug in the back with a bulb that was burnt out, which is what inspired this idea in the first place. I realized I'd have to make some modifications, starting with cutting a hole in the bottom using a drill and jab saw.
![A man drilling a hole in the bottom of a large plastic jack o'lantern][19]
Jess Cherry CC BY-SA 4.0
![A hole that takes up most of the bottom of the plastic jack o'lantern][20]
Jess Cherry CC BY-SA 4.0
Luckily, the pumpkin already had a hole in the back for the cord leading to the original light. I could stuff all the equipment inside the pumpkin, but I needed a way to hide the sensor.
First, I had to make a spot for the sensor to be wired externally to the pumpkin, so I drilled a hole by the stem:
![A small hole drilled in the brown stem of the jack o'lantern][21]
Jess Cherry CC BY-SA 4.0
Then I put all the wiring for the sensor through the hole, which ended up posing another issue: the sensor is big and weird-looking. I went looking for a decorative way to resolve this.
![The sensor hanging around the stem of the pumpkin, and a spool of ribbon][22]
Jess Cherry CC BY-SA 4.0
I did, in fact, make the scariest ribbon decoration (covered in hot glue gun mush) in all of humanity, but you won't notice the sensor.
![A large bow with orange, black, and patterned ribbon completely covers the sensor][23]
Jess Cherry CC BY-SA 4.0
Finally, I put the Pi and extension card in the pumpkin and cabeled the power through the back.
![The breadboard and cables fit inside the hole in the bottom of the jack o'lantern][24]
Jess Cherry CC BY-SA 4.0
With everything cabled, I was ready to VNC into my Pi and turn on the Python, then wait for something to move to test it out.
![VNC viewer with Python file running][25]
Jess Cherry CC BY-SA 4.0
![senseled.py running, showing led turned off switching to led turned on][26]
Jess Cherry CC BY-SA 4.0
### Post baking notes
This was a really long and very researched build. As I said in the introduction, this isn't a weekend project. I knew nothing about breadboards when I started, and it took me a while to recode and determine exactly what I wanted. There are some very granular details I did not include here. For example, the sensor has two knobs that define how far it can pick up motion and how long the sensor input needs to continue. While this was a fantastic thing to learn, I would definitely do a lot of research before pursuing this journey.
I did not get to one part of the project that I really wanted: the ability to connect to a Bluetooth device and make spooky noises. That said, playing with a Raspberry Pi is always fun to do, whether with home automation, weather tracking, or just silly decorations. I hope you enjoyed this walk-through and feel inspired to try something similar yourself.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/10/halloween-raspberry-pi
作者:[Jessica Cherry][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/cherrybomb
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/pumpkins.jpg?itok=00mvIoJf (A vignette of green, orange, and yellow pumpkins in front of a brick wall)
[2]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_1.png (Raspberry Pi computer board)
[3]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_3.png (Cables and LEDs)
[4]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_4.png (Project supplies)
[5]: https://www.raspberrypi.com/documentation/computers/getting-started.html#using-raspberry-pi-imager
[6]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_5.png (Menu)
[7]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_6.png (Menu)
[8]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_7.png (Board and cable)
[9]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_8.png (Breadboard)
[10]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_9.png (Partially set-up breadboard)
[11]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_11.png (Extension board)
[12]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_12.png (Sensor)
[13]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_13.png (Sensor with cables)
[14]: https://opensource.com/sites/default/files/uploads/pumpkin_pi15.png (Breadboard with sensor cables attached)
[15]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_16.png (Light setup)
[16]: https://opensource.com/sites/default/files/uploads/pumpkinpi_bb.jpeg (Illustration of connections)
[17]: https://opensource.com/article/18/3/loop-better-deeper-look-iteration-python
[18]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_18.png (the pumpkin)
[19]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_19.png (Drilling)
[20]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_20.png (Pumpkin hole)
[21]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_21.png (Sensor hole)
[22]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_24.png (The unhidden sensor)
[23]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_25.png (Sensor disguise ribbons)
[24]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_28.png (Enclosing the kit)
[25]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_29.png (VNC viewer)
[26]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_31.png (LED turns on)

Some files were not shown because too many files have changed in this diff Show More