mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-02-28 01:01:09 +08:00
commit
05d5504938
@ -0,0 +1,79 @@
|
||||
[#]: subject: "Apps for daily needs part 3: image editors"
|
||||
[#]: via: "https://fedoramagazine.org/apps-for-daily-needs-part-3-image-editors/"
|
||||
[#]: author: "Arman Arisman https://fedoramagazine.org/author/armanwu/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "wxy"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-13761-1.html"
|
||||
|
||||
满足日常需求的应用(三):图像编辑器
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
图像编辑器是许多人喜欢和需要的应用程序,从专业的设计师、学生,或那些有某些爱好的人。特别是在这个数字时代,越来越多的人因为各种原因需要图像编辑器。本文将介绍一些你可以在 Fedora Linux 上使用的开源图像编辑器。你可能需要安装提到的软件。如果你不熟悉如何在 Fedora Linux 中添加软件包,请参阅我之前的文章 [安装 Fedora 34 工作站后要做的事情][4]。这里列出了图像编辑器类的一些日常需求的应用程序。
|
||||
|
||||
### GIMP
|
||||
|
||||
GIMP(<ruby>GNU 图像处理程序<rt>GNU Image Manipulation Program</rt></ruby>)是一个光栅图像(位图)编辑器,用于照片修饰、图像合成和图像创作。它的功能几乎与 Adobe Photoshop 相同。你可以用 GIMP 做很多你可以用 Photoshop 做的事情。正因为如此,GIMP 作为 Adobe Photoshop 的开源替代品,已经成为最受欢迎的应用程序。
|
||||
|
||||
GIMP 有很多图像处理的功能,特别是针对光栅图像。你可以用 GIMP 修复或改变照片的颜色。你可以选择图像的一部分,裁剪它,然后与图像的其他部分合并。GIMP 还有许多你可以应用于你的图像的效果,包括模糊、阴影、噪音等等。许多人用 GIMP 来修复损坏的照片,提高图像质量,裁剪图像中不需要的部分,制作海报和各种图形设计作品,等等。此外,你还可以在 GIMP 中添加插件和脚本,使其功能更加全面。
|
||||
|
||||
![][5]
|
||||
|
||||
更多信息请见此链接:: <https://www.gimp.org/>
|
||||
|
||||
### Inkscape
|
||||
|
||||
Inkscape 是一个流行的开源应用程序,用于创建和编辑矢量图。它是一个功能丰富的矢量图形编辑器,这使它可以与其他类似的专有应用程序(如 Adobe Illustrator 和 Corel Draw)相竞争。正因为如此,许多专业插画师使用它来创建基于矢量的艺术作品。
|
||||
|
||||
你可以用 Inkscape 制作艺术和技术插图,如标志、图表、图标、桌面壁纸、流程图、漫画等等。此外,Inkscape 可以处理各种图形文件格式。此外,你还可以添加附加组件,使你的工作更容易。
|
||||
|
||||
![][6]
|
||||
|
||||
更多信息请见此链接: <https://inkscape.org/>
|
||||
|
||||
### Krita
|
||||
|
||||
Krita 乍一看像 GIMP 或 Inkscape。但实际上,它是一个完全不同的应用程序,尽管它有一些类似的功能。Krita 是一款用于创作像艺术家那样的数字绘画的应用程序。你可以用 Krita 来制作概念艺术、插图、漫画、纹理和哑光画。
|
||||
|
||||
Krita 有 100 多个预装的专业画笔。它还有一个画笔稳定器功能,有 3 种不同的方式来平滑和稳定你的画笔笔触。此外,你可以用 9 种以上的独特画笔引擎来定制你的画笔。Krita 是那些喜欢进行数字绘画的人的合适应用。
|
||||
|
||||
![][7]
|
||||
|
||||
更多信息可在此链接获得:<https://krita.org/en/>
|
||||
|
||||
### darktable
|
||||
|
||||
darktable 是摄影师或那些想提高照片质量的人的完美选择。darktable 更侧重于图像编辑,特别是对 RAW 图像的非破坏性后期制作。因此,它提供专业的色彩管理,支持自动检测显示配置文件。此外,你还可以用 darktable 过滤和排序多张图片。所以你可以通过标签、评级、颜色标签等来搜索你的收藏。它可以导入各种图像格式,如 JPEG、CR2、NEF、HDR、PFM、RAF 等。
|
||||
|
||||
![][8]
|
||||
|
||||
更多信息可在此链接中获得:<https://www.darktable.org/>
|
||||
|
||||
### 总结
|
||||
|
||||
这篇文章介绍了四个图像编辑器,你可以在 Fedora Linux 上使用它们满足你日常需求。每个应用程序都代表了图像编辑器应用程序的一个子类别。实际上,还有许多其他的图像编辑器可以在 Fedora Linux 上使用。你也可以使用 RawTherapee 或 Photivo 作为 dartkable 替代品。此外,还有 Pinta 作为 GIMP 的替代品,以及 MyPaint 作为 Krita 的替代品。希望这篇文章能帮助你选择正确的图像编辑器。如果你有使用这些应用程序的经验,请在评论中分享你的经验。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/apps-for-daily-needs-part-3-image-editors/
|
||||
|
||||
作者:[Arman Arisman][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://fedoramagazine.org/author/armanwu/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/FedoraMagz-Apps-3-Graphics-816x345.jpg
|
||||
[2]: https://unsplash.com/@brookecagle?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
|
||||
[3]: https://unsplash.com/s/photos/meeting-on-cafe-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
|
||||
[4]: https://fedoramagazine.org/things-to-do-after-installing-fedora-34-workstation/
|
||||
[5]: https://fedoramagazine.org/wp-content/uploads/2021/07/image-gimp-1024x576.png
|
||||
[6]: https://fedoramagazine.org/wp-content/uploads/2021/07/image-inkscape-1024x575.png
|
||||
[7]: https://fedoramagazine.org/wp-content/uploads/2021/07/image-krita-1024x592.png
|
||||
[8]: https://fedoramagazine.org/wp-content/uploads/2021/07/image-darktable-1024x583.png
|
@ -3,49 +3,52 @@
|
||||
[#]: author: "Ron McFarland https://opensource.com/users/ron-mcfarland"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "zz-air"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-13765-1.html"
|
||||
|
||||
了解团队隐含价值观和需求的指南
|
||||
======
|
||||
为了增强团队动力,开放的领导可以研究指导成员行为和决策的隐性社会规范。
|
||||
![Working meetings can be effective meetings][1]
|
||||
|
||||
文化在[开放的组织][2]很重要。 但“文化”似乎是一个如此庞大而复杂的概念。我们该如何帮助开放式的团队组织去理解它呢?
|
||||
> 为了增强团队动力,开放式领导可以研究指导成员行为和决策的隐性社会规范。
|
||||
|
||||
一个解决方案可能来自于 [_Rule Makers, Rule Breakers_][4]_的作者 [Michele J. Gelfand][3]:紧密和松散的文化以及指导我们生活的秘密信号_。Gelfand 把所有的国家和文化分成简单的两类, 一类是“紧密的”文化另一类是“松散的”。然后,她解释了两者的特点和社会规范,提供了它们的相对优势和劣势。通过研究两者,我们可以克服团队、组织和国家之间的分歧和冲突。
|
||||

|
||||
|
||||
In this two-part review of _Rule Makers, Rule Breakers_, 我将解释 Gelfand 的论点,并讨论它对在开放性组织中工作的人们有用的方式。
|
||||
文化在 [开放式组织][2] 很重要。但“文化”似乎是一个如此庞大而复杂的概念。我们该如何帮助开放式组织去理解它呢?
|
||||
|
||||
一个解决方案可能来自于《[Rule Makers, Rule Breakers][4]》的作者 [Michele J. Gelfand][3]:紧密和松散的文化以及指导我们生活的秘密信号。Gelfand 把所有的国家和文化分成简单的两类:一类是“紧密的”文化,另一类是“松散的”。然后,她解释了两者的特点和社会规范,提供了它们的相对优势和劣势。通过研究两者,我们可以克服团队、组织和国家之间的分歧和冲突。
|
||||
|
||||
在这个分为两篇的《Rule Makers, Rule Breakers》的点评中, 我将解释 Gelfand 的论点,并讨论它对在开放性组织中工作的人们有用的方式。
|
||||
|
||||
### 了解你的社会规范
|
||||
|
||||
Gelfand 认为,我们的行为很大程度上取决于我们是生活在 "紧密的" 还是 "松散的" 社区文化中,因为这些文化有不同于其他文化的社会规范。这些规范————以及强制执行的严格程度————将决定我们在社会中的行为。 它们给了我们身份。它们帮助我们彼此协调,简而言之,这些价值使社区团结在一起。
|
||||
Gelfand 认为,我们的行为很大程度上取决于我们是生活在“紧密的”还是“松散的”社区文化中,因为每一种文化都有不同于其他文化的社会规范。这些规范 ——— 以及强制执行的严格程度 ——— 将决定我们在社会中的行为。它们给了我们身份,它们帮助我们彼此协调。简而言之,这些价值使社区团结在一起。
|
||||
|
||||
它们也会影响我们的世界观,影响我们构造环境的方式,甚至影响我们大脑的处理过程。 Gelfand 写道:“无数研究表明,社会规范对于将社区团结成合作、协调良好的团体,从而实现伟大成就至关重要。” 纵观历史,社区让其公民参加看似最疯狂的仪式,除了维持群体凝聚力和合作外,别无其他原因。 这些仪式产生了更紧密的联系,使人们得以生存(特别是在狩猎、觅食和战争时期)。
|
||||
|
||||
社会规范包括我们所有人都会自动遵守的规则, Gelfand 称之为一种 “规范性自动驾驶仪。” 这些是我们不需要思考就能做的事情————例如,在图书馆、电影院、电梯或飞机上保持安静。 我们会自动的做这些事。 “从外面看,” Gelfand 说, “我们的社会规范通常看起来很奇怪。但在内心深处,我们认为这是理所当然的。” 她解释到,社会规范可以被编入法规和法律(“遵守停车标志”和“不要偷窃”)。还有一些基本上是默不作声的(“不要盯着火车上的人看”或“打喷嚏时捂住嘴”)。当然,它们因环境而异。
|
||||
社会规范包括我们所有人都会自动遵守的规则, Gelfand 称之为一种 “规范性自动驾驶仪”。 这些是我们不需要思考就能做的事情————例如,在图书馆、电影院、电梯或飞机上保持安静。 我们会自动的做这些事。 “从表面看,” Gelfand 说, “我们的社会规范通常看起来很奇怪。但在内心深处,我们认为这是理所当然的。” 她解释到,社会规范可以被编入法规和法律(“遵守停车标志”和“不要偷窃”)。还有一些基本上是不言而喻的(“不要盯着火车上的人看”或“打喷嚏时捂住嘴”)。当然,它们因环境而异。
|
||||
|
||||
挑战在于大多数社会规范都是无形的,我们不知道这些社会规范在多大程度上控制着我们。在不知不觉中,我们常常只是跟随周围的人群。这被称为“群体思维”,在这种思维中,人们会跟随他们认同的群体,即使这个群体是错误的。他们不想站出来。
|
||||
|
||||
### 组织,有松有紧
|
||||
|
||||
Gelfand 将社会规范组织成不同的群体。她认为,一些规范具有“紧密”文化的特征,而另一些规范则具有“松散”文化的特征。为此, Gelfand 对来自五大洲 30 多个国家的约 7000 人进行了研究和抽样,他们的职业、性别、年龄、宗教、教派,以及社会阶层,以了解这些社区将自己定位在何处(以及他们的社会规范在官方和社区/社区总体上的执行力度)。 紧密和松散文化之间的差异在国家之间、国家内部(如美国及其各个地区)、组织内部、社会阶层内部甚至家庭内部都有所不同。
|
||||
Gelfand 将社会规范组织成不同的组别。她认为,一些规范具有“紧密”文化的特征,而另一些规范则具有“松散”文化的特征。为此, Gelfand 对来自五大洲 30 多个国家的约 7000 人进行了研究和抽样,他们具有广泛的职业、性别、年龄、宗教、教派,以及社会阶层,以了解这些社区将自己定位在何处(以及他们的社会规范在官方和社区/社区总体上的执行力度)。 紧密和松散文化之间的差异在国家之间、国家内部(如美国及其各个地区)、组织内部、社会阶层内部甚至家庭内部都有所不同。
|
||||
|
||||
因为组织有文化,它们也有自己的社会规范(毕竟,如果一个组织无法协调其成员并影响其行为,它将无法生存)。 因此,组织也可以反映和灌输 Gelfand 所描述的轻松”或“松散”的文化特征。 并且如果我们有很强的能力识别这些差异,我们就能更成功地预测和解决冲突。然后,在对这些社会规范有了更高认识的情况下,我们可以将开放式组织原则付诸实践。
|
||||
因为组织有文化,它们也有自己的社会规范(毕竟,如果一个组织无法协调其成员并影响其行为,它将无法存在)。 因此,组织也可以反映和灌输 Gelfand 所描述的“紧密”或“松散”的文化特征。 并且如果我们有很强的能力识别这些差异,我们就能更成功地预测和解决冲突。然后,在对这些社会规范有了更高认识的情况下,我们可以将开放式组织原则付诸实践。
|
||||
|
||||
Gelfand 这样描述紧密和松散文化的区别:
|
||||
|
||||
> 从广义上讲,松散的文化倾向于开放,但它们也更加无序。另一方面,紧密的文化有令人欣慰的秩序和可预测性,但它们的容忍度较低。这就是紧-松的权衡:一个领域的优势与另一个领域的劣势并存。
|
||||
> 从广义上讲,松散的文化倾向于开放,但它们也更加无序。另一方面,紧密的文化有令人欣慰的秩序和可预测性,但它们的容忍度较低。这就是紧与松的权衡:一个领域的优势与另一个领域的劣势并存。
|
||||
|
||||
她总结说,紧密的社会保持着严格的社会秩序、同步性和自律性;宽松的社会以高度宽容、富有创造力和对变化持开放态度而自豪。
|
||||
|
||||
虽然并非所有情况都是如此,但紧密和松散的文化通常会表现出一些权衡;每个人都有自己的长处和短处。参见下面的图 1 。
|
||||
|
||||
![][5]
|
||||
|
||||
在这两种环境中成功应用五项开放式组织原则的工作可能会有很大的不同。要取得成功,社区承诺至关重要,如果社会规范不同,承诺的原因也会不同。组织领导者必须知道社区的价值观是什么。只有这样,这个人才能充分激励他人。
|
||||
在这两种环境中成功应用五项开放式组织原则的工作可能会有很大的不同。要取得成功,社区承诺至关重要,如果社会规范不同,承诺的理由也会不同。组织领导者必须知道社区的价值观是什么。只有这样,这个人才能充分激励他人。
|
||||
|
||||
在本综述的下一部分中,我将更彻底地解释紧密文化和松散文化的特征,以便领导者能够更好地了解如何将开放式组织原则运用到团队中。
|
||||
在本点评的下一部分中,我将更彻底地解释紧密文化和松散文化的特征,以便领导者能够更好地了解如何将开放式组织原则运用到团队中。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -54,7 +57,7 @@ via: https://opensource.com/open-organization/21/8/leadership-cultural-social-no
|
||||
作者:[Ron McFarland][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[zz-air](https://github.com/zz-air)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -3,20 +3,22 @@
|
||||
[#]: author: "Jim Hall https://opensource.com/users/jim-hall"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "perfiffer"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-13762-1.html"
|
||||
|
||||
通过 ncurses 在 Linux 上写一个猜谜游戏
|
||||
======
|
||||
使用 ncurses 的灵活性和强大功能在 Linux 上创建一个猜数字游戏。
|
||||
![question mark in chalk][1]
|
||||
|
||||
在我的[上一篇文章][2],我简要介绍了使用 ncurses 库通过 C 语言编写文本模式交互式应用程序。使用 `ncurses`,我们可以控制文本在终端上的显示位置和方式。如果你通过阅读手册页探索 `ncurses` 库函数,你会发现有很多不同的方式来显示文本,包括粗体文本、颜色、闪烁文本、窗口、边框、图形字符和其它功能,这些都可以使你的应用脱颖而出。
|
||||
> 使用 ncurses 的灵活性和强大功能在 Linux 上创建一个猜数字游戏。
|
||||
|
||||
如果你想探索一个更高级的程序来演示其中一些有趣的功能,这里有一个简单的“猜数字”游戏,已更新为使用 `ncurses`。该程序在一个范围内选择一个随机数,然后要求用户进行重复猜测,直到他们猜到秘密数字。当用户进行猜测时,程序会告知他们猜测的数字是太低还是太高。
|
||||

|
||||
|
||||
请注意,程序限定可能的数字范围是 0 到 7。将值保持在有限的个位数数字范围内,可以更轻松的使用 `getch()` 函数从用户读取单个数字。我还使用了 `getrandom` 内核系统调用来生成随机数,设定数字最大值为 7,以从 0 (二进制 0000)到 7 (二进制0111)中选择一个随机数。
|
||||
在我的 [上一篇文章][2],我简要介绍了使用 ncurses 库通过 C 语言编写文本模式交互式应用程序。使用 ncurses,我们可以控制文本在终端上的显示位置和方式。如果你通过阅读手册页探索 ncurses 库函数,你会发现显示文本有很多不同的方式,包括粗体文本、颜色、闪烁文本、窗口、边框、图形字符和其它功能,这些都可以使你的应用脱颖而出。
|
||||
|
||||
如果你想探索一个更高级的程序来演示其中一些有趣的功能,有一个简单的“猜数字”游戏,我已更新为使用 ncurses 编写的了。该程序在一个范围内选择一个随机数,然后要求用户进行重复猜测,直到他们猜到这个秘密数字。当用户进行猜测时,程序会告知他们猜测的数字是太低还是太高。
|
||||
|
||||
请注意,程序限定可能的数字范围是 0 到 7。将值保持在有限的个位数数字范围内,可以更轻松的使用 `getch()` 函数从用户读取单个数字。我还使用了 `getrandom` 内核系统调用来生成随机数,设定数字最大值为 7,以从 0 (二进制 `0000`)到 7 (二进制 `0111`)中选择一个随机数。
|
||||
|
||||
```
|
||||
#include <curses.h>;
|
||||
@ -44,7 +46,7 @@ read_guess()
|
||||
}
|
||||
```
|
||||
|
||||
通过使用 `ncurses`,我们可以增加一些有趣的视觉体验。通过添加函数,我们可以在屏幕顶部显示重要的文本信息,在屏幕底部显示状态消息行。
|
||||
通过使用 ncurses,我们可以增加一些有趣的视觉体验。通过添加函数,我们可以在屏幕顶部显示重要的文本信息,在屏幕底部显示状态消息行:
|
||||
|
||||
```
|
||||
void
|
||||
@ -72,7 +74,7 @@ print_status(const char *text)
|
||||
}
|
||||
```
|
||||
|
||||
通过这些函数,我们就可以构建猜数字游戏的主要部分。首先,程序为 `ncurses` 设置终端,然后从 0 到 7 中选择一个随机数。显示数字刻度后,程序启动一个循环,询问用户的猜测。
|
||||
通过这些函数,我们就可以构建猜数字游戏的主要部分。首先,程序为 ncurses 设置终端,然后从 0 到 7 中选择一个随机数。显示数字刻度后,程序启动一个循环,询问用户的猜测。
|
||||
|
||||
当用户进行猜测时,程序会在屏幕上提供反馈。如果猜测太低,程序会在屏幕上的数字下方打印一个左方括号。如果猜测太高,程序会在屏幕上的数字下方打印一个右方括号。这有助于用户缩小他们的选择范围,直到他们猜出正确的数字。
|
||||
|
||||
@ -125,20 +127,21 @@ main()
|
||||
}
|
||||
```
|
||||
|
||||
复制这个程序,自己尝试编译它。不要忘记你需要告诉 GCC 编译器链接到 `ncurses` 库:
|
||||
复制这个程序,自己尝试编译它。不要忘记你需要告诉 GCC 编译器链接到 ncurses 库:
|
||||
|
||||
```
|
||||
$ gcc -o guess guess.c -lncurses
|
||||
```
|
||||
|
||||
我留下了一个调试行,所以你可以看到屏幕右上角附近的秘密数字:
|
||||
|
||||
![guess number game interface][3]
|
||||
|
||||
图1:猜数字游戏。注意右上角的秘密数字。
|
||||
*图1:猜数字游戏。注意右上角的秘密数字。*
|
||||
|
||||
### 开始使用 ncurses
|
||||
|
||||
该程序使用了 `ncurses` 的许多其它功能,你可以从这些功能开始。例如,`print_header` 函数在屏幕顶部居中以粗体文本打印消息,`print_status` 函数在屏幕左下角以反向文本打印消息。使用它来帮助你开始使用 `ncurses` 编程。
|
||||
该程序使用了 ncurses 的许多其它函数,你可以从这些函数开始。例如,`print_header` 函数在屏幕顶部居中以粗体文本打印消息,`print_status` 函数在屏幕左下角以反向文本打印消息。使用它来帮助你开始使用 ncurses 编程。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -147,7 +150,7 @@ via: https://opensource.com/article/21/8/guess-number-game-ncurses-linux
|
||||
作者:[Jim Hall][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[perfiffer](https://github.com/perfiffer)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
120
published/20210831 What is a container image.md
Normal file
120
published/20210831 What is a container image.md
Normal file
@ -0,0 +1,120 @@
|
||||
[#]: subject: "What is a container image?"
|
||||
[#]: via: "https://opensource.com/article/21/8/container-image"
|
||||
[#]: author: "Nived V https://opensource.com/users/nivedv"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-13766-1.html"
|
||||
|
||||
什么是容器镜像?
|
||||
======
|
||||
|
||||
> 容器镜像包含一个打包的应用,以及它的依赖关系,还有它在启动时运行的进程信息。
|
||||
|
||||

|
||||
|
||||
容器是当今 IT 运维的一个关键部分。<ruby>容器镜像<rt>container image</rt></ruby>包含了一个打包的应用,以及它的依赖关系,还有它在启动时运行的进程信息。
|
||||
|
||||
你可以通过提供一组特殊格式的指令来创建容器镜像,可以是提交给<ruby>注册中心<rt>Registry</rt></ruby>,或者是作为 Dockerfile 保存。例如,这个 Dockerfile 为 PHP Web 应用创建了一个容器:
|
||||
|
||||
```
|
||||
FROM registry.access.redhat.com/ubi8/ubi:8.1
|
||||
|
||||
RUN yum --disableplugin=subscription-manager -y module enable php:7.3 \
|
||||
&& yum --disableplugin=subscription-manager -y install httpd php \
|
||||
&& yum --disableplugin=subscription-manager clean all
|
||||
|
||||
ADD index.php /var/www/html
|
||||
|
||||
RUN sed -i 's/Listen 80/Listen 8080/' /etc/httpd/conf/httpd.conf \
|
||||
&& sed -i 's/listen.acl_users = apache,nginx/listen.acl_users =/' /etc/php-fpm.d/www.conf \
|
||||
&& mkdir /run/php-fpm \
|
||||
&& chgrp -R 0 /var/log/httpd /var/run/httpd /run/php-fpm \
|
||||
&& chmod -R g=u /var/log/httpd /var/run/httpd /run/php-fpm
|
||||
|
||||
EXPOSE 8080
|
||||
USER 1001
|
||||
CMD php-fpm & httpd -D FOREGROUND
|
||||
```
|
||||
|
||||
这个文件中的每条指令都会在容器镜像中增加一个<ruby>层<rt>layer</rt></ruby>。每一层只增加与下面一层的区别,然后,所有这些堆叠在一起,形成一个只读的容器镜像。
|
||||
|
||||
### 它是如何工作的?
|
||||
|
||||
你需要知道一些关于容器镜像的事情,按照这个顺序理解这些概念很重要:
|
||||
|
||||
1. 联合文件系统
|
||||
2. 写入时复制(COW)
|
||||
3. 叠加文件系统
|
||||
4. 快照器
|
||||
|
||||
### 联合文件系统
|
||||
|
||||
<ruby>联合文件系统<rt>Union File System</rt></ruby>(UnionFS)内置于 Linux 内核中,它允许将一个文件系统的内容与另一个文件系统的内容合并,同时保持“物理”内容的分离。其结果是一个统一的文件系统,即使数据实际上是以分支形式组织。
|
||||
|
||||
这里的想法是,如果你有多个镜像有一些相同的数据,不是让这些数据再次复制过来,而是通过使用一个叫做<ruby>层<rt>layer</rt></ruby>的东西来共享。
|
||||
|
||||
![UnionFS][2]
|
||||
|
||||
每一层都是一个可以在多个容器中共享的文件系统,例如,httpd 基础层是 Apache 的官方镜像,可以在任何数量的容器中使用。想象一下,由于我们在所有的容器中使用相同的基础层,我们节省了多少磁盘空间。
|
||||
|
||||
这些镜像层总是只读的,但是当我们用这个镜像创建一个新的容器时,我们会在它上面添加一个薄的可写层。这个可写层是你创建、修改、删除或进行每个容器所需的其他修改的地方。
|
||||
|
||||
### 写时复制(COW)
|
||||
|
||||
当你启动一个容器时,看起来好像这个容器有自己的整个文件系统。这意味着你在系统中运行的每个容器都需要自己的文件系统副本。这岂不是要占用大量的磁盘空间,而且还要花费大量的时间让容器启动?不是的,因为每个容器都不需要它自己的文件系统副本!
|
||||
|
||||
容器和镜像使用<ruby>写时复制<rt>copy-on-write</rt></ruby>(COW)机制来实现这一点。写时复制策略不是复制文件,而是将同一个数据实例分享给多个进程,并且只在一个进程需要修改或写入数据时进行复制。所有其他进程将继续使用原始数据。
|
||||
|
||||
Docker 对镜像和容器都使用了写时复制的机制。为了做到这一点,在旧版本中,镜像和运行中的容器之间的变化是通过<ruby>图驱动<rt>graph driver</rt></ruby>来跟踪的,现在则是通过<ruby>快照器<rt>snapshotter</rt></ruby>来跟踪。
|
||||
|
||||
在运行中的容器中执行任何写操作之前,要修改的文件的副本被放在容器的可写层上。这就是发生 _写_ 的地方。现在你知道为什么它被称为“写时复制”了么。
|
||||
|
||||
这种策略既优化了镜像磁盘空间的使用,也优化了容器启动时间的性能,并与 UnionFS 一起工作。
|
||||
|
||||
### 叠加文件系统
|
||||
|
||||
<ruby>叠加文件系统<rt>Overlay File System</rt></ruby>位于现有文件系统的顶部,结合了上层和下层的目录树,并将它们作为一个单一的目录来呈现。这些目录被称为<ruby>层<rt>layer</rt></ruby>。下层保持不被修改。每一层只增加与下一层的差异(计算机术语为 “diff”),这种统一的过程被称为<ruby>联合挂载<rt>union mount</rt></ruby>。
|
||||
|
||||
最低的目录或镜像层被称为<ruby>下层目录<rt>lowerdir</rt></ruby>,上面的目录被称为 <ruby>上层目录<rt>upperdir</rt></ruby>。最后的覆盖层或统一层被称为<ruby>合并层<rt>merged</rt></ruby>。
|
||||
|
||||
![Layered file system][3]
|
||||
|
||||
常见的术语包括这些层的定义:
|
||||
|
||||
* <ruby>基础层<rt>Base layer</rt></ruby>:是你的文件系统的文件所在的地方。就容器镜像而言,这个层就是你的基础镜像。
|
||||
* <ruby>叠加层<rt>Overlay layer</rt></ruby>:通常被称为<ruby>容器层<rt>container layer</rt></ruby>,因为对运行中的容器所做的所有改变,如添加、删除或修改文件,都会写到这个可写层。对这一层所做的所有修改都存储在下一层,是基础层和差异层的联合视图。
|
||||
* <ruby>差异层<rt>Diff layer</rt></ruby>包含了在叠加层所作的所有修改。如果你写的东西已经在基础层了,那么叠加文件系统就会把文件复制到差异层,并做出你想写的修改。这被称为写时复制。
|
||||
|
||||
### 快照器
|
||||
|
||||
通过使用层和图驱动,容器可以将其更改作为其容器文件系统的一部分来构建、管理和分发。但是使用<ruby>图驱动<rt>graph driver</rt></ruby>的工作真的很复杂,而且容易出错。<ruby>快照器<rt>SnapShotter</rt></ruby>与图驱动不同,因为它们不用了解镜像或容器。
|
||||
|
||||
快照器的工作方式与 Git 非常相似,比如有树的概念,并跟踪每次提交对树的改变。一个<ruby>快照<rt>snapshot</rt></ruby>代表一个文件系统状态。快照有父子关系,使用一组目录。可以在父级和其快照之间进行差异比较(`diff`),以创建一个层。
|
||||
|
||||
快照器提供了一个用于分配、快照和挂载抽象的分层文件系统的 API。
|
||||
|
||||
### 总结
|
||||
|
||||
你现在对什么是容器镜像以及它们的分层方法如何使容器可移植有了很好的认识。接下来,我将介绍容器的运行机制和内部结构。
|
||||
|
||||
本文基于 [techbeatly][4] 的文章,经许可后改编。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/8/container-image
|
||||
|
||||
作者:[Nived V][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/nivedv
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus-containers.png?itok=d_4QhZxT (Shipping containers stacked)
|
||||
[2]: https://opensource.com/sites/default/files/unionfs.png (UnionFS)
|
||||
[3]: https://miro.medium.com/max/4800/0*h61UE3S0jRPv3mA7 (Layered file system)
|
||||
[4]: https://medium.com/techbeatly/container-part-ii-images-4f2139194775
|
@ -0,0 +1,92 @@
|
||||
[#]: subject: "OpenWrt 21.02 Arrives With Linux Kernel 5.4 & WPA3 Support"
|
||||
[#]: via: "https://news.itsfoss.com/openwrt-21-02-release/"
|
||||
[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "wxy"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-13763-1.html"
|
||||
|
||||
OpenWrt 21.02 发布,支持 Linux 内核 5.4 和 WPA3
|
||||
======
|
||||
|
||||

|
||||
|
||||
OpenWrt 社区宣布了该发行版的最新稳定版本:OpenWrt 21.02。
|
||||
|
||||
补充一句,OpenWrt 是一个帮助你创建嵌入式设备定制操作系统的项目。
|
||||
|
||||
它使用户能够根据他们的网络需求公开定制他们的设备,这是市面上销售的路由器的固件所没有的功能。除了路由器之外,OpenWrt 还可以在各种设备上运行,如智能手机、住宅网关,甚至是 32 位的个人电脑。
|
||||
|
||||
自从旧的 OpenWrt 19.07 以来,这个版本的发布带来了超过 5800 个新提交。
|
||||
|
||||
让我们来看看 OpenWrt 21.02 有哪些新功能。
|
||||
|
||||
### OpenWrt 21.02 有什么新内容?
|
||||
|
||||
虽然有一些技术上的变化和改进,但让我强调一下主要的新增内容。
|
||||
|
||||
#### WPA3 支持
|
||||
|
||||
虽然在 19.07 版本中就已经存在,但这个最新的 Wi-Fi 网络安全标准现在已默认包含在镜像中了。
|
||||
|
||||
WPA3 的意思是<ruby>Wi-Fi 受保护接入第三版<rt>Wi-Fi Protected Access 3</rt></ruby>,与流行的 WPA2 相比,在安全方面有很大的改进,也向后兼容。
|
||||
|
||||
#### TLS 和 HTTPS 支持
|
||||
|
||||
就像 WPA3 一样,它也默认包括了 TLS 和 HTTPS 支持,并且带有来自 Mozilla 的可信 CA 证书。
|
||||
|
||||
有了这个支持,无需其它工作,`wget` 和 ` opkg` 现在可以通过 HTTPS 获取资源了。此外,除了 HTTP 之外,[LuCl][1] 也可以通过 HTTPS 获得。
|
||||
|
||||
#### 初步的 DSA 支持
|
||||
|
||||
正如其发布公告中所说:
|
||||
|
||||
> “DSA(<ruby>分布式交换机架构<rt>Distributed Switch Architecture</rt></ruby>)是关于可配置的以太网交换机的 Linux 标准。”
|
||||
|
||||
这取代了直到现在还在使用的 `swconfig` 系统,是对 VLAN 和交换机端口管理方式的一个明显变化。
|
||||
|
||||
#### 新的最低硬件要求
|
||||
|
||||
随着 OpenWrt 的众多新功能和更新,以及 Linux 内核的大小的普遍增加,其最低硬件要求也被提高。
|
||||
|
||||
现在设备需要至少 8MB 的闪存和 64MB 的内存来运行默认的构建版本,以确保适当的稳定性。
|
||||
|
||||
#### 软件包更新
|
||||
|
||||
该版本还包含了几个软件包的升级,其中一些是:
|
||||
|
||||
* Linux 内核 5.4.143
|
||||
* gcc 8.4.0
|
||||
* glibc 2.33
|
||||
* binutils 2.34
|
||||
* busybox 1.33.1
|
||||
|
||||
除了上述列出的软件包,还有许多其他软件包也得到了升级。你可以在 [官方发布公告][2] 中了解完整的技术细节。
|
||||
|
||||
### 下载 OpenWrt 21.02
|
||||
|
||||
你可以前往其官方网站下载最新的稳定版,或者选择开发快照进行实验。
|
||||
|
||||
构建自己的软件包和固件的说明应该可以在其文档中找到。
|
||||
|
||||
可以使用 `sysupgrade` 命令将你的系统从 OpenWrt 19.07 升级到 OpenWrt 21.02。请注意,你无法从 18.06 升级。
|
||||
|
||||
- [OpenWrt 21.02][3]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/openwrt-21-02-release/
|
||||
|
||||
作者:[Rishabh Moharir][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://news.itsfoss.com/author/rishabh/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://openwrt.org/docs/techref/luci
|
||||
[2]: https://openwrt.org/releases/21.02/notes-21.02.0
|
||||
[3]: https://openwrt.org/downloads
|
@ -0,0 +1,96 @@
|
||||
[#]: subject: "Lakka Linux 3.4 Brings Fidelity FX Support With the New RetroArch 1.9.9"
|
||||
[#]: via: "https://news.itsfoss.com/lakka-retroarch-release/"
|
||||
[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Lakka Linux 3.4 Brings Fidelity FX Support With the New RetroArch 1.9.9
|
||||
======
|
||||
|
||||
For years now, [RetroArch][1] has been the gold standard in emulation, thanks to its ease of use and simplicity. Similarly, [Lakka][2] has gotten a name by using RetroArch to create an incredibly smooth and straightforward experience for its users.
|
||||
|
||||
Hence, we have recommended it in the past to [turn your old PC into a retrogaming console][3].
|
||||
|
||||
It is always a great day when these two large projects announce new releases, and it looks like we have some exciting news with Lakka 3.4 and RetroArch 1.9.9 release.
|
||||
|
||||
Here, we will be looking at some of the new features announced in RetroArch 1.9.9 and Lakka 3.4 and the significant impact on the future of emulation.
|
||||
|
||||
### What’s New?
|
||||
|
||||
With this release, RetroArch has introduced some useful and impactful new features. These include:
|
||||
|
||||
* AMD FidelityFX support for all games
|
||||
* Windows users can now use HDR on many games
|
||||
* New touchscreen menu for the Nintendo DS
|
||||
|
||||
|
||||
|
||||
Lakka (which includes RetroArch) has also received some welcome improvements.
|
||||
|
||||
* Improved stability
|
||||
* 3 new cores for the PS1, PS2, and DOS
|
||||
* Updated Mesa to version 21.2.1
|
||||
|
||||
|
||||
|
||||
Here we focus on the key highlights and, primarily, Integrated FidelityFX.
|
||||
|
||||
#### FidelityFX For Retro Games
|
||||
|
||||
![][4]
|
||||
|
||||
When AMD announced its open-source alternative to DLSS back in June, we could never have predicted the incredible impact it would have on emulation.
|
||||
|
||||
For those not aware, [FidelityFX][5] allows games to run at a lower resolution while retaining the same image quality, dramatically improving the performance.
|
||||
|
||||
Now, with the RetroArch 1.9.9 release, this technology is being brought to RetroArch and Lakka. This is great because it allows older games designed to run at a low resolution to look much better without resorting to mods or texture packs.
|
||||
|
||||
Overall, I expect this addition to be widely appreciated, especially by people looking for a more modern version of their favorite retro games.
|
||||
|
||||
If you want to learn more about FidelityFX and upscaling, I’d highly suggest you check out [our article on Intel’s XeSS where we explain all this][6] and how it impacts you.
|
||||
|
||||
#### New Touchscreen Menu For Nintendo 3DS
|
||||
|
||||
One of the more interesting ports of RetroArch, the Nintendo 3DS, has also gotten a cool new feature. This comes in the form of a touchscreen menu for the bottom screen, which shows a few useful shortcuts without covering the game.
|
||||
|
||||
While this doesn’t apply to Lakka, users of RetroArch running on top of another distribution should receive this change once RetroArch 1.9.9 lands in the repositories.
|
||||
|
||||
### Wrapping Up
|
||||
|
||||
Overall, [RetroArch 1.9.9][7] and [Lakka 3.4][8] are looking to be significant upgrades, especially with the new integration with FidelityFX.
|
||||
|
||||
As we have already seen, with emulators such as [RPCS3][9], FidelityFX can provide significant graphical improvements on older games, so it is exciting to see this come to RetroArch.
|
||||
|
||||
_What do you think about FidelityFX being used for retro games? Let me know in the comments below!_
|
||||
|
||||
#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
|
||||
|
||||
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
|
||||
|
||||
I'm not interested
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/lakka-retroarch-release/
|
||||
|
||||
作者:[Jacob Crume][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://news.itsfoss.com/author/jacob/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.retroarch.com/
|
||||
[2]: http://lakka.tv
|
||||
[3]: https://itsfoss.com/lakka-retrogaming-linux/
|
||||
[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjIzMCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[5]: https://www.amd.com/en/technologies/radeon-software-fidelityfx-super-resolution
|
||||
[6]: https://news.itsfoss.com/intel-xess-open-source/
|
||||
[7]: https://www.libretro.com/index.php/retroarch-1-9-9-released/
|
||||
[8]: http://lakka.tv/articles/2021/09/06/lakka-3.4/
|
||||
[9]: http://rpcs3.net
|
@ -1,89 +0,0 @@
|
||||
[#]: subject: "Apps for daily needs part 3: image editors"
|
||||
[#]: via: "https://fedoramagazine.org/apps-for-daily-needs-part-3-image-editors/"
|
||||
[#]: author: "Arman Arisman https://fedoramagazine.org/author/armanwu/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Apps for daily needs part 3: image editors
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
Photo by [Brooke Cagle][2] on [Unsplash][3]
|
||||
|
||||
Image editors are applications that are liked and needed by many people, from professional designers, students, or for those who have certain hobbies. Especially in this digital era, more and more people need image editors for various reasons. This article will introduce some of the open source image editors that you can use on Fedora Linux. You may need to install the software mentioned. If you are unfamiliar with how to add software packages in Fedora Linux, see my earlier article [Things to do after installing Fedora 34 Workstation][4]. Here is a list of a few apps for daily needs in the image editors category.
|
||||
|
||||
### GIMP
|
||||
|
||||
GIMP (GNU Image Manipulation Program) is a raster graphics editor used for photo retouching, image composition, and image authoring. It has almost the same functionality as Adobe Photoshop. You can use GIMP to do a lot of the things you can do with Photoshop. Because of that, GIMP has become the most popular application as an open source alternative to Adobe Photoshop.
|
||||
|
||||
GIMP has a lot of features for manipulating images, especially for raster images. You can fix or change the color of your photos using GIMP. You can select a part of the image, crop it, and then merge it with other pieces of the image. GIMP also has many effects that you can apply to your images, including blur, shadow, noise, etc. Many people use GIMP to repair damaged photos, improve image quality, crop unwanted parts of images, create posters and various graphic design works, and much more. Moreover you can also add plugins and scripts in GIMP, making it even more fully featured.
|
||||
|
||||
![][5]
|
||||
|
||||
More information is available at this link: <https://www.gimp.org/>
|
||||
|
||||
* * *
|
||||
|
||||
### Inkscape
|
||||
|
||||
Inkscape is a popular open source application used to create and edit vector graphics. It is a feature-rich vector graphics editor which makes it competitive with other similar proprietary applications, such as Adobe Illustrator and Corel Draw. Because of that, many professional illustrators use it to create vector-based artwork.
|
||||
|
||||
You can use Inkscape for making artistic and technical illustrations, such as logos, diagrams, icons, desktop wallpapers, flowcharts, cartoons, and much more. Moreover, Inkscape can handle various graphic file formats. In addition, you can also add add-ons to make your work easier.
|
||||
|
||||
![][6]
|
||||
|
||||
More information is available at this link: <https://inkscape.org/>
|
||||
|
||||
* * *
|
||||
|
||||
### Krita
|
||||
|
||||
Krita looks like GIMP or Inkscape at first glance. But actually it is an application that is quite different, although it has some similar functions. Krita is an application for creating digital paintings like those made by artists. You can use Krita for making concept art, illustration, comics, texture, and matte paintings.
|
||||
|
||||
Krita has over 100 professionally made brushes that come preloaded. It also has a brush stabilizer feature with 3 different ways to smooth and stabilize your brush strokes. Moreover, you can customize your brushes with over 9 unique brush engines. Krita is the right application for those of you who like digital painting activities.
|
||||
|
||||
![][7]
|
||||
|
||||
More information is available at this link: <https://krita.org/en/>
|
||||
|
||||
* * *
|
||||
|
||||
### darktable
|
||||
|
||||
darktable is perfect for photographers or for those who want to improve the quality of their photos. darktable focuses more on image editing specifically on non-destructive post-production of raw images. Therefore, it provides professional color management that supports automatic display profile detection. In addition, you can also use darktable to handle multiple images with filtering and sorting features. So you can search your collections by tags, rating, color labels, and many more. It can import various image formats, such as JPEG, CR2, NEF, HDR, PFM, RAF, etc.
|
||||
|
||||
![][8]
|
||||
|
||||
More information is available at this link: <https://www.darktable.org/>
|
||||
|
||||
* * *
|
||||
|
||||
### Conclusion
|
||||
|
||||
This article presented four image editors as apps for your daily needs that you can use on Fedora Linux. Each application represents a sub-category of image editor applications. Actually there are many other image editors that you can use in Fedora Linux. You can also use RawTherapee or Photivo as a dartkable alternative. In addition there is Pinta as an alternative to GIMP, and MyPaint as an alternative to Krita. Hopefully this article can help you to choose the right image editors. If you have experience in using these applications, please share your experience in the comments.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/apps-for-daily-needs-part-3-image-editors/
|
||||
|
||||
作者:[Arman Arisman][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://fedoramagazine.org/author/armanwu/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/FedoraMagz-Apps-3-Graphics-816x345.jpg
|
||||
[2]: https://unsplash.com/@brookecagle?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
|
||||
[3]: https://unsplash.com/s/photos/meeting-on-cafe-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
|
||||
[4]: https://fedoramagazine.org/things-to-do-after-installing-fedora-34-workstation/
|
||||
[5]: https://fedoramagazine.org/wp-content/uploads/2021/07/image-gimp-1024x576.png
|
||||
[6]: https://fedoramagazine.org/wp-content/uploads/2021/07/image-inkscape-1024x575.png
|
||||
[7]: https://fedoramagazine.org/wp-content/uploads/2021/07/image-krita-1024x592.png
|
||||
[8]: https://fedoramagazine.org/wp-content/uploads/2021/07/image-darktable-1024x583.png
|
@ -1,152 +0,0 @@
|
||||
[#]: subject: "4 Linux technologies fundamental to containers"
|
||||
[#]: via: "https://opensource.com/article/21/8/container-linux-technology"
|
||||
[#]: author: "Nived V https://opensource.com/users/nivedv"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
4 Linux technologies fundamental to containers
|
||||
======
|
||||
Namespaces, cgroups, seccomp, and SELinux are the Linux technologies
|
||||
that make up the foundations of building and running a container process
|
||||
on your system.
|
||||
![Penguin driving a car with a yellow background][1]
|
||||
|
||||
In previous articles, I have written about [container images][2] and [runtimes][3]. In this article, I look at how containers are made possible by a foundation of some special Linux technologies, including namespaces and control groups.
|
||||
|
||||
![layers of linux technologies][4]
|
||||
|
||||
Figure 1: Linux technologies that contribute to containers
|
||||
(Nived Velayudhan, [CC BY-SA 4.0][5])
|
||||
|
||||
Linux technologies make up the foundations of building and running a container process on your system. Technologies include:
|
||||
|
||||
1. Namespaces
|
||||
2. Control groups (cgroups)
|
||||
3. Seccomp
|
||||
4. SELinux
|
||||
|
||||
|
||||
|
||||
### Namespaces
|
||||
|
||||
_Namespaces_ provide a layer of isolation for the containers by giving the container a view of what appears to be its own Linux filesystem. This limits what a process can see and therefore restricts the resources available to it.
|
||||
|
||||
There are several namespaces in the Linux kernel that are used by Docker or Podman and others while creating a container:
|
||||
|
||||
|
||||
|
||||
```
|
||||
$ docker container run alpine ping 8.8.8.8
|
||||
$ sudo lsns -p 29413
|
||||
NS TYPE NPROCS PID USER COMMAND
|
||||
4026531835 cgroup 299 1 root /usr/lib/systemd/systemd --
|
||||
switched...
|
||||
4026533105 mnt 1 29413 root ping 8.8.8.8
|
||||
4026533106 uts 1 29413 root ping 8.8.8.8
|
||||
4026533105 ipc 1 29413 root ping 8.8.8.8
|
||||
[...]
|
||||
```
|
||||
|
||||
#### **User**
|
||||
|
||||
The user namespace isolates users and groups within a container. This is done by allowing containers to have a different view of UID and GID ranges compared to the host system. The user namespace enables the software to run inside the container as the root user. If an intruder attacks the container and then escapes to the host machine, they're confined to only a non-root identity.
|
||||
|
||||
#### **Mnt**
|
||||
|
||||
The mnt namespace allows the containers to have their own view of the system's file system hierarchy. You can find the mount points for each container process in the _/proc/<PID>/mounts_ location in your Linux system.
|
||||
|
||||
#### **UTS**
|
||||
|
||||
The Unix Timesharing System (UTS) namespace allows containers to have a unique hostname and domain name. When you run a container, a random ID is used as the hostname even when using the `— name` tag. You can use the [`unshare` command][6] to get an idea of how this works.
|
||||
|
||||
|
||||
```
|
||||
$ docker container run -it --name nived alpine sh
|
||||
/ # hostname
|
||||
9c9a5edabdd6
|
||||
/ #
|
||||
$ sudo unshare -u sh
|
||||
# hostname isolated.hostname
|
||||
# hostname
|
||||
# exit
|
||||
$ hostname
|
||||
homelab.redhat.com
|
||||
```
|
||||
|
||||
#### **IPC**
|
||||
|
||||
The Inter-Process Communication (IPC) namespace allows different container processes to communicate by accessing a shared range of memory or using a shared message queue.
|
||||
|
||||
|
||||
|
||||
```
|
||||
# ipcmk -M 10M
|
||||
Shared memory id: 0
|
||||
# ipcmk -M 20M
|
||||
Shared memory id: 1
|
||||
# ipcs
|
||||
\---- Message Queues ----
|
||||
key msqid owner perms used-bytes messages
|
||||
|
||||
\---- Shared Memory Segments
|
||||
key shmid owner perms bytes nattch status
|
||||
0xd1df416a 0 root 644 10485760 0
|
||||
0xbd487a9d 1 root 644 20971520 0
|
||||
[...]
|
||||
```
|
||||
|
||||
#### **PID**
|
||||
|
||||
The Process ID (PID) namespace ensures that the processes running inside a container are isolated from the external world. When you run a `ps` command inside a container, you only see the processes running inside the container and not on the host machine because of this namespace.
|
||||
|
||||
#### **Net**
|
||||
|
||||
The network namespace allows the container to have its own view of network interface, IP addresses, routing tables, port numbers, and so on. How does a container able to communicate to the external world? All containers you create get attached to a special virtual network interface for communication.
|
||||
|
||||
### Control groups (cgroups)
|
||||
|
||||
Cgroups are fundamental blocks of making a container. A cgroup allocates and limits resources such as CPU, memory, network I/O that are used by containers. The container engine automatically creates a cgroup filesystem of each type, and sets values for each container when the container is run.
|
||||
|
||||
### SECCOMP
|
||||
|
||||
Seccomp basically stands for _secure computing_. It is a Linux feature used to restrict the set of system calls that an application is allowed to make. The default seccomp profile for Docker, for example, disables around 44 syscalls (over 300 are available).
|
||||
|
||||
The idea here is to provide containers access to only those resources which the container might need. For example, if you don't need the container to change the clock time on your host machine, you probably have no use for the _clock_adjtime_ and _clock_settime_ syscalls, and it makes sense to block them out. Similarly, you don't want the containers to change the kernel modules, so there is no need for them to make _create_module, delete_module_ syscalls.
|
||||
|
||||
### SELinux
|
||||
|
||||
SELinux stands for _security-enhanced Linux_. If you are running a Red Hat distribution on your hosts, then SELinux is enabled by default. SELinux lets you limit an application to have access only to its own files and prevent any other processes from accessing them. So, if an application is compromised, it would limit the number of files that it can affect or control. It does this by setting up contexts for files and processes and by defining policies that would enforce what a process can see and make changes to.
|
||||
|
||||
SELinux policies for containers are defined by the `container-selinux` package. By default, containers are run with the **container_t** label and are allowed to read (r) and execute (x) under the _/usr_ directory and read most content from the _/etc_ directory. The label **container_var_lib_t** is common for files relating to containers.
|
||||
|
||||
### Wrap up
|
||||
|
||||
Containers are a critical part of today's IT infrastructure and a pretty interesting technology, too. Even if your role doesn't involve containerization directly, understanding a few fundamental container concepts and approaches gives you an appreciation for how they can help your organization. The fact that containers are built on open source Linux technologies makes them even better!
|
||||
|
||||
* * *
|
||||
|
||||
_This article is based on a [techbeatly][7] article and has been adapted with permission._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/8/container-linux-technology
|
||||
|
||||
作者:[Nived V][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/nivedv
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/car-penguin-drive-linux-yellow.png?itok=twWGlYAc (Penguin driving a car with a yellow background)
|
||||
[2]: https://opensource.com/article/21/8/container-fundamentals-2
|
||||
[3]: https://opensource.com/article/21/8/deep-dive-container-runtimes
|
||||
[4]: https://opensource.com/sites/default/files/1linuxtechs.png (layers of linux technologies)
|
||||
[5]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[6]: https://opensource.com/article/19/10/namespaces-and-containers-linux
|
||||
[7]: https://nivedv.medium.com/container-internals-deep-dive-5cc424957413
|
@ -1,116 +0,0 @@
|
||||
[#]: subject: "How to Install Dropbox on Ubuntu Linux"
|
||||
[#]: via: "https://itsfoss.com/install-dropbox-ubuntu/"
|
||||
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How to Install Dropbox on Ubuntu Linux
|
||||
======
|
||||
|
||||
Dropbox is one of the [most popular cloud storage services available for Linux][1] and other operating systems.
|
||||
|
||||
In fact, Dropbox is one of the earliest services to provide a native Linux application. It still [supports 32-bit Linux systems][2] that is also a commendable job.
|
||||
|
||||
In this beginner’s tutorial, I’ll show the steps for installing Dropbox on Ubuntu. The steps are really simple but some websites make it unnecessarily complicated.
|
||||
|
||||
### Install Dropbox on Ubuntu desktop
|
||||
|
||||
Let’s see the installation procedure, step by step.
|
||||
|
||||
#### Step 1: Get Dropbox installer for Ubuntu
|
||||
|
||||
Dropbox offers DEB files for its installer. Go to the download section of its website:
|
||||
|
||||
[Dropbox Download][3]
|
||||
|
||||
And download the appropriate DEB file. Considering that you are using 64 bit Ubuntu, get the deb file for 64-bit version.
|
||||
|
||||
![Download the Dropbox installer][4]
|
||||
|
||||
#### Step 2: Install Dropbox installer
|
||||
|
||||
The deb file you downloaded is just an installer for Dropbox. Actual Dropbox installation starts later, similar to [installing Steam on Ubuntu][5].
|
||||
|
||||
To [install the downloaded deb file][6], either double click on it or right click and select open with Software Install.
|
||||
|
||||
![Installing the downloaded Dropbox deb file][7]
|
||||
|
||||
It will open the software center and you can click the install button.
|
||||
|
||||
![Installing Dropbox deb file][8]
|
||||
|
||||
Wait for the installation to finish.
|
||||
|
||||
#### Step 3: Start Dropbox installation
|
||||
|
||||
Dropbox installer is now installed. Press the Windows key (also known as super key) and search for Dropbox and click on it.
|
||||
|
||||
![Start Dropbox for installation][9]
|
||||
|
||||
On the first launch, it shows two popups. One about restarting Nautilus (the file explorer in Ubuntu) and the other about Dropbox installation.
|
||||
|
||||
![Starting Dropbox installation][10]
|
||||
|
||||
Clicking either Restart Nautilus/Close (on the Nautilus popup) or OK (on the installation popup) starts the actual Dropbox client download and installation. If the ‘Nautilus Restart’ does not close on clicking Close button, click the x button.
|
||||
|
||||
Wait for the Dropbox installation to finish.
|
||||
|
||||
![Installing Dropbox][11]
|
||||
|
||||
Oh! Nautilus restart is required because Dropbox adds some extra features like showing the synchronization status in the file explorer.
|
||||
|
||||
Once Dropbox is installed, it should either take you to the Dropbox login page automatically or you can hit the Dropbox icon at the top and select sign in option.
|
||||
|
||||
![Sign in to Dropbox after installation][12]
|
||||
|
||||
In fact, this is how you would be accessing Dropbox settings in the future.
|
||||
|
||||
#### Step 4: Start using Dropbox on Ubuntu
|
||||
|
||||
![Sign in into Dropbox][13]
|
||||
|
||||
**Note**: Dropbox won’t work until you successfully sign in. Here’s a catch. The free version of Dropbox limits the number of devices you can link to your account. **If you already have 3 linked devices, you should remove some of the older ones that you do not use.**
|
||||
|
||||
Once you are successfully signed in, you should see a Dropbox folder created in your home directory and your files from the cloud starts appearing here.
|
||||
|
||||
![Dropbox folder is created under home directory][14]
|
||||
|
||||
If you want to save disk space or bandwidth, you can go to the Preferences and choose the Selective Sync option. The selective sync option allows you only sync selected folders from Dropbox cloud on your local system.
|
||||
|
||||
![Using selective sync in Dropbox][15]
|
||||
|
||||
Dropbox automatically starts at each boot. This is the behavior you should expect from any cloud service, I believe.
|
||||
|
||||
That’s all you need to get started with Dropbox on Ubuntu. I hope you find this tutorial helpful.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/install-dropbox-ubuntu/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/cloud-services-linux/
|
||||
[2]: https://itsfoss.com/32-bit-linux-distributions/
|
||||
[3]: https://www.dropbox.com/install-linux
|
||||
[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/get-dropbox-for-ubuntu.png?resize=800%2C294&ssl=1
|
||||
[5]: https://itsfoss.com/install-steam-ubuntu-linux/
|
||||
[6]: https://itsfoss.com/install-deb-files-ubuntu/
|
||||
[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/dropbox-installer-ubuntu.png?resize=797%2C476&ssl=1
|
||||
[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/installing-dropbox-deb-file.png?resize=800%2C346&ssl=1
|
||||
[9]: https://itsfoss.com/wp-content/uploads/2021/09/start-drobox-ubuntu.webp
|
||||
[10]: https://itsfoss.com/wp-content/uploads/2021/09/starting-dropbox-installation-800x599.webp
|
||||
[11]: https://itsfoss.com/wp-content/uploads/2021/09/installing-dropbox.webp
|
||||
[12]: https://itsfoss.com/wp-content/uploads/2021/09/sign-in-to-dropbox-after-first-installation.webp
|
||||
[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/sign-in-dropbox.png?resize=800%2C409&ssl=1
|
||||
[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/dropbox-folder-ubuntu.png?resize=800%2C491&ssl=1
|
||||
[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/Dropbox-selective-sync.png?resize=800%2C399&ssl=1
|
@ -1,81 +0,0 @@
|
||||
[#]: subject: "Resize an image from the Linux terminal"
|
||||
[#]: via: "https://opensource.com/article/21/9/resize-image-linux"
|
||||
[#]: author: "Jim Hall https://opensource.com/users/jim-hall"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Resize an image from the Linux terminal
|
||||
======
|
||||
Shrink an image from your terminal with the ImageMagick convert command.
|
||||
![Old camera blue][1]
|
||||
|
||||
ImageMagick is a handy multipurpose command-line tool for all your image needs. ImageMagick supports a variety of image types, including JPG photos and PNG graphics.
|
||||
|
||||
### Resizing images
|
||||
|
||||
I often use ImageMagick on my webserver to resize images. For example, let's say I want to include a photo of my cats on my personal website. The photo from my phone is very large, about 4000x3000 pixels, at 3.3MB. That's much too large for a web page. I use the ImageMagick convert tool to change the size of my photo so that I can include it on my web page. ImageMagick is a full suite of tools, one of the most common is the `convert` command.
|
||||
|
||||
The ImageMagick `convert` command uses this general syntax:
|
||||
|
||||
|
||||
```
|
||||
`convert {input} {actions} {output}`
|
||||
```
|
||||
|
||||
To resize a photo called `PXL_20210413_015045733.jpg` to a more manageable 500-pixel width, type this:
|
||||
|
||||
|
||||
```
|
||||
`$ convert PXL_20210413_015045733.jpg -resize 500x sleeping-cats.jpg`
|
||||
```
|
||||
|
||||
The new image is now only 65KB in size.
|
||||
|
||||
![Sleeping cats][2]
|
||||
|
||||
Jim Hall, [CC BY-SA 4.0][3]
|
||||
|
||||
You can provide both width and height dimensions with the `-resize` option. But, by providing only the width, ImageMagic does the math for you and automatically retains the aspect ratio by resizing the output image with a proportional height.
|
||||
|
||||
### Install ImageMagick on Linux
|
||||
|
||||
On Linux, you can install ImageMagick using your package manager. For instance, on Fedora or similar:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo dnf install imagemagick`
|
||||
```
|
||||
|
||||
On Debian and similar:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo apt install imagemagick`
|
||||
```
|
||||
|
||||
On macOS, use [MacPorts][4] or [Homebrew][5].
|
||||
|
||||
On Windows, use [Chocolatey][6].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/9/resize-image-linux
|
||||
|
||||
作者:[Jim Hall][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/jim-hall
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-photo-camera-blue.png?itok=AsIMZ9ga (Old camera blue)
|
||||
[2]: https://opensource.com/sites/default/files/sleeping-cats.jpg (Sleeping cats)
|
||||
[3]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[4]: https://opensource.com/article/20/11/macports
|
||||
[5]: https://opensource.com/article/20/6/homebrew-mac
|
||||
[6]: https://opensource.com/article/20/3/chocolatey
|
@ -2,7 +2,7 @@
|
||||
[#]: via: "https://itsfoss.com/stop-program-linux-terminal/"
|
||||
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
189
sources/tech/20210907 How to use BusyBox on Linux.md
Normal file
189
sources/tech/20210907 How to use BusyBox on Linux.md
Normal file
@ -0,0 +1,189 @@
|
||||
[#]: subject: "How to use BusyBox on Linux"
|
||||
[#]: via: "https://opensource.com/article/21/8/what-busybox"
|
||||
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How to use BusyBox on Linux
|
||||
======
|
||||
BusyBox is an open source (GPL) project providing simple implementations
|
||||
of nearly 400 common commands.
|
||||
![bash logo on green background][1]
|
||||
|
||||
It's easy to take Linux commands for granted. They come bundled with the system when you install Linux, and we often don't question why they're there. Some of the basic commands, such as [`cd`][2], [`kill`][3], and `echo` aren't always independent applications but are actually built into your shell. Others, such as [`ls`][4], [`mv`][5], and [`cat`][6] are part of a core utility package (often GNU `coreutils` specifically). But there are always alternatives in the world of open source, and one of the most interesting is [BusyBox][7].
|
||||
|
||||
### What is BusyBox in Linux?
|
||||
|
||||
BusyBox is an open source (GPL) project providing simple implementations of nearly 400 common commands, including `ls`, `mv`, `ln`, `mkdir`, `more`, `ps`, `gzip`, `bzip2`, `tar`, and `grep`. It also contains a version of the programming language `awk`, the stream editor `sed`, the filesystem checker `fsck`, the `rpm` and `dpkg` package managers, and of course, a shell (`sh`) that provides easy access to all of these commands. In short, it contains all the essential commands required for a POSIX system to perform common system maintenance tasks as well as many user and administrative tasks.
|
||||
|
||||
In fact, it even contains an `init` command which can be launched as PID 1 to serve as the parent process for all other system services. In other words, BusyBox can be used as an alternative to [systemd][8], OpenRC, sinit, init, and other launch daemons.
|
||||
|
||||
BusyBox is very small. As an executable, it's under 1 MB, so it has gained much of its popularity in the [embedded][9], [Edge][10], and [IoT][11] space, where drive space is at a premium. In the world of containers and cloud computing, it's also popular as a foundation for minimal Linux container images.
|
||||
|
||||
### Minimalism
|
||||
|
||||
Part of the appeal of BusyBox is its minimalism. All of its commands are compiled into a single binary (`busybox`), and its man page is a mere 81 pages (by my calculation of piping `man` to `pr`) but covers nearly 400 commands.
|
||||
|
||||
As an example comparison, here's the output of the `shadow` version of `useradd --help`:
|
||||
|
||||
|
||||
```
|
||||
-b, --base-dir BASE_DIR base directory for home
|
||||
-c, --comment COMMENT GECOS field of the new account
|
||||
-d, --home-dir HOME_DIR home directory of the new account
|
||||
-D, --defaults print or change the default config
|
||||
-e, --expiredate EXPIRE_DATE expiration date of the new account
|
||||
-f, --inactive INACTIVE password inactivity
|
||||
-g, --gid GROUP name or ID of the primary group
|
||||
-G, --groups GROUPS list of supplementary groups
|
||||
-h, --help display this help message and exit
|
||||
-k, --skel SKEL_DIR alternative skeleton dir
|
||||
-K, --key KEY=VALUE override /etc/login.defs
|
||||
-l, --no-log-init do not add the user to the lastlog
|
||||
-m, --create-home create the user's home directory
|
||||
-M, --no-create-home do not create the user's home directory
|
||||
-N, --no-user-group do not create a group with the user's name
|
||||
-o, --non-unique allow users with non-unique UIDs
|
||||
-p, --password PASSWORD encrypted password of the new account
|
||||
-r, --system create a system account
|
||||
-R, --root CHROOT_DIR directory to chroot into
|
||||
-s, --shell SHELL login shell of the new account
|
||||
-u, --uid UID user ID of the new account
|
||||
-U, --user-group create a group with the same name as a user
|
||||
```
|
||||
|
||||
And here's the BusyBox version of the same command:
|
||||
|
||||
|
||||
```
|
||||
-h DIR Home directory
|
||||
-g GECOS GECOS field
|
||||
-s SHELL Login shell
|
||||
-G GRP Group
|
||||
-S Create a system user
|
||||
-D Don't assign a password
|
||||
-H Don't create home directory
|
||||
-u UID User id
|
||||
-k SKEL Skeleton directory (/etc/skel)
|
||||
```
|
||||
|
||||
Whether or not this difference is a feature or a limitation depends on whether you prefer to have 20 options or ten options in your commands. For some users and use-cases, BusyBox's minimalism provides just enough for what needs to be done. For others, it's a good minimal environment to have as a fallback or as a foundation for installing more robust tools like [Bash][12], [Zsh][13], GNU [Awk][14], and so on.
|
||||
|
||||
### Installing BusyBox
|
||||
|
||||
On Linux, you can install BusyBox using your package manager. For example, on Fedora and similar:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo dnf install busybox`
|
||||
```
|
||||
|
||||
On Debian and derivatives:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo apt install busybox`
|
||||
```
|
||||
|
||||
On macOS, use [MacPorts][15] or [Homebrew][16]. On Windows, use [Chocolatey][17].
|
||||
|
||||
You can set BusyBox as your shell using the `chsh --shell` command, followed by the path to the BusyBox `sh` application. I keep BusyBox in `/lib64`, but its location depends on where your distribution installed it.
|
||||
|
||||
|
||||
```
|
||||
$ which busybox
|
||||
/lib64/busybox/busybox
|
||||
$ chsh --shell /lib64/busybox/sh
|
||||
```
|
||||
|
||||
Replacing all common commands wholesale with BusyBox is a little more complex, because most distributions are "hard-wired" to look to specific packages for specific commands. In other words, while it's technically possible to replace `init` with BusyBox's `init`, your package manager may refuse to allow you to remove the package containing `init` for fear of you causing your system to become non-bootable. There are some distributions built upon BusyBox, so starting fresh is probably the easiest way to experience a system built around BusyBox.
|
||||
|
||||
### Try BusyBox
|
||||
|
||||
You don't have to change your shell to BusyBox permanently just to try it. You can launch a BusyBox shell from your current shell:
|
||||
|
||||
|
||||
```
|
||||
$ busybox sh
|
||||
~ $
|
||||
```
|
||||
|
||||
Your system still has the non-BusyBox versions of commands installed, though, so to experience BusyBox's tools, you must issue commands as arguments to the `busybox` executable:
|
||||
|
||||
|
||||
```
|
||||
~ $ busybox echo $0
|
||||
sh
|
||||
~ $ busybox ls --help
|
||||
BusyBox vX.YY.Z (2021-08-25 07:31:48 NZST) multi-call binary.
|
||||
|
||||
Usage: ls [-1AaCxdLHRFplinshrSXvctu] [-w WIDTH] [FILE]...
|
||||
|
||||
List directory contents
|
||||
|
||||
-1 One column output
|
||||
-a Include entries that start with .
|
||||
-A Like -a, but exclude . and ..
|
||||
-x List by lines
|
||||
[...]
|
||||
```
|
||||
|
||||
For the "full" BusyBox experience, you can create symlinks to `busybox` for each command. This is easier than it sounds, as long as you use a [for-loop][18]:
|
||||
|
||||
|
||||
```
|
||||
$ mkdir bbx
|
||||
$ for i in $(bbx --list); do \
|
||||
ln -s /path/to/busybox bbx/$i \
|
||||
done
|
||||
```
|
||||
|
||||
Add your directory of symlinks at the _start_ of your [path][19], and launch BusyBox:
|
||||
|
||||
|
||||
```
|
||||
`$ PATH=$(pwd)/bbx:$PATH bbx/sh`
|
||||
```
|
||||
|
||||
### Get busy
|
||||
|
||||
BusyBox is a fun project and an example of just how _minimal_ computing can be. Whether you use BusyBox as a lightweight environment for an [ancient computer][20] [you've rescued][21], as the userland for an [embedded device][22], to trial a new init system, or just as a curiosity, it can be fun reacquainting yourself with old familiar, yet somehow new, commands.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/8/what-busybox
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bash_command_line.png?itok=k4z94W2U (bash logo on green background)
|
||||
[2]: https://opensource.com/article/21/8/navigate-linux-directories
|
||||
[3]: https://opensource.com/article/18/5/how-kill-process-stop-program-linux
|
||||
[4]: https://opensource.com/article/19/7/master-ls-command
|
||||
[5]: https://opensource.com/article/19/8/moving-files-linux-depth
|
||||
[6]: https://opensource.com/article/19/2/getting-started-cat-command
|
||||
[7]: https://www.busybox.net
|
||||
[8]: https://opensource.com/article/20/4/systemd
|
||||
[9]: https://opensource.com/article/21/3/rtos-embedded-development
|
||||
[10]: https://opensource.com/article/17/9/what-edge-computing
|
||||
[11]: https://opensource.com/article/21/3/iot-measure-raspberry-pi
|
||||
[12]: https://opensource.com/article/20/4/bash-sysadmins-ebook
|
||||
[13]: https://opensource.com/article/19/9/getting-started-zsh
|
||||
[14]: https://opensource.com/article/20/9/awk-ebook
|
||||
[15]: https://opensource.com/article/20/11/macports
|
||||
[16]: https://opensource.com/article/20/6/homebrew-mac
|
||||
[17]: https://opensource.com/article/20/3/chocolatey
|
||||
[18]: https://opensource.com/article/19/10/programming-bash-loops
|
||||
[19]: https://opensource.com/article/17/6/set-path-linux
|
||||
[20]: https://opensource.com/article/20/2/restore-old-computer-linux
|
||||
[21]: https://opensource.com/article/19/7/how-make-old-computer-useful-again
|
||||
[22]: https://opensource.com/article/20/6/open-source-rtos
|
@ -1,93 +0,0 @@
|
||||
[#]: subject: "Run Web Applications in Linux Using Tangram Browser"
|
||||
[#]: via: "https://itsfoss.com/tangram/"
|
||||
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Run Web Applications in Linux Using Tangram Browser
|
||||
======
|
||||
|
||||
_**Brief:** Tangram is a browser that aims to help you run and manage web applications in Linux_. _Let’s take a look at how it works._
|
||||
|
||||
Even if we have native Linux applications available for several tools, many end up using web applications.
|
||||
|
||||
Maybe in the form of an electron app or directly through a web browser, native experiences are becoming an old-school thing.
|
||||
|
||||
Of course, running web applications, no matter the platform, needs more system resources. And, considering every service is going for a web-based approach instead of a native experience, we need solutions to manage the web apps efficiently.
|
||||
|
||||
An open-source Linux app, Tangram, could be the solution.
|
||||
|
||||
### Tangram: A Browser Tailored to Run Web Applications
|
||||
|
||||
![][1]
|
||||
|
||||
You can choose to use some of the [best Linux web browsers][2] to run web applications. But, if you want something that entirely focuses on web application experience, Tangram is an exciting option.
|
||||
|
||||
The developer took inspiration from GNOME Web, [Franz][3], and [Rambox][4].
|
||||
|
||||
You do not get any fancy features but just the ability to change the user agent and manage the web applications you have logged in to.
|
||||
|
||||
It can be used to access multiple social media platforms, chat messengers, work collaboration applications, and more.
|
||||
|
||||
### Features of Tangram
|
||||
|
||||
![][5]
|
||||
|
||||
Considering it is a minimal browser based on WebKitGTK, not much you can do here. To list some of the essentials, here’s what you can do:
|
||||
|
||||
* Re-order tabs in the sidebar
|
||||
* Easily add any web service as a web app
|
||||
* Ability to tweak the user agent (Desktop/mobile)
|
||||
* Keyboard shortcuts
|
||||
* Change position of the sidebar (tab bar)
|
||||
|
||||
|
||||
|
||||
All you need to do is load up a web service, log in, and click on “**Done**” to add it as a web application.
|
||||
|
||||
![][6]
|
||||
|
||||
### Installing Tangram in Linux
|
||||
|
||||
Tangram is available as a Flatpak for every Linux distribution, and you can also find it in [AUR][7].
|
||||
|
||||
If you want to install it via the terminal, type in the following command:
|
||||
|
||||
```
|
||||
flatpak install flathub re.sonny.Tangram
|
||||
```
|
||||
|
||||
You may refer to our [Flatpak guide][8] if you do not have it enabled on your system.
|
||||
|
||||
To explore more about it, you can check out its [GitHub page][9].
|
||||
|
||||
[Tangram Browser][10]
|
||||
|
||||
Have you tried this yet? Do you prefer web applications or native applications? Feel free to share your thoughts in the comments below.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/tangram/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/tangram-web-app-browser.png?resize=800%2C611&ssl=1
|
||||
[2]: https://itsfoss.com/best-browsers-ubuntu-linux/
|
||||
[3]: https://itsfoss.com/franz-messaging-app/
|
||||
[4]: https://itsfoss.com/rambox/
|
||||
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/tangram-settings.png?resize=530%2C290&ssl=1
|
||||
[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/tangram-web-app-whatsapp.png?resize=800%2C431&ssl=1
|
||||
[7]: https://itsfoss.com/aur-arch-linux/
|
||||
[8]: https://itsfoss.com/flatpak-guide/
|
||||
[9]: https://github.com/sonnyp/Tangram
|
||||
[10]: https://flathub.org/apps/details/re.sonny.Tangram
|
157
sources/tech/20210907 Use lspci on Linux to see your hardware.md
Normal file
157
sources/tech/20210907 Use lspci on Linux to see your hardware.md
Normal file
@ -0,0 +1,157 @@
|
||||
[#]: subject: "Use lspci on Linux to see your hardware"
|
||||
[#]: via: "https://opensource.com/article/21/9/lspci-linux-hardware"
|
||||
[#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "unigeorge"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Use lspci on Linux to see your hardware
|
||||
======
|
||||
Use the lspci command to display devices and drivers on your Linux
|
||||
system.
|
||||
![computer screen ][1]
|
||||
|
||||
When you're running Linux on a desktop or server, sometimes you need to identify the hardware in that system. One command used for this is `lspci`. It works by showing all devices attached to the PCI bus. It's provided by the [pciutils][2] package and is available for a wide range of Linux and BSD-based operating systems.
|
||||
|
||||
### Basic usage
|
||||
|
||||
The information displayed when a regular user runs `lspci` might be limited due to access permissions. Running the command with `sudo` provides a complete picture.
|
||||
|
||||
Running `lspci` by itself lists the PCI buses and their attached devices. Here's an example from my media center PC. It's an AMD Phenom CPU-based system, so it has an AMD chipset. It also has an Atheros wireless controller and an Nvidia graphics card. All hardware devices are listed with details such as vendor, name, and model number:
|
||||
|
||||
|
||||
```
|
||||
$ sudo lspci
|
||||
00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] RS880 Host Bridge
|
||||
00:02.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] RS780 PCI to PCI bridge (ext gfx port 0)
|
||||
00:04.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] RS780/RS880 PCI to PCI bridge (PCIE port 0)
|
||||
00:05.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] RS780/RS880 PCI to PCI bridge (PCIE port 1)
|
||||
00:11.0 SATA controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode]
|
||||
00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
|
||||
00:12.1 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0 USB OHCI1 Controller
|
||||
00:12.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
|
||||
00:13.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
|
||||
00:13.1 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0 USB OHCI1 Controller
|
||||
00:13.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
|
||||
00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 SMBus Controller (rev 3c)
|
||||
00:14.1 IDE interface: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 IDE Controller
|
||||
00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 LPC host controller
|
||||
00:14.4 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 PCI to PCI Bridge
|
||||
00:14.5 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI2 Controller
|
||||
00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor HyperTransport Configuration
|
||||
00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor Address Map
|
||||
00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor DRAM Controller
|
||||
00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor Miscellaneous Control
|
||||
00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor Link Control
|
||||
01:00.0 VGA compatible controller: NVIDIA Corporation GK107 [GeForce GTX 650] (rev a1)
|
||||
01:00.1 Audio device: NVIDIA Corporation GK107 HDMI Audio Controller (rev a1)
|
||||
02:00.0 Network controller: Qualcomm Atheros AR9287 Wireless Network Adapter (PCI-Express) (rev 01)
|
||||
```
|
||||
|
||||
### Verbose output
|
||||
|
||||
Adding a `-v` option increases the verbosity or the level of detail for each device. You can use `-vv` or `-vvv` for even higher amounts of device detail. At this level, `lspci` displays various subsystems and memory addresses, interrupt request (IRQ) numbers, and other capabilities for all devices. The output is extremely long. Give it a try on your system.
|
||||
|
||||
### Searching with grep
|
||||
|
||||
Sometimes you want to narrow your search. For instance, the RPM Fusion web site has instructions for installing Nvidia graphics drivers. They begin with identifying your graphics card using the `grep` command. This is what I get on my laptop:
|
||||
|
||||
|
||||
```
|
||||
$ sudo lspci | grep -e VGA
|
||||
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 620 (rev 07)
|
||||
$ sudo lspci | grep -e 3D
|
||||
01:00.0 3D controller: NVIDIA Corporation GM108M [GeForce MX130] (rev a2)
|
||||
```
|
||||
|
||||
The `grep` commands above show one VGA device on my media center PC but no 3D device.
|
||||
|
||||
|
||||
```
|
||||
$ sudo lspci | grep -e VGA
|
||||
01:00.0 VGA compatible controller: NVIDIA Corporation GK107 [GeForce GTX 650] (rev a1)
|
||||
$ sudo lspci | grep -e 3D
|
||||
$
|
||||
```
|
||||
|
||||
### Searching by vendor ID
|
||||
|
||||
There is another way that doesn't require `grep`. Suppose I want to determine whether any other Nvidia devices are present. It's necessary to know a little more. I use the `-nn` option to display vendor and device ID numbers. On my media center PC, this option shows my VGA card, vendor ID, and device ID:
|
||||
|
||||
|
||||
```
|
||||
$ sudo lspci -nn | grep -e VGA
|
||||
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK107 [GeForce GTX 650] [10de:0fc6] (rev a1)
|
||||
```
|
||||
|
||||
The set of brackets with the colon-separated numbers after the device name shows the vendor and device ID. The output indicates that the vendor ID for a device made by Nvidia Corporation is **10de**.
|
||||
|
||||
The `-d` option displays all devices from a specified vendor, device, or class ID. Here are all the Nvidia devices in my system (keeping the `-nn` to include the vendor IDs):
|
||||
|
||||
|
||||
```
|
||||
$ sudo lspci -nn -d 10de:
|
||||
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK107 [GeForce GTX 650] [10de:0fc6] (rev a1)
|
||||
01:00.1 Audio device [0403]: NVIDIA Corporation GK107 HDMI Audio Controller [10de:0e1b] (rev a1)
|
||||
```
|
||||
|
||||
From the output, you can see that in addition to a graphics card, I have an Nvidia audio device. They are both actually part of the same **Nvidia GeForce GTX 650** card, but this is a good example nonetheless.
|
||||
|
||||
### Kernel modules
|
||||
|
||||
Along with PCI hardware devices, `lspci` can show what kernel driver modules are loaded with the `-k` option. I add this option to my `lspci` commands to view several pieces of information about my Nvidia devices.
|
||||
|
||||
|
||||
```
|
||||
$ sudo lspci -nn -k -d 10de:
|
||||
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK107 [GeForce GTX 650] [10de:0fc6] (rev a1)
|
||||
Subsystem: eVga.com. Corp. GK107 [GeForce GTX 650] [3842:2650]
|
||||
Kernel driver in use: nvidia
|
||||
Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia
|
||||
01:00.1 Audio device [0403]: NVIDIA Corporation GK107 HDMI Audio Controller [10de:0e1b] (rev a1)
|
||||
Subsystem: eVga.com. Corp. GK107 HDMI Audio Controller [3842:2650]
|
||||
Kernel driver in use: snd_hda_intel
|
||||
Kernel modules: snd_hda_intel
|
||||
```
|
||||
|
||||
Two additional lines are displayed: _Kernel driver in use_ and _Kernel modules_. The second one lists the modules available to support the device.
|
||||
|
||||
### Keeping up to date
|
||||
|
||||
New devices and vendors are constantly entering the market. If you see a device listed as _unknown_, your PCI device ID database may be outdated. There are two ways to check. The `-Q` option uses DNS to query the central database. This, of course, requires network connectivity.
|
||||
|
||||
|
||||
```
|
||||
`$ sudo lspci -Q`
|
||||
```
|
||||
|
||||
You can also update your local PCI ID database by running the command `update-pciids`.
|
||||
|
||||
|
||||
```
|
||||
$ sudo update-pciids
|
||||
Downloaded daily snapshot dated 2021-08-22 03:15:01
|
||||
```
|
||||
|
||||
### Learn more about your hardware
|
||||
|
||||
Of course, `lspci` is just one of many commands available for Linux that is useful for querying the hardware and software on your system. Learn more about hardware on Linux in my article covering USB devices: [Recognize more devices on Linux with this USB ID Repository][3].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/9/lspci-linux-hardware
|
||||
|
||||
作者:[Alan Formy-Duval][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[unigeorge](https://github.com/unigeorge)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/alanfdoss
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/features_solutions_command_data.png?itok=4_VQN3RK (computer screen )
|
||||
[2]: https://mj.ucw.cz/sw/pciutils/
|
||||
[3]: https://opensource.com/article/20/8/usb-id-repository
|
@ -0,0 +1,88 @@
|
||||
[#]: subject: "Apps for daily needs part 5: video editors"
|
||||
[#]: via: "https://fedoramagazine.org/apps-for-daily-needs-part-5-video-editors/"
|
||||
[#]: author: "Arman Arisman https://fedoramagazine.org/author/armanwu/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Apps for daily needs part 5: video editors
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
Photo by [Brooke Cagle][2] on [Unsplash][3]
|
||||
|
||||
Video editing has become a popular activity. People need video editors for various reasons, such as work, education, or just a hobby. There are also now many platforms for sharing video on the internet. Almost all social media and chat messengers provide features for sharing videos. This article will introduce some of the open source video editors that you can use on Fedora Linux. You may need to install the software mentioned. If you are unfamiliar with how to add software packages in Fedora Linux, see my earlier article [Things to do after installing Fedora 34 Workstation][4]. Here is a list of a few apps for daily needs in the video editors category.
|
||||
|
||||
### Kdenlive
|
||||
|
||||
When anyone asks about an open source video editor on Linux, the answer that often comes up is Kdenlive. It is a very popular video editor among open source users. This is because its features are complete for general purposes and are easy to use by someone who is not a professional.
|
||||
|
||||
Kdenlive supports multi-track, so you can combine audio, video, images, and text from multiple sources. This application also supports various video and audio formats without having to convert them first. In addition, Kdenlive provides a wide variety of effects and transitions to support your creativity in producing cool videos. Some of the features that Kdenlive provides are titler for creating 2D titles, audio and video scopes, proxy editing, timeline preview, keyframeable effects, and many more.
|
||||
|
||||
![][5]
|
||||
|
||||
More information is available at this link: <https://kdenlive.org/en/>
|
||||
|
||||
* * *
|
||||
|
||||
### Shotcut
|
||||
|
||||
Shotcut has more or less the same features as Kdenlive. This application is a general purposes video editor. It has a fairly simple interface, but with complete features to meet the various needs of your video editing work.
|
||||
|
||||
Shotcut has a complete set of features for a video editor, ranging from simple editing to high-level capabilities. It also supports various video, audio, and image formats. You don’t need to worry about your work history, because this application has unlimited undo and redo. Shotcut also provides a variety of video and audio effects features, so you have freedom to be creative in producing your video works. Some of the features offered are audio filters, audio mixing, cross fade audio and video dissolve transition, tone generator, speed change, video compositing, 3 way color wheels, track compositing/blending mode, video filters, etc.
|
||||
|
||||
![][6]
|
||||
|
||||
More information is available at this link: <https://shotcut.org/>
|
||||
|
||||
* * *
|
||||
|
||||
### Pitivi
|
||||
|
||||
Pitivi will be the right choice if you want a video editor that has an intuitive and clean user interface. You will feel comfortable with how it looks and will have no trouble finding the features you need. This application is classified as very easy to learn, especially if you need an application for simple editing needs. However, Pitivi still offers a variety of features, like trimming & cutting, sound mixing, keyframeable audio effects, audio waveforms, volume keyframe curves, video transitions, etc.
|
||||
|
||||
![][7]
|
||||
|
||||
More information is available at this link: <https://www.pitivi.org/>
|
||||
|
||||
* * *
|
||||
|
||||
### Cinelerra
|
||||
|
||||
Cinelerra is a video editor that has been in development for a long time. There are tons of features for your video work such as built-in frame render, various video effects, unlimited layers, 8K support, multi camera support, video audio sync, render farm, motion graphics, live preview, etc. This application is maybe not suitable for those who are just learning. I think it will take you a while to get used to the interface, especially if you are already familiar with other popular video editor applications. But Cinelerra will still be an interesting choice as your video editor.
|
||||
|
||||
![][8]
|
||||
|
||||
More information is available at this link: <http://cinelerra.org/>[][9]
|
||||
|
||||
* * *
|
||||
|
||||
### Conclusion
|
||||
|
||||
This article presented four video editor apps for your daily needs that are available on Fedora Linux. Actually there are many other video editors that you can use in Fedora Linux. You can also use Olive (Fedora Linux repo), OpenShot (rpmfusion-free) , Flowblade (rpmfusion-free) and many more. Each video editor has its own advantages. Some are better at correcting color, while others are better at a variety of transitions and effects. Some are better when it comes to how easy it is to add text. Choose the application that suits your needs. Hopefully this article can help you to choose the right video editors. If you have experience in using these applications, please share your experience in the comments.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/apps-for-daily-needs-part-5-video-editors/
|
||||
|
||||
作者:[Arman Arisman][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://fedoramagazine.org/author/armanwu/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2021/08/FedoraMagz-Apps-5-video-816x345.jpg
|
||||
[2]: https://unsplash.com/@brookecagle?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
|
||||
[3]: https://unsplash.com/s/photos/meeting-on-cafe-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
|
||||
[4]: https://fedoramagazine.org/things-to-do-after-installing-fedora-34-workstation/
|
||||
[5]: https://fedoramagazine.org/wp-content/uploads/2021/08/video-kdenlive-1024x576.png
|
||||
[6]: https://fedoramagazine.org/wp-content/uploads/2021/08/video-shotcut-1024x576.png
|
||||
[7]: https://fedoramagazine.org/wp-content/uploads/2021/08/video-pitivi-1024x576.png
|
||||
[8]: https://fedoramagazine.org/wp-content/uploads/2021/08/video-cinelerra-1024x576.png
|
||||
[9]: https://www.olivevideoeditor.org/
|
@ -0,0 +1,95 @@
|
||||
[#]: subject: "Debug a web page error from the command line"
|
||||
[#]: via: "https://opensource.com/article/21/9/wget-debug-web-server"
|
||||
[#]: author: "Jim Hall https://opensource.com/users/jim-hall"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Debug a web page error from the command line
|
||||
======
|
||||
One way to debug a web server is by using the wget command-line program.
|
||||
![Digital creative of a browser on the internet][1]
|
||||
|
||||
Sometimes when managing a website, things can get messed up. You might remove some stale content and replace it with a redirect to other pages. Later, after making other changes, you find some web pages become entirely inaccessible. You might see an error in your browser that "The page isn't redirecting properly" with a suggestion to check your cookies.
|
||||
|
||||
![Redirect loop example in Firefox][2]
|
||||
|
||||
Screenshot by Jim Hall, [CC-BY SA 4.0][3]
|
||||
|
||||
One way to debug this situation is by using the `wget` command-line program, with the `-S` option to show all server responses. When using `wget` for debugging, I also prefer to save the output to some temporary file, using the `-O` option, in case I need to view its contents later.
|
||||
|
||||
|
||||
```
|
||||
$ wget -O /tmp/test.html -S <http://10.0.0.11/announce/>
|
||||
\--2021-08-24 17:09:49-- <http://10.0.0.11/announce/>
|
||||
Connecting to 10.0.0.11:80... connected.
|
||||
HTTP request sent, awaiting response...
|
||||
|
||||
HTTP/1.1 302 Found
|
||||
|
||||
Date: Tue, 24 Aug 2021 22:09:49 GMT
|
||||
|
||||
Server: Apache/2.4.48 (Fedora)
|
||||
|
||||
X-Powered-By: PHP/7.4.21
|
||||
|
||||
Location: <http://10.0.0.11/assets/>
|
||||
|
||||
Content-Length: 0
|
||||
|
||||
Keep-Alive: timeout=5, max=100
|
||||
|
||||
Connection: Keep-Alive
|
||||
|
||||
Content-Type: text/html; charset=UTF-8
|
||||
Location: <http://10.0.0.11/assets/> [following]
|
||||
\--2021-08-24 17:09:49-- <http://10.0.0.11/assets/>
|
||||
Reusing existing connection to 10.0.0.11:80.
|
||||
HTTP request sent, awaiting response...
|
||||
|
||||
HTTP/1.1 302 Found
|
||||
|
||||
Date: Tue, 24 Aug 2021 22:09:49 GMT
|
||||
|
||||
Server: Apache/2.4.48 (Fedora)
|
||||
|
||||
X-Powered-By: PHP/7.4.21
|
||||
|
||||
Location: <http://10.0.0.11/announce/>
|
||||
|
||||
Content-Length: 0
|
||||
|
||||
Keep-Alive: timeout=5, max=99
|
||||
|
||||
Connection: Keep-Alive
|
||||
|
||||
Content-Type: text/html; charset=UTF-8
|
||||
Location: <http://10.0.0.11/announce/> [following]
|
||||
\--2021-08-24 17:09:49-- <http://10.0.0.11/announce/>
|
||||
Reusing existing connection to 10.0.0.11:80.
|
||||
.
|
||||
.
|
||||
.
|
||||
20 redirections exceeded.
|
||||
```
|
||||
|
||||
I've omitted a lot of repetition in this output. By reading the server responses, you can see that `http ://10.0.0.11/announce/` redirects immediately to `http ://10.0.0.11/assets/`, which then redirects back to `http ://10.0.0.11/announce/`. And so on. This is an endless loop and `wget` will exit after 20 redirections. But armed with this debugging information, you can fix the redirects and avoid the loop.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/9/wget-debug-web-server
|
||||
|
||||
作者:[Jim Hall][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/jim-hall
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet)
|
||||
[2]: https://opensource.com/sites/default/files/uploads/firefox-redirect-loop.png (Redirect loop example in Firefox)
|
||||
[3]: https://creativecommons.org/licenses/by-sa/4.0/
|
@ -0,0 +1,288 @@
|
||||
[#]: subject: "How I migrated a WordPress website to a new host"
|
||||
[#]: via: "https://opensource.com/article/21/9/migrate-wordpress"
|
||||
[#]: author: "David Both https://opensource.com/users/dboth"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How I migrated a WordPress website to a new host
|
||||
======
|
||||
Use this simple approach to migrate a website and manage firewall
|
||||
configurations.
|
||||
![Text editor on a browser, in blue][1]
|
||||
|
||||
Have you ever needed to migrate a WordPress website to a new host? I have done it several times and found the process to be quite easy. Of course, I don't use the recommended methods for doing most things, and this is no exception–I use the easy way, and that is what I recommend.
|
||||
|
||||
This migration is non-destructive, so it is simple to revert to the original server if that should be necessary for any reason.
|
||||
|
||||
### Components of a WordPress website
|
||||
|
||||
Three main components are required to run a website based on [WordPress][2]: WordPress itself, a webserver such as [Apache][3] (which I use), and the [MariaDB][4]. MariaDB is a fork of MySQL and is functionally equivalent.
|
||||
|
||||
There are plenty of webservers out there, but I prefer Apache because I have used it for so long. You may need to adapt the Apache configuration I use here to whatever webserver you are using.
|
||||
|
||||
### The original setup
|
||||
|
||||
I use one Linux host as a firewall and router for my network. The webserver is a different host inside my network. My internal network uses what used to be called a class C private network address range, but which is simply referred to as 192.168.0.0/24 in the [Classless Internet Domain Routing (CIDR)][5] methodology.
|
||||
|
||||
For the firewall, I use the very simple [IPTables][6], which I prefer over the much more complex `firewalld`. One line in this firewall configuration sends incoming packets on port 80 (HTTP) to the webserver. As you can see by the comments, I placed rules to forward other inbound server connections to the same server on their appropriate ports in the `/etc/sysconfig/iptables` file.
|
||||
|
||||
|
||||
```
|
||||
# Reroute ports for inbound connections to the appropriate web/email/etc server.
|
||||
# HTTPD goes to 192.168.0.75
|
||||
-A PREROUTING -d 45.20.209.41/255.255.255.248 -p tcp -m tcp --dport 80 \
|
||||
|
||||
-j DNAT --to-destination 192.168.0.75:80
|
||||
```
|
||||
|
||||
I set up my original Apache webserver using named virtual hosts because I served multiple websites from this one HTTPD instance. It is always a good idea to use the named virtual host configuration approach because, like me, you may decide to host additional sites later, and this process makes that easier to do.
|
||||
|
||||
The virtual host stanza for the website to be moved in `/etc/httpd/conf/httpd.conf` looks like the one below. There are no IP addresses in this stanza, so it needs no changes for use on the new server.
|
||||
|
||||
|
||||
```
|
||||
<VirtualHost *:80>
|
||||
ServerName [www.website1.org][7]
|
||||
ServerAlias server.org
|
||||
|
||||
DocumentRoot "/var/website1/html"
|
||||
ErrorLog "logs/error_log"
|
||||
ServerAdmin [me@website1.org][8]
|
||||
|
||||
<Directory "/var/website1/html">
|
||||
Options Indexes FollowSymLinks
|
||||
|
||||
AllowOverride None
|
||||
Require all granted
|
||||
|
||||
</Directory>
|
||||
</VirtualHost>
|
||||
```
|
||||
|
||||
The `Listen` directive near the top of the `httpd.conf` file looks like this before the migration. This is the actual IP private address of the server and not the public IP address.
|
||||
|
||||
|
||||
```
|
||||
`Listen 192.168.0.75:80`
|
||||
```
|
||||
|
||||
You need to change the `Listen` IP address on the new host.
|
||||
|
||||
### Preparation
|
||||
|
||||
The preparation can be accomplished with three steps:
|
||||
|
||||
* Install the services.
|
||||
* Configure the firewall.
|
||||
* Configure the webserver.
|
||||
|
||||
|
||||
|
||||
#### Install Apache and MariaDB
|
||||
|
||||
Install Apache and MariaDB if they are not already on your new server. It is not necessary to install WordPress.
|
||||
|
||||
|
||||
```
|
||||
`dnf -y install httpd mariadb`
|
||||
```
|
||||
|
||||
#### New server firewall configuration
|
||||
|
||||
Ensure that the firewall on the new server allows port 80. You do have a firewall on _all_ of your computers, right? Most modern distributions use an initial setup that includes a firewall that blocks all incoming traffic to ensure a higher level of security.
|
||||
|
||||
The first line in the snippet below may already be part of your IPTables or other netfilter-based firewall. It identifies inbound packets that have already been recognized as coming from an acceptable source and bypasses additional INPUT filter rules, thus saving time and CPU cycles. The last line in the snippet identifies new incoming connections to HTTPD on port 80 and accepts them.
|
||||
|
||||
|
||||
```
|
||||
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||
<snip>
|
||||
# HTTP
|
||||
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
|
||||
```
|
||||
|
||||
The following sample `/etc/sysconfig/iptables` file is an example of a minimal set of IPTables rules that allow incoming connections on SSH (port 22) and HTTPD (port 80) .
|
||||
|
||||
|
||||
```
|
||||
*filter
|
||||
:INPUT ACCEPT [0:0]
|
||||
:FORWARD ACCEPT [0:0]
|
||||
:OUTPUT ACCEPT [0:0]
|
||||
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||
-A INPUT -p icmp -j ACCEPT
|
||||
-A INPUT -i lo -j ACCEPT
|
||||
# SSHD
|
||||
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
|
||||
# HTTP
|
||||
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
|
||||
|
||||
# Final disposition for unmatched packets
|
||||
-A INPUT -j REJECT --reject-with icmp-host-prohibited
|
||||
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
|
||||
COMMIT
|
||||
```
|
||||
|
||||
All I needed on my new server host was to add the last line in the snippet above to my firewall rules in the `/etc/sysconfig/iptables` file and then reload the revised ruleset.
|
||||
|
||||
|
||||
```
|
||||
`iptables-restore /etc/sysconfig/iptables`
|
||||
```
|
||||
|
||||
Most current Red Hat-based distributions, such as Fedora, use `firewalld`. I don't use it because I find it far more complex than it needs to be for use cases such as home or small to medium businesses. To add inbound port 80 to `firewalld`, I suggest you refer to the [firewalld web page][9].
|
||||
|
||||
Your firewall and its configuration details might differ from these, but the objective is to allow incoming connections to HTTPD on port 80 of the new web server.
|
||||
|
||||
#### HTTPD configuration
|
||||
|
||||
Configure HTTPD in the `/etc/httpd/conf/httpd.conf` file. Set the IP address in the Listen stanza as shown below. The IP address of my new web server is 192.168.0.125.
|
||||
|
||||
|
||||
```
|
||||
`Listen 192.168.0.125:80`
|
||||
```
|
||||
|
||||
Copy the VirtualHost stanza for the website being moved and paste it at the end of the `httpd.conf` file of the new server.
|
||||
|
||||
### The move
|
||||
|
||||
Only two sets of data need to be moved to the new server—the database itself and the website directory structure. Create `tar` archives of the two directories.
|
||||
|
||||
|
||||
```
|
||||
cd /var ; tar -cvf /tmp/website.tar website1/
|
||||
cd /var/lib ; tar -cvf /tmp/database.tar mysql/
|
||||
```
|
||||
|
||||
Copy those tarballs to the new server. I usually store files like this in `/tmp`, which is what it is for. Run the following commands on the new server to extract the files from the tar archives into the correct directories.
|
||||
|
||||
|
||||
```
|
||||
cd /var ; tar -xvf /tmp/website.tar
|
||||
cd /var/lib ; tar -xvf /tmp/database.tar
|
||||
```
|
||||
|
||||
All WordPress files are contained in the `/var/website1`, so they do not need to be installed on the new server. The WordPress installation procedure does not need to be performed on the new server.
|
||||
|
||||
This directory is all that needs to be moved to the new server.
|
||||
|
||||
The last step before making the switch is to start (or restart) the `mysqld` and `httpd` service daemons. WordPress is not a service, so it is not started as a daemon.
|
||||
|
||||
|
||||
```
|
||||
`systemctl start mysqld ; systemctl start httpd`
|
||||
```
|
||||
|
||||
You should check the status of these services after starting them.
|
||||
|
||||
|
||||
```
|
||||
systemctl status mysqld
|
||||
● mariadb.service - MariaDB 10.5 database server
|
||||
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
|
||||
Active: active (running) since Sat 2021-08-21 14:03:44 EDT; 4 days ago
|
||||
Docs: man:mariadbd(8)
|
||||
|
||||
<https://mariadb.com/kb/en/library/systemd/>
|
||||
Process: 251783 ExecStartPre=/usr/libexec/mariadb-check-socket (code=exited, status=0/SUCCESS)
|
||||
Process: 251805 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir mariadb.service (code=exited, status=0/SUCCESS)
|
||||
Process: 251856 ExecStartPost=/usr/libexec/mariadb-check-upgrade (code=exited, status=0/SUCCESS)
|
||||
Main PID: 251841 (mariadbd)
|
||||
Status: "Taking your SQL requests now..."
|
||||
Tasks: 15 (limit: 19003)
|
||||
Memory: 131.8M
|
||||
CPU: 1min 31.793s
|
||||
CGroup: /system.slice/mariadb.service
|
||||
└─251841 /usr/libexec/mariadbd --basedir=/usr
|
||||
|
||||
Aug 21 14:03:43 simba.stmarks-ral.org systemd[1]: Starting MariaDB 10.5 database server...
|
||||
Aug 21 14:03:43 simba.stmarks-ral.org mariadb-prepare-db-dir[251805]: Database MariaDB is probably initialized in /var/lib/mysql already, n>
|
||||
Aug 21 14:03:43 simba.stmarks-ral.org mariadb-prepare-db-dir[251805]: If this is not the case, make sure the /var/lib/mysql is empty before>
|
||||
Aug 21 14:03:44 simba.stmarks-ral.org mariadbd[251841]: 2021-08-21 14:03:44 0 [Note] /usr/libexec/mariadbd (mysqld 10.5.11-MariaDB) startin>
|
||||
Aug 21 14:03:44 simba.stmarks-ral.org systemd[1]: Started MariaDB 10.5 database server.
|
||||
|
||||
systemctl status httpd
|
||||
● httpd.service - The Apache HTTP Server
|
||||
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
|
||||
Drop-In: /usr/lib/systemd/system/httpd.service.d
|
||||
└─php-fpm.conf
|
||||
Active: active (running) since Sat 2021-08-21 14:08:39 EDT; 4 days ago
|
||||
Docs: man:httpd.service(8)
|
||||
Main PID: 252458 (httpd)
|
||||
Status: "Total requests: 10340; Idle/Busy workers 100/0;Requests/sec: 0.0294; Bytes served/sec: 616 B/sec"
|
||||
Tasks: 278 (limit: 19003)
|
||||
Memory: 44.7M
|
||||
CPU: 2min 31.603s
|
||||
CGroup: /system.slice/httpd.service
|
||||
├─252458 /usr/sbin/httpd -DFOREGROUND
|
||||
├─252459 /usr/sbin/httpd -DFOREGROUND
|
||||
├─252460 /usr/sbin/httpd -DFOREGROUND
|
||||
├─252461 /usr/sbin/httpd -DFOREGROUND
|
||||
├─252462 /usr/sbin/httpd -DFOREGROUND
|
||||
└─252676 /usr/sbin/httpd -DFOREGROUND
|
||||
|
||||
Aug 21 14:08:39 simba.stmarks-ral.org systemd[1]: Starting The Apache HTTP Server...
|
||||
Aug 21 14:08:39 simba.stmarks-ral.org httpd[252458]: AH00112: Warning: DocumentRoot [/var/teststmarks-ral/html] does not exist
|
||||
Aug 21 14:08:39 simba.stmarks-ral.org httpd[252458]: Server configured, listening on: port 80
|
||||
Aug 21 14:08:39 simba.stmarks-ral.org systemd[1]: Started The Apache HTTP Server.
|
||||
```
|
||||
|
||||
### Making the final switch
|
||||
|
||||
Now that the required services are up and running, you can change the firewall rule for HTTPD to the following in the `/etc/sysconfig/iptables` file.
|
||||
|
||||
|
||||
```
|
||||
-A PREROUTING -d 45.20.209.41/255.255.255.248 -p tcp -m tcp --dport 80 \
|
||||
-j DNAT --to-destination 192.168.0.125:80
|
||||
```
|
||||
|
||||
Then reload the IPTables rule set.
|
||||
|
||||
|
||||
```
|
||||
`iptables-restore /etc/sysconfig/iptables`
|
||||
```
|
||||
|
||||
Because of the firewall rules in the firewall host, it is not necessary to change the external DNS entries to point to the new server. If you use an internal DNS server, you will need to make the IP address change to that A record in your internal DNS database. If you don't use an internal DNS server, be sure to set the correct address for your new server in the `/etc/hosts` files of your host computers.
|
||||
|
||||
### Testing and cleanup
|
||||
|
||||
Be sure to test your new setup. First, turn off the `mysqld` and `httpd` services on the old server. Then access the website with a browser. If everything works as it should, you can disable `mysqld` and `httpd` on the old server. If there is a failure, you can change the IPTables routing rule back to the old server until the problem is fixed.
|
||||
|
||||
I then removed both MySQL and HTTPD from the old server to ensure that they cannot be started accidentally.
|
||||
|
||||
### Conclusion
|
||||
|
||||
It really is that simple. There is no need to perform export or import procedures on the database because everything necessary is copied over in the `mysql` directory. The only reason you might want to deal with the export/import procedure is if there are databases other than those for the website or sites in the same instance of the MariaDB that you don't want copied to the new server.
|
||||
|
||||
Migrating the rest of the websites served by the old server is easy too. All of the databases required for the additional sites have already been moved over with MariaDB. It is only necessary to move the `/var/website` directories to the new server, add the appropriate virtual host stanzas, and restart HTTPD.
|
||||
|
||||
I have used this procedure multiple times for migrating a website from one server to another, and it always works well.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/9/migrate-wordpress
|
||||
|
||||
作者:[David Both][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/dboth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_blue_text_editor_web.png?itok=lcf-m6N7 (Text editor on a browser, in blue)
|
||||
[2]: https://wordpress.org/
|
||||
[3]: https://opensource.com/article/18/2/how-configure-apache-web-server
|
||||
[4]: https://mariadb.org/
|
||||
[5]: https://opensource.com/article/16/12/cidr-network-notation-configuration-linux
|
||||
[6]: https://en.wikipedia.org/wiki/Iptables
|
||||
[7]: http://www.website1.org
|
||||
[8]: mailto:me@website1.org
|
||||
[9]: https://firewalld.org/documentation/howto/open-a-port-or-service.html
|
116
sources/tech/20210908 How to Run Java Programs in Ubuntu.md
Normal file
116
sources/tech/20210908 How to Run Java Programs in Ubuntu.md
Normal file
@ -0,0 +1,116 @@
|
||||
[#]: subject: "How to Run Java Programs in Ubuntu"
|
||||
[#]: via: "https://itsfoss.com/run-java-program-ubuntu/"
|
||||
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How to Run Java Programs in Ubuntu
|
||||
======
|
||||
|
||||
So, you have started learning Java programming? That’s good.
|
||||
|
||||
And you want to run the java programs on your Linux system? Even better.
|
||||
|
||||
Let me show how to run Java in terminal in Ubuntu and other Linux distributions.
|
||||
|
||||
### Running Java programs in Ubuntu
|
||||
|
||||
Let’s go in proper steps here.
|
||||
|
||||
#### Step 1: Install Java compiler
|
||||
|
||||
To run a Java program, you need to compile the program first. You need Java compiler for this purpose.
|
||||
|
||||
The Java compiler is part of [JDK][1] (Java Development Kit). You need to install JDK in order to compile and run Java programs.
|
||||
|
||||
First, check if you already have Java Compiler installed on your system:
|
||||
|
||||
```
|
||||
javac --version
|
||||
```
|
||||
|
||||
If you see an error like “Command ‘javac’ not found, but can be installed with”, this means you need to install Java Development Kit.
|
||||
|
||||
![Check if Java compiler is already installed or not][2]
|
||||
|
||||
The simplest way to install JDK on Ubuntu is to go with the default offering from Ubuntu:
|
||||
|
||||
```
|
||||
sudo apt install default-jdk
|
||||
```
|
||||
|
||||
You’ll be asked to enter your account’s password. When you type the password, nothing is seen on the screen. That is normal. Just enter your password blindly. When asked, press the enter key or Y key.
|
||||
|
||||
![Installing JDK that also contains the Java compiler][3]
|
||||
|
||||
The above command should work for other Debian and Ubuntu based distributions like Linux Mint, elementary OS etc. For other distributions, use your distribution’s package manager. The package name could also be different.
|
||||
|
||||
Once installed, verify that javac is available now.
|
||||
|
||||
![Verify that Java compiler can be used now][4]
|
||||
|
||||
#### Step 2: Compile Java program in Linux
|
||||
|
||||
You need to have a Java program file for this reason. Let’s say you create a new Java program file named **HelloWorld.java** and it has the following content:
|
||||
|
||||
```
|
||||
class HelloWorld{
|
||||
public static void main(String args[]){
|
||||
System.out.println("Hello World");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You can [use Nano editor in terminal][5] or Gedit graphical text editor for writing your Java programs.
|
||||
|
||||
```
|
||||
javac HelloWorld.java
|
||||
```
|
||||
|
||||
If there is no error, the above command produces no output.
|
||||
|
||||
When you compile the Java program, it generates a .class file with the class name you used in your program. You have to run this class file.
|
||||
|
||||
#### Step 3: Run the Java class file
|
||||
|
||||
You do not need to specify the class extension here. Just the name of the class. And this time, you use the command java, not javac.
|
||||
|
||||
```
|
||||
java HelloWorld
|
||||
```
|
||||
|
||||
This will print Hello World on the screen for my program.
|
||||
|
||||
![Running java programs in the Linux terminal][6]
|
||||
|
||||
And that’s how you run a Java program in the Linux terminal.
|
||||
|
||||
This was the simplest of the example. The sample program had just one class. The Java compiler creates a class file for each class in your program. Things get complicated for bigger programs and projects.
|
||||
|
||||
This is why I advise [installing Eclipse on Ubuntu][7] for proper Java programming. It is easier to program in an IDE.
|
||||
|
||||
I hope you find this tutorial helpful. Questions or suggestions? The comment section is all yours.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/run-java-program-ubuntu/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://jdk.java.net/
|
||||
[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/java-compiler-check-ubuntu.png?resize=800%2C328&ssl=1
|
||||
[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/install-jdk-ubuntu.png?resize=800%2C430&ssl=1
|
||||
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/java-compiler-ubuntu.png?resize=798%2C226&ssl=1
|
||||
[5]: https://itsfoss.com/nano-editor-guide/
|
||||
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/running-java-programs-in-Linux-terminal.png?resize=798%2C301&ssl=1
|
||||
[7]: https://itsfoss.com/install-latest-eclipse-ubuntu/
|
@ -0,0 +1,127 @@
|
||||
[#]: subject: "How to Use the dd Command to Create a Live USB Drive in Linux Terminal [For Experts and Adventurers]"
|
||||
[#]: via: "https://itsfoss.com/live-usb-with-dd-command/"
|
||||
[#]: author: "Hunter Wittenborn https://itsfoss.com/author/hunter/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "perfiffer"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How to Use the dd Command to Create a Live USB Drive in Linux Terminal [For Experts and Adventurers]
|
||||
======
|
||||
|
||||
There are several graphical tools available for creating live USB. [Etcher on Linux][1] is probably the most popular. Ubuntu has its own Startup Disk Creator tool for this purpose.
|
||||
|
||||
However, advanced Linux users swear by the comfort and swiftness of creating live USBs in Linux terminal using the dd command.
|
||||
|
||||
The dd command is a [CLI tool][2] that gives you powerful features for copying and converting files.
|
||||
|
||||
A common use case that people use dd for is to write ISO files to an external storage device such as a USB drive, which can be used to do things like install a new Linux distribution onto a computer or laptop.
|
||||
|
||||
That’s what I am going to show in this tutorial. I’ll go over the commands you will need to run, finding our USB drive from the terminal, and then finally doing the actual flashing of the ISO file.
|
||||
|
||||
### Creating live USB from ISO with dd command
|
||||
|
||||
Before I show you the steps, let me quickly go over the command which you’ll be using and explain what it does.
|
||||
|
||||
Here’s the example command for flashing of the ISO:
|
||||
|
||||
```
|
||||
dd if="./filename.iso" of="/dev/sdb" status="progress" conv="fsync"
|
||||
```
|
||||
|
||||
Let’s go over what exactly that [dd command][3] is doing.
|
||||
|
||||
#### Understanding the above dd command
|
||||
|
||||
![Explanation of the dd command for live USB creation][4]
|
||||
|
||||
First, you enter `dd`. As expected, this is just the name of the program you are going to run.
|
||||
|
||||
Next, you specify `if="./filename.iso"`. `if` stands for input file, which tells `dd` what file you are going to be writing to the external storage drive.
|
||||
|
||||
After that, you enter `of="/dev/sdb"`. As was with `if`, `of` simply stands for output file.
|
||||
|
||||
The thing to remember is that the output file doesn’t technically have to be a file on your system. You can also specify things like the path to an external device (as shown in the example), which just **looks** like a normal file on your system, but actually points to a device connected to your machine.
|
||||
|
||||
`status` can be set to three options: `none`, `noxfer` and `progress.`
|
||||
|
||||
The `progress` option that you set will cause dd to show periodic statistics on how much of the ISO has been transferred to the storage drive, as well as an estimation on how much longer it will be until dd is finished.
|
||||
|
||||
If you were to have set the `none` option instead, dd would only print error messages during the writing of the ISO, thus removing things like the progress bar.
|
||||
|
||||
The `noxfer` option hides some information that’s printed after a transfer is complete, such as how long it took from start to finish.
|
||||
|
||||
Lastly, you set the `conv` option to `fsync`. This causes dd to not report a successful write until the entire ISO has been written to the USB drive.
|
||||
|
||||
If you omit this option, dd will still write just fine (and might actually appear to run quicker), but you might find your system taking quite a while before it tells you it’s safe to remove the USB drive as it will finish writing the ISO’s content in the background, thus allowing you to do other things in the meantime.
|
||||
|
||||
_**Now that you understand what you have to do, let’s see how to do it.**_
|
||||
|
||||
Warning
|
||||
|
||||
The command line is a double-edged sword. Be extra careful when you are running a command like dd. You must make sure that you are using the correct device for the output file destination. One wrong step and you may format your main system disk and lose your operating system.
|
||||
|
||||
#### Step 0: Download the desired ISO
|
||||
|
||||
This goes without saying that you need to have an ISO image file in order to flash it on a USB.
|
||||
|
||||
I am going to use Ubuntu 20.04 ISO (downloadable [here][5]) to test the dd command I showed earlier.
|
||||
|
||||
#### Step 1: Get the USB disk label
|
||||
|
||||
Plug in your USB disk.
|
||||
|
||||
The specific path I entered for `of` was `/dev/sdb`. The USB disks are usually labelled /dev/sdb but that’s not a hard and fast rule.
|
||||
|
||||
This path may differ on your system, but you can confirm the path of the drive with the `lsblk` command. Just look for a listing that looks like the size of your USB drive, and that’ll be it.
|
||||
|
||||
![][6]
|
||||
|
||||
If you are more comfortable with GUI programs, you can also find the drive’s path with tools like GNOME Disks.
|
||||
|
||||
![][7]
|
||||
|
||||
Now that you have established the path to our external drive, let’s create the live USB.
|
||||
|
||||
#### Step 2: Writing the ISO file to the USB disk
|
||||
|
||||
Open up a terminal at the directory where the ISO file is downloaded, and run the following (remember to replace `/dev/sdb` with the name of your storage device if it’s something different):
|
||||
|
||||
```
|
||||
sudo dd if="./ubuntu-20.04.2.0-desktop-amd64.iso" of="/dev/sdb" status="progress" conv="fsync"
|
||||
```
|
||||
|
||||
After that, just let dd do it’s thing, and it’ll print a completion message once it’s done:
|
||||
|
||||
![][8]
|
||||
|
||||
And just like that, you’ve flashed an ISO with dd command in the Linux terminal!
|
||||
|
||||
### Wrapping Up
|
||||
|
||||
Now you’re on your way to doing even more things through the terminal, allowing you to do things faster and quicker than you might have been able to do before.
|
||||
|
||||
Got any remaining questions about the dd command, or something just not working right? Feel free to leave any of it in the comment section below.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/live-usb-with-dd-command/
|
||||
|
||||
作者:[Hunter Wittenborn][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/hunter/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/install-etcher-linux/
|
||||
[2]: https://itsfoss.com/gui-cli-tui/
|
||||
[3]: https://linuxhandbook.com/dd-command/
|
||||
[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/dd-command-for-live-usb-creation.png?resize=800%2C450&ssl=1
|
||||
[5]: https://ubuntu.com/download/desktop/thank-you?version=20.04.2.0&architecture=amd64
|
||||
[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/dd_disks.png?resize=753%2C264&ssl=1
|
||||
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/dd_gnome_disks.png?resize=800%2C440&ssl=1
|
||||
[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/dd-iso-write.png?resize=800%2C322&ssl=1
|
@ -0,0 +1,103 @@
|
||||
[#]: subject: "What is the Latest Ubuntu Version? Which one to use?"
|
||||
[#]: via: "https://itsfoss.com/latest-ubuntu-version/"
|
||||
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
What is the Latest Ubuntu Version? Which one to use?
|
||||
======
|
||||
|
||||
So, you decided to use Ubuntu. Set upon to install Ubuntu and find that there are several active Ubuntu releases.
|
||||
|
||||
That makes you bother about the latest Ubuntu release. Let me help you with that.
|
||||
|
||||
**The newest Ubuntu release is Ubuntu 21.04.** It is a short term release which was out in April 2021 and it will be supported till January 2022. After that, you’ll have to upgrade to Ubuntu 21.10 (will be releases in October 2021).
|
||||
|
||||
**The latest LTS release is Ubuntu 20.04 codenamed Focal Fossa**. It was released in April 2020 and it will be supported till April 2025. If you do not want to upgrade your version every nine months, stick with the latest LTS release.
|
||||
|
||||
In other current Ubuntu releases, version 18.04 is still active. It will be supported till April 2023. But if you are going for a [fresh Ubuntu install][1], go for the latest Ubuntu LTS release, which is 20.04.
|
||||
|
||||
For your information, every two years, there is a new LTS release and **three non-LTS releases** in between (every six months). You may [read this article to know about Ubuntu LTS and non-LTS releases][2].
|
||||
|
||||
The non-LTS releases often bring bleeding-edge features but with minor iterations. And, the next LTS release can be expected to bring all the features added to the non-LTS releases.
|
||||
|
||||
### Latest LTS Version of Ubuntu 20.04 “Focal Fossa”
|
||||
|
||||
![Ubuntu 20.04 LTS][3]
|
||||
|
||||
Every Ubuntu release is associated with a codename, which is often named after animals in alphabetical order.
|
||||
|
||||
In this case, it is “**Focal Fossa**” which refers to a catlike animal found on Madagascar.
|
||||
|
||||
Ubuntu 20.04 comes packed with [Linux Kernel 5.4][4] will be supported till **April 2025**. And, the latest LTS point release is **Ubuntu 20.04.3**.
|
||||
|
||||
If you are using the latest point release (via a new installation), you might have [Linux Kernel 5.11][5] if you are hardware did not fully support Linux 5.4
|
||||
|
||||
Did You Know?
|
||||
|
||||
Every LTS version release is followed by seven point releases, with extra extended security maintenance updates available for five more years (for a fee).
|
||||
|
||||
If you are an enterprise or want longer LTS support than usual, you can subscribe to Ubuntu ESM to get a total of ten years of support for Ubuntu LTS versions on your desktop or server.
|
||||
|
||||
The Long Term Support versions are usually known for adding major feature improvements while the non-LTS versions add bleeding-edge technologies to test and get it ready for the next LTS release.
|
||||
|
||||
If you take a look at [Ubuntu 20.04 features][6] and [Ubuntu 21.04 features][7], you should get an idea of the differences between an LTS and non-LTS release.
|
||||
|
||||
### Which versions of Ubuntu are LTS?
|
||||
|
||||
Not just limited to the version number, there are several Ubuntu flavors available as well. Some of them offer similar software update support and some of them only give you **three years of updates** (in contrast to five by Canonical).
|
||||
|
||||
So, if you want to explore those, I suggest you know [which Ubuntu version to use][8] before deciding to install any Ubuntu flavour.
|
||||
|
||||
### How Long is Ubuntu LTS Supported?
|
||||
|
||||
Any Ubuntu release is supported until the [end-of-life period][9].
|
||||
|
||||
For LTS versions, this is usually five years. And, for non-LTS versions, it is nine months.
|
||||
|
||||
### Should I Upgrade to Ubuntu 20.04 LTS?
|
||||
|
||||
First, you should [check the Ubuntu version installed on your computer][10].
|
||||
|
||||
If you are using an older LTS release, you should definitely consider upgrading to the new one for better hardware compatibility, improved workflow, and performance.
|
||||
|
||||
If you do not want to break the user experience, you can stick to the older release until it reaches the end-of-life period.
|
||||
|
||||
### How to Upgrade to the Latest Ubuntu version?
|
||||
|
||||
![][11]
|
||||
|
||||
You can upgrade to the latest Ubuntu version using the graphical user interface (GUI) or the terminal.
|
||||
|
||||
Simply head to the Software Updater, it should check and notify you if an update is available.
|
||||
|
||||
To get help, you can refer to our [upgrade instructions guide][12] to swiftly upgrade your Ubuntu version without any issues.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/latest-ubuntu-version/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/install-ubuntu/
|
||||
[2]: https://itsfoss.com/long-term-support-lts/
|
||||
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/ubuntu_yaru_light_dark_theme.jpg?resize=800%2C450&ssl=1
|
||||
[4]: https://itsfoss.com/linux-kernel-5-4/
|
||||
[5]: https://news.itsfoss.com/linux-kernel-5-11-release/
|
||||
[6]: https://itsfoss.com/ubuntu-20-04-release-features/
|
||||
[7]: https://news.itsfoss.com/ubuntu-21-04-features/
|
||||
[8]: https://itsfoss.com/which-ubuntu-install/
|
||||
[9]: https://itsfoss.com/end-of-life-ubuntu/
|
||||
[10]: https://itsfoss.com/how-to-know-ubuntu-unity-version/
|
||||
[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/start-upgrade-focal.jpg?resize=800%2C495&ssl=1
|
||||
[12]: https://itsfoss.com/upgrade-ubuntu-version/
|
@ -0,0 +1,99 @@
|
||||
[#]: subject: "How to Change Color of Ubuntu Terminal"
|
||||
[#]: via: "https://itsfoss.com/change-terminal-color-ubuntu/"
|
||||
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How to Change Color of Ubuntu Terminal
|
||||
======
|
||||
|
||||
The default terminal looks good enough if you want to get things done.
|
||||
|
||||
But, if you want a unique terminal experience or something that suits your taste, you can also change the color of your Ubuntu terminal.
|
||||
|
||||
In this quick tutorial, I shall focus on tweaking the color scheme of the terminal in Ubuntu. Ubuntu uses GNOME Terminal so the steps should be valid for most other distributions using GNOME desktop environment.
|
||||
|
||||
### Changing the color of your Ubuntu terminal
|
||||
|
||||
The steps are similar to how you [change the font and size of the terminal][1]. You have to find the option for customizing colors, that’s it.
|
||||
|
||||
Let me quickly highlight what you need to go through to find it:
|
||||
|
||||
**Step 1**. [Open the terminal window in Ubuntu][2] by pressing Ctrl+Alt+T.
|
||||
|
||||
**Step 2**. Head to the terminal preferences. You can click on the menu button to access the **Preferences** or right-click anywhere on the terminal screen.
|
||||
|
||||
![][3]
|
||||
|
||||
It will be a good idea to create a separate profile for your customization so that the default settings do not change.
|
||||
|
||||
![][4]
|
||||
|
||||
**Step 3**. Now, you can find the options to tweak the font size and style. But, here, you need to head to the “**Colors**” tab, as shown in the screenshot below.
|
||||
|
||||
![][5]
|
||||
|
||||
**Step 4**. By default, you will notice that it uses colors from the system theme. If you want to blend in with your system theme, that should be the preferred choice.
|
||||
|
||||
But, if you want to customize, you need to deselect the option and then start choosing the colors.
|
||||
|
||||
![][6]
|
||||
|
||||
As you can notice in the screenshot above, you can choose to use some of the built-in color schemes and also get to customize them to your liking _**by changing the default color option for the text and background.**_
|
||||
|
||||
You can customize every aspect of the terminal screen color, starting from the texts to the cursor, if you select a “custom” built-in scheme.
|
||||
|
||||
![][7]
|
||||
|
||||
Again! Create separate profiles if you want to access different customized versions of the terminal quickly or else you will end up customizing every time you want a specific color combination.
|
||||
|
||||
### Other ways to change the terminal color
|
||||
|
||||
Here are a couple of other ways to change the terminal color in Ubuntu:
|
||||
|
||||
#### Change the theme
|
||||
|
||||
Most Ubuntu themes have their own implementation of terminal colors and some of them actually look very nice. Here is how the terminal color scheme is changed for Ant and Orchis themes.
|
||||
|
||||
![][8]
|
||||
|
||||
You choose a dark theme and your terminal turns black. No need to wonder about selecting color schemes.
|
||||
|
||||
#### Change terminal color based on your wallpaper
|
||||
|
||||
If you do not want to customize the colors of your terminal manually, you can utilize Pywal. With this handy Python tool, you can [change the color scheme of your terminal][9] as per your wallpaper.
|
||||
|
||||
It will automatically adapt to any of your active wallpapers. So, you do not have to bother customizing the terminal.
|
||||
|
||||
### More Customization Options for Your Terminal
|
||||
|
||||
If you are more of a tinkerer, you would love to know that you have more options to customize the look of the terminal. You can read through our resource on [different ways to tweak the look of the terminal][10] to explore more about it.
|
||||
|
||||
_How do you prefer to customize the terminal? Let me know your experiences in the comments below!_
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/change-terminal-color-ubuntu/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/change-terminal-font-ubuntu/
|
||||
[2]: https://itsfoss.com/open-terminal-ubuntu/
|
||||
[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/terminal-preference.png?resize=800%2C428&ssl=1
|
||||
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/terminal-profiles.jpg?resize=800%2C619&ssl=1
|
||||
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/terminal-colors-option.png?resize=800%2C330&ssl=1
|
||||
[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/changing-colors-ubuntu-terminal.webp?resize=800%2C654&ssl=1
|
||||
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-terminal-color-customize.png?resize=800%2C550&ssl=1
|
||||
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/terminal-ant-theme.png?resize=742%2C316&ssl=1
|
||||
[9]: https://itsfoss.com/pywal/
|
||||
[10]: https://itsfoss.com/customize-linux-terminal/
|
@ -0,0 +1,109 @@
|
||||
[#]: subject: "How to change Ubuntu Terminal Font and Size [Beginner’s Tip]"
|
||||
[#]: via: "https://itsfoss.com/change-terminal-font-ubuntu/"
|
||||
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How to change Ubuntu Terminal Font and Size [Beginner’s Tip]
|
||||
======
|
||||
|
||||
If you are spending a lot of time using the terminal on Ubuntu, you may want to adjust the font and size to get a good experience.
|
||||
|
||||
Changing the font is one of the simplest but most visual way of [Linux terminal customization][1]. Let me show you the detailed steps for changing the terminal fonts in Ubuntu along with some tips and suggestions on font selection.
|
||||
|
||||
_**Note:**_ _The steps should be the same for most other [Linux terminal emulator][2] but the way you access the option can differ._
|
||||
|
||||
### Change Ubuntu Terminal font and size using GUI
|
||||
|
||||
**Step 1.** [Launch the terminal on your Ubuntu][3] system by using Ctrl+Alt+T keys.
|
||||
|
||||
**Step 2.** Head to the “**Preferences**” option that you can find when you click on the menu.
|
||||
|
||||
![][4]
|
||||
|
||||
You can also perform a right-click anywhere on the terminal to access the option as shown below.
|
||||
|
||||
![][5]
|
||||
|
||||
**Step 3.** Now, you should be able to access the settings for the terminal. By default, there will be an unnamed profile. This is the default profile. **I suggest creating a new profile** so that your changes do not impact the default settings.
|
||||
|
||||
![][6]
|
||||
|
||||
**Step 4**. To change the font, you need to enable the “**Custom font**” option and then click on “**Monospace Regular**”
|
||||
|
||||
![][7]
|
||||
|
||||
It will show a list of fonts available for selection.
|
||||
|
||||
![][8]
|
||||
|
||||
Here, you get a quick preview of the font at the bottom of the font listing and also the ability to tweak the font size of your Ubuntu terminal.
|
||||
|
||||
By default, it uses a size of **12** for the font and **Ubuntu mono** style.
|
||||
|
||||
**Step 5**. Finally, you can search for your preferred font style and hit “**Select**” to finalize it after looking at the preview and adjusting the font size.
|
||||
|
||||
![][9]
|
||||
|
||||
That’s it. You have successfully changed the fonts. See the changes in the image below. Move the slider to see the difference.
|
||||
|
||||
![Ubuntu terminal font change][10]
|
||||
|
||||
#### Want to Customize the Look of your Linux Terminal?
|
||||
|
||||
Check out our detailed article on some terminal customization tips and tricks.
|
||||
|
||||
[Linux Terminal Tweaks][1]
|
||||
|
||||
### Tips on getting new fonts for Ubuntu terminal
|
||||
|
||||
You can download fonts from the internet in TTF file format and [easily install these new fonts in Ubuntu][11] by double-clicking the TTF file.
|
||||
|
||||
![][12]
|
||||
|
||||
You should open a new terminal window to load the newly installed fonts.
|
||||
|
||||
However, keep in mind that **Ubuntu will not show ALL the newly installed fonts in the terminal**. Why? Because the terminal is designed to use monospaced fonts. Fonts that have letters too close to each other may look weird. Some fonts do not offer proper clarity between the alphabet O and the number 0. Similarly, you may face issues in differentiating the lowercase l and i.
|
||||
|
||||
This is why you’ll see the available fonts in the terminal are often have ‘mono’ in their name.
|
||||
|
||||
Overall, there can be plenty of readability issues that could create more confusion. Hence, it is best to select a font that does not make the terminal hard to read.
|
||||
|
||||
You should also check if a font looks good/weird when you increase/decrease the size of the font to ensure that you do not have a problem when customizing the look of your terminal.
|
||||
|
||||
### Font suggestions for terminal customization
|
||||
|
||||
Free mono and Noto mono are some of the good fonts available from the default list of font selections to apply on your terminal.
|
||||
|
||||
You can try [installing new fonts in Linux][11] like **JetBrains Mono**, and **Robo Mono**, Larabiefont, Share Tech Mono and more from Google Fonts and other sources.
|
||||
|
||||
_What font style/size do you prefer to use with the Ubuntu terminal? Let us know in the comments below!_
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/change-terminal-font-ubuntu/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/customize-linux-terminal/
|
||||
[2]: https://itsfoss.com/linux-terminal-emulators/
|
||||
[3]: https://itsfoss.com/open-terminal-ubuntu/
|
||||
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/terminal-preference.png?resize=800%2C428&ssl=1
|
||||
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/terminal-right-click-menu.png?resize=800%2C341&ssl=1
|
||||
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-terminal-preference-option.png?resize=800%2C303&ssl=1
|
||||
[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/enable-font-change-ubuntu-terminal.png?resize=798%2C310&ssl=1
|
||||
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/monospace-font-default.png?resize=800%2C651&ssl=1
|
||||
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-custom-font-selection.png?resize=800%2C441&ssl=1
|
||||
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-terminal-font-2.png?resize=723%2C353&ssl=1
|
||||
[11]: https://itsfoss.com/install-fonts-ubuntu/
|
||||
[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/12/install-new-fonts-ubuntu.png?resize=800%2C463&ssl=1
|
@ -1,126 +0,0 @@
|
||||
[#]: subject: "What is a container image?"
|
||||
[#]: via: "https://opensource.com/article/21/8/container-image"
|
||||
[#]: author: "Nived V https://opensource.com/users/nivedv"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
什么是容器镜像?
|
||||
======
|
||||
容器镜像包含一个打包的应用,以及它的依赖关系,还有它在启动时运行的进程信息。
|
||||
|
||||
![Shipping containers stacked][1]
|
||||
|
||||
容器是当今 IT 运维的一个关键部分。一个_容器镜像_包含了一个打包的应用,以及它的依赖关系,还有它在启动时运行的进程信息。
|
||||
|
||||
你通过提供一组特殊格式的指令来创建容器镜像,可以是提交给 Registry,或者是 Dockerfile。 例如,这个 Dockerfile 为 PHP Web 应用创建了一个容器:
|
||||
|
||||
|
||||
```
|
||||
FROM registry.access.redhat.com/ubi8/ubi:8.1
|
||||
|
||||
RUN yum --disableplugin=subscription-manager -y module enable php:7.3 \
|
||||
&& yum --disableplugin=subscription-manager -y install httpd php \
|
||||
&& yum --disableplugin=subscription-manager clean all
|
||||
|
||||
ADD index.php /var/www/html
|
||||
|
||||
RUN sed -i 's/Listen 80/Listen 8080/' /etc/httpd/conf/httpd.conf \
|
||||
&& sed -i 's/listen.acl_users = apache,nginx/listen.acl_users =/' /etc/php-fpm.d/www.conf \
|
||||
&& mkdir /run/php-fpm \
|
||||
&& chgrp -R 0 /var/log/httpd /var/run/httpd /run/php-fpm \
|
||||
&& chmod -R g=u /var/log/httpd /var/run/httpd /run/php-fpm
|
||||
|
||||
EXPOSE 8080
|
||||
USER 1001
|
||||
CMD php-fpm & httpd -D FOREGROUND
|
||||
```
|
||||
|
||||
这个文件中的每条指令都会在容器镜像中增加一个_层_。每一层只增加与下面一层的区别,然后,所有这些层叠在一起,形成一个只读的容器镜像。
|
||||
|
||||
### 这是怎么做到的?
|
||||
|
||||
你需要知道一些关于容器镜像的事情,按照这个顺序理解这些概念很重要:
|
||||
|
||||
1. Union 文件系统
|
||||
2. 写入时复制
|
||||
3. Overlay 文件系统
|
||||
4. SnapShotters
|
||||
|
||||
|
||||
|
||||
### Union 文件系统(Aufs)
|
||||
|
||||
Union 文件系统(UnionFS)内置于 Linux 内核中,它允许将一个文件系统的内容与另一个文件系统的内容合并,同时保持“物理”内容的分离。其结果是一个统一的文件系统,即使数据实际上是以分支形式组织。
|
||||
|
||||
这里的想法是,如果你有多个镜像有一些相同的数据,不是让这些数据再次复制过来,而是通过使用一个叫做_层_的东西来共享。
|
||||
|
||||
![UnionFS][2]
|
||||
|
||||
图片 CC BY-SA opensource.com
|
||||
|
||||
每一层都是一个可以在多个容器中共享的文件系统,例如,httpd 基础层是 Apache 的官方镜像,可以在任何数量的容器中使用。想象一下,由于我们在所有的容器中使用相同的基础层,我们节省了多少磁盘空间。
|
||||
|
||||
这些镜像层总是只读的,但是当我们用这个镜像创建一个新的容器时,我们会在它上面添加一个薄的可写层。这个可写层是你创建/修改/删除或进行每个容器所需的其他修改的地方。
|
||||
|
||||
### 写时复制
|
||||
|
||||
当你启动一个容器时,看起来好像这个容器有自己的整个文件系统。这意味着你在系统中运行的每个容器都需要自己的文件系统副本。这岂不是要占用大量的磁盘空间,而且还要花费大量的时间让容器启动?不是的,因为每个容器都不需要它自己的文件系统副本!
|
||||
|
||||
容器和镜像使用写时复制机制来实现这一点。写时复制策略不是复制文件,而是将同一个数据实例分享给多个进程,并且只在一个进程需要修改或写入数据时进行复制。所有其他进程将继续使用原始数据。在运行中的容器中执行任何写操作之前,要修改的文件的副本被放在容器的可写层上。这就是发生_写_的地方。现在你知道为什么它被称为“写时复制”了么。
|
||||
|
||||
这种策略既优化了镜像磁盘空间的使用,也优化了容器启动时间的性能,并与 UnionFS 一起工作。
|
||||
|
||||
### Overlay 文件系统
|
||||
|
||||
Overlay 文件系统位于现有文件系统的顶部,结合了上层和下层的目录树,并将它们作为一个单一的目录来呈现。这些目录被称为_层_。下层保持不被修改。每一层只增加与下一层的差异(计算术语为 _diff_),这种统一的过程被称为 _union 挂载_。
|
||||
|
||||
最低的目录或镜像层被称为 _lowerdir_,上面的目录被称为 _upperdir_。最后的覆盖层或统一层被称为 _merged_。
|
||||
|
||||
![Layered file system][3]
|
||||
|
||||
图片 CC BY-SA opensource.com
|
||||
|
||||
常见的术语包括这些层的定义:
|
||||
|
||||
* 基础层是你的文件系统的文件所在的地方。就容器镜像而言,这个层就是你的基础镜像。
|
||||
* Overlay 层通常被称为_容器层_,因为对运行中的容器所做的所有改变,如添加、删除或修改文件,都会写到这个可写层。对这一层所做的所有修改都存储在下一层,是基础层和 Diff 层的 _union_ 视图。
|
||||
* Diff 层包含了在 Overlay 层所作的所有修改。如果你写的东西已经在基础层了,那么 Overlay 文件系统就会把文件复制到 Diff层,并做出你想写的修改。这被称为_写时复制_。
|
||||
|
||||
|
||||
|
||||
# SnapShotters
|
||||
|
||||
容器可以使用层和图形驱动程序构建、管理和分发更改作为其容器文件系统的一部分。。但是使用图形驱动的工作真的很复杂,而且容易出错。SnapShotters 与图形驱动不同,因为它们不了解镜像或容器。
|
||||
|
||||
Snapshotters 的工作方式与 Git 非常相似,比如有树的概念,并跟踪每次提交对树的改变。一个_快照_代表一个文件系统状态。快照有父子关系,使用一组目录。可以在父级和其快照之间进行 _diff_,以创建一个层。
|
||||
|
||||
Snapshotter 提供了一个用于分配、快照和挂载抽象的分层文件系统的 API。
|
||||
|
||||
### 总结
|
||||
|
||||
你现在对什么是容器镜像以及它们的分层方法如何使容器可移植有了很好的认识。接下来,我将介绍容器的运行机制和内部结构。
|
||||
|
||||
* * *
|
||||
|
||||
_本文基于 [techbeatly][4] 的文章,经许可后改编。_
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/8/container-image
|
||||
|
||||
作者:[Nived V][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/nivedv
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus-containers.png?itok=d_4QhZxT (Shipping containers stacked)
|
||||
[2]: https://opensource.com/sites/default/files/unionfs.png (UnionFS)
|
||||
[3]: https://opensource.com/sites/default/files/rect1036.png (Layered file system)
|
||||
[4]: https://medium.com/techbeatly/container-part-ii-images-4f2139194775
|
@ -0,0 +1,192 @@
|
||||
[#]: subject: "4 Linux technologies fundamental to containers"
|
||||
[#]: via: "https://opensource.com/article/21/8/container-linux-technology"
|
||||
[#]: author: "Nived V https://opensource.com/users/nivedv"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "wxy"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
容器的四大基础技术
|
||||
======
|
||||
|
||||
> 命名空间、控制组、seccomp 和 SELinux 构成了在你的系统上构建和运行一个容器进程的 Linux 技术基础。
|
||||
|
||||
![企鹅驾驶一辆黄色背景的汽车][1]
|
||||
|
||||
在以前的文章中,我介绍过 [容器镜像][2] 及其 [运行时][3]。在这篇文章中,我研究了容器是如何在一些特殊的 Linux 技术基础上实现的,这些技术包括命名空间和控制组。
|
||||
|
||||
![容器技术的层次][4]
|
||||
|
||||
*图1:对容器有贡献的 Linux 技术(Nived Velayudhan, [CC BY-SA 4.0][5])*
|
||||
|
||||
这些 Linux 技术构成了在系统上构建和运行容器进程的基础:
|
||||
|
||||
1. 命名空间
|
||||
2. 控制组(cgroups)
|
||||
3. Seccomp
|
||||
4. SELinux
|
||||
|
||||
### 命名空间
|
||||
|
||||
<ruby>命名空间<rt>namespace</rt></ruby> 为容器提供了一个隔离层,给容器提供了一个看起来是它自己的 Linux 文件系统的视图。这就限制了进程所能看到的东西,从而限制了它所能获得的资源。
|
||||
|
||||
在创建容器时,Docker 或 Podman 和其他容器技术使用了 Linux 内核中的几个命名空间:
|
||||
|
||||
```
|
||||
[nivedv@homelab ~]$ docker container run alpine ping 8.8.8.8
|
||||
[nivedv@homelab ~]$ sudo lsns -p 29413
|
||||
|
||||
NS TYPE NPROCS PID USER COMMAND
|
||||
4026531835 cgroup 299 1 root /usr/lib/systemd/systemd --switched...
|
||||
4026531837 user 278 1 root /usr/lib/systemd/systemd --switched...
|
||||
4026533105 mnt 1 29413 root ping 8.8.8.8
|
||||
4026533106 uts 1 29413 root ping 8.8.8.8
|
||||
4026533107 ipc 1 29413 root ping 8.8.8.8
|
||||
4026533108 pid 1 29413 root ping 8.8.8.8
|
||||
4026533110 net 1 29413 root ping 8.8.8.8
|
||||
```
|
||||
#### 用户
|
||||
|
||||
用户(`user`)命名空间将用户和组隔离在一个容器内。这是通过允许容器与宿主系统有不同的 UID 和 GID 范围来实现的。用户命名空间使软件能够以 root 用户的身份在容器内运行。如果入侵者攻击容器,然后逃逸到宿主机上,他们就受限于只能以非 root身份出现了。
|
||||
|
||||
#### 挂载
|
||||
|
||||
挂载(`mnt`)命名空间允许容器对系统的文件系统层次结构有自己的视图。你可以在 Linux 系统中的 `/proc/<PID>/mounts` 位置找到每个容器进程的挂载点。
|
||||
|
||||
#### UTS
|
||||
|
||||
<ruby>Unix 分时系统<rt>Unix Timeharing System</rt></ruby>(UTS)命名空间允许容器有一个唯一的主机名和域名。当你运行一个容器时,即使使用 `- name` 标签,也会使用一个随机的 ID 作为主机名。你可以使用 [unshare 命令][6] 来了解一下这个工作原理。
|
||||
|
||||
```
|
||||
nivedv@homelab ~]$ docker container run -it --name nived alpine sh
|
||||
/ # hostname
|
||||
9c9a5edabdd6
|
||||
/ #
|
||||
nivedv@homelab ~]$ sudo unshare -u sh
|
||||
sh-5.0# hostname isolated.hostname
|
||||
sh-5.0# hostname
|
||||
isolated.hostname
|
||||
sh-5.0#
|
||||
sh-5.0# exit
|
||||
exit
|
||||
[nivedv@homelab ~]$ hostname
|
||||
homelab.redhat.com
|
||||
```
|
||||
|
||||
#### IPC
|
||||
|
||||
<ruby>进程间通信<rt>Inter-Process Communication</rt></ruby>(IPC)命名空间允许不同的容器进程通过访问共享内存或使用共享消息队列来进行通信。
|
||||
|
||||
```
|
||||
[root@demo /]# ipcmk -M 10M
|
||||
Shared memory id: 0
|
||||
[root@demo /]# ipcmk -M 20M
|
||||
Shared memory id: 1
|
||||
[root@demo /]#
|
||||
[root@demo /]# ipcs
|
||||
------ Message Queues --------
|
||||
key msqid owner perms used-bytes messages
|
||||
------ Shared Memory Segments --------
|
||||
key shmid owner perms bytes nattch status
|
||||
0xd1df416a 0 root 644 10485760 0
|
||||
0xbd487a9d 1 root 644 20971520 0
|
||||
------ Semaphore Arrays --------
|
||||
key semid owner perms nsems
|
||||
```
|
||||
|
||||
#### PID
|
||||
|
||||
<ruby>进程 ID<rt>Process ID</rt></ruby>(PID)命名空间确保在容器内运行的进程与外部世界隔离。当你在容器内运行 `ps` 命令时,由于这个命名空间的存在,你只能看到在容器内运行的进程,而不是在宿主机上。
|
||||
|
||||
#### 网络
|
||||
|
||||
网络(`net`)命名空间允许容器对网络接口、IP 地址、路由表、端口号等有自己的视图。容器如何能够与外部世界沟通?你创建的所有容器都会被附加到一个特殊的虚拟网络接口上进行通信。
|
||||
|
||||
```
|
||||
[nivedv@homelab ~]$ docker container run --rm -it alpine sh
|
||||
/ # ping 8.8.8.8
|
||||
PING 8.8.8.8 (8.8.8.8): 56 data bytes
|
||||
64 bytes from 8.8.8.8: seq=0 ttl=119 time=21.643 ms
|
||||
64 bytes from 8.8.8.8: seq=1 ttl=119 time=20.940 ms
|
||||
^C
|
||||
[root@homelab ~]# ip link show veth84ea6fc
|
||||
veth84ea6fc@if22: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue
|
||||
master docker0 state UP mode DEFAULT group default
|
||||
```
|
||||
|
||||
### 控制组
|
||||
|
||||
控制组(`cgroup`)是制作一个容器的基本模块。控制组会分配和限制资源,如 CPU、内存、网络 I/O 等,这些资源被容器所使用。容器引擎会自动创建每种类型的控制组文件系统,并在容器运行时为每个容器设置值。
|
||||
|
||||
```
|
||||
[root@homelab ~]# lscgroup | grep docker
|
||||
cpuset:/docker
|
||||
net_cls,net_prio:/docker
|
||||
cpu,cpuacct:/docker
|
||||
hugetlb:/docker
|
||||
devices:/docker
|
||||
freezer:/docker
|
||||
memory:/docker
|
||||
perf_event:/docker
|
||||
blkio:/docker
|
||||
pids:/docker
|
||||
```
|
||||
|
||||
容器运行时为每个容器设置了控制组值,所有信息都存储在 `/sys/fs/cgroup/*/docker`。下面的命令将确保容器可以使用 50000 微秒的 CPU 时间,并将内存的软、硬限制分别设置为 500M 和 1G。
|
||||
|
||||
```
|
||||
[root@homelab ~]# docker container run -d --name test-cgroups --cpus 0.5 --memory 1G --memory-reservation 500M httpd
|
||||
[root@homelab ~]# lscgroup cpu,cpuacct:/docker memory:/docker
|
||||
cpu,cpuacct:/docker/
|
||||
cpu,cpuacct:/docker/c3503ac704dafea3522d3bb82c77faff840018e857a2a7f669065f05c8b2cc84
|
||||
memory:/docker/
|
||||
memory:/docker/c3503ac704dafea3522d3bb82c77faff840018e857a2a7f669065f05c8b2cc84
|
||||
[root@homelab c....c84]# cat cpu.cfs_period_us
|
||||
100000
|
||||
[root@homelab c....c84]# cat cpu.cfs_quota_us
|
||||
50000
|
||||
[root@homelab c....c84]# cat memory.soft_limit_in_bytes
|
||||
524288000
|
||||
[root@homelab c....c84]# cat memory.limit_in_bytes
|
||||
1073741824
|
||||
```
|
||||
|
||||
### SECCOMP
|
||||
|
||||
Seccomp 意思是“<ruby>安全计算<rt>secure computing</rt></ruby>”。它是一项 Linux 功能,用于限制应用程序允许进行的系统调用的集合。例如,Docker 的默认 seccomp 配置文件禁用了大约 44 个系统调用(总计超过 300 个)。
|
||||
|
||||
这里的思路是让容器只访问容器可能需要的那些资源。例如,如果你不需要容器改变主机上的时钟时间,你可能不会使用 `clock_adjtime` 和 `clock_settime` 系统调用,屏蔽它们是合理的。同样地,你不希望容器改变内核模块,所以没有必要让它们进行 `create_module`、 `delete_module` 系统调用。
|
||||
|
||||
### SELinux
|
||||
|
||||
SELinux 是“<ruby>安全增强的 Linux<rt>security-enhanced Linux</rt></ruby>”的缩写。如果你在你的宿主机上运行的是 Red Hat 发行版,那么 SELinux 是默认启用的。SELinux 可以让你限制一个应用程序只能访问它自己的文件,并阻止任何其他进程访问它们。因此,如果一个应用程序被破坏了,它将限制该应用程序可以影响或控制的文件数量。它通过为文件和进程设置上下文环境以及定义策略来实现这一目的,这些策略将强制执行一个进程可以看到和改变的内容。
|
||||
|
||||
容器的 SELinux 策略是由 `container-selinux` 包定义的。默认情况下,容器以 `container_t` 标签运行,允许在 `/usr` 目录下读取(`r`)和执行(`x`),并从 `/etc` 目录下读取大部分内容。标签`container_var_lib_t` 是与容器有关的文件的通用标签。
|
||||
|
||||
### 总结
|
||||
|
||||
容器是当今 IT 基础设施的一个重要组成部分,也是一项相当有趣的技术。即使你的工作不直接涉及容器化,了解一些基本的容器概念和方法,也能让你体会到它们如何帮助你的组织。容器是建立在开源的 Linux 技术之上的,这使它们变得更加美好。
|
||||
|
||||
本文基于 [techbeatly][7] 的文章,并经授权改编。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/8/container-linux-technology
|
||||
|
||||
作者:[Nived V][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/nivedv
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/car-penguin-drive-linux-yellow.png?itok=twWGlYAc (Penguin driving a car with a yellow background)
|
||||
[2]: https://opensource.com/article/21/8/container-fundamentals-2
|
||||
[3]: https://opensource.com/article/21/8/deep-dive-container-runtimes
|
||||
[4]: https://opensource.com/sites/default/files/1linuxtechs.png (layers of linux technologies)
|
||||
[5]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[6]: https://opensource.com/article/19/10/namespaces-and-containers-linux
|
||||
[7]: https://nivedv.medium.com/container-internals-deep-dive-5cc424957413
|
@ -0,0 +1,116 @@
|
||||
[#]: subject: "How to Install Dropbox on Ubuntu Linux"
|
||||
[#]: via: "https://itsfoss.com/install-dropbox-ubuntu/"
|
||||
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
如何在 Ubuntu Linux 上安装 Dropbox
|
||||
======
|
||||
|
||||
Dropbox 是[最受欢迎的云存储服务之一,可用于 Linux][1] 和其他操作系统。
|
||||
|
||||
事实上,Dropbox 是最早提供原生 Linux 应用的服务之一。它仍然[支持 32 位 Linux 系统][2],这也是一项值得称赞的工作。
|
||||
|
||||
在这个初学者的教程中,我将展示在 Ubuntu 上安装 Dropbox 的步骤。这些步骤其实很简单,但有些网站把它弄得不必要的复杂。
|
||||
|
||||
### 在 Ubuntu 桌面上安装 Dropbox
|
||||
|
||||
让我们来看看安装步骤,一步一步来。
|
||||
|
||||
#### 第一步:获取 Ubuntu 的 Dropbox 安装程序
|
||||
|
||||
Dropbox 为其安装程序提供 DEB文 件。进入网站的下载页面:
|
||||
|
||||
[Dropbox Download][3]
|
||||
|
||||
下载相应的 DEB 文件。考虑到你使用的是 64 位的 Ubuntu,请获取 64 位版本的 DEB 文件。
|
||||
|
||||
![Download the Dropbox installer][4]
|
||||
|
||||
#### 第二步:安装 Dropbox 安装程序
|
||||
|
||||
你下载的 deb 文件只是 Dropbox 的一个安装程序。实际的 Dropbox 安装稍后开始,类似于[在 Ubuntu 上安装 Steam][5]。
|
||||
|
||||
要[安装下载的 deb 文件][6],可以双击它,或者右击并选择用软件安装打开。
|
||||
|
||||
![Installing the downloaded Dropbox deb file][7]
|
||||
|
||||
它将打开软件中心,你可以点击安装按钮。
|
||||
|
||||
![Installing Dropbox deb file][8]
|
||||
|
||||
等待安装完成。
|
||||
|
||||
#### 第三步:开始安装 Dropbox
|
||||
|
||||
现在 Dropbox 安装程序已经安装完毕。按 Windows 键(也叫 super 键),搜索 Dropbox 并点击它。
|
||||
|
||||
![Start Dropbox for installation][9]
|
||||
|
||||
第一次启动时,它显示两个弹出窗口。一个是关于重启 Nautilus(Ubuntu 中的文件资源管理器),另一个是关于 Dropbox 的安装。
|
||||
|
||||
![Starting Dropbox installation][10]
|
||||
|
||||
点击 Restart Nautilus/Close(在 Nautilus 弹出窗口)或 OK(在安装弹出窗口),开始实际的 Dropbox 客户端下载和安装。如果 “Nautilus Restart” 在点击关闭按钮时没有关闭,请点击 x 按钮。
|
||||
|
||||
等待Dropbox的安装完成。
|
||||
|
||||
![Installing Dropbox][11]
|
||||
|
||||
哦!需要重新启动 Nautilus,因为 Dropbox 增加了一些额外的功能,如在文件资源管理器中显示同步状态。
|
||||
|
||||
当 Dropbox 安装完毕,它应该会自动带你到 Dropbox 的登录页面,或者你可以点击顶部的 Dropbox 图标并选择登录选项。
|
||||
|
||||
![Sign in to Dropbox after installation][12]
|
||||
|
||||
事实上,这就是你今后访问 Dropbox 设置的方式。
|
||||
|
||||
#### 第四步:开始在 Ubuntu 上使用 Dropbox
|
||||
|
||||
![Sign in into Dropbox][13]
|
||||
|
||||
**注意**:在你成功登录之前,Dropbox 将不会工作。这里有一个问题。免费版的 Dropbox 限制了你可以链接到你的账户的设备数量。**如果你已经有 3 个链接的设备,你应该删除一些你不使用的旧设备。**
|
||||
|
||||
当你成功登录后,你应该看到在你的家目录中创建了一个 Dropbox 文件夹,你的云端文件开始出现在这里。
|
||||
|
||||
![Dropbox folder is created under home directory][14]
|
||||
|
||||
如果你想节省磁盘空间或带宽,你可以进入偏好设置并选择选择性同步选项。选择性同步选项允许你只在本地系统上同步来自 Dropbox 云的选定文件夹。
|
||||
|
||||
![Using selective sync in Dropbox][15]
|
||||
|
||||
Dropbox 会在每次启动时自动启动。我相信,这是你应该从任何云服务中期待的行为。
|
||||
|
||||
这就是你在 Ubuntu 上开始使用 Dropbox 所需要的一切。我希望这个教程对你有帮助。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/install-dropbox-ubuntu/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/cloud-services-linux/
|
||||
[2]: https://itsfoss.com/32-bit-linux-distributions/
|
||||
[3]: https://www.dropbox.com/install-linux
|
||||
[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/get-dropbox-for-ubuntu.png?resize=800%2C294&ssl=1
|
||||
[5]: https://itsfoss.com/install-steam-ubuntu-linux/
|
||||
[6]: https://itsfoss.com/install-deb-files-ubuntu/
|
||||
[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/dropbox-installer-ubuntu.png?resize=797%2C476&ssl=1
|
||||
[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/installing-dropbox-deb-file.png?resize=800%2C346&ssl=1
|
||||
[9]: https://itsfoss.com/wp-content/uploads/2021/09/start-drobox-ubuntu.webp
|
||||
[10]: https://itsfoss.com/wp-content/uploads/2021/09/starting-dropbox-installation-800x599.webp
|
||||
[11]: https://itsfoss.com/wp-content/uploads/2021/09/installing-dropbox.webp
|
||||
[12]: https://itsfoss.com/wp-content/uploads/2021/09/sign-in-to-dropbox-after-first-installation.webp
|
||||
[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/sign-in-dropbox.png?resize=800%2C409&ssl=1
|
||||
[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/dropbox-folder-ubuntu.png?resize=800%2C491&ssl=1
|
||||
[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/Dropbox-selective-sync.png?resize=800%2C399&ssl=1
|
@ -0,0 +1,81 @@
|
||||
[#]: subject: "Resize an image from the Linux terminal"
|
||||
[#]: via: "https://opensource.com/article/21/9/resize-image-linux"
|
||||
[#]: author: "Jim Hall https://opensource.com/users/jim-hall"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
从 Linux 终端调整图像的大小
|
||||
======
|
||||
用 ImageMagick 的转换命令从你的终端收缩一张图像。
|
||||
![Old camera blue][1]
|
||||
|
||||
ImageMagick 是一个方便的多用途命令行工具,它能满足你所有的图像需求。ImageMagick 支持各种图像类型,包括 JPG 照片和 PNG 图形。
|
||||
|
||||
### 调整图像大小
|
||||
|
||||
我经常在我的网络服务器上使用 ImageMagick 来调整图像大小。例如,假设我想在我的个人网站上发一张我的猫的照片。我手机里的照片非常大,大约 4000x3000 像素,有 3.3MB。这对一个网页来说太大了。我使用 ImageMagick 转换工具来改变照片的大小,这样我就可以把它放在我的网页上。ImageMagick 是一套完整的工具,其中最常用的是 `convert` 命令。
|
||||
|
||||
ImageMagick 的 `convert` 命令使用这样的一般语法:
|
||||
|
||||
|
||||
```
|
||||
`convert {input} {actions} {output}`
|
||||
```
|
||||
|
||||
要将一张名为 `PXL_20210413_015045733.jpg` 的照片调整到一个更容易管理的 500 像素宽度,请输入:
|
||||
|
||||
|
||||
```
|
||||
`$ convert PXL_20210413_015045733.jpg -resize 500x sleeping-cats.jpg`
|
||||
```
|
||||
|
||||
现在新图片的大小只有 65KB。
|
||||
|
||||
![Sleeping cats][2]
|
||||
|
||||
Jim Hall,[CC BY-SA 4.0][3]
|
||||
|
||||
你可以用 `-resize` 选项同时提供宽度和高度尺寸。但是,如果只提供宽度,ImageMagic 就会为你做计算,并通过调整输出图像的高度比例来自动保留长宽比。
|
||||
|
||||
### 在 Linux 上安装 ImageMagick
|
||||
|
||||
在 Linux 上,你可以使用你的包管理器安装 ImageMagick。例如,在 Fedora 或类似系统上:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo dnf install imagemagick`
|
||||
```
|
||||
|
||||
在 Debian 和类似系统上:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo apt install imagemagick`
|
||||
```
|
||||
|
||||
在 macOS 上,使用 [MacPorts][4] 或 [Homebrew][5]。
|
||||
|
||||
在 Windows 上,使用 [Chocolatey][6]。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/9/resize-image-linux
|
||||
|
||||
作者:[Jim Hall][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/jim-hall
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-photo-camera-blue.png?itok=AsIMZ9ga (Old camera blue)
|
||||
[2]: https://opensource.com/sites/default/files/sleeping-cats.jpg (Sleeping cats)
|
||||
[3]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[4]: https://opensource.com/article/20/11/macports
|
||||
[5]: https://opensource.com/article/20/6/homebrew-mac
|
||||
[6]: https://opensource.com/article/20/3/chocolatey
|
@ -0,0 +1,93 @@
|
||||
[#]: subject: "Run Web Applications in Linux Using Tangram Browser"
|
||||
[#]: via: "https://itsfoss.com/tangram/"
|
||||
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "anine09"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
使用 Tangram Browser 在 Linux 中运行 Web 应用
|
||||
=======
|
||||
|
||||
_**导语:**Tangram 是一个旨在帮助你在 Linux 中运行和管理 Web 应用的浏览器_。_一起来看看它是如何使用的吧。_
|
||||
|
||||
即使我们有许多本地的工具类 Linux 本地应用,但是许多人最终还是选择使用 Web 应用。
|
||||
|
||||
他们也许是使用 Electron 构建的应用或是直接在浏览器中打开网页,使用本地应用正在成为一种比较“传统”的做法。
|
||||
|
||||
当然,运行 Web 应用,不管是什么平台,都会占用更多的系统资源。而且,考虑到每一个服务都是基于 Web 端而不是本地,我们就需要一种有效管理 Web 应用的解决方案。
|
||||
|
||||
因此,我为你介绍一款开源的 Linux 应用,Tangram。
|
||||
|
||||
### Tangram:专为 Web 应用设计的浏览器
|
||||
|
||||
![][1]
|
||||
|
||||
你可以选择其他[优秀的浏览器][2]来运行 Web 应用,但是如果你想完全专注于 Web 应用体验的浏览器,Tangram 是个不错的选择。
|
||||
|
||||
Tangram 的开发者从 GNOME Web,[Franz][3],和 [Rambox][4] 中获得的灵感。
|
||||
|
||||
没有其他花里胡哨的功能, Tangram 能帮助你改变你的用户代理( User Agent )和管理那些你已经登陆的 Web 应用。
|
||||
|
||||
它可以用于访问多个社交媒体,聊天工具,工作协同应用等等。
|
||||
|
||||
### Tangram 的特性
|
||||
|
||||
![][5]
|
||||
|
||||
考虑到 Tangram 是基于 WebKitGTK 的精简化浏览器,它拥有的功能不算很多,下面是一些功能要点:
|
||||
|
||||
* 重新排列的侧边栏选项卡
|
||||
* 方便地添加任何一个 Web 服务作为一个 Web 应用程序
|
||||
* 在桌面端和移动端调整用户代理(User Agent)
|
||||
* 使用键盘快捷键
|
||||
* 改变侧边栏和选项卡的位置
|
||||
|
||||
|
||||
你所需要做的就是加载一个 Web 服务,登陆,然后点击**“完成”**,将其添加为 Web 应用程序。
|
||||
|
||||
![][6]
|
||||
|
||||
### 在 Linux 中安装 Tangram
|
||||
|
||||
每个 Linux 发行版都可以通过 Flatpak 来安装 Tangram,你也可以在 [AUR][7] 中找到它。
|
||||
|
||||
如果你想通过终端来安装它,输入以下命令:
|
||||
|
||||
```
|
||||
flatpak install flathub re.sonny.Tangram
|
||||
```
|
||||
|
||||
如果你的系统没有启用 Flatpak,你可以参考我们的 [Flatpak 指南][8]。
|
||||
|
||||
想要了解更多信息,请访问 [Tangram 的 Github 页面][9]。
|
||||
|
||||
[Tangram Browser][10]
|
||||
|
||||
你试过 Tangram 吗?你更喜欢 Web 应用还是本地应用?欢迎在下面的评论中分享你的想法。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/tangram/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[anine09](https://github.com/anine09)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/tangram-web-app-browser.png?resize=800%2C611&ssl=1
|
||||
[2]: https://itsfoss.com/best-browsers-ubuntu-linux/
|
||||
[3]: https://itsfoss.com/franz-messaging-app/
|
||||
[4]: https://itsfoss.com/rambox/
|
||||
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/tangram-settings.png?resize=530%2C290&ssl=1
|
||||
[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/tangram-web-app-whatsapp.png?resize=800%2C431&ssl=1
|
||||
[7]: https://itsfoss.com/aur-arch-linux/
|
||||
|
||||
[8]: https://itsfoss.com/flatpak-guide/
|
||||
[9]: https://github.com/sonnyp/Tangram
|
||||
[10]: https://flathub.org/apps/details/re.sonny.Tangram
|
Loading…
Reference in New Issue
Block a user