mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-13 22:30:37 +08:00
commit
1b62438024
317
published/20200211 Using external libraries in Java.md
Normal file
317
published/20200211 Using external libraries in Java.md
Normal file
@ -0,0 +1,317 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (unigeorge)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-13769-1.html)
|
||||
[#]: subject: (Using external libraries in Java)
|
||||
[#]: via: (https://opensource.com/article/20/2/external-libraries-java)
|
||||
[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen)
|
||||
|
||||
在 Java 中使用外部库
|
||||
======
|
||||
|
||||
> 外部库填补了 Java 核心库中的一些功能空白。
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202109/10/075749s65x89uzxj8x5kq9.jpg)
|
||||
|
||||
Java 自带有一组核心库,其中包含了定义常用数据类型和相关行为的库(例如 `String` 和 `Date`)、与主机操作系统交互的实用程序(例如 `System` 和 `File`),以及一些用来管理安全性、处理网络通信、创建或解析 XML的有用的子系统。鉴于核心库的丰富性,程序员通常很容易在其中找到有用的组件,以减少需要编写的代码量。
|
||||
|
||||
即便如此,核心库仍有一些功能上的不足,因此发现这些不足的程序员们还额外创建了很多有趣的 Java 库。例如,[Apache Commons][2]“是一个专注于可重用 Java 组件所有方面的 Apache 项目”,提供了大约 43 个开源库的集合(截至撰写本文时),涵盖了 Java 核心库之外的一系列功能 (例如 [geometry][3] 或 [statistics][4]),并增强或替换了 Java 核心库中的原有功能(例如 [math][5] 或 [numbers][6])。
|
||||
|
||||
另一种常见的 Java 库类型是系统组件的接口(例如数据库系统接口),本文会着眼于使用此类接口连接到 [PostgreSQL][7] 数据库,并得到一些有趣的信息。首先,我们来回顾一下库的重要部分。
|
||||
|
||||
### 什么是库?
|
||||
|
||||
<ruby>库<rt>library</rt></ruby>里自然包含的是一些有用的代码。但为了发挥用处,代码需要以特定方式进行组织,特定的方式使 Java 程序员可以访问其中组件来解决手头问题。
|
||||
|
||||
可以说,一个库最重要的部分是它的应用程序编程接口(API)文档。这种文档很多人都熟悉,通常是由 [Javadoc][8] 生成的。Javadoc 读取代码中的结构化注释并以 HTML 格式输出文档,通常 API 的 <ruby>包<rt>package</rt></ruby> 在页面左上角的面板中显示,<ruby>类<rt>class</rt></ruby> 在左下角显示,同时右侧会有库、包或类级别的详细文档(具体取决于在主面板中选择的内容)。例如,[Apache Commons Math 的顶级 API 文档][9] 如下所示:
|
||||
|
||||
![API documentation for Apache Commons Math][10]
|
||||
|
||||
单击主面板中的包会显示该包中定义的 Java 类和接口。例如,[org.apache.commons.math4.analysis.solvers][11] 显示了诸如 `BisectionSolver` 这样的类,该类用于使用二分算法查找单变量实函数的零点。单击 [BisectionSolver][12] 链接会列出 `BisectionSolver` 类的所有方法。
|
||||
|
||||
这类文档可用作参考文档,不适合作为学习如何使用库的教程。比如,如果你知道什么是单变量实函数并查看包 `org.apache.commons.math4.analysis.function`,就可以试着使用该包来组合函数定义,然后使用 `org.apache.commons.math4.analysis.solvers` 包来查找刚刚创建的函数的零点。但如果你不知道,就可能需要更多学习向的文档,也许甚至是一个实际例子,来读懂参考文档。
|
||||
|
||||
这种文档结构还有助于阐明 <ruby>包<rt>package</rt></ruby>(相关 Java 类和接口定义的集合)的含义,并显示特定库中捆绑了哪些包。
|
||||
|
||||
这种库的代码通常是在 [.jar 文件][13] 中,它基本上是由 Java 的 `jar` 命令创建的 .zip 文件,其中还包含一些其他有用的信息。.jar 文件通常被创建为构建过程的端点,该构建过程编译了所定义包中的所有 .java 文件。
|
||||
|
||||
要访问外部库提供的功能,有两个主要步骤:
|
||||
|
||||
1. 确保通过类路径(或者命令行中的 `-cp` 参数或者 `CLASSPATH` 环境变量),库可用于 Java 编译步骤([javac][14])和执行步骤(`java`)。
|
||||
2. 使用恰当的 `import` 语句访问程序源代码中的包和类。
|
||||
|
||||
其余的步骤就与使用 `String` 等 Java核心类相同,使用库提供的类和接口定义来编写代码。很简单对吧?不过也没那么简单。首先,你需要了解库组件的预期使用模式,然后才能编写代码。
|
||||
|
||||
### 示例:连接 PostgreSQL 数据库
|
||||
|
||||
在数据库系统中访问数据的典型使用步骤是:
|
||||
|
||||
1. 访问正在使用的特定数据库软件代码。
|
||||
2. 连接到数据库服务器。
|
||||
3. 构建查询字符串。
|
||||
4. 执行查询字符串。
|
||||
5. 针对返回的结果,做需要的处理。
|
||||
6. 断开与数据库服务器的连接。
|
||||
|
||||
所有这些面向程序员的部分由接口包 [java.sql][15] 提供,它独立于数据库,定义了核心客户端 Java 数据库连接(JDBC)API。`java.sql` 包是 Java 核心库的一部分,因此无需提供 .jar 文件即可编译。但每个数据库提供者都会创建自己的 `java.sql` 接口实现(例如 `Connection` 接口),并且必须在运行步骤中提供这些实现。
|
||||
|
||||
接下来我们使用 PostgreSQL,看看这一过程是如何进行的。
|
||||
|
||||
#### 访问特定数据库的代码
|
||||
|
||||
以下代码使用 [Java 类加载器][16](`Class.forName()` 调用)将 PostgreSQL 驱动程序代码加载到正在执行的虚拟机中:
|
||||
|
||||
```
|
||||
import java.sql.*;
|
||||
|
||||
public class Test1 {
|
||||
|
||||
public static void main(String args[]) {
|
||||
|
||||
// Load the driver (jar file must be on class path) [1]
|
||||
|
||||
try {
|
||||
Class.forName("org.postgresql.Driver");
|
||||
System.out.println("driver loaded");
|
||||
} catch (Exception e1) {
|
||||
System.err.println("couldn't find driver");
|
||||
System.err.println(e1);
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
// If we get here all is OK
|
||||
|
||||
System.out.println("done.");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
因为类加载器可能失败,失败时会抛出异常,所以将对 `Class.forName()` 的调用放在 `try-catch` 代码块中。
|
||||
|
||||
如果你使用 `javac` 编译上面的代码,然后用 `java` 运行,会报异常:
|
||||
|
||||
```
|
||||
me@mymachine:~/Test$ javac Test1.java
|
||||
me@mymachine:~/Test$ java Test1
|
||||
couldn't find driver
|
||||
java.lang.ClassNotFoundException: org.postgresql.Driver
|
||||
me@mymachine:~/Test$
|
||||
```
|
||||
|
||||
类加载器要求类路径中有包含 PostgreSQL JDBC 驱动程序实现的 .jar 文件:
|
||||
|
||||
```
|
||||
me@mymachine:~/Test$ java -cp ~/src/postgresql-42.2.5.jar:. Test1
|
||||
driver loaded
|
||||
done.
|
||||
me@mymachine:~/Test$
|
||||
```
|
||||
|
||||
#### 连接到数据库服务器
|
||||
|
||||
以下代码实现了加载 JDBC 驱动程序和创建到 PostgreSQL 数据库的连接:
|
||||
|
||||
```
|
||||
import java.sql.*;
|
||||
|
||||
public class Test2 {
|
||||
|
||||
public static void main(String args[]) {
|
||||
|
||||
// Load the driver (jar file must be on class path) [1]
|
||||
|
||||
try {
|
||||
Class.forName("org.postgresql.Driver");
|
||||
System.out.println("driver loaded");
|
||||
} catch (Exception e1) {
|
||||
System.err.println("couldn't find driver");
|
||||
System.err.println(e1);
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
// Set up connection properties [2]
|
||||
|
||||
java.util.Properties props = new java.util.Properties();
|
||||
props.setProperty("user","me");
|
||||
props.setProperty("password","mypassword");
|
||||
String database = "jdbc:postgresql://myhost.org:5432/test";
|
||||
|
||||
// Open the connection to the database [3]
|
||||
|
||||
try (Connection conn = DriverManager.getConnection(database, props)) {
|
||||
System.out.println("connection created");
|
||||
} catch (Exception e2) {
|
||||
System.err.println("sql operations failed");
|
||||
System.err.println(e2);
|
||||
System.exit(2);
|
||||
}
|
||||
System.out.println("connection closed");
|
||||
|
||||
// If we get here all is OK
|
||||
|
||||
System.out.println("done.");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
编译并运行上述代码:
|
||||
|
||||
```
|
||||
me@mymachine:~/Test$ javac Test2.java
|
||||
me@mymachine:~/Test$ java -cp ~/src/postgresql-42.2.5.jar:. Test2
|
||||
driver loaded
|
||||
connection created
|
||||
connection closed
|
||||
done.
|
||||
me@mymachine:~/Test$
|
||||
```
|
||||
|
||||
关于上述的一些注意事项:
|
||||
|
||||
* 注释 `[2]` 后面的代码使用系统属性来设置连接参数(在本例中参数为 PostgreSQL 用户名和密码)。代码也可以从 Java 命令行获取这些参数并将所有参数作为参数包传递,同时还有一些其他 `Driver.getConnection()` 选项可用于单独传递参数。
|
||||
* JDBC 需要一个用于定义数据库的 URL,它在上述代码中被声明为 `String database` 并与连接参数一起传递给 `Driver.getConnection()` 方法。
|
||||
* 代码使用 `try-with-resources` 语句,它会在 `try-catch` 块中的代码完成后自动关闭连接。[Stack Overflow][23] 上对这种方法进行了长期的讨论。
|
||||
* `try-with-resources` 语句提供对 `Connection` 实例的访问,并可以在其中执行 SQL 语句;所有错误都会被同一个 `catch` 语句捕获。
|
||||
|
||||
#### 用数据库的连接处理一些有趣的事情
|
||||
|
||||
日常工作中,我经常需要知道为给定的数据库服务器实例定义了哪些用户,这里我使用这个 [简便的 SQL][24] 来获取所有用户的列表:
|
||||
|
||||
```
|
||||
import java.sql.*;
|
||||
|
||||
public class Test3 {
|
||||
|
||||
public static void main(String args[]) {
|
||||
|
||||
// Load the driver (jar file must be on class path) [1]
|
||||
|
||||
try {
|
||||
Class.forName("org.postgresql.Driver");
|
||||
System.out.println("driver loaded");
|
||||
} catch (Exception e1) {
|
||||
System.err.println("couldn't find driver");
|
||||
System.err.println(e1);
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
// Set up connection properties [2]
|
||||
|
||||
java.util.Properties props = new java.util.Properties();
|
||||
props.setProperty("user","me");
|
||||
props.setProperty("password","mypassword");
|
||||
String database = "jdbc:postgresql://myhost.org:5432/test";
|
||||
|
||||
// Open the connection to the database [3]
|
||||
|
||||
try (Connection conn = DriverManager.getConnection(database, props)) {
|
||||
System.out.println("connection created");
|
||||
|
||||
// Create the SQL command string [4]
|
||||
|
||||
String qs = "SELECT " +
|
||||
" u.usename AS \"User name\", " +
|
||||
" u.usesysid AS \"User ID\", " +
|
||||
" CASE " +
|
||||
" WHEN u.usesuper AND u.usecreatedb THEN " +
|
||||
" CAST('superuser, create database' AS pg_catalog.text) " +
|
||||
" WHEN u.usesuper THEN " +
|
||||
" CAST('superuser' AS pg_catalog.text) " +
|
||||
" WHEN u.usecreatedb THEN " +
|
||||
" CAST('create database' AS pg_catalog.text) " +
|
||||
" ELSE " +
|
||||
" CAST('' AS pg_catalog.text) " +
|
||||
" END AS \"Attributes\" " +
|
||||
"FROM pg_catalog.pg_user u " +
|
||||
"ORDER BY 1";
|
||||
|
||||
// Use the connection to create a statement, execute it,
|
||||
// analyze the results and close the result set [5]
|
||||
|
||||
Statement stat = conn.createStatement();
|
||||
ResultSet rs = stat.executeQuery(qs);
|
||||
System.out.println("User name;User ID;Attributes");
|
||||
while (rs.next()) {
|
||||
System.out.println(rs.getString("User name") + ";" +
|
||||
rs.getLong("User ID") + ";" +
|
||||
rs.getString("Attributes"));
|
||||
}
|
||||
rs.close();
|
||||
stat.close();
|
||||
|
||||
} catch (Exception e2) {
|
||||
System.err.println("connecting failed");
|
||||
System.err.println(e2);
|
||||
System.exit(1);
|
||||
}
|
||||
System.out.println("connection closed");
|
||||
|
||||
// If we get here all is OK
|
||||
|
||||
System.out.println("done.");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
在上述代码中,一旦有了 `Connection` 实例,它就会定义一个查询字符串(上面的注释 `[4]`),创建一个 `Statement` 实例并用其来执行查询字符串,然后将其结果放入一个 `ResultSet` 实例。程序可以遍历该 `ResultSet` 实例来分析返回的结果,并以关闭 `ResultSet` 和 `Statement` 实例结束(上面的注释 `[5]`)。
|
||||
|
||||
编译和执行程序会产生以下输出:
|
||||
|
||||
```
|
||||
me@mymachine:~/Test$ javac Test3.java
|
||||
me@mymachine:~/Test$ java -cp ~/src/postgresql-42.2.5.jar:. Test3
|
||||
driver loaded
|
||||
connection created
|
||||
User name;User ID;Attributes
|
||||
fwa;16395;superuser
|
||||
vax;197772;
|
||||
mbe;290995;
|
||||
aca;169248;
|
||||
connection closed
|
||||
done.
|
||||
me@mymachine:~/Test$
|
||||
```
|
||||
|
||||
这是在一个简单的 Java 应用程序中使用 PostgreSQL JDBC 库的(非常简单的)示例。要注意的是,由于 `java.sql` 库的设计方式,它不需要在代码中使用像 `import org.postgresql.jdbc.*;` 这样的 Java 导入语句,而是使用 Java 类加载器在运行时引入 PostgreSQL 代码的方式,也正因此无需在代码编译时指定类路径。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/2/external-libraries-java
|
||||
|
||||
作者:[Chris Hermansen][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/clhermansen
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/books_library_reading_list.jpg?itok=O3GvU1gH (books in a library, stacks)
|
||||
[2]: https://commons.apache.org/
|
||||
[3]: https://commons.apache.org/proper/commons-geometry/
|
||||
[4]: https://commons.apache.org/proper/commons-statistics/
|
||||
[5]: https://commons.apache.org/proper/commons-math/
|
||||
[6]: https://commons.apache.org/proper/commons-numbers/
|
||||
[7]: https://opensource.com/article/19/11/getting-started-postgresql
|
||||
[8]: https://en.wikipedia.org/wiki/Javadoc
|
||||
[9]: https://commons.apache.org/proper/commons-math/apidocs/index.html
|
||||
[10]: https://opensource.com/sites/default/files/uploads/api-documentation_apachecommonsmath.png (API documentation for Apache Commons Math)
|
||||
[11]: https://commons.apache.org/proper/commons-math/apidocs/org/apache/commons/math4/analysis/solvers/package-summary.html
|
||||
[12]: https://commons.apache.org/proper/commons-math/apidocs/org/apache/commons/math4/analysis/solvers/BisectionSolver.html
|
||||
[13]: https://en.wikipedia.org/wiki/JAR_(file_format)
|
||||
[14]: https://en.wikipedia.org/wiki/Javac
|
||||
[15]: https://docs.oracle.com/javase/8/docs/api/java/sql/package-summary.html
|
||||
[16]: https://en.wikipedia.org/wiki/Java_Classloader
|
||||
[17]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string
|
||||
[18]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system
|
||||
[19]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+exception
|
||||
[20]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+properties
|
||||
[21]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+connection
|
||||
[22]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+drivermanager
|
||||
[23]: https://stackoverflow.com/questions/8066501/how-should-i-use-try-with-resources-with-jdbc
|
||||
[24]: https://www.postgresql.org/message-id/1121195544.8208.242.camel@state.g2switchworks.com
|
||||
[25]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+statement
|
||||
[26]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+resultset
|
||||
[27]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+attributes
|
69
published/20210228 What is GNU-Linux Copypasta.md
Normal file
69
published/20210228 What is GNU-Linux Copypasta.md
Normal file
@ -0,0 +1,69 @@
|
||||
[#]: subject: (What is GNU/Linux Copypasta?)
|
||||
[#]: via: (https://itsfoss.com/gnu-linux-copypasta/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (wxy)
|
||||
|
||||
谈谈 GNU/Linux 口水话
|
||||
======
|
||||
|
||||
![](https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/gnu-linux-copypasta.png)
|
||||
|
||||
作为一个 Linux 用户,你可能遇到过以这样开头的一大段文字:“我想插一句话。你所说的 Linux,实际上是指 GNU/Linux。”
|
||||
|
||||
这让一些人对什么是 “Linux” 和什么是 “GNU/Linux” 感到困惑。对此,我在关于 [Linux 发行版的概念][1] 的文章中已经解释过。
|
||||
|
||||
基本上,[Linux 是一个内核][2],加上 [GNU 软件][3],它就可以以操作系统的形式使用。
|
||||
|
||||
许多纯粹主义者和拥趸们不希望人们忘记 GNU 对基于 Linux 的操作系统的贡献。因此,他们经常在各种论坛和社区发布这篇长文(被称为 GNU Linux <ruby>口水话<rt>copypaste</rt></ruby>)。
|
||||
|
||||
我不清楚这些 GNU/Linux 口水话的起源,也不清楚它是从什么时候开始出现的。有些人把它归功于 Richard Stallman 的 [2011 年在 GNU 博客上的文章][4]。我无法证实或否认这一点。
|
||||
|
||||
### 完整的 GNU/Linux 口水话
|
||||
|
||||
> 我只想插一句话。你所说的 Linux,实际上是 GNU/Linux,或者正如我最近所称,是 GNU + Linux。Linux 本身并不是一个操作系统,而是功能齐全的 GNU 系统的另一个自由组件,这个系统是由 GNU 核心库、shell 实用程序和重要的系统组件组成的、按 POSIX 定义构成的完整操作系统。
|
||||
>
|
||||
> 许多计算机用户每天都在运行着一个修改过的 GNU 系统,却没有意识到这一点。通过一个奇特的转折,这个今天被广泛使用的 GNU 版本通常被称为 Linux,而它的许多用户并不知道它基本上是由 GNU 项目开发的 GNU 系统。
|
||||
>
|
||||
> Linux 倒也真的是存在,这些人也在使用它,但它只是他们使用的系统的一部分罢了。Linux 是内核:在系统中该程序将机器的资源分配给你运行的其他程序。内核是操作系统的一个重要部分,但它本身是无用的;它只能在一个完整的操作系统的环境下发挥作用。Linux 通常与 GNU 操作系统结合使用:整个系统基本上是添加了 Linux 的 GNU,或者叫 GNU/Linux。所有所谓的 Linux 发行版实际上都是 GNU/Linux 的发行版!
|
||||
|
||||
### 到底什么是口水话?
|
||||
|
||||
![][7]
|
||||
|
||||
你是否注意到,我使用了“Copypasta”(LCTT 译注:译者选择翻译为“口水话”,或许有更贴合中文的译法,请大家指正)这个术语。它与<ruby>意大利面<rt>pasta</rt></ruby>毫无关系。
|
||||
|
||||
[口水话][8] 是在互联网上复制和粘贴的文本块,通常是为了嘲弄或取笑别人。它是“<ruby>复制-粘贴<rt>copy-paste</rt></ruby>”一词的变种。
|
||||
|
||||
口水话也被认为是垃圾内容,因为它们被重复了一次又一次。以 GNU Linux 口水话为例。如果每次有人在讨论区中使用 Linux 这个词而不是 GNU/Linux 时,总会有几个人不断地粘贴这些大段的文本,那么就会惹恼其他成员。
|
||||
|
||||
### 你有没有贴过 GNU/Linux 口水话?
|
||||
|
||||
就个人而言,我从来没有这样做过。但是,说实话,当我还是一个新的 Linux 用户,在浏览一些 Linux 论坛时,我就是这样知道 GNU/Linux 这个术语的。
|
||||
|
||||
你呢?你有没有在 Linux 论坛上复制粘贴过“我想插一句话……”?你认为它是“嘲弄”工具,还是让人们了解 GNU 项目的必要之举?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/gnu-linux-copypasta/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/what-is-linux-distribution/
|
||||
[2]: https://itsfoss.com/what-is-linux/
|
||||
[3]: https://www.gnu.org/
|
||||
[4]: https://www.gnu.org/gnu/linux-and-gnu.html
|
||||
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/09/what-is-foss.png?fit=800%2C450&ssl=1
|
||||
[6]: https://itsfoss.com/what-is-foss/
|
||||
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/copypasta.png?resize=800%2C450&ssl=1
|
||||
[8]: https://www.makeuseof.com/what-is-a-copypasta/
|
@ -0,0 +1,113 @@
|
||||
[#]: subject: "Check file status on Linux with the stat command"
|
||||
[#]: via: "https://opensource.com/article/21/8/linux-stat-file-status"
|
||||
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "New-World-2019"
|
||||
[#]: reviewer: "turbokernel"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-13768-1.html"
|
||||
|
||||
在 Linux 上使用 stat 命令查看文件状态
|
||||
======
|
||||
|
||||
> 获取到任何文件或文件系统的所有信息,仅需要一条 Linux 命令。
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202109/10/072912ouo04jchatqazq53.jpg)
|
||||
|
||||
在 GNU `coreutils` 软件包中包含 `stat` 命令,它提供了关于文件和文件系统包括文件大小、节点位置、访问权限和 SELinux 上下文,以及创建和修改时间等各种元数据。通常情况下,你需要多个不同命令获取的信息,而这一个命令就可以实现。
|
||||
|
||||
### 在 Linux 上安装 stat 命令
|
||||
|
||||
在 Linux 系统中,可能已经预装了 `stat` 命令,因为它属于核心功能软件包,通常默认包含在 Linux 发行版里。
|
||||
|
||||
如果系统中没有安装 `stat` 命令,你可以使用包管理器安装 `coreutils` 软件包。
|
||||
|
||||
另外,你可以 [通过源码编译安装 coreutils 包][2]。
|
||||
|
||||
### 获取文件状态
|
||||
|
||||
运行 `stat` 命令可以获取指定文件或目录易读的状态信息。
|
||||
|
||||
```
|
||||
$ stat planets.xml
|
||||
File: planets.xml
|
||||
Size: 325 Blocks: 8 IO Block: 4096 regular file
|
||||
Device: fd03h/64771d Inode: 140217 Links: 1
|
||||
Access: (0664/-rw-rw-r--) Uid: (1000/tux) Gid: (100/users)
|
||||
Context: unconfined_u:object_r:user_home_t:s0
|
||||
Access: 2021-08-17 18:26:57.281330711 +1200
|
||||
Modify: 2021-08-17 18:26:58.738332799 +1200
|
||||
Change: 2021-08-17 18:26:58.738332799 +1200
|
||||
Birth: 2021-08-17 18:26:57.281330711 +1200
|
||||
```
|
||||
|
||||
输出的信息易懂,但是包含了很多的信息,这里是 `stat` 所包含的项:
|
||||
|
||||
* `File`:文件名
|
||||
* `Size`:文件大小,以字节表示
|
||||
* `Blocks`:在硬盘驱动器上为文件保留的数据块的数量
|
||||
* `IO Block`:文件系统块大小
|
||||
* `regular file`:文件类型(普通文件、目录、文件系统)
|
||||
* `Device`:文件所在的设备
|
||||
* `Inode`:文件所在的 Inode 号
|
||||
* `Links`:文件的链接数
|
||||
* `Access`、`UID`、`GID`:文件权限、用户和组的所有者
|
||||
* `Context`:SELinux 上下文
|
||||
* `Access`、`Modify`、`Change`、`Birth`:文件被访问、修改、更改状态以及创建时的时间戳
|
||||
|
||||
### 精简输出
|
||||
|
||||
对于精通输出或者想要使用其它工具(例如:[awk][3])解析输出的人,这里可以使用 `--terse`(短参数为 `-t`)参数,实现没有标题或换行符的格式化输出。
|
||||
|
||||
```
|
||||
$ stat --terse planets.xml
|
||||
planets.xml 325 8 81b4 100977 100 fd03 140217 1 0 0 1629181617 1629181618 1629181618 1629181617 4096 unconfined_u:object_r:user_home_t:s0
|
||||
```
|
||||
|
||||
### 自定义格式
|
||||
|
||||
你可以使用 `--printf` 参数以及与 [printf][4] 类似的语法定义自己的输出格式。`stat` 的每一个属性都有一个格式序列(`%C` 表示 SELinux 上下文,`%n` 表示文件名等等),所以,你可以定义输出格式。
|
||||
|
||||
```
|
||||
$ stat --printf="%n\n%C\n" planets.xml
|
||||
planets.xml
|
||||
unconfined_u:object_r:user_home_t:s0
|
||||
$ $ stat --printf="Name: %n\nModified: %y\n" planets.xml
|
||||
Name: planets.xml
|
||||
Modified: 2021-08-17 18:26:58.738332799 +1200
|
||||
```
|
||||
|
||||
下面是一些常见的格式序列:
|
||||
|
||||
* `%a` 访问权限
|
||||
* `%F` 文件类型
|
||||
* `%n` 文件名
|
||||
* `%U` 用户名
|
||||
* `%u` 用户 ID
|
||||
* `%g` 组 ID
|
||||
* `%w` 创建时间
|
||||
* `%y` 修改时间
|
||||
|
||||
在 `stat` 手册和 `coreutils` 信息页中都有完整的格式化序列列表。
|
||||
|
||||
### 文件信息
|
||||
|
||||
如果你曾尝试解析过 `ls -l` 的输出,那么,你会很喜欢 `stat` 命令的灵活性。你并不是每次都需要 `stat` 提供的所有信息,但是,当你需要其中一些或全部的时候它是非常有用的。不管你是读取默认输出,还是你自己创建的查询输出,`stat` 命令都可以查看所需的数据。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/8/linux-stat-file-status
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[New-World-2019](https://github.com/New-World-2019)
|
||||
校对:[turbokernel](https://github.com/turbokernel)
|
||||
|
||||
本文由 [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/yearbook-haff-rx-linux-file-lead_0.png?itok=-i0NNfDC (Hand putting a Linux file folder into a drawer)
|
||||
[2]: https://www.gnu.org/software/coreutils/
|
||||
[3]: https://opensource.com/article/20/9/awk-ebook
|
||||
[4]: https://opensource.com/article/20/8/printf
|
@ -0,0 +1,77 @@
|
||||
[#]: subject: "Apps for daily needs part 4: audio editors"
|
||||
[#]: via: "https://fedoramagazine.org/apps-for-daily-needs-part-4-audio-editors/"
|
||||
[#]: author: "Arman Arisman https://fedoramagazine.org/author/armanwu/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: "turbokernel"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-13771-1.html"
|
||||
|
||||
满足日常需求的应用(四):音频编辑器
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
在过去,音频编辑应用或<ruby>数字音频工作站<rt>digital audio workstation</rt></ruby>(DAW)只提供给专业人士使用,如唱片制作人、音响工程师和音乐家。但现在很多不是专业人士的人也需要它们。这些工具被用于演示文稿解说、视频博客,甚至只是作为一种爱好。现在尤其如此,因为有这么多的在线平台,方便大家分享音频作品,如音乐、歌曲、播客等。本文将介绍一些你可以在 Fedora Linux 上使用的开源音频编辑器或 DAW。你可能需要安装提到的软件。如果你不熟悉如何在 Fedora Linux 中添加软件包,请参阅我之前的文章[安装 Fedora 34 工作站后要做的事情][4]。这里列出了音频编辑器或 DAW 类的一些日常需求的应用。
|
||||
|
||||
### Audacity
|
||||
|
||||
我相信很多人已经知道 Audacity 了。它是一个流行的多轨音频编辑器和录音机,可用于对所有类型的音频进行后期处理。大多数人使用 Audacity 来记录他们的声音,然后进行编辑,使其成品更好。其成品可以作为播客或视频博客的解说词。此外,人们还用 Audacity 来创作音乐和歌曲。你可以通过麦克风或调音台录制现场音频。它还支持 32 位的声音质量。
|
||||
|
||||
Audacity 有很多功能,可以支持你的音频作品。它有对插件的支持,你甚至可以自己编写插件。Audacity 提供了许多内置效果,如降噪、放大、压缩、混响、回声、限制器等。你可以利用实时预览功能在直接聆听音频的同时尝试这些效果。内置的插件管理器可以让你管理经常使用的插件和效果。
|
||||
|
||||
![][5]
|
||||
|
||||
详情请参考此链接: <https://www.audacityteam.org/>
|
||||
|
||||
### LMMS
|
||||
|
||||
LMMS(即 <ruby>Linux 多媒体工作室<rt>Linux MultiMedia Studio</rt></ruby>)是一个全面的音乐创作应用。你可以从头使用 LMMS 用你的电脑开始制作你的音乐。你可以根据自己的创意创造旋律和节拍,并通过选择声音乐器和各种效果使其更加完美。有几个与乐器和效果有关的内置功能,如 16 个内置合成器、嵌入式 ZynAddSubFx、支持插入式 VST 效果插件、捆绑图形和参数均衡器、内置分析器等等。LMMS 还支持 MIDI 键盘和其他音频外围设备。
|
||||
|
||||
![][6]
|
||||
|
||||
详情请参考此链接: <https://lmms.io/>
|
||||
|
||||
### Ardour
|
||||
|
||||
Ardour 作为一个全面的音乐创作应用,其功能与 LMMS 相似。它在其网站上说,Ardour 是一个 DAW 应用,是来自世界各地的音乐家、程序员和专业录音工程师合作的结果。Ardour 拥有音频工程师、音乐家、配乐编辑和作曲家需要的各种功能。
|
||||
|
||||
Ardour 提供了完整的录音、编辑、混音和输出功能。它有无限的多声道音轨、无限撤销/重做的非线性编辑器、一个全功能的混音器、内置插件等。Ardour 还包含视频播放工具,所以使用它为视频项目创建和编辑配乐也很有帮助。
|
||||
|
||||
![][7]
|
||||
|
||||
详情请参考此链接: <https://ardour.org/>
|
||||
|
||||
### TuxGuitar
|
||||
|
||||
TuxGuitar 是一款指法谱和乐谱编辑器。它配备了指法编辑器、乐谱查看器、多轨显示、拍号管理和速度管理。它包括弯曲、滑动、颤音等各种效果。虽然 TuxGuitar 专注于吉他,但它也可以为其他乐器写乐谱。它也能够作为一个基本的 MIDI 编辑器。你需要对指法谱和乐谱有一定的了解才能使用它。
|
||||
|
||||
![][8]
|
||||
|
||||
详情请参考此链接: <http://www.tuxguitar.com.ar/>
|
||||
|
||||
### 总结
|
||||
|
||||
本文章介绍了四款音频编辑器,可以满足你在 Fedora Linux 上日常使用的需求。其实,在 Fedora Linux 上还有很多音频编辑器或者 DAW 供你选择。你也可以使用 Mixxx、Rosegarden、Kwave、Qtractor、MuseScore、musE 等等。希望本文为你调查和选择合适的音频编辑器或者 DAW 提供帮助。如你有使用这些应用的经验,请在评论中分享你的经验。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/apps-for-daily-needs-part-4-audio-editors/
|
||||
|
||||
作者:[Arman Arisman][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[turbokernel](https://github.com/turbokernel)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://fedoramagazine.org/author/armanwu/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/FedoraMagz-Apps-4-Audio-816x345.jpg
|
||||
[2]: https://unsplash.com/@brookecagle?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
|
||||
[3]: https://unsplash.com/s/photos/meeting-on-cafe-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
|
||||
[4]: https://fedoramagazine.org/things-to-do-after-installing-fedora-34-workstation/
|
||||
[5]: https://fedoramagazine.org/wp-content/uploads/2021/08/audio-audacity-1024x575.png
|
||||
[6]: https://fedoramagazine.org/wp-content/uploads/2021/08/audio-lmms-1024x575.png
|
||||
[7]: https://fedoramagazine.org/wp-content/uploads/2021/08/audio-ardour-1024x592.png
|
||||
[8]: https://fedoramagazine.org/wp-content/uploads/2021/08/audio-tuxguitar-1024x575.png
|
92
published/20210901 What are container runtimes.md
Normal file
92
published/20210901 What are container runtimes.md
Normal file
@ -0,0 +1,92 @@
|
||||
[#]: subject: "What are container runtimes?"
|
||||
[#]: via: "https://opensource.com/article/21/9/container-runtimes"
|
||||
[#]: author: "Nived V https://opensource.com/users/nivedv"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: "turbokernel"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-13772-1.html"
|
||||
|
||||
什么是容器运行时?
|
||||
======
|
||||
|
||||
> 通过深入了解容器运行时,理解容器环境是如何建立的。
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202109/11/110104vzgjs0v9c9o04s78.jpg)
|
||||
|
||||
在学习 [容器镜像][2] 时,我们讨论了容器的基本原理,但现在是深入研究容器<ruby>运行时<rt>runtime</rt></ruby>的时候了,从而了解容器环境是如何构建的。本文的部分信息摘自 <ruby>开放容器计划<rt>Open Container Initiative</rt></ruby>(OCI)的 [官方文档][3],所以无论使用何种容器引擎,这些信息都是一致的。
|
||||
|
||||
### 容器运行机制
|
||||
|
||||
那么,当你运行 `podman run` 或 `docker run` 命令时,在后台到底发生了什么?一个分步的概述如下:
|
||||
|
||||
1. 如果本地没有镜像,则从镜像<ruby>登记仓库<rt>registry</rt></ruby>拉取镜像
|
||||
2. 镜像被提取到一个写时复制(COW)的文件系统上,所有的容器层相互堆叠以形成一个合并的文件系统
|
||||
3. 为容器准备一个挂载点
|
||||
4. 从容器镜像中设置元数据,包括诸如覆盖 `CMD`、来自用户输入的 `ENTRYPOINT`、设置 SECCOMP 规则等设置,以确保容器按预期运行
|
||||
5. 提醒内核为该容器分配某种隔离,如进程、网络和文件系统(<ruby>命名空间<rt>namespace</rt></ruby>)
|
||||
6. 提醒内核为改容器分配一些资源限制,如 CPU 或内存限制(<ruby>控制组<rt>cgroup</rt></ruby>)
|
||||
7. 传递一个<ruby>系统调用<rt>syscall</rt></ruby>给内核用于启动容器
|
||||
8. 设置 SELinux/AppArmor
|
||||
|
||||
容器运行时负责上述所有的工作。当我们提及容器运行时,想到的可能是 runc、lxc、containerd、rkt、cri-o 等等。嗯,你没有错。这些都是容器引擎和容器运行时,每一种都是为不同的情况建立的。
|
||||
|
||||
<ruby>容器运行时<rt>Container runtime</rt></ruby>更侧重于运行容器,为容器设置命名空间和控制组(cgroup),也被称为底层容器运行时。高层的容器运行时或容器引擎专注于格式、解包、管理和镜像共享。它们还为开发者提供 API。
|
||||
|
||||
### 开放容器计划(OCI)
|
||||
|
||||
<ruby>开放容器计划<rt>Open Container Initiative</rt></ruby>(OCI)是一个 Linux 基金会的项目。其目的是设计某些开放标准或围绕如何与容器运行时和容器镜像格式工作的结构。它是由 Docker、rkt、CoreOS 和其他行业领导者于 2015 年 6 月建立的。
|
||||
|
||||
它通过两个规范来完成如下任务:
|
||||
|
||||
#### 1、镜像规范
|
||||
|
||||
该规范的目标是创建可互操作的工具,用于构建、传输和准备运行的容器镜像。
|
||||
|
||||
该规范的高层组件包括:
|
||||
|
||||
* [镜像清单][4] — 一个描述构成容器镜像的元素的文件
|
||||
* [镜像索引][5] — 镜像清单的注释索引
|
||||
* [镜像布局][6] — 一个镜像内容的文件系统布局
|
||||
* [文件系统布局][7] — 一个描述容器文件系统的变更集
|
||||
* [镜像配置][8] — 确定镜像层顺序和配置的文件,以便转换成 [运行时捆包][9]
|
||||
* [转换][10] — 解释应该如何进行转换的文件
|
||||
* [描述符][11] — 一个描述被引用内容的类型、元数据和内容地址的参考资料
|
||||
|
||||
#### 2、运行时规范
|
||||
|
||||
该规范用于定义容器的配置、执行环境和生命周期。`config.json` 文件为所有支持的平台提供了容器配置,并详细定义了用于创建容器的字段。在详细定义执行环境时也描述了为容器的生命周期定义的通用操作,以确保在容器内运行的应用在不同的运行时环境之间有一个一致的环境。
|
||||
|
||||
Linux 容器规范使用了各种内核特性,包括<ruby>命名空间<rt>namespace</rt></ruby>、<ruby>控制组<rt>cgroup</rt></ruby>、<ruby>权能<rt>capability</rt></ruby>、LSM 和文件系统<ruby>隔离<rt>jail</rt></ruby>等来实现该规范。
|
||||
|
||||
### 小结
|
||||
|
||||
容器运行时是通过 OCI 规范管理的,以提供一致性和互操作性。许多人在使用容器时不需要了解它们是如何工作的,但当你需要排除故障或优化时,了解容器是一个宝贵的优势。
|
||||
|
||||
本文基于 [techbeatly][12] 的文章,并经授权改编。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/9/container-runtimes
|
||||
|
||||
作者:[Nived V][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[turbokernel](https://github.com/turbokernel)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/nivedv
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/kubernetes_containers_ship_lead.png?itok=9EUnSwci (Ships at sea on the web)
|
||||
[2]: https://opensource.com/article/21/8/container-fundamentals-2
|
||||
[3]: https://github.com/opencontainers
|
||||
[4]: https://github.com/opencontainers/image-spec/blob/master/manifest.md
|
||||
[5]: https://github.com/opencontainers/image-spec/blob/master/image-index.md
|
||||
[6]: https://github.com/opencontainers/image-spec/blob/master/image-layout.md
|
||||
[7]: https://github.com/opencontainers/image-spec/blob/master/layer.md
|
||||
[8]: https://github.com/opencontainers/image-spec/blob/master/config.md
|
||||
[9]: https://github.com/opencontainers/runtime-spec
|
||||
[10]: https://github.com/opencontainers/image-spec/blob/master/conversion.md
|
||||
[11]: https://github.com/opencontainers/image-spec/blob/master/descriptor.md
|
||||
[12]: https://medium.com/techbeatly/container-runtimes-deep-dive-77eb0e511939
|
@ -3,13 +3,15 @@
|
||||
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-13773-1.html"
|
||||
|
||||
如何在 Ubuntu Linux 上安装 Dropbox
|
||||
======
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202109/11/112839qa96g29ws99z9479.jpg)
|
||||
|
||||
Dropbox 是 [最受欢迎的云存储服务之一,可用于 Linux][1] 和其他操作系统。
|
||||
|
||||
事实上,Dropbox 是最早提供原生 Linux 应用的服务之一。它仍然 [支持 32 位 Linux 系统][2],这也是一项值得称赞的工作。
|
||||
@ -24,7 +26,7 @@ Dropbox 是[最受欢迎的云存储服务之一,可用于 Linux][1] 和其他
|
||||
|
||||
Dropbox 为其安装程序提供 DEB 文件。进入网站的下载页面:
|
||||
|
||||
[Dropbox Download][3]
|
||||
- [下载 Dropbox][3]
|
||||
|
||||
下载相应的 DEB 文件。考虑到你使用的是 64 位的 Ubuntu,请获取 64 位版本的 DEB 文件。
|
||||
|
||||
@ -46,7 +48,7 @@ Dropbox 为其安装程序提供 DEB文 件。进入网站的下载页面:
|
||||
|
||||
#### 第三步:开始安装 Dropbox
|
||||
|
||||
现在 Dropbox 安装程序已经安装完毕。按 Windows 键(也叫 super 键),搜索 Dropbox 并点击它。
|
||||
现在 Dropbox 安装程序已经安装完毕。按 `Windows` 键(也叫 `Super` 键),搜索 Dropbox 并点击它。
|
||||
|
||||
![Start Dropbox for installation][9]
|
||||
|
||||
@ -54,7 +56,7 @@ Dropbox 为其安装程序提供 DEB文 件。进入网站的下载页面:
|
||||
|
||||
![Starting Dropbox installation][10]
|
||||
|
||||
点击 Restart Nautilus/Close(在 Nautilus 弹出窗口)或 OK(在安装弹出窗口),开始实际的 Dropbox 客户端下载和安装。如果 “Nautilus Restart” 在点击关闭按钮时没有关闭,请点击 x 按钮。
|
||||
点击 “Restart Nautilus” -> “Close”(在 Nautilus 弹出窗口)或 “OK”(在安装弹出窗口),开始实际的 Dropbox 客户端下载和安装。如果 “Nautilus Restart” 在点击关闭按钮时没有关闭,请点击 “X” 按钮。
|
||||
|
||||
等待 Dropbox 的安装完成。
|
||||
|
||||
@ -78,7 +80,7 @@ Dropbox 为其安装程序提供 DEB文 件。进入网站的下载页面:
|
||||
|
||||
![Dropbox folder is created under home directory][14]
|
||||
|
||||
如果你想节省磁盘空间或带宽,你可以进入偏好设置并选择选择性同步选项。选择性同步选项允许你只在本地系统上同步来自 Dropbox 云的选定文件夹。
|
||||
如果你想节省磁盘空间或带宽,你可以进入偏好设置并选择<ruby>选择性同步<rt>Selective Sync</rt></ruby>选项。该选项允许你只在本地系统上同步来自 Dropbox 云的选定文件夹。
|
||||
|
||||
![Using selective sync in Dropbox][15]
|
||||
|
||||
@ -93,7 +95,7 @@ via: https://itsfoss.com/install-dropbox-ubuntu/
|
||||
作者:[Abhishek Prakash][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/) 荣誉推出
|
||||
|
@ -0,0 +1,82 @@
|
||||
[#]: subject: "Getting the Top Indicator Panel Back in GNOME"
|
||||
[#]: via: "https://itsfoss.com/enable-applet-indicator-gnome/"
|
||||
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "imgradeone"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-13785-1.html"
|
||||
|
||||
恢复 GNOME 顶栏的托盘图标
|
||||
======
|
||||
|
||||
GNOME 是一款流行的 Linux 桌面环境,致力于为 Linux 用户提供现代化的桌面体验。
|
||||
|
||||
虽然这款桌面绝大部分功能都不错,但 GNOME 团队的某些决定确实也让许多用户恼火、质疑。
|
||||
|
||||
前脚不能在桌面摆放图标和文件,后脚将右键菜单中的 [新建文档选项移除][1],现在,除此之外,GNOME 同样也移除了托盘图标栏功能。
|
||||
|
||||
怎么说,你总得知道托盘图标栏是什么吧?这些小图标允许你使用相应应用程序的附加功能。我自己的 Ubuntu 系统里就有许多托盘图标。
|
||||
|
||||
![托盘图标栏][2]
|
||||
|
||||
这一砍就砍出了大问题,尤其是针对那些完全依赖托盘图标的软件的致命打击。就拿 [Dropbox][3] 举例子吧,你只能通过 Dropbox 的托盘图标菜单来访问 Dropbox 的设置页面,很不幸,你在 GNOME 中就完全找不到这个图标。
|
||||
|
||||
这确实是个大问题,好在,我们还是有解决办法的。
|
||||
|
||||
### 借助插件来重新启用 GNOME 的托盘图标栏
|
||||
|
||||
如果你在用 GNOME,想必你已经知道 GNOME 插件是什么了。这些小插件基本上是由热心的独立开发者开发的。
|
||||
|
||||
如果你没有准备好,那么就去 [启用 GNOME 插件][4] 吧。这一步其实非常简单,使用 Chrome 或 Firefox 打开任意一个插件的页面,然后页面会提示你安装浏览器扩展。安装这个扩展,然后就可以启程了。
|
||||
|
||||
![启用 GNOME 插件的浏览器扩展][5]
|
||||
|
||||
现在,有一些可以向顶栏增加托盘图标的 GNOME 插件。在撰写本篇教程的时候,[AppIndicator and KStatusNotifierItem Support][6] 这款插件在 GNOME 的较新版本中已经有良好的开发优化与支持。
|
||||
|
||||
前往插件的页面:
|
||||
|
||||
- [AppIndicator 插件][6]
|
||||
|
||||
在这个页面中,你应该能看到一个开关按钮。点击这个按钮即可安装该插件。
|
||||
|
||||
![][7]
|
||||
|
||||
接下来会有一个弹窗,弹出后请点击“安装”。
|
||||
|
||||
![安装插件][8]
|
||||
|
||||
也许安装插件后,插件不会立即生效。此时,你必须重启 GNOME。在 Xorg 会话中,你只需要按下 `Alt + F2` 并输入 `r` 即可重启 GNOME,但这个操作不支持 Wayland 会话。
|
||||
|
||||
注销当前会话,并且重新登录,此后托盘图标应该就能成功启用了。如果你安装了任何一款带托盘图标的软件,那么你应该可以在顶栏上看见这些图标的身影了。
|
||||
|
||||
于我而言,我已经安装了 Dropbox,因此托盘图标就直接出现在顶栏上了。
|
||||
|
||||
![Dropbox 托盘图标在 GNOME 下可用的截图][9]
|
||||
|
||||
希望这个小技巧能帮助你恢复 GNOME 顶栏中的托盘图标。
|
||||
|
||||
我完全不理解,为什么 GNOME 的开发者会认为把这种实用性极强的功能删除会是个好主意。不过,上帝关上了一扇门,却(通常)会再打开一扇窗。好好享受按你的偏好运作的 GNOME 吧。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/enable-applet-indicator-gnome/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[imgradeone](https://github.com/imgradeone)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/add-new-document-option/
|
||||
[2]: https://itsfoss.com/wp-content/uploads/2021/09/indicator-applet-linux.webp
|
||||
[3]: https://www.dropbox.com
|
||||
[4]: https://itsfoss.com/gnome-shell-extensions/
|
||||
[5]: https://itsfoss.com/wp-content/uploads/2021/09/installing-gnome-extension-add-on-800x355.webp
|
||||
[6]: https://extensions.gnome.org/extension/615/appindicator-support/
|
||||
[7]: https://itsfoss.com/wp-content/uploads/2021/09/appindicator-extension-800x329.webp
|
||||
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/installing-appindicator-extension.png?resize=800%2C269&ssl=1
|
||||
[9]: https://itsfoss.com/wp-content/uploads/2021/09/gnome-dropbox-indicator-800x561.webp
|
@ -0,0 +1,77 @@
|
||||
[#]: subject: "Resize an image from the Linux terminal"
|
||||
[#]: via: "https://opensource.com/article/21/9/resize-image-linux"
|
||||
[#]: author: "Jim Hall https://opensource.com/users/jim-hall"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-13779-1.html"
|
||||
|
||||
在 Linux 终端调整图像的大小
|
||||
======
|
||||
|
||||
> 用 ImageMagick 的转换命令从你的终端缩放一张图像。
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202109/12/235041ohsppv1hg1m26y1m.jpg)
|
||||
|
||||
ImageMagick 是一个方便的多用途命令行工具,它能满足你所有的图像需求。ImageMagick 支持各种图像类型,包括 JPG 照片和 PNG 图形。
|
||||
|
||||
### 调整图像大小
|
||||
|
||||
我经常在我的 Web 服务器上使用 ImageMagick 来调整图像大小。例如,假设我想在我的个人网站上发一张我的猫的照片。我手机里的照片非常大,大约 4000x3000 像素,有 3.3MB。这对一个网页来说太大了。我使用 ImageMagick 转换工具来改变照片的大小,这样我就可以把它放在我的网页上。ImageMagick 是一套完整的工具,其中最常用的是 `convert` 命令。
|
||||
|
||||
ImageMagick 的 `convert` 命令使用这样的一般语法:
|
||||
|
||||
```
|
||||
convert {input} {actions} {output}
|
||||
```
|
||||
|
||||
要将一张名为 `PXL_20210413_015045733.jpg` 的照片调整到一个更容易管理的 500 像素宽度,请输入:
|
||||
|
||||
```
|
||||
$ convert PXL_20210413_015045733.jpg -resize 500x sleeping-cats.jpg
|
||||
```
|
||||
|
||||
现在新图片的大小只有 65KB。
|
||||
|
||||
![Sleeping cats][2]
|
||||
|
||||
你可以用 `-resize` 选项同时提供宽度和高度尺寸。但是,如果只提供宽度,ImageMagic 就会为你做计算,并通过调整输出图像的高度比例来自动保留长宽比。
|
||||
|
||||
### 在 Linux 上安装 ImageMagick
|
||||
|
||||
在 Linux 上,你可以使用你的包管理器安装 ImageMagick。例如,在 Fedora 或类似系统上:
|
||||
|
||||
```
|
||||
$ sudo dnf install imagemagick
|
||||
```
|
||||
|
||||
在 Debian 和类似系统上:
|
||||
|
||||
```
|
||||
$ sudo apt install imagemagick
|
||||
```
|
||||
|
||||
在 macOS 上,使用 [MacPorts][4] 或 [Homebrew][5]。
|
||||
|
||||
在 Windows 上,使用 [Chocolatey][6] 即可。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/9/resize-image-linux
|
||||
|
||||
作者:[Jim Hall][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/jim-hall
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-photo-camera-blue.png?itok=AsIMZ9ga (Old camera blue)
|
||||
[2]: https://opensource.com/sites/default/files/sleeping-cats.jpg (Sleeping cats)
|
||||
[3]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[4]: https://opensource.com/article/20/11/macports
|
||||
[5]: https://opensource.com/article/20/6/homebrew-mac
|
||||
[6]: https://opensource.com/article/20/3/chocolatey
|
@ -0,0 +1,92 @@
|
||||
[#]: subject: "How to Stop a Program in Linux Terminal"
|
||||
[#]: via: "https://itsfoss.com/stop-program-linux-terminal/"
|
||||
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-13783-1.html"
|
||||
|
||||
如何在 Linux 终端中退出一个程序
|
||||
======
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202109/14/112410p18i9dsj813i1j4p.jpg)
|
||||
|
||||
有趣的是,当你刚接触一些东西时,最简单的事情也会变得复杂。
|
||||
|
||||
有一天,我发现我的朋友搞不清楚如何退出 `top` 命令。他没有中止这个命令,而是关闭了整个终端程序。
|
||||
|
||||
这不仅是不必要的,而且是一件不好的事情。
|
||||
|
||||
### 在 Linux 里中止程序
|
||||
|
||||
在 Linux 中,你可以使用 `Ctrl+C` 键来中止终端中的运行程序。这对 Ubuntu 和其他 Linux 发行版都适用。
|
||||
|
||||
以 `ping` 命令为例。如果你不中止它,它将持续显示结果。
|
||||
|
||||
按住 `Ctrl` 键并同时按下 `C` 键。它向正在运行的程序发送 [SIGINT 信号][1]以强制退出该命令。
|
||||
|
||||
![Stopping a program in the Linux terminal][2]
|
||||
|
||||
你看到 `^C` 了吗?这个插入符号(`^`)代表 `Ctrl`。所以基本上,终端将 `Ctrl+C` 的按键显示为 `^C`。
|
||||
|
||||
`Ctrl+C` 对于那些被设计为持续运行直到被打断的命令非常有效。你觉得你需要取消命令,就用 `Ctrl+C`。
|
||||
|
||||
在一个更复杂的方法中,你可以 [找到进程 ID 并杀死一个正在运行的进程][3]。这是更高级的东西,只有进程在后台或由其他用户运行或在另一个终端窗口运行时使用。
|
||||
|
||||
除此以外,还有一些其他的命令和命令行工具也有自己的退出命令。让我在这里简单地提一下其中的一些。
|
||||
|
||||
#### 如何退出 Vim 编辑器
|
||||
|
||||
[退出 Vim 编辑器][4] 在 Linux 世界里闹出了很多笑话。当你刚接触这个强大的基于命令行的文本编辑器时,是很难搞清楚的。在几种退出 `vim` 的方法中,最常见的是按 `Esc` 键,然后输入冒号(`:`),再输入 `q!` 表示不保存而强制退出,或者 `wq` 表示保存并退出。
|
||||
|
||||
![][5]
|
||||
|
||||
#### 如何退出 Nano 编辑器
|
||||
|
||||
退出 [Nano 编辑器][6]比退出 Vim 要简单一些。为什么?因为 Nano 在底部有快捷方式。如果你是新手,你可能不明白,但至少你下次就能搞清楚了。
|
||||
|
||||
要退出 Nano,按 `Ctrl+X`。它将询问你是否要保存对文件所做的修改。你可以输入你的选择。
|
||||
|
||||
![][7]
|
||||
|
||||
#### 如何退出 less 命令
|
||||
|
||||
`less` 是一个奇妙的命令,它可以让你在不像 `cat` 命令那样杂乱的终端屏幕上进行查看。如果你在 `less` 命令的视图内,使用 `q` 键来退出 `less`。
|
||||
|
||||
#### 如何退出终端
|
||||
|
||||
要退出终端本身,不是关闭终端,而是使用 `Ctrl+D` 键盘快捷键或输入退出命令:
|
||||
|
||||
```
|
||||
exit
|
||||
```
|
||||
|
||||
这实际上是让你从当前的 shell 中退出。当你[在 Ubuntu 或其他发行版中打开一个终端][8],它会运行默认的 shell。当你从这个 shell 退出时,终端也会结束。`Ctrl+D` 是做同样事情的快捷方式,并退出终端。
|
||||
|
||||
我希望你觉得这个快速教程对你有帮助。我强烈建议你学习这些 [Linux 命令技巧][9]。
|
||||
|
||||
有问题或建议?请在下面留下评论。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/stop-program-linux-terminal/
|
||||
|
||||
作者:[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://linuxhandbook.com/sigterm-vs-sigkill/#what-is-sigkill
|
||||
[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/stop-a-program-linux-terminal.png?resize=800%2C373&ssl=1
|
||||
[3]: https://itsfoss.com/how-to-find-the-process-id-of-a-program-and-kill-it-quick-tip/
|
||||
[4]: https://itsfoss.com/how-to-exit-vim/
|
||||
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2017/05/how-to-exit-vim.png?resize=737%2C422&ssl=1
|
||||
[6]: https://itsfoss.com/nano-editor-guide/
|
||||
[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/nano-editor-save-and-exit.png?resize=799%2C503&ssl=1
|
||||
[8]: https://itsfoss.com/open-terminal-ubuntu/
|
||||
[9]: https://itsfoss.com/linux-command-tricks/
|
@ -3,22 +3,22 @@
|
||||
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "anine09"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-13777-1.html"
|
||||
|
||||
使用 Tangram Browser 在 Linux 中运行 Web 应用
|
||||
使用 Tangram 浏览器在 Linux 中运行 Web 应用
|
||||
=======
|
||||
|
||||
_**导语:**Tangram 是一个旨在帮助你在 Linux 中运行和管理 Web 应用的浏览器_。_一起来看看它是如何使用的吧。_
|
||||
> Tangram 是一个旨在帮助你在 Linux 中运行和管理 Web 应用的浏览器。一起来看看它是如何使用的吧。
|
||||
|
||||
即使我们有许多本地的工具类 Linux 本地应用,但是许多人最终还是选择使用 Web 应用。
|
||||
对于一些工具来说,即使我们有许多 Linux 原生应用,但是许多人最终还是选择使用 Web 应用。
|
||||
|
||||
他们也许是使用 Electron 构建的应用或是直接在浏览器中打开网页,使用本地应用正在成为一种比较“传统”的做法。
|
||||
他们也许是使用 Electron 构建的应用,或是直接在浏览器中打开的网页,使用原生应用正在成为一种比较“传统”的做法。
|
||||
|
||||
当然,运行 Web 应用,不管是什么平台,都会占用更多的系统资源。而且,考虑到每一个服务都是基于 Web 端而不是本地,我们就需要一种有效管理 Web 应用的解决方案。
|
||||
当然,不管在什么平台运行 Web 应用都会占用更多的系统资源。而且,考虑到每一个服务都正在提供基于 Web 的方式,而不是原生体验,我们就需要一种有效管理 Web 应用的解决方案。
|
||||
|
||||
因此,我为你介绍一款开源的 Linux 应用,Tangram。
|
||||
一款开源的 Linux 应用 Tangram 或许就是这个解决方案。
|
||||
|
||||
### Tangram:专为 Web 应用设计的浏览器
|
||||
|
||||
@ -26,9 +26,9 @@ _**导语:**Tangram 是一个旨在帮助你在 Linux 中运行和管理 Web
|
||||
|
||||
你可以选择其他 [优秀的浏览器][2] 来运行 Web 应用,但是如果你想完全专注于 Web 应用体验的浏览器,Tangram 是个不错的选择。
|
||||
|
||||
Tangram 的开发者从 GNOME Web,[Franz][3],和 [Rambox][4] 中获得的灵感。
|
||||
Tangram 的开发者从 GNOME Web、[Franz][3] 和 [Rambox][4] 中获得了灵感。
|
||||
|
||||
没有其他花里胡哨的功能, Tangram 能帮助你改变你的用户代理( User Agent )和管理那些你已经登陆的 Web 应用。
|
||||
没有其他花里胡哨的功能,只是能更改你的<ruby>用户代理<rt>User Agent</rt></ruby>和管理你所登录的 Web 应用。
|
||||
|
||||
它可以用于访问多个社交媒体,聊天工具,工作协同应用等等。
|
||||
|
||||
@ -36,16 +36,15 @@ Tangram 的开发者从 GNOME Web,[Franz][3],和 [Rambox][4] 中获得的
|
||||
|
||||
![][5]
|
||||
|
||||
考虑到 Tangram 是基于 WebKitGTK 的精简化浏览器,它拥有的功能不算很多,下面是一些功能要点:
|
||||
考虑到 Tangram 是一个基于 WebKitGTK 的精简化浏览器,它拥有的功能不算很多,下面是一些功能要点:
|
||||
|
||||
* 重新排列的侧边栏选项卡
|
||||
* 方便地添加任何一个 Web 服务作为一个 Web 应用程序
|
||||
* 在桌面端和移动端调整用户代理(User Agent)
|
||||
* 重新排列侧边栏的标签
|
||||
* 方便地将任何一个 Web 服务添加为 Web 应用程序
|
||||
* 调整用户代理(桌面端和移动端)
|
||||
* 使用键盘快捷键
|
||||
* 改变侧边栏和选项卡的位置
|
||||
* 改变侧边栏(标签栏)的位置
|
||||
|
||||
|
||||
你所需要做的就是加载一个 Web 服务,登陆,然后点击**“完成”**,将其添加为 Web 应用程序。
|
||||
你所需要做的就是加载一个 Web 服务,登录,然后点击“完成”,将其添加为 Web 应用程序。
|
||||
|
||||
![][6]
|
||||
|
||||
@ -63,9 +62,9 @@ flatpak install flathub re.sonny.Tangram
|
||||
|
||||
想要了解更多信息,请访问 [Tangram 的 Github 页面][9]。
|
||||
|
||||
[Tangram Browser][10]
|
||||
- [Tangram Browser][10]
|
||||
|
||||
你试过 Tangram 吗?你更喜欢 Web 应用还是本地应用?欢迎在下面的评论中分享你的想法。
|
||||
你试过 Tangram 吗?你更喜欢 Web 应用还是原生应用?欢迎在下面的评论中分享你的想法。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -74,7 +73,7 @@ via: https://itsfoss.com/tangram/
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[anine09](https://github.com/anine09)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -0,0 +1,127 @@
|
||||
[#]: subject: "How to Use the dd Command to Create a Live USB Drive in Linux Terminal [For Experts and Adventurers]"
|
||||
[#]: via: "https://itsfoss.com/live-usb-with-dd-command/"
|
||||
[#]: author: "Hunter Wittenborn https://itsfoss.com/author/hunter/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "perfiffer"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-13787-1.html"
|
||||
|
||||
怎样在 Linux 终端下使用 dd 命令创建一个临场 USB 驱动器
|
||||
======
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202109/15/104940ucajv4o4zb8934ll.jpg)
|
||||
|
||||
有很多的图形化工具可以用来创建<ruby>临场<rt>live</rt></ruby> USB 驱动器。Linux 上的 [Etcher][1] 可能是最受欢迎的。为此,Ubuntu 也开发了自己的启动盘创建工具。
|
||||
|
||||
但是,资深 Linux 用户可能更喜欢使用 `dd` 命令在 Linux 终端中创建临场 USB,这会更快速便捷。
|
||||
|
||||
`dd` 命令是一个 [命令行][2] 工具,它提供了用来复制和转换文件的强大功能。
|
||||
|
||||
一个常见的使用示例是,用户使用 `dd` 命令将 ISO 文件写入到他们的外部存储设备(例如 USB 驱动盘),以用来给他们的电脑或者笔记本安装一个新的 Linux 发行版。
|
||||
|
||||
这就是我将在本教程中展示的内容。我将带你认识需要的命令,从终端找到我们的 USB 驱动器,然后对 ISO 文件进行实际刷写。
|
||||
|
||||
### 使用 dd 命令从 ISO 镜像创建临场 USB
|
||||
|
||||
在我向你展示步骤前,让我带你快速过一下你将要使用到的命令并解释它的作用。
|
||||
|
||||
这是一个使用命令刷写 ISO 的例子:
|
||||
|
||||
```
|
||||
dd if="./filename.iso" of="/dev/sdb" status="progress" conv="fsync"
|
||||
```
|
||||
|
||||
让我们来看看 [dd 命令][3] 实际都做了些什么。
|
||||
|
||||
#### 理解 dd 命令
|
||||
|
||||
![Explanation of the dd command for live USB creation][4]
|
||||
|
||||
首先,你输入 `dd`。没错,这就是你要运行的程序的名称。
|
||||
|
||||
接下来,你指定 `if="./filename.iso"`。`if` 代表<ruby>输入文件<rt>input file</rt></ruby>,告诉 `dd` 命令你将要向外部存储设备写入哪个文件。
|
||||
|
||||
之后,你输入 `of="/dev/sdb"`。和 `if` 一样,`of` 代表的是<ruby>输出文件<rt>output file</rt></ruby>。
|
||||
|
||||
要记住的是,输出文件在技术上不必是系统上的文件。你还可以指定诸如外部设备路径之类的内容(如示例所示),它看起来像系统上的普通文件,但实际上指向连接到你机器的设备。
|
||||
|
||||
`status` 可以设定为 3 个选项:`none`、`noxfer` 和 `progress`。
|
||||
|
||||
- 你设置的 `progress` 选项将使 `dd` 任务显示有关已将多少 ISO 文件传输到存储驱动器的定期统计信息,以及对 `dd` 任务完成前需要多长时间的估计。
|
||||
- 如果你改为设置 `none` 选项,`dd` 任务在写入 ISO 文件期间只会打印错误消息,并且删除进度条之类的内容。
|
||||
- `noxfer` 选项隐藏了传输完成后打印的一些信息,例如从开始到完成所用的时间。
|
||||
|
||||
最后,你将 `conv` 选项设置为 `fsync`。这会导致 `dd` 任务在整个 ISO 文件写入 USB 驱动器之前不会报告成功写入。
|
||||
|
||||
如果你省略这个选项,`dd` 任务会工作的很好(并且实际上可能看起来运行得更快),但你可能会发现你的系统需要很长时间才能告诉你移除 USB 驱动器是安全的,因为它会在后台完成 ISO 的内容写入,从而允许你在此期间做其它事情。
|
||||
|
||||
**现在你明白了你必须做什么,让我们看看如何去做。**
|
||||
|
||||
> **注意事项**
|
||||
>
|
||||
> 命令行是把双刃剑。当你在命令行使用类似于 `dd` 命令时必须十分小心。你必须确保你目标输出文件是正确的设备。一个错误的步骤就可能会格式化你的系统硬盘,你的操作系统也会因此而损坏。
|
||||
|
||||
#### 第 0 步: 下载所需的 ISO 镜像
|
||||
|
||||
不用说,你需要有一个 ISO 镜像文件才能将其刷写到 USB 上。
|
||||
|
||||
我将使用 Ubuntu 20.04 ISO(可在此处[下载][5])来测试我之前介绍的 `dd` 命令。
|
||||
|
||||
#### 第 1 步: 获取 USB 盘符
|
||||
|
||||
插入你的 USB 驱动器。
|
||||
|
||||
我为 `of` 参数输入的具体路径是 `/dev/sdb`。USB 磁盘通常会标记为 `/dev/sdb`,但这不是硬性规定。
|
||||
|
||||
此路径可能因你的系统而异,你可以使用 `lsblk` 命令确认 USB 磁盘的路径。只需从列表中查找一个看起来像你的 USB 磁盘大小的驱动器,就可以了。
|
||||
|
||||
![][6]
|
||||
|
||||
如果你更熟悉 GUI 程序,还可以使用 GNOME Disks 等工具找到驱动器的路径。
|
||||
|
||||
![][7]
|
||||
|
||||
现在你已经确认了外部驱动器的路径,让我们开始创建临场 USB。
|
||||
|
||||
#### 第 2 步:将 ISO 文件写入 USB 磁盘
|
||||
|
||||
在下载 ISO 文件的目录打开一个终端,然后运行以下命令(如果 `/dev/sdb` 与你的存储设备名称不同,请记住将其替换):
|
||||
|
||||
```
|
||||
sudo dd if="./ubuntu-20.04.2.0-desktop-amd64.iso" of="/dev/sdb" status="progress" conv="fsync"
|
||||
```
|
||||
|
||||
之后,让 `dd` 去做剩下的事情,它会在完成后打印一条完成消息:
|
||||
|
||||
![][8]
|
||||
|
||||
就像这样,你已经在 Linux 终端中使用 `dd` 命令刷写了 ISO 文件!
|
||||
|
||||
### 总结
|
||||
|
||||
现在,你可以通过终端做更多的事情,让你的工作效率大大提高。
|
||||
|
||||
对 `dd` 命令有任何没解决的问题,或者无法正常工作?请随时在下面的评论部分中留下你的问题。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/live-usb-with-dd-command/
|
||||
|
||||
作者:[Hunter Wittenborn][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[perfiffer](https://github.com/perfiffer)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/hunter/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/install-etcher-linux/
|
||||
[2]: https://itsfoss.com/gui-cli-tui/
|
||||
[3]: https://linuxhandbook.com/dd-command/
|
||||
[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/dd-command-for-live-usb-creation.png?resize=800%2C450&ssl=1
|
||||
[5]: https://ubuntu.com/download/desktop/thank-you?version=20.04.2.0&architecture=amd64
|
||||
[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/dd_disks.png?resize=753%2C264&ssl=1
|
||||
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/dd_gnome_disks.png?resize=800%2C440&ssl=1
|
||||
[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/dd-iso-write.png?resize=800%2C322&ssl=1
|
@ -0,0 +1,79 @@
|
||||
[#]: subject: "Adobe Kills Brackets Code Editor & Suggests Using Visual Studio Code"
|
||||
[#]: via: "https://news.itsfoss.com/adobe-kills-brackets-editor/"
|
||||
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "wxy"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-13782-1.html"
|
||||
|
||||
Adobe 终止支持 Brackets,并建议使用 VS Code 替代
|
||||
======
|
||||
|
||||
> Adobe 结束了对 Brackets 代码编辑器的支持,坚持让用户迁移到微软的 Visual Studio Code。不过,还好总还算是留下了一个复刻。
|
||||
|
||||
![](https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/adobe-bracket-visual-studio.jpg?w=1200&ssl=1)
|
||||
|
||||
Brackets 是一个令人印象深刻的现代开源代码编辑器,可用于 Windows、macOS 和 Linux。
|
||||
|
||||
Adobe 以一个社区引导的项目的形式创建了它,来帮助 Web 开发者。我们之前把它列为 [可供编程人员使用的最佳现代文本编辑器][1] 之一。
|
||||
|
||||
不幸的是,Adobe 在 2021 年 9 月 1 日结束了对 Brackets 的支持。
|
||||
|
||||
### 为什么 Adobe 停用了 Brackets?
|
||||
|
||||
![][2]
|
||||
|
||||
看起来可能是 Adobe 与微软的合作关系促使他们拔掉了这个社区项目的插头。
|
||||
|
||||
因此,他们建议用户迁移到微软的 Visual Studio Code 编辑器。
|
||||
|
||||
![][3]
|
||||
|
||||
这是 Brackets 项目中止后 GitHub 的原始页面上的内容。
|
||||
|
||||
### Visual Studio Code 作为 Brackets 的替代品
|
||||
|
||||
当然,微软的 Visual Studio Code 是一个很好的替代品,而且建立在开源的基础上。然而,当你从他们的网站上下载 Visual Studio Code 时,它并不在一个促进自由和开源软件的许可证之下。
|
||||
|
||||
因此,你可能不得不从源代码构建,或者尝试 [VSCodium][4],这是一个没有遥测/跟踪功能的 Visual Studio Code 的自由许可版本。
|
||||
|
||||
另外,有一个 [关于从 Brackets 迁移的官方指南][5],如果你感兴趣,可以去看看。
|
||||
|
||||
### Brackets 将继续以没有 Adobe 的复刻出现
|
||||
|
||||
![][6]
|
||||
|
||||
尽管 Adobe 已经停止了这个项目,但 [原网站][7] 仍然存在,以维持这个项目的复刻。
|
||||
|
||||
该项目名称可能会改变,但从目前来看,它叫 “Brackets Continued”,以帮助用户识别该复刻。
|
||||
|
||||
请注意,这个复刻项目还没有发布,我们也不知道它是否会作为一个独立的项目继续下去。
|
||||
|
||||
所以,如果你想帮助 Brackets 复刻,并以某种方式帮助维护它,请前往其 GitHub 页面了解更多细节。
|
||||
|
||||
- [Brackets Continued(复刻)][8]
|
||||
|
||||
你喜欢用什么作为你的代码编辑器?你喜欢用 Brackets 代码编辑器进行 Web 开发工作吗?欢迎在评论中分享你的想法。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/adobe-kills-brackets-editor/
|
||||
|
||||
作者:[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-modern-open-source-code-editors-for-linux/
|
||||
[2]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/brackets-screenshot.png?w=800&ssl=1
|
||||
[3]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/adobe-brackets-github.png?w=964&ssl=1
|
||||
[4]: https://vscodium.com
|
||||
[5]: https://code.visualstudio.com/migrate-from-brackets
|
||||
[6]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/brackets-fork.png?w=1511&ssl=1
|
||||
[7]: https://brackets.io
|
||||
[8]: https://github.com/brackets-cont/brackets
|
@ -0,0 +1,253 @@
|
||||
[#]: subject: "Quadratic algorithms are slow (and hashmaps are fast)"
|
||||
[#]: via: "https://jvns.ca/blog/2021/09/10/hashmaps-make-things-fast/"
|
||||
[#]: author: "Julia Evans https://jvns.ca/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "unigeorge"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-13786-1.html"
|
||||
|
||||
浅谈慢速的二次算法与快速的 hashmap
|
||||
======
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202109/15/094524s7dlcq74ksqazyyc.jpg)
|
||||
|
||||
大家好!昨天我与一位朋友聊天,他正在准备编程面试,并试图学习一些算法基础知识。
|
||||
|
||||
我们聊到了<ruby>二次时间<rt>quadratic-time</rt></ruby>与<ruby>线性时间<rt>linear-time</rt></ruby>算法的话题,我认为在这里写这篇文章会很有趣,因为避免二次时间算法不仅在面试中很重要——有时在现实生活中了解一下也是很好的!后面我会快速解释一下什么是“二次时间算法” :)
|
||||
|
||||
以下是我们将要讨论的 3 件事:
|
||||
|
||||
1. 二次时间函数比线性时间函数慢得非常非常多
|
||||
2. 有时可以通过使用 hashmap 把二次算法变成线性算法
|
||||
3. 这是因为 hashmap 查找非常快(即时查询!)
|
||||
|
||||
我会尽量避免使用数学术语,重点关注真实的代码示例以及它们到底有多快/多慢。
|
||||
|
||||
### 目标问题:取两个列表的交集
|
||||
|
||||
我们来讨论一个简单的面试式问题:获取 2 个数字列表的交集。 例如,`intersect([1,2,3], [2,4,5])` 应该返回 `[2]`。
|
||||
|
||||
这个问题也是有些现实应用的——你可以假设有一个真实程序,其需求正是取两个 ID 列表的交集。
|
||||
|
||||
### “显而易见”的解决方案:
|
||||
|
||||
我们来写一些获取 2 个列表交集的代码。下面是一个实现此需求的程序,命名为 `quadratic.py`。
|
||||
|
||||
```
|
||||
import sys
|
||||
|
||||
# 实际运行的代码
|
||||
def intersection(list1, list2):
|
||||
result = []
|
||||
for x in list1:
|
||||
for y in list2:
|
||||
if x == y:
|
||||
result.append(y)
|
||||
return result
|
||||
|
||||
# 一些样板,便于我们从命令行运行程序,处理不同大小的列表
|
||||
def run(n):
|
||||
# 定义两个有 n+1 个元素的列表
|
||||
list1 = list(range(3, n)) + [2]
|
||||
list2 = list(range(n+1, 2*n)) + [2]
|
||||
# 取其交集并输出结果
|
||||
print(list(intersection(list1, list2)))
|
||||
|
||||
# 使用第一个命令行参数作为输入,运行程序
|
||||
run(int(sys.argv[1]))
|
||||
```
|
||||
|
||||
程序名为 `quadratic.py`(LCTT 译注:“quadratic”意为“二次方的”)的原因是:如果 `list1` 和 `list2` 的大小为 `n`,那么内层循环(`if x == y`)会运行 `n^2` 次。在数学中,像 `x^2` 这样的函数就称为“二次”函数。
|
||||
|
||||
### `quadratic.py` 有多慢?
|
||||
|
||||
用一些不同长度的列表来运行这个程序,两个列表的交集总是相同的:`[2]`。
|
||||
|
||||
```
|
||||
$ time python3 quadratic.py 10
|
||||
[2]
|
||||
|
||||
real 0m0.037s
|
||||
$ time python3 quadratic.py 100
|
||||
[2]
|
||||
|
||||
real 0m0.053s
|
||||
$ time python3 quadratic.py 1000
|
||||
[2]
|
||||
|
||||
real 0m0.051s
|
||||
$ time python3 quadratic.py 10000 # 10,000
|
||||
[2]
|
||||
|
||||
real 0m1.661s
|
||||
```
|
||||
|
||||
到目前为止,一切都还不错——程序仍然只花费不到 2 秒的时间。
|
||||
|
||||
然后运行该程序处理两个包含 100,000 个元素的列表,我不得不等待了很长时间。结果如下:
|
||||
|
||||
```
|
||||
$ time python3 quadratic.py 100000 # 100,000
|
||||
[2]
|
||||
|
||||
real 2m41.059s
|
||||
```
|
||||
|
||||
这可以说相当慢了!总共花费了 160 秒,几乎是在 10,000 个元素上运行时(1.6 秒)的 100 倍。所以我们可以看到,在某个点之后,每次我们将列表扩大 10 倍,程序运行的时间就会增加大约 100 倍。
|
||||
|
||||
我没有尝试在 1,000,000 个元素上运行这个程序,因为我知道它会花费又 100 倍的时间——可能大约需要 3 个小时。我没时间这样做!
|
||||
|
||||
你现在大概明白了为什么二次时间算法会成为一个问题——即使是这个非常简单的程序也会很快变得非常缓慢。
|
||||
|
||||
### 快速版:`linear.py`
|
||||
|
||||
好,接下来我们编写一个快速版的程序。我先给你看看程序的样子,然后再分析。
|
||||
|
||||
```
|
||||
import sys
|
||||
|
||||
# 实际执行的算法
|
||||
def intersection(list1, list2):
|
||||
set1 = set(list1) # this is a hash set
|
||||
result = []
|
||||
for y in list2:
|
||||
if y in set1:
|
||||
result.append(y)
|
||||
return result
|
||||
|
||||
# 一些样板,便于我们从命令行运行程序,处理不同大小的列表
|
||||
def run(n):
|
||||
# 定义两个有 n+1 个元素的列表
|
||||
list1 = range(3, n) + [2]
|
||||
list2 = range(n+1, 2*n) + [2]
|
||||
# 输出交集结果
|
||||
print(intersection(list1, list2))
|
||||
|
||||
run(int(sys.argv[1]))
|
||||
```
|
||||
|
||||
(这不是最惯用的 Python 使用方式,但我想在尽量避免使用太多 Python 思想的前提下编写代码,以便不了解 Python 的人能够更容易理解)
|
||||
|
||||
这里我们做了两件与慢速版程序不同的事:
|
||||
|
||||
1. 将 `list1` 转换成名为 `set1` 的 set 集合
|
||||
2. 只使用一个 for 循环而不是两个
|
||||
|
||||
### 看看 `linear.py` 程序有多快
|
||||
|
||||
在讨论 _为什么_ 这个程序快之前,我们先在一些大型列表上运行该程序,以此证明它确实是很快的。此处演示该程序依次在大小为 10 到 10,000,000 的列表上运行的过程。(请记住,我们上一个的程序在 100,000 个元素上运行时开始变得非常非常慢)
|
||||
|
||||
```
|
||||
$ time python3 linear.py 100
|
||||
[2]
|
||||
|
||||
real 0m0.056s
|
||||
$ time python3 linear.py 1000
|
||||
[2]
|
||||
|
||||
real 0m0.036s
|
||||
$ time python3 linear.py 10000 # 10,000
|
||||
[2]
|
||||
|
||||
real 0m0.028s
|
||||
$ time python3 linear.py 100000 # 100,000
|
||||
[2]
|
||||
|
||||
real 0m0.048s <-- quadratic.py took 2 minutes in this case! we're doing it in 0.04 seconds now!!! so fast!
|
||||
$ time python3 linear.py 1000000 # 1,000,000
|
||||
[2]
|
||||
|
||||
real 0m0.178s
|
||||
$ time python3 linear.py 10000000 # 10,000,000
|
||||
[2]
|
||||
|
||||
real 0m1.560s
|
||||
```
|
||||
|
||||
### 在极大型列表上运行 `linear.py`
|
||||
|
||||
如果我们试着在一个非常非常大的列表(100 亿 / 10,000,000,000 个元素)上运行它,那么实际上会遇到另一个问题:它足够 _快_ 了(该列表仅比花费 4.2 秒的列表大 100 倍,因此我们大概应该能在不超过 420 秒的时间内完成),但我的计算机没有足够的内存来存储列表的所有元素,因此程序在运行结束之前崩溃了。
|
||||
|
||||
```
|
||||
$ time python3 linear.py 10000000000
|
||||
Traceback (most recent call last):
|
||||
File "/home/bork/work/homepage/linear.py", line 18, in <module>
|
||||
run(int(sys.argv[1]))
|
||||
File "/home/bork/work/homepage/linear.py", line 13, in run
|
||||
list1 = [1] * n + [2]
|
||||
MemoryError
|
||||
|
||||
real 0m0.090s
|
||||
user 0m0.034s
|
||||
sys 0m0.018s
|
||||
```
|
||||
|
||||
不过本文不讨论内存使用,所以我们可以忽略这个问题。
|
||||
|
||||
### 那么,为什么 `linear.py` 很快呢?
|
||||
|
||||
现在我将试着解释为什么 `linear.py` 很快。
|
||||
|
||||
再看一下我们的代码:
|
||||
|
||||
```
|
||||
def intersection(list1, list2):
|
||||
set1 = set(list1) # this is a hash set
|
||||
result = []
|
||||
for y in list2:
|
||||
if y in set1:
|
||||
result.append(y)
|
||||
return result
|
||||
```
|
||||
|
||||
假设 `list1` 和 `list2` 都是大约 10,000,000 个不同元素的列表,这样的元素数量可以说是很大了!
|
||||
|
||||
那么为什么它还能够运行得如此之快呢?因为 hashmap!!!
|
||||
|
||||
### hashmap 查找是即时的(“常数级时间”)
|
||||
|
||||
我们看一下快速版程序中的 `if` 语句:
|
||||
|
||||
```
|
||||
if y in set1:
|
||||
result.append(y)
|
||||
```
|
||||
|
||||
你可能会认为如果 `set1` 包含 1000 万个元素,那么这个查找——`if y in set1` 会比 `set1` 包含 1000 个元素时慢。但事实并非如此!无论 `set1` 有多大,所需时间基本是相同的(超级快)。
|
||||
|
||||
这是因为 `set1` 是一个哈希集合,它是一种只有键没有值的 hashmap(hashtable)结构。
|
||||
|
||||
我不准备在本文中解释 _为什么_ hashmap 查找是即时的,但是神奇的 Vaidehi Joshi 的 [basecs][1] 系列中有关于 [hash table][2] 和 [hash 函数][3] 的解释,其中讨论了 hashmap 即时查找的原因。
|
||||
|
||||
### 不经意的二次方:现实中的二次算法!
|
||||
|
||||
二次时间算法真的很慢,我们看到的的这个问题实际上在现实中也会遇到——Nelson Elhage 有一个很棒的博客,名为 [不经意的二次方][4],其中有关于不经意以二次时间算法运行代码导致性能问题的故事。
|
||||
|
||||
### 二次时间算法可能会“偷袭”你
|
||||
|
||||
关于二次时间算法的奇怪之处在于,当你在少量元素(如 1000)上运行它们时,它看起来并没有那么糟糕!没那么慢!但是如果你给它 1,000,000 个元素,它真的会花费几个小时去运行。
|
||||
|
||||
所以我认为它还是值得深入了解的,这样你就可以避免无意中使用二次时间算法,特别是当有一种简单的方法来编写线性时间算法(例如使用 hashmap)时。
|
||||
|
||||
### 总是让我感到一丝神奇的 hashmap
|
||||
|
||||
hashmap 当然不是魔法(你可以学习一下为什么 hashmap 查找是即时的!真的很酷!),但它总是让人 _感觉_ 有点神奇,每次我在程序中使用 hashmap 来加速,都会使我感到开心 :)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://jvns.ca/blog/2021/09/10/hashmaps-make-things-fast/
|
||||
|
||||
作者:[Julia Evans][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://jvns.ca/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://medium.com/basecs
|
||||
[2]: https://medium.com/basecs/taking-hash-tables-off-the-shelf-139cbf4752f0
|
||||
[3]: https://medium.com/basecs/hashing-out-hash-functions-ea5dd8beb4dd
|
||||
[4]: https://accidentallyquadratic.tumblr.com/
|
@ -0,0 +1,84 @@
|
||||
[#]: subject: "Here’s Why Firefox is Seeing a Continuous Decline for Last 12 Years"
|
||||
[#]: via: "https://news.itsfoss.com/firefox-continuous-decline/"
|
||||
[#]: author: "Community https://news.itsfoss.com/author/team/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "wxy"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-13780-1.html"
|
||||
|
||||
Firefox 在过去 12 年里损失了 5 亿用户及其 75% 份额的原因
|
||||
======
|
||||
|
||||
> 一位有四十年编程经验的老程序员表达了他对 Firefox 浏览器为何逐渐衰退的看法。
|
||||
|
||||
![](https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/decline.png?w=1200&ssl=1)
|
||||
|
||||
最近有很多关于 Firefox 浏览器衰落的讨论,还有很多讨论 [它在过去两年里失去了 5000 万用户][1] 的文章。
|
||||
|
||||
但是 **实际上它的衰落已经有 12 年之久了,总共损失了 5 亿用户和它曾经拥有的市场份额的 75%**。
|
||||
|
||||
这一切都开始于 2009 年第三季度,其致命的决定是强迫……
|
||||
|
||||
### 顶部标签
|
||||
|
||||
自从 [做了这个决定][2],Firefox 就开始丢失市场份额。PC 上的所有程序都使用针对活动窗口的标签。如微软 Office 和 Adobe 这样的专有软件,如 GIMP、3D 设计、视频编辑器、十六进制编辑器这样的 FOSS 软件,你能想的的种种软件都是这样的,这是标准的、合乎逻辑的设计。
|
||||
|
||||
然后,谷歌决定将标签放在其 Chrome 浏览器的顶部,该浏览器是为移动设备而非台式机设计的。在智能手机上,这可能是有意义的,因为没有空间来容纳一个完整的桌面风格的菜单布局。但在桌面上,它是反直觉的,并且会破坏与所有其他程序的工作流程。台式机的代码与手机不同,所以没有合理的理由试图将移动用户界面强加给台式机用户,而台式机是 Firefox 的主要用户群。在一个 400 万行的代码库中,由两行代码所制定的单一设置“太难维护”的论点,只是在侮辱用户的智商。代码不是草坪,如果你几周不管它,它也不会改变。
|
||||
|
||||
当用户对这一变化的投诉蜂拥而至时,我从一位不愿透露姓名的主要开发者那里得到的回应是:“我们有数亿用户。5000 人的抱怨并不代表大多数的用户。”这些投诉有一个共同的观点:“如果我想让我的浏览器看起来像 Chrome,我就会使用 Chrome。”于是他们就这么做了。
|
||||
|
||||
### 不断删除“没人使用”的功能
|
||||
|
||||
对 Firefox 所做的每项改动都是一样的做法。默认功能被改变了,但有一个菜单设置可以恢复它。然后菜单设置被删除,你只能通过`about:config` 来改变它。再然后,`about:config` 选项也被删除了。用户群的每一次抗议都得到了同样的回应:“你只是极少数人,大多数人喜欢这种改变。”
|
||||
|
||||
75% 并不是少数人。几乎每个人都讨厌这些变化,每一次变化都会把更多的用户赶走,而 Mozilla 工作人员傲慢的、居高临下的回应让用户们有苦难言,让他们再也不想回来了。仔细观察,你可以看到每次删除一些功能,用户数量都有明显的下降,只有在第三方组件或 CSS 恢复了这些变化时才会稳定下来。一次又一次,年复一年。他们没有学到任何教训。
|
||||
|
||||
光是移除设置还不够。Firefox 继续阉割附加组件和主题,强迫集中签名,并最终废除了 XUL,而没有足够的 Web 扩展 API 来替代失去的功能。在抱怨这一变化时,我再次与一位主要开发者(同一个人)交谈。他的回答是(原话)“人们并不是因为附加组件而使用 Firefox 的。我们的遥测显示 80% 的用户从未安装过任何附加组件。”也就是说,任何懂技术的人都会立即关闭遥测,因为他们不想让浏览器监视他们,对此我们也曾无数次抱怨过。
|
||||
|
||||
即使是他们在用户界面设计方面的一项重大举措,即可拖放定制的 Australis 界面,也因为可怕的默认布局和缺乏不需要 CSS 的选项而疏远了更多用户。难看的斜角标签(抄袭自 Chrome)是 Mozilla 唯一承认糟糕的用户界面变化,而且令人惊讶的是,他们只是在 Chrome 取消了斜角标签 **之后** 才这样做。
|
||||
|
||||
时至今日,Mozilla 仍然声称要听取用户的意见,但 12 年后,他们仍然无视我们,难看的默认 Proton 用户界面是最新强加给不情愿的用户群的愚蠢选择。(如果你认为我属于少数的话,可以在谷歌上输入 “Firefox Proton” 来查看最常搜索的建议。)幸运的是,它仍然可以用 `userChrome.css` 来大致修复,但即使是我,也已经厌倦了必须反复修补新的代码来跟上不断的弃用和格式变化。
|
||||
|
||||
### 糟糕的编码范式
|
||||
|
||||
Mozilla 的源代码是一场噩梦。例如,默认配置文件的位置被定义了 3 次,使用了 3 种不同的语言的不同的变量,其中之一是由位于不同文件中的多个变量组合生成的。我看到的另外一个例子是在 6 个不同的文件中定义的另一个全局变量。
|
||||
|
||||
在编译后,下载历史、访问过的网页、书签等等,都被一起塞进了乱七八糟的文件中。最终的结果是什么?试着从你的历史记录中删除 400 个条目,看看它需要多长时间。而从一个单独的文本文件中删除这么多行,只需要一瞬间。想改变一个图标的外观或为自定义搜索添加一个新的图标?它们大多只是 PNG,但它们被混淆并被封入 `omni.ja` 文件。本来可以用你选择的编辑器在几秒钟内改变,但你需要安装和学习 Eclipse 之类的程序,并在每次更改时重新编译文件。这样的例子不胜枚举。
|
||||
|
||||
难怪 Mozilla 的码农在寻找和修复错误方面这么困难。这导致了更糟糕的编码范式,为了修复错误而记录一切。它部分导致了...
|
||||
|
||||
### 糟糕的内存管理
|
||||
|
||||
如果一个程序坐在那里什么都不做,它的内存使用量不应该改变。看看我的内存管理器,我有 40 个进程在遵守这个原则。尽管什么都不做,却不断地读写磁盘的唯一程序是什么?Firefox。它正在运行 13 个进程,所有这些进程都在不断地做这两件事。我写了 40 年的代码,造了 30 年的电脑,所以我确实了解一点计算机如何工作的事情。这就是基础层面上的糟糕设计,在表面上做再多的修补也无济于事。
|
||||
|
||||
代码范式是 Mozilla 性能问题的根源,他们不会解决这个问题。我敢打赌,这也是 FirefoxOS 失败的原因,它是一个伟大的想法,但由于执行不力和编码实践问题,导致太多的错误无法修复而失败。
|
||||
### 在告诉我们“我们重视你的隐私”的同时,侵犯了你的隐私
|
||||
|
||||
就是遥测。当你点击“禁用遥测”时,隐藏的遥测并没有被禁用。首次运行也要发出遥测信号。强制签署附加组件。无法关闭的自动更新,每 10 分钟发出一次信号。需要单独选择退出的“实验”。现在最新的问题是,只是为了制作一个自定义的主题,就强制使用基于 2FA 的应用以登录到 Firefox 插件帐户,如果不是强制签署附加组件,根本就不需要。
|
||||
|
||||
Mozilla 对用户隐私的尊重和对我们意见的尊重一样少。
|
||||
|
||||
### 总结
|
||||
|
||||
事情不一定是这样的。虽然还没有,但是不能承认自己的错误,也不考虑不同的意见的人,注定要停滞不前,走向衰败。Mozilla 的决策者似乎就是这样想的,所以我对未来不抱什么希望。希望你们中的一些人至少能从他们的错误中学习,在他们失败的地方取得成功。通过为用户提供他们想要的东西,而不是告诉他们应该想要什么来取得成功。通过提供市场上缺少的东西,而不是盲目地试图复制你的竞争对手。
|
||||
|
||||
*本文所表达的观点和意见仅代表作者本人,不一定反映本站和 It's FOSS 的官方政策或立场。*
|
||||
|
||||
> 作者信息:Dan 来自澳大利亚墨尔本,已经有大约 40 年的编码经验,做了 25 年的平面设计。他还从事基于 3D 打印机套件的开源机械设计。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/firefox-continuous-decline/
|
||||
|
||||
作者:[Community][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/team/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://news.itsfoss.com/firefox-decline/
|
||||
[2]: https://www.wired.com/2009/07/mozilla-considers-copying-chrome-for-firefox-4dot0/
|
@ -24,9 +24,9 @@ rule_bypass_check() {
|
||||
[ -f /tmp/bypass ] && echo "匹配规则:绕过检查"
|
||||
}
|
||||
|
||||
# 添加原文:添加至少一篇原文
|
||||
# 添加原文:只能添加一篇原文
|
||||
rule_source_added() {
|
||||
[ "$SRC_A" -ge 1 ] \
|
||||
[ "$SRC_A" -eq 1 ] \
|
||||
&& check_category SRC A \
|
||||
&& [ "$TOTAL" -eq "$SRC_A" ] && echo "匹配规则:添加原文 ${SRC_A} 篇"
|
||||
}
|
||||
|
@ -1,94 +0,0 @@
|
||||
[#]: subject: (PDF Mix Tool 1.0.1 Now Lets You Edit Metadata with an Improved UI & Qt 6 Support)
|
||||
[#]: via: (https://news.itsfoss.com/pdf-mix-tool-1-0-1-release/)
|
||||
[#]: author: (Omar Maarof https://news.itsfoss.com/author/omar/)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
PDF Mix Tool 1.0.1 Now Lets You Edit Metadata with an Improved UI & Qt 6 Support
|
||||
======
|
||||
|
||||
[PDF Mix Tool][1] is one of the [best PDF editors for Linux][2] and an alternative to [PDF Arranger][3].
|
||||
It is a neat and simple GUI tool for manipulating pdf files and allows you to modify your files (rotating, splitting, extracting from files), not their content, however.
|
||||
|
||||
Although this application does not come with a lot of tools, it provides a concise toolset so you can manipulate your documents.
|
||||
|
||||
After a year of no new releases, the developer is back with another release (1.0.1) with some significant improvements.
|
||||
|
||||
Let us discover what features this release has to offer.
|
||||
|
||||
### Improved User Interface (UI)
|
||||
|
||||
There is now a left sidebar containing icons for all the operations you might need to perform. Each one of the icons has a respective function and its name below it.
|
||||
|
||||
![][4]
|
||||
|
||||
This is not a big makeover but helps enhancing the user experience, which should be the focus for a useful tool like PDF Mix Tool.
|
||||
|
||||
### PDF Metadata Editing
|
||||
|
||||
![][5]
|
||||
|
||||
You can now modify your document’s title, author, subject, keywords, creator, producer, and creation and modification dates. Thus, you can edit your document’s metadata easily.
|
||||
|
||||
### Support for Qt 6.0
|
||||
|
||||
PDF Mix Tool is written in C++, and it relies on **qpdf** and the **Qt** library to make its magic work. It supports [Qt 6.0][6] now, which will affect the UX positively.
|
||||
|
||||
### Other Improvements
|
||||
|
||||
* PDF Mix Tool now adds right-to-left support in page composition.
|
||||
* Links, annotations, and outlines are preserved as much as possible in all operations.
|
||||
* This version fixed some bugs.
|
||||
|
||||
|
||||
|
||||
You can check out the [official changelog][7] in their GitLab page.
|
||||
|
||||
### Summing Up
|
||||
|
||||
Despite its reputation for being a lightweight, PDF Mix Tool is a handy application that delivers essential capabilities to the user.
|
||||
|
||||
You can get it from [Flathub][8] or [Snap store][9]. For Arch Linux users, you may not find the latest release in the repositories or the [AUR][10]. In either case, you can build it from source that can be found on [GitLab][11].
|
||||
|
||||
You may want to go through our [Flatpak guide][12] or the tutorial for [using Snaps in Linux][13] to get help with installation.
|
||||
|
||||
[Download PDFMixTool][14]
|
||||
|
||||
_What do you think about this release? I’m also curious to know what PDF editor do you happen to use?_
|
||||
|
||||
#### 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/pdf-mix-tool-1-0-1-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]: https://scarpetta.eu/pdfmixtool/
|
||||
[2]: https://itsfoss.com/pdf-editors-linux/
|
||||
[3]: https://news.itsfoss.com/pdf-arranger-1-7-release/
|
||||
[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyMyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU3MiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[6]: https://news.itsfoss.com/qt-6-released/
|
||||
[7]: https://gitlab.com/scarpetta/pdfmixtool/-/blob/master/CHANGELOG.md
|
||||
[8]: https://flathub.org/apps/details/eu.scarpetta.PDFMixTool
|
||||
[9]: https://snapcraft.io/pdfmixtool
|
||||
[10]: https://itsfoss.com/aur-arch-linux/
|
||||
[11]: https://gitlab.com/scarpetta/pdfmixtool
|
||||
[12]: https://itsfoss.com/flatpak-guide/
|
||||
[13]: https://itsfoss.com/use-snap-packages-ubuntu-16-04/
|
||||
[14]: https://scarpetta.eu/pdfmixtool/#download
|
@ -1,88 +0,0 @@
|
||||
[#]: subject: (Edward Snowden Thinks GIMP Needs a Major UI Overhaul)
|
||||
[#]: via: (https://news.itsfoss.com/gimp-ui-edward-snowden/)
|
||||
[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
Edward Snowden Thinks GIMP Needs a Major UI Overhaul
|
||||
======
|
||||
|
||||
Edward Snowden’s recent tweet praised what free and open-source software can achieve.
|
||||
|
||||
In the tweet, he highlights that every time he uses Blender (an open-source 3D software suite), it reminds him of the advantages of FOSS and the growth of the ecosystem.
|
||||
|
||||
He did not just limit to that, in a follow-up reply to the same thread, he also tagged **GIMP** and added, “**I’m really hoping for a major UI overhaul. You guys could be eating Adobe’s lunch.**“
|
||||
|
||||
> P.S. [@GIMP_Official][1], I'm really hoping for a major UI overhaul. You guys could be eating Adobe's lunch.
|
||||
>
|
||||
> — Edward Snowden (@Snowden) [July 18, 2021][2]
|
||||
|
||||
### Does GIMP Require a Major UI Overhaul?
|
||||
|
||||
![][3]
|
||||
|
||||
[GIMP][4] is one of the most effective free and open-source image manipulation tools available.
|
||||
|
||||
It is actively used by professionals and all kinds of individuals to get a variety of things done.
|
||||
|
||||
You can even [make a GIF in GIMP][5]. Hence, it is tailored for simple and advanced tasks.
|
||||
|
||||
While it offers a learning curve to get used to its UI, it is good enough functionality-wise.
|
||||
|
||||
Does it require a UI overhaul?
|
||||
|
||||
Yes, as per the trends, all kinds of designing/editing tools are working to improve the user-friendliness factor, GIMP may have missed out on this front.
|
||||
|
||||
Of course, a sudden UI change may affect the workflow for a lot of veteran users. But, it does require a UI overhaul to beat its competitors like Adobe’s tools.
|
||||
|
||||
Also, with an easy-to-use interface, it will attract more users, potentially helping it grow and monetize the project even further.
|
||||
|
||||
And, it is also clear that Snowden thinks the same way, which is why he is hoping for a major UI overhaul while expecting GIMP to challenge Adobe tools in a big way.
|
||||
|
||||
### Why is GIMP Not Working on a Major User Experience Overhaul Yet?
|
||||
|
||||
Unfortunately, GIMP does not have regular UX contributors or developers to work on a major overhaul.
|
||||
|
||||
They mentioned it as a reply to one of the tweets in Snowden’s tweet thread:
|
||||
|
||||
> “We worked with a UX architect between 2005 and 2012. Good things came out of it. We make small UX improvements in almost every update now that point releases (e.g. 2.10.24) are allowed to have new stuff. But we don’t have a regular UX contributor or devs for a huge overhaul”
|
||||
|
||||
Well, this is definitely a sad thing for such a popular project that gets immense love from thousands of users.
|
||||
|
||||
And, I hope, after Snowden’s tweet, the GIMP project gets more traction and we see regular contributors to help evolve GIMP with the love it deserves.
|
||||
|
||||
If you want to help, you can explore [GIMP’s contribution page][6] to learn more about helping the project.
|
||||
|
||||
_Feel free to let me know your thoughts on GIMP and if you find it useful. Do you think that it needs a major UI overhaul, comments section is all yours!_
|
||||
|
||||
**Image Credits (Snowden’s image)**: [TheGuardian][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/gimp-ui-edward-snowden/
|
||||
|
||||
作者:[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://twitter.com/GIMP_Official?ref_src=twsrc%5Etfw
|
||||
[2]: https://twitter.com/Snowden/status/1416778909358731266?ref_src=twsrc%5Etfw
|
||||
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzMCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[4]: https://www.gimp.org
|
||||
[5]: https://itsfoss.com/make-gif-in-gimp/
|
||||
[6]: https://www.gimp.org/develop/
|
||||
[7]: https://www.theguardian.com/books/2019/aug/01/edward-snowden-memoir-to-reveal-whistleblowers-secrets-permanent-record
|
@ -1,91 +0,0 @@
|
||||
[#]: subject: (You Can Now Use KDE Connect in Windows as Well)
|
||||
[#]: via: (https://news.itsfoss.com/kde-connect-windows/)
|
||||
[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (imgradeone)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
You Can Now Use KDE Connect in Windows as Well
|
||||
======
|
||||
|
||||
KDE Connect is a popular open-source tool that lets you share a connection between a phone and your computer.
|
||||
|
||||
While it was always limited to the Linux platform, it looks like that it is coming to Windows after all.
|
||||
|
||||
And, cross-platform availability of software is always a good thing.
|
||||
|
||||
### What is KDE Connect?
|
||||
|
||||
In case you are coming across it for the first time—KDE connect lets you share files, links, sync notifications, gives you the ability to reply to messages, and more.
|
||||
|
||||
You can also choose to control your desktop and perform some custom commands remotely. And, you can also use your phone to control the volume/skip the music playing on your computer.
|
||||
|
||||
### KDE Connect Available as Beta in Microsoft Store
|
||||
|
||||
![][1]
|
||||
|
||||
As per a Reddit thread posted a few weeks back, a KDE contributor mentions that the beta version is available from the [Microsoft Store][2].
|
||||
|
||||
However, it is only accessible through the private link and cannot be found when you search for it in the Microsoft Store.
|
||||
|
||||
This also marks official support for Windows.
|
||||
|
||||
![][3]
|
||||
|
||||
### KDE Connect for Windows: Here’s How it Looks
|
||||
|
||||
![][4]
|
||||
|
||||
You just need to make sure that both of your devices are connected to the same network.
|
||||
|
||||
Next, all you have to do is pair them and then start sharing files/links, browse your phone, and also get notifications.
|
||||
|
||||
You can choose to tweak some of the options that include storage paths for shared images or change the sound to play when you try to ring the device.
|
||||
|
||||
![][5]
|
||||
|
||||
As you can notice here, you have a variety of options to make use of.
|
||||
|
||||
I tried connecting my Android device for a while, and it worked just fine. You may want to explore more to learn what else you can do with it.
|
||||
|
||||
### Why is it Good News for Windows Users?
|
||||
|
||||
Undoubtedly Windows users already had plenty of options to achieve the same functions without KDE Connect. But with KDE connect onboard, it will finally provide the opportunity to use an open-source and privacy-friendly tool that they can pair their devices with.
|
||||
|
||||
After all, you would not want your notifications, and links/files that you share to be spied upon by a shoddy third-party application.
|
||||
|
||||
In that case, KDE Connect is your friend.
|
||||
|
||||
Even though it is in beta right now. You can try it out by visiting the link and installing it from the Microsoft store.
|
||||
|
||||
[KDE Connect on Microsoft Store][2]
|
||||
|
||||
**Via**: [Omg!Ubuntu!][6]
|
||||
|
||||
#### 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/kde-connect-windows/
|
||||
|
||||
作者:[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]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjIyOCIgd2lkdGg9Ijc2MyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[2]: https://www.microsoft.com/en-gb/p/kde-connect/9n93mrmsxbf0?&activetab=pivot:overviewtab
|
||||
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI4NyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2MyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[6]: https://www.omgubuntu.co.uk/2021/07/kde-connect-windows-app
|
@ -1,126 +0,0 @@
|
||||
[#]: subject: "Top 9 Features in the Newly Released Zorin OS 16 Linux Distribution"
|
||||
[#]: via: "https://news.itsfoss.com/zorin-os-16-features/"
|
||||
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Top 9 Features in the Newly Released Zorin OS 16 Linux Distribution
|
||||
======
|
||||
|
||||
Zorin OS 16 is a gorgeous Linux distribution. With the latest release, there are several helpful feature additions to the distribution.
|
||||
|
||||
While we have [highlighted the key updates in our release coverage][1], I shall focus on some of the best features you can find in Zorin OS 16.
|
||||
|
||||
### 1\. Jelly Mode
|
||||
|
||||
![][2]
|
||||
|
||||
Jelly Mode adds an engaging animation when you minimize or move the window on your screen.
|
||||
|
||||
It is more like a wobble effect when you move the windows and a fluid effect when you minimize or launch an app.
|
||||
|
||||
Unlike other animation improvements, this is quite a pleasing effect to enhance the user experience.
|
||||
|
||||
### 2\. Windows 11-like Layout
|
||||
|
||||
![][3]
|
||||
|
||||
Considering that Windows 11 made a lot of buzz for its launch, it only makes sense for Zorin OS to offers a familiar layout.
|
||||
|
||||
After all, it is one of the best Windows-like Linux distributions out there.
|
||||
|
||||
The Windows 11-like layout is only available in the Zorin Appearance settings for Pro users. So, get the Pro edition if you want to support the development and get access to some extra layouts.
|
||||
|
||||
### 3\. Touchpad Gestures
|
||||
|
||||
If you want to get a seamless touch experience with your laptop/touchpad, Zorin OS 16 is here to the rescue.
|
||||
|
||||
A simple three-finger pinch would help you navigate to the activity overview and dabble between active windows.
|
||||
|
||||
And a four-finger swipe up/down will let you switch between workspaces.
|
||||
|
||||
### 4\. Windows Software Detection
|
||||
|
||||
![][4]
|
||||
|
||||
Zorin OS 16 utilizes a database of popular Windows software to detect if you download a .exe file and want to install it.
|
||||
|
||||
This is incredibly useful for beginners considering that it also informs the alternative or the correct way to install the software on Linux.
|
||||
|
||||
Even if it does not have exact instructions for the Windows software you downloaded, it prompts you to install “**Windows App Support**” when trying to access the .exe file.
|
||||
|
||||
![][5]
|
||||
|
||||
### 5\. New Photos App
|
||||
|
||||
![][6]
|
||||
|
||||
The default photos or image viewer is often untouched when a distribution is updated. But, with Zorin OS 16, you get a more straightforward and clean photo management app.
|
||||
|
||||
You get essential options like cropping, adding filters, enhancing the image, and screencasting to the devices connected to your network.
|
||||
|
||||
### 6\. Flathub Apps
|
||||
|
||||
![][7]
|
||||
|
||||
You no longer need to install Flatpak applications from the terminal separately. Flathub is now included with the Software center.
|
||||
|
||||
So, you can effortlessly search for Flatpak applications right from the Software app.
|
||||
|
||||
### 7\. Taskbar and Dash Customization
|
||||
|
||||
With Zorin OS 16, you get a variety of customization options to tweak the appearance of the taskbar, panel, and dock.
|
||||
|
||||
![][8]
|
||||
|
||||
Starting from the transparency to its position, behavior, size, and more. These options should let you tweak your user experience.
|
||||
|
||||
### 8\. Taskbar Unread Icons and Progress bar
|
||||
|
||||
The taskbar is usually static for most of the Linux distributions. Here, you finally get an unread badge counter in the taskbar, and it also supports a new progress bar for tasks like file transfer.
|
||||
|
||||
The progress bar is a helpful addition, given that you do not have to open the app repeatedly to watch the progress.
|
||||
|
||||
### 9\. New Sound Recorder App
|
||||
|
||||
![][9]
|
||||
|
||||
You do not have to opt for a third-party application to record basic voice-overs, podcasts, or voice notes.
|
||||
|
||||
The built-in sound record app offers a clean and easy-to-use interface. So, it should be a breeze to use it.
|
||||
|
||||
### Wrapping Up
|
||||
|
||||
Have you tried Zorin OS 16 yet? What feature did you find the most useful? Let me know 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/zorin-os-16-features/
|
||||
|
||||
作者:[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/zorin-os-16-release/
|
||||
[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM0MyIgd2lkdGg9Ijc1MiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM2MSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQyMiIgd2lkdGg9IjYxNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyMSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjIzMCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4NSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[9]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4MCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
@ -1,144 +0,0 @@
|
||||
[#]: subject: "Zorin OS 16 is a Visual Spectacle! You Can Download This New Linux Release Right Now"
|
||||
[#]: via: "https://news.itsfoss.com/zorin-os-16-release/"
|
||||
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Zorin OS 16 is a Visual Spectacle! You Can Download This New Linux Release Right Now
|
||||
======
|
||||
|
||||
Zorin OS 16, one of the most anticipated Linux distros, based on Ubuntu 20.04.3 LTS, has arrived.
|
||||
|
||||
With the latest release, they now offer a new “Pro” edition replacing the “Ultimate” edition that comes loaded with a few applications pre-installed and a couple of extra layouts.
|
||||
|
||||
Moreover, you get technical support for installation if you get the Zorin OS 16 Pro to support the developers.
|
||||
|
||||
The base edition is Zorin OS 16 “Core,” is free, which includes all the essentials.
|
||||
|
||||
In this article, I shall highlight the key new additions along with my initial impressions of Zorin OS 16.
|
||||
|
||||
### Zorin OS 16: What’s New?
|
||||
|
||||
Zorin OS 16 may not be as big of an upgrade compared to [elementary OS 6][1], but there are significant improvements across the board. Let us take a look at them.
|
||||
|
||||
### Refined User Interface
|
||||
|
||||
![][2]
|
||||
|
||||
The user interface remains familiar, but they have revamped the default theme and worked on the animations to present a polished look.
|
||||
|
||||
Subtle differences to the default transparency setting, theme, icons, and animations impact the overall user experience.
|
||||
|
||||
While you can notice the differences with Zorin OS 16 Core, the Pro edition takes it up a notch with the stunning new wallpapers and premium layouts available out-of-the-box.
|
||||
|
||||
### Flatpak Enabled
|
||||
|
||||
![][3]
|
||||
|
||||
Previously, Zorin OS supported snap right out of the box with its Software center. Now, with Zorin OS 16, Flathub has been enabled by default.
|
||||
|
||||
So, you can find plenty of applications available, including Flatpak packages in the Software manager.
|
||||
|
||||
You can even select a different package (if it is available) from the dropdown menu available in the top-right corner (as shown in the screenshot above).
|
||||
|
||||
### Improved Tour Screen
|
||||
|
||||
![][4]
|
||||
|
||||
They have also revamped their welcome screen to help you set up all the important things right from the start.
|
||||
|
||||
You get to configure online accounts, connect your smartphone with Zorin Connect, and get a head start on the available layouts to choose from.
|
||||
|
||||
### Windows 11-like Layout
|
||||
|
||||
![][2]
|
||||
|
||||
In my previous [Zorin OS 16 beta][5] coverage, I mentioned a potential Windows 10X-like layout was in the works.
|
||||
|
||||
Considering that Windows 10X no longer exists, the new layout is an alternative to Windows 11 experience.
|
||||
|
||||
Do note that you need to purchase the Zorin OS 16 Pro if you want to access Windows 11-like layout on your system.
|
||||
|
||||
### New Touchpad Gestures
|
||||
|
||||
For laptop or touchpad users, you can now swipe up/down with four fingers to move between workspaces and pinch using three fingers to open the activities overview.
|
||||
|
||||
### New Sound Recorder App
|
||||
|
||||
![][6]
|
||||
|
||||
A clean sound recording app to help you quickly record voice notes or podcasts without worrying about 3rd party applications.
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
Even though I don’t have a figure, I observed some noticeable performance improvements compared to my experience with Zorin OS 15.
|
||||
|
||||
For instance, switching between different layouts is an entirely seamless experience.
|
||||
|
||||
As a side note, I tested Zorin OS 16 Pro on my desktop with **i5-7400, 16 GB RAM,** and **a GTX 1050ti** graphics card.
|
||||
|
||||
I always have my doubts when it comes to Nvidia driver compatibility. But it worked like a charm.
|
||||
|
||||
The boot menu when installing Zorin OS 16 offered a different option for modern NVIDIA drivers, which is what I chose to install.
|
||||
|
||||
So, yes, **Zorin OS 16’s ISO comes with Nvidia driver support out-of-the-box.**
|
||||
|
||||
### Other Improvements
|
||||
|
||||
![][7]
|
||||
|
||||
There are several other additions to the animation, customization settings, and more with Zorin OS 16. Some of them are:
|
||||
|
||||
* Jelly mode to enable a macOS-like animation when minimizing or opening applications.
|
||||
* Improved taskbar
|
||||
* Introduction of fractional scaling
|
||||
* Active directory domain option in the installer
|
||||
* New photos app
|
||||
* Disabled telemetry and tracking in Firefox browser for better privacy
|
||||
|
||||
|
||||
|
||||
To explore more, you can check out [our Zorin OS 16 features list][8] or go through the [official announcement][9].
|
||||
|
||||
### Get Zorin OS 16
|
||||
|
||||
You can download Zorin OS 16 Core for free. If you opt for the Pro edition at **$39**, you also get access to a Pro-lite edition, which will be available to install for old computers.
|
||||
|
||||
The free lite edition and the pro lite version is not yet available and should be coming soon.
|
||||
|
||||
[Zorin OS 16 Download][10]
|
||||
|
||||
What do you think about Zorin OS 16? 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/zorin-os-16-release/
|
||||
|
||||
作者:[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]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjIzMCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUzNiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[5]: https://news.itsfoss.com/zorin-os-16-beta/
|
||||
[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4MCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQxNSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[8]: https://news.itsfoss.com/zorin-os-16-features/
|
||||
[9]: https://blog.zorin.com/2021/08/17/2021-08-17-zorin-os-16-is-released/
|
||||
[10]: https://zorin.com/os/download/
|
@ -1,96 +0,0 @@
|
||||
[#]: subject: "KaOS 2021.08 Release Focuses on Visual Changes and Package Updates"
|
||||
[#]: via: "https://news.itsfoss.com/kaos-2021-08-release/"
|
||||
[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
KaOS 2021.08 Release Focuses on Visual Changes and Package Updates
|
||||
======
|
||||
|
||||
The built-from-scratch Linux distribution KaOS — which uses KDE, Qt, and [pacman][1] as a package manager, has finally received its fifth update this year. This article will highlight the significant changes that have been brought to the distribution.
|
||||
|
||||
Let us get to know about what this new release brings!
|
||||
|
||||
### Desktop Environment Update
|
||||
|
||||
![][2]
|
||||
|
||||
The new Application Launcher, introduced in Plasma 5.22, is now the new home for accessing apps while the traditional cascading app menu is abandoned.
|
||||
|
||||
The default Midna theme has been given a slightly different look, which can be easily noticed from the boot-up to the logout screen. This includes a darker look for the logout screen, combined with a transparent sidebar for the lockscreen and SDDM, and a minimal look for the splash screen. The icon themes have also been customized accordingly for both the light and dark versions of the theme.
|
||||
|
||||
The desktop environment is now based on Plasma 5.22.4 and the latest Frameworks 5.85.0; both are built on Qt 5.15.2+.
|
||||
|
||||
### Application Updates
|
||||
|
||||
#### KDE Apps
|
||||
|
||||
This update brings the latest KDE Gear 21.08. This includes animated previews of folders and an easy method of renaming folders using F2 and TAB in Dolphin file manager, color and image previews, along with an SSH plugin in Konsole. And, a keyframeable effect for altering the speed of clips in Kdenlive, and a party mode in Elisa.
|
||||
|
||||
Plasma mobile apps are now available on KaOS and are promised to be suitable for desktop use. These apps include Angelfish — web browser, Koko – image viewer, Kalk – calculator, and Kasts – podcasts.
|
||||
|
||||
#### System Apps
|
||||
|
||||
Some Calligra users may be disappointed to learn that LibreOffice is now the default office application. Moreover, other applications like bibletime, speedtest-CLI, and mauikit-accounts have also been added.
|
||||
|
||||
### Calamares installer
|
||||
|
||||
Calamares is now built on QML modules designed specifically for KaOS. This gives it an even and modern look with other apps. This also includes an all-new Users and Summary page.
|
||||
|
||||
![Calamares Summary Page][3]
|
||||
|
||||
You can now select your preferred file system while opting for automated partitioning.
|
||||
|
||||
A handy feature allows the transfer of network settings from the Live system to the newly installed system. Thus, you don’t need to connect your PC to your Wi-Fi again.
|
||||
|
||||
### Other Package Updates
|
||||
|
||||
Several other systems packages have been updated. This should improve the overall compatibility and stability as well. Some package updates include:
|
||||
|
||||
* Systemd 249.3
|
||||
* Curl 7.78.0
|
||||
* NetworkManager 1.32.8
|
||||
* Mesa 21.1.7
|
||||
* Vulkan packages 1.2.187
|
||||
* Udisks 2.9.3, MLT 7.0.1
|
||||
* Openexr 3.1.1
|
||||
|
||||
|
||||
|
||||
Do note that this release does not support installation in systems with RAID set up as of now.
|
||||
|
||||
To explore more about the changes, you can refer to the [official announcement][4].
|
||||
|
||||
With this release, KaOS is focused on giving KDE users a streamlined experience. In addition, the installation has been made easier, and power users can definitely make use of the new apps.
|
||||
|
||||
[Download KaOS 2021.08][5]
|
||||
|
||||
What do you think about the latest KaOS release? Is it turning out to be a promising Linux distribution? Let me know your thoughts in the comments 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/kaos-2021-08-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/pacman-command/
|
||||
[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ0NCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4NSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[4]: https://kaosx.us/news/2021/kaos08/
|
||||
[5]: https://kaosx.us/pages/download/
|
@ -1,123 +0,0 @@
|
||||
[#]: subject: "Intel’s XeSS Could be the Open-Source Alternative to Nvidia’s DLSS"
|
||||
[#]: via: "https://news.itsfoss.com/intel-xess-open-source/"
|
||||
[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Intel’s XeSS Could be the Open-Source Alternative to Nvidia’s DLSS
|
||||
======
|
||||
|
||||
Over the past year, everyone in the PC gaming community has been talking about DLSS and FidelityFX. However, it seems that Linux gamers have been missing out, with DLSS only working through Proton when combined with a beta Nvidia driver and FidelityFX leaving much to be desired in terms of graphics.
|
||||
|
||||
Fortunately, Intel appears to want to change that with their new XeSS frame rate boosting technology. Launching alongside their upcoming Alchemist range of GPUs, it promises the ease of implementation of FidelityFX while competing in terms of image quality with DLSS.
|
||||
|
||||
Here, we will be exploring how this technology works and the incredible impact it will have on gaming on Linux.
|
||||
|
||||
### Is it like Nvidia’s DLSS?
|
||||
|
||||
![][1]
|
||||
|
||||
Similar to DLSS (Deep Learning Super Sampling), XeSS stands for Xe Super Sampling. AMD’s FidelityFX is a collection of technologies that enable games to run at a much higher frame rate than traditional rendering with minimal loss to visual quality.
|
||||
|
||||
Currently, two different technologies are used to achieve this. These are AI and traditional upscaling, both with various drawbacks and advantages.
|
||||
|
||||
#### Traditional Upscaling
|
||||
|
||||
Unlike AI, this approach has been worked on for many years. Previously, we have seen it being used in many TVs, computer monitors, and even some games to make a lower resolution image (or frame) appear clearer, with decent results.
|
||||
|
||||
This is the technology that AMD has chosen for their FidelityFX. They did this for several reasons; some possible ones include:
|
||||
|
||||
* Easier implementation by game developers
|
||||
* The capability to run on almost any GPU
|
||||
* Proven technology
|
||||
|
||||
|
||||
|
||||
That isn’t to say that it is without its disadvantages, some being:
|
||||
|
||||
* Reduced visual quality compared to AI-based solutions
|
||||
* More limited in opportunities to improve it in the future
|
||||
|
||||
|
||||
|
||||
AMD is currently the only major company using this technology for game upscaling. That means that we must move on to the other major upscaling technology: AI.
|
||||
|
||||
#### AI Upscaling
|
||||
|
||||
![][2]
|
||||
|
||||
It is the latest advancement in upscaling technology used by DLSS and XeSS.
|
||||
|
||||
Unlike traditional upscaling, this approach typically depends on some special hardware to run.
|
||||
|
||||
Specifically, it would help if you had a GPU with dedicated AI cores. On Nvidia’s cards, these come in the form of Tensor cores.
|
||||
|
||||
Because these cores are new, they are only available on 20 and 30 series GPUs, meaning that older cards are stuck with traditional upscaling. Additionally, it is much harder for developers to implement as the AI needs to be “trained,” involving feeding the AI thousands of hours of gameplay.
|
||||
|
||||
Yet, these trade-offs are worth it for many people, as AI provides better image quality and performance.
|
||||
|
||||
This is the route Intel has taken for its solution.
|
||||
|
||||
### Open Source and Upscaling
|
||||
|
||||
DLSS is completely closed source in true Nvidia style, like the drivers that annoyed Linus Torvalds so much.
|
||||
|
||||
Fortunately, Intel is following in the footsteps of AMD, and they plan to open-source XeSS once it’s ready for prime time.
|
||||
|
||||
While there is no significant commitment made by them, but multiple reports suggest that they plan to eventually open-source it.
|
||||
|
||||
This allows them to take advantage of the numerous contributions the open-source community will (hopefully) make. The result should be a fascinating GPU landscape with many different technologies and companies constantly fight for the top spot in upscaling.
|
||||
|
||||
### Intel XeSS
|
||||
|
||||
![][3]
|
||||
|
||||
Compared to Nvidia’s DLSS (XeSS’s main competitor), XeSS promises better performance, visual quality, and ease of implementation.
|
||||
|
||||
So far, we have seen demos running at as much as double the native performance, backing up the performance claims. But that’s press material for now.
|
||||
|
||||
As I mentioned, Intel is planning to make it open-source.
|
||||
|
||||
While it may not be open-source at launch, they intend on open-sourcing once it matures.
|
||||
|
||||
![][4]
|
||||
|
||||
If Intel is to be believed, this could be the killer feature of their upcoming Alchemy GPUs, putting them ahead of both AMD and Nvidia in one single scoop.
|
||||
|
||||
### Final Thoughts
|
||||
|
||||
I am incredibly excited about this feature, more so than I was about DLSS and FidelityFX combined. It should be noted that this is still some time away, with it expected to release in early 2022.
|
||||
|
||||
Overall, it looks like a significant step forward for Intel and maybe the key to them coming back from behind AMD and Nvidia.
|
||||
|
||||
_Are you excited about XeSS? Let me know in the comments below!_
|
||||
|
||||
**Via**: [Videocardz][5]
|
||||
|
||||
#### 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/intel-xess-open-source/
|
||||
|
||||
作者:[Jacob Crume][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/jacob/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM4MSIgd2lkdGg9IjY3OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[2]: https://i2.wp.com/i.ytimg.com/vi/-Dp61_bM948/hqdefault.jpg?w=780&ssl=1
|
||||
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzMiIgd2lkdGg9Ijc2OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[5]: https://videocardz.com/newz/intel-xess-ai-based-super-sampling-technology-will-be-open-source-once-it-matures
|
@ -1,93 +0,0 @@
|
||||
[#]: subject: "SparkyLinux 6.0 Release is based on Debian 11 and Includes a Built-in VPN"
|
||||
[#]: via: "https://news.itsfoss.com/sparkylinux-6-0-release/"
|
||||
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
SparkyLinux 6.0 Release is based on Debian 11 and Includes a Built-in VPN
|
||||
======
|
||||
|
||||
SparkyLinux 6.0 is a major stable update that utilizes Debian 11 ‘Bullseye’ as its base now.
|
||||
|
||||
While you can go through the [features of Debian 11][1], SparkyLinux 6.0 should reflect some of the perks associated with it.
|
||||
|
||||
Here, we shall take a quick look at what SparkyLinux 6.0 has to offer.
|
||||
|
||||
### SparkyLinux 6.0 “Po Tolo”: What’s New?
|
||||
|
||||
The major highlight of the release is the latest Debian 11 ‘Bullseye’ as its base. The repositories have also been updated to get the latest packages.
|
||||
|
||||
SparkyAPTus AppCenter has replaced the original SparkyAPTus, which is no longer developed.
|
||||
|
||||
![][2]
|
||||
|
||||
You can install, reinstall, and remove applications easily. Not just limited to the applications, but you also get the ability to tweak the pre-configured desktops using it.
|
||||
|
||||
In addition to that, you can remove and install Linux Kernels as well. You can choose from Debian Kernel, Liquorix, Sparky, and XanMod.
|
||||
|
||||
![][3]
|
||||
|
||||
It is worth noting that you will still be able to access all the tools from the old APTus.
|
||||
|
||||
To enhance privacy and security, SparkyLinux has decided to include the non-profit [RiseUp VPN][4] application pre-installed.
|
||||
|
||||
It is a VPN service that relies on donations to keep the network alive and comes with cross-platform support. You can also find it available for Android devices.
|
||||
|
||||
So, this makes it an interesting addition to the distribution. If you are not using any VPN service, this should make things easy.
|
||||
|
||||
The FirstRun app has been replaced with an improved welcome app that guides you through some basic pointers.
|
||||
|
||||
![][5]
|
||||
|
||||
### Other Improvements
|
||||
|
||||
With the latest release, you can also find new wallpapers and updated application packages that include:
|
||||
|
||||
* Thunderbird 78.13.0
|
||||
* VLC 3.0.16
|
||||
* LibreOffice 7.0.4
|
||||
* Calamares Installer 3.2.41.1
|
||||
|
||||
|
||||
|
||||
To know more about the release, you can refer to the [official announcement][6].
|
||||
|
||||
### Download Sparky 6.0
|
||||
|
||||
SparkyLinux 6.0 is available to download with Xfce and KDE Plasma desktop environments. It supports 32-bit systems as well, which is a good thing.
|
||||
|
||||
If you are already running SparkLinux “Po Tolo” rolling release, you need to update your system to get Sparky 6.0.
|
||||
|
||||
Do note that the rolling version will switch to a stable release. So, if you want to stay on the rolling release, you need to wait for a few days.
|
||||
|
||||
[SparkyLinux 6.0][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/sparkylinux-6-0-release/
|
||||
|
||||
作者:[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/debian-11-feature/
|
||||
[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU4NyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU4NSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[4]: https://riseup.net/en/vpn
|
||||
[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU2MyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[6]: https://sparkylinux.org/sparky-6-0-po-tolo/
|
||||
[7]: https://sparkylinux.org/download/
|
@ -1,81 +0,0 @@
|
||||
[#]: subject: "“Apps for GNOME” is a New Web Portal to Showcase Best Linux Apps for GNOME"
|
||||
[#]: via: "https://news.itsfoss.com/apps-for-gnome-portal/"
|
||||
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
“Apps for GNOME” is a New Web Portal to Showcase Best Linux Apps for GNOME
|
||||
======
|
||||
|
||||
There are several apps built for GNOME. Most of the stock (default) GNOME apps do not get enough spotlight as a separate mention.
|
||||
|
||||
While Flathub as a platform helps highlight some fantastic applications for GNOME, it limits to Flatpak apps only.
|
||||
|
||||
Also, it is not just dedicated to GNOME, of course.
|
||||
|
||||
Hence, there is a new website to focus more on the GNOME ecosystem and highlight the best GNOME apps.
|
||||
|
||||
### Apps for GNOME
|
||||
|
||||
![][1]
|
||||
|
||||
A [blog post][2] by Sophie Herold on Planet GNOME announced the availability of the platform.
|
||||
|
||||
[apps.gnome.org][3] is where you can find all the GNOME apps, both default and third-party applications tailored primarily for the GNOME environment.
|
||||
|
||||
With this portal, they aim to encourage users to participate and contribute to the development of such applications.
|
||||
|
||||
When you head to explore an app on the platform, you will be presented with plenty of information that includes where to submit feedback for the app, help translate, and contribute financially.
|
||||
|
||||
![][4]
|
||||
|
||||
It is not something out-of-the-box, but it presents all the information related to a GNOME app in a single place.
|
||||
|
||||
You get a complete picture for a GNOME app starting with the description, screenshots, latest version, information about the maintainers, and translation status.
|
||||
|
||||
![][5]
|
||||
|
||||
Not just limited to desktop GNOME apps, but you will also find applications marked with a mobile icon if it is supported on GNOME mobile devices.
|
||||
|
||||
In addition to the key GNOME apps, it also aims to feature applications that do not offer a flatpak package but suits well for the GNOME platform.
|
||||
|
||||
[Apps for GNOME][3]
|
||||
|
||||
### Making Information More Accessible
|
||||
|
||||
I find it much more insightful than what Flathub seems to provide. And, I think this is not just going to help highlight GNOME apps, but it should help new users get to know more about the applications they use.
|
||||
|
||||
Of course, it should also encourage users to get involved, which is the primary focus.
|
||||
|
||||
While KDE already had an [application portal][6], it might need an upgrade if they take Apps for GNOME as an example to improve.
|
||||
|
||||
_What do you think about the Apps for GNOME initiative?_ _Feel free to share your thoughts 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/apps-for-gnome-portal/
|
||||
|
||||
作者:[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]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU2MiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[2]: https://blogs.gnome.org/sophieh/2021/08/26/apps-gnome-org-is-online/
|
||||
[3]: https://apps.gnome.org
|
||||
[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI4MiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ3OSIgd2lkdGg9Ijc0NCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[6]: https://apps.kde.org
|
@ -1,122 +0,0 @@
|
||||
[#]: subject: "Open Source Video Editor OpenShot 2.6 Released With AI Effects & Major Improvements"
|
||||
[#]: via: "https://news.itsfoss.com/openshot-2-6-release/"
|
||||
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Open Source Video Editor OpenShot 2.6 Released With AI Effects & Major Improvements
|
||||
======
|
||||
|
||||
OpenShot is one of the most popular [open-source video editors][1] out there.
|
||||
|
||||
It is not just for Linux, but it is an impressive free video editor for Windows and Mac users as well.
|
||||
|
||||
While it was already a functional, easy-to-use, feature-rich video editor, it stepped up a notch with the latest release.
|
||||
|
||||
Here, we discuss some key additions in OpenShot 2.6.0 release.
|
||||
|
||||
### OpenShot 2.6.0 Released: What’s New?
|
||||
|
||||
![][2]
|
||||
|
||||
The primary highlight of this release is the inclusion of AI and computer vision effects. But, there is more to it than meets the eye.
|
||||
|
||||
Here are the highlights for OpenShot 2.6.0 changes:
|
||||
|
||||
* New AI and computer vision effects
|
||||
* New audio effects
|
||||
* New zoom slider
|
||||
* Improved transform tool
|
||||
* Improved video effects
|
||||
* Improved snapping
|
||||
* More emoji support
|
||||
* Improved performance
|
||||
* Bug fixes
|
||||
|
||||
|
||||
|
||||
Considering the fundamental changes, OpenShot is now a more compelling option for professional video editors.
|
||||
|
||||
![Official YouTube video for OpenShot 2.6][3]
|
||||
|
||||
### AI Effects
|
||||
|
||||
Taking the help of an AI to process images/videos is becoming increasingly common these days.
|
||||
|
||||
Hence, OpenShot adds the support for AI effects to make it easier to enhance and edit videos.
|
||||
|
||||
One of the features includes eliminating any shake/motion in a video by calculating it.
|
||||
|
||||
![][4]
|
||||
|
||||
You can also track particular objects in a video. This is undoubtedly helpful for animation or any other creative work where you need to follow a specific element of the video.
|
||||
|
||||
Like a real-time feed where the camera detects vehicles, it can also identify objects in the video. While this feature is in beta, it should be fun to experiment with it.
|
||||
|
||||
### Audio Effects
|
||||
|
||||
OpenShot video editor featured most of the essential audio effects. And, in this release, some more important audio effects have been added that include:
|
||||
|
||||
* Compressor
|
||||
* Expander
|
||||
* Echo
|
||||
* Delay
|
||||
* Distortion
|
||||
* Noise
|
||||
* EQ
|
||||
* Robotic voice and whispering voice effects
|
||||
|
||||
|
||||
|
||||
### New & Improved Tools
|
||||
|
||||
![][5]
|
||||
|
||||
Vital tools in snapping and transform mode have been improved.
|
||||
|
||||
The improved transform tool lets you resize, rotate, and work seamlessly to create complex animations.
|
||||
|
||||
Furthermore, when trimming the clip, the snapping tool allows you better align the edges of the clips.
|
||||
|
||||
A new zoom slider tool has been added to give you better control over the timeline. You can easily drag and work with a specific portion of the timeline as needed.
|
||||
|
||||
### Other Improvements
|
||||
|
||||
In addition to the essential changes, you can find performance improvements and numerous bug fixes.
|
||||
|
||||
You can find the latest version as an AppImage file as of now. It should reflect soon in the Flathub repository and other sources as well. Consider reading [how to use AppImage files][6] if you are not aware of it.
|
||||
|
||||
[Download OpenShot 2.6.0][7]
|
||||
|
||||
To explore more about the release, you may refer to the [official release announcement][8].
|
||||
|
||||
#### 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/openshot-2-6-release/
|
||||
|
||||
作者:[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/open-source-video-editors/
|
||||
[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYwOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[3]: https://i0.wp.com/i.ytimg.com/vi/06sgvsYB378/hqdefault.jpg?w=780&ssl=1
|
||||
[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM2MSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[6]: https://itsfoss.com/use-appimage-linux/
|
||||
[7]: https://www.openshot.org/download/
|
||||
[8]: https://www.openshot.org/blog/2021/08/25/new_openshot_release_260/
|
@ -1,154 +0,0 @@
|
||||
[#]: subject: "Linux Kernel 5.14 Released Right After the 30th Anniversary of Linux"
|
||||
[#]: via: "https://news.itsfoss.com/kernel-5-14-release/"
|
||||
[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Linux Kernel 5.14 Released Right After the 30th Anniversary of Linux
|
||||
======
|
||||
|
||||
Back in June, I looked at [Linux Kernel 5.13][1], where we received preliminary support for the M1, RISC-V improvements, and support for new GPUs.
|
||||
|
||||
Now, Linux kernel 5.14 is here! Linus Torvalds just [announced it on the kernel mailing list][2]:
|
||||
|
||||
![Kernel 5.14 announcement mail][3]
|
||||
|
||||
While this release is not quite as large as the aforementioned one, it still has many improvements, especially for ARM devices.
|
||||
|
||||
Let us take a quick look at the key highlights of this release.
|
||||
|
||||
### Linux Kernel 5.14: What’s New?
|
||||
|
||||
Linux kernel 5.14 contains a wide variety of new features, especially for ARM-based systems. This is all happening despite Linus Torvalds claiming that this is a relatively small release in the initial [kernel announcement][4].
|
||||
|
||||
Fast forward to its release candidate v7 before its final release, Linus mentioned:
|
||||
|
||||
> Most of the changes here are drivers (GPU and networking stand out),
|
||||
>
|
||||
> and the rest is pretty random stuff: arch, tracing, core networking, a
|
||||
>
|
||||
> couple of VM fixes..
|
||||
|
||||
Linus Torvalds, Linux kernel 5.14 RC7 announcement
|
||||
|
||||
This release contains a variety of new features. Here is a list of the key new features present in Linux kernel 5.14:
|
||||
|
||||
* The [Raspberry Pi 400][5] can now work completely with this kernel, thanks to the work done for the past couple of months.
|
||||
* The [Rockchip RK3568 SoC][6] is now supported
|
||||
* Initial support for the Sony Xperia 1/1II and 5/5II
|
||||
* Various updates added for Microsoft Surface Duo
|
||||
* Updates to DIY BananaPi M5 board added
|
||||
* [Important updates][7] for RISC-V
|
||||
* Improved support for Intel Alder Lake P and Alder Lake M graphics cards
|
||||
* New hot-unplug support on AMD Radeon graphics cards
|
||||
* ‘Secret’ memory areas introduced with a new system called ‘memfd_secret’
|
||||
* Improvements to [lower the latency of its USB audio driver][8]s
|
||||
* Improved support for USB4
|
||||
* Initial groundwork to support Intel Alder lake processors
|
||||
|
||||
|
||||
|
||||
In this article, we will be looking at what these features are, and what they mean for the end user.
|
||||
|
||||
#### Raspberry Pi 400
|
||||
|
||||
Last year, the Raspberry Pi Foundation launched the [Raspberry Pi 400][5], a keyboard computer similar to those of the 1980s. Unfortunately, this computer requires a custom kernel version to function due to non-mainline drivers.
|
||||
|
||||
However, with the kernel 5.14 release, this appears to have changed. After months of development, the Raspberry Pi 400 can now be booted using the Linux kernel 5.14. While it is unfortunate for support to take this long, it is much better late than never.
|
||||
|
||||
#### RK35xx SoC Support
|
||||
|
||||
This year has truly been a glorious year for [Rockchip][9]. They started off by launching their rk35xx series of SoCs, with many manufacturers integrating the newly-released SoCs into their products.
|
||||
|
||||
One of the most notable uses of the RK35xx series is in the Quartz64, an SBC developed by [Pine64][10] (which I am currently helping mainline). And Linux 5.14 brings support for one of these SoCs, the RK3568.
|
||||
|
||||
For all the upcoming boards based on this SoC, this inclusion is extremely important as it greatly simplifies distro porting.
|
||||
|
||||
#### Initial Support for Sony Xperia 1/1II and 5/5II
|
||||
|
||||
[Sony][11] is one of the few mobile phone manufacturers that actively support running Linux on their phones. This is demonstrated through their compatibility with operating systems such as [Sailfish OS][12] and [Ubuntu Touch][13].
|
||||
|
||||
Now, with the Sony Xperia 1/1II and 5/5II being mainlined, it should be much easier to get an even wider variety of distributions booted. However, it should be also be kept in mind that this is only initial support, much like Linux 5.13’s M1 support.
|
||||
|
||||
#### RISC-V Updates
|
||||
|
||||
One of the trends I have noticed over the past few kernel updates is the ever-improving support for [RISC-V][14] processors. Last update, we got some significant build system improvements, a re-arranged kernel memory map, and support for the kernel debugging module KProbes.
|
||||
|
||||
This time, it appears that this trend is continuing, with the addition of a few RISC-V-specific improvements. These include:
|
||||
|
||||
* Support for transparent huge pages
|
||||
* An optimized copy_{to,from}_user.
|
||||
* Generic PCI resources mapping support
|
||||
* Support for KFENCE (Kernel Electric Fence) for memory safety error detection/validation
|
||||
|
||||
|
||||
|
||||
While mostly minor, these updates should pave the way for future RISC-V based devices.
|
||||
|
||||
#### Radeon Hot-Unplug
|
||||
|
||||
Perhaps my favorite feature of this release, AMD Radeon cards are getting a new hot-unplug feature. Previously, ripping your GPU out while your system was running would result in a kernel panic. Now, you can remove your (Radeon) GPU at any time and your system will continue to function normally, at least in theory.
|
||||
|
||||
I just hope that this feature works better on Linux than my experience with it on Windows. While I wouldn’t recommend randomly pulling your GPU out of your system mid-update, it is still a nice feature to see, and it will be interesting to see what people do with it.
|
||||
|
||||
#### USB 4 Support
|
||||
|
||||
As we see an increasing number of new laptops shipping with USB 4, it has become more and more important for Linux to start supporting it. Fortunately, the Linux kernel 5.14 has a wide variety of improvements for USB 4 users.
|
||||
|
||||
These include:
|
||||
|
||||
* More USB 4 support added to the thunderbolt core
|
||||
* Build warning fixes all over the place
|
||||
* USB-serial driver updates and new device support
|
||||
* A wide variety of driver updates
|
||||
* Lots of other tiny things
|
||||
|
||||
|
||||
|
||||
While not game-changing, these improvements should help many current and future users of USB 4.
|
||||
|
||||
### Wrapping Up
|
||||
|
||||
Between the improved USB support, multitude of updates for ARM and RISC-V devices, and minor GPU upgrades, this release is looking pretty good. As I mentioned before, I am most excited about the Radeon hot-unplug support, as this should make GPU swapping that little bit easier.
|
||||
|
||||
Similarly to last time, I’d recommend waiting for your distribution to offer official updates before upgrading to Linux kernel 5.14. Fortunately, users of distributions such as Arch and Manjaro should receive the updates very shortly. [Advanced Ubuntu users can install the latest mainline Kernel][15] with some effort though it should be avoided.
|
||||
|
||||
_What do you think about the improvements in Linux Kernel 5.14? Let me know down 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/kernel-5-14-release/
|
||||
|
||||
作者:[Jacob Crume][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/jacob/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://news.itsfoss.com/linux-kernel-5-13-release/
|
||||
[2]: https://lkml.org/lkml/2021/8/29/382
|
||||
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ1NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[4]: http://lkml.iu.edu/hypermail/linux/kernel/2107.1/02943.html
|
||||
[5]: https://www.raspberrypi.org/products/raspberry-pi-400/
|
||||
[6]: https://www.96rocks.com/blog/2020/11/28/introduce-rockchip-rk3568/
|
||||
[7]: https://lore.kernel.org/lkml/mhng-423e8bdb-977e-4b99-a1bb-b8c530664a51@palmerdabbelt-glaptop/
|
||||
[8]: http://lkml.iu.edu/hypermail/linux/kernel/2107.1/00919.html
|
||||
[9]: https://www.rock-chips.com/a/en/index.html
|
||||
[10]: http://pine64.org
|
||||
[11]: https://electronics.sony.com/c/mobile
|
||||
[12]: https://sailfishos.org/
|
||||
[13]: https://ubuntu-touch.io/
|
||||
[14]: https://riscv.org/
|
||||
[15]: https://itsfoss.com/upgrade-linux-kernel-ubuntu/
|
@ -1,76 +0,0 @@
|
||||
[#]: subject: "Ransomware Disguised as Open-Source Krita Painting App Promo Video"
|
||||
[#]: via: "https://news.itsfoss.com/krita-email-scam/"
|
||||
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Ransomware Disguised as Open-Source Krita Painting App Promo Video
|
||||
======
|
||||
|
||||
Ransomware attacks are exponentially increasing. And, the way it gets distributed evolves every day.
|
||||
|
||||
One of the most effective ways is by using reputable brand names to lure users into downloading malicious files that may end up encrypting your files and demand a ransom.
|
||||
|
||||
And, in this case, some scammers have started using Krita’s name to deceive users through email.
|
||||
|
||||
### Spreading Malware via Email as Krita Officials
|
||||
|
||||
The attackers disguise themselves as the team for Krita, one of the best [digital open-source painting app][1].
|
||||
|
||||
The email mentions that Krita wants to collaborate with your YouTube channel or your social media space to share promotional videos about their software/product.
|
||||
|
||||
And, they mention that this is a paid advertising campaign, so you think you are getting a reward for promoting Krita.
|
||||
|
||||
Here’s how the email looks like (as shared by [Krita on Twitter][2]):
|
||||
|
||||
![][3]
|
||||
|
||||
Once you show interest in promoting Krita, they send you a follow-up mail instructing you to download a press kit containing screenshots, videos, and other materials.
|
||||
|
||||
The link may look similar to the official one like _krita.io, krita.net_, etc.
|
||||
|
||||
In a detailed video shared by a Twitter user, you can see that the link they share is malicious and sometimes goes undetected by Google’s safe browsing feature:
|
||||
|
||||
> Recently, I received the same email. Though I know this is likely a scam, I decided to proceed further just to see how far will they take us. They asked me to download some files and you can watch the full video here: <https://t.co/Mv2p9z3HCa> [pic.twitter.com/P1K2tlHiT4][4]
|
||||
>
|
||||
> — Inside Electronics (@InsideElectro) [August 29, 2021][5]
|
||||
|
||||
While I agree that this is not the best attempt to distribute malware, not everyone is as attentive as this user here.
|
||||
|
||||
### Never Trust an Email Without Proper Verification
|
||||
|
||||
It is easy for attackers to send you emails that you expect or something that may spark an interest in your work.
|
||||
|
||||
Scammers do their homework to know what you like, but always stay cautious no matter what or who appears to be sending the email.
|
||||
|
||||
If an email explicitly asks to enter your personal information, download an attachment, or visit a website to download a file, you need to double-check if it comes from an official source.
|
||||
|
||||
Generally, officials do not ask you to download any file or personal information unless you took action first. So, it is always wise to think twice and run a background check for what you interact with via emails.
|
||||
|
||||
#### 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/krita-email-scam/
|
||||
|
||||
作者:[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/open-source-paint-apps/
|
||||
[2]: https://twitter.com/Krita_Painting/status/1432295734074880003
|
||||
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI3OSIgd2lkdGg9IjU4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[4]: https://t.co/P1K2tlHiT4
|
||||
[5]: https://twitter.com/InsideElectro/status/1431938502862663680?ref_src=twsrc%5Etfw
|
@ -1,77 +0,0 @@
|
||||
[#]: subject: "Linux Lite Moves to Pay What You Want Model With Version 5.6 Release"
|
||||
[#]: via: "https://news.itsfoss.com/linux-lite-5-6-release/"
|
||||
[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Linux Lite Moves to Pay What You Want Model With Version 5.6 Release
|
||||
======
|
||||
|
||||
[Linux Lite][1] has just announced Linux lite 5.6, the fourth installment in their 5.x series of releases. This release brings some major changes, especially in the download process. Other, more subtle tweaks are also shown throughout the OS.
|
||||
|
||||
Here, we will be looking at what is new, what has changed, and how these changes may affect the future of Linux Lite.
|
||||
|
||||
### What Has Changed in Linux Lite 5.6?
|
||||
|
||||
![][2]
|
||||
|
||||
Alongside the new download model, there a few key changes. These include:
|
||||
|
||||
* New features in the Lite Tweaks app
|
||||
* Updated icon theme
|
||||
* New wallpapers
|
||||
|
||||
|
||||
|
||||
While this list is relatively short, there are a couple of meaningful changes.
|
||||
|
||||
### Pay Want You Want Download Model
|
||||
|
||||
Definitely the most impactful change, Linux Lite has moved to a “Pay what you want” download model. For those not familiar with the term, it is a system where the user is encouraged to pay to obtain a download link. Users can still enter $0 to get the download link for free, but it is not immediately clear and does not support the distro.
|
||||
|
||||
This move follows the footsteps of other popular distros, including ElementryOS. While I can see many users being annoyed at this change, it has also been made clear that Linux Lite would die without this change.
|
||||
|
||||
> “This is a road I’d never thought I’d go down, but we have no choice. Either we stagnate and accept the big G’s ever-changing algorithms, or we boldly go where others have dared.”
|
||||
|
||||
Jerry Bezencon
|
||||
|
||||
In hindsight, this change was inevitable, as there is almost no other way for distributions to reasonably sustain themselves (aside from donations). Now we need to see how this change pays off for the developers of Linux Lite.
|
||||
|
||||
### Updated Lite Tweaks App
|
||||
|
||||
With this update, the Lite Tweaks app gets a few improvements. One of these is the ability to completely clear the cache of the Brave web browser. It also has a new option to set Brave as the default web browser.
|
||||
|
||||
The second update within the Lite Tweaks app is a fix for GRUB. This tweak changes the grub entry from “Ubuntu” to “Linux Lite”. However, it should be noted that this option is only available when GRUB is controlled by Linux Lite.
|
||||
|
||||
### Wrapping Up
|
||||
|
||||
If you want to try Linux Lite for yourself, you can [download it from its website][3]. If you are already running Linux Lite, you can update to version 5.6 using the instructions found on the [release announcement][4].
|
||||
|
||||
While minor, this release does have a few improvements scattered around the OS. Most importantly, however, is the fact that Linux Lite can now be self-sustaining, meaning that we will continue to see more features added with every release. I think this is much better that the distro dying, don’t 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/linux-lite-5-6-release/
|
||||
|
||||
作者:[Jacob Crume][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/jacob/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.linuxliteos.com/
|
||||
[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ0MCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[3]: https://www.linuxliteos.com/download.php
|
||||
[4]: https://www.linuxliteos.com/forums/release-announcements/linux-lite-5-6-final-released/
|
@ -1,96 +0,0 @@
|
||||
[#]: subject: "Lakka Linux 3.4 Brings Fidelity FX Support With the New RetroArch 1.9.9"
|
||||
[#]: via: "https://news.itsfoss.com/lakka-retroarch-release/"
|
||||
[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Lakka Linux 3.4 Brings Fidelity FX Support With the New RetroArch 1.9.9
|
||||
======
|
||||
|
||||
For years now, [RetroArch][1] has been the gold standard in emulation, thanks to its ease of use and simplicity. Similarly, [Lakka][2] has gotten a name by using RetroArch to create an incredibly smooth and straightforward experience for its users.
|
||||
|
||||
Hence, we have recommended it in the past to [turn your old PC into a retrogaming console][3].
|
||||
|
||||
It is always a great day when these two large projects announce new releases, and it looks like we have some exciting news with Lakka 3.4 and RetroArch 1.9.9 release.
|
||||
|
||||
Here, we will be looking at some of the new features announced in RetroArch 1.9.9 and Lakka 3.4 and the significant impact on the future of emulation.
|
||||
|
||||
### What’s New?
|
||||
|
||||
With this release, RetroArch has introduced some useful and impactful new features. These include:
|
||||
|
||||
* AMD FidelityFX support for all games
|
||||
* Windows users can now use HDR on many games
|
||||
* New touchscreen menu for the Nintendo DS
|
||||
|
||||
|
||||
|
||||
Lakka (which includes RetroArch) has also received some welcome improvements.
|
||||
|
||||
* Improved stability
|
||||
* 3 new cores for the PS1, PS2, and DOS
|
||||
* Updated Mesa to version 21.2.1
|
||||
|
||||
|
||||
|
||||
Here we focus on the key highlights and, primarily, Integrated FidelityFX.
|
||||
|
||||
#### FidelityFX For Retro Games
|
||||
|
||||
![][4]
|
||||
|
||||
When AMD announced its open-source alternative to DLSS back in June, we could never have predicted the incredible impact it would have on emulation.
|
||||
|
||||
For those not aware, [FidelityFX][5] allows games to run at a lower resolution while retaining the same image quality, dramatically improving the performance.
|
||||
|
||||
Now, with the RetroArch 1.9.9 release, this technology is being brought to RetroArch and Lakka. This is great because it allows older games designed to run at a low resolution to look much better without resorting to mods or texture packs.
|
||||
|
||||
Overall, I expect this addition to be widely appreciated, especially by people looking for a more modern version of their favorite retro games.
|
||||
|
||||
If you want to learn more about FidelityFX and upscaling, I’d highly suggest you check out [our article on Intel’s XeSS where we explain all this][6] and how it impacts you.
|
||||
|
||||
#### New Touchscreen Menu For Nintendo 3DS
|
||||
|
||||
One of the more interesting ports of RetroArch, the Nintendo 3DS, has also gotten a cool new feature. This comes in the form of a touchscreen menu for the bottom screen, which shows a few useful shortcuts without covering the game.
|
||||
|
||||
While this doesn’t apply to Lakka, users of RetroArch running on top of another distribution should receive this change once RetroArch 1.9.9 lands in the repositories.
|
||||
|
||||
### Wrapping Up
|
||||
|
||||
Overall, [RetroArch 1.9.9][7] and [Lakka 3.4][8] are looking to be significant upgrades, especially with the new integration with FidelityFX.
|
||||
|
||||
As we have already seen, with emulators such as [RPCS3][9], FidelityFX can provide significant graphical improvements on older games, so it is exciting to see this come to RetroArch.
|
||||
|
||||
_What do you think about FidelityFX being used for retro games? Let me know in the comments 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/lakka-retroarch-release/
|
||||
|
||||
作者:[Jacob Crume][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/jacob/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.retroarch.com/
|
||||
[2]: http://lakka.tv
|
||||
[3]: https://itsfoss.com/lakka-retrogaming-linux/
|
||||
[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjIzMCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[5]: https://www.amd.com/en/technologies/radeon-software-fidelityfx-super-resolution
|
||||
[6]: https://news.itsfoss.com/intel-xess-open-source/
|
||||
[7]: https://www.libretro.com/index.php/retroarch-1-9-9-released/
|
||||
[8]: http://lakka.tv/articles/2021/09/06/lakka-3.4/
|
||||
[9]: http://rpcs3.net
|
@ -0,0 +1,71 @@
|
||||
[#]: subject: "Ubuntu’s Yaru Theme Now Officially Supports Xfce"
|
||||
[#]: via: "https://news.itsfoss.com/yaru-xfce-support/"
|
||||
[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Ubuntu’s Yaru Theme Now Officially Supports Xfce
|
||||
======
|
||||
|
||||
Back when [Ubuntu 20.04][1] was released, the Ubuntu team stunned everyone with the new Yaru theme’s beautiful visuals and simplicity. It keeps on getting better with each Ubuntu release. It has become the symbolism of Ubuntu now.
|
||||
|
||||
However, the Yaru theme was not well supported for other desktop environments like Xfce.
|
||||
|
||||
Fortunately, this is set to change with a recent pull request on the [project’s GitHub page][2]. Here, we will be looking at this change, as well as how to try out these changes for yourself.
|
||||
|
||||
### Yaru on Xfce
|
||||
|
||||
![][3]
|
||||
|
||||
This update started in late July, when developer [Muqtxdir][4] opened [a pull request on the Yaru GitHub page][5] to add support for the XFCE desktop environment. Over the course of a month, the awesome developers there worked tirelessly on improving Muqtxdir’s work, with a result that is truly stunning.
|
||||
|
||||
![][3]
|
||||
|
||||
One interesting change is the panel, which now looks similar to the panel found in the GNOME desktop environment.
|
||||
|
||||
### If you want to try it right away (not recommended)
|
||||
|
||||
If you are already using XFCE, trying out the Yaru theme is as simple as following the instructions on here. For this, I will be assuming that you are using Xubuntu, however the commands can be easily adapted for other distributions.
|
||||
|
||||
```
|
||||
sudo apt install git meson sassc libglib2.0-dev libxml2-utils
|
||||
git clone https://github.com/ubuntu/yaru
|
||||
cd yaru && meson build -Dxfwm4=true && sudo ninja -C build install
|
||||
```
|
||||
|
||||
_**If you don’t quite feel comfortable building it from source, I suspect that it will be available with Xubuntu 21.10, which is only a month away now.**_
|
||||
|
||||
Either way, I am really excited about this change, especially as it gives XFCE a much more modern and simplistic look. Plus, it also gives users a major reason to upgrade to Xubuntu 21.10.
|
||||
|
||||
What do you think about the Yaru theme on XFCE? Let me know in the comments below!
|
||||
|
||||
_Source: [Linux Uprising][6]_
|
||||
|
||||
#### 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/yaru-xfce-support/
|
||||
|
||||
作者:[Jacob Crume][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/jacob/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/download-ubuntu-20-04/
|
||||
[2]: https://github.com/ubuntu/yaru
|
||||
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[4]: https://github.com/Muqtxdir
|
||||
[5]: https://github.com/ubuntu/yaru/pull/2971
|
||||
[6]: https://www.linuxuprising.com/2021/09/ubuntus-yaru-theme-gets-official.html
|
@ -0,0 +1,81 @@
|
||||
[#]: subject: "Vivaldi Replaces Firefox as the Default Browser on Manjaro Linux Cinnamon"
|
||||
[#]: via: "https://news.itsfoss.com/vivaldi-replaces-firefox-manjaro/"
|
||||
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Vivaldi Replaces Firefox as the Default Browser on Manjaro Linux Cinnamon
|
||||
======
|
||||
|
||||
Vivaldi is one of the [best web browsers available for Linux][1].
|
||||
|
||||
For all the good reasons, many Linux users have been switching to Vivaldi, especially after [Vivaldi 4.0 release][2].
|
||||
|
||||
Now, to take it up a notch, Vivaldi has managed to replace Firefox as the default browser on Arch-based Manjaro Linux (Cinnamon edition).
|
||||
|
||||
![][3]
|
||||
|
||||
Even though the Cinnamon version is a community edition, it is surprising that Mozilla Firefox dropped from a Linux distribution.
|
||||
|
||||
As per the official announcement, Manjaro’s co-CEO mentioned why they chose Vivaldi:
|
||||
|
||||
> _To give Vivaldi more of the attention it deserves, I decided to include it as the default browser in our popular Cinnamon Community Edition. With its remarkable browsing speed, exceptional customizability and especially the way it values user privacy, Vivaldi for me is a perfect match for Manjaro Linux._
|
||||
|
||||
### Customized Experience for Manjaro Linux Users
|
||||
|
||||
![][4]
|
||||
|
||||
To spice things up, [Vivaldi][5] comes baked in with a Manjaro-Cinnamon theme to give you a refreshing out-of-the-box experience.
|
||||
|
||||
Of course, if you have already used Vivaldi as your browser, you have to sync your data to get started.
|
||||
|
||||
### Vivaldi is a Great Option for Linux Users
|
||||
|
||||
![][6]
|
||||
|
||||
It is worth noting that Vivaldi is not 100% open-source, but you can find most of its source code online, except its UI. Also, it is based on Chromium.
|
||||
|
||||
However, it is a feature-rich web browser that lets you customize a lot of things. You also get a unique tab management feature, integration of web apps, email, calendar, timer, RSS feeds, and more.
|
||||
|
||||
I have been using Vivaldi as my daily driver on Linux, keeping Firefox as the secondary for a while now. And, I like the experience so far!
|
||||
|
||||
So, if you prefer multi-tasking without leaving the web browser, Vivaldi as your default choice should be exciting.
|
||||
|
||||
In addition to this, Vivaldi seems to be taking good care of its privacy policies while offering in-built ad blockers and encrypted sync features.
|
||||
|
||||
### Get Started Using Vivaldi on Manjaro Linux
|
||||
|
||||
You should be able to find and install Vivaldi through official Manjaro repositories.
|
||||
|
||||
If you want it by default, you can consider performing a fresh installation of Manjaro Linux Cinnamon.
|
||||
|
||||
Manjaro Linux Cinnamon
|
||||
|
||||
#### 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/vivaldi-replaces-firefox-manjaro/
|
||||
|
||||
作者:[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://news.itsfoss.com/vivaldi-4-0-release/
|
||||
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyNCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQyMCIgd2lkdGg9IjY2MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[5]: https://vivaldi.com
|
||||
[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYxOCIgd2lkdGg9IjY5NyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
@ -0,0 +1,103 @@
|
||||
[#]: subject: "Fedora 35 Release Date and Expected New Features"
|
||||
[#]: via: "https://news.itsfoss.com/fedora-35-release-date-features/"
|
||||
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Fedora 35 Release Date and Expected New Features
|
||||
======
|
||||
|
||||
Fedora 35 is just around the corner. And, if you cannot wait already, let us highlight some of the essential details about the release.
|
||||
|
||||
### Fedora 35 Release Date
|
||||
|
||||
The expected release date for Fedora 35 beta is **14th September 2021**. But, if delayed, the next planned date is **21st September 2021**.
|
||||
|
||||
After the public beta testing, the final release has been planned for **19th October 2021,** with a delayed date for **26th October 2021.**
|
||||
|
||||
Of course, you can get your hands on Fedora 35 before the final and beta releases as well. But, considering it is just a few days away from its first beta release, you may want to wait it out.
|
||||
|
||||
### Fedora 35 Features
|
||||
|
||||
![][1]
|
||||
|
||||
[Fedora 34][2] was an exciting release with GNOME 40 and a new i3 spin. And Fedora 35 is also shaping up as an interesting upgrade to it.
|
||||
|
||||
Some of the fundamental changes that you can expect are:
|
||||
|
||||
#### GNOME 41
|
||||
|
||||
GNOME 41 may not be a radical change when compared to [GNOME 40][3], but there are some visual improvements and valuable feature additions that you can expect.
|
||||
|
||||
For instance, the GNOME Software will get a clean look and context tiles, resembling much like all the details that you can find in the [Apps for GNOME][4] portal. You should also find [VoIP support added to GNOME 41][5].
|
||||
|
||||
A new “**Connections**” app has been added to let you connect to other platforms/systems remotely.
|
||||
|
||||
GNOME 41 has a planned release date of **September 22, 2021**. So, you may want to watch out for our coverage for the complete details when it releases.
|
||||
|
||||
#### DNS Over TLS Support
|
||||
|
||||
DNS Over TLS (DoT) is essential to encrypt DNS requests and prevent your ISP from spying. With Fedora 35, any configured DNS server should automatically attempt to connect using DoT if the DNS supports it.
|
||||
|
||||
#### Default Btrfs Filesystem for Fedora Cloud
|
||||
|
||||
While Fedora has already switched to the Btrfs filesystem since [Fedora 33][6], they enforce that change for the Cloud edition.
|
||||
|
||||
#### Linux Kernel 5.14
|
||||
|
||||
[Linux Kernel 5.14][7] wasn’t a big release, but it added many features, especially when it comes to ARM devices.
|
||||
|
||||
For Fedora 35, the improved hardware support should make a difference.
|
||||
|
||||
#### Flathub Applications Included with Third-Party Repositories
|
||||
|
||||
You also get some selected Flatpak applications added from a filtered Flathub remote when you enable third-party repositories.
|
||||
|
||||
This should come in handy for better third-party app support in Fedora.
|
||||
|
||||
#### PulseAudio Daemon Replaced by PipeWire
|
||||
|
||||
While we saw initial implementations of replacing PulseAudio in Fedora 34, this time, there is a proposal to replace the PulseAudio daemon with a compatible implementation based on PipeWire.
|
||||
|
||||
### Other Improvements
|
||||
|
||||
Along with the key highlights mentioned above, you should find several under-the-hood changes and package updates that could translate as significant upgrades.
|
||||
|
||||
For instance, the Firewalld package update and the GNU Toolchain update should prove to be valuable upgrades.
|
||||
|
||||
You can explore more about the proposed changes in their [official changeset wiki][8].
|
||||
|
||||
### Wrapping Up
|
||||
|
||||
It should be exciting to see the changes in the final release. For now, let us keep an eye out to test the public beta release. And, if you do not want to experiment on your system with a beta release, you should wait for the stable release.
|
||||
|
||||
#### 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/fedora-35-release-date-features/
|
||||
|
||||
作者:[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]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyMSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[2]: https://news.itsfoss.com/fedora-34-release/
|
||||
[3]: https://news.itsfoss.com/gnome-40-release/
|
||||
[4]: https://news.itsfoss.com/apps-for-gnome-portal/
|
||||
[5]: https://news.itsfoss.com/gnome-41-beta/
|
||||
[6]: https://itsfoss.com/fedora-33/
|
||||
[7]: https://news.itsfoss.com/kernel-5-14-release/
|
||||
[8]: https://fedoraproject.org/wiki/Releases/35/ChangeSet
|
@ -0,0 +1,103 @@
|
||||
[#]: subject: "Open-Source Frontend for Emulators “RetroArch” Now Available on Steam for Windows and Linux Users"
|
||||
[#]: via: "https://news.itsfoss.com/retroarch-steam/"
|
||||
[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Open-Source Frontend for Emulators “RetroArch” Now Available on Steam for Windows and Linux Users
|
||||
======
|
||||
|
||||
Since its release way back in 2010, [RetroArch][1] has been one of the most popular game emulator interfaces. Over the years, it has received numerous upgrades and lets you play classic games from various retro consoles ranging from the Atari 2600 to the PlayStation 2.
|
||||
|
||||
While the RetroArch team has been planning to launch this on Steam for more than a year, it is finally available to the masses!
|
||||
|
||||
This means you can now emulate and play your favorite retro games without having to leave Steam.
|
||||
|
||||
Sure, you can download it from their official website, but launching it directly from your Steam collection proves to be a hassle-free way for most users.
|
||||
|
||||
Not to forget, RetroArch’s presence on Steam will put this on a lot of people’s radars. So, this should give RetroArch’s popularity a boost on both Windows and Linux platforms.
|
||||
|
||||
![RetroArch on Steam][2]
|
||||
|
||||
Keep in mind that the RetroArch version available on Steam lacks certain features and most cores compared to the official one. Let us take a look at them.
|
||||
|
||||
### Key Highlights
|
||||
|
||||
#### Emulator Cores
|
||||
|
||||
Unlike the standard way of using the _Core Downloader_, Cores (Emulators) can be installed as **DLCs** from Steam. This can be easily done by navigating to **“Manage DLC”** on Steam’s Retroarch browser page.
|
||||
|
||||
Only 10 cores are available at launch. Here’s the list of cores –
|
||||
|
||||
* Mupen64 Plus Next – Nintendo N64
|
||||
* Kronos – Sega Saturn
|
||||
* PCSX ReARMed – PlayStation 1
|
||||
* Stella – Atari 2600
|
||||
* SameBoy – Game Boy & Game Boy Colour
|
||||
* mGBA – Game Boy Advance
|
||||
* Mesen – Nintendo Entertainment System
|
||||
* Mesen S – Super Nintendo Entertainment System
|
||||
* Genesis Plus GX – Sega SG-1000, Master System, Game Gear, Genesis and Mega CD
|
||||
* Final Burn Neo – Arcade
|
||||
|
||||
|
||||
|
||||
Additional cores will certainly be released in the future. According to the developer:
|
||||
|
||||
> More cores will be coming as DLC soon. We have no ETA on when these will arrive, but it will likely be a dripfeed of new cores on a periodic basis as it takes a lot of time preparing the pages, descriptions, logos, previews and whatnot that a Steam page requires.
|
||||
|
||||
RetroArch Blog
|
||||
|
||||
![Retroarch Main Menu \(Source: Retroarch\)][3]
|
||||
|
||||
#### Other Highlights
|
||||
|
||||
RetroArch UI stays the same. This may be overwhelming for users who will be using RetroArch for the first time. The developers have plans to revamp its UI soon enough.
|
||||
|
||||
Remote Play and Steam Cloud sync should also work.
|
||||
|
||||
Do note that RetroArch will only be available for 64-bit Linux or Windows PCs. As of now, there are no plans for macOS yet.
|
||||
|
||||
You can learn more about RetroArch’s availability on Steam on their [official blog post][4].
|
||||
|
||||
### Wrapping Up
|
||||
|
||||
The addition of RetroArch to Steam will certainly increase their userbase. Initial reviews seem to be very positive, which is a good thing!
|
||||
|
||||
They should get better financial support from new users on [Patreon][5] as well. You might as well start helping them out if interested.
|
||||
|
||||
If you want to try it out, head to your Steam client and search for it. Or, click on the link below to explore it on Steam store along with its system requirements.
|
||||
|
||||
[RetroArch on Steam][6]
|
||||
|
||||
**Via**: [GamingOnLinux][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/retroarch-steam/
|
||||
|
||||
作者:[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://www.retroarch.com/
|
||||
[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM3NSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQyOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[4]: https://www.libretro.com/index.php/retroarch-finally-released-on-steam/
|
||||
[5]: https://www.patreon.com/libretro
|
||||
[6]: https://store.steampowered.com/app/1118310/RetroArch/
|
||||
[7]: https://www.gamingonlinux.com/2021/09/retroarch-gets-a-steam-release-bringing-emulation-to-even-more-gamers
|
@ -1,73 +0,0 @@
|
||||
[#]: subject: (What is GNU/Linux Copypasta?)
|
||||
[#]: via: (https://itsfoss.com/gnu-linux-copypasta/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
What is GNU/Linux Copypasta?
|
||||
======
|
||||
|
||||
As a Linux user, you might have come across a long text that starts with “I’d like to interject for a moment. What you are referring to as Linux, is in fact, GNU/Linux”.
|
||||
|
||||
It makes some people confused about what is Linux and what is GNU/Linux. I have explained it in the article about the [concept of Linux distributions][1].
|
||||
|
||||
Basically, [Linux is a kernel][2] and with [GNU softwares][3], it becomes usable in the form of an operating system.
|
||||
|
||||
Many purists and enthusiasts don’t want people to forget the contribution of GNU to the Linux-based operating systems. Hence, they often post this long text (known as GNU Linux copypasta) in various forums and communities.
|
||||
|
||||
I am not sure of the origin of the GNU/Linux copypasta and since when it came into existence. Some people attribute it to Richard Stallman’s [article on GNU blog in 2011][4]. I cannot confirm or deny that.
|
||||
|
||||
### Complete GNU/Linux Copypasta
|
||||
|
||||
I’d just like to interject for a moment. What you’re refering to as Linux, is in fact, GNU/Linux, or as I’ve recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX.
|
||||
|
||||
Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called Linux, and many of its users are not aware that it is basically the GNU system, developed by the GNU Project.
|
||||
|
||||
There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine’s resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called Linux distributions are really distributions of GNU/Linux!
|
||||
|
||||
**Recommended Read:**
|
||||
|
||||
![][5]
|
||||
|
||||
#### [Linux Jargon Buster: What is FOSS (Free and Open Source Software)? What is Open Source?][6]
|
||||
|
||||
### What is a Copypasta, again?
|
||||
|
||||
![][7]
|
||||
|
||||
Did you notice that I used the term ‘copypasta’. It has nothing to do with Italian dish pasta.
|
||||
|
||||
[Copypasta][8] is a block of text which is copied and pasted across the internet, often to troll or poke fun at people. It is a degeneration of the term ‘copy-paste’.
|
||||
|
||||
Copypasta is also considered spam because they are repeated as it is a number of times. Take the example of GNU Linux copypasta. If a few people keep on pasting the huge text block every time someone uses Linux instead of GNU/Linux in a discussion forum, it would annoy other members.
|
||||
|
||||
### Have you ever used GNU/Linux Copypasta?
|
||||
|
||||
Personally, I have never done that. But, to be honest, that’s how I come to know about the term GNU/Linux when I was a new Linux users and was browsing through some Linux forum.
|
||||
|
||||
How about you? Have you ever copy-pasted the “I would like to interject for a moment” in a Linux forum? Do you think it’s a tool for ‘trolls’ or is it the necessary evil to make people aware of the GNU project?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/gnu-linux-copypasta/
|
||||
|
||||
作者:[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/what-is-linux-distribution/
|
||||
[2]: https://itsfoss.com/what-is-linux/
|
||||
[3]: https://www.gnu.org/
|
||||
[4]: https://www.gnu.org/gnu/linux-and-gnu.html
|
||||
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/09/what-is-foss.png?fit=800%2C450&ssl=1
|
||||
[6]: https://itsfoss.com/what-is-foss/
|
||||
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/copypasta.png?resize=800%2C450&ssl=1
|
||||
[8]: https://www.makeuseof.com/what-is-a-copypasta/
|
@ -0,0 +1,45 @@
|
||||
[#]: subject: "What I miss about open source conferences"
|
||||
[#]: via: "https://opensource.com/article/21/9/why-i-miss-conferences"
|
||||
[#]: author: "Mike Bursell https://opensource.com/users/mikecamel"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
What I miss about open source conferences
|
||||
======
|
||||
I can buy my own t-shirts, but friendships need nurturing.
|
||||
![Stickers from all different open source projects and communities][1]
|
||||
|
||||
A typical work year would involve my attending maybe six to eight conferences in person and speaking at quite a few of them. A few years ago, I stopped raiding random booths at the exhibitions usually associated with these for t-shirts for the simple reason that I had too many of them. That's not to say that I wouldn't accept one here or there if it was particularly nice, or an open source project which I esteemed particularly, for instance. Or ones which I thought my kids would like—they're not "cool" but are at least useful for sleepwear, apparently. I also picked up a lot of pens and enough notebooks to keep me going for a while.
|
||||
|
||||
And then, at the beginning of 2020, the pandemic hit, I left San Francisco, where I'd been attending meetings co-located with RSA North America (my employer at the time made the somewhat prescient decision not to allow us to go to the main conference), and I've not attended any in-person conferences since.
|
||||
|
||||
There are some good things about this, the most obvious being less travel, though, of late, my family has been dropping an increasing number of not-so-subtle hints about how it would be good if I let them alone for a few days so they can eat food I don't like (pizza and macaroni cheese, mainly) and watch films that I don't enjoy (largely, but not exclusively, romcoms on Disney+). The downsides are manifold. Having to buy my own t-shirts and notebooks, obviously, though it turns out that I'd squirreled away enough pens for the duration. It also turned out that the move to USB-C connectors hadn't sufficiently hit the conference swag industry by the end of 2019 for me to have enough of those to keep me going, so I've had to purchase some of those. That's the silly, minor stuff, though—what about areas where there's real impact?
|
||||
|
||||
Virtual conferences aren't honestly too bad, and the technology has definitely improved over the past few months. I've attended some very good sessions online (and given my share of sessions and panels, whose quality I won't presume to judge), but I've realised that I'm much more likely to attend borderline-interesting talks not on my main list of "must-sees" (some of which turn out to be very valuable) if I've actually traveled to get to a venue. The same goes for attention. I'm much less likely to be checking email, writing emails, and responding to chat messages in an in-person conference than a virtual one. It's partly about the venue, moving between rooms, and not bothering to get my laptop out all the time—not to mention the politeness factor of giving your attention to the speaker(s) or panellists. When I'm sitting at my desk at home, none of these is relevant, and the pull of the laptop (which is open anyway to watch the session) is generally irresistible.
|
||||
|
||||
Two areas that have really suffered, though, are the booth experience and the "hallway track." I've had some very fruitful conversations, both from dropping by booths (sometimes mainly for a t-shirt—see above) or from staffing a booth and meeting those who visit. I've yet to attend any virtual conferences where the booth experience has worked, particularly for small projects and organisations. Online chat isn't the same, and the serendipitous aspect of wandering past a booth and seeing something you'd like to talk about is pretty much entirely missing if you have to navigate a set of webpages of menu options with actual intent.
|
||||
|
||||
The hallway track is meeting people outside a conference's main sessions, either people you know already or as conversations spill out of sessions you've been attending. Knots of people asking questions of presenters or panellists can reveal shared interests, opposing but thought-provoking points of view, or just similar approaches to a topic which can lead to valuable professional relationships and even long-term friendships. I'm not a particularly gregarious person—particularly if I'm tired and jetlagged—but I really enjoy catching up with colleagues and friends over a drink or a meal from time to time. While that's often difficult given the distributed nature of the companies and industries I've been involved with, conferences have presented great opportunities to meet up, have a chinwag and discuss the latest tech trends, mergers and acquisitions, and fashion failures of our fellow attendees. This is what I miss most: I can buy my own t-shirts, but friendships need nurturing. And I hope that we can safely start attending conferences again so that I can meet up with friends and share a drink. I just hope I'm not the one making the fashion mistakes (this time).
|
||||
|
||||
* * *
|
||||
|
||||
_This article was originally published on [Alice, Eve, and Bob][2] and is reprinted with the author's permission._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/9/why-i-miss-conferences
|
||||
|
||||
作者:[Mike Bursell][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/mikecamel
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/stickers-osdc-lead.png?itok=2RNn132b (Stickers from all different open source projects and communities)
|
||||
[2]: https://aliceevebob.com/2021/08/24/buying-my-own-t-shirts-or-what-i-miss-about-conferences/
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (zpl1025)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (runningwater)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
@ -221,7 +221,7 @@ via: https://www.networkworld.com/article/3543232/how-to-examine-processes-runni
|
||||
|
||||
作者:[Sandra Henry-Stocker][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
译者:[runningwater](https://github.com/runningwater)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -1,101 +0,0 @@
|
||||
[#]: subject: "elementary OS 6 ODIN Released. This is What’s New."
|
||||
[#]: via: "https://www.debugpoint.com/2021/08/elementary-os-6/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
elementary OS 6 ODIN Released. This is What’s New.
|
||||
======
|
||||
The team announced the release of elementary OS 6 ODIN, and it is
|
||||
immediately available for download. We recap the release in this post.
|
||||
![elementary OS 6 ODIN Desktop][1]
|
||||
|
||||
The elementary OS 6 code named “ODIN” was a long due. This release coming after more than two years since its predecessor, [elementary OS 5.1 Hera][2]. A lot had happened in the last two years, that includes a full-fledged pandemic. Despite all the challenges, roadblocks – a brand new and much awaited release is here.
|
||||
|
||||
Let’s take a look at what’s new.
|
||||
|
||||
### elementary OS 6 Odin – What’s New
|
||||
|
||||
The team promises the following items in a nutshell in this release:
|
||||
|
||||
> Empowering you to be in control and express yourself,
|
||||
> Continuing to innovate with new features, and
|
||||
> Making elementary OS easier to get and more inclusive
|
||||
|
||||
* This release is based on Ubuntu 20.04 and Linux Kernel 5.8. If you ask me, it’s late at this moment to have a new version of a distro based on Ubuntu 20.04 whereas next LTS is due in 2022.
|
||||
* Dark theme and new ascent color is introduced in this release. With the dark theme enabled, all the default applications, windows automatically adapt to dark mode. This mode also can be set based on sunset and sunrise at your location.
|
||||
* The ascent colors applied across the system when chosen. A fair and nice list of assent colors are available.
|
||||
* The new dark theme is designed such as way that third party app developers can easily integrate their application to follow elementary OS stylesheet.
|
||||
|
||||
|
||||
|
||||
![Dark and Light theme][3]
|
||||
|
||||
* All apps in AppCenter are now Flatpak apps which runs in their separate sandbox. This is one of the best move by elementary team and all the Flatpak apps requires separate permission controls via settings.
|
||||
* If you are a touchpad/touch device fan, then you are in for a treat. Three finger swipe up gestures brings up the activities overview.
|
||||
* Three finger left and right – swap between dynamic workspaces.
|
||||
* And all the applicable apps uses two finger gestures.
|
||||
* Notifications are revamped with new look and can follow dark theme.
|
||||
* A new task application introduced to track your tasks and can sync with online accounts.
|
||||
* elementary OS 6 comes with firmware updates built in, powered by the Linux Vendor Firmware Service. Firmware updates are provided for supported devices by hardware manufacturers like Star Labs, Dell, Lenovo, HP, Intel, Logitech, Wacom, 8bitdo, and many more—now supported devices can get the latest updates for security and stability straight from System Settings → System → Firmware or by searching the Applications Menu for “Firmware.”
|
||||
* Native applications are updated and redesigned completely. Epiphany browser is renamed as Web. Mail is completely rewritten with tighter integration with online accounts.
|
||||
* Files introduces a different behavioral change. You need to single click to browse folders, but double click for files. This can not be changed via gsettings.
|
||||
* And many more updates, which you can read in the [change log][4] here.
|
||||
|
||||
|
||||
|
||||
[][5]
|
||||
|
||||
SEE ALSO: elementary OS 6 Beta Released. Download and Test Now!
|
||||
|
||||
### Minimum System Requirement for elementary OS 6
|
||||
|
||||
Here’s a system specification for this version, before you hit download.
|
||||
|
||||
* Recent Intel i3 or comparable dual-core 64-bit processor
|
||||
* 4 GB of system memory (RAM)
|
||||
* Solid state drive (SSD) with 15 GB of free space
|
||||
* Internet access
|
||||
* Built-in or wired mouse/touchpad and keyboard
|
||||
* 1024×768 minimum resolution display
|
||||
|
||||
|
||||
|
||||
### elementary OD 6 Odin – Download
|
||||
|
||||
The .iso files for the new release is available in below link. Due to rush, the servers might be busy, hence it is recommended to use torrents if possible.
|
||||
|
||||
[Download elementary OS 6 ODIN][6]
|
||||
|
||||
### How to Upgrade
|
||||
|
||||
There is no upgrade path available at the moment to upgrade to elementary 6 from elementary 5.1. Hence, you need to take backups and do a fresh installation via .iso available in above link.
|
||||
|
||||
### Closing Notes
|
||||
|
||||
There is no question that elementary OS is a one-of-a-kind Linux Distribution today. And its popularity is increasing everyday due to the awesome Pantheon desktop. It is one of the rare Linux distribution which appeals both macOS and Windows users. That said, I think the development process requires a bit faster and two years of the wait between versions is too long for IT. This release is based on Ubuntu 20.04 which is already two years old, and we have a new LTS coming up on 2022. And of course there is no upgrade path. I believe if the team work on these aspects, considering dedicated developers, donations, I think it would be one of the best Linux distro.
|
||||
|
||||
* * *
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/2021/08/elementary-os-6/
|
||||
|
||||
作者:[Arindam][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://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/elementary-OS-6-ODIN-Desktop-1024x576.jpg
|
||||
[2]: https://www.debugpoint.com/2019/12/elementary-os-hera-released/
|
||||
[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/Dark-and-Light-theme-1024x692.png
|
||||
[4]: https://blog.elementary.io/elementary-os-6-odin-released/
|
||||
[5]: https://www.debugpoint.com/2021/05/elementary-os-6-beta/
|
||||
[6]: https://elementary.io/
|
@ -1,118 +0,0 @@
|
||||
[#]: subject: "SparkyLinux 6.0 “Po-Tolo” Released Based on Debian 11 Bullseye"
|
||||
[#]: via: "https://www.debugpoint.com/2021/08/sparky-linux-6-review/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
SparkyLinux 6.0 “Po-Tolo” Released Based on Debian 11 Bullseye
|
||||
======
|
||||
We review the SparkyLinux 6 “Po-Tolo” and round up the release.
|
||||
[SparkyLinux][1] is a desktop-based Linux distribution based on Debian and provides almost all major desktop flavors. It is a unique distribution in the sense that it provides both Debian Stable and Debian Testing editions with the latest desktop packages. SparkyLinux also provides a collection of curated applications, with some special editions as well. For example, if you are a Game lover, then the SparkyLinux GameOver edition is there. For system admins, there is a Rescue Edition as well to fix broken systems. All these special editions come with pre-loaded games, utilities with some proprietary packages as well.
|
||||
|
||||
The latest release of SparkyLinux 6 brings the packages from [Debian 11 Bullseye][2], which released a while back. Let’s take a look at what’s new.
|
||||
|
||||
![SparkyLinux 6 desktop \(Xfce\)][3]
|
||||
|
||||
### SparkyLinux 6 – What’s New
|
||||
|
||||
* SparkyLinux 6 is based on Debian 11 Bullseye.
|
||||
* Powered by Linux Kernel 5.10.x LTS
|
||||
|
||||
|
||||
* This distribution maintains its own repo, and it is now updated with Bullseye packages.
|
||||
* The default and necessary applications are updated to their respective Debian stable version. Here’s a quick update:
|
||||
|
||||
|
||||
|
||||
– Firefox 78.13.0ESR instead of Firefox (latest)
|
||||
– Thunderbird 78.13.0
|
||||
– VLC 3.0.16
|
||||
– LibreOffice 7.0.4
|
||||
– Calamares 3.2.41.1
|
||||
|
||||
* The default AppCenter – APTUS is included in this release which provides you curated 2000+ applications which can be installed via a simple GUI with one-click. This is one of the best feature of SparkyLinux, specially for new users or large deployments.
|
||||
|
||||
|
||||
* The APTUS – AppCenter also provides one-click features for the followings –
|
||||
|
||||
|
||||
|
||||
System upgrade
|
||||
Search packages
|
||||
Fix broken packages
|
||||
Edit repo
|
||||
Clean up cache
|
||||
…and more
|
||||
|
||||
* Desktop environments retain their current stable versions with Sparky flavors –
|
||||
|
||||
|
||||
|
||||
Xfce 4.16
|
||||
KDE Plasma 5.22
|
||||
LXQt 0.17
|
||||
|
||||
* Other changes include, the MinimalGUI version changed file manager to PCManFM and browser to Firefox ESR.
|
||||
|
||||
|
||||
|
||||
Detailed changes with information is available [here][4].
|
||||
|
||||
### Download, Upgrade and Install
|
||||
|
||||
If you are using an earlier version of SparkyLinux, simple making a system upgrade takes you to SparkyLinux 6.0. No additional steps are required.
|
||||
|
||||
[][5]
|
||||
|
||||
SEE ALSO: SparkyLinux 2021.03 Gets First-Ever KDE Plasma Edition with Debian 11
|
||||
|
||||
For fresh installation with respective Desktop environments – refer below link for download. You can use [Etcher][6] or similar utility to create LIVE usb for fresh installation. Do not forget to turn off secure boot if you are installing in UEFI systems.
|
||||
|
||||
[download sparkylinux stable][7]
|
||||
|
||||
### Sparky Linux 6 – Quick Review
|
||||
|
||||
* I ran SparkyLinux in a virtual machine and native install, both with Xfce desktop edition for a quick test. The installation went smooth, thanks to the awesome Calamares installer. No surprises there.
|
||||
* After initial boot, a welcome screen guides you to go over the important items if you may want to read. SparkyLinux takes care of system configurations based on GUI based utility. For example, you do not need to open terminal and run “sudo apt upgrade” to update your system. It’ll prompt you that an upgrade is available, you give admin password, and it takes care of it.
|
||||
* SparkyLinux is super stable thanks to Debian and very lightweight. In idle scenario, the Xfce desktop with SparkyLinux was consuming around 600 MB of memory and most of the CPU is used by respective desktop window manager which is at around 5%.
|
||||
* If you are using KDE Plasma or LXQt – the memory and CPU usage should vary, but they would not fluctuate much.
|
||||
* The APTUS – AppCenter plus system administration utility is one of the best feature which makes it stand apart among other distributions.
|
||||
|
||||
|
||||
|
||||
![APTus APPCENTER in SparkyLinux][8]
|
||||
|
||||
* And the good thing is, it gives you flavors of Debian Rolling and Debian Stable both. If you want to use Debian Rolling packages in SparkyLinux, then you can get it out-of-the-box.
|
||||
|
||||
|
||||
|
||||
That said, it’s a simple, stable and user-friendly distribution. Give it a try if you have not yet; It is a perfect and suitable daily-usage distro.
|
||||
|
||||
Cheers.
|
||||
|
||||
* * *
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/2021/08/sparky-linux-6-review/
|
||||
|
||||
作者:[Arindam][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://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://sparkylinux.org
|
||||
[2]: https://www.debugpoint.com/2021/05/debian-11-features/
|
||||
[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/SparkyLinux-6-desktop-Xfce-1024x764.jpeg
|
||||
[4]: https://sparkylinux.org/sparky-6-0-po-tolo/
|
||||
[5]: https://www.debugpoint.com/2021/03/sparkylinux-2021-03-release/
|
||||
[6]: https://www.debugpoint.com/2021/01/etcher-bootable-usb-linux/
|
||||
[7]: https://sparkylinux.org/download/stable/
|
||||
[8]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/APTus-APPCENTER-in-SparkyLinux-1024x781.jpeg
|
@ -1,25 +0,0 @@
|
||||
[#]: subject: ""
|
||||
[#]: via: "https://www.2daygeek.com/upgrade-opensuse-from-15-2-to-15-3/"
|
||||
[#]: author: " "
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
|
||||
======
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.2daygeek.com/upgrade-opensuse-from-15-2-to-15-3/
|
||||
|
||||
作者:[][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:
|
||||
[b]: https://github.com/lujun9972
|
@ -1,252 +0,0 @@
|
||||
[#]: subject: "How to Easily Install Debian Linux"
|
||||
[#]: via: "https://itsfoss.com/install-debian-easily/"
|
||||
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "guevaraya "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How to Easily Install Debian Linux
|
||||
======
|
||||
|
||||
Installing Debian could be easy or complicated depending upon the ISO you choose.
|
||||
|
||||
If you go with the default ISO provided by the Debian website, you’ll have a hard time installing Debian. You’ll be stuck at a screen that asks for network drivers to be installed from external removable media.
|
||||
|
||||
![Installing Debian from default ISO is problematic for new users][1]
|
||||
|
||||
You may, of course, troubleshoot that, but it makes things unnecessarily complicated.
|
||||
|
||||
Don’t worry. Let me show the steps for installing Debian comfortably and easily.
|
||||
|
||||
### The easy way of installing Debian as a desktop
|
||||
|
||||
Before you see the steps, please have a look at things you need.
|
||||
|
||||
* A USB key (pen drive) with at least 4 GB in size.
|
||||
* A system with internet connection (could be the same system where it will be installed).
|
||||
* A system where you’ll be installing Debian. It will wipe out everything on this system so please copy your important data on some other external disk.
|
||||
|
||||
|
||||
|
||||
What kind of system specification you should have for Debian? It depends on the [desktop environment][2] you are going to use. For example, GNOME desktop environment could work on 4 GB RAM but it will work a lot better on an 8 GB RAM. If you have 4 GB or less, try using KDE, Cinnamon or Xfce desktops.
|
||||
|
||||
Debian also has both [32-bit and 64-bit architecture][3] support. You’ll have to get the Debian ISO according to your processor architecture.
|
||||
|
||||
Your system should have at least 25 GB of disk space to function. The more, the merrier.
|
||||
|
||||
Warning!
|
||||
|
||||
This method removes all the other operating systems along with the data present on the disk.
|
||||
|
||||
You may save your personal files, documents, pictures etc on an external USB disk or cloud storage if you want to use it later.
|
||||
|
||||
In this tutorial, I am going to show the steps for installing Debian 11 Bullseye with GNOME desktop environment. The steps should be the same even if you choose some other desktop environment.
|
||||
|
||||
_**This tutorial is tested on a UEFI system with GPT partitioning. If you have [MBR instead of GPT][4] or [legacy BIOS instead of UEFI][5], the live USB creation step will be different.**_
|
||||
|
||||
#### Step 1: Getting the correct Debian ISO
|
||||
|
||||
Half of the battle in installing Debian is choosing the correct ISO. Surprisingly, it is really difficult to navigate through its website and find that ISO which is the easiest for a new Debian user.
|
||||
|
||||
If you click the Download button on the [homepage of Debian website][6], it downloads a minimal net install file which will be super complicate for a regular user. Please DO NOT use this.
|
||||
|
||||
Instead, you should go for the live ISO. But here is a catch, there are separate live versions with non-free software (includes drivers for your networking hardware).
|
||||
|
||||
You should download this non-free live ISO. Another problem here is that you won’t get it mentioned prominently on the website and there are various URLs for torrents or direct downloads for various architecture.
|
||||
|
||||
Let me link them here.
|
||||
|
||||
[Main repo for 32 and 64 bit][7]
|
||||
|
||||
[Debian 11 Direct][8]
|
||||
|
||||
[Debian 11 Torrent][9]
|
||||
|
||||
You’ll see several files with the of desktop environment mentioned in the filename. Choose the one with desktop environment of your choice. For direct downloads, click on the links that end with .iso.
|
||||
|
||||
![Downloading the Debian Live Non-free ISO][10]
|
||||
|
||||
Once you have the appropriate ISO downloaded, the rest is standard procedure that you may have experienced with other Linux distributions.
|
||||
|
||||
#### Step 2: Creating live USB of Debian
|
||||
|
||||
Plug in the USB into your system. It will be wise to format it just for the sake of it. It will be formatted anyway.
|
||||
|
||||
You can use any live USB creation tool of your choice. If you are using Windows, go with Rufus. I am going to use Etcher here because it is available for both Windows and Linux.
|
||||
|
||||
Download Etcher from its website.
|
||||
|
||||
[Download Etcher][11]
|
||||
|
||||
I have a dedicated [tutorial on using Etcher in Linux][12] and thus I am not going to go in detail here. Just run the downloaded executable file, browse to the Debian ISO, make sure that correct USB is selected and then hit the Flash button.
|
||||
|
||||
![Creating Live Debian USB with Etcher][13]
|
||||
|
||||
It may take a couple of minutes to create the live USB. Once that is ready, it is time to boot from it.
|
||||
|
||||
#### Step 3: Boot from the live USB
|
||||
|
||||
Restart the system where you want to install Debian. When it is showing the manufacturer’s logo, press F2/F10 or F12 key to access the boot settings. You may also [access the UEFI firmware settings from Windows.][14]
|
||||
|
||||
Some systems do not allow booting from live USB if secure boot is enabled. If that is the case, please [disable secure boot from the BIOS settings][15].
|
||||
|
||||
The screen may look different for different manufacturers.
|
||||
|
||||
![][16]
|
||||
|
||||
Once you make the change, press F10 to save and exit. Your system will boot once again.
|
||||
|
||||
Again, press F2/F10 or F12 to access the boot settings when it shows the manufacturer’s logo. You should see the option to boot from the USB. Select it.
|
||||
|
||||
![][17]
|
||||
|
||||
It takes a little bit of time and then you should see a screen like this. Go with the first option here.
|
||||
|
||||
![Debian live boot screen][18]
|
||||
|
||||
#### Step 4: Start Debian installation
|
||||
|
||||
When you enter the live Debian session, it may show some welcome screen with option to choose your keyboard and language if you are using GNOME desktop. Just hit next when you see those screens.
|
||||
|
||||
![Debian live welcome screen][19]
|
||||
|
||||
Once you are past the welcome screen, press the Windows/Super key to bring the activity area. You should see the Debian install button here.
|
||||
|
||||
![Start Debian Installation][20]
|
||||
|
||||
It opens the friendly [Calamares graphical installer][21]. Things are pretty straightforward from here.
|
||||
|
||||
![Debian 11 Calamares graphical installer][22]
|
||||
|
||||
It asks you to select your geographical location and time zone.
|
||||
|
||||
![Select your location and time zone][23]
|
||||
|
||||
On the next screen, you’ll be asked to select the keyboard. Please **pay attention** here. Your keyboard is automatically selected based on your location. For example, I had used India as my location and it automatically set the default Indian keyboard with Hindi language. I had to change it to English India.
|
||||
|
||||
![Choosing keyboard layout][24]
|
||||
|
||||
The next screen is about the disk partition and where you would like to install Debian. In this case, you are going to install Debian as the only operating system on your computer.
|
||||
|
||||
The easiest option would to go with ‘Erase disk’ option. Debian will put everything under root except the mandatory ESP partition and Swap space. In fact, it shows what your disk would like after your chosen installation method.
|
||||
|
||||
![Disk partitioning][25]
|
||||
|
||||
If you want to take matter in your hands, you may also opt for manual partitioning and choose how much you want to allot to root, home, boot or swap. Only do that when you know what you are doing.
|
||||
|
||||
On the next screen, you have to provide the username and password. It does not set root password and keeps it empty.
|
||||
|
||||
![Set Username and password][26]
|
||||
|
||||
This also means that you can use sudo with the newly created user. In the ‘complicated Debian install’, you could also set root password but then you’ll have to add the normal user to sudoer list manually. See, this installation method is easier for beginners, right?
|
||||
|
||||
Before it goes on with the actual installation, it presents you with a summary of the choices you have made. If things look good, hit the install button.
|
||||
|
||||
![Summary of your installation choices][27]
|
||||
|
||||
Now it is just a matter of waiting for the installation to finish.
|
||||
|
||||
![Installing Debian][28]
|
||||
|
||||
It takes a few minutes to complete the installation. When the installation finishes, it asks for a restart.
|
||||
|
||||
![Finished Debian installation][29]
|
||||
|
||||
Restart your system and if everything goes well, you should see the grub screen with Debian.
|
||||
|
||||
![Debian boot screen][30]
|
||||
|
||||
### Troubleshooting tip (if your system does not boot into Debian)
|
||||
|
||||
In my case, my Dell system did not recognize any operating system to boot. This was weird because I had see Debian creating an ESP partition.
|
||||
|
||||
If it is the same case with you, go to BIOS settings. Check the boot sequence. If you do not see anything, click on the Add boot option.
|
||||
|
||||
![Add new boot option][31]
|
||||
|
||||
It should give you an option to add an EFI file.
|
||||
|
||||
![Browse to EFi file][32]
|
||||
|
||||
Since Debian created ESP partition during installation, there is an EFI directory created with necessary files.
|
||||
|
||||
![Select EFI directory][33]
|
||||
|
||||
It should show a Debian folder along with some other folders. Select Debian folder.
|
||||
|
||||
![Select Debian][34]
|
||||
|
||||
In this Debian folder, you’ll find files like grubx64.efi, shimx64.efi. Select shimx64.efi.
|
||||
|
||||
![Select shim.efi][35]
|
||||
|
||||
You may give this file an appropriate name. The final screen may look like this.
|
||||
|
||||
![Adding the new boot option with efi file][36]
|
||||
|
||||
Now, you should have this boot option. Since I named it Debian, it shows two Debian boot options (one of them coming from the efi file I guess). Press F10 to save and exit the BIOS settings.
|
||||
|
||||
![New boot option added][37]
|
||||
|
||||
When your system boots now, you should see the grub screen with Debian boot option. You can start enjoying Debian now.
|
||||
|
||||
![][30]
|
||||
|
||||
### Were you able to install Debian?
|
||||
|
||||
I hope I made things simpler here. It is not that you cannot install Debian from the default net installer ISO. It just takes (a lot) more effort.
|
||||
|
||||
Was this tutorial helpful for you in installing Debian? Are you still facing issues? Please let me know in the comment section and I’ll try to help you out.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/install-debian-easily/
|
||||
|
||||
作者:[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://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Debian-firmware.png?resize=800%2C600&ssl=1
|
||||
[2]: https://itsfoss.com/what-is-desktop-environment/
|
||||
[3]: https://itsfoss.com/32-bit-64-bit-ubuntu/
|
||||
[4]: https://itsfoss.com/check-mbr-or-gpt/
|
||||
[5]: https://itsfoss.com/check-uefi-or-bios/
|
||||
[6]: https://www.debian.org/
|
||||
[7]: https://cdimage.debian.org/images/unofficial/non-free/images-including-firmware/11.0.0-live+nonfree/
|
||||
[8]: https://cdimage.debian.org/images/unofficial/non-free/images-including-firmware/11.0.0-live+nonfree/amd64/iso-hybrid/
|
||||
[9]: https://cdimage.debian.org/images/unofficial/non-free/images-including-firmware/11.0.0-live+nonfree/amd64/bt-hybrid/
|
||||
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/downloading-Debian-live-non-free-iso.png?resize=800%2C490&ssl=1
|
||||
[11]: https://www.balena.io/etcher/
|
||||
[12]: https://itsfoss.com/install-etcher-linux/
|
||||
[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/creating-live-debian-usb-with-etcher-800x518.png?resize=800%2C518&ssl=1
|
||||
[14]: https://itsfoss.com/access-uefi-settings-windows-10/
|
||||
[15]: https://itsfoss.com/disable-secure-boot-windows/
|
||||
[16]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2014/05/Disable_Secure_Boot_Windows8.jpg?resize=700%2C525&ssl=1
|
||||
[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/boot-from-windows-disk-ventoy.jpg?resize=800%2C611&ssl=1
|
||||
[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/debian-live-boot-screen.png?resize=617%2C432&ssl=1
|
||||
[19]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/debian-live-welcome-screen.png?resize=800%2C450&ssl=1
|
||||
[20]: https://itsfoss.com/wp-content/uploads/2021/08/start-Debian-installation-800x473.webp
|
||||
[21]: https://calamares.io/
|
||||
[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-1.png?resize=800%2C441&ssl=1
|
||||
[23]: https://itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-2-800x441.webp
|
||||
[24]: https://itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-4-800x441.webp
|
||||
[25]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-5.png?resize=800%2C441&ssl=1
|
||||
[26]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-6.png?resize=800%2C441&ssl=1
|
||||
[27]: https://itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-7-800x500.webp
|
||||
[28]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-8.png?resize=800%2C500&ssl=1
|
||||
[29]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-9.png?resize=800%2C500&ssl=1
|
||||
[30]: https://itsfoss.com/wp-content/uploads/2021/08/debian-boot-screen.webp
|
||||
[31]: https://itsfoss.com/wp-content/uploads/2021/08/add-new-boot-option.webp
|
||||
[32]: https://itsfoss.com/wp-content/uploads/2021/08/add-efi-file-for-boot-option.webp
|
||||
[33]: https://itsfoss.com/wp-content/uploads/2021/08/select-efi-file-boot-option.webp
|
||||
[34]: https://itsfoss.com/wp-content/uploads/2021/08/select-debian-folder-for-uefi.webp
|
||||
[35]: https://itsfoss.com/wp-content/uploads/2021/08/select-shim-boot.webp
|
||||
[36]: https://itsfoss.com/wp-content/uploads/2021/08/new-boot-option.webp
|
||||
[37]: https://itsfoss.com/wp-content/uploads/2021/08/new-boot-option-added.webp
|
@ -1,82 +0,0 @@
|
||||
[#]: subject: "Getting the Top Indicator Panel Back in GNOME"
|
||||
[#]: via: "https://itsfoss.com/enable-applet-indicator-gnome/"
|
||||
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Getting the Top Indicator Panel Back in GNOME
|
||||
======
|
||||
|
||||
GNOME is the popular desktop environment that thrives to give Linux a modern desktop experience.
|
||||
|
||||
While it works for the most part, some of their decisions has left the user fuming and questioning.
|
||||
|
||||
You cannot have icons and files on the desktop, [new document option has been removed][1] from the right click context menu. In addition to that, GNOME has also removed the applet indicator functionality.
|
||||
|
||||
You know what indicator applets are, don’t you? Those little icons that let you access additional features of the given application. I have plenty of them in my Ubuntu system.
|
||||
|
||||
![Indicator applets][2]
|
||||
|
||||
And this creates a problem, specially for applications that rely completely on these applet indicators to function. Take [Dropbox][3] for example. The only way to access Dropbox settings is through the app-indicator and you won’t find it in GNOME.
|
||||
|
||||
That’s a problem, but thankfully, there is a workaround for that.
|
||||
|
||||
### Enabling applet indicator in GNOME via extension
|
||||
|
||||
If you are using GNOME, you probably already know what GNOME Extension is. These are basically small add-ons developed by enthusiastic, independent developers.
|
||||
|
||||
If not done already, [enable GNOME extensions][4]. It’s actually quite simple. Go to any GNOME extension’s page using Firefox or Chrome and it will suggest downloading a browser extension. Install it and you are good to go.
|
||||
|
||||
![Enabling GNOME Extension browser add-on][5]
|
||||
|
||||
Now, there are several GNOME extensions available that allow adding applet indicators in the top panel. At the time of writing this tutorial, [AppIndicator and KStatusNotifierItem Support][6] extension is well developed and supported for the recent GNOME versions.
|
||||
|
||||
Go to its webpage:
|
||||
|
||||
[AppIndicator Extension][6]
|
||||
|
||||
On the page, you should see a toggle button. Click it to install it.
|
||||
|
||||
![][7]
|
||||
|
||||
There will be a pop-up. Hit install when you see it.
|
||||
|
||||
![Install the extension][8]
|
||||
|
||||
The results won’t be seen immediately. You’ll have to restart GNOME. On Xorg, you could just use Alt+F2 and enter r but that does not work in Wayland.
|
||||
|
||||
Log out of the system and log back in. Applet indicator should be activated now. If you have any applications installed that provides an indicator applet, you should see it on the top panel.
|
||||
|
||||
In my case, I had Dropbox already installed and hence it started showing the icon in the top panel.
|
||||
|
||||
![Dropbox indicator working in GNOME][9]
|
||||
|
||||
I hope this little tip help you gain access to the app indicators in the top panel of GNOME again.
|
||||
|
||||
I do not know why the GNOME developers though that dropping this essential feature was a good idea. Anyway, if one door closes, another opens (usually). Enjoy GNOME to your liking.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/enable-applet-indicator-gnome/
|
||||
|
||||
作者:[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/add-new-document-option/
|
||||
[2]: https://itsfoss.com/wp-content/uploads/2021/09/indicator-applet-linux.webp
|
||||
[3]: https://www.dropbox.com
|
||||
[4]: https://itsfoss.com/gnome-shell-extensions/
|
||||
[5]: https://itsfoss.com/wp-content/uploads/2021/09/installing-gnome-extension-add-on-800x355.webp
|
||||
[6]: https://extensions.gnome.org/extension/615/appindicator-support/
|
||||
[7]: https://itsfoss.com/wp-content/uploads/2021/09/appindicator-extension-800x329.webp
|
||||
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/installing-appindicator-extension.png?resize=800%2C269&ssl=1
|
||||
[9]: https://itsfoss.com/wp-content/uploads/2021/09/gnome-dropbox-indicator-800x561.webp
|
@ -1,81 +0,0 @@
|
||||
[#]: subject: "Resize an image from the Linux terminal"
|
||||
[#]: via: "https://opensource.com/article/21/9/resize-image-linux"
|
||||
[#]: author: "Jim Hall https://opensource.com/users/jim-hall"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Resize an image from the Linux terminal
|
||||
======
|
||||
Shrink an image from your terminal with the ImageMagick convert command.
|
||||
![Old camera blue][1]
|
||||
|
||||
ImageMagick is a handy multipurpose command-line tool for all your image needs. ImageMagick supports a variety of image types, including JPG photos and PNG graphics.
|
||||
|
||||
### Resizing images
|
||||
|
||||
I often use ImageMagick on my webserver to resize images. For example, let's say I want to include a photo of my cats on my personal website. The photo from my phone is very large, about 4000x3000 pixels, at 3.3MB. That's much too large for a web page. I use the ImageMagick convert tool to change the size of my photo so that I can include it on my web page. ImageMagick is a full suite of tools, one of the most common is the `convert` command.
|
||||
|
||||
The ImageMagick `convert` command uses this general syntax:
|
||||
|
||||
|
||||
```
|
||||
`convert {input} {actions} {output}`
|
||||
```
|
||||
|
||||
To resize a photo called `PXL_20210413_015045733.jpg` to a more manageable 500-pixel width, type this:
|
||||
|
||||
|
||||
```
|
||||
`$ convert PXL_20210413_015045733.jpg -resize 500x sleeping-cats.jpg`
|
||||
```
|
||||
|
||||
The new image is now only 65KB in size.
|
||||
|
||||
![Sleeping cats][2]
|
||||
|
||||
Jim Hall, [CC BY-SA 4.0][3]
|
||||
|
||||
You can provide both width and height dimensions with the `-resize` option. But, by providing only the width, ImageMagic does the math for you and automatically retains the aspect ratio by resizing the output image with a proportional height.
|
||||
|
||||
### Install ImageMagick on Linux
|
||||
|
||||
On Linux, you can install ImageMagick using your package manager. For instance, on Fedora or similar:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo dnf install imagemagick`
|
||||
```
|
||||
|
||||
On Debian and similar:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo apt install imagemagick`
|
||||
```
|
||||
|
||||
On macOS, use [MacPorts][4] or [Homebrew][5].
|
||||
|
||||
On Windows, use [Chocolatey][6].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/9/resize-image-linux
|
||||
|
||||
作者:[Jim Hall][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/jim-hall
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-photo-camera-blue.png?itok=AsIMZ9ga (Old camera blue)
|
||||
[2]: https://opensource.com/sites/default/files/sleeping-cats.jpg (Sleeping cats)
|
||||
[3]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[4]: https://opensource.com/article/20/11/macports
|
||||
[5]: https://opensource.com/article/20/6/homebrew-mac
|
||||
[6]: https://opensource.com/article/20/3/chocolatey
|
@ -1,97 +0,0 @@
|
||||
[#]: subject: "How to Stop a Program in Linux Terminal"
|
||||
[#]: via: "https://itsfoss.com/stop-program-linux-terminal/"
|
||||
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How to Stop a Program in Linux Terminal
|
||||
======
|
||||
|
||||
It’s amusing how the simplest of the things could be complicated when you are new to something.
|
||||
|
||||
The other day, I found my friend could not figure out how to exit the top command. Instead of stopping the command, he closed the entire terminal application.
|
||||
|
||||
That’s not only unnecessary, it is a not good thing to do.
|
||||
|
||||
### Stopping programs in Linux
|
||||
|
||||
In Linux, you can use the Ctrl+C keys to stop a running program in the terminal. This works for Ubuntu as well as any other Linux distribution.
|
||||
|
||||
Take the ping command for example. If you do not stop it, it will keep on displaying the result.
|
||||
|
||||
Hold the Ctrl button and press the C key at the same time. It sends the [SIGKILL signal][1] to the running program to force quit the command.
|
||||
|
||||
![Stopping a program in the Linux terminal][2]
|
||||
|
||||
Do you see the ^C? The caret (^) means Ctrl. So basically, the terminal shows the Ctrl+C keystrokes as ^C.
|
||||
|
||||
The Ctrl+C works very well for the commands that are designed to keep on running until interrupted. You feel like you have to cancel the command, use Ctrl+C.
|
||||
|
||||
In a more complicated method, you can [find the process ID and kill a running process][3]. That’s more advanced stuff and used only when the process is running in the background or by another user or in another terminal window.
|
||||
|
||||
Apart from that, there are some other commands and command line tools that have their own exit commands. Let me briefly mention some of them here.
|
||||
|
||||
#### How to exit Vim editor
|
||||
|
||||
[Existing Vim editor][4] has made so many jokes in the Linux world. It is difficult to figure out when you are new to this powerful command line based text editor. Among several ways of quitting vim, the most common is to press the Esc key and then type a colon (:) and then type `q!` for force quit without save or `wq` for save and quit.
|
||||
|
||||
![][5]
|
||||
|
||||
#### How to exit Nano editor
|
||||
|
||||
Quitting the [Nano editor][6] is a bit simpler than exiting Vim. Why? Because Nano mentions the shortcut at the bottom. You may not understand it if you are new to it but at least you’ll be able to figure it out the next time.
|
||||
|
||||
To exit Nano, press Ctrl+X. It will ask if you want to save the changes made to the file or not. You can enter your choice.
|
||||
|
||||
![][7]
|
||||
|
||||
#### How to exit less command
|
||||
|
||||
The less is a wonderful command that lets you view without cluttering your terminal screen like the cat command. If you are inside the less command view, use the key `q` to exit less.
|
||||
|
||||
#### How to exit the terminal
|
||||
|
||||
To exit the terminal itself, instead of closing the terminal, either use Ctrl+D keyboard shortcut or type the exit command:
|
||||
|
||||
```
|
||||
exit
|
||||
```
|
||||
|
||||
This actually exists you from the current shell. When you [open a terminal in Ubuntu][8] or any other Linux distribution, it runs the default shell. When you exit from this shell, terminal ends as well. Ctrl+D is the shortcut to do the same and quit the terminal.
|
||||
|
||||
I hope you find this quick tutorial helpful. I highly recommend learning these [Linux command tips][9].
|
||||
|
||||
**Recommended Read:**
|
||||
|
||||
![][10]
|
||||
|
||||
#### [21 Super Handy Linux Command Tips and Tricks That Will Save you a lot of Time and Increase Your Productivity][9]
|
||||
|
||||
Questions or suggestions? Please leave a comment below.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/stop-program-linux-terminal/
|
||||
|
||||
作者:[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://linuxhandbook.com/sigterm-vs-sigkill/#what-is-sigkill
|
||||
[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/stop-a-program-linux-terminal.png?resize=800%2C373&ssl=1
|
||||
[3]: https://itsfoss.com/how-to-find-the-process-id-of-a-program-and-kill-it-quick-tip/
|
||||
[4]: https://itsfoss.com/how-to-exit-vim/
|
||||
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2017/05/how-to-exit-vim.png?resize=737%2C422&ssl=1
|
||||
[6]: https://itsfoss.com/nano-editor-guide/
|
||||
[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/nano-editor-save-and-exit.png?resize=799%2C503&ssl=1
|
||||
[8]: https://itsfoss.com/open-terminal-ubuntu/
|
||||
[9]: https://itsfoss.com/linux-command-tricks/
|
||||
[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/linux-command-tips.png?fit=800%2C450&ssl=1
|
@ -0,0 +1,88 @@
|
||||
[#]: subject: "Apps for daily needs part 5: video editors"
|
||||
[#]: via: "https://fedoramagazine.org/apps-for-daily-needs-part-5-video-editors/"
|
||||
[#]: author: "Arman Arisman https://fedoramagazine.org/author/armanwu/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Apps for daily needs part 5: video editors
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
Photo by [Brooke Cagle][2] on [Unsplash][3]
|
||||
|
||||
Video editing has become a popular activity. People need video editors for various reasons, such as work, education, or just a hobby. There are also now many platforms for sharing video on the internet. Almost all social media and chat messengers provide features for sharing videos. This article will introduce some of the open source video editors that you can use on Fedora Linux. You may need to install the software mentioned. If you are unfamiliar with how to add software packages in Fedora Linux, see my earlier article [Things to do after installing Fedora 34 Workstation][4]. Here is a list of a few apps for daily needs in the video editors category.
|
||||
|
||||
### Kdenlive
|
||||
|
||||
When anyone asks about an open source video editor on Linux, the answer that often comes up is Kdenlive. It is a very popular video editor among open source users. This is because its features are complete for general purposes and are easy to use by someone who is not a professional.
|
||||
|
||||
Kdenlive supports multi-track, so you can combine audio, video, images, and text from multiple sources. This application also supports various video and audio formats without having to convert them first. In addition, Kdenlive provides a wide variety of effects and transitions to support your creativity in producing cool videos. Some of the features that Kdenlive provides are titler for creating 2D titles, audio and video scopes, proxy editing, timeline preview, keyframeable effects, and many more.
|
||||
|
||||
![][5]
|
||||
|
||||
More information is available at this link: <https://kdenlive.org/en/>
|
||||
|
||||
* * *
|
||||
|
||||
### Shotcut
|
||||
|
||||
Shotcut has more or less the same features as Kdenlive. This application is a general purposes video editor. It has a fairly simple interface, but with complete features to meet the various needs of your video editing work.
|
||||
|
||||
Shotcut has a complete set of features for a video editor, ranging from simple editing to high-level capabilities. It also supports various video, audio, and image formats. You don’t need to worry about your work history, because this application has unlimited undo and redo. Shotcut also provides a variety of video and audio effects features, so you have freedom to be creative in producing your video works. Some of the features offered are audio filters, audio mixing, cross fade audio and video dissolve transition, tone generator, speed change, video compositing, 3 way color wheels, track compositing/blending mode, video filters, etc.
|
||||
|
||||
![][6]
|
||||
|
||||
More information is available at this link: <https://shotcut.org/>
|
||||
|
||||
* * *
|
||||
|
||||
### Pitivi
|
||||
|
||||
Pitivi will be the right choice if you want a video editor that has an intuitive and clean user interface. You will feel comfortable with how it looks and will have no trouble finding the features you need. This application is classified as very easy to learn, especially if you need an application for simple editing needs. However, Pitivi still offers a variety of features, like trimming & cutting, sound mixing, keyframeable audio effects, audio waveforms, volume keyframe curves, video transitions, etc.
|
||||
|
||||
![][7]
|
||||
|
||||
More information is available at this link: <https://www.pitivi.org/>
|
||||
|
||||
* * *
|
||||
|
||||
### Cinelerra
|
||||
|
||||
Cinelerra is a video editor that has been in development for a long time. There are tons of features for your video work such as built-in frame render, various video effects, unlimited layers, 8K support, multi camera support, video audio sync, render farm, motion graphics, live preview, etc. This application is maybe not suitable for those who are just learning. I think it will take you a while to get used to the interface, especially if you are already familiar with other popular video editor applications. But Cinelerra will still be an interesting choice as your video editor.
|
||||
|
||||
![][8]
|
||||
|
||||
More information is available at this link: <http://cinelerra.org/>[][9]
|
||||
|
||||
* * *
|
||||
|
||||
### Conclusion
|
||||
|
||||
This article presented four video editor apps for your daily needs that are available on Fedora Linux. Actually there are many other video editors that you can use in Fedora Linux. You can also use Olive (Fedora Linux repo), OpenShot (rpmfusion-free) , Flowblade (rpmfusion-free) and many more. Each video editor has its own advantages. Some are better at correcting color, while others are better at a variety of transitions and effects. Some are better when it comes to how easy it is to add text. Choose the application that suits your needs. Hopefully this article can help you to choose the right video editors. If you have experience in using these applications, please share your experience in the comments.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/apps-for-daily-needs-part-5-video-editors/
|
||||
|
||||
作者:[Arman Arisman][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://fedoramagazine.org/author/armanwu/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2021/08/FedoraMagz-Apps-5-video-816x345.jpg
|
||||
[2]: https://unsplash.com/@brookecagle?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
|
||||
[3]: https://unsplash.com/s/photos/meeting-on-cafe-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
|
||||
[4]: https://fedoramagazine.org/things-to-do-after-installing-fedora-34-workstation/
|
||||
[5]: https://fedoramagazine.org/wp-content/uploads/2021/08/video-kdenlive-1024x576.png
|
||||
[6]: https://fedoramagazine.org/wp-content/uploads/2021/08/video-shotcut-1024x576.png
|
||||
[7]: https://fedoramagazine.org/wp-content/uploads/2021/08/video-pitivi-1024x576.png
|
||||
[8]: https://fedoramagazine.org/wp-content/uploads/2021/08/video-cinelerra-1024x576.png
|
||||
[9]: https://www.olivevideoeditor.org/
|
@ -0,0 +1,288 @@
|
||||
[#]: subject: "How I migrated a WordPress website to a new host"
|
||||
[#]: via: "https://opensource.com/article/21/9/migrate-wordpress"
|
||||
[#]: author: "David Both https://opensource.com/users/dboth"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How I migrated a WordPress website to a new host
|
||||
======
|
||||
Use this simple approach to migrate a website and manage firewall
|
||||
configurations.
|
||||
![Text editor on a browser, in blue][1]
|
||||
|
||||
Have you ever needed to migrate a WordPress website to a new host? I have done it several times and found the process to be quite easy. Of course, I don't use the recommended methods for doing most things, and this is no exception–I use the easy way, and that is what I recommend.
|
||||
|
||||
This migration is non-destructive, so it is simple to revert to the original server if that should be necessary for any reason.
|
||||
|
||||
### Components of a WordPress website
|
||||
|
||||
Three main components are required to run a website based on [WordPress][2]: WordPress itself, a webserver such as [Apache][3] (which I use), and the [MariaDB][4]. MariaDB is a fork of MySQL and is functionally equivalent.
|
||||
|
||||
There are plenty of webservers out there, but I prefer Apache because I have used it for so long. You may need to adapt the Apache configuration I use here to whatever webserver you are using.
|
||||
|
||||
### The original setup
|
||||
|
||||
I use one Linux host as a firewall and router for my network. The webserver is a different host inside my network. My internal network uses what used to be called a class C private network address range, but which is simply referred to as 192.168.0.0/24 in the [Classless Internet Domain Routing (CIDR)][5] methodology.
|
||||
|
||||
For the firewall, I use the very simple [IPTables][6], which I prefer over the much more complex `firewalld`. One line in this firewall configuration sends incoming packets on port 80 (HTTP) to the webserver. As you can see by the comments, I placed rules to forward other inbound server connections to the same server on their appropriate ports in the `/etc/sysconfig/iptables` file.
|
||||
|
||||
|
||||
```
|
||||
# Reroute ports for inbound connections to the appropriate web/email/etc server.
|
||||
# HTTPD goes to 192.168.0.75
|
||||
-A PREROUTING -d 45.20.209.41/255.255.255.248 -p tcp -m tcp --dport 80 \
|
||||
|
||||
-j DNAT --to-destination 192.168.0.75:80
|
||||
```
|
||||
|
||||
I set up my original Apache webserver using named virtual hosts because I served multiple websites from this one HTTPD instance. It is always a good idea to use the named virtual host configuration approach because, like me, you may decide to host additional sites later, and this process makes that easier to do.
|
||||
|
||||
The virtual host stanza for the website to be moved in `/etc/httpd/conf/httpd.conf` looks like the one below. There are no IP addresses in this stanza, so it needs no changes for use on the new server.
|
||||
|
||||
|
||||
```
|
||||
<VirtualHost *:80>
|
||||
ServerName [www.website1.org][7]
|
||||
ServerAlias server.org
|
||||
|
||||
DocumentRoot "/var/website1/html"
|
||||
ErrorLog "logs/error_log"
|
||||
ServerAdmin [me@website1.org][8]
|
||||
|
||||
<Directory "/var/website1/html">
|
||||
Options Indexes FollowSymLinks
|
||||
|
||||
AllowOverride None
|
||||
Require all granted
|
||||
|
||||
</Directory>
|
||||
</VirtualHost>
|
||||
```
|
||||
|
||||
The `Listen` directive near the top of the `httpd.conf` file looks like this before the migration. This is the actual IP private address of the server and not the public IP address.
|
||||
|
||||
|
||||
```
|
||||
`Listen 192.168.0.75:80`
|
||||
```
|
||||
|
||||
You need to change the `Listen` IP address on the new host.
|
||||
|
||||
### Preparation
|
||||
|
||||
The preparation can be accomplished with three steps:
|
||||
|
||||
* Install the services.
|
||||
* Configure the firewall.
|
||||
* Configure the webserver.
|
||||
|
||||
|
||||
|
||||
#### Install Apache and MariaDB
|
||||
|
||||
Install Apache and MariaDB if they are not already on your new server. It is not necessary to install WordPress.
|
||||
|
||||
|
||||
```
|
||||
`dnf -y install httpd mariadb`
|
||||
```
|
||||
|
||||
#### New server firewall configuration
|
||||
|
||||
Ensure that the firewall on the new server allows port 80. You do have a firewall on _all_ of your computers, right? Most modern distributions use an initial setup that includes a firewall that blocks all incoming traffic to ensure a higher level of security.
|
||||
|
||||
The first line in the snippet below may already be part of your IPTables or other netfilter-based firewall. It identifies inbound packets that have already been recognized as coming from an acceptable source and bypasses additional INPUT filter rules, thus saving time and CPU cycles. The last line in the snippet identifies new incoming connections to HTTPD on port 80 and accepts them.
|
||||
|
||||
|
||||
```
|
||||
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||
<snip>
|
||||
# HTTP
|
||||
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
|
||||
```
|
||||
|
||||
The following sample `/etc/sysconfig/iptables` file is an example of a minimal set of IPTables rules that allow incoming connections on SSH (port 22) and HTTPD (port 80) .
|
||||
|
||||
|
||||
```
|
||||
*filter
|
||||
:INPUT ACCEPT [0:0]
|
||||
:FORWARD ACCEPT [0:0]
|
||||
:OUTPUT ACCEPT [0:0]
|
||||
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||
-A INPUT -p icmp -j ACCEPT
|
||||
-A INPUT -i lo -j ACCEPT
|
||||
# SSHD
|
||||
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
|
||||
# HTTP
|
||||
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
|
||||
|
||||
# Final disposition for unmatched packets
|
||||
-A INPUT -j REJECT --reject-with icmp-host-prohibited
|
||||
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
|
||||
COMMIT
|
||||
```
|
||||
|
||||
All I needed on my new server host was to add the last line in the snippet above to my firewall rules in the `/etc/sysconfig/iptables` file and then reload the revised ruleset.
|
||||
|
||||
|
||||
```
|
||||
`iptables-restore /etc/sysconfig/iptables`
|
||||
```
|
||||
|
||||
Most current Red Hat-based distributions, such as Fedora, use `firewalld`. I don't use it because I find it far more complex than it needs to be for use cases such as home or small to medium businesses. To add inbound port 80 to `firewalld`, I suggest you refer to the [firewalld web page][9].
|
||||
|
||||
Your firewall and its configuration details might differ from these, but the objective is to allow incoming connections to HTTPD on port 80 of the new web server.
|
||||
|
||||
#### HTTPD configuration
|
||||
|
||||
Configure HTTPD in the `/etc/httpd/conf/httpd.conf` file. Set the IP address in the Listen stanza as shown below. The IP address of my new web server is 192.168.0.125.
|
||||
|
||||
|
||||
```
|
||||
`Listen 192.168.0.125:80`
|
||||
```
|
||||
|
||||
Copy the VirtualHost stanza for the website being moved and paste it at the end of the `httpd.conf` file of the new server.
|
||||
|
||||
### The move
|
||||
|
||||
Only two sets of data need to be moved to the new server—the database itself and the website directory structure. Create `tar` archives of the two directories.
|
||||
|
||||
|
||||
```
|
||||
cd /var ; tar -cvf /tmp/website.tar website1/
|
||||
cd /var/lib ; tar -cvf /tmp/database.tar mysql/
|
||||
```
|
||||
|
||||
Copy those tarballs to the new server. I usually store files like this in `/tmp`, which is what it is for. Run the following commands on the new server to extract the files from the tar archives into the correct directories.
|
||||
|
||||
|
||||
```
|
||||
cd /var ; tar -xvf /tmp/website.tar
|
||||
cd /var/lib ; tar -xvf /tmp/database.tar
|
||||
```
|
||||
|
||||
All WordPress files are contained in the `/var/website1`, so they do not need to be installed on the new server. The WordPress installation procedure does not need to be performed on the new server.
|
||||
|
||||
This directory is all that needs to be moved to the new server.
|
||||
|
||||
The last step before making the switch is to start (or restart) the `mysqld` and `httpd` service daemons. WordPress is not a service, so it is not started as a daemon.
|
||||
|
||||
|
||||
```
|
||||
`systemctl start mysqld ; systemctl start httpd`
|
||||
```
|
||||
|
||||
You should check the status of these services after starting them.
|
||||
|
||||
|
||||
```
|
||||
systemctl status mysqld
|
||||
● mariadb.service - MariaDB 10.5 database server
|
||||
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
|
||||
Active: active (running) since Sat 2021-08-21 14:03:44 EDT; 4 days ago
|
||||
Docs: man:mariadbd(8)
|
||||
|
||||
<https://mariadb.com/kb/en/library/systemd/>
|
||||
Process: 251783 ExecStartPre=/usr/libexec/mariadb-check-socket (code=exited, status=0/SUCCESS)
|
||||
Process: 251805 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir mariadb.service (code=exited, status=0/SUCCESS)
|
||||
Process: 251856 ExecStartPost=/usr/libexec/mariadb-check-upgrade (code=exited, status=0/SUCCESS)
|
||||
Main PID: 251841 (mariadbd)
|
||||
Status: "Taking your SQL requests now..."
|
||||
Tasks: 15 (limit: 19003)
|
||||
Memory: 131.8M
|
||||
CPU: 1min 31.793s
|
||||
CGroup: /system.slice/mariadb.service
|
||||
└─251841 /usr/libexec/mariadbd --basedir=/usr
|
||||
|
||||
Aug 21 14:03:43 simba.stmarks-ral.org systemd[1]: Starting MariaDB 10.5 database server...
|
||||
Aug 21 14:03:43 simba.stmarks-ral.org mariadb-prepare-db-dir[251805]: Database MariaDB is probably initialized in /var/lib/mysql already, n>
|
||||
Aug 21 14:03:43 simba.stmarks-ral.org mariadb-prepare-db-dir[251805]: If this is not the case, make sure the /var/lib/mysql is empty before>
|
||||
Aug 21 14:03:44 simba.stmarks-ral.org mariadbd[251841]: 2021-08-21 14:03:44 0 [Note] /usr/libexec/mariadbd (mysqld 10.5.11-MariaDB) startin>
|
||||
Aug 21 14:03:44 simba.stmarks-ral.org systemd[1]: Started MariaDB 10.5 database server.
|
||||
|
||||
systemctl status httpd
|
||||
● httpd.service - The Apache HTTP Server
|
||||
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
|
||||
Drop-In: /usr/lib/systemd/system/httpd.service.d
|
||||
└─php-fpm.conf
|
||||
Active: active (running) since Sat 2021-08-21 14:08:39 EDT; 4 days ago
|
||||
Docs: man:httpd.service(8)
|
||||
Main PID: 252458 (httpd)
|
||||
Status: "Total requests: 10340; Idle/Busy workers 100/0;Requests/sec: 0.0294; Bytes served/sec: 616 B/sec"
|
||||
Tasks: 278 (limit: 19003)
|
||||
Memory: 44.7M
|
||||
CPU: 2min 31.603s
|
||||
CGroup: /system.slice/httpd.service
|
||||
├─252458 /usr/sbin/httpd -DFOREGROUND
|
||||
├─252459 /usr/sbin/httpd -DFOREGROUND
|
||||
├─252460 /usr/sbin/httpd -DFOREGROUND
|
||||
├─252461 /usr/sbin/httpd -DFOREGROUND
|
||||
├─252462 /usr/sbin/httpd -DFOREGROUND
|
||||
└─252676 /usr/sbin/httpd -DFOREGROUND
|
||||
|
||||
Aug 21 14:08:39 simba.stmarks-ral.org systemd[1]: Starting The Apache HTTP Server...
|
||||
Aug 21 14:08:39 simba.stmarks-ral.org httpd[252458]: AH00112: Warning: DocumentRoot [/var/teststmarks-ral/html] does not exist
|
||||
Aug 21 14:08:39 simba.stmarks-ral.org httpd[252458]: Server configured, listening on: port 80
|
||||
Aug 21 14:08:39 simba.stmarks-ral.org systemd[1]: Started The Apache HTTP Server.
|
||||
```
|
||||
|
||||
### Making the final switch
|
||||
|
||||
Now that the required services are up and running, you can change the firewall rule for HTTPD to the following in the `/etc/sysconfig/iptables` file.
|
||||
|
||||
|
||||
```
|
||||
-A PREROUTING -d 45.20.209.41/255.255.255.248 -p tcp -m tcp --dport 80 \
|
||||
-j DNAT --to-destination 192.168.0.125:80
|
||||
```
|
||||
|
||||
Then reload the IPTables rule set.
|
||||
|
||||
|
||||
```
|
||||
`iptables-restore /etc/sysconfig/iptables`
|
||||
```
|
||||
|
||||
Because of the firewall rules in the firewall host, it is not necessary to change the external DNS entries to point to the new server. If you use an internal DNS server, you will need to make the IP address change to that A record in your internal DNS database. If you don't use an internal DNS server, be sure to set the correct address for your new server in the `/etc/hosts` files of your host computers.
|
||||
|
||||
### Testing and cleanup
|
||||
|
||||
Be sure to test your new setup. First, turn off the `mysqld` and `httpd` services on the old server. Then access the website with a browser. If everything works as it should, you can disable `mysqld` and `httpd` on the old server. If there is a failure, you can change the IPTables routing rule back to the old server until the problem is fixed.
|
||||
|
||||
I then removed both MySQL and HTTPD from the old server to ensure that they cannot be started accidentally.
|
||||
|
||||
### Conclusion
|
||||
|
||||
It really is that simple. There is no need to perform export or import procedures on the database because everything necessary is copied over in the `mysql` directory. The only reason you might want to deal with the export/import procedure is if there are databases other than those for the website or sites in the same instance of the MariaDB that you don't want copied to the new server.
|
||||
|
||||
Migrating the rest of the websites served by the old server is easy too. All of the databases required for the additional sites have already been moved over with MariaDB. It is only necessary to move the `/var/website` directories to the new server, add the appropriate virtual host stanzas, and restart HTTPD.
|
||||
|
||||
I have used this procedure multiple times for migrating a website from one server to another, and it always works well.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/9/migrate-wordpress
|
||||
|
||||
作者:[David Both][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/dboth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_blue_text_editor_web.png?itok=lcf-m6N7 (Text editor on a browser, in blue)
|
||||
[2]: https://wordpress.org/
|
||||
[3]: https://opensource.com/article/18/2/how-configure-apache-web-server
|
||||
[4]: https://mariadb.org/
|
||||
[5]: https://opensource.com/article/16/12/cidr-network-notation-configuration-linux
|
||||
[6]: https://en.wikipedia.org/wiki/Iptables
|
||||
[7]: http://www.website1.org
|
||||
[8]: mailto:me@website1.org
|
||||
[9]: https://firewalld.org/documentation/howto/open-a-port-or-service.html
|
@ -1,116 +0,0 @@
|
||||
[#]: subject: "How to Run Java Programs in Ubuntu"
|
||||
[#]: via: "https://itsfoss.com/run-java-program-ubuntu/"
|
||||
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How to Run Java Programs in Ubuntu
|
||||
======
|
||||
|
||||
So, you have started learning Java programming? That’s good.
|
||||
|
||||
And you want to run the java programs on your Linux system? Even better.
|
||||
|
||||
Let me show how to run Java in terminal in Ubuntu and other Linux distributions.
|
||||
|
||||
### Running Java programs in Ubuntu
|
||||
|
||||
Let’s go in proper steps here.
|
||||
|
||||
#### Step 1: Install Java compiler
|
||||
|
||||
To run a Java program, you need to compile the program first. You need Java compiler for this purpose.
|
||||
|
||||
The Java compiler is part of [JDK][1] (Java Development Kit). You need to install JDK in order to compile and run Java programs.
|
||||
|
||||
First, check if you already have Java Compiler installed on your system:
|
||||
|
||||
```
|
||||
javac --version
|
||||
```
|
||||
|
||||
If you see an error like “Command ‘javac’ not found, but can be installed with”, this means you need to install Java Development Kit.
|
||||
|
||||
![Check if Java compiler is already installed or not][2]
|
||||
|
||||
The simplest way to install JDK on Ubuntu is to go with the default offering from Ubuntu:
|
||||
|
||||
```
|
||||
sudo apt install default-jdk
|
||||
```
|
||||
|
||||
You’ll be asked to enter your account’s password. When you type the password, nothing is seen on the screen. That is normal. Just enter your password blindly. When asked, press the enter key or Y key.
|
||||
|
||||
![Installing JDK that also contains the Java compiler][3]
|
||||
|
||||
The above command should work for other Debian and Ubuntu based distributions like Linux Mint, elementary OS etc. For other distributions, use your distribution’s package manager. The package name could also be different.
|
||||
|
||||
Once installed, verify that javac is available now.
|
||||
|
||||
![Verify that Java compiler can be used now][4]
|
||||
|
||||
#### Step 2: Compile Java program in Linux
|
||||
|
||||
You need to have a Java program file for this reason. Let’s say you create a new Java program file named **HelloWorld.java** and it has the following content:
|
||||
|
||||
```
|
||||
class HelloWorld{
|
||||
public static void main(String args[]){
|
||||
System.out.println("Hello World");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You can [use Nano editor in terminal][5] or Gedit graphical text editor for writing your Java programs.
|
||||
|
||||
```
|
||||
javac HelloWorld.java
|
||||
```
|
||||
|
||||
If there is no error, the above command produces no output.
|
||||
|
||||
When you compile the Java program, it generates a .class file with the class name you used in your program. You have to run this class file.
|
||||
|
||||
#### Step 3: Run the Java class file
|
||||
|
||||
You do not need to specify the class extension here. Just the name of the class. And this time, you use the command java, not javac.
|
||||
|
||||
```
|
||||
java HelloWorld
|
||||
```
|
||||
|
||||
This will print Hello World on the screen for my program.
|
||||
|
||||
![Running java programs in the Linux terminal][6]
|
||||
|
||||
And that’s how you run a Java program in the Linux terminal.
|
||||
|
||||
This was the simplest of the example. The sample program had just one class. The Java compiler creates a class file for each class in your program. Things get complicated for bigger programs and projects.
|
||||
|
||||
This is why I advise [installing Eclipse on Ubuntu][7] for proper Java programming. It is easier to program in an IDE.
|
||||
|
||||
I hope you find this tutorial helpful. Questions or suggestions? The comment section is all yours.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/run-java-program-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://jdk.java.net/
|
||||
[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/java-compiler-check-ubuntu.png?resize=800%2C328&ssl=1
|
||||
[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/install-jdk-ubuntu.png?resize=800%2C430&ssl=1
|
||||
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/java-compiler-ubuntu.png?resize=798%2C226&ssl=1
|
||||
[5]: https://itsfoss.com/nano-editor-guide/
|
||||
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/running-java-programs-in-Linux-terminal.png?resize=798%2C301&ssl=1
|
||||
[7]: https://itsfoss.com/install-latest-eclipse-ubuntu/
|
@ -1,127 +0,0 @@
|
||||
[#]: subject: "How to Use the dd Command to Create a Live USB Drive in Linux Terminal [For Experts and Adventurers]"
|
||||
[#]: via: "https://itsfoss.com/live-usb-with-dd-command/"
|
||||
[#]: author: "Hunter Wittenborn https://itsfoss.com/author/hunter/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How to Use the dd Command to Create a Live USB Drive in Linux Terminal [For Experts and Adventurers]
|
||||
======
|
||||
|
||||
There are several graphical tools available for creating live USB. [Etcher on Linux][1] is probably the most popular. Ubuntu has its own Startup Disk Creator tool for this purpose.
|
||||
|
||||
However, advanced Linux users swear by the comfort and swiftness of creating live USBs in Linux terminal using the dd command.
|
||||
|
||||
The dd command is a [CLI tool][2] that gives you powerful features for copying and converting files.
|
||||
|
||||
A common use case that people use dd for is to write ISO files to an external storage device such as a USB drive, which can be used to do things like install a new Linux distribution onto a computer or laptop.
|
||||
|
||||
That’s what I am going to show in this tutorial. I’ll go over the commands you will need to run, finding our USB drive from the terminal, and then finally doing the actual flashing of the ISO file.
|
||||
|
||||
### Creating live USB from ISO with dd command
|
||||
|
||||
Before I show you the steps, let me quickly go over the command which you’ll be using and explain what it does.
|
||||
|
||||
Here’s the example command for flashing of the ISO:
|
||||
|
||||
```
|
||||
dd if="./filename.iso" of="/dev/sdb" status="progress" conv="fsync"
|
||||
```
|
||||
|
||||
Let’s go over what exactly that [dd command][3] is doing.
|
||||
|
||||
#### Understanding the above dd command
|
||||
|
||||
![Explanation of the dd command for live USB creation][4]
|
||||
|
||||
First, you enter `dd`. As expected, this is just the name of the program you are going to run.
|
||||
|
||||
Next, you specify `if="./filename.iso"`. `if` stands for input file, which tells `dd` what file you are going to be writing to the external storage drive.
|
||||
|
||||
After that, you enter `of="/dev/sdb"`. As was with `if`, `of` simply stands for output file.
|
||||
|
||||
The thing to remember is that the output file doesn’t technically have to be a file on your system. You can also specify things like the path to an external device (as shown in the example), which just **looks** like a normal file on your system, but actually points to a device connected to your machine.
|
||||
|
||||
`status` can be set to three options: `none`, `noxfer` and `progress.`
|
||||
|
||||
The `progress` option that you set will cause dd to show periodic statistics on how much of the ISO has been transferred to the storage drive, as well as an estimation on how much longer it will be until dd is finished.
|
||||
|
||||
If you were to have set the `none` option instead, dd would only print error messages during the writing of the ISO, thus removing things like the progress bar.
|
||||
|
||||
The `noxfer` option hides some information that’s printed after a transfer is complete, such as how long it took from start to finish.
|
||||
|
||||
Lastly, you set the `conv` option to `fsync`. This causes dd to not report a successful write until the entire ISO has been written to the USB drive.
|
||||
|
||||
If you omit this option, dd will still write just fine (and might actually appear to run quicker), but you might find your system taking quite a while before it tells you it’s safe to remove the USB drive as it will finish writing the ISO’s content in the background, thus allowing you to do other things in the meantime.
|
||||
|
||||
_**Now that you understand what you have to do, let’s see how to do it.**_
|
||||
|
||||
Warning
|
||||
|
||||
The command line is a double-edged sword. Be extra careful when you are running a command like dd. You must make sure that you are using the correct device for the output file destination. One wrong step and you may format your main system disk and lose your operating system.
|
||||
|
||||
#### Step 0: Download the desired ISO
|
||||
|
||||
This goes without saying that you need to have an ISO image file in order to flash it on a USB.
|
||||
|
||||
I am going to use Ubuntu 20.04 ISO (downloadable [here][5]) to test the dd command I showed earlier.
|
||||
|
||||
#### Step 1: Get the USB disk label
|
||||
|
||||
Plug in your USB disk.
|
||||
|
||||
The specific path I entered for `of` was `/dev/sdb`. The USB disks are usually labelled /dev/sdb but that’s not a hard and fast rule.
|
||||
|
||||
This path may differ on your system, but you can confirm the path of the drive with the `lsblk` command. Just look for a listing that looks like the size of your USB drive, and that’ll be it.
|
||||
|
||||
![][6]
|
||||
|
||||
If you are more comfortable with GUI programs, you can also find the drive’s path with tools like GNOME Disks.
|
||||
|
||||
![][7]
|
||||
|
||||
Now that you have established the path to our external drive, let’s create the live USB.
|
||||
|
||||
#### Step 2: Writing the ISO file to the USB disk
|
||||
|
||||
Open up a terminal at the directory where the ISO file is downloaded, and run the following (remember to replace `/dev/sdb` with the name of your storage device if it’s something different):
|
||||
|
||||
```
|
||||
sudo dd if="./ubuntu-20.04.2.0-desktop-amd64.iso" of="/dev/sdb" status="progress" conv="fsync"
|
||||
```
|
||||
|
||||
After that, just let dd do it’s thing, and it’ll print a completion message once it’s done:
|
||||
|
||||
![][8]
|
||||
|
||||
And just like that, you’ve flashed an ISO with dd command in the Linux terminal!
|
||||
|
||||
### Wrapping Up
|
||||
|
||||
Now you’re on your way to doing even more things through the terminal, allowing you to do things faster and quicker than you might have been able to do before.
|
||||
|
||||
Got any remaining questions about the dd command, or something just not working right? Feel free to leave any of it in the comment section below.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/live-usb-with-dd-command/
|
||||
|
||||
作者:[Hunter Wittenborn][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/hunter/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/install-etcher-linux/
|
||||
[2]: https://itsfoss.com/gui-cli-tui/
|
||||
[3]: https://linuxhandbook.com/dd-command/
|
||||
[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/dd-command-for-live-usb-creation.png?resize=800%2C450&ssl=1
|
||||
[5]: https://ubuntu.com/download/desktop/thank-you?version=20.04.2.0&architecture=amd64
|
||||
[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/dd_disks.png?resize=753%2C264&ssl=1
|
||||
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/dd_gnome_disks.png?resize=800%2C440&ssl=1
|
||||
[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/dd-iso-write.png?resize=800%2C322&ssl=1
|
@ -0,0 +1,331 @@
|
||||
[#]: subject: "A guide to simplifying invoicing with this open source tool"
|
||||
[#]: via: "https://opensource.com/article/21/7/open-source-invoicing-po"
|
||||
[#]: author: "Frank Bergmann https://opensource.com/users/fraber"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
A guide to simplifying invoicing with this open source tool
|
||||
======
|
||||
]project-open[ simplifies one of the most challenging activities in IT:
|
||||
writing customer invoices.
|
||||
![Digital images of a computer desktop][1]
|
||||
|
||||
Many IT projects are late, over budget, and subject to dramatic changes during development. This makes invoicing for them one of the most taxing activities in IT. It's stressful—it involves dealing with ambiguities, conflicting interests, and human error. Worse, every single decision made during the project affects how much you can bill for. When a sales guy brags—incorrectly—that your software "includes this feature," you can't invoice for the time to build it. When a support guy admits something is a bug rather than an imprecise spec, you won't be able to charge money for it.
|
||||
|
||||
This tutorial explains a methodology and a tool to streamline this process. Together, they help reduce frustration, improve customer relationships, and achieve a higher percentage of billable hours. The tool is free, open source, and can be applied to a wide range of organizations—from a self-employed IT guy to a multimillion-dollar software business.
|
||||
|
||||
This article can also serve as a guide on how to handle financial tasks if you decide to become self-employed or set up a startup. It doesn't cover project management or similar disciplines; I'm focusing only on invoicing here. The first part of this article describes the invoicing methodology, while the second part shows you how to apply the methodology within []project-open[][2] (or ]po[ for short).
|
||||
|
||||
### The general invoicing process
|
||||
|
||||
There's a general process for writing invoices no matter what tool you use. Some organizations may be more or less formal with certain steps, but all project-based businesses follow the same basic process:
|
||||
|
||||
![Invoicing processes covered in this tutorial][3]
|
||||
|
||||
Figure 1. Invoicing processes (Frank Bergmann, [CC BY-SA 4.0][4])
|
||||
|
||||
#### Assign a contract type
|
||||
|
||||
From an invoicing perspective, the most important property of a project is the contract type. You can invoice services for a **fixed price** (the risk of time and other overruns is 100% on your side), **time and materials** (you bill by the hour, and the customer takes on the risk of overruns), or a **mixture of both** (you specify some deliverables with a fixed price, but other parts of the contract are billed using time and materials). Sometimes invoicing is tied to certain objectives (milestone billing) or time periods (periodic invoicing), but these are just variants of the two contract types above.
|
||||
|
||||
Agile projects tend to be more time-and-materials based because the specs (and therefore the amount of work) for each user story change over the course of the project. Classic waterfall projects tend to be more fixed-price based, but this depends on the project and negotiation position. The following information applies to all contract types.
|
||||
|
||||
#### Define your project
|
||||
|
||||
Project definition is normally a separate step before execution begins. If you want to get paid, you have to start here and define the scope of your project with watertight deliverables. Otherwise, you're at the mercy of your customer's goodwill to let you off the hook if there are ambiguities later.
|
||||
|
||||
![Initial project definition Gantt Chart][5]
|
||||
|
||||
Figure 2. Initial project definition Gantt chart (Frank Bergmann, [CC BY-SA 4.0][4])
|
||||
|
||||
The Gantt chart above shows a sample ]po[ project. To define a project with unambiguous deliverables:
|
||||
|
||||
1. Define the project as a list of tasks to work on. Every task must have a clear deliverable so that it's easy to tell if the task is complete or not.
|
||||
2. Create an estimate (the **Work** column) of how long it will take to complete the task. This helps you track time overruns. A second column, **Billable Hours**, allows you to account for unbillable time (e.g., time spent in presales activities is generally not billable).
|
||||
3. Define a **Material** for each task if you charge different rates for different task types. For example, you may charge US$ 100 per hour for project management while database administration costs US$ 60 per hour.
|
||||
4. Optional: Assign **Resources** to each task to specify who should do the work.
|
||||
|
||||
|
||||
|
||||
Entering information this way makes it very easy to produce invoices and status reports later.
|
||||
|
||||
#### Manage project change requests, bugs, and issues
|
||||
|
||||
Projects tend to change during their course due to unforeseen issues, new ideas from the customer, and many other reasons. Most of these changes mean additional work for you. It's important to track whether this work is paid or unpaid. Customer extension requests or scope increases are usually paid, while bugs or other issues tend to be unpaid.
|
||||
|
||||
There are different ways of tracking change requests (CRs):
|
||||
|
||||
* **Contractually:** Formally record change requests as an email or a signed CR document so that there are no ambiguities when invoicing.
|
||||
* **Operationally:** You probably want to add CRs as tasks in your project. This is just like creating the initial tasks list. You may want to group additional tasks below a summary task to indicate they aren't covered by the original scope.
|
||||
* **Bug tracker:** It may also be useful to keep a separate log for quality issues and bugs (usually non-billable changes).
|
||||
|
||||
|
||||
|
||||
Whatever method you use, make sure you tag the work as tasks vs. bugs in some way to remind you to treat them differently when writing an invoice later.
|
||||
|
||||
#### Issue periodic status reports
|
||||
|
||||
Customers expect you to provide periodic information about the progress of their projects. That's because IT projects are usually late and over budget. This can be an unpleasant duty, particularly if you have to report overruns, but it makes good business sense.
|
||||
|
||||
A weekly status report frequently contains the following sections:
|
||||
|
||||
* A list of tasks you're working on, optionally with their completion status
|
||||
* A list of tasks you've started working on in this reporting period
|
||||
* A list of tasks you've finished in this reporting period
|
||||
* The reasons it took you so long to finish the tasks above
|
||||
|
||||
|
||||
|
||||
#### Get customer signoff
|
||||
|
||||
Before you can write an invoice, you usually need approval from the customer confirming all deliverables are complete. This may be the most difficult phase of the entire project because it often involves negotiating accountability for any overruns you encountered in the project.
|
||||
|
||||
I recommend you start considering this phase when you first define the project so that every task is bound to a clearly defined deliverable and completion status isn't up for debate. You may also define explicit acceptance criteria during project definition to avoid ambiguities. When negotiating the details of a task with the customer during project execution, remember to record all decisions so that you can easily find this documentation when trying to get signoff.
|
||||
|
||||
#### Invoice
|
||||
|
||||
Once you've gotten signoff, writing the invoice is relatively easy. You just need to multiply the billable hours by the agreed rate per hour or day:
|
||||
|
||||
* Look at all billable tasks and determine planned hours, billable hours, and actual hours.
|
||||
* Can you bill the overrun hours to the customer? If so, you'll probably have to explain why the customer should pay for this and where this has been agreed upon contractually.
|
||||
* Multiply the billable hours by the hourly rate for the respective service type.
|
||||
|
||||
|
||||
|
||||
Once you calculate the final amount, you may need to add taxes according to your local regulations, which will differ depending upon the country, state, county, or even city where your business is located. Finally, enter the calculation into a standardized invoice document and send it to the customer.
|
||||
|
||||
#### Track accounts receivable and payments
|
||||
|
||||
Once the invoice has been sent to the customer, you have to track the payments in your bank account and connect them to the respective invoices. You may also have to send reminders to your customers if they're late with payments.
|
||||
|
||||
#### Do profit & loss and post-mortem
|
||||
|
||||
After all the work is finished, you'll want to see how much money you earned from the project. This can be very easy or quite complex if the work involves salaried employees, external consultants, efforts shared with other projects, travel costs, etc. At the end, you'll have a profit-and-loss statement that consists of the invoiced amount minus all of your costs.
|
||||
|
||||
This may also be a good moment to review your project in general (called a post-mortem) and your estimation process in particular. Compare the estimated time with the actual time spent and how the various decisions and events during the project affected the balance. This should inform your sales and quoting process for the next project.
|
||||
|
||||
### Create invoices with ]project-open[
|
||||
|
||||
Now that you know the process, let's look at implementing it using the free and open source tool ]po[.
|
||||
|
||||
#### Download, install, and configure ]po[
|
||||
|
||||
It only takes a few minutes to get ]po[ running on your computer. You can get [native installers][6] (along with help and instructions) for various Linux flavors or Windows from the ]po[ website.
|
||||
|
||||
After installing ]po[, follow the configuration wizard and choose the **Other/Everything** and **Complete/Full Installation** options to enable all system options. Project invoicing is disabled in the simplified configurations.
|
||||
|
||||
#### Define a project
|
||||
|
||||
To create a new project, use **Projects -> New Project** and choose **Gantt Project** or one of its subtypes. The ]po[ Gantt editor contains everything you need to set up your project. You can structure your project hierarchically with **Summary tasks** or keep it as a flat list. The Gantt timeline on the right-hand side is optional for the invoicing process. It's only used for tracking progress during project execution.
|
||||
|
||||
There are columns for all the task properties described below. The **Material** and **Billable Hours** columns aren't visible in ]po[ by default. To make them visible, click the **v** button to the right of each column header and enable the column. You can change the column order by dragging and dropping:
|
||||
|
||||
![Gantt chart with project definition and status][7]
|
||||
|
||||
Figure 3. Gantt chart with project definition and status (Frank Bergmann, [CC BY-SA 4.0][4])
|
||||
|
||||
* **Task:** This is the name of the task.
|
||||
* **Work:** Enter the estimated hours to finish the task.
|
||||
* **Billable Hours** (optional): Allows you to specify billable time if it is different from Work.
|
||||
* **Done %:** The project manager enters the progress toward completing the task.
|
||||
* **Material:** This is the service type of the task, for example, project management or frontend development. You can edit the list of materials in **Master Data -> Materials**. These service types tie in with the list of rates (see below) to define prices for different types of work or different resources.
|
||||
* **Resources:** To assign resources to tasks, you first have to use the **Projects -> <project name> -> Members** portlet to add resources to the project. After you reload the page, these resources will be available in the Gantt editor, where you can assign them to tasks in the **Resources** column.
|
||||
* **Notes:** This field is not available as a column. Double-click on the icon before any task to open the **Task** property panel that includes a large free-text area for notes.
|
||||
|
||||
|
||||
|
||||
]po[ will automatically calculate the duration (setting the end date) of a task if you have defined its Work and Resources. Similarly, it will calculate the duration of a Summary task (a parent task with several subtasks) based on its children. You can create dependencies between tasks by dragging and dropping with your mouse.
|
||||
|
||||
#### Log your hours
|
||||
|
||||
Use the **Timesheet** menu to get to the calendar page. Click **Log hours** for a specific day.
|
||||
|
||||
![Time sheet calendar][8]
|
||||
|
||||
Figure 3. Time sheet calendar (Frank Bergmann, [CC BY-SA 4.0][4])
|
||||
|
||||
You'll see a list of all projects on which you are a member. There, you can log hours and add comments about what you've done.
|
||||
|
||||
![Logging hours][9]
|
||||
|
||||
Figure 4. Logging hours (Frank Bergmann, [CC BY-SA 4.0][4])
|
||||
|
||||
#### Add issues and change requests
|
||||
|
||||
You can add new tasks to the Gantt editor any time during the project to reflect change requests.
|
||||
|
||||
You can also add a bug tracker to your project. From the left-hand side of the project, find **Project -> Admin Project -> Create a Subproject**. Then create a new subproject with the name **<Project> Bug Tracker** and type **Ticket Container**. This new bug tracker will appear in the Gantt editor together with the included tickets marked with different icons. The bug tracker will also appear in the **Tickets -> New Ticket** section so that the project manager, the customer, or other stakeholders can log various types of issues. Please see the **Documentation** tab on the []po[ website][10] for details about the ]po[ helpdesk functionality, as this is beyond the scope of this tutorial.
|
||||
|
||||
#### Report your status
|
||||
|
||||
The ]po[ Gantt editor also serves as a visual status report. Basically, all tasks to the left of the red line ("today") should show 100% in the **Done %** column.
|
||||
|
||||
![Project status Gantt chart][11]
|
||||
|
||||
Figure 5. Project status Gantt chart (Frank Bergmann, [CC BY-SA 4.0][4])
|
||||
|
||||
Look at the **Master data import** task in Figure 5:
|
||||
|
||||
* **Is the task on time?** The black bar inside the Gantt bar represents the 40% from the **Done%** column. The rectangle ends to the left of the red line representing today, indicating the task is late.
|
||||
* **Is the task within budget?** The red rectangle in the Gantt bar is red. It represents the **Logged Hours** as a percentage of **Work**. We can see that the team has already spent 48 of the planned 56 hours, but the task is only 40% done. Continuing like this, it would take 120 hours (= 48h / 40%) to complete the task. The bar's color changes to blue if **Logged Hours** < **Work * Done%**.
|
||||
|
||||
|
||||
|
||||
]po[ includes other more advanced status reporting tools, including Earned Value Analysis (EVA), Milestone Trend Analysis, and various specialized reports. The documentation provides more information on these tools.
|
||||
|
||||
#### Get to sign off
|
||||
|
||||
]project-open[ doesn't include specific support for getting your customer to sign off on your project. However, the detailed information attached to each task—which you documented at the start—will be extremely helpful in proving that everything's been done in accordance with the decisions you and your customer made together. Take note of any difficulties and take them into account when defining the next project.
|
||||
|
||||
#### Create an invoice manually
|
||||
|
||||
This is the simplest and most flexible way to create invoices and is suitable for very small or fixed-price projects. Use **<project> -> Finance -> New Customer Invoice** **from Scratch** to start. (Do not use the **Finance** tab at the top of the ]po[ menu—go to your specific project and use the project's **Finance** tab there). You'll see a screen like this:
|
||||
|
||||
![Creating an invoice manually][12]
|
||||
|
||||
Figure 6. Creating an invoice manually (Frank Bergmann, [CC BY-SA 4.0][4])
|
||||
|
||||
Fields in the invoice header:
|
||||
|
||||
* **Invoice no:** This is the invoice identification for tax reporting purposes. This number is created automatically and numbered per month. Alternative numbering schemes are available.
|
||||
* **Invoice date:** This is the date you created the invoice (for tax reporting purposes).
|
||||
* **Payment terms:** This is the number of days until the invoice is due.
|
||||
* **Payment method:** This is how the customer should pay. You can modify the available payment options in **Admin -> Categories -> Intranet Invoice Payment Method**.
|
||||
* **Invoice template:** This is a LibreOffice template that will render the invoices. **Admin -> Invoice templates** shows the list of available templates. Here you can also download a template and upload a modified version.
|
||||
* **Invoice status:** **Created** is a freshly created invoice. The other options are for tracking the payment process. You can configure invoice states in **Admin -> Categories -> Intranet Cost Status**.
|
||||
* **Invoice type:** **Customer Invoice** is the default type of invoice.
|
||||
* **Customer:** You can set up new customers in **Master Data -> Companies -> New Company** or the CRM section of ]po[.
|
||||
* **Invoice address:** One customer may have multiple places of business, so enter the address where you want this invoice sent.
|
||||
* **Contact:** Enter the person who should receive the invoice. ]po[ can send out invoices directly as emails.
|
||||
* **Notes:** Enter any notes relevant to the invoice.
|
||||
* **VAT:** Most countries use value-added tax (VAT). You can also configure VAT types (instead of a numeric value) for certain countries.
|
||||
* **TAX:** Some countries add a second tax to invoices. You can disable this field in **Admin -> Parameters -> intranet-invoices** if you don't need this.
|
||||
|
||||
|
||||
|
||||
Fields in the invoice lines:
|
||||
|
||||
* **Line:** This is a way to order the invoice line items.
|
||||
* **Description:** Enter a description of the item.
|
||||
* **Unit:** Enter the units of what you invoice (e.g., how many hours, days, etc.).
|
||||
* **UoM:** This stands for unit of measure, and it can be the number of hours, days, or just units.
|
||||
* **Rate:** This is the price per unit using the default currency. You can configure currencies in **Master Data -> Exchange Rates** and define the default currency in **Admin -> Parameters -> DefaultCurrency**.
|
||||
|
||||
|
||||
|
||||
Clicking the **Preview using Template** link will launch your text processor (Microsoft Word or LibreOffice Writer) if it's installed on your computer. You can now edit the invoice before you send it to the customer.
|
||||
|
||||
![Invoice print preview][13]
|
||||
|
||||
Figure 7. Invoice print preview (Frank Bergmann, [CC BY-SA 4.0][4])
|
||||
|
||||
#### Create an invoice semiautomatically
|
||||
|
||||
]po[ also has a wizard that converts logged hours "automagically" into invoice line items for you. This process applies to fixed-price, time-and-materials, and periodic invoicing types.
|
||||
|
||||
Use **<project> -> Finance -> New Customer Invoice from Timesheet Tasks** to start the wizard.
|
||||
|
||||
![Invoice wizard][14]
|
||||
|
||||
Figure 8. Invoice wizard (Frank Bergmann, [CC BY-SA 4.0][4])
|
||||
|
||||
The main part of the screen (labeled **(1)** in the image above) shows five different types of hours per task. This works a bit like a report but lets you take actions using the provided user interface elements:
|
||||
|
||||
* **Planned Hours:** The estimated hours for the task, as specified in the Gantt editor during project planning
|
||||
* **Billable Hours:** Similar to Planned Hours, but you can manually modify this to account for non-billable time
|
||||
* **All Reported Hours:** All timesheet hours logged by anyone, ever
|
||||
* **Reported Hours in Interval:** Hours logged between the start date and end date in the filter **(2)** at the top of the screen
|
||||
* **All Unbilled Hours:** Hours that aren't included in any previous invoice created using this wizard. This figure is useful when doing periodic invoicing to see if hours "slipped through" in past invoicing runs.
|
||||
|
||||
|
||||
|
||||
The checkboxes **(3)** in the first column let you manually deselect certain tasks. The **Aggregate hours** checkbox **(4)** lets you create invoice lines per task (when unchecked) or invoice lines per material (when checked). Select **aggregate** if there are many tasks in your project; otherwise, your invoice could become very long.
|
||||
|
||||
Your result is an invoice like this:
|
||||
|
||||
![Invoice proposed by the wizard][15]
|
||||
|
||||
Figure 9. Invoice proposed by the wizard (Frank Bergmann, [CC BY-SA 4.0][4])
|
||||
|
||||
This is similar to the manually created invoice but with additional information:
|
||||
|
||||
* The invoice lines are copied from the selected tasks in the previous screen. Summary tasks are excluded because, otherwise, the number of hours would be duplicated.
|
||||
* The **Rate** column includes the best matching rate for the task (see below).
|
||||
|
||||
|
||||
|
||||
Select the **Create Customer Invoice** button to finish the process. But before doing that, you may want to check that the prices are right.
|
||||
|
||||
##### Check the price list and reference prices
|
||||
|
||||
The **Reference Prices** section in the figure above explains how the best matching rate is determined for each of the six invoice lines (this is why the same line is repeated six times).
|
||||
|
||||
The source of this data is the **Company Timesheet Prices** portlet.
|
||||
|
||||
![Company Timesheet Prices portlet][16]
|
||||
|
||||
Figure 10. Price list with one entry (Frank Bergmann, [CC BY-SA 4.0][4])
|
||||
|
||||
This example contains a single line with **Hour** as the UoM and 75.00 EUR as the **Rate**; all other fields are empty. We could translate this as: "All hours for this customer cost EUR 75.00." This is a suitable definition of a "default rate" if you want to keep things simple.
|
||||
|
||||
##### Use the price-finding algorithm
|
||||
|
||||
Unfortunately, reality tends to be complex. Consider the example below. It defines a discount for TCL Programming Hours but only for the specific project Motor Development (2016_0019).
|
||||
|
||||
![Price-finding data entry screen][17]
|
||||
|
||||
Figure 11. Price entry in a specific project (Frank Bergmann, [CC BY-SA 4.0][4])
|
||||
|
||||
The price-finding algorithm will select the most suitable rate for each line of the new invoice by choosing the one with the highest number of matching fields and discarding those with hard mismatches. The **Reference Prices** section will list all candidate rate entries, from best match to worst.
|
||||
|
||||
In the end, though, it's up to you to modify the proposed rates. This option for manual intervention is designed to handle the most unusual cases.
|
||||
|
||||
### Next steps
|
||||
|
||||
There are a number of steps that come after writing an invoice. Detailing them would exceed the scope of this tutorial. However, the functionality is available as part of the ]po[ Community Edition:
|
||||
|
||||
* **Accounts receivable:** The **Finance -> Accounts Receivable** section allows you to follow up on invoices and send reminders to customers.
|
||||
* **Procurement and accounts payable:** ]po[ includes a project-based procurement and vendor-management system.
|
||||
* **Profit and loss:** You'll be interested to see if you made a profit on your project or not.
|
||||
* **Learned lessons:** You may want to do a post-mortem to review the project and learn what to do differently the next time.
|
||||
* **Cash-flow forecasting:** Starting with your current bank account level, your invoices, and your CRM sales funnel, this will calculate the moment when your company will run out of money.
|
||||
* **Management accounting:** This consists of many that reports that will answer most questions about your business out of the box. There's a tutorial on how to write your own reports.
|
||||
* **Tax reporting:** ]po[ captures almost everything a service company needs for tax reporting. There are export interfaces for various accounting software packages.
|
||||
|
||||
|
||||
|
||||
What are your biggest challenges with invoicing customers? Please share your pet peeves in the comments.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/7/open-source-invoicing-po
|
||||
|
||||
作者:[Frank Bergmann][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/fraber
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_browser_web_desktop.png?itok=Bw8ykZMA (Digital images of a computer desktop)
|
||||
[2]: https://www.project-open.com/
|
||||
[3]: https://opensource.com/sites/default/files/uploads/1-invoicingprocess.png (Invoicing processes covered in this tutorial)
|
||||
[4]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[5]: https://opensource.com/sites/default/files/uploads/2-ganttchart.png (Initial project definition Gantt Chart)
|
||||
[6]: https://www.project-open.com/en/list-installers
|
||||
[7]: https://opensource.com/sites/default/files/pictures/define-a-project-gantt-project.png (Gantt chart with project definition and status)
|
||||
[8]: https://opensource.com/sites/default/files/uploads/3-timesheet-calendar.png (Time sheet calendar)
|
||||
[9]: https://opensource.com/sites/default/files/uploads/4-logging-hours.png (Logging hours)
|
||||
[10]: https://www.project-open.com/en/
|
||||
[11]: https://opensource.com/sites/default/files/uploads/5-project-status.png (Project status Gantt chart)
|
||||
[12]: https://opensource.com/sites/default/files/uploads/6-invoicing.png (Creating an invoice manually)
|
||||
[13]: https://opensource.com/sites/default/files/uploads/7-invoice-preview.png (Invoice print preview)
|
||||
[14]: https://opensource.com/sites/default/files/uploads/8-invoice-wizard_rev.png (Invoice wizard)
|
||||
[15]: https://opensource.com/sites/default/files/uploads/8-invoice-wizard.png (Invoice proposed by the wizard)
|
||||
[16]: https://opensource.com/sites/default/files/uploads/10-timesheet-prices.png (Company Timesheet Prices portlet)
|
||||
[17]: https://opensource.com/sites/default/files/uploads/11-price-finding.png (Price-finding data entry screen)
|
@ -0,0 +1,170 @@
|
||||
[#]: subject: "Find files and directories on Linux with the find command"
|
||||
[#]: via: "https://opensource.com/article/21/9/linux-find-command"
|
||||
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Find files and directories on Linux with the find command
|
||||
======
|
||||
There are many reasons to learn find, so download our free find cheat
|
||||
sheet to help you learn more about the command.
|
||||
![Magnifying glass on code][1]
|
||||
|
||||
Regardless of how organized I resolve to be, it seems there are always times when I just can't locate a file. Sometimes it's because I can't remember the name of the file in the first place. Other times, I know the name, but I can't recall where I decided to save it. There are even times when I need a file that I didn't create in the first place. No matter what the quandary, though, I know that on a [POSIX system][2], I always have the `find` command.
|
||||
|
||||
### Installing find
|
||||
|
||||
The `find` command is defined by the [POSIX specification][3], which creates the open standard by which POSIX systems (including Linux, BSD, and macOS) are measured. Simply put, you already have `find` installed as long as you're running Linux, BSD, or macOS.
|
||||
|
||||
However, not all `find` commands are exactly alike. The GNU `find` command, for instance, has features that the BSD or Busybox or Solaris `find` command might not have or does have but implements differently. This article uses GNU `find` from the [findutils][4] package because it's readily available and pretty popular. Most commands demonstrated in this article work with other implementations of `find`, but should you try a command on a platform other than Linux and get unexpected results, try downloading and installing the GNU version.
|
||||
|
||||
### Find a file by name
|
||||
|
||||
You can locate a file by its filename by providing the full file name or parts of the file name using regular expressions. The `find` command requires the path to the directory you want to search in, options to specify what attribute you're searching (for instance, -`name` for a case-sensitive file name), and then the search string. By default, your search string is treated literally: The `find` command searches for a filename that is exactly the string you enter between quotes unless you use regular expression syntax.
|
||||
|
||||
Assume your Documents directory contains four files: `Foo`, `foo`, `foobar.txt`, and `foo.xml`. Here's a literal search for a file with the name "foo":
|
||||
|
||||
|
||||
```
|
||||
$ find ~ -name "foo"
|
||||
/home/tux/Documents/examples/foo
|
||||
```
|
||||
|
||||
You can broaden your search by making it case-insensitive with the `-iname` option:
|
||||
|
||||
|
||||
```
|
||||
$ find ~ -iname "foo"
|
||||
/home/tux/Documents/examples/foo
|
||||
/home/tux/Documents/examples/Foo
|
||||
```
|
||||
|
||||
### Wildcards
|
||||
|
||||
You can use basic shell wildcard characters to broaden your search. For instance, the asterisk (`*`) represents any number of characters:
|
||||
|
||||
|
||||
```
|
||||
$ find ~ -iname "foo*"
|
||||
/home/tux/Documents/examples/foo
|
||||
/home/tux/Documents/examples/Foo
|
||||
/home/tux/Documents/examples/foo.xml
|
||||
/home/tux/Documents/examples/foobar.txt
|
||||
```
|
||||
|
||||
A question mark (`?`) represents a single character:
|
||||
|
||||
|
||||
```
|
||||
$ find ~ -iname "foo*.???"
|
||||
/home/tux/Documents/examples/foo.xml
|
||||
/home/tux/Documents/examples/foobar.txt
|
||||
```
|
||||
|
||||
This isn't regular expression syntax, so the dot (`.`) represents a literal dot in this example.
|
||||
|
||||
### Regular expressions
|
||||
|
||||
You can also use regular expressions. As with `-iname` and `-name`, there's both a case-sensitive and a case-insensitive option. Unlike the `-name` and `-iname` options, though, a `-regex` and `-iregex` search is applied to the _whole path_, not just the file name. That means if you search for `foo`, you get no results because `foo` doesn't match `/home/tux/Documents/foo`. Instead, you must either search for the entire path, or else use a wildcard sequence at the beginning of your string:
|
||||
|
||||
|
||||
```
|
||||
$ find ~ -iregex ".*foo"
|
||||
/home/tux/Documents/examples/foo
|
||||
/home/tux/Documents/examples/Foo
|
||||
```
|
||||
|
||||
### Find a file modified within the last week
|
||||
|
||||
To find a file you last modified last week, use the `-mtime` option along with a (negative) number of days in the past:
|
||||
|
||||
|
||||
```
|
||||
$ find ~ -mtime -7
|
||||
/home/tux/Documents/examples/foo
|
||||
/home/tux/Documents/examples/Foo
|
||||
/home/tux/Documents/examples/foo.xml
|
||||
/home/tux/Documents/examples/foobar.txt
|
||||
```
|
||||
|
||||
### Find a file modified within a range of days
|
||||
|
||||
You can combine `-mtime` options to locate a file within a range of days. For the first `-mtime` argument, provide the most recent number of days you could have modified the file, and for the second, give the greatest number of days. For instance, this search looks for files with modification times more than one day in the past, but no more than seven:
|
||||
|
||||
|
||||
```
|
||||
`$ find ~ -mtime +1 -mtime -7`
|
||||
```
|
||||
|
||||
### Limit a search by file type
|
||||
|
||||
It's common to optimize the results of `find` by specifying the file type you're looking for. You shouldn't use this option if you're not sure what you're looking for, but if you know you're looking for a file and not a directory, or a directory but not a file, then this can be a great filter to use. The option is `-type`, and its arguments are a letter code representing a few different kinds of data. The most common are:
|
||||
|
||||
* `d` \- directory
|
||||
* `f` \- file
|
||||
* `l` \- symbolic link
|
||||
* `s` \- socket
|
||||
* `p` \- named pipe (used for FIFO)
|
||||
* `b` \- block special (usually a hard drive designation)
|
||||
|
||||
|
||||
|
||||
Here are some examples:
|
||||
|
||||
|
||||
```
|
||||
$ find ~ -type d -name "Doc*"
|
||||
/home/tux/Documents
|
||||
$ find ~ -type f -name "Doc*"
|
||||
/home/tux/Downloads/10th-Doctor.gif
|
||||
$ find /dev -type b -name "sda*"
|
||||
/dev/sda
|
||||
/dev/sda1
|
||||
```
|
||||
|
||||
### Adjust scope
|
||||
|
||||
The `find` command is recursive by default, meaning that it searches for results in the directories of directories contained in directories (and so on). This can get overwhelming in a large filesystem, but you can use the `-maxdepth` option to control how deep into your folder structure you want `find` to descend:
|
||||
|
||||
|
||||
```
|
||||
$ find /usr -iname "*xml" | wc -l
|
||||
15588
|
||||
$ find /usr -maxdepth 2 -iname "*xml" | wc -l
|
||||
15
|
||||
```
|
||||
|
||||
You can alternately set the minimum depth of recursion with `-mindepth`:
|
||||
|
||||
|
||||
```
|
||||
$ find /usr -mindepth 8 -iname "*xml" | wc -l
|
||||
9255
|
||||
```
|
||||
|
||||
### Download the cheat sheet
|
||||
|
||||
This article only covers the basic functions of `find`. It's a great tool for searching through your system, but it's also a really useful front-end for the powerful [Parallel][5] command. There are many reasons to learn `find`, so **[download our free `find` cheat sheet][6]** to help you learn more about the command.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/9/linux-find-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/find-file-linux-code_magnifying_glass_zero.png?itok=E2HoPDg0 (Magnifying glass on code)
|
||||
[2]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains
|
||||
[3]: https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/
|
||||
[4]: https://www.gnu.org/software/findutils/
|
||||
[5]: https://opensource.com/article/18/5/gnu-parallel
|
||||
[6]: https://opensource.com/downloads/linux-find-cheat-sheet
|
@ -0,0 +1,99 @@
|
||||
[#]: subject: "How to Change Color of Ubuntu Terminal"
|
||||
[#]: via: "https://itsfoss.com/change-terminal-color-ubuntu/"
|
||||
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How to Change Color of Ubuntu Terminal
|
||||
======
|
||||
|
||||
The default terminal looks good enough if you want to get things done.
|
||||
|
||||
But, if you want a unique terminal experience or something that suits your taste, you can also change the color of your Ubuntu terminal.
|
||||
|
||||
In this quick tutorial, I shall focus on tweaking the color scheme of the terminal in Ubuntu. Ubuntu uses GNOME Terminal so the steps should be valid for most other distributions using GNOME desktop environment.
|
||||
|
||||
### Changing the color of your Ubuntu terminal
|
||||
|
||||
The steps are similar to how you [change the font and size of the terminal][1]. You have to find the option for customizing colors, that’s it.
|
||||
|
||||
Let me quickly highlight what you need to go through to find it:
|
||||
|
||||
**Step 1**. [Open the terminal window in Ubuntu][2] by pressing Ctrl+Alt+T.
|
||||
|
||||
**Step 2**. Head to the terminal preferences. You can click on the menu button to access the **Preferences** or right-click anywhere on the terminal screen.
|
||||
|
||||
![][3]
|
||||
|
||||
It will be a good idea to create a separate profile for your customization so that the default settings do not change.
|
||||
|
||||
![][4]
|
||||
|
||||
**Step 3**. Now, you can find the options to tweak the font size and style. But, here, you need to head to the “**Colors**” tab, as shown in the screenshot below.
|
||||
|
||||
![][5]
|
||||
|
||||
**Step 4**. By default, you will notice that it uses colors from the system theme. If you want to blend in with your system theme, that should be the preferred choice.
|
||||
|
||||
But, if you want to customize, you need to deselect the option and then start choosing the colors.
|
||||
|
||||
![][6]
|
||||
|
||||
As you can notice in the screenshot above, you can choose to use some of the built-in color schemes and also get to customize them to your liking _**by changing the default color option for the text and background.**_
|
||||
|
||||
You can customize every aspect of the terminal screen color, starting from the texts to the cursor, if you select a “custom” built-in scheme.
|
||||
|
||||
![][7]
|
||||
|
||||
Again! Create separate profiles if you want to access different customized versions of the terminal quickly or else you will end up customizing every time you want a specific color combination.
|
||||
|
||||
### Other ways to change the terminal color
|
||||
|
||||
Here are a couple of other ways to change the terminal color in Ubuntu:
|
||||
|
||||
#### Change the theme
|
||||
|
||||
Most Ubuntu themes have their own implementation of terminal colors and some of them actually look very nice. Here is how the terminal color scheme is changed for Ant and Orchis themes.
|
||||
|
||||
![][8]
|
||||
|
||||
You choose a dark theme and your terminal turns black. No need to wonder about selecting color schemes.
|
||||
|
||||
#### Change terminal color based on your wallpaper
|
||||
|
||||
If you do not want to customize the colors of your terminal manually, you can utilize Pywal. With this handy Python tool, you can [change the color scheme of your terminal][9] as per your wallpaper.
|
||||
|
||||
It will automatically adapt to any of your active wallpapers. So, you do not have to bother customizing the terminal.
|
||||
|
||||
### More Customization Options for Your Terminal
|
||||
|
||||
If you are more of a tinkerer, you would love to know that you have more options to customize the look of the terminal. You can read through our resource on [different ways to tweak the look of the terminal][10] to explore more about it.
|
||||
|
||||
_How do you prefer to customize the terminal? Let me know your experiences in the comments below!_
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/change-terminal-color-ubuntu/
|
||||
|
||||
作者:[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/change-terminal-font-ubuntu/
|
||||
[2]: https://itsfoss.com/open-terminal-ubuntu/
|
||||
[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/terminal-preference.png?resize=800%2C428&ssl=1
|
||||
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/terminal-profiles.jpg?resize=800%2C619&ssl=1
|
||||
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/terminal-colors-option.png?resize=800%2C330&ssl=1
|
||||
[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/changing-colors-ubuntu-terminal.webp?resize=800%2C654&ssl=1
|
||||
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-terminal-color-customize.png?resize=800%2C550&ssl=1
|
||||
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/terminal-ant-theme.png?resize=742%2C316&ssl=1
|
||||
[9]: https://itsfoss.com/pywal/
|
||||
[10]: https://itsfoss.com/customize-linux-terminal/
|
@ -0,0 +1,109 @@
|
||||
[#]: subject: "How to change Ubuntu Terminal Font and Size [Beginner’s Tip]"
|
||||
[#]: via: "https://itsfoss.com/change-terminal-font-ubuntu/"
|
||||
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How to change Ubuntu Terminal Font and Size [Beginner’s Tip]
|
||||
======
|
||||
|
||||
If you are spending a lot of time using the terminal on Ubuntu, you may want to adjust the font and size to get a good experience.
|
||||
|
||||
Changing the font is one of the simplest but most visual way of [Linux terminal customization][1]. Let me show you the detailed steps for changing the terminal fonts in Ubuntu along with some tips and suggestions on font selection.
|
||||
|
||||
_**Note:**_ _The steps should be the same for most other [Linux terminal emulator][2] but the way you access the option can differ._
|
||||
|
||||
### Change Ubuntu Terminal font and size using GUI
|
||||
|
||||
**Step 1.** [Launch the terminal on your Ubuntu][3] system by using Ctrl+Alt+T keys.
|
||||
|
||||
**Step 2.** Head to the “**Preferences**” option that you can find when you click on the menu.
|
||||
|
||||
![][4]
|
||||
|
||||
You can also perform a right-click anywhere on the terminal to access the option as shown below.
|
||||
|
||||
![][5]
|
||||
|
||||
**Step 3.** Now, you should be able to access the settings for the terminal. By default, there will be an unnamed profile. This is the default profile. **I suggest creating a new profile** so that your changes do not impact the default settings.
|
||||
|
||||
![][6]
|
||||
|
||||
**Step 4**. To change the font, you need to enable the “**Custom font**” option and then click on “**Monospace Regular**”
|
||||
|
||||
![][7]
|
||||
|
||||
It will show a list of fonts available for selection.
|
||||
|
||||
![][8]
|
||||
|
||||
Here, you get a quick preview of the font at the bottom of the font listing and also the ability to tweak the font size of your Ubuntu terminal.
|
||||
|
||||
By default, it uses a size of **12** for the font and **Ubuntu mono** style.
|
||||
|
||||
**Step 5**. Finally, you can search for your preferred font style and hit “**Select**” to finalize it after looking at the preview and adjusting the font size.
|
||||
|
||||
![][9]
|
||||
|
||||
That’s it. You have successfully changed the fonts. See the changes in the image below. Move the slider to see the difference.
|
||||
|
||||
![Ubuntu terminal font change][10]
|
||||
|
||||
#### Want to Customize the Look of your Linux Terminal?
|
||||
|
||||
Check out our detailed article on some terminal customization tips and tricks.
|
||||
|
||||
[Linux Terminal Tweaks][1]
|
||||
|
||||
### Tips on getting new fonts for Ubuntu terminal
|
||||
|
||||
You can download fonts from the internet in TTF file format and [easily install these new fonts in Ubuntu][11] by double-clicking the TTF file.
|
||||
|
||||
![][12]
|
||||
|
||||
You should open a new terminal window to load the newly installed fonts.
|
||||
|
||||
However, keep in mind that **Ubuntu will not show ALL the newly installed fonts in the terminal**. Why? Because the terminal is designed to use monospaced fonts. Fonts that have letters too close to each other may look weird. Some fonts do not offer proper clarity between the alphabet O and the number 0. Similarly, you may face issues in differentiating the lowercase l and i.
|
||||
|
||||
This is why you’ll see the available fonts in the terminal are often have ‘mono’ in their name.
|
||||
|
||||
Overall, there can be plenty of readability issues that could create more confusion. Hence, it is best to select a font that does not make the terminal hard to read.
|
||||
|
||||
You should also check if a font looks good/weird when you increase/decrease the size of the font to ensure that you do not have a problem when customizing the look of your terminal.
|
||||
|
||||
### Font suggestions for terminal customization
|
||||
|
||||
Free mono and Noto mono are some of the good fonts available from the default list of font selections to apply on your terminal.
|
||||
|
||||
You can try [installing new fonts in Linux][11] like **JetBrains Mono**, and **Robo Mono**, Larabiefont, Share Tech Mono and more from Google Fonts and other sources.
|
||||
|
||||
_What font style/size do you prefer to use with the Ubuntu terminal? Let us know in the comments below!_
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/change-terminal-font-ubuntu/
|
||||
|
||||
作者:[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/customize-linux-terminal/
|
||||
[2]: https://itsfoss.com/linux-terminal-emulators/
|
||||
[3]: https://itsfoss.com/open-terminal-ubuntu/
|
||||
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/terminal-preference.png?resize=800%2C428&ssl=1
|
||||
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/terminal-right-click-menu.png?resize=800%2C341&ssl=1
|
||||
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-terminal-preference-option.png?resize=800%2C303&ssl=1
|
||||
[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/enable-font-change-ubuntu-terminal.png?resize=798%2C310&ssl=1
|
||||
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/monospace-font-default.png?resize=800%2C651&ssl=1
|
||||
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-custom-font-selection.png?resize=800%2C441&ssl=1
|
||||
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-terminal-font-2.png?resize=723%2C353&ssl=1
|
||||
[11]: https://itsfoss.com/install-fonts-ubuntu/
|
||||
[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/12/install-new-fonts-ubuntu.png?resize=800%2C463&ssl=1
|
212
sources/tech/20210910 MAKE MORE with Inkscape - Ink-Stitch.md
Normal file
212
sources/tech/20210910 MAKE MORE with Inkscape - Ink-Stitch.md
Normal file
@ -0,0 +1,212 @@
|
||||
[#]: subject: "MAKE MORE with Inkscape – Ink/Stitch"
|
||||
[#]: via: "https://fedoramagazine.org/make-more-with-inkscape-ink-stitch/"
|
||||
[#]: author: "Sirko Kemter https://fedoramagazine.org/author/gnokii/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
MAKE MORE with Inkscape – Ink/Stitch
|
||||
======
|
||||
|
||||
![MAKE more with Inkscape - Ink/Stitch][1]
|
||||
|
||||
Inkscape, the most used and loved tool of Fedora’s Design Team, is not just a program for doing nice vector graphics. With vector graphics (in our case SVG) a lot more can be done. Many programs can import this format. Also, Inkscape can do a lot more than just graphics. The first article of this [series][2] showed how to [produce GCode with Inkscape][3]. This article will examine another Inkscape extension – [Ink/Stitch][4]. Ink/Stitch is an extension for designing embroidery with Inkscape.
|
||||
|
||||
### DIY Embroidery
|
||||
|
||||
In the last few years the do-it-yourself or maker scene has experienced a boom. You could say it all began with the inexpensive option of [3D printing][5]; followed by also not expensive [CNC][6] machines and laser cutters/engravers. Also the prices for more _“_traditional_”_ machines such as embroidery machines have fallen during recent years. [Home embroidery machines are now available for 500 US dollars][7].
|
||||
|
||||
If you don’t want to or can’t buy one yourself, the nearest [MakerSpace][8] often has one. Even the prices for commercial single-head embroidery machines are down to 5,000 US dollars. They are an investment that can pay off quickly.
|
||||
|
||||
### Software for Embroidery Design
|
||||
|
||||
Some of the home machines include their own software for designing embroidery. But most, if not all, of these applications are Windows-only. Also, the most used manufacturer-independent software of this area – [Embird][9] – is only available for Windows. But you could run it in Wine.
|
||||
|
||||
Another solution for Linux – [Embroidermodde][10] – is not really developed anymore. And this is after having had a fundraising campaign.
|
||||
|
||||
Today, only one solution is left – [Ink/Stitch][4]
|
||||
|
||||
![The logo of the Ink/Stitch project][11]
|
||||
|
||||
### Open Source and Embroidery Design
|
||||
|
||||
Ink/Stitch started out using [libembroidery][12]. Today [pyembroidery][13] is used. The manufacturers can’t be blamed for the prices of these machines and the number of Linux users. It is hardly worthwhile to develop applications for Linux.
|
||||
|
||||
#### The Embroidery File Format Problem
|
||||
|
||||
There is a problem with the proliferation of file formats for embroidery machines; especially among manufacturers that cook their own file format for their machines. In some cases, even a single manufacturer may use several different file formats.
|
||||
|
||||
* **.10o** – Toyota embroidery machines
|
||||
* **.100** – Toyota embroidery machines
|
||||
* **.CSD** – Poem, Huskygram, and Singer EU embroidery home sewing machines.
|
||||
* **.DSB** – Baruda embroidery machines
|
||||
* **.JEF** – MemoryCraft 10000 machines.
|
||||
* **.SEW** – MemoryCraft 5700, 8000, and 9000 machines.
|
||||
* **.PES** – Brother and Babylock embroidery home sewing machines.
|
||||
* **.PEC** – Brother and Babylock embroidery home sewing machines.
|
||||
* **.HUS** – Husqvarna/Viking embroidery home sewing machines.
|
||||
* **.PCS** – Pfaff embroidery home sewing machines.
|
||||
* **.VIP** – old Pfaff format also used by Husqvarna machines.
|
||||
* **.VP3** – newer Pfaff embroidery home sewing machines.
|
||||
* **.DST** – Tajima commercial embroidery sewing machines.
|
||||
* **.EXP** – Melco commercial embroidery sewing machines.
|
||||
* **.XXX** – Compucon, Singer embroidery home sewing machines.
|
||||
* **.ZSK** – ZSK machines on the american market
|
||||
|
||||
|
||||
|
||||
This is just a small selection of the file formats that are available for embroidery. You can find a more complete list [here][14]. If you are interested in [deeper knowledge about these file formats, see here for more information][15].
|
||||
|
||||
#### File Formats of Ink/Stitch
|
||||
|
||||
Ink/Stitch can currently read the following file formats: 100, 10o, BRO, DAT, DSB, DST, DSZ, EMD, EXP, EXY, FXY, GT, INB, JEF, JPX, KSM, MAX, MIT, NEW, PCD, PCM, PCQ, PCS, PEC, PES, PHB, PHC, SEW, SHV, STC, STX, TAP, TBF, U01, VP3, XXX, ZXY and also GCode as TXT file.
|
||||
|
||||
For the more important task of writing/saving your work, Ink/Stitch supports far fewer formats: DST, EXP, JEF, PEC, PES, U01, VP3 and of course SVG, CSV and GCode as TXT
|
||||
|
||||
Besides the problem of all these file formats, there are other problems that a potential stitch program has to overcome.
|
||||
|
||||
Working with the different kinds of stitches is one difficulty. The integration of tools for drawing and lettering is another. But why invent such a thing from scratch? Why not take an existing vector program and just add the functions for embroidery to it? That was the idea behind the [Ink/Stitch project][4] over three years ago.
|
||||
|
||||
### Install Ink/Stitch
|
||||
|
||||
Ink/Stitch is an [extension for Inkscape][16]. Inkscape’s new functionality for downloading and installing extensions is still experimental. And you will not find Ink/Stitch among the extensions that are offered there. You must [download][17] the extension manually. After it is downloaded, unzip the package into your directory for Inkscape extensions. The default location is _~/.config/Inkscape/extensions_ (or _/usr/share/inkscape/extensions_ for system-wide availability). If you have changed the defaults, you may need to check Inkscape’s settings to find the location of the extensions directory.
|
||||
|
||||
### Customization – Install Add-ons for Ink/Stitch
|
||||
|
||||
The Ink/Stitch extension provides a function called Install Add-Ons for Inkscape, which you should run first.
|
||||
|
||||
The execution of this function – _Extensions > Ink/Stitch > Thread Color Management > Install thread color palettes for Inkscape_ – will take a while.
|
||||
|
||||
Do not become nervous as there is no progress bar or a similar thing to see.
|
||||
|
||||
This function will install 70 color palettes of various yarn manufacturers and a symbol library for Ink/Stitch.
|
||||
|
||||
![Inkscape with the swatches dialogue open, which shows the Madeira Rayon color palette][18]
|
||||
|
||||
If you use the download from Github version 2.0.0, the ZIP-file contains the color palette files. You only need to unpack them into the right directory (_~/.config/inkscape/palettes/_). If you need a [hoop template, you can download][19] one and save it to _~/.config/inkscape/templates_.
|
||||
|
||||
The next time you start Inkscape, you will find it under _File > New From Template_.
|
||||
|
||||
### Lettering with Ink/Stitch
|
||||
|
||||
The way that is by far the easiest and most widely used, is to get a embroidery design using the _Lettering_ function of Ink/Stitch. It is located under _Extensions > Ink/Stitch > Lettering_. Lettering for embroidery is not simple. What you expect are so called satin stitched letters. For this, special font settings are needed.
|
||||
|
||||
![Inkscape with a “Chopin” glyph for satin stitching defined for the Lettering function][20]
|
||||
|
||||
You can convert paths to satin stitching. But this is more work intensive than using the Lettering function. Thanks to the work of an active community, the May 2021 release of Ink/Stitch 2.0 brought more predefined fonts for this. An English tutorial on how to create such fonts can be found [here][21].
|
||||
|
||||
Version 2.0 also brings functions (_Extensions > Ink/Stitch > Font Management_) to make managing these kinds of fonts easier. There are also functions for creating these kinds of fonts. But you will need knowledge about font design with Inkscape to do so. First, you create an an entire SVG font. It is then feed through a JSON script which converts the SVG font into the type of files that Ink/Stitch’s font management function works with.
|
||||
|
||||
![On the left side the Lettering dialogue and on the right the preview of this settings][22]
|
||||
|
||||
The function will open a dialogue window where you just have to put in your text, choose the size and font, and then it will render a preview.
|
||||
|
||||
### Embroider Areas/Path-Objects
|
||||
|
||||
The easiest thing with Ink/Stitch, is to embroider areas or paths. Just draw your path. When you use shapes then you have to convert them and then run _Extensions > Ink/Stitch > Fill Tools > Break Apart Fill Objects…_
|
||||
|
||||
This breaks apart the path into its different parts. You have to use this function. The _Path > Break apart_ function of Inkscape won’t work for this.
|
||||
|
||||
Next, you can run Ink/Stitch’s built-in simulator: _Extensions > Ink/Stitch > Visualise and Export > Simulator/Realistic Preview_.
|
||||
|
||||
![The new Fedora logo as Stitch Plan Preview][23]
|
||||
|
||||
Be careful with the simulator. It takes a lot system resources and it will take a while to start. You may find it easier to use the function _Extensions > Ink/Stitch > Visualise and Export > Stitch Plan Preview_. The latter renders the threading of the embroidery outside of the document.
|
||||
|
||||
![Nicubunu’s Fedora hat icon as embroidery. The angles for the stitches of the head part and the brim are different so that it looks more realistic. The outline is done in Satin stitching][24]
|
||||
|
||||
### Simple Satin and Satin Embroidery
|
||||
|
||||
Ink/Stitch will convert each stroke with a continuous line (no dashes) to what they call Zig-Zag or Simple Satin. Stitches are created along the path using the stroke width you have specified. This will work as long there aren’t too many curves on the path.
|
||||
|
||||
![Parameter setting dialogue and on the right the Fedora logo shape embroidered as Zig-Zag line][25]
|
||||
|
||||
This is simple. But it is by far not the best way. It is better to use the Satin Tools for this. The functions for the Satin embroidery can be found under _Extensions > Satin Tools_. The most important is the conversion function which converts paths to satin strokes.
|
||||
|
||||
![Fedora logo shape as Satin Line embroidery][26]
|
||||
|
||||
You can also reverse the stitch direction using _Extensions > Satin Tools > Flip Satin Column Rails_. This underlines the 3D effect satin embroidery gets, especially when you make puff embroidery. For machines that have this capability, you can also set the markings for the trims of jump stitches. To visualize these trims, Ink/Stitch uses the symbols that where installed from its own symbol library.
|
||||
|
||||
### The Ink/Stitch Stitch Library
|
||||
|
||||
What is called the stitch library is simply the kind of stitches that Ink/Stitch can create. The Fill Stitch and Zig-Zag/Satin Stitch have already been introduced. But there are more.
|
||||
|
||||
* **Running Stitches**: These are used for doing outline designs. The running stitch produces a series of small stitches following a line or curve. Each dashed line will be converted into a Running Stitch. The size of the dashes does not matter.
|
||||
|
||||
|
||||
|
||||
![A running stitch – each dashed line will be converted in such one][27]
|
||||
|
||||
* **Bean Stitches**: These can also be used for outline designs or add details to a design. The bean stitch describes a repetition of running stitches back and forth. This results in thicker threading.
|
||||
|
||||
|
||||
|
||||
![Bean Stitches – creating a thicker line][28]
|
||||
|
||||
* **Manual Stitch**: In this mode, Ink/Stitch will use each node of a path as a needle penetration point; exactly as they are placed.
|
||||
|
||||
|
||||
|
||||
![In manual mode – each node will be the needle penetration point][29]
|
||||
|
||||
* **E-Stitch**: The main use for e-stitch is a simple but strong cover stitch for applique items. It is often used for baby cloths because their skin tends to be more sensitive.
|
||||
|
||||
|
||||
|
||||
![E-Stitch mostly used for applications on baby cloths, soft but strong connection][30]
|
||||
|
||||
### Embroidery Thread List
|
||||
|
||||
Some embroidery machines (especially those designed for commercial use) allow different threads to be fitted in advance according to what will be needed for the design. These machines will automatically switch to the right thread when needed. Some file formats for embroidery support this feature. But some do not. Ink/Stitch can apply custom thread lists to an embroidery design.
|
||||
|
||||
If you want to work on an existing design, you can import a thread list: _Extensions > Ink/Stitch > Import Threadlist_. Thread lists can also be exported: _Save As different file formats as *.zip_. You can also print them: _Extensions > Ink/Stitch > Visualise and Export > Print PDF_.
|
||||
|
||||
### Conclusion
|
||||
|
||||
Writing software for embroidery design is not easy. Many functions are needed and diverse (sometimes closed-source) file formats make the task difficult. Ink/Stitch has managed to create a useful tool with many functions. It enables the user to get started with basic embroidery design. Some things could be done a little better. But it is definitely a good tool as-is and I expect that it will become better over time. Machine embroidery can be an interesting hobby and with Ink/Stitch the Fedora Linux user can begin designing breathtaking things.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/make-more-with-inkscape-ink-stitch/
|
||||
|
||||
作者:[Sirko Kemter][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://fedoramagazine.org/author/gnokii/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2021/08/drawing2-816x345.png
|
||||
[2]: https://fedoramagazine.org/series/make-more/
|
||||
[3]: https://fedoramagazine.org/make-more-with-inkscape-g-code-tools/
|
||||
[4]: https://inkstitch.org/
|
||||
[5]: https://fedoramagazine.org/3d-printing-in-fedora-from-an-idea-to-the-thing/
|
||||
[6]: https://en.wikipedia.org/wiki/Numerical_control
|
||||
[7]: https://www.amazon.com/-/de/dp/B07VZ2YBLL/ref=sr_1_11?__mk_de_DE=%C3%85M%C3%85%C5%BD%C3%95%C3%91&crid=1MFJJWXMKQD6R&dchild=1&keywords=home+embroidery+machine&qid=1628388092&rnid=2941120011&s=arts-crafts&sprefix=home+embroider+%2Caps%2C-1&sr=1-11
|
||||
[8]: https://www.fablabs.io/labs/map
|
||||
[9]: https://www.embird.net/
|
||||
[10]: https://embroidermodder.org/
|
||||
[11]: https://fedoramagazine.org/wp-content/uploads/2021/08/inkstitch_logo.png
|
||||
[12]: https://github.com/Embroidermodder/libembroidery
|
||||
[13]: https://github.com/inkstitch/pyembroidery
|
||||
[14]: http://www.needlework.ru/page/embroidery.htm
|
||||
[15]: http://edutechwiki.unige.ch/en/Embroidery_format
|
||||
[16]: https://inkscape.org/~wwderw/%E2%98%85inkstitch-embroidery-extension
|
||||
[17]: https://github.com/inkstitch/inkstitch/releases/tag/v2.0.0
|
||||
[18]: https://fedoramagazine.org/wp-content/uploads/2021/08/swatches-1024x556.png
|
||||
[19]: https://inkstitch.org/assets/images/tutorials/templates/hoop-template.svg
|
||||
[20]: https://fedoramagazine.org/wp-content/uploads/2021/08/satinfont-1024x556.png
|
||||
[21]: https://inkstitch.org/tutorials/font-creation/
|
||||
[22]: https://fedoramagazine.org/wp-content/uploads/2021/08/lettering-1024x523.png
|
||||
[23]: https://fedoramagazine.org/wp-content/uploads/2021/08/stitch-preview-1024x556.png
|
||||
[24]: https://fedoramagazine.org/wp-content/uploads/2021/08/nicu-stitch.gif
|
||||
[25]: https://fedoramagazine.org/wp-content/uploads/2021/08/zigzag-1024x463.png
|
||||
[26]: https://fedoramagazine.org/wp-content/uploads/2021/08/satin.png
|
||||
[27]: https://fedoramagazine.org/wp-content/uploads/2021/08/running-stitch-detail.jpg
|
||||
[28]: https://fedoramagazine.org/wp-content/uploads/2021/08/bean-stitch-detail.jpg
|
||||
[29]: https://fedoramagazine.org/wp-content/uploads/2021/08/manual-stitch-detail.png
|
||||
[30]: https://fedoramagazine.org/wp-content/uploads/2021/08/e-stitch-detail.jpg
|
@ -0,0 +1,157 @@
|
||||
[#]: subject: "How to Set JAVA_HOME Variable in Ubuntu Linux Correctly"
|
||||
[#]: via: "https://itsfoss.com/set-java-home-ubuntu/"
|
||||
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How to Set JAVA_HOME Variable in Ubuntu Linux Correctly
|
||||
======
|
||||
|
||||
If you are [running Java programs on Ubuntu][1] using Eclipse, [Maven][2] or Netbeans etc, you’ll need to set JAVA_HOME to your path. Otherwise, your system will complain that “java_home environment variable is not set”.
|
||||
|
||||
In this beginner’s tutorial, I’ll show the steps to correctly set Java Home variable on Ubuntu. The steps should be valid for most other Linux distributions as well.
|
||||
|
||||
The process consists of these steps:
|
||||
|
||||
* Making sure Java Development Kit (JDK) is installed.
|
||||
* Finding the correct location of JDK executable.
|
||||
* Setting the JAVA_HOME variable and making the change permanent.
|
||||
|
||||
|
||||
|
||||
### Step 1: Check if JDK is installed
|
||||
|
||||
The simplest way to check if Java Development Kit (JDK) is installed on your Linux system is by running this command:
|
||||
|
||||
```
|
||||
javac --version
|
||||
```
|
||||
|
||||
The above command checks the version of Java compiler. If it is installed, it will show the Java version.
|
||||
|
||||
![Java Compiler is installed][3]
|
||||
|
||||
If the command shows an error like javac command not found, you’ll have to install JDK.
|
||||
|
||||
![Java Compiler is not installed][4]
|
||||
|
||||
If Java Compiler is not installed on your system, install Java Development Kit using this command:
|
||||
|
||||
```
|
||||
sudo apt install default-jdk
|
||||
```
|
||||
|
||||
This will install the default Java version in your current Ubuntu version. If you need some other specific Java version, you’ll have to specify it while [installing Java on Ubuntu][5].
|
||||
|
||||
Once you have made sure that Java Compiler is present on your system, it’s time to find its location.
|
||||
|
||||
### Step 2: Get the location of JDK executable (Java Compiler)
|
||||
|
||||
The executable is usually located in the /usr/lib/jvm directory. I won’t left you on your own for a guessing game. Instead, let’s find out the path of the Java executable.
|
||||
|
||||
[Use the which command][6] to get the location of Java Compiler executable:
|
||||
|
||||
```
|
||||
which javac
|
||||
```
|
||||
|
||||
The problem here is that the location it gives is actually a [symbolic link][7]. You’ll have to follow it a couple of times:
|
||||
|
||||
![][8]
|
||||
|
||||
An easier method is to follow the symbolic link and get to the actual executable file directly using this command:
|
||||
|
||||
```
|
||||
readlink -f `which java`
|
||||
```
|
||||
|
||||
The readlink command follows a symbolic link. I have used ` around _which java_. This is called command substitution and it replaces the command with its output. So basically, the above command is equivalent to _readlink -f /usr/bin/java_ in this case.
|
||||
|
||||
In my example, the location of the executable file is **/usr/lib/jvm/java-11-openjdk-amd64/bin/java**. It could be different for you. Copy the correct path you got from the above command in your system. You know, you can [copy paste in the Ubuntu terminal][9].
|
||||
|
||||
### Step 3: Setting JAVA_HOME variable
|
||||
|
||||
Now that you have got the location, use it to set the JAVA_HOME environment variable:
|
||||
|
||||
```
|
||||
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/bin/java
|
||||
```
|
||||
|
||||
Check the value of JAVA_HOME directory:
|
||||
|
||||
```
|
||||
echo $JAVA_HOME
|
||||
```
|
||||
|
||||
![][10]
|
||||
|
||||
Try to run your program or project in the SAME TERMINAL and see if it works.
|
||||
|
||||
This is not over yet. The JAVA_HOME variable you just declared is temporary. If you close the terminal or start a new session, it will be empty again.
|
||||
|
||||
To set JAVA_HOME variable ‘permanently’, you should add it to the bashrc file in your home directory.
|
||||
|
||||
You can [use the Nano editor for editing files in the Linux terminal][11]. If you do not want that and take a simple copy-paste approach, use the following commands:
|
||||
|
||||
Back up your bashrc file (in case you mess it, you can get it back):
|
||||
|
||||
```
|
||||
cp ~/.bashrc ~/.bashrc.bak
|
||||
```
|
||||
|
||||
Next, [use the echo command to append][12] the export command you used at the beginning of this section. _**Change the command below to use the correct path as displayed by your system in**_.
|
||||
|
||||
```
|
||||
echo "export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/bin/java" >> ~/.bashrc
|
||||
```
|
||||
|
||||
Verify that it has been correctly added to the end of the file:
|
||||
|
||||
```
|
||||
tail -3 ~/.bashrc
|
||||
```
|
||||
|
||||
The above [tail command][13] will show the last 3 lines of the specified file.
|
||||
|
||||
Here’s the entire output of the above three commands.
|
||||
|
||||
![][14]
|
||||
|
||||
Now, even if you exit the session or restart the system, the JAVA_HOME variable will still be set to the value you specified. That’s what you want, right?
|
||||
|
||||
Do note that if you change the default Java version in the future, you’ll have to change the value of JAVA_HOME and point it to the correct executable path.
|
||||
|
||||
I hope this tutorial not only helped you to set Java Home, it also taught you how you are doing it.
|
||||
|
||||
If you are still facing issues or have any questions or suggestions, please let me know in the comments.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/set-java-home-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-java-program-ubuntu/
|
||||
[2]: https://maven.apache.org/
|
||||
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/check-java-compiler-ubuntu.png?resize=750%2C310&ssl=1
|
||||
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/java-compiler-check-ubuntu.png?resize=732%2C300&ssl=1
|
||||
[5]: https://itsfoss.com/install-java-ubuntu/
|
||||
[6]: https://linuxhandbook.com/which-command/
|
||||
[7]: https://linuxhandbook.com/symbolic-link-linux/
|
||||
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/get-java-home-path-ubuntu.png?resize=800%2C283&ssl=1
|
||||
[9]: https://itsfoss.com/copy-paste-linux-terminal/
|
||||
[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/setting-java-home-ubuntu.png?resize=800%2C268&ssl=1
|
||||
[11]: https://itsfoss.com/nano-editor-guide/
|
||||
[12]: https://linuxhandbook.com/echo-command/
|
||||
[13]: https://linuxhandbook.com/tail-command/
|
||||
[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/set-java-home-bashrc-ubuntu.png?resize=786%2C348&ssl=1
|
206
sources/tech/20210911 Play with model trains in OpenTTD.md
Normal file
206
sources/tech/20210911 Play with model trains in OpenTTD.md
Normal file
@ -0,0 +1,206 @@
|
||||
[#]: 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/
|
@ -0,0 +1,327 @@
|
||||
[#]: subject: "How I rediscovered Logo with the Python Turtle module"
|
||||
[#]: via: "https://opensource.com/article/21/9/logo-python-turtle"
|
||||
[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How I rediscovered Logo with the Python Turtle module
|
||||
======
|
||||
The Logo programming language is available today as a Python package.
|
||||
![Box turtle][1]
|
||||
|
||||
When I was in high school, one of the very first programming languages I was introduced to was Logo. It was interactive and visual. With basic movement commands, you could have your cursor (“turtle”) draw basic shapes and intricate patterns. It was a great way to introduce the compelling concept of an algorithm—a series of instructions for a computer to execute.
|
||||
|
||||
Fortunately, the Logo programming language is available today as a Python package. So let’s jump right in, and you can discover the possibilities with Logo as we go along.
|
||||
|
||||
### Installing the Turtle module
|
||||
|
||||
Logo is available as the [`turtle` package for Python][2]. To use it, you must have Python installed first. Python is already installed on Linux and BSD, and it's easy to install on both [MacOS][3] and [Windows][4].
|
||||
|
||||
Once you have Python installed, install the Turtle module:
|
||||
|
||||
|
||||
```
|
||||
`pip3 install turtle`
|
||||
```
|
||||
|
||||
### Bob draws a square
|
||||
|
||||
With the `turtle` package installed, you can draw some basic shapes.
|
||||
|
||||
To draw a square, imagine a turtle (call him Bob) in the middle of your screen, holding a pen with his tail. Every time Bob moves, he draws a line behind him. How must Bob move to draw a square?
|
||||
|
||||
1. Move forward 100 steps.
|
||||
2. Turn right 90 degrees.
|
||||
3. Move forward 100 steps.
|
||||
4. Turn right 90 degrees.
|
||||
5. Move forward 100 steps.
|
||||
6. Turn right 90 degrees.
|
||||
7. Move forward 100 steps.
|
||||
|
||||
|
||||
|
||||
Now write the above algorithm in Python. Create a file called `logo.py` and place the following code in it.
|
||||
|
||||
|
||||
```
|
||||
import turtle
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
turtle.title('Hi! I\'m Bob the turtle!')
|
||||
turtle.setup(width=800, height=800)
|
||||
|
||||
bob = turtle.Turtle(shape='turtle')
|
||||
bob.color('orange')
|
||||
|
||||
# Drawing a square
|
||||
bob.forward(100)
|
||||
bob.right(90)
|
||||
bob.forward(100)
|
||||
bob.right(90)
|
||||
bob.forward(100)
|
||||
bob.right(90)
|
||||
bob.forward(100)
|
||||
|
||||
turtle.exitonclick()
|
||||
```
|
||||
|
||||
Save the above as `logo.py` and run it:
|
||||
|
||||
|
||||
```
|
||||
`$ python3 logo.py`
|
||||
```
|
||||
|
||||
Bob draws a square on the screen:
|
||||
|
||||
![Logo drawn square][5]
|
||||
|
||||
Illustration by Ayush Sharma, [CC BY-SA 4.0][6]
|
||||
|
||||
### Bob draws a hexagon
|
||||
|
||||
To draw a hexagon, Bob must move like this:
|
||||
|
||||
1. Move forward 150 steps.
|
||||
2. Turn right 60 degrees.
|
||||
3. Move forward 150 steps.
|
||||
4. Turn right 60 degrees.
|
||||
5. Move forward 150 steps.
|
||||
6. Turn right 60 degrees.
|
||||
7. Move forward 150 steps.
|
||||
8. Turn right 60 degrees.
|
||||
9. Move forward 150 steps.
|
||||
10. Turn right 60 degrees.
|
||||
11. Move forward 150 steps.
|
||||
|
||||
|
||||
|
||||
In Python, you can use a [`for` loop][7] to move Bob:
|
||||
|
||||
|
||||
```
|
||||
import turtle
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
turtle.title('Hi! I\'m Bob the turtle!')
|
||||
turtle.setup(width=800, height=800)
|
||||
|
||||
bob = turtle.Turtle(shape='turtle')
|
||||
bob.color('orange')
|
||||
|
||||
# Drawing a hexagon
|
||||
for i in range(6):
|
||||
|
||||
bob.forward(150)
|
||||
bob.right(60)
|
||||
|
||||
turtle.exitonclick()
|
||||
```
|
||||
|
||||
Run your code again and watch Bob draw a hexagon.
|
||||
|
||||
![Logo drawn hexagon][8]
|
||||
|
||||
Illustration by Ayush Sharma, [CC BY-SA 4.0][6]
|
||||
|
||||
### Bob draws a square spiral
|
||||
|
||||
Now try drawing a square spiral, but this time you can speed things up a bit. You can use the `speed` function and set `bob.speed(2000)` so that Bob moves faster.
|
||||
|
||||
|
||||
```
|
||||
import turtle
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
turtle.title('Hi! I\'m Bob the turtle!')
|
||||
turtle.setup(width=800, height=800)
|
||||
|
||||
bob = turtle.Turtle(shape='turtle')
|
||||
bob.color('orange')
|
||||
|
||||
# Drawing a square spiral
|
||||
bob.speed(2000)
|
||||
for i in range(500):
|
||||
|
||||
bob.forward(i)
|
||||
bob.left(91)
|
||||
|
||||
turtle.exitonclick()
|
||||
```
|
||||
|
||||
![Logo drawn spiral][9]
|
||||
|
||||
Illustration by Ayush Sharma, [CC BY-SA 4.0][6]
|
||||
|
||||
### Bob and Larry draw a weird snake thing
|
||||
|
||||
In the above examples, you initialized `Bob` as an object of the `Turtle` class. You're not limited to just one turtle, though. In the next code block, create a second turtle called `Larry` to draw along with Bob.
|
||||
|
||||
The `penup()` function makes the turtles lift their pens, so they don’t draw anything as they move, and the `stamp()` function places a marker whenever it’s called.
|
||||
|
||||
|
||||
```
|
||||
import turtle
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
turtle.title('Hi! We\'re Bob and Larry!')
|
||||
turtle.setup(width=800, height=800)
|
||||
|
||||
bob = turtle.Turtle(shape='turtle')
|
||||
larry = turtle.Turtle(shape='turtle')
|
||||
bob.color('orange')
|
||||
larry.color('purple')
|
||||
|
||||
bob.penup()
|
||||
larry.penup()
|
||||
bob.goto(-180, 200)
|
||||
larry.goto(-150, 200)
|
||||
for i in range(30, -30, -1):
|
||||
|
||||
bob.stamp()
|
||||
larry.stamp()
|
||||
bob.right(i)
|
||||
larry.right(i)
|
||||
bob.forward(20)
|
||||
larry.forward(20)
|
||||
|
||||
turtle.exitonclick()
|
||||
```
|
||||
|
||||
![Logo drawn snake][10]
|
||||
|
||||
Illustration by Ayush Sharma, [CC BY-SA 4.0][6]
|
||||
|
||||
### Bob draws a sunburst
|
||||
|
||||
Bob can also draw simple lines and fill them in with color. The functions `begin_fill()` and `end_fill()` allow Bob to fill a shape with the color set with `fillcolor()`.
|
||||
|
||||
|
||||
```
|
||||
import turtle
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
turtle.title('Hi! I\'m Bob the turtle!')
|
||||
turtle.setup(width=800, height=800)
|
||||
|
||||
bob = turtle.Turtle(shape='turtle')
|
||||
bob.color('orange')
|
||||
|
||||
# Drawing a filled star thingy
|
||||
bob.speed(2000)
|
||||
bob.fillcolor('yellow')
|
||||
bob.pencolor('red')
|
||||
|
||||
for i in range(200):
|
||||
|
||||
bob.begin_fill()
|
||||
bob.forward(300 - i)
|
||||
bob.left(170)
|
||||
bob.forward(300 - i)
|
||||
bob.end_fill()
|
||||
|
||||
turtle.exitonclick()
|
||||
```
|
||||
|
||||
![Logo drawn sunburst][11]
|
||||
|
||||
Illustration by Ayush Sharma, [CC BY-SA 4.0][6]
|
||||
|
||||
### Larry draws a Sierpinski triangle
|
||||
|
||||
Bob enjoys drawing simple geometrical shapes holding a pen with his tail as much as the next turtle, but what he enjoys most is drawing fractals.
|
||||
|
||||
One such shape is the [Sierpinski triangle][12], which is an equilateral triangle recursively subdivided into smaller equilateral triangles. It looks something like this:
|
||||
|
||||
![Logo drawn triangle][13]
|
||||
|
||||
Illustration by Ayush Sharma, [CC BY-SA 4.0][6]
|
||||
|
||||
To draw the Sierpinski triangle above, Bob has to work a bit harder:
|
||||
|
||||
|
||||
```
|
||||
import turtle
|
||||
|
||||
def get_mid_point(point_1: list, point_2: list):
|
||||
|
||||
return ((point_1[0] + point_2[0]) / 2, (point_1[1] + point_2[1]) / 2)
|
||||
|
||||
def triangle(turtle: turtle, points, depth):
|
||||
|
||||
turtle.penup()
|
||||
turtle.goto(points[0][0], points[0][1])
|
||||
|
||||
turtle.pendown()
|
||||
turtle.goto(points[1][0], points[1][1])
|
||||
turtle.goto(points[2][0], points[2][1])
|
||||
turtle.goto(points[0][0], points[0][1])
|
||||
|
||||
if depth > 0:
|
||||
|
||||
triangle(turtle, [points[0], get_mid_point(points[0], points[1]), get_mid_point(points[0], points[2])], depth-1)
|
||||
triangle(turtle, [points[1], get_mid_point(points[0], points[1]), get_mid_point(points[1], points[2])], depth-1)
|
||||
triangle(turtle, [points[2], get_mid_point(points[2], points[1]), get_mid_point(points[0], points[2])], depth-1)
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
turtle.title('Hi! I\'m Bob the turtle!')
|
||||
turtle.setup(width=800, height=800)
|
||||
|
||||
larry = turtle.Turtle(shape='turtle')
|
||||
larry.color('purple')
|
||||
|
||||
points = [[-175, -125], [0, 175], [175, -125]] # size of triangle
|
||||
|
||||
triangle(larry, points, 5)
|
||||
|
||||
turtle.exitonclick()
|
||||
```
|
||||
|
||||
### Wrap up
|
||||
|
||||
The Logo programming language is a great way to teach basic programming concepts, such as how a computer can execute a set of commands. Also, because the library is now available in Python, it can be used to visualize complex ideas and concepts.
|
||||
|
||||
I hope Bob and Larry have been enjoyable and instructive.
|
||||
|
||||
Have fun, and happy coding.
|
||||
|
||||
* * *
|
||||
|
||||
_This article was originally published on the [author's personal blog][14] and has been adapted with permission._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/9/logo-python-turtle
|
||||
|
||||
作者:[Ayush Sharma][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/ayushsharma
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/patti-black-unsplash.jpg?itok=hS8wQNUg (Box turtle)
|
||||
[2]: https://docs.python.org/3.7/library/turtle.html
|
||||
[3]: https://opensource.com/article/19/5/python-3-default-mac
|
||||
[4]: https://opensource.com/article/19/8/how-install-python-windows
|
||||
[5]: https://opensource.com/sites/default/files/uploads/rediscovering-logo-python-turtle-square.jpg (Logo drawn square)
|
||||
[6]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[7]: https://opensource.com/article/18/3/loop-better-deeper-look-iteration-python
|
||||
[8]: https://opensource.com/sites/default/files/uploads/rediscovering-logo-python-turtle-hexagon.jpg (Logo drawn hexagon)
|
||||
[9]: https://opensource.com/sites/default/files/uploads/rediscovering-logo-python-turtle-square-spiral.jpg (Logo drawn spiral)
|
||||
[10]: https://opensource.com/sites/default/files/uploads/rediscovering-logo-python-turtle-stamping-larry.jpg (Logo drawn snake)
|
||||
[11]: https://opensource.com/sites/default/files/uploads/rediscovering-logo-python-turtle-sunburst.jpg (Logo drawn sunburst)
|
||||
[12]: https://en.wikipedia.org/wiki/Sierpinski_triangle
|
||||
[13]: https://opensource.com/sites/default/files/uploads/rediscovering-logo-python-turtle-sierpinski-triangle.jpg (Logo drawn triangle)
|
||||
[14]: https://notes.ayushsharma.in/2019/06/rediscovering-logo-with-bob-the-turtle
|
@ -0,0 +1,83 @@
|
||||
[#]: subject: "Replace smart quotes with the Linux sed command"
|
||||
[#]: via: "https://opensource.com/article/21/9/sed-replace-smart-quotes"
|
||||
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Replace smart quotes with the Linux sed command
|
||||
======
|
||||
Banish "smart" quotes with your favorite version of sed.
|
||||
![Coding on a computer][1]
|
||||
|
||||
In typography, a pair of quotation marks were traditionally oriented toward one another. They look like this:
|
||||
|
||||
“smart quotes”
|
||||
|
||||
As computers became popular in the mid-twentieth century, the orientation was often abandoned. The original character set of computers didn't have much room to spare, so it makes sense that two double-quotes and two single-quotes were reduced down to just one of each in the ASCII specification. These days the common character set is Unicode, with plenty of space for lots of fancy quotation marks and apostrophes, but many people have become used to the minimalism of just one character for both opening and closing quotes. Besides that, computers actually see the different kinds of quotation marks and apostrophes as distinct characters. In other words, to a copmuter the right double quote is different from the left double quote or a straight quote.
|
||||
|
||||
### Replacing smart quotes with sed
|
||||
|
||||
Computers aren't typewriters. When you press a key on your keyboard, you're not pressing a lever with an inkstamp attached to it. You're just pressing a button that sends a signal to your computer, which the computer interprets as a request to display a specific predefined character. The request depends on your keyboard map. As a Dvorak typist, I've witnessed the confusion on people's faces when they discover "asdf" on my keyboard produces "aoeu" on the screen. You may also have pressed special combinations of keys to produce characters, such as ™ or ß or ≠, that's not even printed on your keyboard.
|
||||
|
||||
Each letter or character, whether it's printed on your keyboard or not, has a code. Character encoding can be expressed in different ways, but to a computer the Unicode sequences u2018 and u2019 produce **‘** and **’**, while the codes u201c and u201d produce the **“** and **”** characters. Knowing these "secret" codes means you can replace them programmatically using a command like [sed][2]. Any version of sed will do, so you can use GNU sed or BSD sed or even [Busybox][3] sed.
|
||||
|
||||
Here's the simple shell script I use:
|
||||
|
||||
|
||||
```
|
||||
#!/bin/sh
|
||||
# GNU All-Permissive License
|
||||
|
||||
SDQUO=$(echo -ne '\u2018\u2019')
|
||||
RDQUO=$(echo -ne '\u201C\u201D')
|
||||
$SED -i -e "s/[$SDQUO]/\'/g" -e "s/[$RDQUO]/\"/g" "${1}"
|
||||
```
|
||||
|
||||
Save this script as `fixquotes.sh` and then create a separate test file containing smart quotes:
|
||||
|
||||
|
||||
```
|
||||
‘Single quote’
|
||||
“Double quote”
|
||||
```
|
||||
|
||||
Run the script, and then use the [cat][4] command to see the results:
|
||||
|
||||
|
||||
```
|
||||
$ sh ./fixquotes.sh test.txt
|
||||
$ cat test.txt
|
||||
'Single quote'
|
||||
"Double quote"
|
||||
```
|
||||
|
||||
### Install sed
|
||||
|
||||
If you’re using Linux, BSD, or macOS, then you already have GNU or BSD `sed` installed. These are two unique reimplementations of the original `sed` command, and for the script in this article they are functionally the same (that's not true for all scripts, though).
|
||||
|
||||
On Windows, you can [install GNU sed][5] with [Chocolatey][6].
|
||||
|
||||
Vim offers great benefits to writers, regardless of whether they are technically minded or not.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/9/sed-replace-smart-quotes
|
||||
|
||||
作者:[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/code_computer_laptop_hack_work.png?itok=aSpcWkcl (Coding on a computer)
|
||||
[2]: https://opensource.com/article/20/12/sed
|
||||
[3]: https://opensource.com/article/21/8/what-busybox
|
||||
[4]: https://opensource.com/article/19/2/getting-started-cat-command
|
||||
[5]: https://chocolatey.org/packages/sed
|
||||
[6]: https://opensource.com/article/20/3/chocolatey
|
@ -0,0 +1,136 @@
|
||||
[#]: subject: "Revolt: An Open-Source Alternative to Discord"
|
||||
[#]: via: "https://itsfoss.com/revolt/"
|
||||
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Revolt: An Open-Source Alternative to Discord
|
||||
======
|
||||
|
||||
_**Brief**: Revolt is a promising free and open-source choice to replace Discord. Here, we take a look at what it offers along with its initial impressions._
|
||||
|
||||
Discord is a feature-rich collaboration platform primarily tailored for gamers. Even though you can use Discord on Linux with no issues, it is still a proprietary solution.
|
||||
|
||||
You can choose to use [Element][1] as an open-source solution collaboration platform, but it is not a replacement.
|
||||
|
||||
But, Revolt is an impressive Discord alternative that is open-source.
|
||||
|
||||
Note
|
||||
|
||||
Revolt is in the public beta testing phase and does not offer any mobile applications. It may lack some essential features that you find on Discord.
|
||||
|
||||
Let me highlight what you can expect with Revolt and if it can be a replacement for Discord on Linux.
|
||||
|
||||
### An Open Source Discord Alternative That You Can Self-Host
|
||||
|
||||
![][2]
|
||||
|
||||
Revolt is not just a simple open-source replacement, but you also get the ability to self-host.
|
||||
|
||||
It does lack a variety of features that Discord offers, but you get a lot of basic functionalities to get a head start to start experimenting.
|
||||
|
||||
Even without some features, you could mention it as a feature-rich open-source client. Let us look at the features available right now.
|
||||
|
||||
### Features of Revolt
|
||||
|
||||
![][3]
|
||||
|
||||
While it looks and feels a lot like Discord already, here are some of the key highlights:
|
||||
|
||||
* Ability to create your own server
|
||||
* Create text channels and voice channels
|
||||
* Assign user roles in a server
|
||||
* Tweak the theme (dark/light)
|
||||
* Change the accent color
|
||||
* Manage the font and emoji packs from available options
|
||||
* Custom CSS support
|
||||
* Ability to add bots
|
||||
* Easy to manage permissions for text/voice channels
|
||||
* Send friend requests to other users
|
||||
* Saved notes section
|
||||
* Ability to control notifications
|
||||
* Hardware acceleration support
|
||||
* Dedicated desktop settings
|
||||
* Self-hosting using Docker
|
||||
* User status and custom status support
|
||||
|
||||
|
||||
|
||||
So, as something in the public beta testing phase, it sounds excellent for starters. You already get most of the core functionalities, but you may want to wait to see it as a full-fledged Discord replacement.
|
||||
|
||||
### Initial Impressions of Using Revolt
|
||||
|
||||
![][4]
|
||||
|
||||
If you have used Discord, the user experience will feel familiar. And that is a good thing here.
|
||||
|
||||
For this quick app highlight, I did not compare the resource usage of Discord and Revolt because it is still in beta and won’t be an apples-to-apples comparison.
|
||||
|
||||
However, in my brief testing, it felt snappy, except the case when you load up a text channel for the first time. When publishing this, it did not have the Two-Factor Authentication (2FA) feature but was supposed to be added in their first milestone (Version 1) release.
|
||||
|
||||
![][5]
|
||||
|
||||
Some features like user status, permission management, and appearance tweaks looked useful. But, when it comes to the voice channels, it is not the same way as Discord works, at least for now.
|
||||
|
||||
I have no idea if they plan to do it the same way, but Discord’s voice channel feature is intuitive, fast, and with better controls.
|
||||
|
||||
Not to forget, Discord also offers “Discord Stage,” which is a Clubhouse-like audio room feature.
|
||||
|
||||
Some other features that I couldn’t find included:
|
||||
|
||||
* Ability to react to messages
|
||||
* Noise suppression feature
|
||||
* Change server
|
||||
* Server logs
|
||||
* Variety of useful bots
|
||||
|
||||
|
||||
|
||||
Of course, it will take a significant amount of time to catch up with the features offered by Discord, but at least we now have an open-source solution to Discord.
|
||||
|
||||
You can explore their [project roadmap/release tracker][6] to see what you can expect in its final/future releases.
|
||||
|
||||
### Install Revolt in Linux
|
||||
|
||||
Revolt is available for Linux and Windows. You can choose to use it on your web browser without needing a separate application.
|
||||
|
||||
But, if you need to have it on your desktop, they offer an AppImage file and a deb package that you can grab from its [GitHub releases section][7].
|
||||
|
||||
If you’re new to Linux, refer to our resources on [using an AppImage file][8] and [installing deb packages][9] to get started.
|
||||
|
||||
Feel free to head to its [Feedback section][10] if you want to help them improve with your bug reports and suggestions. Also, you can explore their [GitHub page][11] for more information.
|
||||
|
||||
[Revolt][12]
|
||||
|
||||
What do you think about Revolt? Do you believe that it has the potential to become a good open-source replacement to Discord on Linux?
|
||||
|
||||
Let me know your thoughts in the comments down below!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/revolt/
|
||||
|
||||
作者:[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/element/
|
||||
[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/revolt-screenshot.png?resize=800%2C506&ssl=1
|
||||
[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/revolt-desktop-settings.png?resize=800%2C501&ssl=1
|
||||
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/revolt-screenshot1.png?resize=800%2C509&ssl=1
|
||||
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/revolt-appearance-setting.png?resize=800%2C524&ssl=1
|
||||
[6]: https://github.com/orgs/revoltchat/projects/2
|
||||
[7]: https://github.com/revoltchat/desktop/releases/tag/v1.0.2
|
||||
[8]: https://itsfoss.com/use-appimage-linux/
|
||||
[9]: https://itsfoss.com/install-deb-files-ubuntu/
|
||||
[10]: https://app.revolt.chat/settings/feedback
|
||||
[11]: https://github.com/revoltchat
|
||||
[12]: https://revolt.chat
|
@ -0,0 +1,188 @@
|
||||
[#]: subject: "A guide to web scraping in Python using Beautiful Soup"
|
||||
[#]: via: "https://opensource.com/article/21/9/web-scraping-python-beautiful-soup"
|
||||
[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
A guide to web scraping in Python using Beautiful Soup
|
||||
======
|
||||
The Beautiful Soup library in Python makes extracting HTML from web
|
||||
pages easy.
|
||||
![Computer screen with files or windows open][1]
|
||||
|
||||
Today we'll discuss how to use the Beautiful Soup library to extract content from an HTML page. After extraction, we'll convert it to a Python list or dictionary using Beautiful Soup.
|
||||
|
||||
### What is web scraping, and why do I need it?
|
||||
|
||||
The simple answer is this: Not every website has an API to fetch content. You might want to get recipes from your favorite cooking website or photos from a travel blog. Without an API, extracting the HTML, or _scraping_, might be the only way to get that content. I'm going to show you how to do this in Python.
|
||||
|
||||
**Not all websites take kindly to scraping, and some may prohibit it explicitly. Check with the website owners if they're okay with scraping.**
|
||||
|
||||
### How do I scrape a website in Python?
|
||||
|
||||
For web scraping to work in Python, we're going to perform three basic steps:
|
||||
|
||||
1. Extract the HTML content using the `requests` library.
|
||||
2. Analyze the HTML structure and identify the tags which have our content.
|
||||
3. Extract the tags using Beautiful Soup and put the data in a Python list.
|
||||
|
||||
|
||||
|
||||
### Installing the libraries
|
||||
|
||||
Let's first install the libraries we'll need. The `requests` library fetches the HTML content from a website. Beautiful Soup parses HTML and converts it to Python objects. To install these for Python 3, run:
|
||||
|
||||
|
||||
```
|
||||
`pip3 install requests beautifulsoup4`
|
||||
```
|
||||
|
||||
### Extracting the HTML
|
||||
|
||||
For this example, I'll choose to scrape the [Technology][2] section of this website. If you go to that page, you'll see a list of articles with title, excerpt, and publishing date. Our goal is to create a list of articles with that information.
|
||||
|
||||
The full URL for the Technology page is:
|
||||
|
||||
|
||||
```
|
||||
`https://notes.ayushsharma.in/technology`
|
||||
```
|
||||
|
||||
We can get the HTML content from this page using `requests`:
|
||||
|
||||
|
||||
```
|
||||
#!/usr/bin/python3
|
||||
import requests
|
||||
|
||||
url = '<https://notes.ayushsharma.in/technology>'
|
||||
|
||||
data = requests.get(url)
|
||||
|
||||
print(data.text)
|
||||
```
|
||||
|
||||
The variable `data` will contain the HTML source code of the page.
|
||||
|
||||
### Extracting content from the HTML
|
||||
|
||||
To extract our data from the HTML received in `data`, we'll need to identify which tags have what we need.
|
||||
|
||||
If you skim through the HTML, you’ll find this section near the top:
|
||||
|
||||
|
||||
```
|
||||
<[div][3] class="col">
|
||||
<[a][4] href="/2021/08/using-variables-in-jekyll-to-define-custom-content" class="post-card">
|
||||
<[div][3] class="card">
|
||||
<[div][3] class="card-body">
|
||||
<[h5][5] class="card-title">Using variables in Jekyll to define custom content</[h5][5]>
|
||||
<[small][6] class="card-text text-muted">I recently discovered that Jekyll's config.yml can be used to define custom
|
||||
variables for reusing content. I feel like I've been living under a rock all this time. But to err over and
|
||||
over again is human.</[small][6]>
|
||||
</[div][3]>
|
||||
<[div][3] class="card-footer text-end">
|
||||
<[small][6] class="text-muted">Aug 2021</[small][6]>
|
||||
</[div][3]>
|
||||
</[div][3]>
|
||||
</[a][4]>
|
||||
</[div][3]>
|
||||
```
|
||||
|
||||
This is the section that repeats throughout the page for every article. We can see that `.card-title` has the article title, `.card-text` has the excerpt, and `.card-footer > small` has the publishing date.
|
||||
|
||||
Let's extract these using Beautiful Soup.
|
||||
|
||||
|
||||
```
|
||||
#!/usr/bin/python3
|
||||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
from pprint import pprint
|
||||
|
||||
url = '<https://notes.ayushsharma.in/technology>'
|
||||
data = requests.get(url)
|
||||
|
||||
my_data = []
|
||||
|
||||
html = BeautifulSoup(data.text, 'html.parser')
|
||||
articles = html.select('a.post-card')
|
||||
|
||||
for article in articles:
|
||||
|
||||
title = article.select('.card-title')[0].get_text()
|
||||
excerpt = article.select('.card-text')[0].get_text()
|
||||
pub_date = article.select('.card-footer small')[0].get_text()
|
||||
|
||||
my_data.append({"title": title, "excerpt": excerpt, "pub_date": pub_date})
|
||||
|
||||
pprint(my_data)
|
||||
```
|
||||
|
||||
The above code extracts the articles and puts them in the `my_data` variable. I'm using `pprint` to pretty-print the output, but you can skip it in your code. Save the code above in a file called `fetch.py`, and then run it using:
|
||||
|
||||
|
||||
```
|
||||
`python3 fetch.py`
|
||||
```
|
||||
|
||||
If everything went fine, you should see this:
|
||||
|
||||
|
||||
```
|
||||
[{'excerpt': "I recently discovered that Jekyll's config.yml can be used to"
|
||||
"define custom variables for reusing content. I feel like I've"
|
||||
'been living under a rock all this time. But to err over and over'
|
||||
'again is human.',
|
||||
'pub_date': 'Aug 2021',
|
||||
'title': 'Using variables in Jekyll to define custom content'},
|
||||
{'excerpt': "In this article, I'll highlight some ideas for Jekyll"
|
||||
'collections, blog category pages, responsive web-design, and'
|
||||
'netlify.toml to make static website maintenance a breeze.',
|
||||
'pub_date': 'Jul 2021',
|
||||
'title': 'The evolution of ayushsharma.in: Jekyll, Bootstrap, Netlify,'
|
||||
'static websites, and responsive design.'},
|
||||
{'excerpt': "These are the top 5 lessons I've learned after 5 years of"
|
||||
'Terraform-ing.',
|
||||
'pub_date': 'Jul 2021',
|
||||
'title': '5 key best practices for sane and usable Terraform setups'},
|
||||
|
||||
... (truncated)
|
||||
```
|
||||
|
||||
And that's all it takes! In 22 lines of code, we've built a web scraper in Python. You can find the [source code in my example repo][7].
|
||||
|
||||
### Conclusion
|
||||
|
||||
With the website content in a Python list, we can now do cool stuff with it. We could return it as JSON for another application or convert it to HTML with custom styling. Feel free to copy-paste the above code and experiment with your favorite website.
|
||||
|
||||
Have fun, and keep coding.
|
||||
|
||||
* * *
|
||||
|
||||
_This article was originally published on the [author's personal blog][8] and has been adapted with permission._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/9/web-scraping-python-beautiful-soup
|
||||
|
||||
作者:[Ayush Sharma][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/ayushsharma
|
||||
[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://notes.ayushsharma.in/technology
|
||||
[3]: http://december.com/html/4/element/div.html
|
||||
[4]: http://december.com/html/4/element/a.html
|
||||
[5]: http://december.com/html/4/element/h5.html
|
||||
[6]: http://december.com/html/4/element/small.html
|
||||
[7]: https://gitlab.com/ayush-sharma/example-assets/-/blob/fd7d2dfbfa3ca34103402993b35a61cbe943bcf3/programming/beautiful-soup/fetch.py
|
||||
[8]: https://notes.ayushsharma.in/2021/08/a-guide-to-web-scraping-in-python-using-beautifulsoup
|
@ -0,0 +1,378 @@
|
||||
[#]: subject: "Build a data sharding service with DistSQL"
|
||||
[#]: via: "https://opensource.com/article/21/9/distsql"
|
||||
[#]: author: "Meng Haoran https://opensource.com/users/haoran-meng"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Build a data sharding service with DistSQL
|
||||
======
|
||||
Database sharding demonstrates the additional functionality of DistSQL.
|
||||
![Person standing in front of a giant computer screen with numbers, data][1]
|
||||
|
||||
If you're reading this, then you're probably familiar with the data query and programming language, SQL (Structured Query Language). It's also used as the standard language for management systems for accessing data, querying, updating, and managing relational database systems. Like standard SQL, DistSQL, or Distributed SQL, it is a built-in SQL language unique to ShardingSphere that provides incremental functional capabilities beyond standard SQL. Leveraging ShardingSphere's powerful SQL parsing engine, DistSQL provides a syntax structure and syntax validation system like that of standard SQL, making DistSQL more flexible while maintaining regularity. ShardingSphere's Database Plus concept aims at creating an open source distributed database system that is both functional and relevant to the actual database business. DistSQL is built on top of the traditional database to provide SQL capabilities that are both standards-compliant and feature ShardingSphere's functionality to enhance conventional database management.
|
||||
|
||||
### Original design intention of DistSQL
|
||||
|
||||
Over its years of rapid development, ShardingSphere has become unique in the database middleware space as the kernel has gradually stabilized, and the core functionality has continuously been honed. As an open source leader in Asia, ShardingSphere keeps pursuing its exploration of a distributed database ecosystem. Redefining the boundary between middleware and database to allow developers to leverage Apache ShardingSphere as if they were using a database natively is DistSQL's design goal. It is also an integral part of ShardingSphere's ability to transform from a developer-oriented framework and middleware to an operations-oriented infrastructure product.
|
||||
|
||||
### DistSQL syntax system
|
||||
|
||||
DistSQL has been designed from the outset to be standards-oriented, considering the habits of both database developers and operators. The syntax of DistSQL is based on the standard SQL language, maintaining readability and ease of use while retaining the maximum amount of ShardingSphere's own features and providing the highest possible number of customization options for users to cope with different business scenarios.
|
||||
|
||||
Developers familiar with SQL and ShardingSphere can get started quickly.
|
||||
|
||||
Standard SQL provides different types of syntaxes such as DQL, DDL, DML, DCL, etc., to define various functional SQL statements. DistSQL defines a syntax system of its own, as well.
|
||||
|
||||
In ShardingSphere, the DistSQL syntax is currently divided into three main types: RDL, RQL, and RAL.
|
||||
|
||||
* RDL (Resource & Rule Definition Language) - Resource rule definition language for creating, modifying, and deleting resources and rules.
|
||||
* RQL (Resource & Rule Query Language) - Resource rule query language for querying and presenting resources and rules.
|
||||
* RAL (Resource & Rule Administrate Language) - Resource rule administration language for incremental functional operations such as hint, transaction type switching, and query of a sharding execution plan.
|
||||
|
||||
|
||||
|
||||
DistSQL's syntax builds a bridge for ShardingSphere to move towards a distributed database. It is still being improved as more ideas are implemented, so DistSQL will become increasingly powerful. Developers who are interested are welcome to join ShardingSphere and contribute ideas and code to DistSQL.
|
||||
|
||||
For more detailed syntax rules, please refer to the official [documentation][2].
|
||||
|
||||
For the project's community, please refer to the official [Slack channel][3].
|
||||
|
||||
### DistSQL in practice
|
||||
|
||||
Having understood the design concept and syntax system of DistSQL, let's demonstrate how to build a data sharding service based on ShardingSphere.
|
||||
|
||||
#### Environment preparation
|
||||
|
||||
* Start MySQL services
|
||||
* Create a MySQL database for sharding
|
||||
* Start the Zookeeper service
|
||||
* Turn on the distributed governance configuration and start [ShardingSphere-Proxy][4]
|
||||
|
||||
|
||||
|
||||
#### Practical demonstration
|
||||
|
||||
1\. Connect to the launched ShardingSphere-Proxy using the MySQL command line.
|
||||
|
||||
2\. Create and query the distributed database `sharding_db`:
|
||||
|
||||
|
||||
```
|
||||
mysql> CREATE DATABASE sharding_db;
|
||||
Query OK, 0 ROWS affected (0.04 sec)
|
||||
|
||||
mysql> SHOW DATABASES;
|
||||
+-------------+
|
||||
| SCHEMA_NAME |
|
||||
+-------------+
|
||||
| sharding_db |
|
||||
+-------------+
|
||||
1 ROW IN SET (0.04 sec)
|
||||
```
|
||||
|
||||
3\. Use the newly created database:
|
||||
|
||||
|
||||
```
|
||||
mysql> USE sharding_db;
|
||||
No connection. Trying TO reconnect...
|
||||
Connection id: 2
|
||||
CURRENT DATABASE: *** NONE ***
|
||||
|
||||
DATABASE changed
|
||||
```
|
||||
|
||||
4\. Execute RDL to configure two data source resources, `ds_1` and `ds_2`, for sharding:
|
||||
|
||||
|
||||
```
|
||||
mysql> ADD RESOURCE ds_1 (
|
||||
-> HOST=127.0.0.1,
|
||||
-> PORT=3306,
|
||||
-> DB=ds_1,
|
||||
-> USER=root,
|
||||
-> PASSWORD=root123456
|
||||
-> );
|
||||
Query OK, 0 ROWS affected (0.53 sec)
|
||||
|
||||
mysql>
|
||||
mysql> ADD RESOURCE ds_2 (
|
||||
-> HOST=127.0.0.1,
|
||||
-> PORT=3306,
|
||||
-> DB=ds_2,
|
||||
-> USER=root,
|
||||
-> PASSWORD=root123456
|
||||
-> );
|
||||
Query OK, 0 ROWS affected (0.02 sec)
|
||||
```
|
||||
|
||||
5\. Execute RQL to query the newly added data source resources:
|
||||
|
||||
|
||||
```
|
||||
mysql> SHOW RESOURCES FROM sharding_db;
|
||||
+------+-------+-----------+------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| name | TYPE | host | port | db | attribute |
|
||||
+------+-------+-----------+------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| ds_1 | MySQL | 127.0.0.1 | 3306 | ds_1 | {"maxLifetimeMilliseconds":1800000,"readOnly":FALSE,"minPoolSize":1,"idleTimeoutMilliseconds":60000,"maxPoolSize":50,"connectionTimeoutMilliseconds":30000} |
|
||||
| ds_2 | MySQL | 127.0.0.1 | 3306 | ds_2 | {"maxLifetimeMilliseconds":1800000,"readOnly":FALSE,"minPoolSize":1,"idleTimeoutMilliseconds":60000,"maxPoolSize":50,"connectionTimeoutMilliseconds":30000} |
|
||||
+------+-------+-----------+------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
2 ROWS IN SET (0.13 sec)
|
||||
```
|
||||
|
||||
6\. Execute RDL to create a sharding rule for the `t_order` table:
|
||||
|
||||
|
||||
```
|
||||
mysql> CREATE SHARDING TABLE RULE t_order(
|
||||
-> RESOURCES(ds_1,ds_2),
|
||||
-> SHARDING_COLUMN=order_id,
|
||||
-> TYPE(NAME=hash_mod,PROPERTIES("sharding-count"=4)),
|
||||
-> GENERATED_KEY(COLUMN=order_id,TYPE(NAME=snowflake,PROPERTIES("worker-id"=123)))
|
||||
-> );
|
||||
Query OK, 0 ROWS affected (0.06 sec)
|
||||
```
|
||||
|
||||
7\. Execute RQL to query the sharding rules:
|
||||
|
||||
|
||||
```
|
||||
mysql> SHOW SHARDING TABLE RULES FROM sharding_db;
|
||||
+---------+-----------------+-------------------+----------------------+------------------------+-------------------------------+--------------------------------+-------------------+---------------------+----------------------------+-----------------------------+-------------------+------------------+-------------------+
|
||||
| TABLE | actualDataNodes | actualDataSources | databaseStrategyType | databaseShardingColumn | databaseShardingAlgorithmType | databaseShardingAlgorithmProps | tableStrategyType | tableShardingColumn | tableShardingAlgorithmType | tableShardingAlgorithmProps | keyGenerateColumn | keyGeneratorType | keyGeneratorProps |
|
||||
+---------+-----------------+-------------------+----------------------+------------------------+-------------------------------+--------------------------------+-------------------+---------------------+----------------------------+-----------------------------+-------------------+------------------+-------------------+
|
||||
| t_order | | ds_1,ds_2 | | | | | hash_mod | order_id | hash_mod | sharding-COUNT=4 | order_id | snowflake | worker-id=123 |
|
||||
+---------+-----------------+-------------------+----------------------+------------------------+-------------------------------+--------------------------------+-------------------+---------------------+----------------------------+-----------------------------+-------------------+------------------+-------------------+
|
||||
1 ROW IN SET (0.01 sec)
|
||||
```
|
||||
|
||||
In addition to querying all sharding rules under the current database, RQL can also query individual tables for sharding rules with the following statement:
|
||||
|
||||
`SHOW SHARDING TABLE RULE t_order FROM sharding_db`
|
||||
|
||||
Creating and querying the `t_order` sharding table:
|
||||
|
||||
|
||||
```
|
||||
mysql> CREATE TABLE `t_order`(
|
||||
-> `order_id` INT NOT NULL,
|
||||
-> `user_id` INT NOT NULL,
|
||||
-> `status` VARCHAR(45) DEFAULT NULL,
|
||||
-> PRIMARY KEY (`order_id`)
|
||||
-> )ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
Query OK, 0 ROWS affected (0.28 sec)
|
||||
|
||||
mysql> SHOW TABLES;
|
||||
+-----------------------+
|
||||
| Tables_in_sharding_db |
|
||||
+-----------------------+
|
||||
| t_order |
|
||||
+-----------------------+
|
||||
1 ROW IN SET (0.01 sec)
|
||||
```
|
||||
|
||||
After successfully creating the sharding table `t_order` on the ShardingSphere-Proxy side, ShardingSphere automatically creates the sharding table based on the sharding rules of the `t_order` table by connecting to the underlying databases `ds_1` and `ds_2` via the client-side.
|
||||
|
||||
|
||||
```
|
||||
mysql> USE ds_1;
|
||||
DATABASE changed
|
||||
mysql> SHOW TABLES;
|
||||
+----------------+
|
||||
| Tables_in_ds_1 |
|
||||
+----------------+
|
||||
| t_order_0 |
|
||||
| t_order_2 |
|
||||
+----------------+
|
||||
2 ROWS IN SET (0.01 sec)
|
||||
|
||||
[/code] [code]
|
||||
|
||||
mysql> USE ds_2;
|
||||
DATABASE changed
|
||||
mysql> SHOW TABLES;
|
||||
+----------------+
|
||||
| Tables_in_ds_2 |
|
||||
+----------------+
|
||||
| t_order_1 |
|
||||
| t_order_3 |
|
||||
+----------------+
|
||||
2 ROWS IN SET (0.00 sec)
|
||||
```
|
||||
|
||||
Once the sharding table is created, continue to execute the SQL statement on the ShardingSphere-Proxy side to insert the data:
|
||||
|
||||
|
||||
```
|
||||
mysql> INSERT INTO t_order VALUES(1, 1, 'ok');
|
||||
Query OK, 1 ROW affected (0.06 sec)
|
||||
|
||||
mysql> INSERT INTO t_order VALUES(2, 2, 'disabled');
|
||||
Query OK, 1 ROW affected (0.00 sec)
|
||||
|
||||
mysql> INSERT INTO t_order VALUES(3, 3, 'locked');
|
||||
Query OK, 1 ROW affected (0.01 sec)
|
||||
|
||||
mysql> SELECT * FROM t_order;
|
||||
+----------+---------+----------+
|
||||
| order_id | user_id | STATUS |
|
||||
+----------+---------+----------+
|
||||
| 1 | 1 | ok |
|
||||
| 2 | 2 | disabled |
|
||||
| 3 | 3 | locked |
|
||||
+----------+---------+----------+
|
||||
3 ROWS IN SET (0.06 sec)
|
||||
```
|
||||
|
||||
Query the execution plan via RAL:
|
||||
|
||||
|
||||
```
|
||||
mysql> preview SELECT * FROM t_order;
|
||||
+-----------------+------------------------------------------------+
|
||||
| datasource_name | SQL |
|
||||
+-----------------+------------------------------------------------+
|
||||
| ds_1 | SELECT * FROM t_order_0 ORDER BY order_id ASC |
|
||||
| ds_1 | SELECT * FROM t_order_2 ORDER BY order_id ASC |
|
||||
| ds_2 | SELECT * FROM t_order_1 ORDER BY order_id ASC |
|
||||
| ds_2 | SELECT * FROM t_order_3 ORDER BY order_id ASC |
|
||||
+-----------------+------------------------------------------------+
|
||||
4 ROWS IN SET (0.02 sec)
|
||||
```
|
||||
|
||||
This completes the ShardingSphere data sharding service using DistSQL. Compared to the previous version of the ShardingSphere proxy, which was profile-driven, DistSQL is more developer-friendly and flexible in managing resources and rules. Moreover, the SQL-driven approach enables seamless interfacing between DistSQL and standard SQL.
|
||||
|
||||
|
||||
```
|
||||
schemaName: sharding_db
|
||||
dataSources:
|
||||
ds_0:
|
||||
url: jdbc:mysql://127.0.0.1:3306/ds_1?serverTimezone=UTC&useSSL=false
|
||||
username: root
|
||||
password: root123456
|
||||
connectionTimeoutMilliseconds: 30000
|
||||
idleTimeoutMilliseconds: 60000
|
||||
maxLifetimeMilliseconds: 1800000
|
||||
maxPoolSize: 50
|
||||
minPoolSize: 1
|
||||
ds_1:
|
||||
url: jdbc:mysql://127.0.0.1:3306/ds_2?serverTimezone=UTC&useSSL=false
|
||||
username: root
|
||||
password: root123456
|
||||
connectionTimeoutMilliseconds: 30000
|
||||
idleTimeoutMilliseconds: 60000
|
||||
maxLifetimeMilliseconds: 1800000
|
||||
maxPoolSize: 50
|
||||
minPoolSize: 1
|
||||
rules:
|
||||
\- !SHARDING
|
||||
tables:
|
||||
t_order:
|
||||
actualDataNodes: ds_${0..1}.t_order_${0..1}
|
||||
tableStrategy:
|
||||
standard:
|
||||
shardingColumn: order_id
|
||||
shardingAlgorithmName: t_order_inline
|
||||
keyGenerateStrategy:
|
||||
column: order_id
|
||||
keyGeneratorName: snowflake
|
||||
t_order_item:
|
||||
actualDataNodes: ds_${0..1}.t_order_item_${0..1}
|
||||
tableStrategy:
|
||||
standard:
|
||||
shardingColumn: order_id
|
||||
shardingAlgorithmName: t_order_item_inline
|
||||
keyGenerateStrategy:
|
||||
column: order_item_id
|
||||
keyGeneratorName: snowflake
|
||||
bindingTables:
|
||||
- t_order,t_order_item
|
||||
defaultDatabaseStrategy:
|
||||
standard:
|
||||
shardingColumn: user_id
|
||||
shardingAlgorithmName: database_inline
|
||||
defaultTableStrategy:
|
||||
none:
|
||||
|
||||
shardingAlgorithms:
|
||||
database_inline:
|
||||
type: INLINE
|
||||
props:
|
||||
algorithm-expression: ds_${user_id % 2}
|
||||
t_order_inline:
|
||||
type: INLINE
|
||||
props:
|
||||
algorithm-expression: t_order_${order_id % 2}
|
||||
t_order_item_inline:
|
||||
type: INLINE
|
||||
props:
|
||||
algorithm-expression: t_order_item_${order_id % 2}
|
||||
keyGenerators:
|
||||
snowflake:
|
||||
type: SNOWFLAKE
|
||||
props:
|
||||
worker-id: 123
|
||||
|
||||
[/code] [code]
|
||||
|
||||
1\. CREATE a distributed DATABASE
|
||||
CREATE DATABASE sharding_db;
|
||||
|
||||
2\. ADD DATA resources
|
||||
ADD RESOURCE ds_1 (
|
||||
HOST=127.0.0.1,
|
||||
PORT=3306,
|
||||
DB=ds_1,
|
||||
USER=root,
|
||||
PASSWORD=root123456
|
||||
);
|
||||
ADD RESOURCE ds_2 (
|
||||
HOST=127.0.0.1,
|
||||
PORT=3306,
|
||||
DB=ds_2,
|
||||
USER=root,
|
||||
PASSWORD=root123456
|
||||
);
|
||||
|
||||
3\. CREATE sharding rules
|
||||
CREATE SHARDING TABLE RULE t_order(
|
||||
RESOURCES(ds_1,ds_2),
|
||||
SHARDING_COLUMN=order_id,
|
||||
TYPE(NAME=hash_mod,PROPERTIES("sharding-count"=4)),
|
||||
GENERATED_KEY(COLUMN=order_id,TYPE(NAME=snowflake,PROPERTIES("worker-id"=123)))
|
||||
);
|
||||
```
|
||||
|
||||
In the above example, only a small part of the DistSQL syntax is demonstrated. In addition to creating and querying resources and rules via `CREATE` and `SHOW` statements, DistSQL also provides additional operations such as `ALTRE DROP` and supports configuration control of data sharding's core functions, read and write separation, data encryption, and database discovery.
|
||||
|
||||
### Conclusion
|
||||
|
||||
As one of the new features released in Apache ShardingSphere's 5.0.0-beta, DistSQL will continue to build on this release to improve syntax and increasingly powerful functions. DistSQL has opened up endless possibilities for ShardingSphere to explore the distributed database space. In the future, DistSQL will be used as a link to connect more functions and provide one-click operations.
|
||||
|
||||
For example, it'll allow the analysis of the overall database status with one click, connect with elastic migration, provide one-click data expansion and shrinkage, and connect with control to realize one-click master-slave switch and change database status. Open source and JavaScript enthusiasts are warmly welcomed to join the Slack community or check the project's GitHub page to learn more about ShardingSphere's latest developments.
|
||||
|
||||
* * *
|
||||
|
||||
_This article is adapted from the author's [original publication][5]._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/9/distsql
|
||||
|
||||
作者:[Meng Haoran][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/haoran-meng
|
||||
[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://shardingsphere.apache.org/document/current/en/features/dist-sql/syntax/
|
||||
[3]: https://join.slack.com/t/apacheshardingsphere/shared_invite/zt-sbdde7ie-SjDqo9~I4rYcR18bq0SYTg
|
||||
[4]: https://shardingsphere.apache.org/document/current/cn/quick-start/shardingsphere-proxy-quick-start/
|
||||
[5]: https://shardingsphere.apache.org/blog/en/material/jul_26_an_introduction_to_distsql/
|
@ -0,0 +1,114 @@
|
||||
[#]: subject: "How to check for update info and changelogs with rpm-ostree db"
|
||||
[#]: via: "https://fedoramagazine.org/how-to-check-for-update-info-and-changelogs-with-rpm-ostree-db/"
|
||||
[#]: author: "Mateus Rodrigues Costa https://fedoramagazine.org/author/mateusrodcosta/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How to check for update info and changelogs with rpm-ostree db
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
Photo by [Dan-Cristian Pădureț][2] on [Unsplash][3]
|
||||
|
||||
This article will teach you how to check for updates, check the changed packages, and read the changelogs with _rpm-ostree db_ and its subcommands.
|
||||
|
||||
The commands will be demoed on a Fedora Silverblue installation and should work on any OS that uses _rpm-ostree_.
|
||||
|
||||
### Introduction
|
||||
|
||||
Let’s say you are interested in immutable systems. Using a base system that is read-only while you build your use cases on top of containers technology sounds very attractive and it persuades you to select a distro that uses _rpm-ostree_.
|
||||
|
||||
You now find yourself on [Fedora Silverblue][4] (or another similar distro) and you want to check for updates. But you hit a problem. While you can find the updated packages on Fedora Silverblue with GNOME Software, you can’t actually read their changelogs. You also can’t [use _dnf updateinfo_ to read them on the command line][5], since there’s no DNF on the host system.
|
||||
|
||||
So, what should you do? Well, _rpm-ostree_ has subcommands that can help in this situation.
|
||||
|
||||
### Checking for updates
|
||||
|
||||
The first step is to check for updates. Simply run _rpm-ostree upgrade –check_:
|
||||
|
||||
```
|
||||
$ rpm-ostree upgrade --check
|
||||
...
|
||||
AvailableUpdate:
|
||||
Version: 34.20210905.0 (2021-09-05T20:59:47Z)
|
||||
Commit: d8bab818f5abcfb58d2c038614965bf26426d55667e52018fcd295b9bfbc88b4
|
||||
GPGSignature: Valid signature by 8C5BA6990BDB26E19F2A1A801161AE6945719A39
|
||||
SecAdvisories: 1 moderate
|
||||
Diff: 4 upgraded
|
||||
```
|
||||
|
||||
Notice that while it doesn’t tell the updated packages in the output, it does show the Commit for the update as _d8bab818f5abcfb58d2c038614965bf26426d55667e52018fcd295b9bfbc88b4_. This will be useful later.
|
||||
|
||||
Next thing you need to do is find the Commit for the current deployment you are running. Run _rpm-ostree status_ to get the BaseCommit of the current deployment:
|
||||
|
||||
```
|
||||
$ rpm-ostree status
|
||||
State: idle
|
||||
Deployments:
|
||||
● fedora:fedora/34/x86_64/silverblue
|
||||
Version: 34.20210904.0 (2021-09-04T19:16:37Z)
|
||||
BaseCommit: e279286dcd8b5e231cff15c4130a4b1f5a03b6735327b213ee474332b311dd1e
|
||||
GPGSignature: Valid signature by 8C5BA6990BDB26E19F2A1A801161AE6945719A39
|
||||
RemovedBasePackages: ...
|
||||
LayeredPackages: ...
|
||||
...
|
||||
```
|
||||
|
||||
For this example BaseCommit is _e279286dcd8b5e231cff15c4130a4b1f5a03b6735327b213ee474332b311dd1e_.
|
||||
|
||||
Now you can find the diff of the two commits with _rpm-ostree db diff [commit1] [commit2]_. In this command _commit1_ will be the BaseCommit from the current deployment and _commit2_ will be the Commit from the upgrade checking command.
|
||||
|
||||
```
|
||||
$ rpm-ostree db diff e279286dcd8b5e231cff15c4130a4b1f5a03b6735327b213ee474332b311dd1e d8bab818f5abcfb58d2c038614965bf26426d55667e52018fcd295b9bfbc88b4
|
||||
ostree diff commit from: e279286dcd8b5e231cff15c4130a4b1f5a03b6735327b213ee474332b311dd1e
|
||||
ostree diff commit to: d8bab818f5abcfb58d2c038614965bf26426d55667e52018fcd295b9bfbc88b4
|
||||
Upgraded:
|
||||
soundtouch 2.1.1-6.fc34 -> 2.1.2-1.fc34
|
||||
```
|
||||
|
||||
The diff output shows that _soundtouch_ was updated and indicates the version numbers. View the changelogs by adding _–changelogs_ to the previous command:
|
||||
|
||||
```
|
||||
$ rpm-ostree db diff e279286dcd8b5e231cff15c4130a4b1f5a03b6735327b213ee474332b311dd1e d8bab818f5abcfb58d2c038614965bf26426d55667e52018fcd295b9bfbc88b4 --changelogs
|
||||
ostree diff commit from: e279286dcd8b5e231cff15c4130a4b1f5a03b6735327b213ee474332b311dd1e
|
||||
ostree diff commit to: d8bab818f5abcfb58d2c038614965bf26426d55667e52018fcd295b9bfbc88b4
|
||||
Upgraded:
|
||||
soundtouch 2.1.1-6.fc34.x86_64 -> 2.1.2-1.fc34.x86_64
|
||||
* dom ago 29 2021 Uwe Klotz <uwe.klotz@gmail.com> - 2.1.2-1
|
||||
- Update to new upstream version 2.1.2
|
||||
Bump version to 2.1.2 to correct incorrect version info in configure.ac
|
||||
|
||||
* sex jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.1-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||
```
|
||||
|
||||
This output shows the commit notes as well as the version numbers.
|
||||
|
||||
### Conclusion
|
||||
|
||||
Using _rpm-ostree db_ you are now able to have the functionality equivalent to _dnf check-update_ and _dnf updateinfo_.
|
||||
|
||||
This will come in handy if you want to inspect detailed info about the updates you install.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/how-to-check-for-update-info-and-changelogs-with-rpm-ostree-db/
|
||||
|
||||
作者:[Mateus Rodrigues Costa][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://fedoramagazine.org/author/mateusrodcosta/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2021/09/rpm-ostree-db_changelog-816x345.jpg
|
||||
[2]: https://unsplash.com/@dancristianp?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
|
||||
[3]: https://unsplash.com/s/photos/backdrop?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
|
||||
[4]: https://fedoramagazine.org/what-is-silverblue/
|
||||
[5]: https://fedoramagazine.org/use-dnf-updateinfo-to-read-update-changelogs/
|
@ -0,0 +1,110 @@
|
||||
[#]: subject: "Raspberry Pi Zero vs Zero W: What’s the Difference?"
|
||||
[#]: via: "https://itsfoss.com/raspberry-pi-zero-vs-zero-w/"
|
||||
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Raspberry Pi Zero vs Zero W: What’s the Difference?
|
||||
======
|
||||
|
||||
Raspberry Pi created a revolution when it launched the $25 mini computer ten years ago. Over the time, several variants of Raspberry Pi have been launched. Some upgrade a previous model and some are crafted for specific purposes.
|
||||
|
||||
Of all the Raspberry models, Pi Zero and Pi Zero W are the cheapest ones aimed for small scale and IoT projects. Both devices are almost similar to each other but with a subtle and important difference.
|
||||
|
||||
**So, what is the difference between Raspberry Pi Zero and Zero W? The W in Zero W stands for Wireless and it depicts its wireless capability over the Pi Zero model. That’s the single biggest difference between the two similar models.**
|
||||
|
||||
Let’s take a look at a bit more in detail.
|
||||
|
||||
### Key Difference Between Pi Zero and Pi Zero W
|
||||
|
||||
![][1]
|
||||
|
||||
While Raspberry Pi Zero was built with a goal that provides more utility with half of the size of the A+ board.
|
||||
|
||||
And, Raspberry Pi Zero W was introduced later to include wireless connectivity built-in without needing a separate accessory/module to enable Bluetooth and Wi-Fi.
|
||||
|
||||
This is the key difference between the two with the rest of the specifications remaining identical.
|
||||
|
||||
So, if you want the support for:
|
||||
|
||||
* 802.11 b/g/n wireless LAN
|
||||
* Bluetooth 4.1
|
||||
* Bluetooth Low Energy (BLE)
|
||||
|
||||
|
||||
|
||||
Raspberry Pi Zero W will be the definite choice to go with.
|
||||
|
||||
Also, Raspberry Pi Zero W offers a variant with header pins included which is “Raspberry Pi Zero WH”.
|
||||
|
||||
Preview | Product | Price |
|
||||
---|---|---|---
|
||||
[![CanaKit Raspberry Pi Zero W \(Wireless\) Complete Starter Kit - 16 GB Edition][2]][3] | [CanaKit Raspberry Pi Zero W (Wireless) Complete Starter Kit - 16 GB Edition][3] | $32.99[][4] | [Buy on Amazon][5]
|
||||
|
||||
### Raspberry Pi Zero and Raspberry Pi Zero W Specifications
|
||||
|
||||
![Raspberry Pi Zero W][6]
|
||||
|
||||
The [specifications for Raspberry Pi Zero W][7] and Zero are almost identical.
|
||||
|
||||
You get a 1 GHz single-core CPU coupled with 512 MB RAM. For connectivity, you get a mini HDMI port, micro USB OTG support, micro USB power, and a CSI Camera connector (to plug in a camera module).
|
||||
|
||||
These boards also feature a [HAT][8] (Hardware Attached on Top)-compatible 40 pin header, but generally, without the pins that let you easily plug the interfaces.
|
||||
|
||||
You can choose to explore the capabilities using [various Raspberry Pi OS][9] available. In either case, just stick to the Raspberry Pi OS.
|
||||
|
||||
### Raspberry Pi Zero series: Is it worth It?
|
||||
|
||||
![Raspberry Pi Zero][10]
|
||||
|
||||
Raspberry Pi Zero is a single-board computer that is popular for its form factor. Even though you have plenty of [Raspberry Pi zero alternatives][11], Raspberry Pi Zero is the recommended choice for all the good reasons.
|
||||
|
||||
Of course, unless you have specific requirements.
|
||||
|
||||
In addition to the size of the board, the pricing, power requirement, and processing power are some of the key highlights of this board under **$20**.
|
||||
|
||||
So, if you are looking for the essential features under a budget, the Raspberry Zero series should work for you.
|
||||
|
||||
**Recommended Read:**
|
||||
|
||||
![][12]
|
||||
|
||||
#### [27 Super Cool Raspberry Pi Zero W Projects for DIY Enthusiasts][13]
|
||||
|
||||
The small form factor of the Raspberry Pi Zero W enables a new range of projects. Here are some cool projects you can build with your tiny Raspberry Pi Zero W.
|
||||
|
||||
### Is Raspberry Pi Zero series affordable?
|
||||
|
||||
Raspberry Pi Zero costs **$5** and the Raspberry Pi Zero W would cost you around **$10**. ****Of course, depending on its availability and region, the cost will differ. If you want the Raspberry Pi Zero W with header pins, it should cost you around **$14**.
|
||||
|
||||
There are other devices that can be used as an [alternative to Raspberry Pi Zero][11] and they have similar price tag.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/raspberry-pi-zero-vs-zero-w/
|
||||
|
||||
作者:[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://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-zero-vs-zero-w.png?resize=800%2C450&ssl=1
|
||||
[2]: https://i1.wp.com/m.media-amazon.com/images/I/517BwcAPmTL._SL160_.jpg?ssl=1
|
||||
[3]: https://www.amazon.com/dp/B072N3X39J?tag=chmod7mediate-20&linkCode=osi&th=1&psc=1 (CanaKit Raspberry Pi Zero W (Wireless) Complete Starter Kit - 16 GB Edition)
|
||||
[4]: https://www.amazon.com/gp/prime/?tag=chmod7mediate-20 (Amazon Prime)
|
||||
[5]: https://www.amazon.com/dp/B072N3X39J?tag=chmod7mediate-20&linkCode=osi&th=1&psc=1 (Buy on Amazon)
|
||||
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-zero-w.png?resize=600%2C400&ssl=1
|
||||
[7]: https://itsfoss.com/raspberry-pi-zero-w/
|
||||
[8]: https://github.com/raspberrypi/hats
|
||||
[9]: https://itsfoss.com/raspberry-pi-os/
|
||||
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-zero-1.png?resize=600%2C400&ssl=1
|
||||
[11]: https://itsfoss.com/raspberry-pi-zero-alternatives/
|
||||
[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/10/raspberry-pi-zero-w-projects.png?fit=800%2C450&ssl=1
|
||||
[13]: https://itsfoss.com/raspberry-pi-zero-projects/
|
@ -0,0 +1,125 @@
|
||||
[#]: subject: "Screen Recording in Linux With OBS and Wayland"
|
||||
[#]: via: "https://itsfoss.com/screen-record-obs-wayland/"
|
||||
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Screen Recording in Linux With OBS and Wayland
|
||||
======
|
||||
|
||||
There are [tons of screen recorders available for Linux][1]. But when it comes to supporting [Wayland][2], almost all of them do not work.
|
||||
|
||||
This is problematic because many new distribution releases are switching to Wayland display manager by default once again. And if something as basic as a screen recorder does not work, it leaves a bad experience.
|
||||
|
||||
[GNOME’s built-in screen recorder][3] works but it is hidden, has no GUI and no way to configure and control the recordings. There is another tool called [Kooha][4] but it keeps on displaying a timer on the screen.
|
||||
|
||||
[Switching between Xorg and Wayland][5] just for screen recording is not very convenient.
|
||||
|
||||
Amidst all this, I was happy to learn that Wayland support landed in OBS Studio with version 27 release thanks to Pipewire. But even there, it’s not straightforward and hence I am going to show you the steps for screen recording on Wayland using [OBS Studio][6].
|
||||
|
||||
### Using OBS to screen record on Wayland
|
||||
|
||||
![][7]
|
||||
|
||||
Let’s see how it is done.
|
||||
|
||||
#### Step 1: Install OBS Studio
|
||||
|
||||
You should install OBS Studio version 27 first. It is already included in Ubuntu 21.10 which I am suing in this tutorial.
|
||||
|
||||
To install OBS Studio 27 on Ubuntu 18.04, 20.04, Linux Mint 20 etc, use the [official OBS Studio][8] [][8][PPA][8].
|
||||
|
||||
Open a terminal and use the following commands one by one:
|
||||
|
||||
```
|
||||
sudo add-apt-repository ppa:obsproject/obs-studio
|
||||
sudo apt update
|
||||
sudo apt install obs-studio
|
||||
```
|
||||
|
||||
If there is an older version of OBS Studio installed already, it will be upgraded to the newer version.
|
||||
|
||||
For Fedora, Arch and other distributions, please check your package manager or unofficial repositories for installing the latest version of OBS Studio.
|
||||
|
||||
#### Step 2: Check if Wayland capture is working
|
||||
|
||||
Please make sure that you are using Wayland. Now start OBS Studio and go through all the stuff it shows on the first run. I am not going to show that.
|
||||
|
||||
The main step is to add Pipewire as a screen capture source. Click on the + symbol under the Sources list.
|
||||
|
||||
![Add screen capture source in OBS Studio][9]
|
||||
|
||||
Do you see anything that reads Screen Capture (PipeWire)?
|
||||
|
||||
![Do you see PipeWire option in the screen sources?][10]
|
||||
|
||||
**If the answer is no, quit OBS Studio**. This is normal. OBS Studio does not switch to use Wayland automatically in Ubuntu at least. There is a fix for that.
|
||||
|
||||
Open a terminal and use the following command:
|
||||
|
||||
```
|
||||
export QT_QPA_PLATFORM=wayland
|
||||
```
|
||||
|
||||
In the same terminal, run the following command to start OBS Studio:
|
||||
|
||||
```
|
||||
obs
|
||||
```
|
||||
|
||||
It will show some message on the terminal. Ignore them. Your focus should be on the OBS Studio GUI. Try to add screen capture once again. You should see the PipeWire option now.
|
||||
|
||||
![][10]
|
||||
|
||||
You explicitly asked OBS Studio to use Wayland this time with the QT_QPA_PLATFORM variable.
|
||||
|
||||
Select PipeWire as the source and then it asks you to choose a display screen. Select it and click on the Share button.
|
||||
|
||||
![][11]
|
||||
|
||||
Now it should show your screen recursively infinite number of times. If you see that, you could start recording the screen in Wayland now.
|
||||
|
||||
![][12]
|
||||
|
||||
#### Step 3: Make changes permanent
|
||||
|
||||
That was good. You just verified that you can record your screen on Wayland. But setting the environment variable and starting OBS from the terminal each time is not convenient.
|
||||
|
||||
What you can do is to **export the variable to your ~/.bash_profile (for you) or /etc/profile (for all users on the system).**
|
||||
|
||||
```
|
||||
export QT_QPA_PLATFORM=wayland
|
||||
```
|
||||
|
||||
Log out and log back in. Now OBS will automatically start using this parameter and you can use it to record your screen in Wayland.
|
||||
|
||||
I hope you find this quick tip helpful. If you still have questions or suggestions, please let me know in the comment section.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/screen-record-obs-wayland/
|
||||
|
||||
作者:[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/best-linux-screen-recorders/
|
||||
[2]: https://wayland.freedesktop.org/
|
||||
[3]: https://itsfoss.com/gnome-screen-recorder/
|
||||
[4]: https://itsfoss.com/kooha-screen-recorder/
|
||||
[5]: https://itsfoss.com/switch-xorg-wayland/
|
||||
[6]: https://obsproject.com/
|
||||
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/obs-screen-record-wayland.webp?resize=800%2C450&ssl=1
|
||||
[8]: https://launchpad.net/~obsproject/+archive/ubuntu/obs-studio
|
||||
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/obs-studio-add-screen-capture-source.png?resize=800%2C537&ssl=1
|
||||
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/obs-studio-wayland-support.png?resize=800%2C538&ssl=1
|
||||
[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/obs-studio-screen.png?resize=800%2C578&ssl=1
|
||||
[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/start-screen-recording-obs-wayland.jpg?resize=800%2C537&ssl=1
|
@ -1,317 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (unigeorge)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Using external libraries in Java)
|
||||
[#]: via: (https://opensource.com/article/20/2/external-libraries-java)
|
||||
[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen)
|
||||
|
||||
在 Java 中使用外部库
|
||||
======
|
||||
外部库填补了 Java 核心库中的一些功能空白。
|
||||
![books in a library, stacks][1]
|
||||
|
||||
Java 自带有一组核心库,其中包含了定义常用数据类型和相关行为的库(例如 **String** 和 **Date**)、与主机操作系统交互的实用程序(例如 **System** 和 **File**),以及一些用来管理安全性、处理网络通信、创建或解析 XML的有用的子系统。鉴于核心库的丰富性,程序员通常很容易在其中找到有用的组件,以减少需要编写的代码量。
|
||||
|
||||
即便如此,核心库仍有一些功能上的不足,因此发现这些不足的程序员们还额外创建了很多有趣的 Java 库。例如,[Apache Commons][2] <q>是一个专注于可重用 Java 组件所有方面的 Apache 项目</q>,提供了大约 43 个开源库的集合(截至撰写本文时),涵盖了 Java 核心库之外的一系列功能 (例如 [geometry][3] 或 [statistics][4]),并增强或替换了 Java 核心库中的原有功能(例如 [math][5] 或 [numbers][6])。
|
||||
|
||||
另一种常见的 Java 库类型是系统组件的接口(例如数据库系统接口),本文会着眼于使用此类接口连接到 [PostgreSQL][7] 数据库,并得到一些有趣的信息。首先,我们来回顾一下库的重要部分。
|
||||
|
||||
### 什么是库?
|
||||
|
||||
库里自然包含的是一些有用的代码。但为了发挥用处,代码需要以特定方式进行组织,特定的方式使 Java 程序员可以访问其中组件来解决手头问题。
|
||||
|
||||
可以说,一个库最重要的部分是它的应用程序编程接口 (API) 文档。这种文档很多人都熟悉,通常是由 [Javadoc][8] 生成的。Javadoc 读取代码中的结构化注释并以 HTML 格式输出文档,通常 API 的 <ruby>包<rt><rp>(</rp>pacage<rp>)</rp></rt></ruby> 在页面左上角的面板中显示,<ruby>类<rt><rp>(</rp>class<rp>)</rp></rt></ruby> 在左下角显示,同时右侧会有库、包或类级别的详细文档(具体取决于在主面板中选择的内容)。例如,[Apache Commons Math 的顶级 API 文档][9] 如下所示:
|
||||
|
||||
![API documentation for Apache Commons Math][10]
|
||||
|
||||
单击主面板中的包会显示该包中定义的 Java 类和接口。例如,**[org.apache.commons.math4.analysis.solvers][11]** 显示了诸如 **BisectionSolver** 这样的类,该类用于使用二分算法查找单变量实函数的零点。单击 [BisectionSolver][12] 链接会列出 **BisectionSolver** 类的所有方法。
|
||||
|
||||
这类文档可用作参考文档,不适合作为学习如何使用库的教程。比如,如果你知道什么是单变量实函数并查看包 **org.apache.commons.math4.analysis.function**,就可以试着使用该包来组合函数定义,然后使用 **org.apache.commons.math4.analysis.solvers** 包来查找刚刚创建的函数的零点。但如果你不知道,就可能需要更多学习向的文档,也许甚至是一个实际例子,来读懂参考文档。
|
||||
|
||||
这种文档结构还有助于阐明 _package_(相关 Java 类和接口定义的集合)的含义,并显示特定库中捆绑了哪些包。
|
||||
|
||||
这种库的代码通常是在 [**.jar** 文件][13] 中,它基本上是由 Java 的 **jar** 命令创建的 .zip 文件,其中还包含一些其他有用的信息。**.jar** 文件通常被创建为构建过程的端点,该构建过程编译了所定义包中的所有 **.java** 文件。
|
||||
|
||||
要访问外部库提供的功能,有两个主要步骤:
|
||||
|
||||
1. 确保通过类路径(或者命令行中的 **-cp** 参数或者 **CLASSPATH** 环境变量),库可用于 Java 编译步骤([**javac**][14])和执行步骤(**java**)。
|
||||
2. 使用恰当的 **import** 语句访问程序源代码中的包和类。
|
||||
|
||||
其余的步骤就与使用 **String** 等 Java核心类相同,使用库提供的类和接口定义来编写代码。很简单对吧?不过也没那么简单。首先,你需要了解库组件的预期使用模式,然后才能编写代码。
|
||||
|
||||
### 示例:连接 PostgreSQL 数据库
|
||||
|
||||
在数据库系统中访问数据的典型使用步骤是:
|
||||
|
||||
1. 访问正在使用的特定数据库软件代码。
|
||||
2. 连接到数据库服务器。
|
||||
3. 构建查询字符串。
|
||||
4. 执行查询字符串。
|
||||
5. 针对返回的结果,做需要的处理。
|
||||
6. 断开与数据库服务器的连接。
|
||||
|
||||
所有这些面向程序员的部分由接口包 **[java.sql][15]** 提供,它独立于数据库,定义了核心客户端 Java 数据库连接 (JDBC) API。**java.sql** 包是 Java 核心库的一部分,因此无需提供 **.jar** 文件即可编译。但每个数据库提供者都会创建自己的 **java.sql** 接口实现(例如 **Connection** 接口),并且必须在运行步骤中提供这些实现。
|
||||
|
||||
接下来我们使用 PostgreSQL,看看这一过程是如何进行的。
|
||||
|
||||
#### 访问特定数据库的代码
|
||||
|
||||
以下代码使用 [Java 类加载器][16](**Class.forName()** 调用)将 PostgreSQL 驱动程序代码加载到正在执行的虚拟机中:
|
||||
|
||||
```
|
||||
import java.sql.*;
|
||||
|
||||
public class Test1 {
|
||||
|
||||
public static void main([String][17] args[]) {
|
||||
|
||||
// Load the driver (jar file must be on class path) [1]
|
||||
|
||||
try {
|
||||
Class.forName("org.postgresql.Driver");
|
||||
[System][18].out.println("driver loaded");
|
||||
} catch ([Exception][19] e1) {
|
||||
[System][18].err.println("couldn't find driver");
|
||||
[System][18].err.println(e1);
|
||||
[System][18].exit(1);
|
||||
}
|
||||
|
||||
// If we get here all is OK
|
||||
|
||||
[System][18].out.println("done.");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
因为类加载器可能失败,失败时会抛出异常,所以将对 **Class.forName()** 的调用放在 try-catch 代码块中。
|
||||
|
||||
如果你使用 **javac** 编译上面的代码,然后用 Java 运行,会报异常:
|
||||
|
||||
```
|
||||
me@mymachine:~/Test$ javac Test1.java
|
||||
me@mymachine:~/Test$ java Test1
|
||||
couldn't find driver
|
||||
java.lang.ClassNotFoundException: org.postgresql.Driver
|
||||
me@mymachine:~/Test$
|
||||
```
|
||||
|
||||
类加载器要求类路径中有包含 PostgreSQL JDBC 驱动程序实现的 **.jar** 文件:
|
||||
|
||||
```
|
||||
me@mymachine:~/Test$ java -cp ~/src/postgresql-42.2.5.jar:. Test1
|
||||
driver loaded
|
||||
done.
|
||||
me@mymachine:~/Test$
|
||||
```
|
||||
|
||||
#### 连接到数据库服务器
|
||||
|
||||
以下代码实现了加载 JDBC 驱动程序和创建到 PostgreSQL 数据库的连接:
|
||||
|
||||
```
|
||||
import java.sql.*;
|
||||
|
||||
public class Test2 {
|
||||
|
||||
public static void main([String][17] args[]) {
|
||||
|
||||
// Load the driver (jar file must be on class path) [1]
|
||||
|
||||
try {
|
||||
Class.forName("org.postgresql.Driver");
|
||||
[System][18].out.println("driver loaded");
|
||||
} catch ([Exception][19] e1) {
|
||||
[System][18].err.println("couldn't find driver");
|
||||
[System][18].err.println(e1);
|
||||
[System][18].exit(1);
|
||||
}
|
||||
|
||||
// Set up connection properties [2]
|
||||
|
||||
java.util.[Properties][20] props = new java.util.[Properties][20]();
|
||||
props.setProperty("user","me");
|
||||
props.setProperty("password","mypassword");
|
||||
[String][17] database = "jdbc:postgresql://myhost.org:5432/test";
|
||||
|
||||
// Open the connection to the database [3]
|
||||
|
||||
try ([Connection][21] conn = [DriverManager][22].getConnection(database, props)) {
|
||||
[System][18].out.println("connection created");
|
||||
} catch ([Exception][19] e2) {
|
||||
[System][18].err.println("sql operations failed");
|
||||
[System][18].err.println(e2);
|
||||
[System][18].exit(2);
|
||||
}
|
||||
[System][18].out.println("connection closed");
|
||||
|
||||
// If we get here all is OK
|
||||
|
||||
[System][18].out.println("done.");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
编译并运行上述代码:
|
||||
|
||||
```
|
||||
me@mymachine:~/Test$ javac Test2.java
|
||||
me@mymachine:~/Test$ java -cp ~/src/postgresql-42.2.5.jar:. Test2
|
||||
driver loaded
|
||||
connection created
|
||||
connection closed
|
||||
done.
|
||||
me@mymachine:~/Test$
|
||||
```
|
||||
|
||||
关于上述的一些注意事项:
|
||||
|
||||
* 注释 [2] 后面的代码使用系统属性来设置连接参数(在本例中参数为 PostgreSQL 用户名和密码)。代码也可以从 Java 命令行获取这些参数并将所有参数作为参数包传递,同时还有一些其他 **Driver.getConnection()** 选项可用于单独传递参数。
|
||||
* JDBC 需要一个用于定义数据库的 URL,它在上述代码中被声明为 **String database** 并与连接参数一起传递给 **Driver.getConnection()** 方法。
|
||||
* 代码使用 try-with-resources 语句,它会在 try-catch 块中的代码完成后自动关闭连接。[Stack Overflow][23] 上对这种方法进行了长期的讨论。
|
||||
* try-with-resources 语句提供对 **Connection** 实例的访问,并可以在其中执行 SQL 语句;所有错误都会被同一个 **catch** 语句捕获。
|
||||
|
||||
#### 用数据库的连接处理一些有趣的事情
|
||||
|
||||
In my day job, I often need to know what users have been defined for a given database server instance, and I use this [handy piece of SQL][24] for grabbing a list of all users:
|
||||
|
||||
日常工作中,我经常需要知道为给定的数据库服务器实例定义了哪些用户,这里我使用这个 [简便的 SQL][24] 来获取所有用户的列表:
|
||||
|
||||
```
|
||||
import java.sql.*;
|
||||
|
||||
public class Test3 {
|
||||
|
||||
public static void main([String][17] args[]) {
|
||||
|
||||
// Load the driver (jar file must be on class path) [1]
|
||||
|
||||
try {
|
||||
Class.forName("org.postgresql.Driver");
|
||||
[System][18].out.println("driver loaded");
|
||||
} catch ([Exception][19] e1) {
|
||||
[System][18].err.println("couldn't find driver");
|
||||
[System][18].err.println(e1);
|
||||
[System][18].exit(1);
|
||||
}
|
||||
|
||||
// Set up connection properties [2]
|
||||
|
||||
java.util.[Properties][20] props = new java.util.[Properties][20]();
|
||||
props.setProperty("user","me");
|
||||
props.setProperty("password","mypassword");
|
||||
[String][17] database = "jdbc:postgresql://myhost.org:5432/test";
|
||||
|
||||
// Open the connection to the database [3]
|
||||
|
||||
try ([Connection][21] conn = [DriverManager][22].getConnection(database, props)) {
|
||||
[System][18].out.println("connection created");
|
||||
|
||||
// Create the SQL command string [4]
|
||||
|
||||
[String][17] qs = "SELECT " +
|
||||
" u.usename AS \"User name\", " +
|
||||
" u.usesysid AS \"User ID\", " +
|
||||
" CASE " +
|
||||
" WHEN u.usesuper AND u.usecreatedb THEN " +
|
||||
" CAST('superuser, create database' AS pg_catalog.text) " +
|
||||
" WHEN u.usesuper THEN " +
|
||||
" CAST('superuser' AS pg_catalog.text) " +
|
||||
" WHEN u.usecreatedb THEN " +
|
||||
" CAST('create database' AS pg_catalog.text) " +
|
||||
" ELSE " +
|
||||
" CAST('' AS pg_catalog.text) " +
|
||||
" END AS \"Attributes\" " +
|
||||
"FROM pg_catalog.pg_user u " +
|
||||
"ORDER BY 1";
|
||||
|
||||
// Use the connection to create a statement, execute it,
|
||||
// analyze the results and close the result set [5]
|
||||
|
||||
[Statement][25] stat = conn.createStatement();
|
||||
[ResultSet][26] rs = stat.executeQuery(qs);
|
||||
[System][18].out.println("User name;User ID;Attributes");
|
||||
while (rs.next()) {
|
||||
[System][18].out.println(rs.getString("User name") + ";" +
|
||||
rs.getLong("User ID") + ";" +
|
||||
rs.getString("Attributes"));
|
||||
}
|
||||
rs.close();
|
||||
stat.close();
|
||||
|
||||
} catch ([Exception][19] e2) {
|
||||
[System][18].err.println("connecting failed");
|
||||
[System][18].err.println(e2);
|
||||
[System][18].exit(1);
|
||||
}
|
||||
[System][18].out.println("connection closed");
|
||||
|
||||
// If we get here all is OK
|
||||
|
||||
[System][18].out.println("done.");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
在上述代码中,一旦有了 **Connection** 实例,它就会定义一个查询字符串(上面的注释 [4]),创建一个 **Statement** 实例并用其来执行查询字符串,然后将其结果放入一个 **ResultSet** 实例。程序可以遍历该 **ResultSet** 实例来分析返回的结果,并以关闭 **ResultSet** 和 **Statement** 实例结束(上面的注释 [5])。
|
||||
|
||||
编译和执行程序会产生以下输出:
|
||||
|
||||
```
|
||||
me@mymachine:~/Test$ javac Test3.java
|
||||
me@mymachine:~/Test$ java -cp ~/src/postgresql-42.2.5.jar:. Test3
|
||||
driver loaded
|
||||
connection created
|
||||
User name;User ID;[Attributes][27]
|
||||
fwa;16395;superuser
|
||||
vax;197772;
|
||||
mbe;290995;
|
||||
aca;169248;
|
||||
connection closed
|
||||
done.
|
||||
me@mymachine:~/Test$
|
||||
```
|
||||
|
||||
这是在一个简单的 Java 应用程序中使用 PostgreSQL JDBC 库的(非常简单的)示例。要注意的是,由于 **java.sql** 库的设计方式,它不需要在代码中使用像 **import org.postgresql.jdbc.*;** 这样的 Java 导入语句,而是使用 Java 类加载器在运行时引入 PostgreSQL 代码的方式,也正因此无需在代码编译时指定类路径。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/2/external-libraries-java
|
||||
|
||||
作者:[Chris Hermansen][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/clhermansen
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/books_library_reading_list.jpg?itok=O3GvU1gH (books in a library, stacks)
|
||||
[2]: https://commons.apache.org/
|
||||
[3]: https://commons.apache.org/proper/commons-geometry/
|
||||
[4]: https://commons.apache.org/proper/commons-statistics/
|
||||
[5]: https://commons.apache.org/proper/commons-math/
|
||||
[6]: https://commons.apache.org/proper/commons-numbers/
|
||||
[7]: https://opensource.com/article/19/11/getting-started-postgresql
|
||||
[8]: https://en.wikipedia.org/wiki/Javadoc
|
||||
[9]: https://commons.apache.org/proper/commons-math/apidocs/index.html
|
||||
[10]: https://opensource.com/sites/default/files/uploads/api-documentation_apachecommonsmath.png (API documentation for Apache Commons Math)
|
||||
[11]: https://commons.apache.org/proper/commons-math/apidocs/org/apache/commons/math4/analysis/solvers/package-summary.html
|
||||
[12]: https://commons.apache.org/proper/commons-math/apidocs/org/apache/commons/math4/analysis/solvers/BisectionSolver.html
|
||||
[13]: https://en.wikipedia.org/wiki/JAR_(file_format)
|
||||
[14]: https://en.wikipedia.org/wiki/Javac
|
||||
[15]: https://docs.oracle.com/javase/8/docs/api/java/sql/package-summary.html
|
||||
[16]: https://en.wikipedia.org/wiki/Java_Classloader
|
||||
[17]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string
|
||||
[18]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system
|
||||
[19]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+exception
|
||||
[20]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+properties
|
||||
[21]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+connection
|
||||
[22]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+drivermanager
|
||||
[23]: https://stackoverflow.com/questions/8066501/how-should-i-use-try-with-resources-with-jdbc
|
||||
[24]: https://www.postgresql.org/message-id/1121195544.8208.242.camel@state.g2switchworks.com
|
||||
[25]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+statement
|
||||
[26]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+resultset
|
||||
[27]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+attributes
|
@ -1,118 +0,0 @@
|
||||
[#]: subject: "Check file status on Linux with the stat command"
|
||||
[#]: via: "https://opensource.com/article/21/8/linux-stat-file-status"
|
||||
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "New-World-2019"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
在 Linux 上使用 stat 命令查看文件状态
|
||||
======
|
||||
只需要一个 Linux 命令,你就可以获取到任何文件或文件系统的所有信息。
|
||||
![Hand putting a Linux file folder into a drawer][1]
|
||||
|
||||
命令 `stat` 被包含在 GNU `coreutils` 软件包里,它提供了关于文件和文件系统的各种元数据,包括文件大小、结点位置、访问权限和 SELinux 上下文以及创建和修改时间。通常情况下,你需要多个不同命令获取的信息,这一个命令就可以实现。
|
||||
|
||||
### 在 Linux 上安装 stat 命令
|
||||
|
||||
在 Linux 系统中,可能早已安装了 `state` 命令,因为它是核心功能软件包的一部分,默认情况下,通常包含在 Linux 发行版里。
|
||||
|
||||
如果系统中没有安装 `stat` 命令,你可以使用包管理器安装 `coreutils` 软件包。
|
||||
|
||||
另外,你可以 [ 使用源码编译 coreutils 包 ][2]。
|
||||
|
||||
### 获取文件状态
|
||||
|
||||
运行 `stat` 命令可以获取指定文件或目录易于理解的输出。
|
||||
|
||||
|
||||
```
|
||||
$ stat planets.xml
|
||||
File: planets.xml
|
||||
Size: 325 Blocks: 8 IO Block: 4096 regular file
|
||||
Device: fd03h/64771d Inode: 140217 Links: 1
|
||||
Access: (0664/-rw-rw-r--) Uid: (1000/tux) Gid: (100/users)
|
||||
Context: unconfined_u:object_r:user_home_t:s0
|
||||
Access: 2021-08-17 18:26:57.281330711 +1200
|
||||
Modify: 2021-08-17 18:26:58.738332799 +1200
|
||||
Change: 2021-08-17 18:26:58.738332799 +1200
|
||||
Birth: 2021-08-17 18:26:57.281330711 +1200
|
||||
```
|
||||
|
||||
输出的信息很容易理解,但是包含了很多的信息,这里是 `stat` 所包含的项:
|
||||
|
||||
* **File**: 文件名
|
||||
* **Size**: 文件大小,以字节表示
|
||||
* **Blocks**: 在硬盘驱动器上为文件保留的数据块的数量
|
||||
* **IO Block**: 文件系统块大小
|
||||
* **regular file**: 文件类型(普通文件,目录,文件系统)
|
||||
* **Device**: 文件所在的设备
|
||||
* **Inode**: 文件所在的 Inode 号
|
||||
* **Links**: 文件的链接数
|
||||
* **Access, UID, GID**: 文件权限,用户和组的所有者
|
||||
* **Context**: SELinux 上下文
|
||||
* **Access, Modify, Change, Birth**: 文件被访问、修改、更改状态以及创建时的时间戳
|
||||
|
||||
|
||||
|
||||
### 精简输出
|
||||
|
||||
对于非常了解输出或者想要使用其它工具(例如:[awk][3])解析输出的人,这里可以使用 `--terse`(短参数为 `-t`) 参数,实现没有标题或换行符的格式化输出。
|
||||
|
||||
|
||||
```
|
||||
$ stat --terse planets.xml
|
||||
planets.xml 325 8 81b4 100977 100 fd03 140217 1 0 0 1629181617 1629181618 1629181618 1629181617 4096 unconfined_u:object_r:user_home_t:s0
|
||||
```
|
||||
|
||||
### 选择自己的格式
|
||||
|
||||
你可以使用 `--printf` 参数以及与 [printf][4] 类似的语法定义自己的输出格式。`stat` 的每一个属性都有一个格式序列(`%C` 表示 SELinux 上下文,`%n` 表示文件名等等),所以,你可以选择你想要的输出格式。
|
||||
|
||||
|
||||
```
|
||||
$ stat --printf="%n\n%C\n" planets.xml
|
||||
planets.xml
|
||||
unconfined_u:object_r:user_home_t:s0
|
||||
$ $ stat --printf="Name: %n\nModified: %y\n" planets.xml
|
||||
Name: planets.xml
|
||||
Modified: 2021-08-17 18:26:58.738332799 +1200
|
||||
```
|
||||
|
||||
下面是一些常见的格式序列:
|
||||
|
||||
* **%a** 访问权限
|
||||
* **%F** 文件类型
|
||||
* **%n** 文件名
|
||||
* **%U** 用户名
|
||||
* **%u** 用户 ID
|
||||
* **%g** 组 ID
|
||||
* **%w** 创建时间
|
||||
* **%y** 修改时间
|
||||
|
||||
|
||||
|
||||
在 `stat` 手册和 `coreutils` 信息页中都有完整的格式化序列列表。
|
||||
|
||||
### 文件信息
|
||||
|
||||
如果你曾经尝试解析过 `ls -l` 的输出,那么,你会很喜欢 `stat` 命令的灵活性。你并不是每次都需要 `stat` 提供的所有信息,但是,当你需要其中一些或全部的时候它是非常有用的。不管你是读取默认输出,还是你自己创建的查询输出,`stat` 命令都可以让你访问想要的数据。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/8/linux-stat-file-status
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[New-World-2019](https://github.com/New-World-2019)
|
||||
校对:[校对者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/yearbook-haff-rx-linux-file-lead_0.png?itok=-i0NNfDC (Hand putting a Linux file folder into a drawer)
|
||||
[2]: https://www.gnu.org/software/coreutils/
|
||||
[3]: https://opensource.com/article/20/9/awk-ebook
|
||||
[4]: https://opensource.com/article/20/8/printf
|
@ -1,87 +0,0 @@
|
||||
[#]: subject: "Apps for daily needs part 4: audio editors"
|
||||
[#]: via: "https://fedoramagazine.org/apps-for-daily-needs-part-4-audio-editors/"
|
||||
[#]: author: "Arman Arisman https://fedoramagazine.org/author/armanwu/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
满足日常需求的应用第四部分:音频编辑器
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
照片由 [Brooke Cagle][2] 在 [Unsplash][3] 上发布。
|
||||
|
||||
音频编辑应用或数字音频工作站(DAW)在过去只被专业人士使用,如唱片制作人、音响工程师和音乐家。但现在很多不是专业人士的人也需要它们。这些工具被用于演示文稿解说、视频博客,甚至只是作为一种爱好。现在尤其如此,因为有这么多的在线平台,方便大家分享音频作品,如音乐、歌曲、播客等。本文将介绍一些你可以在 Fedora Linux 上使用的开源音频编辑器或 DAW。你可能需要安装提到的软件。如果你不熟悉如何在 Fedora Linux 中添加软件包,请参阅我之前的文章[安装 Fedora 34 工作站后要做的事情][4]。这里列出了音频编辑器或 DAW 类的一些日常需求的应用。
|
||||
|
||||
### Audacity
|
||||
|
||||
我相信很多人已经知道 Audacity 了。它是一个流行的多轨音频编辑器和录音机,可用于对所有类型的音频进行后期处理。大多数人使用 Audacity 来记录他们的声音,然后进行编辑,使其结果更好。其结果可以作为播客或视频博客的解说词。此外,人们还用 Audacity 来创作音乐和歌曲。你可以通过麦克风或调音台录制现场音频。它还支持 32 位的声音质量。
|
||||
|
||||
Audacity 有很多功能,可以支持你的音频作品。它有对插件的支持,你甚至可以自己编写插件。Audacity 提供了许多内置效果,如降噪、放大、压缩、混响、回声、限制器等。你可以利用实时预览功能在直接聆听音频的同时尝试这些效果。内置的插件管理器可以让你管理经常使用的插件和效果。
|
||||
|
||||
![][5]
|
||||
|
||||
更多信息可在此链接中找到: <https://www.audacityteam.org/>
|
||||
|
||||
* * *
|
||||
|
||||
### LMMS
|
||||
|
||||
LMMS 或 Linux MultiMedia Studio 是一个全面的音乐创作应用。你可以使用 LMMS 用你的电脑从头开始制作你的音乐。你可以根据自己的创意创造旋律和节拍,并通过选择声音乐器和各种效果使其更加完美。有几个与乐器和效果有关的内置功能,如 16 个内置合成器、嵌入式 ZynAddSubFx、支持插入式 VST 效果插件、捆绑图形和参数均衡器、内置分析器等等。LMMS 还支持 MIDI 键盘和其他音频外围设备。
|
||||
|
||||
![][6]
|
||||
|
||||
更多信息可在此链接中获得: <https://lmms.io/>
|
||||
|
||||
* * *
|
||||
|
||||
### Ardour
|
||||
|
||||
Ardour 作为一个全面的音乐创作应用,其功能与 LMMS 相似。它在其网站上说,Ardour 是一个 DAW 应用,是来自世界各地的音乐家、程序员和专业录音工程师合作的结果。Ardour 拥有音频工程师、音乐家、配乐编辑和作曲家需要的各种功能。
|
||||
|
||||
Ardour 为录音、编辑、混音和输出提供了完整的功能。它有无限的多声道音轨、无限撤销/重做的非线性编辑器、一个全功能的混音器、内置插件等。Ardour 还带有视频播放工具,所以它在为视频项目创建和编辑配乐的过程中也很有帮助。
|
||||
|
||||
![][7]
|
||||
|
||||
更多信息可在此链接中获得: <https://ardour.org/>
|
||||
|
||||
* * *
|
||||
|
||||
### TuxGuitar
|
||||
|
||||
TuxGuitar 是一个指法谱和乐谱编辑器。它配备了指法编辑器、乐谱查看器、多轨显示、拍号管理和速度管理。它包括各种效果,如弯曲、滑动、颤音等。虽然 TuxGuitar 专注于吉他,但它也允许你为其他乐器写乐谱。它也可以作为一个基本的 MIDI 编辑器。你需要对指法谱和乐谱有一定的了解才能使用它。
|
||||
|
||||
![][8]
|
||||
|
||||
更多的信息可以在这个链接上获得: <http://www.tuxguitar.com.ar/>
|
||||
|
||||
* * *
|
||||
|
||||
### 总结
|
||||
|
||||
这篇文章介绍了四个音频编辑器,作为你在 Fedora Linux 上的日常需要和使用的应用。实际上,还有许多其他的你可以在 Fedora Linux 上使用的音频编辑器或者 DAW。你也可以使用 Mixxx、Rosegarden、Kwave、Qtractor、MuseScore、musE 等等。希望这篇文章能帮助你调查和选择合适的音频编辑器或者 DAW。如果你有使用这些应用的经验,请在评论中分享你的经验。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/apps-for-daily-needs-part-4-audio-editors/
|
||||
|
||||
作者:[Arman Arisman][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://fedoramagazine.org/author/armanwu/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/FedoraMagz-Apps-4-Audio-816x345.jpg
|
||||
[2]: https://unsplash.com/@brookecagle?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
|
||||
[3]: https://unsplash.com/s/photos/meeting-on-cafe-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
|
||||
[4]: https://fedoramagazine.org/things-to-do-after-installing-fedora-34-workstation/
|
||||
[5]: https://fedoramagazine.org/wp-content/uploads/2021/08/audio-audacity-1024x575.png
|
||||
[6]: https://fedoramagazine.org/wp-content/uploads/2021/08/audio-lmms-1024x575.png
|
||||
[7]: https://fedoramagazine.org/wp-content/uploads/2021/08/audio-ardour-1024x592.png
|
||||
[8]: https://fedoramagazine.org/wp-content/uploads/2021/08/audio-tuxguitar-1024x575.png
|
250
translated/tech/20210827 How to Easily Install Debian Linux.md
Normal file
250
translated/tech/20210827 How to Easily Install Debian Linux.md
Normal file
@ -0,0 +1,250 @@
|
||||
[#]: subject: "How to Easily Install Debian Linux"
|
||||
[#]: via: "https://itsfoss.com/install-debian-easily/"
|
||||
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "guevaraya "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
如何简单安装 Debian Linux 系统
|
||||
======
|
||||
|
||||
安装 Debian 的简易程度依赖于选择什么镜像。
|
||||
|
||||
如果你使用 Debain 官网的默认镜像,安装 Debian 就比较费劲。你会遇到这种界面,让你从外部介质先安装网络驱动。
|
||||
|
||||
![Installing Debian from default ISO is problematic for new users][1]
|
||||
|
||||
当然你也可以花时间去排除这个故障,但这让事情变得无意义的复杂。
|
||||
|
||||
不用担心,让我来展示如何轻巧的简单安装 Debian。
|
||||
|
||||
### 简单安装 Debian桌面系统
|
||||
|
||||
在你查看步骤之前,请确认以下准备工作:
|
||||
* 一个至少 4Gb 大小的U盘
|
||||
* 一个可以联网的系统(可以和要安装的操作系统一样)
|
||||
* 要安装的 Debian 系统将会清理掉系统上所有数据,因此请拷贝重要数据到其他外部磁盘
|
||||
|
||||
你需要什么规格的 Debian 系统?取决于你想用什么类型的[桌面环境][2]。例如,GNOME 桌面系统可以在4GB RAM上运行但最好在8GB RAM 流畅一些。如果你是4GB或更小的 RAM,还是建议尝试 KDE,Cinnamon 或 Xfce 桌面系统。
|
||||
|
||||
Debian 也都支持 [32位和64位的指令架构][3]。你需要根据你的CPU指令架构选择对应的 Debian 镜像。
|
||||
|
||||
你的系统应该至少要有 25 GB的硬盘空间可用。越多越好。
|
||||
|
||||
警告!
|
||||
|
||||
这个方法会移除磁盘上其他操作系统的已有数据。
|
||||
|
||||
你可能需要保存你后面还需要用的个人信息,文档,照片等到外部 U 盘或云盘。
|
||||
|
||||
这个教程是我安装附带 GNOME Debian 11 Bullseye 的步骤。这些步骤其实和其他桌面环境都大同小异。
|
||||
|
||||
_**这个教程在 UEFI 系统的 GPT分区得到验证。如果你是[MBR替换GPT分区][4],或[传统的BIOS替换UEFI][5],创建Live USB的步骤有一点不同。**_
|
||||
|
||||
|
||||
#### 步骤 1:获取正确的 Debian 的 ISO 镜像
|
||||
|
||||
在安装 Debian 过程中的一半事情是选择合适的 ISO 镜像。奇怪的是,确实作为一个新 Debian 用户很难从官网容易的找到 ISO镜像。
|
||||
|
||||
如果你点击 Debian 官网的下载按钮,它会下载一个为用户提供最佳兼容的最小安装包。请不太要用它。
|
||||
|
||||
反而,你需要用 Live ISO。这有一个技巧,有独立非免费的 Live 版本(包含网络驱动)
|
||||
|
||||
你需要下载非免费的 live ISO 镜像。这里的其他程序可以不必从官网下载,有各种 torrents 连接或直接下载各种架构的安装包。
|
||||
|
||||
这些链接就在这里
|
||||
|
||||
[32和64位的主仓地址][7]
|
||||
|
||||
[Debian 11 官方下载][8]
|
||||
|
||||
[Debian 11 种子地址][9]
|
||||
|
||||
你将看到桌面环境的几个文件的名字。选择一种你的对应的桌面环境。直接下载的话,直接点击.iso结尾的链接。
|
||||
|
||||
![下载非免费版的 Live Debian 的ISO][10]
|
||||
|
||||
一旦你有了对应的 ISO 下载包,剩下就是和其他 Linux 发行版的安装流程一样了
|
||||
|
||||
#### 步骤 2: 创建一个 Debian 的 Live USB
|
||||
|
||||
将USB插入你的系统。最好在用之前最好格式化一下,它最终也会被格式化的。
|
||||
|
||||
你可以根据你的选择使用任何版本的 Live USB 创建工具。如果你使用 Windows,请用 Rufus。我们现在在这用 Etcher,因为这个工具在 Windows 和 Linux 都可以用。
|
||||
|
||||
从它的官网下载 Etcher
|
||||
|
||||
[下载 Etcher][11]
|
||||
|
||||
我有一个专门的[在linux下使用 Etcher 的教程][12]。而这我就不深入介绍了。仅仅下载可执行程序,浏览 Debian 的 ISO镜像,确认选择正确的 USB 驱动器然后点击 Flash 按钮。
|
||||
|
||||
![用 Etcher 创建 Debian 的 Live USB][13]
|
||||
|
||||
不一会就创建好 live USB。一旦创建好,就可以开机引导了。
|
||||
|
||||
#### 步骤 3:从 live USB 引导启动
|
||||
|
||||
重启即将要安装 Debian 的系统。当她显示制造商标识的时候,按下F2/F10 或 F12 键进入开机引导选择界面。你可能也会[进入到 UEFI 固件设置界面][14]。
|
||||
|
||||
有些系统已经开启了安全启动功能就不允许从 Live USB 开机引导。如果是这种情况,请[从BIOS设置里禁用安全启动][15]
|
||||
|
||||
不同的的制造商在界面上一些差异。
|
||||
|
||||
![][16]
|
||||
|
||||
一点你在 BIOS 里做了修改,按下 F10 保存并推出。你的系统将会重新启动。
|
||||
|
||||
再次看到,当看到制造商的标识后按下 F2/F10 或 F12 查看引导配置。你应该可以看到从 USB 引导的类似选项,然后选中。
|
||||
|
||||
![][17]
|
||||
|
||||
一会儿就会看到如下图的显示界面,选择第一个选项。
|
||||
|
||||
![Debian live 选择界面][18]
|
||||
|
||||
#### 步骤 4: 开始 Debian 安装
|
||||
|
||||
当你进入 live Debian 会话,如果你用 GNONE 桌面话,它呈现一个欢迎界面并带有选择你的键盘和语言。当你看到这些界面只需要点击下一步。
|
||||
|
||||
![Debian live 欢迎界面][19]
|
||||
|
||||
选择欢迎界面之后,按下 windows徽标/Super 键进入活动区。你应该可以看到 Debian 的安装按钮。
|
||||
|
||||
![开始 Debian 安装][20]
|
||||
|
||||
它会打开一个友好的[<ruby>卡拉马雷斯<rt>Calamares</rt></ruby>图形安装器][21]。从这里开始事情就比较简单了,
|
||||
|
||||
![Debian 11 Calamares graphical installer][22]
|
||||
|
||||
它会让你选择你的地理位置和时区。
|
||||
|
||||
![Select your location and time zone][23]
|
||||
|
||||
下一个界面,会让你选择键盘类型。这儿请 **注意**。你的键盘会根据位置自动选择。例如,我的位置是印度它会自动选择印地语的印度键盘。我不得不将其改为英语印度类型。
|
||||
|
||||
![选择键盘类型][24]
|
||||
|
||||
下一个界面是关于硬盘分区表和 Debian 安装哪里。这里是在你的系统只安装 Debian。
|
||||
|
||||
简单选择便是直接 “Erase Disk”。Debian 将把除过 ESP 分区和交互分区的其他分区都放在根挂载点上。实际上,下面显示了你选择了安装配置后的磁盘分布。
|
||||
|
||||
![磁盘分区][25]
|
||||
|
||||
如果你想手动选择,你也需要手工划分区,选择 root,home,boot 或 swap 分配多少。只有你知道自己在做什么你才可以去手工配置。
|
||||
|
||||
下一界面,你需要提供用户名和密码。但它不会设置root的密码并将其保持为空。
|
||||
|
||||
![设置用户名和密码][26]
|
||||
|
||||
这也意味着你可以用 sudo 新创建用户。在“复杂 Debian 安装”中,你也可以设置 root 密码但前提是你必须用手动添加普通用户到 sudoer 列表。看看,这个安装过程是不是对新手来说很简单?
|
||||
|
||||
在实际真正安装之前,它会呈现你已经选择的汇总信息。如果没有问题,就可以点击安装按钮。
|
||||
|
||||
![安装配置的汇总信息][27]
|
||||
|
||||
现在只需要等待安装完成。
|
||||
|
||||
![安装 Debian][28]
|
||||
|
||||
几分钟后就会完成安装。当安装完成,它会提示重启。
|
||||
|
||||
![完成 Debian 安装][29]
|
||||
|
||||
如果一切顺利重启系统,你应该可以看到 Debian 的 grub 界面。
|
||||
|
||||
![Debian 启动画面][30]
|
||||
|
||||
### 疑难解答小贴士 (如果系统没有启动到 Debian)
|
||||
|
||||
我遇到情况是,我的 Dell 系统不能识别并引导任何操作系统。很奇怪,我已经能看到 Debian 已经创建了一个 ESP 分区。
|
||||
|
||||
如果你也是同样的情况,去BIOS配置里。检测启动流程,如果你看不到任何东西,就点击新增一个启动选项。
|
||||
|
||||
![增加新的启动选项][31]
|
||||
|
||||
它会提供一个增加 EFI 文件的选项。
|
||||
|
||||
![选择 EFi 文件][32]
|
||||
|
||||
只有在安装过程中 Debian 创建了 ESP 分区,就有一个带文件的 EFI 目录被创建出来。
|
||||
|
||||
![选择 EFI 目录][33]
|
||||
|
||||
它会显示一个 Debian 文件夹包含其他文件夹。选择 Debian 文件夹。
|
||||
|
||||
![选择 Debian][34]
|
||||
|
||||
在 Debian 文件夹,你将看到 grubx64.efi, shimx64.efi。请选择 shimx64.efi。
|
||||
|
||||
![选择 shim.efi][35]
|
||||
|
||||
你需要选择一个合适的名字。最后的界面应该如下:
|
||||
|
||||
![增加 efi 文件的新启动选项][36]
|
||||
|
||||
现在你可能有了下面这个启动选项。我命名为 Debian,它显示了两个 Debian 驱动选择(我猜其中一个是从 efi 文件来的)。按下 F10 保存退出 BIOS 的配置。
|
||||
|
||||
![新增的启动选项][37]
|
||||
|
||||
现在启动你的系统,你可以看到 grub 界面带有 Debian 的启动选项。你现在可以体验 Debian 了。
|
||||
|
||||
![][30]
|
||||
|
||||
### Debian 可以安装到哪里?
|
||||
|
||||
我这里的目的是让事情变得简单。并不是说你不能从默认的官网下载安装包来安装。只是它需要花更多的精力。
|
||||
|
||||
这个教程对你安装有帮助吗?你如果还是有问题,请在下面留言给我,我会尽力提供帮助。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/install-debian-easily/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[巴龙](https://github.com/guevaraya)
|
||||
校对:[校对者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://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Debian-firmware.png?resize=800%2C600&ssl=1
|
||||
[2]: https://itsfoss.com/what-is-desktop-environment/
|
||||
[3]: https://itsfoss.com/32-bit-64-bit-ubuntu/
|
||||
[4]: https://itsfoss.com/check-mbr-or-gpt/
|
||||
[5]: https://itsfoss.com/check-uefi-or-bios/
|
||||
[6]: https://www.debian.org/
|
||||
[7]: https://cdimage.debian.org/images/unofficial/non-free/images-including-firmware/11.0.0-live+nonfree/
|
||||
[8]: https://cdimage.debian.org/images/unofficial/non-free/images-including-firmware/11.0.0-live+nonfree/amd64/iso-hybrid/
|
||||
[9]: https://cdimage.debian.org/images/unofficial/non-free/images-including-firmware/11.0.0-live+nonfree/amd64/bt-hybrid/
|
||||
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/downloading-Debian-live-non-free-iso.png?resize=800%2C490&ssl=1
|
||||
[11]: https://www.balena.io/etcher/
|
||||
[12]: https://itsfoss.com/install-etcher-linux/
|
||||
[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/creating-live-debian-usb-with-etcher-800x518.png?resize=800%2C518&ssl=1
|
||||
[14]: https://itsfoss.com/access-uefi-settings-windows-10/
|
||||
[15]: https://itsfoss.com/disable-secure-boot-windows/
|
||||
[16]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2014/05/Disable_Secure_Boot_Windows8.jpg?resize=700%2C525&ssl=1
|
||||
[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/boot-from-windows-disk-ventoy.jpg?resize=800%2C611&ssl=1
|
||||
[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/debian-live-boot-screen.png?resize=617%2C432&ssl=1
|
||||
[19]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/debian-live-welcome-screen.png?resize=800%2C450&ssl=1
|
||||
[20]: https://itsfoss.com/wp-content/uploads/2021/08/start-Debian-installation-800x473.webp
|
||||
[21]: https://calamares.io/
|
||||
[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-1.png?resize=800%2C441&ssl=1
|
||||
[23]: https://itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-2-800x441.webp
|
||||
[24]: https://itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-4-800x441.webp
|
||||
[25]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-5.png?resize=800%2C441&ssl=1
|
||||
[26]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-6.png?resize=800%2C441&ssl=1
|
||||
[27]: https://itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-7-800x500.webp
|
||||
[28]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-8.png?resize=800%2C500&ssl=1
|
||||
[29]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-9.png?resize=800%2C500&ssl=1
|
||||
[30]: https://itsfoss.com/wp-content/uploads/2021/08/debian-boot-screen.webp
|
||||
[31]: https://itsfoss.com/wp-content/uploads/2021/08/add-new-boot-option.webp
|
||||
[32]: https://itsfoss.com/wp-content/uploads/2021/08/add-efi-file-for-boot-option.webp
|
||||
[33]: https://itsfoss.com/wp-content/uploads/2021/08/select-efi-file-boot-option.webp
|
||||
[34]: https://itsfoss.com/wp-content/uploads/2021/08/select-debian-folder-for-uefi.webp
|
||||
[35]: https://itsfoss.com/wp-content/uploads/2021/08/select-shim-boot.webp
|
||||
[36]: https://itsfoss.com/wp-content/uploads/2021/08/new-boot-option.webp
|
||||
[37]: https://itsfoss.com/wp-content/uploads/2021/08/new-boot-option-added.webp
|
@ -1,96 +0,0 @@
|
||||
[#]: subject: "What are container runtimes?"
|
||||
[#]: via: "https://opensource.com/article/21/9/container-runtimes"
|
||||
[#]: author: "Nived V https://opensource.com/users/nivedv"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
什么是容器运行时?
|
||||
======
|
||||
深入了解容器运行时,你就可以理解容器环境是如何建立的。
|
||||
![Ships at sea on the web][1]
|
||||
|
||||
在对[容器镜像][2]的检查中,我讨论了容器的基本原理,但现在是时候深入研究容器运行时了,这样你就可以了解容器环境是如何构建的。本文的部分信息摘自 Open Container Initiative (OCI)(容器的开放标准)的[官方文档][3],所以无论你的容器引擎如何,这些信息都是相关的。
|
||||
|
||||
### 容器运行机制
|
||||
|
||||
那么,当你运行 `podman run` 或 `docker run` 命令时,在后台到底发生了什么?这里为你提供一个逐步的概述:
|
||||
|
||||
1. 如果本地没有镜像,则从镜像注册处拉取镜像
|
||||
2. 镜像被提取到一个写时拷贝的文件系统上,所有的容器层相互叠加以创建一个合并的文件系统
|
||||
3. 准备一个容器挂载点
|
||||
4. 从容器镜像中设置元数据,包括诸如覆盖 CMD、来自用户输入的 ENTRYPOINT、设置 SECCOMP 规则等设置,以确保容器按预期运行
|
||||
5. 提醒内核为该容器分配某种隔离,如进程、网络和文件系统(命名空间)
|
||||
6. 内核还被提醒为这个容器分配一些资源限制,如 CPU 或内存限制(cgroups)
|
||||
7. 一个系统调用(syscall)被传递给内核以启动容器
|
||||
8. 设置 SELinux/AppArmor
|
||||
|
||||
|
||||
|
||||
容器运行时负责上述所有的工作。当我们想到容器运行时,想到的可能是 runc、lxc、containerd、rkt、cri-o 等等。嗯,你没有错。这些都是容器引擎和容器运行时,每一种都是为不同的情况建立的。
|
||||
|
||||
_容器运行时_更侧重于运行容器,为容器设置命名空间和 cgroups,也被称为底层容器运行时。高层的容器运行时或容器引擎专注于格式、解包、管理和镜像共享。它们还为开发者提供 API。
|
||||
|
||||
### Open Container Initiative (OCI)
|
||||
|
||||
Open Container Initiative(OCI)是一个 Linux 基金会项目。其目的是设计某些开放标准或围绕如何与容器运行时和容器镜像格式工作的结构。它是由 Docker、rkt、CoreOS 和其他行业领导者于 2015 年 6 月建立的。
|
||||
|
||||
它使用两个规范来做这件事:
|
||||
|
||||
#### 1\. 镜像规范(image-spec)
|
||||
|
||||
该规范的目标是创建可互操作的工具,用于构建、传输和准备运行的容器镜像。
|
||||
|
||||
该规范的高层组件包括:
|
||||
|
||||
* [Image Manifest][4] — 一个描述构成容器镜像的元素的文件
|
||||
* [Image Index][5] — 镜像清单的注释索引
|
||||
* [Image Layout][6] — 一个代表镜像内容的文件系统布局
|
||||
* [Filesystem Layer][7] — 一个描述容器文件系统的变化集
|
||||
* [Image Configuration][8] — 确定镜像层排序和配置的文件,适合转换成[运行时包][9]。
|
||||
* [Conversion][10] — 解释应该如何进行转换的文件
|
||||
* [Descriptor][11] — 一个描述被引用内容的类型、元数据和内容地址的参考资料
|
||||
|
||||
|
||||
|
||||
#### 2\. 运行时规范(runtime-spec)
|
||||
|
||||
该规范旨在定义容器的配置、执行环境和生命周期。config.json 文件为所有支持的平台提供了容器配置,并详细说明了能够创建容器的地方。执行环境与为容器的生命周期定义的通用操作一起被详细说明,以确保在容器内运行的应用在不同的运行时之间有一个一致的环境。
|
||||
|
||||
Linux 容器规范使用了各种内核功能,包括命名空间、cgroups、capabilities、LSM 和文件系统监牢来实现该规范。
|
||||
|
||||
### 现在你知道了
|
||||
|
||||
容器运行时是由 OCI 规范管理的,以提供一致性和互操作性。许多人在使用容器时不需要了解它们是如何工作的,但当你需要排除故障或优化使用方法时,了解容器是一个宝贵的优势。
|
||||
|
||||
* * *
|
||||
|
||||
_本文基于 [techbeatly][12] 的文章,并经授权改编。_
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/9/container-runtimes
|
||||
|
||||
作者:[Nived V][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/nivedv
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/kubernetes_containers_ship_lead.png?itok=9EUnSwci (Ships at sea on the web)
|
||||
[2]: https://opensource.com/article/21/8/container-fundamentals-2
|
||||
[3]: https://github.com/opencontainers
|
||||
[4]: https://github.com/opencontainers/image-spec/blob/master/manifest.md
|
||||
[5]: https://github.com/opencontainers/image-spec/blob/master/image-index.md
|
||||
[6]: https://github.com/opencontainers/image-spec/blob/master/image-layout.md
|
||||
[7]: https://github.com/opencontainers/image-spec/blob/master/layer.md
|
||||
[8]: https://github.com/opencontainers/image-spec/blob/master/config.md
|
||||
[9]: https://github.com/opencontainers/runtime-spec
|
||||
[10]: https://github.com/opencontainers/image-spec/blob/master/conversion.md
|
||||
[11]: https://github.com/opencontainers/image-spec/blob/master/descriptor.md
|
||||
[12]: https://medium.com/techbeatly/container-runtimes-deep-dive-77eb0e511939
|
@ -2,25 +2,23 @@
|
||||
[#]: via: "https://opensource.com/article/21/9/lspci-linux-hardware"
|
||||
[#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: translator: "unigeorge"
|
||||
[#]: reviewer: "turbokernel"
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Use lspci on Linux to see your hardware
|
||||
在 Linux 上使用 lspci 命令查看硬件情况
|
||||
======
|
||||
Use the lspci command to display devices and drivers on your Linux
|
||||
system.
|
||||
lspci 命令用于显示 Linux 系统上的设备和驱动程序。
|
||||
![computer screen ][1]
|
||||
|
||||
When you're running Linux on a desktop or server, sometimes you need to identify the hardware in that system. One command used for this is `lspci`. It works by showing all devices attached to the PCI bus. It's provided by the [pciutils][2] package and is available for a wide range of Linux and BSD-based operating systems.
|
||||
当你在个人电脑或服务器上运行 Linux 时,有时需要识别该系统中的硬件。`lspci` 命令用于显示连接到 PCI 总线的所有设备,从而满足上述需求。该命令由 [pciutils][2] 包提供,可用于各种基于 Linux 和 BSD 的操作系统。
|
||||
|
||||
### Basic usage
|
||||
### 基础用法
|
||||
|
||||
The information displayed when a regular user runs `lspci` might be limited due to access permissions. Running the command with `sudo` provides a complete picture.
|
||||
|
||||
Running `lspci` by itself lists the PCI buses and their attached devices. Here's an example from my media center PC. It's an AMD Phenom CPU-based system, so it has an AMD chipset. It also has an Atheros wireless controller and an Nvidia graphics card. All hardware devices are listed with details such as vendor, name, and model number:
|
||||
由于访问权限,普通用户运行 `lspci` 时显示的信息可能会受限,因此可以使用 `sudo` 运行命令,系统会给出完整的信息图。
|
||||
|
||||
直接运行 `lspci` 命令会列出 PCI 总线及其连接的设备,下图是在我的媒体中心 PC 上的演示样例。图中是一个基于 AMD Phenom CPU 的系统,所以它有一个 AMD 芯片组,以及 Atheros 无线适配器和 Nvidia 显卡。所有硬件设备都列出了详细信息,例如供应商、名称和型号等:
|
||||
|
||||
```
|
||||
$ sudo lspci
|
||||
@ -50,14 +48,13 @@ $ sudo lspci
|
||||
02:00.0 Network controller: Qualcomm Atheros AR9287 Wireless Network Adapter (PCI-Express) (rev 01)
|
||||
```
|
||||
|
||||
### Verbose output
|
||||
### 详细输出
|
||||
|
||||
Adding a `-v` option increases the verbosity or the level of detail for each device. You can use `-vv` or `-vvv` for even higher amounts of device detail. At this level, `lspci` displays various subsystems and memory addresses, interrupt request (IRQ) numbers, and other capabilities for all devices. The output is extremely long. Give it a try on your system.
|
||||
添加 `-v` 选项会显示每个设备的详细信息,你可以使用 `-vv` 或 `-vvv` 来获取更多的设备细节。在 `-v` 级别,`lspci` 会显示所有设备的各种子系统和内存地址、中断请求 (IRQ) 编号和一些其他功能信息。输出信息会非常长。在你的系统上试一试吧。
|
||||
|
||||
### Searching with grep
|
||||
|
||||
Sometimes you want to narrow your search. For instance, the RPM Fusion web site has instructions for installing Nvidia graphics drivers. They begin with identifying your graphics card using the `grep` command. This is what I get on my laptop:
|
||||
### 使用 grep 过滤搜索
|
||||
|
||||
你可能会需要缩小搜索范围。例如,RPM Fusion 网站有安装 Nvidia 图形驱动程序的说明,里面就首先使用了 `grep` 命令来定位显卡信息。下面是我在笔记本电脑上得到的输出:
|
||||
|
||||
```
|
||||
$ sudo lspci | grep -e VGA
|
||||
@ -66,8 +63,7 @@ $ sudo lspci | grep -e 3D
|
||||
01:00.0 3D controller: NVIDIA Corporation GM108M [GeForce MX130] (rev a2)
|
||||
```
|
||||
|
||||
The `grep` commands above show one VGA device on my media center PC but no 3D device.
|
||||
|
||||
下面(LCTT 译注:原文为 “above”,应为作者笔误)的 `grep` 命令在我的媒体中心 PC 上定位了一个 VGA 设备,但没有显示 3D 设备。
|
||||
|
||||
```
|
||||
$ sudo lspci | grep -e VGA
|
||||
@ -76,20 +72,18 @@ $ sudo lspci | grep -e 3D
|
||||
$
|
||||
```
|
||||
|
||||
### Searching by vendor ID
|
||||
|
||||
There is another way that doesn't require `grep`. Suppose I want to determine whether any other Nvidia devices are present. It's necessary to know a little more. I use the `-nn` option to display vendor and device ID numbers. On my media center PC, this option shows my VGA card, vendor ID, and device ID:
|
||||
### 按供应商 ID 搜索
|
||||
|
||||
还有另一种无需 `grep` 的方法可以使用。假设我想确认一下此计算机是否有其他的 Nvidia 设备,在此之前我们还需要一些额外信息,使用 `-nn` 选项显示的供应商和设备 ID 号。在我的媒体中心 PC 上,此选项会给出我的 VGA 卡、供应商 ID 和设备 ID:
|
||||
|
||||
```
|
||||
$ sudo lspci -nn | grep -e VGA
|
||||
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK107 [GeForce GTX 650] [10de:0fc6] (rev a1)
|
||||
```
|
||||
|
||||
The set of brackets with the colon-separated numbers after the device name shows the vendor and device ID. The output indicates that the vendor ID for a device made by Nvidia Corporation is **10de**.
|
||||
|
||||
The `-d` option displays all devices from a specified vendor, device, or class ID. Here are all the Nvidia devices in my system (keeping the `-nn` to include the vendor IDs):
|
||||
设备名称后的方括号内有用冒号分隔的数字,即供应商和设备 ID。输出表明 Nvidia Corporation 制造的设备的供应商 ID 为 **10de**。
|
||||
|
||||
`-d` 选项用于指定供应商、设备或类 ID 的所有设备。以下是我系统中的所有 Nvidia 设备(保留 `-nn` 以解析供应商 ID):
|
||||
|
||||
```
|
||||
$ sudo lspci -nn -d 10de:
|
||||
@ -97,12 +91,11 @@ $ sudo lspci -nn -d 10de:
|
||||
01:00.1 Audio device [0403]: NVIDIA Corporation GK107 HDMI Audio Controller [10de:0e1b] (rev a1)
|
||||
```
|
||||
|
||||
From the output, you can see that in addition to a graphics card, I have an Nvidia audio device. They are both actually part of the same **Nvidia GeForce GTX 650** card, but this is a good example nonetheless.
|
||||
从输出中可以看到,除了显卡之外,我还有一个 Nvidia 音频设备。实际上它们都属于同一张 **Nvidia GeForce GTX 650** 卡,但这仍然是一个很好的示例。
|
||||
|
||||
### Kernel modules
|
||||
|
||||
Along with PCI hardware devices, `lspci` can show what kernel driver modules are loaded with the `-k` option. I add this option to my `lspci` commands to view several pieces of information about my Nvidia devices.
|
||||
### 内核模块
|
||||
|
||||
结合 PCI 硬件设备,`lspci` 可以使用 `-k` 选项显示内核加载了哪些驱动程序模块。我将此选项添加到我的 `lspci` 命令来查看有关我的 Nvidia 设备的信息。
|
||||
|
||||
```
|
||||
$ sudo lspci -nn -k -d 10de:
|
||||
@ -116,28 +109,26 @@ $ sudo lspci -nn -k -d 10de:
|
||||
Kernel modules: snd_hda_intel
|
||||
```
|
||||
|
||||
Two additional lines are displayed: _Kernel driver in use_ and _Kernel modules_. The second one lists the modules available to support the device.
|
||||
可以看到额外显示了两行:<ruby>_正在使用的内核驱动程序_<rt><rp>(</rp>Kernel driver in use<rp>)</rp></rt></ruby> 和 <ruby>_内核模块_<rt><rp>(</rp>Kernel modules<rp>)</rp></rt></ruby>,其中后者列出了可用于支持该设备的模块。
|
||||
|
||||
### Keeping up to date
|
||||
|
||||
New devices and vendors are constantly entering the market. If you see a device listed as _unknown_, your PCI device ID database may be outdated. There are two ways to check. The `-Q` option uses DNS to query the central database. This, of course, requires network connectivity.
|
||||
### 同步最新状态
|
||||
|
||||
新设备和供应商总是在不断迭代。如果看到显示为 _unknown_ 的设备,说明你的 PCI 设备 ID 数据库可能已过时。有两种方法可以检查更新。`-Q` 选项会使用 DNS 查询中央数据库,当然,这需要联网。
|
||||
|
||||
```
|
||||
`$ sudo lspci -Q`
|
||||
```
|
||||
|
||||
You can also update your local PCI ID database by running the command `update-pciids`.
|
||||
|
||||
你还可以通过运行命令 `update-pciids` 来更新本地 PCI ID 数据库。
|
||||
|
||||
```
|
||||
$ sudo update-pciids
|
||||
Downloaded daily snapshot dated 2021-08-22 03:15:01
|
||||
```
|
||||
|
||||
### Learn more about your hardware
|
||||
### 了解有关你的硬件的更多信息
|
||||
|
||||
Of course, `lspci` is just one of many commands available for Linux that is useful for querying the hardware and software on your system. Learn more about hardware on Linux in my article covering USB devices: [Recognize more devices on Linux with this USB ID Repository][3].
|
||||
当然,`lspci` 只是 Linux 中用于查询系统硬件和软件的诸多命令之一。读者可以在阅读关于 USB 设备的文章,了解有关 Linux 硬件的更多信息:[使用此 USB ID 存储库识别 Linux 上的更多设备][3]。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -145,8 +136,8 @@ via: https://opensource.com/article/21/9/lspci-linux-hardware
|
||||
|
||||
作者:[Alan Formy-Duval][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
译者:[unigeorge](https://github.com/unigeorge)
|
||||
校对:[turbokernel](https://github.com/turbokernel)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -0,0 +1,95 @@
|
||||
[#]: subject: "Debug a web page error from the command line"
|
||||
[#]: via: "https://opensource.com/article/21/9/wget-debug-web-server"
|
||||
[#]: author: "Jim Hall https://opensource.com/users/jim-hall"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
从命令行调试网页错误
|
||||
======
|
||||
调试网络服务器的一种方法是使用 wget 命令行程序。
|
||||
![Digital creative of a browser on the internet][1]
|
||||
|
||||
有时在管理一个网站时,事情会被搞得一团糟。你可能会删除一些陈旧的内容,用重定向到其他页面来代替。后来,在做了其他改动后,你发现一些网页变得完全无法访问了。你可能会在浏览器中看到一个错误:“该页面没有正确重定向”,并建议你检查你的 cookies。
|
||||
|
||||
![Redirect loop example in Firefox][2]
|
||||
|
||||
Screenshot by Jim Hall,[CC-BY SA 4.0][3]
|
||||
|
||||
调试这种情况的一个方法是使用 `wget` 命令行程序,使用 `-S` 选项来显示所有的服务器响应。当使用 `wget` 进行调试时,我也喜欢使用 `-O` 选项将输出保存到一些临时文件中,以备以后需要查看其内容。
|
||||
|
||||
|
||||
```
|
||||
$ wget -O /tmp/test.html -S <http://10.0.0.11/announce/>
|
||||
\--2021-08-24 17:09:49-- <http://10.0.0.11/announce/>
|
||||
Connecting to 10.0.0.11:80... connected.
|
||||
HTTP request sent, awaiting response...
|
||||
|
||||
HTTP/1.1 302 Found
|
||||
|
||||
Date: Tue, 24 Aug 2021 22:09:49 GMT
|
||||
|
||||
Server: Apache/2.4.48 (Fedora)
|
||||
|
||||
X-Powered-By: PHP/7.4.21
|
||||
|
||||
Location: <http://10.0.0.11/assets/>
|
||||
|
||||
Content-Length: 0
|
||||
|
||||
Keep-Alive: timeout=5, max=100
|
||||
|
||||
Connection: Keep-Alive
|
||||
|
||||
Content-Type: text/html; charset=UTF-8
|
||||
Location: <http://10.0.0.11/assets/> [following]
|
||||
\--2021-08-24 17:09:49-- <http://10.0.0.11/assets/>
|
||||
Reusing existing connection to 10.0.0.11:80.
|
||||
HTTP request sent, awaiting response...
|
||||
|
||||
HTTP/1.1 302 Found
|
||||
|
||||
Date: Tue, 24 Aug 2021 22:09:49 GMT
|
||||
|
||||
Server: Apache/2.4.48 (Fedora)
|
||||
|
||||
X-Powered-By: PHP/7.4.21
|
||||
|
||||
Location: <http://10.0.0.11/announce/>
|
||||
|
||||
Content-Length: 0
|
||||
|
||||
Keep-Alive: timeout=5, max=99
|
||||
|
||||
Connection: Keep-Alive
|
||||
|
||||
Content-Type: text/html; charset=UTF-8
|
||||
Location: <http://10.0.0.11/announce/> [following]
|
||||
\--2021-08-24 17:09:49-- <http://10.0.0.11/announce/>
|
||||
Reusing existing connection to 10.0.0.11:80.
|
||||
.
|
||||
.
|
||||
.
|
||||
20 redirections exceeded.
|
||||
```
|
||||
|
||||
我在这个输出中省略了很多重复的内容。通过阅读服务器的响应,你可以看到 `http://10.0.0.11/announce/` 立即重定向到 `http://10.0.0.11/assets/`,然后又重定向到 `http://10.0.0.11/announce/`。以此类推。这是一个无休止的循环,`wget` 将在 20 次重定向后退出。但有了这些调试信息,你可以修复重定向,避免循环。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/9/wget-debug-web-server
|
||||
|
||||
作者:[Jim Hall][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/jim-hall
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet)
|
||||
[2]: https://opensource.com/sites/default/files/uploads/firefox-redirect-loop.png (Redirect loop example in Firefox)
|
||||
[3]: https://creativecommons.org/licenses/by-sa/4.0/
|
116
translated/tech/20210908 How to Run Java Programs in Ubuntu.md
Normal file
116
translated/tech/20210908 How to Run Java Programs in Ubuntu.md
Normal file
@ -0,0 +1,116 @@
|
||||
[#]: subject: "How to Run Java Programs in Ubuntu"
|
||||
[#]: via: "https://itsfoss.com/run-java-program-ubuntu/"
|
||||
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
如何在 Ubuntu 中运行 Java 程序
|
||||
======
|
||||
|
||||
那么,你已经开始学习 Java 编程了?这很好。
|
||||
|
||||
你想在你的 Linux 系统上运行 Java 程序?那就更好了。
|
||||
|
||||
让我告诉你如何在 Ubuntu 和其他 Linux 发行版的终端中运行 Java。
|
||||
|
||||
### 在 Ubuntu 中运行 Java 程序
|
||||
|
||||
让我们在这里按正确的步骤进行。
|
||||
|
||||
#### 第一步:安装 Java 编译器
|
||||
|
||||
要运行一个 Java 程序,你需要先编译该程序。为此你需要 Java 编译器。
|
||||
|
||||
Java 编译器是 [JDK][1](Java 开发工具包)的一部分。你需要安装 JDK,以便编译和运行 Java 程序。
|
||||
|
||||
首先,检查你的系统上是否已经安装了 Java 编译器:
|
||||
|
||||
```
|
||||
javac --version
|
||||
```
|
||||
|
||||
如果你看到类似 “Command ‘javac’ not found, but can be installed with” 的错误,这意味着你需要安装 Java 开发工具包。
|
||||
|
||||
![Check if Java compiler is already installed or not][2]
|
||||
|
||||
在 Ubuntu 上安装 JDK 的最简单方法是使用 Ubuntu 的默认包:
|
||||
|
||||
```
|
||||
sudo apt install default-jdk
|
||||
```
|
||||
|
||||
你会被要求输入你的账户密码。当你输入密码时,屏幕上什么也看不到。这很正常。直接输入密码即可。当询问时,按回车键或 Y 键。
|
||||
|
||||
![Installing JDK that also contains the Java compiler][3]
|
||||
|
||||
上述命令应该适用于其他基于 Debian 和 Ubuntu 的发行版,如 Linux Mint、Elementary OS 等。对于其他发行版,请使用你的发行版的包管理器。包的名称也可能不同。
|
||||
|
||||
安装完毕后,验证 javac 现在是否可用。
|
||||
|
||||
![Verify that Java compiler can be used now][4]
|
||||
|
||||
#### 第二步:在 Linux 中编译 Java 程序
|
||||
|
||||
因为这个原因,你需要有一个 Java 程序文件。假设你创建了一个名为 **HelloWorld.java** 的新的 Java 程序文件,它的内容如下:
|
||||
|
||||
```
|
||||
class HelloWorld{
|
||||
public static void main(String args[]){
|
||||
System.out.println("Hello World");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
你可以[使用终端的 Nano 编辑器][5]或 Gedit 图形化文本编辑器来编写你的 Java 程序。
|
||||
|
||||
```
|
||||
javac HelloWorld.java
|
||||
```
|
||||
|
||||
如果没有错误,上面的命令不会产生输出。
|
||||
|
||||
当你编译 Java 程序时,它会生成一个 .class 文件,文件名是你在程序中使用的类。你需要运行这个类文件。
|
||||
|
||||
#### 第三步:运行 Java 类文件
|
||||
|
||||
你不需要在这里指定类的扩展名。只需要类的名称。而这一次,你使用 java 命令,而不是 javac。
|
||||
|
||||
```
|
||||
java HelloWorld
|
||||
```
|
||||
|
||||
我的程序将在屏幕上打印 Hello World。
|
||||
|
||||
![Running java programs in the Linux terminal][6]
|
||||
|
||||
这就是你如何在 Linux 终端中运行一个 Java 程序。
|
||||
|
||||
这是最简单的一个例子。这个示例程序只有一个类。Java 编译器为你程序中的每个类都创建一个类文件。对于较大的程序和项目来说,事情会变得很复杂。
|
||||
|
||||
这就是为什么我建议[在 Ubuntu 上安装 Eclipse][7]来进行 Java 编程。在 IDE 中编程更容易。
|
||||
|
||||
希望本教程对你有所帮助。有问题或建议吗?评论区都是你的。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/run-java-program-ubuntu/
|
||||
|
||||
作者:[Abhishek Prakash][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/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://jdk.java.net/
|
||||
[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/java-compiler-check-ubuntu.png?resize=800%2C328&ssl=1
|
||||
[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/install-jdk-ubuntu.png?resize=800%2C430&ssl=1
|
||||
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/java-compiler-ubuntu.png?resize=798%2C226&ssl=1
|
||||
[5]: https://itsfoss.com/nano-editor-guide/
|
||||
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/running-java-programs-in-Linux-terminal.png?resize=798%2C301&ssl=1
|
||||
[7]: https://itsfoss.com/install-latest-eclipse-ubuntu/
|
@ -0,0 +1,57 @@
|
||||
[#]: subject: "Building an open source community health analytics platform"
|
||||
[#]: via: "https://opensource.com/article/21/9/openrit-mystic"
|
||||
[#]: author: "Quinn Foster https://opensource.com/users/quinn-foster"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
构建开源的社区健康分析平台
|
||||
======
|
||||
一个学术性的 OSPO 正在与 CHAOSS 软件合作以建立一个社区健康分析平台。
|
||||
![metrics and data shown on a computer screen][1]
|
||||
|
||||
罗切斯特理工学院(RIT)最近在增加其在开源世界的存在方面取得了相当大的进展。例如,其开源项目办公室,Open@RIT,已经开始帮助 RIT 的教职员工为他们的开源项目建立和维护社区。
|
||||
|
||||
这些进展是由 RIT 的学生、教师和工作人员推动的。目前,大学里已经有越来越多的人在领导他们自己的开放项目。然而,运行一个完全的开源项目可能是很麻烦的。这主要来自于维护项目的社区和管理数据,如项目的代码、问题跟踪和仓库。
|
||||
|
||||
为了帮助这些人,Open@RIT 正在创建一个名为 Mystic 的系统,这是一个社区健康分析平台,利用了 [GrimoireLab][2],这是一个由 [CHAOSS][3] 软件开发的开源工具包,为开源项目提供指标和分析。GrimoireLab 允许用户收集、丰富、过滤和可视化一个项目的数据,例如一个报告的问题被解决的时间、贡献者的关系等。
|
||||
|
||||
Mystic 将作为一个前端门户,任何人都可以提交他们的项目。在那里,项目将被直接发送到 GrimoireLab,它将在几分钟后为提交者计算并发布项目的指标。
|
||||
|
||||
> Open@RIT 的全栈开发者和 Mystic 的首席开发者 Emi Simpson 说:“我们希望 RIT 的任何管理、领导或参与开源项目的人都能将该项目提交给 Mystic,并获得他们需要的任何指标”。
|
||||
|
||||
这个过程很简单。登录 Mystic 后,上传项目的用户会打开一个弹出式窗口,输入项目的细节和数据源的链接,如 GitLab、RSS feed 和一个开放软件基金会(OSF)项目。一旦细节和项目被保存下来,Mystic 就会使用 GrimoireLab 从项目源中自动检索指标,并为每个源渲染图表。然后,该项目及其指标将显示在它自己的仪表板上。
|
||||
|
||||
![Mystic statistics page][4]
|
||||
|
||||
Screenshot by Quinn Foster,[CC-BY SA 4.0][5]
|
||||
|
||||
这些仪表盘将并列显示在一个页面上,以供其他人查看,鼓励全世界 RIT 内部的开源社区之间的合作开发和互动。Simpson 和 Open@RIT 希望这将增加 RIT 的开放工作的参与度,并进一步巩固该大学作为开放工作中心的地位。
|
||||
|
||||
> Simpson 说:“如果有人问 RIT 在为开源软件做什么,我希望人们能够指着 Mystic 和 GrimoireLab 说就是这些。通过建立‘这些’是我们正在做的,这些是我们的贡献,这些是人们正在做的项目的指标,我们可以在 RIT 建立一个以我们正在做的开源工作为中心的社区。”
|
||||
|
||||
目前,Mystic 仍在开发中,还没有准备好进入生产环境,但它对 RIT 和整个开源的潜力仍然是有目共睹的。未来的目标包括实现与大学报告工具的轻松整合,以及在项目层面和总体上的综合仪表盘。
|
||||
|
||||
你对 Mystic 的贡献感兴趣吗?[请与我们联系][6]开始吧。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/9/openrit-mystic
|
||||
|
||||
作者:[Quinn Foster][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/quinn-foster
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen)
|
||||
[2]: https://chaoss.github.io/grimoirelab/
|
||||
[3]: https://chaoss.community/
|
||||
[4]: https://opensource.com/sites/default/files/uploads/mystic_statistics_page.png (Mystic statistics page)
|
||||
[5]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[6]: https://opensource.ieee.org/rit/mystic
|
Loading…
Reference in New Issue
Block a user