Merge branch 'LCTT:master' into master

This commit is contained in:
Donkey 2022-07-14 23:28:05 +08:00 committed by GitHub
commit 9e65e9dd41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
39 changed files with 4128 additions and 2150 deletions

View File

@ -3,135 +3,106 @@
[#]: author: "Tomasz Waraksa https://opensource.com/users/tomasz"
[#]: collector: "lujun9972"
[#]: translator: "mcfd"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-14826-1.html"
从 Linux 终端发送桌面通知与提醒
如何从 Linux 终端发送桌面通知与提醒
======
本 Linux 教程演示如何使用脚本命令来发送
自己的桌面通知与提醒。
![Person using a laptop][1]
> 这篇教程演示如何使用脚本命令来发送自己的桌面通知与提醒。
![](https://img.linux.net.cn/data/attachment/album/202207/14/145103vawkhy6w506thy6h.jpg)
有时候,来自脚本的视觉回馈是很有用的。例如,当一个脚本或计划任务完成时,一个长期运行的构建任务失败时,或者当脚本执行中出现了紧急问题时。桌面应用程序可以通过弹出通知来做到这一点,但脚本也可以做到这一点!你可以使用脚本命令来给自己发送桌面通知与提醒。
![Example notification][2]
(Tomasz Waraksa, CC BY-SA 4.0)
下面的代码是在 Linux 上编写和测试的。它也可以在 macOS 上运行,只需花点功夫。请参见最后一节 [提示与技巧][3]。
### 从 Linux 终端发送通知
要从 Linux 终端发送通知,请使用 [`notify-send`][4] 命令。运行 `which ``notify-send`  命令来查看它是否在于你的系统中。如果没有,请使用包管理器来安装它。
要从 Linux 终端发送通知,请使用 [notify-send][4] 命令。运行 `which notify-send` 命令来查看它是否在于你的系统中。如果没有,请使用包管理器来安装它。
在 Fedora 上,输入:
```
`$ sudo dnf install notify-send`
$ sudo dnf install notify-send
```
在基于 Debian 的发行版上,输入:
```
`$ sudo apt install notify-send`
$ sudo apt install notify-send
```
几个简单的通知示例:
```
$ notify-send "Dinner ready!"
$ notify-send "Tip of the Day" "How about a nap?"
```
你可以用紧急程度、自定义图标等选项来自定义通知。过 `man notify-send` 了解更多。你也可以在通知正文中使用一小组 HTML 标记以使消息有一个棒的视觉感受。最重要的是URL 被呈现为可点击的。例如:
```
$ notify-send -u critical \
  "Build failed!" \
  "There were &lt;b&gt;123&lt;/b&gt; errors. Click here to see the results: <http://buildserver/latest>"
"Build failed!" \
"There were <b>123</b> errors. Click here to see the results: http://buildserver/latest"
```
![Build fail notification][5]
(Tomasz Waraksa, CC BY-SA 4.0)
发送的通知会被桌面环境接收,并像其他通知一样显示。它们将具有相同的外观、交互和行为。
### 将 notify-send 与 at 结合使用
计划任务通常被用来定期安排命令。`at` 命令安排在一个指定的时间执行一条命令。 如果你像这样运行它,它会以交互模式启动,你可以在其中输入要在指定时间执行的命令:
计划任务通常被用来定期安排命令。`at` 命令安排在一个指定的时间执行一条命令。如果你像这样运行它,它会以交互模式启动,你可以在其中输入要在指定时间执行的命令:
```
`$ at 12:00`
$ at 12:00
```
这对脚本来说并不有用。幸运的是, `at` 接受来自标准输入的参数,所以我们可以这样使用它:
这对脚本来说并不有用。幸运的是 `at` 接受来自标准输入的参数,所以我们可以这样使用它:
```
$ echo "npm run build" | at now + 1 minute
$ echo "backup-db" | at 13:00
```
有许多指定时间的方法。 从绝对时间,如 `10:00`,到相对时间,如 `now + 2 hours` ,再特殊时间,如`noon` 或 `midnight`。我们可以把它和 `notify-send` 结合起来,在未来的某个时间向自己发送提醒。例如:
```
`$ echo "notify-send 'Stop it and go home now?' 'Enough work for today.' -u critical" | at now`
$ echo "notify-send 'Stop it and go home now?' 'Enough work for today.' -u critical" | at now
```
![Stop for the day notification][6]
(Tomasz Waraksa, CC BY-SA 4.0)
### 提醒的命令
现在,建立一个自定义的 Bash 命令来给自己发送提醒信息。像这样简单且人性化的命令:
```
$ remind "I'm still here" now
$ remind "Time to wake up!" in 5 minutes
$ remind "Dinner" in 1 hour
$ remind "Take a break" at noon
$ remind "It's Friday pints time!" at 17:00
```
这比 Alexa 更好!该怎样做?
请看下面的代码。它定义了一个名为 **remind** 的函数,它支持上述语法。实际工作是在最后两行完成的。其余的部分负责显示帮助信息、参数校验等,这与任何大型应用程序中有用的代码与必要的白噪声的比例大致相同。
请看下面的代码。它定义了一个名为 `remind` 的函数,它支持上述语法。实际工作是在最后两行完成的。其余的部分负责显示帮助信息、参数校验等,这与任何大型应用程序中有用的代码与必要的白噪声的比例大致相同。
把代码保存在某个地方,例如,在 `~/bin/remind` 文件中,并在你的 `.bashrc` 配置文件写入该函数,以便在你登录时加载它:
```
`$ source ~/bin/remind`
$ source ~/bin/remind
```
重新打开终端,然后输入 remind 来查看语法。尽情享受吧!
重新打开终端,然后输入 `remind` 来查看语法。尽情享受吧!
```
#!/usr/bin/env bash
function remind () {
  local COUNT="$#"
@ -201,7 +172,9 @@ function remind () {
* * *
_本文经作者许可改编自原文详情见[此处][7]。_
(文内图片来自 Tomasz Waraksa, CC BY-SA 4.0
本文经作者许可改编自 [原文][7]。
--------------------------------------------------------------------------------
@ -210,7 +183,7 @@ via: https://opensource.com/article/22/1/linux-desktop-notifications
作者:[Tomasz Waraksa][a]
选题:[lujun9972][b]
译者:[mcfd](https://github.com/mcfd)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -4,41 +4,40 @@
[#]: collector: "lkxed"
[#]: translator: "robsean"
[#]: reviewer: "turbokernel"
[#]: publisher: " "
[#]: url: " "
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-14819-1.html"
Linux 静态链接工作原理
Linux 静态链接工作原理
======
学习如何将多个 C <ruby>对象<rt>object</rt></ruby> 文件组合到一个带有静态库的单个可执行文件文件之中。
![Woman using laptop concentrating][1]
![](https://img.linux.net.cn/data/attachment/album/202207/12/120441y0q5a5abfyjyy7ug.jpg)
图片作者Mapbox Uncharted ERG, [CC-BY 3.0 US][2]
> 学习如何用静态链接库将多个 C 目标文件结合到一个单个的可执行文件之中。
使用 C 编写的应用程序时,通常有多个源码文件,但最终需要编译成单个的可执行文件。
使用 C 编写的应用程序时,通常有多个源码文件,但最终需要编译成单个的可执行文件。
你可以通过两种方式来完成这项工作:通过创建一个 <ruby>静态<rt>static</rt></ruby> 库 或 一个 <ruby>动态<rt>dynamic</rt></ruby> (也被称为 <ruby>共享<rt>shared</rt></ruby>)。从创建和链接的方式来看,它们是两种不同类型的库。选择使用哪种方式取决于你的的具体场景。
你可以通过两种方式来完成这项工作:通过创建一个 <ruby>静态<rt>static</rt></ruby> 库 或 一个 <ruby>动态<rt>dynamic</rt></ruby>也被称为 <ruby>共享<rt>shared</rt></ruby>。从创建和链接的方式来看,它们是两种不同类型的库。选择使用哪种方式取决于你的的具体场景。
在 [上一篇文章][3] 中,我演示了如何创建一个动态链接的可执行文件,这是一种更通用的方法。在这篇文章中,我将说明如何创建一个静态链接的可执行文件。
### 使用静态库链接器
链接器是一个命令,它将一个程序的多个部分组合,并为它们重新组织存储器分配。
<ruby>链接器<rt>linker</rt></ruby>是一个命令,它将一个程序的多个部分结合在一起,并为它们重新组织内存分配。
链接器的功能包括:
* 集成一个程序的所有的部分
* 装配一个新的存储器结构,以便所有的部分组合在一起
* 恢复存储器地址,以便程序可以在新的存储器组织下运行
* 整合一个程序的所有的部分
* 计算出一个新的内存组织结构,以便所有的部分组合在一起
* 恢复存地址,以便程序可以在新的存组织结构下运行
* 解析符号引用
经过这些链接器功能,创建了一个名称为可执行文件的一个可运行程序。
链接器通过这些功能,创建了一个名称为可执行文件的一个可运行程序。
静态库是通过复制一个程序中的所有依赖库模块到最终的可执行镜像来创建的。链接器将链接静态库作为编译过程的最后一步。可执行文件是通过解析外部引用、库实例程序与程序代码组合来创建的。
静态库是通过复制一个程序中的所有依赖库模块到最终的可执行镜像来创建的。链接器将链接静态库作为编译过程的最后一步。可执行文件是通过解析外部引用、将库例程与程序代码结合在一起来创建的。
### 创建对象文件
### 创建目标文件
这里是一个静态库的示例以及其链接过程。首先,创建带有这些函数识别标志的头文件 `mymath.h` :
这里是一个静态库的示例以及其链接过程。首先,创建带有这些函数识别标志的头文件 `mymath.h` :
```
int add(int a, int b);
@ -47,7 +46,7 @@ int mult(int a, int b);
int divi(int a, int b);
```
使用这些函数定义来创建 `add.c` 、`sub.c` 、`mult.c` 和 `divi.c` 文件:
使用这些函数定义来创建 `add.c` 、`sub.c` 、`mult.c` 和 `divi.c` 文件。我将把所有的代码都放置到一个代码块中,请将其分为四个文件,如注释所示
```
// add.c
@ -71,15 +70,17 @@ return (a/b);
}
```
现在,使用 GCC 来生成对象文件 `add.o` 、`sub.o` 、`mult.o` 和 `divi.o` :
现在,使用 GCC 来生成目标文件 `add.o` 、`sub.o` 、`mult.o` 和 `divi.o`
LCTT 校注:关于“<ruby>目标文件<rt>object file</rt></ruby>”,有时候也被称作“对象文件”,对此,存在一些译法混乱情形,称之为“目标文件”的译法比较流行,本文采用此译法。)
```
$ gcc -c add.c sub.c mult.c divi.c
```
`-c` 选项跳过链接步骤,并且只创建对象文件。
`-c` 选项跳过链接步骤,而只创建目标文件。
创建一个名称为 `libmymath.a` 的静态库,接下来,移除对象文件,因为它们不再被需要。(注意,使用一个 `trash` 命令比使用一个 `rm` 命令更安全。)
创建一个名称为 `libmymath.a` 的静态库,接下来,移除目标文件,因为它们不再被需要。(注意,使用一个 `trash` 命令比使用一个 `rm` 命令更安全。)
```
$ ar rs libmymath.a add.o sub.o mult.o divi.o
@ -88,7 +89,7 @@ $ ls
add.c  divi.c  libmymath.a  mult.c  mymath.h  sub.c
```
现在,你已经创建了一个简单的名称为 `libmymath` 是数学示例库,你可以在 C 代码中使用它。当然,这里有非常复杂的 C 库,这就是开发者们用于开发最终产品的过程,你和我可以安装这些库并在 C 代码中使用。
现在,你已经创建了一个名称为 `libmymath` 的简单数学示例库,你可以在 C 代码中使用它。当然,也有非常复杂的 C 库,这就是他们这些开发者来生成最终产品的工艺流程,你和我可以安装这些库并在 C 代码中使用。
接下来,在一些自定义代码中使用你的数学库,然后链接它。
@ -129,9 +130,9 @@ int main()
$ gcc -I . -c mathDemo.c
```
`-I` 选项告诉 GCC 搜索在其后列出的头文件。在这个实例中,你通过单个点 (`.` ) 来指定当前目录。
`-I` 选项告诉 GCC 搜索在其后列出的头文件。在这个实例中,你通过单个点`.`来指定当前目录。
`mathDemo.o``libmymath.a` 来生成最终的可执行文件。这里有两种方法来向 GCC 表达这一点。
`mathDemo.o``libmymath.a` 来生成最终的可执行文件。这里有两种方法来向 GCC 告知这一点。
你可以指向文件:
@ -145,7 +146,7 @@ $ gcc -static -o mathDemo mathDemo.o libmymath.a
$ gcc -static -o mathDemo -L . mathDemo.o -lmymath
```
在后面的那个示例中,`-lmymath` 选项告诉链接器来链接随对象文件 `mathDemo.o` 中的对象文件 `libmymath.a` 来生成最终的可执行文件。`-L` 选项指示链接器在下面的参数中查找库 (类似于你使用 `-I` 所做的工作)
在后面的那个示例中,`-lmymath` 选项告诉链接器来链接对象文件 `mathDemo.o`对象文件 `libmymath.a` 来生成最终的可执行文件。`-L` 选项指示链接器在下面的参数中查找库(类似于你使用 `-I` 所做的工作)
### 分析结果
@ -171,7 +172,7 @@ $ du -h ./mathDemo
932K    ./mathDemo
```
在我 [前一篇文章][5] 的示例中,动态链接的可执行文件只占有 24K 大小。
在我 [前一篇文章][3] 的示例中,动态链接的可执行文件只占有 24K 大小。
运行该命令来看看它的工作内容:
@ -193,7 +194,7 @@ Enter two numbers
动态链接可执行文件通常优于静态链接可执行文件,因为动态链接会保持应用程序的组件模块化。假如一个库接收到一次关键安全更新,那么它可以很容易地修补,因为它存在于应用程序的外部。
当你使用静态链接时,库的代码会 "隐藏" 在你创建的可执行文件之中,意味着在库每次更新时(相信我,你会有更好的东西),仅有的一种修补方法是重新编译和发布一个新的可执行文件。
当你使用静态链接时,库的代码会“隐藏”在你创建的可执行文件之中,意味着在库每次更新时(相信我,你会有更好的东西),仅有的一种修补方法是重新编译和发布一个新的可执行文件。
不过,如果一个库的代码,要么存在于它正在使用的具有相同代码的可执行文件中,要么存在于不会接收到任何更新的专用嵌入式设备中,那么静态连接将是一种可接受的选项。
@ -212,6 +213,6 @@ via: https://opensource.com/article/22/6/static-linking-linux
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/lenovo-thinkpad-laptop-concentration-focus-windows-office.png
[2]: https://creativecommons.org/licenses/by/3.0/us/
[3]: https://opensource.com/article/22/5/dynamic-linking-modular-libraries-linux
[3]: https://linux.cn/article-14813-1.html
[4]: https://www.redhat.com/sysadmin/recover-file-deletion-linux
[5]: https://opensource.com/article/22/5/dynamic-linking-modular-libraries-linux

View File

@ -3,29 +3,32 @@
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-14827-1.html"
massCode一个免费和开源的代码片段管理器
massCode一个自由开源的代码片段管理器
======
简介:一个开源的代码片段管理器,使你能够涉足代码,提高生产力,并节省时间。
![](https://img.linux.net.cn/data/attachment/album/202207/14/151504ti9twf2u5kft2wh2.jpg)
> massCode 是一个开源的代码片段管理器,使你能够涉足代码,提高生产力,并节省时间。
如果一个工具能让事情变得更快、更有效率,那对许多开发者来说就是救命稻草。
虽然有不同的服务和平台试图使编码体验更快,但你仍然有其他几个选择可以考虑。
虽然有各种服务和平台试图使编码体验更快,但你仍然有其他几个选择可以考虑。
例如,一个代码片段管理器。使用代码片段管理器,你的目的是保存你想快速访问的代码部分。它更像是指定快捷方式,在你的程序中添加所需的代码。
例如,代码片段管理器。使用代码片段管理器,你的目的是保存你想快速访问的代码片段。它更像是指定快捷方式,在你的程序中添加所需的代码。
这不是一个新的概念,但可用于这项工作的工具可能不完全是开源的。
幸运的是,我偶然发现了一个不错的项目,它为你提供了一个免费的、开源的片段管理器,即 massCode。
幸运的是,我偶然发现了一个不错的项目,它为你提供了一个自由开源的片段管理器,即 massCode。
### massCode跨平台的开源片段管理器
![masscode][1]
massCode 是一个有用的片段管理器,具有一些基本功能。
massCode 是一个有用的代码片段管理器,具有一些基本功能。
它支持广泛的编程语言,还包括对 Markdown 的支持。你可以使用文件夹组织你的代码片段,添加标签等。
@ -37,30 +40,30 @@ massCode 可用于 Linux、Windows 或 macOS。让我们来看看一些主要功
massCode 包括许多有用的功能。其中一些是:
* 多层次的文件夹组织者
* 多层次的文件夹结构
* 每个片段都可以存储在片段(标签)中
* 集成编码编辑器,即 [Ace][3]
* 代码格式化或高亮显示
* 支持带预览的 Markdown
* 能够搜索一个片段
* 给你的代码段添加描述,以了解它的用途
* 各种深色/浅色主题可用
* 能够从 [SnippetsLab][4] 迁移
* 自动保存以帮助你保留你的工作
* 将其与云同步文件夹整合
* 对 VSCode、Raycast 和 Alfred 的扩展支持。
* 集成编码编辑器 [Ace][3]
* 代码格式化或高亮显示
* 支持带预览的 Markdown
* 能够搜索片段
* 给你的代码段添加描述,以了解它的用途
* 各种深色/浅色主题可用
* 能够从 [SnippetsLab][4] 迁移
* 自动保存以帮助你保留你的工作
* 将其与云同步文件夹整合
* 支持 VSCode、Raycast 和 Alfred 的扩展
除了上述所有功能外,你还可以轻松地复制保存代码片段,只需点击一下。
对于自定义,你可以调整字体大小和系列、切换自动换行、高亮显示行、使用单引号或添加尾随命令,这要归功于 [Prettier][5]。
此外,一份片段可以有多个片 因此,它使你有机会将其用于各种用例。
此外,一份片段可以有多个片。因此,它使你有机会将其用于各种用例。
如前所述,你也可以通过改变同步文件夹的存储位置将其与你的任何云同步服务整合。
![masscode migrate preferences][6]
总的来说,它工作得很好,有一些局限性,比如将嵌套文件夹从 SnippetsLab 迁移到 masCode 的能力。
总的来说,它工作得很好,有一些局限性,比如缺乏将嵌套文件夹从 SnippetsLab 迁移到 masCode 的能力。
### 在 Linux 上安装 massCode
@ -70,13 +73,13 @@ massCode 有 [Snap 包][7],但不在 Snap 商店中。你可以直接下载该
sudo snap install --dangerous ~/Downloads/masscode_2.6.1_amd64.snap
```
我们的一份故障排除指南可以帮助你了解更多关于 [dangerous snap 选项][8]。
我们的一份故障排除指南可以帮助你了解 [snap 的 dangerous 选项][8]。
你可以通过其[官方网站][9]或 [GitHub 发布区][10]下载 Windows/MacOS 版。
你可以通过其 [官方网站][9] 或 [GitHub 发布区][10] 下载 Windows/MacOS 版。
[massCode][11]
> **[massCode][11]**
你试过 massCode 吗?还有其他可用于 Linux 的代码片段管理器吗?请在下面的评论中告诉我你的想法。
你试过 massCode 吗?还有其他可用于 Linux 的代码片段管理器吗?请在下面的评论中告诉我你的想法。
--------------------------------------------------------------------------------
@ -85,7 +88,7 @@ via: https://itsfoss.com/masscode/
作者:[Ankush Das][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -3,31 +3,32 @@
[#]: author: "Don Watkins https://opensource.com/users/don-watkins"
[#]: collector: "lkxed"
[#]: translator: "MjSeven"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-14823-1.html"
检查 Linux 磁盘使用情况
======
du 和 ncdu 两个命令提供了相同信息的两种不同视图,便于我们跟踪存储在计算机上的内容。
![Data stack in blue][1]
> du 和 ncdu 两个命令提供了相同信息的两种不同视图,便于我们跟踪存储在计算机上的内容。
![](https://img.linux.net.cn/data/attachment/album/202207/13/111729faleyal2gmappykc.jpg)
无论你有多少存储空间,了解文件占用了多少磁盘空间都是一个重要的考虑事项。我的笔记本有一个相对较小的 250GB NVME 驱动器,大多数时候都没什么问题,但几年前我开始探索 Linux 上的游戏,情况变得有所不同,安装 Steam 和其他游戏使存储管理更加重要。
### du 命令
检查磁盘驱动器上剩余存储空间最简单的方法是 [du 命令][2]。它会估计文件空间使用情况,像其他所有 Linux 工具一样,`du` 非常强大,但知道如何根据你的特定需求使用它会很有帮助。我总是查阅 man 页面来获取实用程序。du 有几个选项,可以为你提供文件存储的最佳快照,以及它们在系统上消耗多少空间。
检查磁盘驱动器上剩余存储空间最简单的方法是 [du 命令][2]。它会估计文件空间使用情况,像其他所有 Linux 工具一样,`du` 非常强大,但学会如何根据你的特定需求使用它会很有帮助。我总是查阅手册页来掌握实用程序的用法。`du` 有几个选项,可以为你提供文件存储的最佳快照,以及它们在系统上消耗多少空间。
`du` 命令有很多选项,以下是一些常见的:
* -a - 包括文件夹和文件在内的存储信息
* --apparent-size - 打印自身大小而不是占用磁盘量
* -h - 人类可读的格式
* -b - 字节
* -c -总计
* -k - 块大小
* -m - 以兆字节为单位的大小
* `-a` - 包括文件夹和文件在内的存储信息
* `--apparent-size` - 打印自身大小而不是占用磁盘量
* `-h` - 人类可读的格式
* `-b` - 字节为单位
* `-c` - 总计
* `-k` - 以块为单位
* `-m` - 以兆字节为单位的大小
务必查看 `du` 手册页获取完整帮助列表。
@ -41,15 +42,15 @@ du 和 ncdu 两个命令提供了相同信息的两种不同视图,便于我
$ du -a ~/Downloads
4923    ./UNIX_Driver_5-0/UNIX Driver 50
4923    ./UNIX_Driver_5-0
20     ./epel-release-latest-9.noarch.rpm
12    ./rpmfusion-free-release-9.noarch.rpm
20     ./epel-release-latest-9.noarch.rpm
12     ./rpmfusion-free-release-9.noarch.rpm
2256    ./PZO9297 000 Cover.pdf
8    ./pc.md
8     ./pc.md
2644    ./geckodriver-v0.31.0-linux64.tar.gz
466468
```
最左边的数字是以字节为单位的文件大小。我想要一些对我更有帮助的东西,所以我将人类可读格式的选项添加到命令中,结果是 4.8G(千兆字节),这对我来说是一种更有用的数字格式。(to 校正:这个 4.8G 不知道从何而来)
最左边的数字是以字节为单位的文件大小。我想要一些对我更有帮助的东西,所以我将人类可读格式的选项添加到命令中,结果是 456M兆字节),这对我来说是一种更有用的数字格式。
```
$ du -ah ~/Downloads
@ -65,21 +66,15 @@ $ du -ah ~/Downloads
与大多数 Linux 命令一样,你可以组合选项,要以人类可读的格式查看 `Downloads` 目录,使用 `du -ah ~/Downloads` 命令。
**[[ 另请阅读:检查可用磁盘空间的 5 个 Linux 命令 ]][3]**
#### 总和
`-c` 选项在最后一行提供了磁盘使用总和。我可以使用 `du -ch /home/don` 来显示主目录中的每个文件和目录。这里有很多信息,我只想知道最后一行的信息,所以我将磁盘使用命令通过管道传输给 `tail`。命令是 `du -ch /home/don | tail`to 校正:这条命令似乎没卵用,在 Ubuntu 试验过
`-c` 选项在最后一行提供了磁盘使用总和。我可以使用 `du -ch /home/don` 来显示主目录中的每个文件和目录。这里有很多信息,我只想知道最后一行的信息,所以我将 `du` 命令通过管道传输给 `tail` 来显示最后几行。命令是 `du -ch /home/don | tail`LCTT 校注:可以使用 `tail -1` 来仅显示最后一行汇总行。
![将 du 命令输出通过管道传输到 tail][4]
Image by:
(Don Watkins, CC BY-SA 4.0)
### ncdu 命令
对存储在驱动器上内容感兴趣的 Linux 用户,另一个选择是 [ncdu 命令][5],它代表 *NCurses 磁盘使用情况*。基于你的 Linux 发行版,你可能需要下载并安装它。
对存储在驱动器上内容感兴趣的 Linux 用户,另一个选择是 [ncdu 命令][5],它代表 “NCurses 磁盘使用情况”。基于你的 Linux 发行版,你可能需要下载并安装它。
在 Linux Mint、Elementary、Pop_OS! 或其它基于 Debian 的发行版上:
@ -99,37 +94,27 @@ $ sudo dnf install ncdu
$ sudo pacman -S ncdu
```
安装后,你可以使用 ncdu 来分析你的文件系统。以下是在我的主目录中发出 `ncdu` 后的示例输出。`ncdu` 的 man 页面指出“ncduNCurses Disk Usage是众所周知的 `du` 基于 curses 的版本,它提供了一种快速查看哪些目录正在使用磁盘空间的方法。”
安装后,你可以使用 `ncdu` 来分析你的文件系统。以下是在我的主目录中发出 `ncdu` 后的示例输出。`ncdu` 的手册页指出 “ncduNCurses Disk Usage是众所周知的 `du` 基于 curses 的版本,它提供了一种快速查看哪些目录正在使用磁盘空间的方法。”
![du 命令输出][6]
Image by:
(Don Watkins, CC BY-SA 4.0)
我可以使用方向键上下导航,按下 **Enter** 键进入目录。有趣的是,`du` 报告我的主目录中的总磁盘使用量为 12GB`ncdu` 显示为 11GB。你可以在 `ncdu` 手册页中找到更多信息。
我可以使用方向键上下导航,按下回车键进入目录。有趣的是,`du` 报告我的主目录中的总磁盘使用量为 12GB`ncdu` 显示为 11GB。你可以在 `ncdu` 手册页中找到更多信息。
你可以将 `ncdu` 指向某个目录来探索特定目录。例如,`ncdu /home/don/Downloads`。
![ncdu 命令输出][7]
Image by:
(Don Watkins, CC BY-SA 4.0)
**?** 键显示帮助菜单。
`?` 键显示帮助菜单。
![ncdu 帮助][8]
Image by:
(Don Watkins, CC BY-SA 4.0)
### 总结
`du``ncdu` 两个命令提供了相同信息的两种不同视图,便于我们跟踪存储在计算机上的内容。
如果你不习惯使用终端,或者只是在寻找此类信息的另一种试图,查看 [GNOME 磁盘使用分析器][9]。如果你的系统上还没有它,你可以轻松安装和使用它。检查你的发行版是否有 `baobab`,如果你想进行尝试,去安装它。
如果你不习惯使用终端,或者想寻找此类信息的另一种查看方式,可以看看 [GNOME 磁盘使用分析器][9]。如果你的系统上还没有它,你可以轻松安装和使用它。检查你的发行版是否有 baobab 开发的这个软件,如果你想试试,那就去安装它吧。
(文内图片来自于 Don Watkins, CC BY-SA 4.0
--------------------------------------------------------------------------------
@ -138,7 +123,7 @@ via: https://opensource.com/article/22/7/check-disk-usage-linux
作者:[Don Watkins][a]
选题:[lkxed][b]
译者:[MjSeven](https://github.com/MjSeven)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -3,14 +3,14 @@
[#]: author: "The Linux Foundation https://www.linuxfoundation.org/blog/google-summer-of-code-zephyr-rtos/"
[#]: collector: "lkxed"
[#]: translator: "lkxed"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-14818-1.html"
谷歌编程之夏与 Zephyr RTOS 项目介绍
======
**谷歌编程之夏**GSoC是一个谷歌举办的国际年度项目每年都在夏季举办。当贡献者们参与并完成一个 [自由开源软件][3] 的编码项目,[谷歌][1] 就会给他们发放 [津贴][2]。谷歌编程之夏于 2005 年推出,于 5 月至 8 月举行。项目创意由参与开源软件开发的主办组织提交,但学生也可以提出自己的项目创意。
**谷歌编程之夏**GSoC是一个谷歌举办的国际年度项目每年都在夏季举办。当贡献者们参与并完成一个 [自由开源软件][3] 的编码项目,[谷歌][1] 就会给他们发放 [津贴][2]。谷歌编程之夏于 2005 年推出,于每年 5 月至 8 月举行。项目创意由参与开源软件开发的主办组织提交,但学生也可以提出自己的项目创意。
今年,该项目向 18 岁或以上的任何人开放 —— 不仅限于学生和应届毕业生了。参与者通过编写软件获得报酬,其 [津贴][4] 的金额取决于他们所在国家/地区的 [购买力平价][5]。
@ -30,7 +30,7 @@
* 得益于 Zephyrs 的设备支持,用户可以选择标准 Arduino 生态系统更广泛的设备
* 能够重复使用 Arduino 工具,如 Arduino IDE 和丰富的库
Arduino Core 使用 LGPL 下进行许可Zephyr 使用 Apache 2 下进行许可。这意味着该项目的开发很可能需要脱离主分支,并在单独的 repo 中进行,以保持代码和许可证分离。有关这方面的历史讨论,请参阅 [#22247][9],有关 Arduino 核心架构之前的早期尝试,请参阅 [soburi/arduino-on-zephyr][10]。
Arduino Core 使用 LGPL 许可Zephyr 使用 Apache 2 许可。这意味着该项目的开发很可能需要脱离主分支,并在单独的仓库中进行,以保持代码和许可证分离。有关这方面的历史讨论,请参阅 [#22247][9],有关 Arduino 核心架构之前的早期尝试,请参阅 [soburi/arduino-on-zephyr][10]。
**贡献者的任务是:**
@ -40,7 +40,7 @@ Arduino Core 使用 LGPL 下进行许可Zephyr 使用 Apache 2 下进行许
**导师:**
[Jonathan Beri][12] Golioth 和 Zephyr TSC 的首席执行官
[Jonathan Beri][12] Golioth 和 Zephyr TSC 的首席执行官
[Alvaro Viebrantz][13] Golioth 和 Google GDE 的创始工程师
**代码许可证:** LGPL
@ -61,7 +61,7 @@ Dhruva 是一名电气工程专业的本科生。他的兴趣广泛,从嵌入
### 项目二Zephyr 的 Apache Thrift 模块
一个贡献者350 hours)。
一个贡献者350 小时)。
[Apache Thrift][17] 是一个 [IDL][18] 规范、[RPC][19] 框架和代码生成器,它抽象出传输和协议细节,让开发者专注于应用逻辑。它适用于所有主流操作系统,支持超过 27 种编程语言、7 种协议和 6 种底层传输方式。最初,它于 [2007 年在 Facebook 开发][20],随后与 Apache 软件基金会共享。
@ -100,7 +100,7 @@ via: https://www.linux.com/news/google-summer-of-code-zephyr-rtos/
作者:[The Linux Foundation][a]
选题:[lkxed][b]
译者:[lkxed](https://github.com/lkxed)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,68 @@
[#]: subject: "Do You Miss Firefox Send? Internxt Send is Ready as a Replacement"
[#]: via: "https://news.itsfoss.com/internxt-send/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lkxed"
[#]: translator: "lkxed"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-14822-1.html"
怀念 Firefox Send 吗?不妨试试 Internxt Send 吧
======
> Internxt 发布了一个新产品,它可以让你快速地将加密文件发送给任何人,同时保持你的隐私。嗯,我们只能希望它不会像 Firefox Send 那样关闭吧……
![Internxt][1]
[Internxt][2] 是一个相当新的开源加密云服务,旨在取代大型科技公司的产品。例如,你可以把它作为谷歌的相册和云端硬盘的替代品。
它免费提供 10 GB 的容量。所以,如果感兴趣的话,你可以注册个账号试一试。
最近,他们还新增了另一个产品 “Internxt Send”作为 Firefox Send 的替代品,填补这个空缺。
说到这里还挺遗憾的Firefox Send 已停止服务了,不得不说它是一个很好的工具!
不过,[Internxt Send][3] 让你可以像 Firefox Send 一样安全地发送/共享图像、视频、文档和其他文件。
### Internxt Send一个安全的文件共享服务
![][4]
我在 GitHub 上找不到 Internxt Send 的存储库,但我已经要求他们澄清了。
LCTT 译注:虽然 Internxt 是在 GitHub 上开源的,但是 GitHub 上没有 Internxt Send 这个产品的存储库,产品的介绍里也没有声称它是开源的。)
正如你所期望的那样,你无需创建帐户即可将文件上传到 Internxt Send。
文件上传限制为 5 GB。而且你不能以任何方式提高这个限制。
你可以选择文件,上传并生成共享链接。或者,你也可以直接向收件人发送电子邮件,那样的话,你需要在邮件里分享你的电子邮件地址。
![][5]
有趣的是,它还允许你在这个电子邮件中添加自定义文本。
与 Firefox Send 不同的是,你无法修改文件共享链接的到期时间,或者是让它在多次下载后失效。默认情况下,链接会在 15 天后过期,你无法更改这个时间。嗯,这还挺扫兴的。
但是,对于那些正在苦苦等待一个加密的共享文件服务的人来说,这可能是一种替代方案。
*我认为有更多的 Firefox Send 替代品是件好事!你对 Internxt Send 有何看法?欢迎在下方评论区里和大家分享。*
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/internxt-send/
作者:[Ankush Das][a]
选题:[lkxed][b]
译者:[lkxed](https://github.com/lkxed)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/ankush/
[b]: https://github.com/lkxed
[1]: https://news.itsfoss.com/wp-content/uploads/2022/07/internxt-send-ft-1.jpg
[2]: https://itsfoss.com/internxt-cloud-service/
[3]: https://send.internxt.com/
[4]: https://news.itsfoss.com/wp-content/uploads/2022/07/internxt-send-1024x640.png
[5]: https://news.itsfoss.com/wp-content/uploads/2022/07/internxt-send-screenshot-1024x782.png

View File

@ -0,0 +1,141 @@
[#]: subject: "7 Reasons Why Ubuntu 22.04 LTS is the Most Secure Release Yet"
[#]: via: "https://news.itsfoss.com/reasons-ubuntu-22-04-secure/"
[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/"
[#]: collector: "lkxed"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-14820-1.html"
Ubuntu 22.04 LTS 是目前最安全的版本的七大原因
======
> Ubuntu 22.04 LTS 是迄今为止最好的 Ubuntu 版本之一。是什么让它如此安全?
![ubuntu 22.04][1]
早在今年 4 月就发布了的 [Ubuntu 22.04 LTS][2],是迄今为止最安全的 Ubuntu 版本。
其安全更新的延长支持、新的硬件支持和其他林林总总的改进,使它在安全方面远远超过了之前的所有版本。
但它是如何做到这一点的呢?还有,是什么让这个版本与以前的版本不同的呢?
有几个原因Canonical 在一篇新的博客文章中为我们重点指出了这些。在这里,让我总结一下,以帮助你了解更多。
### 是什么让 Ubuntu 22.04 LTS 变得安全?
在这个版本中Ubuntu 团队似乎投入了大量的工作来确保其长期的安全性和可靠性。尽管多年来他们以难以想象的方式做到了这一点,但我将强调其中的几件事:
* 改进的硬件安全措施支持
* 更新了安全包
* 私有家目录
* OpenSSL 3
* GCC 11
* nftables 作为默认的防火墙后端
* Linux 内核改进
#### 1、改进的硬件安全措施支持
![][3]
随着英特尔、AMD 和 ARM 的 CPU/SoC 开始推出更多的安全措施,拥有足够的软件来让这些功能发挥作用就变得越来越重要。
截至目前Ubuntu 22.04 支持三种主要的硬件安全措施。
英特尔的 “<ruby>软件保护扩展<rt>Software Guard eXtensions</rt></ruby>SGX提供了一个安全独立的区域来进行敏感计算。例如理想情况下密码处理将在这里进行因为它确保没有其他应用程序可以访问这些数据。
还有 AMD 的“<ruby>安全加密虚拟化<rt>Secure Encrypted Virtualization</rt></ruby>SEV。这项技术旨在防止主机操作系统干扰正在运行的虚拟机。
尽管这与桌面用户的相关性不如其他技术,但要知道,很多数据中心的基础设施都依赖虚拟机来实现应用的容器化。总的来说,此类针对硬件的安全措施应该会加强对桌面和服务器用户的保护。
#### 2、Linux 内核安全的改进
随着 Ubuntu 的每一次发布Linux 内核都会得到升级,提供了许多有用的功能和支持。
但是这一次Canonical 推出了针对不同的平台的优化内核版本。对于 OEM 认证的桌面设备,它提供了 [Linux 内核 5.17][4]。
而对于所有的桌面和服务器用户,可以使用 [Linux 内核 5.15 LTS][5]。
不仅仅限于这个概念,在 [博文][6] 中提到的一些基本内核安全增强措施包括:
* 支持 [核心调度][7],它允许进程控制哪些线程可以在 SMT 同级之间调度,以便让它们保护敏感信息,而不泄露给系统中其他不受信任的进程。
* 内核堆栈随机化提供了一种加固措施,以挫败希望在内核内进行内存破坏攻击的攻击者。
* BPF 子系统也有一些安全方面的增强,包括默认情况下限制为只有特权进程可以使用,以及对签名的 BPF 程序的初步支持。
* 新的 Landlock Linux 安全模块的加入为应用程序沙箱提供了另一种机制,可以通过 AppArmor 或 SELinux 与更传统的方式结合使用。
总之,所有这些改进使 Ubuntu 22.04 LTS 成为开发者、用户和系统管理员的更安全的选择。
#### 3、更新的安全软件包
![][8]
让我们从技术性的安全概念退后一步,回到每个 Ubuntu 用户都应该已经熟悉的概念:软件包。每一个新的 Ubuntu 版本,软件库中的大多数软件包都会更新,以带来更好的安全性和新功能。
尽管对于 Ubuntu 22.04 来说,这并不完全是新的东西,但这确实包括了很多安全方面的更新。这方面的例子包括 openSSL 3 和 GCC 11。
#### 4、OpenSSL 3
OpenSSL 是所有安全通信的支柱。
考虑到包括 MD2 和 DES 在内的许多传统算法已经被废弃并默认禁用OpenSSL 3 作为一个重大的升级特别值得关注。
因此,除非用户特别想使用不太安全的算法,否则你将在默认情况下获得最好的安全性。
#### 5、GCC 11
另一方面GCC 是许多开发者用来将他们的代码变成可以在你的计算机上运行的程序的编译器。
它带来了许多改进,但有一项特别显著地提高了安全性。静态分析得到了极大的加强,使开发人员能够更快地发现软件的漏洞,在第一步就防止有漏洞的代码被发布。
这可能不会直接影响到用户,许多开发人员使用 Ubuntu 来开发他们的应用程序。因此,你下载的很多程序,即使在非 Ubuntu 系统上,也应该比以前更安全。
#### 6、私有家目录
![][9]
作为一个传统上以桌面为重点的发行版Ubuntu 经常选择方便而不是安全。然而,随着他们越来越努力地推动云计算的采用,这种情况必须改变。
以前,任何有权限进入电脑的人都可以打开并查看任何用户的家目录。然而,你可以想象,这给非桌面用户带来了很多问题。因此,需要改变为私有家目录。
对于多用户系统来说,这可能稍显不方便,但这可以相对容易地改变。而且,对于那些不太熟悉技术的人来说,他们不需要做任何事情就可以得到更好的安全保障。
#### 7、nftables 作为默认防火墙后端
![][10]
25 年来防火墙一直是将你的计算机与更广泛的互联网隔离开来的一个关键部分。这些年来Linux 发行版通常使用两种不同的防火墙解决方案iptables 和 xtables。
然而近些年来一种不同的解决方案进入了人们的视野nftables。它提供了显著的性能和灵活性的改进使网络管理员能够更好地保护你的设备。
### 总结
毋庸置疑Ubuntu 22.04 LTS 做了很多不错的升级。不仅仅是用户体验,它在安全方面也是一个重大的飞跃。
当然,还有更多,但上面提到的改进是很好的成就!
关于更多的技术细节,你可以查看这篇 [Ubuntu 的官方博客文章][11]。
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/reasons-ubuntu-22-04-secure/
作者:[Jacob Crume][a]
选题:[lkxed][b]
译者:[wxy](https://github.com/wxy)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/jacob/
[b]: https://github.com/lkxed
[1]: https://news.itsfoss.com/wp-content/uploads/2022/07/ubuntu-22-04-is-most-secure-release.jpg
[2]: https://news.itsfoss.com/ubuntu-22-04-release/
[3]: https://news.itsfoss.com/wp-content/uploads/2022/07/hardware-security-illustration-1024x576.jpg
[4]: https://news.itsfoss.com/linux-kernel-5-17-release/
[5]: https://news.itsfoss.com/linux-kernel-5-15-release/
[6]: https://ubuntu.com/blog/whats-new-in-security-for-ubuntu-22-04-lts
[7]: https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/core-scheduling.html
[8]: https://news.itsfoss.com/wp-content/uploads/2021/07/open-source-security-illustration-1024x576.png
[9]: https://news.itsfoss.com/wp-content/uploads/2021/04/private-home-directory-ubuntu-21.png
[10]: https://news.itsfoss.com/wp-content/uploads/2022/07/firewall-illustration-1024x576.jpg
[11]: https://ubuntu.com/blog/whats-new-in-security-for-ubuntu-22-04-lts

View File

@ -1,93 +0,0 @@
[#]: subject: "The Next-Gen TUXEDO Pulse 15 is a Workstation Powerhouse"
[#]: via: "https://news.itsfoss.com/tuxedo-pulse-gen-2/"
[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
The Next-Gen TUXEDO Pulse 15 is a Workstation Powerhouse
======
TUXEDOs all-new Pulse 15 Gen 2 now packs an improved WQHD 165Hz display and AMDs Ryzen 7 5700U that runs at 35W!
![tuxedo][1]
TUXEDO Computers is a German manufacturer popular for offering a wide range of consumer Linux desktops and laptops.
One of their latest notebook releases, the **Pulse 15** which was introduced two years ago has received a second revision and it sounds like a big upgrade.
### Tuxedo Pulse 15 Gen-2: Whats New?
![][2]
The notebooks new 15.6-inch display takes the center stage here. A **2560 x 1440 pixels LED panel** is definitely a huge enhancement compared to the 1080p display used in the previous model. So you can expect clearer and more detailed images, not to mention fluid movements thanks to the high **165Hz refresh rate**!
The AMD Ryzen 5 4600H is now replaced by the year-old **Ryzen 7 5700U**. Offering a total of 8 cores and 16 threads with a boost up to 4.3Ghz clock speed, it should be ideal for heavy workloads.
TUXEDO has optimized the CPU to run at a whopping 35W instead of the maximum recommended 25W. Moreover, a 35% decrease in power consumption compared to the Ryzen 5 4600H has been benchmarked. The integrated AMD RX Vega 8 graphics running at 1900MHz will be slightly more powerful thanks to the increased wattage.
![][3]
Lastly, the criticisms of the cooling system should be addressed by a new design that features an **“above-average” dual-fan setup** and includes two heat pipes. TUXEDO stated that users shouldnt come across thermal throttling issues and loud fan noise when at full load.
![][4]
#### Other Specifications
Despite such big hardware upgrades, the magnesium-chassis laptop weighs only about 1.5Kg with a 1.7cm thickness.
You get two M.2 NVMe slots for storage and two DDR4 memory slots that support up to 3200MHz.
As far as the battery is concerned, the same **91-Wh** battery is being used promising a best estimate of up to 18 hours, varying with usage.
The connectivity options also include a new DisplayPort via USB-C, which was absent with the first-generation model. Other options contain:
* Intel Dual Band AX 200 (WiFi 6 & Bluetooth 5.2)
* 1 x USB 3.2 Gen2 Type-C
* 2 x USB 3.2 Gen2 Type-A
* 1 x USB 2.0 Type-A
* 1 x HDMI 2.0
* 1 x Gigabit RJ45 LAN
* 2-in-1 Headphone & Microphone
* Kensington Lock
* UHS-50 Micro SD Cardreader
### Pricing & Availability
The base configuration which includes 8 GB Samsung 3200 MHz DDR 4 RAM and 250 GB NVMe SSD costs**1149 EUR or 1185 USD**. You can choose the flagship TUXEDO_OS 22.04 LTS, Ubuntu 22.04 LTS, Kubuntu 22.04 LTS, or Ubuntu Budgie 22.04 LTS as the operating system of your choice.
Shipping for orders starts on July 15, 2022. You can pre-order the laptop now.
You can check out the official website product page for more details.
[TUXEDO Pulse 15 Gen-2][5]
### Powerful Linux Laptop Lineup
The Tuxedo Pulse 15 specs indicate that it is a solid offering. Thus, developers and business users should not have any complaints regarding its performance.
Not to forget, we also had a recent launch of [HP Dev One][6], and a teaser for [StarFighter][7] with a 4K 10-bit IPS display by Star Labs.
Looks like youre in for a treat if you are saving up for a premium Linux-specific laptop.
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/tuxedo-pulse-gen-2/
作者:[Rishabh Moharir][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/rishabh/
[b]: https://github.com/lkxed
[1]: https://news.itsfoss.com/wp-content/uploads/2022/07/TUXEDO-Pulse-15-linux-laptop.jpg
[2]: https://news.itsfoss.com/wp-content/uploads/2022/07/1250-1100-max-1-1024x901.png
[3]: https://news.itsfoss.com/wp-content/uploads/2022/07/1600-1600-max-1-1024x1024.png
[4]: https://news.itsfoss.com/wp-content/uploads/2022/07/1600-1600-max-2.png
[5]: https://www.tuxedocomputers.com/en/Linux-Hardware/Notebooks/15-16-inch/TUXEDO-Pulse-15-Gen2.tuxedo
[6]: https://news.itsfoss.com/hp-dev-one-system76/
[7]: https://news.itsfoss.com/starfighter-laptop-reveal/

View File

@ -1,65 +0,0 @@
[#]: subject: "Do You Miss Firefox Send? Internxt Send is Ready as a Replacement"
[#]: via: "https://news.itsfoss.com/internxt-send/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Do You Miss Firefox Send? Internxt Send is Ready as a Replacement
======
A new offering by Internxt lets you send encrypted files to anyone quickly while retaining your privacy. We can only hope that it does not shut down like Firefox Send.
![internxt][1]
[Internxt][2] is a fairly new open-source encrypted cloud service that aims to replace the offerings by the big tech. For instance, you can use it as an alternative to Google Photos, and Drive.
You get 10 GB for free. So, you can sign up for it to test it out.
Recently, they have also added another product “Internxt Send”, as a replacement to fill the void for Firefox Send.
Unfortunately, Firefox Send was discontinued, but it was a good tool!
[Internxt Send][3] lets you send/share images, videos, documents, and other files securely, just like Firefox Send.
### Internxt Send: A Secure File Sharing Service
![][4]
While I couldnt find the repository on GitHub for Internxt Send, Ive asked them for clarification.
As one would expect, you can upload your files to Internxt Send without needing to create an account.
The file upload limit is 5 GB. And, you cannot increase the limit in any way.
You can choose to upload the files required and generate a link to share. Or, you can directly send an email to the recipient, where you would also need to share your email address.
![][5]
Interestingly, it also lets you add custom text to the email you send with the file uploaded.
Unlike Firefox Send, you cannot tweak the expiry for the link generated to share the file or set it to stop working after a number of downloads. The link expires in 15 days by default, and you cannot change that. So, that is a bummer.
But, if you were waiting for an encrypted service that lets you privately share files, this can be an alternative.
*It is good to have more Firefox Send alternatives I think! What are your thoughts on Internxt Send?*
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/internxt-send/
作者:[Ankush Das][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/ankush/
[b]: https://github.com/lkxed
[1]: https://news.itsfoss.com/wp-content/uploads/2022/07/internxt-send-ft-1.jpg
[2]: https://itsfoss.com/internxt-cloud-service/
[3]: https://send.internxt.com/
[4]: https://news.itsfoss.com/wp-content/uploads/2022/07/internxt-send-1024x640.png
[5]: https://news.itsfoss.com/wp-content/uploads/2022/07/internxt-send-screenshot-1024x782.png

View File

@ -0,0 +1,37 @@
[#]: subject: "Microsoft Postpones A Contentious Ban On Paid for Open Source And WebKit"
[#]: via: "https://www.opensourceforu.com/2022/07/microsoft-postpones-a-contentious-ban-on-paid-for-open-source-and-webkit/"
[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Microsoft Postpones A Contentious Ban On Paid for Open Source And WebKit
======
![microsoft][1]
On July 16, the Microsoft Store, an online store for Windows apps and other apps, was supposed to implement new policies prohibiting developers from selling open source apps that are otherwise free and from distributing browser apps that use Apples WebKit engine. However, Giorgio Sardo, general manager of the Microsoft Store, stated on Friday that Microsoft will postpone enforcement in response to the developer communitys criticism. The changes, which were announced last month, appear to be aimed at improving the Microsoft Store experience. They include, for example, a section prohibiting apps from disseminating misinformation if they “provide content related to information, news, or current events in the real world.”
However, the new rules restrict what developers can do with open source software. They forbid Microsoft Store apps from using Apples WebKit browser engine, for example. In fact, any web browser engine other than Chromium, Gecko, or EdgeHTML would be prohibited, so its not just WebKit thats forbidden. Apples Safari browser, which is based on WebKit, hasnt been officially supported for Windows since 2012. However, because WebKit is open source, an enterprising developer (or team of developers, because browsers are complicated) could presumably create a browser for Windows.
What makes this unusual is that Microsoft announced its Open App Store Principles in February to address regulatory concerns about competition stemming from its acquisition of Activision/Blizzard. The Windows behemoth did so fully aware of the global antitrust challenges to Apples App Store and Google Play. In fact, Microsoft has backed efforts to force its competitors to relax their own store policies. The App Store browser rule, which requires all iOS browser apps to be based on Apples WebKit engine rather than Googles open source Chromium/Blink or Mozillas open source Gecko engine, has been a major source of regulatory pushback against Apple.
The EUs Digital Markets Act and Digital Services Act aim to boost competition by removing Apples WebKit requirement. The UK Competition and Markets Authority, like the US National Telecommunications and Information Administration (NTIA), is considering a similar rule. As a result, Microsoft declares in Section 10.2.1: “Products that browse the web must use either the Chromium or the Gecko open source engine.” (The company is also making an exception for legacy apps in the Microsoft Store built with its discontinued EdgeHTML engine.)
Developers appear to be more concerned about Microsofts decision to restrict the sale of apps based on open source software. “Not attempt to profit from open source or other software that is otherwise generally available for free, nor be priced irrationally high relative to the features and functionality provided by your product,” says Section 10.8.7 of the revised policy. The policy change comes in the wake of Microsofts commercial release of GitHub Copilot, a subscription-based AI code suggestion tool trained on open source code. The Software Freedom Conservancy, an open source advocacy group, accused Microsoft last week of profiting from open source without clarifying whether Copilot complies with licencing terms and urged open source developers to abandon GitHub.
--------------------------------------------------------------------------------
via: https://www.opensourceforu.com/2022/07/microsoft-postpones-a-contentious-ban-on-paid-for-open-source-and-webkit/
作者:[Laveesh Kocher][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.opensourceforu.com/author/laveesh-kocher/
[b]: https://github.com/lkxed
[1]: https://www.opensourceforu.com/wp-content/uploads/2022/07/microsoft-e1657525936852.jpg

View File

@ -0,0 +1,88 @@
[#]: subject: "Nokia Targets An Amateur Linux Phone Project NOTKIA for a Name Change"
[#]: via: "https://news.itsfoss.com/nokia-notkia/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Nokia Targets An Amateur Linux Phone Project NOTKIA for a Name Change
======
An open-source project wants to bring you a Nokia-like Linux phone, but Nokia does not seem to like the projects name.
![nokia][1]
An open-source project that aims to make a classic Nokia like (small form factor) Linux phone has come under fire, by Nokia.
The projects name was originally “**Notkia**“, which Nokia finds similar while potentially affecting its brand reputation, and infringement of Nokias rights.
While it is okay to protect your business, what is it with these companies sending infringement notices to projects that arent even a threat to them at its current state?
### Notkia: Developing a Pocket-Sized Linux Phone
Thanks to the notice by Nokia, we get to know about an interesting collaborative effort to develop a small Linux phone for basic use, while keeping privacy in mind.
They aim to design a PCB that fits exactly in the classic Nokias phone shell.
![][2]
As of now, they have a decent amount of things working with the hardware that includes Bluetooth, and Wi-Fi.
It is not an Android-based operating system, rather it relies on Mainline Linux Kernel.
You can learn more about the project and the specifications for the planned phone in their [official blog post][3].
The project is waiting for fundraising, and will make early prototypes to available to be purchased separately.
### Inspired by Nokia, and Noticed by Nokia
Well, the project clearly states that they have been inspired by Nokias classic phones and they do not try to mislead any of their contributors and potential customers.
The projects creator shared the email by Nokia on Twitter, mentioning that Nokia should be more sensitive before sending such notices to projects that are led with community interests.
> After reading the email from [@Nokia][4] one more time, I started to feel angry. This nothing more than a staged accident. Since this is already a collaborative project and contributed by people around the world, I'm going to release the complete email to its "intended recipients".
>
> ![Twitter: @ReimuNotMoe][5]
[June 30, 2022][6]
**Also, they confirmed that the project will be changing its name.**
Of course, as an open-source project, it should not concern Nokia unless they start selling their prototypes/phones while using Nokias brand name.
But, at its current state, this is more of a passion project, and a collaborative effort by a community of open-source enthusiasts. So, it sounds a bit far-fetched to send a notice to them for infringing Nokias rights.
*Right?*
Of course, this is not surprising for companies, but for Nokia, it seems a bit too overly cautious and anti-competitive.
Especially, when it is safe to say that the company is not doing as good as youd expect with their latest smartphone releases.
Interestingly, theres also an [IT company][7] with the name “Notkia”, as spotted by a fellow Twitter user. Did they also receive a notice by Nokia? Who knows?
*What do you think about the open-source project for a pocket-sized phone powered by Linux?* *Share your thoughts in the comments down below.*
**Via**: [Vice][8]
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/nokia-notkia/
作者:[Ankush Das][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/ankush/
[b]: https://github.com/lkxed
[1]: https://news.itsfoss.com/wp-content/uploads/2022/07/nokia-targets-linux-phone-notkia.jpg
[2]: https://news.itsfoss.com/wp-content/uploads/2022/07/notkia-nokia-1024x766.jpg
[3]: https://hackaday.io/project/185645-notkia-name-change-planned
[4]: https://twitter.com/nokia?ref_src=twsrc%5Etfw
[5]: https://pbs.twimg.com/media/FWftWyjUYAA49ew?format=jpg&name=large
[6]: https://twitter.com/ReimuNotMoe/status/1542466662154108930?ref_src=twsrc%5Etfw
[7]: https://www.linkedin.com/company/notkia-it/
[8]: https://www.vice.com/en/article/93awjz/nokia-asks-open-source-notkia-phone-project-to-change-its-name

View File

@ -0,0 +1,83 @@
[#]: subject: "Cutefish OS Halts Development and Its Future is Uncertain"
[#]: via: "https://www.debugpoint.com/cutefish-os-development-halts/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Cutefish OS Halts Development and Its Future is Uncertain
======
The famous Cutefish OS, with its Cutefish Desktop development, apparently stopped, which is evident from the GitHub commit history.
### Cutefish OS Halts Development
A few months back, we [reviewed][1] the emerging Linux distribution Cutefish OS which comes with its own desktop environment (Cutefish DE). The look and feel, the way it was built from the ground up was perfect in terms of usability and customization options.
![Cutefish OS - Application Menu][2]
Cutefish OS is built primarily for the general users who want a stable Linux Operating system and looks like “macOS” out of the box. Hence the team designed the Cutefish Desktop Environment (DE) with a Global menu, bottom dock, top panel, icon and cursor themes and many such features to fulfil that goal.
You might think that almost all Linux desktop environments are customizable to look like “mac OS” with some effort. I agree. But that requires some knowledge about how to install a cursor theme, desktop theme, rounded corners, blur and so on. Almost all of these customization doesnt come by default.
Moreover, Cutefish OS also brings Debian and Ubuntu as its base, which is a perfect choice considering the average Linux users and their knowledge level.
With all the promises and some exciting BETA releases, the development seems now completely stalled. A quick walk on [GitHub][3] shows the activities are minimal in terms of feature additions.
Moreover, the official home page of Cutefish OS, i.e. cutefishos.com, is not reachable (timed-out).
![The activity in GitHub of Cutefish OS shows a straight line for a few months][4]
### Whats Next
In the discussion on [Reddit][5], one of the users pitched the idea of forking the OS. The idea is to carry on with the development. This is the main advantage of community-driven projects in the open-source world.
![File Manager Global menu in Top bar in Cutefish OS Desktop][6]
However, it is a fact that maintaining, developing and steering a Linux distribution is a massive effort by itself. And a single person cant make it a successful one. Hence, I believe a desktop environment fork is a rational choice rather than the entire operating system. A portable DE is easier to maintain and continues its development for a longer term.
However, as of writing this piece, no one has forked it yet. But I believe it will be soon.
### An OpenMandriva Fork?
On the other hand, it looks like the OpenMandriva project is already [continuing][7] with the development of the Cutefish DE (not the OS) for its own OS. For more details, visit the Matrix [discussion page][8].
Besides, its worth mentioning that Arch Linux already have the Cutefish desktop packages in the community repo. You can even [install it][9] as a standalone DE in Arch Linux with easy steps.
As you can see, it is easier to maintain the DE to continue its development because the structure is already out there.
![Cutefish Desktop in Arch Linux][10]
### Conclusion
I have tested and [reviewed hundreds of distros][11] for years, and Cutefish OS is the promising one with its stunning desktop environment. It was written from the ground up with QML and C++ and took advantage of KWin. It would have been an attractive desktop as a separate component and could have been another great option besides KDE Plasma or GNOME.
Many open-source projects are born and die every year, and its unfortunate to see the situation of Cutefish OS. I hope an official fork comes up soon, and we all can contribute to it. I think the best way forward is to fork only the Cutefish Desktop Environment and fine-tune the edge cases.
So, what do you think about the entire situation of Cutefish OS? Lets have a conversation in the comment box.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/cutefish-os-development-halts/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/cutefish-os-review-2021/
[2]: https://www.debugpoint.com/wp-content/uploads/2021/11/Cutefish-OS-Application-Menu-1024x582.jpg
[3]: https://github.com/cutefishos
[4]: https://www.debugpoint.com/wp-content/uploads/2022/07/The-activity-in-GitHub-of-Cutefish-OS-shows-a-straight-line-for-a-few-months.jpg
[5]: https://www.reddit.com/r/linux/comments/vwd0m8/i_am_about_to_fork_cutefishos_and_i_need_your_help/
[6]: https://www.debugpoint.com/wp-content/uploads/2021/11/File-Manager-Global-menu-in-Top-bar-in-Cutefish-OS-Desktop-1024x577.jpg
[7]: https://abf.openmandriva.org/platforms/cooker/products/43/product_build_lists/1162
[8]: https://matrix.to/#/#oma:matrix.org
[9]: https://www.debugpoint.com/cutefish-arch-linux-install/
[10]: https://www.debugpoint.com/wp-content/uploads/2022/02/Cutefish-Desktop-in-Arch-Linux.jpg
[11]: https://www.debugpoint.com/tag/linux-distro-review

View File

@ -0,0 +1,99 @@
[#]: subject: "eBook Manager Calibre 6.0 is Here With Full-Text Search and Other Improvements"
[#]: via: "https://news.itsfoss.com/calibre-6-release/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
eBook Manager Calibre 6.0 is Here With Full-Text Search and Other Improvements
======
A much-needed upgrade for Calibre has finally landed with improvements and changes. Try it out!
![calibre 6.0][1]
Calibre is a popular open-source eBook reader for Linux, macOS, and Windows. It is also available for the ARM platform (Linux).
It happens to be one of the [best eBook readers for Linux][2].
After a year and a half of development, a new major upgrade for Calibre has finally landed.
### Calibre 6.0: Whats New?
While it is a big deal to put an end to the 5.x series of updates, you do not get a big list of additions.
However, the release includes significant improvements and a few feature additions that I will be highlighting here.
#### Full-Text Search
![calibre 6.0][3]
With Calibre 6.0, you can search the entire text of all books in your library collection.
This should come in handy for users, who want to quickly search for something specific, even though they do not remember the name of a book.
It will help you find things quickly when you need them.
#### Support for ARM and Apple Silicon
Calibre 6.0 adds support for ARM64 on Linux and Apple Silicon.
It will no longer work with 32-bit systems, considering [Qt 6][4] does not support it.
#### Easy Dark Mode Switch & Icon Themes
![calibre 6.0][5]
You can now easily head to the preferences, and tweak the look/feel settings to toggle the dark mode.
A quick switch could have helped, but it should be good enough. By default, it respects the system preference, so it should not be an issue for most.
In addition to this, you also get to choose icon themes for your preferences.
#### Switch to Qt 6
You can expect some unmaintained third-party plugins to no longer work with Qt 6 on Calibre 6.0.
Essential plugins that have been ported to Qt 6 should work as you would expect.
### Other Changes
Along with all the upgrades, you get a few improvements and changes that include:
* No support for Windows 8.
* The Calibre:// URL scheme is more useful to create links and can be accessed from other programs.
* Improved “Read aloud” button to start reading the book text using OSs text-to-speech engine.
You can also check out its [official announcement][6] for more information.
### Download Calibre 6.0
Calibre 6.0 can be downloaded from its [GitHub releases section][7]. You have to download the archived package for Linux (ARM64/AMD64) and extract it to run the executable.
In either case, you can also install it using the Flatpak package from [Flathub][8].
[Calibre 6.0][9]
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/calibre-6-release/
作者:[Ankush Das][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/ankush/
[b]: https://github.com/lkxed
[1]: https://news.itsfoss.com/wp-content/uploads/2022/07/calibre-6-0-release.jpg
[2]: https://itsfoss.com/best-ebook-readers-linux/
[3]: https://news.itsfoss.com/wp-content/uploads/2022/07/calibre-6.png
[4]: https://news.itsfoss.com/qt-6-released/
[5]: https://news.itsfoss.com/wp-content/uploads/2022/07/calibre-dark-theme.jpg
[6]: https://calibre-ebook.com/new-in/fifteen
[7]: https://github.com/kovidgoyal/calibre/releases/tag/v6.0.0
[8]: https://flathub.org/apps/details/com.calibre_ebook.calibre
[9]: https://calibre-ebook.com/

View File

@ -1,85 +0,0 @@
[#]: subject: "Why use a Raspberry Pi to power your business"
[#]: via: "https://opensource.com/article/22/1/raspberry-pi-business"
[#]: author: "Giuseppe Cassibba https://opensource.com/users/peppe8o"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Why use a Raspberry Pi to power your business
======
Why small, single-board computers can be the future for smart working
and small offices.
![A chair in a field.][1]
With the pandemic changing the way we're working, job decentralization is becoming an important challenge for all companies.
### Smart offices
Even if every factory approached smart working only as remoting the employee notebook through a VPN, adding evolution brings some basic office services as nearest as possible to people. This could drastically reduce the datacenter's load and improve people's working experience. An additional effect is removing many single-point-of-failures from information and communications technology (ICT) in this scenario.
Instead of hundreds or thousands of workplaces outside the company, it's like having hundreds or thousands of small offices/branches around the world. It's what one might call **smart offices**.
This statement may frighten many ICT experts because of the culture, which associates a big machine (server) to each office, even if the advantages of spreading computing resources are clear.
### A different perspective
What if you could deliver the services of a big server from a tiny US$ 50 board? What if this tiny board requires only an SD card and an ordinary USB power supply? Here's where the [Raspberry Pi][2] is the most flexible solution.
Raspberry Pi computer boards are very small form factor computers running Linux. They have an OS delivered and maintained from Raspberry Pi Foundation—the Raspberry Pi OS. Based on Debian, it shares many software packages with the most known Linux distributions. Moreover, many Raspberry Pi boards can flawlessly run the most famous Ubuntu server. They include ARM processors, which grant low energy consumption.
**[ Read next: [7 ways to use Raspberry Pi in enterprise IT][3] ]**
But Raspberry Pi computer boards are a great opportunity also for small companies, bringing tons of (open source) services at affordable costs. Here, you have to consider data loss risks, as you have all your services in small consumer-grade hardware. But setting up the right backup/restore procedures can reduce these risks.
### What services can you provide from a Raspberry Pi board?
Most services usually get delivered from more expensive servers. The "most" attribute depends on some restrictions:
* **ARM processor:** Some packages are available only for X86/X64 processors. This is one of the hardest challenges to overcome. On the other hand, the increasing market share for ARM processors keeps programmers having ARM-compatible versions of their software.
* **RAM amount:** This is a problem limited to some complex applications running complex calculations in a sophisticated manner. Many times, it's just a matter of revisiting the code, splitting steps, and keeping it simple and efficient. Moreover, if a service requires a lot of RAM/CPU for a few users, this may also mean that the service is not working correctly, and it could be an opportunity for you to remove old problems that are wasting resources. Finally, the latest Raspberry Pi computer boards upgraded the RAM amount up to 8GB, which is a lot.
* **Users who are inexperienced with servers:** This is another problem you can approach with base images inside the micro-SD cards on which Raspberry Pi stores the OS and running data.
That said, you can do many interesting things with a Raspberry Pi. In [my blog][4], I've tested this by running all kinds of services—from a basic LAMP server to a complex CRM. Passing through some complex systems, all open source, like:
* Proxy server (also capable to add ad-blocker services)
* Email server
* Printing server
* [Hotel management][5]
* Contact relations management
* [Private social network][6]
* Private forum
* Private Git web portal
* Network monitoring server
* [And many other useful services][7]
Another interesting opportunity for Raspberry Pi in your remote office is to get a WiFi hotspot offering advanced services and control from its Ethernet port. 
Finally, [Raspberry Pi can also run containers][8], an additional tool to get a world of services available from this incredible board.
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/1/raspberry-pi-business
作者:[Giuseppe Cassibba][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/peppe8o
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BIZ_WorkInPublic_4618517_1110_CS_A.png?itok=RwVrWArk (A chair in a field.)
[2]: https://opensource.com/resources/raspberry-pi
[3]: https://enterprisersproject.com/article/2020/11/raspberry-pi-7-enterprise-it-uses
[4]: https://peppe8o.com
[5]: https://opensource.com/article/20/4/qloapps-raspberry-pi
[6]: https://opensource.com/article/20/3/raspberry-pi-open-source-social
[7]: https://peppe8o.com/category/raspberrypi/
[8]: https://opensource.com/article/20/8/kubernetes-raspberry-pi

View File

@ -66,7 +66,7 @@ via: https://opensource.com/article/22/7/meet-fsf-executive-director-zoe-kooyman
作者:[Seth Kenlon][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
译者:[Peaksol](https://github.com/TravinDreek)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,89 @@
[#]: subject: "Why Agile coaches need internal cooperation"
[#]: via: "https://opensource.com/article/22/7/agile-coach-internal-cooperation"
[#]: author: "Kelsea Zhang https://opensource.com/users/kelsea-zhang"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Why Agile coaches need internal cooperation
======
An Agile coach is only as successful as their Agile partner. Here's how to foster internal cooperation and create an Agile team.
![Working meetings can be effective meetings][1]
Image by Mapbox Uncharted ERG, [CC-BY 3.0 US][2]
If you're an Agile coach, you probably seek to inspire and empower others as an external member of your team or department. However, many Agile coaches overlook the importance of internal cooperation. That's not necessarily a term you are familiar with, so allow me to explain.
### What is internal cooperation?
As an Agile coach, you don't work alone. You try to find a partner in the team you're taking care of. This partner is expected to:
* Undertake all or most of the Agile transformation in the future.
* Find all possible opportunities for systematic improvement and team optimization.
* Be self-motivated.
* Not be managed by you; you delegate your enthusiasm and vision to them.
Of course, maybe you don't need such a person because, theoretically speaking, everyone in the team is your ideal candidate, and everyone is self-driven. Or maybe your whole team will magically become what you want it to be overnight.
Reality check: most of the time, you need a partner, an inside agent. Somebody to keep the spirit of Agile alive, whether you're there to encourage it or not.
### Internal cooperation is required
Getting buy-in from the team you are coaching isn't a luxury; it's a requirement. If you're the only Agile practitioner on your team, then your team isn't Agile! So how do you cultivate this internal cooperation?
#### Clarify responsibility
Being Agile is supposed to be a team effort. The beneficiary is the team itself, but the team must also bear the burden of transformation. An Agile coach is meant to be inspiring and empowering, but the change doesn't happen in just one person. That's why teams must learn to consider and solve problems on their own. A team must have its own *engine* (your Agile partner is such an engine) rather than relying on the external force of the Agile coach. It's the engines that want to solve problems, and with the help of Agile coaches, their abilities and ways of thinking can be enriched and improved.
It's best to have an engine from the beginning, but that's not always possible. The earlier, the better, so look for allies from the start.
#### Know the team
When you find a partner, you gain someone who understands the team's situation better than you do. A good partner knows the team from the inside and communicates with it on a level you cannot. No matter how good you are as an Agile coach, you must recognize that an excellent Agile partner has a unique advantage in "localization."
The best approach is not *An Agile coach makes a customized implementation plan for the team, and then the team is responsible for execution*. In my opinion, with the support of the Agile coach, the Agile partner should work with the team to make plans that best fit its needs. Next, try to implement those plans with frequent feedback and keep adjusting them as needed.
You continue to observe progress, whether the team members falter in Agile principles, and give them support at the right moments. Of course, when there's something wrong, you often want to stay silent, let the team hit a wall, and learn from their setbacks. Other times, stepping in to provide guidance is the right thing.
### Is an Agile coach still necessary?
In a word: Absolutely!
Agile is a team effort. Everyone must collaborate to find processes that work. Solutions are often sparked by the collision of ideas between the Agile coach and the partner. Then the partner can accurately get how an Agile theory is applied in the daily work. The partner understands the essence of Agile theories through the solutions.
As an Agile coach, you must have a solid theoretical foundation and the ability to apply that theory to specific scenarios. On the surface, you take charge of the theory while your Agile partner is responsible for the practice. However, an Agile coach must not be an armchair strategist, and teams aren't supposed to assume that the Agile coach is a theorist. In fact, an Agile coach must consciously let go of the practice part so the Agile partner can take over.
The significance of accompanying a team is not supposed to be pushing the team to move passively toward the Agile coach's vision. The amount of guidance required from you will fluctuate over time, but it shouldn't and can't last forever.
### Find an Agile partner
How do you find your Agile partner? First of all, observe the team you are coaching and notice anyone who is in charge of continuous improvement, whether it's their defined job role or not. That person is your Agile partner.
If there's nobody like that yet, you must cultivate one. Be sure to choose someone with a good sense of project management. I have observed that team leaders or project managers who perform well in the traditional development model may not be good candidates in the Agile environment. In an Agile management model, you must have an open mind, a sense of continuous pursuit of excellence, a flexible approach, extensive knowledge, and strong self-motivation.
### Be Agile together
Don't be shy about bringing on a partner to help you with your work and communication. Instead, find willing partners, and work together to make your organization an Agile one.
*[This article is translated from Xu Dongwei's Blog and is republished with permission.][4]*
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/7/agile-coach-internal-cooperation
作者:[Kelsea Zhang][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/kelsea-zhang
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/leader-team-laptops-conference-meeting.png
[2]: https://creativecommons.org/licenses/by/3.0/us/
[3]: https://enterprisersproject.com/article/2022/2/agile-adoption-6-steps-IT-leaders?intcmp=7013a000002qLH8AAM
[4]: https://mp.weixin.qq.com/s/OQUAY6JkpTEgnev_EgZdZA

View File

@ -2,7 +2,7 @@
[#]: via: "https://itsfoss.com/firefox-containers/"
[#]: author: "Hunter Wittenborn https://itsfoss.com/author/hunter/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: translator: "hanszhao80"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
@ -108,7 +108,7 @@ via: https://itsfoss.com/firefox-containers/
作者:[Hunter Wittenborn][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
译者:[hanszhao80](https://github.com/hanszhao80)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,268 +0,0 @@
[#]: subject: "Beginners Guide to Installing Arch Linux on VirtualBox"
[#]: via: "https://itsfoss.com/install-arch-linux-virtualbox/"
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: "hanszhao80"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Beginners Guide to Installing Arch Linux on VirtualBox
======
[Arch Linux is hugely popular][1] in the desktop Linux world. One of the reasons for the popularity is that [installing Arch Linux][2] itself is a complicated task.
I am not exaggerating. Installing [Ubuntu or Debian][3] is a lot easier task than Arch Linux because it doesnt have an official GUI based installer. And this is where virtual machines come in.
You can try installing Arch Linux in VirtualBox first and see if its something you would like to run on actual hardware. This way, you get to experience Arch Linux without disturbing your current operating system.
In this article, I will be guiding you through the steps to install a functional Arch Linux virtual machine.
### Installing Arch Linux on VirtualBox
Undoubtedly, you need to first [install VirtualBox on Linux][4] or Windows. On Windows, simply go to the Oracles website and download VirtualBox.
[Download VirtualBox][5]
If you are using Windows 10 or newer version, please ensure that you have virtualization enabled on your system.
Once done, you need to head to [Arch Linuxs official website][6] to download the ISO file. You should find options to [download using torrent][7] or download the file directly.
![][8]
Hold on to the ISO file when needed, you can delete it to [free space on your system][9] after successful installation.
Now, let us begin installing Arch Linux on VirtualBox.
#### Part 1. Creating the Virtual Machine
**Step 1:** First, you need to set up a few things in VirtualBox. Launch VirtualBox and click on “**New**” to create a virtual machine.
![][10]
Note that you can continue creating the virtual machine using the guided mode, but you get more options at a single glance with the expert mode.
![][11]
Hence, I recommend using the expert mode to create the virtual machine.
Fret not, the expert mode is as easy, with just a bit of extra available options and nothing else to worry about.
**Step 2**: Enter the name of your virtual machine, it should auto-detect the “Type” and “Version” respectively when you type in “**Arch Linux**” in the name field.
![][12]
You should increase the memory size to use the virtual machine comfortably. If it is just for minor testing, you can go ahead with the default setting.
In my case, I allocate ~**4 GB of RAM**.
Also, make sure to **create a virtual hard disk** under the “Hard disk” option. It should be the selected option by default.
Now, proceed to set the virtual hard disk size.
**Step 3:** You can choose a preferred location path for the virtual hard disk and tweak the size as per your requirements. The installation should not be a problem with the minimum allocated size (8 GB), but to be on the safe side, you may want to allocate at least 10-15 GB.
![][13]
Next, you need to select the hard disk file type as “**VDI (VirtualBox Disk Image)**” and the storage as “**Dynamically allocated**,” as shown in the image above.
VDI is the most common hard disk type for the virtual hard disk.
And, when you select the “**Dynamically allocated**” option for the hard disk storage, it means that the storage space will be utilized as per usage. In other words, 15 GB of space wont be locked from your disk as soon as the virtual machine is created.
Now, all you have to do is hit “**Create**” to add the virtual machine.
#### Part 2. Adding the ISO File to Start Installing Arch Linux
![][14]
Once the VM has been listed, you can look at its configuration and select the ISO as the disk drive under the **Storage** option.
You can also separately head to the virtual machine settings to explore more and choose the ISO file.
![][15]
To do that, navigate your way to the “**Storage**” setting of the VM.
![][16]
Here, you will have to click on the “**Empty**” device under Controller and then proceed to select the Arch Linux ISO file as the disk file (as shown in the image above).
![][17]
Once you select it, hit “**OK**” to save the changes to your setting.
Heres how the virtual machine setting should look like with the ISO set as the disk to boot:
![][18]
Now, hit “**Start**” to start the VM and get started with the installation.
#### Part 3. Installing Arch Linux using the Guided Installer
Arch Linux has made the installation easier by [introducing a guided installer][19], i.e., it gives you all the options you need to set up a full-fledged Arch Linux system.
So, with the help of a guided installer, you do not have to install a desktop environment and other essential packages yourself separately. All you have to do is follow the onscreen instructions and choose the options suitable for your installation.
In this article, we focus on the guided installer. If you want to do things yourself, you should follow our [Arch installation guide][2].
Moving on to the installation, when you start the VM, you will be looking at this screen:
![][20]
The first option is the ideal way of proceeding. If you have a specific requirement, you can choose other options to boot up Arch Linux.
Now, you should be looking at a terminal window. Heres how to get started:
**Step 1**: Type in “**archinstall**” to initiate installation using the guided installer.
![][21]
**Step 2:** Choose a keyboard layout as per your requirements, selecting a US layout should be the most common choice. Just type in a number to make the selection, as shown in the image below (for instance, 26).
![][22]
**Step 3:** Next, you need to select a region to download packages.
![][23]
Choosing a preferred region instead of “Worldwide” is crucial because it downloads many unnecessary packages if you select “**Worldwide**” as your region.
**Step 4:** Once you select the region, it will ask you to choose the drive for installation. In this case, we already created a virtual drive of ~15 GB displayed as **/dev/sda**.
Similarly, check for the drive you created as per the size and choose that disk to proceed. Here, I type in **1** as the input; yours can differ.
![][24]
**Step 5:** For the next set of steps, you will be asked the following:
* **Select a filesystem type**
* **Encryption password** (optional)
* **Hostname**
* **Create root password** (optional)
* **Creating a super-user**
* **Choose a pre-programmed profile**
![][25]
In my test, I chose BTRFS as the filesystem without setting any disk encryption password.
The hostname can be anything of your choice, but Id suggest keeping it short.
You may choose to create a root password, but it shouldnt be an issue if you do not. However, you need to create a superuser with Sudo privileges.
I used “**admin**” and “**pass**” as the user and the password, respectively. But, you should not use easy-to-guess credentials if you do not want anyone else to access the VM on your computer.
And, then, you will be shown a choice to select a profile. In this case, we want a full-fledged Arch Linux desktop. So, we choose “**desktop**” by typing in **0**.
**Step 6:** Next, you will be asked to choose a desktop environment. I decided to proceed with KDE. You can select anything else you like.
![][26]
**Step 7**: To finalize, you will be asked to choose the graphics card driver. Here, we install Arch Linux on VirtualBox, so you can select option 4 as “**VMware/VirtualBox**,” as shown in the image below.
![][27]
You may also be asked to choose pipewire instead of PulseAudio for audio with a “Yes (y) or No (no)” response. Any of those should serve the purpose.
****Step 8:**** Next comes an important step. Here, you can choose to go with **linux-lts** if you need the LTS version of the kernel, or else proceed with the default.
![][28]
The installer will prompt you to explicitly install any packages required. In this case, we do not have any specific requirements, so we will leave it blank and press enter to skip.
**Step 9:** To enable internet access, you will be asked to select the required network adapter. You will have to choose the option:
**Use network manager to control and manage your internet connection**
![][29]
**Step 10:** The timezone needs to be defined in the next step. Choose what applies to you, or continue with the default option.
**Step 11:** Once done, it will display most of the options you selected as confirmation. Press **Enter** to continue.
![][30]
**Step 12:** It will take a few minutes for the installation to complete, depending on your internet connection speed.
After the installation is complete, it will ask you to **chroot into a newly created installation for post-installation configuration**, but we dont need that. So, type in “**N**” to complete the installation.
**Step 13:** Finally, you should see the terminal window again. Type in:
```
shutdown now
```
This will safely exit the installation and close the virtual machine.
Its all set! Before starting the virtual machine with Arch installed, you need to do one more thing **remove the ISO disk selected as the optical drive**. Similar to how you added the ISO to boot from, you can head to the virtual machine settings and remove it as shown below:
![][31]
Thats it! You are done installing Arch Linux on VirtualBox.
All you have to do is start the virtual machine, and heres how it looks in my case:
![virtualbox arch][32]
Even though it takes a bit of time to go through the options, the new guided installer on Arch Linux saves a lot of time to get the essentials right.
![][33]
The same set of steps apply for installing Arch Linux on your computer. You need to [make a separate bootable USB drive using Etcher][34] with the Arch Linux ISO file.
### Wrapping Up
[Arch Linux is a popular choice][1] for a variety of reasons. However, if it is your first time installing, or if you want to test it out, a virtual machine is the best way to experience it without disrupting your host computer.
I hope this helps you install Arch Linux on VirtualBox. Let me know your thoughts in the comments down below.
--------------------------------------------------------------------------------
via: https://itsfoss.com/install-arch-linux-virtualbox/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[hanszhao80](https://github.com/hanszhao80)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/why-arch-linux/
[2]: https://itsfoss.com/install-arch-linux/
[3]: https://itsfoss.com/debian-vs-ubuntu/
[4]: https://itsfoss.com/install-virtualbox-ubuntu/
[5]: https://www.virtualbox.org/wiki/Downloads
[6]: https://archlinux.org/download/
[7]: https://itsfoss.com/best-torrent-ubuntu/
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/archlinux-downloads.png?resize=800%2C419&ssl=1
[9]: https://itsfoss.com/free-up-space-ubuntu-linux/
[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-new.png?resize=800%2C562&ssl=1
[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-expert-mode.png?resize=707%2C438&ssl=1
[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-create.png?resize=800%2C536&ssl=1
[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-disk.png?resize=800%2C528&ssl=1
[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/choose-disk-virtualbox-arch.png?resize=800%2C440&ssl=1
[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-settings-option.png?resize=800%2C551&ssl=1
[16]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-choose-iso.png?resize=800%2C314&ssl=1
[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-arch-iso-select.png?resize=800%2C348&ssl=1
[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-set-start.png?resize=800%2C548&ssl=1
[19]: https://news.itsfoss.com/arch-linux-easy-install/
[20]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-archlinux-boot.png?resize=800%2C593&ssl=1
[21]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/vb-archinstall-guided.png?resize=800%2C400&ssl=1
[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/vb-archinstall-kb-layout.png?resize=800%2C694&ssl=1
[23]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/archinstall-region.png?resize=800%2C664&ssl=1
[24]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/archinstall-selectdisk.png?resize=800%2C199&ssl=1
[25]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/archinstall-desktop-configure.png?resize=800%2C497&ssl=1
[26]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/archinstall-virtualbox-desktop-environment.png?resize=800%2C415&ssl=1
[27]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-environment.png?resize=419%2C173&ssl=1
[28]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/archinstall-linux-kernel.png?resize=800%2C692&ssl=1
[29]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-arch-network-manager.png?resize=800%2C151&ssl=1
[30]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/archinstall-confirmation.png?resize=800%2C697&ssl=1
[31]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/iso-remove-archinstall.png?resize=800%2C286&ssl=1
[32]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-arch.png?resize=800%2C635&ssl=1
[33]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/kde-arch-virtualbox.png?resize=800%2C453&ssl=1
[34]: https://itsfoss.com/install-etcher-linux/

View File

@ -2,7 +2,7 @@
[#]: via: "https://opensource.com/article/21/11/observability-python"
[#]: author: "Moshe Zadka https://opensource.com/users/moshez"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: translator: "MCGA"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "

View File

@ -1,311 +0,0 @@
[#]: subject: "Plotting Data in R: Graphs"
[#]: via: "https://www.opensourceforu.com/2022/05/plotting-data-in-r-graphs/"
[#]: author: "Shakthi Kannan https://www.opensourceforu.com/author/shakthi-kannan/"
[#]: collector: "lkxed"
[#]: translator: "tanloong"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Plotting Data in R: Graphs
======
R has a number of packages for plotting graphs and data visualisation, such as graphics, lattice, and ggplot2. In this ninth article in the R series, we shall explore the various functions to plot data in R.
![business-man-visulising-graphs][1]
We will be using R version 4.1.2 installed on Parabola GNU/Linux-libre (x86-64) for the code snippets.
```
$ R --version
R version 4.1.2 (2021-11-01) -- “Bird Hippie”
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
```
R is free software and comes with absolutely no warranty. You are welcome to redistribute it under the terms of the GNU General Public License versions 2 or 3. For more information about these matters, see *https://www.gnu.org/licenses/.*
### Plot
Consider the all-India consumer price index (CPI rural/urban) data set up to November 2021 available at *https://data.gov.in/catalog/all-india-consumer-price-index-ruralurban-0* for the different states in India. We can read the data from the downloaded file using the read.csv function, as shown below:
```
> cpi <- read.csv(file=”CPI.csv”, sep=”,”)
> head(cpi)
Sector Year Name Andhra.Pradesh Arunachal.Pradesh Assam Bihar
1 Rural 2011 January 104 NA 104 NA
2 Urban 2011 January 103 NA 103 NA
3 Rural+Urban 2011 January 103 NA 104 NA
4 Rural 2011 February 107 NA 105 NA
5 Urban 2011 February 106 NA 106 NA
6 Rural+Urban 2011 February 105 NA 105 NA
Chattisgarh Delhi Goa Gujarat Haryana Himachal.Pradesh Jharkhand Karnataka
1 105 NA 103 104 104 104 105 104
2 104 NA 103 104 104 103 104 104
3 104 NA 103 104 104 103 105 104
4 107 NA 105 106 106 105 107 106
5 106 NA 105 107 107 105 107 108
6 105 NA 104 105 106 104 106 106
...
```
Let us aggregate the CPI values per year for the state of Punjab, and plot a line chart using the plot function, as follows:
```
> punjab <- aggregate(x=cpi$Punjab, by=list(cpi$Year), FUN=sum)
> head(punjab)
Group.1 x
1 2011 3881.76
2 2012 4183.30
3 2013 4368.40
4 2014 4455.50
5 2015 4584.30
6 2016 4715.80
> plot(punjab$Group.1, punjab$x, type=”l”, main=”Punjab Consumer Price Index upto November 2021”, xlab=”Year”, ylab=”Consumer Price Index”)
```
The following arguments are supported by the plot function:
| Argument | Description |
| :- | :- |
| x | A vector for the x-axis |
| y | The vector or list in the y-axis |
| type | p for points, l for lines, o for overplotted plots and lines, s for stair steps, h for histogram |
| xlim | The x limits of the plot |
| ylim | The y limits of the plot |
| main | The title of the plot |
| sub | The subtitle of the plot |
| xlab | The label for the x-axis |
| ylab | The label for the y-axis |
| axes | Logical value to draw the axes |
The line chart is shown in Figure 1.
![Figure 1: Line chart][2]
The autocorrelation plot can be used to obtain correlation statistics for time series analysis, and the same can be generated using the acf function in R. You can specify the following autocorrelation types: *correlation, covariance*, or partial. Figure 2 shows the ACF chart that represents the CPI values (x in the chart) for the state of Punjab.
![Figure 2: ACF chart][3]
The function*acf* accepts the following arguments:
| Argument | Description |
| :- | :- |
| x | A univariate or multivariate object or vector or matrix |
| lag.max | The maximum lag to calculate the acf |
| type | Supported values correlation, covariance, partial |
| plot | The acf is plotted if this value is TRUE |
| i | A set of time difference lags to retain |
| j | A collection of names or numbers to retain |
### Bar chart
The barplot function is used to draw a bar chart. The chart for Punjabs CPI can be generated as follows, and is shown in Figure 3:
![Figure 3: Line chart of Punjabs CPI][4]
```
> barplot(punjab$x, main=”Punjab Consumer Price Index”, sub=”Upto November 2021”, xlab=”Year”, ylab=”Consumer Price Index”, col=”navy”)
```
The function is quite flexible and supports the following arguments:
| Argument | Description |
| :- | :- |
| height | A numeric vector or matrix that contains the values |
| width | A numeric vector that specifies the widths of the bars |
| space | The amount of space between bars |
| beside | A logical value to specify if the bars should be stacked or next to each other |
| density | A numerical value that specifies the density of the shading lines |
| angle | The angle used to shade the lines |
| border | The colour of the border |
| main | The title of the chart |
| sub | The sub-title of the chart |
| xlab | The label for the x-axis |
| ylab | The label for the y-axis |
| xlim | The limits for the x-axis |
| ylim | The limits for the y-axis |
| axes | A value that specifies whether the axes should be drawn |
You can get more details on the barplot function using the help command, as shown below:
```
> help(barplot)
acf package:stats R Documentation
Auto- and Cross- Covariance and -Correlation Function Estimation
Description:
The function acf computes (and by default plots) estimates of
the autocovariance or autocorrelation function. Function pacf
is the function used for the partial autocorrelations. Function
ccf computes the cross-correlation or cross-covariance of two
univariate series.
Usage:
acf(x, lag.max = NULL,
type = c(“correlation”, “covariance”, “partial”),
plot = TRUE, na.action = na.fail, demean = TRUE, ...)
pacf(x, lag.max, plot, na.action, ...)
## Default S3 method:
pacf(x, lag.max = NULL, plot = TRUE, na.action = na.fail,
...)
ccf(x, y, lag.max = NULL, type = c(“correlation”, “covariance”),
plot = TRUE, na.action = na.fail, ...)
## S3 method for class acf
x[i, j]
```
### Pie chart
Pie charts need to be used wisely, as they may not actually show relative differences among the slices. We can generate the Rural, Urban, and Rural+Urban values for the month of January 2021 for Gujarat as follows, using the subset function:
```
> jan2021 <- subset(cpi, Name==”January” & Year==”2021”)
> jan2021$Gujarat
[1] 153.9 151.2 149.1
> names <- c(Rural, Urban, Rural+Urban)
```
![Figure 4: Pie chart][5]
The pie function can be used to generate the actual pie chart for the state of Gujarat, as shown below:
```
> pie(jan2021$Gujarat, names, main=”Gujarat CPI Rural and Urban Pie Chart”)
```
The following arguments are supported by the pie function:
| Argument | Description |
| :- | :- |
| x | Positive numeric values to be plotted |
| label | A vector of character strings for the labels |
| radius | The size of the pie |
| clockwise | A value to indicate if the pie should be drawn clockwise or counter-clockwise |
| density | A value for the density of shading lines per inch |
| angle | The angle that specifies the slope of the shading lines in degrees |
| col | A numeric vector of colours to be used |
| lty | The line type for each slice |
| main | The title of the chart |
### Boxplot
A boxplot shows the interquartile range between the 25th and 75th percentile using two whiskers for the distribution of a variable. The values outside the range are plotted separately. The boxplot functions take the following arguments:
| Argument | Description |
| :- | :- |
| data | A data frame or list that is defined |
| x | A vector that contains the values to plot |
| width | The width of the boxes to be plotted |
| outline | A logical value indicating whether to draw the outliers |
| names | The names of the labels for each box plot |
| border | The colour to use for the outline of each box plot |
| range | A maximum numerical amount the whiskers should extend from the boxes |
| plot | The boxes are plotted if this value is TRUE |
| horizontal | A logical value to indicate if the boxes should be drawn horizontally |
The boxplot for a few states from the CPI data is shown below:
```
> names <- c (Andaman and Nicobar, Lakshadweep, Delhi, Goa, Gujarat, Bihar)
> boxplot(cpi$Andaman.and.Nicobar, cpi$Lakshadweep, cpi$Delhi, cpi$Goa, cpi$Gujarat, cpi$Bihar, names=names)
```
![Figure 5: Box plot][6]
![Figure 6: Q-Q plot][7]
### Q-Q plot
The Quantile-Quantile (Q-Q) plot is a way to compare two data sets. You can also compare a data set with a theoretical distribution. The qqnorm function is a generic function, and we can view the Q-Q plot for the Punjab CPI data as shown below:
```
> qqnorm(punjab$x)
```
![Figure 7: Volcano][8]
The*qqline* function adds a theoretical line to a normal, quantile-quantile plot. The following arguments are accepted by these functions:
| Argument | Description |
| :- | :- |
| x | The first data sample |
| y | The second data sample |
| datax | A logical value indicating if values should be on the x-axis |
| probs | A numerical vector representing probabilities |
| xlab | The label for x-axis |
| ylab | The label for y-axis |
| qtype | The type of quantile computation |
### Contour plot
The contour function is useful for plotting three-dimensional data. You can generate a new contour plot, or add contour lines to an existing chart. These are commonly used along with image charts. The volcano data set in R provides information on the Maunga Whau (Mt Eden) volcanic field, and the same can be visualised with the contour function as follows:
```
> contour(volcano)
```
The contour function accepts the following arguments:
| Argument | Description |
| :- | :- |
| x,y | The location of the grid for z |
| z | A numeric vector to be plotted |
| nlevels | The number of contour levels |
| labels | A vector of labels for the contour lines |
| xlim | The x limits for the plot |
| ylim | The y limits for the plot |
| zlim | The z limits for the plot |
| axes | A value to indicate to print the axes |
| col | The colour for the contour lines |
| lty | The line type to draw |
| lwd | Width for the lines |
| vfont | The font for the labels |
The areas between the contour lines can be filled using a solid colour to indicate the levels, as shown below:
```
> filled.contour(volcano, asp = 1)
```
The same volcano data set with the filled.contour colours is illustrated in Figure 8.
![Figure 8: Filled volcano][9]
You are encouraged to explore the other functions and charts in the graphics package in R.
--------------------------------------------------------------------------------
via: https://www.opensourceforu.com/2022/05/plotting-data-in-r-graphs/
作者:[Shakthi Kannan][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.opensourceforu.com/author/shakthi-kannan/
[b]: https://github.com/lkxed
[1]: https://www.opensourceforu.com/wp-content/uploads/2022/04/business-man-visulising-graphs.jpg
[2]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-1-Line-chart.jpg
[3]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-2-ACF-chart.jpg
[4]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-3-Line-chart-of-Punjabs-CPI.jpg
[5]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-4-Pie-chart.jpg
[6]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-5-ox-plot.jpg
[7]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-6-Q-Q-plot.jpg
[8]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-7-Volcano.jpg
[9]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-8-Filled-volcano.jpg

View File

@ -1,749 +0,0 @@
[#]: subject: "Docker Commands Tutorial | Getting Started With Docker In Linux"
[#]: via: "https://ostechnix.com/getting-started-with-docker/"
[#]: author: "sk https://ostechnix.com/author/sk/"
[#]: collector: "lkxed"
[#]: translator: "MCGA"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Docker Commands Tutorial | Getting Started With Docker In Linux
======
Essential Docker Commands For beginners
This detailed Docker tutorial covers the essential **Docker commands**, such as how to create a new container, run the container, remove a container and so on. In addition, this guide also explains how to build your own custom Docker image from an existing container and how to remove containers and images. Without further ado, let us **get started with Docker basics usage**!
### Docker Installation Steps
Docker can be installed in most modern Linux operating systems. If you haven't installed Docker yet, refer the following guides:
* [Install Docker Engine And Docker Compose In AlmaLinux, CentOS, Rocky Linux][1]
* [How to Install Docker And Docker Compose In Ubuntu][2]
### What Is Docker Image And Docker Container?
Before getting started with Docker, let me clarify what is a **Docker image** and a **Docker Container**.
A Docker Image is the file that decides how a Container should behave, and Docker Container is the running or stopped stage of a Docker image.
The containers are isolated from the rest of host's files.
When we run a Docker container, it uses an isolated filesystem which provided by a Docker image. The Docker image consists of everything needed to run an application - all dependencies, configuration, scripts, binaries, etc.
The image also contains other configuration for the container, such as environment variables, a default command to run, and other metadata.
### Getting Started With Docker In Linux
All steps given below are tested in Ubuntu 22.04, 20.04 and 18.04 LTS server edition. However, the steps provided in the subsequent sections are common to all Linux platforms. For example, you can run the same commands in a RHEL-based system(E.g. AlmaLinux) too.
#### 1. Search Docker Images
We can get the images from either from the official docker library called [Docker hub][3], or create our own.
For those wondering, Docker hub is an online central repository where all Docker users build, test, and save their Docker images. Docker hub has tens of thousands of Docker images and the number of images is growing everyday.
You can search for the any Docker images with **"docker search"** command from command line.
For instance, to search for docker images based on **Alpine** Linux, run:
```
$ sudo docker search alpine
```
**Sample Output:**
![Search Docker Images][4]
To search images based on **Ubuntu**, run:
```
$ sudo docker search ubuntu
```
You can even search images for any application, for example **Nginx**, like below:
```
$ sudo docker search nginx
```
Docker hub has a wide range of images. Be it an operating system, application, or combination of multiple applications (E.g. LAMP stack), you will find pre-built Docker images for everything in Docker hub.
If something you're looking for is not available, you can build it and make it available for public via Docker hub or keep it private for your own use.
#### 2. Download Docker Images
To download Docker image for Ubuntu OS, run the following command from the Terminal:
```
$ sudo docker pull ubuntu
```
The above command will download the latest Ubuntu image from the **Docker hub**.
**Sample Output:**
```
Using default tag: latest
latest: Pulling from library/ubuntu
405f018f9d1d: Pull complete
Digest: sha256:b6b83d3c331794420340093eb706a6f152d9c1fa51b262d9bf34594887c2c7ac
Status: Downloaded newer image for ubuntu:latest
docker.io/library/ubuntu:latest
```
You can also download a specific version of Ubuntu image using command:
```
$ sudo docker pull ubuntu:20.04
```
Docker allows us to download any images and start the container based on that image regardless of the host OS.
For example, to download Alpine OS image, run:
```
$ sudo docker pull alpine
```
![Download Docker Images][5]
#### 3. List Docker Images
All downloaded Docker images will be saved in **/var/lib/docker/** directory.
To view the list of downloaded Docker images, run:
```
$ sudo docker images
```
**Sample Output:**
```
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest 27941809078c 3 weeks ago 77.8MB
ubuntu 20.04 20fffa419e3a 3 weeks ago 72.8MB
alpine latest e66264b98777 5 weeks ago 5.52MB
```
![List Docker Images][6]
As you see above, I have downloaded three Docker images - **Ubuntu** **latest**, **Ubuntu 20.04** and **Alpine Linux**.
Now, let us go ahead and see how to start or run the containers based on the downloaded images.
#### 4. Run Docker Containers
We can start a container in two ways - either using its Docker **Image** **TAG** or **Image ID**.
**TAG** refers to a particular snapshot of the image and the **IMAGE ID** is the corresponding unique identifier for that image.
Take a look at the following screenshot:
![Docker Image Tag and ID][7]
As you see in the above results, the tags are **"latest"** and **"20.04"**.
* 27941809078c is the IMAGE ID of Ubuntu latest Docker image,
* 20fffa419e3a is the image id of Ubuntu 20.04 Docker image
* and `e66264b98777` is the image id of Alpine latest Docker image.
##### 4.1. Run Containers Using Tag
Once you downloaded the Docker images of your choice, run the following command to start a Docker container and connect to it by using its TAG.
```
$ sudo docker run -t -i ubuntu:latest /bin/bash
```
Or,
```
$ sudo docker run -it ubuntu:latest /bin/bash
```
Here,
* -t : Assigns a new Pseudo Terminal inside the Ubuntu container.
* -i : Allows us to make an interactive connection by grabbing the standard in (STDIN) of the container.
* ubuntu:latest : Ubuntu docker image with Tag "latest".
* /bin/bash : BASH shell for the new container. This is optional. If you don't mention the shell, the default shell will be assigned to the container.
After starting the container, you'll be automatically landed into the Container's shell (Command prompt):
![Run Containers Using Tag][8]
The new container based on the Ubuntu latest image has been started now. A unique ID and a name will be given to all the newly containers. As you can see in the above output, the Ubuntu container ID is **2f2a5b826762**. We will see where to find the name of the container in a minute.
You can now start working in the container. Once you're done with the Container, you can return back to the host system's Terminal (In my case, it is Ubuntu 22.04 LTS) without terminating the Container (guest os).
##### 4.2. Detach From Running Containers
To detach from a running container (without terminating it), press **CTRL+P** followed by **CTRL+Q**.
Now, you are back to your original host computer's terminal window. Please note that the container is still running in the background and we didn't terminate it yet.
##### 4.3. Run Containers Using IMAGE Id
The another way to start a container and connect to it is by using the IMAGE ID as shown below:
```
$ sudo docker run -it 20fffa419e3a /bin/bash
```
Here,
* 20fffa419e3a - Image id
To detach from the container and return back to the host system's Terminal, press **CTRL+P** and **CTRL+Q**. Again, we only detached from the container but didn't stop it. The container is still running in the background.
##### 4.4. Run Containers In Detached Mode
In the previous sections, we started a container and attached to it immediately. And then we detached from the container once our work with that container is completed.
You can also start container in detached mode (without automatically attaching it).
To run a container in the background, run:
```
$ sudo docker run -it -d alpine:latest
```
**Sample Output:**
```
d74f2ceb5f3ad2dbddb0b26e372adb14efff91e75e7763418dbd12d1d227129d
```
The first 12 letters in the above output indicates the container ID.
You can verify if the container is running using `docker ps` command:
```
$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d74f2ceb5f3a alpine:latest "/bin/sh" 3 seconds ago Up 2 seconds zen_pascal
```
![Run Containers In Background][9]
As you can see in the above output, we have a created an Alpine container but didn't attach to it.
If you want to attach it to the container, simply, run:
```
$ sudo docker attach d74f2ceb5f3a
```
#### 5. View Running Containers
To view the list running of containers, run the following command:
```
$ sudo docker ps
```
**Sample Output:**
```
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f7e04eed577e 20fffa419e3a "/bin/bash" 6 minutes ago Up 6 minutes brave_mclean
2f2a5b826762 ubuntu:latest "/bin/bash" 18 minutes ago Up 18 minutes hungry_leavitt
```
![View Running Containers][10]
Here,
* f7e04eed577e is the ID of the Ubuntu container that is created with image "2f2a5b826762". And, "brave_mclean" is the name of this container.
* 2f2a5b826762 is the ID of the Ubuntu container that is created with image "ubuntu:latest". And, "hungry_leavitt" is the name of this container.
Whenever a new container is created, a unique ID and name will be given to it, so we can access the container using either its ID or name.
**Heads Up:** Please note that **Container ID and Docker image ID are different**.
To list all available (either running or stopped) containers, run:
```
$ sudo docker ps -a
```
#### 6. Attach To Or Detach From Running Containers
First, find the name or ID of the container with `docker ps` command.
```
$ sudo docker ps
```
Next, attach to the running container using `docker attach` command.
```
$ sudo docker attach <container-id>
```
For instance, I am going to attach to the container that has the ID "f7e04eed577e" like below:
```
$ sudo docker attach f7e04eed577e
```
You can also attach to a container using its name as well.
```
$ sudo docker attach brave_mclean
```
Now you're logged in to the container.
To detach from the container, simply press **CTRL+P** followed by **CTRL+Q**.
#### 7. Start, Restart, Pause, And Stop Containers
You can start, restart, pause or stop a Docker container using its name or container ID.
First, find the name or ID of the container with `docker ps -a` command.
![Find Container ID And Name][11]
Now you can start a container using `docker start` command with name or ID like below.
```
$ sudo docker start modest_cray
```
```
$ sudo docker start 10615254bb45
```
You can **start multiple containers** with space-separated like below.
```
$ sudo docker start 24b5ee8c3d3a 56faac6d20ad d74f2ceb5f3a
```
To gracefully restart a running container, do:
```
$ sudo docker start 10615254bb45
```
To pause processes in a running container:
```
$ sudo docker pause 10615254bb45
```
To Unpause processes in a running container:
```
$ sudo docker unpause 10615254bb45
```
To block a container until others stop:
```
$ sudo docker wait 10615254bb45
```
Similarly we can stop a docker container using its name or ID. If you're already inside the container's shell, you can stop the container by simply running the following command:
```
# exit
```
You can also stop (power off the container) from the Docker host system using the following command:
```
$ sudo docker stop 10615254bb45
```
You can exit multiple containers with space-separated as shown below.
```
$ sudo docker stop 35b5ee8c3d3a 10615254bb45
```
After exiting the container, verify if it is really stopped by listing the running containers with command:
```
$ sudo docker ps
```
#### 8. Kill Docker Containers
The docker stop command will gracefully turn off a running container. Sometimes, you may stuck with an unresponsive container or you want to forcibly shutdown a container.
To kill a container by sending a `SIGKILL` to a running container, run:
```
$ sudo docker kill 10615254bb45
```
#### 9. Automatically Delete Containers After Closing Them
You may want to test a Container and then delete it once you're done with the Container. If so, you can automatically delete the Container after closing it by using `--rm` flag:
```
$ sudo docker run -it --rm debian:latest
```
Once you exit from the Container, it will be automatically deleted.
![Automatically Delete Containers][12]
As you see in the above output, I created a new Debian container. Once I exit from the container, it is automatically deleted. The `docker ps -a` output shows that the Debian container doesn't exist.
#### 10. Assign Name To Containers
If you closely look into the output of previous commands, each container is given a random name when you start a container. If you don't name your Containers, Docker will name them for you automatically.
Have a look at the following example.
```
$ sudo docker run -it -d alpine:latest
2af79e97a825c91bf374b4862b9e7c22fc22acd1598005e8bea3439805ec335d
```
```
$ sudo docker run -it -d alpine:latest
80b53b7e661d33696b65c78267fc3f067b6100799c925910db4721963e3fae0a
```
```
$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
80b53b7e661d alpine:latest "/bin/sh" 3 seconds ago Up 2 seconds bold_margulis
2af79e97a825 alpine:latest "/bin/sh" 6 seconds ago Up 5 seconds recursing_taussig
```
As you see in the above output, even though I have created two containers using the same docker image, they both gets different ID and name.
If you want to assign a static name to the container, use `--name` flag like below:
```
$ sudo docker run -it -d --name ostechnix_alpine alpine:latest
```
The above command will create run a new Container called **ostechnix_alpine** in detached mode.
let us view list of the running Containers:
```
$ sudo docker ps
```
**Sample Output:**
```
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
397111fac537 alpine:latest "/bin/sh" 2 seconds ago Up 2 seconds ostechnix_alpine
80b53b7e661d alpine:latest "/bin/sh" 7 minutes ago Up 7 minutes bold_margulis
2af79e97a825 alpine:latest "/bin/sh" 7 minutes ago Up 7 minutes recursing_taussig
```
![Assign Name To Containers][13]
Did you notice the name of the first Container in the above output? Yes, we've assigned a custom name (i.e. `ostechnix_alpine` ) to the Container.
Assigning custom names to containers gives us a benefit. We can easily identify what is installed in that container by looking at the name of the container name.
#### 11. Build Custom Docker Images
Docker is not just for downloading and using the existing containers. You can create your own custom docker image as well.
Let us start an Ubuntu container:
```
$ sudo docker run -it ubuntu:latest
```
Now, you will be in the container's shell.
Then, install any software or do whatever you want in the container.
For example, let us install **Apache web server** in the container.
```
# apt update
# apt install apache2
```
Similarly, install and test any software of your choice in the Container.
Once you're done, detach from the container (don't exit it) and return back to the host system's shell. Please do not stop or power-off the Container. To detach from the container without stopping it, press `CTRL+P` followed by `CTRL+Q`.
From your Docker host terminal, run the following command to find the container ID:
```
$ sudo docker ps
```
Finally, create a Docker image of the running Container using command:
```
$ sudo docker commit 377e6d77ebb5 ostechnix/ubuntu_apache
```
**Sample Output:**
```
sha256:bc5e5f95ca592a3585fda2c5a40ec30c98e292046ef70390a2c3b7863cc6f7c1
```
Here,
* 377e6d77ebb5  Ubuntu container ID.
* ostechnix  Name of the user who created the container.
* ubuntu_apache Name of the docker image created by user ostechnix.
Let us check whether the new Docker image is created or not with command:
```
$ sudo docker images
```
**Sample Output:**
```
ostechnix/ubuntu_apache
```
![Build Custom Docker Images][14]
As you see in the above output, the new Docker image has been created in our Docker host system from the running Container.
Now, you can create a new Container from the newly created Docker image as usual with command:
```
$ sudo docker run -it ostechnix/ubuntu_apache
```
#### 12. Removing Containers
Once you're done all R&D with Docker containers, you can delete if you don't want them anymore.
To do so, First we have to stop (power off) the running Containers.
Let us find out the running containers with command:
```
$ sudo docker ps
```
**Sample Output:**
```
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
377e6d77ebb5 ubuntu:latest "bash" 7 minutes ago Up 7 minutes elegant_beaver
```
Stop the running container by using it's ID:
```
$ sudo docker stop 377e6d77ebb5
```
Now, delete the container using command:
```
$ sudo docker rm 377e6d77ebb5
```
Similarly, stop all containers and delete them if they are no longer required.
Deleting multiple containers one by one can be a tedious task. So, we can delete all stopped containers in one go, just run:
```
$ sudo docker container prune
```
Type **"Y"** and hit `ENTER` key to delete the containers.
```
WARNING! This will remove all stopped containers.
Are you sure you want to continue? [y/N] y
Deleted Containers:
397111fac5374921b974721ee646b2d5fbae61ca9c6e8b90fbf47952f382a46b
80b53b7e661d33696b65c78267fc3f067b6100799c925910db4721963e3fae0a
[...]
Total reclaimed space: 176B
```
![Delete Containers][15]
This command will work only with latest Docker versions.
Verify if all the containers are deleted using the command:
```
$ sudo docker ps -a
```
If you don't see any output, all containers are deleted.
#### 13. Removing Docker Images
Remember, first you should remove all the containers before removing all the images from which those containers were created.
Once you removed containers, you can delete the Docker images that you no longer need.
To find the list of the Downloaded Docker images:
```
$ sudo docker images
```
**Sample Output:**
```
REPOSITORY TAG IMAGE ID CREATED SIZE
ostechnix/ubuntu_apache latest bc5e5f95ca59 14 minutes ago 229MB
debian latest d2780094a226 11 days ago 124MB
ubuntu latest 27941809078c 3 weeks ago 77.8MB
ubuntu 20.04 20fffa419e3a 3 weeks ago 72.8MB
alpine latest e66264b98777 5 weeks ago 5.52MB
```
As you see above, we have 5 Docker images in our host system.
Let us delete them by using their IMAGE id:
```
$ sudo docker rmi ce5aa74a48f1
```
**Sample Output:**
```
Untagged: ostechnix/ubuntu_apache:latest
Deleted: sha256:bc5e5f95ca592a3585fda2c5a40ec30c98e292046ef70390a2c3b7863cc6f7c1
Deleted: sha256:a8e4797160a2b2d33d8bd1bd67e008260c022b3a53fbcc198b2b74d9eae5961d
```
Similarly, delete all other Docker images.
To remove all stopped containers, all images, build cache, all networks, run:
```
$ sudo docker system prune -a
```
Be careful while using this command. It will delete all unused containers, networks, images (both dangling and unreferenced).
![Delete Everything In Docker][16]
By default, volumes are not removed to prevent important data from being deleted even if there is currently no container using the volume.
If you want to delete everything including the Volumes, use the `--volumes` flag.
```
$ sudo docker system prune -a --volumes
```
### Docker Troubleshooting
Docker won't let you to delete the Docker images if they are used by any running or stopped containers.
For example, when I try to delete a Docker Image with ID **b72889fa879c**, from one of my old Ubuntu server. I got the following error:
```
Error response from daemon: conflict: unable to delete b72889fa879c (must be forced) - image is being used by stopped container dde4dd285377
```
This is because the Docker image that you want to delete is currently being used by another Container.
So, let us check the running Container using command:
```
$ sudo docker ps
```
**Sample Output:**
![Show running docker containers][17]
Oops! There is no running container.
Let us again check for all containers (running and stopped) with command:
```
$ sudo docker ps -a
```
**Sample Output:**
![Show running and stopped docker containers][18]
As you see, there are still some stopped containers are using one of the Docker images. So, let us delete all of the containers.
**Example:**
```
$ sudo docker rm 12e892156219
```
Similarly, remove all containers as shown above using their respective container's ID.
Once you deleted all containers, finally remove the Docker images.
**Example:**
```
$ sudo docker rmi b72889fa879c
```
That's it. Now verify if there are any other Docker images in the host with command:
```
$ sudo docker images
```
You will now probably won't have any docker images.
### Conclusion
In this comprehensive **getting started with Docker tutorial**, we explained Docker basics such as creating, running, searching, removing containers and also building own Docker image from a Container. We also explained how to delete Docker containers and images when they are no longer necessary.
Hope you a got the basic idea about **Docker usage**.
For more details, refer the official resource links given at the end of this guide or drop a comment in the comment section below.
**Resources:**
* [Docker website][19]
* [Docker Documentation][20]
--------------------------------------------------------------------------------
via: https://ostechnix.com/getting-started-with-docker/
作者:[sk][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://ostechnix.com/author/sk/
[b]: https://github.com/lkxed
[1]: https://ostechnix.com/install-docker-almalinux-centos-rocky-linux/
[2]: https://ostechnix.com/install-docker-ubuntu/
[3]: https://hub.docker.com/
[4]: https://ostechnix.com/wp-content/uploads/2022/07/Search-Docker-Images.png
[5]: https://ostechnix.com/wp-content/uploads/2022/07/Download-Docker-Images.png
[6]: https://ostechnix.com/wp-content/uploads/2022/07/List-Docker-Images.png
[7]: https://ostechnix.com/wp-content/uploads/2022/07/Docker-Image-Tag-and-ID.png
[8]: https://ostechnix.com/wp-content/uploads/2022/07/Run-Containers-Using-Tag-1.png
[9]: https://ostechnix.com/wp-content/uploads/2022/07/Run-Containers-In-Background-1.png
[10]: https://ostechnix.com/wp-content/uploads/2022/07/View-Running-Containers.png
[11]: https://ostechnix.com/wp-content/uploads/2022/07/Find-Container-ID-And-Name.png
[12]: https://ostechnix.com/wp-content/uploads/2022/07/Automatically-Delete-Containers.png
[13]: https://ostechnix.com/wp-content/uploads/2022/07/Assign-Name-To-Containers.png
[14]: https://ostechnix.com/wp-content/uploads/2022/07/Build-Custom-Docker-Images.png
[15]: https://ostechnix.com/wp-content/uploads/2022/07/Delete-Containers.png
[16]: https://ostechnix.com/wp-content/uploads/2022/07/Delete-Everything-In-Docker.png
[17]: https://ostechnix.com/wp-content/uploads/2016/04/sk@sk-_005-1-1.jpg
[18]: https://ostechnix.com/wp-content/uploads/2016/04/sk@sk-_006-1.jpg
[19]: https://www.docker.com/
[20]: https://docs.docker.com/

View File

@ -1,115 +0,0 @@
[#]: subject: "Manage your files in your Linux terminal with ranger"
[#]: via: "https://opensource.com/article/22/7/manage-files-linux-terminal-ranger"
[#]: author: "Sumantro Mukherjee https://opensource.com/users/sumantro"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Manage your files in your Linux terminal with ranger
======
Try this lightweight open source tool to preview files without leaving the terminal.
![Filing cabinet for organization][1]
The most basic way to look at your files and folders is to use the commands `ls` and `ll`. But sometimes, I want to see not just the file metadata but also the contents of a file at a glance. For that, I use ranger.
If you love working out of your console and using [Vim][2] or Vi, and you dont want to leave your terminal for any reason, ranger is your new best friend. Ranger is a minimal file manager that allows you not only to navigate through the files but also to preview them. Ranger comes bundled with rifle, a file executor that can efficiently choose programs that work with a given file type.
### Installing ranger on Linux
Ranger can be installed in Fedora or any RPM-based distro by running
```
$ sudo dnf install ranger
```
Ranger is also available for [other distros and macOS][3].
### Using ranger for the first time
As a user, you can start ranger by simply typing `$ ranger` on your favorite terminal. The arrow keys give way to the navigation. This screenshot is an excellent example of how I can preview the code of the `config.example` file stored in `Kernel-tests`.
![Screenshot of terminal showing config.example highlighted and a preview of the file in the terminal to the right][4]
Picking any file and hitting F4 opens up your default editor and lets you edit the files right away!
### What about images and videos?
Using [rifle][5] with ranger lets you quickly find the program associated with a given file. Hovering over an image and then trying to open it is very simple; just hit Enter. Heres how that looks:
![Screenshot of a PNG file preview over a terminal window][6]
Hitting i on an image file will give the user all the EXIF data. Hitting **S****hift+Enter** will open the PDF file.
![A screenshot showing a preview of a PDF file (tickets to a museum) floating over the terminal window][7]
The same key combo will open and start playing videos in the system's default video player that supports the codec. The example below is an mp4 video, which plays just fine on [VLC][8].
![Screenshot of a Bugcrowd University Cross Site Scripting video in VLC media player, previewed over the terminal][9]
### File ops
The following key bindings work well unless otherwise configured by the Vim user.
j: Move down
k: Move up
h: Move to parent directory
gg: Go to the top of the list
i: Preview file
r: Open file
zh: View hidden files
cw: Rename current file
yy: Yank (copy) file
dd: Cut file
pp: Paste file
u: Undo
z: Change settings
dD: Delete file
### Console commands
Sometimes I have a folder that contains screenshots of a particular software when I am drafting articles. Selecting or marking files by hitting Space and then typing `:bulkrename` helps me move all the weird timestamps to, for example, lorax1, lorax2 , and so on. An example is below:
![Screenshot of terminal showing timestamped files that can be renamed with the bulkrename command][10]
Other useful console commands include:
`:openwith` : Open a select file with a program of your choice
`:touch FILENAME` : Create a file
`:mkdir FILENAME` : Create a directory
`:shell <command>` : Run a command in shell
`:delete` : Delete files
### Will it work in tty2/3/4?
As someone who works in quality assurance (QA), I've found that searching for logs and reading them has never been easier. Even when my Gnome Display Manager crashes, I can switch over to my tty2, log in with my username and password, and start ranger with superuser permission, and then I am all sorted to explore!
Ranger is a great tool for working with files without ever having to leave the terminal. Ranger is minimal and customizable, so give it go!
Image by: (Sumantro Mukherjee, CC BY-SA 4.0)
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/7/manage-files-linux-terminal-ranger
作者:[Sumantro Mukherjee][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/sumantro
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/files_documents_organize_letter.png
[2]: https://opensource.com/tags/vim
[3]: https://opensource.com/article/20/3/ranger-file-navigator
[4]: https://opensource.com/sites/default/files/2022-06/ranger%201.png
[5]: https://www.systutorials.com/docs/linux/man/1-rifle/
[6]: https://opensource.com/sites/default/files/2022-06/ranger%202.png
[7]: https://opensource.com/sites/default/files/2022-06/ranger%203.png
[8]: https://opensource.com/article/21/2/linux-media-players
[9]: https://opensource.com/sites/default/files/2022-06/ranger%204.png
[10]: https://opensource.com/sites/default/files/2022-06/ranger%205.png

View File

@ -1,143 +0,0 @@
[#]: subject: "Monitoring tiny web services"
[#]: via: "https://jvns.ca/blog/2022/07/09/monitoring-small-web-services/"
[#]: author: "Julia Evans https://jvns.ca/"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Monitoring tiny web services
======
Hello! Ive started to run a few more servers recently ([nginx playground][1], [mess with dns][2], [dns lookup][3]), so Ive been thinking about monitoring.
It wasnt initially totally obvious to me how to monitor these websites, so I wanted to quickly write up what how I did it.
Im not going to talk about how to monitor Big Serious Mission Critical websites at all, only tiny unimportant websites.
### goal: spend approximately 0 time on operations
I want the sites to mostly work, but I also want to spend approximately 0% of my time on the ongoing operations.
I was initially very wary of running servers at all because at my last job I was on a 247 oncall rotation for some critical services, and in my mind “being responsible for servers” meant “get woken up at 2am to fix the servers” and “have lots of complicated dashboards”.
So for a while I only made static websites so that I wouldnt have to think about servers.
But eventually I realized that any server I was going to write was going to be very low stakes, if they occasionally go down for 2 hours its no big deal, and I could just set up some very simple monitoring to help keep them running.
### not having monitoring sucks
At first I didnt set up any monitoring for my servers at all. This had the extremely predictable outcome of sometimes the site broke, and I didnt find out about it until somebody told me!
### step 1: an uptime checker
The first step was to set up an uptime checker. There are tons of these out there, the ones Im using right now are [updown.io][4] and [uptime robot][5]. I like updowns user interface and [pricing][6] structure more (its per request instead of a monthly fee), but uptime robot has a more generous free tier.
These
1. check that the site is up
2. if it goes down, it emails me
I find that email notifications are a good level for me, Ill find out pretty quickly if the site goes down but it doesnt wake me up or anything.
### step 2: an end-to-end healthcheck
Next, lets talk about what “check that the site is up” actually means.
At first I just made one of my healthcheck endpoints a function that returned `200 OK` no matter what.
This is kind of useful it told me that the server was on!
But unsurprisingly I ran into problems because it wasnt checking that the API was actually _working_ sometimes the healthcheck succeeded even though the rest of the service had actually gotten into a bad state.
So I updated it to actually make a real API request and make sure it succeeded.
All of my services do very few things (the nginx playground has just 1 endpoint), so its pretty easy to set up a healthcheck that actually runs through most of the actions the service is supposed to do.
Heres what the end-to-end healthcheck handler for the nginx playground looks like. Its very basic: it just makes another POST request (to itself) and checks if that request succeeds or fails.
```
func healthHandler(w http.ResponseWriter, r *http.Request) {
// make a request to localhost:8080 with `healthcheckJSON` as the body
// if it works, return 200
// if it doesn't, return 500
client := http.Client{}
resp, err := client.Post("http://localhost:8080/", "application/json", strings.NewReader(healthcheckJSON))
if err != nil {
log.Println(err)
w.WriteHeader(http.StatusInternalServerError)
return
}
if resp.StatusCode != http.StatusOK {
log.Println(resp.StatusCode)
w.WriteHeader(http.StatusInternalServerError)
return
}
w.WriteHeader(http.StatusOK)
}
```
### healthcheck frequency: hourly
Right now Im running most of my healthchecks every hour, and some every 30 minutes.
I run them hourly because updown.ios pricing is per healthcheck, Im monitoring 18 different URLs, and I wanted to keep my healthcheck budget pretty minimal at $5/year.
Taking an hour to find out that one of these websites has gone down seems ok to me if there is a problem theres no guarantee Ill get to fixing it all that quickly anyway.
If it were free to run them more often Id probably run them every 5-10 minutes instead.
### step 3: automatically restart if the healthcheck fails
Some of my websites are on fly.io, and fly has a pretty standard feature where I can configure a HTTP healthcheck for a service and restart the service if the healthcheck starts failing.
“Restart a lot” is a very useful strategy to paper over bugs that I havent gotten around to fixing yet for a while the nginx playground had a process leak where `nginx` processes werent getting terminated, so the server kept running out of RAM.
With the healthcheck, the result of this was that every day or so, this would happen:
* the server ran out of RAM
* the healthcheck started failing
* it get restarted
* everything was fine again
* repeat the whole saga again some number of hours later
Eventually I got around to actually fixing the process leak, but it was nice to have a workaround in place that could keep things running while I was procrastinating fixing the bug.
These healthchecks to decide whether to restart the service run more often: every 5 minutes or so.
### this is not the best way to monitor Big Services
This is probably obvious and I said this already at the beginning, but “write one HTTP healthcheck” is not the best approach for monitoring a large complex service. But I wont go into that because thats not what this post is about.
### its been working well so far!
I originally wrote this post 3 months ago in April, but I waited until now to publish it to make sure that the whole setup was working.
Its made a pretty big difference before I was having some very silly downtime problems, and now for the last few months the sites have been up 99.95% of the time!
--------------------------------------------------------------------------------
via: https://jvns.ca/blog/2022/07/09/monitoring-small-web-services/
作者:[Julia Evans][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://jvns.ca/
[b]: https://github.com/lujun9972
[1]: https://nginx-playground.wizardzines.com
[2]: https://messwithdns.net
[3]: https://dns-lookup.jvns.ca
[4]: https://updown.io/
[5]: https://uptimerobot.com/
[6]: https://updown.io/#pricing

View File

@ -1,162 +0,0 @@
[#]: subject: "How to Install yay AUR Helper in Arch Linux [Beginners Guide]"
[#]: via: "https://www.debugpoint.com/install-yay-arch/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Install yay AUR Helper in Arch Linux [Beginners Guide]
======
This beginners guide explains the steps to install the Yay AUR helper in Arch Linux.
The yay is an abbreviation of Yet Another Yogurt. It is technically a [pacman][1] wrapper and AUR helper written in [Go programming languages][2]. It is the most popular [Arch User Repository (AUR)][3] helper available today. With Yay, you can take advantage of a vast Arch User Repository of packages and easily compile and install any software.
It automates many package management tasks such as searching, resolving dependencies on the fly, compiling and building packages, and, of course, publishing your packages for AUR.
Lets look at how you can install Yay in Arch Linux or any Arch-based distro such as Manjaro. Once you install Arch Linux, you can install packages via pacman package manager from three main Arch official repo. But Yay is not installed by default after a fresh Arch Linux installation. Hence you need to install it to take advantage of AUR manually.
This guide covers the below topics.
* Install yay in Arch Linux
* Install yay in Manjaro
* How to use yay to install packages in Arch Linux and Manjaro
* Some yay tips
### Install yay in Arch Linux
#### Pre-requisite
Open a terminal and run the below commands. Provide admin password when prompted. These steps require the [base-devel][4] package and git package for compilation and installation.
```
sudo pacman -S base-devel
```
```
sudo pacman -S git
```
![Install git][5]
#### Install yay
The yay package has two versions in the Arch repository, as follows.
[yay][6] stable version[yay-git][7] development version
For this guide, I have used the stable version. Now, go to “/opt” directory and clone the git repo.
```
cd /optsudo git clone https://aur.archlinux.org/yay.git
```
![clone the yay repo][8]
Change the owner of the source directory. Replace “debugpoint” with your user name.
```
sudo chown -R debugpoint:users ./yay
```
If you are unaware of the user or group, you can find the user and groups using the example below.
```
id debugpoint
```
Go to the directory and compile.
```
cd yay
```
```
makepkg -si
```
This completes the installation for yay in Arch Linux.
![Install yay in Arch Linux][9]
### Install in yay in Manjaro
If you are using Manjaro Linux, the yay package is available in the community repo. You can easily install using the following commands in Manjaro.
```
pacman -Syyupacman -S yay
```
Now, lets look at how you can install any package using Yay and some basic yay usage.
### How to use yay to install packages
The first search on the AUR website to install any application to get the package name. For example, to install [featherpad][10] text editor, run the below command.
```
yay -S featherpad
```
After installation, you can find the application launcher in the application menu.
![Install a sample application (featherpad) using yay][11]
### Some yay tips
You can also do many tweaks and system operations using yay. Some of the examples are below.
**Refresh the system packages and upgrade:**
```
yay -Syu
```
**Use the development versions of packages and upgrade (be careful while running this command)**:
```
yay -Syu --devel --timeupdate
```
**Remove any packages (for example, featherpad)**:
```
yay -Rns featherpad
```
**Get a quick system stat:**
![system stat using yay][12]
```
yay -Ps
```
I hope this beginners guide helped you install yay in [Arch Linux][13], then use yay for installing packages, and perform different system actions.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/install-yay-arch/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://wiki.archlinux.org/index.php/pacman
[2]: https://golang.org/
[3]: https://wiki.archlinux.org/index.php/Arch_User_Repository
[4]: https://aur.archlinux.org/packages/meta-group-base-devel/
[5]: https://www.debugpoint.com/wp-content/uploads/2021/01/Install-git-1024x291.png
[6]: https://aur.archlinux.org/packages/yay/
[7]: https://aur.archlinux.org/packages/yay-git/
[8]: https://www.debugpoint.com/wp-content/uploads/2021/01/clone-the-yay-repo-1024x271.png
[9]: https://www.debugpoint.com/wp-content/uploads/2021/01/Install-yay-in-Arch-Linux-1024x460.png
[10]: https://aur.archlinux.org/packages/featherpad-git/
[11]: https://www.debugpoint.com/wp-content/uploads/2021/01/Install-a-sample-application-featherpad-using-yay-1024x620.png
[12]: https://www.debugpoint.com/wp-content/uploads/2021/01/system-stat-using-yay.png
[13]: https://www.debugpoint.com/tag/arch-linux/

View File

@ -0,0 +1,80 @@
[#]: subject: "Manual Renewal of SSL Certificates: A Simple Guide"
[#]: via: "https://www.opensourceforu.com/2022/07/manual-renewal-of-ssl-certificates-a-simple-guide/"
[#]: author: "Jitendra Bhojwani https://www.opensourceforu.com/author/jitendra-bhojwani/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Manual Renewal of SSL Certificates: A Simple Guide
======
![SSL-Certificates-Featured-image][1]
*In the April 2022 issue of this magazine, we read about the different types of SSL certificates and their applications. This article explains how to manually renew an existing SSL certificate, so that it stays updated with the latest security requirements.*
When visitors interact with your website and share critical details like credit card numbers, they trust that their information has been secured against misuse. So it becomes your responsibility to respect that trust and offer complete protection to all the visitors on your site. Failing to do so can not only cost you the loyalty of customers but may also put you in a legal soup. There have been many instances where websites that couldnt protect their customers data against leakage, theft or misuse were forced to pay hefty penalties, and also lost their reputation.
#### How does an SSL certificate secure customers data?
One of the best ways to protect sensitive customer information is to secure your site with an SSL (secure sockets layer) certificate. Without going into the technical nitty-gritties, an SSL certificate encrypts the communication between a Web server and the visitors browser, and thus makes it technically impossible for hackers or threat actors to steal data in transit. SSL establishes a secure handshake process to decrypt the encrypted information — a process that is too complex to be cracked by humans or even software.
#### Why do you need to update your SSL certificate?
While an SSL certificate does offer security against data theft or misuse, you need to update it periodically to ensure the most effective security against the latest threats. This article will list the step-by-step instructions for renewing your SSL certificate in the right way.
There are quite a few benefits of updating an SSL certificate:
* Timely renewal authenticates your websites identity.
* You get updated security.
* A one-year validity promotes the healthy practice of periodically renewing/upgrading the scope of protection, thus eliminating the risks associated with outdated versions.
> Note: The best practice is to select an auto renewal option that relieves you from the stress of remembering the renewal date or manually following the related steps. |
#### A bit off topic …a pure open source way to build your own SSL certificate
Yes, it is absolutely true! With some simplified and compact steps you can actually build your own SSL certificate from scratch! While the entire process is out of the scope of this article, here are a few key open source components and tools that you can use to create your SSL certificate.
* OpenSSL: This is a highly credible tool to implement TLS and crypto libraries.
* EasyRSA: This command-line tool enables you to build PKI CA and manage it efficiently.
* CFSSL: Cloudflare has finally built a multi-purpose, multi-capability tool for PKI and TLS.
* Lemur: A fair enough TLS producer developed by Netflix.
### How to renew your SSL certificate
While the broad process of [SSL][2] renewal remains the same, there could be some minor tweaks and variations depending upon your specific SSL provider.
The renewal process follows three main steps — CSR (certificate signing request) generation, certificate activation and, finally, the certificate installation.
**Generating CSR:** For cPanel hosting panels, you can click on the Security tab and search for the *SSL/TLS* option. It will display a screen that shows a link just under the CSR option. This section facilitates new CSR generation for your desired domain name.
You will be asked detailed contact information for confirming that you are the genuine domain owner. After filling the form, you will get a CSR code that is needed for certificate reactivation.
*Activating an SSL certificate:* In your dashboard, you can see a quick overview of the SSL certificate, domains and other digital infrastructure products that you own. Click this button to start the SSL renewal process. Enter the CSR generated a while ago and confirm the accuracy of the information. You can now validate the SSL renewal process.
*Validating the SSL certificate:* You will once again be prompted to confirm domain ownership. Enter your domain-associated email. Upload a file on the Web server where the certificate needs to be installed. Validate the SSL certificate with the help of CNAME records. While there are multiple options, it is best and easiest to validate it with an email. Once you enter the domain associated email, you will get an email containing a specific link followed by another mail that comprises the new certificate file with a .*crt* extension.
*Installing the SSL certificate:* Your Web hosting provider will either give you an option for communicating with the support team for installing renewed files or provide you with the detailed instructions on how you can do it manually through your cPanel. Keep in mind that different hosts offer different options for renewal. That said, if you are a non-technical person then contacting the support team will be the best option for you.
For manual updating, visit the *SSL/TLS* section of your cPanel and find the *Manage SSL* sites option. It contains the entire domain list that you own. Corresponding to each domain name you can see the Certificate Renewal option.
In the screen next to it, enter the details in *Private Key* using the *Autofill* by *Domain* option. Under the *Certificate* option, fill the details of your .*crt file*. You are almost done. Just click the button that reads *Install Certificate*.
Along with saving the critical data and sensitive information of your users, the SSL certificate also builds trust by reaffirming that data shared on your site is secure. It can also affect your SEO profile positively as Google considers SSL certification a healthy practice. However, to continue enjoying the best security with this certificate, you need to update it periodically. This ensures that your site is fully secured against the data in transit attacks as per the latest security requirements.
--------------------------------------------------------------------------------
via: https://www.opensourceforu.com/2022/07/manual-renewal-of-ssl-certificates-a-simple-guide/
作者:[Jitendra Bhojwani][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.opensourceforu.com/author/jitendra-bhojwani/
[b]: https://github.com/lkxed
[1]: https://www.opensourceforu.com/wp-content/uploads/2022/05/SSL-Certificates-Featured-image.jpg
[2]: https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwitou7xjv_3AhWLRmwGHVZ2BWwQFnoECB0QAQ&url=https%3A%2F%2Fgithub.com%2Fopenssl%2Fopenssl&usg=AOvVaw0niwMRCpb4nN_PtJFMQwWP

View File

@ -0,0 +1,382 @@
[#]: subject: "Run Linux, macOS, Windows Virtual Machines With Quickemu"
[#]: via: "https://ostechnix.com/run-linux-macos-windows-virtual-machines-with-quickemu/"
[#]: author: "sk https://ostechnix.com/author/sk/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Run Linux, macOS, Windows Virtual Machines With Quickemu
======
Use Quickemu To Quickly Spin Up Virtual Machines For Linux, macOS And Windows
This guide explains what is **Quickemu** and how to create and **run Linux, macOS and Windows desktop virtual machines with Quickemu** in Linux.
### What Is Quickemu?
Quickemu is a command line program to quickly create and run optimized Linux, macOS and Windows desktop virtual machines.
You don't need sudo or root permissions to run virtual machines. You can simply test any Linux, macOS or Windows VMs as a normal user and store the virtual machine configurations in your HOME directory or USB disk.
The Quickemu application consists of two CLI tools namely **quickemu** and **quickget**.
The quickget CLI tool downloads the latest ISO image for your OS. By default, the downloaded images are saved in your HOME directory. You can change it to other location for example external USB drive.
And, the Quickemu CLI tool uses **QEMU** under the hood to create and manage virtual machines. So the VMs are highly optimized and should work out of the box without any additional configuration.
### Quickemu Features
Quickemu ships with a lot of features out of the box.
* Over 300 operating systems are supported.
* Supports both EFI (with or without SecureBoot) and Legacy BIOS boot.
* Full SPICE support with host/guest clipboard sharing.
* Enables file sharing for Linux and Windows guests using VirtIO-webdavd.
* Enables file sharing for Linux and macOS guests using VirtIO-9p.
* Enables Samba file sharing between Linux, macOS and Windows guests.
* Configures automatic SSH port-forwarding for guests.
* Network port forwarding.
* Full duplex audio support.
* Smartcard, USB device pass-through.
* VirGL acceleration.
* Braille support.
* Free and Opensource.
### Install Quickemu In Linux
Quickemu is a new project and has been packaged for a few operating systems at the moment.
**Arch Linux:**
Quickemu is available in **[AUR][1]**. If you're on Arch Linux and its variants like EndeavourOS, Manjaro Linux, you can install Quickemu using **[Paru][2]** or **[Yay][3]** helpers.
```
$ paru -S quickemu
```
Or,
```
$ yay -S quickemu
```
**NixOS:**
To install Quickemu in NixOS, run:
```
$ nix-env -i quickemu
```
**Ubuntu:**
The developer of Quickemu has created a dedicated PPA for Ubuntu and its derivatives such as Elementary OS, Linux Mint and Pop!_OS.
To install Quickemu in Ubuntu and its derivatives, run the following commands one by one.
```
$ sudo apt-add-repository ppa:flexiondotorg/quickemu
```
```
$ sudo apt update
```
```
$ sudo apt install quickemu
```
For other Linux distributions, refer to the project's GitHub repository given at the end.
### Run Linux, MacOS And Windows Virtual Machines With Quickemu
Creating and managing VMs with Quickemu is just two step process.
Download the OS image, for example Alpine Linux, using quickget CLI:
```
$ quickget alpine latest
```
You can also download a specific version of the Alpine like below:
```
$ quickget alpine 3.15
```
It will create a configuration file for the chosen OS. It will be named based on the selected OS.
```
alpine-latest/alpin 100%[===================>] 47.00M 3.52MB/s in 14s
Checking alpine-latest/alpine-virt-3.16.0-x86_64.iso with sha256sum... Good!
Making alpine-latest.conf
To start your Alpine Linux virtual machine run:
quickemu --vm alpine-latest.conf
```
![Download Alpine Linux ISO Image With Quickget][4]
Now start your Alpine Linux virtual machine using command:
```
$ quickemu --vm alpine-latest.conf
```
This command will create and launch the Alpine Linux virtual machine via Spicy GTK client.
![Run Alpine Linux Virtual Machine With Quickemu][5]
Please note that it is just a live system. You still need to install the OS. You can now start the Alpine OS installation as usual.
Each VM and its associated files(ISO, Qcow2, other configuration files) are stored in a separate directory in your HOME directory. For instance, if you created Alpine VM using the Alpine latest image, a new directory called "alpine-latest" will be created and the VM's related files will be kept in this directory.
```
$ ls alpine-latest
alpine-latest-agent.sock alpine-latest.pid alpine-latest.sh disk.qcow2
alpine-latest.log alpine-latest.ports alpine-virt-3.16.0-x86_64.iso OVMF_VARS.fd
```
As you see in the above output, my Alpine Linux VM's ISO file, Qcow2 disk file and other config files such as `.ports`, `.fd`, `.sock` etc., are saved inside **~/alpine-latest** directory.
### Accessing Virtual Machines From Host Via Terminal
Whenever you launch a VM, Quickemu will display the following useful information on your host system's terminal.
```
Quickemu 3.15 using /usr/bin/qemu-system-x86_64 v6.2.0
- Host: Ubuntu 22.04 LTS running Linux 5.15 (ubuntu2204)
- CPU: 11th Gen Intel(R) Core(TM) i3-1115G4 @ 3.00GHz
- CPU VM: 1 Socket(s), 1 Core(s), 1 Thread(s), 4G RAM
- BOOT: EFI (Linux), OVMF (/usr/share/OVMF/OVMF_CODE_4M.fd), SecureBoot (off).
- Disk: alpine-latest/disk.qcow2 (16G)
Looks unused, booting from alpine-latest/alpine-virt-3.16.0-x86_64.iso
- Boot ISO: alpine-latest/alpine-virt-3.16.0-x86_64.iso
- Display: SPICE, qxl-vga, GL (on), VirGL (off)
- ssh: On host: ssh user@localhost -p 22220
- SPICE: On host: spicy --title "alpine-latest" --port 5930 --spice-shared-dir /home/ostechnix/Public
- WebDAV: On guest: dav://localhost:9843/
- 9P: On guest: sudo mount -t 9p -o trans=virtio,version=9p2000.L,msize=104857600 Public-ostechnix ~/Public
- Process: Starting alpine-latest.conf as alpine-latest (11272)
```
As you see, It displays the configuration details of both host and VM including the other details such as how to access the VM via SSH, access the shared folder via SPICE client etc. You can use these details to access the VM from your host system.
For example, if the SSH service is configured with port 22220 in your VM, you can access the VM from your hosts system like below.
```
$ ssh -P 22220 vm-user@localhost
```
You can check the `.ports` file in the VM directory to find what SSH and SPICE ports the VM is connected to.
```
$ cat alpine-latest/alpine-latest.ports
ssh,22220
spice,5930
```
This can be useful when you want to start the VMs in headless mode.
### Create VMs With Custom Specification(CPU Core, Disk And Memory)
By default, Quickemu will allocate the number of CPUs cores, and the size of the disk and RAM based on your host computer's specification. You can override this default behavior by using the following parameters.
* cpu_cores="2" - Specify the number of CPU cores(E.g. 2 cores) allocated to the VM.
* ram="4G" - Specify the RAM capacity(E.g. 4 GB) to allocate to the VM.
* disk_size="20G" - Specify the disk size(E.g. 20 GB) to allocate to the VM.
To create a VM with 2 CPU cores, 4 GB RAM and 20 GB hdd, edit your VM configuration file:
```
$ nano alpine-latest.conf
```
Add the following lines:
```
cpu_cores="2"
ram="4G"
disk_size="20G"
```
![Create Custom Configuration VM Using Quickemu][6]
Now, start the VM using the updated config file:
```
$ quickemu --vm alpine-latest.conf
```
### Create Desktop Shortcut For VMs
Instead of typing the whole command, you can create a desktop shortcut for your VM like below.
```
$ quickemu --vm alpine-latest.conf --shortcut
```
This command will create shortcut for the Alpine VM in `~/.local/share/applications/` location.
```
$ ls ~/.local/share/applications/
alpine-latest.desktop
```
A menu entry for the VM is also created for the VM. From now on, you can launch the VM from the Dash or menu.
![Desktop Shortcut For VMs][7]
### Start VMs With SPICE Client
Launching VMs with SPICE protocol will offer you the following benefits.
* Share clipboard between host and guest.
* Share files between host and guest.
* Enable USB pass-through.
Make sure the `spicy` client is installed and run the following command to
```
$ quickemu --vm alpine-latest.conf --display spice
```
### Use Existing ISO Images
Sometimes, you might have already downloaded the ISO files. In that case, you don't need to use "quickget" command to download the ISO file. Instead, just edit your VM configuration file:
```
$ nano alpine-latest.conf
```
Update the correct ISO file pathg(E.g. /home/ostechnix/Downloads/) like below:
```
[...]
iso="/home/ostechnix/Downloads/alpine-virt-3.16.0-x86_64.iso"
```
Now Quickemu will use the ISO file saved in the "Downloads" directory.
### Start VMs In Headless Mode
Make sure the **spicy** client is installed.
Run the following command to start the VM with SPICE, but no display attached:
```
$ quickemu --vm alpine-latest.conf --display none
```
Since the VM is started in headless mode, you can access it via SSH only.
Assuming the SSH service is configured with port 22220 in your VM, you can access the VM from your hosts system like below.
```
$ ssh -P 22220 vm-user@localhost
```
You can check the `.ports` file in the VM directory to lookup what SSH and SPICE ports the VM is connected to.
```
$ cat alpine-latest/alpine-latest.ports
ssh,22220
spice,5930
```
### Configure Networking
**Enable Bridge Networking**
To allow your VM to a preconfigured network bridge, add the following line to the VM configuration:
```
bridge="br0"
```
**Port Forwarding**
To allow port forwarding, add the following line to VM configuration:
```
port_forwards=("22:2200" "8800:80"
```
Here,
* 22:2200 - The port 22 on your host system is forwarded to the port 2200 on your guest system.
* 8800:80 - The port 8800 on your host system is forwarded to the port 80 on your guest system.
Quickemu allows you to do a few other customization. For more details, refer the project's GitHub page given at the end.
### Delete Virtual Machine
You can delete a VM if it is no longer required using command:
```
$ quickemu --vm alpine-latest.conf --delete-vm
```
This command will the entire virtual machine along with its configuration.
### Display Help
To view Quickemu help, run:
```
$ quickemu --help
Usage
quickemu --vm ubuntu.conf
You can also pass optional parameters
--braille : Enable braille support. Requires SDL.
--delete-disk : Delete the disk image and EFI variables
--delete-vm : Delete the entire VM and it's configuration
--display : Select display backend. 'sdl' (default), 'gtk', 'none', or 'spice'
--fullscreen : Starts VM in full screen mode (Ctl+Alt+f to exit)
--ignore-msrs-always : Configure KVM to always ignore unhandled machine-specific registers
--screen <screen> : Use specified screen to determine the window size.
--shortcut : Create a desktop shortcut
--snapshot apply <tag> : Apply/restore a snapshot.
--snapshot create <tag> : Create a snapshot.
--snapshot delete <tag> : Delete a snapshot.
--snapshot info : Show disk/snapshot info.
--status-quo : Do not commit any changes to disk/snapshot.
--version : Print version
```
### Conclusion
Quickemu provides an easy way to quickly deploy and run Windows, macOS and Linux desktop virtual machines.
One distinct feature of Quickemu, we can download the ISO image directly using the Quickget CLI. I don't think if this feature is included in the other virtualization applications and hypervisors.
Also Quickemu usage is very easy! If you're looking for a simple way to run optimized Virtual machines for Linux, macOS and Windows, Quickemu is perfect choice!
**Resource:**
* [Quickemu GitHub Repository][8]
--------------------------------------------------------------------------------
via: https://ostechnix.com/run-linux-macos-windows-virtual-machines-with-quickemu/
作者:[sk][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://ostechnix.com/author/sk/
[b]: https://github.com/lkxed
[1]: https://aur.archlinux.org/packages/quickemu
[2]: https://ostechnix.com/how-to-install-paru-aur-helper-in-arch-linux/
[3]: https://ostechnix.com/yay-found-yet-another-reliable-aur-helper/
[4]: https://ostechnix.com/wp-content/uploads/2022/07/Download-Alpine-Linux-ISO-Image-With-Quickget.png
[5]: https://ostechnix.com/wp-content/uploads/2022/07/Run-Alpine-Linux-Virtual-Machine-With-Quickemu.png
[6]: https://ostechnix.com/wp-content/uploads/2022/07/Create-Custom-Configuration-VM-Using-Quickemu.png
[7]: https://ostechnix.com/wp-content/uploads/2022/07/Desktop-Shortcut-For-VMs.png
[8]: https://github.com/quickemu-project/quickemu

View File

@ -0,0 +1,120 @@
[#]: subject: "7 kinds of garbage collection for Java"
[#]: via: "https://opensource.com/article/22/7/garbage-collection-java"
[#]: author: "Jayashree Huttanagoudar https://opensource.com/users/jayashree-huttanagoudar"
[#]: collector: "lkxed"
[#]: translator: "Veryzzj"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
7 kinds of garbage collection for Java
======
Learn about the choices you have in Java for memory management.
An application written using programming languages like C and C++ requires you to program the destruction of objects in memory when they're no longer needed. The more your application grows, the great the probability that you'll overlook releasing unused objects. This leads to a memory leak and eventually the system memory gets used up, and at some point there's no further memory to allocate. This results in a situation where the application fails with an OutOfMemoryError. But in the case of Java, Garbage Collection (GC) happens automatically during application execution, so it alleviates the task of manual deallocation and possible memory leaks.
Garbage Collection isn't a single task. The Java Virtual Machine (JVM) has eight different kinds of Garbage Collection, and it's useful to understand each one's purpose and strength.
### 1. Serial GC
![Serial threaded garbage collection][1]
A primitive implementation of GC using just a single thread. When Garbage Collection happens, it pauses the application (commonly known as a "stop the world" event.) This is suitable for applications that can withstand small pauses. Garbage Collection has a small footprint, so this is the preferred GC type for embedded applications. This Garbage Collection style can be enabled at runtime:
```
$ java -XX:+UseSerialGC
```
### 2. Parallel GC
![Parallel garbage collection][2]
Like Serial GC, this also uses a "stop the world" method. That means that while GC is happening, application threads are paused. But in this case, there are multiple threads performing GC operation. This type of GC is suitable for applications with medium to large data sets running in a multithreaded and multiprocessor environment.
This is the default GC in JVM, and is also known as the *Throughput Collector*. Various GC parameters, like throughput, pause time, number of threads, and footprint, can be tuned with suitable JVM flags:
* Number of threads: `-XX:ParallelGCThreads=<N>`
* Pause time: `-XX:MaxGCPauseMillis=<N>`
* Throughput (time spent for GC compared to actual application execution): `-XX:GCTimeRatio=<N>`
* Maximum heap footprint: `-Xmx<N>`
* Parallel GC can be explicitly enabled: `java -XX:+UseParallelGC`. With this option, minor GC in the young generation is done with multiple threads, but GC and compaction is done with a single thread in the old generation.
There's also a version of Parallel GC called *Parallel Old GC*, which uses multiple threads for both young and old generations:
```
$ java -XX:+UseParallelOldGC
```
### 3. Concurrent Mark Sweep (CMS)
![Concurrent garbage collection][3]
Concurrent Mark Sweep (CMS) garbage collection is run alongside an application. It uses multiple threads for both minor and major GC. Compaction for live objects isn't performed in CMS GC after deleting the unused objects, so the time paused is less than in other methods. This GC runs concurrently with the application, which slows the response time of the application. This is suitable for applications with low pause time. This GC was deprecated in Java 8u, and completely removed from 14u onwards. If you're still using a Java version that has it, though, you can enable it with:
```
$ java -XX:+UseConcMarkSweepGC
```
In the case of CMS GC, the application is paused twice. It's paused first when it marks a live object that's directly reachable. This pause is known as the *initial-mark*. It's paused a second time at the end of the CMS GC phase, to account for the objects that were missed during the concurrent cycle, when application threads updated the objects after CMS GC were completed. This is known as the *remark phase*.
### 4. G1 (Garbage First) GC
![Garbage first][4]
Garbage first (G1) was meant to replace CMS. G1 GC is parallel, concurrent, and incrementally compacting, with low pause-time. G1 uses a different memory layout than CMS, dividing the heap memory into equal sized regions. G1 triggers a global mark phase with multiple threads. After the mark phase is complete, G1 knows which region might be mostly empty and chooses that region for a sweep/deletion phase first.
In the case of G1, an object that's more than half a region size is considered a "humongous object." These objects are placed in the Old generation, in a region appropriately called the *humongous region*. To enable G1:
```
$ java -XX:+UseG1GC
```
### 5. Epsilon GC
This GC was introduced in 11u and is a *no-op* (do nothing) GC. Epsilon just manages memory allocation. It doesnt do any actual memory reclamation. Epsilon is intended only when you know the exact memory footprint of your application, and knows that it is garbage collection free.
```
$ java -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC
```
### 6. Shenandoah
Shenandoah was introduced in JDK 12, and is a CPU intensive GC. It performs compaction, deletes unused objects, and release free space to the OS immediately. All of this happens in parallel with the application thread itself. To enable Shenandoah:
```
$ java -XX:+UnlockExperimentalVMOptions \
-XX:+UseShenandoahGC
```
### 7. ZGC
ZGC is designed for applications that have low latency requirements and use large heaps. ZGC allows a Java application to continue running while it performs all garbage collection operations. ZGC was introduced in JDK 11u and improved in JDK 12. Both Shenandoah and ZGC have been moved out of the experimental stage as of JDK 15. To enable ZGC:
```
$ java -XX:+UnlockExperimentalVMOptions -XX:+UseZGC
```
### Flexible garbage collection
Java provides flexibility for memory management. It's useful to get familiar with the different methods available so you can choose what's best for the application you're developing or running.
Image by: [Opensource.com][5]
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/7/garbage-collection-java
作者:[Jayashree Huttanagoudar][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/jayashree-huttanagoudar
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/2022-07/jaya-java-gc-serial.webp
[2]: https://opensource.com/sites/default/files/2022-07/jaya-java-gc-parallel.webp
[3]: https://opensource.com/sites/default/files/2022-07/jaya-java-gc-concurrent.webp
[4]: https://opensource.com/sites/default/files/2022-07/g1.png
[5]: https://opensource.com/home-page-new

View File

@ -0,0 +1,184 @@
[#]: subject: "List Upgradable Packages With apt Command in Ubuntu"
[#]: via: "https://itsfoss.com/apt-list-upgradable/"
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
List Upgradable Packages With apt Command in Ubuntu
======
The [apt command][1] is used for package management in Debian and Ubuntu. While you are probably already familiar with the install and remove options, apt provides a few extra features as well.
One of them is the ability to see all the upgradable packages on your system. And to display them, all you have to do is to use this command in the terminal:
```
apt list --upgradable
```
As you can notice, you dont even need sudo to list the updatable packages. It just lists the packages that can be updated. It doesnt update them.
In fact, the apt command adds this hint when you run the `sudo apt update` command to update the local package repository cache.
```
Fetched 1,243 kB in 17s (71.4 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
30 packages can be upgraded. Run 'apt list --upgradable' to see them.
```
I dont recall any similar direct option in the older apt-get command to list all the upgradable packages. Thats one of the several new features apt has added on top of the older apt-get command.
Lets talk about it in a bit more detail.
### Listing all the upgradable packages
What you should know here is that **you only get to list the updates available through the APT package manager.** So, if you have added PPAs or [external repositories][2] to your systems sources.list, youll see the updates from them.
But you wont get updates for AppImage, Flatpak, Snap or some other packaging formats here.
In other words, it works with apt packages only.
So, to list all the upgradable packages on your Ubuntu or Debian system, you should update the local package cache first:
```
sudo apt update
```
And then your system will be aware of the available package updates. The apt command tells you how many packages can be upgraded at the end of the update command:
![The apt command shows the number of upgradable packages at the bottom of the apt update command output][3]
To see what package can be upgraded, run the command:
```
apt list --upgradable
```
You should see an output like this:
```
[email protected]:~$ apt list --upgradable
Listing... Done
apparmor/jammy-updates 3.0.4-2ubuntu2.1 amd64 [upgradable from: 3.0.4-2ubuntu2]
brave-browser/stable 1.40.113 amd64 [upgradable from: 1.40.107]
evolution-data-server-common/jammy-updates,jammy-updates 3.44.2-0ubuntu1 all [upgradable from: 3.44.1-0ubuntu2]
evolution-data-server/jammy-updates 3.44.2-0ubuntu1 amd64 [upgradable from: 3.44.1-0ubuntu2]
```
![Listing all the upgradable packages][4]
It **lists all the upgradable packages in alphabetical order** with the information on the currently installed version and the new available package version.
```
brave-browser/stable 1.40.113 amd64 [upgradable from: 1.40.107]
```
For example, It shows that I have Brave browser version 1.40.107 installed on the system, and version 1.40.113 is available.
What can you do with this information? Let me share a few things I can think of.
### Upgrade all the packages
This is probably what most casual Ubuntu users do. You can upgrade all the upgradable packages with the following command:
```
sudo apt upgrade
```
It lists what packages will be upgraded and then asks to confirm the upgrade by pressing enter or Y.
![Upgrade all packages][5]
If you are sure about upgrading all the packages, you can skip the Do you want to continue part by giving it the go ahead by adding -y to the command.
```
sudo apt upgrade -y
```
### Simulate an upgrade (but dont upgrade any packages)
This is what people did before the apt list command. With the simulate option, you dont actually make any changes. It just shows what packages will be installed or upgraded if you run the upgrade.
```
apt -s upgrade
```
You dont need to use sudo (even though I have used it in the screenshot below).
![Running an upgrade simulation with apt command][6]
### Upgrade only the selected packages
If you are managing an Ubuntu server and you dont want to upgrade all the packages but only one of a few selected ones (like MySQL/Ngnix), you can do that easily with the apt command.
```
sudo apt --only-upgrade install package_name
```
Actually, if you run the apt install command on an already installed package for which an update is available, it will upgrade the package.
With the `--only-upgrade` flag, you ensure that a package is only upgraded (if it is already installed). It wont install the given package if it is not already installed.
You can also upgrade selected few packages by providing their name:
```
sudo apt --only-upgrade install package1 package2
```
You can also do the opposite and [hold selected packages from the upgrade][7].
```
sudo apt-mark hold package_name
```
With that, the given package wont be upgraded when you upgrade all the system packages.
You can remove the hold with this command:
```
sudo apt-mark unhold package_name
```
### Does it show the kernel upgrades?
This is kind of tricky.
When you run the apt list upgradable command it shows all the packages that can be upgraded.
But if there are new kernel versions available, they might not be shown since the kernel package name starts with linux-headers-x-y. Its because the system treats them as new packages, not an upgrade on already installed package linux-headers-a-b.
However, you would still see “linux-generic-hwe” kind of package in the list of upgradable packages. Because that package will be upgraded (with the newer kernel).
### Conclusion
The ability to list upgradable packages is one of the several new features the apt command brought over the older apt-get command. For more on this topic, you can read my article [explaining the difference between the apt and apt-get commands][8].
As a desktop user, I dont always check the packages that can be upgraded. I go for the upgrade straightaway. However, when I am managing a server, I prefer to see what updates are available and then decide whether or not I am going for an upgrade.
How about you? Do you see a good use for this feature for yourself?
--------------------------------------------------------------------------------
via: https://itsfoss.com/apt-list-upgradable/
作者:[Abhishek Prakash][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/abhishek/
[b]: https://github.com/lkxed
[1]: https://itsfoss.com/apt-command-guide/
[2]: https://itsfoss.com/adding-external-repositories-ubuntu/
[3]: https://itsfoss.com/wp-content/uploads/2022/07/update-package-cache-ubuntu.png
[4]: https://itsfoss.com/wp-content/uploads/2022/07/apt-list-upgradable-packages-ubuntu.webp
[5]: https://itsfoss.com/wp-content/uploads/2022/07/upgrade-all-packages-ubuntu.webp
[6]: https://itsfoss.com/wp-content/uploads/2022/07/run-an-upgrade-simulation-apt-ubuntu.webp
[7]: https://itsfoss.com/prevent-package-update-ubuntu/
[8]: https://itsfoss.com/apt-vs-apt-get-difference/

View File

@ -0,0 +1,173 @@
[#]: subject: "OpenWrt, an open source alternative to firmware for home routers"
[#]: via: "https://opensource.com/article/22/7/openwrt-open-source-firmware"
[#]: author: "Stephan Avenwedde https://opensource.com/users/hansic99"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
OpenWrt, an open source alternative to firmware for home routers
======
OpenWrt is a Linux-based, open source operating system targeting embedded network devices.
If you're reading this article from home, you are probably connected with a LTE/5G/DSL/WIFI router. Such devices are usually responsible to route packets between your local devices (smartphone, PC, TV, and so on) and provide access to the world wide web through a built-in modem. Your router at home has most likely a web-based interface for configuration purposes. Such interfaces are often oversimplified as they are made for casual users.
If you want more configuration options, but don't want to spend for a professional device you should take a look at an alternative firmware such as [OpenWrt][2].
### OpenWrt features
OpenWrt is a Linux-based, open source operating system targeting embedded network devices. It is mainly used as a replacement for the original firmware on home routers of all kinds. OpenWrt comes with all the useful features a good router should have like a DNS server ([dnsmasq][3]), Wifi access point and client functionality, PPP protocol for modem functionality and, unlike with the standard firmware, everything is fully configurable.
### LuCI Web Interface
OpenWrt can be configured remotely by command line (SSH) or using [LuCI][4], a GUI configuration interface. LuCI is a lightweight, extensible web GUI written in [Lua][5], which enables an exact configuration of your device. Besides configuration, LuCI provides a lot of additional information like real time graphs, system logs, and network diagnostics.
![LuCI web interface][6]
Image by: Stephan Avenwedde, [CC BY-SA][7]
There are some optional extensions available for LuCI to add even further configuration choices.
### Writeable file system
Another highlight is the writeable filesystem. While the stock firmware is usually read-only, OpenWrt comes with a writeable filesystem thanks to a clever solution that combines OverlayFS with SquashFS and JFFS2 filesystems to allow installation of packages to enhance functionality. Find more information about the file system architecture in the [OpenWrt documentation][8].
### Extensions
OpenWrt has an associated package manager, [opkg][9], which allows to install additional services. Some examples are an FTP server, a DLNA media server, an OpenVPN server, a Samba server to enable file sharing, or Asterisk (software to control telephone calls). Of course, some extensions require appropriate resources of the underlying hardware.
### Motivation
You might wonder why you should try to replace a router manufacture's firmware, risking irreparable damage to your device and loss of warranty. If your device works the way you want, then you probably shouldnt. Never touch a running system! But if you want to enhance functionality, or if your device is lacking configuration options, then you should check whether OpenWrt could be a remedy.
In my case, I wanted a travel router which I can place on an appropriate position when Im on a campsite in order to get a good connection to the local Wifi access point. The router should connect itself as an ordinary client and broadcasts its own access point for my devices. This allows me to configure all my devices to connect with the routers access points and I only have to change the routers client connection when Im somewhere else. Moreover, on some campsites you only get an access code for one single device, which I can enhance with this setup.
As my travel router, I choose the TP-Link TL-WR902AC for the following reasons:
* Small
* Two Wifi antennas
* 5V power supply (USB)
* Low power consumption
* Cost effective (you get it for around $30)
To get an idea of the size, here it is next to a Raspberry Pi4:
![TP-Link TL-WR902AC next to a Raspberry Pi][10]
Image by: Stephan Avenwedde, [CC BY-SA 4.0][11]
Even though the router brings all hardware capabilities I demand, I relatively quickly found out that the default firmware dont let me configure it the way I wanted. The router is mainly intended as an Wifi access point, which repeats an existing Wifi network or connects itself to the web over the onboard Ethernet interface. The default firmware is very limited for these use cases.
Fortunately, the router is capable of running OpenWrt, so I decided to replace the original firmware with it.
### Installation
When your LTE/5G/DSL/WIFI router meets the [minimum requirements][12], chances are high that it's possible to run OpenWrt on it. As the next step, you look in the [hardware table][13] and check whether your devices is listed as compatible, and which firmware package you have to choose. The page for the [TP-Link TL-WR902AC][14] also includes the installation instructions which describe how to flash the internal memory.
The process of flashing the firmware can vary between different devices, so I wont go into detail on this. In a nutshell, I had to connect the device over  a TFTP server on a network interface with a certain IP address, rename the OpenWrt firmware file and then boot up the device considering pressing the reset button.
### Configuration
Once flashing was successfully, your device should now boot up with the new firmware. It may take a bit longer now to boot up as OpenWrt comes with much more features compared to the default firmware.
OpenWrt acts as a DHCP server, so in order to begin with configuration, make a direct Ethernet connection between your PC and the router, and configure your PCs Ethernet adapter as a DHCP client.
On Fedora Linux, to activate the DHCP client mode for your network adapter, first you have to find out the connection UUID by running:
```
$ nmcli connection show
NAME          UUID         TYPE      DEVICE
Wired Conn 1  7a96b...27a  ethernet  ens33
virbr0        360a0...673  bridge   virbr0
testwifi      2e865...ee8  wifi     --
virbr0        bd487...227  bridge   --
Wired Conn 2  16b23...7ba  ethernet --
```
Pick the UUID for the connection you want to modify and then run:
```
$ nmcli connection modify <UUID> ipv4.method auto
```
You can find more information about these commands in the [Fedora Networking Wiki][15].
After you have a connection to your router, open a web browser and navigate to [http://openwrt/][16]. You should now see LuCIs login manager:
![LuCI login][17]
Use **root** as the username, and leave the password field blank.
### Configuring Wifi and routing
To configure your Wifi antennas, click on the **Network** menu and select **Wireless**.
![LuCI wireless configuration][19]
On my device, the antenna **radio0** on top operates in 2.4 GHz mode and is connected to the local access point called *MOBILE-INTERNET*. The antenna **radio1** below operates at 5 GHz and has an associated access point with the SSID *OpenWrt_AV*. With a click of the **Edit**button, you can open the device configuration to decide whether the device belongs to the *LAN* or WWAN network. In my case, the access point *OpenWrt_AV* belongs to the LAN network and the client connection *MOBILE-INTERNET* belongs to the WWAN network.
![LuCI configuration screen][21]
Configured networks are listed under **Network**, in the **Interfaces** panel.
![Device list][23]
In order to get the functionality I want, network traffic must be routed between the LAN and the WWAN network. The routing can be configured in the **Firewall** section of the **Network** panel. I didnt change anything here because, by default, the traffic is routed between the networks, and incoming packets (from WWAN to LAN) have to pass the firewall.
So all you need to know is whether an interface belongs to LAN or (W)WAN. This concept makes it relatively easy to configure, especially for beginners. You can find more information in [OpenWrts basic networking][25] guide.
### Captive portals
Public Wifi access points are often protected by a [captive portal][26] where you have to enter an access code or similar. Usually, such portals show up when you are first connected to the access point and try to open an arbitrary web page. This mechanism is realized by the access point's DNS server.
By default, OpenWrt has a security feature activated that prevents connected clients from a [DNS rebinding attack][27]. OpenWrts rebind protection also prevents captive portals from being forwarded to clients, so you must disable rebind protection so you can reach captive portals. This option is in the **DHCP and DNS** panel of the **Network** menu.
![Firewall settings][28]
### Try OpenWrt
Thanks to an upgrade to OpenWrt, I got a flexible travel router based on commodity hardware. OpenWrt makes your router fully configurable and extensible and, thanks to the well-made web GUI, it's also appropriate for beginners. There are even a few [select routers][30] that ship with OpenWrt already installed. You are also able to enhance your router's functionality with lots of [available packages][31]. For example, Im using the [vsftp][32] FTP server to host some movies and TV series on a connected USB stick. Take a look at the [projects homepage][33], where you can find many reasons to switch to OpenWrt.
Image by: Stephan Avenwedde, [CC BY-SA 4.0][7]
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/7/openwrt-open-source-firmware
作者:[Stephan Avenwedde][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/hansic99
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/OSDC_Internet_Cables_520x292_0614_RD.png
[2]: https://openwrt.org
[3]: https://thekelleys.org.uk/dnsmasq/doc.html
[4]: https://openwrt.org/docs/guide-user/luci/start
[5]: https://opensource.com/article/20/2/lua-cheat-sheet
[6]: https://opensource.com/sites/default/files/2022-07/openwrt_luci_overview_c_0.png
[7]: https://creativecommons.org/licenses/by-sa/4.0/legalcode
[8]: https://openwrt.org/docs/techref/flash.layout
[9]: https://openwrt.org/docs/guide-user/additional-software/opkg
[10]: https://opensource.com/sites/default/files/2022-07/OpenWrt_Comparison_RaspberryPi.jpg
[12]: https://openwrt.org/supported_devices
[13]: https://openwrt.org/toh/start
[14]: https://openwrt.org/toh/tp-link/tl-wr902ac_v3
[15]: https://fedoraproject.org/wiki/Networking/CLI
[16]: http://openwrt/
[17]: https://opensource.com/sites/default/files/2022-07/openwrt_luci_login_manager.png
[19]: https://opensource.com/sites/default/files/2022-07/openwrt_luci_wireless_section_c.webp
[21]: https://opensource.com/sites/default/files/2022-07/openwrt_luci_wifi_device_configuration.webp
[23]: https://opensource.com/sites/default/files/2022-07/openwrt_luci_network_devices_0.webp
[25]: https://openwrt.org/docs/guide-user/base-system/basic-networking
[26]: https://en.wikipedia.org/wiki/Captive_portal
[27]: https://en.wikipedia.org/wiki/DNS_rebinding
[28]: https://opensource.com/sites/default/files/2022-07/openwrt_luci_firewall_settings.webp
[30]: https://opensource.com/article/22/1/turris-omnia-open-source-router
[31]: https://openwrt.org/packages/table/start
[32]: https://openwrt.org/docs/guide-user/services/nas/ftp.overview
[33]: https://openwrt.org/reasons_to_use_openwrt

View File

@ -0,0 +1,275 @@
[#]: subject: "9 Rather Unknown Ways of Using Neofetch in Linux"
[#]: via: "https://itsfoss.com/using-neofetch/"
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
9 Rather Unknown Ways of Using Neofetch in Linux
======
Neofetch is a simple command-line tool that [displays an ASCII logo of the distribution][1] along with a few system information in the terminal. It looks beautiful and you can easily show which distribution, desktop environment, and themes you are using when you share the screenshots of your desktop in various Linux communities.
![KDE Neon Neofetch][2]
For most users, thats all there is to Neofetch.
But Neofetch is highly customizable. You can display any ASCII logo instead of the distributions, filter out the information to display or replace the logos with cowsay messages.
Interesting, isnt it? Before I show you how to customize Neofetch, let me quickly go on installing it first, if you havent installed it already.
### Installing Neofetch
[Neofetch][3] is available in the official repo of all major Linux distributions. To install it in Ubuntu and [Debian-based distros][4], use:
```
sudo apt install neofetch
```
Fedora and Red Hat users can use the DNF package manager:
```
sudo dnf install neofetch
```
Arch and Manjaro users can [use the pacman command][5]:
```
sudo pacman -S neofetch
```
openSUSE users can use the Zypper command:
```
sudo zypper install neofetch
```
Once you have it installed, lets see how to use it.
### Using Neofetch
In its simplest form, enter the neofetch command in the terminal:
```
neofetch
```
And it will show you the default output that consists of the ASCII logo of your distribution and some system information.
![Neofetch output in Ubuntu][6]
Thats simple. But you can configure it to show some additional information or hide some.
#### 1. Display logo of another distro
By default neofetch shows the logo of the current distribution. No surprises there.
But you can have the ASCII logo of a different distribution than yours. Surprise!
Here is the Pop!OS logo in Kubuntu system.
![Displaying Logo of Pop!_OS in Kubuntu][7]
To do that, you have to use the ascii_distro flag.
```
neofetch --ascii_distro distroname
```
You know what! You can even display ASCII logo of Windows in Neofetch.
![neofetch windows logo][8]
#### 2. Show a smaller logo
The list of distros having ASCII art is listed in the man page of Neofetch. Now, there also exists a sublist of distros, which has a small ASCII art. That list can also be found in its man page.
![neofetch small logo][9]
To achieve this:
```
neofetch --ascii_distro <distroname>_small
```
You can make it permanent by editing the respective line on the config file.
If a distro logo doesnt have a small version, it displays the bigger one. And if you made a typo, it shows the Tux logo.
![Tux logo with Neofetch][10]
#### 3. Hiding Multiple Infos from view
In Neofetch, there is a lot of information is shown by default. You dont have to stick to them if you dont want to.
You can hide some information from the display. You can do that in two ways: either by providing options through the command line or by editing the configuration file.
I will prefer editing the config file, because it is one time and will take effect immediately, and no need to type it repeatedly.
Open neofetch config with [Vim or Nano][11] or your favorite editor using:
```
nano .config/neofetch/config.conf
```
![neofetch config file][12]
Here you can find multiple lines referring to “info”. Comment those that you want to hide and uncomment those to show. To comment, just add # at the beginning of a line.
Save the file and exit. Next, Neofetch run will be the modified one.
The same config file can be tweaked to show users in the system, CPU temperatures, battery information, etc.
![customised neofetch][13]
#### 4. Hide the logo or the info
You can tweak Neofetch to display only the system information and hide the ASCII logo.
```
neofetch --off
```
![neofetch without ascii logo][14]
Also, you can have Neofetch with only the ASCII logo, without system information:
```
neofetch -L
```
![neofetch with only ascii logo][15]
#### 5. Use a custom image as ASCII logo
Neofetch supports custom images to be applied to the ASCII logo part. This is achieved by several backends. Images can be applied through jp2a, caca, sixel, w3m backends.
By using jp2a, you can have your own image as an ascii art in neofetch.
![custom ascii logo in neofetch with jp2a backend][16]
To do this, use Neofetch like this:
```
neofetch --jp2a /path/to/image
```
Another type of output that is supported is the caca backend. On the terminal, enter:
```
neofetch --caca /path/to/image
```
![neofetch image with caca backend][17]
There are other backends also, which can be found on its man page.
#### 6. Add gradient colors by using lolcat with Neofetch
With lolcat, you can have a colorful neofetch. Install lolcat using your distributions package manager first:
```
sudo apt install lolcat
```
Once lolcat is installed, pipe neofetch to lolcat to get a rainbow effect:
```
neofetch | lolcat
```
![neofetch with lolcat][18]
#### 7. Use cowsay and fortune instead of logo
With the latest releases of Neofetch, you can now display cowsay and fortune in place of the ascii logo. For more fancy, the same output can be piped to lolcat.
```
neofetch --ascii "$(fortune | cowsay -W 30)" | lolcat
```
Cowsay program can also display other animal figures by specifying the cowfile with `-f` flag.
![neofetch with cowsay and lolcat][19]
For more fun and if you have some time to invest, type the below code and see an animated neofetch appearing:
```
neofetch --ascii "$(fortune | cowsay -f dragon -W 30)" | lolcat -ats 60
```
#### 8. Animate it
Speaking of animation, you can animate the entire Neofetch output with the pv command. It consumes a lot of time but if you are doing a screencast and want to amuse people, this could do the trick.
![A Video from YouTube][20]
With pv command installed on your system, use it in conjugation with Neofetch:
```
neofetch | pv -qL 100
```
This will begin typing character by character the neofetch art and info. Adjust the animation speed by changing the value from 100. Higher the value, faster is the animation.
#### 9. Custom colors for the title, underline and info panel
You can change the colors for the informational part. The parts of the informational panel are in the order: title, @, underline, subtitle, colon, info.
You can give a different part to each one of them by adding a color code in their position like this:
```
neofetch --colors 3 4 5 6 2 1
```
![neofetch custom color scheme one][21]
![neofetch custom color scheme two][22]
### Wrapping Up
There are many more ways to tweak Neofetch. You can always look into its man page.
As I said earlier, for most users Neoetch is just a simple, no-option command to pretty display system information and distribution logo in the terminal.
Even I never bothered to look into customizing Neofetch. It was my teammate Sreenath who likes experimenting with these things and he came up with the idea and I had a feeling that Its FOSS readers like you might find it amusing.
Over to you now. Did you find some surprising new usage of Neofetch? Do you know some other cool trick? Share it with us in the comments.
--------------------------------------------------------------------------------
via: https://itsfoss.com/using-neofetch/
作者:[Abhishek Prakash][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/abhishek/
[b]: https://github.com/lkxed
[1]: https://itsfoss.com/display-linux-logo-in-ascii/
[2]: https://itsfoss.com/wp-content/uploads/2021/01/kde-neon-neofetch.png
[3]: https://github.com/dylanaraps/neofetch
[4]: https://itsfoss.com/debian-based-distros/
[5]: https://itsfoss.com/pacman-command/
[6]: https://itsfoss.com/wp-content/uploads/2022/07/neofetch-output.png
[7]: https://itsfoss.com/wp-content/uploads/2022/07/Changed-logo-of-distribution.png
[8]: https://itsfoss.com/wp-content/uploads/2022/07/neofetch-windows-logo-800x490.png
[9]: https://itsfoss.com/wp-content/uploads/2022/07/neofetch-small-logo-800x306.png
[10]: https://itsfoss.com/wp-content/uploads/2022/07/neofetch-tux-logo.png
[11]: https://itsfoss.com/vim-vs-nano/
[12]: https://itsfoss.com/wp-content/uploads/2022/07/neofetch-config-file-800x419.png
[13]: https://itsfoss.com/wp-content/uploads/2022/07/customised-neofetch-800x164.png
[14]: https://itsfoss.com/wp-content/uploads/2022/07/neofetch-without-ascii-logo.png
[15]: https://itsfoss.com/wp-content/uploads/2022/07/neofetch-with-only-ascii-logo.png
[16]: https://itsfoss.com/wp-content/uploads/2022/07/custom-ascii-logo-in-neofetch-with-jp2a-backend-800x314.png
[17]: https://itsfoss.com/wp-content/uploads/2022/07/neofetch-image-with-caca-backend-800x278.png
[18]: https://itsfoss.com/wp-content/uploads/2022/07/neofetch-with-lolcat-800x303.png
[19]: https://itsfoss.com/wp-content/uploads/2022/07/neofetch-with-cowsay-and-lolcat-800x240.png
[20]: https://player.vimeo.com/video/727286686
[21]: https://itsfoss.com/wp-content/uploads/2022/07/neofetch-custom-color-scheme-one.png
[22]: https://itsfoss.com/wp-content/uploads/2022/07/neofetch-custom-color-scheme-two.png

View File

@ -0,0 +1,124 @@
[#]: subject: "A guide to productivity management in open source projects"
[#]: via: "https://opensource.com/article/22/7/productivity-management-open-source-projects"
[#]: author: "Thabang Mashologu https://opensource.com/users/tmashologu"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
A guide to productivity management in open source projects
======
Enhance productivity by applying the SPACE framework to open source teams.
![Working on a team, busy worklife][1]
Image by: opensource.com
Open source is one of the most important technology trends of our time. Its the lifeblood of the digital economy and the preeminent way that software-based innovation happens today. In fact, its estimated that over 90% of software released today contains open source libraries.
There's no doubt the open source model is effective and impactful. But is there still room for improvement? When comparing the broader software industrys processes to that of open source communities, one big gap stands out: productivity management.
By and large, open source project leads and maintainers have been slow to adopt modern productivity and project management practices and tools commonly embraced by startups and enterprises to drive the efficiency and predictability of software development processes. Its time we examine how the application of these approaches and capabilities can improve the management of open source projects for the better.
### Understanding productivity in open source software development
The open source model, at its heart, is community-driven. There is no single definition of success for different communities, so a one-size-fits-all approach to measuring success does not exist. And what we have traditionally thought of as productivity measures for software development, like commit velocity, the number of pull requests approved and merged, and even the lines of code delivered, only tell part of the story.
Open source projects are people-powered. We need to take a holistic and humanistic approach to measuring productivity that goes beyond traditional measures. I think this new approach should focus on the fact that great open source is about communication and coordination among a diverse community of contributors. The level of inclusivity, openness, and transparency within communities impacts how people feel about their participation, resulting in more productive teams.
These and other dimensions of what contributes to productivity on open source teams can be understood and measured with the SPACE framework, which was developed based on learnings from the proprietary world and research conducted by GitHub, the University of Victoria in Canada, and Microsoft. I believe that the SPACE framework has the potential to provide a balanced view of what is happening in open source projects, which would help to drive and optimize collaboration and participation among project team members.
### A more accurate productivity framework
The SPACE framework acronym stands for:
* Satisfaction and well-being
* Performance
* Activity
* Communication and collaboration
* Efficiency and flow
Satisfaction and well-being refer to how fulfilled developers feel with the team, their tools, and the environment, as well as how healthy and happy they are. Happiness is somewhat underrated as a factor in the success of teams. Still, there is strong evidence of a direct correlation between the way people feel and their productivity. In the open source industry, surveying contributors, committers, and maintainers about their attitudes, preferences, and priorities about what is being done and how is essential to understanding attitudes and opinions.
Performance in this context is about evaluating productivity in terms of the outcomes of processes instead of output. Team-level examples are code-review velocity (which captures the speed of reviews) and story points shipped. More holistic measures focus on quality and reliability. For example, was the code written in a way that ensures it will reliably do what it is supposed to do? Are there a lot of bugs in the software? Is industry adoption of the software growing?
Open source activity focuses on measuring design and development and CI/CD metrics, like build, test, deployments, releases, and infrastructure utilization. Example metrics for open source projects are the number of pull requests, commits, code reviews completed, build releases, and project documents created.
Communication and collaboration capture how people and teams work together, communicate, and coordinate efforts with high transparency and awareness within and between teams. Metrics in this area focus on the vibrancy of forums, as measured by the number of posts, messages, questions asked and answered, and project meetings held.
Finally, efficiency and flow refer to the ability to complete work and progress towards it with minimal interruptions and delays. At the individual developer level, this is all about getting into a flow that allows complex tasks to be completed with minimal distractions, interruptions, or context switching. At the project team level, this is about optimizing flow to minimize the delays and handoffs that take place in the steps needed to take software from an idea or feature request to being written into code. Metrics are built around process delays, handoffs, time on task, and the ease of project contributions and integrations.
### Applying the SPACE framework to open source teams
Here are some sample metrics to illustrate how the SPACE framework could be used for an open source project.
#### Satisfaction and well-being
* Contributor satisfaction
* Community sentiment
* Community growth & diversity
#### Performance
* Code review velocity
* Story points shipped
* Absence of bugs
* Industry adoption
#### Activity
* number of pull requests
* number of commits
* number of code reviews
* number of builds
* number of releases
* number of docs created
#### Communication and collaboration
* Forum posts
* Messages
* Questions asked & answered
* Meetings
#### Efficiency and flow
* Code review timing
* Process delays & handoffs
* Ease of contributions/integration
### Tools for managing open source projects must be fit for purpose
There is an opportunity to leverage the tools and approaches startups and high-growth organizations use to understand and improve open source development efficiency. All while putting open sources core tenets, like openness and transparency, into practice.
Tools used by open source teams should enable maintainers and contributors to be productive and successful, while allowing the projects to be open and welcoming to everyone, including developers who may work in multiple organizations and even competing companies. It is also critical to provide an excellent onboarding experience for new contributors and accelerate their time-to-understanding and time-to-contribution.
Tools for managing open source projects should transparently manage data and accurately reflect project progress based on where the collaboration happens: in the codebase and repositories. Open source teams should be able to see real-time updates based on updates to issues and pull requests. And, project leads and maintainers should have the flexibility to decide whether access to the project should be completely public or if it should be limited to trusted individuals for issues or information of a more sensitive nature.
Ideally, tools should allow self-governed project teams to streamline coordination, processes, and workflows and eliminate repetitive tasks through automation. This reduces human friction and empowers maintainers and contributors to focus on what really matters: contributing to the ecosystem or community and delivering releases faster and more reliably.
The tools teams use should also support collaboration from people wherever they are. Since open source teams work in a remote and asynchronous world, tools should be able to integrate everyones contributions wherever and whenever they occur. These efforts should be enabled by great documentation stored in a central and easily accessible place. And finally, the tools should enable continuous improvement based on the types of frameworks and measures of productivity outlined above.
Features that allow for increased transparency are especially important for open source projects. Tools should help keep community members aligned and working towards a common goal with a project roadmap that shows work is in flight, progress updates, and predicted end dates.
### Conclusion
Open source projects are a benefit to us all, and as such, it benefits everyone to make the processes that exist within these projects as productive as possible.
By leveraging concepts like the SPACE framework and modern tools, we can ditch the spreadsheets and manual ways of tracking, measuring, and improving productivity. We can adapt approaches that power software development in the proprietary world and leverage modern tools that can help increase the quality, reliability, and predictability of open source software releases. Open source is far too important to leave to anything less.
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/7/productivity-management-open-source-projects
作者:[Thabang Mashologu][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/tmashologu
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/team_dev_email_chat_video_work_wfm_desk_520.png

View File

@ -0,0 +1,216 @@
[#]: subject: "How I create music playlists on Linux"
[#]: via: "https://opensource.com/article/22/7/c-linux-mp3"
[#]: author: "Rikard Grossman-Nielsen https://opensource.com/users/rikardgn"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How I create music playlists on Linux
======
Use this C program I made on Linux to listen to your favorite songs on the go.
![Open source software helps artists create music][1]
Image by: Opensource.com
I recently wrote a C program in Linux to create a smaller random selection of MP3 files from my extensive MP3 library. The program goes through a directory containing my MP3 library, and then creates a directory with a random, smaller selection of songs. I then copy the MP3 files to my smartphone to listen to them on the go.
Sweden is a sparsely populated country with many rural areas where you don't have full cell phone coverage. That's one reason for having MP3 files on a smartphone. Another reason is that I don't always have the money for a streaming service, so I like to have my own copies of the songs I enjoy.
You can download my application from its [Git repository][2]. I wrote it for Linux specifically in part because it's easy to find well-tested file I/O routines on Linux. Many years ago, I tried writing the same program on Windows using proprietary C libraries, and I got stuck trying to get the file copying routing to work. Linux gives the user easy and direct access to the file system.
In the spirit of open source, it didn't take much searching before I found file I/O code for Linux to inspire me. I also found some code for allocating memory which inspired me. I wrote the code for random number generation.
The program works as described here:
1. It asks for the source and destination directory.
2. It asks for the number of files in the directory of MP3 files.
3. It searches for the percentage (from 1.0 to 88.0 percent) of your collection that you wish to copy. You can also enter a number like 12.5%, if you have a collection of 1000 files and wish to copy 125 files from your collection rather than 120 files. I put the cap at 88% because copying more than 88% of your library would mostly generate a collection similar to your base collection. Of course, the code is open source so you can freely modify it to your liking.
4. It allocates memory using pointers and malloc. Memory is required for several actions, including the list of strings representing the files in your music collection. There is also a list to hold the randomly generated numbers.
5. It generates a list of random numbers in the range of all the files (for example, 1 to 1000, if the collection has 1000 files).
6. It copies the files.
Some of these parts are simpler than others, but the code is only about 100 lines:
```
#include <dirent.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h> /* include necessary header files */
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#define BUF_SIZE 4096 /* use buffer of 4096 bytes */
#define OUTPUT_MODE 0700 /*protect output file */
#define MAX_STR_LEN 256
int main(void) {
DIR *d;
struct dirent *dir;
char strTemp[256], srcFile[256],
dstFile[256], srcDir[256], dstDir[256];
char **ptrFileLst;
char buffer[BUF_SIZE];
int nrOfStrs=-1, srcFileDesc,
dstFileDesc, readByteCount,
writeByteCount, numFiles;
int indPtrFileAcc, q;
float nrFilesCopy;
// vars for generatingRandNumList
int i, k, curRanNum, curLstInd,
numFound, numsToGen, largNumRange;
int *numLst;
float procFilesCopy;
printf("Enter name of source Directory\n");
scanf("%s", srcDir);
printf("Enter name of destionation Directory\n");
scanf("%s", dstDir);
printf("How many files does the directory with mp3 files contain?\n");
scanf("%d", &numFiles);
printf("What percent of the files do you wish to make a random selection of\n");
printf("enter a number between 1 and 88\n");
scanf("%f", &procFilesCopy);
// allocate memory for filesList, list of random numbers
ptrFileLst= (char**) malloc(numFiles * sizeof(char*));
for (i = 0; i < numFiles; i++) {
ptrFileLst[i] = (char*)malloc(MAX_STR_LEN * sizeof(char));
}
largNumRange = numFiles;
nrFilesCopy = (procFilesCopy / 100) * numFiles;
numsToGen = (int)((procFilesCopy / 100) * numFiles);
printf("nrFilesCopy=%f", nrFilesCopy);
printf("NumsToGen=%d", numsToGen);
numLst = malloc(numsToGen * sizeof(int));
srand(time(0));
numLst[0] = rand() % largNumRange + 1;
numFound=0;
do {
curRanNum = (int)rand() % largNumRange + 1;
if (numLst[0] == curRanNum) {
numFound=1;
}
} while(numFound == 1);
numLst[1] = curRanNum;
getchar();
curLstInd = 1;
i = 0;
while(1) {
do {
numFound = 0;
curRanNum = (int)rand() % largNumRange + 1;
for (int k = 0; k <= curLstInd; k++){
if (numLst[k] == curRanNum)
numFound = 1;
}
} while(numFound == 1);
numLst[curLstInd+1] = curRanNum;
curLstInd++;
i++;
// numsToGen=Total numbers to generate minus two
// already generated by the code above this loop
if (i == (numsToGen-2))
break;
}
d = opendir(srcDir);
if (d) {
while ( (dir = readdir(d)) != NULL ) {
strcpy(strTemp, dir->d_name);
if (strTemp[0] != '.') {
nrOfStrs++;
strcpy(ptrFileLst[nrOfStrs], strTemp);
}
}
closedir(d);
}
for (q = 0; q <= curLstInd; q++) {
indPtrFileAcc = numLst[q];
strcpy(srcFile, srcDir);
strcat(srcFile, "/");
strcat(srcFile, ptrFileLst[indPtrFileAcc]);
strcpy(dstFile, dstDir);
strcat(dstFile, "/");
strcat(dstFile, ptrFileLst[indPtrFileAcc]);
srcFileDesc = open(srcFile, O_RDONLY);
dstFileDesc = creat(dstFile, OUTPUT_MODE);
while(1) {
readByteCount = read(srcFileDesc, buffer, BUF_SIZE);
if (readByteCount <= 0)
break;
writeByteCount = write(dstFileDesc, buffer, readByteCount);
if(writeByteCount <= 0)
exit(4);
}
//close the files
close(srcFileDesc);
close(dstFileDesc);
}
}
```
This code is possibly the most complex:
```
while(1) {
readByteCount = read(srcFileDesc, buffer, BUF_SIZE);
if (readByteCount <= 0)
break;
writeByteCount = write(dstFileDesc, buffer, readByteCount);
if (writeByteCount <= 0)
exit(4);
}
```
This reads a number of bytes (readByteCount) from a file specified into the character buffer. The first parameter to the function is the file name (srcFileDesc). The second parameter is a pointer to the character buffer, declared previously in the program. The last parameter of the function is the size of the buffer.
The program returns the number of the bytes read (in this case, 4 bytes). The first `if` clause breaks out of the loop if a number of 0 or less is returned.
If the number of read bytes is 0, then all of the writing is done, and the loop breaks to write the next file. If the number of bytes read is less than 0, then an error has occurred and the program exits.
When the 4 bytes are read, it will write to them.The write function takes three arguments.The first is the file to write to, the second is the character buffer, and the third is the number of bytes to write (4 bytes). The function returns the number of bytes written.
If 0 bytes are written, then a write error has occurred, so the second `if` clause exits the program.
The `while` loop reads and copies the file, 4 bytes at a time, until the file is copied. When the copying is done, you can copy the directory of randomly generated mp3 files to your smartphone.
The copy and write routine are fairly efficient because they use file system calls in Linux.
### Improving the code
This program is simple and it could be improved in terms of its user interface, and how flexible it is. You can implement a function that calculates the number of files in the source directory so you don't have to enter it manually, for instance. You can add options so you can pass the percentage and path non-interactively.nBut the code does what I need it to do, and it's a demonstration of the simple efficiency of the C programming language.
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/7/c-linux-mp3
作者:[Rikard Grossman-Nielsen][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/rikardgn
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/LIFE_musicinfinity.png
[2]: https://github.com/rikardgn/learnC/blob/main/randMp3Copy.c

View File

@ -0,0 +1,84 @@
[#]: subject: "Why use a Raspberry Pi to power your business"
[#]: via: "https://opensource.com/article/22/1/raspberry-pi-business"
[#]: author: "Giuseppe Cassibba https://opensource.com/users/peppe8o"
[#]: collector: "lujun9972"
[#]: translator: " void-mori"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
为何要使用树莓派为你的业务提供动力
======
为何小小的单板机是智能工作以及小型办公室的未来
![A chair in a field.][1]
随着疫情的大流行,我们的工作方式也正在发生着改变。工作的分散化正在成为所有公司需要面临的一项重要挑战。
### 智能办公室
即使所有的工厂都能和智能工作搭上一点边哪怕仅仅是通过VPN来对员工的笔记本电脑进行远程控制添加evolution而带来一些基本办公服务尽可能的拉近人与人之间的距离这些都能够极大降低数据中心的负载并且提高人们的工作体验。这个方案还有一个额外的影响就是从信息和通信技术上来说消除了许多单点故障。
和在公司外部有成百上千的工作场地不同,更像是在世界范围内有着成百上千的小型办公室/分支,这就是所谓的“智能办公室”。
这种表述可能会让许多的ICT专家感到恐慌因为这种文化使得一台大机器即服务器关联了每个办公室即使摊开计算资源的优势非常明显。
### 一个不同的角度
如果你能够通过一个50美金的小开发板在大服务器上交付服务会怎么样如果这个小板子只需要一张SD卡和一个普通的USB电源支持那又会怎么样呢这就是[Raspberry Pi][2]是最灵活的解决方案的原因所在。
树莓派开发板是尺寸非常小的运行Linux的计算机。它有一个由树莓派基金会提供和维护的操作系统—Raspberry Pi OS。它基于Debian和最知名的Linux发行版共享许多软件包。此外许多树莓派的开发板能够完美运行最知名的Ubuntu Server它涵盖了ARM处理器给予了对低功耗处理器的支持。
**[ 阅读下一篇: [在enterprise IT中使用树莓派的7种方式][3] ]**
但树莓派开发板对小公司来说也是一个很好的机会,以能够承担得起的代价获得大量的(开源)服务。这种情况下,你必须考虑数据丢失的风险,因为你把所有的服务运行在一个小的,消费级的硬件上。不过设置正确的备份/还原程序能够降低这些风险。
### 你能从树莓派开发板上提供什么服务?
大多数服务通常由更昂贵的服务器提供。“大多数”属性取决于一些限制:
* **ARM处理器:** 一些软件包只支持X86/X64处理器。这是最难克服的挑战之一。另一方面ARM处理器的市场份额不断增长使得程序员让他们的软件有兼容ARM处理器的版本。
* **内存容量:** 这是一个仅限于在复杂应用以复杂的方式进行复杂的计算的情况下讨论的问题。很多时候,只不过是关于重新访问代码,拆分步骤,并保持简单高效的问题。此外,如果一个服务因为少数几个用户而需要大量的内存/CPU这大概也意味着此服务没有正常工作。这可能是你消除浪费资源的旧问题的一个机会。 最后最新的树莓派开发板把内存容量升级到了8GB是一个很大的提升。
* **对服务器没有经验的用户:** 这是另一个问题你可以在存储了系统和运行数据的树莓派上使用micro-SD卡中的基础镜像。
咱就是说,你能够用树莓派做很多有趣的事情。在[我的博客][4]里我通过运行各种服务进行了测试—从基本的LAMP服务器到复杂的CRM。从简单到复杂系统全部都是开源的例如
* 代理服务器(也能够添加广告拦截服务)
* 电子邮件服务器
* 打印服务器
* [酒店管理][5]
* 联系人关系管理
* [私人社交网络][6]
* 私人论坛
* 私有Git门户网站
* 网络监控服务器
* [许多其他有用的服务][7]
对树莓派来说另一个有趣的机会是在你的远程办公室获得提供高级服务的wifi热点并且可以从它的以太网端口进行控制。 
最后,[树莓派也能够运行容器][8],这是一个额外的工具,从这个不可思议的开发板中获得一个可用的服务世界。
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/1/raspberry-pi-business
作者:[Giuseppe Cassibba][a]
选题:[lujun9972][b]
译者:[void-mori](https://github.com/void-mori)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/peppe8o
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BIZ_WorkInPublic_4618517_1110_CS_A.png?itok=RwVrWArk "A chair in a field."
[2]: https://opensource.com/resources/raspberry-pi
[3]: https://enterprisersproject.com/article/2020/11/raspberry-pi-7-enterprise-it-uses
[4]: https://peppe8o.com
[5]: https://opensource.com/article/20/4/qloapps-raspberry-pi
[6]: https://opensource.com/article/20/3/raspberry-pi-open-source-social
[7]: https://peppe8o.com/category/raspberrypi/
[8]: https://opensource.com/article/20/8/kubernetes-raspberry-pi

View File

@ -0,0 +1,268 @@
[#]: subject: "Beginners Guide to Installing Arch Linux on VirtualBox"
[#]: via: "https://itsfoss.com/install-arch-linux-virtualbox/"
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: "hanszhao80"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
VirtualBox 安装 Arch Linux 的新手操作指南
======
[Arch Linux 在桌面 Linux 世界中非常流行][1]。受欢迎的原因之一是 [安装 Arch Linux][2] 本身就是一项复杂的任务。
我没有夸大其词。安装 [Ubuntu 或 Debian][3] 比 Arch Linux 容易得多,因为官方没给后者提供图形界面的安装程序。这时虚拟机就派上用场了。
你可以先在 VirtualBox 中尝试安装 Arch Linux看看它是否是你想在实际硬件上运行的系统。通过这种方式你可以在不打乱当前操作系统的情况下体验 Arch Linux。
在本文,我将一步一步指导你完成一个实用的 Arch Linux 虚拟机的安装过程。
### 在 VirtualBox 上安装 Arch Linux
毫无疑问,你需要先 [在 Linux 上安装 VirtualBox][4](或 Windows。在 Windows 上,只需访问 Oracle 的网站并下载 VirtualBox。
[下载 VirtualBox][5]
如果你使用的是 Windows 10 或更高版本,请确保你的系统已启用虚拟化。
完成后,你需要到 [Arch Linux 官方网站][6] 下载 ISO 文件。你应该找到 [使用 torrent 下载][7] 或直接下载文件的选项。
![][8]
你可以保留 ISO 文件以备不时之需,安装成功后也可以将其删除以 [释放系统上的空间][9]。
现在,让我们开始在 VirtualBox 上安装 Arch Linux 吧。
#### 第一部分 创建虚拟机
**第一步**:首先,你需要在 VirtualBox 中设置一下。启动 VirtualBox 并单击 **<ruby>新建<rt>New</rt></ruby>** 来创建一个虚拟机。
![][10]
注意,你可以使用<ruby>向导模式<rt>guided mode</rt></ruby>继续创建虚拟机,但使用<ruby>专家模式<rt>expert mode</rt></ruby>可以一目了然地获得更多选项。
![][11]
因此,我推荐使用专家模式来创建虚拟机。
不用担心,专家模式同样简单,只是多了一些额外的可选项,无需担心其他任何事情。
**第二步**:输入你的虚拟机名称。当你在<ruby>名称<rt>Name</rt></ruby>字段中输入 **Arch Linux** 时,它会分别自动检测<ruby>类型<rt>Type</rt></ruby><ruby>版本<rt>Version</rt></ruby>
![][12]
你应该增加内存大小以舒适地使用虚拟机。如果只是用于小型测试,你可以继续使用默认设置。
我在这个例子中分配了 **4 GB 左右的内存**
另外,请确保在<ruby>硬盘<rt>Hard disk</rt></ruby>选项下选择**<ruby>现在创建虚拟硬盘<rt>create a virtual hard disk</rt></ruby>**。它应该是默认选项。
现在,继续设置虚拟硬盘大小。
**第三步**:你可以选择虚拟硬盘的存放位置,并根据你的需求调整大小。最小分配大小 (8 GB) 对于安装系统应该不是问题,但安全起见,你可能得分配至少 10 到 15 GB。
![][13]
接下来,你需要将硬盘硬盘文件类型选择为 **VDI (VirtualBox <ruby>磁盘镜像<rt>Disk Image</rt></ruby>)** ,将存储选择为 **<ruby>动态分配<rt>Dynamically assigned</rt></ruby>**,如上图所示。
VDI 是虚拟硬盘最常见的硬盘类型。
当你为硬盘存储选择 **动态分配** 选项时,这意味着存储空间将根据使用情况进行使用。换言之,当创建虚拟机后,并不会立即将这 15 GB 的空间从你的磁盘中锁定。
现在,你所要做的就是点击 **<ruby>创建<rt>Create</rt></ruby>** 来添加虚拟机。
#### 第二部分 添加 ISO 文件以开始安装 Arch Linux
![][14]
当虚拟机在左侧列表中出现后,你可以查看其配置并在 **<ruby>存储<rt>Storage</rt></ruby>** 选项下选择 ISO 文件作为磁盘驱动。
你也可以单独前往虚拟机设置以探索更多内容并选择 ISO 文件。
![][15]
为此,你需要导航至虚拟机设置的 **<ruby>存储<rt>Storage</rt></ruby>** 页签。
![][16]
在这里,你必须单击 <ruby>控制器<rt>Controller</rt></ruby> 下的 **<ruby>没有盘片<rt>Empty</rt></ruby>**,然后继续选择 Arch Linux ISO 文件作为磁盘文件(如上图所示)。
![][17]
完成选择后,点击 **OK** 以保存设置的变更。
将 ISO 设置为要引导的磁盘时,虚拟机设置应如下所示:
![][18]
现在,点击 **<ruby>启动<rt>Start</rt></ruby>** 启动虚拟机并开始安装。
#### 第三部分 使用引导式安装程序安装 Arch Linux
使用 [介绍一个引导式安装程序][19] 的方法使安装 Arch Linux 变得更容易,也就是说,它为你提供了设置成熟的 Arch Linux 系统所需的所有选项。
因此,在引导式安装程序的帮助下,你不必单独安装桌面环境和其他基本软件包。你所要做的就是按照屏幕上的说明选择适合你的选项。
在本文中,我们将重点介绍引导式安装程序。如果你想自己做,你应该遵循我们的 [Arch 安装指南][2]。
继续安装流程,当你启动虚拟机时,将看到以下屏幕:
![][20]
第一个选项是理想的处理方式。如果你有特定的要求,可以选择其他选项来启动 Arch Linux。
现在,你应该正在查看一个终端窗口。以下是如何开始:
**第一步**:输入 `archinstall` 以使用引导式安装程序启动安装。
![][21]
**第二步**根据你的要求选择键盘布局美式布局应该是最常见的选择。简单地输入一个数字即可进行选择如下图所示例如26
![][22]
**第三步**:接下来,你需要选择一个区域来下载包。
![][23]
选择首选地区而不是“<ruby>全球<rt>“Worldwide”</rt></ruby>”。这至关重要,因为如果你选择 **全球** 作为你的地区,它会下载许多不必要的包。
**第四步**:选择区域后,它会要求你选择驱动器进行安装。在这个例子中,我们已经创建了一个大约 15 GB 的虚拟驱动器,显示为 **/dev/sda**。
类似的,根据大小检查你创建的驱动器,然后选择该磁盘继续。在这里,我输入 `1` 作为输入;你的可能会有所不同。
![][24]
**第五步**:接下来,你将被询问以下内容:
- **选择文件系统类型**
- **加密密码** (可选的)
- **主机名**
- **创建 root 密码** (可选的)
- **创建超级用户**
- **选择一个预编程的配置文件**
![][25]
在我的测试中,我选择了 BTRFS 作为文件系统,没有设置任何磁盘加密密码。
主机名可随心所欲的设置,但我建议保持简短。
你可以选择创建一个 root 密码,即使不这么做也应该没什么问题。不过,你需要创建一个具有 Sudo 权限的超级用户。
我使用 **admin/pass** 作为用户名和密码。不过,如果你不想让其他人访问你计算机上的虚拟机,则不应使用易于猜测的密码。
然后,你将看到一个选择配置文件的选项。在这种情况下,我们需要一个成熟的 Arch Linux 桌面。因此,我们通过输入 `0` 来选择 **<ruby>桌面<rt>desktop</rt></ruby>**。
**第六步**:接下来,你将被要求选择桌面环境。我决定使用 KDE。你可以选择任何你喜欢的。
![][26]
**第七步**:最后,你将被要求选择显卡驱动程序。由于我们是在 VirtualBox 上安装的 Arch Linux你可以选择选项 4**VMware/VirtualBox**,如下图所示:
![][27]
你可能还会被要求输入“是y或否no”选择 pipewire 而不是 PulseAudio 作为音频服务。选任何一个都应该都能达到目的。
**第八步**:接下来是重要的一步。在这里,如果你需要内核的 LTS 版本,你可以选择使用 **linux-lts**,或者继续使用默认值。
![][28]
安装程序会提示你输入想安装的软件包。在这里,我们没有任何特殊要求,因此我们将其留空并按回车键跳过。
**第九步**:你将被要求选择所需的网络适配器以启用互联网访问。你必须选择以下选项:
**<ruby>使用网络管理器来控制和管理你的互联网连接<rt>Use network manager to control and manage your internet connection</rt></ruby>**
![][29]
**第十步**:下一步需要定义时区。选择适用于你的时区,或继续使用默认选项。
**第十一步**:完成后,它将显示你选择的大部分选项以供确认。按 **回车** 继续。
![][30]
**第十二步**:安装完成需要花费几分钟时间,这取决于你的互联网连接速度。
安装完成后,它会要求你**chroot 进入新创建的安装以进行安装后配置**,但我们不需要。因此输入 `N` 以完成安装。
**第十三步**:最后,你应该会再次看到终端窗口。输入:
```
shutdown now
```
这将安全地退出安装并关闭虚拟机。
一切就绪!在启动安装了 Arch 的虚拟机之前,你还需要做一件事 —— **移除选择作为光驱的 ISO 磁盘**。与添加启动 ISO 的方式类似,你可以前往虚拟机设置并将其删除,如下所示:
![][31]
到此为止你已在 VirtualBox 上安装了 Arch Linux。
你所要做的就是启动虚拟机,在我的例子中它是这样的:
![virtualbox arch][32]
尽管浏览这些选项需要一些时间,但 Arch Linux 上新的引导式安装程序可以节省大量时间使必填项配置正确。
![][33]
同样的步骤也适用于在你的计算机上安装 Arch Linux。你需要用 Arch Linux ISO 文件 [使用 Etcher 制作单独的可启动 USB 盘][34]。
### 总结
[Arch Linux 成为一种流行的选择][1] 有多种原因。但是,如果这是你第一次安装,或者你想对其进行测试,那么虚拟机是在不打乱主机的情况下体验它的最佳方式。
我希望这可以帮助你在 VirtualBox 上安装 Arch Linux。在下面的评论中让我知道你的想法。
--------------------------------------------------------------------------------
via: https://itsfoss.com/install-arch-linux-virtualbox/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[hanszhao80](https://github.com/hanszhao80)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/why-arch-linux/
[2]: https://itsfoss.com/install-arch-linux/
[3]: https://itsfoss.com/debian-vs-ubuntu/
[4]: https://itsfoss.com/install-virtualbox-ubuntu/
[5]: https://www.virtualbox.org/wiki/Downloads
[6]: https://archlinux.org/download/
[7]: https://itsfoss.com/best-torrent-ubuntu/
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/archlinux-downloads.png?resize=800%2C419&ssl=1
[9]: https://itsfoss.com/free-up-space-ubuntu-linux/
[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-new.png?resize=800%2C562&ssl=1
[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-expert-mode.png?resize=707%2C438&ssl=1
[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-create.png?resize=800%2C536&ssl=1
[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-disk.png?resize=800%2C528&ssl=1
[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/choose-disk-virtualbox-arch.png?resize=800%2C440&ssl=1
[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-settings-option.png?resize=800%2C551&ssl=1
[16]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-choose-iso.png?resize=800%2C314&ssl=1
[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-arch-iso-select.png?resize=800%2C348&ssl=1
[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-set-start.png?resize=800%2C548&ssl=1
[19]: https://news.itsfoss.com/arch-linux-easy-install/
[20]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-archlinux-boot.png?resize=800%2C593&ssl=1
[21]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/vb-archinstall-guided.png?resize=800%2C400&ssl=1
[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/vb-archinstall-kb-layout.png?resize=800%2C694&ssl=1
[23]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/archinstall-region.png?resize=800%2C664&ssl=1
[24]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/archinstall-selectdisk.png?resize=800%2C199&ssl=1
[25]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/archinstall-desktop-configure.png?resize=800%2C497&ssl=1
[26]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/archinstall-virtualbox-desktop-environment.png?resize=800%2C415&ssl=1
[27]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-environment.png?resize=419%2C173&ssl=1
[28]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/archinstall-linux-kernel.png?resize=800%2C692&ssl=1
[29]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-arch-network-manager.png?resize=800%2C151&ssl=1
[30]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/archinstall-confirmation.png?resize=800%2C697&ssl=1
[31]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/iso-remove-archinstall.png?resize=800%2C286&ssl=1
[32]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-arch.png?resize=800%2C635&ssl=1
[33]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/kde-arch-virtualbox.png?resize=800%2C453&ssl=1
[34]: https://itsfoss.com/install-etcher-linux/

View File

@ -0,0 +1,324 @@
[#]: subject: "Plotting Data in R: Graphs"
[#]: via: "https://www.opensourceforu.com/2022/05/plotting-data-in-r-graphs/"
[#]: author: "Shakthi Kannan https://www.opensourceforu.com/author/shakthi-kannan/"
[#]: collector: "lkxed"
[#]: translator: "tanloong"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
R 语言绘制数据:图表篇
======
R 语言有非常多的绘图和数据可视化的包,比如 graphics、lattice、ggplot2 等。这是 R 语言系列的第 9 篇文章,我们会介绍 R 中用来绘图的各种函数。
![business-man-visulising-graphs][1]
本文使用的 R 是 4.1.2 版本,
运行环境为 Parabola GNU/Linux-libre (x86-64)。
```R
$ R --version
R version 4.1.2 (2021-11-01) -- "Bird Hippie"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
```
R 是开源软件,没有任何担保责任。
只要遵守 GNU 通用公共许可证的版本 2 或者版本 3你就可以对它进行 (修改和) 再分发。
详情见 [*https://www.gnu.org/licenses/.*](https://www.gnu.org/licenses/.)
### 折线图
我们以印度全境消费者物价指数 (CPI -- 乡村/城市) 数据集为研究对象,它可以从 [*https://data.gov.in/catalog/all-india-consumer-price-index-ruralurban-0*](https://data.gov.in/catalog/all-india-consumer-price-index-ruralurban-0) 下载。选择 "截止到 2021 年 11 月" 的版本,用 read.csv 函数读取下载好的文件,如下所示:
```R
> cpi <- read.csv(file="CPI.csv", sep=",")
> head(cpi)
Sector Year Name Andhra.Pradesh Arunachal.Pradesh Assam Bihar
1 Rural 2011 January 104 NA 104 NA
2 Urban 2011 January 103 NA 103 NA
3 Rural+Urban 2011 January 103 NA 104 NA
4 Rural 2011 February 107 NA 105 NA
5 Urban 2011 February 106 NA 106 NA
6 Rural+Urban 2011 February 105 NA 105 NA
Chattisgarh Delhi Goa Gujarat Haryana Himachal.Pradesh Jharkhand Karnataka
1 105 NA 103 104 104 104 105 104
2 104 NA 103 104 104 103 104 104
3 104 NA 103 104 104 103 105 104
4 107 NA 105 106 106 105 107 106
5 106 NA 105 107 107 105 107 108
6 105 NA 104 105 106 104 106 106
...
```
以 Punjab 州为例,对每年各月份的 CPI 值求和,然后用 plot 函数画一张折线图:
```R
> punjab <- aggregate(x=cpi$Punjab, by=list(cpi$Year), FUN=sum)
> head(punjab)
Group.1 x
1 2011 3881.76
2 2012 4183.30
3 2013 4368.40
4 2014 4455.50
5 2015 4584.30
6 2016 4715.80
> plot(punjab$Group.1, punjab$x, type="l", main="Punjab Consumer Price Index upto November 2021", xlab="Year", ylab="Consumer Price Index")
```
plot 函数可以传入如下参数:
| 参数 | 描述 |
| :- | :- |
| x | 向量类型,用于绘制 x 轴的数据 |
| y | 向量或列表类型,用于绘制 y 轴的数据 |
| type | 设置绘图类型:"p" 画点;"l" 画线;"o" 同时画点和线,且相互重叠;"s" 画阶梯线;"h" 画铅垂线 |
| xlim | x 轴范围 |
| ylim | y 轴范围 |
| main | 标题 |
| sub | 副标题 |
| xlab | x 轴标题 |
| ylab | y 轴标题 |
| axes | 逻辑型,是否绘制坐标轴 |
结果如图 1。
![Figure 1: Line chart][2]
### 自相关图
自相关图能在时序分析中展示一个变量是否具有自相关性,可以用 R 中的 acf 函数绘制。acf 函数可以设置三种自相关类型:*correlation*、*covariance* 或 *partial*。图 2 是 Punjab 州 CPI 值的自相关图x 表示 CPI。
```R
acf(punjab$x,main='x')
```
![Figure 2: ACF chart][3]
acf 函数可以传入以下参数:
| 参数 | 描述 |
| :- | :- |
| x | 一个单变量或多变量的 time series 对象,或者一个数值向量或数值矩阵 |
| lag.max | 最大滞后阶数 |
| type | 字符型,设置所计算的自相关类型:"correlation"、"covariance" 或 "partial" |
| plot | 逻辑性,若 TRUE 则绘制图像,若 FALSE 则打印传入数据的描述信息 |
| i | 一组要保留的时差滞后 |
| j | 一组要保留的名称或数字 |
### 柱状图
R 中画柱状图的函数是 barplot。下面的代码用来画 Punjab 州 CPI 的柱状图如图3
```R
> barplot(punjab$x, main="Punjab Consumer Price Index", sub="Upto November 2021", xlab="Year", ylab="Consumer Price Index", col="navy")
```
![Figure 3: Line chart of Punjab's CPI][4]
barplot 函数的使用方法非常灵活,可以传入以下参数:
| 参数 | 描述 |
| :- | :- |
| height | 数值向量或数值矩阵,包含用于绘图的数据 |
| width | 数值向量,用于设置柱宽 |
| space | 柱间距 |
| beside | 逻辑型,若 FALSE 则绘制堆积柱状图,若 TRUE 则绘制并列柱状图 |
| density | 数值型,设置阴影线的填充密度 (条数/英寸),默认为 NULL即不填充阴影线|
| angle | 数值型,填充线条的角度,默认为 45 |
| border | 柱子边缘的颜色 |
| main | 标题 |
| sub | 副标题 |
| xlab | x 轴标题 |
| ylab | y 轴标题 |
| xlim | x 轴范围 |
| ylim | y 轴范围 |
| axes | 逻辑型,是否绘制坐标轴 |
用 help 命令可以查看 barplot 函数的详细信息:
```R
> help(barplot)
barplot package:graphics R Documentation
Bar Plots
Description:
Creates a bar plot with vertical or horizontal bars.
Usage:
barplot(height, ...)
## Default S3 method:
barplot(height, width = 1, space = NULL,
names.arg = NULL, legend.text = NULL, beside = FALSE,
horiz = FALSE, density = NULL, angle = 45,
col = NULL, border = par("fg"),
main = NULL, sub = NULL, xlab = NULL, ylab = NULL,
xlim = NULL, ylim = NULL, xpd = TRUE, log = "",
axes = TRUE, axisnames = TRUE,
cex.axis = par("cex.axis"), cex.names = par("cex.axis"),
inside = TRUE, plot = TRUE, axis.lty = 0, offset = 0,
add = FALSE, ann = !add && par("ann"), args.legend = NULL, ...)
## S3 method for class 'formula'
barplot(formula, data, subset, na.action,
horiz = FALSE, xlab = NULL, ylab = NULL, ...)
```
### 饼图
绘制饼图时要多加注意,因为饼图不一定能展示出各扇形间的区别。(LCTT 译注:"根据统计学家和一些心理学家的调查结果,这种以比例展示数据的统计图形 [实际上是很糟糕的可视化方式][10]因此R 关于饼图的帮助文件中清楚地说明了并不推荐使用饼图,而是使用条形图或点图作为替代。") 用 subset 函数获得 Gujarat 州在 2021 年 1 月 Rural、Urban、Rurual+Urban 的 CPI 值:
```R
> jan2021 <- subset(cpi, Name=="January" & Year=="2021")
> jan2021$Gujarat
[1] 153.9 151.2 149.1
> names <- c('Rural', 'Urban', 'Rural+Urban')
```
使用 pie 函数为 Gujarat 州的 CPI 值生成饼图,如下所示:
```R
> pie(jan2021$Gujarat, names, main="Gujarat CPI Rural and Urban Pie Chart")
```
![Figure 4: Pie chart][5]
pie 函数可以传入以下参数:
| 参数 | 描述 |
| :- | :- |
| x | 元素大于 0 的数值向量 |
| label | 字符向量,用于设置每个扇形的标签 |
| radius | 饼图的半径 |
| clockwise | 逻辑型,若 TRUE 则顺时针绘图,若 FALSE 则逆时针绘图 |
| density | 数值型,设置阴影线的填充密度 (条数/英寸),默认为 NULL即不填充阴影线|
| angle | 数值型,填充线条的角度,默认为 45 |
| col | 数值向量,用于设置颜色 |
| lty | 每个扇形的线条类型 |
| main | 标题 |
### 箱线图
(LCTT 译注:"箱线图主要是 [从四分位数的角度出发][11] 描述数据的分布,它通过最大值 (Q4)、上四分位数 (Q3)、中位数(Q2)、下四分位数 (Q1) 和最小值 (Q0) 五处位置来获取一维数据的分布概况。我们知道,这五处位置之间依次包含了四段数据,每段中数据量均为总数据量的 1/4。通过每一段数据占据的长度我们可以大致推断出数据的集中或离散趋势 (长度越短,说明数据在该区间上越密集,反之则稀疏。)")
箱线图能够用“须线” (whiskers) 展示一个变量的四分位距 (Interquartile Range简称 IQR=Q3-Q1)。用上下四分位数分别加/减内四分位距,再乘以一个人为设定的倍数 range (见下面的参数列表),得到 `range * c(Q1-IQR, Q3+IQR)`,超过这个范围的数据点就被视作离群点,在图中直接以点的形式表示出来。
boxplot 函数可以传入以下参数:
| 参数 | 描述 |
| :- | :- |
| data | 数据框或列表,用于参数类型为公式 (formula) 的情况 |
| x | 数值向量或者列表,若为列表则对列表中每一个子对象依次作出箱线图 |
| width | 设置箱子的宽度 |
| outline | 逻辑型,设置是否绘制离群点 |
| names | 设置每个箱子的标签 |
| border | 设置每个箱子的边缘的颜色 |
| range | 延伸倍数,设置箱线图末端 (须) 延伸到什么位置 |
| plot | 逻辑型,设置是否生成图像,若 TRUE 则生成图像,若 FALSE 则打印传入数据的描述信息 |
| horizontal | 逻辑型,设置箱线图是否水平放置 |
用 boxplot 函数绘制部分州的箱线图:
```R
> names <- c ('Andaman and Nicobar', 'Lakshadweep', 'Delhi', 'Goa', 'Gujarat', 'Bihar')
> boxplot(cpi$Andaman.and.Nicobar, cpi$Lakshadweep, cpi$Delhi, cpi$Goa, cpi$Gujarat, cpi$Bihar, names=names)
```
![Figure 5: Box plot][6]
### QQ 图
QQ 图 (Quantile-Quantile plot) 可以用来对比两个数据集也可以用来检查数据是否服从某种理论分布。qqnorm 函数能绘制正态分布 QQ 图,可以检验数据是否服从正态分布,用下面的代码绘制 Punjab 州 CPI 数据的 QQ 图:
```R
> qqnorm(punjab$x)
```
![Figure 6: Q-Q plot][7]
qqline 函数可以向正态分布 QQ 图上添加理论分布曲线,它可以传入以下参数:
| 参数 | 描述 |
| :- | :- |
| x | 第一个数据样本 |
| y | 第二个数据样本 |
| datax | 逻辑型,设置是否以 x 轴表示理论曲线的值,默认为 FALSE |
| probs | 长度为 2 的数值向量,代表概率 |
| xlab | x 轴标题 |
| ylab | y 轴标题 |
| qtype | [1,9] 内的整数,设置分位计算类型,详情见 help(quantile) 的 "Type" 小节 |
### 等高图
等高图可以描述三维数据,在 R 中对应的函数是 contour这个函数也可以用来向已有的图表添加等高线。等高图常与其他图表一起使用。我们用 contour 对 R 中的 volcano 数据集 (奥克兰的火山地形信息) 绘制等高图,代码如下:
```R
> contour(volcano)
```
![Figure 7: Volcano][8]
contour 函数的常用参数如下:
| 参数 | 描述 |
| :- | :- |
| x,y | z 中数值对应的点在平面上的位置 |
| z | 数值向量 |
| nlevels | 设置等高线的条数,调整等高线的疏密 |
| labels | 等高线上的标记字符串,默认是高度的数值 |
| xlim | 设置 x 轴的范围 |
| ylim | 设置 y 轴的范围 |
| zlim | 设置 z 轴的范围 |
| axes | 设置是否绘制坐标轴 |
| col | 设置等高线的颜色 |
| lty | 设置线条的类型 |
| lwd | 设置线条的粗细 |
| vfont | 设置标签字体 |
等高线之间的区域可以用颜色填充,每种颜色表示一个高度范围,如下所示:
```R
> filled.contour(volcano, asp = 1)
# asp 为图形纵横比,即 y 轴上的 1 单位长度和 x 轴上 1 单位长度的比率
```
填充结果见图 8。
![Figure 8: Filled volcano][9]
掌握上述内容后,你可以尝试 R 语言 graphics 包中的其他函数和图表 (LCTT 译注:用 help(package=graphics) 可以查看 graphics 包提供的函数列表)。
--------------------------------------------------------------------------------
via: https://www.opensourceforu.com/2022/05/plotting-data-in-r-graphs/
作者:[Shakthi Kannan][a]
选题:[lkxed][b]
译者:[tanloong](https://github.com/tanloong)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.opensourceforu.com/author/shakthi-kannan/
[b]: https://github.com/lkxed
[1]: https://www.opensourceforu.com/wp-content/uploads/2022/04/business-man-visulising-graphs.jpg
[2]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-1-Line-chart.jpg
[3]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-2-ACF-chart.jpg
[4]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-3-Line-chart-of-Punjabs-CPI.jpg
[5]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-4-Pie-chart.jpg
[6]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-5-ox-plot.jpg
[7]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-6-Q-Q-plot.jpg
[8]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-7-Volcano.jpg
[9]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-8-Filled-volcano.jpg
[10]: https://bookdown.org/xiangyun/msg/gallery.html#sec:pie
[11]: https://bookdown.org/xiangyun/msg/gallery.html#sec:boxplot

View File

@ -0,0 +1,751 @@
[#]: subject: "Docker Commands Tutorial | Getting Started With Docker In Linux"
[#]: via: "https://ostechnix.com/getting-started-with-docker/"
[#]: author: "sk https://ostechnix.com/author/sk/"
[#]: collector: "lkxed"
[#]: translator: "MCGA"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Docker 命令教程 | 在 Linux 中入门 Docker
======
初学者的 Docker 基本命令
这篇详细的 Docker 教程覆盖了核心的 **Docker 命令**,比如,如何创建新容器,运行容器,删除容器等。另外,这篇教程也解释了如何从已有的容器构建你自己的 Docker 镜像,如何移除容器和镜像。言归正传,现在开始 Docker 的基本用法。
### Docker 安装步骤
大多数现代 Linux 操作系统都可以安装 Docker。如果还没安装过 Docker请参考下面的步骤
* [在 AlmaLinuxCentOSRocky Linux 上安装 Docker Engine 和 Docker Compose][1]
* [如何在 Ubuntu 上安装 Docker 和 Docker Compose][2]
### 什么是 Docker 镜像和 Docker 容器?
在开始 Docker 之前,我先说明一下 Docker 镜像和 Docker 容器是什么。
Docker 镜像是一个描述容器如何运行的的文件Docker 容器是 Docker 镜像在运行或被终止时的一个阶段。
容器和主机上的其他文件是隔离的。
当我们运行一个 Docker 容器的时候,它会使用一个被隔离出来的文件系统,这个文件系统是由一个 Docker 镜像提供的。Docker 镜像包含了运行应用程序所需要的一切东西 - 所有的依赖,配置,脚本,二进制文件等等。
镜像也包含容器所需要的其他配置项,比如说环境变量,运行的默认命令,以及其他元数据。
### Linux 下的 Docker 入门
下面的所有步骤都已在 Ubuntu 22.0420.04 以及 18.04 LTS 服务器版本中测试通过。后续小节中提供的步骤对于所有 Linux 平台都是通用的。比如,在基于 RHEL 的系统中(比如 AlmaLinux可以运行相同的命令。
#### 1. 搜索 Docker 镜像
我们可以从叫做 [Docker hub][3] 的 docker 官方库获得镜像,或者我们也可以制作自己的镜像。
有些人可能不清楚Docker hub 是一个线上的中心化仓库,所有的 Docker 用户在上面构建,测试,然后保存他们的 Docker 镜像。Docker hub 有数以万计的 Docker 镜像,而且这个数字还在每天增长。
你可以从命令行通过 **“docker search”** 命令搜索任意 Docker 镜像。
比如要搜索基于 **Alpine** Linux 的 docker 镜像,运行:
```
$ sudo docker search alpine
```
**输出结果:**
![Search Docker Images][4]
搜索基于 **Ubuntu** 的镜像,运行:
```
$ sudo docker search ubuntu
```
你还可以搜索其他任意的应用,比如 **Nginx**,像下面这样:
```
$ sudo docker search nginx
```
Docker hub 有各种各样的镜像。你能在 Docker hub 上找到一切已构建好的 Docker 镜像,比如说操作系统,应用,或者多个应用的合体(比如 LAMP 栈)。
如果你找的东西不在上面,你还可以构建一个镜像,然后通过 Docker hub 向其他人开放,或者只是自己用。
#### 2. 下载 Docker 镜像
从终端运行下面的命令可以下载 Ubuntu OS 的 Docker 镜像:
```
$ sudo docker pull ubuntu
```
上面的这个命令会从 Docker hub 下载最新的 Ubuntu 镜像。
**输出结果:**
```
Using default tag: latest
latest: Pulling from library/ubuntu
405f018f9d1d: Pull complete
Digest: sha256:b6b83d3c331794420340093eb706a6f152d9c1fa51b262d9bf34594887c2c7ac
Status: Downloaded newer image for ubuntu:latest
docker.io/library/ubuntu:latest
```
你也可以用下面的命令下载指定版本的 Ubuntu 镜像:
```
$ sudo docker pull ubuntu:20.04
```
Docker 允许我们下载任何镜像,并且在那个镜像上创建容器,这些操作与主机的操作系统无关。
比如要下载 Alpine 系统的镜像,运行:
```
$ sudo docker pull alpine
```
![Download Docker Images][5]
#### 3. 列出 Docker 镜像
所有已下载的 Docker 镜像都保存在 **/var/lib/docker** 路径下。
要查看所有已下载的 Docker 镜像,运行:
```
$ sudo docker images
```
**输出结果:**
```
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest 27941809078c 3 weeks ago 77.8MB
ubuntu 20.04 20fffa419e3a 3 weeks ago 72.8MB
alpine latest e66264b98777 5 weeks ago 5.52MB
```
![List Docker Images][6]
从上面可以看出来,我已经下载了三个 Docker 镜像 - **Ubuntu** **lates****Ubuntu 20.04** 和 **Alpine Linux**
现在,我们看一下接下来如何从下载的镜像启动或者运行容器。
#### 4. 运行 Docker 容器
有两种方法我们可以启动一个容器 - 使用 Docker **镜像** **TAG** 或者 **<ruby>镜像 ID<rt>Image ID</rt></ruby>**。
**TAG** 指的是一个特定的镜像快照,**<ruby>镜像 ID<rt>Image ID</rt></ruby>** 是那个镜像对应的唯一识别码。
可以查看下面这个截图:
![Docker Image Tag and ID][7]
从上面的解脱可以看到,<ruby>标签<rt>tags</rt></ruby>**latest****“20.04”**。
* 27941809078c is the IMAGE ID of Ubuntu latest Docker image,
* 27941809078c 是 Ubuntu latest 的 Docker 镜像的<ruby>镜像 ID<rt>IMAGE ID</rt></ruby>
* 20fffa419e3a is the image id of Ubuntu 20.04 Docker image
* 20fffa419e3a 是 Ubuntu 20.04 的 Docker 镜像的镜像 ID
* and `e66264b98777` is the image id of Alpine latest Docker image.
* 而 `e66264b98777` 是 Alpine latest 的 Docker 镜像的镜像 ID。
##### 4.1. 使用<ruby>标签<rt>Tag</rt></ruby>运行容器
下载选择好的 Docker 镜像后,运行下面的命令来启动 Docker 容器,并且通过它的<ruby>标签<rt>TAG</rt></ruby>进行连接。
```
$ sudo docker run -t -i ubuntu:latest /bin/bash
```
或者,
```
$ sudo docker run -it ubuntu:latest /bin/bash
```
这里,
* -t在 Ubuntu 容器内分配一个伪终端。
* -i通过从容器获取一个便准输入STDIN允许我们创建一个可交互的连接。
* ubuntu:latest标签为“latest”的 Ubuntu docker 镜像。
* /bin/bash新容器的 BASH shell。这个是可选项。如果你不加 shell 的话,默认的 shell 会被分配给容器。
启动容器后,会自动进入容器的 shell命令行
![Run Containers Using Tag][8]
基于最新 Ubuntu 镜像的容器现在已经启动了。所有的新容器都会被赋予一个名字和唯一的 ID。从上面的输出可以看到那个 Ubuntu 容器的 ID 是 **2f2a5b826762**。一会儿我们会看到从哪找到容器的名字。
现在就可以在容器里面工作了。当你完成容器内的工作后,你可以回到主机操作系统的终端(在我这个例子中,操作系统是 Ubuntu 22.04 LTS而不需要关掉容器客户机
##### 4.2. 从运行中的容器中分离
使用 **CTRL+P** 然后 **CTRL+Q** 就可以从运行中的容器分离(不需要关闭)。
现在,你就回到了你原来的主机的终端窗口。请注意,容器还在后台运行中,我们并没有关掉它。
##### 4.3. 使用镜像 ID 运行容器
另一种启动容器并且连接进去的方式是通过使用镜像 ID像下面这样
```
$ sudo docker run -it 20fffa419e3a /bin/bash
```
这里,
* 20fffa419e3a - 镜像 id
**CTRL+P** 然后 **CTRL+Q** 可以从当前容器中分离回到主机系统的终端。我们只是从容器中分离,但是没有让它停止。容器仍然在后台运行中。
##### 4.4. 在分离模式中运行容器
在前面的小结中,我们启动了一个容器并且立刻连接了进去。然后当容器中的工作结束后,我们从容器中分离了出来
你也可以在分离模式(不需要自动连接进去)中启动容器
在后台运行一个容器,输入命令:
```
$ sudo docker run -it -d alpine:latest
```
**输出结果:**
```
d74f2ceb5f3ad2dbddb0b26e372adb14efff91e75e7763418dbd12d1d227129d
```
上面输出结果的前 12 字符代表的是容器的 ID
通过 `docker ps` 命令,你可以验证容器是否在运行:
```
$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d74f2ceb5f3a alpine:latest "/bin/sh" 3 seconds ago Up 2 seconds zen_pascal
```
![Run Containers In Background][9]
从上面个的输出结果中可以看到,我们创建了一个 Alpine 容器,但是还没有连接进去。
如果你想连接进去,很简单,运行:
```
$ sudo docker attach d74f2ceb5f3a
```
#### 5. 查看运行中的容器
查看运行中的容器,运行下面的命令:
```
$ sudo docker ps
```
**输出结果:**
```
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f7e04eed577e 20fffa419e3a "/bin/bash" 6 minutes ago Up 6 minutes brave_mclean
2f2a5b826762 ubuntu:latest "/bin/bash" 18 minutes ago Up 18 minutes hungry_leavitt
```
![View Running Containers][10]
这里,
* f7e04eed577e 是由镜像 “2f2a5b826762” 创建的 Ubuntu 容器的 ID。并且“brave_mclean”是这个容器的名字。
* 2f2a5b826762 是由镜像 “ubuntulatest” 创建的 Ubuntu 容器的 ID。并且“hungry_leavitt” 是这个容器的名字。
当一个新容器被创建后,一个唯一的 ID 和名字会赋给它,这样我们就能通过它的 ID 和名字来连接它。
**注意:** 请注意**容器 ID 和 Docker 镜像 ID 是不同的**。
列出所有可用的(运行或者停止)容器,运行:
```
$ sudo docker ps -a
```
#### 6. 从运行中的容器分离或连接
首先,通过 `docker ps` 命令找到容器的 ID。
```
$ sudo docker ps
```
然后,运行 `docker attach` 命令连接到运行中的容器。
```
$ sudo docker attach <container-id>
```
比如像下面这样,我要连接到 ID 为 “f7e04eed577e” 的容器:
```
$ sudo docker attach f7e04eed577e
```
你也可以通过使用它的名字连接到一个容器。
```
$ sudo docker attach brave_mclean
```
现在你就登录到这个容器了。
想要从容器分离,只要按 **CTRL+P** 然后 **CTRL+Q**
#### 7. 启动,重启,暂停和终止容器。
你可以使用容器的名字或 ID 来启动,重启,暂停或者终止一个 Docker 容器。
首先,通过 `docker ps -a` 命令找到容器的名字或 ID。
![Find Container ID And Name][11]
现在,通过使用 `docker start` 命令,加上名字或 ID你可以启动一个容器像下面这样
```
$ sudo docker start modest_cray
```
```
$ sudo docker start 10615254bb45
```
用空格隔开,就可以**启动多个容器**,像下面这样:
```
$ sudo docker start 24b5ee8c3d3a 56faac6d20ad d74f2ceb5f3a
```
优雅的重启一个运行中的容器,运行:
```
$ sudo docker start 10615254bb45
```
暂停一个运行中的容器:
```
$ sudo docker pause 10615254bb45
```
把暂停的容器恢复过来:
```
$ sudo docker unpause 10615254bb45
```
直到其它容器都停止前,阻塞一个容器:
```
$ sudo docker wait 10615254bb45
```
我们可以很容易地通过使用它的名字或 ID 来终止一个容器。如果你已经在容器的 shell 里了,只需要运行下面的命令就可以非常简单的终止:
```
# exit
```
你也可以使用下面的命令从 Docker 的主机系统中终止(关闭容器)容器:
```
$ sudo docker stop 10615254bb45
```
用空格隔开,你可以退出多个容器,像下面这样。
```
$ sudo docker stop 35b5ee8c3d3a 10615254bb45
```
在退出容器之后,通过列出所有容器的命令来确保它确实被终止了:
```
$ sudo docker ps
```
#### 8. <ruby>强行关闭<rt>Kill</rt></ruby> Docker 容器
docker stop 命令可以非常优雅的关掉运行中的容器。有时候,你可能卡在一个没有响应的容器,或者你想强制关掉容器。
通过给一个运行中的容器发送 `SIGKILL` 来强行关闭容器,运行:
```
$ sudo docker kill 10615254bb45
```
#### 9. 在关闭容器后自动删除他们
也许你想测试一个容器,然后当你完成在容器中的工作就把它删掉。如果是这样,通过使用 `--rm` 标签在关闭后自动删掉容器:
```
$ sudo docker run -it --rm debian:latest
```
当你从容器中退出,它会自动被删掉。
![Automatically Delete Containers][12]
从上面的结果可以看到,我先创建了一个新的 Debian 容器。当我退出这个容器的时候,它就被自动删掉了。`docker ps -a` 命令的输出结果显示Debian 容器现在不存在。
#### 10. 给容器命名
如果你再看一下之前命令的输出结果当你启动一个容器的时候每个容器都被赋予了一个随机的名字。如果你不命名你的容器Docker 会自动替你给他们命名。
现在看一下下面的例子:
```
$ sudo docker run -it -d alpine:latest
2af79e97a825c91bf374b4862b9e7c22fc22acd1598005e8bea3439805ec335d
```
```
$ sudo docker run -it -d alpine:latest
80b53b7e661d33696b65c78267fc3f067b6100799c925910db4721963e3fae0a
```
```
$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
80b53b7e661d alpine:latest "/bin/sh" 3 seconds ago Up 2 seconds bold_margulis
2af79e97a825 alpine:latest "/bin/sh" 6 seconds ago Up 5 seconds recursing_taussig
```
从上面的结果可以看到,尽管我用同一个 docker image 创建了两个容器,它们获得了不同的 ID 和名字。
如果你想给容器赋一个不变的名字,使用 `--name` 标签,像下面这样:
```
$ sudo docker run -it -d --name ostechnix_alpine alpine:latest
```
上面的命令会在分离模式中创建一个叫做 **ostechnix_alpine** 的新容器。
我们看一下当前运行的容器列表:
```
$ sudo docker ps
```
**输出结果:**
```
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
397111fac537 alpine:latest "/bin/sh" 2 seconds ago Up 2 seconds ostechnix_alpine
80b53b7e661d alpine:latest "/bin/sh" 7 minutes ago Up 7 minutes bold_margulis
2af79e97a825 alpine:latest "/bin/sh" 7 minutes ago Up 7 minutes recursing_taussig
```
![Assign Name To Containers][13]
注意到上面输出结果中的第一个容器的名字了吗?对了,我们给这个容器分配了一个自定义的名字(也就是 `ostechnix_alpine`)。
给容器分配自定义的名字可以给我们带来其他好处。只要看一下容器的名字,我们就能很容易的确定那个容器里面安装了什么。
#### 11. 构建自定义 Docker 镜像
Docker 不仅仅是下载和使用已存在的容器。你也可以创建自己的自定义 docker 镜像。
现在我们开始一个 Ubuntu 容器:
```
$ sudo docker run -it ubuntu:latest
```
现在,你会进入到容器的 shell。
然后,在容器中,你可以安装任何的软件或者做你想做的事情。
比如,我们在容器中安装 “Apache web server**。
```
# apt update
# apt install apache2
```
相似地,在容器中,可以根据自己的需要安装和测试软件。
完成以后,从容器分离(不要退出)回到主机系统的 shell。不要终止或者关闭容器。使用 **CTRL+P** 然后 **CTRL+Q** 从容器中分离,这样不会关闭容器。
在你的 Docker 主机的终端,运行下面的命令来找到容器 ID
```
$ sudo docker ps
```
最后,创建一个当前运行中的容器的 Docker image使用命令
```
$ sudo docker commit 377e6d77ebb5 ostechnix/ubuntu_apache
```
**输出结果**
```
sha256:bc5e5f95ca592a3585fda2c5a40ec30c98e292046ef70390a2c3b7863cc6f7c1
```
这里,
* 377e6d77ebb5  Ubuntu 容器的 ID。
* ostechnix  创建容器的用户的名字。
* ubuntu_apache 用户 ostechnix 创建的 docker image 的名字。
现在我们查看一下新的 Docker 镜像是否被创建了,使用下面的命令:
```
$ sudo docker images
```
**输出结果:**
```
ostechnix/ubuntu_apache
```
![Build Custom Docker Images][14]
从上面给的结果中可以看到,从运行中的容器创建的新 Docker 镜像已经在我们的 Docker 主机系统中了。
现在你就可以从这个新的 Docker 镜像创建行容器了,用之前的命令:
```
$ sudo docker run -it ostechnix/ubuntu_apache
```
#### 12. 移除容器
当你在 Docker 容器中完成所有开发后,如果你不需要他们了,你可以删掉他们。
为此,首先我们需要终止(关闭)运行中的容器。
用这个命令来看一下运行中的容器:
```
$ sudo docker ps
```
**输出结果:**
```
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
377e6d77ebb5 ubuntu:latest "bash" 7 minutes ago Up 7 minutes elegant_beaver
```
通过使用它的 ID 来终止运行中的容器:
```
$ sudo docker stop 377e6d77ebb5
```
现在,使用这个命令删除容器:
```
$ sudo docker rm 377e6d77ebb5
```
同样,如果不再需要所有的容器,关闭并删除它们。
一个一个的删除多个容器会是一项繁琐的工作。所以,我们可以把所有停止的容器一次性删掉,运行:
```
$ sudo docker container prune
```
**Y** 然后回车键,这些容器就被删掉了。
```
WARNING! This will remove all stopped containers.
Are you sure you want to continue? [y/N] y
Deleted Containers:
397111fac5374921b974721ee646b2d5fbae61ca9c6e8b90fbf47952f382a46b
80b53b7e661d33696b65c78267fc3f067b6100799c925910db4721963e3fae0a
[...]
Total reclaimed space: 176B
```
![Delete Containers][15]
这个命令只有在最新版中有效。
使用下面的命令来验证是否所有容器都被删除了:
```
$ sudo docker ps -a
```
如果看不到任何结果,说明所有容器被删掉了。
#### 13. 删除 Docker 镜像
记住,在删除所有镜像之前,首先要删掉所有从那些镜像创建的容器。
当你删掉容器后,你可以删掉你不需要的 Docker 镜像。
列出所有下载的 Docker 镜像:
```
$ sudo docker images
```
**输出结果:**
```
REPOSITORY TAG IMAGE ID CREATED SIZE
ostechnix/ubuntu_apache latest bc5e5f95ca59 14 minutes ago 229MB
debian latest d2780094a226 11 days ago 124MB
ubuntu latest 27941809078c 3 weeks ago 77.8MB
ubuntu 20.04 20fffa419e3a 3 weeks ago 72.8MB
alpine latest e66264b98777 5 weeks ago 5.52MB
```
从上面可以看到,在我们的主机上有 5 个 Docker 镜像。
通过使用镜像 ID 来删掉它们:
```
$ sudo docker rmi ce5aa74a48f1
```
**输出结果:**
```
Untagged: ostechnix/ubuntu_apache:latest
Deleted: sha256:bc5e5f95ca592a3585fda2c5a40ec30c98e292046ef70390a2c3b7863cc6f7c1
Deleted: sha256:a8e4797160a2b2d33d8bd1bd67e008260c022b3a53fbcc198b2b74d9eae5961d
```
同样,删除其他所有 Docker 镜像。
删掉所有未运行的容器,所有镜像,构建的缓存,所有网络,运行:
```
$ sudo docker system prune -a
```
使用这个命令的时候要注意,它会删掉所有没有使用的容器,网络,镜像(<ruby>挂起<rt>dangling</rt></ruby><ruby>未使用<rt>unreferenced</rt></ruby>
![Delete Everything In Docker][16]
默认情况下,即使当前没有容器在使用<ruby>磁盘容量<rt>volumes</rt></ruby>,为防止重要数据被删除,<ruby>磁盘容量<rt>volumes</rt></ruby>也不会被删除
如果你想删掉所有东西,包括分配的容量,使用 `--volumes` 标签。
```
$ sudo docker system prune -a --volumes
```
### Docker 问题汇总
Docker 不会允许你删除 Docker 镜像,如果这些镜像正在被运行或停止的容器使用。
比如,当我尝试从一个以前的 Ubuntu 服务器上删除 ID 为 **b72889fa879c** 的 Docker 镜像。我会得到下面的错误:
```
Error response from daemon: conflict: unable to delete b72889fa879c (must be forced) - image is being used by stopped container dde4dd285377
```
这是因为你想删除的 Docker 镜像正在被另一个容器使用。
所以,我们先查看一下运行中的容器,使用命令:
```
$ sudo docker ps
```
**输出结果:**
![Show running docker containers][17]
噢,没有运行中的容器。
我们在看一下所有的容器(运行和停止的),用这个命令:
```
$ sudo docker ps -a
```
**输出结果:**
![Show running and stopped docker containers][18]
可以看到,仍然有停止的容器在使用其中一个 Docker 镜像。所以,我们先把所有容器删掉。
**比如:**
```
$ sudo docker rm 12e892156219
```
类似地,向上面那样,用对应容器的 ID 将他们都删除。
当把所有容器删掉后,移除掉 Docker 镜像。
**比如:**
```
$ sudo docker rmi b72889fa879c
```
就这么简单。现在确认是否还有其他 Docker 镜像在主机上,使用命令:
```
$ sudo docker images
```
你现在应该不再有任何 docker 镜像了。
### 总结
在这篇全面的 Docker 入门教程中,我们解释了 Docker 的基本操作,比如创建,运行,搜索,删除容器,还有从 Docker 镜像构建你自己的容器。同时,我们也解释了如何在不需要 Docker 容器和镜像的时候删除它们。
希望你现在对 **Docker 的使用** 有一个基本的了解
更多细节,请参考这篇教程最下面的官方资源链接,或者在下面的评论区进行评论。
**相关资料:**
* [Docker 官网][19]
* [Docker 文档][20]
--------------------------------------------------------------------------------
via: https://ostechnix.com/getting-started-with-docker/
作者:[sk][a]
选题:[lkxed][b]
译者:[MCGA](https://github.com/Yufei-Yan)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://ostechnix.com/author/sk/
[b]: https://github.com/lkxed
[1]: https://ostechnix.com/install-docker-almalinux-centos-rocky-linux/
[2]: https://ostechnix.com/install-docker-ubuntu/
[3]: https://hub.docker.com/
[4]: https://ostechnix.com/wp-content/uploads/2022/07/Search-Docker-Images.png
[5]: https://ostechnix.com/wp-content/uploads/2022/07/Download-Docker-Images.png
[6]: https://ostechnix.com/wp-content/uploads/2022/07/List-Docker-Images.png
[7]: https://ostechnix.com/wp-content/uploads/2022/07/Docker-Image-Tag-and-ID.png
[8]: https://ostechnix.com/wp-content/uploads/2022/07/Run-Containers-Using-Tag-1.png
[9]: https://ostechnix.com/wp-content/uploads/2022/07/Run-Containers-In-Background-1.png
[10]: https://ostechnix.com/wp-content/uploads/2022/07/View-Running-Containers.png
[11]: https://ostechnix.com/wp-content/uploads/2022/07/Find-Container-ID-And-Name.png
[12]: https://ostechnix.com/wp-content/uploads/2022/07/Automatically-Delete-Containers.png
[13]: https://ostechnix.com/wp-content/uploads/2022/07/Assign-Name-To-Containers.png
[14]: https://ostechnix.com/wp-content/uploads/2022/07/Build-Custom-Docker-Images.png
[15]: https://ostechnix.com/wp-content/uploads/2022/07/Delete-Containers.png
[16]: https://ostechnix.com/wp-content/uploads/2022/07/Delete-Everything-In-Docker.png
[17]: https://ostechnix.com/wp-content/uploads/2016/04/sk@sk-_005-1-1.jpg
[18]: https://ostechnix.com/wp-content/uploads/2016/04/sk@sk-_006-1.jpg
[19]: https://www.docker.com/
[20]: https://docs.docker.com/

View File

@ -0,0 +1,115 @@
[#]: subject: "Manage your files in your Linux terminal with ranger"
[#]: via: "https://opensource.com/article/22/7/manage-files-linux-terminal-ranger"
[#]: author: "Sumantro Mukherjee https://opensource.com/users/sumantro"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
用 ranger 在 Linux 终端管理你的文件
======
试试这个轻量级的开源工具,不用离开终端就可以预览文件。
![Filing cabinet for organization][1]
查看你的文件和文件夹的最基本方法是使用命令 `ls``ll`。但是有时候,我不仅想看到文件的元数据,还想一目了然地看到文件的内容。为此,我使用 ranger。
如果你喜欢在控制台中工作,并使用 [Vim][2] 或 Vi而且你不想因为任何原因离开你的终端那么 ranger 就是你最好的新朋友。Ranger 是一个最小的文件管理器它不仅可以让你浏览文件还可以预览它们。Ranger 与 rifle 捆绑在一起rifle 是一个文件执行器,可以有效地选择与特定文件类型相关的程序。
### 在 Linux 上安装 ranger
Ranger 可以在 Fedora 或任何基于 RPM 的发行版中安装,方法是运行:
```
$ sudo dnf install ranger
```
Ranger 也可以用于[其他发行版和 macOS][3]。
### 第一次使用 ranger
作为一个用户,你可以在你喜欢的终端上简单地输入 `$ ranger` 来启动 ranger。可以用方向键浏览。这张截图是一个很好的例子我可以预览存储在 `Kernel-tests` 中的 `config.example` 文件的代码。
![Screenshot of terminal showing config.example highlighted and a preview of the file in the terminal to the right][4]
选中任何文件并按下 F4 键,就可以打开你的默认编辑器,让你立即编辑这些文件!
### 图像和视频怎么办?
使用 [rifle][5] 和 ranger 可以让你快速找到与某一文件相关的程序。将鼠标悬停在图片上,然后试图打开它是非常简单的,只要点击回车即可。下面是它的样子:
![Screenshot of a PNG file preview over a terminal window][6]
在一个图像文件上点击 i 会给用户提供所有的 EXIF 数据。点击 **Shift+Enter** 将打开 PDF 文件。
![A screenshot showing a preview of a PDF file (tickets to a museum) floating over the terminal window][7]
同样的组合键将在系统默认的支持该编解码器的视频播放器中打开并开始播放视频。下面的例子是一个 mp4 视频,它在 [VLC][8] 上播放得很好。
![Screenshot of a Bugcrowd University Cross Site Scripting video in VLC media player, previewed over the terminal][9]
### 文件操作
除非 Vim 用户另有配置,否则下面的键绑定工作良好。
j下移
k上移
h: 移动到父目录
gg移到列表的顶部
i预览文件
r打开文件
zh查看隐藏文件
cw重命名当前文件
yy复制文件
dd剪切文件
pp粘贴文件
u撤销
z改变设置
dD删除文件
### 控制台命令
有时我在起草文章时,有一个文件夹包含某个软件的截图。通过点击空格选择或标记文件,然后输入 `:bulkrename`可以帮助我把所有奇怪的时间戳变成如lorax1、lorax2 等等。下面是一个例子。
![Screenshot of terminal showing timestamped files that can be renamed with the bulkrename command][10]
其他有用的控制台命令包括:
`:openwith`:用你选择的程序打开一个选择的文件
`:touch FILENAME`:创建一个文件
`:mkdir FILENAME`:创建一个目录
`:shell <command>`:在 shell 中运行一个命令
`:delete`:删除文件
### 在 tty2/3/4 中能工作吗?
作为一个从事质量保证QA工作的人我发现搜索日志和阅读日志从未如此简单。即使我的 Gnome 显示管理器崩溃了,我也可以切换到我的 tty2用我的用户名和密码登录并以超级用户权限启动 ranger然后我就可以尽情地探索了
Ranger 是一个很好的工具可以在不离开终端的情况下处理文件。Ranger 是最小的,也是可定制的,所以不妨一试吧!
图片来源Sumantro MukherjeeCC BY-SA 4.0
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/7/manage-files-linux-terminal-ranger
作者:[Sumantro Mukherjee][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/sumantro
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/files_documents_organize_letter.png
[2]: https://opensource.com/tags/vim
[3]: https://opensource.com/article/20/3/ranger-file-navigator
[4]: https://opensource.com/sites/default/files/2022-06/ranger%201.png
[5]: https://www.systutorials.com/docs/linux/man/1-rifle/
[6]: https://opensource.com/sites/default/files/2022-06/ranger%202.png
[7]: https://opensource.com/sites/default/files/2022-06/ranger%203.png
[8]: https://opensource.com/article/21/2/linux-media-players
[9]: https://opensource.com/sites/default/files/2022-06/ranger%204.png
[10]: https://opensource.com/sites/default/files/2022-06/ranger%205.png

View File

@ -0,0 +1,143 @@
[#]: subject: "Monitoring tiny web services"
[#]: via: "https://jvns.ca/blog/2022/07/09/monitoring-small-web-services/"
[#]: author: "Julia Evans https://jvns.ca/"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
监测微型网络服务
======
你好! 我最近又开始运行一些服务器([nginx playground][1]、[mess with dns][2]、[dns lookup][3]),所以我一直在考虑监控问题。
最初我并不完全清楚如何监控这些网站,所以我想快速写下我是如何做到的。
我根本不打算谈如何监控大型严肃的关键任务网站,只谈微型的不重要的网站。
### 目标:在操作上几乎不花时间
我希望网站大部分时间都能正常工作,但我也希望在持续的运营上几乎不花时间。
我最初对运行服务器非常警惕,因为在我的上一份工作中,我是 24/7 轮流值班,负责一些关键的服务,在我的印象中,“负责服务器”意味着“在凌晨 2 点被叫起来修理服务器”和“有很多复杂的仪表盘”。
所以有一段时间我只做静态网站,这样我就不用考虑服务器的问题。
但最终我意识到,我所要写的任何服务器的风险都很低,如果它们偶尔宕机 2 小时也没什么大不了的,我只需设置一些非常简单的监控来帮助它们保持运行。
### 没有监控很糟糕
起初,我根本没有为我的服务器设置任何监控。这样做的结果是非常可预见的:有时网站坏了,而我却没有发现,直到有人告诉我!
### 步骤 1uptime 检查器
第一步是建立一个 uptime 检查器。外面有很多这样的东西,我现在使用的是 [updown.io][4] 和 [uptime robot][5]。我更喜欢 updown 的用户界面和[定价][6]结构它是按请求而不是按月收费但u ptime robot 有一个更慷慨的免费套餐。
它们会:
1. 检查网站是否正常
2. 如果出现故障,它会给我发电子邮件
我发现电子邮件通知对我来说是一个很好的级别,如果网站宕机,我会很快发现,但它不会唤醒我或任何东西。
### 步骤 2端到端的健康检查
接下来,让我们谈谈“检查网站是否正常”到底是什么意思。
起初,我只是把我的健康检查端点之一变成一个函数,无论如何都会返回 `200 OK`
这倒是挺有用的 它告诉我服务器是启动着的!
但不出所料,我遇到了问题,因为它没有检查 API 是否真的在_工作_ 有时健康检查成功了,尽管服务的其他部分实际上已经进入了一个糟糕的状态。
所以我更新了它,让它真正地发出 API 请求,并确保它成功了。
我所有的服务都只做了很少的事情nginx playground 只有一个端点),所以设置一个健康检查是非常容易的,它实际上贯穿了服务应该做的大部分动作。
下面是 nginx playground 的端到端健康检查处理程序的样子。它非常基本:它只是发出一个 POST 请求(给自己),并检查该请求是成功还是失败。
```
func healthHandler(w http.ResponseWriter, r *http.Request) {
// make a request to localhost:8080 with `healthcheckJSON` as the body
// if it works, return 200
// if it doesn't, return 500
client := http.Client{}
resp, err := client.Post("http://localhost:8080/", "application/json", strings.NewReader(healthcheckJSON))
if err != nil {
log.Println(err)
w.WriteHeader(http.StatusInternalServerError)
return
}
if resp.StatusCode != http.StatusOK {
log.Println(resp.StatusCode)
w.WriteHeader(http.StatusInternalServerError)
return
}
w.WriteHeader(http.StatusOK)
}
```
### 健康检查频率:每小时一次
现在,我大部分健康检查每小时运行一次,有些每 30 分钟运行一次。
我每小时运行一次,因为 updown.io 的定价是按健康检查次数计算的,我正在监控 18 个不同的 URL而且我想把我的健康检查预算保持在 5 美元/年的最低水平。
花一个小时来发现这些网站中的一个出现故障,对我来说是可以的 如果有问题,我也不能保证能很快修复它。
如果可以更频繁地运行它们,我可能会每 5-10 分钟运行一次。
### 步骤 3第三步如果健康检查失败自动重新启动
我的一些网站在 fly.io 上fly 有一个相当标准的功能,我可以为一个服务配置一个 HTTP 健康检查,如果健康检查失败,就重新启动服务。
“经常重启”是一个非常有用的策略来弥补我尚未修复的 bug有一段时间nginx playground 有一个进程泄漏,`nginx` 进程没有被终止,所以服务器的内存一直在耗尽。
通过健康检查,其结果是,每隔一天左右就会发生这样的情况:
* 服务器的内存用完了
* 健康检查开始失败
* 它被重新启动
* 一切又正常了
* 几个小时后再次重复整个传奇
最终,我开始实际修复进程泄漏,但很高兴有一个解决方法可以在我拖延修复 bug 时保持运行。
这些用于决定是否重新启动服务的运行状况检查更频繁地运行:每 5 分钟左右。
### 这不是监控大型服务的最佳方式
这可能很明显,我在一开始就已经说过了,但是“编写一个 HTTP 健康检查”并不是监控大型复杂服务的最佳方法。 但我不会深入讨论,因为这不是这篇文章的主题。
### 到目前为止一直运行良好!
我最初在 3 个月前的四月写了这篇文章,但我一直等到现在才发布它以确保整个设置正常工作。
这带来了很大的不同 在我遇到一些非常愚蠢的停机问题之前,现在在过去的几个月里,网站的运行时间达到了 99.95%
--------------------------------------------------------------------------------
via: https://jvns.ca/blog/2022/07/09/monitoring-small-web-services/
作者:[Julia Evans][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://jvns.ca/
[b]: https://github.com/lujun9972
[1]: https://nginx-playground.wizardzines.com
[2]: https://messwithdns.net
[3]: https://dns-lookup.jvns.ca
[4]: https://updown.io/
[5]: https://uptimerobot.com/
[6]: https://updown.io/#pricing

View File

@ -0,0 +1,163 @@
[#]: subject: "How to Install yay AUR Helper in Arch Linux [Beginners Guide]"
[#]: via: "https://www.debugpoint.com/install-yay-arch/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
如何在 Arch Linux 中安装 yay AUR 助手(初学者指南)
======
这个初学者指南解释了在 Arch Linux 中安装 Yay AUR 助手的步骤。
yay 是 “Yet Another Yogurt” 的缩写。从技术上讲,它是用 [Go 编程语言][2]编写的 [pacman][1] 封装器和 AUR 助手。它是当今最流行的 [Arch 用户仓库 (AUR)][3]助手。使用 Yay你可以利用庞大的 Arch 用户软件包库并轻松编译和安装任何软件。
它可以自动执行许多包管理任务,例如搜索、动态解决依赖关系、编译和构建包,当然还有在 AUR 发布包。
让我们看看如何在 Arch Linux 或任何基于 Arch 的发行版(如 Manjaro中安装 Yay。安装 Arch Linux 后,你可以通过 pacman 包管理器从三个主要的 Arch 官方仓库安装包。但是在全新的 Arch Linux 安装后,默认情况下不会安装 Yay。因此你需要手动安装它以利用 AUR。
本指南涵盖以下主题。
* 在 Arch Linux 中安装 yay
* 在 Manjaro 中安装 yay
* 如何在 Arch Linux 和 Manjaro 中使用 yay 安装包
* 一些 yay 的提示
### 在 Arch Linux 中安装 yay
#### 先决条件
打开终端并运行以下命令。出现提示时提供管理员密码。这些步骤需要 [base-devel][4] 包和 git 包进行编译和安装。
```
sudo pacman -S base-devel
```
```
sudo pacman -S git
```
![Install git][5]
#### 安装 yay
yay 包在 Arch 仓库中有两个版本,如下所示。
[yay][6] 稳定版
[yay-git][7] 开发版
对于本指南,我使用了稳定版。现在,进入 “/opt” 目录并克隆 git 仓库。
```
cd /optsudo git clone https://aur.archlinux.org/yay.git
```
![clone the yay repo][8]
更改源目录的所有者。将 “debugpoint” 替换为你的用户名。
```
sudo chown -R debugpoint:users ./yay
```
如果你不知道用户或组,可以使用以下示例查找用户和组。
```
id debugpoint
```
进入目录并编译。
```
cd yay
```
```
makepkg -si
```
这样就完成了 Arch Linux 中 yay 的安装。
![Install yay in Arch Linux][9]
### 在 Manjaro 中安装 yay
如果你使用 Manjaro Linuxyay 包可以在社区仓库中找到。你可以在 Manjaro 中使用以下命令轻松安装。
```
pacman -Syyupacman -S yay
```
现在,让我们看看如何使用 Yay 安装任何软件包以及一些基本的 yay 用法。
### 如何使用 yay 安装包
首先在 AUR 网站上搜索安装任何应用以获取包名。例如,要安装 [featherpad][10] 文本编辑器,请运行以下命令。
```
yay -S featherpad
```
安装后,你可以在应用菜单中找到应用启动器。
![Install a sample application (featherpad) using yay][11]
### 一些 yay 的技巧
你还可以使用 yay 进行许多调整和系统操作。下面是一些示例。
**刷新系统包并升级**
```
yay -Syu
```
**使用包的开发版本并升级(运行此命令时要小心)**
```
yay -Syu --devel --timeupdate
```
**删除任何包例如featherpad**
```
yay -Rns featherpad
```
**快速获取系统统计信息**
![system stat using yay][12]
```
yay -Ps
```
我希望这个初学者指南能帮助你在 [Arch Linux][13] 中安装 yay然后使用 yay 安装包,并执行不同的系统操作。
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/install-yay-arch/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://wiki.archlinux.org/index.php/pacman
[2]: https://golang.org/
[3]: https://wiki.archlinux.org/index.php/Arch_User_Repository
[4]: https://aur.archlinux.org/packages/meta-group-base-devel/
[5]: https://www.debugpoint.com/wp-content/uploads/2021/01/Install-git-1024x291.png
[6]: https://aur.archlinux.org/packages/yay/
[7]: https://aur.archlinux.org/packages/yay-git/
[8]: https://www.debugpoint.com/wp-content/uploads/2021/01/clone-the-yay-repo-1024x271.png
[9]: https://www.debugpoint.com/wp-content/uploads/2021/01/Install-yay-in-Arch-Linux-1024x460.png
[10]: https://aur.archlinux.org/packages/featherpad-git/
[11]: https://www.debugpoint.com/wp-content/uploads/2021/01/Install-a-sample-application-featherpad-using-yay-1024x620.png
[12]: https://www.debugpoint.com/wp-content/uploads/2021/01/system-stat-using-yay.png
[13]: https://www.debugpoint.com/tag/arch-linux/