mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-26 21:30:55 +08:00
commit
5858eff260
@ -1,8 +1,8 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (unigeorge)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: 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)
|
||||
@ -10,13 +10,13 @@
|
||||
如何使用 Apache 软件处理实时数据
|
||||
======
|
||||
|
||||
开源社区在处理实时事件的项目丰富度方面处于领先地位。
|
||||
> 开源以丰富的项目画布引领着处理实时事件的方向。
|
||||
|
||||
![Alarm clocks with different time][1]
|
||||
![](https://img.linux.net.cn/data/attachment/album/202110/17/105502opl53qrmj950j3mv.jpg)
|
||||
|
||||
在“永不下线”的未来,入网设备规模可能会达到数十亿。存储原始数据,日后再进行分析的方案将不再能满足需求,因为用户需要实时且准确的响应。要对故障等敏感状况进行预测,实时处理数据也必不可少——数据到达数据库后再处理肯定是来不及的。
|
||||
在“永不下线”的未来,入网设备规模可能会达到数十亿。存储原始数据,日后再进行分析的方案将不再能满足需求,因为用户需要实时且准确的响应。要对故障等对环境敏感的状况进行预测,实时处理数据也必不可少 —— 数据到达数据库后再处理肯定是来不及的。
|
||||
|
||||
有人可能会说,“云可扩展性”能够满足实时处理流数据的需求,但一些简单的例子就能表明它永远无法满足对无界数据流进行实时响应的需求。从移动设备到物联网,都需要一种新的范式来满足需求。尽管云计算依赖对大数据“先存储后分析”的方案,但也迫切需要一种能够处理持续、杂乱和海量数据流的软件框架,并在数据流到达时立即对其进行处理,以保证实时的响应、预测和对数据的洞悉。
|
||||
有人可能会说,“云可扩展性”能够满足实时处理流数据的需求,但一些简单的例子就能表明它永远无法满足对无界数据流进行实时响应的需求。从移动设备到物联网,都需要一种新的范式来满足需求。尽管云计算依赖于对大数据“先存储后分析”的方案,但也迫切需要一种能够处理持续、杂乱和海量数据流的软件框架,并在数据流到达时立即对其进行处理,以保证实时的响应、预测和对数据的洞悉。
|
||||
|
||||
例如,在加利福尼亚州的帕洛阿尔托市,每天从基础交通设施产生的流数据比 Twitter Firehose 还要多。这是很大的数据量。为 Uber、Lyft 和 FedEx 等消费者预测城市交通需要实时的分析、学习和预测。云处理不可避免地导致每个事件大约会有半秒的延迟。
|
||||
|
||||
@ -29,13 +29,13 @@
|
||||
|
||||
### 发布和订阅
|
||||
|
||||
事件驱动系统领域中有一个关键架构模式:<ruby>发布/订阅<rp>(</rp><rt>publish/subscribe</rt><rp>)</rp></ruby> 消息传递模式。这是一种异步通信方法,其中消息会从 _发布者_(数据产生方)传递到 _订阅者_(处理数据的应用程序)。发布/订阅模式可以将消息发送者与消费者分离开来。
|
||||
事件驱动系统领域中有一个关键架构模式:<ruby>发布/订阅<rt>publish/subscribe</rt></ruby> 消息传递模式。这是一种异步通信方法,其中消息会从 _发布者_(数据产生方)传递到 _订阅者_(处理数据的应用程序)。发布/订阅模式可以将消息发送者与消费者分离开来。
|
||||
|
||||
在发布/订阅模式中,消息源会 _发布_ 针对某个 _topic_(主题) 的 <ruby>事件<rp>(</rp><rt>event</rt><rp>)</rp></ruby> 至 _broker_(服务端),后者按接收顺序存储它们。应用程序可以 _订阅_ 一个或多个 _topic_,然后 _broker_ 会转发匹配的事件。 Apache Kafka 和 Pulsar 以及 CNCF NATS 是发布/订阅系统。 发布/订阅的云服务包括 Google Pub/Sub、AWS Kinesis、Azure Service Bus、Confluent Cloud 等。(LCTT译注:本段部分术语英文名称更为泛用,针对这些术语,正文采用英文,仅在括号中标注其对应中文。)
|
||||
在发布/订阅模式中,消息源会 _发布_ 针对某个 <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 译注:本段部分术语英文名称更为泛用,针对这些术语,采用了中英文标注。)
|
||||
|
||||
发布/订阅系统不会 _运行_ 订阅者应用程序,它们只是 _传递_ 数据给相应 topic 的订阅者。
|
||||
发布/订阅系统不会 _运行_ 订阅者应用程序,它们只是 _传递_ 数据给相应主题的订阅者。
|
||||
|
||||
流数据通常包含应用程序或基础架构状态更新的事件。在选择架构来处理数据时,发布/订阅框架等数据分发系统的作用是有限的。消费者应用程序的“处理方式”超出了发布/订阅系统的范围。这让开发人员的管理变得极具复杂性。所谓的流处理器是一种特殊的订阅者,可以动态分析数据并将结果返回给同一个 broker。
|
||||
流数据通常包含应用程序或基础架构状态更新的事件。在选择架构来处理数据时,发布/订阅框架等数据分发系统的作用是有限的。消费者应用程序的“处理方式”超出了发布/订阅系统的范围。这让开发人员的管理变得极具复杂性。所谓的流处理器是一种特殊的订阅者,可以动态分析数据并将结果返回给同一个服务端。
|
||||
|
||||
### Apache Spark
|
||||
|
||||
@ -65,7 +65,7 @@ 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)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -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_hour,server,聚簇列:无)
|
||||
|
||||
```
|
||||
CREATE TABLE server_logs(
|
||||
log_hour TIMESTAMP,
|
||||
log_level text,
|
||||
message text,
|
||||
server text,
|
||||
PRIMARY KEY ((log_hour, server))
|
||||
)
|
||||
```
|
||||
|
||||
在此定义中,`server` 和 `log_hour` 字段都相同的行才会进入同一个分区。
|
||||
|
||||
#### 定义方式 4(分区键:log_hour,server,聚簇列: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/
|
363
published/20201029 Managing resources with cgroups in systemd.md
Normal file
363
published/20201029 Managing resources with cgroups in systemd.md
Normal 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` 是 systemd(PID 1),`atd.service` 在下一层,是 `system.slice` 的一部分。`CGroup` 项的第二行还显示了进程 ID(PID)和启动守护进程使用的命令。
|
||||
|
||||
`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 0(root)和 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
|
@ -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
|
@ -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 account’s 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
|
@ -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/
|
@ -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? That’s 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 >/dev/null 2>&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 >/dev/null 2>&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. Here’s 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`: It’s okay if the log file is missing. Don’t Panic.
|
||||
* `notifempty`: Don’t 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 yesterday’s 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
|
||||
|
||||
I’m 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 @@ I’m 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/) 荣誉推出
|
||||
|
@ -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/) 荣誉推出
|
||||
|
@ -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 网页浏览器,同时本教程也将介绍如何更新和卸载该软件。
|
||||
|
||||
它内置了标签组、广告拦截、鼠标手势、笔记管理,甚至还有命令连锁。你甚至可以借助页面平铺来一次性浏览多个页面。当然,相比于 Chrome,Vivaldi 更加尊重你的隐私。
|
||||
[Vivaldi][1] 是一款日益流行的网页浏览器。它基于 Chromium 内核,因此它拥有和 Chrome 类似的功能,但它也新增了一些其他特色功能,让这款浏览器与众不同、更为直观。
|
||||
|
||||
![页面平铺,一次性浏览多个页面][2]
|
||||
它内置了标签组、广告拦截、鼠标手势、笔记管理,甚至还有命令连锁。你甚至可以借助切分视图来一次性浏览多个页面。当然,相比于 Chrome,Vivaldi 更加尊重你的隐私。
|
||||
|
||||
你可以从 [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
|
||||
|
||||
按下 Super(Windows)键打开系统菜单,搜索 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/) 荣誉推出
|
||||
|
113
published/20211011 What is a hostname.md
Normal file
113
published/20211011 What is a hostname.md
Normal 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)系统,我就会在命名规则中加入他们的缩写词。
|
||||
|
||||
此外,就像许多大型企业、金融机构和政府一样,他们可能有不同的数据中心,位于不同的地理位置,以达到性能或灾难恢复的目的。因此,比如说,位于北美大陆东海岸的数据中心被称为 ED(East Data center),而位于西海岸的数据中心则是 WD(West 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
|
@ -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**。
|
||||
|
||||
### Seahorse:GNOME 的密码及加密密钥管理器
|
||||
|
||||
![][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/
|
83
published/20211013 5 markdown editors I recommend trying.md
Normal file
83
published/20211013 5 markdown editors I recommend trying.md
Normal 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)
|
@ -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
|
@ -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/
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
116
published/20211018 4 Linux tools to erase your data.md
Normal file
116
published/20211018 4 Linux tools to erase your data.md
Normal 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
|
@ -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/
|
@ -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/
|
@ -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?
|
@ -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/
|
@ -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 what’s 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&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
|
@ -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 he’d 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 would’ve 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 it’s 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 doesn’t see himself doing kernel programming at the age of 70. Then he also chipped in that he didn’t imagine himself doing kernel programming at the age of 50 as well and yet he is doing that at present.
|
||||
|
||||
> “Somehow I don’t see myself doing kernel programming when I’m 70. But on the other hand, I didn’t see myself doing kernel programming when I was 50 either, a few years back. So… we’ll 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/
|
@ -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!
|
||||
|
||||
System76’s 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. Here’s 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/
|
@ -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
|
||||
======
|
||||
|
||||
There’s 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 there’s 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 OS’s 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 GNOME’s 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 that’s 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
|
@ -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. Let’s take a look at them.
|
||||
|
||||
### Feren OS 2021.10: What’s 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 Pocket’s 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 screen’s design style and KDE plasma’s 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 & 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
|
@ -1,85 +0,0 @@
|
||||
[#]: subject: "TUXEDO’s 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: " "
|
||||
|
||||
TUXEDO’s 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. Let’s 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 didn’t 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, you’ll find NVIDIA’s 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 NVIDIA’s DLSS, like all RTX GPUs, for a stepped-up gaming experience.
|
||||
|
||||
Also, it’s 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 you’re 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 don’t 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 laptop’s 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/
|
@ -1,151 +0,0 @@
|
||||
[#]: subject: "Here’s 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: " "
|
||||
|
||||
Here’s 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 isn’t user-friendly, and it’s 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, that’s about to change with the [support for BattleEye, and Easy-Anti Cheat added to Linux][2].
|
||||
|
||||
Fret not; I’m 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]
|
||||
|
||||
I’m 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 isn’t 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]
|
||||
|
||||
Let’s 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 that’s the case, do you think there’s any reason to consider Windows? I’ll 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.
|
||||
|
||||
I’m sure you know how Microsoft’s 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 aren’t 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 isn’t 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/
|
@ -0,0 +1,84 @@
|
||||
[#]: subject: "Systemd-free Linux Distro Devuan Releases Version 4.0 Based on Debian 11"
|
||||
[#]: via: "https://news.itsfoss.com/devuan-4-release/"
|
||||
[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Systemd-free Linux Distro Devuan Releases Version 4.0 Based on Debian 11
|
||||
======
|
||||
|
||||
The developers of Devuan GNU+Linux have recently released the latest stable version – Devuan “Chimaera” 4.0. For those who aren’t aware, Devuan is a fork of Debian that doesn’t use systemd but init as its software suite.
|
||||
|
||||
Let’s take a look at what this new release has to offer.
|
||||
|
||||
### Key Highlights
|
||||
|
||||
The latest release is now based on [Debian 11 “Bullseye”][1] and uses the Linux Kernel 5.10. As mentioned before, you have to choose between init systems – OpenRC, sysvinit, and runit.
|
||||
|
||||
![Source: devuan.org][2]
|
||||
|
||||
#### Refreshed UI
|
||||
|
||||
A new bootloader screen and desktop theming have been introduced.
|
||||
|
||||
The release note states –
|
||||
|
||||
> Improved desktop support – virtually all desktop environments available in Debian are now part of Devuan, systemd-free
|
||||
|
||||
This means you don’t necessarily have to use the default XFCE as the desktop environment. As for desktop managers, gdm3 and ssdm have now been included.
|
||||
|
||||
#### Improved Accessibility
|
||||
|
||||
The installer is completely based on Debian 11’s installer. Thus, all procedures described in Debian’s wiki will apply here too.
|
||||
|
||||
You can now disable task-speech accessibility if you intend to install a console-only system and avoid unnecessary dependencies.
|
||||
|
||||
Lastly, you can successfully install a desktop environment without installing PulseAudio. The GUI or console installation sessions will use hardware or software speech synthesis instead. This also includes using a refreshable braille display.
|
||||
|
||||
#### Fixes and Updates to Certain Packages
|
||||
|
||||
Do note that wicd, the network manager, will no longer be available due to its dependence on the obsolete python2. Instead, you can use other alternatives such as network-manager and connman.
|
||||
|
||||
It had been noticed that newer AMD CPUs caused the system to boot to a black screen. To solve this issue, the release notes clearly mention the user to install the firmware-amd-graphics package from the non-free repository. The non-free repositories will be available during the install time.
|
||||
|
||||
If you’re upgrading from the previous release, Devuan 3 Beowolf, you may notice missing XFCE app icons. This can easily be solved by running a simple command mentioned in the release notes.
|
||||
|
||||
For more details, you can refer to their [official release notes.][3]
|
||||
|
||||
### Summing Up
|
||||
|
||||
Devuan 4.0 looks like an interesting release, especially for those who want a Debian-like experience but without systemd.
|
||||
|
||||
Users running the older versions of Devuan and those looking to migrate from Debian can head over to the [official website’s guide][4]. New users willing to give Devuan 4.0 a try can use the link below.
|
||||
|
||||
[Get Devuan Chimaera 4.0][5]
|
||||
|
||||
_How do you find Devuan when compared to Debian? Would you like to try it out?_
|
||||
|
||||
#### 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/devuan-4-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]: https://news.itsfoss.com/debian-11-feature/
|
||||
[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4MCIgd2lkdGg9IjY0MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[3]: https://files.devuan.org/devuan_chimaera/Release_notes.txt
|
||||
[4]: https://www.devuan.org/os/install
|
||||
[5]: https://www.devuan.org/get-devuan
|
@ -0,0 +1,86 @@
|
||||
[#]: subject: "Valve is Reviewing Games Compatible with SteamOS"
|
||||
[#]: via: "https://news.itsfoss.com/steamdeck-verified/"
|
||||
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Valve is Reviewing Games Compatible with SteamOS
|
||||
======
|
||||
|
||||
With the introduction of Steam Deck, the future of gaming in Linux is more promising than ever.
|
||||
|
||||
The presence of Steam Deck has already made it possible to [bring in anti-cheat engine support to Linux][1]. If you did not know, Steam Deck is powered by the upcoming new [SteamOS][2] (based on Arch Linux).
|
||||
|
||||
And, now, to make things better, Valve has announced to introduce new compatibility badges to showcase games on Steam that should work with Steam Deck powered by SteamOS.
|
||||
|
||||
### Steam Deck Verified: What Does it Mean?
|
||||
|
||||
![][3]
|
||||
|
||||
Like what we mentioned about referring ProtonDB to check compatibility in our [Linux gaming guide][4], Valve aims to verify every game that works with Steam Deck.
|
||||
|
||||
As shown in the image above, it will display four categories of compatibility badges. Accordingly, you can decide if you want to try the game on the Steam Deck console or not.
|
||||
|
||||
Valve plans to thoroughly review the games for Steam Deck compatibility and update the status with every new update made to the game.
|
||||
|
||||
Overall, the games will be tested to fulfill the following criteria:
|
||||
|
||||
* Full controller support.
|
||||
* Should support the default 1280 x 800 (or 1280 x 720) resolution of Steam Deck.
|
||||
* Without any warnings displayed as a seamless experience.
|
||||
* If running through Proton, the game needs to support it.
|
||||
|
||||
|
||||
|
||||
![][5]
|
||||
|
||||
The compatibility badge will also display detailed insights on what you can expect as per the status.
|
||||
|
||||
And, if you are a developer, you can go through the [official details of the review process][6] to make your game compatible.
|
||||
|
||||
### Does This Mean You Won’t Need ProtonDB for Linux Desktop Gaming?
|
||||
|
||||
![][7]
|
||||
|
||||
While I cannot confirm that, but it raises the potential for it.
|
||||
|
||||
As of now, Linux gamers utilize the community portal [ProtonDB][8] to check if a Windows-only game works with Linux.
|
||||
|
||||
With Steam Deck verified, if the compatibility badges are shown cross-platform, it could be useful for Linux desktops. Technically, Steam Deck is still Linux, but your PC’s hardware configuration is not the same.
|
||||
|
||||
But, it would be useful to rely on Valve’s official review process to launch a game on Steam without worrying about its compatibility on your Linux desktop.
|
||||
|
||||
We can only hope for better when it comes to gaming on Linux.
|
||||
|
||||
_What do you think about Valve’s new compatibility checking initiative for Steam Deck? Feel free to let me know your thoughts._
|
||||
|
||||
#### 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/steamdeck-verified/
|
||||
|
||||
作者:[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/easy-anti-cheat-linux/
|
||||
[2]: https://itsfoss.com/steamos/
|
||||
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM4MCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[4]: https://itsfoss.com/linux-gaming-guide/
|
||||
[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[6]: https://partner.steamgames.com/doc/steamdeck/compat
|
||||
[7]: https://i1.wp.com/i.ytimg.com/vi/_OAqvtlgfGA/hqdefault.jpg?w=780&ssl=1
|
||||
[8]: http://protondb.com/
|
@ -0,0 +1,84 @@
|
||||
[#]: subject: "FreeOffice 2021 is Here for Linux With Enhanced Compatibility and New Features to Rival Microsoft Office"
|
||||
[#]: via: "https://news.itsfoss.com/freeoffice-2021-release/"
|
||||
[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
FreeOffice 2021 is Here for Linux With Enhanced Compatibility and New Features to Rival Microsoft Office
|
||||
======
|
||||
|
||||
The German-based software developer has just announced the latest upgrade to its popular FreeOffice series. FreeOffice 21, as a free alternative to Microsoft Office.
|
||||
|
||||
It is a complete software suite aimed at productivity. It contains three apps – TextMaker 21, PlanMaker 21, and Presentations 21 – that serve as alternatives to Word, Excel, and PowerPoint. The UI is very similar to MS Office’s ribbon layout, although you can choose the classic layout instead.
|
||||
|
||||
FreeOffice 21 is based on the commercial suite SoftMaker Office 21, which is also available for Linux. Even though it lacks certain features compared to SoftMaker Office, FreeOffice is reasonably sufficient for home or office use.
|
||||
|
||||
This makes it one of the best office suites and [other open-source Microsoft Office alternatives][1] on Linux.
|
||||
|
||||
Let’s get to know what the latest release has in store for us.
|
||||
|
||||
**Note:** We have covered products that are not open-source from SoftMaker because they are also available for Linux. And, the same goes for FreeOffice 2021.
|
||||
|
||||
### Major Highlights
|
||||
|
||||
The eye-catching feature of the release is the flawless compatibility with MS Office formats. It supports the modern file formats DOCX, XLSX, and PPTX. This means you can easily open, edit and save your friend’s MS Office files. Thus, there’s no hassle of exporting and converting file formats anymore.
|
||||
|
||||
Another important highlight is using a single license for Linux, macOS, and Windows concurrently. This is helpful if you want to use FreeOffice on more than one PC, like your workstation or your sibling’s laptop.
|
||||
|
||||
Other newly added features include initial support for SVG graphic format and improved import-export functions.
|
||||
|
||||
#### TextMaker 2021 Improvements
|
||||
|
||||
![Source: Presskit][2]
|
||||
|
||||
You can now simultaneously use footnotes and endnotes in the same document.
|
||||
|
||||
Moreover, TextMaker can even open the older Microsoft DOC format and ODT format utilized by OpenOffice and LibreOffice.
|
||||
|
||||
#### PlanMaker 2021 Improvements
|
||||
|
||||
![Source: Presskit][2]
|
||||
|
||||
Power users will find it comforting to know that functions, like conditional formatting and extended pivot tables using PlanMaker, will be compatible with Excel 2021, 2019, and 365.
|
||||
|
||||
#### Presentations 2021 Improvements
|
||||
|
||||
![Source: Presskit][2]
|
||||
|
||||
Users who like to focus on the visual aspects of the slides can find more animations, slide transitions, and effects. These are now based on OpenGL for smoother performance.
|
||||
|
||||
### Wrapping Up
|
||||
|
||||
FreeOffice 21 seems to be a good update, especially if you were looking for a free office suite with better compatibility with Microsoft Office.
|
||||
|
||||
FreeOffice is available for Linux along with macOS and Windows, entirely **free of cost**. You can find DEB, RPM packages, along with a tar package for other Linux distributions.
|
||||
|
||||
[Download FreeOffice 21][3]
|
||||
|
||||
_Do you use SoftMaker FreeOffice as your daily driver? If not, do you plan to check it out?_
|
||||
|
||||
#### 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/freeoffice-2021-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]: https://itsfoss.com/best-free-open-source-alternatives-microsoft-office/
|
||||
[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[3]: https://www.freeoffice.com/en/download
|
@ -0,0 +1,82 @@
|
||||
[#]: subject: "Here’s Why Raspberry Pi is Increasing its Price"
|
||||
[#]: via: "https://news.itsfoss.com/raspberry-pi-price-hike/"
|
||||
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Here’s Why Raspberry Pi is Increasing its Price
|
||||
======
|
||||
|
||||
It may not be a good time for best pricing when it comes to motherboards, CPUs, and GPUs. However, Raspberry Pi boards continued to sail through most of 2020-2021 without an increase in its price.
|
||||
|
||||
But, recently, Raspberry Pi announced its first-ever price hike ever, so why is that happening?
|
||||
|
||||
### Supply Chain Issues: What is it Exactly?
|
||||
|
||||
The entire semiconductor industry is suffering from an incredibly high demand and short supply situation.
|
||||
|
||||
Amidst the COVID-19 pandemic, the requirements for electronic components, gadgets, and computers have shot up.
|
||||
|
||||
Of course, the GPU (graphics card) shortage is the worst of them. But, overall, if a product uses a chip, it is tough to readily manufacture as of now.
|
||||
|
||||
Every major company has been investing to ramp up the work in a foundry to get more chips out. However, considering an unprecedented demand globally, it will take at least a few years to fulfill the current orders and move on.
|
||||
|
||||
Raspberry Pi managed to survive 2020 and most of 2021 without significant issues in manufacturing boards as per the demands.
|
||||
|
||||
While Raspberry Pi 4 launch price and its availability were not initially affected by a large margin, it could not escape the supply chain issues forever.
|
||||
|
||||
Hence, Raspberry Pi predicts that they cannot meet the rise in demands as they would expect compared to their capacity of manufacturing. And, this is why they are increasing the pricing for some of their products.
|
||||
|
||||
### Raspberry Pi Price Hike: What Changes?
|
||||
|
||||
The affected products include the Raspberry Pi Zero and the 2 GB variant of the Raspberry Pi 4.
|
||||
|
||||
While they intended to manufacture more this year, they will make about seven million units in 2021 due to supply chain issues.
|
||||
|
||||
The Raspberry Pi 4 2GB variant was priced at $35 replacing the 1 GB option. However, it is now priced back at **$45**, temporarily.
|
||||
|
||||
And, the 1 GB Raspberry Pi 4 option is making a comeback at **$35**. This way, you get more options, but the one with more memory gets expensive.
|
||||
|
||||
For now, they will focus on Compute Module 3, Compute Module 3+, and Raspberry Pi 3B.
|
||||
|
||||
So, it is worth noting that if you are looking for a Raspberry Pi 3B+, you might want to consider Raspberry Pi 4. In other words, the older Raspberry Pi models like 3B+ and Zero may not have a good availability throughout this year (and the next).
|
||||
|
||||
### Is It a Permanent Price Change?
|
||||
|
||||
Considering Raspberry Pi managed to maintain the pricing even with the global chip shortage, we can be confident that they can bring the old price back soon.
|
||||
|
||||
Here’s what they mention in their [official announcement][1]:
|
||||
|
||||
> These changes in pricing are not here to stay. As global supply chain issues moderate, we’ll keep revisiting this issue, and we want to get pricing back to where it was as fast as we can.
|
||||
|
||||
In addition to the unfortunate price hike, they also say that they currently predict a sound capacity of supply to be able to support existing Raspberry Pi 4 customers along with users migrating from Raspberry Pi 3B+ as well:
|
||||
|
||||
> The good news is that we’ve been able to hold the line on pricing for all but one of our products; that we expect to have enough 28nm silicon over the next twelve months to support both our existing Raspberry Pi 4 and Compute Module 4 customers, and customers migrating from Raspberry Pi 3B+; and that we see early signs that the supply chain situation is starting to ease.
|
||||
|
||||
Given that they are essentially going back to their old pricing, I think that the business users and tinkerers do not have a lot to worry about.
|
||||
|
||||
_What do you think about its price hike? Feel free to enter the comments section below to share your thoughts._
|
||||
|
||||
#### 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/raspberry-pi-price-hike/
|
||||
|
||||
作者:[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://www.raspberrypi.com/news/supply-chain-shortages-and-our-first-ever-price-increase/
|
@ -0,0 +1,71 @@
|
||||
[#]: subject: "Brave Browser Kicks Out Google as the Default Search Engine in Favor of its Own"
|
||||
[#]: via: "https://news.itsfoss.com/brave-replaces-google/"
|
||||
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Brave Browser Kicks Out Google as the Default Search Engine in Favor of its Own
|
||||
======
|
||||
|
||||
Brave is one of the [best web browsers available for Linux][1]. The browser uses Google as the default search engine for most of the regions.
|
||||
|
||||
However, that is about to change with the recent announcement of Brave abandoning Google to favor its privacy-respecting search engine [Brave Search][2].
|
||||
|
||||
### Brave Search In, Google Out
|
||||
|
||||
Google pays a lot of good money when it comes to keeping its search engine as the default in many web browsers.
|
||||
|
||||
But, it seems that Brave plans to take on Google’s search engine by utilizing its offering ([Brave Search][3]) to replace it as the default search engine.
|
||||
|
||||
Considering Brave Search is still in the beta phase, it is a bold move.
|
||||
|
||||
The change is only for new users and is limited to a few countries (United States, Canada, and the United Kingdom).
|
||||
|
||||
Brave Search also replaces Qwant and DuckDuckGo in France and Germany, respectively.
|
||||
|
||||
Shortly, this change will be happening for more regions as well.
|
||||
|
||||
If you already use Brave, your default search engine will not be changed automatically. Also, if you do not belong to one of the regions mentioned above, you need to change the default search engine to Brave Search, if you prefer it over Google.
|
||||
|
||||
### Improving Brave Search in the Process
|
||||
|
||||
With the new default selection, Brave Search should have the potential to receive more feedback on its search result index and quality.
|
||||
|
||||
Hence, Brave has also launched the [Web Discovery Project][4] along with this change to let users opt-in to contribute anonymous data to help improve the search results.
|
||||
|
||||
As of now, Brave Search does not include any advertisements. But, it will be adding advertisements soon and introducing a premium option to opt for an ad-free experience.
|
||||
|
||||
### Closing Thoughts
|
||||
|
||||
Brave Search is a promising alternative to Google’s search engine. Of course, it is not easy to offer a good search experience as good as Google, but it is refreshing to see shifting focus to other search engines.
|
||||
|
||||
The brave web browser has a significant userbase among the chromium-based solutions. So, this change should let new users experience a different search engine promoting more healthy competition.
|
||||
|
||||
What do you think about this? Let me know your thoughts.
|
||||
|
||||
#### 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/brave-replaces-google/
|
||||
|
||||
作者:[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/best-browsers-ubuntu-linux/
|
||||
[2]: https://itsfoss.com/brave-search-features/
|
||||
[3]: https://search.brave.com/
|
||||
[4]: https://brave.com/privacy/browser/#web-discovery-project
|
@ -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 that’s 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. Don’t forget to update your police your messaging, blogs, and blog calendar for selling too. Consider segmenting your blog’s OSS content in it’s own category if you haven’t 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/
|
@ -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/) 荣誉推出
|
||||
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (zpl1025)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -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/
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (MjSeven)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -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
|
@ -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/) 荣誉推出
|
||||
|
@ -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 &
|
||||
```
|
||||
|
||||
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/
|
@ -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: "geekpi"
|
||||
[#]: 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 won’t 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, I’ll show you two methods of installing Chrome on Debian:
|
||||
|
||||
* GUI method
|
||||
* Command line method
|
||||
|
||||
|
||||
|
||||
Let’s 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 Chrome’s website.
|
||||
|
||||
[Get Google Chrome][1]
|
||||
|
||||
You’ll 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]
|
||||
|
||||
You’ll be asked to enter your account’s password. This is the same password you use to log into your system.
|
||||
|
||||
![Enter your account’s 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 Google’s 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, you’ll have to use the terminal to remove it.
|
||||
|
||||
Don’t worry. It’s 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. That’s okay. Type it and press enter and confirm the deletion.
|
||||
|
||||
![][14]
|
||||
|
||||
Well, that’s 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
|
@ -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
|
@ -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, let’s 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 **GNOME’s Seahorse**.
|
||||
|
||||
### Seahorse: GNOME’s Password & 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 it’s 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 doesn’t 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/
|
112
sources/tech/20211014 9 ways to use open source every day.md
Normal file
112
sources/tech/20211014 9 ways to use open source every day.md
Normal 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
|
@ -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&D, Swords & 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&D 5th Edition, you can't just list the attributes:
|
||||
|
||||
|
||||
```
|
||||
[Save]
|
||||
DEX
|
||||
INT
|
||||
```
|
||||
|
||||
Instead, you must force them to be a pair.
|
||||
|
||||
In D&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&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&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:
|
||||
|
||||
|
||||
```
|
||||
<char>
|
||||
<name>Robin Hood</name>
|
||||
<health>20</health>
|
||||
<acrobat>5</acrobat>
|
||||
<archery>8</archery>
|
||||
<disguise>3</disguise>
|
||||
</char>
|
||||
```
|
||||
|
||||
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
|
||||
<name>Robin Hood</name>
|
||||
$ ./v char.archery
|
||||
<archery>7</archery>
|
||||
```
|
||||
|
||||
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
|
@ -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 & 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 & 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&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
|
111
sources/tech/20211017 How I use open source to play RPGs.md
Normal file
111
sources/tech/20211017 How I use open source to play RPGs.md
Normal 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
|
@ -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.
|
||||
|
||||
Microsoft’s [Visual Studio Code][2] and GitHub’s [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 Atom’s 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 Code’s 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 (GitHub’s Atom).
|
||||
* More out-of-the-box functionality like Microsoft’s 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 editor’s 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]
|
||||
|
||||
[GitHub’s 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.
|
||||
|
||||
Atom’s 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 Atom’s hackable nature.
|
||||
* In-built Git and complete GitHub integration; not surprising considering it is developed by GitHub
|
||||
* [Atom’s 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 editor’s functionality and end up creating almost a new editor; It truly is “hackable”.
|
||||
* Atom’s binary releases and its source code are fully open source (unlike Visual Studio Code’s 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/
|
@ -0,0 +1,95 @@
|
||||
[#]: subject: "Annotator: Open-Source App for Linux to Easily Add Essential Annotations to Your Images"
|
||||
[#]: via: "https://itsfoss.com/annotator/"
|
||||
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Annotator: Open-Source App for Linux to Easily Add Essential Annotations to Your Images
|
||||
======
|
||||
|
||||
_**Brief:**_ _An exciting and useful annotation tool with additional features for Linux systems._
|
||||
|
||||
When it comes to image manipulation and editing, there are many tools available. However, options like GIMP are not necessarily the solution to everything.
|
||||
|
||||
Yes, GIMP offers plenty of features for beginners and advanced users, but it could be time-consuming to learn something and apply visual enhancements to any image you want.
|
||||
|
||||
Annotator is an impressive open-source tool that lets you do a lot of things in a couple of clicks.
|
||||
|
||||
### Annotator: Open-Source Image Annotation Tool
|
||||
|
||||
![][1]
|
||||
|
||||
Annotator lets you quickly add shapes, texts, and other visual elements. This is useful for a variety of use-cases.
|
||||
|
||||
The tool is easy to use and offers a simple user interface. And, you also get a variety of features to enhance the images you want.
|
||||
|
||||
### Features of Annotator
|
||||
|
||||
![Adding icons to images][2]
|
||||
|
||||
Not just limited to adding enhancements to an image, but you also get some other functionalities with Annotator. Some of the key features are:
|
||||
|
||||
* Ability to add a text
|
||||
* Customize the text color, adjust the size, tweak the highlight color, and more
|
||||
* Use magnifying tool to focus on a particular point in image
|
||||
* Tweak the magnifier to change the angle, and size
|
||||
* Add visual icons to express something
|
||||
* Use pencil to write, useful for trackpad users
|
||||
* Blur tool to obfuscate important or unnecessary details
|
||||
* Counter icons to highlight important any sort of order in an image
|
||||
* Supports multiple fonts
|
||||
* Adjust the border width and lines for shapes and texts
|
||||
* Various shapes like arrow, circle, and star available
|
||||
* Ability to resize and crop images
|
||||
|
||||
|
||||
|
||||
![][3]
|
||||
|
||||
### Installing Annotator in Linux
|
||||
|
||||
Primarily, Annotator is available on AppCenter for elementaryOS. But, fortunately, it is a Flatpak package, so that you can install it on any Linux distribution.
|
||||
|
||||
All you need to do is head to the AppCenter store’s link and then download/open the **Flatpak ref** file using the software installer. We have more information on this in our [Flatpak guide][4], if you need help.
|
||||
|
||||
[Annotator][5]
|
||||
|
||||
To build from the source or explore more about it, you can check out its [GitHub page][6].
|
||||
|
||||
### Thoughts on Using Annotator
|
||||
|
||||
I find it useful for my work, considering we need to deal with various screenshots every day. And, the more descriptive, the better the images for our readers to understand.
|
||||
|
||||
Usually, I use Flameshot as my screenshot tool and add annotations available through it. There are other [screenshot tools available for Linux][7], but I prefer Flameshot for its quick annotation features.
|
||||
|
||||
However, you cannot use Flameshot or any other screenshot tool to add annotations to existing images.
|
||||
|
||||
Hence, Annotator came in handy to edit existing screenshots or any other images needed.
|
||||
|
||||
All of its features worked well in my brief usage, but I’d want to edit and re-size the text to be more intuitive. Other than that, I have no complaints.
|
||||
|
||||
I’d recommend you give this a try if you need to add highlights/annotations to the images on your system. Let me know your thoughts in the comments down below.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/annotator/
|
||||
|
||||
作者:[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://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/annotator.png?resize=800%2C573&ssl=1
|
||||
[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/annotator-screenshot.png?resize=800%2C410&ssl=1
|
||||
[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/annotator-resize.png?resize=800%2C490&ssl=1
|
||||
[4]: https://itsfoss.com/flatpak-guide/
|
||||
[5]: https://appcenter.elementary.io/com.github.phase1geo.annotator/
|
||||
[6]: https://github.com/phase1geo/Annotator
|
||||
[7]: https://itsfoss.com/take-screenshot-linux/
|
136
sources/tech/20211019 Linux Tablets- What are Your Options.md
Normal file
136
sources/tech/20211019 Linux Tablets- What are Your Options.md
Normal file
@ -0,0 +1,136 @@
|
||||
[#]: subject: "Linux Tablets: What are Your Options?"
|
||||
[#]: via: "https://itsfoss.com/linux-tablets/"
|
||||
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Linux Tablets: What are Your Options?
|
||||
======
|
||||
|
||||
There are plenty of [Linux-based laptops available][1]. There are also [mini-PCs preloaded with Linux][2].
|
||||
|
||||
A few [Linux-based smartphones][3] are also present in the market.
|
||||
|
||||
How about tablets? Are there some good Linux-based tablets? The answer is not straightforward.
|
||||
|
||||
Many Linux-only system manufacturers focus on creating desktop computers. This is primarily due to the fact that the Linux experience on touch devices is no where close to what Android and iOS provide.
|
||||
|
||||
Does this mean you cannot use Linux on a tablet? Not really. There are a few options available for the early adapters and DIY tinkerers. Let’s see what options do you have in the name of Linux tablets.
|
||||
|
||||
### Ubuntu Touch
|
||||
|
||||
![Ubuntu Touch OS on BQ tablets][4]
|
||||
|
||||
Alright! This is not a gadget but an operating system. But this does give you option to install a touch-friendly version of Ubuntu on some old Android tablet.
|
||||
|
||||
Mind the word ‘some’. Officially, Ubuntu Touch [supports][5] on Nexus 7, Lenovo M10, Xperia Z4 and BQ Aquaris tablets. You may even try to install Ubuntu Touch on some other tablet of yours. It may not work 100% but could still be pretty much useable.
|
||||
|
||||
Ubuntu Touch was a project by Ubuntu team but they [discontinued it in 2017][6]. [UBports][7] has taken the responsibility of continuing this project and they are doing a good job at it with their limited resources.
|
||||
|
||||
All in all, if you have an experimental temperament and want to give another life to your old Android tablet, Ubuntu Touch could be your weekend project.
|
||||
|
||||
[Ubuntu Touch][8]
|
||||
|
||||
### Pine Tab
|
||||
|
||||
![PineTab][9]
|
||||
|
||||
Pine64 started with its single board computer Pine A64 as a [Raspberry Pi alternative][10]. It launched several Pine-branded products over the time. This list includes low cast [PineTime smartwatch][11], Pinebook laptop, PinePhone smartphone and PineTab tablet.
|
||||
|
||||
These Pine devices are often inexpensive and allow the user full control on the gadget. This tinkering attitude has helped it gathered a huge fan following of open source DIY enthusiasts.
|
||||
|
||||
The PineTab basically uses the same component as the Pine64 single board computers with touchscreen and keyboard. It’s not the prettiest looking gadget out there but then, it does not intend to be one.
|
||||
|
||||
The specifications are basic with an HD IPS capacitive touchscreen, Allwinner A64 chipset, Quad-core CPU and 2 GB RAM.
|
||||
|
||||
It’s not something that can compete with an iPad or Galaxy Tab but it allows you to install a distribution of your choice and configure it as you want.
|
||||
|
||||
Please keep in mind that Pine has limited stock, so consider yourself lucky if you can see this device available for purchase.
|
||||
|
||||
[PineTab][12]
|
||||
|
||||
### PineNote
|
||||
|
||||
![PineNote][13]
|
||||
|
||||
Another Pine device that is slightly different from the PineTab you saw in the previous section.
|
||||
|
||||
The PineTab is a Linux tablet for browsing internet, using applications and playing games. The PineNote is for taking notes and reading books and documents.
|
||||
|
||||
It has a Eink display that you may have seen on e-book readers like Kindle. Apart from letting you experience an e-book reader, PineNote also allows you to take note with a Wacom Pen.
|
||||
|
||||
PineNote has Quad-core Rockchip, multi-touch Eink panel, 4 GB RAm and 128 GB eMMC storage. It is also one of the rare few gadgets that has a higher than usual price tag of $399.
|
||||
|
||||
Please keep in mind that PineNote is in early developments and is accepting orders only from developers.
|
||||
|
||||
[PineNote][14]
|
||||
|
||||
### JingPad
|
||||
|
||||
![JingPad on my desk][15]
|
||||
|
||||
Perhaps one of the rare few projects that aim to provide a ‘consumer level Linux tablet’. They have premium, custom hardware on the high end side. It has 11″ 2K AMOLED displaym 8 GB RAM, Unisoc Tiger T7510 Octa Core processor along with magnetic keyboard.
|
||||
|
||||
Altogether, things look quite good on the paper, at least from the hardware perspective. Premium hardware comes at premium pricing, of course. The device could cost between $600-$800.
|
||||
|
||||
JingPad also has its own Linux based, touch-friendly operating system called JingOS. The operating system is still under heavy development and should be ready by end of first quarter of 2022.
|
||||
|
||||
Want to know more about JingPad? Read [my experience with JingPad and JingOS in this detailed review][16].
|
||||
|
||||
[JingPad][17]
|
||||
|
||||
### RasPad
|
||||
|
||||
![RasPad][18]
|
||||
|
||||
RasPad is a kit for Raspberry Pi devices to turn it into a functional touch based device. Unlike the regular tabs, this is not a flat device but has a wedge shaped body. This makes it easier to use at desks.
|
||||
|
||||
RasPad is created specially for Raspberry Pi devices and you can use most of its ports easily. There is a dedicated RasPad OS but you are free to use the regular Raspbian OS or Ubuntu or any other Raspberry Pi operating system. Do consider touch friendliness while choosing the OS.
|
||||
|
||||
Please keep in mind that Raspberry Pi device is NOT included in the kit. You’ll have to buy it separately.
|
||||
|
||||
[RasPad][19]
|
||||
|
||||
### What’s your choice?
|
||||
|
||||
I know we are still far from a good alternative Linux tablet that could compete with at least the Android tablets in the market. But at least we have some options available and that’s a silver lining.
|
||||
|
||||
Do you already own any of the above listed devices? How is your experience with it?
|
||||
|
||||
If you had to choose only one of them, which is your choice for the ideal Linux tablet?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/linux-tablets/
|
||||
|
||||
作者:[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/get-linux-laptops/
|
||||
[2]: https://itsfoss.com/linux-based-mini-pc/
|
||||
[3]: https://itsfoss.com/linux-phones/
|
||||
[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
|
@ -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: " "
|
||||
[#]: 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. That’s 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, let’s 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, you’ll be asked to enter your account’s password. When you type it, nothing is displayed on the screen. That is fine. That’s 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. That’s it.
|
||||
|
||||
### Removing build-essential tool from Ubuntu
|
||||
|
||||
Keeping those development tools won’t 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
|
@ -0,0 +1,97 @@
|
||||
[#]: 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: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Why Mark Text is my favorite markdown editor
|
||||
======
|
||||
Mark Text has tools that make it easy to write markdown while at the
|
||||
same time providing a simple interface that just gets out of my way.
|
||||
![Typewriter keys in multicolor][1]
|
||||
|
||||
I got introduced to the markdown format a few years ago when I began to explore Jupyter Notebooks. Many of the other writers at Opensource.com knew markdown, but it was a skill that was unfamiliar to me.
|
||||
|
||||
Markdown is a standard way of writing text, in which you use minimal notation to _markup_ how you want the text styled. For instance, instead of clicking a button to make a word bold, you surround the word with two asterisks (**word**). This has two effects:
|
||||
|
||||
* Visually suggests emboldened text when viewed as plain text
|
||||
* Appears as bold, given a good text converter or renderer (such as Pandoc or a good markdown text editor)
|
||||
|
||||
|
||||
|
||||
One of the greatest advantages of markdown is that most of its notation is intuitive and derived from habits most of us already have. It just makes sense to emphasize words with asterisks, mark headlines with characters to set them apart, and so on.
|
||||
|
||||
Everyone spoke highly of it, but I wasn't sure why I would need to learn and use markdown. However, I'm a curious person, and I began to explore markdown and how it might figure into my writing.
|
||||
|
||||
### Learning markdown
|
||||
|
||||
I enjoyed using a markdown [cheat sheet][2] as I learned. I found markdown to be an excellent tool for writing anything, and I love that I don't even need a special markdown editor. Any text editor can write markdown because markdown uses standard text to denote style. So I started using simple editors like Vim or gedit (or any other editor) and consulted the cheat sheet to remember the simple formatting rules.
|
||||
|
||||
I've been journaling this year as a way of organizing my thoughts and learning more about markdown. I've recently tried the [Ghostwriter][3] text editor, an excellent editor with some extra markdown-specific features. Markdown has become so popular now that many editors incorporate or make it their focus to include syntax highlighting, hints, and other features that make it easy to work in markdown. They're not must-have features, but when you have them, they're nice to have.
|
||||
|
||||
### Trying Mark Text
|
||||
|
||||
While reading a blog, I discovered [Mark Text][4]. Mark Text has tools that make it easy to write markdown while at the same time providing a simple interface that just gets out of my way. Mark Text has six themes: Three light and three dark themes. Dark themes are easier for me to use. The [user documentation][5] is excellent, and there is markdown [syntax help][6] available too.
|
||||
|
||||
### Markdown in real time
|
||||
|
||||
Mark Text provides a real-time preview with a clean and simple interface. It supports the [Commonmark][7] spec, Github Flavored Markdown spec, and Pandoc Markdown. According to its website, Mark Text also supports markdown extensions like KaTex, front matter, and emoji. It outputs HTML and PDF files.
|
||||
|
||||
Mark Text has various editing modes like typewriter mode, source code mode, and focus mode. Adding images is a snap, as you can simply copy and paste them from your clipboard.
|
||||
|
||||
A pop-up at the upper left of the Mark Text window displays the number of characters and paragraphs entered so far. That's really helpful as a writer.
|
||||
|
||||
Saving files is easy from the menu at the upper left of the Mark Text window or use **Ctrl+S**. In fact, the menus of Mark Text look friendly and familiar to anyone who's used to a basic text editor or word processor.
|
||||
|
||||
![Mark Text file menu][8]
|
||||
|
||||
(Don Watkins, [CC BY-SA 4.0][9])
|
||||
|
||||
I love that Mark Text supports various formats with simple keystroke shortcuts, including table blocks, diagrams, in-line formats, math formula blocks, and other code blocks.
|
||||
|
||||
You can download Mark Text for your operating system from the following links:
|
||||
|
||||
* [Linux][10]
|
||||
* [macOS][11]
|
||||
* [Windows][12]
|
||||
|
||||
|
||||
|
||||
Mark Text is open source with an [MIT][13] license. You can always [download][14] the latest version.
|
||||
|
||||
Alternatively, you can install Mark Text on macOS with `brew install --cask mark-text` and on Windows with [Chocolatey][15] by entering `choco install marktext`.
|
||||
|
||||
Mark Text is always looking for sponsors and developers. The project has a [guide][16] for contributors. In addition, you can support the project on Patreon and Open Collective.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/10/mark-text-markdown-editor
|
||||
|
||||
作者:[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/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
|
@ -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
|
@ -0,0 +1,178 @@
|
||||
[#]: 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: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How to Install Rust and Cargo on Ubuntu and Other Linux Distributions
|
||||
======
|
||||
|
||||
_**Brief: Learn various ways of installing Rust programming language on Linux along with its package manager Cargo.**_
|
||||
|
||||
Ever since Mozilla dumped [Rust][1], it has gained even more prominence and popularity. Don’t just take my words for it. [Rust is going to be included in the Linux kernel][2], only the second programming language after C.
|
||||
|
||||
Many developers have also started making awesome command line based tools in Rust. These tools are often available through the [Cargo package manager][3].
|
||||
|
||||
This is why it matters to install Rust support in Linux, both for the programmers and the end users.
|
||||
|
||||
Officially, Rust documents suggest installing Rust in Linux by downloading and executing the installer script in this manner:
|
||||
|
||||
```
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||
```
|
||||
|
||||
That could work. However, your distribution probably already packages Rust. Using your distribution’s [package manager][4] is also an option.
|
||||
|
||||
Let me walk you through the Rust installation steps for both official Rust way and package manager way.
|
||||
|
||||
### Method 1: Installing Rust on any Linux using the official method
|
||||
|
||||
There are a couple of advantages of this method:
|
||||
|
||||
* You get the latest Rust and Cargo version
|
||||
* Rust is only installed for the current user, not system-wide
|
||||
* You do not need to be root or have sudo access to install Rust for yourself this way
|
||||
|
||||
|
||||
|
||||
A few people dislike downloading and [running shell scripts][5] off the internet, even if it is coming from the official sources. However, since it does not need root access and the script is coming from the official sources, it should be safe to install it this way.
|
||||
|
||||
First, make sure that you have Curl installed. Use your distribution’s package manager to install it, if it is not already installed. You can [install Curl on Ubuntu][6] and Debian using the apt command:
|
||||
|
||||
```
|
||||
sudo apt install curl
|
||||
```
|
||||
|
||||
Next, use this command to download the script and run it:
|
||||
|
||||
```
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||
```
|
||||
|
||||
![][7]
|
||||
|
||||
It will ask your input for the kind of installation you want. Go with option 1:
|
||||
|
||||
![][8]
|
||||
|
||||
Once the script finishes the installation process, you need to source the configuration file to make the changes available for your shell.
|
||||
|
||||
![][9]
|
||||
|
||||
Source the file:
|
||||
|
||||
```
|
||||
source $HOME/.cargo/env
|
||||
```
|
||||
|
||||
Once it is done, verify that rust is available for you by checking the installed version:
|
||||
|
||||
```
|
||||
rustc --version
|
||||
```
|
||||
|
||||
![Verifying Rust installation][10]
|
||||
|
||||
Super cool. If there is a new version of Rust released, you can update the installed one using:
|
||||
|
||||
```
|
||||
rustup update
|
||||
```
|
||||
|
||||
Let me quickly show how to remove rust installed this way before you see the other installation method.
|
||||
|
||||
#### Removing Rust installed the official way
|
||||
|
||||
In a terminal, use the following command to remove Rust from your system:
|
||||
|
||||
```
|
||||
rustup self uninstall
|
||||
```
|
||||
|
||||
Press Y when asked and you’ll have Rust removed from the system.
|
||||
|
||||
![Removing Rust from Linux][11]
|
||||
|
||||
That’s settled then. Let’s see how to use the apt command to install Rust on Ubuntu.
|
||||
|
||||
### Method 2: Installing Rust support on Ubuntu using apt
|
||||
|
||||
Why would you want to use the package manager?
|
||||
|
||||
* It installs Rust system wide and thus makes it available for all the users on the system
|
||||
* It gets updated centrally with other system updates (if your distribution adds a new version of Rust)
|
||||
|
||||
|
||||
|
||||
There are two main Rust packages available in Ubuntu:
|
||||
|
||||
* rustc: The rust compiler used for Rust programming language
|
||||
* cargo: Cargo is the Rust package manager and it automatically installs rustc
|
||||
|
||||
|
||||
|
||||
As a regular user, you would be using Cargo for installing Rust based applications. As a programmer, you’ll need Cargo for getting other Rust packages or create your own.
|
||||
|
||||
Since Cargo includes rustc, I would advise installing it so that all required packages are installed in one go.
|
||||
|
||||
```
|
||||
sudo apt install cargo
|
||||
```
|
||||
|
||||
You’ll be asked to enter your account’s password.
|
||||
|
||||
![][12]
|
||||
|
||||
You are, of course, free to use `apt install rustc` and install only Rust. That choice lies with you.
|
||||
|
||||
You may verify that Rust is installed for you and all the other users (if you want to):
|
||||
|
||||
![][13]
|
||||
|
||||
That’s good. Let me quickly show the uninstall step as well.
|
||||
|
||||
#### Removing Rust using apt remove
|
||||
|
||||
To remove Rust, you can remove Cargo first and then use the autoremove command to remove the dependencies installed with it.
|
||||
|
||||
```
|
||||
sudo apt remove cargo
|
||||
```
|
||||
|
||||
Now run the autoremove:
|
||||
|
||||
```
|
||||
sudo apt autoremove
|
||||
```
|
||||
|
||||
That’s it. You now know all the essentials about installing Rust on Ubuntu and other Linux distributions. Questions and suggestions are always welcome.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/install-rust-cargo-ubuntu-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.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
|
@ -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&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.
|
||||
|
||||
<< snip >>
|
||||
$
|
||||
```
|
||||
|
||||
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&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<00:00, 2409.72 rules/s]
|
||||
matching: 100%| 76/76 [00:01<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&CK Tactic | ATT&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&CK Tactic and Technique to match the capabilities. If you are unfamiliar with what ATT&CK means, please refer to the [MITRE ATT&CK Framework here][8].
|
||||
|
||||
MITRE ATT&CK is best described in the project's own words:
|
||||
|
||||
> MITRE ATT&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&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)
|
||||
|
||||
<< snip >>
|
||||
|
||||
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
|
||||
|
||||
<< snip >>
|
||||
|
||||
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
|
||||
|
||||
<< snip >>
|
||||
```
|
||||
|
||||
### 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)
|
||||
|
||||
<< snip >>
|
||||
|
||||
api: opendir @ 0x20052E8
|
||||
api: readdir @ 0x2005369, 0x200548A
|
||||
|
||||
write file on Linux
|
||||
|
||||
<< snip >>
|
||||
|
||||
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/
|
@ -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
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Example Domain</title>
|
||||
```
|
||||
|
||||
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
|
@ -0,0 +1,131 @@
|
||||
[#]: 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: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How to Convert a Webpage to PDF in Linux
|
||||
======
|
||||
|
||||
Saving a webpage as a PDF comes in handy when you archive certain resources or use them for educational purposes.
|
||||
|
||||
But, how do you convert a webpage to PDF in Linux?
|
||||
|
||||
_**You can either choose to go the easy way out using the web browser (GUI) on every Linux distribution or use the terminal to turn a webpage into a PDF file.**_
|
||||
|
||||
Here, I shall mention both the methods to help you get the job done.
|
||||
|
||||
### Method 1: Converting a Webpage to PDF Using Web Browser
|
||||
|
||||
Even though I use Mozilla Firefox for this tutorial, you can do the same thing with any of the [best browsers available for Linux.][1]
|
||||
|
||||
![][2]
|
||||
|
||||
1\. Load up the webpage you want to convert.
|
||||
|
||||
2\. Head to the browser menu to find the “**Print**” option or use the keyboard shortcut “**Ctrl + P**.”
|
||||
|
||||
3\. By default, it should let you save it as a PDF. You need to hit “Save,” and choose the destination and save the webpage.
|
||||
|
||||
![Save webpage as PDF in Mozilla Firefox][3]
|
||||
|
||||
The one major problem with this simple approach is that it includes all the elements on the page. This may include comments, footer etc. You may use a PDF editor to remove parts of it but that’s an additional task.
|
||||
|
||||
_**A better option is to utilize a browser extension like [Print Friendly][4]. It allows you to edit and remove parts of the webpage before downloading the PDF.**_
|
||||
|
||||
### Method 2: Converting a Webpage to PDF or Images Using the Terminal
|
||||
|
||||
You probably already know that you can [browse internet in Linux terminal][5] and even [download files using the command line][6]. That’s not surprising considering you can do a lot more in the terminal, including downloading a webpage as PDF.
|
||||
|
||||
A nifty open-source command-line tools **wkhtmltopdf** and **wkhtmltoimage** come to the rescue that lets you convert any HTML webpage to a PDF or image file.
|
||||
|
||||
It utilizes the Qt WebKit rendering engine to get the task done. You can explore its [GitHub page][7] for more information.
|
||||
|
||||
You should be able to install it from the default repository of your Linux distribution. For Ubuntu-based distros, you can type in the command:
|
||||
|
||||
```
|
||||
sudo apt install wkhtmltopdf
|
||||
```
|
||||
|
||||
It is pretty straightforward to use no matter whether you want to convert it to a PDF or image file:
|
||||
|
||||
![][8]
|
||||
|
||||
To convert a webpage into a PDF, type in:
|
||||
|
||||
```
|
||||
wkhtmltopdf URL/domain filename.pdf
|
||||
```
|
||||
|
||||
As an example, here’s how it would look:
|
||||
|
||||
```
|
||||
wkhtmltopdf linuxmint.com mint.pdf
|
||||
```
|
||||
|
||||
You can choose to use the complete URL as “**<https://linuxmint.com**”> or use the domain name as shown in the example above.
|
||||
|
||||
The file generated will be saved in the home directory by default.
|
||||
|
||||
You also get a few exciting options when converting a webpage.
|
||||
|
||||
For instance, you can **apply a grayscale filter to the PDF file**, **make multiple copies of the page** in the same file, and **exclude images** during conversion.
|
||||
|
||||
The grayscale filter may not work on every webpage, but you can try that using the command:
|
||||
|
||||
```
|
||||
wkhtmltopdf -g google.com googlepage.pdf
|
||||
```
|
||||
|
||||
To make multiple copies of pages in the same PDF file, the command would be:
|
||||
|
||||
```
|
||||
wkhtmltopdf --copies 2 linuxmint.com mint.pdf
|
||||
```
|
||||
|
||||
And, if you want to exclude images from the web pages, just type:
|
||||
|
||||
```
|
||||
wkhtmltopdf --no-images linuxmint.com mint.pdf
|
||||
```
|
||||
|
||||
Additionally, if you want to convert a webpage as an image, the command would look like this:
|
||||
|
||||
```
|
||||
wkhtmltoimage linuxmint.com mint.png
|
||||
```
|
||||
|
||||
Note that unlike the GUI method using a browser, using these tools via the terminal has its limitation. It does not seem to convert web pages utilizing any <iframe> code snippets successfully.
|
||||
|
||||
Sites like ours and even DuckDuckGo didn’t convert to PDF or an image. However, simple HTML sites like Linuxmint.com, Ubuntu.com, Google.com, worked like charm.
|
||||
|
||||
### Wrapping Up
|
||||
|
||||
To get the best results, saving a webpage as a PDF using a browser seems to be the way to go. But, if you want more options and go through the terminal, the **wkhtmltopdf** utility should come in handy.
|
||||
|
||||
How do you prefer to convert web pages to PDF in Linux? Feel free to share your thoughts in the comments.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/convert-webpage-pdf-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://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
|
@ -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
|
37
sources/tech/20211022 3 tips for printing with Linux.md
Normal file
37
sources/tech/20211022 3 tips for printing with Linux.md
Normal 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
|
@ -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.**_
|
||||
|
||||
Microsoft’s [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 don’t 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, it’s 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. It’s 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/
|
@ -0,0 +1,113 @@
|
||||
[#]: 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: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment
|
||||
======
|
||||
|
||||
_**Brief: This is a step-by-step beginner’s tutorial to show how to install themes and icons in Xubuntu and other Linux distributions that use Xfce desktop environment.**_
|
||||
|
||||
Installing themes on Xubuntu is similar to Ubuntu or any other Linux distribution. You put the theme files in the ~/.themes folder and then use a tool to change it.
|
||||
|
||||
However, some options or the user interface will look different considering Xubuntu uses the [Xfce desktop environment][1]. This is why I created this specific tutorial to show the steps with proper screenshots.
|
||||
|
||||
### Install new themes in Xubuntu (Xfce)
|
||||
|
||||
To get started, you need to create a **.themes** folder in the home directory. Mind the dot (.) before the folder name. It’s important and hides the folder from normal view.
|
||||
|
||||
To check if you already have it, you can [enable viewing hidden files][2] and then create it if it isn’t present.
|
||||
|
||||
![][3]
|
||||
|
||||
Once done, you need to download a theme.
|
||||
|
||||
1\. You can browse for XFCE themes on the [Xfce-look][4] portal. All you have to do is download the archive (compressed) file.
|
||||
|
||||
2\. Next, you need to [extract the zip file][5], as shown in the screenshot below.
|
||||
|
||||
![][6]
|
||||
|
||||
3\. Once you extract it, you will notice a folder appear, and you will have to copy it.
|
||||
|
||||
![][7]
|
||||
|
||||
4\. You will have to then paste this folder into the **.themes** directory that you created initially.
|
||||
|
||||
![][8]
|
||||
|
||||
5\. Finally, you need to head to the Appearance setting to find it listed and select it/apply it for it to take effect.
|
||||
|
||||
![][9]
|
||||
|
||||
As you notice in the screenshot below, the new theme has been added and applied:
|
||||
|
||||
![][10]
|
||||
|
||||
In addition to the theme, if you need to customize the icons of your Xubuntu desktop, you need to create another .icons folder in the home directory.
|
||||
|
||||
Like you installed the theme, you will have to follow a similar process to apply the icon themes.
|
||||
|
||||
To give you an example, let me highlight those steps here:
|
||||
|
||||
### Adding icon themes in Xubuntu (Xfce)
|
||||
|
||||
You can browse through the same [xfce-look portal][11] to look for complete icon themes.
|
||||
|
||||
Or, you can explore some of the best [icon themes available for Ubuntu][12] that should work for Xubuntu as well.
|
||||
|
||||
Once you find the one you like, download it, and extract it as shown below.
|
||||
|
||||
![][13]
|
||||
|
||||
Next, you will have to copy and paste the folder into the .**icons** folder.
|
||||
|
||||
![][14]
|
||||
|
||||
Now, you can head back to the Appearance settings and find the icon listed under the “Icons” available.
|
||||
|
||||
To show you the difference, **I changed the default Xubuntu theme to adwaita-dark**, as you can see here:
|
||||
|
||||
![][15]
|
||||
|
||||
**Note**: Some icon or theme files may contain nested folders with different variants in it. You’ll notice that they do not appear in the appearance tool. If that’s the case, copy the inner folder directly in ~/.themes or ~/.icons folder.
|
||||
|
||||
### Wrapping Up
|
||||
|
||||
With both the style and icons tweaked, you can [customize your Xubuntu experience][16] to blend in with your taste.
|
||||
|
||||
Do you prefer the default Xubuntu look or customize the look of it using different themes/icons? Let me know your thoughts in the comments.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/install-themes-xfce-xubuntu/
|
||||
|
||||
作者:[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://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/
|
@ -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
|
@ -1,369 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (YungeG)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Managing resources with cgroups in systemd)
|
||||
[#]: via: (https://opensource.com/article/20/10/cgroups)
|
||||
[#]: author: (David Both https://opensource.com/users/dboth)
|
||||
|
||||
在 systemd 中使用 cgroup 管理资源
|
||||
======
|
||||
|
||||
cgroup 按照应用管理资源,而不是按照组成应用的单个进程。
|
||||
|
||||
![Business woman on laptop sitting in front of window][1]
|
||||
|
||||
作为一个系统管理员,没有事情比意外地耗尽计算资源让我更觉得沮丧。我曾不止一次填满了一个分区的所有可用磁盘空间、耗尽内存、以及没有足够的 CPU 时间在合理的时间内处理我的任务。资源管理是系统管理员最重要的工作之一。
|
||||
|
||||
资源管理的关键是保证所有的进程能够相对公平的访问需要的系统资源。资源管理还包括确保在需要时添加内存、硬盘驱动器空间、还有 CPU 容量;或者在无法添加时限制资源的使用。此外,应该阻止独占系统资源的用户,无论其是否有意。
|
||||
|
||||
|
||||
系统管理员可以通过一些工具监控和管理不同的系统资源。例如,[top][2] 和类似的工具允许你监控内存、I/O、存储(磁盘,SSD等)、网络、交换空间、CPU 的用量等。这些工具,尤其是以 CPU 为中心的工具,大部分基于运行的进程是控制的基本单位的模型。他们最多只是提供了一种方式来调整 nice 数字——从而修改优先级——或者杀死一个运行的进程。(要了解 nice 数字的信息,查看[_使用 Glances 监控 Linux 和 Windows 主机_][3])。
|
||||
|
||||
SystemV 环境中基于传统的资源管理的其他工具,由 `/etc/security/limits.conf` 文件和 `/etc/security/limits.d` 中的本地配置文件控制。资源可以按照用户或组以一种相当粗糙但实用的方式限制。可以管理的资源包括 RAM 的各个方面、每日的总 CPU 时间、数据总量、优先级、nice 数字、同时登陆的数量、进程数、文件大小的最大值等。
|
||||
|
||||
### 使用 cgroup 管理进程
|
||||
|
||||
[systemd 和 SystemV][4] 之间的一个主要差异是管理进程的方式。SystemV 将每个进程当做指向自身的一个实体。systemd 将相关的进程集中到一个控制组,称作 [cgroup][5](控制组的简称),并将 cgroup 作为一个整体管理系统资源。这意味着资源能够基于应用管理,而不是组成应用的单个进程。
|
||||
|
||||
cgroup 的控制单元称作切片单元。切片是允许 systemd 以树状格式控制程序次序,从而简化管理的概念化。
|
||||
|
||||
### 查看 cgroup
|
||||
|
||||
我将从一些允许你查看不同类型 cgroup 信息的命令开始。 `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` 是 systemd(PID 1),`atd.service` 在下一层,是 `system.slice` 的一部分。cgroup 项的第二行还显示了进程 ID(PID)和启动守护进程使用的命令。
|
||||
|
||||
`systemctl` 命令列出多个 cgroup 项,`--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 0(root)和 1000 的用户切片,1000 是我登陆的用户。这里列出了组成每个切片的切片部分,而不是服务。还说明了每个用户登录时都会为其创建一个切片,这为将一个用户的所有任务作为单个 cgroup 项进行管理提供了一种方式。
|
||||
|
||||
### 探索 cgroup 层次结构
|
||||
|
||||
目前为止一切顺利,但是 cgroup 是分层的,所有的服务单元作为其中一个 cgroup 的成员运行。要查看这个层次结构很简单,使用 systemd 的一个旧命令和一个新命令即可。
|
||||
|
||||
`ps` 命令可以用于映射进程的和其所处的 cgroup 层次。注意使用 `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]
|
||||
<SNIP>
|
||||
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
|
||||
<SNIP>
|
||||
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
|
||||
<SNIP>
|
||||
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
|
||||
<SNIP>
|
||||
```
|
||||
|
||||
你可以使用 `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][6] …
|
||||
│ │ ├─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][7] …
|
||||
│ │ ├─dbus\x2d:1.2\x2dorg.xfce.Xfconf.slice
|
||||
│ │ │ └─dbus-:[1.2-org.xfce.Xfconf@0.service][8]
|
||||
│ │ │ └─370748 /usr/lib64/xfce4/xfconf/xfconfd
|
||||
│ │ ├─dbus\x2d:1.2\x2dca.desrt.dconf.slice
|
||||
│ │ │ └─dbus-:[1.2-ca.desrt.dconf@0.service][9]
|
||||
│ │ │ └─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
|
||||
<SNIP>
|
||||
│ │ └─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
|
||||
<SNIP>
|
||||
└─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
|
||||
<SNIP>
|
||||
├─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][10]
|
||||
│ └─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
|
||||
<SNIP>
|
||||
```
|
||||
|
||||
这个树状视图显示了所有的用户和系统切片,以及每个 cgroup 内正在运行的服务和程序。注意叫作“范围”的单元,它将相关的程序组成一个管理单元,在上面列出的结果中就是 `user-1000.slice`。`user-1000.slice/session-7.scope` cgroup 包含了 GUI 桌面程序层次结构,以 LXDM 显示管理器会话和其所有的子任务开始,包括像 Bash 命令行解释器和 Thunar GUI 文件管理器之类的程序。
|
||||
|
||||
配置文件中不定义范围单元,而是作为启动相关程序组的结果程序化生成的。范围单元不创建或启动作为 cgroup 组成部分运行的进程。范围内的所有进程都是平等的,没有内部的层次结构。范围的生命周期在第一个进程创建时开始,在最后一个进程销毁时结束。
|
||||
|
||||
在你的桌面打开多个窗口,比如终端模拟器、LibreOffice、或者任何你想打开的,然后切换到一个可用的虚拟控制台,启动类似 `top` 或 [Midnight Commander][11] 的程序。在主机运行 `systemd-cgls` 命令,留意整体的层次结构和范围单元。
|
||||
|
||||
`systemd-cgls` 命令提供的 cgroup 层次结构表示(以及组成 cgroup 单元的细节),比我见过的其他任何指令都要完整。和 `ps` 命令提供的输出相比,我喜欢 `systemd-cgls` 命令更简洁的树形表示。
|
||||
|
||||
### 来自朋友们的一点帮助
|
||||
|
||||
介绍完这些基础知识后,我曾计划过深入研究 cgroup 的更多细节,以及如何使用,但是我在 Opensource.com 的姐妹网站 [Enable Sysadmin][13] 上发现了一系列四篇优秀文章,由 Red Hat 公司的 [Steve Ovens][12] 所作。与其从头重写 Steve 的文章,我觉得倒不如通过链接到这些文章,利用他的 cgroup 专业知识:
|
||||
|
||||
1. [一个 Linux 系统管理员对 cgroup 的介绍][14]
|
||||
2. [如何用 CPUShares 管理 cgroup][15]
|
||||
3. [用更难的方式——手动管理 cgroup][16]
|
||||
4. [用 systemd 管理 cgroup][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)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/dboth
|
||||
[b]: https://github.com/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
|
199
translated/tech/20210911 Play with model trains in OpenTTD.md
Normal file
199
translated/tech/20210911 Play with model trains in OpenTTD.md
Normal file
@ -0,0 +1,199 @@
|
||||
[#]: 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: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
在 OpenTTD 中玩模型火车
|
||||
======
|
||||
|
||||
想玩实体模型火车,却没有足够大的空间?试试 OenTTD 中的虚拟火车吧。
|
||||
![Old train][1]
|
||||
|
||||
我父亲一直很喜欢火车模型,我记得我小时候,曾看着他在圣诞树周围建了一整条轨道。当[乐高][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 &
|
||||
```
|
||||
|
||||
首次启动 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)
|
||||
校对:[校对者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/
|
@ -1,134 +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: " "
|
||||
|
||||
我如何使用 Ansible 和 anacron 实现自动化
|
||||
======
|
||||
有了 anacron,我可以把脚本和 Ansible playbooks 放到合适的地方,以完成各种琐碎的任务。
|
||||
![Woman programming][1]
|
||||
|
||||
自动化是很好的 IT 和 DevOps 的理想,但根据我的经验,任何不方便的东西可能根本不存在。有很多次,我为某些任务想出了一个很好的解决方案,我甚至会编写脚本,但我没有让它真正实现自动化,因为在我工作的机器上不存在易于自动化的基础设施。
|
||||
|
||||
我最喜欢的简易自动化工具曾经是 cron 系统,它古老、可靠、面向用户,而且(除了一个我永远无法记住的调度语法)简单。然而,cron 的问题是,它假定一台电脑每天 24 小时都在工作。在错过了太多预定的备份之后,我发现了 [anacron][2],一个基于时间戳而非预定时间的 cron 系统。如果你的电脑在通常情况下运行时处于关闭状态,Anacron 会确保它在电脑重新开启时运行。创建一个作业就像把一个 shell 脚本放到三个目录中一样简单。`cron.day`、`cron.weekly` 或者 `cron.monthly` (如果你想的话,你可以定义更多)。有了 anacron,我发现自己把脚本和 Ansible playbook 放到了各种琐碎的任务中,包括弹出到期和事件提醒。
|
||||
|
||||
这是一个现代问题的简单而明显的解决方案,但如果 anacron 没有安装在电脑上,它对我没有好处。
|
||||
|
||||
### 用 Ansible 进行软件设置
|
||||
|
||||
任何时候我设置一台新的计算机,无论是笔记本电脑、工作站还是服务器,我都会安装 anacron。这很简单,但是 anacron 的安装只提供了 anacron 命令。它并没有设置 Anacron 的用户环境。所以我创建了一个 Ansible playbook 来设置用户需要什么来使用 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 playbook,所以我把它放在我的 `~/Ansible/data` 目录下,那里是我的 playbook 的支持文件。
|
||||
|
||||
|
||||
```
|
||||
- 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` 模块提供了一个安装软件包的通用接口,所以我把它用在这个 playbook 上。幸运的是,我还没有遇到一个仓库将 `anacron` 命名为 `anacron`,所以现在,我不必考虑软件包名称的潜在差异。
|
||||
|
||||
这实际上是一个单独的 playbook,因为软件包的安装需要权限升级,它由 `becomes: true` 指令提供。
|
||||
|
||||
|
||||
```
|
||||
\- hosts: localhost
|
||||
become: true
|
||||
tasks:
|
||||
- name: install anacron
|
||||
ansible.builtin.package:
|
||||
name: anacron
|
||||
state: present
|
||||
```
|
||||
|
||||
### 使用 anacron 和 Ansible 实现轻松自动化
|
||||
|
||||
为了用 Ansible 安装 anacron,我运行 playbook:
|
||||
|
||||
|
||||
```
|
||||
`$ ansible-playbook ~/Ansible/setup-anacron.yaml`
|
||||
```
|
||||
|
||||
从这里起,我就可以编写 shell 脚本来执行一些琐碎但重复的任务,然后把它复制到 `~/.local/etc/cron.daily`,让它每天自动运行一次(或者大约如此)。我还为诸如[清理下载文件夹][3]之类的任务编写了 Ansible playbook。我把我的 playbook 放在 `~/Ansible` 里,这是我保存 Ansible playbook 的地方,然后在 `~/.local/etc/cron.daily` 里创建一个 shell 脚本来执行这个 playbook。这很简单,不费吹灰之力,而且很快第二天也自然如此。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/9/ansible-anacron-automation
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/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
|
@ -0,0 +1,100 @@
|
||||
[#]: 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: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
GitUI: 用 Rust 编写的 Git 的快速命令行客户端
|
||||
======
|
||||
|
||||
[基本的 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 之间的比较。Git 的简单用户界面
|
||||
|
||||
这种优化大部分来自于 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 仓库中。
|
||||
|
||||
真正让我兴奋的是,你不仅可以做之前的四个动作,还可以**编辑**每个文件,**拉取**它,**blame** 它,在其中**导航**等等,这一切都无需退出界面。 很棒,不是吗?
|
||||
|
||||
![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)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [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
|
Loading…
Reference in New Issue
Block a user