Merge pull request #24 from LCTT/master

update from LCTT
This commit is contained in:
perfiffer 2021-11-05 08:55:15 +08:00 committed by GitHub
commit 482e935b22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
98 changed files with 2805 additions and 1282 deletions

View File

@ -0,0 +1,101 @@
[#]: 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: "robsean"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13947-1.html"
如何更改 Ubuntu 的终端的颜色
======
![](https://img.linux.net.cn/data/attachment/album/202111/03/173150n4wjwgi4iii4662z.jpg)
如果你只是想完成一些工作,默认的终端已经看起来足够好了。
但是,如果你想要一个独一无二的的终端体验或者符合你自身品位的一些东西,你也可以改变你的 Ubuntu 的终端的颜色。
在这篇速成教程中,我将专注于调整 Ubuntu 中的颜色方案。由于 Ubuntu 使用 GNOME 的终端,因此这些步骤可能也对大多数的使用 GNOME 桌面环境的其它的发行版有效。
### 更改你的 Ubuntu 的终端的颜色
这些步骤类似于 [如何更改终端的字体和大小][1]。你必须找到自定义颜色的选项,就是这样的简单。
让我们快速指出你需要找到什么:
**步骤 1**[在 Ubuntu 中打开终端窗口][2],方法是按 `Ctrl+Alt+T` 组合键。
**步骤 2**:打开终端<ruby>首选项<rt>Preferences</rt></ruby>。你可以单击菜单按钮或者右击终端屏幕的任意位置来访问首选项。
![][3]
针对你的自定义选项,创建一个独立的配置文件将会是一个好主意,因为这样做不会更改默认的设置。
![][4]
**步骤 3**:现在,你可以找到一些调整字体大小和样式的选项。但是,在这里,你需要前往 “<ruby>颜色<rt>Colors</rt></ruby>” 选项卡,如下面的屏幕截图所示。
![][5]
**步骤 4**:在默认情况下,你将会注意到:它使用来自系统主题的颜色。如果你想融入你自己的系统主题,这应该是首选的方式。
但是,如果你想要自定义,你需要先取消系统的颜色的选项,然后再开始选择颜色。
![][6]
如你在上面的屏幕截图中能够注意到的那样,你可以选择使用一些内置的颜色方案,也可以 **通过更改文本和背景的默认颜色选项** 来完成自定义颜色方案。
如果你选择一种“自定义”内置方案,那么你可以自定义从文本到光标的各个层面的终端的屏幕颜色。
![][7]
再强调一次!如果你想快速地访问终端的不同的自定义版本,请创建一个单独的配置,否则,每次当你想要一种独特的颜色组合方案时,你都将需要重新自定义。
### 更改终端的颜色的其它的方法
这里有其它的几种更改 Ubuntu 的终端的颜色的方法:
#### 更改主题
大多数的 Ubuntu 主题都有它们自己的终端的颜色的实现,并且其中的一些实现看起来非常漂亮。这里是如何针对 Ant 和 Orchis 主题进行更改终端的颜色方案:
![][8]
你可以选择一种黑暗主题,接下来你的主题将会变成黑色。不需要担心选择颜色方案的问题。
#### 依据你的壁纸选择终端颜色
如果你不想手动自定义你的终端的颜色,你可以使用 Pywal 。使用这个方便的 Python 工具,你的计算机能够随着你的每一张壁纸来 [更改你的终端的颜色方案][9] 。
它将自动地适配你所使用的壁纸。因此,你不需要费心地自定义终端。
### 针对你的终端的自定义选项
如果你是一个更高级的玩家,你可能会热衷于更多的自定义终端的外貌的选项。你可以通读我们关于 [调整终端的外貌的不同的方法][10] 的资源来探索更多的信息。
你更喜欢自定义终端吗?在下面的评论区,让我们知道你的经历!
--------------------------------------------------------------------------------
via: https://itsfoss.com/change-terminal-color-ubuntu/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[robsean](https://github.com/robsean)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/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/

View File

@ -0,0 +1,101 @@
[#]: subject: "Visual Studio Code or Atom? Which Code Editor Should You Use?"
[#]: via: "https://itsfoss.com/visual-studio-code-vs-atom/"
[#]: author: "Pratham Patel https://itsfoss.com/author/pratham/"
[#]: collector: "lujun9972"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13944-1.html"
VS Code 还是 Atom你应该选择哪个
======
![](https://img.linux.net.cn/data/attachment/album/202111/01/231806jk4mky6gjmrw4mgm.png)
如今,找到一个 [好的开源代码编辑器][1] 并不难,随便选择一个就可以了。
微软的 [VS Code][2] 和 GitHub 的 [Atom][3] 是两个最流行的、功能丰富的、类似于 IDE 的代码编辑器,都拥有庞大的用户群和粉丝。
VS Code 和 Atom 现在都属于微软,因为 Atom 的原开发者 GitHub 现在属于微软。这两个都有一个有吸引力的、现代的 UI有一个漂亮的原生黑暗主题。两个编辑器都使用 [Electron][4] 作为用户界面。
相似的地方很多,这就是为什么你很容易在它们中间选择时感到迷惑。
如果你不能下定决心,想在 VS Code 和 Atom 之间进行一番比较和选择,这篇文章应该可以帮助你。
### VS Code
![VS Code 的用户界面与拥挤的项目界面][5]
[VS Code][2] 是开源的现代编辑器之一。它的用户群爆炸性地增长,因为它具有类似 IDE 的功能,但仍然保持相对较轻的资源占用。
VS Code 是由微软制作的,可用于 Linux、macOS 和 Windows。微软于 2015 年 11 月 18 日在 [GitHub][6] 上根据 MIT 许可发布了 VS Code 的 _大部分_ 源代码。
VS Code 的开发者对 Electron 进行了一些奇妙的优化,使其尽可能的轻量级和高效。由于 Electron 应用程序可以在大多数操作系统上运行Linux、macOS 和 Windows 的用户都可以从这些优化中受益。
[在 Linux 上安装 VS Code][7] 也相当简单。事实上,它在许多发行版的软件中心都有。
#### 为什么你应该选择 VS Code
* 那些从一开始就想获得接近 IDE 的功能,而又不想摆弄他们的代码编辑器的人,[通常] 会选择 VS Code 。
* 即使是基于 ElectronVS Code 与其他 Electron 应用(如 GitHub 的 Atom相比开销也非常小。
* 更多开箱即用的功能,如微软的 IntelliSense 自动补完、Git 集成、Markdown 支持等等。
* 插件可以只用来增加功能、主题和支持新的语言;而这种插件约束确保编辑器的核心在增加新插件后仍保持熟悉。
[由微软分发的][8] 二进制版本仍然是专有的免费软件。[VSCodium][9] 建立在 VS Code 的公开源代码之上。然而,关于 VSCodium 的讨论超出了本文的范围,如果你想获得 VS Code 提供的功能,而又没有任何专有元素的话,可以考虑将其作为 VS Code 的一个可行的替代品。
## Atom
![Atom 编辑器的用户界面][10]
[GitHub 的 Atom][3] 是另一个自由开源的代码编辑器,可用于 Linux、macOS 和 Windows。Atom 是一个使用 JavaScript 通过 Electron 制作的桌面应用程序,用于轻松开发软件包。
Atom 的源代码是根据 MIT 许可发布 [在 GitHub 上][11] 的。由于 Atom 是 GitHub 的产品,因此它嵌入了 Git Control。
Atom 被称为“<ruby>可魔改的<rt>hackable</rt></ruby> 21 世纪文本编辑器”,因为它可以使用 HTML、CSS 和 JS 完全定制。
像 VS Code 一样,你可以轻松地在其他平台和 [Linux 上安装 Atom][12] 。
#### 选择 Atom 的理由
* Atom 是那些想要一个基础的编辑器,并希望在其上进行开发的人的首选,因为 Atom 的可魔改性质。
* 内置了 Git 和完整的 GitHub 集成;考虑到它是由 GitHub 开发的,这并不令人惊讶。
* 从应用程序中非常容易搜索、安装和升级 [Atom 的插件][13]。
* 可用的 Atom 插件是非常可扩展的,甚至可以完全改变编辑器的功能,并最终创造出几乎一个新的编辑器;它确实是“可魔改”的。
* Atom 的二进制版本和它的源代码是完全开源的(不像 VS Code 的二进制版本包含专有部分+遥测)。
* 你可以 [把 Atom 从一个代码编辑器变成 IDE][14],有更智能的上下文自动完成、代码导航功能、文档格式化等。
### 总结
Atom 和 VS Code 都是建立在 Electron 之上的。但是微软在 VS Code 上做了更多的优化,使其尽可能的轻量化。
在这一点上VS Code 就像 Ubuntu几乎所有的东西都开箱即用。而 Atom 就像 Arch精简而极易魔改可扩展
Atom 和 VS Code 在技术上都隶属于微软,最终它们会殊途同归。因此,最好是使用你的社区(网页开发/软件开发)所倾向的编辑器,并铺平前进的道路。也许你最终会选择 Vim
--------------------------------------------------------------------------------
via: https://itsfoss.com/visual-studio-code-vs-atom/
作者:[Pratham Patel][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/pratham/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/
[2]: https://code.visualstudio.com/
[3]: https://atom.io/
[4]: https://www.electronjs.org/
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/04_visual_studio_code.png?resize=800%2C544&ssl=1
[6]: https://github.com/microsoft/vscode
[7]: https://itsfoss.com/install-visual-studio-code-ubuntu/
[8]: https://code.visualstudio.com/Download
[9]: https://vscodium.com/
[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/05_atom.png?resize=800%2C527&ssl=1
[11]: https://github.com/atom/atom
[12]: https://itsfoss.com/install-atom-ubuntu/
[13]: https://itsfoss.com/install-packages-in-atom/
[14]: https://ide.atom.io/

View File

@ -3,37 +3,39 @@
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "turbokernel"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13942-1.html"
AnnotatorLinux 下可轻松为你的图片添加基本注释的开源应用
Annotator为 Linux 图片添加基本注解
======
_**简介:**_ 一个令人兴奋和有用的注释工具,为 Linux 系统提供额外的功能。
![](https://img.linux.net.cn/data/attachment/album/202111/01/102651ic6c6azacc8m8jxa.jpg)
说到图像处理和编辑,有很多工具可用。然而,像 GIMP 这样的选择不一定能解决所有问题
> 一款令人兴奋和有用的注解工具,为 Linux 系统提供额外的功能
是的GIMP 为初学者和高级用户提供了大量的功能,但要学习一些东西并对任何你想要的图像应用视觉增强功能可能很费时
谈及图像处理和编辑,有很多工具可用。然而,像 GIMP 这样的工具不一定能解决所有问题
Annotator 是一个令人印象深刻的开源工具,可以让你点几下就能做很多事情
GIMP 确实为初学者和高级用户提供了大量的功能,但要学习一些东西并对图像进行视觉增强功能的应用可能很费时
### Annotator开源图像注释工具
Annotator 是一个令人印象深刻的开源工具,可以让你能轻松完成很多事情。
### Annotator开源图像注解工具
![][1]
Annotator 你快速添加形状、文本和其他视觉元素。这对各种使用情况都很有用。
Annotator 你快速添加形状、文本和其他视觉元素。这对各种使用情况都很有用。
这个工具很容易使用,提供了一个简单的用户界面。而且,你还可以得到各种功能来增强你想要的图像。
这个工具提供了一个简单的用户界面并且易于使用。而且,你还可以通过各种你想要的功能来增强图像。
### Annotator 的功能
![Adding icons to images][2]
仅仅限于为图片增强,你还可以通过 Annotator 获得一些其他功能。其中的一些主要功能是:
局限于图片增强,你还可以通过 Annotator 获得一些其他功能。其中的一些主要功能是:
* 能够添加文本
* 自定义文本的颜色,调整大小,调整高亮的颜色等
* 自定义文本的颜色,调整大小,调整高亮的颜色等
* 使用放大镜工具来关注图像中的某个特定点
* 调整放大镜以改变角度和大小
* 添加视觉图标来表达一些东西
@ -45,15 +47,13 @@ Annotator 让你快速添加形状、文本和其他视觉元素。这对各种
* 可用各种形状,如箭头、圆圈和星星
* 能够调整图像的大小和裁剪图像
![][3]
### 在 Linux 中安装 Annotator
基本上,Annotator 可在 elementaryOS 的应用中心找到。但是,幸运的是,它是一个 Flatpak 包,所以你可以在任何 Linux 发行版上安装它。
Annotator 通常可在 elementaryOS 的应用中心找到。但幸运的是,它是一个 Flatpak 包,所以你可以在任何 Linux 发行版上安装它。
你所需要做的就是前往应用中心商店的链接,然后使用软件安装程序下载/打开 **Flatpak ref** 文件。如果你需要帮助,我们的 [Flatpak 指南][4]中有更多相关信息。
你所需要做的就是前往应用中心商店的链接,然后使用软件安装程序下载/打开 **Flatpak ref** 文件。如果你需要帮助,我们的 [Flatpak 指南][4] 中有更多相关信息。
[Annotator][5]
@ -61,17 +61,17 @@ Annotator 让你快速添加形状、文本和其他视觉元素。这对各种
### 关于使用 Annotator 的想法
我发现它对我的工作很有用,因为我们每天都需要处理各种截图。而且,描述性越,图片就越能让我们的读者理解。
我发现它对我的工作很有用,因为我们每天都需要处理各种截图。而且,描述性越详细,图片就越能让我们的读者理解。
通常情况下,我使用 Flameshot 作为我的截图工具,并通过它添加可用的注释。还有其他[可用于 Linux 的截图工具][7],但我更喜欢 Flameshot 的快速注释功能。
通常情况下,我使用 Flameshot 作为我的截图工具,并通过它添加可用的注解。还有其他 [可用于 Linux 的截图工具][7],但我更喜欢 Flameshot 的快速注解功能。
然而,你不能使用 Flameshot 或其他任何截图工具来为现有的图片添加注
然而,你不能使用 Flameshot 或其他任何截图工具来为现有的图片添加注
因此Annotator 在编辑现有的截图或任何其他所需的图像时就显得非常方便。
在我短暂的使用过程中,它的所有功能都运行良好,我希望可以编辑和调整文字的大小,使之更加直观。除此以外,我没有任何抱怨。
在我短暂的使用过程中,它的所有功能都运行良好,不过我希望可以编辑和调整文字的大小,使之更加直观。
如果你需要为你的系统上的图像添加高亮/注释,我建议你试一试。请在下面的评论中告诉我你的想法。
如果你需要为系统上的图像添加高亮/注解,我建议你试一试。请在下面的评论中告诉我你的想法。
--------------------------------------------------------------------------------
@ -80,7 +80,7 @@ via: https://itsfoss.com/annotator/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[turbokernel](https://github.com/turbokernel)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,105 @@
[#]: subject: "Ferdi: A Free & Open-Source Alternative to Franz & Rambox"
[#]: via: "https://itsfoss.com/ferdi/"
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13946-1.html"
FerdiFranz 和 Rambox 的自由开源替代品
======
![](https://img.linux.net.cn/data/attachment/album/202111/03/171216dxojy2xuivii4xii.jpg)
> Ferdi 是一个很有前途的开源应用,是 Franz 和 Rambox 的替代品,免费提供了更多功能。让我们来探索一下它的更多信息。
有一个可以帮助你管理多个服务的应用会方便,这样你就不用什么事情都要打开一个浏览器去做了,虽然从技术上讲,你可以这样,但这肯定不是最有条理的做事方式。
因此,像 [Rambox][1] 和 [Franz][2] 这样的跨平台解决方案是相当流行的,它可以登录到几个服务,并一目了然地访问所有的服务。
尽管它们都可用于 Linux而且我们已经单独介绍过它们但它们免费提供的功能有限。
相比之下Ferdi 是 Franz 的一个复刻,旨在提供更好的体验,同时免费提供了许多高级功能。
### Ferdi: 一处管理多个应用
![][3]
Ferdi 是一个自由开源应用,让你在一个地方添加多个应用,包括各种消息服务。
它还可以让你定制应用的各个方面和它的行为。如果你喜欢像 Rambox 和 Franz 这样的应用,你更应该看看 Ferdi。
### Ferdi 的特点
![][4]
你可以发现它有大量的功能,而不需要支付额外费用。在这里,我将重点提到一些关键的功能:
* 跨平台支持Linux、Windows 和 macOS
* 包含丰富的信息服务Slack、WhatsApp、Element 等)。
* 支持用 Franz 账户登录
* 能够对信息进行密码保护
* 可以选择使用你的自定义服务器
* 快速访问待办事项列表,可选择使用 Franz Todo、Todoist、Microsoft To Do、Any.do 等
* 通过在不使用时卸载应用(休眠)来调整性能
* 私密通知,以隐藏你的信息
* 支持“请勿打扰”模式
* 可为每个应用单独切换黑暗模式
* 云同步
* 对账户数量没有限制
* 能够设置一个代理,并通过它进行连接
* 可以添加多个工作空间
### 关于使用 Ferdi 的想法
![][5]
就像 Rambox 和 Franz 一样Ferdi 不可避免的会消耗大量资源。所以,你需要知道你是否有足够的内存来让几个应用在 Ferdi 中活动。
在不使用时,能够卸载应用是件好事。因此,如果你的资源不足,你可能想利用休眠选项。
![][6]
Ferdi 还提供一些高级选项,如 GPU 加速、通用黑暗模式、隐私切换、外观定制等。你甚至可以添加没有列出的自定义服务。
![][7]
总的来说,在 Ferdi 中你会得到许多功能和选择,你可以用这些选项组合有效地将多个应用有条理地组织起来。
### 在 Linux 中安装 Ferdi
Ferdi 提供了多个软件包,便于在 Linux 上安装。你可以找到一个适用于 Ubuntu/Fedora 的 DEB/RPM 包,以及一个适用于所有其他 Linux 发行版的 [AppImage 文件][8]。
他们还提供了一个 snap 包,并且也可以通过 [AUR][9] 安装。所以,你有很多选择来让它安装在你的 Linux 电脑上。
你可以探索他们的 [GitHub 页面][10] 并前往其发布页下载,或者访问其官方网站。
- [下载 Ferdi][11]
你试过 Ferdi 了吗?它是否达到了取代 Franz 或 Rambox 的目的?它是否更好?请在下面的评论中分享你的经验。
--------------------------------------------------------------------------------
via: https://itsfoss.com/ferdi/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/rambox/
[2]: https://itsfoss.com/franz-messaging-app/
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/ferdi-screenshot.png?resize=800%2C621&ssl=1
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/ferdi-screenshot-1.png?resize=800%2C584&ssl=1
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/ferdi-custom-services.png?resize=800%2C586&ssl=1
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/ferdi-workspaces.png?resize=800%2C627&ssl=1
[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/ferdi-advanced-options.png?resize=800%2C541&ssl=1
[8]: https://itsfoss.com/appimage-interview/
[9]: https://itsfoss.com/aur-arch-linux/
[10]: https://github.com/getferdi/ferdi
[11]: https://getferdi.com/

View File

@ -0,0 +1,112 @@
[#]: subject: "A simple CSS trick for dark mode"
[#]: via: "https://opensource.com/article/21/10/dark-themes-websites"
[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13950-1.html"
一个深色模式的简单 CSS 技巧
======
> 让你的网站根据用户选择的主题进行调整的能力是一个很棒的辅助功能。
![](https://img.linux.net.cn/data/attachment/album/202111/04/101203a19wb2ptlcmwmmnl.jpg)
你可能已经熟悉<ruby>媒体查询<rt>media query</rt></ruby>了。它们被广泛地用于使网站具有响应性。`width` 和 `height` 属性包含视区的尺寸。然后,你可以使用 CSS 在不同的尺寸下呈现不同的布局。
[prefers-color-scheme 媒体查询][2] 的工作方式与此相同。用户可以将他们的操作系统配置为使用浅色或深色主题。`prefers-color-scheme` 包含这个值。该值是 `light``dark` ,尽管 W3C 规范指出它可能支持未来的值,如 `sepia`。我为这两种模式指定不同的 CSS 变量值,让用户的操作系统来决定。
### prefers-color-scheme 媒体查询
`prefers-color-scheme` 媒体查询的两种变化是:
```
/* Light mode */
@media (prefers-color-scheme: light) {
:root {
--body-bg: #FFFFFF;
--body-color: #000000;
}
}
/* Dark mode */
@media (prefers-color-scheme: dark) {
:root {
--body-bg: #000000;
--body-color: #FFFFFF;
}
}
```
在上面的 CSS 中,`--body-bg` 和 `--body-color` 是 [CSS 变量][3]。正如你所看到的,它们对两种模式都包含不同的值。在浅色主题中,我设置了一个白色背景和黑色文本。在深色主题中,我设置了黑色背景和白色文本。
因为[规范][2]说 W3C 可能会引入未来的值,所以把这个 CSS 转换为默认值是有意义的。
```
/* Light mode */
:root {
--body-bg: #FFFFFF;
--body-color: #000000;
}
/* Dark mode */
@media (prefers-color-scheme: dark) {
:root {
--body-bg: #000000;
--body-color: #FFFFFF;
}
}
```
在上面的代码中,我默认定义了一个浅色主题,如果媒体查询是 `dark`,则将其转换为深色主题。这样一来,以后任何添加到媒体查询的值都会默认设置为浅色主题。
### 使用 CSS 变量
现在我为不同的主题设置了不同的值,我需要实际使用它们来设计页面。
```
body {
background: var(--body-bg);
color: var(--body-color);
}
```
[var() 语法][3] 是 CSS 使用变量的方式。在上面的代码中,我是说把 `background` 设置为 `--body-bg` 的值,把 `color` 设置为 `--body-color` 的值。注意,这些变量的值来自媒体查询。这意味着背景和前景的颜色是根据操作系统的设置而改变的!
这就是媒体查询的真正能力。提供一个从操作系统到网页的一致的用户体验。
如果你进入 [findmymastodon.com][4],并切换你的操作系统的主题,你会看到从一个主题到另一个主题的过渡。
[CSS 工作组][2] 网站也使用同样的媒体查询。改变你的操作系统主题,网站就会切换主题来进行调整。
### 结论
请注意,使用 `prefers-color-scheme` 与使用普通的编程语言没有什么不同。我定义了一些变量,这些变量的值根据一些逻辑而改变。而这些变量然后被用于进一步的操作。
让你的网站根据用户选择的主题进行调整的能力是一个很棒的辅助功能。而且,为了用户的利益,它进一步模糊了桌面和网络之间的界限。最新的浏览器版本 [支持 prefers-color-scheme][5],所以你今天就可以开始实验了。
编码愉快。
这篇文章最初发表在 [作者的网站][6] 上,经许可后重新发表。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/10/dark-themes-websites
作者:[Ayush Sharma][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/ayushsharma
[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://drafts.csswg.org/mediaqueries-5/#prefers-color-scheme
[3]: https://www.w3.org/TR/css-variables-1/
[4]: https://findmymastodon.com/
[5]: https://caniuse.com/prefers-color-scheme
[6]: https://ayushsharma.in/2021/10/creating-light-and-dark-themes-for-websites-correctly-using-prefers-color-scheme

View File

@ -0,0 +1,91 @@
[#]: subject: "How to kill a zombie process on Linux"
[#]: via: "https://opensource.com/article/21/10/linux-zombie-process"
[#]: author: "Anderson Silva https://opensource.com/users/ansilva"
[#]: collector: "lujun9972"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13941-1.html"
如何在 Linux 上杀死一个僵尸进程
======
> 要杀死一个僵尸进程,你必须从进程列表中删除其名称。
![](https://img.linux.net.cn/data/attachment/album/202111/01/095024jyrvo8ss5jnxysqo.jpg)
万圣节快乐!
这里有一个和 Unix 纪元一样古老的故事。自从有了 C 和 Unix以及后来的Linux我们就有了“<ruby>僵尸<rt>zombie</rt></ruby>”。具体来说,有一些进程被标记为“<ruby>僵尸进程<rt>zombie process</rt></ruby>”。一些人误解它,另一些人忽视它,而它对我们许多人试图 “杀死” 这些进程的努力免疫,没有什么成效。这是为什么呢?
### Linux 中的进程是什么?
这一切始于执行 Linux 中的一个程序时,当它被执行时,它的运行实例被称为进程。你可以用 [ps 命令][2] 查看你的 Linux 环境中的所有进程:
```
$ ps -ax
        PID TTY         STAT   TIME COMMAND
        1 ?     Ss      0:01 /usr/lib/systemd/systemd rhgb --switched-root --sys
        2 ?     S       0:00 [kthreadd]
        3 ?     I<      0:00 [rcu_gp]
        4 ?     I<      0:00 [rcu_par_gp]
```
有时一个进程启动另一个进程,使第一个进程成为第二个进程的父进程。`pstree` 命令是一个很好的工具,可以让你看到系统中进程的“家谱”:
```
$ pstree -psn
systemd(1)─┬─systemd-journal(952)
        ├─systemd-udevd(963)
        ├─systemd-oomd(1137)
        ├─systemd-resolve(1138)
        ├─systemd-userdbd(1139)─┬─systemd-userwor(12707)
                           ├─systemd-userwor(12714)
                           └─systemd-userwor(12715)
        ├─auditd(1140)───{auditd}(1141)
        ├─dbus-broker-lau(1164)───dbus-broker(1165)
        ├─avahi-daemon(1166)───avahi-daemon(1196)
        ├─bluetoothd(1167)
```
每个进程在系统中都会被分配一个编号。进程编号PID1 被分配给启动过程中执行的第一个进程PID 1 之后的每一个进程都是它的子孙。PID 1 进程是初始化进程,在大多数新版本的 Linux 中,它只是一个指向 `systemd` 程序的符号链接。
### 用 kill 命令结束一个进程
你可以用 `kill` 命令来终止 Linux 系统中的进程。尽管名字叫 “杀死”,但 `kill` 命令和其他一些命令,如 `pkill``killall`,都是为向一个或多个进程发送信号而编写/设计的。当没有指定信号时,它发送的默认信号是 `SIGTERM` 信号,以终止进程。
当一个父进程死亡或被杀死,而其子进程没有跟随其父进程的死亡,我们称该进程为“<ruby>孤儿进程<rt>orphan process</rt></ruby>”。
### 如何杀死一个僵尸进程
另一方面,僵尸进程是不能被“杀死”的!你可能会问为什么?因为它们已经死了!
每一个子进程,当被终止时,都会成为一个僵尸进程,然后被父进程删除。当进程退出并释放它所使用的资源时,它的名字仍然在操作系统的进程表中。这时,父进程的工作就是把它的名字从进程表中删除。如果没有删除,我们就有了僵尸进程,它不再是一个真正的进程,而只是操作系统进程表上的一个条目。
这就是为什么试图对一个<ruby>失效的<rt>defunct</rt></ruby>(僵尸)进程执行 “杀死” 命令,即使使用 `-9``SIGKILL`)选项也不起作用,因为没有什么可以杀死的。
因此,要杀死一个僵尸进程,比如从进程列表(进程表)中删除其名称,你必须杀死其父进程。例如,如果 PID 5878 是一个僵尸进程,而它的父进程是 PID 4809那么要杀死僵尸进程5878就必须结束父进程4809
```
$ sudo kill -9 4809  # 4809 是父进程,而非僵尸
```
我对僵尸的最后一句警告:在杀死父进程时要非常小心。如果一个进程的父进程是 PID 1而你杀了它你就会重新启动自己
而这将是一个更可怕的故事!
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/10/linux-zombie-process
作者:[Anderson Silva][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/ansilva
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ganapathy-kumar-unsplash.jpg?itok=5-DT99NA (Full moon on a hazy night)
[2]: https://opensource.com/article/21/8/linux-procps-ng

View File

@ -0,0 +1,119 @@
[#]: subject: "Fedora 35 Debuts With GNOME 41 and a New KDE Variant"
[#]: via: "https://news.itsfoss.com/fedora-35-release/"
[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/"
[#]: collector: "lujun9972"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13949-1.html"
Fedora 35 登场:带来了 GNOME 41 和一个新的 KDE 变体
======
> Fedora 35 发布了,带来了 GNOME 41并有一个专注于可靠性的基于 KDE 的新变体。
![](https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/fedora-35-release.png?w=1200&ssl=1)
在测试版发布几周后Fedora 35 稳定版终于来了!这个版本带来了一些关键性的改进,我们将在这里介绍它们。
这些改进中最值得注意的是加入了最近发布的 GNOME 41同时还有一些小的升级如 Linux 内核 5.14 和完成向 PipeWire 的过渡。
现在,让我们来简要看一下这些变化,以及 Fedora 35 引入的一些改进。
### Fedora 35 的关键升级
下面是 Fedora 35 中一些比较有影响的升级和新增功能。
### 桌面环境
Fedora 因其对最新桌面环境的支持而闻名,而这一点在这个版本中似乎没有改变。
#### GNOME 41
![][9]
Fedora 35 工作站现在搭载了目前最受欢迎的 GNOME 41。这意味着它有了新的“<ruby>连接<rt>Connections</rt></ruby>”应用、显著改进的软件中心,以及一些很棒的多任务控制。
它还对笔记本用户有所帮助,因为它改进了触摸板手势、电源配置文件和移动数据设置。
如果你想看看还有什么新东西,你可以看看我们的 [GNOME 41 发布报道][2]。
#### KDE Plasma 5.22
![][10]
不过,这个版本并不包括最近发布的 Plasma 5.23,而是选择了 [Plasma 5.22][3]。不过,这是可以理解的,因为 Fedora 团队只有一周的时间。
虽然是一个相当小的升级Plasma 5.22 确实带来了自适应透明功能,以及改进的 Krunner 和系统设置。如果你有兴趣,你可以看看 [KDE Plasma 5.22][3] 的更多信息。
### 新的 KDE 版本Fedora Kinoite
![][11]
Fedora Kinoite 采用 KDE Plasma 桌面,并且它是基于 rpm-ostree 技术的。你可以得到开箱即用的 Flatpak 应用程序支持,以轻松安装软件。
根据其官方的描述:
> “Kinoite 提供原子更新和一个不可变操作系统,以提高可靠性。”
因此,它可能是一个值得尝试的选择,可以作为你的 Linux 桌面操作系统用于日常工作,而不存在因更新而破坏用户体验的风险。
截至目前,它支持 X86_64 和 AArch64 架构。你可以去它的 [项目网站][4] 了解一下。
### Linux 5.14 内核
早在八月份,我就介绍了 [新的 Linux 5.14][5] 内核,它现在已经出现在了 Fedora 35 中。这对那些基于 ARM 的系统来说是个好消息,因为 Linux 5.14 带来了许多针对 ARM 的改进。
如果你没有使用 ARM 计算机,你仍然会从 Linux 5.14 的一些其他改进中受益。这些改进主要与 GPU 有关,以及对 USB 4 的改进支持。
#### DNS over TLS 支持
随着隐私变得越来越重要,像 DNS over TLSDoT这样的技术正在成为我们隐私的一个关键部分。现在Fedora 35 带来了对这项技术的支持,它有助于加密你进出 DNS 服务器的互联网流量。
这意味着你的 ISP 不能监视你的浏览习惯,我相信每个人都会喜欢这一点。
### 其他改进
除了前面提到的那些Fedora 35 还带来了对以下新功能的支持。
* Firewalld 软件包更新
* GNU 工具链更新
* 支持第三方软件库中的 Flathub 应用程序
* Fedora Cloud 默认采用 btrfs 文件系统
* 过渡到 Pipewire
如果你想看完整的变化列表,可以在 [官方更新列表][6] 或 [官方公告][7] 中找到。
### 总结
虽然这个版本没有像 Fedora 34 那样带来很多突破性的改进,但我认为用户会对它更加满意。在 GNOME 41 和 Linux 5.14 之间,用户应该会发现他们的系统有了不错的改进。
如果你想亲自尝试一下 Fedora 35请随时从下面的链接中下载它。
- [下载Fedora 35][8]
你对 Fedora 35 中引入的变化有什么看法?请在下面的评论中告诉我!
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/fedora-35-release/
作者:[Jacob Crume][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/jacob/
[b]: https://github.com/lujun9972
[2]: https://news.itsfoss.com/gnome-41-release/
[3]: https://news.itsfoss.com/kde-plasma-5-22-release/
[4]: https://kinoite.fedoraproject.org/
[5]: https://news.itsfoss.com/kernel-5-14-release/
[6]: https://fedoraproject.org/wiki/Releases/35/ChangeSet
[7]: https://fedoramagazine.org/announcing-fedora-35/
[8]: https://getfedora.org/
[9]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/Gnome-41-Fedora.png?w=1366&ssl=1
[10]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/KDE-5.22-Fedora.png?w=1366&ssl=1
[11]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/kde-kinoite.jpg?resize=1568%2C882&ssl=1

View File

@ -1,84 +0,0 @@
[#]: subject: "Systemd-free Linux Distro Devuan Releases Version 4.0 Based on Debian 11"
[#]: via: "https://news.itsfoss.com/devuan-4-release/"
[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Systemd-free Linux Distro Devuan Releases Version 4.0 Based on Debian 11
======
The developers of Devuan GNU+Linux have recently released the latest stable version Devuan “Chimaera” 4.0. For those who arent aware, Devuan is a fork of Debian that doesnt use systemd but init as its software suite.
Lets take a look at what this new release has to offer.
### Key Highlights
The latest release is now based on [Debian 11 “Bullseye”][1] and uses the Linux Kernel 5.10. As mentioned before, you have to choose between init systems OpenRC, sysvinit, and runit.
![Source: devuan.org][2]
#### Refreshed UI
A new bootloader screen and desktop theming have been introduced.
The release note states
> Improved desktop support virtually all desktop environments available in Debian are now part of Devuan, systemd-free
This means you dont necessarily have to use the default XFCE as the desktop environment. As for desktop managers, gdm3 and ssdm have now been included.
#### Improved Accessibility
The installer is completely based on Debian 11s installer. Thus, all procedures described in Debians wiki will apply here too.
You can now disable task-speech accessibility if you intend to install a console-only system and avoid unnecessary dependencies.
Lastly, you can successfully install a desktop environment without installing PulseAudio. The GUI or console installation sessions will use hardware or software speech synthesis instead. This also includes using a refreshable braille display.
#### Fixes and Updates to Certain Packages
Do note that wicd, the network manager, will no longer be available due to its dependence on the obsolete python2. Instead, you can use other alternatives such as network-manager and connman.
It had been noticed that newer AMD CPUs caused the system to boot to a black screen. To solve this issue, the release notes clearly mention the user to install the firmware-amd-graphics package from the non-free repository. The non-free repositories will be available during the install time.
If youre upgrading from the previous release, Devuan 3 Beowolf, you may notice missing XFCE app icons. This can easily be solved by running a simple command mentioned in the release notes.
For more details, you can refer to their [official release notes.][3]
### Summing Up
Devuan 4.0 looks like an interesting release, especially for those who want a Debian-like experience but without systemd.
Users running the older versions of Devuan and those looking to migrate from Debian can head over to the [official websites guide][4]. New users willing to give Devuan 4.0 a try can use the link below.
[Get Devuan Chimaera 4.0][5]
_How do you find Devuan when compared to Debian? Would you like to try it out?_
#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
I'm not interested
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/devuan-4-release/
作者:[Rishabh Moharir][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/rishabh/
[b]: https://github.com/lujun9972
[1]: https://news.itsfoss.com/debian-11-feature/
[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4MCIgd2lkdGg9IjY0MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[3]: https://files.devuan.org/devuan_chimaera/Release_notes.txt
[4]: https://www.devuan.org/os/install
[5]: https://www.devuan.org/get-devuan

View File

@ -1,86 +0,0 @@
[#]: subject: "Valve is Reviewing Games Compatible with SteamOS"
[#]: via: "https://news.itsfoss.com/steamdeck-verified/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Valve is Reviewing Games Compatible with SteamOS
======
With the introduction of Steam Deck, the future of gaming in Linux is more promising than ever.
The presence of Steam Deck has already made it possible to [bring in anti-cheat engine support to Linux][1]. If you did not know, Steam Deck is powered by the upcoming new [SteamOS][2] (based on Arch Linux).
And, now, to make things better, Valve has announced to introduce new compatibility badges to showcase games on Steam that should work with Steam Deck powered by SteamOS.
### Steam Deck Verified: What Does it Mean?
![][3]
Like what we mentioned about referring ProtonDB to check compatibility in our [Linux gaming guide][4], Valve aims to verify every game that works with Steam Deck.
As shown in the image above, it will display four categories of compatibility badges. Accordingly, you can decide if you want to try the game on the Steam Deck console or not.
Valve plans to thoroughly review the games for Steam Deck compatibility and update the status with every new update made to the game.
Overall, the games will be tested to fulfill the following criteria:
* Full controller support.
* Should support the default 1280 x 800 (or 1280 x 720) resolution of Steam Deck.
* Without any warnings displayed as a seamless experience.
* If running through Proton, the game needs to support it.
![][5]
The compatibility badge will also display detailed insights on what you can expect as per the status.
And, if you are a developer, you can go through the [official details of the review process][6] to make your game compatible.
### Does This Mean You Wont Need ProtonDB for Linux Desktop Gaming?
![][7]
While I cannot confirm that, but it raises the potential for it.
As of now, Linux gamers utilize the community portal [ProtonDB][8] to check if a Windows-only game works with Linux.
With Steam Deck verified, if the compatibility badges are shown cross-platform, it could be useful for Linux desktops. Technically, Steam Deck is still Linux, but your PCs hardware configuration is not the same.
But, it would be useful to rely on Valves official review process to launch a game on Steam without worrying about its compatibility on your Linux desktop.
We can only hope for better when it comes to gaming on Linux.
_What do you think about Valves new compatibility checking initiative for Steam Deck? Feel free to let me know your thoughts._
#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
I'm not interested
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/steamdeck-verified/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://news.itsfoss.com/easy-anti-cheat-linux/
[2]: https://itsfoss.com/steamos/
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM4MCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[4]: https://itsfoss.com/linux-gaming-guide/
[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[6]: https://partner.steamgames.com/doc/steamdeck/compat
[7]: https://i1.wp.com/i.ytimg.com/vi/_OAqvtlgfGA/hqdefault.jpg?w=780&ssl=1
[8]: http://protondb.com/

View File

@ -1,84 +0,0 @@
[#]: subject: "FreeOffice 2021 is Here for Linux With Enhanced Compatibility and New Features to Rival Microsoft Office"
[#]: via: "https://news.itsfoss.com/freeoffice-2021-release/"
[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
FreeOffice 2021 is Here for Linux With Enhanced Compatibility and New Features to Rival Microsoft Office
======
The German-based software developer has just announced the latest upgrade to its popular FreeOffice series. FreeOffice 21, as a free alternative to Microsoft Office.
It is a complete software suite aimed at productivity. It contains three apps TextMaker 21, PlanMaker 21, and Presentations 21 that serve as alternatives to Word, Excel, and PowerPoint. The UI is very similar to MS Offices ribbon layout, although you can choose the classic layout instead.
FreeOffice 21 is based on the commercial suite SoftMaker Office 21, which is also available for Linux. Even though it lacks certain features compared to SoftMaker Office, FreeOffice is reasonably sufficient for home or office use.
This makes it one of the best office suites and [other open-source Microsoft Office alternatives][1] on Linux.
Lets get to know what the latest release has in store for us.
**Note:** We have covered products that are not open-source from SoftMaker because they are also available for Linux. And, the same goes for FreeOffice 2021.
### Major Highlights
The eye-catching feature of the release is the flawless compatibility with MS Office formats. It supports the modern file formats DOCX, XLSX, and PPTX. This means you can easily open, edit and save your friends MS Office files. Thus, theres no hassle of exporting and converting file formats anymore.
Another important highlight is using a single license for Linux, macOS, and Windows concurrently. This is helpful if you want to use FreeOffice on more than one PC, like your workstation or your siblings laptop.
Other newly added features include initial support for SVG graphic format and improved import-export functions.
#### TextMaker 2021 Improvements
![Source: Presskit][2]
You can now simultaneously use footnotes and endnotes in the same document.
Moreover, TextMaker can even open the older Microsoft DOC format and ODT format utilized by OpenOffice and LibreOffice.
#### PlanMaker 2021 Improvements
![Source: Presskit][2]
Power users will find it comforting to know that functions, like conditional formatting and extended pivot tables using PlanMaker, will be compatible with Excel 2021, 2019, and 365.
#### Presentations 2021 Improvements
![Source: Presskit][2]
Users who like to focus on the visual aspects of the slides can find more animations, slide transitions, and effects. These are now based on OpenGL for smoother performance.
### Wrapping Up
FreeOffice 21 seems to be a good update, especially if you were looking for a free office suite with better compatibility with Microsoft Office.
FreeOffice is available for Linux along with macOS and Windows, entirely **free of cost**. You can find DEB, RPM packages, along with a tar package for other Linux distributions.
[Download FreeOffice 21][3]
_Do you use SoftMaker FreeOffice as your daily driver? If not, do you plan to check it out?_
#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
I'm not interested
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/freeoffice-2021-release/
作者:[Rishabh Moharir][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/rishabh/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/best-free-open-source-alternatives-microsoft-office/
[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[3]: https://www.freeoffice.com/en/download

View File

@ -1,82 +0,0 @@
[#]: subject: "Heres Why Raspberry Pi is Increasing its Price"
[#]: via: "https://news.itsfoss.com/raspberry-pi-price-hike/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Heres Why Raspberry Pi is Increasing its Price
======
It may not be a good time for best pricing when it comes to motherboards, CPUs, and GPUs. However, Raspberry Pi boards continued to sail through most of 2020-2021 without an increase in its price.
But, recently, Raspberry Pi announced its first-ever price hike ever, so why is that happening?
### Supply Chain Issues: What is it Exactly?
The entire semiconductor industry is suffering from an incredibly high demand and short supply situation.
Amidst the COVID-19 pandemic, the requirements for electronic components, gadgets, and computers have shot up.
Of course, the GPU (graphics card) shortage is the worst of them. But, overall, if a product uses a chip, it is tough to readily manufacture as of now.
Every major company has been investing to ramp up the work in a foundry to get more chips out. However, considering an unprecedented demand globally, it will take at least a few years to fulfill the current orders and move on.
Raspberry Pi managed to survive 2020 and most of 2021 without significant issues in manufacturing boards as per the demands.
While Raspberry Pi 4 launch price and its availability were not initially affected by a large margin, it could not escape the supply chain issues forever.
Hence, Raspberry Pi predicts that they cannot meet the rise in demands as they would expect compared to their capacity of manufacturing. And, this is why they are increasing the pricing for some of their products.
### Raspberry Pi Price Hike: What Changes?
The affected products include the Raspberry Pi Zero and the 2 GB variant of the Raspberry Pi 4.
While they intended to manufacture more this year, they will make about seven million units in 2021 due to supply chain issues.
The Raspberry Pi 4 2GB variant was priced at $35 replacing the 1 GB option. However, it is now priced back at **$45**, temporarily.
And, the 1 GB Raspberry Pi 4 option is making a comeback at **$35**. This way, you get more options, but the one with more memory gets expensive.
For now, they will focus on Compute Module 3, Compute Module 3+, and Raspberry Pi 3B.
So, it is worth noting that if you are looking for a Raspberry Pi 3B+, you might want to consider Raspberry Pi 4. In other words, the older Raspberry Pi models like 3B+ and Zero may not have a good availability throughout this year (and the next).
### Is It a Permanent Price Change?
Considering Raspberry Pi managed to maintain the pricing even with the global chip shortage, we can be confident that they can bring the old price back soon.
Heres what they mention in their [official announcement][1]:
> These changes in pricing are not here to stay. As global supply chain issues moderate, well keep revisiting this issue, and we want to get pricing back to where it was as fast as we can.
In addition to the unfortunate price hike, they also say that they currently predict a sound capacity of supply to be able to support existing Raspberry Pi 4 customers along with users migrating from Raspberry Pi 3B+ as well:
> The good news is that weve been able to hold the line on pricing for all but one of our products; that we expect to have enough 28nm silicon over the next twelve months to support both our existing Raspberry Pi 4 and Compute Module 4 customers, and customers migrating from Raspberry Pi 3B+; and that we see early signs that the supply chain situation is starting to ease.
Given that they are essentially going back to their old pricing, I think that the business users and tinkerers do not have a lot to worry about.
_What do you think about its price hike? Feel free to enter the comments section below to share your thoughts._
#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
I'm not interested
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/raspberry-pi-price-hike/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://www.raspberrypi.com/news/supply-chain-shortages-and-our-first-ever-price-increase/

View File

@ -1,71 +0,0 @@
[#]: subject: "Brave Browser Kicks Out Google as the Default Search Engine in Favor of its Own"
[#]: via: "https://news.itsfoss.com/brave-replaces-google/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Brave Browser Kicks Out Google as the Default Search Engine in Favor of its Own
======
Brave is one of the [best web browsers available for Linux][1]. The browser uses Google as the default search engine for most of the regions.
However, that is about to change with the recent announcement of Brave abandoning Google to favor its privacy-respecting search engine [Brave Search][2].
### Brave Search In, Google Out
Google pays a lot of good money when it comes to keeping its search engine as the default in many web browsers.
But, it seems that Brave plans to take on Googles search engine by utilizing its offering ([Brave Search][3]) to replace it as the default search engine.
Considering Brave Search is still in the beta phase, it is a bold move.
The change is only for new users and is limited to a few countries (United States, Canada, and the United Kingdom).
Brave Search also replaces Qwant and DuckDuckGo in France and Germany, respectively.
Shortly, this change will be happening for more regions as well.
If you already use Brave, your default search engine will not be changed automatically. Also, if you do not belong to one of the regions mentioned above, you need to change the default search engine to Brave Search, if you prefer it over Google.
### Improving Brave Search in the Process
With the new default selection, Brave Search should have the potential to receive more feedback on its search result index and quality.
Hence, Brave has also launched the [Web Discovery Project][4] along with this change to let users opt-in to contribute anonymous data to help improve the search results.
As of now, Brave Search does not include any advertisements. But, it will be adding advertisements soon and introducing a premium option to opt for an ad-free experience.
### Closing Thoughts
Brave Search is a promising alternative to Googles search engine. Of course, it is not easy to offer a good search experience as good as Google, but it is refreshing to see shifting focus to other search engines.
The brave web browser has a significant userbase among the chromium-based solutions. So, this change should let new users experience a different search engine promoting more healthy competition.
What do you think about this? Let me know your thoughts.
#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
I'm not interested
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/brave-replaces-google/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/best-browsers-ubuntu-linux/
[2]: https://itsfoss.com/brave-search-features/
[3]: https://search.brave.com/
[4]: https://brave.com/privacy/browser/#web-discovery-project

View File

@ -0,0 +1,65 @@
[#]: subject: "Google to Pay up to $50,337 for Exploiting Linux Kernel Bugs"
[#]: via: "https://news.itsfoss.com/google-linux-kernel-bounty/"
[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Google to Pay up to $50,337 for Exploiting Linux Kernel Bugs
======
Google makes good use of Linux across its platforms, especially when it comes to Android and its massive servers. Over the years, Google has been inclining more towards open-source projects and programs.
Recently, the tech giant sponsored $1 million to fund a security-focused open-source program run by The Linux Foundation, more details in our [original coverage.][1]
And, now, Google just tripled its bounty rewards for the next three months for security researchers working on finding kernel exploits that help achieve privilege escalation (i.e., when an attacker gains administrator access using a bug/flaw)
Its no surprise that there will always be some form of bugs and flaws that plague the security and development of the kernel. Fortunately, hundreds of security researchers from various organizations and individuals-alike work to improve its state of security, which is why the vulnerabilities are not necessarily exploited in the wild.
Even though Google has a good track record of rewarding security researchers, it stepped up the game for the next three months by announcing a base reward of **$30,377 to $50,377** as the upper limit.
### Program Details and Rewards
The exploits can be responding to currently patched vulnerabilities, new unpatched vulnerabilities, and new techniques.
The base reward of **$31,337** holds for exploiting publicly patched vulnerabilities that exploit privilege escalation. If it identifies unpatched vulnerabilities or new exploit techniques, the reward can go up to **$50,337**.
Moreover, this program also goes along with the Android VRP and Patch Reward programs. This means if the exploit works on Android, you can be eligible for rewards up to 250,000 USD in addition to this program.
You can read more about this on their [official portal][2] if you are curious about Android.
The hike in reward will be open for the next three months, that is, until January 31, 2022.
Security researchers can go through their [official blog post][3] to set up the lab environment and read more about the requirements on their [official GitHub webpage.][4]
### Wrapping Up
This program is an excellent initiative by Google. It is undoubtedly going to attract and benefit many security professionals and researchers alike.
Not to forget, the state of security for Linux Kernel should get the ultimate benefit.
#### 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/google-linux-kernel-bounty/
作者:[Rishabh Moharir][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/rishabh/
[b]: https://github.com/lujun9972
[1]: https://news.itsfoss.com/google-sos-sponsor/
[2]: https://bughunters.google.com/about/rules/6171833274204160
[3]: https://security.googleblog.com/2021/11/trick-treat-paying-leets-and-sweets-for.html
[4]: https://google.github.io/kctf/vrp

View File

@ -0,0 +1,83 @@
[#]: subject: "After Moving From FreeBSD to Void Linux, Project Trident Finally Discontinues"
[#]: via: "https://news.itsfoss.com/project-trident-discontinues/"
[#]: author: "John Paul https://news.itsfoss.com/author/john/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
After Moving From FreeBSD to Void Linux, Project Trident Finally Discontinues
======
Sadly, the [Project Trident][1] team announced that they will be ending development of their Linux distro.
### Story Time!!!
For those of you who have not heard of Project Trident, let me give you a little ride down memory lane. Back in 2005, Kris Moore introduced [PC-BSD][2] as an easy way to set up FreeBSD with a desktop interface. It was acquired the following year by [iXsystems][3]. In September of 2016, the name of the project was changed to TrueOS. The project also became a rolling release based on the Current branch of FreeBSD. Two years later, TrueOS [announced][4] that they would be doing away with the desktop version of their operating system and focusing on the enterprise and server market. The desktop elements [were spun off][5] to a new project: Project Trident.
For a time, the dev team at Project Trident tried their best to create a good desktop experience on top of FreeBSD. However, due to [issues with FreeBSD][6] including “hardware compatibility, communications standards, or package availability continue to limit Project Trident users” they decide to base it on something else. Their solution was to rebase their project on [Void Linux][7] in 2019. For a while, it looked like the future of Project Trident was set. Then 2020 happened.
![Project Trident desktop][8]
### The End of a Project
On October 29th, the Project Trident team posted the following [announcement][9]:
> It is with great sadness that we are announcing that Project Trident will be entering is “sunset” period starting Nov 1 of 2021 and will be closing up shop in March of 2022. The core team of the project has come to this decision together. With changes and events over the past two years in life, jobs, family, etc; our individual priorities have changed as well.
>
> We will keep the Project Trident package repository and websites up and running until the EOL date of March 1, 2022, but we strongly encourage users to begin looking for alternative desktop OS solutions over the coming new year holiday.
>
> Thank you all for your support and encouragement! The project had a good run and we thoroughly enjoyed getting to know many of you over the years.
### The Lumina Project Continues
One constant throughout the PC-BSD/TrueOS/Project Trident saga is the desktop environment in use. In 2012, [Ken Moore][10] (Kris younger brother) started working on a Qt-based desktop environment named [Lumina][11]. In 2014, it became the default desktop environment of PC-BSD and has stayed that way down to Project Trident. Lumina stands apart from other desktop environment because it was designed to be operating system agnostic. Other desktop environments like KDE and GNOME have Linux specific code that makes it hard to port to BSD.
![Lumina desktop environment][8]
June of this year, Ken [handed the reigns of Lumina][12] to a fellow Project Trident developer [JT Pennington][13] (also of [BSDNow][14] fame).
The [announcement][12] states:
> After more than 7 years of work, I have decided that it is time to let others take over the development of the Lumina Desktop project going forward. It has been an incredible task which has pushed me into areas of development that I had never previously considered. However, with work and life changes, my time for developing new functionality for Lumina has become nearly non-existent, particularly for the Qt5 -&gt; Qt6 change that will be coming within the next year or so. By passing the torch over to JT (q5sys on GitHub), I am hoping that the project might receive more timely updates, for the benefit of everyone.
>
> Thank you all, and I hope for the continued success of the Lumina Desktop project!!
### Final Thoughts
I always had high hopes for Project Trident. They were small compared to many of the distros that we cover. They werent just a reskin of Arch or Ubuntu with one or two new tools. Not only that, but they were working to improve a distro (Void) that shared their ideals. However, life happens, even to the best of us. I wish Ken, JT and the others well as they sunset a project that they have spent many hours working on. Hopefully, well be seeing more from them in the future.
#### 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/project-trident-discontinues/
作者:[John Paul][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/john/
[b]: https://github.com/lujun9972
[1]: https://project-trident.org/
[2]: https://en.wikipedia.org/wiki/TrueOS
[3]: http://ixsystems.com/
[4]: https://itsfoss.com/trueos-plan-change/
[5]: https://itsfoss.com/project-trident-interview/
[6]: https://project-trident.org/post/os_migration/
[7]: https://voidlinux.org/
[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[9]: https://project-trident.org/post/2021-10-29_sunset/
[10]: https://github.com/beanpole135
[11]: https://lumina-desktop.org/
[12]: https://lumina-desktop.org/post/2021-06-23/
[13]: https://github.com/q5sys
[14]: https://www.bsdnow.tv/

View File

@ -0,0 +1,56 @@
[#]: subject: "4 tips to becoming a technical writer with open source contributions"
[#]: via: "https://opensource.com/article/21/11/technical-writing-open-source"
[#]: author: "Ashley Hardin https://opensource.com/users/ashleyhardin"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
4 tips to becoming a technical writer with open source contributions
======
Your open source contributions show potential employers that you take
the initiative and seek opportunities to learn, grow, and challenge
yourself.
![A person writing.][1]
Whether youre a tech hobbyist interested in dabbling in technical writing or an established technologist looking to pivot your career to become a professional technical writer, you can build your technical writing portfolio with open source contributions. Writing for open source projects is fun, flexible, and low risk. Contribute to a project of interest to you on your own schedule, and you might be surprised at how welcoming the community can be or how fast you can make an impact.
Your open source contributions show potential employers that you take the initiative and seek opportunities to learn, grow, and challenge yourself. As with anything, you have to start somewhere. Contributing to open source projects allows you to showcase your talents while also learning new skills and technologies. In addition, writing for open source projects enables you to connect with new communities, collaborate with new people across time zones, and build your network. When you dig into open source opportunities, you enhance your resume and set yourself apart from other candidates. Here are four ways to get started with contributing to open source that can lead to a career in technical writing. 
### Learn the tools of the trade
To get started, I recommend becoming familiar with [Git][2], setting up [GitLab][3] and [GitHub][4] accounts, and finding a text editor that you like. Personally, I love working with the open source tool [Atom][5]. When it comes to Git, there is a wealth of free learning resources available online, including some excellent interactive tutorials. You dont need to be a Git master to dive into open source. I recommend learning the basics first and letting your skills develop as you contribute more.
### Find a project
The hardest part of contributing to open source can be finding a project to contribute to. You can check out [Up For Grabs][6] and search for projects that interest you. [First Timers Only][7] has more resources on getting started. Dont hesitate to contact project maintainers to learn more about the project and where they need help. Be persistent. It can take some time to find a project thats right for you.
### Say goodbye to imposter syndrome
A common misconception is that you need to be a programmer to contribute to open source projects. As a self-taught contributor with no engineering or computer science credentials, I can assure you that is not the case. Documentation is often the most valuable but most neglected part of development projects. These projects often lack the people and resources needed to create complete, quality documentation. This presents a great opportunity for you to get involved by submitting pull requests or by filing issues against the project. You can do it!
### Start small
Check the repository for the project that you are interested in for possible contribution guidelines to follow. Next, look for opportunities to update README files or to submit typo fixes. No contribution is too small. The project maintainers will likely be happy for the help, and youll be glad to get your first pull requests submitted as you build your technical writing portfolio.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/11/technical-writing-open-source
作者:[Ashley Hardin][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/ashleyhardin
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003784_02_os.comcareers_resume_rh1x.png?itok=S3HGxi6E (A person writing.)
[2]: https://git-scm.com/
[3]: https://about.gitlab.com/
[4]: https://github.com/
[5]: https://atom.io/
[6]: https://up-for-grabs.net/#/
[7]: https://www.firsttimersonly.com/

View File

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

View File

@ -2,7 +2,7 @@
[#]: via: (https://opensource.com/article/21/6/freedos-environment-variables)
[#]: author: (Jim Hall https://opensource.com/users/jim-hall)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (robsean)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -2,7 +2,7 @@
[#]: via: (https://opensource.com/article/21/6/freedos-embedded-system)
[#]: author: (Jim Hall https://opensource.com/users/jim-hall)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (robsean)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -1,99 +0,0 @@
[#]: 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: "robsean"
[#]: 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, thats 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/

View File

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

View File

@ -1,157 +0,0 @@
[#]: subject: "How to Set JAVA_HOME Variable in Ubuntu Linux Correctly"
[#]: via: "https://itsfoss.com/set-java-home-ubuntu/"
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
[#]: collector: "lujun9972"
[#]: translator: "robsean"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Set JAVA_HOME Variable in Ubuntu Linux Correctly
======
If you are [running Java programs on Ubuntu][1] using Eclipse, [Maven][2] or Netbeans etc, youll need to set JAVA_HOME to your path. Otherwise, your system will complain that “java_home environment variable is not set”.
In this beginners tutorial, Ill show the steps to correctly set Java Home variable on Ubuntu. The steps should be valid for most other Linux distributions as well.
The process consists of these steps:
* Making sure Java Development Kit (JDK) is installed.
* Finding the correct location of JDK executable.
* Setting the JAVA_HOME variable and making the change permanent.
### Step 1: Check if JDK is installed
The simplest way to check if Java Development Kit (JDK) is installed on your Linux system is by running this command:
```
javac --version
```
The above command checks the version of Java compiler. If it is installed, it will show the Java version.
![Java Compiler is installed][3]
If the command shows an error like javac command not found, youll have to install JDK.
![Java Compiler is not installed][4]
If Java Compiler is not installed on your system, install Java Development Kit using this command:
```
sudo apt install default-jdk
```
This will install the default Java version in your current Ubuntu version. If you need some other specific Java version, youll have to specify it while [installing Java on Ubuntu][5].
Once you have made sure that Java Compiler is present on your system, its time to find its location.
### Step 2: Get the location of JDK executable (Java Compiler)
The executable is usually located in the /usr/lib/jvm directory. I wont left you on your own for a guessing game. Instead, lets find out the path of the Java executable.
[Use the which command][6] to get the location of Java Compiler executable:
```
which javac
```
The problem here is that the location it gives is actually a [symbolic link][7]. Youll have to follow it a couple of times:
![][8]
An easier method is to follow the symbolic link and get to the actual executable file directly using this command:
```
readlink -f `which java`
```
The readlink command follows a symbolic link. I have used ` around _which java_. This is called command substitution and it replaces the command with its output. So basically, the above command is equivalent to _readlink -f /usr/bin/java_ in this case.
In my example, the location of the executable file is **/usr/lib/jvm/java-11-openjdk-amd64/bin/java**. It could be different for you. Copy the correct path you got from the above command in your system. You know, you can [copy paste in the Ubuntu terminal][9].
### Step 3: Setting JAVA_HOME variable
Now that you have got the location, use it to set the JAVA_HOME environment variable:
```
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/bin/java
```
Check the value of JAVA_HOME directory:
```
echo $JAVA_HOME
```
![][10]
Try to run your program or project in the SAME TERMINAL and see if it works.
This is not over yet. The JAVA_HOME variable you just declared is temporary. If you close the terminal or start a new session, it will be empty again.
To set JAVA_HOME variable permanently, you should add it to the bashrc file in your home directory.
You can [use the Nano editor for editing files in the Linux terminal][11]. If you do not want that and take a simple copy-paste approach, use the following commands:
Back up your bashrc file (in case you mess it, you can get it back):
```
cp ~/.bashrc ~/.bashrc.bak
```
Next, [use the echo command to append][12] the export command you used at the beginning of this section. _**Change the command below to use the correct path as displayed by your system in**_.
```
echo "export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/bin/java" >> ~/.bashrc
```
Verify that it has been correctly added to the end of the file:
```
tail -3 ~/.bashrc
```
The above [tail command][13] will show the last 3 lines of the specified file.
Heres the entire output of the above three commands.
![][14]
Now, even if you exit the session or restart the system, the JAVA_HOME variable will still be set to the value you specified. Thats what you want, right?
Do note that if you change the default Java version in the future, youll have to change the value of JAVA_HOME and point it to the correct executable path.
I hope this tutorial not only helped you to set Java Home, it also taught you how you are doing it.
If you are still facing issues or have any questions or suggestions, please let me know in the comments.
--------------------------------------------------------------------------------
via: https://itsfoss.com/set-java-home-ubuntu/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/run-java-program-ubuntu/
[2]: https://maven.apache.org/
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/check-java-compiler-ubuntu.png?resize=750%2C310&ssl=1
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/java-compiler-check-ubuntu.png?resize=732%2C300&ssl=1
[5]: https://itsfoss.com/install-java-ubuntu/
[6]: https://linuxhandbook.com/which-command/
[7]: https://linuxhandbook.com/symbolic-link-linux/
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/get-java-home-path-ubuntu.png?resize=800%2C283&ssl=1
[9]: https://itsfoss.com/copy-paste-linux-terminal/
[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/setting-java-home-ubuntu.png?resize=800%2C268&ssl=1
[11]: https://itsfoss.com/nano-editor-guide/
[12]: https://linuxhandbook.com/echo-command/
[13]: https://linuxhandbook.com/tail-command/
[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/set-java-home-bashrc-ubuntu.png?resize=786%2C348&ssl=1

View File

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

View File

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

View File

@ -19,7 +19,7 @@ For years, people left security at the end—until their deployment was about to
Understanding Kubernetes NetworkPolicy can be daunting for people just starting to learn the ins and outs of Kubernetes implementation. But this is one of the fundamental requirements that you must learn before deploying an application to your Kubernetes cluster. When learning Kubernetes and cloud-native application patterns, make your slogan "Don't leave security behind!"
## The NetworkPolicy concept
### The NetworkPolicy concept
[NetworkPolicy][2] replaces firewall appliances in the data center context that you know—as pods to compute instances, network plugins to router and switches, and volumes to storage area network (SAN).
@ -35,34 +35,43 @@ There a different network plugins [listed on Kubernetes.io][4]:
## Applying a network policy
### Applying a network policy
To apply a network policy, you need a working Kubernetes cluster with a network plugin that supports NetworkPolicy.
But first, you need to understand how to use NetworkPolicy in the context of Kubernetes. The Kubernetes NetworkPolicy allows [pods][3] to receive traffic from anywhere. This is not ideal. To secure the pods, you must understand the endpoints pods can communicate within the Kubernetes construct.
1. Pod-to-pod communication using `podSelector`. [code] - namespaceSelector:
1. Pod-to-pod communication using `podSelector`.
```
- namespaceSelector:
    matchLabels:
      project: myproject
```
2. Namespace-to-namespace communication and namespace-to-pod communication using `namespaceSelector` and/or a combination of `podSelector` and `namespaceSelector`. [code] - namespaceSelector:
2. Namespace-to-namespace communication and namespace-to-pod communication using `namespaceSelector` and/or a combination of `podSelector` and `namespaceSelector`.
```
- namespaceSelector:
    matchLabels:
      project: myproject
\- podSelector:
    matchLabels:
      role: frontend
      role: frontend
```
3. IP blocks communication for pods using `ipBlock` to define which `IP CIDR` blocks dictate the source and destination. [code] - ipBlock:
3. IP blocks communication for pods using `ipBlock` to define which `IP CIDR` blocks dictate the source and destination.
```
- ipBlock:
        cidr: 172.17.0.0/16
        except:
        - 172.17.1.0/24
```
Note the difference between pod, namespace, and IP-based policy. For pod and namespace-based NetworkPolicy, you use `selector` to control traffic, while for IP-based NetworkPolicy, controls get defined using `IP blocks` (CIDR ranges).
Putting it together, a NetworkPolicy should look like the following:
```
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
@ -83,4 +92,123 @@ spec:
        - 192.168.1.0/24
    - namespaceSelector:
        matchLabels:
          projec
          project: myproject
    - podSelector:
        matchLabels:
          role: frontend
    ports:
    - protocol: TCP
      port: 6379
  egress:
  - to:
    - ipBlock:
        cidr: 10.0.0.0/24
    ports:
    - protocol: TCP
      port: 5978
```
Referencing the NetworkPolicy above, notice the `spec` section. Under this section, `podSelector` with label _app=backend_ is the target of our NetworkPolicy. In short, the NetworkPolicy protects the application called _backend_ inside a given namespace.
This section also has `policyTypes` definition. This field indicates whether or not the given policy applies to ingress traffic to the selected pod, egress traffic from selected pods, or both.
```
spec:
  podSelector:
    matchLabels:
      app: backend
  policyTypes:
  - Ingress
  - Egress
```
Now, look at the `ingress` and `egress` section. This definition dictates the control of the NetworkPolicy.
First, examine the `ingress from` section.
The NetworkPolicy in this instance allows pod connection from:
* `ipBlock`
* Allow 172.17.0.0/16
* Deny192.168.1.0/24
* `namespaceSelector`
* `myproject`: Allow all pods from this namespace and with the same labels _project=myproject_.
* `podSelector`
* `frontend`: Allow pods that match the label _role=frontend_
```
ingress:
\- from:
  - ipBlock:
      cidr: 172.17.0.0/16
      except:
      - 192.168.1.0/24
  - namespaceSelector:
      matchLabels:
        project: myproject
  - podSelector:
      matchLabels:
        role: frontend
```
Now, examine the `egress to` section. This dictates the connection from the pod to:
* `ipBlock`
* 10.0.0.0/24: Connection to this CIDR is allowed
* Ports: Allowed to connect using TCP and port 5978
```
egress:
\- to:
  - ipBlock:
      cidr: 10.0.0.0/24
  ports:
  - protocol: TCP
    port: 5978
```
## NetworkPolicy limitations
NetworkPolicy alone cannot totally secure your Kubernetes clusters. You can use either the operating system components or Layer 7 technologies to overcome the known limitations. You need to remember that NetworkPolicy can only address security for IP address and port level—Open Systems Interconnection (OSI) layer 3 or 4.
To address security requirements that NetworkPolicy can't handle, you need to use other security solutions. Here are some [use cases][7] that you need to know where NetworkPolicy needs augmentation by other technologies.
## Summary
Understanding Kubernetes NetworkPolicy is important because it's a way to fulfill (but not replace) the firewall role that you usually use in a datacenter setup, but for Kubernetes. Think of this as the first layer of your container security, knowing that NetworkPolicy alone is not a total security solution.
NetworkPolicy applies security on pod and namespace using selectors and labels. In addition, NetworkPolicy can also enforce security through IP ranges.
Having a sound understanding of NetworkPolicy is an important skill towards secure adoption of containerization in the Kubernetes context.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/10/kubernetes-networkpolicy
作者:[Mike Calizo][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/mcalizo
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/containers_modules_networking_hardware_parts.png?itok=rPpVj92- (Parts, modules, containers for software)
[2]: https://kubernetes.io/docs/concepts/services-networking/network-policies/
[3]: https://kubernetes.io/docs/concepts/workloads/pods/
[4]: https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/
[5]: https://github.com/containernetworking/cni
[6]: https://github.com/containernetworking/cni/blob/spec-v0.4.0/SPEC.md
[7]: https://kubernetes.io/docs/concepts/services-networking/network-policies/#what-you-can-t-do-with-network-policies-at-least-not-yet

View File

@ -1,105 +0,0 @@
[#]: subject: "Ferdi: A Free & Open-Source Alternative to Franz & Rambox"
[#]: via: "https://itsfoss.com/ferdi/"
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Ferdi: A Free & Open-Source Alternative to Franz & Rambox
======
_**Brief:**_ _Ferdi is a promising open-source application with more free features as an alternative to Franz and Rambox. Let us explore more about it._
A single application to help you manage multiple services comes in handy when you do not want to do everything on your browser. While technically, you can, it may not be the most organized way of doing things.
Hence, options like [Rambox][1] and [Franz][2] are pretty popular cross-platform solutions to sign in to several services and access all of them at a glance.
Even though they both are available for Linux (and weve covered them separately), they offer limited features for free.
In contrast, Ferdi is a fork of Franz offering many premium functionalities for free while aiming to provide a better experience.
### Ferdi: Dabble With Multiple Applications in One Place
![][3]
Ferdi is a free and open-source application that lets you add multiple applications, including various messaging services, in one place.
It also lets you customize various aspects of the application and its behavior. If you like applications like Rambox and Franz, you should explore more about Ferdi.
### Features of Ferdi
![][4]
You can find tons of features available without needing to pay a premium. Here, I shall highlight some key features:
* Cross-platform support (Linux, Windows, and macOS)
* Wide range of messaging services included (Slack, WhatsApp, Element, etc.)
* Supports signing in with Franz account
* Ability to password-protect messages
* Option to use your custom server
* Quick to-do list access with the option to use Franz Todo, Todoist, Microsoft To Do, Any.do, and more.
* Tweak performance by unloading applications when not in use (Hibernation)
* Private notification to hide your messages
* Do not disturb mode support
* Dark mode with the option to toggle every app added separately
* Cloud sync
* No restrictions on the number of accounts
* Ability to set up a proxy and connect through it
* Add multiple workspaces
### Thoughts on Using Ferdi
![][5]
Just like Rambox and Franz, Ferdi wont shy away from consuming a good chunk of your resources. So, you need to keep in mind whether you have enough memory (RAM) to have several applications active within Ferdi.
It is good to have the option to unload applications when not in use. So, in case you are low on resources, you might want to utilize the Hibernation option.
![][6]
Ferdi also offers some advanced options like GPU acceleration, universal dark mode, privacy toggles, appearance customization, and more. You can even add custom services that you do not find listed.
![][7]
Overall, you get many features and choices when it comes to Ferdi. You should be able to organize multiple applications efficiently with the available set of options.
### Installing Ferdi in Linux
Ferdi offers multiple packages for easy installation on Linux. You can find a DEB/RPM package for Ubuntu/Fedora, an [AppImage file][8] for all other Linux distributions.
They also provide a snap package along with the ability to install it via [AUR][9]. So, you have plenty of options to get it installed on your Linux computer.
You can explore their [GitHub page][10] and head to its releases section to download them or visit the official site.
[Download Ferdi][11]
Have you tried Ferdi yet? Does it serve the purpose of replacing Franz or Rambox? Is it better? Share your experience in the comments down below.
--------------------------------------------------------------------------------
via: https://itsfoss.com/ferdi/
作者:[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/rambox/
[2]: https://itsfoss.com/franz-messaging-app/
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/ferdi-screenshot.png?resize=800%2C621&ssl=1
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/ferdi-screenshot-1.png?resize=800%2C584&ssl=1
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/ferdi-custom-services.png?resize=800%2C586&ssl=1
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/ferdi-workspaces.png?resize=800%2C627&ssl=1
[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/ferdi-advanced-options.png?resize=800%2C541&ssl=1
[8]: https://itsfoss.com/appimage-interview/
[9]: https://itsfoss.com/aur-arch-linux/
[10]: https://github.com/getferdi/ferdi
[11]: https://getferdi.com/

View File

@ -1,116 +0,0 @@
[#]: subject: "A simple CSS trick for dark mode"
[#]: via: "https://opensource.com/article/21/10/dark-themes-websites"
[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
A simple CSS trick for dark mode
======
The ability to let your website adjust to the user's theme of choice is
a great accessibility feature.
![Text editor on a browser, in blue][1]
You're likely already familiar with media queries. They're in widespread use for making websites responsive. The `width` and `height` properties contain the viewport's dimensions. You then use CSS to render different layouts at different dimensions.
The [prefers-color-scheme media query][2] works the same way. The user can configure their operating system to use a light or dark theme. `Prefers-color-scheme` contains that value. The value is either `light` or `dark`, though the W3C spec states that it might support future values like `sepia`. I specify different values of CSS variables for both modes and let the user's OS decide.
### The prefers-color-scheme media queries
The two variations of the `prefers-color-scheme` media query are:
```
/* Light mode */
@media (prefers-color-scheme: light) {
   :root {
       --body-bg: #FFFFFF;
       --body-color: #000000;
   }
}
/* Dark mode */
@media (prefers-color-scheme: dark) {
   :root {
       --body-bg: #000000;
       --body-color: #FFFFFF;
   }
}
```
In the above CSS, `--body-bg` and `--body-color` are [CSS variables][3]. As you can see, they contain different values for both modes. In the light theme, I'm setting a white background with black text. In the dark theme, I'm setting black background with white text.
Since the [spec][2] says that W3C might introduce future values, it makes sense to convert this CSS into a boolean.
```
/* Light mode */
:root {
   --body-bg: #FFFFFF;
   --body-color: #000000;
}
/* Dark mode */
@media (prefers-color-scheme: dark) {
   :root {
       --body-bg: #000000;
       --body-color: #FFFFFF;
   }
}
```
In the above code, I'm defining a light theme by default and converting it to the dark theme if the media query is `dark`. This way, any future values added to the media query will set the light theme by default.
### Using the CSS variables
Now that I have different values for different themes, I need to actually use them to style the page.
```
body {
   background: var(--body-bg);
   color: var(--body-color);
}
```
The [var() syntax][3] is how CSS uses variables. In the above code, I'm saying set the `background` to the value of `--body-bg` and set the `color` to the value of `--body-color`. Note that the values of these variables are coming from the media query. Meaning that the background and foreground color changes based on the OS's setting! 
This is the real power of the media query: Providing a consistent user experience from OS to the web page.
If you go to [findmymastodon.com][4] and switch your OS's theme, you'll see the transition from one theme to the other.
The [CSS Working Group][2] website also uses the same media queries. Change your OS theme, and the website switches themes to adjust.
### Conclusion
Notice that using `prefers-color-scheme` is no different from using a regular programming language. I define variables whose values change based on some logic. And those variables are then used for further operations.
The ability to let your website adjust to the user's theme of choice is a great accessibility feature. And it further blurs the line between desktop and web for the benefit of the user. The latest browser versions [support prefers-color-scheme][5], so you can begin experimenting today.
Happy coding.
* * *
_This article originally appeared on the [author's website][6] and is republished with permission._
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/10/dark-themes-websites
作者:[Ayush Sharma][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/ayushsharma
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_blue_text_editor_web.png?itok=lcf-m6N7 (Text editor on a browser, in blue)
[2]: https://drafts.csswg.org/mediaqueries-5/#prefers-color-scheme
[3]: https://www.w3.org/TR/css-variables-1/
[4]: https://findmymastodon.com/
[5]: https://caniuse.com/prefers-color-scheme
[6]: https://ayushsharma.in/2021/10/creating-light-and-dark-themes-for-websites-correctly-using-prefers-color-scheme

View File

@ -1,145 +0,0 @@
[#]: subject: "Only 4 MB? How to Fix USB Destroyed by Etcher and Rufus After Creating Live Linux USB"
[#]: via: "https://itsfoss.com/format-live-linux-usb/"
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Only 4 MB? How to Fix USB Destroyed by Etcher and Rufus After Creating Live Linux USB
======
Heres the scenario. You used Etcher or Rufus tools to create a bootable, live Linux USB in Windows or perhaps in Linux.
You used it to install Linux and the purpose of the USB is accomplished. Now you want to format this USB and use it for the regular data transfer or storage.
You plug it in your Windows system and to your surprise, the disk capacity of the USB is just 4 MB.
![][1]
You try to format it and it probably wont let you do that. Even if you manage to format it, the size of the USB is now shrunk to just 4 MB from the usual 8 GB, 16 GB or 32 GB.
Have you lost your USB? Not really. Your USB is not completely destroyed. You can still format it with a little trick and use it comfortably.
Let me show how to restore the bootable USB to a usable state in both Windows and Linux.
### Formatting the live Linux USB created by Rufus or Etcher [In Windows]
You see only 4 MB of disk space in Windows. Do you know why? Because while creating the live Linux USB, the tool creates a 4 MB of EFI partition in FAT 32 filesystem. The other partition(s) is in Linuxs Ext4 filesystem which is not recognized by Windows.
This is why your Windows system only sees the EFI partition of 4 MB and shows the USB size as 4 MB.
![Windows only see the EFI partition on the USB][2]
All in all, what you need to do is to delete all the partition on the USB disk, create a new NTFS or FAT32 partition from the free space you got from deleting the existing partitions. Thats it.
Let me show the steps in detail.
#### Step 1:
Go to the Windows menu and look for the Disk Management tool.
![Start disk management tool][3]
Start this tool and it will show all the disks present on your computer. This includes the plugged-in USB, of course.
_**This is very important to select the correct disk**_. Identify which one it is from the size of the USB disk or from the Removable tag.
![][4]
#### Step 2:
The idea is to delete any existing partition present on the USB disk. The unallocated space cannot be deleted but thats okay.
Right click on the partition and click **Delete Volume**.
![Delete partitions on the USB disk][5]
When asked for your confirmation, press Yes.
![Confirm deletion of partition][6]
Your aim is to have only a single block of unallocated space. When you see that, right click on it and click on “New Simple Volume” to create a partition.
![Create New Simple Volume \(partition\)][7]
The next steps are simple. Click on Next, select the entire available space, assign a letter to it, select the file system (FAT 32 or NTFS) and format it.
![Click Next][8]
![Use entire available space][9]
![Give it a drive letter][10]
![Use FAT 32 or NTFS, Name the USB if you want][11]
![Revise all the changes][12]
Once that is done, youll see that the USB has returned to normal state and you can start copy-pasting data to it.
![USB is back to normal state][13]
You can use your USB as before now.
These steps were for Windows. What if you use Linux?
### Formatting live Linux USB on Linux
I have noticed that live USB created by Etcher and such tools often create refuse to be formatted properly by the right click format option in the file manager.
As an alternative, you can do what you did in Windows: delete existing partitions and create a new partition with the entire free space.
Use the GNOME Disks tool here. It is already installed on Ubuntu and many other Linux distributions.
![Start disk app][14]
_**Again, make sure that you have selected the external USB disk here.**_
Youll see various partitions on the USB disk. Try and format the disk from the menu above.
![Format disk][15]
**If that does not work, delete the partitions individually** one by one and then make the entire USB as free space.
When you have the entire free space created, click on the + sign to create a partition on it in NTFS or FAT32 filesystem.
![][16]
Create the partition with NTFS (or FAT 32), name it something appropriate and then you can enjoy the USB like it was before.
### Conclusion
Tools like Rufus and Etcher dont really destroy your USB. This is how they function, by creating a different filesystem on the disk. But then the operating system doesnt understand it properly.
The good thing is that it can be fixed with only a little effort. I hope you too were able to fix it. If not, share your issue with me and Ill try to help.
--------------------------------------------------------------------------------
via: https://itsfoss.com/format-live-linux-usb/
作者:[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://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/usb-drive-4mb-space-only.webp?resize=800%2C324&ssl=1
[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/mystery-behind-4-mb-linux-live-usb.webp?resize=800%2C400&ssl=1
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/start-disk-management-tool-windows.webp?resize=800%2C694&ssl=1
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/identify-usb-disk-in-windows.webp?resize=800%2C509&ssl=1
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/delete-partitions-on-usb-disk.webp?resize=800%2C464&ssl=1
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/confirm-deletion-of-partition.webp?resize=800%2C357&ssl=1
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/Create-New-Partition.webp?resize=800%2C471&ssl=1
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/creating-new-simple-volume-1.png?resize=731%2C590&ssl=1
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/creating-new-simple-volume-2.png?resize=735%2C589&ssl=1
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/creating-new-simple-volume-3.png?resize=732%2C590&ssl=1
[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/creating-new-simple-volume-4.png?resize=669%2C527&ssl=1
[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/creating-new-simple-volume-5.png?resize=670%2C524&ssl=1
[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/live-Linux-USB-formatted-successfully.webp?resize=800%2C571&ssl=1
[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/start-disk-app.webp?resize=791%2C256&ssl=1
[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/format-usb-in-disks-tool.webp?resize=800%2C434&ssl=1
[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/create-partition-on-usb.webp?resize=800%2C418&ssl=1

View File

@ -0,0 +1,79 @@
[#]: subject: "Use the Linux cowsay command for a colorful holiday greeting"
[#]: via: "https://opensource.com/article/21/11/linux-cowsay"
[#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Use the Linux cowsay command for a colorful holiday greeting
======
Celebrate the Day of the Dead using this fun Linux command-line tool.
![Pumpkins painted for Day of the Dead][1]
You may have heard of a small program that takes input, such as a message that you type, and outputs a picture of a cow quoting your message. It is called **cowsay**. It has been written about before here on [Opensource.com][2].
So, to have a little fun with it, I thought I'd use it to celebrate Día de los Muertos (Day of the Dead).
In addition to a cow, there are other images available. When you install `cowsay` it includes several other images, which the install stores in `/user/share/cowsay`. You can use the `-l` argument to get a list.
```
$ sudo dnf install cowsay
$ cowsay -l
```
There's actually quite a bit of development activity related to `cowsay` and similar programs. It is possible to create your own image files or download images others have made. For instance, [Charc0al's cowsay file converter][3] is located on GitHub. You can use this tool to convert your own pictures to the special ASCII format file required by `cowsay`. Depending on your Linux or FreeBSD terminal settings, you may have color support enabled. The `cowsay` utility can display color images, as well. Charc0al's converter provides many ready-to-go color files.
I chose to use the Beetlejuice file for my celebration. First, I saved the [beetlejuice.cow][4] file to `/usr/share/cowsay`. This directory is owned by root, so you may have to save the file to your home directory first and then copy it. I also needed to give all users read access.
```
$ sudo cp beetlejuice.cow /usr/share/cowsay
$ sudo chmod o+r /usr/share/cowsay/beetlejuice.cow
```
It is interesting to notice how the image is generated. The top sets various ASCII color control codes to variables. These variables are then used to draw the image in the traditional ASCII art style. The image is almost full-body and did not fit my terminal height without scrolling off the screen, so I edited the file and removed the last 15 lines to shorten it.
The image is also detected by the `cowsay` program and appears in the list.
```
$ cowsay -l
Cow files in /usr/share/cowsay:
beavis.zen beetlejuice blowfish bud-frogs bunny cheese cower default dragon
...
```
Now, simply run the program and specify the image using the `-f` option. Don't forget to provide a message.
```
`$ cowsay -f beetlejuice "Happy Day of the Dead!"`
```
![ASCII display of Beetlejuice via cowsay][5]
Beetlejuice says Happy Day of the Dead  (CC BY-SA 4.0)
The `cowsay` command is just another way to have some command-line fun with your Linux computer. Experiment with `cowsay` and ASCII art—get creative.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/11/linux-cowsay
作者:[Alan Formy-Duval][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/alanfdoss
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/drew-hays-unsplash.jpg?itok=uBrvJkTW (Pumpkins painted for Day of the Dead)
[2]: https://opensource.com/article/18/12/linux-toy-cowsay
[3]: https://charc0al.github.io/cowsay-files/converter/
[4]: https://raw.githubusercontent.com/charc0al/cowsay-files/master/cows/beetlejuice.cow
[5]: https://opensource.com/sites/default/files/cowsay_beetlejuice.png

View File

@ -0,0 +1,87 @@
[#]: subject: "4 ways to edit photos on the Linux command line"
[#]: via: "https://opensource.com/article/21/11/edit-photos-linux-command-line"
[#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
4 ways to edit photos on the Linux command line
======
Here are a few of my favorite ImageMagick tricks and how to use them
without a GUI.
![Montage of Alan as a Kid][1]
Linux is useful to photographers and graphic artists. It provides many tools for editing different types of image files and formats, including photographs. This roundup shows that you do not even need a graphical interface to work with your photos. Here are four ways that you can edit images at the command line.
### Apply effects to your images
A couple of years ago, Seth Kenlon wrote the article, [4 fun (and semi-useless) Linux toys][2] which included an introduction to the ImageMagick suite of editing tools. ImageMagick is even more relevant today in 2021.
This article taught us about Fred's ImageMagick scripts, which really are useful. Fred Weinhaus maintains over 200 scripts for applying all sorts of effects to your image files. Seth shows us an example of Fred's `vintage3` script that gives an image an old-time appearance.
### Create photo collages
This year, Jim Hall showed us how to create a collage from photos with his article, [Create a photo collage from the Linux command line][3].
Collages are used a lot in pamphlets and brochures. They are a fun way to display several images within a single picture. Effects can be applied to blend them further together. As a matter of fact, I used his article as a guide to create the collage of pictures above. That is me when I was a kid! Here is the command I used:
```
$ montage Screenshot-20211021114012.png \
Screenshot-20211021114220.png \
Screenshot-20211021114257.png \
Screenshot-20211021114530.png \
Screenshot-20211021114639.png \
Screenshot-20211021120156.png \
-tile 3x2 -background black \
screenshot-montage.png
```
### Resize images
Jim delivered another article, [Resize an image from the Linux terminal][4]. This tutorial demonstrates how to change the dimensions of an image file and save it as a new file using ImageMagick. For example, the collage that resulted from the montage command above did not have the required dimensions. Learning how to resize allowed me to adjust the width and height so that it could be included. This is the command I used to resize the lead image of this article:
```
`$ convert screenshot-montage.png -resize 520x292\! alanfd-kid-montage.png`
```
### Automate image processing
Recently, I decided to take a look at the ImageMagick suite for myself. This time, I combined its tools into a Bash script. The article is entitled [Automate image processing with this bash script][5]. This example is a simple script that automates the production of images for my articles. It is tailored to the requirements here on Opensource.com. I provided a Git repo link in the article if you would like to use the script. It is easily modified and extensible for anyone's needs.
### Wrap up
I hope you enjoy these articles and use Linux in your artistic endeavors. If you would like to check out more Linux image software, take a look at the Fedora [Design Suite][6] Spin. It is a complete operating system installation that includes many different open source multimedia production and publishing tools, such as:
* GIMP
* Inkscape
* Blender
* Darktable
* Krita
* Scribus
* and more...
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/11/edit-photos-linux-command-line
作者:[Alan Formy-Duval][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/alanfdoss
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/alanfd-kid-montage.png?itok=r1kgXpLc (Montage of Alan as a Kid)
[2]: https://opensource.com/life/16/6/fun-and-semi-useless-toys-linux
[3]: https://opensource.com/article/21/9/photo-montage-imagemagick
[4]: https://opensource.com/article/21/9/resize-image-linux
[5]: https://opensource.com/article/21/10/image-processing-bash-script
[6]: https://labs.fedoraproject.org/en/design-suite/

View File

@ -0,0 +1,157 @@
[#]: subject: "Flatpak Apps Look Out of Place? Heres How to Apply GTK Themes on Flatpak Applications"
[#]: via: "https://itsfoss.com/flatpak-app-apply-theme/"
[#]: author: "Community https://itsfoss.com/author/itsfoss/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Flatpak Apps Look Out of Place? Heres How to Apply GTK Themes on Flatpak Applications
======
One of the reasons why some users avoid installing Flatpak apps is that most [Flatpak][1] apps dont change their appearance as per the current system theme. This makes the applications look out of the place in your otherwise beautiful set up.
![Flatpak apps do not match system theme][2]
The official way to apply GTK themes to Flatpak apps is by [installing the desired theme as a flatpak][3]. However, there are only a few GTK themes that can be installed as Flatpak.
This means that if you found a [beautiful GTK theme][4], your Flatpak applications will still be using their default appearance. But wait! There is a workaround.
In this tutorial, I am going to introduce you a way to make flatpak apps aware of external GTK themes.
### Applying GTK themes to Flatpak applications (intermediate level)
Before we proceed, lets understand why flatpak apps have this behavior.
Flatpak apps run inside a container, so they dont have access to the host filesystem, network, or physical devices without explicitly setting the appropriate permission, and that is what we are going to do.
As I said earlier, this is a workaround, not a flawless solution. **Dont expect it to change the themes of Flatpak apps automatically when you change the system theme.** You can, however, change it for all Flatpak apps in one single command.
Lets see how to achieve that. Please note that this tutorial requires that you are a bit familiar with the Linux command line and you can find your way around the terminal.
#### Step 1: Give Flatpak apps access to GTK themes location
GTK themes are located in /usr/share/themes for all users, and in ~/.themes for a specific user.
To **give all flatpak packages permission** to access ~/.themes run the following command:
```
sudo flatpak override --filesystem=$HOME/.themes
```
Notice that you cant give access to /usr/share/themes because according to [flatpak documentaion they are black listed][5].
**Alternatively**, you can do this at per-application base as well. You need to specify the application ID for which you are going to change the theme.
```
sudo flatpak override org.gnome.Calculator --filesystem=$HOME/.themes
```
#### Step 2:Tell Flatpak apps which theme to use
Giving access to ~/.themes is not enough because this directory may contain multiple themes. To tell flatpak which GTK theme to use, first get the name of the desired theme and then apply the following command:
```
sudo flatpak override --env=GTK_THEME=my-theme
```
As you can see in the screenshot below, there is two themes available, Ant-Bloody and Orchis-dark. _**Copy and paste the exact theme name**_ in the above command:
![Set GTK themes for all Flatpak apps][6]
Alternatively, for individual application, run:
```
sudo flatpak override org.gnome.Calculator --env=GTK_THEME=my-theme
```
and replace my-theme with the folder name of the theme you want to apply (and it must be located in ~/.themes).
#### Step 3: Test the theme change by running a Flatpak app
If the application was already running, youll have to close and start it again. Youll see that the newly started application uses the theme that you had specified earlier.
Here is a screenshot of GNOME calculator and GNOME builder (Flatpak version) before the above steps:
![Flatpak applications with default Adwaita theme][7]
And after the above steps (With Canta GTK theme):![][8]![][8]
![Flatpak applications with Canta Dark theme][9]
Thats better, right? Now, I could leave you here but it would be appropriate to mention the steps for reverting the changes.
### Revert the changes
You can reset the changes by resetting all the overrides at once. Please note that this will reset any previous overrides you had explicitly set.
```
sudo flatpak override --reset
```
Alternatively, you can reset permissions at package level as well:
```
sudo flatpak override --reset org.example.app
```
If you have previously overridden the GTK_THEME or filesystem for a specific Flatpak package using “flatpak override” resetting will help you set it again.
### Additional information
Normal GTK applications load GTK theme specified by gsettings, you can run the following command to get currently applied GTK themes:
```
gsettings get org.gnome.desktop.interface gtk-theme
```
And to set the GTK theme, run:
```
gsettings set org.gnome.desktop.interface gtk-theme my-theme
```
To do the above with Flatpak, you have to enter a shell session inside the container of the desired application by running:
```
flatpak run --command=bash org.gnome.Calculator
```
And inside this session, run the above command:
```
gsettings set org.gnome.desktop.interface gtk-theme my-theme
```
But that did not work with me, so I resorted to use GTK_THEME environment variable, which is supposed to be used for debugging purpose. If you managed to make gsettings work, then tell me in the comments.
I know its not an automated solution but at least it gives you the option to change the themes for the Flatpak applications with a couple of commands. This way, you can make the Flatpak application integrate with the rest of the system.
I hope this helped you. If you face any issues, please mention them in the comments.
_**Author Info: This article has been contributed by Its FOSS reader Hamza Algohary and edited by Abhishek Prakash. Hamza is a computer engineering student and a Linux and open source enthusiast. He also develops apps for Linux desktop. You can find his work on [his GitHub profile][10].**_
--------------------------------------------------------------------------------
via: https://itsfoss.com/flatpak-app-apply-theme/
作者:[Community][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/itsfoss/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/what-is-flatpak/
[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/11/flatpak-apps-not-matching-system-theme.jpg?resize=800%2C450&ssl=1
[3]: https://docs.flatpak.org/en/latest/desktop-integration.html#theming
[4]: https://itsfoss.com/best-gtk-themes/
[5]: https://docs.flatpak.org/en/latest/sandbox-permissions.html#filesystem-access
[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/11/set-gtk-theme-to-flatpak-apps.png?resize=800%2C277&ssl=1
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/11/flatpak-adwaita.webp?resize=800%2C450&ssl=1
[8]: https://itsfoss.com/flatpak-app-apply-theme/flatpak-canta-dark.png
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/11/flatpak-canta-dark.webp?resize=800%2C450&ssl=1
[10]: https://github.com/hamza-Algohary

View File

@ -0,0 +1,103 @@
[#]: subject: "Motrix: A Beautiful Cross-Platform Open-Source Download Manager"
[#]: via: "https://itsfoss.com/motrix/"
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Motrix: A Beautiful Cross-Platform Open-Source Download Manager
======
_**Brief:** An open-source download manager that_ _provides a clean user interface while offering all the essential features to operate cross-platform. Explore more about it here._
There are plenty of download managers available for Linux. If you want to download something and have the ability to manage them, you can choose any of the download managers available.
However, if you want a good-looking download manager that offers a modern user experience without compromising on the feature set, Ive something that you might like.
### Meet Motrix: A Feature-Rich Open Source Download Manager
![][1]
Motrix is a no-nonsense download manager that provides a clean look out of the box. It is free and open-source software.
You can choose to use it for Linux, Windows, and macOS as well.
It could be a potential replacement for some [torrent clients available for Linux][2] as well.
Let me highlight some key features along with the installation instructions.
### Features of Motrix
![][3]
You should find all the features that you would typically expect in a download manager. Heres a list of them:
* Cross-platform support
* Easy to use interface
* BitTorrent selective download
* Automatic tracker list update
* UPnP &amp; NAT-PMP Port Mapping
* Parallel download tasks (up to 10)
* Support for up to 64 threads in a single task
* Ability to set a speed limit
* Option to change the user-agent
* System tray support
* Dark mode
* Multiple languages supported
![][4]
Overall, it worked well with torrent files and detected the download links from the clipboard as well. The advanced options can be accessed right before downloading a file, so that should come in handy.
![][5]
I did not find any issues while using it on Ubuntu as a snap package in my brief testing.
### Install Motrix in Linux
You get a variety of installation options for Motrix. So, you should be able to install it on any Linux distribution of your choice.
Primarily, it offers an AppImage for download. But, you can also find it available as a [Flatpak package][6] and [Snap][7] [][7][store][7].
If you are using Ubuntu, you should find it listed through the software center.
In addition to these, it is also available in [AUR][8] for Arch Linux users. In either case, you can always get the DEB/RPM packages from their [GitHub releases section][9].
You can find the links to download and more information on installation on their [official website][10] and the [GitHub page][11].
[Motrix][10]
### Wrapping Up
Motrix offers all the goodies that youd want in a download manager with a modern UX as a bonus.
I recommend you try this out as your download manager and see if it replaces your current tool. Id be curious to know your active download manager on your Linux system; feel free to tell me more about it in the comments below!
--------------------------------------------------------------------------------
via: https://itsfoss.com/motrix/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/11/motrix-download-manager.png?resize=800%2C604&ssl=1
[2]: https://itsfoss.com/best-torrent-ubuntu/
[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/11/motrix-dm-setting.png?resize=800%2C607&ssl=1
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/11/motrix-dm-white.png?resize=800%2C613&ssl=1
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/11/motrix-dm-options.png?resize=800%2C596&ssl=1
[6]: https://itsfoss.com/what-is-flatpak/
[7]: https://itsfoss.com/enable-snap-support-linux-mint/
[8]: https://itsfoss.com/aur-arch-linux/
[9]: https://github.com/agalwood/Motrix/releases
[10]: https://motrix.app/
[11]: https://github.com/agalwood/Motrix

View File

@ -0,0 +1,202 @@
[#]: subject: "Turn any website into a Linux desktop app with open source tools"
[#]: via: "https://opensource.com/article/21/11/linux-apps-nativefier"
[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Turn any website into a Linux desktop app with open source tools
======
Nativefier and Electron creates desktop apps from any website.
![Text editor on a browser, in blue][1]
Mastodon is a great open source, decentralised social network. I use Mastodon every day, and it's probably most common to use Mastodon through its web interface (although being open source, there are many different ways to interact with it, including terminal-based applications and mobile apps), but I prefer dedicated application windows.
Recently, I discovered [Nativefier][2], and I can now enjoy Mastodon, or any other web app, as a desktop application on my Linux desktop. Nativefier takes a URL and wraps it with the Electron framework, which runs the open source Chromium browser as its backend but runs as its own executable application. Nativefier is licensed under the MIT license and is available for Linux, Windows, and macOS.
### Installing Nativefier
Nativefier requires Node.js
Installing Nativefier is as simple as running:
```
`$ sudo npm install -g nativefier`
```
On my Ubuntu desktop, I had to upgrade NodeJS first, so be sure to check what versions of Node is required when you install Nativefier.
Once installed, you can check your version of Nativefier to verify that it's been installed:
```
$ nativefier --version
45.0.4
```
Running `nativefier --help` lists all options the app supports.
### Setup
I recommend that you create a new folder called `~/NativeApps` before you start creating apps with Nativefier. This helps keep your applications nice and organized.
```
$ mkdir ~/NativeApps
cd ~/NativeApps
```
### Creating an app for Mastodon
I'll start by creating an app for [mastodon.technology][3].
Use the command:
```
$ nativefier --name Mastodon \
\--platform linux --arch x64 \
\--width 1024 --height 768 \
\--tray --disable-dev-tools \
\--single-instance <https://mastodon.technology>
```
The options in this example do the following:
* `--name`: Sets the app name to Mastodon
* `--platform`: Sets the app's platform to Linux
* \--arch x64: Sets the architecture to x64
* `--width 1024 --height 768`: Sets the apps' dimensions on launch
* `--tray`: Creates a tray icon for the app
* `--disable-dev-tools`: Disables Chrome dev tools
* `--single-instance`: Only allows one instance of the app
Running that single command shows the following output:
```
Preparing Electron app...
Converting icons...
Packaging... This will take a few seconds, maybe minutes if the requested Electron isn't cached yet...
Packaging app for platform linux x64 using electron v13.4.0 Finalizing build...
App built to /home/tux/NativeApps/Mastodon-linux-x64, move to wherever it makes sense for you and run the contained executable file (prefixing with ./ if necessary)
Menu/desktop shortcuts are up to you, because Nativefier cannot know where you're going to move the app. Search for "linux .desktop file" for help, or see <https://wiki.archlinux.org/index.php/Desktop\_entries>
```
The output shows that the files get placed in `/home/tux/NativeApps/Mastodon-linux-x64`. When you `cd` into this folder, you see a file named Mastodon. This is the main executable that launches the app. Before you can launch it, you must give it the appropriate permissions.
```
$ cd Mastodon-linux-x64
chmod +x Mastodon
```
Now, execute `./Mastodon` to see your Linux app launch!
![Mastodon app launched][4]
(Ayush Sharma, [CC BY-SA 4.0][5])
### Creating an app for my blog
For fun, I'm going to create an app for my blog website as well. What good is having a tech blog if there's no Linux app for it?
![Ayush Sharma blog][6]
(Ayush Sharma, [CC BY-SA 4.0][5])
The command:
```
$ nativefier -n ayushsharma \
-p linux -a x64 \
\--width 1024 --height 768 \
\--tray --disable-dev-tools \
\--single-instance <https://ayushsharma.in>
$ cd ayushsharma-linux-x64
chmod +x ayushsharma
```
### Creating an app for findmymastodon.com
And finally, here's an app for my pet project, [findmymastodon.com][7].
![Find my mastodon website][8]
(Ayush Sharma, [CC BY-SA 4.0][5])
The command:
```
$ nativefier -n findmymastodon \
-p linux -a x64 \
\--width 1024 --height 768 \
\--tray --disable-dev-tools \
\--single-instance <https://findmymastodon.com>
$ cd findmymastodon-linux-x64
chmod +x findmymastodon
```
### Creating Linux desktop icons
With the apps created and the executables ready to go, it's time to create desktop icons.
As a demonstration, here's how to create a desktop icon for the Mastodon launcher. First, download an icon for [Mastodon][9]. Place the icon in its Nativefier app directory as `icon.png`.
Then create a file called `Mastodon.desktop` and enter this text:
```
[Desktop Entry]
Type=Application
Name=Mastodon
Path=/home/tux/NativeApps/Mastodon-linux-x64
Exec=/home/tux/NativeApps/Mastodon-linux-x64/Mastodon
Icon=/home/tux/NativeApps/Mastodon-linux-x64/icon.png
```
You can move the `.desktop` file to your Linux desktop to have it as a desktop launcher. You can also place a copy of it in `~/.local/share/applications` so it shows up in your application menu or activity launcher.
### Conclusion
I love having dedicated apps for tools I use often. My favorite feature about having an app for Mastodon is that once I log in to Mastodon, I don't have to log in again! Nativefier runs Chromium underneath. So it's able to remember your session just like any browser does. I'd like to give a special thanks to the Nativefier team for taking the Linux desktop one step closer to perfection.
* * *
_This article originally appeared on the [author's website][10] and is republished with permission._
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/11/linux-apps-nativefier
作者:[Ayush Sharma][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/ayushsharma
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_blue_text_editor_web.png?itok=lcf-m6N7 (Text editor on a browser, in blue)
[2]: https://github.com/nativefier/nativefier
[3]: https://mastodon.technology/
[4]: https://opensource.com/sites/default/files/uploads/2_launch-mastodon-app.png (Mastodon app launched)
[5]: https://creativecommons.org/licenses/by-sa/4.0/
[6]: https://opensource.com/sites/default/files/uploads/3_ayush-shama-blog.png (Ayush Sharma blog)
[7]: https://findmymastodon.com/
[8]: https://opensource.com/sites/default/files/uploads/4_find-my-mastodon-app.png (Find my mastodon website)
[9]: https://icons8.com/icons/set/mastodon
[10]: https://ayushsharma.in/2021/10/make-linux-apps-for-notion-mastodon-webapps-using-nativefier

View File

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

View File

@ -0,0 +1,237 @@
[#]: subject: "How do you tell if a problem is caused by DNS?"
[#]: via: "https://jvns.ca/blog/2021/11/04/how-do-you-tell-if-a-problem-is-caused-by-dns/"
[#]: author: "Julia Evans https://jvns.ca/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How do you tell if a problem is caused by DNS?
======
I was looking into problems people were having with DNS a few months ago and I noticed one common theme a lot of people have server issues (“my server is down! or its slow!“), but they cant tell if the problem is caused by DNS or not.
So here are a few tools I use to tell if a problem Im having is caused by DNS, as well as a few DNS debuggging stories from my life.
### I dont try to interpret browser error messages
First, lets talk briefly about browser error messages. You might think that your browser will tell you if the problem is DNS or not! And it _could_ but mine doesnt seem to do so in any obvious way.
On my machine, if Firefox fails to resolve DNS for a site, it gives me the error: **Hmm. Were having trouble finding that site. We cant connect to the server at bananas.wizardzines.com.**
But if the DNS succeeds and it just cant establish a TCP connection to that service, I get the error: **Unable to connect. Firefox cant establish a connection to the server at localhost:1324**
These two error messages (“we cant connect to the server” and “firefox cant establish a connection to the server”) are so similar that I dont try to distinguish them if I see any kind of “connection failure” error in the browser, Ill immediately go the command line to investigate.
### tool 1: error messages
I was complaining about browser error messages being misleading, but if youre writing a program, theres usually some kind of standard error message that you get for DNS errors. It often wont say “DNS” in it, itll usually be something about “unknown host” or “name or service not found” or “getaddrinfo”.
For example, lets run this Python program:
```
import requests
r = requests.get('http://examplezzz.com')
```
This gives me the error message:
```
socket.gaierror: [Errno -2] Name or service not known
```
If I write the same program in Ruby, I get this error:
```
Failed to open TCP connection to examplezzzzz.com:80 (getaddrinfo: Name or service not known
```
If I write the same program in Java, I get:
```
Exception in thread "main" java.net.UnknownHostException: examplezzzz.com
```
In Node, I get:
```
Error: getaddrinfo ENOTFOUND examplezzzz.com
```
These error messages arent quite as uniform as I thought they would be, there are quite a few different error messages in different languages for exact the same problem, and it depends on the library youre using too. But if you Google the error you can find out if it means “resolving DNS failed” or not.
### tool 2: use `dig` to make sure its a DNS problem
For example, the other day I was setting up a new subdomain, lets say it was <https://bananas.wizardzines.com>.
I set up my DNS, but when I went to the site in Firefox, it wasnt working. So I ran `dig` to check whether the DNS was resolving for that domain, like this:
```
$ dig bananas.wizardzines.com
(empty response)
```
I didnt get a response, which is a failure. A success looks like this:
```
$ dig wizardzines.com
wizardzines.com. 283 IN A 172.64.80.1
```
Even if my programming language gives me a clear DNS error, I like to use `dig` to independently confirm because there are still a lot of different error messages and I find them confusing.
### tool 3: check against more than one DNS server
There are LOTS of DNS servers, and they often dont have the same information. So when Im investigating a potential DNS issue, I like to query more than one server.
For example, if its a site on the public internet Ill both use my local DNS server (`dig domain.com`) and a big public DNS server like 1.1.1.1 or 8.8.8.8 or 9.9.9.9 (`dig @8.8.8.8 domain.com`).
The other day, Id set up a new domain, lets say it was <https://bananas.wizardzines.com>.
Heres what I did:
1. go to <https://bananas.wizardzines.com> in a browser (spoiler: huge mistake!)
2. go to my DNS provider and set up bananas.wizardzines.com
3. try to go to <https://bananas.wizardzines.com> in my browser. It fails! Oh no!
I wasnt sure why it failed, so I checked against 2 different DNS servers:
```
$ dig bananas.wizardzines.com
$ dig @8.8.8.8 bananas.wizardzines.com
feedback.wizardzines.com. 300 IN A 172.67.209.237
feedback.wizardzines.com. 300 IN A 104.21.85.200
```
From this I could see that `8.8.8.8` actually did have DNS records for my domain, and it was just my local DNS server that didnt.
This was because Id gone to <https://bananas.wizardzines.com> in my browser before Id created the DNS record (huge mistake!), and then my ISPs DNS server cached the **absence** of a DNS record, so it was returning an empty response until the negative cached expired.
I googled “negative cache time” and found a Stack Overflow post explaining where I could find the negative cache TTL (by running `dig SOA wizardzines.com`). It turned out the TTL was 3600 seconds or 1 hour, so I just needed to wait an hour for my ISP to update its cache.
### tool 4: spy on the DNS requests being made with tcpdump
Another of my favourite things to do is spy on the DNS requests being made and check if theyre failing. There are at least 3 ways to do this:
1. Use tcpdump (`sudo tcpdump -i any port 53`)
2. Use wireshark
3. Use a command line tool I wrote called [dnspeep][1], which is like tcpdump but just for DNS queries and with friendlier output
Im going to give you 2 examples of DNS problems I diagnosed by looking at the DNS requests being made with `tcpdump`.
### problem: the case of the slow websites
One day five years ago, my internet was slow. Really slow, it was taking 10+ seconds to get to websites. I thought “hmm, maybe its DNS!”, so started `tcpdump` and then opened one of the slow sites in my browser.
Heres what I saw in `tcpdump`:
```
$ sudo tcpdump -n -i any port 53
12:05:01.125021 wlp3s0 Out IP 192.168.1.181.56164 > 192.168.1.1.53: 11760+ [1au] A? ask.metafilter.com. (59)
12:05:06.191382 wlp3s0 Out IP 192.168.1.181.56164 > 192.168.1.1.53: 11760+ [1au] A? ask.metafilter.com. (59)
12:05:11.145056 wlp3s0 Out IP 192.168.1.181.56164 > 192.168.1.1.53: 11760+ [1au] A? ask.metafilter.com. (59)
12:05:11.746358 wlp3s0 In IP 192.168.1.1.53 > 192.168.1.181.56164: 11760 2/0/1 CNAME metafilter.com., A 54.244.168.112 (91)
```
The first 3 lines are DNS requests, and theyre separated by 5 seconds. Basically this is my browser timing out its DNS queries and retrying them.
Finally, on the 3rd query, a response comes back.
I dont actually know exactly why this happened, but I restarted my router and the problem went away. Hooray!
(by the way the reason I know that this is the tcpdump output I got 5 years ago is that I wrote about it in my [zine on tcpdump][2], you can read that zine for free!)
### problem: the case of the nginx failure
Earlier this year, I was using <https://fly.io> to set up a website, and I was having trouble getting nginx to redirect to my site all the requests were failing.
I eventually got SSH access to the server and ran `tcpdump` and heres what I saw:
```
$ tcpdump -i any port 53
17:16:04.216161 IP6 fly-local-6pn.55356 > fdaa::3.53: 46219+ A? myservice.internal. (42)
17:16:04.216197 IP6 fly-local-6pn.55356 > fdaa::3.53: 11993+ AAAA? myservice.internal. (42)
17:16:04.216946 IP6 fdaa::3.53 > fly-local-6pn.55356: 46219 NXDomain- 0/0/0 (42)
17:16:04.217063 IP6 fly-local-6pn.43938 > fdaa::3.53: 32351+ PTR? 3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.a.a.d.f.ip6.arpa. (90)
17:16:04.218378 IP6 fdaa::3.53 > fly-local-6pn.55356: 11993- 1/0/0 AAAA fdaa:0:bff:a7b:aa2:d426:1ab:2 (70)
17:16:04.461646 IP6 fdaa::3.53 > fly-local-6pn.43938: 32351 NXDomain 0/1/0 (154)
```
This is a bit confusing to read, but basically:
1. nginx requests an A record
2. nginx requests an AAAA record
3. the DNS server returns an `NXDOMAIN` reply for the A record
4. the DNS server returns a successful reply for the AAAA record, with an IPv6 address
The `NXDOMAIN` reponse made nginx think that that domain didnt exist, so it ignored the IPv6 address it got later.
This was happening because there was a bug in the DNS server according to the DNS spec it should have been returning `NOERROR` instead of `NXDOMAIN` for the A record. I reported the bug and they fixed it right away.
I think it would have been literally impossible for me to guess what was happening here without using `tcpdump` to see what queries nginx was making.
### if there are no DNS failures, it can still be a DNS problem
I originally wrote “if you can see the DNS requests, and there are no timeouts or failures, the problem isnt DNS”. But someone on Twitter [pointed out][3] that this isnt true!
One way you can have a DNS problem even without DNS failures is if your program is doing its own DNS caching. Heres how that can go wrong:
1. Your program makes a DNS request and caches the result
2. 6 days pass
3. Your program never updates its IP address
4. The IP address for the site changes
5. You start getting errors
This _is_ a DNS problem (your program should be requesting DNS updates more often!) but you have to diagnose it by noticing that there are _missing_ DNS queries. This one is very tricky and the error messages youll get wont look like they have anything to do with DNS.
### thats all for now
This definitely isnt a complete list of ways to tell if its DNS or not, but I hope it helps!
Id love to hear methods of checking “is it DNS?” that I missed Im pretty sure Ive missed at least one important method.
--------------------------------------------------------------------------------
via: https://jvns.ca/blog/2021/11/04/how-do-you-tell-if-a-problem-is-caused-by-dns/
作者:[Julia Evans][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://jvns.ca/
[b]: https://github.com/lujun9972
[1]: https://github.com/jvns/dnspeep/
[2]: https://wizardzines.com/zines/tcpdump/
[3]: https://twitter.com/0x2ba22e11/status/1456305123420950530

View File

@ -0,0 +1,127 @@
[#]: subject: "How to update a Linux symlink"
[#]: via: "https://opensource.com/article/21/11/update-linux-file-system-link"
[#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to update a Linux symlink
======
Links have always been a unique advanced feature of UNIX file systems.
![Links][1]
UNIX and Linux users find many uses for links, particularly symbolic links. One way that I like to use symbolic links is to manage configuration backups of various IT equipment.
I have a directory structure to hold everything related to documentation, updates, and other files for the computers and devices on my network. Devices can include routers, access points, NAS servers, and laptops, often of different brands and versions. The configuration backups themselves might be deep within the directory tree, e.g. `/home/alan/Documents/network/device/NetgearRL5000/config`.
To simplify the backup process, I have a directory in my home called `Configuration`. I use symbolic links from this directory to point to the specific device directory:
```
:~/Configuration/ $ ls -F1
Router@
Accesspoint@
NAS@
```
**Note**: The `-F` option of the `ls` command appends special characters to each file name to represent its type. As shown above, the `@` symbol indicates that these are links.
### Creating a link
The symbolic link **Router** points to the `config` directory of my Netgear RL5000. The command to create it is `ln -s:`
```
`$ ln -s /home/alan/Documents/network/device/NetgearRL5000/config Router`
```
Then, take a look and confirm with `ls -l:`
```
:~/Configuration/ $ ls -l
Router -&gt; /home/alan/Documents/network/device/NetgearRL5000/config
NAS -&gt; /home/alan/Documents/network/device/NFSBox/config
...
```
The advantage is that when performing maintenance on this device, I simply browse to `~/Configuration/Router`.
The second advantage of using a symbolic link becomes evident if I decide to replace this router with a new model. I might re-task the old router to be an access point. Therefore, its directory does not get deleted. Instead, I have a new directory that corresponds to the new router, perhaps an ASUS DF-3760. I create the directory and confirm its existence:
```
`$ mkdir -p ~/Documents/network/device/ASUSDF-3760/config`[/code] [code]
:~/Documents/network/device/ $ ls
NetgearRL5000
ASUSDF-3760
NFSBox
...
```
Another example could be if you have several access points throughout your offices. You can use symbolic links to represent each one logically with either a generic name, such as `ap1`, `ap2`, and so on, or you can use descriptive words such as `ap_floor2`, `ap_floor3`, etc. This way, as the physical devices change over time, you do not have to continuously update any processes that might be managing them as they are addressing the links rather than the actual device directories.
### Updating a link
Since my main router has changed, I want the router's symbolic link to point to its directory. I could use the `rm` and `ln` commands to remove and create a new symbolic link, but there is a way to do this in one step using only the `ln` command with a few options:
```
:~/Configuration/ $ ln -vfns ~/Documents/network/device/ASUSDF-3760/config/ Router
'Router' -&gt; '/home/alan/Documents/network/device/ASUSDF-3760/config/'
:~/Configuration/ $ ls -l
Router -&gt; /home/alan/Documents/network/device/ASUSDF-3760/config
NAS -&gt; /home/alan/Documents/network/device/NFSBox/config
```
The options, according to the man page, are as follow:
**-v, --verbose**
print name of each linked file
**-f, --force**
remove destination file (necessary since a link already exists)
**-n, --no-dereference**
treat LINK_NAME as a normal file if it is a symbolic link to a directory
**-s, --symbolic**
make symbolic links instead of hard links
### Wrap up
Links are one of the most powerful features of UNIX and Linux file systems. Other operating systems have tried to mimic this capability, but those never worked as well or were as usable due to the lack of a fundamental link design in their file systems.
The demonstration above is only one possibility of many to take advantage of links for seamlessly navigating an ever-changing directory structure in a living production environment. Links provides the flexibility needed in an organization that is never static for long.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/11/update-linux-file-system-link
作者:[Alan Formy-Duval][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/alanfdoss
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/links.png?itok=enaPOi4L (Links)

View File

@ -0,0 +1,157 @@
[#]: subject: "How to Set JAVA_HOME Variable in Ubuntu Linux Correctly"
[#]: via: "https://itsfoss.com/set-java-home-ubuntu/"
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
[#]: collector: "lujun9972"
[#]: translator: "robsean"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
如何在 Ubuntu Linux 中正确地设置 JAVA_HOME 变量
======
如果你 [在 Ubuntu 上运行 Java 程序][1] ,使用 Eclipse[Maven][2] 或 Netbeans 等等,你将需要设置 JAVA_HOME 到你的路径。否则,你的系统将会向你控诉 “java_home environment variable is not set”。
在这篇初学者教程中,我将向你展示在 Ubuntu 上正确地设置 Java_Home 变量的步骤。这些步骤应该也适用于大多数的其它的 Linux 发行版。
设置过程包含这些步骤:
* 确保已经安装 Java 开发工具包 (JDK) 。
* 查找 JDK 可执行文件的正确的位置。
* 设置 JAVA_HOME 变量和永久的更改。
### 步骤 1: 核查 JDK 是否已经安装
核查 Java 开发工具包 (JDK) 是否已经安装在你的 Linux 系统上的最简单的方法是运行这个命令:
```
javac --version
```
上面的命令将核查 Java 编译器的版本。如果已经安装了 Java 编译器,它将显示 Java 版本。
![Java Compiler is installed][3]
如果上面的命令显示一个像未找到 javac 命令的错误信息,你将必须安装 JDK 。
![Java Compiler is not installed][4]
如果在你的系统上并没有安装 Java 编译器,使用这条命令来安装 Java 开发工具包 JDK
```
sudo apt install default-jdk
```
这将在你当前的 Ubuntu 版本中安装默认的 Java 版本。如果你需要一些其它的特定的 Java 版本,那么你必须 [在 Ubuntu 中安装 Java 时][5],具体指出它的版本。
在你确保 Java 编译器存在于你的系统之中后,接下来就到了查找其位置的时机了。
### 步骤 2: 获取 JDK 可执行文件 (Java 编译器) 的位置
可执行文件通常位于 /usr/lib/jvm 目录之中。我不会让你来玩一个猜谜游戏。相反,让我们找出 Java 可执行文件的路径。
[使用 which 命令][6] 来获取 Java 编译器可执行文件的位置:
```
which javac
```
在这里的问题是,它给出的位置实际上是一个 [符号链接][7] 。你将需要按照下图执行几次:
![][8]
最简单的方法是按照符合链接来直接使用这条命令以获取实际的可执行文件:
```
readlink -f `which java`
```
readlink 命令跟着一个符号链接。我在 _which java_ 的外侧使用 ` 。readlink 将使用 which java 的输出来替换符号链接,这被称之为命令替换。因此,在这个实例中,上面的命令大体上相当于 _readlink -f /usr/bin/java_
在我的示例中,可执行文件的位置是 **/usr/lib/jvm/java-11-openjdk-amd64/bin/java** 。对你来说可能会不一样。在你的系统中,复制上述命令所获取的正确的路径。你知道,你可以 [在 Ubuntu 的终端中复制和粘贴][9] 。
### 步骤 3: 设置 JAVA_HOME 变量
现在,你以及获取了位置,使用它来设置 JAVA_HOME 环境变量:
```
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/bin/java
```
核查 JAVA_HOME 目录的值:
```
echo $JAVA_HOME
```
![][10]
尝试在同一个终端总运行你的程序或工程,并查看它是否工作。
这尚未结束。你刚刚声明的 JAVA_HOME 变量是临时的。如果你关闭这个终端或开始一个新的会话,它将会再次变成空的。
为了“永久地”设置 JAVA_HOME 变量,你应该将其添加到你 home 命令中的 bashrc 文件中。
你可以 [在 linux 终端中使用 Nano 编辑器来编译文件][11]。 如果你不想使用它,并想采取一种简单的复制和粘贴的方法,使用下面的命令:
备份你的 bashrc 文件 (万一你把它弄坏了,你还可以将其再恢复回来)
```
cp ~/.bashrc ~/.bashrc.bak
```
接下来,[使用 echo 命令来追加][12] 你在这部分开头处所使用的 export 命令。_**你应该适当地更改下面的命令,以便其正确地使用系统所显示的路径**_.
```
echo "export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/bin/java" >> ~/.bashrc
```
验证它已经被正确地添加到文件的结尾处:
```
tail -3 ~/.bashrc
```
上面的 [tail 命令][13] 将显示所具体指定文件的最后 3 行。
这里是上面的三个命令的全部的输出。
![][14]
现在即使你退出会话或重新启动系统JAVA_HOME 变量都仍将设置为你所具体指定的值。这就是你所想要的,对吧?
注意,如果你将来更改默认的 Java 版本,你将需要更改 JAVA_HOME 的值并将其指向正确的可执行文件的路径。
我希望这篇教程不仅会帮助你设置 Java_Home ,也会教会你如何完成这项工作。
如果你仍然面临难题或者有一些疑问或建议,请在评论区告诉我。
--------------------------------------------------------------------------------
via: https://itsfoss.com/set-java-home-ubuntu/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[robsean](https://github.com/robsean)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/run-java-program-ubuntu/
[2]: https://maven.apache.org/
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/check-java-compiler-ubuntu.png?resize=750%2C310&ssl=1
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/java-compiler-check-ubuntu.png?resize=732%2C300&ssl=1
[5]: https://itsfoss.com/install-java-ubuntu/
[6]: https://linuxhandbook.com/which-command/
[7]: https://linuxhandbook.com/symbolic-link-linux/
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/get-java-home-path-ubuntu.png?resize=800%2C283&ssl=1
[9]: https://itsfoss.com/copy-paste-linux-terminal/
[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/setting-java-home-ubuntu.png?resize=800%2C268&ssl=1
[11]: https://itsfoss.com/nano-editor-guide/
[12]: https://linuxhandbook.com/echo-command/
[13]: https://linuxhandbook.com/tail-command/
[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/set-java-home-bashrc-ubuntu.png?resize=786%2C348&ssl=1

View File

@ -0,0 +1,114 @@
[#]: subject: "What is Build Essential Package in Ubuntu? How to Install it?"
[#]: via: "https://itsfoss.com/build-essential-ubuntu/"
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
什么是 Ubuntu 中的 Build Essential 包?如何安装它?
======
_**简介:这是一篇快速提示,旨在告知 Ubuntu 的新用户关于 build-essential 软件包,它的用处和安装步骤。**_
在 Ubuntu 中安装 build-essential 包,就像在终端中输入这个命令一样简单:
```
sudo apt update && sudo apt install build-essential
```
但围绕它有几个问题,你可能想知道答案:
* 什么是 build essential 包?
* 它包含什么内容?
* 为什么要安装它(如果安装的话)?
* 如何安装它?
* 如何删除它?
### 什么是 Ubuntu 中的 build-essential 软件包?
build-essential 包实际上是属于 Debian 的。它本身并不是一个软件。它包含了创建一个 Debian 包deb所需的软件包列表。这些软件包包括 libc、gcc、g++、make、dpkg-dev 等。build-essential 包包含这些所需的软件包作为依赖,所以当你安装 build-essential 时,你只需一个命令就能安装所有这些软件包。
请不要认为 build-essential 是一个超级软件包,它可以在一个命令中神奇地安装从 Ruby 到 Go 的所有开发工具。它有一些开发工具,但不是全部。
#### 你为什么要安装 build-essential 包?
它是用来从应用的源代码创建 DEB 包。一个普通用户不会每天都去创建 DEB 包,对吗?
然而,有些用户可能会使用他们的 Ubuntu Linux 系统进行软件开发。你想[在 Ubuntu 中运行 c 程序][1],你需要 gcc 编译器。你想[在 Ubuntu 中运行 C++ 程序][2],你需要 g++ 编译器。如果你要使用一个不寻常的、只能从源代码中获得的软件,你的系统会抛出 [make 命令未找到的错误][3],因为你需要先安装 make 工具。
当然,所有这些都可以单独安装。然而,利用 build-essential 软件包的优势,一次性安装所有这些开发工具要容易得多。这就是你得到的好处。
这就像 [ubuntu-restricted-extras 包允许你一次安装几个媒体编解码器][4]。
现在你知道了这个包的好处,让我们看看如何安装它。
### 在 Ubuntu Linux 中安装 build-essential 包
![][5]
在 Ubuntu 中按 Ctrl+Alt+T 快捷键打开终端,输入以下命令:
```
sudo apt update
```
使用 sudo 命令,你会被要求输入你的账户密码。当你输入时,屏幕上没有任何显示。这没问题。这在大多数 Linux 系统中都是这样的。盲目地输入你的密码,然后按回车键。
![][6]
apt update 命令刷新了本地软件包的缓存。这对于一个新安装的 Ubuntu 来说是必不可少的。
之后,运行下面的命令来安装 build-essential 工具:
```
sudo apt install build-essential
```
它应该显示所有要安装的软件包。当要求确认时按 Y
![][7]
等待安装完成。就好了。
### 从 Ubuntu 中删除 build-essential 工具
保留这些开发工具不会损害你的系统。但如果你的磁盘空间不足,你可以考虑删除它。
在 Ubuntu 中,由于有 apt remove 命令,删除软件很容易:
```
sudo apt remove build-essential
```
运行 autoremove 命令来删除剩余的依赖包也是一个好主意:
```
sudo apt autoremove
```
你现在知道了所有关于 build-essential 包的要点(双关语)。请享受它吧 :)
--------------------------------------------------------------------------------
via: https://itsfoss.com/build-essential-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/run-c-program-linux/
[2]: https://itsfoss.com/c-plus-plus-ubuntu/
[3]: https://itsfoss.com/make-command-not-found-ubuntu/
[4]: https://itsfoss.com/install-media-codecs-ubuntu/
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/Build-Essential-Ubuntu.png?resize=800%2C450&ssl=1
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/apt-update.png?resize=800%2C467&ssl=1
[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/install-build-essential-ubuntu.png?resize=800%2C434&ssl=1

View File

@ -0,0 +1,146 @@
[#]: subject: "Only 4 MB? How to Fix USB Destroyed by Etcher and Rufus After Creating Live Linux USB"
[#]: via: "https://itsfoss.com/format-live-linux-usb/"
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
只有 4MB如何修复 Etcher 和 Rufus 创建 Linux USB 后“破坏”的 USB
======
情况是这样的。你用 Etcher 或者 Rufus 工具在 Windows 或者 Linux 中创建了一个可启动的、Live Linux USB。
你用它来安装 LinuxUSB 的目的已经达到了。现在你想格式化这个 USB用它来进行常规的数据传输或存储。
你把它插入你的 Windows 系统,令你吃惊的是,这个 USB 的磁盘容量只有 4MB。
![][1]
你试图格式化它但它可能不会让你这么做。即使你设法格式化它USB 的大小现在也从通常的 8GB、16GB 或 32GB 缩减到只有 4MB。
你失去了你的 USB 吗?并非如此。你的 USB 并没有完全被破坏。你仍然可以用一个小技巧来格式化它,并舒适地使用它。
让我告诉你如何在 Windows 和 Linux 中把可启动的 USB 恢复到可用的状态。
### 格式化由 Rufus 或 Etcher 创建的 Live Linux USB (在 Windows 下)
你在 Windows 中看到只有 4MB 的磁盘空间。你知道为什么吗?因为在创建 Live Linux USB 时,该工具在 FAT32 文件系统中创建了一个 4MB 的 EFI 分区。其他的分区是在 Linux 的 Ext4 文件系统中,而这是不被 Windows 识别的。
这就是为什么你的 Windows 系统只看到 4MB 的 EFI 分区,并显示 USB 大小为 4MB。
![Windows only see the EFI partition on the USB][2]
总而言之,你需要做的是删除 USB 盘上的所有分区,用删除现有分区后得到的空闲空间创建一个新的 NTFS 或 FAT32 分区。这就行了。
让我展示一下详细的步骤。
#### 步骤 1
进入 Windows 菜单,寻找“磁盘管理”工具。
![Start disk management tool][3]
启动这个工具,它将显示你电脑上存在的所有磁盘。当然,这包括插入的 USB。
_**选择正确的磁盘是非常重要的**_。从 U 盘的大小或“可移动”的标签中辨别出它是哪一个。
![][4]
#### 步骤 2
我们的想法是删除 U 盘上的任何现有分区。未分配的空间不能被删除,但这也没关系。
在该分区上点击右键,然后点击**删除卷**。
![Delete partitions on the USB disk][5]
当要求你确认时,按是。
![Confirm deletion of partition][6]
你的目标是只有一个未分配的空间块。当你看到它时,右击它并点击“新的简单卷”来创建一个分区。
![Create New Simple Volume \(partition\)][7]
接下来的步骤很简单。点击“下一步”选择整个可用空间给它分配一个字母选择文件系统FAT32 或 NTFS并将其格式化。
![Click Next][8]
![Use entire available space][9]
![Give it a drive letter][10]
![Use FAT 32 or NTFS, Name the USB if you want][11]
![Revise all the changes][12]
完成后,你会看到 USB 已经恢复到正常状态,你可以开始向它复制粘贴数据。
![USB is back to normal state][13]
你现在可以像以前一样使用你的 USB 了。
这些步骤是针对 Windows 的。如果你使用 Linux 呢?
### 在 Linux 上格式化 Live USB
我注意到,由 Etcher 和这类工具创建的 Live USB 经常拒绝被文件管理器中的右键格式化选项正确格式化。
除此之外,你可以像在 Windows 中那样做:删除现有的分区,用整个可用空间创建一个新的分区。
这里使用 GNOME Disks 工具。它已经安装在 Ubuntu 和许多其他 Linux 发行版上。
![Start disk app][14]
_**同样,确保你在这里选择了外部 USB 盘。**_
你会看到 U 盘上的各种分区。试着从上面的菜单中格式化该磁盘。
![Format disk][15]
**如果这不起作用,逐个删除分区**,然后把整个 USB 作为自由空间。
当你创建了整个自由空间后,点击 “+” 号,在上面创建一个 NTFS 或 FAT32 文件系统的分区。
![][16]
用 NTFS或 FAT32创建分区给它起个合适的名字然后你就可以像以前一样使用这个 USB 了。
### 总结
像 Rufus 和 Etcher 这样的工具并没有真正破坏你的 USB。这就是它们的功能通过在磁盘上创建一个不同的文件系统。但这样一来操作系统就不能正确理解它。
好在只需付出一点努力就可以修复。我希望你也能够修复它。如果没有,请与我分享你的问题,我将尽力帮助你。
--------------------------------------------------------------------------------
via: https://itsfoss.com/format-live-linux-usb/
作者:[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://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/usb-drive-4mb-space-only.webp?resize=800%2C324&ssl=1
[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/mystery-behind-4-mb-linux-live-usb.webp?resize=800%2C400&ssl=1
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/start-disk-management-tool-windows.webp?resize=800%2C694&ssl=1
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/identify-usb-disk-in-windows.webp?resize=800%2C509&ssl=1
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/delete-partitions-on-usb-disk.webp?resize=800%2C464&ssl=1
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/confirm-deletion-of-partition.webp?resize=800%2C357&ssl=1
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/Create-New-Partition.webp?resize=800%2C471&ssl=1
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/creating-new-simple-volume-1.png?resize=731%2C590&ssl=1
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/creating-new-simple-volume-2.png?resize=735%2C589&ssl=1
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/creating-new-simple-volume-3.png?resize=732%2C590&ssl=1
[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/creating-new-simple-volume-4.png?resize=669%2C527&ssl=1
[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/creating-new-simple-volume-5.png?resize=670%2C524&ssl=1
[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/live-Linux-USB-formatted-successfully.webp?resize=800%2C571&ssl=1
[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/start-disk-app.webp?resize=791%2C256&ssl=1
[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/format-usb-in-disks-tool.webp?resize=800%2C434&ssl=1
[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/create-partition-on-usb.webp?resize=800%2C418&ssl=1

View File

@ -0,0 +1,131 @@
[#]: subject: "How I dynamically generate Jekyll config files"
[#]: via: "https://opensource.com/article/21/11/jekyll-config-files"
[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
我如何动态地生成 Jekyll 配置文件
======
使用 Python 或 Bash 将动态数据插入 Jekyll 静态网站中,并且避免创建一个 API 后端。
![Digital creative of a browser on the internet][1]
[Jekyll][2],静态网站生成器,使用 `_config.yml` 进行配置。这些配置都是 Jekyll 特有的。但你也可以在这些文件中[用我们自己的内容定义变量][3],并在整个网站中使用它们。在本文中,我将重点介绍动态创建 Jekyll 配置文件的一些优势。
在我的本地笔记本电脑上,我使用以下命令来服务我的 Jekyll 网站进行测试:
```
`bundle exec jekyll serve --incremental --config _config.yml`
```
### 结合多个配置文件
在本地测试中,有时需要覆盖配置选项。我的网站的[当前 _config.yml][4] 有以下设置:
```
# Jekyll Configuration
# Site Settings
url: "<https://notes.ayushsharma.in>"
website_url: "<https://notes.ayushsharma.in/>"
title: ayush sharma's notes ☕ + 🎧 + 🕹️
email: [ayush@ayushsharma.in][5]
images-path: /static/images/
videos-path: /static/videos/
js-path: /static/js/
baseurl: "" # the subpath of your site, e.g. /blog
```
由于本地的 `jekyll serve` URL 是 http://localhost:4000上面定义的 URL 就不能用了。我可以创建一个 `_config.yml` 的副本 `_config-local.yml` 并替换所有的值。但还有一个更简单的选择。
Jekyll 允许[指定多个配置文件][6],后面的声明覆盖前面的声明。这意味着我可以用以下代码定义一个新的 `_config-local.yml`
```
`url:""`
```
然后我可以把上述文件和我的主 `_config.yml` 结合起来,像这样:
```
`bundle exec jekyll serve --incremental --config _config.yml,_config-local.yml`
```
通过合并这两个文件,这个 `jekyll serve``url` 的最终值将是空白。这就把我网站中定义的所有 URL 变成了相对的 URL并使它们在我的本地笔记本电脑上工作。
### C结合动态配置文件
一个简单的例子,假设你想在你的网站上显示当前日期。它的 bash 命令是:
```
&gt; date '+%A, %d %B %Y'
Saturday, 16 October 2021
```
我知道我也可以[使用 Jekyll 的 _config.yml 的自定义内容][3]。我将上述日期输出到一个新的 Jekyll 配置文件中。
```
`my_date=`date '+%A, %d %B %Y'`; echo 'my_date: "'$my_date'"' > _config-data.yml`
```
现在 `_config-data.yml` 包含:
```
`my_date: "Saturday, 16 October 2021"`
```
我可以把我的新配置文件和其他文件结合起来,在我的网站上使用 `my_date` 变量。
```
`bundle exec jekyll serve --incremental --config _config.yml,_config-local.yml,_config-data.yml`
```
在运行上述命令时,`{{ site.my_date }}` 输出其配置的值。
### 结论
上面的例子很简单但可能性是无穷的。Bash、Python 和其他编程语言可以动态地生成 Jekyll 配置文件。然后我可以在 `build``serve` 过程中结合这些文件。
对于 [findmymastodon.com][7][我使用 Python 来获取 Mastodon 的用户统计数据][8]。然后我把这些写进一个新的 [_config-data.yml 文件][9](目前是手动)。最后,[主页和其他页面从配置文件中显示这些][10]。这样,我就可以利用一个动态的后台,并且仍然保持我所喜欢的所有静态网站的优点。
我希望这能为你自己的静态网站激发一些想法。Jamstack 对于静态网站是很好的,但你可以避免为动态内容创建整个 API 后台。为什么不使用一个构建作业来创建带有更新内容的配置文件呢?这可能不适合每一种情况,但少一个 API 意味着更少的基础设施移动部件。
我希望这能在你的下一个静态网站项目中给你一些帮助。继续阅读,并祝你编码愉快。
* * *
_这篇文章最初发布在[作者的网站][11]上并经授权转载。_
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/11/jekyll-config-files
作者:[Ayush Sharma][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/ayushsharma
[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/article/21/9/build-website-jekyll
[3]: https://ayushsharma.in/2021/08/using-variables-in-jekyll-to-define-custom-content
[4]: https://gitlab.com/ayush-sharma/ayushsharma-in/-/blob/2.0/_config.yml
[5]: mailto:ayush@ayushsharma.in
[6]: https://jekyllrb.com/docs/configuration/options/#build-command-options
[7]: https://findmymastodon.com/
[8]: https://gitlab.com/ayush-sharma/find-my-mastodon/-/blob/1.0/src/fetch-instance-data/fetch_data.py#L252
[9]: https://gitlab.com/ayush-sharma/find-my-mastodon/-/blob/1.0/_config-data.yml
[10]: https://gitlab.com/ayush-sharma/find-my-mastodon/-/blob/1.0/index.md#L16
[11]: https://ayushsharma.in/2021/10/inserting-dynamic-data-into-jekyll-static-sites-using-python-or-bash