Merge pull request #9 from LCTT/master

update
This commit is contained in:
littlebirdnest 2022-11-11 21:26:08 +08:00 committed by GitHub
commit 755b878c19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
83 changed files with 10690 additions and 4021 deletions

View File

@ -0,0 +1,123 @@
[#]: subject: (How we built an open source design system to create new community logos)
[#]: via: (https://opensource.com/article/21/4/ansible-community-logos)
[#]: author: (Fiona Lin https://opensource.com/users/fionalin)
[#]: collector: (lujun9972)
[#]: translator: (MareDevi)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-15227-1.html)
我们如何建立一个开源的设计系统来创造新的社区徽标
======
> 了解 Ansible 的新徽标是如何根据相关人员的意见开发的,以确保整个项目的品牌一致性。
![UX design Mac computer with mobile and laptop][1]
作为红帽的用户体验UX设计和 Ansible 产品团队的交互设计师,我们花了大约 6 个月的时间为 Ansible 社区设计了一系列徽标。这件事其实在更早的时候就开始了,当时一位项目经理要求我们为一个幻灯片提供一个 “快速而简单” 的徽标。在收集了一些需求后,我们在几天内就向相关人员展示了一个徽标,而且没有经过太多调整。几个月后,另一个相关人员说他们也需要类似的徽标,所以我们重复了这个过程。
于是,我们注意到一个模式:像这样的徽标资源不仅仅代表个人的要求,而是整个 Ansible 项目的共同需要。在完成了几个徽标要求后,我们有了一系列临时的设计,但在没有意识到品牌和设计惯例的情况下,这可能给整个 Ansible 的品牌视觉造成了不一致。随着这个徽标系列的增加,我们认识到了这个迫在眉睫的问题,并需要解决它。
我们的解决方案是创建一个 Ansible 设计系统,这是一个针对品牌的资源,可以指导未来一致的徽标设计。
### 什么是设计系统?
设计系统是一个可重复使用的资源和指导方法的集合,有助于告知任何数字产品套件的视觉语言。设计系统创造了一些模式,将独立的产品整合在一起,并通过可扩展性和一致性提升品牌。
特别是在一个有多种产品的大公司里,如果没有标准化,扩展起来就不容易,因为不同的团队对每个产品都有贡献。设计系统可以作为每个团队建立新资产的基线。有了标准化的外观和感觉,产品在整个组合中被统一为一个家族。
### 从头构建一个设计系统
在收到相关人员提出的为 Ansible 开源社区(如 Ansible Builder、Ansible Runner 和Project Receptor创建徽标的一系列要求后我们决定为我们的工作流程设计一个结构并创建一个单一的事实来源为之努力。
首先我们对现有的徽标进行了视觉审计以确定我们要做的是什么。Ansible 的原始徽标系列由四个主要图像组成:代表 AWX 的 Angry Spud代表 Ansible 核心/引擎的 Ansibull以及代表 AWX 的带翅膀的显示器。大部分的徽标都是用一致的红色阴影和公牛的形象联系在一起的,但是笔画的宽度、笔画的颜色、线条的质量和排版复杂而多样。
![Original Ansible logos][2]
Angry Spud 使用棕褐色的轮廓和手绘风格,而 Ansibull 则是一个对称的几何矢量图。AWX 显示器是一个异类,它有细线画的翅膀,蓝色的矢量矩形,以及古英语字体(这里没有包括在内,但与家族中其他使用现代无衬线的字体相比,它是一个例外)。
### 确立新的设计标准
考虑到调色板、排版和图像,我们产生了一个一致的构图,以 Ansibull 代表所有核心的 Ansible 产品,以及大胆的线条和充满活力的颜色。
![Ansible design system][4]
新的 Ansible 社区徽标设计风格指南详细说明了 Ansible 产品徽标的调色、排版、尺寸、间距和徽标变化。
新的风格指南展示了一种全新的、现代的定制字体,该字体基于瑞士独立字体厂商 [Grilli Type][5] 的 GT America 字体。我们为该字体创造了一个柔和的外观,通过圆润每个字母某些角落来配合图像的圆润度。
我们决定通过在光谱中加入更多的颜色并以原色为基础,设计一个更生动、更饱和、更普遍的调色板。新的调色板以浅蓝色、黄色和粉红色为主色调,每种颜色都有较浅的高光和较深的阴影。这种更广泛的颜色范围使系统内有更多的灵活性,并引入了 3D 的外观和感觉。
![New Ansible logos][6]
我们还引入了新的图像,如 Receptor 和 AWX 徽标中的六边形,以保持视觉上的连续性。最后,我们确保每个徽标在浅色和深色背景上都能使用,以获得最大的灵活性。
### 拓展设计组合
一旦我们建立了核心徽标系列,我们就开始为 Ansible 服务创建徽章,如 Ansible Demo 和 Ansible Workshop。为了将服务与产品区分开来我们决定将服务图形包围在一个圆圈中圆圈中包含了相同的定制排版的服务名称。新的服务徽章显示了幼儿版的 Ansibull来自 Ansible Builder 的徽标)正在完成与每个服务相关的任务,例如 Ansible Demo 指向白板Ansible Workshop 则使用构建工具。
![New Ansible services logos][7]
### 利用开放源码进行设计决策
最初的 AWX 徽标受到了摇滚乐图像的影响,如翅膀和重金属字体(此处省略)。
![Original AWX logo][8]
(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3])
Ansible 社区的一些成员,包括红帽多样性和包容性小组,提请我们注意,这些元素类似于仇恨团体使用的图像。
考虑到原徽标的社会影响,我们必须迅速与 Ansible 社区合作,设计一个替代徽标。我们没有像最初的徽标那样闭门造车,而是扩大了项目的范围,仔细考虑了更多的相关人员,包括 Ansible 社区、红帽多样性和包容性小组,以及红帽法律团队。
我们开始了头脑风暴,向 Ansible 开源社区征求意见。Ansible 的一位工程师 Rebeccah Hunter 在草图绘制阶段做出了贡献,后来成为我们设计团队中的一员。让一大群相关人员参与进来的挑战之一是,我们对新的徽标概念有了各种各样的想法,比如一条辅助电缆、一碗拉面等等。
我们勾画了五个社区贡献的徽标创意,每个徽标都有不同的品牌视觉:一个芽、一个火箭、一个显示器、一碗拉面和一个辅助电缆。
![AWX logo concepts][9]
在完成这些初步的概念草图后,我们建立了一个虚拟的投票机制,并在整个迭代过程中使用。这个投票系统使我们能够利用社区的反馈,从五个初始概念缩小到三个:火箭、一碗拉面和显示器。我们在这三个方向上进一步迭代,并通过专门的 Slack 频道进行反馈,直到我们找到一个符合社区愿景的方向,即 AWX 显示器。
![New AWX logo][10]
以社区的意见为指导,我们围绕显示器为 AWX 打造了徽标概念。我们保留了原徽标中的显示器元素,同时使其外观和感觉现代化,以配合我们更新的设计系统。我们使用了更鲜艳的色调,更简洁的无衬线字体,以及来自 Project Receptor 徽标的元素,包括六角形图案。
通过从一开始就与我们的社区接触,我们能够在公开场合进行设计和迭代,所有相关人员都有一种包容感。最后,我们认为这是取代一个有争议的徽标的最好方法。最终的版本被移交给了红帽法律团队,在获得批准后,我们用这个新的徽标替换了所有的现有资产。
### 主要收获
为设计系统创建一套规则和资源,使你的数字产品全面保持一致,消除品牌混乱,并实现可扩展性。
当你探索在自己的社区建立一个设计系统时,你可能会从我们在这条路上学到的这些关键经验中受益:
* 用设计系统来扩展新的徽标,比没有设计系统要容易得多。
* 当你使用投票系统来验证结果时,杂乱无章的设计方案就会变得不那么令人生畏。
* 将大量受众的注意力引向三套方案,可以消除决策疲劳,集中社区反馈。
我们希望这篇文章能够提供用于开源社区的设计系统的启示,并帮助你认识到在早期开发一个系统的好处。如果你正在创建一个新的设计系统,你有什么问题?如果你已经创建了一个,你学到了什么教训?请在评论中分享你的想法。
*图像来自Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3]*
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/4/ansible-community-logos
作者:[Fiona Lin][a]
选题:[lujun9972][b]
译者:[MareDevi](https://github.com/MareDEvi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/fionalin
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ux-design-mac-laptop.jpg?itok=9-HKgXa9 (UX design Mac computer with mobile and laptop)
[2]: https://opensource.com/sites/default/files/pictures/original_logos.png (Original Ansible logos)
[3]: https://creativecommons.org/licenses/by-sa/4.0/
[4]: https://opensource.com/sites/default/files/pictures/design_system.png (Ansible design system)
[5]: https://www.grillitype.com/
[6]: https://opensource.com/sites/default/files/pictures/new_logos.png (New Ansible logos)
[7]: https://opensource.com/sites/default/files/pictures/new_service_badges.png (New Ansible services logos)
[8]: https://opensource.com/sites/default/files/uploads/awx_original.png (Original AWX logo)
[9]: https://opensource.com/sites/default/files/uploads/awx_concepts.png (AWX logo concepts)
[10]: https://opensource.com/sites/default/files/uploads/awx.png (New AWX logo)

View File

@ -0,0 +1,220 @@
[#]: subject: (Parsing config files with Lua)
[#]: via: (https://opensource.com/article/21/6/parsing-config-files-lua)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
[#]: collector: (lujun9972)
[#]: translator: (hadisi1993)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-15235-1.html)
使用 Lua 解析配置文件
======
![](https://img.linux.net.cn/data/attachment/album/202211/10/084609uq6vvp1vjzqzpc9k.jpg)
> 使用 Lua 配置持久化应用设置。
不是所有的应用都需要配置文件;对很多应用来说,在启动时变得焕然一新对它们更有利。例如,简单的工具就极少需要偏好项和设置在使用过程中保持稳定不变。然而,当你编写一个复杂的应用程序时,如果能让用户设置与应用的交互方式,以及应用与系统交互的方式会很不错。这就是配置文件用来做的事情。本文将讨论一些利用 Lua 进行持久化配置的方法。
### 选择一种格式
关于配置文件很重要的两点是一致性和可预见性。你不会希望为了保存用户偏好项,将信息转储到文件中,然后再花几天去编码实现“逆向工程”,处理最后出现在文件里的随机信息。
这里用一些常用的 [配置文件格式][2]。Lua 有一些库可以处理大多数常用的配置格式;在本文中,我会采用 INI 格式。
### 安装库
Lua 库的核心仓库是 [Luarocks.org][3]。你可以在这个网站搜索库,或者你可以安装并使用 `luarocks` 终端命令。
Linux 环境中,你可以从发行版的软件仓库中下载它,例如:
```
$ sudo dnf install luarocks
```
在 macOS 上,请使用 [MacPorts][4] 或者 [Homebrew][5]。在 Windows 上,请使用 [Chocolatey][6]。
`luarocks` 安装后,你可以使用 `search` 子命令来搜索一个恰当的库。如果你不知道库的名字,可以通过关键词来搜索这个库,例如 `ini`、xml` 或者 `json`,这取决于你想要用这个库做什么。打个比方,你可以搜索 `inifile` 这个库被我用来解析 INI 格式的文本文件。
```
$ luarocks search inifile
Search results:
inifile
1.0-2 (rockspec) - https://luarocks.org
1.0-2 (src) - https://luarocks.org
1.0-1 (rockspec) - https://luarocks.org
[...]
```
一个开发者容易犯的错误是在系统上安装了这个库却忘了把它和应用打包。这会给没有安装这个库的用户带来麻烦。为了防止这个问题发生,可以使用 `--tree` 选项将它安装在项目的本地文件夹中。如果你没有这个项目文件夹,那就先创建这个文件夹再安装库:
```
$ mkdir demo
$ cd demo
$ luarocks install --tree=local inifile
```
`--tree` 选项指示 `luarocks` 创建一个新文件夹并在其中安装你的库,例如这个例子中的 `local` 文件夹。 使用这个简单的技巧,你可以将所有你项目要使用的依赖项直接安装到项目文件夹中。
### 配置代码
首先,在一个名 `myconfig.ini` 的文件中创建一些 INI 数据。
```
[example]
name=Tux
species=penguin
enabled=false
[demo]
name=Beastie
species=demon
enabled=false
```
将这个文件保存到你的主目录下,命名为 `myconfig.ini`, _不要_ 存到项目文件夹下。你通常会希望配置文件独立于你的文件存在,这样当用户卸载你的应用时,使用应用时产生的数据可以保存在系统中。有些用户会删除不重要的配置文件,但大多数不会。最终,如果他们要重装这个应用,还会保留着所有的用户偏好项。
配置文件的位置以技术来说并不重要,但每一个操作系统都有存储它们的特定或者默认的路径。在 Linux 中,这个路径由 [Freedesktop 规范][7] 指定。它规定配置文件被保存在一个名为 `~/.config` 的隐藏文件夹中。为了操作时更加清晰明确,可以在主目录下存储配置文件,以便于使用和寻找。
创建第二个文件,命名为 `main.lua`,并在你喜欢的文本编辑器中打开它。
首先,你必须告诉 Lua 你将想要使用的附加库放置在哪里。`package.path` 变量决定了 Lua 到哪里去寻找这些库。你可以从终端中查看 Lua 默认的包地址:
```
$ Lua
> print(package.path)
./?.lua;/usr/share/lua/5.3/?.lua;/usr/share/lua/5.3/?/init.lua;/usr/lib64/lua/5.3/?.lua;/usr/lib64/lua/5.3/?/init.lua
```
在你的 Lua 代码中,将你本地库的路径添加到 `package.path` 中:
```
package.path = package.path .. ';local/share/lua/5.3/?.lua
```
### 使用 Lua 解析 INI 文件
当包的位置确定以后,下一件事就是引入 `inifile` 库并处理一些操作系统逻辑。即使这是一个很简单的应用,代码也需要从操作系统获取到用户主目录的路径,并建立在必要时将文件系统路径返回给操作系统的通信方式。
```
package.path = package.path .. ';local/share/lua/5.3/?.lua
inifile = require('inifile')
-- find home directory
home = os.getenv('HOME')
-- detect path separator
-- returns '/' for Linux and Mac
-- and '\' for Windows
d = package.config:sub(1,1)
```
现在你可使用 `inifile` 来从配置文件解析数据到 Lua 表中。一旦这些数据被导入进表中,你可以像查询其他的 Lua 表一样查询它。
```
-- parse the INI file and
-- put values into a table called conf
conf = inifile.parse(home .. d .. 'myconfig.ini')
-- print the data for review
print(conf['example']['name'])
print(conf['example']['species'])
print(conf['example']['enabled'])
```
在终端中运行代码可以看见结果:
```
$ lua ./main.lua
Tux
penguin
false
```
这看起来是正确的。试试在 `demo` 块中执行同样的操作。
### 使用 INI 格式存储数据
不是所有用来解析的库都会读写数据(通常被称为 _编码 和 _解码_),但是 `inifile` 会这样做。这意味着你可以使用它对配置文件进行修改。
为了改变配置文件中的值,你可以对被解析的表中的变量进行设置,然后把表重写回配置文件中。
```
-- set enabled to true
conf['example']['enabled'] = true
conf['demo']['enabled'] = true
-- save the change
inifile.save(home .. d .. 'myconfig.ini', conf)
```
现在再来看看配置文件:
```
$ cat ~/myconfig.ini
[example]
name=Tux
species=penguin
enabled=true
[demo]
name=Beastie
species=demon
enabled=true
```
### 配置文件
按照用户的设想来存储数据对程序来说是至关重要的。幸运的是,这对工程师来说是一个很常规的任务,大多数工作可能早已被完成了。只要找到一个好用的库完成开放格式下编码和解码,你就能为用户提供一致且持续的体验。
以下是完整的演示代码,可供参考。
```
package.path = package.path .. ';local/share/lua/5.3/?.lua'
inifile = require('inifile')
-- find home directory
home = os.getenv('HOME')
-- detect path separator
-- returns '/' for Linux and Mac
-- and '\' for Windows
d = package.config:sub(1,1)
-- parse the INI file and
-- put values into a table called conf
conf = inifile.parse(home .. d .. 'myconfig.ini')
-- print the data for review
print(conf['example']['name'])
print(conf['example']['species'])
print(conf['example']['enabled'])
-- enable Tux
conf['example']['enabled'] = true
-- save the change
inifile.save(home .. d .. 'myconfig.ini', conf)
```
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/6/parsing-config-files-lua
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[hadisi1993](https://github.com/hadisi1993)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_women_computing_2.png?itok=JPlR5aCA (坐在电脑前的女人)
[2]: https://opensource.com/article/21/6/config-files-and-their-formats
[3]: https://opensource.com/article/19/11/getting-started-luarocks
[4]: https://opensource.com/article/20/11/macports
[5]: https://opensource.com/article/20/6/homebrew-mac
[6]: https://opensource.com/article/20/3/chocolatey
[7]: https://www.freedesktop.org/wiki/Specifications
[8]: http://www.opengroup.org/onlinepubs/009695399/functions/getenv.html

View File

@ -0,0 +1,486 @@
[#]: subject: "For the Love of Ubuntu: Here are the Mascots of All Ubuntu Releases"
[#]: via: "https://itsfoss.com/all-Ubuntu-mascots/"
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
[#]: collector: "lkxed"
[#]: translator: "chai001125"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15240-1.html"
Ubuntu 所有版本的吉祥物
======
![](https://img.linux.net.cn/data/attachment/album/202211/11/130502q6500yvm0znvktz9.jpg)
> 在这篇文章中,我们会介绍迄今为止所有 Ubuntu 发行版本的吉祥物。
你可能已经注意到了:每个 Ubuntu 版本都会有一个版本名称和代号。代号由两个单词组成,这两个单词有相同的首字母,第一个单词是形容词,另一个单词通常是一个濒危的物种名称。
对应于其代号,这些 Ubuntu 版本也有一个吉祥物。例如Ubuntu 22.04 的代号为 “Jammy Jellyfish”因此 Ubuntu 22.04 的桌面壁纸上有 **吉祥物:水母** 的图像。
但是实际上,这些“吉祥物”并不总是 Ubuntu 版本的一部分,因为吉祥物在早期的 Ubuntu 版本中是没有的。
有史以来第一个 Ubuntu 版本是在 2004 年 10 月发布的 4.10 版LCTT 译注Ubuntu 的版本号是由年份和月份的组合来表示的。)但是,直到 Ubuntu 8.04 LTS “Hardy Heron” 版本,你才会看到相关的吉祥物。
在我之前写的 [另一篇文章][1] 中,我整理了所有 Ubuntu 版本的默认壁纸。在本文中,你将了解到所有 Ubuntu 版本的吉祥物。
现在,就让我们按时间倒序,一起进入 Ubuntu 的吉祥物之旅吧。
LCTT 校注本文原文发表时Ubuntu 22.10 尚未发布,它的代号是 “Kinetic Kudu”吉祥物是“捻角羚”。
LCTT 校注:由于 Ubuntu 系列的代号和吉祥物选择的都是比较少见的动物和晦涩的描述,因此尽管译者和校对虽然尽力了,但是应该还有谬误。我觉得原文作者为了找出这些说明也尽力,恐怕真正权威的诠释只有 Canonical 才能给出吧。)
### Ubuntu 22.04 Jammy Jellyfish幸运水母
![Ubuntu 22.04 mascot][2]
于 2021 年 4 月 21 日发布。
Jammy 的意思是被果酱覆盖着的、充满果酱的。不太正式地Jammy 还有**幸运**的意思。
<ruby>水母<rt> Jellyfish </rt></ruby> 是一种自由游动的水生动物,它的身体就像是一把透明伞,还具有拖曳的触须。少数水母是通过茎干固定在海床上,而不能移动。全世界的海洋中有超过两百种的水母,它们分布于全球各地的水域里。
### Ubuntu 21.10 Impish Indri顽皮大狐猴
![Ubuntu 21.10 mascot][3]
于 2021 年 10 月 14 日发布。
Impish 的意思是以**顽皮**而不是严肃的方式,对某人/某事不太尊重。
<ruby>大狐猴<rt> Indri </rt></ruby>,也称为 babakoto是现存的最大的狐猴之一。它的头身长约 64 至 72 厘米,体重在 6 至 9.5 公斤之间。它的毛发是黑白相间的。在攀爬或攀爬时,它会保持竖直的姿势。
> 据维基2014 年的世界自然保护联盟IUCN <ruby>红色名录<rt> Red List </rt></ruby> 中,仅出现在马达加斯加的大狐猴首次被提升至极危级别。
### Ubuntu 21.04 Hirsute Hippo多毛河马
![Ubuntu 21.04 mascot][4]
于 2021 年 4 月 22 日发布。
Hirsute 的意思是**多毛的**。
<ruby>河马<rt> Hippo </rt></ruby>,是一种生活在非洲大陆撒哈拉以南的大型半水生哺乳动物。河马是河马科中仅有的两个现存物种之一,另一个物种是 <ruby>侏儒河马<rt> pygmy hippopotamus </rt></ruby>。河马的名字来源于古希腊语“river horse”。
> 据维基:在 2006 年 5 月已被 IUCN 红色名录中分为易危物种,世界仅存约 12.5 万15 万头
但是其实,我并没有见过很多多毛的河马 😅。
### Ubuntu 20.10 Groovy Gorilla时髦大猩猩
![Ubuntu 20.10 mascot][5]
于 2020 年 10 月 22 日发布。
Groovy 的意思是**时尚的**和令人兴奋的。
<ruby>大猩猩<rt> Gorilla </rt></ruby>,是一种草​​食性的地栖巨猿。它主要栖息在赤道非洲的热带森林中。大猩猩属分为两个物种:东部大猩猩和西部大猩猩,以及进一步可分为四个或五个亚种。
### Ubuntu 20.04 LTS Focal Fossa瞩目狸猫
![Ubuntu 20.04 mascot][6]
于 2020 年 4 月 23 日发布。
Focal 的意思是令人注目的、**瞩目**。
<ruby>马岛长尾狸猫<rt> Fossa </rt></ruby>,是**马达加斯加岛上最大的食肉性哺乳动物**。它身体的长度可以达到近六英尺,其中它们的长尾巴占了一半。它们看起来就像是猫、狗和獴的杂交体。它们有细长的身体、肌肉发达的四肢和短的红棕色毛发。
### Ubuntu 19.10 Eoan Ermine东方白鼬
![Ubuntu 19.10 mascot][7]
于 2019 年 10 月 17 日发布。
Eoan 的意思是**与黎明或东方有关的**。
<ruby>白鼬<rt> Stoat </rt></ruby>,也被称为欧亚貂、白令貂,简称 <ruby><rt> Ermine </rt></ruby>,是一种原产于欧亚大陆和北美北部的鼬科动物。由于鼬在极地广泛分布,因此它被 IUCN 列为最不担忧灭绝的物种。
> 据维基IUCN 将其列为世界百大外来入侵种。
### Ubuntu 19.04 Disco Dingo迪斯科野犬
![Ubuntu 19.04 mascot][8]
于 2019 年 4 月 18 日发布。
Disco 与**迪斯科**音乐和夜总会有关。
<ruby>澳洲野犬<rt> Dingo </rt></ruby>,是在澳大利亚发现的一种古老的犬种。澳洲野犬的科属分类在不同出版物中不太一样,因此它的科属分类存在争议。
### Ubuntu 18.10 Cosmic Cuttlefish外星墨鱼
![Ubuntu 18.10 mascot][9]
于 2018 年 10 月 18 日发布。
Cosmic 意味着与地球**不同的**、宇宙的。
<ruby>墨鱼<rt> Cuttlefish </rt></ruby>,是乌贼目的一种海洋软体动物。它属于头足类,这一类还包含了鱿鱼、章鱼和鹦鹉螺。墨鱼有一个独特的内壳,即墨鱼骨,它可以用于控制浮力。
### Ubuntu 18.04 LTS Bionic Beaver仿生河狸
![Ubuntu 18.04 mascot][10]
于 2018 年 4 月 26 日发布。
Bionic 意味着**仿生的**,或者是机电的。
<ruby>河狸<rt> Beaver </rt></ruby>,是北半球温带的一种大型半水生啮齿动物。有两种现存的海狸:北美河狸和欧亚河狸。河狸是仅次于水豚的现存第二大啮齿动物。
> 据维基:它们处于 IUCN 哺乳动物红色名录中的无危物种,在中国河狸被列为一级保护动物。
英国用户认为这个版本的名称特别有趣。
### Ubuntu 17.10 Artful Aardvark机灵土豚
![Ubuntu 17.10 mascot][11]
于 2017 年 10 月 19 日发布。
Ubuntu 在此版本中默认切换回了 GNOME。
Artful 的意思是聪明的或**机灵的**。
<ruby>土豚<rt> Aardvark </rt></ruby>,是一种原产于非洲的穴居、夜间活动的中型哺乳动物。它是管齿目中唯一的现存物种。与大多数其他食虫动物不同,它有一个长长的像猪一样的鼻子,可以闻出食物在哪里。
### Ubuntu 17.04 Zesty Zapus开心跳鼠
![Ubuntu 17.04 mascot][12]
于 2017 年 4 月 13 日发布。
这个版本是最后一个以 Unity 桌面为特色的版本。
Zesty 意味着有一种强烈的、**令人开心的**、有点辛辣的味道。
<ruby>跳鼠<rt>Zapus</rt></ruby> 是北美跳鼠中唯一一个有牙齿的一个属。跳鼠是除 <ruby>指猴<rt> Aye-aye </rt></ruby>之外,唯一现存的有 18 颗牙齿的哺乳动物。
### Ubuntu 16.10 Yakkety Yak唠叨牦牛
![Ubuntu 16.10 mascot][13]
于 2016 年 10 月 13 日发布。
Yakkety 有很多意思。OMG Ubuntu 说“yakking” 有唠唠叨叨这一非正式意思yakkety 还可能是一种知名的流行爵士乐器 “Yakety Sax” 的另一种拼写。
<ruby>牦牛<rt> Yak </rt></ruby>,是一种大型驯养的野牛。它的毛发蓬松,肩部隆起,有很大的角。在一些地方它是一种驮畜,人们也可以食用它的奶和肉、以及加工它的皮制作东西。
### Ubuntu 16.04 LTS Xenial Xerus好客地松鼠
![Ubuntu 16.04 mascot][14]
于 2016 年 4 月 21 日发布。
Xenial 的意思是**热情好客的**。
<ruby>非洲地松鼠<rt> Xerus </rt></ruby>,有四个亚种,分别是**开普地松鼠,条纹地松鼠,山地松鼠和无条纹地松鼠**。这些动物是昼行性的,是食草动物,通常吃坚果、根和种子。然而,有时它们也会吃蛋类和其他小动物。
### Ubuntu 15.10 Wily Werewolf狡猾狼人
![Ubuntu 15.10 mascot][15]
于 2015 年 10 月 22 日发布。
这个版本可能是少有的发布代号中带有虚构动物的 Ubuntu 版本之一。
Wily 的意思是善于获得优势,尤其在欺骗上十分**狡猾的**。
<ruby>狼人<rt> Werewolf </rt></ruby>,是可以隐藏住耳朵和尾巴的一种神话生物。它是人,也是狼,大多数人因为它们的长相而害怕它们。
### Ubuntu 15.04 Vivid Vervet活泼绿猴
![Ubuntu 15.04 mascot][16]
于 2015 年 4 月 23 日发布。
Vivid 的意思是**活泼**的、明亮的。
<ruby>黑长尾猴<rt> Vervet monkey </rt></ruby>是一种原产于非洲的角猿科的旧大陆猴。“vervet”一词也用于表示<ruby>绿猴属<rt> Chlorocebus </rt></ruby>的所有动物,其中包含五个不同的亚种,这五个不同的亚种主要分布在南部非洲以及一些东部国家。
### Ubuntu 14.10 Utopic Unicorn乌托邦独角兽
![Ubuntu 14.10 mascot][17]
于 2014 年 10 月 23 日发布。
这个版本是另一个其发布代号中带有虚构动物的 Ubuntu 版本。
Utopic 与**乌托邦**有关,乌托邦是一个虚构的、不存在但是一个理想的地方。
<ruby>独角兽<rt> Unicorn </rt></ruby>,是一种传说中的生物。自古以来,它就被描述为前额有一个巨大的、尖的、螺旋状的角的一种野兽。
### Ubuntu 14.04 LTS Trusty Tahr可靠塔尔羊
![Ubuntu 14.04 mascot][18]
于 2014 年 4 月 17 日发布。
Trusty 意味着**可靠的**或忠实的。
<ruby>塔尔羊<rt> Tahr </rt></ruby>,是一种很像山羊的哺乳动物。它们会栖息在阿曼、印度南部和喜马拉雅山脉的悬崖和山坡上。
### Ubuntu 13.10 Saucy Salamander活泼蝾螈
![Ubuntu 13.10 mascot][19]
于 2013 年 10 月 17 日发布。
Saucy 意味着大胆的、**活泼的**或精神饱满的。
<ruby>蝾螈<rt> Salamander </rt></ruby>是一类两栖动物。其典型特征是有着蜥蜴般的外观,它们有细长的身体,钝的鼻子,以及与身体成直角突出的短肢,并且幼体和成体都有尾巴。现存的所有十个蝾螈科都属于有尾目。
### Ubuntu 13.04 Raring Ringtail热情猫熊
![Ubuntu 13.04 mascot][20]
于 2013 年 4 月 25 日发布。
Raring 的意思是热情的和**非常渴望做某事**。
<ruby>猫熊<rt> Ringtail </rt></ruby>,是**一种像猫一样大的食肉动物,类似于一只长着浣熊尾巴的小狐狸**。它浓密的尾巴是扁平的,几乎和头部和身体一样长,有黑白交替的环。它们是夜行动物,一天中的大部分时间都在它们的巢穴里睡觉。
### Ubuntu 12.10 Quantal Quetzal量子大咬鹃
![Ubuntu 12.10 mascot][21]
于 2012 年 10 月 18 日发布。
Quantal 意味着与**量子**或量子理论有关的。
<ruby>大咬鹃<rt> Quetzal </rt></ruby>,是咬鹃家族中的一种色彩鲜艳的鸟类。它们生活在森林中,主要是在潮湿的高地。来自*凤尾绿咬鹃属*的五种物种生活在新热带的,而另外一个物种,即角咬鹃,生活在墨西哥和美国最南端的局部地区。大咬鹃相当地大,它们的身体长度超过 32 厘米或者有 13 英寸长,比其他咬鹃科的物种都大。绚丽的大咬鹃因其鲜艳的色彩,而成为危地马拉的国鸟。
### Ubuntu 12.04 LTS Precise Pangolin精准穿山甲
![Ubuntu 12.04 mascot][22]
于 2012 年 4 月 26 日发布。
Precise 意味着能**精确**或准确地表达细节。
<ruby>穿山甲<rt> Pangolin </rt></ruby>,有时被称为有鳞食蚁兽,是鳞甲目的一种哺乳动物。它现存的一个科是穿山甲科,有三个属:穿山甲亚属、长尾穿山甲亚属和地穿山甲亚属。穿山甲亚属包括在亚洲发现的四种物种,而长尾穿山甲亚属和地穿山甲亚属各包括两种物种,均在撒哈拉以南非洲发现。
> 据维基百科2014 年IUCN 红色名录物种存续委员会穿山甲专门小组,指出穿山甲是目前全世界最常被走私买卖的哺乳动物。所有穿山甲都面临巨大的生存威胁,其中中华穿山甲和马来穿山甲被 IUCN 评估为“极危”物种,非法走私的活动极为猖獗。随着亚洲的 4 种穿山甲数量锐减,走私贸易商家已转移目标至非洲,以满足市场上的庞大需求。
### Ubuntu 11.10 Oneiric Ocelot梦幻豹猫
![Ubuntu 11.10 mascot][23]
于 2011 年 10 月 13 日发布。
Oneiric 的意思是与**梦**有关的。
<ruby>豹猫<rt> Ocelot </rt></ruby>,是一种中等大小的斑点野猫。它的肩长可达 40 至 50 厘米,体重在 8 至 15.5 公斤之间。<ruby>卡尔·林奈<rt>Carl Linnaeus</rt></ruby> 于 1758 年首次在书中描述了它。
> 据维基:华盛顿公约将孟加拉国、印度以及泰国的豹猫族群列入附录一禁止进行国际贸易,而其他族群亦列入华盛顿公约附录二。
### Ubuntu 11.04 Natty Narwhal聪明独角鲸
![Ubuntu 11.04 mascot][24]
于 2011 年 4 月 28 日发布。
这个版本是第一个采用 Unity 桌面的版本。
Natty 意味着**聪明**和时尚的。
<ruby>独角鲸<rt> Narwhal </rt></ruby>,是一种中等大小的齿鲸。拥有一颗突出的犬齿的大“獠牙”。它常年生活在格陵兰、加拿大和俄罗斯周围的北极水域。它是一角鲸科中现存的两种鲸鱼物种之一,另一个物种是 <ruby>白鲸<rt> Beluga whale </rt></ruby>
### Ubuntu 10.10 Maverick Meerkat独行猫鼬
![Ubuntu 10.10 mascot][25]
于 2010 年 10 月 10 日发布。
Maverick 的意思是**特立独行的**或有独立思想的。
<ruby>猫鼬<rt> Meerkat </rt></ruby>,是一种在南部非洲发现的小型猫鼬。它的特点是头宽、眼睛大、鼻子尖、腿长、尾巴很细,毛色有斑纹。
### Ubuntu 10.04 LTS Lucid Lynx清醒猞狸
![Ubuntu 10.04 mascot][26]
于 2010 年 4 月 29 日发布。
Lucid 意味着**易于理解的**或明亮的。
<ruby>猞猁<rt> Lynx </rt></ruby>,是中型野猫属猞猁中的一种。猞猁这个名字起源于中古英语,源自希腊语 λύγξ,λύγξ 又源自于印欧语词根 leuk-,指的是它眼睛能反射发光的样子。
### Ubuntu 9.10 Karmic Koala幸运考拉
![Ubuntu 9.10 mascot][27]
于 2009 年 10 月 29 日发布。
Karmic 意味着与**命运**、业力有关。
<ruby>考拉<rt> Koala </rt></ruby>,是一种原产于澳大利亚的树栖草食性的有袋动物。它是袋鼠科唯一现存的物种,它的近亲是<ruby>袋熊<rt> Wombat </rt></ruby>
> 据维基:在 19 世纪初树袋熊遭到捕杀出口,数量由百万只锐减至一千多只,于是澳大利亚政府立法保护。
### Ubuntu 9.04 Jaunty Jackalope自信鹿角兔
![Ubuntu 9.04 mascot][28]
于 2009 年 4 月 23 日发布。
这个版本是我用的第一个 Ubuntu 版本。
Jaunty 是指拥有活泼、开朗和**自信**的态度。
<ruby>鹿角兔<rt> Jackalope </rt></ruby>,是**北美民间传说中的一种神话动物**被描述为长着羚羊角的可怕的长角兔。Jackalope 这个词是由 jackrabbit 和 antelope 组合而成的。许多鹿角兔的标本都是由用鹿角制成的。
### Ubuntu 8.10 Intrepid Ibex无畏野山羊
![Ubuntu 8.10 mascot][29]
于 2008 年 10 月 30 日发布。
Intrepid 意味着**无所畏惧**、冒险的。
<ruby>野山羊<rt> Ibex </rt></ruby>,以雄性的大弯角为特征,在前面形成像横向的脊那样。它主要分布于欧亚大陆、北非和东非。
### Ubuntu 8.04 LTS Hardy Heron坚韧苍鹭
![Ubuntu 8.04 mascot][30]
于 2008 年 4 月 24 日发布。
这个版本是第一个吉祥物出现在其默认壁纸上的 Ubuntu 版本。
Hardy 意味着能够**忍受**困难条件的、强大的。
<ruby>苍鹭<rt> Heron </rt></ruby>,是一种长腿、长颈、生活在淡水和沿海的鸟类。
### Ubuntu 7.10 Gutsy Gibbon阵风长臂猿
![Ubuntu 7.10 mascot][31]
于 2007 年 10 月 18 日发布。
Gusty 表示以**阵风**的方式吹动。
<ruby>长臂猿<rt> Gibbon </rt></ruby>,是一种猿类,它们生活在孟加拉国东部、印度东北部、中国南部和印度尼西亚的亚热带和热带雨林地区。
### Ubuntu 7.04 Feisty Fawn活泼小鹿
![Ubuntu 7.04 mascot][32]
于 2007 年 4 月 19 日发布。
Feisty 意味着**小而坚定**的。
<ruby>小鹿<rt> Fawn </rt></ruby>,指的是第一年刚出生的小鹿。
### Ubuntu 6.10 Edgy Eft紧张水蜥
![Ubuntu 6.10 mascot][33]
于 2006 年 10 月 26 日发布。
Edgy 的意思是**紧张的**。
<ruby>水蜥<rt> Eft </rt></ruby>,是蝾螈的陆生幼年期。蝾螈是一种蜥蜴,它具有三个不同的发育生命阶段:水生幼虫、陆生幼体和成体。
所以水蜥指的是一个青年的蝾螈。
### Ubuntu 6.06 Dapper Drake整洁公鸭
![Ubuntu 6.06 mascot][34]
于 2006 年 6 月 1 日发布。
Dapper 的意思是衣着整洁,**外表整洁的**。
<ruby>公鸭<rt> Drake </rt></ruby>,是完全性成熟的成年雄性鸭子。
### Ubuntu 5.10 Breezy Badger微风之獾
![Ubuntu 5.10 mascot][35]
于 2005 年 10 月 12 日发布。
Breezy 的意思是有**微风**的。
<ruby><rt> Badger </rt></ruby>,一种是短腿的杂食动物,经常蹲下身挤在一起。
### Ubuntu 5.04 Hoary Hedgehog灰白刺猬
![Ubuntu 5.04 mascot][36]
于 2005 年 4 月 8 日发布。
Hoary 是**灰白色的**意思。
<ruby>刺猬<rt> Hedgehogis </rt></ruby>,是一种多刺的哺乳动物,遍布于欧洲、亚洲和非洲的部分地区,并引入到了新西兰。
### Ubuntu 4.10 : Warty Warthog有疣疣猪
![Ubuntu 4.10 mascot][37]
于 2004 年 10 月 20 日发布。
Ubuntu 就是从这个版本开始的。
Wart 是由病毒引起的一种小的、坚硬的、良性的皮肤生长物。Warty 的意思是**长满疣的**。
<ruby>疣猪<rt> Warthog </rt></ruby>,是猪科的一种野生动物,它是在撒哈拉以南非洲的草原、稀树草原和林地中被发现的。
### 总结
本文有没有让 Ubuntu 用户了解了更多知识呢?从技术上讲,并没有,但回顾历史是件好事。如果你多年来一直是 Ubuntu 用户,那么这篇文章可能会引发你的怀旧之情。
Ubuntu 9.04 是我第一次尝试 Linux 桌面。如果我没记错的话,那是在 2009 年 9 月下旬。仅仅几周后,我的系统就升级到了 Ubuntu 9.10。那些天我经常在 Ubuntu 论坛上浏览,探索这个新的操作系统,并学习新的东西。
那么,这篇文章有没有勾起你的一些美好的回忆呢?你的第一个 Ubuntu 版本又是哪个呢?在评论区中分享你的 Ubuntu 使用经历吧。
--------------------------------------------------------------------------------
via: https://itsfoss.com/all-Ubuntu-mascots/
作者:[Abhishek Prakash][a]
选题:[lkxed][b]
译者:[chai001125](https://github.com/chai001125)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/abhishek/
[b]: https://github.com/lkxed
[1]: https://itsfoss.com/Ubuntu-default-wallpapers-download/
[2]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-22-04-mascot.jpg
[3]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-21-10-mascot.jpg
[4]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-21-04-mascot.jpg
[5]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-20-10-mascot.jpg
[6]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-20-04-mascot-1.jpg
[7]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-19-10-mascot.jpg
[8]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-19-04-mascot.jpg
[9]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-18-10-mascot.jpg
[10]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-18-04-mascot.jpg
[11]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-17-10-mascot.jpg
[12]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-17-04-mascot.jpg
[13]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-16-10-mascot.jpg
[14]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-16-04-mascot.jpg
[15]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-15-10-mascot.jpg
[16]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-15-04-mascot.jpg
[17]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-14-10-mascot.jpg
[18]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-14-04-mascot.jpg
[19]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-13-10-mascot.jpg
[20]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-13-04-mascot.jpg
[21]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-12-10-mascot.jpg
[22]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-12-04-mascot.jpg
[23]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-11-10-mascot.jpg
[24]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-11-04-mascot.jpg
[25]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-10-10-mascot.jpg
[26]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-10-04-mascot.jpg
[27]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-9-10-mascot.jpg
[28]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-9-04-mascot.jpg
[29]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-8-10-mascot.jpg
[30]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-8-04-mascot.jpg
[31]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-7-10-mascot.jpg
[32]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-7-04-mascot.jpg
[33]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-6-10-mascot.jpg
[34]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-6-06-mascot.jpg
[35]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-5-10-mascot.jpg
[36]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-5-04-mascot.jpg
[37]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-4-10-mascot.jpg

View File

@ -3,27 +3,28 @@
[#]: author: "Don Watkins https://opensource.com/users/don-watkins"
[#]: collector: "lkxed"
[#]: translator: "chai001125"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15215-1.html"
新手教程:12 个重要的 Linux 命令
12 个对新手最重要的 Linux 命令
======
我向所有的 Linux 初学者推荐以下这些命令。
![Command line prompt][1]
> 我向所有的 Linux 初学者推荐以下这些命令。
在使用 Linux 命令行时,很容易就会迷失方向,这可能会导致灾难性的后果:我有一次使用 <ruby> 删除命令<rt> `rm` command </rt> </ruby> 删除文件,然而删除之后我才意识到我刚刚是删除了计算机的引导目录。后来,我学会了使用 `pwd` 命令,来知道当前在文件系统的哪个目录下;并且我使用了 [trashy 和 trash-cli][2] 这一命令行回收站工具,在删除文件时 trash-cli 会充当中间人,将文件先“删除”到桌面上的垃圾箱中,能够通过垃圾箱或通过终端的 `trash` 命令,来恢复垃圾箱中已删除的文件。
![](https://img.linux.net.cn/data/attachment/album/202211/05/092308plqfl6a6z0g7afx7.jpg)
当我刚开始使用 Linux 时,我有一个放在桌子上的“作弊小抄”,它就是 <ruby> *《101 条你应该知道的 Linux 命令》*<rt> 101 commands for Linux </rt> </ruby> ,我在管理 Linux 服务器时能参考“作弊小抄”上面的这些命令。随着我越来越熟悉这些命令,我越来越精通服务器管理了。
在使用 Linux 命令行时,很容易就会迷失方向,这可能会导致灾难性的后果:我有一次使用删除命令 `rm` 删除文件,然而删除之后我才意识到我刚刚是删除了计算机的引导目录。后来,我学会了使用 `pwd` 命令,来知道当前在文件系统的哪个目录下;并且我使用了 [trashy 和 trash-cli][2] 这一命令行回收站工具LCTT 译注:在删除文件时 `trash-cli` 会充当中间人,将文件先“删除”到桌面上的垃圾箱中,能够通过垃圾箱或通过终端的 `trash` 命令,来恢复垃圾箱中已删除的文件。)
当我刚开始使用 Linux 时我有一个放在桌子上的“速查表”它就是《101 条你应该知道的 Linux 命令》,我在管理 Linux 服务器时能参考速查表上面的这些命令。随着我越来越熟悉这些命令,我越来越精通服务器管理了。
以下是我认为最有用的 12 个 Linux 命令。
### 1. 打印工作目录pwd
### 1打印工作目录pwd
`pwd` 命令会打印出你的工作目录。换句话来说,它输出你当前所在目录的路径。`pwd` 命令有两种选项:`-L`(即逻辑路径 logical) 用来打印当前的目录路径(不考虑符号链接),`-P` (即物理路径 physical)会解析符号链接,并打印出物理目录。你可以进一步阅读我们翻译的 [另一篇文章](https://linux.cn/article-4356-1.html)
`pwd` 命令会打印出你的工作目录。换句话来说,它输出你当前所在目录的路径。`pwd` 命令有两种选项:`-L``--logical`(即逻辑路径)用来打印当前的目录路径(不解析符号链接),`-P` 或 `--physial`即物理路径会打印出解析符号链接后的物理目录。LCTT 译注:你可以进一步阅读我们翻译的 [另一篇文章](https://linux.cn/article-4356-1.html)。)
### 2. 创建目录mkdir
### 2创建目录mkdir
使用 `mkdir` 命令来创建一个新目录,是非常容易的。以下命令,创建了一个名为 `example` 目录(若 `example` 已存在,则无法创建):
@ -37,23 +38,23 @@ $ mkdir example
$ mkdir -p example/one/two
```
如果目录 `example` 和目录 `one` 都已存在,则仅会创建目录 `two`。如果上述目录都不存在,则会创建三个嵌套目录。
如果目录 `example` 和目录 `one` 都已存在,则仅会创建目录 `two`。如果上述目录都不存在,则会创建三个嵌套目录。
### 3. 列出文件ls
### 3列出文件ls
我最早使用的是 MS-DOS微软磁盘操作系统因此我习惯于使用 `dir` 命令,来列出文件。我不记得当时是否能在 Linux 上使用 `dir` 命令,但是如今 `dir` 命令已经包含在 <ruby> GNU 核心实用程序包 <rt> GNU Core Utilities package </rt></ruby> 中了。大多数人会使用 `ls` 命令,来显示目录中的文件及其所有的属性。`ls` 命令有许多选项,包括 `-l` 查看文件的长列表,显示文件所有者和权限等信息。
我最早使用的是 MS-DOS微软磁盘操作系统因此我习惯于使用 `dir` 命令,来列出文件。我不记得当时是否能在 Linux 上使用 `dir` 命令,但是如今 `dir` 命令已经包含在 <ruby>GNU 核心实用程序包<rt>GNU Core Utilities package</rt></ruby> 中了。大多数人会使用 `ls` 命令,来显示目录中的文件及其所有的属性。`ls` 命令有许多选项,包括 `-l` 查看文件的长列表,显示文件所有者和权限等信息。
### 4. 更改当前工作目录cd
### 4更改当前工作目录cd
在 Linux 中经常要更改当前工作目录,这就是 `cd` 命令的功能。例如,以下的示例将让你从 <ruby> 主目录 <rt> home </rt></ruby>进入 `Documents` 目录:
在 Linux 中经常要更改当前工作目录,这就是 `cd` 命令的功能。例如,以下的示例将让你从 <ruby>主目录<rt>home</rt></ruby> 进入 `Documents` 目录:
```
$ cd Documents
```
你可以使用 `cd ~`或者`cd`,来快速转换到你的 <ruby> 主目录 <rt> home </rt></ruby>。你可以使用 `cd ..` 来返回到上一级目录。
你可以使用 `cd ~` 或者 `cd`,来快速转换到你的主目录。你可以使用 `cd ..` 来返回到上一级目录。
### 5. 删除文件rm
### 5删除文件rm
删除文件是很危险的,因为在 Linux 终端上用 `rm` 命令会**彻底地**删除文件,并没有像桌面的垃圾桶那样依旧保存着删除的文件。许多终端用户有一个坏习惯,他们会永久地删除他们认为不再需要的文件。然而,因为没有“取消删除”命令,这个坏习惯可能会导致严重的问题:你会不小心删除了包含重要数据的目录。
@ -63,15 +64,15 @@ Linux 系统为文件删除提供了 `rm` 和 `shred` 命令。要删除文件 `
$ rm example.txt
```
然而,使用 trash 命令要安全得多,例如[trashy][3] 或者 [trash-cli][4],它会将文件先“删除”到桌面上的垃圾箱中:
然而,使用 `trash` 命令要安全得多,例如 [trashy][3] 或者 [trash-cli][4],它会将文件先“删除”到桌面上的垃圾箱中:
```
$ trash example.txt
```
关于 Trash-Cli 的更多信息可以参考我们翻译的 [另一篇文章](https://linux.cn/article-10029-1.html)。
LCTT 译注:关于 Trash-Cli 的更多信息可以参考我们翻译的 [另一篇文章](https://linux.cn/article-10029-1.html)。
### 6. 复制文件cp
### 6复制文件cp
使用 `cp` 命令,来复制文件。`cp` 的语法是从*旧文件*复制到*新文件*。这里有一个例子:
@ -85,7 +86,7 @@ $ cp file1.txt newfile1.txt
$ cp -r dir1 newdirectory
```
### 7. 移动并重命名文件mv
### 7移动并重命名文件mv
重命名和移动文件在功能上是相同的过程。当你移动文件时,从一个目录中取出一个文件,并将其放入一个新目录中;当你重命名文件时,将一个目录中的文件更改为新名称,并放回到同一目录或另一个目录下。无论是重命名还是移动文件,你都可以使用 `mv` 命令:
@ -93,7 +94,7 @@ $ cp -r dir1 newdirectory
$ mv file1.txt file_001.txt
```
### 8. 创建一个空文件touch
### 8创建一个空文件touch
使用 `touch` 命令可以简单地创建一个空文件:
@ -105,7 +106,7 @@ $ touch two.txt
$ touch three.md
```
### 9. 更改权限chmod
### 9更改权限chmod
使用 `chmod` 命令,来更改文件的权限。`chmod` 最常见的用途是让文件能够执行:
@ -124,9 +125,9 @@ $ ./hello.sh
Hello, Don
```
### 10. 提升为 root 权限sudo
### 10提升为 root 权限sudo
在管理自己的 Linux 系统时,可能需要提升为超级用户(也称为 root这就是 `sudo`(即 *super user do*)命令的来源。假设你想要做一些只有管理员(或 root 用户)才能做的事情,只需在命令前加一个 `sudo` 即可:
在管理自己的 Linux 系统时,可能需要提升为超级用户(也称为 root这就是 `sudo`(即 <ruby>以超级用户做<rt>super user do</rt></ruby>)命令的来源。假设你想要做一些只有管理员(或 root 用户)才能做的事情,只需在命令前加一个 `sudo` 即可:
```
$ touch /etc/os-release && echo "Success"
@ -136,7 +137,7 @@ $ sudo touch /etc/os-release && echo "Success"
Success
```
### 11. 关机poweroff
### 11关机poweroff
`poweroff` 命令的功能和它的字面意思一样:把你的计算机关机。需要在 `poweroff` 前面加一个 `sudo` 才能成功关机。
@ -146,7 +147,6 @@ Success
$ sudo shutdown -h 60
```
Or immediately:
或者立即关闭计算机:
```
@ -155,7 +155,7 @@ $ sudo shutdown -h now
你也可以用 `sudo shutdown -r now` 或者 `reboot` 来重启计算机。
### 12. 阅读手册man
### 12阅读手册man
`man` 命令可能是 Linux 中最重要的命令了,你可以通过 `man` 命令查看 Linux 系统上每个命令的官方文档。例如,要阅读更多有关 `mkdir` 的信息,可以输入:
@ -167,7 +167,6 @@ $ man mkdir
### 你最喜欢的 Linux 命令是什么?
There are many more commands on a Linux system—hundreds! What's your favorite command, the one you find yourself using time and time again?
Linux 系统上还有数百个其他命令!你最喜欢使用的 Linux 命令是什么呢?什么命令是你一直反复使用的呢?
--------------------------------------------------------------------------------
@ -177,7 +176,7 @@ via: https://opensource.com/article/22/5/essential-linux-commands
作者:[Don Watkins][a]
选题:[lkxed][b]
译者:[chai001125](https://github.com/chai001125)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,343 @@
[#]: subject: "Infuse your awk scripts with Groovy"
[#]: via: "https://opensource.com/article/22/9/awk-groovy"
[#]: author: "Chris Hermansen https://opensource.com/users/clhermansen"
[#]: collector: "lkxed"
[#]: translator: "lxbwolf"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15231-1.html"
为你的 awk 脚本注入 Groovy
======
![](https://img.linux.net.cn/data/attachment/album/202211/09/100129hp5bze5bbbbmddw6.jpg)
> awk 和 Groovy 相辅相成,可以创建强大、有用的脚本。
最近我写了一个使用 Groovy 脚本来清理我的音乐文件中的标签的系列。我开发了一个 [框架][2],可以识别我的音乐目录的结构,并使用它来遍历音乐文件。在该系列的最后一篇文章中,我从框架中分离出一个实用类,我的脚本可以用它来处理文件。
这个独立的框架让我想起了很多 awk 的工作方式。对于那些不熟悉 awk 的人来说,你学习下这本电子书:
> **[《awk 实用指南》][3]**
我从 1984 年开始大量使用 awk当时我们的小公司买了第一台“真正的”计算机它运行的是 System V Unix。对我来说awk 是非常完美的:它有<ruby>关联内存<rt>associative memory</rt></ruby>——将数组视为由字符串而不是数字来索引的。它内置了正则表达式,似乎专为处理数据而生,尤其是在处理数据列时,而且结构紧凑,易于学习。最后,它非常适合在 Unix 工作流使用,从标准输入或文件中读取数据并写入到输出,数据不需要经过其他的转换就出现在了输入流中。
说 awk 是我日常计算工具箱中的一个重要部分一点也不为过。然而,在我使用 awk 的过程中,有几件事让我感到不满意。
可能主要的问题是 awk 善于处理以分隔字段呈现的数据,但很奇怪它不善于处理 CSV 文件,因为 CSV 文件的字段被引号包围时可以嵌入逗号分隔符。另外,自 awk 发明以来,正则表达式已经有了很大的发展,我们需要记住两套正则表达式的语法规则,而这并不利于编写无 bug 的代码。[一套这样的规则已经很糟糕了][4]。
由于 awk 是一门简洁的语言,因此它缺少很多我认为有用的东西,比如更丰富的基础类型、结构体、`switch` 语句等等。
相比之下Groovy 拥有这些能力:可以使用 [OpenCSV 库][5],它很擅长处理 CSV 文件、Java 正则表达式和强大的匹配运算符、丰富的基础类型、类、`switch` 语句等等。
Groovy 所缺乏的是简单的面向管道的概念,即把要处理数据作为一个传入的流,以及把处理过的数据作为一个传出的流。
但我的音乐目录处理框架让我想到,也许我可以创建一个 Groovy 版本的 awk “引擎”。这就是我写这篇文章的目的。
### 安装 Java 和 Groovy
Groovy 是基于 Java 的,需要先安装 Java。最新的、合适的 Java 和 Groovy 版本可能都在你的 Linux 发行版的软件库中。Groovy 也可以按照 [Groovy 主页][6] 上的说明进行安装。对于 Linux 用户来说,一个不错的选择是 [SDKMan][7],它可以用来获得多个版本的 Java、Groovy 和其他许多相关工具。在这篇文章中,我使用的是 SDK 的版本:
* JavaOpenJDK 11 的 11.0.12 的开源版本
* Groovy3.0.8
### 使用 Groovy 创建 awk
这里的基本想法是将打开一个或多个文件进行处理、将每行分割成字段、以及提供对数据流的访问等复杂情况封装在三个部分:
* 在处理数据之前
* 在处理每行数据时
* 在处理完所有数据之后
我并不打算用 Groovy 来取代 awk。相反我只是在努力实现我的典型用例那就是
* 使用一个脚本文件而不是在命令行写代码
* 处理一个或多个输入文件
* 设置默认的分隔符为 `|`,并基于这个分隔符分割所有行
* 使用 OpenCSV 完成分割工作awk 做不到)
### 框架类
下面是用 Groovy 类实现的 “awk 引擎”:
```
@Grab('com.opencsv:opencsv:5.6')
import com.opencsv.CSVReader
public class AwkEngine {
// With admiration and respect for
// Alfred Aho
// Peter Weinberger
// Brian Kernighan
// Thank you for the enormous value
// brought my job by the awk
// programming language
Closure onBegin
Closure onEachLine
Closure onEnd
private String fieldSeparator
private boolean isFirstLineHeader
private ArrayList<String> fileNameList
public AwkEngine(args) {
this.fileNameList = args
this.fieldSeparator = "|"
this.isFirstLineHeader = false
}
public AwkEngine(args, fieldSeparator) {
this.fileNameList = args
this.fieldSeparator = fieldSeparator
this.isFirstLineHeader = false
}
public AwkEngine(args, fieldSeparator, isFirstLineHeader) {
this.fileNameList = args
this.fieldSeparator = fieldSeparator
this.isFirstLineHeader = isFirstLineHeader
}
public void go() {
this.onBegin()
int recordNumber = 0
fileNameList.each { fileName ->
int fileRecordNumber = 0
new File(fileName).withReader { reader ->
def csvReader = new CSVReader(reader,
this.fieldSeparator.charAt(0))
if (isFirstLineHeader) {
def csvFieldNames = csvReader.readNext() as
ArrayList<String>
csvReader.each { fieldsByNumber ->
def fieldsByName = csvFieldNames.
withIndex().
collectEntries { name, index ->
[name, fieldsByNumber[index]]
}
this.onEachLine(fieldsByName,
recordNumber, fileName,
fileRecordNumber)
recordNumber++
fileRecordNumber++
}
} else {
csvReader.each { fieldsByNumber ->
this.onEachLine(fieldsByNumber,
recordNumber, fileName,
fileRecordNumber)
recordNumber++
fileRecordNumber++
}
}
}
}
this.onEnd()
}
}
```
虽然这看起来是相当多的代码,但许多行是因为太长换行了(例如,通常你会合并第 38 行和第 39 行,第 41 行和第 42 行,等等)。让我们逐行看一下。
第 1 行使用 `@Grab` 注解从 [Maven Central][8] 获取 OpenCSV 库的 5.6 本周。不需要 XML。
第 2 行我引入了 OpenCSV 的 `CSVReader`
第 3 行,像 Java 一样,我声明了一个 `public` 实用类 `AwkEngine`
第 11-13 行定义了脚本所使用的 Groovy 闭包实例,作为该类的钩子。像任何 Groovy 类一样,它们“默认是 `public`”,但 Groovy 将这些字段创建为 `private`,并对其进行外部引用(使用 Groovy 提供的 getter 和 setter 方法)。我将在下面的示例脚本中进一步解释这个问题。
第 14-16 行声明了 `private` 字段 —— 字段分隔符,一个指示文件第一行是否为标题的标志,以及一个文件名的列表。
第 17-31 行定义了三个构造函数。第一个接收命令行参数。第二个接收字段的分隔符。第三个接收指示第一行是否为标题的标志。
第 31-67 行定义了引擎本身,即 `go()` 方法。
第 33 行调用了 `onBegin()` 闭包(等同于 awk 的 `BEGIN {}` 语句)。
第 34 行初始化流的 `recordNumber`(等同于 awk 的 `NR` 变量)为 0注意我这里是从 00 而不是 1 开始的)。
第 35-65 行使用 `each` `{}` 来循环处理列表中的文件。
第 36 行初始化文件的 `fileRecordNumber`(等同于 awk 的 `FNR` 变量)为 0从 0 而不是 1 开始)。
第 37-64 行获取一个文件对应的 `Reader` 实例并处理它。
第 38-39 行获取一个 `CSVReader` 实例。
第 40 行检测第一行是否为标题。
如果第一行是标题,那么在 41-42 行会从第一行获取字段的标题名字列表。
第 43-54 行处理其他的行。
第 44-48 行把字段的值复制到 `name:value` 的映射中。
第 49-51 行调用 `onEachLine()` 闭包(等同于 awk 程序 `BEGIN {}``END {}` 之间的部分,不同的是,这里不能输入执行条件),传入的参数是 `name:value` 映射、处理过的总行数、文件名和该文件处理过的行数。
第 52-53 行是处理过的总行数和该文件处理过的行数的自增。
如果第一行不是标题:
第 56-62 行处理每一行。
第 57-59 调用 `onEachLine()` 闭包,传入的参数是字段值的数组、处理过的总行数、文件名和该文件处理过的行数。
第 60-61 行是处理过的总行数和该文件处理过的行数的自增。
第 66 行调用 `onEnd()` 闭包(等同于 awk 的 `END {}`)。
这就是该框架的内容。现在你可以编译它:
```
$ groovyc AwkEngine.groovy
```
一点注释:
如果传入的参数不是一个文件,编译就会失败,并出现标准的 Groovy 堆栈跟踪,看起来像这样:
```
Caught: java.io.FileNotFoundException: not-a-file (No such file or directory)
java.io.FileNotFoundException: not-a-file (No such file or directory)
at AwkEngine$_go_closure1.doCall(AwkEngine.groovy:46)
```
OpenCSV 可能会返回 `String[]` 值,不像 Groovy 中的 `List` 值那样方便(例如,数组没有 `each {}`)。第 41-42 行将标题字段值数组转换为 list因此第 57 行的 `fieldsByNumber` 可能也应该转换为 list。
### 在脚本中使用这个框架
下面是一个使用 `AwkEngine` 来处理 `/etc/group` 之类由冒号分隔并没有标题的文件的简单脚本:
```
def ae = new AwkEngine(args, ':')
int lineCount = 0
ae.onBegin = {
  println “in begin”
}
ae.onEachLine = { fields, recordNumber, fileName, fileRecordNumber ->
  if (lineCount < 10)
    println “fileName $fileName fields $fields”
    lineCount++
}
ae.onEnd = {
  println “in end”
  println “$lineCount line(s) read”
}
ae.go()
```
第 1 行 调用的有两个参数的构造函数,传入了参数列表,并定义冒号为分隔符。
第 2 行定义一个脚本级的变量 `lineCount`用来记录处理过的行数注意Groovy 闭包不要求定义在外部的变量为 `final`)。
第 3-5 行定义 `onBegin()` 闭包,在标准输出中打印出 “in begin” 字符串。
第 6-10 行定义 `onEachLine()` 闭包,打印文件名和前 10 行字段,无论是否为前 10 行,处理过的总行数 `lineCount` 都会自增。
第 11-14 行定义 `onEnd()` 闭包,打印 “in end” 字符串和处理过的总行数。
第 15 行运行脚本,使用 `AwkEngine`
像下面一样运行一下脚本:
```
$ groovy Test1Awk.groovy /etc/group
in begin
fileName /etc/group fields [root, x, 0, ]
fileName /etc/group fields [daemon, x, 1, ]
fileName /etc/group fields [bin, x, 2, ]
fileName /etc/group fields [sys, x, 3, ]
fileName /etc/group fields [adm, x, 4, syslog,clh]
fileName /etc/group fields [tty, x, 5, ]
fileName /etc/group fields [disk, x, 6, ]
fileName /etc/group fields [lp, x, 7, ]
fileName /etc/group fields [mail, x, 8, ]
fileName /etc/group fields [news, x, 9, ]
in end
78 line(s) read
$
```
当然,编译框架类生成的 `.class` 文件需要在 classpath 中,这样才能正常运行。通常你可以用 `jar` 把这些 class 文件打包起来。
我非常喜欢 Groovy 对行为委托的支持这在其他语言中需要各种诡异的手段。许多年来Java 需要匿名类和相当多的额外代码。Lambda 已经在很大程度上解决了这个问题,但它们仍然不能引用其范围之外的非 final 变量。
下面是另一个更有趣的脚本,它很容易让人想起我对 awk 的典型使用方式:
```
def ae = new AwkEngine(args, ';', true)
ae.onBegin = {
  // nothing to do here
}
def regionCount = [:]
  ae.onEachLine = { fields, recordNumber, fileName, fileRecordNumber ->
  regionCount[fields.REGION] =
  (regionCount.containsKey(fields.REGION) ?
  regionCount[fields.REGION] : 0) +
  (fields.PERSONAS as Integer)
}
ae.onEnd = {
  regionCount.each { region, population ->
  println “Region $region population $population”
}
}
ae.go()
```
第 1 行调用了三个函数的构造方法,`true` 表示这是“真正的 CSV” 文件,第一行为标题。由于它是西班牙语的文件,因此它的逗号表示数字的`点`,标准的分隔符是分号。
第 2-4 行定义 `onBegin()` 闭包,这里什么也不做。
第 5 行定义一个(空的)`LinkedHashmap`,键是 String 类型,值是 Integer 类型。数据文件来自于智利最近的人口普查,你要在这个脚本中计算出智利每个地区的人口数量。
第 6-11 行处理文件中的行(加上标题一共有 180,500 行)—— 请注意在这个案例中,由于你定义 第 1 行为 CSV 列的标题,因此 `fields` 参数会成为 `LinkedHashMap<String,String>` 实例。
第 7-10 行是 `regionCount` 映射计数增加,键是 `REGION` 字段的值,值是 `PERSONAS` 字段的值 —— 请注意,与 awk 不同,在 Groovy 中你不能在赋值操作的右边使用一个不存在的映射而期望得到空值或零值。
第 12-16 行,打印每个地区的人口数量。
第 17 行运行脚本,调用 `AwkEngine`
像下面一样运行一下脚本:
```
$ groovy Test2Awk.groovy ~/Downloads/Censo2017/ManzanaEntidad_CSV/Censo*csv
Region 1 population 330558
Region 2 population 607534
Region 3 population 286168
Region 4 population 757586
Region 5 population 1815902
Region 6 population 914555
Region 7 population 1044950
Region 8 population 1556805
Region 16 population 480609
Region 9 population 957224
Region 10 population 828708
Region 11 population 103158
Region 12 population 166533
Region 13 population 7112808
Region 14 population 384837
Region 15 population 226068
$
```
以上为全部内容。对于那些喜欢 awk 但又希望得到更多的东西的人,我希望你能喜欢这种 Groovy 的方法。
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/9/awk-groovy
作者:[Chris Hermansen][a]
选题:[lkxed][b]
译者:[lxbwolf](https://github.com/lxbwolf)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/clhermansen
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/browser_screen_windows_files.png
[2]: https://opensource.com/article/22/8/music-tagging-framework-groovy
[3]: https://opensource.com/downloads/awk-ebook
[4]: http://regex.info/blog/2006-09-15/247
[5]: http://opencsv.sourceforge.net/
[6]: https://groovy.apache.org/download.html
[7]: https://opensource.com/article/22/3/manage-java-versions-sdkman
[8]: https://mvnrepository.com/artifact/com.opencsv/opencsv

View File

@ -0,0 +1,103 @@
[#]: subject: "What you need to know about compiling code"
[#]: via: "https://opensource.com/article/22/10/compiling-code"
[#]: author: "Alan Smithee https://opensource.com/users/alansmithee"
[#]: collector: "lkxed"
[#]: translator: "Donkey-Hao"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15213-1.html"
关于编译代码你应该知道的
======
![](https://img.linux.net.cn/data/attachment/album/202211/04/054126nec50keexencosc4.jpg)
> 用这个方便的捕鼠器比喻来理解编译代码。
源代码必须要经过编译才能够运行程序,而对于开源软件,每个人都可以获取源代码。无论你是自己编写了代码,想要编译和运行它,还是下载了某人的项目来尝试它,了解如何通过 [编译器][2] 处理源代码,以及编译器如何处理这些代码,这都很有用。
### 创建一个更好的捕鼠器
一般情况我们不会将一个捕鼠器比作电脑,但不管你信不信,它确实与你正在使用的设备(手机或电脑)的 CPU 有一些相似之处。经典的捕鼠器(我说的不是 🐈)有两种状态:打开或者释放。你可以认为 *打开* 是将捕鼠器设置好准备捕获老鼠,以及 *释放* 是捕鼠器被老鼠触发。某种意义上来说,捕鼠器就像是一台有鼠标的电脑。你可以想象一下这个代码,用一种虚构的语言来描述这个过程:
```
if mousetrap == 0 then
There's a mouse!
else
There's no mouse yet.
end
```
换句话说,你可以基于捕鼠器的状态发现是否有老鼠(数据)。当然,捕鼠器不是万无一失的,有可能有一只老鼠在捕鼠器旁边,由于老鼠还没有触发捕鼠器,所以它的状态还是 *打开* 的。因此该程序可以进行改进,这都是非常典型的。
### 开关
总的来说,捕鼠器就是一个开关。你会在家里使用开关打开灯。可以从开关中获得许多信息。比如,人们会从你家灯的状态了解到你是否在家。
你可以根据邻居家灯的状态来改变行为。如果邻居家所有的灯都熄灭了,那么请关掉你大声的音乐,因为人们可能已经上床睡觉了。
CPU 也使用这样的逻辑,只不过乘以几个数量级,缩小到了微观级别。当 CPU 在特定寄存器上接收到电信号时,可以触发其他一些寄存器,然后触发另一个,以此类推。如果这些寄存器有特定的意义,那么就可以通信。也许激活同一主板上某处的芯片,或者使 LED 亮起,或者改变屏幕上的像素颜色。
种瓜得瓜,种豆得豆。如果你真的想在多个位置而不是仅限于一处发现老鼠,但是你只有一个捕鼠器,那你应该开发一个应用才行。使用网络摄像头和一些基本的图像识别软件,你可以建立空厨房的模型,然后扫描变化。当老鼠进入厨房,在原先没有老鼠的图像上会有像素的变化。记录下这些数据,如果有无人机可以追踪老鼠并捕获会更好,这样就可以将老鼠赶出厨房了。这时,你通过打开和关闭信号的魔法,创造了一个更好的捕鼠器。
### 编译器
代码编译器将人们可阅读的代码转换成 CPU 可以理解的机器语言。这是非常复杂的过程,因为 CPU 非常复杂(甚至比捕鼠器更加复杂),同时因为该过程比严格“需要”的更加灵活。并不是所有的编译器都很灵活。有一些编译器只有一个目标,它们只会处理特定格式的代码文件,处理过程也因此而简单明了。
幸运的是,现代的通用编译器并不简单。它们允许你编写不同语言的代码,也允许你用不同的方式链接库文件,并且可以生成运行在不同架构上的文件。[GNU 编译器集合][4]GCC`gcc` 编译器 `--help` 会输出超过 50 行的选项LLVM 的 `clang` 编译器的 `--help` 输出超过 1000 行。GCC 指导手册的字数超过 10 万。
当你在编译代码时会有很多选项。
当然,大多数人并不需要知道所有的选项。我从未读过 GCC 的手册页,因为它们是针对 Objective-C、Fortran 以及我从未听说过的芯片架构的。不过我重视它将代码编译为不同的架构 —— 64 位或者 32 位 —— 的能力,以及在其他行业已经落后的计算机上运行开源软件的能力。
### 编译生命周期
同样重要的是,理解编译代码的不同阶段。这是一个简单的 C 语言程序的生命周期:
1. 带有宏定义的 C 源代码 `.c` 文件,用 `cpp` 预处理为 `.i` 文件。
2. 扩展了宏定义的 C 源代码 `.i` 文件,会被 `gcc` 转译成 `.s` 文件。
3. 以汇编语言写的文本文件 `.s` 文件被汇编为目标 `.o` 文件。
4. 带有 CPU 指令的二进制目标代码,以及其他目标文件和库 `*.o` 文件,以内存区域无关的偏移量,使用 `ld` 链接以生成可执行文件。
5. 最终的二进制文件要么包含所有需要的目标,要么设置以动态链接库 `*.so` 文件加载。
你可以试试这个简单示例(可能需要对库路径做一些调整):
```
$ cat << EOF >> hello.c
#include
int main(void)
{ printf("hello world\n");
return 0; }
EOF
$ cpp hello.c > hello.i
$ gcc -S hello.i
$ as -o hello.o hello.s
$ ld -static -o hello \
-L/usr/lib64/gcc/x86_64-slackware-linux/5.5.0/ \
/usr/lib64/crt1.o /usr/lib64/crti.o hello.o \
/usr/lib64/crtn.o --start-group -lc -lgcc \
-lgcc_eh --end-group
$ ./hello
hello world
```
### 可获得的知识
计算机已经变得非常强大,并且用户友好。请不要走向这两种可能的极端中的任何一种:计算机不像捕鼠器和电灯开关那么简单,但它们也不是无法理解的。你可以了解编译代码、如何链接以及针对不同架构进行编译。一旦你知道了,你就可以更好地调试代码。你可以理解你下载的代码,甚至可以修复其中的一两个错误。同时从理论上来讲,你可以建造一个更好的捕鼠器,或者用捕鼠器造一个 CPU。由你决定。
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/10/compiling-code
作者:[Alan Smithee][a]
选题:[lkxed][b]
译者:[Donkey-Hao](https://github.com/Donkey-Hao)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/alansmithee
[b]: https://github.com/lkxed
[2]: https://opensource.com/article/19/5/primer-assemblers-compilers-interpreters
[3]: https://opensource.com/article/22/9/python-interpreters-2022
[4]: https://opensource.com/article/22/5/gnu-c-compiler

View File

@ -3,22 +3,24 @@
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15219-1.html"
如何清理 Snap 版本以释放磁盘空间
======
**这个带有脚本的快速指南有助于清理旧的 snap 版本并释放 Ubuntu 系统中的一些磁盘空间。**
![](https://img.linux.net.cn/data/attachment/album/202211/06/082905iomvvhsgoooc5czg.jpg)
我在使用 Ubuntu 的测试系统中的磁盘空间不足。因此,我通过 GNOME 的磁盘使用分析器进行调查,以找出哪个包正在消耗宝贵的 SSD 空间。除了通常的缓存和主目录,令我惊讶的是,我发现 Snap 和 Flatpak 消耗了大量的存储空间。
> 这个带有脚本的快速指南有助于清理旧的 Snap 版本并释放 Ubuntu 系统中的一些磁盘空间。
我正在使用的 Ubuntu 测试系统中的磁盘空间不足。因此,我通过 GNOME 的磁盘使用分析器进行调查,以找出哪个包正在消耗宝贵的 SSD 空间。除了通常的缓存和主目录,令我惊讶的是,我发现 Snap 和 Flatpak 消耗了大量的存储空间。
![Snap 大小 - 清理前][1]
尽管如此,我始终坚持一个规则:除非必要,否则不要使用 Snap 或 Flatpak。这主要是因为它们的安装尺寸和其他问题。我更喜欢原生 deb 和 rpm 包。多年来,我在这个测试系统中安装和移除了一定数量的 Snap 包。
卸载后出现问题。Snap 在系统中保留了一些残留文件,一般用户不知道。
但卸载后还有问题。Snap 在系统中保留了一些残留文件,一般用户不知道。
所以我打开了 Snap 文件夹 `/var/lib/snapd/snaps`,发现 Snap 保留了以前安装/卸载的软件包的旧版本。
@ -57,11 +59,11 @@ sudo snap set system refresh.retain=2
set -eu
LANG=en_US.UTF-8 snap list --all | awk '/disabled/{print $1, $3}' |
while read snapname revision; do
snap remove "$snapname" --revision="$revision"
snap remove "$snapname" --revision="$revision"
done
```
将上面的脚本以 .sh 格式保存在一个目录中(例如 `clean_snap.sh`),赋予它可执行权限并运行。
将上面的脚本以 `.sh` 扩展名保存在一个目录中(例如 `clean_snap.sh`),赋予它可执行权限并运行。
```
chmod +x clean_snap.sh
@ -75,13 +77,13 @@ chmod +x clean_snap.sh
### 结束语
对于 Snap 的设计效率如何,人们总是争论不休。许多人说,它的设计是坏的,是臃肿的,是消耗系统资源的。这种说法的某些部分是真实的,我不会否认它。如果实施和加强得当,整个沙盒应用的概念是很好的。我相信,与 Snap 相比Flatpak 工作做得更好。
对于 Snap 的设计效率如何,人们总是争论不休。许多人说,它的设计是坏的,是臃肿的,是消耗系统资源的。这种说法的某些部分是真实的,我不会否认它。如果实施和加强得当,整个沙盒应用的概念是很好的。我相信,与 Snap 相比Flatpak 工作做得更好。
也就是说,我希望这可以帮助你清理一些磁盘空间。尽管它在 Ubuntu 中进行了测试,但它应该适用于所有支持 Snap 的 Linux 发行版。
也就是说,我希望这可以帮助你清理一些磁盘空间。尽管它在 Ubuntu 中进行了测试,但它应该适用于所有支持 Snap 的 Linux 发行版。
此外,请查看我们关于[如何清理 Ubuntu][7] 的指南以及其他步骤。
此外,请查看我们关于 [如何清理 Ubuntu][7] 的指南以及其他步骤。
最后,如果你要清理 **Flatpak** 应用,请参阅[本指南][8]。
最后,如果你要清理 **Flatpak** 应用,请参阅 [这篇指南][8]。
--------------------------------------------------------------------------------
@ -90,7 +92,7 @@ via: https://www.debugpoint.com/clean-up-snap/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -3,16 +3,18 @@
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15216-1.html"
如何检查: 是 Xorg 还是 Wayland 显示服务器?
======
**以下是快速检查在运行 Xorg 还是 Wayland 显示服务器的方法。**
![](https://img.linux.net.cn/data/attachment/album/202211/05/102913nmpm4pzka6b6aar1.jpg)
随着时间的推移,现代 Wayland 显示服务器正在进入所有 Linux 发行版。尽管遗留的 Xorg 仍然相关并且会继续存在,但 Wayland 无疑在安全性和其他性能方面更好。
> 以下是快速检查在运行 Xorg 还是 Wayland 显示服务器的方法。
随着时间的推移,现代 Wayland 显示服务器正在进入所有 Linux 发行版。尽管老旧的 Xorg 仍然能用并且会继续存在,但 Wayland 无疑在安全性和其他性能方面更好。
但是Xorg 不会很快完全淘汰。可能永远不会。
@ -20,21 +22,21 @@
### Wayland 或 Xorg你在运行哪一个
- 在你的 Linux 发行版(例如 Ubuntu、Fedora、Arch 等)中打开一个终端窗口 (CTRL+ALT+T)
在你的 Linux 发行版(例如 Ubuntu、Fedora、Arch 等)中打开一个终端窗口`CTRL+ALT+T`
- 然后输入以下命令并回车。
然后输入以下命令并回车:
```
echo $XDG_SESSION_TYPE
```
- 命令输出会告诉你当前会话是 Wayland 还是 Xorg (X11)
命令输出会告诉你当前会话是 Wayland 还是 XorgX11
```
[debugpoint@fedora ~]$ echo $XDG_SESSION_TYPEwayland
```
![此命令可以为提供有关 Xorg 或 Wayland 的详细信息][1]
![此命令可以为提供有关 Xorg 或 Wayland 的详细信息][1]
这很简单。但是,还有其他方法。
@ -44,7 +46,7 @@ echo $XDG_SESSION_TYPE
如果你需要图形方法,请打开你的 Linux 发行版的设置应用。在关于部分,你应该看到某个标签下中的 Wayland/X11。
例如,在 GNOME 设置中,你可以在 “Windowing system” 下找到它,如下图所示。
例如,在 GNOME 设置中,你可以在 “<ruby>窗口子系统<rt>Windowing system</rt></ruby>” 下找到它,如下图所示:
![在 GNOME 设置中可以找到它][2]
@ -52,13 +54,13 @@ echo $XDG_SESSION_TYPE
你还可以使用 [systemd][3] 登录管理器 `loginctl` 找到它。请记住,它仅适用于基于 systemd 的系统。
打开终端并运行以下命令。你可以看到会话 id 值。在此示例中为 `c2`
打开终端并运行以下命令。你可以看到会话 id 值。在此示例中为 `c2`
```
loginctl
```
现在,将会话 ID 传递给以下命令以获取显示服务器类型。确保将 c2 更改为的系统规格。
现在,将会话 ID 传递给以下命令以获取显示服务器类型。确保将 c2 更改为的系统规格。
```
loginctl show-session c2 -p Type
@ -70,7 +72,7 @@ loginctl show-session c2 -p Type
这些是你可以确定在 Linux 系统中运行的是 Systemd 还是 Xorg 的一些方法。你还可以在 shell 脚本中使用上述命令来实现进一步的流程自动化。
干杯
祝好
--------------------------------------------------------------------------------
@ -79,7 +81,7 @@ via: https://www.debugpoint.com/check-wayland-or-xorg/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,121 @@
[#]: subject: "How to Check CPU and HDD Temperature in Ubuntu and Other Linux"
[#]: via: "https://www.debugpoint.com/cpu-hdd-temperature-ubuntu/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15223-1.html"
如何在 Ubuntu 和其他 Linux 中检查 CPU 和硬盘温度
======
![](https://img.linux.net.cn/data/attachment/album/202211/07/151624auhj011bqnzk9qfu.jpg)
> 想知道如何在台式机或笔记本电脑上检查 Ubuntu 和其他 Linux 中的 CPU 和硬盘温度?这是一个快速指南。
如果你是普通用户,那么实际上不需要检查 CPU 或 HDD 温度。但是,如果你使用的是非常旧的硬件或轻薄型的硬件,你可能会遇到过热问题。因为这些薄的硬件内部紧密耦合在一起,无论做了多少传热机制,它都会升温。因此,必须监控硬件的温度。然而,现代 Linux 发行版能够通过软件传感器很好地处理过热情况。
### 在 Ubuntu 上监控 CPU 和硬盘温度的步骤
#### 使用终端
我们将使用几个包来实现相同的目的。在基于 Ubuntu 的系统中打开一个终端并安装以下内容。
```
sudo apt install hddtemp
sudo apt install lm-sensors
```
[hddtemp][1] 程序为你提供硬盘和 SSD (根据我的测试)的温度。 [lm-sensors][2] 包为你提供来自 CPU 和其他通过 PCI 端口访问的传感器的温度详细信息。
安装后,从终端运行以下命令。你需要知道你的磁盘标识符,例如 `/dev/sda``/dev/sdb` 等。
要找出磁盘标识符,你可以使用 `fdisk`
```
sudo fdisk -l
```
然后运行以下命令检查 HDD 或 SSD 温度。
```
sudo hddtemp
```
![HDD or SSD Temperature from terminal][3]
*来自终端的 HDD 或 SSD 温度*
检查 CPU 温度和其他信息需要额外的步骤。
首先,运行以下命令,以便传感器程序可以检测到系统中的传感器。
```
sudo sensors-detect
```
上面的命令可能会问你一些是/否的问题。继续按回车选择默认选项。
完成后,运行以下命令查看 CPU 和其他接口温度。
```
sensors
```
![using sensors][4]
*使用传感器*
#### 使用 GUI 工具
如果你更喜欢能完成上述所有操作的漂亮 GUI你可以安装 [psensor][5]。该程序适用于 Linux 系统,例如 Ubuntu、Fedora、[Arch][6] 和其他变体。它为你提供了漂亮的图形和表格视图:
Ubuntu 及其衍生版:
```
sudo apt install psensor
```
Fedora 和基于 RPM 的衍生版:
```
sudo dnf install psensor
```
Arch、Manjaro 和类似的衍生版:
```
pacman -S psensor
```
安装后,从终端运行 `psensor` 或从应用菜单启动它。
正如你在下面的截图中所见,它通过漂亮的图表让你可以很好地了解 CPU、GPU 和 HDD 的所有重要温度。使用它的首选项,你可以根据需要对其进行调整。这个轻量级的程序在很多情况下都会很有帮助。
![psensor running][7]
*psensor 运行*
因此,这些是你可以在 Ubuntu 和其他 Linux 系统中监控 CPU、GPU 或 HDD 温度的一些方法。如果你知道其他方法,请通过下面的评论栏告诉我。
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/cpu-hdd-temperature-ubuntu/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://wiki.archlinux.org/title/Hddtemp
[2]: https://github.com/lm-sensors/lm-sensors
[3]: https://www.debugpoint.com/wp-content/uploads/2021/09/HDD-or-SSD-Temperature-from-terminal.png
[4]: https://www.debugpoint.com/wp-content/uploads/2021/09/psensor.png
[5]: https://wpitchoune.net/psensor/
[6]: https://www.debugpoint.com/tag/arch-linux
[7]: https://www.debugpoint.com/wp-content/uploads/2021/09/psensor-running-1024x465.png

View File

@ -3,16 +3,18 @@
[#]: author: "Agil Antony https://opensource.com/users/agantony"
[#]: collector: "lkxed"
[#]: translator: "chai001125"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15220-1.html"
用 git log 命令显示在特定日期的提交记录
======
`git log` 命令是 Git 中一个很重要的查看提交记录的工具,它也是人们喜欢使用 Git 的原因之一。
![](https://img.linux.net.cn/data/attachment/album/202211/06/085449j5diiljl7dzgdr0z.jpg)
`git log` 命令能够让你了解到更多关于贡献者 <ruby>提交<rt> commit </rt> </ruby> 的记录。使用 `git log` 的一种方式是按日期查看提交记录 。要查看**在指定日期或日期范围内**创建的 Git 存储库中的提交记录,请使用带有选项 `--since``--until` 或者同时使用以上两个选项的 `git log` 命令。
> `git log` 命令是 Git 中一个很重要的查看提交记录的工具,它也是人们喜欢使用 Git 的原因之一。
`git log` 命令能够让你了解到更多关于贡献者 <ruby>提交<rt>commit</rt></ruby> 的记录。使用 `git log` 的一种方式是按日期查看提交记录 。要查看**在指定日期或日期范围内**创建的 Git 存储库中的提交记录,请使用带有选项 `--since``--until` 或者同时使用以上两个选项的 `git log` 命令。
首先,进入你要查看的分支(例如,`main` 分支):
@ -57,7 +59,7 @@ via: https://opensource.com/article/22/10/git-log-command
作者:[Agil Antony][a]
选题:[lkxed][b]
译者:[chai001125](https://github.com/chai001125)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,144 @@
[#]: subject: "Transfer files and folders from Windows to Linux with PSCP"
[#]: via: "https://opensource.com/article/22/10/transfer-files-windows-linux-pscp"
[#]: author: "Paul https://opensource.com/users/plaubscher"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15234-1.html"
使用 PSCP 将文件和文件夹从 Windows 传输到 Linux
======
![](https://img.linux.net.cn/data/attachment/album/202211/10/074452ys2lgjdqq8gaj8rg.jpg)
> 开源的 PSCP 程序可以轻松地在 Windows 和 Linux 计算机之间传输文件和文件夹。
你是否正在寻找一种将文件从 Windows 计算机快速传输到 Linux 计算机并再次传输回来的方法?开源的 PSCP 程序可以轻松传输文件和文件夹,当然它是开源的。
### 在 Windows 中设置 PATH
了解如何在 Windows 中设置命令路径可以更轻松地使用 PSCP 等方便的程序。如果你不熟悉该过程,请阅读 [如何在 Windows 上设置 PATH][1]。
### 使用 PSCP
PSCPPuTTY 安全复制协议)是一个命令行工具,用于将文件和文件夹从 Windows 计算机传输到 Linux 计算机。
- 从 [网站][2] 下载 `pscp.exe`
- 将 `pscp.exe` 移动到 `PATH` 中的文件夹(例如,如果你按照 [Opensource.com][3] 上的 PATH 教程进行操作,则为 `Desktop\App`)。如果你没有设置 `PATH` 变量,你也可以将 `pscp.exe` 移动到保存要传输的文件的文件夹中。
- 使用 Windows 任务栏中的搜索栏在 Windows 计算机上打开 Powershell在搜索栏中输入 `powershell`。)
- 输入 `pscp -version` 以确认你的计算机可以找到该命令。
### IP 地址
在进行传输之前,你必须知道目标计算机的 IP 地址或完全限定域名。假设它是同一网络上的计算机,并且你没有运行 DNS 服务器来解析计算机名称,你可以在 Linux 机器上使用 `ip` 命令找到目标 IP 地址:
```
[linux]$ ip addr show |grep 'inet '
inet 127.0.0.1/8 scope host lo
inet 192.168.1.23/24 brd 10.0.1.255 scope global noprefixroute eth0
```
在所有情况下127.0.0.1 都是计算机仅用于与自身通信的环回地址,因此在此示例中,正确的地址是 192.168.1.23。在你的系统上IP 地址可能不同。如果你不确定哪个是哪个,你可以连续尝试每个,直到找到正确的(然后在某处写下来!)
或者,你可以查看路由器的设置,其中列出了通过 DHCP 分配的所有地址。
### 防火墙和服务器
`pscp` 命令使用 OpenSSH 协议,因此你的 Linux 计算机必须运行 OpenSSH 服务器软件,并且防火墙必须允许 SSH 流量。
如果你不确定你的 Linux 机器是否正在运行 SSH请在 Linux 机器上运行以下命令:
```
[linux]$ sudo systemctl enable --now sshd
```
要确保你的防火墙允许 SSH 流量,请运行以下命令:
```
[linux]$ sudo firewall-cmd --add-servicessh --permanent
```
有关 Linux 上的防火墙的更多信息,请阅读 [使用防火墙使 Linux 更强大][4]。
### 传输文件
在这个例子中,我有一个名为 `pscp-test.txt` 的文件,我想将它从我的 Windows 计算机上的 `C:\Users\paul\Documents` 传输到我的目标 Linux 计算机主目录 `/home/paul`
现在你已经有了 `pscp` 命令和目标地址,你可以传输测试文件 `pscp-test.txt`。打开 Powershell 并使用 `dir` 命令切换到示例文件所在的 `Documents` 文件夹:
```
PS> dir %USERPROFILE%\Documents\
```
现在执行传输:
```
PS> pscp pscp-test.txt paul@192.168.1.23:/home/paul
| Password:
End of keyboard-interactive prompts from server
pscp-test.txt | 0 kb | 0.0 kB/s | ETA: 00:00:00 | 100%
```
这是语法,逐字逐句来:
- `pscp`:用于传输文件的命令。
- `pscp-test.txt` 是你要从 Windows 传输的文件的名称。
- `paul@192.168.1.23` 是我在 Linux 计算机上的用户名,以及 Linux 计算机的 IP 地址。你必须将其替换为你自己的用户和目的地信息。请注意,`pscp` 需要目标计算机上的目标路径,而 IP 地址末尾的 `:/home/paul` 指定我希望将文件复制到我的主文件夹。
对 Linux 计算机进行身份验证后,`pscp-test.txt` 文件将传输到 Linux 计算机。
### 验证已传输
在你的 Linux 计算机上,打开终端并使用 `ls` 命令验证文件 `pscp-test.txt` 是否出现在你的主目录中。
```
[linux]$ ls
Documents
Downloads
Music
Pictures
pscp-test.txt
```
### 从 Linux 系统复制文件
你不仅限于将文件复制到 Linux 系统。使用 `pscp`,你还可以将文件从 Linux 复制到 Windows。语法是一样的只是反过来
```
PS> pscp paul@192.168.1.23:/home/paul/pscp-test.txt %USERPROFILE%\Documents\pscp-win.txt
```
这是语法:
- `pscp`:用于传输文件的命令。
- `paul@192.168.1.23:/home/paul/pscp-test.txt` 是我在 Linux 计算机上的用户名、Linux 计算机的 IP 地址,以及我要复制的文件的路径。
- `%USERPROFILE%\Documents` 是我的 Windows 计算机上我要保存文件的位置。 请注意,在将文件复制回我的 Windows 计算机时,我可以给它一个新名称,例如 `pscp-win.txt`,以区别于原始文件。 当然,你不必重命名文件,但对于本演示来说,它是一个有用的快捷方式。
打开文件管理器以验证 `pscp-win.txt` 文件是否已从 Linux 计算机复制到 Windows `C:\Users\paul\Documents` 下。
![Image of a file manager.][5]
### 远程复制
借助开源 `pscp` 命令的强大功能,你可以访问家中的任何计算机、拥有帐户的服务器,甚至是移动设备和 [边缘设备][6]。
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/10/transfer-files-windows-linux-pscp
作者:[Paul][a]
选题:[lkxed][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/plaubscher
[b]: https://github.com/lkxed
[1]: https://opensource.com/article/22/10/set-path-powershell
[2]: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
[3]: http://Opensource.com
[4]: https://opensource.com/article/19/7/make-linux-stronger-firewalls
[5]: https://opensource.com/sites/default/files/2022-10/Filemanager.pscp_.png
[6]: https://opensource.com/tags/edge-computing

View File

@ -0,0 +1,142 @@
[#]: subject: "How to Install Python 3.11 in Ubuntu and Other Related Linux"
[#]: via: "https://www.debugpoint.com/install-python-3-11-ubuntu/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15230-1.html"
如何在 Ubuntu 等 Linux 中安装 Python 3.11
======
> 打算为你的项目开发工作安装 Python 3.11?下面是如何在 Ubuntu 等发行版中安装 Python 3.11 的方法。
![][1]
Python 3.11 于 2022 年 10 月 25 日发布,并声称比之前的 [Python 3.10][2] 版本快 10% - 60%。
一如既往3.11 中的功能和改进列表明显较多。下面是一个简介:
- 错误回溯更明确,可以指出导致错误的确切语句。
- 引入异常组和新的 except* 语法。
- 你可以在基础表达式中添加自定义文本,以便在你的代码中更好地处理错误。
- 引入 Variadic 泛型,允许在 Python 数值库(如 NumPy中使用类似数组的结构。
- 字典类型 TypedDict 得到了改进,现在你可以指定个别字典项目是必须的还是可选的。
- 引入了 Self 注解,允许类返回它们自己的类型实例。
还有很多,你可以在官方的 [3.11 亮点页面][3] 上详细了解。
### Linux 发行版中的当前 Python 版本
[Ubuntu 22.04 LTS][4] 带有 Python 3.10,而最近发布的 [Ubuntu 22.10 Kinetic Kudu][5] 也是同样的版本。然而, Kinetick Kudu 可能会在几周内采用 3.11。
另外,[Fedora 37][6] 已经有了 Python 3.11 RC2并将提供该版本。
所以,如果你正在运行 Ubuntu 22.04 LTS、[Linux Mint 21][7] 或任何基于 Ubuntu-LTS 的发行版,这里是你如何通过 PPA 安装 Python 3.11 的方法。
**注意**:谨慎地使用这个方法。确保你知道你在做什么,因为替换 Linux 发行版的基础 Python 版本可能会导致系统不稳定。许多默认的应用程序和软件包都依赖于 3.10 版本。
### 如何在 Ubuntu 和相关发行版中安装 Python 3.11
打开终端提示,添加以下 PPA
```
sudo add-apt-repository ppa:deadsnakes/ppa
```
使用下面的命令刷新缓存:
```
sudo apt update 
```
并使用下面的命令安装 Python 3.11
```
sudo apt install python3.11
```
![在 Ubuntu 22.04 LTS 中安装 Python 3.11][8]
### 设置默认的 Python 版本
理论上,你可以在 Linux 发行版中安装多个版本的 Python但只能默认一个版本。将 Python 3.11 设置为默认版本需要一些额外的步骤。请跟我做。
然而,在这之前,请确保你知道哪些应用程序依赖于 Python 3.10。你可以使用 `apt-cache rdepends` 命令轻松地找到它,如下所示:
```
debugpoint@debugpoint-22-04:~$ apt-cache rdepends python3.10
python3.10
Reverse Depends:
python3.10-dbg
python3.10-venv
python3.10-full
libpython3.10-testsuite
idle-python3.10
idle-python3.10
python3.10-minimal
python3.10-doc
python3.10-dev
python3
[截断]
python3
python3-uno
python3-all
gedit
```
#### 使用 Python 3.11 作为默认的 Python3
首先,从终端使用以下命令检查当前的默认版本:
```
python3 --version
```
使用 `update-alternatives` 来创建 `python3` 的符号链接:
```
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1
```
```
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2
```
并通过命令选择哪一个作为 Python3 使用:
```
sudo update-alternatives --config python3
```
![设置默认的 Python 版本为 3.11][9]
现在你可以开始在你当前的 Ubuntu 版本中使用最新的 Python 来进行工作/学习了。你可以使用上述命令切换到库存版本,并随时改变版本。
如果你使用上述安装方法切换到 3.11,那么请确保你检查所有必要的应用程序,看它们是否工作正常。
最后,如果你遇到问题,请在评论区告诉我。
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/install-python-3-11-ubuntu/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[wxy](https://github.com/wxy)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/wp-content/uploads/2022/10/py3112204-1024x576.jpg
[2]: https://www.debugpoint.com/install-python-3-10-ubuntu/
[3]: https://docs.python.org/3.11/whatsnew/3.11.html
[4]: https://www.debugpoint.com/ubuntu-22-04-review/
[5]: https://www.debugpoint.com/ubuntu-22-10/
[6]: https://www.debugpoint.com/fedora-37/
[7]: https://www.debugpoint.com/linux-mint-21-review/
[8]: https://www.debugpoint.com/wp-content/uploads/2022/10/Install-Python-3.11-in-Ubuntu-22.04-LTS.jpg
[9]: https://www.debugpoint.com/wp-content/uploads/2022/10/Setting-up-default-python-version-to-3.11.jpg

View File

@ -0,0 +1,110 @@
[#]: subject: "How to Upgrade Python Packages with Pip"
[#]: via: "https://itsfoss.com/upgrade-pip-packages/"
[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/"
[#]: collector: "lkxed"
[#]: translator: "chai001125"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15224-1.html"
使用 Pip 升级 Python 软件包
======
![](https://img.linux.net.cn/data/attachment/album/202211/07/153408lqflbw3mwxja3qm4.jpg)
你上次更新通过 Pip 安装的 Python 软件包是什么时候?大多数用户往往会忘记这些 Python 软件包也需要手动更新,因为仅仅更新系统存储库对于软件包来说是不起作用的。
因此,让我们花点时间看看如何使用 Pip来更新旧的 Python 软件包吧。
### 如何使用 Pip 升级 Python 软件包
[PipPip Installs Packages][1] 是一个用于管理 Python 软件包的 <ruby>命令行实用程序 <rt> command line utility </rt></ruby> 。你可以将 Pip 安装 Python 软件包,类比为在 Ubuntu 和 Debian 中使用 `apt` 管理软件包那样。
因此,接下来就让我们深入了解如何使用这个极好的工具 Pip来管理与 Python 软件包相关的内容吧。
#### 1、列出过时的 Python 软件包
在计划更新什么软件包之前,我们先要列出有哪些过时的软件包,你可以在其中选择想要更新的软件包,因为大多数人不会想一下子更新整个软件包库。
要列出过时的 Python 软件包,你只需将 `pip` 命令与 `list` 选项、`--outdated` 标志一同使用即可,如下图所示:
```
pip list --outdated
```
![outdated packages][2]
#### 2、升级特定的软件包
获得可更新的软件包列表后你可以像我之前提到的那样选择你要更新的那个特定的软件包pip 升级软件包命令的语法如下:
```
pip install package_name -U
```
例如,我想将名为 `anime-api` 的软件包升级到最新版本,所以我将使用下面的命令来升级:
```
pip install anime-api -U
```
![update anime api][3]
#### 3、将软件包升级到特定的版本
没有必要总是使用软件的最新版本,如果你想将软件包升级到不是最新的某个特定版本,参考如下的命令语法:
```
pip install --upgrade <package>==<version>
```
例如,我想将名为 `xdg` 的软件包更新到 5.1 版本5.1 版本是最新版本的前一个版本,所以可以使用以下命令:
```
pip install --upgrade xdg==5.1
```
![upgrade xdg to specific iteration][5]
#### 4、使用 Pip 一次性升级所有软件包
**请注意:我不建议你一次性升级所以软件包,因为 Python 软件包的依赖项太复杂了,一次性的升级无法处理相互依赖项。**
要一次性升级所有 python 软件包,你可以使用以下命令:
```
pip3 list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U
```
![upgrade everything][6]
上面的命令使用了 [xargs][7]。首先,会得到所有需要更新的软件包,然后对每个软件包执行 `pip3 install -U` 命令。
我在这里使用的是 `pip3`,而不是 `pip`。在 Ubuntu 22.04 及更高的版本中,`pip` 和 `pip3` 命令都可以使用。
### 总结
使用 Pip 一次性更新所有 Python 软件包并不是一个好主意。我发现一次性更新后,软件包之间的依赖关系被破坏了,所以请确保只更新你想要更新的软件包。
如果你还有其他的疑问,就请在评论区中留言吧。
--------------------------------------------------------------------------------
via: https://itsfoss.com/upgrade-pip-packages/
作者:[Sagar Sharma][a]
选题:[lkxed][b]
译者:[chai001125](https://github.com/chai001125)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/sagar/
[b]: https://github.com/lkxed
[1]: https://itsfoss.com/install-pip-ubuntu/
[2]: https://itsfoss.com/wp-content/uploads/2022/09/outdated-packages.png
[3]: https://itsfoss.com/wp-content/uploads/2022/09/update-anime-api.png
[4]: https://www.debian.org/
[5]: https://itsfoss.com/wp-content/uploads/2022/09/upgrade-xdg-to-specific-iteration.png
[6]: https://itsfoss.com/wp-content/uploads/2022/09/upgrade-everything.png
[7]: https://linuxhandbook.com/xargs-command/

View File

@ -0,0 +1,104 @@
[#]: subject: "How to Enable Dark Mode in Web Browser"
[#]: via: "https://www.debugpoint.com/dark-mode-browser/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15226-1.html"
如何在 Web 浏览器中启用深色模式
======
![](https://img.linux.net.cn/data/attachment/album/202211/08/110615dax28a8fhx13hxhi.jpg)
> 本指南旨在帮助你在 Firefox、Chrome、Chromium 和 Edge 等流行的网页浏览器中启用深色模式。
我们都喜欢深色模式。与标准浅色模式相比,许多人更喜欢它。许多桌面应用原生提供深色模式,而一些应用则是通过桌面环境的底层模式适应深色模式。
不可否认,我们都在网页浏览器上花费了很多时间。我们很少使用桌面应用(除非你从事专门的工作,例如视频编辑等)。因此,当你花费大量时间在浏览器中阅读和学习时,你始终可以选择深色模式。不过,对于网页浏览器,启用深色模式的方法略有不同。
本指南为你提供了在 Firefox、Chromium、Chrome 和 Edge 浏览器中启用深色模式的简单步骤。
### 在网页浏览器中启用深色模式
#### 在 Firefox 中启用深色模式
打开 Firefox 并点击右上角的菜单。
单击 “<ruby>设置<rt>Settings</rt></ruby> > <ruby>扩展和主题<rt>Extension and Themes</rt></ruby>”。
选择 “<ruby>深色主题<rt>Dark Theme</rt></ruby>” 并点击 “<ruby>启用<rt>enable</rt></ruby>”。你应该会看到深色模式已应用于 Firefox。
![Enable dark mode in Firefox][1]
*在 Firefox 浏览器中启用深色模式*
![Firefox in Dark Mode][2]
*深色模式下的 Firefox*
要将其还原,请按照相同的步骤并选择浅色主题。
#### Chromium 和 Chrome 中的深色模式
默认情况下Chromium 或 Chrome 不会预安装任何深色主题。因此,你需要前往 Chrome 应用商店并下载你想要的深色主题。对于本指南,我会推荐超过一百万用户使用的 “Morpheon Dark” 主题。
从 Chromium 浏览器打开 Morpheon Dark 主题页面(以下链接)。
> **[Chrome 应用商店中的 Morpheon Dark 主题][3]**
点击 “<ruby>添加到 Chrome<rt>Add To Chrome</rt></ruby>” 按钮。它应该会在 Chrome 中启用。
你可能想探索 Chrome 应用店中提供的其他深色或浅色主题。 [访问此页面获取所有深色主题的集合][4]。
但是,你应该要记住的一件事是:此主题不会更改设置或上下文菜单,这是显而易见的。因为它只是改变了浏览器窗口,而这些菜单(有时)是操作系统本身的一部分。
![Chromium Dark Theme][5]
*Chromium 深色主题*
对 Chrome 浏览器也遵循相同的步骤。
#### Edge 浏览器 深色模式
但是,[Edge 浏览器][6] 默认带有更好的深色主题。它允许你从设置中使用 GTK+、浅色和深色模式。
打开 Edge 浏览器,点击右上角的三个小点。
转到 “<ruby>外观<rt>Appearance</rt></ruby>” 并选择 “<ruby>深色<rt>Dark</rt></ruby>”。这样应该就好了。
Edge 的这种深色主题实现更好,因为它改变了上下文菜单和地址栏。
![Edge in Dark Theme][7]
*深色主题的 Edge*
### 总结
如果你是高级用户,你可能不需要本指南。你可以自己弄清楚。
但我们为所有读者涵盖了所有基础到高级教程。许多新的 Linux 用户可能不知道如何在浏览器中启用深色模式。
所以,就是说,我希望这对你和其他人有帮助。如果你遇到任何问题,请在下面的评论框中告诉我。
---
via: https://www.debugpoint.com/dark-mode-browser/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux 中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/wp-content/uploads/2021/10/Enable-dark-mode-in-Firefox.jpg
[2]: https://www.debugpoint.com/wp-content/uploads/2021/10/Firefox-in-Dark-Mode-1024x423.jpg
[3]: https://chrome.google.com/webstore/detail/morpheon-dark/mafbdhjdkjnoafhfelkjpchpaepjknad?hl=en-GB
[4]: https://chrome.google.com/webstore/category/collection/dark_themes
[5]: https://www.debugpoint.com/wp-content/uploads/2021/10/Chromium-Dark-Theme-1024x463.jpg
[6]: https://www.debugpoint.com/2020/10/how-to-install-edge-ubuntu-linux/
[7]: https://www.debugpoint.com/wp-content/uploads/2021/10/Edge-in-Dark-Theme-1024x541.jpg

View File

@ -0,0 +1,190 @@
[#]: subject: "Install WoeUSB on Ubuntu to Create a Bootable Windows USB"
[#]: via: "https://itsfoss.com/install-woeusb-ubuntu/"
[#]: author: "Sreenath https://itsfoss.com/author/sreenath/"
[#]: collector: "lkxed"
[#]: translator: "robsean"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15217-1.html"
在 Ubuntu 上安装 WoeUSB 来创建一个可启动 Windows USB
======
> 想在 Linux 上创建一个可启动 Windows USB Ventoy 是一个很好的选择。
但是,在 Ventoy 出道之前WoeUSB 是用于创建可启动 Windows USB 的首选工具。原版 WoeUSB 工程在 2014 年左右香消玉损。
鉴于其流行程度一位新的开发者接过了将其起死回生的任务。因此WoeUSB-ng 诞生了。在这里“ng” 是 <ruby>新生代<rt>new generation</rt></ruby> 的缩写。换句话说,[WoeUSB-ng][1] 是新生代的 WoeUSB 。但是,因为原版的工具已经不存在了,我将 WoeUSB-ng 描述为 WoeUSB 。
在这篇教程中,我将向你展示如何在 Ubuntu Linux 上安装 WoeUSB 。我也将分享使用 WoeUSB 来创建可启动 Windows USB 的步骤。
但是,在此之前,让我们快速查看这个令人惊叹的工具的特色。
### WoeUSB
![install woeusb ubuntu][2]
WoeUSB 是一个简单的工具,其唯一的目的是 [在 Linux 上创建可启动 Windows USB][3] 。
原版 WoeUSB 是一个 shell 脚本。这个原版 WoeUSB 被使用 Python 重写为 WoeUSB-ng ,它可以安装在你的系统上,并且通过命令行或 GUI 界面。
特色:
- 支持老式 PC 启动或 UEFI 启动
- 支持 FAT32 和 NTFS 文件系统
- 支持使用物理安装盘或磁盘镜像作为源
- 它可以用于 Windows Vista 及其更高版本的任意语言或变体版本
- 老式的 MBR/IBM PC 兼容启动模式
- 本机 UEFI 启动支持 Windows 7 及其更高版本的镜像(仅限于将 FAT 文件系统作为目标的情况)
### 在 Ubuntu 和其它的 Linux 发行版上安装 WoeUSB
Arch Linux 用户可以从 AUR 安装 WoeUSB-ng 。
对于其它的发行版,可以使用 PIP 来安装 WoeUSB 。毕竟,它是一个 Python 应用程序。在这里,我将为 Ubuntu/Debian 提供一些命令。
为安装 WoeUSB-ng ,你首先需要 [安装 PIP][4] 和其它必要的依赖项。
```
sudo apt install git p7zip-full python3-pip python3-wxgtk4.0 grub2-common grub-pc-bin
```
在这之后,你可以安装 WoeUSB-ng ,通过运行:
```
sudo pip3 install WoeUSB-ng
```
对于所有的其它安装,你可以参考其 [操作指南][5] 。
> **[WoeUSB-ng][1]**
### 前提条件: 获取 Windows 的 ISO 文件和一个兼容的 USB 磁盘
这一点没有什么需要说的。你需要有一个你将要安装的 Windows 版本的 ISO 文件。
从微软的网站,你应该能够获取 Windows 10 和 11 的ISO 文件。
> **[下载 Windows][6]**
如果你有较旧的 Windows 版本的 ISO 文件,也可以使用它们。
除此之外,你需要有一个至少 8 GB 大小的 USB 驱动器磁盘。你应该使用 NTFS 的文件系统来格式化它filesystem.
### 方法 1: 使用图形用户界面化的 WoeUSB 来创建一个可启动的 Windows USB推荐
<ruby>活动概述<rt>activity overview</rt></ruby> 或菜单中打开 woeusb-gui 。
![woeusb in ubuntu activities overview][7]
在应用程序窗口中,选择下载的 Windows ISO 和所希望的 USB 驱动器,如截屏所示,然后按下 <ruby>安装<rt>Install</rt></ruby> 按钮。
![woeusb gui setup][8]
在应用程序中也其它可用的调整,可以通过顶部的菜单栏来访问使用。
在按下“安装”按钮后woeUSB 将开始格式化和复制文件。你需要等待一些时间,因为这里有大约 6 GB 的文件需要复制。
![woeusb writing windows iso to the usb drive][9]
在复制完成后WoeUSB 将会提示一个成功的对话框。你现在可以安全地弹出 USB 驱动器,并将其作为一个可启动 USB 驱动器来使用。
![woeusb completed writing and gives a success message][10]
### 方法 2: 从终端中使用 WoeUSB针对专家
WoeUSB-ng 软件包也提供一个名称为 `woeusb` 的命令行实用程序。
为使用 WoeUSb 来创建一个可启动的 Windows USB ,你需要运行下面的命令:
```
sudo woeusb --device <path/to/Windows/ISO> <name/of/the/USB/device> --target-filesystem ntfs
```
在这里,`--device` 标识用于擦除 USB 和从零开始创建一个可启动 USB 驱动器。同样,`--target-filesystem` 标识用于设置为 NTFS ,来避免将要复制的文件大小超过 FAT 文件系统的限制。
![woeusb commandline][11]
该过程将花费一些时间来完成复制。在完成复制后,它将显示一条成功的信息。
![woeusb commandline success message][12]
此时,你可以安全地弹出 USB 驱动器,并在其它的个人电脑上将其作为一个 Windows 可启动 USB 来使用。
### 超值: 使用 WoeUSB 的 Bash Shell 脚本(针对专家)
WoeUSB 也提供一个 Bash Shell 脚本,在你的系统上,它不需要安装任何东西就可以使用。
首先,你需要从 [该工程的发布版本页面][13] 下载 Shell 脚本。
在 [执行 Shell 文件][14] 之前,你需要获取所需要的依赖项。为安装它,运行:
```
sudo apt install wimtools
```
现在,通过文件管理器或通过命令行来使它可执行。
![make woeusb script executable][15]
或者,你可以运行 `chmod +x <path/to/script>` 来使它可执行。现在,运行已下载目录中的 `./woeusb-5.2.4.bash -h` 来获取帮助。
为创建一个现场 USB ,该进程类似于 woeusb-ng 的命令行部分,但是你没有安装任何东西。
因此,在一个终端中,运行:
```
sudo <path/to/downloaded/script/file> --device <path/to/windows/ISO> <name-of-USB-device> --target-filesystem ntfs
```
这将开始将 ISO 写入 USB 驱动器,如下面的截屏所示:
![woeusb bash script running without installation][16]
在完成后,你可以安全地弹出 USB 驱动器,并将其作为可启动 USB 使用。
### 移除 WoeUSB
如果你使用 PIP 安装 WoeUSB ,你也可以类似地移除它:
```
pip3 uninstall WoeUSB-ng
```
你可以在你的系统上保留或移除已安装的依赖项。这完全取决于你。我建议保留它们。
### 总结
大约 10 年前WoeUSB 是一个非常流行的工具。其他人以另外一种形式将其复活是很好的,这就是开源的艺术。
我希望这篇教程会帮助你。如果通过 WoeUSB 创建的 Windows USB 不能按部就班地工作,你可以 [尝试使用 Ventoy][3] 。享受它。
--------------------------------------------------------------------------------
via: https://itsfoss.com/install-woeusb-ubuntu/
作者:[Sreenath][a]
选题:[lkxed][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/sreenath/
[b]: https://github.com/lkxed
[1]: https://github.com/WoeUSB/WoeUSB-ng
[2]: https://itsfoss.com/wp-content/uploads/2022/10/install-woeusb-ubuntu.png
[3]: https://itsfoss.com/bootable-windows-usb-linux/
[4]: https://itsfoss.com/install-pip-ubuntu/
[5]: https://github.com/WoeUSB/WoeUSB-ng#installation
[6]: https://www.microsoft.com/en-in/software-download/
[7]: https://itsfoss.com/wp-content/uploads/2022/10/woeusb-in-ubuntu-activities-overview.png
[8]: https://itsfoss.com/wp-content/uploads/2022/10/woeusb-gui-setup.png
[9]: https://itsfoss.com/wp-content/uploads/2022/10/woeusb-writing-windows-iso-to-the-usb-drive.png
[10]: https://itsfoss.com/wp-content/uploads/2022/10/woeusb-completed-writing-and-gives-a-success-message.png
[11]: https://itsfoss.com/wp-content/uploads/2022/10/woeusb-commandline.png
[12]: https://itsfoss.com/wp-content/uploads/2022/10/woeusb-commandline-success-message.png
[13]: https://github.com/WoeUSB/WoeUSB/releases/tag/v5.2.4
[14]: https://itsfoss.com/run-shell-script-linux/
[15]: https://itsfoss.com/wp-content/uploads/2022/10/make-woeusb-script-executable.png
[16]: https://itsfoss.com/wp-content/uploads/2022/10/woeusb-bash-script-running-without-installation.png

View File

@ -0,0 +1,38 @@
[#]: subject: "The Android Open Source Project Is Now RISC-V Compatible"
[#]: via: "https://www.opensourceforu.com/2022/11/the-android-open-source-project-is-now-risc-v-compatible/"
[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/"
[#]: collector: "lkxed"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15221-1.html"
安卓开源项目AOSP现在兼容 RISC-V 了
======
![](https://img.linux.net.cn/data/attachment/album/202211/06/091143bfvf3wz0sluua229.jpg)
> 安卓的一个重要进展是将<ruby>安卓开源项目<rt>Android Open Source Project</rt></ruby>AOSP移植到 RISC-V 处理器架构。
AOSP 已经开始在上游启用 RISC-V这将促进 RISC-V CPU 在可穿戴设备、物联网,以及最终在智能手机和笔记本电脑中的使用。
为了开放生态系统,中国科学院 PLCT 实验室的工程师和软件开发人员在 2020 年开始将 Android 10 移植到 RISC-V 架构上。阿里巴巴的云计算部门和平头哥芯片子公司一起努力保持开发与最新的安卓版本同步。
“我们很高兴看到谷歌对构建针对 RISC-V 的 AOSP 的更多支持!阿里云一直致力于通过一系列的创新来支持 RISC-V 社区的发展,比如将安卓的基本功能移植到 RISC-V 上,这证明了在从多媒体到信号处理、设备互联和人工智能等场景中使用基于 RISC-V 的设备的可行性。”阿里云生态系统总监、RISC-V 国际组织的应用与工具水平委员会副主席 David Chen 博士说:“我们期待着与安卓团队合作,为繁荣的 RISC-V 社区做出贡献。”
通过增强 RISC-V 上的安卓系统的基本功能,在 2021 年,阿里云的专家们付出了巨大的努力,积极推动了软件生态系统的发展。 RISC-V on Android 的工作集中在 RISC-V Android 工作组和软件库中进行。
--------------------------------------------------------------------------------
via: https://www.opensourceforu.com/2022/11/the-android-open-source-project-is-now-risc-v-compatible/
作者:[Laveesh Kocher][a]
选题:[lkxed][b]
译者:[wxy](https://github.com/wxy)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.opensourceforu.com/author/laveesh-kocher/
[b]: https://github.com/lkxed
[1]: https://www.opensourceforu.com/wp-content/uploads/2022/11/android-696x364.jpg

View File

@ -0,0 +1,106 @@
[#]: subject: "Kate Editor is Getting Four New Awesome Features"
[#]: via: "https://news.itsfoss.com/kate-editor-22-12-features/"
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
[#]: collector: "lkxed"
[#]: translator: "Cubik65536"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15239-1.html"
Kate 文本编辑器增加了四个非常棒的新功能
======
> 这个由 KDE 开发的功能丰富的文本编辑器正在变得更好和更有用!
![Kate 文本编辑器获得了四个非常棒的新功能][1]
[Kate 文本编辑器][2] 是一个不断发展和强大的开源文本编辑器,它可以作为微软的 Visual Studio Code 应用程序的替代品。
它可以在 Linux、Windows 和 macOS 上使用。
这个代码编辑器在 2021 年进行了重大升级,这可能使它成为了 KDE 对微软产品的回应。
在即将到来的 Kate 和 KWrite 22.12 版本上,他们的目标是添加许多非常有用的功能。
来简单看看我们可以从 Kate 中期待什么。
### 🆕 Kate Editor 的新增功能
如果你读了 [Nate 的博客][3] 了解 KDE 的改进,你可能已经知道了 KDE Plasma 和应用程序即将获得的升级。
但是,我想强调一些 Kate 22.12 将会带来的令人激动的新功能:
- 对 Qt 部件的支持
- 更新的欢迎页面
- Git 差异查看器
- 配置标签页
- 剪切板历史
#### 欢迎页面
![kate 22.12 欢迎页面][4]
和许多其他 [KDE 应用程序][6] 一样Kate 现在将显示一个欢迎页面,该页面将欢迎用户并显示创建或打开文件、启动新会话、查看最近的文档等选项。
对于不喜欢这个页面的用户,欢迎页面上将提供一个选项,以在新窗口上禁用欢迎页面。
#### Git 差异查看器
![kate 22.12 git 差异支持][6]
Kate 终于增加了对显示 git-diff 的支持;用户将能够比较他们的代码以检查差异,并找到那些令人讨厌的、会导致他们的应用程序无法正常运行错误。
用户也可以从多种视图中进行选择,例如统一视图、并排视图和原始视图。
#### 新的剪贴板历史粘贴对话框
![kate 22.12 剪贴板历史][7]
Kate 现在添加了一个新的对话框,在粘贴的时候显示用户剪贴板内容的列表。
当你在多行代码之间切换,而又不想丢失重要的内容时,这可能会很有用。
#### 配置标签页
![kate 22.12 配置标签页][8]
Kate 也将添加一个配置标签页,让用户可以更改重要的设置,并添加了一个搜索栏,使用户可以快速查找特定的设置。
#### 🛠️ 其他变更和改进
Kate 22.12 将带来的其他值得注意的改进包括:
- 优化的状态栏
- 对构建插件的改进
- 可移动的侧边栏按钮
- 对窗口处理的改进
Kate 正在成为微软的 [Visual Studio Code][9] 的合适替代品,并且自 2021 年大规模重构以来已经取得了很大的进步。
在 Kate 的 [官方博客文章][10] 中,你可以了解更多关于这些变化的信息,并看看它们实际是怎么工作的。
💬 你期待 Kate 22.12 的发布吗?还是更喜欢 VS Code
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/kate-editor-22-12-features/
作者:[Sourav Rudra][a]
选题:[lkxed][b]
译者:[Cubik65536](https://github.com/Cubik65536)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/sourav/
[b]: https://github.com/lkxed
[1]: https://news.itsfoss.com/content/images/size/w1200/2022/11/kate-4-new-features.jpg
[2]: https://kate-editor.org/
[3]: https://pointieststick.com
[4]: https://news.itsfoss.com/content/images/2022/11/Kate_22.12_Welcome.png
[5]: https://apps.kde.org/
[6]: https://news.itsfoss.com/content/images/2022/11/Kate_22.12_GitDiff-1.png
[7]: https://news.itsfoss.com/content/images/2022/11/Kate_22.12_Clipboard_Hist-1.png
[8]: https://news.itsfoss.com/content/images/2022/11/Kate_22.12_Config-1.png
[9]: https://code.visualstudio.com/
[10]: https://kate-editor.org/post/2022/2022-10-31-treats-for-kate/

View File

@ -3,22 +3,22 @@
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
[#]: collector: "lkxed"
[#]: translator: "littlebirdnest"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15212-1.html"
Linux Lite 6.2 发布
======
Linux Lite 6.2 是一个近乎完美且有用的升级,没什么太花哨的东西。
> Linux Lite 6.2 是一个理想的升级,带来一些有用的变化,没什么太花哨的东西。
![Linux Lite 6.2 Released][1]
Linux Lite 是一种流行的轻量级的类Windows 发行版,为用户提供熟悉的操作系统。
Linux Lite 是一种流行的轻量级的类 Windows 发行版,为用户提供了一个熟悉的操作系统感受
最新版本 Linux Lite 6.2 基于 Ubuntu 22.04 LTS对 UI 进行了各种更改以及各种bug的修复。
最新版本 Linux Lite 6.2 基于 Ubuntu 22.04 LTS对 UI 进行了各种更改以及各种错误的修复。
Linux Lite 6.2:有什么新功能?
### Linux Lite 6.2:有什么新功能?
![linux lite 6.2 desktop][2]
@ -26,30 +26,32 @@ Linux Lite 6.2:有什么新功能?
一些主要亮点包括:
- **更新的图标s**
- **新壁纸**
- **Shotcut 视频编辑器**
- **删除 Microsoft Teams**
- **LibreOffice 7.3.6.2**
- **Linux 内核 5.15**
- 更新的图标
- 新壁纸
- Shotcut 视频编辑器
- 删除微软 Teams
- LibreOffice 7.3.6.2
- Linux 内核 5.15
#### Shotcut 取代 OpenShot
![linux lite 6.2 shotcut video editor][3]
是的,[Shotcut][4] 现在取代[OpenShot][5]作为 Linux Lite 6.2 上的默认视频编辑器。
是的,[Shotcut][4] 现在取代了 [OpenShot][5],成为 Linux Lite 6.2 上的默认视频编辑器。
OpenShot 获得了这个位置,因为它不能很好地与 Ubuntu 22.04 配合使用,而如果没有一个好用的视频编辑器,用户将不得不自己寻找一个。
OpenShot 之所以被删除,是因为它不能很好地与 Ubuntu 22.04 配合使用,而如果没有一个好用的视频编辑器,用户将不得不自己寻找一个。
Shotcut 无疑是一款出色的视频编辑器。所以,应该是一个不错的选择。
#### 微软团队已删除
#### 微软 Teams 已删除
另一个重大变化是 Microsoft Teams 不再包含在发行版中。
另一个重大变化是微软 Teams 不再包含在发行版中。
其原因是微软停止了 Linux 应用程序,转而支持他们认为是进步的 Web 应用程序版本。
其原因是微软停止了 Linux 应用程序,转而支持一个渐进式 Web 应用程序版本。
我们之前的报道可以让您更深入地了解:
我们之前的报道可以让你更深入地了解:
> **[微软决定放弃 Teams 的 Linux 应用代之以渐进式Web应用](https://news.itsfoss.com/microsoft-linux-app-retire/)**
#### 更新的图标和新壁纸
@ -66,20 +68,20 @@ Linux Lite 6.2 具有最新的 [Papirus][7] 图标集以及一系列新的 Linux
其他值得注意的变化包括:
- 任务管理器的更新
- 改进了 Lite Upgrade 应用程序中的结束对话。
- 改进了 Lite 升级应用程序中的结束对话。
- 各种应用程序的最新更新、错误修复等。
您可以阅读完整的发行说明以[了解更多信息][9]。
你可以阅读完整的发行说明以 [了解更多信息][9]。
Linux Lite 6.2 似乎是对以前版本的令人满意的升级,有许多重大的变化和补充。
Linux Lite 6.2 看起来是对以前版本的令人满意的升级,有许多重大的变化和补充。
### 📥下载 Linux 精简版 6.2
### 📥 下载 Linux Lite 6.2
可以从其官方网站下载最新的 ISO 或使用 Lite 升级工具升级到它。
可以从其官方网站下载最新的 ISO 或使用 Lite 升级工具升级到它。
[Linux Lite 6.2][10]
> [Linux Lite 6.2][10]
💬如何看待 Linux Lite 6.2?愿意试一试吗?
💬如何看待 Linux Lite 6.2?愿意试一试吗?
--------------------------------------------------------------------------------
@ -87,8 +89,8 @@ via: https://news.itsfoss.com/linux-lite-6-2-release/
作者:[Sourav Rudra][a]
选题:[lkxed][b]
译者:[littlebirdnest](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
译者:[littlebirdnest](https://github.com/littlebirdnest)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,134 @@
[#]: subject: "How to Trim a Video in VLC Player [If You Really Want to]"
[#]: via: "https://itsfoss.com/vlc-trim-video/"
[#]: author: "Sreenath https://itsfoss.com/author/sreenath/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15241-1.html"
如何在 VLC 播放器中裁剪视频
======
![](https://img.linux.net.cn/data/attachment/album/202211/11/153202yhomxyc1ysuq57x1.jpg)
VLC 媒体播放器是 [最好的媒体播放器][1] 之一。这款跨平台播放器功能丰富,可以播放任何可用的媒体格式。
你会惊讶地发现 VLC 不仅仅是一个视频播放器。它可以对你的媒体文件做很多事情。
我们分享过 [使用 VLC 下载 YouTube 视频][2] 的 [VLC 技巧][3]。
让我再和你分享一个。用 VLC 裁剪视频怎么样?这不是 [裁剪视频][4] 的最佳方式,但它可以作为一个选择使用。
### 使用 VLC 裁剪视频
在 VLC 中裁剪视频本质上意味着从所需部分的开头到结尾录制视频。默认情况下,录制控制工具通常在 VLC 面板中不可见。
让我详细介绍一下步骤。
#### 步骤 1启用高级控件
要获取控件,你需要使其在主控制面板上可见。
首先选择“<ruby>视图<rt>View</rt></ruby>”选项,然后选中“<ruby>高级控件<rt>Advanced Controls</rt></ruby>”复选框。现在,如截图所示,出现了带有几个按钮的新控件行。
![在 vlc 播放器中启用高级控件视图][5]
#### 步骤 2打开视频
为了裁剪视频,你需要在 VLC 中打开它。你可以通过“<ruby>媒体<rt>Media</rt></ruby> > <ruby>打开文件<rt>Open File</rt></ruby>”在 VLC 播放器中打开视频:
![通过 vlc 文件菜单打开媒体文件][6]
或者你可以使用 Nautilus 文件管理器中的 VLC 打开视频文件:
![使用 nautilus 文件管理器中的 vlc 播放器打开媒体文件][7]
#### 步骤 3使用 VLC 的录制功能裁剪视频
打开视频文件后,将时间线设置为所需输出的起点并暂停视频。之后,按“录制”按钮并播放视频。
![在起点暂停,按录制键开始录制][8]
当达到所需输出的终点时,暂停视频并再次按下“录制”按钮停止录制。
![在终点暂停并按下录制][9]
这应该将裁剪后的输出保存到你的 `~/Videos` 目录中。
![nautilus 文件管理器中的原始和裁剪后文件][10]
### 故障排除:无法识别的输出文件
VLC 以 .ts 文件格式录制视频。这在 VLC 中受支持,你可以根据需要使用它。但是 Ubuntu 中的许多其他播放器,包括本地视频播放器,都无法识别该格式。因此,在这种情况下,有两种解决方案。
#### Gnome-Video 提示安装 GStreamer 包
当你尝试打开文件时GNOME-Videos 会提示错误并建议安装 Gstreamer 多媒体编解码器。
![转换后的视频在 gnome 视频播放器中显示播放错误][11]
你可以点击上图所示的 “<ruby>在 Ubuntu 软件应用中查找<rt>Find in Ubuntu Software</rt></ruby>” 按钮,这将打开 Ubuntu 软件中心。你可以在那里安装所需的编解码器包。
![根据 GNOME 视频播放器的提示从软件中心安装 gstreamer][12]
同样安装 Gnome-videos 并使用它打开视频将解决问题。
#### 使用 VLC 转换视频文件
如果你不想为此安装任何额外的软件包,你可以使用 VLC 本身将 .ts 文件转换为 mp4 格式以在任何其他播放器中播放。
为此,打开 VLC 并在“<ruby>媒体<rt>Media</rt></ruby>”菜单下选择“<ruby>转换/保存<rt>Conver/Save</rt></ruby>”选项。
![从媒体菜单中选择转换][13]
现在,使用“<ruby>添加<rt>Add</rt></ruby>”按钮提供需要转换的文件的位置,然后选择“<ruby>转换/保存<rt>Conver/Save</rt></ruby>”,如截图所示。
![在媒体转换对话框中选择要转换的文件][14]
选择所需的输出配置MP4并为输出设置文件名然后按“<ruby>开始<rt>Start</rt></ruby>”。
![在 vlc 媒体转换菜单中设置转换配置和输出文件名][15]
这将开始转换,并根据源的时长决定转换时间。完成后,你可以从 `~/Videos` 目录访问转换后的输出。
![nautilus 文件管理器中的原始裁剪和转换文件][16]
### 总结
虽然确实可以使用 VLC 播放器来裁剪视频,但整个过程与专门的 [视频编辑器][17] 完全不同。
最大的问题是你需要观看所有裁剪部分才能完成裁剪,如果你要裁剪跨越数分钟的视频的一大部分,这就不方便了。
无论如何,这个很酷的功能在某些情况下可能是一个方便的工具,比如你想要的只是裁剪一个特定的小剪辑或从电影场景中制作一个 Gif。
--------------------------------------------------------------------------------
via: https://itsfoss.com/vlc-trim-video/
作者:[Sreenath][a]
选题:[lkxed][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/sreenath/
[b]: https://github.com/lkxed
[1]: https://itsfoss.com/video-players-linux/
[2]: https://itsfoss.com/download-youtube-videos-vlc/
[3]: https://itsfoss.com/simple-vlc-tips/
[4]: https://itsfoss.com/video-trimmer/
[5]: https://itsfoss.com/wp-content/uploads/2022/11/enable-advanced-controls-view-in-vlc-player.png
[6]: https://itsfoss.com/wp-content/uploads/2022/11/open-media-file-through-vlc-file-menu.png
[7]: https://itsfoss.com/wp-content/uploads/2022/11/open-media-file-with-vlc-player-from-nautilus-file-manager.png
[8]: https://itsfoss.com/wp-content/uploads/2022/11/pause-at-start-point-and-start-record-by-pressing-record-button.png
[9]: https://itsfoss.com/wp-content/uploads/2022/11/pause-at-end-point-and-press-record.png
[10]: https://itsfoss.com/wp-content/uploads/2022/11/original-and-trimmed-file-in-nautilus-file-manager.png
[11]: https://itsfoss.com/wp-content/uploads/2022/11/converted-video-shows-a-play-error-in-gnome-video-player-app.png
[12]: https://itsfoss.com/wp-content/uploads/2022/11/install-gstreamer-from-software-as-prompted-by-the-gnome-video-player.png
[13]: https://itsfoss.com/wp-content/uploads/2022/11/select-convert-from-media-menu.png
[14]: https://itsfoss.com/wp-content/uploads/2022/11/select-file-to-convert-in-the-media-convert-dialog-box.png
[15]: https://itsfoss.com/wp-content/uploads/2022/11/set-conversion-profiles-and-output-file-name-in-vlc-media-convert-menu.png
[16]: https://itsfoss.com/wp-content/uploads/2022/11/original-trimmed-and-converted-file-in-nautilus-file-manager.png
[17]: https://itsfoss.com/open-source-video-editors/

View File

@ -0,0 +1,163 @@
[#]: subject: "Xfce 4.18: Top New Features & Release Guide"
[#]: via: "https://www.debugpoint.com/xfce-4-18-features/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15228-1.html"
前瞻Xfce 4.18 主要新功能
======
> 有关 Xfce 4.18 的核心和原生应用程序的功能的全面介绍。
经过近两年的开发Xfce 4.18 将在 2022 年圣诞节期间发布。作为 [Xfce 4.16][1] 以来的重要的版本,其一直在开发标签 4.17 下进行开发,以增强这个轻量级桌面。
考虑到 GTK4 的更新、初步的 Wayland 支持以及核心和本地应用程序的改进Xfce 4.18 是一个重要的里程碑版本,其带来了大量更新。
从发布时间来看,第一个 Xfce 4.18 预发布版pre1已经发布。2022 年 12 月的第一周会有另一个预发布版。而 Xfce 4.18 的最终版本预计将在 2022 年 12 月 15 日至 12 月 29 日之间发布。
由于目前还没有官方的详细介绍,我在这篇文章中总结了 Xfce 4.18 的基本和主要功能。
请继续阅读。
![Xfce 4.18 pre1 (compiled in Arch)][2]
### Xfce 4.18 的新功能
#### 1、核心库更新
Xfce 4.18 的依赖关系有所改变,并使用以下版本进行编译:
- glib-2.0 >= 2.66
- gtk >= 3.24
- libcairo >= 1.16
- gdk-pixbuf-2.0 >= 2.40
- gobject-introspection >= 1.66
#### 2、桌面和面板
顶部的主面板带来了新的设置和调整。但整体外观仍与以前的 4.16 版本中的一样。一些默认的面板小程序在这个版本中也有变化。桌面图标、右键上下文菜单和项目保持不变。
面板的首选项设置有两个新的选项。首先,面板的长度现在以**像素**设置,而不是百分比。其次,一个新的选项,“<ruby>保持面板在窗口上方<rt>Keep panel above windows</rt></ruby>” ,可以让你将窗口对话放到面板后面。之前,应用程序的窗口只能达到面板的边缘。
![Xfce 4.18 中的面板首选项][3]
彻底修改了时钟小程序的设置。是的,你终于可以改变 Xfce 时钟小程序的字体风格。与此同时,它提供了四种时钟布局:
- 只有日期
- 只有时间
- 日期和时间
- 时间和日期
此外,你还可以向日历中添加命令。
![终于你可以改变 Xfce 时钟小程序的字体了][4]
#### 3、Thunar 文件管理器
也许这个版本中最令人兴奋的变化是 Thunar 文件管理器的功能。首先,一个新的“搜索”图标取代了工具栏上的“重新加载”按钮。当点击时,它会在地址栏上出现搜索,可以使用你的搜索关键词进行递归搜索。重新加载按钮被放到了 “<ruby>查看<rt>View</rt></ruby>” 菜单中。
其次,在左边的导航栏上增加了一个的新项目,“<ruby>最近<rt>Recent</rt></ruby>”。在底部,元数据更有条理(从逗号分隔改为竖线分隔),还有一个新的上下文菜单项可以选择你想要显示的元数据。
![Thunar 4.18 的视觉变化][5]
Thunar 的主菜单有很多变化。下面列出了主要的变化。在下面的图片中还标注了自 4.16 以来的变化。
- 引入了一个**新的书签菜单**,可以将当前文件夹作为快捷方式添加到侧边栏。
- “<ruby>编辑<rt>Edit</rt></ruby>”菜单有了 “<ruby>撤销<rt>undo</rt></ruby>” 和 “<ruby>重做<rt>redo</rt></ruby>” 选项。
- “<ruby>前往<rt>Go</rt></ruby>” 菜单有了 “<ruby>最近<rt>Recent</rt></ruby>” 和 “<ruby>搜索<rt>Search</rt></ruby>” 的选项。
Thunar 首次通过 “<ruby>视图<rt>View</rt></ruby>”菜单项有了“<ruby>分割视图<rt>Split view</rt></ruby>”! 是的,你现在可以在视图面板中拖放项目。
前不久,我 [报道][6] 说图像预览即将在 Thunar 中出现。而它终于来了。作为谷歌代码之夏 2022 的部分开发成果,你现在可以嵌入在侧边栏中看到图片预览。或者在右边的一个独立的新面板上查看。它可以通过偏好设置来改变。
下面是它的外观。
![带有独立图像预览的 Thunar 分割视图][7]
![嵌入图像预览的 Thunar 分割视图][8]
#### 4、Thunar 的首选项
Thunar 设置中出现了大量调整。首先,一个新的选项卡可以为 Thunar 定制你的键盘快捷键。你可以直接指定新的快捷键组合,并从这个选项卡中改变现有的快捷键组合。
![Thunar 的新快捷键标签][9]
<ruby>显示<rt>Display</rt></ruby>” 设置中新增了一个缩略图部分,你现在可以指定缩略图的文件大小。缩略图的具体设置也被归为一组。
![4.18 版的 Thunar 显示设置][10]
<ruby>侧面板<rt>Side Pane</rt></ruby>” 选项卡有了一个新的图像预览选项,你在上面看到过。你可以设置为嵌入式或独立式预览。此外,“<ruby>行为<rt> Behaviour</rt></ruby>” 选项卡增加了 “<ruby>启动时恢复选项卡<rt>restore tabs on startup</rt></ruby>” 和在选项卡标题中显示 “<ruby>完整的目录路径<rt>full directory path</rt></ruby>” 的选项,这将有很大帮助。
<ruby>高级<rt>Advanced</rt></ruby>” 选项卡为 “<ruby>文件传输<rt>File Transfer</rt></ruby>” 提供了一个新的设置部分,有两个新的选项:“<ruby>中间文件复制<rt>Intermediate file copy</rt></ruby>”和“<ruby>验证校验和<rt>Verify checksum</rt></ruby>”。此外,在这个选项卡中还增加了一个新的递归搜索的选项。你还可以通过以下选项将 Thunar 设置为直接 “<ruby>执行 Shell 脚本<rt>Execute Shell script</rt></ruby>”。
![Thunar 4.18 的高级选项][11]
除了上述变化外,文件夹属性对话框现在可以显示文件和文件夹的数量。另外,一个新的高亮选项使你能够为你的文件夹图标背景和前景选择任何自定义颜色。如果你有一个复杂的文件夹结构,这将使你能够快速导航。
下面是它的外观。
![文件夹高亮演示][12]
#### 设置
<ruby>外观<rt>Appearances</rt></ruby>” 设置现在允许你打开和关闭对话框的标题栏。
<ruby>桌面<rt>Desktop</rt></ruby>” 设置允许文件上下文菜单中的删除选项(打开或关闭)。
<ruby>显示<rt>Display</rt></ruby>” 设置现在允许你为多种显示情况设置默认值:镜像、扩展显示还是什么都不做。早些时候,这些选项在显示器被连接时才可用。
#### Wayland 和其他更新
除了上述 Xfce 4.18 的功能外,窗口管理器和桌面还有许多额外的错误修复和性能改进。这些都是在底层的,你应该能感受到一个更精良的 Xfce 桌面体验。
Xfce 桌面核心和原生应用程序的 Wayland 迁移工作开始了。离它完全准备好还有很长的路要走。在这个版本中,你可能不会看到很多 Wayland 的更新。然而,许多应用程序在 Wayland 下已经可以正常工作了。你可以在 [本页][13] 了解更多关于迁移状态的信息。
### 下载及什么时候出现在发行版
Xfce 4.18 应该会在 2023 年 4 月进入 Ubuntu 23.04 Lunar Lobster并在 Fedora 38 中出现。基于滚动发布的发行版,如 Arch Linux、Manjaro 和 OpenSUSE Tumbleweed 应该会在 2022 年 12 月发布后的几天内得到它。轻量级的流行发行版 [MX Linux][14] 应该在 2023 年采用这个版本,这个时候也是 Debian Bookworm 更新的时候。
Xfce 4.18 的第一个预发布版本 [现已发布][15]。你可以从下面的页面下载源码压缩包,并编译它们。请参考官方的 [编译指南][16]。
> **[下载 Xfce 4.18 源代码pre1][17]**
### 总结
总的来说变化的数量巨大。许多核心变化和需要的变化都进入了这个版本。Thunar 文件管理器的更新是早该进行的,对于 Xfce 的爱好者来说应该是完美的。
随着 Wayland 的支持,未来的 Xfce 版本可能会带来一个可行的 Xfce 版本。Wayland 的支持仍在进行中,每个组件都有许多决定有待作出。许多发行版和关键部署仍然喜欢 Xfce 而不是 KDE Plasma 或 GNOME。考虑到这些用例和未来的路线图Xfce 4.18 是下一个版本之前的一个重要的里程碑。
列表中你最喜欢的功能是什么?请在评论栏里告诉我。
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/xfce-4-18-features/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[wxy](https://github.com/wxy)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/xfce-4-16-review/
[2]: https://www.debugpoint.com/wp-content/uploads/2022/11/Xfce-4.18-pre1-compiled-in-Arch-1024x594.jpg
[3]: https://www.debugpoint.com/wp-content/uploads/2022/11/Panel-preferences-in-Xfce-4.18.jpg
[4]: https://www.debugpoint.com/wp-content/uploads/2022/11/Finally-you-can-change-the-font-of-Xfce-Clock-applet.jpg
[5]: https://www.debugpoint.com/wp-content/uploads/2022/11/Thunar-4.18-visual-changes.jpg
[6]: https://debugpointnews.com/thunar-image-preview/
[7]: https://www.debugpoint.com/wp-content/uploads/2022/11/Thunar-split-view-with-embedded-image-preview.jpg
[8]: https://www.debugpoint.com/wp-content/uploads/2022/11/Thunar-split-view-with-sidebar-image-preview.jpg
[9]: https://www.debugpoint.com/wp-content/uploads/2022/11/New-shortcut-tab-in-Thunar.jpg
[10]: https://www.debugpoint.com/wp-content/uploads/2022/11/Thunar-Display-Settings-in-4.18.jpg
[11]: https://www.debugpoint.com/wp-content/uploads/2022/11/Advanced-options-of-Thunar-4.18.jpg
[12]: https://www.debugpoint.com/wp-content/uploads/2022/11/Folder-highlight-demo.jpg
[13]: https://wiki.xfce.org/releng/wayland_roadmap
[14]: https://www.debugpoint.com/tag/mx-linux
[15]: https://www.reddit.com/r/xfce/comments/yjiwwv/announce_xfce_418pre1_released/
[16]: https://docs.xfce.org/xfce/building
[17]: https://archive.xfce.org/xfce/4.18pre1/fat_tarballs

View File

@ -1,123 +0,0 @@
[#]: subject: "Portmaster 1.0 Release Marks it as a Solid Open-Source Application Firewall for Privacy-Focused Users"
[#]: via: "https://news.itsfoss.com/portmaster-1-release/"
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Portmaster 1.0 Release Marks it as a Solid Open-Source Application Firewall for Privacy-Focused Users
======
Portmaster is an all-in-one open-source privacy tool that you probably need. Give it a try!
![Portmaster 1.0 Release Marks it as a Solid Open-Source Application Firewall for Privacy-Focused Users][1]
Portmaster by [Safing][2] is a free and open-source application firewall that aims to automate the process of protecting the privacy of its users.
**It allows you to monitor network activity, add custom connection rules for applications, and more.**
We tested it during the alpha stage, and came to the conclusion that it had good potential to act as a viable alternative to [GlassWire][3]. Of course, it may not be a replacement, but it can be one in the near future:
With the release of Portmaster 1.0, we can recommend everyone to give it a try.
> 💡Portmaster 1.0 is a stable release suitable for every user.
### 🆕 Portmaster 1.0: What's New?
![portmaster 1.0][4]
Considering this is Portmaster's first stable release, there could be room for improvement.
However, some of the features that it brings with it include:
- **Easy navigation to monitor app network connections**
- **Secure DNS by default**
- **Automatic blocking of trackers & malware**
#### Automatic Blocking Of Trackers & Malware
![portmaster 1.0 filter lists][5]
Portmaster lets you automatically block various trackers and malware by using well-known filter lists from the likes of [AdAway][6], [abuse.ch][7], [AdGuard][8], and a few of their curated lists.
#### Side-Dash Menu
![portmaster 1.0 side dash menu][9]
The presence of sidebar menu in Portmaster makes things easy, meaning it acts as a quick switcher between apps and settings.
![portmaster side-dash][10]
It also shows key information regarding apps that are using the network.
Additionally, suppose you are using their [paid SPN service][11] (or Portmaster Unlimited). In that case, you can use the Side-Dash to see which countries each app connects to, alongside the number of identities in use.
![portmaster 1.0 country identity details][12]
#### Other Features
![allow or block connections][13]
In addition to the key highlights, it also gives you some powerful abilities that include:
- **Choose your favorite DNS-over-TLS provider, like Cloudflare, Quad9, AdGuard, etc., to encrypt DNS requests.**
- **Allow/Block specific websites or applications.**
- **Specify if you do not want your apps to connect to specific countries.**
- **Block all p2p connections.**
### 📥 Download Portmaster 1.0
Portmaster is currently only available for Windows and Linux, with no news on the release of a macOS version.
They plan to support mobile platforms in the future as well.
You can visit its official [downloads page][14] to get started for Linux (.deb/.rpm packages) and Windows.
Explore more about the project on its [GitHub page][15].
[Portmaster 1.0][14]
### 💭 My Thoughts
Portmaster aims to succeed in a space where GlassWire is a very well-known name. It is easy to use and offers an intuitive experience.
**But, GlassWire is not open-source and does not have a client for Linux.**
With further refinements, I think it would be an impressive addition to every privacy-conscious computer user.
Of course, a free and open-source alternative to any proprietary tool is a good thing, as it enables more users to try it out.
And, Portmaster is something that helps you monitor your network connections and automate your privacy protections, I think you should take it for a spin! 😊
💬 Is Portmaster a good application firewall for your use-case? What do you think about it?
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/portmaster-1-release/
作者:[Sourav Rudra][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/sourav/
[b]: https://github.com/lkxed
[1]: https://news.itsfoss.com/content/images/size/w1200/2022/10/portmaster-1-0-release.png
[2]: https://safing.io/
[3]: https://www.glasswire.com/
[4]: https://news.itsfoss.com/content/images/2022/10/Portmaster_1.0.png
[5]: https://news.itsfoss.com/content/images/2022/10/Portmaster_1.0_Filter_Lists.png
[6]: https://adaway.org/
[7]: https://abuse.ch/
[8]: https://adguard.com/
[9]: https://news.itsfoss.com/content/images/2022/10/Portmaster_1.0_Side_Dash.png
[10]: https://news.itsfoss.com/content/images/2022/10/portmaster-1-0-screenshot.png
[11]: https://safing.io/spn/
[12]: https://news.itsfoss.com/content/images/2022/10/Portmaster_1.0_Country_Details.png
[13]: https://news.itsfoss.com/content/images/2022/10/manually-allow-ord-block-connections.png
[14]: https://safing.io/download/
[15]: https://github.com/safing/portmaster/

View File

@ -1,38 +0,0 @@
[#]: subject: "The Android Open Source Project Is Now RISC-V Compatible"
[#]: via: "https://www.opensourceforu.com/2022/11/the-android-open-source-project-is-now-risc-v-compatible/"
[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
The Android Open Source Project Is Now RISC-V Compatible
======
![android][1]
A crucial advancement for the technology is the porting of the Android Open Source Project (AOSP) to the RISC-V processor architecture.
The AOSP has begun enabling RISC-V upstream, which will promote the use of RISC-V CPUs in wearables, the Internet of Things, and eventually smartphones and laptops.
In an effort to open up the ecosystem, engineers and software developers from the Chinese Academy of Sciences PLCT Lab started porting Android 10 to the RISC-V architecture in 2020. Together, Alibabas Cloud division and T-Head chip subsidiary have worked hard to maintain the development up to date with the latest Android releases.
“We are glad to see more support from Google for building AOSP targeting RISC-V! Alibaba Cloud has been committed to supporting the RISC-V community through a series of innovations, such as progressing the porting of basic Android functions onto RISC-V, which proves the feasibility of using RISC-V based devices in scenarios ranging from multimedia to signal processing, device interconnection, and artificial intelligence. We look forward to engaging with the Android team to contribute to the thriving RISC-V community down the road,” said Dr. David Chen, Director of Ecosystem from Alibaba Cloud and Vice Chair of the Applications & Tools Horizontal Committee at RISC-V International.
By enhancing the fundamental capabilities of Android on RISC-V, experts at Alibaba Cloud made a significant effort to actively assist the software ecosystem throughout 2021. The RISC-V Android Working Group and the software repository are where the RISC-V on Android efforts are concentrated.
--------------------------------------------------------------------------------
via: https://www.opensourceforu.com/2022/11/the-android-open-source-project-is-now-risc-v-compatible/
作者:[Laveesh Kocher][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.opensourceforu.com/author/laveesh-kocher/
[b]: https://github.com/lkxed
[1]: https://www.opensourceforu.com/wp-content/uploads/2022/11/android-696x364.jpg

View File

@ -1,114 +0,0 @@
[#]: subject: "Kate Editor is Getting Four New Awesome Features"
[#]: via: "https://news.itsfoss.com/kate-editor-22-12-features/"
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Kate Editor is Getting Four New Awesome Features
======
KDE's feature-packed text editor is getting better and more useful!
![Kate Editor is Getting Four New Awesome Features][1]
[Kate Editor][2] is a constantly evolving and powerful open-source text editor that acts as a viable alternative to Microsoft's proprietary Visual Studio Code application.
It is available for Linux, Windows, and macOS.
The code editor received a significant upgrade in 2021 potentially making it KDE's answer to Microsoft's offering.
With the upcoming Kate and KWrite 22.12 release, they aim to add a number of much-needed features.
Let's take a brief look at what we can expect from Kate.
### 🆕 Kate Editor: New Feature Additions
If you have been reading [Nate's blog][3] for KDE improvements, you probably know all about the upgrades coming to KDE Plasma and the applications.
However, some exciting additions are coming to Kate 22.12 that I wanted to highlight:
- **Support for Qt Widgets**
- **Updated Welcome Page**
- **Git Diff Viewer**
- **Configuration Tab**
- **Clipboard History**
#### Welcome Page
![kate 22.12 welcome page][4]
Image Credits: KDE
Like many other [KDE apps][5], Kate will now show a welcome page that will greet users with a welcome screen and include options like creating or opening a file, starting a new session, viewing recent documents, and more.
For users who might not like this, an option will be provided on the welcome page to disable this behavior for a new window.
#### Git Diff Viewer
![kate 22.12 git diff support][6]
Image Credits: KDE
Kate will finally get support for viewing git-diff; users will be able to compare their code to check for differences and find those pesky bugs that are causing their application not to run correctly.
Users will also be able to choose from a variety of views, such as unified, side-by-side, and raw.
#### New Clipboard History Paste Dialog
![kate 22.12 clipboard history][7]
Image Credits: KDE
A new dialog has been added to Kate, showing users a list of previous clipboard content while pasting.
This can be helpful if you are juggling between multiple lines of code and don't want to lose track of the essential bits.
#### Configuration Tab
![kate 22.12 configuration tab][8]
Image Credits: KDE
Kate will also feature a configuration tab that lets users change significant settings and a search bar to quickly find specific settings.
#### 🛠️ Other Changes and Improvements
Some other notable improvements to be featured on Kate 22.12 are:
- **Optimized Status Bar**
- **Improvements to the Build Plugin**
- **Moveable Sidebar Buttons**
- **Improvements to Window Handling**
Kate is shaping to be a suitable alternative to Microsoft's [Visual Studio Code][9] and has come a long way since its major revamp in 2021.
In Kate's [official blog post][10], you can learn more about these changes and watch them in action.
💬 Are you looking forward to the release of Kate 22.12? Or do you prefer VS Code?
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/kate-editor-22-12-features/
作者:[Sourav Rudra][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/sourav/
[b]: https://github.com/lkxed
[1]: https://news.itsfoss.com/content/images/size/w1200/2022/11/kate-4-new-features.jpg
[2]: https://kate-editor.org/
[3]: https://pointieststick.com
[4]: https://news.itsfoss.com/content/images/2022/11/Kate_22.12_Welcome.png
[5]: https://apps.kde.org/
[6]: https://news.itsfoss.com/content/images/2022/11/Kate_22.12_GitDiff-1.png
[7]: https://news.itsfoss.com/content/images/2022/11/Kate_22.12_Clipboard_Hist-1.png
[8]: https://news.itsfoss.com/content/images/2022/11/Kate_22.12_Config-1.png
[9]: https://code.visualstudio.com/
[10]: https://kate-editor.org/post/2022/2022-10-31-treats-for-kate/

View File

@ -0,0 +1,98 @@
[#]: subject: "Linux Mint's Update Manager Now Supports Flatpak"
[#]: via: "https://news.itsfoss.com/linux-mint-update-manager/"
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
[#]: collector: "lkxed"
[#]: translator: "qfzy1233"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Linux Mint's Update Manager Now Supports Flatpak
======
Linux Mint's Update Manager just got more helpful!
![Linux Mint's Update Manager Now Supports Flatpak][1]
Linux Mint's Update Manager is an essential part of the distro that makes the experience easier for new users.
A recent update has pushed many improvements to Linux Mint 21, including Flatpak support with the update manager.
**You just need to update your system to get these refinements.**
### ⭐ Flatpak Support In Update Manager
![linux mint 21 flatpak support in update manager][2]
Image Credits: The Linux Mint Blog
Yes, you read that right. It is finally happening.
Flatpak support has been added to the Update Manager, letting users update Flatpak applications and runtimes in a few clicks.
This should make way for a unified update experience that further improves the user experience.
It is beneficial for new users who need not be familiar with terminal commands to update Flatpak. Also, you do not require to integrate Flatpak with the software center (for GNOME).
In other words, the Linux Mint team enhanced your experience with Flatpak apps.
**Alongside Flatpak support, the update includes a few more enhancements to Linux Mint 21, which is immediately available as an update.**
Some of the refinements include:
### Improvements To Corner Bar
![linux mint 21 updated corner bar][3]
Image Credits: The Linux Mint Blog
The corner bar on Linux Mint 21 has received two new additions:
- **Ability to set left click and middle click actions to the corner bar; you can configure it to show the desktop, the workspace selector, or the desklets.**
- **A new option lets you hover your mouse on the corner bar to show the desktop.**
### Updates To Nemo
![linux mint 21 updated nemo file manager][4]
Image Credits: The Linux Mint Blog
The Nemo file manager has received a few tweaks; now, when files are selected, only the file names will be highlighted instead of the icon and file name.
**If you did not know**, you could enhance the Nemo file manager experience with some of our suggested tweaks as well:
Furthermore, the desktop icon has been flipped vertically, and a new shortcut has been added to the desktop's context menu to give quick access to the display settings.
### Fewer Password Prompts
This is another user experience tweak that many of you might like.
When removing a Flatpak or any shortcut or local application, it will no longer ask you for a password.
Similarly, in the case of Synaptic and the Update Manager, pkexec will be used to remember the password.
This way, users do not have to enter the password every time they perform multiple operations.
You can refer to [Linux Mint's monthly blog post][5] to learn about other changes.
**Via: [DebugPointNews][6]**
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/linux-mint-update-manager/
作者:[Sourav Rudra][a]
选题:[lkxed][b]
译者:[qfzy1233](https://github.com/qfzy1233)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/sourav/
[b]: https://github.com/lkxed
[1]: https://news.itsfoss.com/content/images/size/w1200/2022/11/mint-updater-tool-flatpak-support.png
[2]: https://news.itsfoss.com/content/images/2022/11/Linux_Mint_21_UM_FlatpakSupport.png
[3]: https://news.itsfoss.com/content/images/2022/11/Linux_Mint_21_CornerBar_Update.png
[4]: https://news.itsfoss.com/content/images/2022/11/Linux_Mint_21_Nemo_Updates.png
[5]: https://blog.linuxmint.com/?p=4424
[6]: https://debugpointnews.com/linux-mint-update-flatpak/

View File

@ -0,0 +1,102 @@
[#]: subject: "Microsoft Teams Progressive Web App Experience is Here for Linux"
[#]: via: "https://news.itsfoss.com/microsoft-teams-pwa-linux/"
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Microsoft Teams Progressive Web App Experience is Here for Linux
======
Microsoft Teams PWA is now available for Linux users!
![Microsoft Teams Progressive Web App Experience is Here for Linux][1]
After recently [dropping support][2] for a native Microsoft Teams Linux app, Microsoft has finally made the **PWA** (progressive web app) available to everyone.
PWA is an app that uses the same code as a website but with a few changes that make it easier to use it as an app.
Users of the native Linux app have mixed feelings about this move, some welcoming it and others not.
Let us take a look at what Microsoft has done with this app.
### ⭐ Microsoft Teams Progressive Web App
![microsoft teams pwa][3]
With the [Microsoft Teams][4] PWA, you get several features already available on the Windows client. So, it is a good thing for most users.
The features include:
- **Ability to set custom backgrounds**
- **A new gallery view**
- **Reactions to chats**
- **Raise-a-hand feature during meetings**
- **System Notifications**
The Teams PWA comes with a dock icon and can be set to auto-start on system boot.
Additionally, it gets easy access to app permissions and can be used with Conditional Access configuration (for Azure users), applied via the Endpoint Manager.
**Related Read 📖**
### 👇 How to Use the PWA
![microsoft teams pwa install prompt][5]
When you first log in to Teams on a web browser, it should show you a pop-up similar to the one shown above.
Click on it to install the PWA, launch it from your application list, and then use it like a desktop app.
> 💡Users of Firefox beware: Only Chromium-based browsers like Chrome and Edge support PWAs.
But, if it doesn't show you a pop-up, or you mistakenly clicked on 'Not-now', follow these steps to install the Teams PWA.
![microsoft teams pwa edge][6]
For **Microsoft Edge**:
1. Log in to Teams through the [official website][7]. 2. Click on the three-dot menu of the browser. 3. Then go into '**Apps**.' as shown in the screenshot above. 4. Click on '**Install this site as an app.**'  5. Set the app name and click on '**Install**' to set up the Teams PWA.
If you are using Google Chrome on Linux, here's what it looks like:
![microsoft teams pwa chrome][8]
The steps include login to **Teams → Three-dot menu → More tools → Create shortcut.**
Next, you need to do the following to create the PWA:
![microsoft teams pwa chrome 2][9]
- **Set app name**
- **Enable 'Open as window'**
- **Click on 'Create'**
That's pretty easy! So, have you tried Microsoft Teams PWA experience on Linux yet?
Share your thoughts in the comments below!
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/microsoft-teams-pwa-linux/
作者:[Sourav Rudra][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/sourav/
[b]: https://github.com/lkxed
[1]: https://news.itsfoss.com/content/images/size/w1200/2022/11/ms-teams-pwa-arrives-on-linux.png
[2]: https://news.itsfoss.com/microsoft-linux-app-retire/
[3]: https://news.itsfoss.com/content/images/2022/11/MicrosoftTeams_PWA.png
[4]: https://www.microsoft.com/en-in/microsoft-teams/group-chat-software
[5]: https://news.itsfoss.com/content/images/2022/11/MicrosoftTeams_PWA_Install.png
[6]: https://news.itsfoss.com/content/images/2022/11/MicrosoftTeams_PWA_Edge.png
[7]: https://teams.live.com
[8]: https://news.itsfoss.com/content/images/2022/11/MicrosoftTeams_PWA_Chrome.png
[9]: https://news.itsfoss.com/content/images/2022/11/MicrosoftTeams_PWA_Chrome_2.png

View File

@ -0,0 +1,97 @@
[#]: subject: "What you actually need to know about open source to get started"
[#]: via: "https://opensource.com/article/22/11/get-started-open-source"
[#]: author: "Katie Edwards https://opensource.com/users/kaedward"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
What you actually need to know about open source to get started
======
A beginner's guide to open source explained in plain terms.
So you want (or need) to figure out what ["open source"][1] really means. I'll cover the basics of open source, whether you're interested in contributing to a project or want to be in the loop at a new job where the term keeps getting thrown around.
Full disclosure: I am a person with little technical experience, working in the content-design fringes of a very technical open source environment. Given my background in marketing and communication, I felt like a fish out of water when I made this career switch. [Git][2], data science, the ins and outs of software… It was, and still is a year later, a lot to comprehend.
But that's why I'm writing this piece. I want to help make open source a little less intimidating. After all, at the center of open source is a supportive learning community—built for everyone, technically experienced or not.
I'll start with the absolute basics.
### What is open source?
For the record, the industry definition of open source is available at the [Open Source Initiative][3] site.
However, the popular perception of "open source" software is usually that it doesn't cost anything, the source code is accessible, anyone can contribute to it, and you can redistribute it or do whatever else you want with it.
Some of that is true, and some of it plays into a few common misconceptions, one of which is cost.
#### Open source costs $0
Is it true? Usually, but not always. By nature of its code being publicly available, open source software can be obtained at no cost. However, for-profit companies do exist around open source projects. But if the software is available at no cost, how do open source companies even exist? How do they make money?
The concept of having a "free product" is counter-intuitive. But that's just the thing: A company doesn't have to sell software to profit from the management of products, storage of data, and customer support.
Many companies follow a subscription model, offering customer support in case of bugs or general confusion. Data storage isn't free, so that is another area where these companies can bring in income. In this regard, the "product" isn't the software; it's the benefit of a subscription.
- **The source code is accessible**: Is it true? Yes, always. This accessibility is a prerequisite for adopting the term "open source." The source code must be available to view, use, modify, and redistribute.
- **You can do whatever you want with the code**: Is it true? It depends. Subject to licensing terms, there are some limitations on how you can use code, but you can generally use it however you'd like. Whether that means tweaking a project to fit a specific need or using it as the basis for something else, open source software is yours, and everyone else's, to modify.
- **Anyone can contribute to open source projects**: Is it true? Yes - within limits. Anyone with the [right skill set][4] can contribute to open source. However, that doesn't mean all contributions are always accepted and implemented.
For example, say you're interested in a project where the end goal is a catalog of all the types of birds in the world. You're really into dinosaurs, specifically dinosaurs that may have eventually evolved into modern-day birds. So, you contribute entries for all of the most bird-like dinosaurs. The project owners could see this and think, "Sweet, those are some great prehistoric birds." However, they're also allowed to say, "Hmm, those dinosaurs are like birds, but they're technically not birds yet. They probably don't belong on Birdpedia."
Luckily, projects don't usually work under lawless conditions. Open source projects typically come with contribution guidelines and codes of conduct, so you don't have to worry about your additions flying off the rails.
### Why open source?
So, after all the contributions are made (if it's ever actually done), why would people give away their software for no cost? If so many people put their time and effort into creating something, why wouldn't they band together and slap a price tag on it?
This question comes with a lot of answers. Here are a few:
- Starting a business is hard, especially if the project you're working on doesn't form the strong foundation for a money machine. It can be easier to rally a bunch of like-minded people without commitments or the expectation of paychecks.
- Most open source communities consist of people interested in improving software or bringing it into existence but don't have the time or interest to commit to working full-time on a project. Sometimes open source represents passion projects, geek groups, and crowd-sourced solutions to annoying problems.
- The groups that form around open source projects of all sizes foster supportive communities where contributors and onlookers alike can practice their skills, improve software they regularly use, teach and learn from each other, and feel empowered to make their voices heard. Many open source communities are essentially hyper-focused online hobby clubs.
### Where do I get involved?
Now you may ask yourself, "But what do I do with this information? Can I contribute to open source projects? What if I'm not good enough yet?"
Never fear—even [beginners][5] are welcome to contribute to open source projects. It's a great way to hone your skills while working with a community towards a larger goal. And, as I talked about earlier, the worst that can happen is your changes aren't merged into Birdpedia (and that's because those product owners just can't see your vision of a Birdpedia where birds and their ancestors gleefully coexist in an online world of bird-related knowledge).
Do you have to know how to code to contribute to projects? Contrary to popular belief, [no, you don't][6]. Projects "take a village" to thrive, which means they need input from people of all different backgrounds. Visual designers, writers, marketers, reviewers, translators, subject matter enthusiasts, and even just users of the resulting product are all valuable contributors. Not only do they help build out and improve products, but they identify bugs, suggest improvements, spread the word about the project, and generally strengthen the community.
In short, no matter what your background or experience, if you're interested in open source or a specific project, you're nearly guaranteed to be welcomed with open arms.
### Get started with open source now
Still not sure where to begin? Here are some ideas and resources to get you started:
- [Up For Grabs][7] is a "list of open source projects which have curated tasks specifically for new contributors." This is a great place to find an easy first PR opportunity, which is a great way to find out what kind of contributions you'll enjoy.
- Check out this list of [beginner-friendly projects][8] on GitHub.
- If you're still not feeling inspired, consider [contributing][9] to (or flying with) [PatternFly][10], Red Hat's open design system.
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/11/get-started-open-source
作者:[Katie Edwards][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/kaedward
[b]: https://github.com/lkxed
[1]: https://opensource.com/resources/what-open-source
[2]: https://opensource.com/resources/what-is-git
[3]: https://opensource.org/osd
[4]: https://opensource.com/life/16/1/8-ways-contribute-open-source-without-writing-code
[5]: https://opensource.com/article/18/4/get-started-open-source-project
[6]: https://opensource.com/article/22/8/non-code-contribution-powers-open-source
[7]: https://up-for-grabs.net/?ref=hackernoon.com#/
[8]: https://github.com/MunGell/awesome-for-beginners
[9]: https://github.com/patternfly
[10]: https://www.patternfly.org/v4/get-started/design

View File

@ -0,0 +1,272 @@
[#]: subject: "What stickers are on your laptop?"
[#]: via: "https://opensource.com/article/22/11/laptop-stickers"
[#]: author: "AmyJune Hineline https://opensource.com/users/amyjune"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
What stickers are on your laptop?
======
Your laptop is a blank canvas ready to be decorated with self-expression. What are your favorite stickers? Take our poll and then read what other open source enthusiasts had to say.
Having just switched work laptops last December, I realized how much I love applying stickers to my work machines. Sometimes the stickers are souvenirs from past events, others are from projects that I am passionate about, and some are just for fun!
Curious to know what others had on their laptops, I asked!
### Accessibility advocate
![AMyJune's laptop with lots of Drupal stickers][1]
Here is my work laptop (Can you tell my roots are in Drupal). My favorite decal is the Druplicon with the wheelchair... When [Drupal 8 came out, we took the logo][2] and blended it with the wheelchair because the agency I worked with focused on accessibility.
—[AmyJune Hineline][3]
### Fresh Java
![Alan Formy-Duval's laptop with various linux decals][4]
I have always had stickers on my computers and stuff since I was a kid. I think my favorite is either Tux or the Linux Inside. They are mostly field-relevant except for just a few.  In the bottom-right corner, I have Java running on Tomcat (haha) - an area I spent much of my career doing.
—[Alan Formy-Duval][5]
### Utilitarian purpose
![Rikard Grossman-Nielsen's laptop with two velcro strips glued on][6]
Well, I don't have any stickers. However, I've glued Velcro bands on my two laptops to secure my external hard drive for when I'm gaming on the bus. I have also glued a lock notch on.
—[Rikard Grossman-Nielsen][7]
### Maintain the look
![John 'Warthog9' Hawley's laptop with a mix of decals][8]
Not the most decorated laptop by far, but I like the collection (and you know, hard to get more without travel for a while!)
My favorite is the "last one to commit is the maintainer". It's a snarky comment on the state of maintainership, as well as a promise that the code will live on as a result.
Mostly it boils down to things I use or contribute to, think are meaningful, or just found the sticker awesome.
—[John 'Warthog9' Hawley][9]
### Window covering
I never put stickers on my laptop because it seems to me the only really cool stickers are the ones I don't have (said the grumpy old man.)
But the old homebrew computer my kids used to use in high school, a 3GHz Core Duo with 8 GB of memory, has an Open Mainframe sticker on it that I grabbed at the Linux Foundation Open Source Summit here in Vancouver a few years ago. I quite like that one.
And because in my life, the **Control** key lives next to the **A**, not down on the bottom row, I have a few keyboards around with a **CTRL** sticker on the CapsLock key and a **CAPS** sticker on the **Control** key, which work together with the [swap Ctrl and CapsLock option in GNOME Tweak Tool][10].
Finally, I used to peel off Windows stickers, back when my only option was buying computers and paying the Windows tax, and put Linux sticker over the gummy patch. Same with keyboards that had the Windows logo on the Super key.
—[Chris Hermansen][11]
### Mementos
![StrangeMama's laptop with a Kanopi sticker and various other decals][12]
The Kanopi sticker is by far my favorite sticker. Not only is it shiny and iridescent, but it's a constant reminder of how amazing this company is to work for. They seriously put their employees first, and they're super mindful in selecting client projects that align with Kanopi's overall company mission and vision.
The Curt V8 sticker is in remembrance of a dear friend. He loved Fords and my husband loves Chevys. The constant fun rivalry resulted in randomly placed Ford and Chevy objects snuck into garages depending on whose house we were at. I smile every time I see this Ford emulated sticker on my laptop, since I live in a Chevy family.
The variety of stickers represents the family adventures that we have been on throughout the years. Date nights, friends, family road trips, scary hiking adventures (Angels Landing), and my youngest's drive to get a police sticker from every city and state.
—[Kristine Strange][13]
### Conference swag
![Cindy William's laptop with various decals including a Kanopi sticker and Glimore Girls decals][14]
The dragon is [my college mascot][15]. I also have some Gilmore Girls and coffee stickers.
Heres a photo of my daughters door, filled with stickers Ive brought back from conferences over the years.
![Cindy William's daughter's door covering tale to stern with decals from various WordPress and Drupal Camps][16]
—[Cindy Williams][17]
### Sticking with chicken
This is my not-work laptop. My work laptop is basically being covered in a honeycomb of hex-shaped stickers of our products, open source projects I use and support, and at least one Opensource.com hexagon. :)
I cant pick a favorite, since they are all favorites, or I wouldnt have them on the laptop that goes with me everywhere. I am overly fond of the chickens, the Raven, and Sergi the Cat with his knives.
![Kevin Sonney's laptop with various decals][18]
![Kevin Sonney's laptop with various decals][19]
—[Kevin Sonney][20]
### Foodie fun
I used to load up my laptops with stickers. The one I bought last year filled up fast:
![DJ Billings' laptop with various decals including a muffin][21]
My favorite is the cupcake & donut one because I illustrated it.
I just bought a [System76][22] Darter Pro laptop and I love it. I got a bunch of really cool stickers with it, but I've been hesitant to put them on the laptop. I don't know why.
—[DJ Billings][23]
### Keeping it clean
![Don Watkins' laptop with opensource.com and Red Hat stickers][24]
I dont put a lot of stickers on my laptops but Ive got my two favorites on my current laptop, which is System76 Darter Pro.
—[Don Watkins][25]
### Life's essentials
![Katie Sanders' laptop and Yeto mug with decals][26]
I included my water bottle, too. I think I like those stickers even more.
Beer, dogs, music, croissants. What else could I need in life?
—[Katie Sanders][27]
### My mantra
![Faye Polson's laptop with "yeet or be yeeted" decal][28]
My favorite sticker is **yeet or be yeeted**.
—[Faye Polson][29]
### Garlic
![Tiffany Bridge's laptop with movie, WordPress, and garlic decals][30]
Most of the stickers are professional, but the **Greetings from Hamunaptra, City of the Dead** sticker is a subtle reference to one of my favorite movies, **The Mummy** (1999) starring Brendan Fraser and Rachel Weisz.
The flags and the **Blackbeards Bar & Grill** stickers are references to **Our Flag Means Death**, which I am completely obsessed with.
And the garlic is the Cosmic Garlic sticker of my friend's shop. Garlic is a folk remedy for all kinds of diseases, so it seemed like a good thing to put on a laptop during a pandemic.
—[Tiffany Bridge][31]
### Open source projects
![Seth Kenlon's laptop with various linux and open source decals][32]
I usually cover my laptop with projects I use, contribute to, or admire. Statistically, my laptop should be layered with a lot more stickers by now. I haven't been to a tech conference in three years, so the pace has been slower than usual.
—[Seth Kenlon][33]
### Decked out in Drupal
![April's laptop features several Drupal stickers.][34]
I add stickers that represent me in tech. So I include organizations I'm a part of, events I've attended, and projects I support.
It's always fun to see the Drupal bear on peoples laptops since I designed it.
Notice all of my stickers are on a laptop cover for preservability.
—[April Sides][35]
### Wild about WordPress
![Michelle Frechette's laptop with misc WordPress and Wapuu decals][36]
My favorite is hard to pick, but probably the **Michelle wapuu**! Shes so me!
The stickers **I press all the words** and **WordPress is my super power** are from WordCamp Rochester, so those are near and dear to me.
Basically, Ill add a sticker if I have a history with it (I spoke at the camp, for example), or I just like it!
—[Michelle Frechette][37]
### An eye for art
![Dagger McJagger's Laptop with misc Drupal and open source decals][38]
I heavily lean towards art stickers. Seeing art on my computer reminds me of the people I know and experiences Ive had while using this computer.
My favorite is the sad-face Midsommar sticker that my partner gave me. After seeing the movie for the first time, we stood outside the theater discussing it for hours into the night. We still reference it to this day.
—[Jonathan Daggerhart][39]
### Custom skin
![Sallie Goetsch's laptop with a custom goddess Ereshkigal skin][40]
I got a new travel laptop in 2019, and it remains pristine because I have not been to any events since then. My work laptop has a custom skin of the goddess Ereshkigal, after whom I named the computer.
—Sallie Goetsch
### GNU Emacs
![Sachin Patil's laptop with only one sticker][41]
A GNU Emacs sticker.
—[Sachin Patil][42]
### Opensource.com
After seeing everyone's responses, and maybe getting some cool stickers in the mail from a very brilliant community manager...
OK, OK, I give! AmyJune, Don, and Sachin convinced me to put ONE sticker on my laptop.
Here's a photo showing my laptop with its singular sticker:
![Chris Hermansen's laptop with an opensource.com sticker on it][43]
—Chris Hermansen
### Stickers and open source
You don't have to adorn your computer with stickers. It's not required, and it certainly doesn't mean you love open source more or less than anybody else. But if you love an open source project, there's a good chance that it's got a sticker you can use to decorate your computer (or your door, water bottle, or USB microphone). Rest assured that if you love open source and you love stickers, there's a strong intersection between the two!
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/11/laptop-stickers
作者:[AmyJune Hineline][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/amyjune
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/2022-11/amyjune-laptop.webp
[2]: https://www.drupal.org/files/cta/graphic/drupal%208%20logo%20isolated%20CMYK%2072_1.png
[3]: https://opensource.com/users/amyjune
[4]: https://opensource.com/sites/default/files/2022-10/Alan%20F..webp
[5]: https://opensource.com/users/alanfdoss
[6]: https://opensource.com/sites/default/files/2022-10/%20Rikard%20Grossman-Nielsen-1.webp
[7]: https://opensource.com/users/rikardgn
[8]: https://opensource.com/sites/default/files/2022-10/%20John%20%27Warthog9%27%20Hawley%20.webp
[9]: https://opensource.com/users/warthog9
[10]: https://opensource.com/article/18/11/how-swap-ctrl-and-caps-lock-your-keyboard
[11]: https://opensource.com/users/clhermansen
[12]: https://opensource.com/sites/default/files/2022-10/kristine.webp
[13]: https://opensource.com/users/strangemama
[14]: https://opensource.com/sites/default/files/2022-10/cindy%20williams.webp
[15]: https://www.uab.edu
[16]: https://opensource.com/sites/default/files/2022-10/cindy%20duaghter%20door.webp
[17]: https://opensource.com/users/cindytwilliams
[18]: https://opensource.com/sites/default/files/2022-10/%20Kevin%20Sonney%20.webp
[19]: https://opensource.com/sites/default/files/2022-10/%20Kevin%20Sonney%202.webp
[20]: https://opensource.com/users/ksonney
[21]: https://opensource.com/sites/default/files/2022-10/DJ_laptop-stickers.webp
[22]: https://opensource.com/article/19/5/system76-secret-sauce
[23]: https://opensource.com/users/itsjustdj
[24]: https://opensource.com/sites/default/files/2022-10/don%20watkins.webp
[25]: https://opensource.com/users/don-watkins
[26]: https://opensource.com/sites/default/files/2022-10/Katie%20Sanders.webp
[27]: https://enterprisersproject.com/user/katie-sanders
[28]: https://opensource.com/sites/default/files/2022-10/faye3.webp
[29]: https://twitter.com/faye_polson
[30]: https://opensource.com/sites/default/files/2022-10/tiffany_0.webp
[31]: https://tiff.is/
[32]: https://opensource.com/sites/default/files/2022-10/seth-laptop.webp
[33]: https://opensource.com/users/seth
[34]: https://opensource.com/sites/default/files/2022-11/april.webp
[35]: https://opensource.com/users/weekbeforenext
[36]: https://opensource.com/sites/default/files/2022-10/Michelle%20Fre.webp
[37]: https://meetmichelle.online
[38]: https://opensource.com/sites/default/files/2022-10/Dagger%20McJagger.webp
[39]: https://opensource.com/users/daggerhart
[40]: https://opensource.com/sites/default/files/2022-10/Ereshkigal%20laptop%20skin.webp
[41]: https://opensource.com/sites/default/files/2022-10/psachin.webp
[42]: https://opensource.com/users/psachin
[43]: https://opensource.com/sites/default/files/2022-10/%20chris%20hermansen%20.webp

View File

@ -1,240 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (FYJNEVERFOLLOWS )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Convert audio files with this versatile Linux command)
[#]: via: (https://opensource.com/article/20/2/linux-sox)
[#]: author: (Klaatu https://opensource.com/users/klaatu)
Convert audio files with this versatile Linux command
======
SoX Sound Exchange can even add effects to your audio files.
![HiFi vintage stereo][1]
I work with media, and when you work with any kind of media, you learn pretty quickly that standardization is a valuable tool. Just as you wouldn't try to add a fraction to a decimal without converting one or the other, I've learned that it's not ideal to combine media of differing formats. Most hobbyist-level applications make the conversion process invisible to the user as a convenience. Flexible software aimed at users needing control over the fine details of their assets, however, often leave it up to you to convert your media to your desired format in advance. I have a few favorite tools for conversion, and one of those is the so-called _Swiss army knife of sound_, [SoX][2].
### Installing
On Linux or BSD, you can install the **sox** command (and some helpful symlinks) from your software repository or ports tree.
You can also install SoX from its home on [Sourceforge.net][3]. It doesn't release often, but its codebase tends to be stable, so if you want the latest features (such as Opus support), it's easy and safe to build.
SoX provides primarily the **sox** command, but installation also creates a few useful symlinks: **play**, **rec**, and **soxi**.
### Getting information about files with SoX
SoX reads and rewrites audio data. Whether it stores the rewritten audio data is up to you. There are use cases in which you don't need to store the converted data, for instance, when you're sending the output directly to your speakers for playback. Before doing any conversion, however, it's usually a good idea to determine exactly what you're dealing with in the first place.
To gather information about an audio file, use the **soxi** command. This is a symlink to **sox --info**.
```
$ soxi countdown.mp3
Input File     : '/home/tux/countdown.mp3'
Channels       : 1
Sample Rate    : 44100
Precision      : 16-bit
Duration       : 00:00:11.21 = 494185 samples...
File Size      : 179k
Bit Rate       : 128k
Sample Encoding: MPEG audio (layer I, II or III)
```
This output gives you a good idea of what codec the audio file is encoded in, the file length, file size, sample rate, and the number of channels. Some of these you might _think_ you already know, but I never trust assumptions when media is brought to me by a client. Verify media attributes with **soxi**.
### Converting files
In this example, the audio of a game show countdown has been delivered as an MP3 file. While nearly all editing applications accept compressed audio, none of them actually edit the compressed data. Conversion is happening somewhere, whether it's a secret background task or a prompt for you to save a copy. I generally prefer to do the conversion myself, in advance. This way, I can control what format I'm using. I can do lots of media in batches overnight instead of wasting valuable production time waiting for an editing application to churn through them on demand.
The **sox** command is meant for converting audio files. There are a few stages in the **sox** pipeline:
* input
* combine
* effects
* output
In command syntax, the effects step is, confusingly, written _last_. That means the pipeline is composed this way:
```
`input → combine → output → effects`
```
### Encoding
The simplest conversion command involves only an input file and an output file. Here's the command to convert an MP3 file to a lossless FLAC file:
```
$ sox countdown.mp3 output.flac
$ soxi output.flac
Input File     : 'output.flac'
Channels       : 1
Sample Rate    : 44100
Precision      : 16-bit
Duration       : 00:00:11.18 = 493056 samples...
File Size      : 545k
Bit Rate       : 390k
Sample Encoding: 16-bit FLAC
Comment        : 'Comment=Processed by SoX'
```
#### Effects
The effects chain is specified at the end of a command. It can alter audio prior to sending the data to its final destination. For instance, sometimes audio that's too loud can cause problems during conversion:
```
$ sox bad.wav bad.ogg
sox WARN sox: `bad.ogg' output clipped 126 samples; decrease volume?
```
Applying a **gain** effect can often solve this problem:
```
`$ sox bad.wav bad.ogg gain -1`
```
#### Fade
Another useful effect is **fade**. This effect lets you define the shape of a fade-in or fade-out, along with how many seconds you want the fade to span.
Here's an example of a six-second fade-in using an inverted parabola:
```
`$ sox intro.ogg intro.flac fade p 6`
```
This applies a three-second fade-in to the head of the audio and a fade-out starting at the eight-second mark (the intro music is only 11 seconds, so the fade-out is also three-seconds in this case):
```
`$ sox intro.ogg intro.flac fade p 3 8`
```
The different kinds of fades (sine, linear, inverted parabola, and so on), as well as the options **fade** offers (fade-in, fade-out), are listed in the **sox** man page.
#### Effect syntax
Each effect plugin has its own syntax, so refer to the man page for details on how to invoke each one.
Effects can be daisy-chained in one command, at least to the extent that you want to combine them. In other words, there's no syntax to apply a **flanger** effect only during a six-second fade-out. For something that precise, you need a graphical sound wave editor or a digital audio workstation such as [LMMS][4] or [Rosegarden][5]. However, if you just have effects that you want to apply once, you can list them together in the same command.
This command applies a -1 **gain** effect, a tempo **stretch** of 1.35, and a **fade-out**:
```
$ sox intro.ogg output.flac gain -1 stretch 1.35 fade p 0 6
$ soxi output.flac
Input File     : 'output.flac'
Channels       : 1
Sample Rate    : 44100
Precision      : 16-bit
Duration       : 00:00:15.10 = 665808 samples...
File Size      : 712k
Bit Rate       : 377k
Sample Encoding: 16-bit FLAC
Comment        : 'Comment=Processed by SoX'
```
### Combining audio
SoX can also combine audio files, either by concatenating them or by mixing them.
To join (or _concatenate_) files into one, provide more than one input file in your command:
```
`$ sox countdown.mp3 intro.ogg output.flac`
```
In this example, **output.flac** now contains **countdown** audio, followed immediately by **intro** music.
If you want the two tracks to play over one another at the same time, though, you can use the **\--combine mix** option:
```
`$ sox --combine mix countdown.mp3 intro.ogg output.flac`
```
Imagine, however, that the two input files differed in more than just their codecs. It's not uncommon for vocal tracks to be recorded in mono (one channel), but for music to be recorded in at least stereo (two channels). SoX won't default to a solution, so you have to standardize the format of the two files yourself first.
#### Altering audio files
Options related to the file name listed _after_ it. For instance, the **\--channels** option in this command applies _only_ to **input.wav** and NOT to **example.ogg** or **output.flac**:
```
`$ sox --channels 2 input.wav example.ogg output.flac`
```
This means that the position of an option is very significant in SoX. Should you specify an option at the start of your command, you're essentially only overriding what SoX gleans from the input files on its own. Options placed immediately before the _output_ file, however, determine how SoX writes the audio data.
To solve the previous problem of incompatible channels, you can first standardize your inputs, and then mix:
```
$ sox countdown.mp3 --channels 2 countdown-stereo.flac gain -1
$ soxi countdown-stereo.flac
Input File     : 'countdown-stereo.flac'
Channels       : 2
Sample Rate    : 44100
Precision      : 16-bit
Duration       : 00:00:11.18 = 493056 samples...
File Size      : 545k
Bit Rate       : 390k
Sample Encoding: 16-bit FLAC
Comment        : 'Comment=Processed by SoX'
$ sox --combine mix \
countdown-stereo.flac \
intro.ogg \
output.flac
```
SoX absolutely requires multiple commands for complex actions, so it's normal to create several temporary and intermediate files as needed.
### Multichannel audio
Not all audio is constrained to one or two channels, of course. If you want to combine several audio channels into one file, you can do that with SoX and the **\--combine merge** option:
```
$ sox --combine merge countdown.mp3 intro.ogg output.flac
$ soxi output.flac
Input File     : 'output.flac'
Channels       : 3
[...]
```
### Easy audio manipulation
It might seem strange to work with audio using no visual interface, and for some tasks, SoX definitely isn't the best tool. However, for many tasks, SoX provides an easy and lightweight toolkit. SoX is a simple command with powerful potential. With it, you can convert audio, manipulate channels and waveforms, and even generate your own sounds. This article has only provided a brief overview of its capabilities, so go read its man page or [online documentation][2] and then see what you can create.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/2/linux-sox
作者:[Klaatu][a]
选题:[lujun9972][b]
译者:[FYJNEVERFOLLOWS](https://github.com/FYJNEVERFOLLOWS)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/klaatu
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/hi-fi-stereo-vintage.png?itok=KYY3YQwE (HiFi vintage stereo)
[2]: http://sox.sourceforge.net/sox.html
[3]: http://sox.sourceforge.net
[4]: https://opensource.com/life/16/2/linux-multimedia-studio
[5]: https://opensource.com/article/18/3/make-sweet-music-digital-audio-workstation-rosegarden

View File

@ -1,134 +0,0 @@
[#]: subject: (How we built an open source design system to create new community logos)
[#]: via: (https://opensource.com/article/21/4/ansible-community-logos)
[#]: author: (Fiona Lin https://opensource.com/users/fionalin)
[#]: collector: (lujun9972)
[#]: translator: (MareDevi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
How we built an open source design system to create new community logos
======
Learn how Ansible's new logos were developed with stakeholder input to
ensure a consistent brand across the entire project.
![UX design Mac computer with mobile and laptop][1]
As interaction designers on Red Hat's User Experience (UX) Design and Ansible product teams, we worked for about six months to build a logo family with the Ansible community. This journey started even earlier when a project manager asked us for a "quick and easy" logo for a slide deck. After gathering a few requirements, we presented a logo to the stakeholders within a few days and without much need for iteration. A few months later, another stakeholder decided they would also benefit from having imagery for their materials, so we repeated the process.
At this point, we noticed a pattern: logo resources like these no longer represented individual requests but rather a common need across the Ansible project. After completing several logo requests, we had built a makeshift series that—without conscious branding and design conventions—created the potential for visual inconsistencies across the Ansible brand. As the logo collection grew, we recognized this looming problem and the need to combat it.
Our solution was to create an Ansible design system, a brand-specific resource to guide consistent logo design well into the future.
### What is a design system?
A design system is a collection of reusable assets and guidelines that help inform the visual language of any digital product suite. Design systems create patterns to bring separate products together and elevate brands through scalability and consistency.
Especially in a large corporation with multiple products in the portfolio, scaling does not come easily without standardization as different teams contribute to each product. Design systems work as a baseline for each team to build new assets on. With a standardized look and feel, products are unified as one family across the portfolio.
### Getting started building a design system
After receiving a series of requests from stakeholders to create logos for the open source Ansible community, such as Ansible Builder, Ansible Runner, and Project Receptor, we decided to design a structure for our workflow and create a single source of truth to work for moving forward.
First, we conducted a visual audit of the existing logos to determine what we had to work with. Ansible's original logo family consists of four main images: the Angry Spud for AWX, the Ansibull for Ansible Core/Engine, and the monitor with wings for AWX. Most of the logos were tied together with a consistent shade of red and bull imagery, but the stroke width, stroke color, line quality, and typography were vast and varied.
![Original Ansible logos][2]
(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3])
The Angry Spud uses a tan outline and a hand-drawn style, while the bull is a symmetrical, geometric vector. The AWX monitor was the outlier with its thin line-art wings, blue vector rectangle, and Old English typeface (not included here, but an exception from the rest of the family, which uses a modern sans serif).
### Establishing new design criteria
Taking color palette, typography, and imagery into consideration, we generated a consistent composition that features the Ansibull for all core Ansible products, along with bold lines and vibrant colors.
![Ansible design system][4]
(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3])
The new Ansible community logo design style guide details the color palette, typography, sizing, spacing, and logo variations for Ansible product logos.
The new style guide presents a brand new, modern custom typeface based on GT America by [Grilli Type][5], an independent Swiss type foundry. We created a softer look for the typeface to match the imagery's roundedness by rounding out certain corners of each letter.
We decided to curate a more lively, saturated, and universal color palette by incorporating more colors in the spectrum and basing them on primary colors. The new palette features light blue, yellow, and pink, each with a lighter highlight and darker shadow. This broader color scope allows more flexibility within the system and introduces a 3D look and feel.
![New Ansible logos][6]
(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3])
We also introduced new imagery, such as the hexagons in the Receptor and AWX logos for visual continuity. Finally, we made sure each logo works on both light and dark backgrounds for maximum flexibility.
### Expanding the design portfolio
Once we established the core logo family, we moved onto creating badges for Ansible services, such as Ansible Demo and Ansible Workshop. To differentiate services from products, we decided to enclose service graphics in a circle that contains the name of the service in the same custom typography. The new service badges show the baby Ansibull (from the Ansible Builder logo) completing tasks related to each service, such as pointing to a whiteboard for Ansible Demo or using building tools for Ansible Workshop.
![New Ansible services logos][7]
(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3])
### Using open source for design decisions
The original AWX logo was influenced by rock-and-roll imagery, such as the wings and the heavy metal typeface (omitted from the image here).
![Original AWX logo][8]
(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3])
Several members of the Ansible community, including the Red Hat Diversity and Inclusion group, brought to our attention that these elements resemble imagery used by hate groups.
Given the social implications of the original logo's imagery, we had to work quickly with the Ansible community to design a replacement. Instead of working in a silo, as we did for the initial logos, we broadened the project's scope to carefully consider a wider range of stakeholders, including the Ansible community, Red Hat Diversity and Inclusion group, and Red Hat Legal team.
We started brainstorming by reaching out to the Ansible open source community for ideas. One of the Ansible engineers, Rebeccah Hunter, contributed in the sketching phase and later became an embedded part of our design team. Part of the challenge of involving a large group of stakeholders was that we had a variety of ideas for new logo concepts, ranging from an auxiliary cable to a bowl of ramen.
We sketched five community-surfaced logos, each featuring a different branded visual: a sprout, a rocket, a monitor, a bowl of ramen, and an auxiliary cable.
![AWX logo concepts][9]
(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3])
After completing these initial concept sketches, we set up a virtual voting mechanism that we used throughout the iteration process. This voting system allowed us to use community feedback to narrow from five initial concepts down to three: the rocket, the bowl of ramen, and the monitor. We further iterated on these three directions and presented back, via a Slack channel dedicated to this effort, until we landed on one direction, the AWX monitor, that aligned with the community's vision.
![New AWX logo][10]
(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3])
With community voices as our guide, we pursued the monitor logo concept for AWX. We preserved the monitor element from the original logo while modernizing the look and feel to match our updated design system. We used a more vibrant color palette, a cleaner sans-serif typeface, and elements, including the hexagon motif, from the Project Receptor logo.
By engaging with our community from the beginning of the process, we were able to design and iterate in the open with a sense of inclusiveness from all stakeholders. In the end, we felt this was the best approach for replacing a controversial logo. The final version was handed off to the Red Hat Legal team, and after approval, we replaced all current assets with this new logo.
### Key takeaways
Creating a set of rules and assets for a design system keeps your digital products consistent across the board, eliminates brand confusion, and enables scalability.
As you explore building a design system with your own community, you may benefit from these key takeaways we learned along our path:
* Scaling new logos with a design system is a much easier process than without one.
* Juggling design options becomes less daunting when you use a polling system to validate results.
* Directing a large audience's attention on sets of three eliminates decision fatigue and focuses community feedback.
We hope this article provides insight into designing a system with an open source community and helps you recognize the benefit of developing a system early in your process. If you are creating a new design system, what questions do you have? And if you have created one, what lessons have you learned? Please share your ideas in the comments.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/4/ansible-community-logos
作者:[Fiona Lin][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/fionalin
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ux-design-mac-laptop.jpg?itok=9-HKgXa9 (UX design Mac computer with mobile and laptop)
[2]: https://opensource.com/sites/default/files/pictures/original_logos.png (Original Ansible logos)
[3]: https://creativecommons.org/licenses/by-sa/4.0/
[4]: https://opensource.com/sites/default/files/pictures/design_system.png (Ansible design system)
[5]: https://www.grillitype.com/
[6]: https://opensource.com/sites/default/files/pictures/new_logos.png (New Ansible logos)
[7]: https://opensource.com/sites/default/files/pictures/new_service_badges.png (New Ansible services logos)
[8]: https://opensource.com/sites/default/files/uploads/awx_original.png (Original AWX logo)
[9]: https://opensource.com/sites/default/files/uploads/awx_concepts.png (AWX logo concepts)
[10]: https://opensource.com/sites/default/files/uploads/awx.png (New AWX logo)

View File

@ -1,231 +0,0 @@
[#]: subject: (Parsing config files with Lua)
[#]: via: (https://opensource.com/article/21/6/parsing-config-files-lua)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Parsing config files with Lua
======
Configure persistent application settings with the Lua programming
language.
![Woman sitting in front of her computer][1]
Not all applications need configuration files; many applications benefit from starting fresh each time they are launched. Simple utilities, for instance, rarely require preferences or settings that persist across uses. However, when you write a complex application, it's nice for users to be able to configure how they interact with it and how it interacts with their system. That's what configuration files are for, and this article discusses some of the ways you can implement persistent settings with the Lua programming language.
### Choose a format
The important thing about configuration files is that they are consistent and predictable. You do not want to dump information into a file under the auspices of saving user preferences and then spend days writing code to reverse-engineer the random bits of information that have ended up in the file.
There are several popular [formats for configuration files][2]. Lua has libraries for most of the common configuration formats; in this article, I'll use the INI format.
### Installing the library
The central hub for Lua libraries is [Luarocks.org][3]. You can search for libraries on the website, or you can install and use the `luarocks` terminal command.
On Linux, you can install it from your distribution's software repository. For example:
```
`$ sudo dnf install luarocks`
```
On macOS, use [MacPorts][4] or [Homebrew][5]. On Windows, use [Chocolatey][6].
Once `luarocks` is installed, you can use the `search` subcommand to search for an appropriate library. If you don't know the name of a library, you can search for a keyword, like `ini` or `xml` or `json`, depending on what's relevant to what you're trying to do. In this case, you can just search for `inifile`, which is the library I use to parse text files in the INI format:
```
$ luarocks search inifile
Search results:
inifile
 1.0-2 (rockspec) - <https://luarocks.org>
 1.0-2 (src) - <https://luarocks.org>
 1.0-1 (rockspec) - <https://luarocks.org>
 [...]
```
A common trap programmers fall into is installing a library on their system and forgetting to bundle it with their application. This can create problems for users who don't have the library installed. To avoid this, use the `--tree` option to install the library to a local folder within your project directory. If you don't have a project directory, create one first, and then install:
```
$ mkdir demo
$ cd demo
$ luarocks install --tree=local inifile
```
The `--tree` option tells `luarocks` to create a new directory, called `local` in this case, and install your library into it. With this simple trick, you can install all the dependency code your project uses directly into the project directory.
### Code setup
First, create some INI data in a file called `myconfig.ini`:
```
[example]
name=Tux
species=penguin
enabled=false
[demo]
name=Beastie
species=demon
enabled=false
```
Save the file as `myconfig.ini` into your home directory, _not_ into your project directory. You usually want configuration files to exist outside your application so that even when a user uninstalls your application, the data they generate while using the application remains on their system. Users might remove unnecessary config files manually, but many don't. As a result, if they reinstall an application, it will retain all of their preferences.
Config file locations are technically unimportant, but each operating system (OS) has a specification or a tradition of where they ought to be placed. On Linux, this is defined by the [Freedesktop specification][7]. It dictates that configuration files are to be saved in a hidden folder named `~/.config`. For clarity during this exercise, just save the file in your home directory so that it's easy to find and use.
Create a second file named `main.lua` and open it in your favorite text editor.
First, you must tell Lua where you've placed the additional library you want it to use. The `package.path` variable determines where Lua looks for libraries. You can view Lua's default package path in a terminal:
```
$ Lua
&gt; print(package.path)
./?.lua;/usr/share/lua/5.3/?.lua;/usr/share/lua/5.3/?/init.lua;/usr/lib64/lua/5.3/?.lua;/usr/lib64/lua/5.3/?/init.lua
```
In your Lua code, append your local library location to `package.path`:
```
`package.path = package.path .. ';local/share/lua/5.3/?.lua`
```
### Parsing INI files with Lua
With the package location established, the next thing to do is to require the `inifile` library and then handle some OS logistics. Even though this is a simple example application, the code needs to get the user's home directory location from the OS and establish how to communicate filesystem paths back to the OS when necessary:
```
package.path = package.path .. ';local/share/lua/5.3/?.lua
inifile = require('inifile')
\-- find home directory
home = os.getenv('HOME')
\-- detect path separator
\-- returns '/' for Linux and Mac
\-- and '\' for Windows
d = package.config:sub(1,1)
```
Now you can use `inifile` to parse data from the config file into a Lua table. Once the data has been placed into a table, you can query the table as you would any other Lua table:
```
\-- parse the INI file and
\-- put values into a table called conf
conf = inifile.parse(home .. d .. 'myconfig.ini')
\-- print the data for review
print(conf['example']['name'])
print(conf['example']['species'])
print(conf['example']['enabled'])
```
Run the code in a terminal to see the results:
```
$ lua ./main.lua
Tux
penguin
false
```
That looks correct. Try doing the same for the `demo` block.
### Saving data in the INI format
Not all parser libraries read and write data (often called _encoding_ and _decoding_), but the `inifile` library does. That means you can use it to make changes to a configuration file.
To change a value in a configuration file, you set the variable representing the value in the parsed table, and then you write the table back to the configuration file:
```
\-- set enabled to true
conf['example']['enabled'] = true
conf['demo']['enabled'] = true
\-- save the change
inifile.save(home .. d .. 'myconfig.ini', conf)
```
Take a look at the configuration file now:
```
$ cat ~/myconfig.ini
[example]
name=Tux
species=penguin
enabled=true
[demo]
name=Beastie
species=demon
enabled=true
```
### Config files
The ability to save data about how a user wants to use an application is an important part of programming. Fortunately, it's a common task for programmers, so much of the work has probably already been done. Find a good library for encoding and decoding into an open format, and you can provide a persistent and consistent user experience.
Here's the entire demo code for reference:
```
package.path = package.path .. ';local/share/lua/5.3/?.lua'
inifile = require('inifile')
\-- find home directory
home = os.[getenv][8]('HOME')
\-- detect path separator
\-- returns '/' for Linux and Mac
\-- and '\' for Windows
d = package.config:sub(1,1)
\-- parse the INI file and
\-- put values into a table called conf
conf = inifile.parse(home .. d .. 'myconfig.ini')
\-- print the data for review
print(conf['example']['name'])
print(conf['example']['species'])
print(conf['example']['enabled'])
\-- enable Tux
conf['example']['enabled'] = true
\-- save the change
inifile.save(home .. d .. 'myconfig.ini', conf)
```
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/6/parsing-config-files-lua
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_women_computing_2.png?itok=JPlR5aCA (Woman sitting in front of her computer)
[2]: https://opensource.com/article/21/6/config-files-and-their-formats
[3]: https://opensource.com/article/19/11/getting-started-luarocks
[4]: https://opensource.com/article/20/11/macports
[5]: https://opensource.com/article/20/6/homebrew-mac
[6]: https://opensource.com/article/20/3/chocolatey
[7]: https://www.freedesktop.org/wiki/Specifications
[8]: http://www.opengroup.org/onlinepubs/009695399/functions/getenv.html

View File

@ -1,461 +0,0 @@
[#]: subject: "For the Love of Ubuntu: Here are the Mascots of All Ubuntu Releases"
[#]: via: "https://itsfoss.com/all-Ubuntu-mascots/"
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
For the Love of Ubuntu: Here are the Mascots of All Ubuntu Releases
======
This is a collection of the mascots of all the Ubuntu releases so far.
You may have noticed that every Ubuntu release has a version name and codename. The codename is composed of two words that start with the same letter. The first word is an adjective, and the other one is (usually) an (endangered) species.
These releases also have a mascot for those codenames. Ubuntu 22.04 is codenamed Jammy Jellyfish and hence the Jellyfish mascot on its wallpaper.
These mascots were not always part of Ubuntu releases. The codenames were always there, but not the mascots.
The first-ever Ubuntu release was version 4.10 in October 2004. But it wasnt until the Ubuntu 8.04 LTS Hardy Heron release that you saw the associated mascot.
Earlier, I complied the [list of the default wallpapers of all Ubuntu releases][1]. In this one, you get to look at the mascots of those releases.
Lets hop on to Ubuntus mascot journey in reverse chronological order.
### Ubuntu 22.04 Jammy Jellyfish
![Ubuntu 22.04 mascot][2]
Released on 21 April 2021.
Jammy means covered with, filled with, or resembling jam. Informally, it also means lucky.
Jellyfish are mainly free-swimming marineanimalswith umbrella-shaped bells and trailingtentacles, although a few are anchored to the seabed by stalks rather than being mobile.
### Ubuntu 21.10 Impish Indri
![Ubuntu 21.10 mascot][3]
Released on 14 October 2021.
Impish means showing no respect for somebody/something in a way that is amusing rather than serious.
The Indri, also called the babakoto, is one of the largest living lemurs, with a head-and-body length of about 6472 cm and a weight of between 6 and 9.5 kg. It has a black and white coat and maintains an upright posture when climbing or clinging
### Ubuntu 21.04 Hirsute Hippo
![Ubuntu 21.04 mascot][4]
Released on 22 April 2021.
Hirsute means hairy.
The hippopotamus, also called the hippo, common hippopotamus, or river hippopotamus, is a large semiaquatic mammal native to sub-Saharan Africa. It is one of only two extant species in the family Hippopotamidae, the other being the pygmy hippopotamus. Its name comes from the ancient Greek for “river horse”.
Not sure if I have seen many hairy hippo.
### Ubuntu 20.10 Groovy Gorilla
![Ubuntu 20.10 mascot][5]
Released on 22 October 2020.
Groovy means fashionable and exciting.
Gorillas are herbivorous, predominantly ground-dwelling great apes that inhabit the tropical forests of equatorial Africa. The genus Gorilla is divided into two species: the eastern gorilla and the western gorilla, and either four or five subspecies.
### Ubuntu 20.04 LTS Focal Fossa
![Ubuntu 20.04 mascot 1][6]
Released on 23 April 2020.
Focal means something providing a focus, important in other meaning.
The fossa (Cryptoprocta ferox) is**the largest carnivorous mammal on the island of Madagascar**. They can reach nearly six feet in length, with half of that due to their long tails. They look like a cross between a cat, a dog, and a mongoose. Fossas have slender bodies, muscular limbs, and short, reddish-brown coats.
### Ubuntu 19.10 Eoan Ermine
![Ubuntu 19.10 mascot][7]
Released on 17 October 2019.
Eoan means relating to dawn or east.
The stoat or short-tailed weasel, also known as the Eurasian ermine, Beringian ermine, or simply ermine, is a mustelid native to Eurasia and the northern portions of North America. Because of its wide circumpolar distribution, it is listed as Least Concern on the IUCN Red List.
### Ubuntu 19.04 Disco Dingo
![Ubuntu 19.04 mascot][8]
Released on 18 April 2019.
Disco relates to the disco music and nightclubs.
The dingo is an ancient lineage of dog found in Australia. Its taxonomic classification is debated as indicated by the variety of scientific names presently applied in different publications.
### Ubuntu 18.10 Cosmic Cuttlefish
![Ubuntu 18.10 mascot][9]
Released on 18 October 2018.
Cosmic means something distinct from the earth,
Cuttlefish or cuttles are marine molluscs of the order Sepiida. They belong to the class Cephalopoda, which also includes squid, octopuses, and nautiluses. Cuttlefish have a unique internal shell, the cuttlebone, which is used for control of buoyancy.
### Ubuntu 18.04 LTS Bionic Beaver
![Ubuntu 18.04 mascot][10]
Released on 26 April 2018.
Bionic means having or denoting an artificial, typically electromechanical, body part or parts.
Beavers are large, semiaquatic rodents in the genus Castor native to the temperate Northern Hemisphere. There are two extant species: the North American beaver and the Eurasian beaver. Beavers are the second-largest living rodents after the capybaras.
The British users found this release name particularly amusing.
### Ubuntu 17.10 Artful Aardvark
![Ubuntu 17.10 mascot][11]
Released on 19 October 2017.
Ubuntu switched back to GNOME by default with this release.
Artful means cleaver or carfty.
The aardvark is a medium-sized, burrowing, nocturnal mammal native to Africa. It is the only living species of the order Tubulidentata, although other prehistoric species and genera of Tubulidentata are known. Unlike most other insectivores, it has a long pig-like snout, which is used to sniff out food.
### Ubuntu 17.04 Zesty Zapus
![Ubuntu 17.04 mascot][12]
Released on 13 April 2017.
Last release to feature the Unity desktop.
Zesty means having a strong, pleasant, and somewhat spicy flavor.
Zapus is a genus of North American jumping mouse. It is the only genus whose members have the dental formula. Zapus are the only extant mammals aside from the Aye-aye with a total of 18 teeth.
### Ubuntu 16.10 Yakkety Yak
![Ubuntu 16.10 mascot][13]
Released on 13 October 2016.
Yakkety could mean a lot of things. While yakking is an informal term for talking a lot, yakkety could be an alternative spelling of Yakety Sax — a well known pop-jazz musical instrument, says OMGUbuntu!.
Yak is a large domesticated wild ox with shaggy hair, humped shoulders, and large horns, used in Tibet as a pack animal and for its milk, meat, and hide.
### Ubuntu 16.04 LTS Xenial Xerus
![Ubuntu 16.04 mascot][14]
Released on 21 April 2016.
Xenial means something related to hospitality.
The Xerus has four subspecies **cape ground squirrel, striped ground squirrel, mountain ground squirrel, and unstriped ground squirrel**. These animals are diurnal and are usually known to be herbivores in nature and usually eat nuts, roots, and seeds. However, sometimes they also eat eggs and other small animals.
### Ubuntu 15.10 Wily Werewolf
![Ubuntu 15.10 mascot][15]
Released on 22 October 2015.
Perhaps one of the rare Ubuntu releases that had a finctional character in its codename, unless you dont consider warewolves fictional.
Wily means skilled at gaining an advantage, especially deceitfully.
The werewolves are mythical creatures that can hide their ears and tail. It is a human but also a wolf, and most people fear them because of how they look.
### Ubuntu 15.04 Vivid Vervet
![Ubuntu 15.04 mascot][16]
Released on 23 April 2015.
Vivid means intensely deep or bright..
The vervet monkey, or simply vervet, is an Old World monkey of the family Cercopithecidae native to Africa. The term “vervet” is also used to refer to all the members of the genus Chlorocebus. The five distinct subspecies can be found mostly throughout Southern Africa, as well as some of the eastern countries.
### Ubuntu 14.10 Utopic Unicorn
![Ubuntu 14.10 mascot][17]
Released on 23 October 2014.
Another of the Ubuntu release with fictional animal in its release codename unless you consider Unicrons are real.
Utopic relates to utopia which is a fictional, impractical but ideal place.
The**unicorn**is alegendary creaturethat has been described sinceantiquityas a beast with a single large, pointed, spiralinghornprojecting from its forehead.
### Ubuntu 14.04 LTS Trusty Tahr
![Ubuntu 14.04 mascot][18]
Released on 17 April 2014.
Trusty means reliable or faithful.
Tahr is a goatlike mammal that inhabits cliffs and mountain slopes in Oman, southern India, and the Himalayas.
### Ubuntu 13.10 Saucy Salamander
![Ubuntu 13.10 mascot][19]
Released on 17 October 2013.
Saucy means expressing in a bold, lively, or spirited manner.
Salamanders are a group of amphibians typically characterized by their lizard-like appearance, with slender bodies, blunt snouts, short limbs projecting at right angles to the body, and the presence of a tail in both larvae and adults. All ten extant salamander families are grouped together under the order Urodela.
### Ubuntu 13.04 Raring Ringtail
![Ubuntu 13.04 mascot][20]
Released on 25 April 2013.
Raring means very enthusiastic and eager to do something.
The Ringtail is**a cat-sized carnivore resembling a small fox with a long raccoonlike tail**. Its bushy tail is flattened and nearly as long as the head and body, with alternating black and white rings. These animals are almost wholly nocturnal and spend the majority of the day sleeping in their dens.
### Ubuntu 12.10 Quantal Quetzal
![Ubuntu 12.10 mascot][21]
Released on 18 October 2012.
Quantal means relating to a quantum or quanta, or to quantum theory.
**Quetzals** are strikingly coloredbirdsin thetrogonfamily. They are found inforests, especially in humidhighlands, with the five species from the genus*Pharomachrus*being exclusivelyNeotropical, while a single species, theeared quetzal,*Euptilotis neoxenus*, is found in Mexico and very locally in the southernmost United States. Quetzals are fairly large (all over 32cm or 13inches long), slightly bigger than other trogon species. Theresplendent quetzalis thenational birdofGuatemalabecause of its vibrant colour.
### Ubuntu 12.04 LTS Precise Pangolin
![Ubuntu 12.04 mascot][22]
Released on 26 April 2012.
Precise means marked by exactness and accuracy of expression or detail.
Pangolins, sometimes known as scaly anteaters, are mammals of the order Pholidota. The one extant family, the Manidae, has three genera: Manis, Phataginus, and Smutsia. Manis comprises the four species found in Asia, while Phataginus and Smutsia include two species each, all found in sub-Saharan Africa.
### Ubuntu 11.10 Oneiric Ocelot
![Ubuntu 11.10 mascot][23]
Released on 13 October 2011.
Onerice relates to dreams or dreaming.
The ocelot (Leopardus pardalis) is a medium-sized spotted wild cat that reaches 4050 cm (15.719.7 in) at the shoulders and weighs between 8 and 15.5 kg (17.6 and 34.2 lb). It was first described by Carl Linnaeus in 1758.
### Ubuntu 11.04 Natty Narwhal
![Ubuntu 11.04 mascot][24]
Released on 28 April 2011.
The first release to feature the Unity desktop.
Natty means smart and fashionable.
The narwhal, also known as a narwhale, is a medium-sized toothed whale that possesses a large “tusk” from a protruding canine tooth. It lives year-round in the Arctic waters around Greenland, Canada and Russia. It is one of two living species of whale in the family Monodontidae, along with the beluga whale.
### Ubuntu 10.10 Maverick Meerkat
![Ubuntu 10.10 mascot][25]
Released on 10 October 2010.
Maverick means an unorthodox or independent-minded person.
The meerkat or suricate is a small mongoose found in southern Africa. It is characterised by a broad head, large eyes, a pointed snout, long legs, a thin tapering tail, and a brindled coat pattern.
### Ubuntu 10.04 LTS Lucid Lynx
![Ubuntu 10.04 mascot][26]
Released on 29 April 2010.
Lucid means easy to understand or bright.
A lynx is any of the four species within the medium-sized wild cat genus Lynx. The name lynx originated in Middle English via Latin from the Greek word λύγξ, derived from the Indo-European root leuk- in reference to the luminescence of its reflective eyes.
### Ubuntu 9.10 Karmic Koala
![Ubuntu 9.10 mascot][27]
Released on 29 October 2009.
Karmic means relating to or characteristic of karma.
The koala or, inaccurately, koala bear is an arboreal herbivorous marsupial native to Australia. It is the only extant representative of the family Phascolarctidae and its closest living relatives are the wombats.
### Ubuntu 9.04 Jaunty Jackalope
![Ubuntu 9.04 mascot][28]
Released on 23 April 2009.
The first Ubuntu version I ever used.
Jaunty means having or expressing a lively, cheerful, and self-confident manner.
The jackalope is**a mythical animal of North American folklore, in the category of fearsome critters, described as a jackrabbit with antelope horns**. The word jackalope is a portmanteau of jackrabbit and antelope. Many jackalope taxidermy mounts, including the original, are made with deer antlers.
### Ubuntu 8.10 Intrepid Ibex
![Ubuntu 8.10 mascot][29]
Released on 30 October 2008.
Intrepid means fearless; adventurous.
An ibex is any of several species of wild goat, distinguished by the males large recurved horns, which are transversely ridged in front. Ibex are found in Eurasia, North Africa and East Africa.
### Ubuntu 8.04 LTS Hardy Heron
![Ubuntu 8.04 mascot][30]
Released on 24 April 2008.
The first Ubuntu release where the mascot appeared on its default wallpaper.
Hardy means capable of enduring difficult conditions; robust.
The herons arelong-legged, long-necked, freshwater and coastal birds
### Ubuntu 7.10 Gutsy Gibbon
![Ubuntu 7.10 mascot][31]
Released on 18 October 2007.
Gusty is characterized by or blowing in gusts.
Gibbons are apeslive in subtropical and tropical rainforest from eastern Bangladesh to Northeast India to southern China and Indonesia
### Ubuntu 7.04 Feisty Fawn
![Ubuntu 7.04 mascot][32]
Released on 19 April 2007.
Feisty means small but determined. Fawn is a young deer in its first year.
### Ubuntu 6.10 Edgy Eft 
![Ubuntu 6.10 mascot][33]
Released on 26 October 2006.
Edgy means tense or nervous.
Eft is the terrestrial juvenile phase of newt. A newt is a type of salamander (a type of lizard). This newt has three distinct developmental life stages: aquatic larva, terrestrial juvenile (eft), and adult.
So basically eft is a teenaged newt :)
### Ubuntu 6.06 Dapper Drake
![Ubuntu 6.06 mascot][34]
Released on 1 June 2006.
Dapper means neat and trim in dress and appearance. Drake is a fully sexually mature adult male duck of any duck species.
### Ubuntu 5.10 Breezy Badger
![Ubuntu 5.10 mascot][35]
Released on 12 October 2005.
Breezy means pleasantly windy.
Badgers are short-legged omnivores, united by their squat bodies, adapted for fossorial activity.
### Ubuntu 5.04 Hoary Hedgehog 
![Ubuntu 5.04 mascot][36]
Released on 8 April 2005.
Hoary means greyish white.
A hedgehogis a spiny mammal found throughout parts of Europe, Asia, and Africa, and in New Zealand by introduction.
### Ubuntu 4.10 : Warty Warthog
![Ubuntu 4.10 mascot][37]
Released on 20 October 2004.
This is where it all started.
Wart is a small, hard, benign growth on the skin, caused by a virus. Warty means someone full of warts.
The common warthog is a wild member of the pig family found in grassland, savanna, and woodland in sub-Saharan Africa.
### Conclusion
Does this article add value to an Ubuntu user? Not technically, but its good to look back at the history. If you have been an Ubuntu user for years, it could trigger nostalgia.
Ubuntu 9.04 was the first time I tried Linux on a desktop. It was in late September of 2009 if I recall correctly. Only a few weeks later, my system was upgraded to Ubuntu 9.10. I used to spend time browing in Ubuntu Forum thoses days, exploring this new OS and learning new things.
So, did this article bring back some good old memories? Which was your first Ubuntu version? Share it in the comments.
--------------------------------------------------------------------------------
via: https://itsfoss.com/all-Ubuntu-mascots/
作者:[Abhishek Prakash][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/abhishek/
[b]: https://github.com/lkxed
[1]: https://itsfoss.com/Ubuntu-default-wallpapers-download/
[2]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-22-04-mascot.jpg
[3]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-21-10-mascot.jpg
[4]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-21-04-mascot.jpg
[5]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-20-10-mascot.jpg
[6]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-20-04-mascot-1.jpg
[7]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-19-10-mascot.jpg
[8]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-19-04-mascot.jpg
[9]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-18-10-mascot.jpg
[10]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-18-04-mascot.jpg
[11]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-17-10-mascot.jpg
[12]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-17-04-mascot.jpg
[13]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-16-10-mascot.jpg
[14]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-16-04-mascot.jpg
[15]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-15-10-mascot.jpg
[16]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-15-04-mascot.jpg
[17]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-14-10-mascot.jpg
[18]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-14-04-mascot.jpg
[19]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-13-10-mascot.jpg
[20]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-13-04-mascot.jpg
[21]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-12-10-mascot.jpg
[22]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-12-04-mascot.jpg
[23]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-11-10-mascot.jpg
[24]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-11-04-mascot.jpg
[25]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-10-10-mascot.jpg
[26]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-10-04-mascot.jpg
[27]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-9-10-mascot.jpg
[28]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-9-04-mascot.jpg
[29]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-8-10-mascot.jpg
[30]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-8-04-mascot.jpg
[31]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-7-10-mascot.jpg
[32]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-7-04-mascot.jpg
[33]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-6-10-mascot.jpg
[34]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-6-06-mascot.jpg
[35]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-5-10-mascot.jpg
[36]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-5-04-mascot.jpg
[37]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-4-10-mascot.jpg

View File

@ -2,7 +2,7 @@
[#]: via: "https://itsfoss.com/audacity-recording/"
[#]: author: "Anuj Sharma https://itsfoss.com/author/anuj/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: translator: "FYJNEVERFOLLOWS "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
@ -113,7 +113,7 @@ via: https://itsfoss.com/audacity-recording/
作者:[Anuj Sharma][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
译者:[FYJNEVERFOLLOWS](https://github.com/FYJNEVERFOLLOWS)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,348 +0,0 @@
[#]: subject: "Infuse your awk scripts with Groovy"
[#]: via: "https://opensource.com/article/22/9/awk-groovy"
[#]: author: "Chris Hermansen https://opensource.com/users/clhermansen"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Infuse your awk scripts with Groovy
======
Awk and Groovy complement each other to create robust, useful scripts.
Recently I wrote a series on using Groovy scripts to clean up the tags in my music files. I developed a [framework][2] that recognized the structure of my music directory and used it to iterate over the content files. In the final article of that series, I separated this framework into a utility class that my scripts could use to process the content files.
This separate framework reminded me a lot of the way awk works. For those of you unfamiliar with awk, you might benefit from Opensource.com's eBook, [A practical guide to learning awk][3].
I have used awk extensively since 1984, when our little company bought its first "real" computer, which ran System V Unix. For me, awk was a revelation: It had associative memory— think arrays indexed by strings instead of numbers. It had regular expressions built in, seemed designed to deal with data, especially in columns, and was compact and easy to learn. Finally, it was designed to work in Unix pipelines, reading its data from standard input or files and writing to output, with no ceremony required to do so—data just appeared in the input stream.
To say that awk has been an essential part of my day-to-day computing toolkit is an understatement. And yet there are a few things about how I use awk that leave me unsatisfied.
Probably the main issue is that awk is good at dealing with data presented in delimited fields but curiously not good at handling comma-separated-value files, which can have field delimiters embedded within a field, provided that the field is quoted. Also, regular expressions have moved on since awk was invented, and needing to remember two sets of regular expression syntax rules is not conducive to bug-free code. [One set of such rules is bad enough][4].
Because awk is a small language, it's missing some things that I sometimes find useful, like a richer assortment of base types, structures, switch statements, and so on.
In contrast, Groovy has all of these good things: access to [the OpenCSV library][5], which facilitates dealing with CSV files, Java regular expressions and great matching operators, a rich assortment of base types, classes, switch statements, and more.
What Groovy lacks is the simple pipeline-oriented view of data as an incoming stream and processed data as an outgoing stream.
But my music directory processing framework made me think, maybe I can create a Groovy version of awk's "engine". That's my objective for this article.
### Install Java and Groovy
Groovy is based on Java and requires a Java installation. Both a recent and decent version of Java and Groovy might be in your Linux distribution's repositories. Groovy can also be installed following the instructions on the [Groovy homepage][6]. A nice alternative for Linux users is [SDKMan][7], which can be used to get multiple versions of Java, Groovy and many other related tools. For this article, I'm using SDK's releases of:
* Java: version 11.0.12-open of OpenJDK 11;
* Groovy: version 3.0.8.
### Creating awk with Groovy
The basic idea here is to encapsulate the complexities of opening a file or files for processing, splitting the line into fields, and providing access to the stream of data in three parts:
* Before any data is processed
* On each line of data
* After all data is processed
I'm not going for the general case of replacing awk with Groovy. Instead, I'm working toward my typical use case, which is:
* Use a script file rather than having the code on the command line
* Process one or more input files
* Set my default field delimiter to `|` and split lines read on that delimiter
* Use OpenCSV to do the splitting (what I can't do in awk)
### The framework class
Here's the "awk engine" in a Groovy class:
```
1 @Grab('com.opencsv:opencsv:5.6')
 2 import com.opencsv.CSVReader
 3 public class AwkEngine {
 4 // With admiration and respect for
 5 //     Alfred Aho
 6 //     Peter Weinberger
 7 //     Brian Kernighan
 8 // Thank you for the enormous value
 9 // brought my job by the awk
10 // programming language
11 Closure onBegin
12 Closure onEachLine
13 Closure onEnd
14 private String fieldSeparator
15 private boolean isFirstLineHeader
16 private ArrayList<String> fileNameList
   
17 public AwkEngine(args) {
18     this.fileNameList = args
19     this.fieldSeparator = "|"
20     this.isFirstLineHeader = false
21 }
   
22 public AwkEngine(args, fieldSeparator) {
23     this.fileNameList = args
24     this.fieldSeparator = fieldSeparator
25     this.isFirstLineHeader = false
26 }
   
27 public AwkEngine(args, fieldSeparator, isFirstLineHeader) {
28     this.fileNameList = args
29     this.fieldSeparator = fieldSeparator
30     this.isFirstLineHeader = isFirstLineHeader
31 }
   
32 public void go() {
33     this.onBegin()
34     int recordNumber = 0
35     fileNameList.each { fileName ->
36         int fileRecordNumber = 0
37         new File(fileName).withReader { reader ->
38             def csvReader = new CSVReader(reader,
39                 this.fieldSeparator.charAt(0))
40             if (isFirstLineHeader) {
41                 def csvFieldNames = csvReader.readNext() as
42                     ArrayList<String>
43                 csvReader.each { fieldsByNumber ->
44                     def fieldsByName = csvFieldNames.
45                         withIndex().
46                         collectEntries { name, index ->
47                             [name, fieldsByNumber[index]]
48                         }
49                     this.onEachLine(fieldsByName,
50                             recordNumber, fileName,
51                             fileRecordNumber)
52                     recordNumber++
53                     fileRecordNumber++
54                 }
55             } else {
56                 csvReader.each { fieldsByNumber ->
57                     this.onEachLine(fieldsByNumber,
58                         recordNumber, fileName,
59                         fileRecordNumber)
60                     recordNumber++
61                     fileRecordNumber++
62                 }
63             }
64         }
65     }
66     this.onEnd()
67 }
68 }
```
While this looks like a fair bit of code, many of the lines are continuations of a split longer lines (for example, normally you would combine lines 38 and 39, lines 41 and 42, and so on). Let's look at this line by line.
Line 1 uses the `@Grab` annotation to fetch the OpenCSV library version 5.6 from [Maven Central][8]. No XML required.
In line 2, I import OpenCSV's `CSVReader` class.
In line 3, just as with Java, I declare a public utility class, `AwkEngine`.
Lines 11-13 define the Groovy Closure instances used by the script as hooks into this class. These are "public by default" as is the case with any Groovy class—but Groovy creates the fields as private and external references to these (using getters and setters provided by Groovy). I'll explain that further in the sample scripts below.
Lines 14-16 declare the private fields—the field separator, a flag to indicate whether the first line of a file is a header, and a list for the file name.
Lines 17-31 define three constructors. The first receives the command line arguments. The second receives the field separator character. The third receives the flag indicating whether the first line is a header or not.
Lines 31-67 define the engine itself, as the `go()` method.
Line 33 calls the `onBegin()` closure (equivalent to the awk `BEGIN {}` statement).
Line 34 initializes the `recordNumber` for the stream (equivalent to the awk `NR` variable) to 0 (note I am doing 0-origin here rather than the awk 1-origin).
Lines 35-65 use each `{}` to loop over the list of files to be processed.
Line 36 initializes the `fileRecordNumber` for the file (equivalent to the awk `FNR` variable) to 0 (0-origin, not 1-origin).
Lines 37-64 get a `Reader` instance for the file and process it.
Lines 38-39 get a `CSVReader` instance.
Line 40 checks to see whether the first line is being treated as a header.
If the first line is being treated as a header, then lines 41-42 get the list of field header names from the first record.
Lines 43-54 process the rest of the records.
Lines 44-48 copy the field values into the map of `name:value`.
Lines 49-51 call the onEachLine`()` closure (equivalent to what appears in an awk program between `BEGIN {}` and `END {}`, though no pattern can be attached to make the execution conditional), passing in the map of `name:value`, the stream record number, the file name and the file record number.
Lines 52-53 increment the stream record number and file record number.
Otherwise:
Lines 56-62 process the records.
Lines 57-59 call the `onEachLine()` closure, passing in the array of field values, the stream record number, the file name and the file record number.
Lines 60-61 increment the stream record number and file record number.
Line 66 calls the `onEnd()` closure (equivalent to the awk `END {}` ).
That's it for the framework. Now you can compile it:
```
$ groovyc AwkEngine.groovy
```
A couple of comments:
If an argument is passed in that is not a file, the code fails with a standard Groovy stack trace, which looks something like this:
```
Caught: java.io.FileNotFoundException: not-a-file (No such file or directory)
java.io.FileNotFoundException: not-a-file (No such file or directory)
at AwkEngine$_go_closure1.doCall(AwkEngine.groovy:46)
```
OpenCSV tends to return `String[]` values, which are not as convenient as `List` values in Groovy (for example there is no `each {}` defined for an array). Lines 41-42 convert the header field value array into a list, so perhaps `fieldsByNumber` in line 57 should also be converted into a list.
### Using the framework in scripts
Here's a very simple script using `AwkEngine` to examine a file like `/etc/group`, which is colon-delimited and has no header:
```
1 def ae = new AwkEngine(args, :')
2 int lineCount = 0
3 ae.onBegin = {
4    println “in begin”
5 }
6 ae.onEachLine = { fields, recordNumber, fileName, fileRecordNumber ->
7    if (lineCount < 10)
8       println “fileName $fileName fields $fields”
9       lineCount++
10 }
11 ae.onEnd = {
12    println “in end”
13    println “$lineCount line(s) read”
14 }
15 ae.go()
```
Line 1 calls the two-argument constructor, passing in the argument list and the colon as delimiter.
Line 2 defines a script top-level variable, `lineCount`, used to record the count of lines read (note that Groovy closures don't require variables defined external to the closure to be final).
Lines 3-5 define the `onBegin()` closure, which just prints the string "in begin" on standard output.
Lines 6-10 define the `onEachLine()` closure, which prints the file name and the fields for the first 10 lines and in any case increments the line count.
Lines 11-14 define the `onEnd()` closure, which prints the string "in end" and the count of the number of lines read.
Line 15 runs the script using the `AwkEngine`.
Run this script as follows:
```
$ groovy Test1Awk.groovy /etc/group
in begin
fileName /etc/group fields [root, x, 0, ]
fileName /etc/group fields [daemon, x, 1, ]
fileName /etc/group fields [bin, x, 2, ]
fileName /etc/group fields [sys, x, 3, ]
fileName /etc/group fields [adm, x, 4, syslog,clh]
fileName /etc/group fields [tty, x, 5, ]
fileName /etc/group fields [disk, x, 6, ]
fileName /etc/group fields [lp, x, 7, ]
fileName /etc/group fields [mail, x, 8, ]
fileName /etc/group fields [news, x, 9, ]
in end
78 line(s) read
$
```
Of course the `.class` files created by compiling the framework class must be on the classpath for this to work. Naturally, you could use `jar` to package up those class files.
I really like Groovy's support for the delegation of behavior, which requires various shenanigans in other languages. For many years Java required anonymous classes and quite a bit of extra code. Lambdas have gone a long way to fixing this, but they still cannot refer to non-final variables outside their scope.
Here's another, more interesting script that is very reminiscent of my typical use of awk:
```
1 def ae = new AwkEngine(args, ;', true)
2 ae.onBegin = {
3    // nothing to do here
4 }
5 def regionCount = [:]
6    ae.onEachLine = { fields, recordNumber, fileName, fileRecordNumber ->
7    regionCount[fields.REGION] =
8    (regionCount.containsKey(fields.REGION) ?
9    regionCount[fields.REGION] : 0) +
10   (fields.PERSONAS as Integer)
11 }
12 ae.onEnd = {
13    regionCount.each { region, population ->
14    println “Region $region population $population”
15    }
16 }
17 ae.go()
```
Line 1 calls the three-argument constructor, recognizing that this is a "true CSV" file with the header being on the first line. Because it's a Spanish file, where the comma is used as the decimal "point", the standard delimiter is the semicolon.
Lines 2-4 define the `onBegin()` closure which in this case doesn't do anything.
Line 5 defines an (empty) `LinkedHashMap`, which you will fill with String keys and Integer values. The data file is from Chile's most recent census and you are calculating the number of people in each region of Chile in this script.
Lines 6-11 processes the lines in the file (there are 180,500 including the header)—note that in this case, because you are defining line 1 as the CSV column headers, the fields parameter is going to be an instance of `LinkedHashMap<String,String>`.
Lines 7-10 increment the `regionCount` map, using the value in the field REGION as the key and the value in the field PERSONAS as the value—note that, unlike awk, in Groovy you can't refer to a non-existent map entry on the right-hand side and expect a blank or zero value to materialize.
Lines 12- 16 print out population by region.
Line 17 runs the script on the `AwkEngine` instance.
Run this script as follows:
```
$ groovy Test2Awk.groovy ~/Downloads/Censo2017/ManzanaEntidad_CSV/Censo*csv
Region 1 population 330558
Region 2 population 607534
Region 3 population 286168
Region 4 population 757586
Region 5 population 1815902
Region 6 population 914555
Region 7 population 1044950
Region 8 population 1556805
Region 16 population 480609
Region 9 population 957224
Region 10 population 828708
Region 11 population 103158
Region 12 population 166533
Region 13 population 7112808
Region 14 population 384837
Region 15 population 226068
$
```
That's it. For those of you who love awk and yet would like a little more, I hope you enjoy this Groovy approach.
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/9/awk-groovy
作者:[Chris Hermansen][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/clhermansen
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/browser_screen_windows_files.png
[2]: https://opensource.com/article/22/8/music-tagging-framework-groovy
[3]: https://opensource.com/downloads/awk-ebook
[4]: http://regex.info/blog/2006-09-15/247
[5]: http://opencsv.sourceforge.net/
[6]: https://groovy.apache.org/download.html
[7]: https://opensource.com/article/22/3/manage-java-versions-sdkman
[8]: https://mvnrepository.com/artifact/com.opencsv/opencsv

View File

@ -1,140 +0,0 @@
[#]: subject: "Fedora 37: Top New Features and Release Wiki"
[#]: via: "https://www.debugpoint.com/fedora-37/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Fedora 37: Top New Features and Release Wiki
======
**An article about Fedora 37 and its new features, release details and everything you need to know.**
Fedora 37 development is wrapped up, and the BETA is [now out][1]. Hence the features and packages are final at this stage.
In this usual feature guide page, I have summarised the essential features you should know about Fedora 37 and get an idea of what to expect. But before that, heres a tentative schedule.
- The beta was out on September 13, 2022.
- **Final Fedora 37 is planned for release on October 25, 2022.**
![Fedora 37 Workstation with GNOME 43][2]
### Fedora 37: Top New Features
#### Kernel
**First** up are the critical items that make the core. Fedora 37 is powered by **Linux Kernel 5.19,** the latest mainline Kernel available now. Linux Kernel 5.19 brings essential features such as a fix for Ratbleed vulnerability, ARM support, Apple M1 NVMe SSD controller support and many such features, which you can read in our [Kernel feature guide][3].
The advantage of using the latest Kernel is that you can be assured that you are using the latest and greatest hardware support available at this moment in time.
**Next** up, the desktop environments are updated in this release.
#### Desktop Environment
Fedora 37 is the first distribution which brings the stunning **GNOME 43** desktop, which brings some excellent features such as:
- [Revamped quick settings][4] with pill-buttons
- Files (nautilus) 43 with GTK4 and libadwaita port
- Files with rubberband, emblems, responsive sidebar-like features
- [Updated GNOME Web with WebExtension API support][5]
And many features you have been waiting for for years. Do check out my [GNOME 43 feature guide][6] to learn more.
Fedora 37 brings **KDE Plasma 5.26** desktop environment with tons of new features, performance improvements and bug fixes. The most noteworthy features of the KDE Plasma desktop include:
- An updated overview screen.
- Dynamic wallpaper for dark and light themes.
- Animated wallpaper support
- Multi-button mouse support
- Updated KDE Framework and applications.
…and much more which you can read in detail in my [KDE Plasma 5.26 feature guide][7].
Since the lightweight desktop LXQt gets a stable update, 1.1.0, it arrives in Fedora 37. **LXQt 1.1.0** brings a default colour palette for dark themes for a uniform look, two variants (simple and compact) of the application menu and re-arranged GTK settings. Furthermore, LXQt 1.1.0 also starts the initial work for the Qt 6.0 porting of desktop components. All these bug fixes and enhancements arrive in the Fedora LXQt edition.
In addition, other primary desktop flavours remain at their current releases since no significant new updates arrive, i.e. **Xfce 4.16 and MATE 1.26**for the respective Fedora flavours.
Lets see what the system-wide changes in this release that impacts all the Fedora flavours are.
#### System wide changes
The most significant change is the official support for **Raspberry Pi 4** boards. Thanks to the works over the years, you can now enjoy Fedora 37 on your favourite Pi boards with out-of-the-box supports.
Fedora Linux is always a pioneer in advancing technology and adopting the latest features before any other distro. With that in mind, the **SDDM display manager now comes with default Wayland** in KDE Plasma (and Kinoite) and different flavours. This completes the Wayland transition from the Fedora distro aspect for this flavour. 
As I [reported earlier][8], Fedora Linux 37 plans to provide us with a preview image of a **Web-based installer** for Anaconda. It might not be available immediately following the release. But it should be within a few days post-release.
Other noteworthy features include changing the **default hostname from “fedora” to “localhost”** to mitigate some third-party system configuration detection. 
Other than that, the **Fedora Core OS** is made to be an official Fedora edition and now stands together with Server, IoT and cloud editions for better discovery and adoption. Fedora Core OS minimal footprint OS is primarily used for container workloads and brings auto updates and additional features.
Following the tradition, this release also features a [brand new wallpaper][9] with both night and day versions. I must say it looks awesome (see the above desktop image).
Finally, also in this release, Fedora **drops 32-bit Java** packages, including JDK 8, 11, and 17, since usage is low. In addition, the openssl1.1 package is also deprecated.
The toolchain, apps and programming stack are updated as follows:
- Glibc 2.36 and Binutils 2.38
- Node.js 18.x
- Perl 5.36
- Python 3.11
### Summary of features in Fedora 37
So, thats about it with the features of this release. Heres a summary of the Fedora 37 features:
- Linux Kernel 5.19
- GNOME 43
- KDE Plasma 5.26
- Xfce 4.16
- MATE 1.24
- LXQt 1.1.0
- A preview image of the new web-based installer
- The SDDM display manager defaults to Wayland (in KDE Plasma and others)
- Official Raspberry Pi 4 support
- Fedora Core OS becomes the official flavour
- Key packages dropping 32-bit support
- And associated toolchain and programming language updates.
If you have spare time, you can[give it a spin][10] or test drive. Just be cautious that it is still BETA.
Also, If you are daring enough, you can upgrade to this release with **caution** because, yknow its BETA. The commands below will help you to do that.
```
sudo dnf install dnf-plugin-system-upgrade
sudo dnf system-upgrade download --ref --releasever=37
```
For Kinoite, Silverblue and other immutable versions, use:
```
rpm-ostree rebase fedora:fedora/37/x86_64/silverblue
```
**So, whats your favourite feature of this release? Let me know in the comment section.**
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/fedora-37/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://debugpointnews.com/fedora-37-beta/
[2]: https://www.debugpoint.com/wp-content/uploads/2022/08/Fedora-37-Workstation-with-GNOME-43-1024x572.jpg
[3]: https://www.debugpoint.com/linux-kernel-5-19/
[4]: https://www.debugpoint.com/gnome-43-quick-settings/
[5]: https://www.debugpoint.com/gnome-web-43-tab-view/
[6]: https://www.debugpoint.com/gnome-43/
[7]: https://www.debugpoint.com/kde-plasma-5-26/
[8]: https://debugpointnews.com/fedora-37-anaconda-web-ui-installer/
[9]: https://debugpointnews.com/fedora-37-wallpaper/
[10]: https://getfedora.org/workstation/download/

View File

@ -2,7 +2,7 @@
[#]: via: "https://opensource.com/article/22/10/open-source-editors"
[#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: translator: "Donkey-Hao"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
@ -42,7 +42,7 @@ via: https://opensource.com/article/22/10/open-source-editors
作者:[Alan Formy-Duval][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
译者:[Donkey-Hao](https://github.com/Donkey-Hao)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,202 +0,0 @@
[#]: subject: "Endless OS Desktop Linux Done Right for the Masses"
[#]: via: "https://www.debugpoint.com/endless-os-review-2021/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Endless OS Desktop Linux Done Right for the Masses
======
**We review the popular Endless OS as Linux Desktop with the new features and updates of the latest version 4.0.**
![Endless OS Desktop version 4.0][1]
Endless OS is a [OSTree based][2] free and open-source[Linux Distribution][3]. This Linux distribution is packaged from Debian/Ubuntu, but not directly based on it. OSTree is an atomic upgrade system for Linux-based OSes. This is a unique way to provide package updates to Linux-distribution, where OSTree packages everything in a server and then replicates to the client.
The main advantage is that your underlying Linux operating system always remain intact, and it is read-only. OSTree only operates in user space.
In that sense, Endless OS never breaks, and it remains fresh as you install for the first time. Today, only very few Linux Distribution are based on OSTree technology such as Fedora SIlverblue and Fedora Kinoite.
That said, let take a deep dive on the Endless OS as a whole and check out the updates to the new version.
### Endless OS Review
#### Version 4.0 Updates
As of writing this post, Endless OS latest version is 4.0 which has been released on Nov 22, 2021. This release brings better app grid switching with indicators, switch user option and a Long term support model. With this new support model, this version 4.0 will continue to receive update even after Endless OS 5.0 released. You can learn more about the updates in this [post][4].
#### Downloading Endless OS
Before I go into the installer, I would like to spend a few words on the installer/.ISO of this distribution. Endless OS brings two separate installers. An .ISO file specifically designed for Windows system to install as dual-boot. This installer is an EXE file which you can download in Windows machine and start the installation! This something unique I found.
With all the Windows hate aside, this actually helps to adopt this Linux distribution far more easily for the average user. An average user may not even know what a partition or a GRUB is. So, in those situations, it downloads, does the partition and installs it without any complex user input. This is really impressive. You can learn more about the Windows installation [here][5].
Other .ISO images are dedicated to
- Basic desktop installer with language selection
- A specially designed .ISO for virtual machine
- .ISO images for ARM hardware such as Raspberry Pi, Pinebook Pro etc.
Go ahead and open the below link and get your .ISO copy. Remember, the full installer ISO files are much larger > 10 GB. So, if you are planning to test, use the basic installer.
![Download options of Endless OS][6]
[download Endless OS][7]
#### Unique Installation of Endless OS
Apart from the Windows installation as described above, you need to know a couple of things. The Endless OS can not be installed at the moment as dual boot with other Linux distributions. What? Yes.
As per the information I found, the .ISO is not designed to handle other Linux distribution as dual boot. However, you can try it in virtual machine with any Linux host OS.
The basic installer gives you two options. Try in LIVE media or reformat the entire disk and install. Yes, entire disk. So be very careful if youre trying to install in actual hardware.
During my test, I had to install it in a virtual machine ([virt-manager][8]) because I dont want to reformat my entire SSD.
The installation went smooth. No error whatsoever. However, it took a little longer (probably 10 to 15 minutes extra) than other Linux distribution installation in same hardware.
![Two options to Install and Try Endless OS][9]
![This OS requires entire disk][10]
#### First Login and Setup
After the successful installation, you get to choose Language, user account, privacy options. These are standard GNOME options which we see in Fedora Workstation GNOME Edition. One of the important item is the terms of use. As this Linux is targeted for mass deployment for schools, non-profits or labs you might want to go through the terms.
User creation dialog have an option to set up parental control for the user being created, which is neat.
#### How the Endless OS with GNOME desktop looks
When you first boot up, you see a desktop with icons and a search bar.
This is the application list menu, which is the default desktop screen. You can search any items in your desktop and launch them via the search bar. The search bar also gives you the option to directly search Google via Chromium, which is the default browser.
This default desktop screen contains preloaded applications and well organized app folders for native GNOME apps.
The bottom panel is awesome, really. It is well optimized in terms of looks and width. Not too narrow or wide. In the far left, you have Endless OS icon, which is a toggle for show applications and show desktop options.
Then, you have the favorites as icons. The favorites icons have the app indicator notifying that it is open. If some app is not marked as favorites, they also show up in the bottom panel when opened with app indicator. This is super neat.
To the right, the system tray is classified intro three sections. First one gives you the volume controls, network and Wi-Fi settings. In the middle you have date, time and calendar on mouse-hover. And at the extreme right you have the options to log out, switch user, power off and other information. All these menu comes up when you mouse-hover into it. You do not need to click them.
#### Hot Corner and Workspace
Endless OS is based on GNOME 3.38 version. Not GNOME. Hence, the workspace design is kind of unique. To the extreme right bottom there is a hot corner. When you click on that, it brings up the current workspace with a list of running applications. When you mouse hover, you can close them or select them without leaving the view.
#### Things that I feel Endless OS done right with GNOME
If you have used GNOME in Ubuntu or Fedora, and then experienced it in Endless OS, you might find some UI tweaks works out of the box. You do not need to set up Extensions or change settings. Here are a couple of them I found that I wish GNOME with Fedora or Ubuntu would feature by default.
- Clicking on desktop empty section shows the desktop by minimizing all open applications. And pressing ALT+TAB brings up the open app windows again. You cant imagine how comfortable this behavior is.
- The show desktop and app toggle at the bottom right of the panel and its default mapping with Super key. This just works.
- All windows have Minimize, Maximize, and Close icons at the top right by default. You do not need additional tweaks to get it working.
- Hot corner implementation at the far right.
- Panel design in terms of width, app icons with app indicators. They are all default implementations.
- System tray menu popup in mouse over by default. You do not need an extra click to open it up. This is such a breathing while using the mouse.
Heres a quick video showing all the above features.
#### Unique Features that make it perfect for non-technical users
Perhaps the unique selling point of this Linux desktop is minimal user intervention during installation + post-install tweaks. And you can start using this desktop without internet connection right away. A perfect desktop for those places where internet is not always available.
Think about a school at a remove place where Internet connectivity is costly or not available. But you need to have a stable, free and easy-to-use Linux Desktop for kids to learn the computing. You can burn a CD/DVD or create USB with language specific .ISO and deploy it offline.
And post-installation does not require any additional settings at all. All the options are well defaulted and just works.
#### Software and Applications
One point to note that, Endless OS use Flatpak to deploy applications. There is no way to install other than Flatpak. For example, you can not use apt or apt-get at all because the file system is read only.
Thats why, the .ISO itself is larger and contains all required applications, language packs preloaded. Ideal for schools, labs and other forms of deployments.
However, if you need additional applications, you can install it using the customized App Center for GNOME with internet connection.
The App Center have curated categories at the left which shows the Flatpak applications. The App center is configured to fetch application metadata directly from Flathub.
![App Center in Endless OS][11]
Oh, this OS supports NVIDIA cards out-of-the-box with either the proprietary driver for supported cards or nouveau for older ones.
#### Help Center
Think about a situation, where a student is learning computer for the first time using Endless OS. If the person want to change the login screen photo, how does he/she do?
Here comes the great built-in help center of this OS which I feel one of the important feature. All the person need to do is type something in the desktop search bar and pull up help.
This is so helpful, isnt it?
![Trying Help in Endless OS-1][12]
![Trying Help in Endless OS-2][13]
#### How about the performance?
I have only managed to install it in a virtual machine. So, it has comfortable response time while using the desktop. The animations and other gestures are instant. I kept it running for more than 15 hours in a virtual machine.
After 15 hours, it was consuming around 1 to 2% CPU and 1 GB of memory. Most of the CPU is consumed by gnome-shell, followed by Xorg. I am not sure why gnome-shell was consuming so much, might be memory leak bug. Not sure though.
![Performance of Endless OS][14]
#### What about disk space?
As this Linux distribution plans to be a self-sufficient distro without internet, the installation size is a little larger compared to other distributions such as Ubuntu or Fedora. A default virtual machine installation takes around ~11 GB of disk space.
#### Is it a perfect Linux Distribution? Well, not really.
I try many Linux distributions and desktops for this blog and my work. Very few are perfect and ready to use just after installation. I mean, you dont need to go over “10 things to do after installing **” with this Linux distribution.
But, some minor improvements are welcome from the team in the future. First item I feel, an .ISO which is dedicated to be installed side-by-side with Ubuntu, fedora and other Linux. This is really needed.
Probably some support for Snap packages in the future.
And the final drawback might be the availability of applications only as Flatpak. Not every app have an official flatpak version today. That limits its capability to some extent, but not more.
#### If things go wrong how to get help and Support?
Theres a great online active community of Endless OS where you get support from its creators. And the documentation is also very impressive which contains all necessary details ranging from installation to usage. You can visit the community and documentation using the below links.
- [https://support.endlessos.org/en/home][15]
- [https://community.endlessos.com/][16]
### Closing Notes
Endless OS is one of those few Linux distributions which I felt really well thought of and designed. It is perfect for schools, labs, and remote/offline situations. And perfectly designed to be used by anyone without prior knowledge of much computing, even experience of Windows. Even the Windows users would feel comfortable using this modified GNOME desktop. That said, I am hoping that the team should bring up options to install it alongside other Linux distributions. Then it might be a daily driver distribution for many Linux users and get more attention it deserves.
If you want only one Linux operating system in your machine which is super stable and run for years, then go ahead and try this distribution. You will be amazed by how much time you save without worrying about terminal, commands, updates/upgrades and sudden package dependency surprises.
To wrap up this Endless OS review, what you think about Endless OS? Is it a perfect distro? Let me know in the comment box below.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/endless-os-review-2021/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/wp-content/uploads/2021/11/Endless-OS-Desktop-version-4.0-1024x582.jpg
[2]: https://ostree.readthedocs.io/en/stable/
[3]: https://www.debugpoint.com/category/distributions
[4]: https://support.endlessos.org/en/endless-os/release-notes/4-0
[5]: https://support.endlessos.org/en/installation/windows-installer/dual-boot
[6]: https://www.debugpoint.com/wp-content/uploads/2021/11/Download-options-of-Endless-OS.jpg
[7]: https://endlessos.com/download/
[8]: https://www.debugpoint.com/2020/11/virt-manager/
[9]: https://www.debugpoint.com/wp-content/uploads/2021/11/Two-options-to-Install-and-Try-Endless-OS-1024x734.jpg
[10]: https://www.debugpoint.com/wp-content/uploads/2021/11/This-OS-requires-entire-disk.jpg
[11]: https://www.debugpoint.com/wp-content/uploads/2021/11/App-Center-in-Endless-OS-1024x625.jpg
[12]: https://www.debugpoint.com/wp-content/uploads/2021/11/Trying-Help-in-Endless-OS-1-1024x576.jpg
[13]: https://www.debugpoint.com/wp-content/uploads/2021/11/Trying-Help-in-Endless-OS-2.jpg
[14]: https://www.debugpoint.com/wp-content/uploads/2021/11/Performance-of-Endless-OS.jpg
[15]: https://support.endlessos.org/en/home
[16]: https://community.endlessos.com/

View File

@ -1,119 +0,0 @@
[#]: subject: "How to Check CPU and HDD Temperature in Ubuntu and Other Linux"
[#]: via: "https://www.debugpoint.com/cpu-hdd-temperature-ubuntu/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Check CPU and HDD Temperature in Ubuntu and Other Linux
======
**Wondering how you can check the CPU and HDD temperature in Ubuntu and other Linux on your desktop or laptop? Heres a quick guide.**
You do not actually require checking CPU or HDD temperature if you are an average user. But, if you are using very older hardware or a thin one, you may run into an overheating problem. Because these thin ones are tightly coupled together inside, and no matter how much heat transfer mechanism is implemented, it heats up. Therefore, it is essential to monitor the temperature of the hardware. However, modern Linux distributions are well capable of handling overheating situations via software sensors.
### Steps for monitoring CPU and HDD temperature on Ubuntu
#### Using terminal
We are going to use a couple of packages to achieve the same. Open a terminal in your Ubuntu-based system and install the following.
```
sudo apt install hddtemp
sudo apt install lm-sensors
```
The [hddtemp][1] utility gives you the temperature of your optical hard disk drive as well as SSD (as per my test). And the [lm-sensors][2] package gives you temperature details from the CPUs and other sensors accessed via PCI ports.
After installation, run the following from the terminal. You need to know your disk identifier for this for example `/dev/sda` or `/dev/sdb`, etc.
To find out the disk identifiers, you can use `fdisk`.
```
sudo fdisk -l
```
Then run below to check the HDD or SSD temperature.
```
sudo hddtemp
```
![HDD or SSD Temperature from terminal][3]
HDD or SSD Temperature from terminal
Checking the CPU temperature and other information requires an additional step.
First, run the below command so that the utility of the sensor can detect the sensors in your system.
```
sudo sensors-detect
```
The above command might ask you some YES/NO questions. Keep pressing ENTER to choose the default options.
Once done, run the below command to view the CPU and other interface temperatures.
```
sensors
```
![using sensors][4]
using sensors
#### Using GUI tools
If you prefer a nice GUI which does all the above, you can install [psensor][5]. This utility works across Linux systems such as Ubuntu, Fedora, [Arch][6] and other variants. This gives you nice graphical plus tabular view of
**Ubuntu and its derivatives**
```
sudo apt install psensor
```
**Fedora and RPM-based derivatives**
```
sudo dnf install psensor
```
**Arch, Manjaro and similar derivatives**
```
pacman -S psensor
```
Once installed, run via `psensor from the terminal or launch it from the`application menu.
As you can see in the below screenshot, it gives you a nice view of all the important temperatures across CPU, GPU, and HDD with a nice graph. Using its preferences, you can tweak it as per your need. This lightweight utility can be helpful in many cases.
![psensor running][7]
psensor running
So, these are some ways in which you can monitor CPU, GPU or HDD temperature in your Ubuntu and other Linux systems. Let me know if you know of any other ways to find these out using the comment box below.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/cpu-hdd-temperature-ubuntu/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://wiki.archlinux.org/title/Hddtemp
[2]: https://github.com/lm-sensors/lm-sensors
[3]: https://www.debugpoint.com/wp-content/uploads/2021/09/HDD-or-SSD-Temperature-from-terminal.png
[4]: https://www.debugpoint.com/wp-content/uploads/2021/09/psensor.png
[5]: https://wpitchoune.net/psensor/
[6]: https://www.debugpoint.com/tag/arch-linux
[7]: https://www.debugpoint.com/wp-content/uploads/2021/09/psensor-running-1024x465.png

View File

@ -1,139 +0,0 @@
[#]: subject: "Transfer files and folders from Windows to Linux with PSCP"
[#]: via: "https://opensource.com/article/22/10/transfer-files-windows-linux-pscp"
[#]: author: "Paul https://opensource.com/users/plaubscher"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Transfer files and folders from Windows to Linux with PSCP
======
The open source PSCP utility makes it easy to transfer files and folders between Windows and Linux computers.
Are you looking for a way to quickly transfer files from your Windows computer to your Linux computer and back again? The open source PSCP utility makes it easy to transfer files and folders, and of course it's open source.
### Setting your PATH in Windows
Knowing how to set your command path in Windows makes it easier to use a handy utility like PSCP. If you're unfamiliar with that process, read [how to set a PATH on Windows][1].
### Using PSCP
PSCP (PuTTY Secure Copy Protocol) is a command-line tool for transferring files and folders from a Windows computer to a Linux computer.
- Download `pscp.exe` from its [website][2].
- Move `pscp.exe` to a folder in your PATH (for example, `Desktop\App` if you followed the PATH tutorial here on [Opensource.com][3]). If you haven't set a PATH variable for yourself, you can alternately move `pscp.exe` to the folder holding the files you're going to transfer.
- Open Powershell on your Windows computer using the search bar in the Windows taskbar (type 'powershell` into the search bar.)
- Type `pscp version` to confirm that your computer can find the command.
### IP address
Before you can make the transfer, you must know the IP address or fully-qualified domain name of the destination computer. Assuming it's a computer on your same network, and that you're not running a DNS server to resolve computer names, you can find the destination IP address using the `ip` command on the Linux machine:
```
[linux]$ ip addr show |grep'inet '
inet 127.0.0.1/8 scope host lo
inet 192.168.1.23/24 brd 10.0.1.255 scope global noprefixroute eth0
```
In all cases, 127.0.0.1 is a loopback address that the computer uses only to talk to itself, so in this example the correct address is 192.168.1.23. On your system, the IP address is likely to be different. If you're not sure which is which, you can try each one in succession until you get the right one (and then write it down somewhere!)
Alternately, you can look in the settings of your router, which lists all addresses assigned over DHCP.
### Firewalls and servers
The `pscp` command uses the OpenSSH protocol, so your Linux computer must be running the OpenSSH server software, and its firewall must allow SSH traffic.
If you're not sure whether your Linux machine is running SSH, then run this command on the Linux machine:
```
[linux]$ sudo systemctl enable--now sshd
```
To ensure your firewall allows SSH traffic, run this command:
```
[linux]$ sudo firewall-cmd --add-servicessh--permanent
```
For more information on firewalls on Linux, read [Make Linux stronger with firewalls][4].
### Transfer the file
In this example, I have a file called `pscp-test.txt` that I want to transfer from `C:\Users\paul\Documents` on my Windows computer to my destination Linux computer home directory `/_home_/paul`.
Now that you have the `pscp` command and the destination address, you're ready to transfer the test file `pscp-test.txt`. Open Powershell and use the `dir` command to change to the `Documents` folder, where the sample file is located:
PS> dir %USERPROFILE%\Documents\
Now execute the transfer:
```
PS> pscp pscp-test.txt paul@192.168.1.23:/home/paul| Password:
End of keyboard-interactive prompts from server
pscp-test.txt |0 kb |0.0 kB/s | ETA: 00:00:00 |100%
```
Here's the syntax, word for word:
- `pscp`: The command used to transfer the file.
- `pscp-test.txt` is the name of the file you want to transfer from Windows.
- `paul@192.168.1.23` is my username on the Linux computer, and the IP address of the Linux computer. You must replace this with your own user and destination information. Notice that `pscp` requires a destination path on the target computer, and `:/home/paul` at the end of the IP address specifies that I want the file copied to my home folder.
After you authenticate to the Linux computer, the `pscp-test.txt` file is transferred to the Linux computer.
### Verifying the transferred
On your Linux computer, open a terminal and use the `ls` command to verify that the file `pscp-test.txt` appears in your home directory.
```
[linux]$ ls
Documents
Downloads
Music
Pictures
pscp-test.txt
```
### Copying a file off of a Linux system
You aren't limited to just copying files to your Linux system. With `pscp`, you can also copy a file from Linux onto Windows. The syntax is the same, only in reverse:
```
PS> pscp paul@192.168.1.23:/home/paul/pscp-test.txt %USERPROFILE%\Documents\pscp-win.txt
```
Here's the syntax:
- `pscp`: The command used to transfer the file.
- `paul@192.168.1.23:/home/paul/pscp-test.txt` is my username on the Linux computer, the IP address of the Linux computer, and the path to the file I want to copy.
- `%USERPROFILE%\Documents` is the location on my Windows computer where I want to save the file. Notice that in copying the file back to my Windows computer, I can give it a new name, such as `pscp-win.txt`, to differentiate it from the original. You don't have to rename the file, of course, but for this demonstration it's a useful shortcut.
Open your file manager to verify that the `pscp-win.txt` file was copied to the Windows `C:\Users\paul\Documents` path from the Linux computer.
![Image of a file manager.][5]
### Remote copying
With the power of the open source `pscp` command, you have access to any computer in your house, and servers you have accounts on, and even mobile and [edge devices][6].
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/10/transfer-files-windows-linux-pscp
作者:[Paul][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/plaubscher
[b]: https://github.com/lkxed
[1]: https://opensource.com/article/22/10/set-path-powershell
[2]: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
[3]: http://Opensource.com
[4]: https://opensource.com/article/19/7/make-linux-stronger-firewalls
[5]: https://opensource.com/sites/default/files/2022-10/Filemanager.pscp_.png
[6]: https://opensource.com/tags/edge-computing

View File

@ -1,142 +0,0 @@
[#]: subject: "Fedora 37: Top New Features and Release Wiki"
[#]: via: "https://www.debugpoint.com/fedora-37/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Fedora 37: Top New Features and Release Wiki
======
**An article about Fedora 37 and its new features, release details and everything you need to know.**
Fedora 37 development is wrapped up, and the BETA is [now out][1]. Hence the features and packages are final at this stage.
In this usual feature guide page, I have summarised the essential features you should know about Fedora 37 and get an idea of what to expect. But before that, heres a tentative schedule.
- The beta was out on September 13, 2022.
- **Final Fedora 37 is planned for release on November 15, 2022.**
![Fedora 37 Workstation with GNOME 43][2]
Fedora 37 Workstation with GNOME 43
### Fedora 37: Top New Features
#### Kernel
**First** up are the critical items that make the core. Fedora 37 is powered by **Linux Kernel 5.19,** the latest mainline Kernel available now. Linux Kernel 5.19 brings essential features such as a fix for Ratbleed vulnerability, ARM support, Apple M1 NVMe SSD controller support and many such features, which you can read in our [Kernel feature guide][3].
The advantage of using the latest Kernel is that you can be assured that you are using the latest and greatest hardware support available at this moment in time.
**Next** up, the desktop environments are updated in this release.
#### Desktop Environment
Fedora 37 is the first distribution which brings the stunning **GNOME 43** desktop, which brings some excellent features such as:
- [Revamped quick settings][4] with pill-buttons
- Files (nautilus) 43 with GTK4 and libadwaita port
- Files with rubberband, emblems, responsive sidebar-like features
- [Updated GNOME Web with WebExtension API support][5]
And many features you have been waiting for for years. Do check out my [GNOME 43 feature guide][6] to learn more.
Fedora 37 brings **KDE Plasma 5.26** desktop environment with tons of new features, performance improvements and bug fixes. The most noteworthy features of the KDE Plasma desktop include:
- An updated overview screen.
- Dynamic wallpaper for dark and light themes.
- Animated wallpaper support
- Multi-button mouse support
- Updated KDE Framework and applications.
…and much more which you can read in detail in my [KDE Plasma 5.26 feature guide][7].
Since the lightweight desktop LXQt gets a stable update, 1.1.0, it arrives in Fedora 37. **LXQt 1.1.0** brings a default colour palette for dark themes for a uniform look, two variants (simple and compact) of the application menu and re-arranged GTK settings. Furthermore, LXQt 1.1.0 also starts the initial work for the Qt 6.0 porting of desktop components. All these bug fixes and enhancements arrive in the Fedora LXQt edition.
In addition, other primary desktop flavours remain at their current releases since no significant new updates arrive, i.e. **Xfce 4.16 and MATE 1.26**for the respective Fedora flavours.
Lets see what the system-wide changes in this release that impacts all the Fedora flavours are.
#### System wide changes
The most significant change is the official support for **Raspberry Pi 4** boards. Thanks to the works over the years, you can now enjoy Fedora 37 on your favourite Pi boards with out-of-the-box supports.
Fedora Linux is always a pioneer in advancing technology and adopting the latest features before any other distro. With that in mind, the **SDDM display manager now comes with default Wayland** in KDE Plasma (and Kinoite) and different flavours. This completes the Wayland transition from the Fedora distro aspect for this flavour. 
As I [reported earlier][8], Fedora Linux 37 plans to provide us with a preview image of a **Web-based installer** for Anaconda. It might not be available immediately following the release. But it should be within a few days post-release.
Other noteworthy features include changing the **default hostname from “fedora” to “localhost”** to mitigate some third-party system configuration detection. 
Other than that, the **Fedora Core OS** is made to be an official Fedora edition and now stands together with Server, IoT and cloud editions for better discovery and adoption. Fedora Core OS minimal footprint OS is primarily used for container workloads and brings auto updates and additional features.
Following the tradition, this release also features a [brand new wallpaper][9] with both night and day versions. I must say it looks awesome (see the above desktop image).
Finally, also in this release, Fedora **drops 32-bit Java** packages, including JDK 8, 11, and 17, since usage is low. In addition, the openssl1.1 package is also deprecated.
The toolchain, apps and programming stack are updated as follows:
- Glibc 2.36 and Binutils 2.38
- Node.js 18.x
- Perl 5.36
- Python 3.11
### Summary of features in Fedora 37
So, thats about it with the features of this release. Heres a summary of the Fedora 37 features:
- Linux Kernel 5.19
- GNOME 43
- KDE Plasma 5.26
- Xfce 4.16
- MATE 1.24
- LXQt 1.1.0
- A preview image of the new web-based installer
- The SDDM display manager defaults to Wayland (in KDE Plasma and others)
- Official Raspberry Pi 4 support
- Fedora Core OS becomes the official flavour
- Key packages dropping 32-bit support
- And associated toolchain and programming language updates.
If you have spare time, you can[give it a spin][10] or test drive. Just be cautious that it is still BETA.
Also, If you are daring enough, you can upgrade to this release with **caution** because, yknow its BETA. The commands below will help you to do that.
```
sudo dnf install dnf-plugin-system-upgrade
sudo dnf system-upgrade download --ref --releasever=37
```
For Kinoite, Silverblue and other immutable versions, use:
```
rpm-ostree rebase fedora:fedora/37/x86_64/silverblue
```
**So, whats your favourite feature of this release? Let me know in the comment section.**
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/fedora-37/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://debugpointnews.com/fedora-37-beta/
[2]: https://www.debugpoint.com/wp-content/uploads/2022/08/Fedora-37-Workstation-with-GNOME-43-1024x572.jpg
[3]: https://www.debugpoint.com/linux-kernel-5-19/
[4]: https://www.debugpoint.com/gnome-43-quick-settings/
[5]: https://www.debugpoint.com/gnome-web-43-tab-view/
[6]: https://www.debugpoint.com/gnome-43/
[7]: https://www.debugpoint.com/kde-plasma-5-26/
[8]: https://debugpointnews.com/fedora-37-anaconda-web-ui-installer/
[9]: https://debugpointnews.com/fedora-37-wallpaper/
[10]: https://getfedora.org/workstation/download/

View File

@ -1,182 +0,0 @@
[#]: subject: "How to Install Python 3.11 in Ubuntu and Other Related Linux"
[#]: via: "https://www.debugpoint.com/install-python-3-11-ubuntu/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Install Python 3.11 in Ubuntu and Other Related Linux
======
**Planning to get Python 3.11 installed for your project work? Heres how to install Python 3.11 in Ubuntu and related distros.**
![][1]
Python 3.11 was released on Oct 25, 2022, and claims to be 10-60% faster than the prior [Python 3.10][2] version.
As always, the feature and improvement list are significantly high in 3.11. Heres a brief.
- Error tracebacks are not more definite, which gives you an exact statement that causes the error.
- Introduction of exception groups and new except* syntax
- You can add custom text in the base expression for better error handling in your code.
- Introduction of Variadic generic to allow array-like structure in numerical Python libraries )such as NumPy)
- Dictionary type TypedDict gets improvement where you can now specify whether individual dictionary items are mandatory or optional.
- Introduction of Self annotation, which allows classes to return their own type instance.
And many more, which you can read in detail on the official [3.11 highlights page][3].
### Current Python versions in Linux Distros
[Ubuntu 22.04 LTS][4] have Python 3.10, whereas the recently released [Ubuntu 22.10 Kinetic Kudu][5] also have the same. However, Kinetick Kudu will probably feature 3.11 within a few weeks.
Also, [Fedora 37][6] (planned for Nov 1) already has the Python 3.11 RC2 and will get the version.
So, if you are running Ubuntu 22.04 LTS, [Linux Mint 21][7] or any Ubuntu-LTS-based distros, heres how you can install Python 3.11 via a PPA.
**Note**: Use this method with caution. Make sure you know what you are doing because replacing the base Python version of a Linux distribution may cause an unstable system. Many default applications and packages depend on the 3.10 version.
### How to install Python 3.11 in Ubuntu and related distros
- Open a terminal prompt and add the following PPA.
```
sudo add-apt-repository ppa:deadsnakes/ppa
```
- Refresh the cache using the below command.
```
sudo apt update 
```
- And install Python 3.11 using the below command.
```
sudo apt install python3.11
```
![Install Python 3.11 in Ubuntu 22.04 LTS][8]
Install Python 3.11 in Ubuntu 22.04 LTS
### Set Default Python Versions
In theory, you can install multiple versions of Python in Linux distros, but the default can only be one version. Setting up Python 3.11 as default requires some additional steps. Follow along.
However, before you do that, make sure you know which applications depend on Python 3.10. You can easily find it out using `apt-cache rdepends` command as below.
```
debugpoint@debugpoint-22-04:~$ apt-cache rdepends python3.10
python3.10
Reverse Depends:
python3.10-dbg
python3.10-venv
python3.10-full
libpython3.10-testsuite
idle-python3.10
idle-python3.10
python3.10-minimal
python3.10-doc
python3.10-dev
python3
virtualbox
python3.10-venv
python3.10-full
libpython3.10-testsuite
kitty
idle-python3.10
idle-python3.10
python3.10-minimal
python3.10-doc
python3.10-dev
python3.10-dbg
python3-uno
python3-all
python3.10-dbg
virtualbox
stimfit
python3.10-venv
python3.10-full
python3-stfio
python3-escript-mpi
python3-escript
python3-csound
plasma-firewall
pitivi
obs-studio
liferea
libpython3.10-testsuite
libglib2.0-tests
kitty
idle-python3.10
idle-python3.10
cluster-glue
atac
rhythmbox-plugins
python3.10-minimal
python3.10-doc
python3.10-dev
python3
python3-uno
python3-all
gedit
```
#### Use Python 3.11 as the default Python3
- First, check the current default version using the below command from the terminal.
```
python3 --version
```
- Use `update-alternatives` to create symbolic links to `python3`
```
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1
```
```
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2
```
- And choose which one to use as Python3 via the command:
```
sudo update-alternatives --config python3
```
![Setting up default python version to 3.11][9]
Setting up default python version to 3.11
Now you can start using the latest Python in your current Ubuntu version for your work/study. You switch to the stock version using the above commands and change the versions at any time.
If you switch to 3.11 using the above install method, then make sure you check all the necessary apps to see whether they are working fine.
Finally, do let me know in the comment box if you run into problems.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/install-python-3-11-ubuntu/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/wp-content/uploads/2022/10/py3112204-1024x576.jpg
[2]: https://www.debugpoint.com/install-python-3-10-ubuntu/
[3]: https://docs.python.org/3.11/whatsnew/3.11.html
[4]: https://www.debugpoint.com/ubuntu-22-04-review/
[5]: https://www.debugpoint.com/ubuntu-22-10/
[6]: https://www.debugpoint.com/fedora-37/
[7]: https://www.debugpoint.com/linux-mint-21-review/
[8]: https://www.debugpoint.com/wp-content/uploads/2022/10/Install-Python-3.11-in-Ubuntu-22.04-LTS.jpg
[9]: https://www.debugpoint.com/wp-content/uploads/2022/10/Setting-up-default-python-version-to-3.11.jpg

View File

@ -1,108 +0,0 @@
[#]: subject: "How to Upgrade Python Packages with Pip"
[#]: via: "https://itsfoss.com/upgrade-pip-packages/"
[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Upgrade Python Packages with Pip
======
When was the last that you updated Python packages installed via Pip? Most of the users tend to forget that those packages also need to be updated, as just updating the system repository is not going to work here.
So lets take a moment and see how to update old Python packages with Pip.
### How to use pip to upgrade Python packages
[Pip (Pip Installs Packages)][1] is a command line utility to manage python packages. You can think of this as how we use apt to manage packages in Ubuntu and Debian.
So lets dive deep into how you can use this fab utility to manage everything related to Python packages.
#### 1. List outdated packages
Listing the outdated packages is the best idea to plan how you want to update packages as not many want to update their entire library of packages at once and wants to be selective.
To list outdated packages of Python, you just have to pair `pip` command with `list` option and `--outdated` flag as shown:
```
pip list --outdated
```
![outdated packages][2]
#### 2. Upgrade a specific package
Once you get the list of the packages that need to be updated, you can be selective as I mentioned earlier, and to update a specific package, youll need to follow the given command syntax:
```
pip install package_name -U
```
For example, I want to upgrade the package named `anime-api` to the most recent version, so Ill be using the given command:
```
pip install anime-api -U
```
![update anime api][3]
#### 3. Upgrade package to specific version
It is not necessary to use only the most recent version of the software (cough [Debian][4] cough) and if you are in need of using packages to a specific version that may or may not be the most recent software, can be done using the given command syntax:
```
pip install --upgrade <package>==<version>
```
So I want to update the package named `xdg` to version 5.1 which is one point release behind the most recent build so my command would be:
```
pip install --upgrade xdg==5.1
```
![upgrade xdg to specific iteration][5]
#### 4. Upgrade every package using Pip
**NOTE: I do not recommend upgrading every package at once as most of the time, the dependencies are too complex to be handled.**
To upgrade every python package, youd need to follow the given command:
```
pip3 list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U
```
![upgrade everything][6]
The above command utilizes [xargs][7]. First, it will grab the packages that are needed to be updated and then perform `pip3 install -U` command over each package.
And I used pip3 here instead of pip. In Ubuntu 22.04 and later, both pip and pip3 commands are available.
### Wrapping Up
Upgrading everything at once has never been a good idea in the case of pip. And I found myself in a state of broken dependencies so make sure you know what you will have.
And if you have any queries, feel free to ask in the comments.
--------------------------------------------------------------------------------
via: https://itsfoss.com/upgrade-pip-packages/
作者:[Sagar Sharma][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/sagar/
[b]: https://github.com/lkxed
[1]: https://itsfoss.com/install-pip-ubuntu/
[2]: https://itsfoss.com/wp-content/uploads/2022/09/outdated-packages.png
[3]: https://itsfoss.com/wp-content/uploads/2022/09/update-anime-api.png
[4]: https://www.debian.org/
[5]: https://itsfoss.com/wp-content/uploads/2022/09/upgrade-xdg-to-specific-iteration.png
[6]: https://itsfoss.com/wp-content/uploads/2022/09/upgrade-everything.png
[7]: https://linuxhandbook.com/xargs-command/

View File

@ -1,247 +0,0 @@
[#]: subject: "Customize GNOME 40 Desktop to Look Like macOS [Guide]"
[#]: via: "https://www.debugpoint.com/gnome-40-macos-look-1/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Customize GNOME 40 Desktop to Look Like macOS [Guide]
======
**A quick guide for you to help you customizing the GNOME 40 desktop to look like macOS.**
Ever since the GNOME 40 desktop was released, I was wondering whether it is even possible to make this desktop look like macOS. It seems we can do it as close as possible to look like macOS. Heres how.
Theres always debate that why people are so fascinated to make Linux Desktop look like macOS? If you want MacOS, then get a Mac. Well, keeping that debate aside, I ran some experiments to see whether the GNOME 40 and associated extension ecosystem evolved enough to make it look like macOS.
The power of any Linux desktop is customization. And among the popular desktops such as KDE, GNOME, Deepin, Budgie only KDE Plasma comes with built-in tools to customize it to anything you want. On the other hand, GNOMEs vanilla install doesnt give you those options out-of-the-box. Hence to get the desired result, you need to depend on many extensions and tweaks.
As GNOME 40 fundamentally changes the behavior of the desktop, the developers already ported their extensions to work on GNOME 40. And the majority of them working very well as of today.
So, in this guide, we are going to use a bunch of extensions for GNOME 40 and the final desktop should look like this.
![GNOME 40 Desktop Configuration - MacOS][1]
GNOME 40 Desktop Configuration MacOS
![GNOME 40 Customization - MacOS - Workspace View][2]
GNOME 40 Customization MacOS Workspace View
### Steps to Customize GNOME 40 Desktop to Look Like macOS
#### Setup Extensions and Tools
As this guide requires the installation of GNOME extensions, you need to set up your system as per the Linux distribution. You can read our guide here on installing and using GNOME Extensions; Or, follow the quick guide below.
Open a terminal and install the following.
**Ubuntu**
```
sudo apt install chrome-gnome-shell
```
**Fedora**
```
sudo dnf install chrome-gnome-shell
```
You have to install an add-on based on your preferred browser. Install them using the below links:
- [Chrome, Chromium, Google Chrome, Vivaldi][3]
- [Firefox][4]
- [Opera][5]
Install the GNOME Tweak tool using the below command.
**Ubuntu**
```
sudo apt install gnome-tweak-tool
```
**Fedora**
```
sudo dnf install gnome-tweak-tool
```
Install the [new Extensions Flatpak app][6] to manage extensions in GNOME 40 desktop. Go to Software and search for Extensions to install.
#### Theme, Icon, and Cursor
##### Download
I have used the WhiteSur Shell Theme, BigSur Icon Theme, McMojave Cursors, and macOS BS Theme for Cairo Dock for this guide.
Download the following packages and extract them. Open each of the below links and go to the Files section. Then download the light versions of the packages. If you want the dark theme, you can download the dark version as well. I have used the light theme for this guide.
- [WhiteSur Shell Theme][7]
- [BigSur Icon Theme][8]
- [McMojave Cursors][9]
- [macOS BS Theme for Cairo Dock][10]
After you download, extract them. Then create two directories named .icons and .themes under your home directory. Then copy the corresponding folders to .icons and .themes directories. The cursor theme goes to the .icons directory. Do not extract or copy the theme for the Cairo dock.
#### Install Extensions and configuration
##### Changes in Tweak Tool
Open the GNOME Tweak Tool and make the following changes to apply the themes that you downloaded above.
- On the Window Titlebars tab, turn on Maximize and Minimize and make the placement as Left.
- If you want to change the Font, you can. I kept the default Cantarell Regular font.
- On the Appearance tab change the Themes as below.
![tweak settings for theme][11]
tweak settings for theme
##### Download and configure extensions
We need a bunch of extensions for the desired looks. Heres a list of the extensions compatible at the moment with GNOME 40. Install all of them using the below links. After installation, do the following configuration using the Extensions app.
[Better OSD GNOME 40][12] : Changes the OSD location in the desktop.
- Change the horizontal and vertical position of the OSD as per your need so that it becomes like this on the right-top of the desktop. This depends on the resolution of your screen.
![GNOME 40 OSD][13]
GNOME 40 OSD
[Notification Banner Position][14]: Move the default notifications from the center to any section you want. Only enable this extension, no change in settings is required.
![Notification][15]
Notification
[Dynamic Panel Transparency][16]: Make your top panel transparent in GNOME 40 desktop.
- Change the maximized opacity to 27% and unmaximized to 19% in the settings of this extension.
[Frippery Move Clock][17]: Move the center clock to the right side of the panel. Only enable this extenstion. No setting change is required.
[User Themes][18]: Ability to apply GNOME Shell theme.
- Apply the WhiteSur-light Shell theme.
![apply WhiteSur-light user theme][19]
apply WhiteSur-light user theme
[Blur My Shell][20]: Blurs the workspace and activtiy view and login screen.
- On the settings, only turn on the blue for Dash and Overview and disable for Panel and others. Because this may conflict with the Transparent panel extension above.
#### Dock Configuration
There are many Docks available that are compatible with the GNOME desktop. For this guide, I have used the [Cairo Dock][21]with many customization options. Install it using the following command.
**Ubuntu**
```
sudo apt install cairo-dock
```
**Fedora**
```
sudo dnf install cairo-dock
```
Download the Cairo dock theme for MacOS from the below link.
[Cairo Dock theme for macOS look-a-like][10]
After installation of the Cairo Dock, open the GNOME Tweak Tool and add Cairo dock as a startup application.
From the application menu, launch Cairo Dock. And do the following settings.
- Import the above theme from **Themes** Tab and **Apply** it. Browse to the downloaded tar file and apply.
- On the Configuration > Appearance Tab Choose **Icons as BigSur** and **Size=Big**.
- On the Configuration > Behaviour Tab change the settings as per the below image.
![Cairo Dock Config - Behaviour][22]
Cairo Dock Config Behaviour
- Change the **Addon Tab** applets which appear on the Dock as per your need.
- On the **Current Items** Tab, under the Bottom Dock, rearrange and remove anything you want. You can right-click on the items and remove them.
- Add a **custom Launcher** to launch the Application list of GNOME from Right Click on Dock > Add > Custom Launcher.
- On the Current Items Tab, under the Bottom Dock, modify the custom launcher and give a name. For example, for this guide I have given the name “Finder” and Command as below which would bring up the GNOME Application list.
![Cairo Dock custom launcher][23]
Cairo Dock custom launcher
```
dbus-send --session --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval string:'Main.shellDBusService.ShowApplications();'
```
After these configuration, your dock should look like below.
![Cairo Dock Animation][24]
Cairo Dock Animation
#### Additional Configuration
Time for a nice wallpaper. There are a bunch of wallpapers available for Mac in the below link. Grab one and apply.
[download cool wallpapers][25]
If you fancy some more customization, then you can opt for below.
- For Wobbly windows animation when you drag, download, and apply [Compiz alike windows effect.][26]
- Install [Albert Launcher][27] for your desktop which is like KDE KRunner.
### Closing Notes
I hope this guide gives you a starting point for your GNOME 40 desktop customization. There are hundreds of themes, icons, and extensions available compatible with the new desktop workflow. You can create your own desktop look as you wish.
Do let me know in the comments below, whether it helped you; Also let us know about some cool extensions, themes for everyone.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/gnome-40-macos-look-1/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/wp-content/uploads/2021/05/GNOME-40-Desktop-Configuration-MacOS.jpg
[2]: https://www.debugpoint.com/wp-content/uploads/2021/05/GNOME-40-Customization-MacOS-Workspace-View.jpg
[3]: https://chrome.google.com/webstore/detail/gnome-shell-integration/gphhapmejobijbbhgpjhcjognlahblep
[4]: https://addons.mozilla.org/en/firefox/addon/gnome-shell-integration/
[5]: https://addons.opera.com/en/extensions/details/gnome-shell-integration/
[6]: https://flathub.org/apps/details/org.gnome.Extensions
[7]: https://www.pling.com/p/1403328
[8]: https://www.pling.com/p/1399044
[9]: https://www.pling.com/p/1355701
[10]: https://www.pling.com/p/1401527
[11]: https://www.debugpoint.com/wp-content/uploads/2021/05/tweak-settings-for-theme.jpg
[12]: https://extensions.gnome.org/extension/4231/better-osd-gnome-40/
[13]: https://www.debugpoint.com/wp-content/uploads/2021/05/GNOME-40-OSD.jpg
[14]: https://extensions.gnome.org/extension/4105/notification-banner-position/
[15]: https://www.debugpoint.com/wp-content/uploads/2021/05/Notification.jpg
[16]: https://extensions.gnome.org/extension/1011/dynamic-panel-transparency/
[17]: https://extensions.gnome.org/extension/2/move-clock/
[18]: https://extensions.gnome.org/extension/19/user-themes/
[19]: https://www.debugpoint.com/wp-content/uploads/2021/05/apply-WhiteSur-light-user-theme.jpg
[20]: https://extensions.gnome.org/extension/3193/blur-my-shell/
[21]: http://glx-dock.org/
[22]: https://www.debugpoint.com/wp-content/uploads/2021/05/Cairo-Dock-Config-Behaviour.jpg
[23]: https://www.debugpoint.com/wp-content/uploads/2021/05/Cairo-Dock-custom-launcher.jpg
[24]: https://www.debugpoint.com/wp-content/uploads/2021/05/Cairo-Dock-Animation.gif
[25]: https://www.pling.com/p/1399346%E2%80%8B
[26]: https://extensions.gnome.org/extension/2950/compiz-alike-windows-effect/
[27]: https://albertlauncher.github.io/installing/

View File

@ -1,142 +0,0 @@
[#]: subject: "Customize GNOME 42 with A Polished Look"
[#]: via: "https://www.debugpoint.com/customize-gnome-42-look-1/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Customize GNOME 42 with A Polished Look
======
**A tutorial on how you can give your favourite GNOME desktop a polished look, in 5 minutes.**
There are many ways you can customize your favourite GNOME desktop with icons, themes, cursors and wallpapers. This article shows you how to give the GNOME 42 desktop a more polished look. The GNOME 42 desktop environment is available with the recently released Ubuntu 22.04 LTS and Fedora 36.
Before you read further, heres how it looks with a side by side comparison (before and after).
![GNOME before customisation][1]
![GNOME after customisation][2]
I am going to divide this tutorial into two sections.
The first section deals with setting up and installing required packages. And second, how to apply various settings to get your desired look.
This tutorial was mainly tested on Ubuntu 22.04 LTS. However, it should work in other variants of Ubuntu and Fedora.
### Customize GNOME 42 with a Polished Look
#### Setup
- First, enable your system for Flatpak because we need to install the Extension Manager to download some required GNOME Shell extensions for this tutorial.
- So, to do that, open up a terminal and run the following commands.
```
sudo apt install flatpak gnome-software-plugin-flatpakflatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
```
- Reboot the computer once done.
- Then run the following command from the terminal to install the Extensions Manager app to download GNOME Shell Extensions.
```
flatpak install flathub com.mattjakeman.ExtensionManager
```
- Open the Extension Manager application and install two extensions. The first one is **Floating Dock** which features a super cool dock which you can move around anywhere on your desktop. Second, install the **User themes** extensions to help you install the external GTK themes in your Ubuntu Linux.
![User Themes Extension][3]
User Themes Extension
![Floating Dock Extension][4]
Floating Dock Extension
- Secondly, install the [Materia Theme][5] using the below commands. You have to build it as it doesnt have any executable. Run the following commands in sequence in Ubuntu to install.
```
git clone https://github.com/ckissane/materia-theme-transparent.gitcd materia-theme-transparentmeson _buildmeson install -C _build
```
- Additionally, download the [Kora Icon theme][6] from the below link. After downloading, extract the files and copy the below four folders to `/home/<user name>/.icons` path. Create the .icons folder if it is not present.
[Download Kora Icon Theme][7]
![Kora Icon Theme][8]
Kora Icon Theme
- Besides the above changes, download the awesome Bibata cursor theme from the below link. After download, extract and copy the folders to the same `/home/<user name>/.icons` folder.
[Download Bibata Cursor Theme][9]
- In addition to the above, if you want a nice font which goes with the above themes, [download Robot font][10] from Google Fonts and copy them to `/home/<user name>/.fonts` folder.
- Finally, restart your system once again.
#### Configuration
- Open the Extension Manager, enable the Floating Dock and User Themes, and disable the Ubuntu Dock.
![Changes to Extensions][11]
Changes to Extensions
- In addition, open the Floating dock settings and make the following changes.
![Floating Dock Settings][12]
Floating Dock Settings
- Cursor: Bibata-Original-Ice
- Shell Theme: Materia
- Icon: Kora
- Furthermore, open the [GNOME Tweak Tool][13], and go to the Appearance tab. Set the followings.
- Other than that, you may also want to change the font. To do that, go to the Fonts tab and change the document and interface to Robot 10pt.
- Alternatively, you can also change the accent colour and style from Settings which comes by default with Ubuntu 22.04.
- Finally, download a nice wallpaper as per your preference. For this tutorial, I have downloaded a sample wallpaper from [here][14].
- If all goes well, you should have a nice desktop, as shown below.
![Customize GNOME 42 - Final Look][15]
Customize GNOME 42 Final Look
Enjoy a polished GNOME 42. Cheers.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/customize-gnome-42-look-1/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://i2.wp.com/www.debugpoint.com/wp-content/uploads/2022/05/GNOME-before-customisation.jpg?ssl=1
[2]: https://i0.wp.com/www.debugpoint.com/wp-content/uploads/2022/05/GNOME-after-customisation.jpg?ssl=1
[3]: https://www.debugpoint.com/wp-content/uploads/2022/05/User-Themes-Extension2.jpg
[4]: https://www.debugpoint.com/wp-content/uploads/2022/05/Floating-Doc-Extension.jpg
[5]: https://github.com/ckissane/materia-theme-transparent
[6]: https://github.com/bikass/kora/
[7]: https://github.com/bikass/kora/archive/refs/heads/master.zip
[8]: https://www.debugpoint.com/wp-content/uploads/2022/05/Kora-Icon-Theme.jpg
[9]: https://www.pling.com/p/1197198/
[10]: https://fonts.google.com/specimen/Roboto
[11]: https://www.debugpoint.com/wp-content/uploads/2022/05/Changes-to-Extensions.jpg
[12]: https://www.debugpoint.com/wp-content/uploads/2022/05/Floating-Dock-Settings.jpg
[13]: https://www.debugpoint.com/2018/05/customize-your-ubuntu-desktop-using-gnome-tweak/
[14]: https://www.pexels.com/photo/colorful-blurred-image-6985048/
[15]: https://www.debugpoint.com/wp-content/uploads/2022/05/Customize-GNOME-42-Final-Look.jpg

View File

@ -1,167 +0,0 @@
[#]: subject: "Customize GNOME in Ubuntu 20.04 with this Productive Look"
[#]: via: "https://www.debugpoint.com/customize-gnome-ubuntu-2020/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Customize GNOME in Ubuntu 20.04 with this Productive Look
======
**In one of the early [guides][1], I explained the overall look and feel of the GNOME desktop. How you can visually change the look from a mundane desktop to something nice and better. This guide explains some steps which give you an idea of how you can Customize GNOME in Ubuntu 20.04 with a productive look.**
Thanks to extensions, the GNOME desktop can be transformed to anything from visual and overall productivity. GNOME extensions are very powerful if you know which one to use and what customizations to apply.
There are hundreds of extensions on the official GNOME extension website. That means you can customize GNOME in many ways. The following steps are merely a guide to show you how you can customize Ubuntu 20.04 with GNOME With a productive look.
### Customize GNOME in Ubuntu
A default Ubuntu installation with GNOME desktop look like this without much configuration. This guide helps you to changes this look.
![Before Customization - GNOME][2]
Before Customization GNOME
#### Prerequisite
Make sure GNOME Extension is enabled in your browser. If you dont know how to [check this guide][3]. Or, just visit the official GNOME Extension page [here][4]. You can get a popup message at the top saying the steps (see below). Follow the instructions to enable GNOME extensions for your browser.
![GNOME Extensions Page][5]
GNOME Extensions Page
I hope you have the admin password of the Ubuntu 20.04 installation where you are trying this out.
And, install the [GNOME Tweak Tool][6]. You can use Ubuntu Software to install Or, run below from the terminal.
```
sudo apt-get install gnome-tweaks
```
#### Install Extensions
Open the [GNOME Extension website][4].
Then, install all the below extensions. Open the link and click on the “OFF” button to enable and install respective extensions.
- [Dash to panel][7]
- [Tray icons][8]
- [Open Weather][9]
- [User Themes][10]
- [Arc menu][11]
#### Configure the extensions
##### Dash to Panel
Once you install, the Dash by default moves to the bottom of the screen. Right click on the panel at the bottom and open Dash to Panel Settings. Change below settings.
![Dash to Panel Settings][12]
Dash to Panel Settings
**On the Position Tab**
- Disable the Show Applications Button
- Move the Date menu after System menu
- Change Desktop button width to 15px.
- Turn on the override panel theme background opacity. Give value to 50%.
**On the style tab**
- Change the running indicator style to dots.
##### Tray icons
- No need to change any settings.
##### Open Weather
- Change the display, City and the temperature unit if you like.
##### User Themes
- No need to change any settings.
##### Arc Menu
- Open Arc Menu Settings
**General Tab**
- Choose Display Arc menu on Dash to panel.
- Choose Hot Key for Arc menu to Left Super key.
**Menu Layout Tab**
- Choose Modern menu layout to Redmond Menu Style
![Arc Menu Settings][13]
Arc Menu Settings
**Menu Theme**
- Choose override menu theme. Keep the theme as default, or, you can change as you wish.
**Button Appearance**
- Change the icon to anyone. I have selected the Ubuntu icon.
- Change Icon size to 40px.
At this stage, the menu and panel should look like this.
![Panel and Menu][14]
Panel and Menu
Almost done, couple of additional settings are required now.
- Open the GNOME Tweak tool and go to the Appearance tab. Choose Shell theme to Yaru Dark.
- Open Settings and change the Appearance to Dark.
- Then change the desktop wallpaper to a nice wallpaper.
If all goes well, you should have a nice productive yet beautiful looking desktop with you. The Arc Menu itself is a big productivity booster.
### Final desktop
![GNOME Desktop After customization - Ubuntu][15]
GNOME Desktop After customization Ubuntu
So, thats it with the steps. This is merely a guide. You can play around with the settings in hundreds of ways to make the GNOME desktop best suitable for you.
Wallpaper Photo by **[Ethan Wu][16]** from **[Pexels][17]**
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/customize-gnome-ubuntu-2020/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/2020/05/customize-gnome-in-ubuntu-20-04-with-a-new-look/
[2]: https://www.debugpoint.com/wp-content/uploads/2020/11/Before-Customization-GNOME--1024x576.jpg
[3]: https://www.debugpoint.com/2018/05/how-to-install-and-use-gnome-shell-extensions-in-ubuntu/
[4]: https://extensions.gnome.org/
[5]: https://www.debugpoint.com/wp-content/uploads/2020/11/GNOME-Extensions-Page.jpg
[6]: https://www.debugpoint.com/2018/05/customize-your-ubuntu-desktop-using-gnome-tweak/
[7]: https://extensions.gnome.org/extension/1160/dash-to-panel/
[8]: https://extensions.gnome.org/extension/1503/tray-icons/
[9]: https://extensions.gnome.org/extension/750/openweather/
[10]: https://extensions.gnome.org/extension/19/user-themes/
[11]: https://extensions.gnome.org/extension/1228/arc-menu/
[12]: https://www.debugpoint.com/wp-content/uploads/2020/11/Dash-to-Panel-Settings.jpg
[13]: https://www.debugpoint.com/wp-content/uploads/2020/11/Arc-Menu-Settings.jpg
[14]: https://www.debugpoint.com/wp-content/uploads/2020/11/Panel-and-Menu.jpg
[15]: https://www.debugpoint.com/wp-content/uploads/2020/11/GNOME-Desktop-After-customization-Ubuntu-1024x576.jpg
[16]: https://www.pexels.com/@ethanwu?utm_content=attributionCopyText&utm_medium=referral&utm_source=pexels
[17]: https://www.pexels.com/photo/closeup-photo-of-water-dew-on-glass-1425298/?utm_content=attributionCopyText&utm_medium=referral&utm_source=pexels

View File

@ -1,174 +0,0 @@
[#]: subject: "How to Install PostgreSQL 15 on Ubuntu 22.04 Step-by-Step"
[#]: via: "https://www.linuxtechi.com/how-to-install-postgresql-on-ubuntu/"
[#]: author: "Narendra K https://www.linuxtechi.com/author/narendra/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Install PostgreSQL 15 on Ubuntu 22.04 Step-by-Step
======
In this article, we will explain how to install PostgreSQL 15 database server on Ubuntu 22.04 (Jammy Jellyfish).
PostgreSQL is a powerful, open-source object-relational Database Management System (DBMS). Its been battle-tested for over 35 years which has earned it a strong reputation for reliability and performance. This feature-rich database is used by many tech giants, such as Apple, IMDB, Instagram, and so on.
PostgreSQL supports large number of the SQL standard and is constructed to be extensible by users in many aspects. Some of the salient features include ACID transactions, foreign keys, subqueries, triggers, user-defined types, functions, etc.
##### Prerequisites
Before installing the PostgreSQL server, we must ensure that the system meets the following installation requirements:
- Pre-Installed Ubuntu 22.04
- A regular user with sudo rights
- An active internet connection
- At least 2 GB of RAM with an additional 512 MB of disk space. Please note that this is a minimal requirement for the demo environment. The actual hardware configuration will vary with data volume.
Without any further delay, lets deep dive into PostgreSQL 15 installation steps,
### 1) Enable PostgreSQL Package Repository
PostgreSQL 15 package is not available in the default package repository, so enable its official package repository using following commands.
```
$ sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
$ wget -qO- https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo tee /etc/apt/trusted.gpg.d/pgdg.asc &>/dev/null
```
To begin, lets fetch the latest versions of the packages. We can achieve this using the apt update command as shown below:
```
$ sudo apt update
```
The above command will take a few seconds to complete.
### 2) Install PostgreSQL 15 Database Server and Client
The postgresql package installs the default version of the PostgreSQL database server whereas the postgresql-client package installs the client utility.
Lets install the PostgreSQL client and server using the below apt command:
```
$ sudo apt install postgresql postgresql-client -y
```
Next, lets verify that the PostgreSQL service is up and running:
```
$ sudo systemctl status postgresql
```
Finally, check the PostgreSQL version using the psql command line utility:
```
$ psql --version
```
Here, we can see that the version of PostgreSQL is 15.
### 3) Update PostgreSQL Admin User Password
By default, we can connect to the PostgreSQL server without using any password. Lets see this in action using the psql utility:
```
$ sudo -u postgres psql
postgres=#
```
In the above output, the postgres=#  prompt indicated the active connection with the PostgreSQL server.
In this example, we have used the postgres user. This is an admin user of PostgreSQL and it gets created during the installation process.
Allowing administrative access to the database without any password isnt a good idea. So, lets set the password for the postgres user:
```
postgres=# ALTER USER postgres PASSWORD 'demoPassword';
```
The above SQL query sets the user password to demoPassword. Please note that, we have used a very simple password because this is a demo environment. However, the same is not recommended in the production environment.
Lets verify that the password has been set successfully. So first, terminate the current session with the server using the \q command.
```
postgres=# \q
```
Output of above commands,
Now, lets connect to the database server again:
```
$ psql -h localhost -U postgres
```
Lets enter the demoPassword string as a password and now we are connected to the database.
### 4) Configure PostgreSQL to Allow Remote Connections
By default, PostgreSQL accepts connections from the localhost only. However, we can easily modify the configuration to allow connection from remote clients.
PostgreSQL reads its configuration from the postgresql.conf file which is located in the /etc/postgresql/<version>/main/ directory. Here, the version indicates the major version of PostgreSQL.
For example, in our case the full path of the file is /etc/postgresql/15/main/postgresql.conf.
Now, open the postgresql.conf file in a text editor, uncomment the line that starts with the listen_addresses, and replace localhost with *.
This setting is located under the CONNECTIONS AND AUTHENTICATION section. After modification the file will look like this:
Save and close the file.
Next, edit the IPv4 local connections section of the pg_hba.conf file to allow IPv4 connections from all clients. Please note that this file is also located in /etc/postgresql/15/main/ directory.
```
$ sudo vi /etc/postgresql/15/main/pg_hba.conf
```
After modification the file will look like this:
In the above configuration indicates to allow connection from the network 192.168.1.0/24
In case, Ubuntu firewall is running on your system then allow PostgreSQL 5432 port using following command,
```
$ sudo ufw allow 5432/tcp
```
##### Verifying Remote Connection
Finally, restart the service and verify its up and running:
```
$ sudo systemctl restart postgresql
$ sudo systemctl status postgresql
```
Now, lets try to access DB from remote client.
```
$ psql -h 192.168.1.192 -U postgres
```
In this example, 192.168.1.192 is the IP address of the PostgreSQL database server.
Here we can see that we are able to access DB from the remote client.
Thats all from this article.Please do post your queries and feedback in the below comments section.
Read Also: [How to Set Static IP Address on Ubuntu Server 22.04][1]
--------------------------------------------------------------------------------
via: https://www.linuxtechi.com/how-to-install-postgresql-on-ubuntu/
作者:[Narendra K][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.linuxtechi.com/author/narendra/
[b]: https://github.com/lkxed
[1]: https://www.linuxtechi.com/static-ip-address-on-ubuntu-server/

View File

@ -1,190 +0,0 @@
[#]: subject: "Install WoeUSB on Ubuntu to Create a Bootable Windows USB"
[#]: via: "https://itsfoss.com/install-woeusb-ubuntu/"
[#]: author: "Sreenath https://itsfoss.com/author/sreenath/"
[#]: collector: "lkxed"
[#]: translator: "robsean"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Install WoeUSB on Ubuntu to Create a Bootable Windows USB
======
Want to create a bootable Windows USB on Linux? Ventoy is a pretty good option.
But before Ventoy, WoeUSB used to be the go-to tool for this purpose. The original WoeUSB project got discontinued around 2014.
Owing to its popularity, a new developer took the task of bringing the project back from the dead. And hence WoeUSB-ng was born. “ng” here stands for “new generation”. In other words, [WoeUSB-ng][1] is the new generation WoeUSB. But since the original tool doesnt exist anymore, Ill be referring WoeUSB-ng as WoeUSB.
In this tutorial, Ill show you how to install WoeUSB on Ubuntu Linux. Ill also share the steps for creating bootable Windows USBs with WoeUSB.
But before that, lets quickly look at the features of this awesome tool.
### WoeUSB
![install woeusb ubuntu][2]
WoeUSB is a simple tool that has the sole purpose of [creating bootable Windows USB on Linux][3].
The original WoeUSB is a shell script. This same WoeUSB is rewritten as WoeUSB-ng in python, which can be installed on your system and provides both a command-line and GUI interface.
**Features:**
- Support Legacy PC/UEFI booting
- Support FAT32 and NTFS filesystems
- Support using physical installation disc or disk image as source
- It can be used for Windows Vista and later with any language or edition variants
- Legacy/MBR-style/IBM PC compatible boot mode
- Native UEFI booting is supported for Windows 7 and later images (limited to the FAT filesystem as the target)
### Installing WoeUSB on Ubuntu and other Linux distros
Arch Linux users can install WoeUSB-ng from AUR.
For other distros, WoeUSB can be installed using PIP. Its a Python application, after all. I am going to provide commands for Ubuntu/Debian here.
To install WoeUSB-ng, you need to [install PIP][4] and other necessary dependencies first.
```
sudo apt install git p7zip-full python3-pip python3-wxgtk4.0 grub2-common grub-pc-bin
```
After this, you can install WoeUSB-ng by running:
```
sudo pip3 install WoeUSB-ng
```
For all other installations, you can refer to their [instructions][5].
[WoeUSB-ng][1]
### Prerequisite: Get Windows ISO and a compatible USB
This one goes without saying. You need to have the ISO file of the Windows version you want to install.
From the Microsoft website, you should be able to get the ISO for Windows 10 and 11.
[Download Windows][6]
If you have ISOs for older Windows versions, they can also be used.
Apart from that, you need to have a USB key/pen drive of at least 8 GB in size. You should format it in NTFS filesystem.
### Method 1: Using WoeUSB to create a bootable Windows USB graphically (recommended)
Open woeusb-gui from the activity overview or menu.
![woeusb in ubuntu activities overview][7]
In the application window, select the downloaded Windows ISO and the desired USB drive as shown in the screenshot and press **Install**.
![woeusb gui setup][8]
There are also other tweaks available within the app, which can be accessed by the top menu bar.
After pressing install, the woeUSB will start formatting and copying files. You need to wait for some time because there are approximately 6 GB of files to be copied.
![woeusb writing windows iso to the usb drive][9]
Once copying completes, WoeUSB will prompt a success dialog. You can now safely eject the USB and use it as a bootable USB.
![woeusb completed writing and gives a success message][10]
### Method 2: Using WoeUSB from the terminal (for experts)
WoeUSB-ng package also provides a command-line utility called woeusb.
To create the bootable Windows USB using WoeUSb, you need to run the following command:
```
sudo woeusb --device <path/to/Windows/ISO> <name/of/the/USB/device> --target-filesystem ntfs
```
Here, the `--device` flag is used to wipe the USB and create a bootable from scratch completely. Also, the target-filesystem flag is set to NTFS, to avoid problems of copying files more than the size limits of the FAT system.
![woeusb commandline][11]
The process will take some time to complete copying. Once completed, it will display a success message.
![woeusb commandline success message][12]
At this point, you can eject the USB safely and use it as a Windows bootable USB on other PCs.
### Bonus: Using WoeUSB Bash shell script (for experts)
WoeUSB is also available as a bash shell script, which can be used without installing anything on your system.
First, you want to download the shell script from the [releases page of the project][13].
Before [executing the shell file][14], you need to get the required dependencies. To install, run:
```
sudo apt install wimtools
```
Now make it executable either through file manager or through command-line.
![make woeusb script executable][15]
Or you can run `chmod +x <path/to/script>` to make it executable. Now, run`./woeusb-5.2.4.bash -h` inside the downloaded directory to get help.
In order to create a live USB, the process is same as the command-line part of woeusb-ng, except, you are not installing anything.
So, in a terminal, run:
```
sudo <path/to/downloaded/script/file> --device <path/to/windows/ISO> <name-of-USB-device> --target-filesystem ntfs
```
This will start writing the ISO to USB drive, as shown in the screenshot below:
![woeusb bash script running without installation][16]
Once completed, you can safely eject the USB and use it as bootable USB.
### Removing WoeUSB
If you installed WoeUSB using PIP, you can also remove it similarly:
```
pip3 uninstall WoeUSB-ng
```
You can keep the installed dependencies on your system or remove them. Thats entirely up to you. I would suggest keeping them.
### Wrapping Up
WoeUSB was an immensely popular tool around ten years ago. Its good that it has been continued in another form by someone else. Thats the beauty of open source.
I hope this tutorial helped you. If somehow the Windows USB created by WoeUSB doesnt work as expected, you may [try using Ventoy][3]. Enjoy it.
--------------------------------------------------------------------------------
via: https://itsfoss.com/install-woeusb-ubuntu/
作者:[Sreenath][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/sreenath/
[b]: https://github.com/lkxed
[1]: https://github.com/WoeUSB/WoeUSB-ng
[2]: https://itsfoss.com/wp-content/uploads/2022/10/install-woeusb-ubuntu.png
[3]: https://itsfoss.com/bootable-windows-usb-linux/
[4]: https://itsfoss.com/install-pip-ubuntu/
[5]: https://github.com/WoeUSB/WoeUSB-ng#installation
[6]: https://www.microsoft.com/en-in/software-download/
[7]: https://itsfoss.com/wp-content/uploads/2022/10/woeusb-in-ubuntu-activities-overview.png
[8]: https://itsfoss.com/wp-content/uploads/2022/10/woeusb-gui-setup.png
[9]: https://itsfoss.com/wp-content/uploads/2022/10/woeusb-writing-windows-iso-to-the-usb-drive.png
[10]: https://itsfoss.com/wp-content/uploads/2022/10/woeusb-completed-writing-and-gives-a-success-message.png
[11]: https://itsfoss.com/wp-content/uploads/2022/10/woeusb-commandline.png
[12]: https://itsfoss.com/wp-content/uploads/2022/10/woeusb-commandline-success-message.png
[13]: https://github.com/WoeUSB/WoeUSB/releases/tag/v5.2.4
[14]: https://itsfoss.com/run-shell-script-linux/
[15]: https://itsfoss.com/wp-content/uploads/2022/10/make-woeusb-script-executable.png
[16]: https://itsfoss.com/wp-content/uploads/2022/10/woeusb-bash-script-running-without-installation.png

View File

@ -2,7 +2,7 @@
[#]: via: "https://opensource.com/article/22/11/transfer-files-folders-windows-linux-winscp"
[#]: author: "Paul https://opensource.com/users/plaubscher"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: translator: "robsean"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "

View File

@ -1,84 +0,0 @@
[#]: subject: "Move Virtual Machine Image to Another Host Using GNOME Boxes"
[#]: via: "https://www.debugpoint.com/move-virtual-machine-image-another-host/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Move Virtual Machine Image to Another Host Using GNOME Boxes
======
**This guide explains the steps you need to move a Virtual Machine Image to Another Host Using GNOME Boxes.**
GNOME Boxes is a virtualization utility created by the GNOME project. This utility works as a front end for libvirt. libvirt is an open-source API, daemon, and management tool for managing platform virtualization. It supports different virtualization technologies such as KVM, Xen, VMware ESXi, QEMU, etc.
If you want to create virtual machines using GNOME Boxes, [refer to this guide.][1]
In this tutorial, I will explain how you can move any Virtual Machine image file (which is already created and running using GNOME Boxes) to a different host and run it.
This way, you do not need to re-install the virtual machine from the operating system anymore. Moreover, it is portable and you can carry your virtual machine image in a USB stick.
### How to Move Virtual Machine Image to Another Host Using GNOME Boxes
I hope you have already had a virtual machine created in GNOME Boxes; if not, check out [this guide][1].
- GNOME Boxes and [libvert][2] uses below directories for the virtual machine images and configurations. You need to take backups of each, as mentioned below, carefully.
- GNOME Boxes keeps the virtual machines physical image (usually in the size of GB) in the below path. For each of your virtual machines, you will find an image there.
```
~/.local/share/gnome-boxes/images/
```
![Machine Images][3]
- Copy the image file to your new hosts path: `~/.local/share/gnome-boxes/images/`
- Copy the libvirt configuration XML from the below path to your new hosts same location.
```
~/.config/libvirt/qemu/
```
![Image XML][4]
- In the above path, you should see separate xml files for each of your virtual machines. Copy the one you need.
- Open the below file in your current system.
```
~/.config/gnome-boxes/sources/'QEMU Session'
```
- Copy the section (from “[display” … to end of this section) which belongs to your virtual machine. You can easily find it using the name (see below last seen name).
![QEMU Session File][5]
- Open the same above file in the other host machine and append the copied content at the end. Save the file.
- Close all applications, including GNOME Boxes, in the new host machine.
Open GNOME Boxes now, and you should see your virtual machine moved with its contents in your new host.
You can now have a portable virtual machine that can easily carry and move around. Remember, the target machine should have GNOME Boxes installed to make this work.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/move-virtual-machine-image-another-host/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/2020/05/install-use-gnome-boxes/
[2]: https://libvirt.org/
[3]: https://www.debugpoint.com/wp-content/uploads/2020/06/Machine-Images.png
[4]: https://www.debugpoint.com/wp-content/uploads/2020/06/Image-XML.png
[5]: https://www.debugpoint.com/wp-content/uploads/2020/06/QEMU-Session-File.png

View File

@ -0,0 +1,255 @@
[#]: subject: "Top 10 32-Bit Linux Distributions in 2022 [Compared]"
[#]: via: "https://www.debugpoint.com/32-bit-linux-distributions/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Top 10 32-Bit Linux Distributions in 2022 [Compared]
======
**We list the best 32-bit Linux distributions that still support ancient systems.**
### What is happening with 32-bit Linux Distros?
Linux always supports older hardware, thanks to the community. But more and more Linux operating systems are dropping support for 32-bit systems mainly because it takes additional testing effort to keep another build apart from 64-bit, and the number of 32-bit systems is reducing daily.
Most of the older hardware manufactured before 2007 has 32-bit architecture-based CPUs, which we mostly know as i386, i586, i486 and x86. However, the hardware manufactured after 2007 are primarily 64-bit and may term as modern.
Recently, many famous and lightweight Linux distros dropped support for 32-bit architecture. But some projects are still strong and provide users with an option to run the older machines with full functionality.
I will list the ten best Linux distros that still support 32-bit systems.
### Top 10 32-bit Linux distros in 2022
#### 1. Debian
Debian Linux is the foundation of hundreds of Linux distributions across multiple architectures. Millions use it as a desktop and server operating system. Debian is a “universal operating system” because it supports x86-64, arm64, armel,armhf, i386, mips, mipsel, mips64el, ppc64el, s390x architectures with work in progress for riscv64.
In addition, it supports a wide range of hardware and includes free and non-free packages. On the desktop side, all the major [desktop environments][1] are available for you to install on your older hardware.
Perhaps, it is the safest choice if you are looking for a vanilla 32-bit Linux distro experience.
![Debian Logo][2]
#### Why is Debian the best 32-bit distro?
- Most popular and widely used
- Dependable and used by millions
- Well documentation, tutorials and user guides
- Proper framed future roadmap
- [Support for all architectures and platforms][3]
[Download Debian][4]
#### 2. MX Linux
MX Linux is a systemd-free distro based on Debian stable branch. It is recently trending among users who want a clean system that supports older to modern hardware.
MX Linux is popular because its carefully created to give you a perfect and stable system with its native applications and tools.
![MX Linux][5]
The team behind it gives a lot of thought while packaging the applications in this distro. Besides that, it is also based on antiX components and comes with KDE Plasma desktop, Xfce and Fluxbox.
MX Linux is probably the best choice in this list because it is easy to download and use in older systems.
![mx linux logo][6]
#### Why is MX Linux the best?
- Systemd free, hence faster
- Based on Debian stable, it gives a more stable system
- Unique in-house applications to help users with generic tasks
- 3 desktop flavour options to choose from
- Well-supported community and user-base
[Download MX Linux][7]
#### 3. Q4OS
The third 32-bit Linux distro in this list is Q4OS. Q4OS is a unique Linux operating system based on Debian and brings KDE and Trinity desktop environments. It comes with a 32-bit installer which can be used to install. In addition, Q4OS also features a Windows installer where you can parallel run this distro inside WIndows.
An exciting and related trivia about Q4OS is that it was created as an alternative to Windows XP when Microsoft discontinued it on 2014. And its still going strong and providing a stable 32-bit alternative to many users.
![Q4OS Logo][8]
#### Here are some of the critical advantages of Q4OS
- Well-defined roadmap and unlikely to be discontinued
- Based on Debian and long-term support has been available for more than five years
- Provides KDE and Trinity desktop both (for those who like KDE 3)
- The unique installer gives the ability to install it inside Windows and take advantage of the entire hardware (not like in VM)
- Themes, Software centre, and third-party app installers are available
[Download Q4OS][9]
#### 4. NixOS
The fourth Linux distro in this list of 32-bit distributions is NixOS, built on top of the Nix Package manager. This independent Linux distribution is perfect for DevOps and deployment pipeline tasks and supports atomic updates. It uses a configuration script for several tasks, including installation.
That said, NixOS is not for the beginner or average Linux users, although it functions like other Linux distributions. Its not designed to be an end-user Linux operating system.
However, since it provides a 32-bit variant, its perfect for some use cases where you need to set up a remote server or pipeline in older hardware. You can learn more and download using the below link.
[Download NixOS][10]
#### 5. Void Linux
Void Linux is an independent Linux distro (not depending on Debian or Fedora, etc.) which follows a unique rolling release model. It comes with X Binary Package System (XBPS), which helps you to install apps and packages directly from sources. In addition, it uses runit as init system, instead of systemd. 
Void Linux provides a 32-bit installer with the latest packages alongside the usual 64-bit and ARM installation methods. Hence, you can quickly try it out on your older hardware. Moreover, Void Linux also support all major desktop environments, such as Xfce, Cinnamon, LXDE, LXQt and more.
![Void Linux Logo][11]
#### Here are some of the advantages of Void Linux
- Independent distribution and free from Debian, Ubuntu or Fedora base
- Well-defined path for future updates and continuity
- Excellent XBPS package management system
- A rolling release-based distro which is stable
- All major desktop environments supported
[Download Void Linux][12]
#### 6. Zorin OS Lite 15.3
Zorin OS is an excellent and popular Linux distribution, a fusion of Xfce and GNOME 3 desktop. It comes with a Pro and Lite version. The Zorin OS Lite version provides a 32-bit installer at the moment.
![Zorin OS - Best Linux Distributions of 2022][13]
But there is a catch. Currently, the Zorin OS 15.3 Lite version only supports the 32-bit version. And its support ends on April 2023.
After that, Zorin OS will not be supporting the 32-bit version anymore. The reason is it is based on Ubuntu LTS. And Ubuntu discontinued the 32-bit image from Ubuntu 20.04 LTS Focal Fossa version.
Hence, you can use Zorin OS 15.3 Lite until April 2023 and take advantage of its beautiful desktop and additional features.
[Download Zorin OS 15.3 Lite (32 bit)][14]
#### 7. Porteus
If you are a fan of the Old-KDE desktop and looking for a 32-bit operating system, then you can try Porteus Linux. Porteus is a Slackware Linux spin that features a KDE 4.0+ desktop environment. It is based on bleeding edge Slackware Linux and provides a fast desktop experience. Moreover, it can run from a Live USB/CD. The installer size is 300 MB, perfect for CD-based older hardware.
![Porteus Logo][15]
#### The reason why Porteus can be an ideal 32-bit Linux OS
- Based on bleeding-edge Slackware Linux
- Enjoy the simplicity of Slackware
- Installer size can fit into a CD (300 MB only)
- Legacy KDE 4.0 Desktop support
- Can run off a USB or CD
[Download Porteus Linux][16]
#### 8. antiX
The antiX Linux is slightly different on the desktop level than other 32-bit distros in this list. It is a lightweight Linux distribution based on Debian stable branch and brings some exciting features. First and foremost, it comes with a 32-bit installer, which has four variants Full, Core, Base and Net. Secondly, it features famous primarily Windows Managers and Not desktop environments. Hence it is faster.
The antiX Linux features IceWM, Fluxbox, and ROX desktop options. In addition, it is free of systemd and uses sysVinit & runit as init system.
A perfect 32-bit Linux distribution that brings window manager, sydtemd-free and Debian base.
![Antix Logo][17]
#### Why is antiX an excellent 32-bit distro?
- Provides stability with Debian stable branch
- Provides a 32-bit installer with four variants
- Systemd free distribution 
- Window manager support, rather than desktops
[Download antiX][18]
#### 9. BunsenLabs Linux
Remember the famous Crunchbang project? The BunsenLabs Linux is a successor of the Crunchbang project based on the Debian stable branch. Like antiX, it also features Windows Manager rather than desktop environments. It brings Openbox Window manager with an excellent tint2 panel at its core. In addition, some goodies such as Conky presets, jgmenu makes it a well-designed 32-bit distro for that ancient hardware.
![BunsenLabs Logo][19]
#### Why is BunsenLabs the best?
- Powered by Debian stable branch
- Openbox Window manager is for the desktop experience
- Pre-configured Concky with tint2 panel, jgmenu
- A good amount of help and support is available
[Download BunsenLabs][20]
#### 10. Alpine Linux
A list of 32-bit Linux distributions is incomplete without Alpine Linux. Alpine Linux is an almost two-decade-old Linux distro created for developers and power users. Its unique and provides a 32-bit variant among other architectures.
At its core, it uses musl and BusyBox instead of GNU tools and packages. Also, Alpine uses OpenRC as init system.
This independent Linux is perfect for containers and hypervisors and boasts about its security. Perhaps, not so suitable for usual desktop usage. However, the popular PostmarketOS mobile Linux OS platform is based on Alpine Linux.
![Alpine Logo][21]
#### Alpine Linux advantages
- Independent Linux distro
- Not based on GNU toolchain (uses musl and BusyBox)
- APK package manager
- Suitable for containers and Hypervisors
- Well secured at the core level
[Download AlpineLinux][22]
### List of significant distros that dropped support of 32-bit recently
Since you went thru the above list, its always to remember that a bunch of distros which depended on Ubuntu dropped their 32-bit support. From the version Ubuntu 20.04 Focal Fossa, Ubuntu officially closed the support for 32-bit. Hence all the Ubuntu-LTS variants are also forced to follow this decision.
Heres a brief list of awesome distros which unfortunately discontinued the 32-bit support in the recent past.
- Linux Mint 20 and above
- Puppy Linux 9.5 and above
- Ubuntu 20.04 LTS Focal Fossa and above
- All the official Ubuntu flavours (such as Lubuntu and Xubuntu) from 20.04 onwards
### Closing Notes
You can rest assured that there will always be support for 32-bit Linux distributions to support older hardware. If a day comes when all distro stops support, Debian will always support all hardware possible. Thats the beauty of Debian.
Also, other niche distros, such as Puppy and Void Linux will continue to support 32-bit hardware in the coming days. Because they are built with this purpose only.
Finally, I hope this list helps you to pick the best 32-bit distro for your PC or hardware. Also, dont forget to check out the [best lightweight distros][23] for older hardware which contain 64-bit distros for older hardware.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/32-bit-linux-distributions/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/category/desktop-environment
[2]: https://www.debugpoint.com/wp-content/uploads/2022/07/512_debian.png
[3]: https://www.debugpoint.com/install-debian-buster/
[4]: https://www.debian.org/distrib/
[5]: https://www.debugpoint.com/wp-content/uploads/2022/05/MX-Linux.jpg
[6]: https://www.debugpoint.com/wp-content/uploads/2022/07/mx-linux-logo-2.png
[7]: https://mxlinux.org/download-links/
[8]: https://www.debugpoint.com/wp-content/uploads/2022/07/512_q4os_lightblue.png
[9]: https://www.q4os.org/downloads1.html
[10]: https://nixos.org/
[11]: https://www.debugpoint.com/wp-content/uploads/2022/07/512_void.png
[12]: https://voidlinux.org/download/
[13]: https://www.debugpoint.com/wp-content/uploads/2022/05/Zorin-OS.jpg
[14]: https://zorin.com/os/download/15/lite/32/
[15]: https://www.debugpoint.com/wp-content/uploads/2022/07/Porteus-Logo.png
[16]: http://www.porteus.org/
[17]: https://www.debugpoint.com/wp-content/uploads/2022/07/512_antix.png
[18]: https://antixlinux.com/download/
[19]: https://www.debugpoint.com/wp-content/uploads/2022/07/512_bunsenlabs_yellow_black.png
[20]: https://www.bunsenlabs.org/installation.html
[21]: https://www.debugpoint.com/wp-content/uploads/2022/07/512_alpine.png
[22]: https://alpinelinux.org/downloads/
[23]: https://www.debugpoint.com/lightweight-linux-distributions-2022/

View File

@ -0,0 +1,160 @@
[#]: subject: "How to Install and Use Snap Packages in Ubuntu"
[#]: via: "https://www.debugpoint.com/how-to-install-and-use-snap-packages-in-ubuntu/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Install and Use Snap Packages in Ubuntu
======
**A tutorial on how to find, install and maintain snap packages in Ubuntu.**
Snappy (in short, Snap) packages are transactional packages developed by Canonical for Ubuntu for its line of solution offerings. Due to its transactional nature, snap packages can be used in across Linux Distributions. Snap packages are handy due to their atomic update in nature for critical industrial use cases such as IoT.
The packages can be found and installed via the command line, primarily from a web store called [Snapcraft][1]. The snap packages can also be downloaded from this store as .snap files, containing all the dependencies needed inside the .snap package.
The installed snap software is installed in their respective folders and doesnt interfere with the rest of the system. That means if you have installed software via typical `apt-get install xyz` and installed the same software by installing`xyz.snap`, then both versions of the same software can co-exist on your PC without interfering with each other.
In contrast, [Flatpak][2] also has a similar concept and offers much more robust offerings, mainly for GUI-driven apps.
This article will show you how to perform basic operations with snap via the command line.
### How to install and manage Snap packages in Ubuntu
#### 1. Find a Snap Package
To find a snap package, run the below command. It will give you a list of all available snap packages, their version and description.
```
snap find
```
![snap find][3]
You can give the name as an argument to find a specific snap package.
```
snap find name_of_package
```
![snap find name][4]
#### 2. Install a Snap Package from Command Line
To install a snap package, run the below command with the snap package name.
```
sudo snap install name-of-the-package
```
![snap install][5]
The command will install the package with all of its dependencies in your system. In addition, you can also see the progress of your installation.
After installation, you can launch the application directly from the application menu.
#### 3. Updating Snap Package
You can update an installed snap package by using the below command:
```
sudo snap refresh name-of-the-package
```
![snap refresh][6]
#### 4. List your installed snaps
To list down all the snap packages installed in your system, use the below command;
```
snap list
```
![snap list][7]
#### 5. Removing (or uninstalling) a snap package
To remove a snap package from your system, run the below command:
```
sudo snap remove name-of-the-package
```
![snap remove][8]
#### 6. View Snap Activity
To view the recent changes done using snap in your system, run the below command. This will give the installed/updated activity list in those snap packages with the date and time stamps.
```
snap changes
```
![snap changes][9]
#### 7. Handling Snap Errors
There are some errors you may encounter while installing/maintaining snap packages. E.g. while downloading a snap package via command `snap install`, if you press `CTRL+C` for abort, then you may get the below error while trying for the second time and so on. This is so bad that you cant even install any other snap packages.
```
error: can't install "notes": snap "ubuntu-core" has changes in progress.
```
![snap err][10]
Ideally, when you do the same when installing via the apt install command, apt will take care when you run it for the second time.
**To solve this error, follow these steps:**
- Run the below command to find out the ID of the error installation.
```
snap changes
```
![snap changes abort][11]
- As you can see, ID=7 is the installation which I aborted. Now, run the below command with the ID.
```
sudo snap abort 7
```
![snap abort][12]
- This will abort the pending change that still has a pending task. Now you can continue installing the same package or a different package.
### Closing Notes
In this article, you learned some fundamental commands for managing snap packages in the Ubuntu system via the terminal. This should get you started for now. Also, for more common tasks such as install and remove you can visit snapcraft.io and use install methods there. Further documentation about snap is available in the [official reference][13].
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/how-to-install-and-use-snap-packages-in-ubuntu/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://snapcraft.io/
[2]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/
[3]: https://www.debugpoint.com/wp-content/uploads/2016/07/snap-find.png
[4]: https://www.debugpoint.com/wp-content/uploads/2016/07/snap-find-name.png
[5]: https://www.debugpoint.com/wp-content/uploads/2016/07/snap-install.png
[6]: https://www.debugpoint.com/wp-content/uploads/2016/07/snap-refresh.png
[7]: https://www.debugpoint.com/wp-content/uploads/2016/07/snap-list.png
[8]: https://www.debugpoint.com/wp-content/uploads/2016/07/snap-remove.png
[9]: https://www.debugpoint.com/wp-content/uploads/2016/07/snap-changes.png
[10]: https://www.debugpoint.com/wp-content/uploads/2016/07/snap-err.png
[11]: https://www.debugpoint.com/wp-content/uploads/2016/07/snap-changes-abort.png
[12]: https://www.debugpoint.com/wp-content/uploads/2016/07/snap-abort.png
[13]: https://snapcraft.io/docs

View File

@ -0,0 +1,537 @@
[#]: subject: "How To Securely Transfer Files With SCP In Linux"
[#]: via: "https://ostechnix.com/securely-transfer-files-with-scp-in-linux/"
[#]: author: "sk https://ostechnix.com/author/sk/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How To Securely Transfer Files With SCP In Linux
======
File transfer over a network can be done in various ways and using different protocols. The most commonly used protocols for **copying files remotely** are **Rsync**, **SCP** and **SFTP**. In this guide, we will look at **what is SCP** and how to **securely transfer files between local and remote computers with SCP** in Linux and Unix-like operating systems.
### What is SCP?
SCP, stands for **Secure Copy**, is a command line program to copy files and directories between a local and a remote system or between two remote systems in a secure way in Linux and Unix-like operating systems.
Using `scp` command, you can securely copy a file or a directory,
- from your local system to a remote system,
- from a remote system to your local system,
- between remote systems from your local system.
When transferring data with the scp command, the files and directories are both encrypted. So even if your network is compromised, the perpetrators can't get any meaningful data.
SCP is a component of the openSSH program and it uses the SSH protocol to securely transfer files. OpenSSH comes pre-installed with almost all modern Linux and Unix distributions, so don't bother installing it.
#### A word of caution:
According to the **official announcement** from the openSSH developers,
> The **scp protocol is outdated**, inflexible and not readily fixed. We recommend the use of more modern protocols like sftp and rsync for file transfer instead.
>
> Link - [https://lists.mindrot.org/pipermail/openssh-unix-dev/2019-March/037672.html][1]
However, the majority of the users still prefer SCP over other protocols. Because, SCP handles remote-to-remote file transfers more efficiently than its counterparts such as SFTP and Rsync.
And also, SCP works exactly like `cp` command, while `rsync` changes its behavior based on whether the source directory has a **trailing slash** or not. Take a look at the following commands:
- `rsync source destination/` - would copy the source into the destination folder.
- `rsync source/ destination/` - would copy the contents of the source folder into the destination folder.
So you must always double check if you've put the trailing slash in the path.
I personally use **[Rsync][2]** for copying large size files between two hosts and SCP for copying single files over a network.
### SCP Command Syntax
The general syntax for SCP command is given below:
```
scp [-346ABCpqrTv] [-c cipher] [-F ssh_config] [-i identity_file] [-J destination] [-l limit] [-o ssh_option] [-P port] [-S program] source ... target
```
Depending upon the file transfer path, the syntax will differ. Here I have included some example syntax format.
Copy a file from your local system to a remote system:
```
scp <options> SourceFile User@RemoteHost:RemotePath
```
Similarly, to copy a directory from your local system to a remote system, use `-r` flag:
```
scp -r SourceDirectory User@RemoteHost:RemotePath
```
Copy multiple files to a remote system:
```
scp <options> SourceFile1 SourceFile2 User@RemoteHost:RemotePath
```
Copy a file from remote system to your local system:
```
scp <options> User@RemoteHost:RemoteFilePath DestinationFile
```
Copy a directory from remote system to local system:
```
scp -r User@RemoteHost:RemoteDirectoryPath DestinationDirectory
```
Copy a file from one remote system to another remote system from your local system:
```
scp <options> User@RemoteHost1:RemoteFile1 User@RemoteHost2:RemotePath
```
Please note that when you copy files between two remote systems, the traffic will not pass through the local system. The operation takes place directly between two remote systems. You can, however, pass the traffic from the system on which you run scp command using `-3` option.
Copy a directory from one remote system to another remote system from your local system:
```
scp -r User@RemoteHost1:RemoteDirectory User@RemoteHost2:DestinationPath
```
### SCP Command Options
The most commonly used options of SCP command are:
- **`-C`** : Enable compression. Here, C stands for Compression. When you use this option, the data transfer speed will be faster, because the data is compressed. SCP will automatically enable the compression at the source system and decompression at the destination system.
- **`-c <cipher>`** : c stands for cipher. By default, SCP uses **'AES-128'** encryption method for encrypting data. You can change the encryption method using `-c` option.
- **`-i <identity_file>`** : i stands for Identity file or Private key. As you already know, there are password-based and key-based authentication used in SSH. If you want to use key-based authentication while transferring files, you can use the -i option to specify the Identity file or Private key.
- **`-l limit`** : l stands for limit bandwidth. Using this option, you can set the maximum bandwidth used for transferring data. The limit should be specified in **`Kbit/s`**.
- **`-F <ssh_config>`** : Some times, you may need to use different networks to connect to your Linux systems. Or you may be behind a proxy server. In such situations, you can use different `ssh_config` file using `-F` option.
- **`-P port`** - P stands for Port. Please note that it is uppercase P. By default, SSH uses port number 22. You might have changed the port number in the destination host for security reasons. In that case, you should explicitly mention the new port number using `-P` option.
- **`-p`** : if you want to preserve modification times, access times, and modes from the original file, you need to use -p option while copying files. Please note that it is lowercase p.
- **`-r`** : Recursively copy entire directories.
- **`-B`** : B stands for batch mode. It is used for selecting batch mode while transferring files. It prevents asking for passwords or passphrases.
- **`-S program`** : Name of the program to use for the encrypted connection.
- **`-v`** : v stands for verbose. When using the `-v` option, the command will print the progress in your Terminal screen. So, you will see the what exactly is going on when the files are being transferred. It is useful in debugging connection, authentication, and configuration problems.
SCP has so many options. You can check the man pages of SCP command to learn about other options. Let us see some **useful scp command examples**.
### Important Notes to Remember before You Begin
- The `scp` command relies on `ssh` for secure file transfer. So you must have either a **ssh key** or **password** to authenticate to the remote systems.
- To be able to transfer files, you must have **read permission on the source files** and **write permission on the destination** location.
- The `scp` command will not check the destination location before writing. Any files in the destination with the same name will be **overwritten without notification**.
- To be able to distinguish between local and remote locations, use a **colon** (**`:`**).
- When transferring large files, it is recommended to start the task inside a **[Screen][3]** or **[Tmux][4]** session.
### Transfer Files With SCP in Linux
As I already mentioned, we can use `scp` command to copy a file or a directory from a local system to a remote system and vice versa and copy files and folders between one remote computer to another remote computer.
#### 1 Copy Files with SCP from Local System to Remote System
To copy a file from a local system to a remote system using `scp` command, run:
```
$ scp File1.txt ostechnix@192.168.1.40:/home/ostechnix/
```
**Sample Output:**
```
ostechnix@192.168.1.40's password:
File1.txt 100% 104 814.0KB/s 00:00
```
Let us break down the above command and see what each option does.
- `**File1.txt**` - The source file to be copied to the destination.
- `**ostechnix**` - The username of the remote system.
- `**192.168.1.40**` - The IP address of the remote system.
- `**/home/ostechnix/**` - The destination directory in the remote system. This is the absolute path where we want to transfer the source file i.e. `File.txt`.
You can also copy the file and rename it as well. The following command transfers the **`File1.txt`** to the destination and saves the file with different name **`myfile.txt`**.
```
$ scp File1.txt ostechnix@192.168.1.40:/home/ostechnix/myfile.txt
```
![Copy Files From Local System To Remote System][5]
Copy Files from Local System to Remote System
#### 2. Copy Multiple Files with SCP from Local System to Remote System
To transfer multiple files from a local system to a remote system with `scp` command, run:
```
$ scp File1.txt File2.txt ostechnix@192.168.1.40:/home/ostechnix/
```
**Sample Output:**
```
ostechnix@192.168.1.40's password:
File1.txt 100% 104 689.4KB/s 00:00
File2.txt 100% 496 6.3MB/s 00:00
```
![Copy Multiple Files from Local System to Remote System][6]
Copy Multiple Files from Local System to Remote System
Here,
- `**File1.txt**` and **`File2.txt`** - The name of the sources that will be copied to the specified destination.
- `**ostechnix@192.168.1.40**` - The username and IP address of the remote system.
- `**/home/ostechnix**` - The destination path where we want to put the copied files.
If the files have same extension, you can use the following alternative commands to achieve the same goal.
```
$ scp {File1,File2}.txt ostechnix@192.168.1.40:/home/ostechnix/
```
Or,
```
$ scp *.txt ostechnix@192.168.1.40:/home/ostechnix/
```
#### 3. Recursively Copy Directories with SCP from Local System to Remote System
To recursively copy an entire directory including the sub-directories and its contents from your local system to a remote system, use **`-r`** flag like below.
```
$ scp -r Documents/ ostechnix@192.168.1.40:/home/ostechnix/
```
![Copy a Directory from Local System to Remote System][7]
Copy a Directory from Local System to Remote System
The above command will copy the entire directory **'`Documents`'** including its contents to the destination system.
Here,
- **`-r`** : Copy files and directories recursively including the sub-directories and its contents.
- **`Documents`** : The name of the source directory that we want to copy to the destination.
- `**ostechnix@192.168.1.40**` : The username and IP address of the remote system.
- `**/home/ostechnix**` : The destination path where we want to put the copied directory.
#### 4. Transfer Files with SCP from Remote System to Local System
Remember we copied `FIle1.txt` to the remote system from our local system. Let us copy it back to the local system.
To copy a file from a remote system to your local system with `scp`, run:
```
$ scp ostechnix@192.168.1.40:/home/ostechnix/File1.txt Downloads/
```
Here,
- `**ostechnix@192.168.1.40**` : The username and IP address of the remote system.
- **`/home/ostechnix/File.txt`** : The absolute path of file that we want to copy to the local system.
- **`Downloads`** - The location where to save the copied file.
![Transfer Files from Remote System to Local System][8]
Transfer Files from Remote System to Local System
#### 5. Transfer Multiple Files using SCP from Remote System to Local System
To copy multiple files from a remote system to your local system, mention the absolute path of the files that you want to copy **within the curly braces** as shown below.
```
$ scp ostechnix@192.168.1.40:/home/ostechnix/\{File1.txt,File2.txt\} Downloads/
```
![Transfer Multiple Files from Remote System to Local System][9]
Transfer Multiple Files from Remote System to Local System
The above command will copy the `File1.txt` and `File2.txt` from the `/home/ostechnix/` directory of the remote system to the `Downloads` directory of the local system.
Please note that there is **no spaces after the commas within the curly braces**.
#### 6. Recursively Copy Directories from Remote System to Local System
To copy an entire directory including the sub-directories and its contents recursively from a remote computer to your local system using `scp`, use **`-r`** flag.
```
$ scp -r ostechnix@192.168.1.40:/home/ostechnix/Documents Downloads/
```
The above command will copy the entire **`Documents`** from the remote system to the **`Downloads`** directory in your local system.
#### 7. Copy Files using SCP between Two Remote Computers
To copy files directly from one remote system to another remote system with `scp`, run:
```
$ scp senthil@192.168.1.40:/home/senthil/File1.txt kumar@192.168.1.20:/home/kumar/
```
You will be asked to enter the password of the both remote systems.
Here,
- **`senthil@192.168.1.40`** - The username and IP address of the remote system from the file is currently located.
- **`/home/senthil/File1.txt`** - The name the file1 that is being copied and its location.
- `**kumar@192.168.1.20**` - The username and IP address of the remote system where we want to copy the file.
- **`/home/kumar`** - The location where to save the copied file on the remote system.
The above command will copy the `/home/senthil/File1.txt` from the remote host `192.168.1.40` to `/home/kumar/` directory on the remote host `192.168.1.20`.
In this method, the data will be transferred directly from one remote system to another remote system. If you want to route the traffic through the machine on which the command is run, use `**-3**` flag like below.
```
$ scp -3 senthil@192.168.1.40:/home/senthil/File1.txt kumar@192.168.1.20:/home/kumar/
```
#### 8. Enable Compression while Copying Files with SCP
So far we have transferred files without compressing them. Now we will enable compression while transferring files using **`-C`** flag.
```
$ scp -C File1.txt ostechnix@192.168.1.40:/home/ostechnix/
```
The `-C` flag will enable compression of data at the source and automatically decompress the data at destination side.
By enabling compression, you can increase the file copy or transfer speed significantly.
#### 9. Limit Bandwidth while Transferring Files using SCP
We can limit the bandwidth while copying files with SCP using `-l` flag. Please note that the maximum bandwidth is specified in Kbits/s. 1 byte=8 bits. So if you want to limit bandwidth to 200 KB/s, the value for `-l` would be **1600** (200*8).
```
$ scp -l 1600 File1.txt ostechnix@192.168.1.40:/home/ostechnix/
```
This is useful when transferring large files to prevent SCP from throttling the bandwidth.
#### 10. Use Different Port while Copying Files using SCP
As a system admin, you might **[have changed the default port of your SSH protocol][10]** on the remote servers for security reasons. In such cases, you can specify the port number with `-P` flag when transferring files. Please note that this is **uppercase P**.
```
$ scp -P 2022 File1.txt ostechnix@192.168.1.40:/home/ostechnix/
```
#### 11. Use Different Cipher while Copying Files with SCP
By default, SCP uses **'`AES-128`'** for encrypting files. If you want to use different cipher, use **`-c`** flag followed by the cipher name.
For example, if you want to use **'`3des-cbc`'** cipher, the command would be like below:
```
$ scp -c 3des-cbc File1.txt ostechnix@192.168.1.40:/home/ostechnix/
```
To view the list of supported ciphers, run:
```
$ ssh -Q cipher localhost | paste -d, -s -
```
**Sample Output:**
```
3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com
```
#### 12. Copying Files with SCP in Verbose Mode
if you want to know what's going on behind the scenes while copying files with scp, you can use `**-v**` flag. When transferring files with SCP in Verbose mode, the step by step process of the SCP command execution will be displayed in the terminal. This comes in handy when troubleshooting times.
```
$ scp -v File1.txt ostechnix@192.168.1.40:/home/ostechnix/
```
You will see a whole lot of output when sending files in Verbose mode as shown in the following output.
![Copying Files with SCP in Verbose Mode][11]
Copying Files with SCP in Verbose Mode
#### 13. Transferring Files with SCP in Quiet Mode
We can transfer files in quiet mode with **`-q`** flag. When sharing files in quiet mode, it will not show the copy progress, warning or diagnostic message in the output.
```
$ scp -q File1.txt ostechnix@192.168.1.40:/home/ostechnix/
```
#### 14. Preserve File Attributes when Transferring Files with SCP
To preserve file attributes such as file modification times, access times, and modes when copying files with SCP, use **`-p`** flag. Please note that this is **lowercase p**.
```
$ scp -p File1.txt ostechnix@192.168.1.40:/home/ostechnix/
```
#### 15. Use Identity File when Copying Files with SCP
SSH supports both password-based and key-based authentication. Key-based authentication is most widely used authentication method in Linux environments.
If you want to use key-based authentication while transferring files, use the **`-i`** option to specify the Identity file or Private key.
```
$ scp -i my_private_key.pem File1.txt ostechnix@192.168.1.40:/home/ostechnix/
```
#### 16. Use Different ssh_config File when Transferring Files with SCP
There are situations where you need to use different networks to connect to your Linux systems. Or you may be behind a proxy server. In such situations, you can use different `ssh_config` file using `**-F**` option.
```
$ scp -F /home/ostechnix/my_ssh_config File1.txt ostechnix@192.168.1.40:/home/ostechnix/
```
#### 17. Copy files with SCP using IPv4 or IPv6
We can force SCP to only use IPv4 or IPv6 addresses when copying files. This can be achieved by adding **`-4`** for IPv4 networks and **`-6`** for IPv6 networks.
```
$ scp -6 File1.txt ostechnix@192.168.1.40:/home/ostechnix/
```
### Frequently Asked Questions
#### Question 1: What is SCP?
**Answer:** SCP is a command line program to securely transfer files and directories from a local system to a remote system and vice versa, or between two remote systems directly.
#### Question 2: How to copy a file from the local computer to remote computer using SCP?
To copy a file from your local system to a remote system, the command would be:
```
scp SourceFile.txt User@RemoteHost:/some/remote/directory
```
#### Question 3: How to copy recursively copy files and directories?
To recursively copy a directory including the sub-directories, use `-r` flag.
```
scp -r /some/local/directory User@RemoteHost:/some/remote/directory
```
#### Question 4: Can I transfer multiple files using SCP?
Yes, you can. Just mention the source file names with space separated.
Copy multiple files from local to remote:
```
scp file1.txt file2.txt file3.txt User@RemoteHost:/some/remote/directory
scp {file1,file2,file3}.txt User@RemoteHost:/some/remote/directory
scp *.txt User@RemoteHost:/some/remote/directory
```
Copy multiple files from remote to local:
```
scp User@RemoteHost:/some/remote/directory/\{file1.txt,file2.txt,file3.txt\} /some/local/directory
```
Copy multiple files from remote to remote:
```
$ scp User@RemoteHost1:/some/remote/directory/\{file1.txt,file2.txt,file3.txt\} User@RemoteHost2:/some/remote/directory/
```
#### Question 5: How to transfer all files in a directory?
To transfer all files in a directory, switch to that directory:
```
cd dir_name
```
```
scp *.txt User@RemoteHost:/some/remote/directory
```
#### Question 6: Can I compress files?
Yes, you can. Use **`-C`** to compress files. The files are compressed at source and decompress at destination automatically.
```
scp -C /some/large/file User@RemoteHost:/some/remote/directory
```
#### Question 7: Can I preserve file attributes?
To preserve file attributes such as modification times, access times, and modes from the original file, use `-p` flag.
```
scp -p file.txt User@RemoteHost:/some/remote/directory
```
#### Question 8: Can I use different port?
Yes. SCP allows you to use different port with `-P` flag.
```
scp -P 2022 file.txt User@RemoteHost:/some/remote/directory
```
#### Question 9: Can I use different cipher?
Yes, you can. Use -c flag to use different cipher.
```
scp -c 3des-cbc User@RemoteHost:/some/remote/directory
```
#### Question 10: How do I list the supported ciphers by SSH?
To view the list of supported ciphers by SSH and SCP, use the following command
```
ssh -Q cipher localhost | paste -d, -s -
```
#### Question 11: Is SCP really secure?
Yes, it is completely secure to use. SCP uses the same SSH mechanism used by openSSH. The data in transit is encrypted at the source side and decrypted at destination.
#### Question 12: Can I transfer files from a Windows system to a Linux system?
Yes, you can. Use either **PSCP** program to transfer files from windows platform to Linux platform. You can also use **WinSCP**.
### Conclusion
In this comprehensive guide, we learned what is SCP, and how to **securely transfer files with SCP** in Linux. We provided **17 SCP command examples**. We also looked at the commonly asked questions about SCP.
Whether you're a Linux Admin, or a Developer or a Regular user, you will have to copy files to and from a remote system at some point. Knowing how to **use SCP to securely copy files** will be definitely useful.
--------------------------------------------------------------------------------
via: https://ostechnix.com/securely-transfer-files-with-scp-in-linux/
作者:[sk][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://ostechnix.com/author/sk/
[b]: https://github.com/lkxed
[1]: https://lists.mindrot.org/pipermail/openssh-unix-dev/2019-March/037672.html
[2]: https://ostechnix.com/linux-rsync-command-examples-for-beginners/
[3]: https://ostechnix.com/screen-command-examples-to-manage-multiple-terminal-sessions/
[4]: https://ostechnix.com/tmux-command-examples-to-manage-multiple-terminal-sessions/
[5]: https://ostechnix.com/wp-content/uploads/2022/11/Copy-Files-from-Local-System-to-Remote-System.png
[6]: https://ostechnix.com/wp-content/uploads/2022/11/Copy-Multiple-Files-from-Local-System-to-Remote-System.png
[7]: https://ostechnix.com/wp-content/uploads/2022/11/Copy-Directory-from-Local-System-to-Remote-System.png
[8]: https://ostechnix.com/wp-content/uploads/2022/11/Transfer-Files-from-Remote-System-to-Local-System.png
[9]: https://ostechnix.com/wp-content/uploads/2022/11/Transfer-Multiple-Files-from-Remote-System-to-Local-System.png
[10]: https://ostechnix.com/how-to-change-apache-ftp-and-ssh-default-port-to-a-custom-port-part-3/
[11]: https://ostechnix.com/wp-content/uploads/2022/11/Copying-Files-with-SCP-in-Verbose-Mode.png

View File

@ -0,0 +1,112 @@
[#]: subject: "How to Make LibreOffice Look Like Microsoft Office"
[#]: via: "https://www.debugpoint.com/libreoffice-like-microsoft-office/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Make LibreOffice Look Like Microsoft Office
======
**We attempted to make the LibreOffice suite look like Microsoft Office. Is it possible? Lets find out.**
[LibreOffice][1] is a free and open-source office productivity suite that provides you with a complete collection of applications. It consists of a Word processor (Writer), a spreadsheet program (Calc), Presentation (Impress), and a drawing program (Draw). It also gives you a stand-alone database system LibreOffice Base while LibreOffice Math is a program that helps students and researchers write formulas and equations.
While the widely used [Microsoft Office][2] is a paid office productivity suite that gives you excellent programs to perform almost all tasks related to study, office, and enterprise usage.
Adopting LibreOffice is sometimes difficult compared to Microsoft Office although most of the menu items and tools are the same. Both programs are different, but their objective is the same in terms of functionality. Due to its popularity, Microsoft office is used widely and is well-known to users. However, many users prefer the free LibreOffice for their work and activities.
That said, if you can make LibreOffice look like Microsoft Office, it is much easier for first-time users to adopt mostly coming from a Microsoft Office background. The look and feel play a big part in users minds, including their muscle memory, familiarity with colours, and menu items.
Of course, you can not make it exactly like Microsoft Office because of the different icons, fonts, etc. However, you can make it look up to a certain amount.
### Make LibreOffice Look Like Microsoft Office
#### 1. User Interface changes
LibreOffice has a “Ribbon” style toolbar called Tabbed Bar. However, it has many toolbar options (see below). For this guide, I have used the Tabbed bar option.
- Open LibreOffice and go to `Menu > View > User Interface`.
- Select `Tabbed` from the UI Section.
![tabbed bar option][3]
- Click on Apply to All.
- LibreOffice also provides an option to apply the toolbar type-specific to Writer or Calc. If you want a different toolbar type, you can choose that way. But I would recommend using the Apply to All to make it consistent.
- Now you should have the Microsoft Office-style Ribbon. Although they are not precisely the same, you get the feel of it.
#### 2. Microsoft Office Icons for LibreOffice
The Icons in the toolbar play a big part in your workflow. LibreOffice provides some nice icons for your toolbar. The best ones are the
- Karasa Jaga
- Colibre
- Elementary
For this guide, we will use Office 2013 icon set, which an author develops. It is available in Devian Art.
- Go to the below link and download the LibreOffice extension file (*.oxt). For the newer versions of LibreOffice, you need to use extension files to install icon sets.
[download office 2013 icon sets for libreoffice][4]
- After downloading, double-click the .oxt file to open. Or, press CTRL+ALT+E to open the Extension Manager and select the downloaded .oxt file using the Add button. Close the window once done.
![Import icon sets in Extension Manager][5]
- Now go to `Tools > Options > View`. From the Icon style, choose Office 2013.
- Change the icon size via `Icon Size > Notebookbar > Large`. If you feel the icons are small, you can change them. However, I think to make it more Office-like, the large settings work better.
![Change icons in Options][6]
And thats it. Your LibreOffice installation should look like this.
![Making LibreOffice look like Microsoft Office in KDE Plasma][7]
![Making LibreOffice look like Microsoft Office in Windows 10][8]
![Making LibreOffice look like Microsoft Office in GNOME][9]
Remember, the looks may be different if you are using Ubuntu, KDE Plasma, or any Linux distribution. But I think it looks closer to Microsoft Office in KDE Plasma than GNOME. LibreOffice doesnt look good in GTK-based systems at the moment.
In Windows, however, it looks better because it uses a system font and colour palette.
These are some settings that you can use. However, you can play around with more customizations, icons, and themes as you wish. If you fancy dark mode in LibreOffice, you may want to read our tutorial on [how to enable dark mode in LibreOffice][10].
### Closing Notes
Microsoft Office is undoubtedly the market leader in the Office productivity space. There is a reason for it, it comes with decades of development, and its not a free product. The latest Office 365 Home usage price is around ~7 USD per month for 3 to 4 devices, which is a bit pricy if you ask me.
Whereas LibreOffice is free and community-developed and headed by The Document Foundation. It is not trying to be Microsoft Office, but it allows millions of users, schools, non-profits, colleges, and students to work and learn using a free office suite. Hence, the development is slower, and features arrive late.
Hence, it is beneficial if it can mimic the basic look and feel to make it like Microsoft Office to increase LibreOffices adoption. And I hope this guide serves a little purpose in that direction.
[Link: Official Feature comparison between LibreOffice and Microsoft Office.][11]
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/libreoffice-like-microsoft-office/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: http://libreoffice.com
[2]: http://office.com
[3]: https://www.debugpoint.com/wp-content/uploads/2021/06/tabbed-bar-option.jpg
[4]: https://www.deviantart.com/users/outgoing?https://1drv.ms/u/s!ArgKmgFcmBYHhSQkPfyMZRnXX5LJ
[5]: https://www.debugpoint.com/wp-content/uploads/2021/06/Import-icon-sets-in-Extension-Manager.jpg
[6]: https://www.debugpoint.com/wp-content/uploads/2021/06/Change-icons-in-Options-1024x574.jpg
[7]: https://www.debugpoint.com/wp-content/uploads/2021/06/Making-LibreOffice-look-like-Microsoft-Office-in-KDE-Plasma.jpg
[8]: https://www.debugpoint.com/wp-content/uploads/2021/06/Making-LibreOffice-look-like-Microsoft-Office-in-Windows-10.jpg
[9]: https://www.debugpoint.com/wp-content/uploads/2021/06/Making-LibreOffice-look-like-Microsoft-Office-in-GNOME.jpg
[10]: https://www.debugpoint.com/how-to-enable-dark-mode-libreoffice/
[11]: https://wiki.documentfoundation.org/Feature_Comparison:_LibreOffice_-_Microsoft_Office

View File

@ -0,0 +1,113 @@
[#]: subject: "Upgrade to Latest LibreOffice in Ubuntu, Linux Mint and Windows"
[#]: via: "https://www.debugpoint.com/libreoffice-upgrade-update-latest/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Upgrade to Latest LibreOffice in Ubuntu, Linux Mint and Windows
======
**This beginners guide explains the steps required to upgrade to the latest LibreOffice in Ubuntu, Linux Mint****and Windows.**
![LibreOffice 7.3.x Community Edition in Ubuntu 22.04 LTS Jammy Jellyfish][1]
[LibreOffice][2], used by millions of users worldwide, is the most popular free office suite today. It consists of a spreadsheet program (Calc), document processor (Writer), presentation (Impress), drawing (Draw), and Math module to help you with most of the office, business, academic, and day-to-day work.
LibreOffice can act as an excellent replacement for paid Microsoft Office suite due to its compatibility with proprietary file formats such as DOCX, PPTX, and XLSX. It is a fork of the Apache OpenOffice productivity suite and is actively developed by thousands of global contributors.
![LibreOffice Logo][3]
### Upgrade to Latest LibreOffice
LibreOffice recently changed its versioning methods from the Fresh and Still concept. Now, LibreOffice has a **community** edition and a recommended **enterprise** edition. This is because many businesses use the latest LibreOffice version with cutting-edge features, hampering the development effort. Hence the team suggested the business users get paid support from official LibreOffice partners for long-term support. You can read the blog post [here][4].
That said, here are the current versions.
#### Latest LibreOffice Versions
- The current LibreOffice Community version series is **LibreOffice 7.4.x.**
- And the LibreOffice stable recommended version for business is **LibreOffice 7.3.x**.
#### Upgrade to Latest LibreOffice in Ubuntu, Linux Mint, and Other Ubuntu Based distributions
[Ubuntu 22.04 LTS Jammy Jellyfish][5] have LibreOffice 7.3.x.
**Ubuntu 20.04 LTS** has LibreOffice 6.4.7 at the moment, and soon it will get the update for the next iteration.
**Ubuntu 18.04 LTS,** supported until[April 2023][6], has the LibreOffice 6.2 version. Linux Mint 19.x also provides the same. You can still download and install LibreOffice 6.3.x version in Ubuntu 18.04 or Linux Mint 19.x.
It is always wiser to stick to the LibreOffice version provided by the distribution. Moreover, unless you need the latest features, you should not upgrade. If you like to experiment, you can go ahead.
##### Via PPA
- You can install and upgrade to the latest Fresh version using the official LibreOffice PPA. Open a terminal and run the below commands in Ubuntu or Linux Mint.
```
sudo add-apt-repository ppa:libreoffice/ppa
```
```
sudo apt update && sudo apt install libreoffice
```
- To **downgrade** LibreOffice and remove the PPA, run the below commands from the terminal sequentially.
```
sudo add-apt-repository --remove ppa:libreoffice/ppa
```
```
sudo apt install ppa-purge && sudo ppa-purge ppa:libreoffice/ppa
```
##### Via Snap
You can also have the option to install the latest LibreOffice as Snap via the below option. [Snap packages][7] can be used across supported Linux distributions as a standalone package. Thus, you can keep your existing installation of LibreOffice and still run the latest Snap version.
Remember that technically you can run two versions of LibreOffice in parallel using one Snap version. However, ensure there might be slight file association issues and other problems. This applies to Flatpak as well.
[Download LibreOffice as Snap][8]
##### Via Flatpak
Flatpak is another way by which you can have the latest LibreOffice alongside the distro-provided version. You can [set up your system for Flatpak][9] and download LibreOffice via the below link.
[Download LibreOffice as Flatpak][10]
#### Upgrade for Windows
For Windows, you cant upgrade directly from the existing installation. You can download the latest LibreOffice from [this page][11] and do the installation. During installation, your existing version would be uninstalled.
### Upgrade Troubleshooting
If you encounter any problems or system instability after the upgrade, it is better to do a clean install. So, you can download the latest copy from [this link][11] and install it. If you are using Ubuntu or Linux Mint, dont forget to remove the stock version first before installing the latest version.
Finally, drop a comment below if you face issues while upgrading to the latest LibreOffice in Ubuntu Linux and others.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/libreoffice-upgrade-update-latest/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/wp-content/uploads/2019/09/LibreOffice-7.3.x-Community-Edition-in-Ubuntu-22.04-LTS-Jammy-Jellyfish.jpg
[2]: https://www.libreoffice.org/
[3]: https://www.debugpoint.com/wp-content/uploads/2019/09/LibreOffice-Icon.png
[4]: https://blog.documentfoundation.org/blog/2021/02/03/libreoffice-7-1-community/
[5]: https://www.debugpoint.com/2022/01/ubuntu-22-04-lts/
[6]: https://www.debugpoint.com/ubuntu-release-dates-wiki/
[7]: https://www.debugpoint.com/2016/07/how-to-install-and-use-snap-packages-in-ubuntu/
[8]: https://snapcraft.io/libreoffice
[9]: https://www.debugpoint.com/2018/07/how-to-install-flatpak-apps-ubuntu-linux/
[10]: https://flathub.org/apps/details/org.libreoffice.LibreOffice
[11]: https://www.libreoffice.org/download/download/

View File

@ -0,0 +1,134 @@
[#]: subject: "How to Install Latest LibreOffice in Ubuntu and other Linux"
[#]: via: "https://www.debugpoint.com/install-latest-libreoffice-ubuntu-linux/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Install Latest LibreOffice in Ubuntu and other Linux
======
**Heres a quick guide on how to install the latest LibreOffice version in Ubuntu and other Linux.**
The free and open-source office suite LibreOffice comes in two versions. The Community and Enterprise versions. The “community” version is for early adopters who want the latest bleeding-edge software tech. And the “enterprise” version is more stable and may not include all the latest features, but it is ideal for the production environment and professional work.
### Install Latest LibreOffice in Ubuntu and other Linux
#### 1. Remove pre-installed LibreOffice
The Ubuntu operating system and other Linux ideally come with pre-installed LibreOffice. That might not be the latest one because of the distribution-specific release cycles. However, before you do a fresh install, you can remove the stock version of LibreOffice in Ubuntu and its related derivatives via the below command:
Open a terminal and run the below commands to remove the installed LibreOffice in Ubuntu and related distributions. For others, you can use your distros package manager to remove it.
```
sudo apt remove purge libreoffice*
sudo apt autoclean
sudo apt autoremove
```
Do a reboot to ensure everything is okay (though you could skip this step).
#### 2. Install via download
Go to the [official download page][1]. And download the “Fresh” version by choosing the type from the drop-down. For Ubuntu and other derivatives, choose the .deb file.
![LibreOffice download and install from official website][2]
After downloading, extract the files; you should see all the packages below.
![Extracted LibreOffice DEB files][3]
Now, open a terminal at the extracted files exact location and run the commands below in sequence. Firstly, you need to install the `ure` package. The second is the `core` package and followed by all the basic packages. Finally, the main `LibreOffice` packages. A typical set of commands are present below. You need to change the version numbers for other releases.
```
sudo dpkg -i libobasis7.0-ure_7.0.4.2-2_amd64.deb
sudo dpkg -i libobasis7.0-core_7.0.4.2-2_amd64.deb
sudo dpkg -i libobasis7.0*
```
```
sudo dpkg -i libreoffice7.0*
```
If you are using Fedora Linux or Red Hat Linux, use the [dnf command][4] to install in the same order as mentioned above.
![Install LibreOffice via dpkg][5]
Wait for the installation to finish. After completion, you can find LibreOffice via the application menu.
![Latest LibreOffice in Menu][6]
This should complete the steps to install the latest LibreOffice. If you dont want to follow the above method, see the below options.
#### Install via PPA
If you like to install it via PPA, then follow the below steps. Make sure to remove the existing LibreOffice in step 1 above.
```
sudo add-apt-repository ppa:libreoffice/ppa
```
And finally, run the below commands to install the latest LibreOffice 5.4 series from this official PPA.
```
sudo apt update
sudo apt install libreoffice
```
Once installed, you can launch LibreOffice via Dash search.
![LibreOffice 5.4.2 Running in Ubuntu][7]
#### Install via Snap and Flatpak
If you are a Linux user, you may try the LibreOffice self-contained executable, which runs in a sandbox like Snap or Flatpak.
- To install LibreOffice via [Flatpak][8], visit [this page][9] to set it up and then run the below command to install it.
```
flatpak install flathub org.libreoffice.LibreOffice
```
- Similarly, for the [Snap version][10], use the following command to install.
```
sudo snap install libreoffice
```
### How can I upgrade to the latest LibreOffice version?
If you do not want to remove LibreOffice but want to upgrade to the latest version, please read our complete guide below.
> [Upgrade to Latest LibreOffice in Ubuntu, Linux Mint and Windows][11]
![“Upgrade to Latest LibreOffice in Ubuntu, Linux Mint and Windows” — DebugPoint.com][12]
Feel free to comment if you are having trouble installing the latest LibreOffice.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/install-latest-libreoffice-ubuntu-linux/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.libreoffice.org/download/download/
[2]: https://www.debugpoint.com/wp-content/uploads/2017/10/LibreOffice-download-and-install-from-official-website.jpg
[3]: https://www.debugpoint.com/wp-content/uploads/2017/10/Extracted-LibreOffice-DEB-files.jpg
[4]: https://www.debugpoint.com/dnf-commands-examples/
[5]: https://www.debugpoint.com/wp-content/uploads/2017/10/Install-LibreOffice-via-dpkg.jpg
[6]: https://www.debugpoint.com/wp-content/uploads/2017/10/Latest-LibreOffice-in-Menu.jpg
[7]: https://www.debugpoint.com/wp-content/uploads/2017/10/LibreOffice-5.4.2-Running-in-Ubuntu-.png
[8]: https://flathub.org/apps/details/org.libreoffice.LibreOffice
[9]: https://flatpak.org/setup/
[10]: https://snapcraft.io/libreoffice
[11]: https://www.debugpoint.com/libreoffice-upgrade-update-latest/
[12]: https://www.debugpoint.com/libreoffice-upgrade-update-latest/embed/#?secret=KINquNxuYI#?secret=FGij1s6Mfc

View File

@ -0,0 +1,245 @@
[#]: subject: "10 Best Open Source Bots for Your Discord Server"
[#]: via: "https://itsfoss.com/open-source-discord-bots/"
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
10 Best Open Source Bots for Your Discord Server
======
Discord started as a platform where gamers and friends could hang out. **[Discord][1] has over 150 million users** in **2022**, even after [turning down][2] a **$12 billion offer from Microsoft**.
If it is your first time hearing about it, consider it something like Slack, but with countless fun functionalities to create communities (i.e., servers).
Among all the features, Discord bots allow automating things or spice up your server. But most of them are proprietary. So, in this list, I suggest some of the **best open-source Discord bots**.
**Note:**Bots can spread malware and affect your entire Discord server. You must ensure that you do not add bots you do not know about. And this is why you might want to trust open-source Discord bots more than other options.
### 1. MonitoRSS
![monitorss itsfoss][3]
Highlights:
- **RSS Feed**
- **Filters and Subscriptions**
- **Hosted**
[MonitoRSS][4] is a useful Discord bot that enables your community to receive news from any sources that support RSS.
It is a reasonably popular bot that works as expected. You can add it to a particular channel, customize its look, and start getting news updates on your Discord server.
It also lets you filter articles for your feed and allow users to subscribe to an article as per their liking. This can be managed and customized using a web interface control panel.
Explore more on its [GitHub page][5].
### 2. ModMail
![modmail discord][6]
Highlights:
- **Enables users to contact server staff**
- **Self-host**
- **Hosted version**
- **Optional premium**
[ModMail][7] is a simple open-source Discord bot that seamlessly lets a user contact the staff/admins/moderators of a Discord channel.
Traditionally, you have to reach out to multiple people via DMs to expect help on something you want to know. However, some servers have many users, so it may be difficult for the server staff to get back to you.
ModMail creates a separate channel when you send a message to the bot. And this channel acts as a shared inbox to all the administrators, mods, and you.
![modmail bot][8]
Not only does easy messaging, but it also helps the server staff to conveniently read past transcripts, enable automated replies, save snippets of them, respond anonymously, and more. Some features are premium-only.
You can check out its [official website][9] and [GitHub page][10] for more info. It also gives you all the necessary information to self-host it.
### 3. Red Discord Bot (Self-Hosted)
![red discord bot][11]
Highlights:
- **Highly Customizable**
- **Moderation****tasks**
- **Good documentation**
- **Multipurpose**
[Red][12] is an entirely modular bot that provides you with many functions, including music, moderation, trivia, stream alerts, and more.
Red should be useful whether you want it to send welcome messages or help moderate the server.
Unlike some others, you cannot add the bot directly to your server. You will have to self-host it, configure it, and then get the ability to add it to your server.
The installation does not need any sort of coding; you have to follow the [documentation][13].
### 4. Discord Music Bot (Self-Hosted)
![discord music bot][14]
Highlights:
- **It****supports Spotify, SoundCloud, and YouTube**.
- **It offers shuffling, volume control, and a web dashboard to manage it all**.
[Discord Music Bot][15] (not a unique name, I know) is a pretty popular Discord bot that you can self-host.
It supports Spotify, SoundCloud, and YouTube. Some features include shuffling, volume control, and a web dashboard.
You can follow the instructions on its [GitHub page][15] to install and configure it for your server.
### 5. Discord Tickets (Self-Hosted)
![discord tickets][16]
Highlights:
- **Ticket management**
- **Add custom branding for free**
Do you have customers for your services/products on Discord? You can use [Discord Tickets][17] to manage/create tickets and add your branding for free.
Most of the Discords popular ticket management bots are proprietary and require a premium subscription to add your brand logo.
With Discord Tickets, you can self-host and customize as per your requirements. Explore more about it on its [GitHub page][18].
### 6. EvoBot (Self-Hosted)
![evobot][19]
Highlights:
- **Highly customizable**
- **Search for music or use a URL to play**
[EvoBot][20] is yet another open-source music Discord bot with lots of customization options.
You can play music from YouTube and SoundCloud using its URL or search/play.
Explore more about its installation and configuration on its [GitHub page][20].
### 7. Atlanta Bot
![atlanta bot][21]
Highlights:
- **Hosted version**
- **Self-host option**
- **Web dashboard**
- **Multipurpose**
[AtlantaBot][22] is yet another all-in-one bot that provides functionalities for moderation, music, fun commands, and several commands.
Furthermore, it features its dashboard with valuable options. You can set up the dashboard and manage your server/configuration through it. You can also perform limited translations using the bot.
It can be self-hosted, but if you would rather not make an effort, you can invite a hosted version of the bot.
### 8. YAGPDB (Self-Hosted)
![reddit feed yagpdb][23]
Highlights:
- **Custom commands**
- **Automatic moderator**
- **Reddit/YouTube feed**
- **Moderation****tasks**
[YAGPDB][24] stands for **Yet Another General Purpose Discord Bot**.
With this bot, you can quickly perform general moderation tasks, add custom commands, create an automatic moderator, manage/create roles, and pull Reddit/YouTube feeds.
It is configurable. So, you can do more with it than what I just mentioned. Explore more about it on its [GitHub page][25].
### 9. Loritta
![loritta][26]
Highlights:
- **Hosted version**
- **Self-host option**
- **Engagement and Moderation features.**
If you are looking for a multipurpose Discord bot with an interesting character, [Loritta][27] would be a good pick.
It supports moderation, entertainment, and automation features. You can self-host it or use the hosted version.
The developer presents the bot as a girl who helps you moderate, entertain, and engage the members of your server. Additionally, it offers a premium plan for some extra perks.
Explore more about it on its [GitHub page][28].
### 10. Melijn
![melijn][29]
Highlights:
- **Hosted version**
- **Self-host option**
- **Moderation features.**
[Melijn][30] is yet another multipurpose bot for Discord servers.
You can interact with audio commands, moderate, perform user verifications, and create role groups.
It offers a hosted version and lets you self-host it, following the instructions on its [GitHub page][31].
### Whats Your Favorite Discord Bot?
If you are a Discord server moderator or admin, what bot do you like to use for your community?
Do you focus on moderation features or engagement features? What are the standard features that you look for in a Discord bot?
Share your thoughts in the comments below.
--------------------------------------------------------------------------------
via: https://itsfoss.com/open-source-discord-bots/
作者:[Ankush Das][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/ankush/
[b]: https://github.com/lkxed
[1]: https://discord.com/company
[2]: https://www.bloomberg.com/news/articles/2021-04-20/chat-app-discord-is-said-to-end-takeover-talks-with-microsoft
[3]: https://itsfoss.com/wp-content/uploads/2022/11/monitorss-itsfoss.jpg
[4]: https://monitorss.xyz
[5]: https://github.com/synzen/MonitoRSS
[6]: https://itsfoss.com/wp-content/uploads/2022/11/modmail-discord.jpg
[7]: https://modmail.xyz/
[8]: https://itsfoss.com/wp-content/uploads/2022/11/modmail-bot.png
[9]: https://modmail.xyz/premium
[10]: https://github.com/chamburr/modmail
[11]: https://itsfoss.com/wp-content/uploads/2022/11/red-discord-bot.png
[12]: https://github.com/Cog-Creators/Red-DiscordBot
[13]: https://docs.discord.red/en/stable/
[14]: https://itsfoss.com/wp-content/uploads/2022/11/discord-music-bot.png
[15]: https://github.com/SudhanPlayz/Discord-MusicBot
[16]: https://itsfoss.com/wp-content/uploads/2022/11/discord-tickets.jpg
[17]: https://discordtickets.app
[18]: https://github.com/discord-tickets/bot
[19]: https://itsfoss.com/wp-content/uploads/2022/11/evobot.png
[20]: https://github.com/eritislami/evobot
[21]: https://itsfoss.com/wp-content/uploads/2022/11/atlanta-bot.png
[22]: https://github.com/Androz2091/AtlantaBot
[23]: https://itsfoss.com/wp-content/uploads/2022/11/reddit-feed-yagpdb.png
[24]: https://yagpdb.xyz
[25]: https://github.com/botlabs-gg/yagpdb
[26]: https://itsfoss.com/wp-content/uploads/2022/11/loritta.jpg
[27]: https://loritta.website/us/
[28]: https://github.com/LorittaBot
[29]: https://itsfoss.com/wp-content/uploads/2022/11/melijn.jpg
[30]: https://melijn.com
[31]: https://github.com/ToxicMushroom/Melijn

View File

@ -0,0 +1,184 @@
[#]: subject: "How to iterate over tables in Lua"
[#]: via: "https://opensource.com/article/22/11/iterate-over-tables-lua"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to iterate over tables in Lua
======
Create structure that makes it easier to find stored data.
In the [Lua][1] programming language, an array is called a table. A table is used in Lua to store data. If you're storing a lot of data in a structured way, it's useful to know your options for retrieving that data when you need it.
### Creating a table in Lua
To create a table in Lua, you instantiate the table with an arbitrary name:
```
mytable = {}
```
There are different ways you can structure your data in a table. You could fill it with values, essentially creating a list (called a list in some languages):
```
mytable = {'zombie','apocalypse'}
```
Or you could create an associated array (called a map or dictionary in some languages). You can add arbitrary keys to the table using dot notation. You can also add a value to that key the same way you add a value to a variable:
```
myarray = {}
myarray.baz = 'happy'
myarray.qux = 'halloween'
```
You can add verification with the `assert()` function:
```
[assert][2](myarray.baz == 'happy', 'unexpected value in myarray.baz')
[assert][2](myarray.qux == 'halloween', 'unexpected value in myarray.qux')
```
You now have two tables: a list-style `mytable` and an associative array-style `myarray`.
### Iterating over a table with pairs
Lua's `pairs()` function extracts key and value pairs from a table.
```
print('pairs of myarray:')
for k, v in pairs(myarray) do
  print(k, v)
end
```
Here's the output:
```
pairs of myarray:
baz     happy
qux     halloween
```
If there are no keys in a table, Lua uses an index. For instance, the `mytable` table contains the values `zombie` and `apocalypse`. It contains no keys, but Lua can improvise:
```
print('pairs of mytable:')
for k, v in pairs(mytable) do
  print(k, v)
end
```
Here's the output:
```
1   zombie
2   apocalypse
```
### Iterating over a table with ipairs
To account for the fact that tables without keys are common, Lua also provides the `ipairs` function. This function extracts the index and the value:
```
print('ipairs of mytable:')
for i, v in ipairs(mytable) do
  print(i, v)
end
```
The output is, in this case, the same as the output of `pairs`:
```
1   zombie
2   apocalypse
```
However, watch what happens when you add a key and value pair to `mytable`:
```
mytable.surprise = 'this value has a key'
print('ipairs of mytable:')
for i, v in ipairs(mytable) do
  print(i, v)
end
```
Lua ignores the key and value because `ipairs` retrieves only indexed entries:
```
1   zombie
2   apocalypse
```
The key and value pair, however, have been stored in the table:
```
print('pairs of mytable:')
for k, v in ipairs(mytable) do
  print(k, v)
end
```
The output:
```
1          zombie
2          apocalypse
surprise   this value has a key
```
### Retrieving arbitrary values
You don't have to iterate over a table to get data out of it. You can call arbitrary data by either index or key:
```
print('call by index:')
print(mytable[2])
print(mytable[1])
print(myarray[2])
print(myarray[1])
print('call by key:')
print(myarray['qux'])
print(myarray['baz'])
print(mytable['surprise'])
```
The output:
```
call by index:
apocalypse
zombie
nil
nil
call by key:
halloween
happy
this value has a key
```
### Data structures
Sometimes using a Lua table makes a lot more sense than trying to keep track of dozens of individual variables. Once you understand how to structure and retrieve data in a language, you're empowered to generate complex data in an organized and safe way.
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/11/iterate-over-tables-lua
作者:[Seth Kenlon][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lkxed
[1]: https://opensource.com/article/22/11/lua-worth-learning
[2]: http://www.opengroup.org/onlinepubs/009695399/functions/assert.html

View File

@ -0,0 +1,91 @@
[#]: subject: "Fix scanned images with ImageMagick"
[#]: via: "https://opensource.com/article/22/11/fixing-scanned-images-imagemagick"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Fix scanned images with ImageMagick
======
It's easy to correct images, even in batches, with this open source tool.
Years ago while rummaging through the contents of a shelf in a used bookstore, I happened upon a booklet titled "UNIX System Command Summary for Berkeley 4.2 & 4.3 BSD," published by Specialized Systems Consultants. I bought it as a curiosity item because it was nearly 20 years old yet still largely applicable to modern Linux and BSD.
That amused me then and now. A booklet written in 1986 was still largely relevant in 2016, while books on the same shelf about a proprietary OS weren't worth the paper they were printed on. (Think about it: What technology do you think is going to survive a zombie apocalypse?) I've had the booklet on my own bookshelf for several years now, but it occurred to me that it's probably worth doing a little digital preservation of this artifact, so I decided to scan the booklet to create a [CBZ ebook][1].
Scanning was easy, albeit time-consuming, with [Skanlite][2]. After I was finished, however, I discovered that some pages weren't quite level.
![A page of text, including a table of contents and a glossary, that is crooked and distorted][3]
In printing, this is called a registration problem, meaning that the position of what's being printed isn't correctly orientated on the page.
### ImageMagick
[ImageMagick][4] is a non-interactive terminal-based graphics editor. It might seem counterintuitive to try to edit a graphic in a graphic-less environment like a text-only terminal, but it's actually very common. For instance, when you upload an image to use as a profile picture to a web application, it's likely that a script on the application's server processes your image using ImageMagick or its libraries. The advantage of a non-interactive editor is that you can formulate what needs to be done to a sample image, then apply those effects to hundreds of other images at the press of a button.
ImageMagick is generally just as capable as any graphics editor, as long as you take the time to uncover its many functions and how to combine them to achieve the desired effects. In this case, I want to rotate pages that are askew. After searching through ImageMagick's documentation, I discovered that the ImageMagick term for the solution I needed was called deskew. Aligning your terminology with somebody else's terminology is a challenge in anything that you don't already know, so when you approach ImageMagick (or anything), keep in mind that the word you've decided describes a problem or solution may not be the same word used by someone else.
To deskew an image with crooked text using ImageMagick:
```
$ convert page_0052.webp -deskew25% fix_0052.webp
```
The `-deskew` option represents the threshold of acceptable skew. A skew is determined by tracing peaks and valleys of objects that appear to be letters. Depending on how crooked your scan is, you may need more or less than 25% threshold. I've gone as high as 80%, and so far nothing under 25% has had an effect.
Here's the result:
![The same page of text, now with the text properly aligned][5]
Fixed! Applying this to the remaining 55 pages of the document fixed skewed pages while doing nothing to pages that were already straight. In other words, it was safe to run this command on pages that needed no adjustment, thanks to my threshold setting.
### Cropping an image with ImageMagick
After correcting for a skew, and because I scanned more of each page than necessary anyway to prevent accidentally cutting off words, I decided that it made sense to crop my corrected pages. I was happy to keep some space around the margins, but not quite as much as I had. I use the `crop` function of ImageMagick often enough for images on this very website, so I was familiar with the option. However, I needed to determine how to crop each page.
First, I needed the size of the image:
```
$ identify fixed_0052.webp
WEBP 1128x2593 1128x2593+0+08-bit sRGB 114732B 0.020u 0:00.021
```
Knowing the size, I was able to make some estimations about how many pixels I could stand to lose. After a few trial runs, I came up with this:
```
convert fix_0052.webp -gravity Center -crop 950x2450+0+0 crop_0052.webp
```
This isn't an exact fit, but it proved important when I applied it to other images in the booklet. The pages varied in content and scanner placement here and there, so I was happy to give each one a little breathing room.
Here's the corrected and cropped image:
![The same page of text, with the previous fixes applied and crooked white margins around the page cropped out.][6]
### Batch image editing with open source
The beauty of ImageMagick is that once you've figured out the formula for fixing your image, you can apply that fix to all images requiring the same fix. I do this with [GNU Parallel][7], which uses all my CPU cores to finish image correction across hundreds of pages. It doesn't take long, and the results speak for themselves. More importantly, I've got a digital archive of a fun artifact of UNIX history.
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/11/fixing-scanned-images-imagemagick
作者:[Seth Kenlon][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lkxed
[1]: https://opensource.com/article/19/3/comic-book-archive-djvu
[2]: https://opensource.com/article/22/2/scan-documents-skanlite-linux-kde
[3]: https://opensource.com/sites/default/files/2022-10/imagemagick-crook_1.png
[4]: https://opensource.com/article/17/8/imagemagick
[5]: https://opensource.com/sites/default/files/2022-10/imagemagick-deskew-fix.png
[6]: https://opensource.com/sites/default/files/2022-10/imagemagick-deskew-crop.png
[7]: http://LINK-TO-SETH-GNU-PARALLEL-REDHAT.COM/SYSADMIN

View File

@ -0,0 +1,137 @@
[#]: subject: "How to Install Cinnamon Desktop in Arch Linux"
[#]: via: "https://www.debugpoint.com/cinnamon-arch-linux-install/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Install Cinnamon Desktop in Arch Linux
======
**Cinnamon is the default desktop environment for Linux Mint. This quick guide explains the steps to install the Cinnamon desktop environment in Arch Linux.**
The [Cinnamon desktop environment][1] is the default desktop flavour for [Linux Mint][2]. This GTK-based desktop environment is created to provide a traditional desktop flavour with old GNOME (i.e. pre-GNOME 3 looks). The desktop itself is lightweight and very user-friendly. Because it keeps the time-tested icon and menu-driven desktop behaviour, hence it is considered (in combination with Linux Mint) one of the easy-to-use desktops for new Linux users.
Although Cinnamon and its packages are closely coupled with Linux Mint, this desktop can be installed as a separate desktop environment in Ubuntu, Fedora, or Arch Linux.
Installing Cinnamon in Arch Linux is fairly easy, like other desktops such as Xfce and KDE Plasma in Arch. But it requires some specific packages to be installed to make it look like a proper Cinnamon desktop.
Lets dive in.
### Install Cinnamon Desktop in Arch Linux
#### Step 1: Install Base System
This guide assumes that you have installed the base Arch system already. If you do not have the base system installed, please install it using the [automated arch install guide][3] (recommended method). Then follow the below steps.
#### Step 2: Update Your System
Open a terminal in your Arch installation. And make sure the system is up to date by running the below command:
```
pacman -Syu
```
#### Step 3: Instal yay AUR Helper
Some packages that are required for configuring Cinnamon are not available in the Arch official repository. They are available in Arch User Repo (AUR). Hence you need to install yay for additional packages. Follow [this guide to install yay AUR helper][4].
#### Step 4: Install Cinnamon Desktop in Arch Linux
The basic Cinnamon desktop is available in the [cinnamon][5] package, which is present in the Community repo. Open a terminal and run the following commands to install the Cinnamon desktop and the terminal application.
```
sudo pacman -S cinnamon gnome-terminal
```
Install the display server and display manager. LightDM is lightweight and ideal for Cinnamon. Although, you can use any other display manager, such as SDDM or GDM. But I would recommend that you stick with lightdm.
```
sudo pacman -S xorg lightdm lightdm-gtk-greeter
```
Enable the display manager and Network services to start in the next boot.
```
systemctl enable lightdm
systemctl enable NetworkManager
```
Reboot the system.
#### Step 5: Configure Cinnamon Desktop
After a successful reboot, you should see the lightdm login prompt. Log in using the username and password which you may have created while installing the base system.
When I first log in to the base Cinnamon desktop, it looks very bland. So it needed a bit of customization.
![Cinnamon Desktop in Arch (Before Configuration)][6]
Open a terminal and install some important packages such as sound drivers, browsers, etc. This would ensure that proper fonts and additional items are installed.
```
sudo pacman -S pulseaudio pulseaudio-alsa pavucontrol firefox vlc gimp xfburn thunderbird gedit gnome-system-monitor
```
Then install faenza icon theme for a Cinnamon-specific icon set.
```
sudo pacman -S mate-icon-theme-faenza
```
The numix themes require yay to be installed. Make sure you follow [this guide][4]to install yay AUR helper before running the below command to install it.
```
yay -S numix-themes
```
After all the installation is complete, reboot the system.
When you log in back, open the Themes application and change the Window borders, Icons, Controls, and Desktop as per below.
![Theme Changes for this guide][7]
You may also choose to download additional themes in the second tab (Add/remove) as well.
![Additional Themes for you to download][8]
Change the default GNOME wallpaper (which comes with Cinnamon) to something you like. This guide uses the Cinnamon logo wallpaper from [cinnamon-look.org][9].
If all goes well, your desktop should look like this.
![Cinnamon Desktop in Arch Linux][10]
![Cinnamon Desktop Running in Arch Linux][11]
So, that concludes the basic steps for installing and configuring the Cinnamon desktop in Arch Linux. You may want to add additional settings, such as desklets, etc.
### Closing Notes
Cinnamon is a modern and easy-to-use desktop for new users. And with the flexibility of Arch Linux and Cinnamon at its core, this combo can be ideal for many users who like Cinnamon desktop (mainly Linux Mint) but want Arch Linux with it. I hope this guide helps you set up your Cinnamon box with Arch Linux.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/cinnamon-arch-linux-install/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://cinnamon-spices.linuxmint.com/
[2]: https://www.debugpoint.com/linux-mint/
[3]: https://www.debugpoint.com/archinstall-guide/
[4]: https://www.debugpoint.com/2021/01/install-yay-arch/
[5]: https://archlinux.org/packages/community/x86_64/cinnamon/
[6]: https://www.debugpoint.com/wp-content/uploads/2021/02/Cinnamon-Desktop-in-Arch-Before-Configuration.jpg
[7]: https://www.debugpoint.com/wp-content/uploads/2021/02/Theme-Changes-for-this-guide.jpg
[8]: https://www.debugpoint.com/wp-content/uploads/2021/02/Additional-Themes-for-you-to-download.jpg
[9]: https://www.cinnamon-look.org/browse/cat/
[10]: https://www.debugpoint.com/wp-content/uploads/2021/02/Cinnamon-Desktop-in-Arch-Linux-1024x535.jpg
[11]: https://www.debugpoint.com/wp-content/uploads/2021/02/Cinnamon-Desktop-Running-in-Arch-Linux-1024x640.jpg

View File

@ -0,0 +1,117 @@
[#]: subject: "How to Install and Configure KDE Plasma Desktop in Arch Linux [Complete Guide]"
[#]: via: "https://www.debugpoint.com/kde-plasma-arch-linux-install/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Install and Configure KDE Plasma Desktop in Arch Linux [Complete Guide]
======
**If you love KDE and Arch Linux, this guide is for you. This guide explains the steps needed to set up a fully functioning KDE Plasma desktop with all of its native applications.**
Lets take a look at how you can install KDE Plasma in Arch Linux.
In the earlier posts, we explained that you could set up a bare minimum Arch Linux with an [automated archinstall script][1] and also explained how you can install GNOME, LXQt, and Xfce desktop Arch Linux. And now, we explain the steps for the KDE Plasma desktop.
### KDE Plasma desktop
[KDE Plasma][2] is a lightweight and visually appealing desktop environment for Linux that comes with tons of customization options at a very detailed level. The latest iteration of this desktop is Plasma 5, which is based on Qt5, KDE Framework 5 provides both Xorg and Wayland display server options.
The current KDE Plasma desktop version is [5.26 stable][3], which this article uses for installation.
This guide requires that you install the bare minimum Arch Linux shell already. If not, then follow this [simple guide][1] to install a basic skeleton of Arch Linux. Then continue with the following steps.
Also, ensure you have admin privileges with your user for running the pacman package manager.
### Install and Configure KDE Plasma Desktop in Arch Linux
You need the following packages for a fully functional KDE Plasma system in Arch Linux.
- [plasma][4] (~590 mb) basic plasma packages
- [kde-applications][5](~800 mb) additional KDE native applications (Konsole, etc)
- xorg display server
- sddm display manager
These four packages are necessary. However, you can optionally install [plasma-wayland-session][6] if you want to use the Wayland display server.
#### 1. Install packages
Open a terminal and run the following command to install those packages.
```
pacman -S --needed xorg sddmpacman -S --needed plasma kde-applications
```
When asked to select a package, press enter for default selection. If you are unsure, choose the following options when asked on the screen.
pipewire-media-sessionphonon-qt5-gstreamerpyside2cronietesseract-data-eng (for english)
Wait for the installation to finish.
#### 2. Enable display server and network
Now its time to enable the display manager and network; otherwise, you will not be able to log in. Run the following commands after the above commands are complete.
```
sudo systemctl enable sddmsudo systemctl enable NetworkManager
```
#### 3. Configure sddm and reboot
One last configuration you need for the KDE Plasma desktop is related to the login screen. By default, sddm uses its own failsafe login screen, which is not the typical KDE Plasma “breeze” login screen. A small tweak is needed for a KDE Plasma login screen.
Open the `sddm.conf` file from the terminal.
```
sudo nano /usr/lib/sddm/sddm.conf.d/default.conf
```
Change the theme section as per below.
```
[Theme]
# current theme name
Current=breeze
```
![Modify the sddm configuration to accept breeze theme][7]
Press `CTRL+O` and `CTRL+X` to save and exit the nano editor. Now you can restart your Arch system using the below command:
```
sudo systemctl reboot
```
And you should be greeted with a nice KDE Plasma login screen and a desktop.
![Arch Linux Running KDE Plasma Desktop][8]
That wraps up the steps for KDE Plasma desktop installation in Arch Linux. I hope you get all the steps correctly and can install them. If you face any errors, comment below.
Whats next? You may want to check out other [Arch Linux guides][9], Or browse the website for a more interesting read.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/kde-plasma-arch-linux-install/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/archinstall-guide/
[2]: https://kde.org/plasma-desktop/
[3]: https://www.debugpoint.com/kde-plasma-5-26/
[4]: https://archlinux.org/packages/extra/x86_64/plasma-desktop/
[5]: https://archlinux.org/groups/x86_64/kde-applications/
[6]: https://archlinux.org/packages/extra/x86_64/plasma-wayland-session/
[7]: https://www.debugpoint.com/wp-content/uploads/2021/01/Modify-the-sddm-configuration-to-accept-breeze-theme.jpg
[8]: https://www.debugpoint.com/wp-content/uploads/2021/01/Arch-Linux-Running-KDE-Plasma-Desktop-1024x640.jpg
[9]: https://www.debugpoint.com/tag/arch-linux

View File

@ -0,0 +1,290 @@
[#]: subject: "How to Install GNOME Desktop in Arch Linux [Complete Guide]"
[#]: via: "https://www.debugpoint.com/gnome-arch-linux-install/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Install GNOME Desktop in Arch Linux [Complete Guide]
======
**This guide explains the steps you need to install GNOME Desktop in Arch Linux.**
This guide has two parts. The first part deals with installing the base Arch system. The second part is installing the complete GNOME desktop environment on top of Arch Linux.
### What is the GNOME Desktop?
GNOME is a popular desktop environment that is a default desktop choice for many top-tier desktops-based Linux distributions such as Ubuntu and Fedora. Almost all flavors provide a GNOME desktop option.
The GNOME desktop is one of the stable and user-friendly desktops, hence it is preferred by many average, advanced users. If you want a desktop that remains invisible while you carry out your work, GNOME is the one. It never gets into your way while working. Hence it is still popular and default option for many despite many controversies about being GNOME3 (current iteration) being slow, resource-heavy, etc,
With all that said, lets take a look at how you can install a GNOME desktop in bare metal Arch installations.
### Install GNOME Desktop in Arch Linux
#### Part 1: Install Arch Linux
If you have already Arch Linux installed, you can skip this step and directly go to the install GNOME Desktop section below.
For a quick Arch Linux base installation, follow the below steps. You can also visit [this guide][1] for a complete tutorial on how to install Arch Linux as Dual Boot or in a virtual machine.
The following steps are a straightforward legacy way of installing Arch. Follow the guide below for a more modern way of using the archinstall script. Once you are done, come back to resume GNOME installation via [step 2][2].
Modern method: Install using archinstall script (recommended)
##### Legacy method: Download Arch Linux
Download Arch Linux .iso from the below link. There are magnet and torrent links available. Once you download, write the ISO to a USB drive. And then boot from the drive.
[Download Arch Linux][3]
If you are planning to install it as a virtual machine image via GNOME Boxes, virt-manager then you do not need to write it to a USB drive.
##### Boot and Configure Partitions
After you boot from the Arch Linux iso, you have to run a series of commands to install the base system.
First, run the below command to find out the device identifier.
```
fdisk -l
```
![fdisk -l before][4]
Then with the device identifier, run the below command to start partitioning your disk. Make sure to change `/dev/sda` as per your system.
```
cfdisk /dev/sda
```
Select `label type = dos` in the next prompt.
Select the free space and choose option NEW from the bottom. In this example, I will create three partitions as per below.
```
/dev/sda1 - 1G - for /boot/dev/sda2 - 5G - for root/dev/sda3 - 1G - for swap
```
![cfdisk][5]
In the next screen provide partition size for the boot partition (for this example, I gave 1 GB). Select it as the primary partition.
Repeat the same step for the main root partition of size 5GB.
![Swap partition type change][6]
Create a swap partition using the same steps with size 1G (you may change it as per your need). After you create the swap partition, make sure to choose Type at the bottom and mark it as a swap with the option “Linux Swap/Solaris”.
![final partition list in cfdisk][7]
Once done, write the changes to the disk using the Write option at the bottom. Make sure you take a backup before you write as this is a permanent change in your system.
Run the below command to check before you proceed. You can see in this example, three partitions are listed.
```
fdisk -l
```
![final partition list in fdisk][8]
Run the following commands in sequence to format and create an ext4 file system in the newly created partition above. Make sure you change the /dev/sda1 and /dev/sda2 as per your need.
```
mkfs.ext4 /dev/sda1mkfs.ext4 /dev/sda2mkswap /dev/sda3swapon /dev/sda3
```
After completion, mount the system and create necessary directories.
```
mount /dev/sda2 /mntmkdir /mnt/boot /mnt/var /mnt/homemount /dev/sda1 /mnt/boot
```
Again, make sure you change /dev/sda1, /dev/sda2 and /dev/sda3 as per your system.
![prepare file system][9]
##### Install the base system
I hope you are already connected to the internet. If not, try using a USB dongle or wired internet connection which Arch installer automatically configure and detect. If you do not have a wired connection available, follow [this guide][10] to configure a wireless or wifi network using Arch Linux installer.
Run the below commands in sequence to install the base system in the mounted partition. The download size is approx 400 MB.
```
pacman -Syypacstrap /mnt base base-devel linux linux-firmware nano dhcpcd net-tools grub
```
![Install base system][11]
Once complete, generate file system table without which you cant boot the system.
```
genfstab -U /mnt >> /mnt/etc/fstab
```
##### Configure the base system
Follow the below commands in sequence to configure the base system. This involves setting up your locale, language, add a login user, and setting up the internet.
```
arch-chroot /mntnano /etc/locale.gen
```
Uncomment the locale of your choice by removing # at the beginning. For this guide, I have chosen en_US.UTF-8 UTF-8. Press CTRL+O, Enter, and CTRL+X to exit from nano.
![change locale][12]
Generate the locale using:
```
locale-gen
```
Setup the language using the below command.
```
echo LANG=en_US.UTF-8 > /etc/locale.confexport LANG=en_US.UTF-8
```
Setup the local time zone.
```
ln -s /usr/share/zoneinfo/America/New_York /etc/localtime
```
Again, you can choose them as per your need. You can list the local timezones via the below commands.
```
ls /usr/share/zoneinfo
ls /usr/share/zoneinfo/America
```
Setup the hardware clock, create a hostname, and enable the DHCP for the internet using the below commands in sequence. You can change `"arindam-pc"` to any hostname as per your desire.
```
hwclock --systohc --utcecho arindam-pc > /etc/hostnamesystemctl enable dhcpcd
```
The next step is to set up the root user password, create an admin user, and add the user in the sudoers file.
Follow the below commands in sequence. Make sure to change the user name from `debugpoint` to something else as per your need.
```
passwd rootuseradd -m -g users -G wheel -s /bin/bash debugpointpasswd debugpoint
```
![create user][13]
Open the sudoers file and add the below lines.
```
nano /etc/sudoers
```
Add below lines. As you already created the root user, the entry should be there.
```
root ALL=(ALL) ALLdebugpoint ALL=(ALL) ALL
```
![update sudoers file][14]
Install grub, setup the initial ramdisk environment, unmount the system using the below commands in sequence.
```
grub-install /dev/sdagrub-mkconfig -o /boot/grub/grub.cfgmkinitcpio -p linuxexit
```
![configure grub][15]
Then reboot your system. If you are isntalling in a physical system, unplug the USB media at this step.
```
umount /mnt/boot
umount /mnt
reboot
```
You have now successfully installed the Arch Linux base system. Its time to install the complete GNOME desktop.
![Arch is installed][16]
#### Part 2: Install GNOME in Arch Linux
After reboot, choose Arch Linux from grub. In the Arch Linux prompt start running the following commands in sequence. These commands install Xorg server, display manager, GNOME desktop components, controller packages, and additional applications.
For all the commands use default, i.e. press enter when asked.
- **Install Xorg server. Approx install size is 80 MB.**
```
sudo pacman -S --needed xorg
```
- **Install display manager, GNOME desktop. Approx install size is 300 MB.**
```
sudo pacman -S --needed gnome gnome-tweaks nautilus-sendto gnome-nettool gnome-usage gnome gnome-multi-writer adwaita-icon-theme xdg-user-dirs-gtk fwupd arc-gtk-theme seahosrse gdm
```
The above installation would ask for several options for packages. Choose any of the ones you want. If you are unsure, choose jack, noto-sans and xdg-portal-desktop-gnome when asked.
- **Install applications**
This is just a reference. You can also install the ones you require.
```
sudo pacman -S --needed firefox vlc filezilla leafpad xscreensaver archlinux-wallpaper
```
Now its time to enable the display manager and network manager as service. So that next time you log on, they can run automatically by systemd.
```
systemctl enable gdm
systemctl enable NetworkManager
```
Reboot the system using the reboot command.
```
reboot
```
![Arch Linux Running GNOME 43 Desktop][17]
If all goes well, you should see a nice login prompt on the GNOME desktop. Login using the credential you just created. You should be greeted with a nice and clean GNOME 43 desktop in Arch Linux.
I hope this guide helps you to install GNOME desktop in a bare metal Arch instalation.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/gnome-arch-linux-install/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/2020/11/install-arch-linux/
[2]: https://www.debugpoint.com/archinstall-guide/
[3]: https://www.archlinux.org/download/
[4]: https://www.debugpoint.com/wp-content/uploads/2020/12/fdisk-l-before.jpg
[5]: https://www.debugpoint.com/wp-content/uploads/2020/12/cfdisk-1024x159.jpg
[6]: https://www.debugpoint.com/wp-content/uploads/2020/12/Swap-parition-type-change.jpg
[7]: https://www.debugpoint.com/wp-content/uploads/2020/12/final-partition-list-in-cfdisk-1024x178.jpg
[8]: https://www.debugpoint.com/wp-content/uploads/2020/12/final-partition-list-in-fdisk.jpg
[9]: https://www.debugpoint.com/wp-content/uploads/2020/12/prepare-file-system.jpg
[10]: https://www.debugpoint.com/2020/11/connect-wifi-terminal-linux/
[11]: https://www.debugpoint.com/wp-content/uploads/2020/12/Install-base-system-1024x205.jpg
[12]: https://www.debugpoint.com/wp-content/uploads/2020/12/change-locale.jpg
[13]: https://www.debugpoint.com/wp-content/uploads/2020/12/create-user.jpg
[14]: https://www.debugpoint.com/wp-content/uploads/2020/12/update-sudoers-file.jpg
[15]: https://www.debugpoint.com/wp-content/uploads/2020/12/configure-grub-1024x639.jpg
[16]: https://www.debugpoint.com/wp-content/uploads/2020/12/Arch-is-installed.jpg
[17]: https://www.debugpoint.com/wp-content/uploads/2020/12/Arch-Linux-Running-GNOME-43-Desktop-1024x636.jpg

View File

@ -0,0 +1,548 @@
[#]: subject: "Making a DNS query in Ruby from scratch"
[#]: via: "https://jvns.ca/blog/2022/11/06/making-a-dns-query-in-ruby-from-scratch/"
[#]: author: "Julia Evans https://jvns.ca/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Making a DNS query in Ruby from scratch
======
Hello! A while back I wrote a post about [how to write a toy DNS resolver in Go][1].
In that post I left out “how to generate and parse DNS queries” because I thought it was boring, but a few people pointed out that they did not know how to parse and generate DNS queries and they were interested in how to do it.
This made me curious how much work _is_ it do the DNS parsing? It turns out we can do it in a pretty nice 120-line Ruby program, which is not that bad.
So heres a quick post on how to generate DNS queries and parse DNS responses! Were going to do it in Ruby because Im giving a talk at a Ruby conference soon, and this blog post is partly prep for that talk :). Ive tried to keep it readable for folks who dont know Ruby though, Ive only used pretty basic Ruby code.
At the end were going to have a very simple toy Ruby version of `dig` that can look up domain names like this:
```
$ ruby dig.rb example.com
example.com 20314 A 93.184.216.34
```
The whole thing is about 120 lines of code, so its not _that_ much. (The final program is [dig.rb][2] if you want to skip the explanations and just read some code.) We wont implement the “how a DNS resolver works” from the previous post because, well, we already did that. Lets get into it!
Along the way Im going to try to explain how you could figure out some of this stuff yourself if you were trying to figure out how DNS queries are formatted from scratch. Mostly thats “poke around in Wireshark” and “read RFC 1035, the DNS RFC”.
### step 1: open a UDP socket
We need to actually _send_ our queries, so to do that we need to open a UDP socket. Well send our queries to `8.8.8.8`, Googles DNS server.
Heres the code to set up a UDP connection to `8.8.8.8`, port 53 (the DNS port).
```
require 'socket'
sock = UDPSocket.new
sock.bind('0.0.0.0', 12345)
sock.connect('8.8.8.8', 53)
```
##### a quick note on UDP
Im not going to say too much about UDP here, but I will say that the basic unit of computer networking is the “packet” (a packet is a string of bytes), and in this program were going to do the simplest possible thing you can do with a computer network send 1 packet and receive 1 packet in response.
So UDP is a way to send packets in the simplest possible way.
Its the most common way to send DNS queries, though you can also use TCP or DNS-over-HTTPS instead.
##### step 2: copy a DNS query from Wireshark
Next: lets say we have no idea how DNS works but we want to send a working query as fast as possible. The easiest way to get a DNS query to play with and make sure our UDP connection is working is to just copy one that already works!
So thats what were going to do, using Wireshark (an incredible packet analysis tool)
The steps I used to this are roughly:
1. Open Wireshark and click capture
2. Enter `udp.port == 53` as a filter (in the search bar)
3. Run `ping example.com` in my terminal (to generate a DNS query)
4. Click on the DNS query (“Standard query A example.com”)
5. Right click on “Domain Name System (query”) in the bottom left pane
6. Click Copy -> as a hex stream
7. Now I have “b96201000001000000000000076578616d706c6503636f6d0000010001” on my clipboard, to use in my Ruby program. Hooray!
##### step 3: decode the hex stream and send the DNS query
Now we can send our DNS query to `8.8.8.8`! Heres what that looks like: we just need to add 5 lines of code
```
hex_string = "b96201000001000000000000076578616d706c6503636f6d0000010001"
bytes = [hex_string].pack('H*')
sock.send(bytes, 0)
# get the reply
reply, _ = sock.recvfrom(1024)
puts reply.unpack('H*')
```
`[hex_string].pack('H*')` is translating our hex string into a byte string. At this point we dont really know what this data _means_ but well get there in a second.
We can also take this opportunity to make sure our program is working and is sending valid data, using `tcpdump`. How I did that:
1. Run `sudo tcpdump -ni any port 53 and host 8.8.8.8` in a terminal tab
2. In a different terminal tab, run [this Ruby program][3] (`ruby dns-1.rb`)
Heres what the output looks like:
```
$ sudo tcpdump -ni any port 53 and host 8.8.8.8
08:50:28.287440 IP 192.168.1.174.12345 > 8.8.8.8.53: 47458+ A? example.com. (29)
08:50:28.312043 IP 8.8.8.8.53 > 192.168.1.174.12345: 47458 1/0/0 A 93.184.216.34 (45)
```
This is really good - we can see the DNS request (“whats the IP for `example.com`”) and the response (“its 93.184.216.34”). So everything is working. Now we just need to, you know, figure out how to generate and decode this data ourselves.
##### step 4: learn a little about how DNS queries are formatted
Now that we have a DNS query for `example.com`, lets learn about what it means.
Heres our query, formatted as hex.
```
b96201000001000000000000076578616d706c6503636f6d0000010001
```
If you poke around in Wireshark, youll see that this query has 2 parts:
* The **header** (`b96201000001000000000000`)
* The **question** (`076578616d706c6503636f6d0000010001`)
##### step 5: make the header
Our goal in this step is to generate the byte string `b96201000001000000000000`, but with a Ruby function instead of hardcoding it.
So: the header is 12 bytes. What do those 12 bytes mean? If you look at Wireshark (or read [RFC 1035][4]), youll see that its 6 2-byte numbers concatenated together.
The 6 numbers correspond to the query ID, the flags, and then the number of questions, answer records, authoritative records, and additional records in the packet.
We dont need to worry about what all those things are yet though we just need to put in 6 numbers.
And luckily we know exactly which 6 numbers to put because our goal is to literally generate the string `b96201000001000000000000`.
So heres a function to make the header. (note: theres no `return` because you dont need to write `return` in Ruby if its the last line of the function)
```
def make_question_header(query_id)
# id, flags, num questions, num answers, num auth, num additional
[query_id, 0x0100, 0x0001, 0x0000, 0x0000, 0x0000].pack('nnnnnn')
end
```
This is very short because weve hardcoded everything except the query ID.
##### whats `nnnnnn`?
You might be wondering what `nnnnnn` is in `.pack('nnnnnn')`. Thats a format string telling `.pack()` how to convert that array of 6 numbers into a byte string.
[The documentation for `.pack` is here][5], and it says that `n` means “represent it as “16-bit unsigned, network (big-endian) byte order”.
16 bits is the same as 2 bytes, and we need to use network byte order because this is computer networking. Im not going to explain byte order right now (though I do have a [comic attempting to explain it][6])
##### test the header code
Lets quickly test that our `make_question_header` function works.
```
puts make_question_header(0xb962) == ["b96201000001000000000000"].pack("H*")
```
This prints out “true”, so we win and we can move on.
##### step 5: encode the domain name
Next we need to generate the **question** (“whats the IP for `example.com`?“). This has 3 parts:
* the **domain name** (for example “example.com”)
* the **query type** (for example “A” is for “IPv4 **A**ddress”
* the **query class** (which is always the same, 1 is for **IN** is for **IN**ternet)
The hardest part of this is the domain name so lets write a function to do that.
`example.com` is encoded in a DNS query, in hex, as `076578616d706c6503636f6d00`. What does that mean?
Well, if we translate the bytes into ASCII, it looks like this:
```
076578616d706c6503636f6d00
7 e x a m p l e 3 c o m 0
```
So each segment (like `example`) has its length (like 7) in front of it.
Heres the Ruby code to translate `example.com` into `7 e x a m p l e 3 c o m 0`:
```
def encode_domain_name(domain)
domain
.split(".")
.map { |x| x.length.chr + x }
.join + "\0"
end
```
Other than that, to finish generating the question section we just need to append the type and class onto the end of the domain name.
##### step 6: write `make_dns_query`
Heres the final function to make a DNS query:
```
def make_dns_query(domain, type)
query_id = rand(65535)
header = make_question_header(query_id)
question = encode_domain_name(domain) + [type, 1].pack('nn')
header + question
end
```
[Heres all the code weve written before in `dns-2.rb`][7] its still only 29 lines.
##### now for the parsing
Now that weve managed to _generate_ a DNS query, we get into the hard part: the parsing. Again, well split this into a bunch of different
* parse a DNS header
* parse a DNS name
* parse a DNS record
The hardest part of this (maybe surprisingly) is going to be “parse a DNS name”.
##### step 7: parse the DNS header
Lets start with the easiest part: the DNS header. We already talked about how its 6 numbers concatenated together.
So all we need to do is
* read the first 12 bytes
* convert that into an array of 6 numbers
* put those numbers in a class for convenience
Heres the Ruby code to do that.
```
class DNSHeader
attr_reader :id, :flags, :num_questions, :num_answers, :num_auth, :num_additional
def initialize(buf)
hdr = buf.read(12)
@id, @flags, @num_questions, @num_answers, @num_auth, @num_additional = hdr.unpack('nnnnnn')
end
end
```
Quick Ruby note: `attr_reader` is a Ruby thing that means “make these instance variables accessible as methods”. So you can call `header.flags` to look at the `@flags` variable.
We can call this with `DNSHeader(buf)`. Not so bad.
Lets move on to the hardest part: parsing a domain name.
##### step 8: parse a domain name
First, lets write a partial version.
```
def read_domain_name_wrong(buf)
domain = []
loop do
len = buf.read(1).unpack('C')[0]
break if len == 0
domain << buf.read(len)
end
domain.join('.')
end
```
This repeatedly reads 1 byte and then reads that length into a string until the length is 0.
This works great, for the first time we see a domain name (`example.com`) in our DNS response.
##### trouble with domain names: compression!
But the second time `example.com` appears, we run into trouble in Wireshark, it says that the domain is represented cryptically as just the 2 bytes `c00c`.
This is something called **DNS compression** and if we want to parse any DNS responses were going to have to implement it.
This is luckily not **that** hard. All `c00c` is saying is:
* The first 2 bits (`0b11.....`) mean “DNS compression ahead!”
* The remaining 14 bits are an integer. In this case that integer is `12` (`0x0c`), so that means “go back to the 12th byte in the packet and use the domain name you find there”
If you want to read more about DNS compression, I found the [explanation in the DNS RFC][8] relatively readable.
##### step 9: implement DNS compression
So we need a more complicated version of our `read_domain_name` function
Here it is.
```
domain = []
loop do
len = buf.read(1).unpack('C')[0]
break if len == 0
if len & 0b11000000 == 0b11000000
# weird case: DNS compression!
second_byte = buf.read(1).unpack('C')[0]
offset = ((len & 0x3f) << 8) + second_byte
old_pos = buf.pos
buf.pos = offset
domain << read_domain_name(buf)
buf.pos = old_pos
break
else
# normal case
domain << buf.read(len)
end
end
domain.join('.')
```
Basically whats happening is:
* if the first 2 bits are `0b11`, we need to do DNS compression. Then:
* read the second byte and do a little bit arithmetic to convert that into the offset
* save the current position in the buffer
* read the domain name at the offset we calculated
* restore our position in the buffer
This is kind of messy but its the most complicated part of parsing the DNS response, so were almost done!
##### step 10: parse a DNS query
You might think “why do we need to parse a DNS query? This is the response!”. But every DNS response has the original query in it, so we need to parse it.
Heres the code for parsing the DNS query.
```
class DNSQuery
attr_reader :domain, :type, :cls
def initialize(buf)
@domain = read_domain_name(buf)
@type, @cls = buf.read(4).unpack('nn')
end
end
```
Theres not very much to it: the type and class are 2 bytes each.
##### step 11: parse a DNS record
This is the exciting part the DNS record is where our query data lives! The “rdata field” (“record data”) is where the IP address were going to get in response to our DNS query lives.
Heres the code:
```
class DNSRecord
attr_reader :name, :type, :class, :ttl, :rdlength, :rdata
def initialize(buf)
@name = read_domain_name(buf)
@type, @class, @ttl, @rdlength = buf.read(10).unpack('nnNn')
@rdata = buf.read(@rdlength)
end
```
We also need to do a little work to make the `rdata` field human readable. The meaning of the record data depends on the record type for example for an “A” record its a 4-byte IP address, for but a “CNAME” record its a domain name.
So heres some code to make the request data human readable:
```
def read_rdata(buf, length)
@type_name = TYPES[@type] || @type
if @type_name == "CNAME" or @type_name == "NS"
read_domain_name(buf)
elsif @type_name == "A"
buf.read(length).unpack('C*').join('.')
else
buf.read(length)
end
end
```
This function uses this `TYPES` hash to map the record type to a human-readable name:
```
TYPES = {
1 => "A",
2 => "NS",
5 => "CNAME",
# there are a lot more but we don't need them for this example
}
```
The most interesting part of `read_rdata` is probably the line `buf.read(length).unpack('C*').join('.')` its saying “hey, an IP address is 4 bytes, so convert it into an array of 4 numbers and then join those with “.“s”.
##### step 12: finish parsing the DNS response
Now were ready to parse the DNS response!
Heres some code to do that:
```
class DNSResponse
attr_reader :header, :queries, :answers, :authorities, :additionals
def initialize(bytes)
buf = StringIO.new(bytes)
@header = DNSHeader.new(buf)
@queries = (1..@header.num_questions).map { DNSQuery.new(buf) }
@answers = (1..@header.num_answers).map { DNSRecord.new(buf) }
@authorities = (1..@header.num_auth).map { DNSRecord.new(buf) }
@additionals = (1..@header.num_additional).map { DNSRecord.new(buf) }
end
end
```
This mostly just calls the other functions weve written to parse the DNS response.
It uses this cute `(1..@header.num_answers).map` construction to create an array of 2 DNS records if `@header.num_answers` is 2. (which is maybe a _little_ bit of Ruby magic but I think its kind of fun and hopefully isnt too hard to read)
We can integrate this code into our main function like this:
```
sock.send(make_dns_query("example.com", 1), 0) # 1 is "A", for IP address
reply, _ = sock.recvfrom(1024)
response = DNSResponse.new(reply) # parse the response!!!
puts response.answers[0]
```
Printing out the records looks awful though (it says something like `#<DNSRecord:0x00000001368e3118>`). So we need to write some pretty printing code to make it human readable.
##### step 13: pretty print our DNS records
We need to add a `.to_s` field to DNS records to make them have a nice string representation. This is just a 1-line method in `DNSRecord`:
```
def to_s
"#{@name}\t\t#{@ttl}\t#{@type_name}\t#{@parsed_rdata}"
end
```
You also might notice that I left out the `class` field of the DNS record. Thats because its always the same (IN for “internet”) so I felt it was redundant. Most DNS tools (like real `dig`) will print out the class though.
##### and were done!
Heres our final `main` function:
```
def main
# connect to google dns
sock = UDPSocket.new
sock.bind('0.0.0.0', 12345)
sock.connect('8.8.8.8', 53)
# send query
domain = ARGV[0]
sock.send(make_dns_query(domain, 1), 0)
# receive & parse response
reply, _ = sock.recvfrom(1024)
response = DNSResponse.new(reply)
response.answers.each do |record|
puts record
end
```
I dont think theres too much to say about this we connect, send a query, print out each of the answers, and exit. Success!
```
$ ruby dig.rb example.com
example.com 18608 A 93.184.216.34
```
You can see the final program as a gist here: [dig.rb][2]. You could add more features to it if you want, like
* pretty printing for other query types
* options to print out the “authority” and “additional” sections of the DNS response
* retries
* making sure that the DNS response we see is _actually_ a response to the query we sent (the query ID has to match!
Also [you can let me know on Twitter][9] if Ive made a mistake in this post somewhere I wrote this pretty quickly so I probably got something wrong.
--------------------------------------------------------------------------------
via: https://jvns.ca/blog/2022/11/06/making-a-dns-query-in-ruby-from-scratch/
作者:[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://jvns.ca/blog/2022/02/01/a-dns-resolver-in-80-lines-of-go/
[2]: https://gist.github.com/jvns/1e5838a53520e45969687e2f90199770
[3]: https://gist.github.com/jvns/aa202b1edd97ae261715c806b2ba7d39
[4]: https://datatracker.ietf.org/doc/html/rfc1035#section-4.1.1
[5]: https://ruby-doc.org/core-3.0.0/Array.html#method-i-pack
[6]: https://wizardzines.com/comics/little-endian/
[7]: https://gist.github.com/jvns/3587ea0b4a2a6c20dcfd8bf653fc11d9
[8]: https://datatracker.ietf.org/doc/html/rfc1035#section-4.1.4
[9]: https://twitter.com/b0rk

View File

@ -0,0 +1,98 @@
[#]: subject: "How to Install MATE Desktop in Arch Linux [Complete Guide]"
[#]: via: "https://www.debugpoint.com/mate-desktop-arch-linux-install/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Install MATE Desktop in Arch Linux [Complete Guide]
======
**This guide explains the steps you need to install MATE Desktop in Arch Linux.**
This guide has two parts. The first part deals with installing the base Arch system. The second part is installing the complete MATE desktop environment on top of Arch Linux.
This article tested in the following versions: MATE 1.24, and MATE 1.26.
### What is the MATE Desktop?
When the GNOME desktop changed its direction from GNOME 2 to GNOME 3 by changing the user interaction and interface, the MATE desktop continued the older/Legacy GNOME 2 development. So, the MATE desktop environment continues the GNOME 2 desktop, which preserved the traditional desktop experience in Linux. It is fast and low on memory consumption. In my opinion, one of the underrated desktop environments which need more love!
The MATE team continued development as it is one of the popular GNOME 2 based desktop while supporting newer technologies. You can learn more on its [official website][1].
### Install MATE Desktop in Arch Linux
#### Part 1: Install Arch Linux
If you already have Arch Linux installed, you can skip this step and directly go to the [installation of MATE Desktop section below][2].
For a quick Arch Linux installation, follow this automated archinstall guide which is super easy to follow. And once installed, continue to Part 2.
#### Part 2: Install MATE Desktop in Arch Linux
After reboot, choose Arch Linux from grub. In the Arch Linux prompt, start running the following commands in sequence. These commands install the Xorg server, display manager, MATE desktop components, controller packages, and additional applications.
For all the commands, use default, i.e. press enter when asked.
- **Install Xorg. Approx install size is 80 MB.**
```
sudo pacman -S --needed xorg
```
- **Install display manager, and MATE desktop components. Approx install size is 380 MB.**
```
sudo pacman -S --needed mate mate-extra ttf-freefont lightdm lightdm-gtk-greeter
```
![Installing MATE Packages][3]
- **Install applications**
This is just a reference. You can also install the ones you require.
```
sudo pacman -S --needed firefox vlc filezilla leafpad xscreensaver archlinux-wallpaper
```
Now its time to enable the display manager and network manager as a service. So that the next time you log on, they can run automatically by systemd.
```
systemctl enable lightdm
systemctl enable NetworkManager
```
Reboot the system using the reboot command.
```
reboot
```
You should see a login prompt on the MATE desktop if all goes well.
And you can now log in using the user ID and password which you just created. A superfast and legacy MATE Desktop would welcome you.
![MATE Desktop in Arch Linux][4]
I hope this guide helps you create your own Arch Linux environment with a legacy MATE desktop from scratch. Please let me know if you run into trouble using the comment box below.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/mate-desktop-arch-linux-install/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://mate-desktop.org/
[2]: https://www.debugpoint.com/archinstall-guide/
[3]: https://www.debugpoint.com/wp-content/uploads/2021/08/Installing-MATE-Packages.jpg
[4]: https://www.debugpoint.com/wp-content/uploads/2021/08/MATE-Desktop-in-Arch-Linux-1.jpg

View File

@ -0,0 +1,166 @@
[#]: subject: "Ghostwriter: An Excellent Open-Source Writing App"
[#]: via: "https://itsfoss.com/ghostwriter/"
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Ghostwriter: An Excellent Open-Source Writing App
======
We have covered several [open-source tools for writers][1] with some distraction-free editors.
One of them is **Ghostwriter**. **It is available for Linux and Windows with an unofficial build for macOS.**
I will not blame you for accidentally reading it as “Ghost Rider” if you are a fan of it.
Keeping that aside, it looks like Ghostwriter is now under KDEs umbrella, with **Carl Schwan** (KDE Developer) as a sponsor. So, you can expect the writing app only to get better.
Hence, I think it is a good idea to spotlight KDEs newest addition to its Incubator, i.e., Ghostwriter as one of our weekly app highlights.
### Ghostwriter Excels At Distraction-Free Writing
![ghostwriter white][2]
A distraction-free writer is always welcome to write an article like this, make a technical document, or do other creative writing tasks.
Also, we need a reliable app that saves things in a jiffy.
**[Ghostwriter][3]**seems to be an excellent option with all the essentials. Let me highlight some of its key features.
### Features of Ghostwriter
![ghostwriter black][4]
As a distraction-free writing app, some users prefer a minimal set of features. But, Ghostwriter does not compromise on the toolset that you get with it to enhance your writing experience.
The main highlights include:
- **Focus mode to highlight specific regions you write/edit**
- **A full-screen mode**
- **Clean user interface**
- **Markdown support for easy formatting**
- **Built-in dark and light themes (toggle)**
- **Ability to customize the theme/create your version**
- **Live preview your Markdown document in HTML**
- **Sidebar with outline navigation**
- **Session and Document statistics (characters, words, paragraphs, average wpm, reading time, etc.)**
- **Ability to export to Pandoc, MultiMarkdown, commonmark**
- **A Hemingway mode to disable editing while writing (to help you focus on completing the brought draft faster)**
- **Drag and drop image support**
- **Autosave**
- **Cheatsheet to refer Markdown system without looking elsewhere**
### Experiencing Ghostwriter
![ghostwriter screenshot f37][5]
I tried using Ghostwriter on Fedora 37, and it worked as one would expect.
It presents a minimal user interface, which is easy to use, pleasing to look at, and not too fancy.
![ghostwriter toggle][6]
The availability of essential options as toggle buttons is much appreciated (**left-to-right**):
- Dark/Light mode toggle
- Live HTML preview
- Hemingway mode
- Focus mode
- Full-screen mode
In addition to the toggles, the document and session stats also come in handy to keep track of time spent, words written, and other valuable data.
![ghostwriter stats][7]
Another user interface element that I found helpful is the bottom status bar that you can customize.
![ghostwriter bottom][8]
**What do you need to focus on when writing?**
The editor lets you choose that to see as a priority stat. Whether you want to focus on the number fo words, speed, paragraphs, or time, you can set the bottom bar to change.
**To enhance the experience**, you can customize the theme to your liking, where you get to change the font, color of the title/text, and other elements of the user interface.
![ghostwriter theme edit][9]
While you already know that it supports Markdown, it will not stop you from working on it.
Even if it is your first time using Markdown, it includes a cheat sheet in the sidebar for quick access. Of course, if you need a dedicated editor for it, you can try exploring some of the [best Markdown editors][10] available.
Use the cheat sheet to add code blocks, links, text formatting, headings, and more.
![ghostwriter markdown cheatsheet][11]
Overall, if you closely take a glance at the screenshots, all the essential functionalities is accessible in a single click.
Unless you need to tweak the theme, change the file saving folder preference, and a few more available options, you do not need to leave the editor.
As a bonus, it includes useful export options for users who need it:
![ghostwriter export][12]
You can explore rest of the tiny bits and decide if it suits your requirements.
### Installing Ghostwriter on Linux
You can install Ghostwriter via a PPA for Ubuntu-based distros, and it is also available for Fedora through a separate repository.
To install Ghostwriter on Ubuntu-based distros, type in the following command:
```
sudo add-apt-repository ppa:wereturtle/ppa
sudo apt update
sudo apt install ghostwriter
```
If you are using Fedora, type in the following:
```
sudo dnf copr enable wereturtle/stable
sudo dnf install ghostwriter
```
You will also find a Flatpak package listed on [Flathub][13]. However, it does not seem to be a recommended option as per its official download page. You can give it a try, though.
Explore more about it on its [GitLab page][14] or the [official website][15].
### Not Too Fany, But Very Useful!
I think the user interface, the user experience, and the feature set are perfectly balanced for all kinds of use cases.
Of course, some do not need Markdown support, and some need more features to write/create chapters for their books. So, Ghostwriter may not be for everyone.
That said, the features you get with it make it well worth a try, regardless of your use case.
--------------------------------------------------------------------------------
via: https://itsfoss.com/ghostwriter/
作者:[Ankush Das][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/ankush/
[b]: https://github.com/lkxed
[1]: https://itsfoss.com/open-source-tools-writers/
[2]: https://itsfoss.com/wp-content/uploads/2022/11/ghostwriter-white.png
[3]: https://itsfoss.com/wp-content/uploads/2022/11/ghostwriter-black.png
[4]: https://itsfoss.com/wp-content/uploads/2022/11/ghostwriter-screenshot-f37.jpg
[5]: https://itsfoss.com/wp-content/uploads/2022/11/ghostwriter-toggle.jpg
[6]: https://itsfoss.com/wp-content/uploads/2022/11/ghostwriter-stats.jpg
[7]: https://itsfoss.com/wp-content/uploads/2022/11/ghostwriter-bottom.png
[8]: https://itsfoss.com/wp-content/uploads/2022/11/ghostwriter-theme-edit.jpg
[9]: https://itsfoss.com/best-markdown-editors-linux/
[10]: https://itsfoss.com/wp-content/uploads/2022/11/ghostwriter-markdown-cheatsheet.png
[11]: https://itsfoss.com/wp-content/uploads/2022/11/ghostwriter-export.png
[12]: https://flathub.org/apps/details/io.github.wereturtle.ghostwriter
[13]: https://ghostwriter.kde.org/download/
[14]: https://invent.kde.org/office/ghostwriter
[15]: https://ghostwriter.kde.org

View File

@ -0,0 +1,652 @@
[#]: subject: "Build your own SaaS on Linux with Vely"
[#]: via: "https://opensource.com/article/22/11/build-your-own-saas-vely"
[#]: author: "Sergio Mijatovic https://opensource.com/users/vely"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Build your own SaaS on Linux with Vely
======
Vely makes it possible to leverage the power of C in your web applications.
[Vely][1] combines high performance and the low footprint of C with the ease of use and improved safety of languages like PHP. It's free and open source software, licensed under GPLv3 and LGPL 3 for libraries, so you can even build commercial software with it.
### Using Vely for SaaS
You can use Vely to create a multitenant web application that you can run on the Internet as Software-as-a-Service (SaaS). Each user has a completely separate data space from any other.
In this example web application, a user can sign up for a notebook service to create notes and then view and delete them. It demonstrates several technology integrations in just 310 lines of code across seven source files. The technologies include:
- MariaDB
- Web browser
- Apache
- Unix sockets
#### How it works
Here's how the application works from a user's perspective. A code walk-through follows the images.
The app allows a user to create a new login by specifying an email address and password. You can style these any way you like, such as with CSS:
![Create a user account][2]
Verify the user's email:
![Verify the user's email address][3]
Each user logs in with their unique username and password:
![The user logs in][4]
Once logged in, a user can add a note:
![The user can add a note][5]
A user can get a list of notes:
![User lists notes][6]
The app asks for confirmation before deleting a note:
![The app asks for confirmation before deleting a note][7]
After the user confirms, the note is deleted:
![After confirmation, the note is deleted][8]
#### Setup prerequisites
Follow the installation instructions on [Vely.dev][9]. It's a quick process that uses standard packaging tools, such as DNF, APT, Pacman, or Zypper.
Because they are part of this example, you must install Apache as a web server and MariaDB as a database.
After installing Vely, turn on syntax highlighting in Vim if you're using it:
```
vv -m
```
#### Get the source code
The source code for this demonstration SaaS app is part of the Vely installation. It's a good idea to create a separate source code directory for each application (and you can name it whatever you like). In this case, unpacking the source code does that for you:
```
$ tar xvf $(vv -o)/examples/multitenant_SaaS.tar.gz
$ cd multitenant_SaaS
```
By default, the application is named `multitenant_SaaS`, but you can call it anything (if you do that, change it everywhere).
### Set up the application
The very first step is to create an application. It's simple to do with Vely's `vf` utility:
```
$ sudo vf -i-u $(whoami) multitenant_SaaS
```
This command creates a new application home (`/var/lib/vv/multitenant_SaaS`) and performs the application setup for you. Mostly, that means creating various subdirectories in the home folder and assigning privileges. In this case, only the current user (the result of `whoami`) owns the directories, with 0700 privileges, which ensures that no one else has access to the files.
### Set up the database
Before doing any coding, you need a place to store the information used by the application. First, create a MariaDB database called `db_multitenant_SaaS`, owned by the user `vely` with password `your_password`. You can change any of these values, but remember to change them everywhere during this example.
Logged in as root in the MySQL utility:
```
CREATEDATABASEIFNOTEXISTS db_multitenant_SaaS;
CREATEUSERIFNOTEXISTS vely IDENTIFIEDBY'your_password';
GRANTCREATE,ALTER,DROP,SELECT,INSERT,DELETE,UPDATEON db_multitenant_SaaS.*TO vely;
```
Then create database objects (tables and records and so on) in the database:
```
USE db_multitenant_SaaS;
SOURCE setup.sql;
exit
```
### Connect Vely to a database
To let Vely know where your database is and how to log into it, create a database config file named `db_multitenant_SaaS`. (This is the name used by the database statements in the source code, so if you change it, make sure you change it everywhere.)
Vely uses native MariaDB database connectivity, so you can specify any options that a given database lets you:
```
$ echo'[client]
user=vely
password=your_password
database=db_multitenant_SaaS
protocol=TCP
host=127.0.0.1
port=3306'> db_multitenant_SaaS
```
### Build the application
Use the `vv` utility to make the application, using the `--db` option to specify the MariaDB database and the database config file:
```
$ vv -q--db=mariadb:db_multitenant_SaaS
```
### Start the application server
To start the application server for your web application, use the `vf` FastCGI process manager. The application server uses a Unix socket to communicate with the web server (creating a reverse proxy):
```
$ vf -w3 multitenant_SaaS
```
This starts three daemon processes to serve the incoming requests. You can also start an adaptive server that increases the number of processes to serve more requests and gradually reduce the number of processes when they're not needed:
```
$ vf multitenant_SaaS
```
See `vf` for more options to help you achieve the best performance.
When you need to stop your application server, use the `-m quit` option:
```
$ vf -m quit multitenant_SaaS
```
### Set up the web server
This is a web application, so the application needs a web server. This example uses Apache by way of a Unix socket listener.
#### 1. Set up Apache
To configure Apache as a reverse proxy and connect your application to it, you need to enable FastCGI proxy support, which generally means using the `proxy` and `proxy_fcgi` modules.
For Fedora systems (or others, like Arch) enable the `proxy` and `proxy_fcgi` modules by adding (or uncommenting) the appropriate **LoadModule** directives in the `/etc/httpd/conf/httpd.conf` Apache configuration file.
For Debian, Ubuntu, and similar systems, enable the `proxy` and `proxy_fcgi` modules:
```
$ sudo a2enmod proxy
$ sudo a2enmod proxy_fcgi
```
For OpenSUSE, add these lines to the end of `/etc/apache2/httpd.conf`:
```
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
```
#### 2. Configure Apache
Now you must add the proxy information to the Apache configuration file:
```
ProxyPass "/multitenant_SaaS" unix:///var/lib/vv/multitenant_SaaS/sock/sock|fcgi://localhost/multitenant_SaaS
```
The location of your configuration may vary, depending on your Linux distribution:
- Fedora, CentOS, Mageia, and Arch: `/etc/httpd/conf/httpd.conf`
- Debian, Ubuntu, Mint: `/etc/apache2/apache2.conf`
- OpenSUSE: `/etc/apache2/httpd.conf`
#### 3. Restart
Finally, restart Apache. On Fedora and similar systems, as well as Arch Linux:
```
$ sudo systemctl restart httpd
```
On Debian and Debian-based systems, as well as OpenSUSE:
```
$ sudo systemctl restart apache2
```
### Set up local mail
This example uses email as a part of its function. If your server can already send email, you can skip this. Otherwise, you can use local mail (`myuser@localhost`) just to test it out. To do that, install Sendmail.
On Fedora and similar:
```
$ sudo dnf installsendmail
$ sudo systemctl start sendmail
```
On Debian systems (like Ubuntu):
```
$ sudo apt installsendmail
$ sudo systemctl start sendmail
```
When the application sends an email to a local user, such as `OS_user@localhost`, then you can verify that the email was sent by looking at `/var/mail/` (the "mail spool").
### Access the application server from the browser
Assuming you're running the application locally, use `http://127.0.0.1/multitenant_SaaS?req=notes&action=begin` to access your application server from your web browser. If you're running this on a live server on the Internet, you may need to adjust your firewall settings to allow HTTP traffic.
### Source code
This example application contains seven source files. You can review the code yourself (remember, it's just 310 lines across these files), but here's an overview of each one.
#### SQL setup (setup.sql)
The two tables created are:
- **users**: Information about each user. Each user in the **users** table has its own unique ID (**userId** column) along with other information such as email address and whether it's verified. There's also a hashed password. An actual password is never stored in plain text (or otherwise); a one-way hash is used to check the password.
- **notes**: Notes entered by the user. The **notes** table contains the notes, each along with **userId** column that states which user owns them. The **userId** column's value matches the namesake column from **users** table. This way, every note clearly belongs to a single user.
The file contents:
```
CREATETABLEIFNOTEXISTS notes (dateOf datetime, noteId BIGINTAUTO_INCREMENTPRIMARYKEY, userId BIGINT, note VARCHAR(1000));
CREATETABLEIFNOTEXISTS users (userId BIGINTAUTO_INCREMENTPRIMARYKEY, email VARCHAR(100), hashed_pwd VARCHAR(100), verified SMALLINT, verify_token VARCHAR(30),SESSIONVARCHAR(100));
CREATEUNIQUEINDEXIFNOTEXISTS users1 ON users (email);
```
#### Run-time data (login.h)
To properly display the Login, Sign Up, and Logout links, you need some flags that are available anywhere in the application. Also, the application uses cookies to maintain a session, so this needs to be available anywhere, for example, to verify that the session is valid. Every request sent to the application is confirmed that way. Only requests that come with verifiable cookies are permitted.
So to that effect, you have a **global_request_data** type `reqdata` (request data) and in it there's `sess_userId` (ID of user) and `sess_id` (user's current session ID). You also have rather self-explanatory flags that help render pages:
```
#ifndef _VV_LOGIN
#define _VV_LOGIN
typedef struct s_reqdata {
    bool displayed_logout; // true if Logout link displayed
    bool is_logged_in; // true if session verified logged-in
    char *sess_userId; // user ID of current session
    char *sess_id; // session ID
} reqdata;
void login_or_signup ();
#endif
```
#### Session checking and session data (_before.vely)
Vely has a notion of a **before_request_handler**. The code you write executes before any other code that handles a request. To do this, all you need is to write this code in a file named `_before.vely`, and the rest is automatically handled.
Anything that a SaaS application does, such as handling requests sent to an application, must be validated for security. This way, the application knows whether the caller has the permissions needed to perform an action.
Checking for permission is done here in a before-request handler. That way, whatever other code you have handling a request, you already have the session information.
To keep session data (like session ID and user ID) available anywhere in your code, you use **global_request_data**. It's just a generic pointer (**void***) to memory that any code that handles requests can access. This is perfect for handling sessions, as shown below:
```
#include "vely.h"
#include "login.h"
// _before() is a before-request-handler. It always executes before
// any other code that handles a request. It's a good place for any
// kind of request-wide setting or data initialization
void _before() {
    // Output HTTP header
    out-header default
    reqdata *rd; // this is global request data, see login.h
    // allocate memory for global request data, will be automatically deallocated
    // at the end of request
    new-mem rd size sizeof(reqdata)
    // initialize flags
    rd->displayed_logout = false;
    rd->is_logged_in = false;
    // set the data we created to be global request data, accessible
    // from any code that handles a request
    set-req data rd
    // check if session exists (based on cookies from the client)
    // this executes before any other request-handling code, making it
    // easier to just have session information ready
    _check_session ();
}
```
#### Checking if the session is valid (_check_session.vely)
One of the most important tasks in a multitenant SaaS application is to check (as soon as possible) if the session is valid by checking whether a user is logged in. It's done by getting the session ID and user ID cookies from the client (such as a web browser) and checking these against the database where sessions are stored:
```
#include "vely.h"
#include "login.h"
// Check if session is valid
void _check_session () {
    // Get global request data
    reqdata *rd;
    get-req data to rd
    // Get cookies from user browser
    get-cookie rd->sess_userId="sess_userId"
    get-cookie rd->sess_id="sess_id"
    if (rd->sess_id[0] != 0) {
        // Check if session ID is correct for given user ID
        char *email;
        run-query @db_multitenant_SaaS = "select email from users where userId='%s' and session='%s'" output email : rd->sess_userId, rd->sess_id row-count define rcount
            query-result email to email
        end-query
        if (rcount == 1) {
            // if correct, set logged-in flag
            rd->is_logged_in = true;
            // if Logout link not display, then display it
            if (rd->displayed_logout == false) {
                @Hi <<p-out email>>! <a href="https://opensource.com/?req=login&action=logout">Logout</a><br/>
                rd->displayed_logout = true;
            }
        } else rd->is_logged_in = false;
    }
}
```
#### Signing up, Logging in, Logging out (login.vely)
The basis of any multitenant system is the ability for a user to sign up, log in, and log out. Typically, signing up involves verifying the email address; more often than not, the same email address is used as a username. That's the case here.
There are several subrequests implemented here that are necessary to perform the functionality:
- When Signing Up a new user, display the HTML form to collect the information. The URL request signature for this is `req=login&action=newuser`.
- As a response to the Sign Up form, create a new user. The URL request signature is `req=login&action=createuser`. The **input-param** signal obtains an **email** and **pwd** POST form fields. The password value is a one-way hash, and an email verification token is created as a random five-digit number. These are inserted into the **users** table, creating a new user. A verification email is sent, and the user is prompted to read the email and enter the code.
- Verify the email by entering the verification code sent to that email. The URL request signature is `req=login&action=verify`.
- Display a Login form for the user to log in. The URL request signature is `req=login` (for instance, `action` is empty.)
- Log in by verifying the email address (username) and password. The URL request signature is `req=login&action=login`.
- Logout at the user's request. The URL request signature is `req=login&action=logout`.
- Landing page for the application. The URL request signature is `req=login&action=begin`.
- If the user is currently logged in, go to the application's landing page.
See examples of these below:
```
#include "vely.h"
#include "login.h"
// Handle session maintenance, login, logout, session verification
// for any multitenant Cloud application
void login () {
    // Get URL input parameter "action"
    input-param action
    // Get global request data, we record session information in it, so it's handy
    reqdata *rd;
    get-req data to rd
    // If session is already established, the only reason why we won't proceed to
    // application home is if we're logging out
    if (rd->is_logged_in) {
        if (strcmp(action, "logout")) {
            _show_home();
            exit-request
        }
    }
    // Application screen to get started. Show links to login or signup and show
    // home screen appropriate for this
    if (!strcmp (action, "begin")) {
        _show_home();
        exit-request
    // Start creating new user. Ask for email and password, then proceed to create user
    // when this form is submitted.
    } else if (!strcmp (action, "newuser")) {
        @Create New User<hr/>
        @<form action="https://opensource.com/?req=login" method="POST">
        @<input name="action" type="hidden" value="createuser">
        @<input name="email" type="text" value="" size="50" maxlength="50" required autofocus placeholder="Email">
        @<input name="pwd" type="password" value="" size="50" maxlength="50" required placeholder="Password">
        @<input type="submit" value="Sign Up">
        @</form>
    // Verify code sent to email by user. The code must match, thus verifying email address    
    } else if (!strcmp (action, "verify")) {
        input-param code
        input-param email
        // Get verify token based on email
        run-query @db_multitenant_SaaS = "select verify_token from users where email='%s'" output db_verify : email
            query-result db_verify to define db_verify
            // Compare token recorded in database with what user provided
            if (!strcmp (code, db_verify)) {
                @Your email has been verifed. Please <a href="https://opensource.com/?req=login">Login</a>.
                // If matches, update user info to indicate it's verified
                run-query @db_multitenant_SaaS no-loop = "update users set verified=1 where email='%s'" : email
                exit-request
            }
        end-query
        @Could not verify the code. Please try <a href="https://opensource.com/?req=login">again</a>.
        exit-request
    // Create user - this runs when user submits form with email and password to create a user    
    } else if (!strcmp (action, "createuser")) {
        input-param email
        input-param pwd
        // create hashed (one-way) password
        hash-string pwd to define hashed_pwd
        // generate random 5 digit string for verify code
        random-string to define verify length 5 number
        // create user: insert email, hashed password, verification token. Current verify status is 0, or not verified
        begin-transaction @db_multitenant_SaaS
        run-query @db_multitenant_SaaS no-loop = "insert into users (email, hashed_pwd, verified, verify_token, session) values ('%s', '%s', '0', '%s', '')" : email, hashed_pwd, verify affected-rows define arows error define err on-error-continue
        if (strcmp (err, "0") || arows != 1) {
            // if cannot add user, it probably doesn't exist. Either way, we can't proceed.
            login_or_signup();
            @User with this email already exists.
            rollback-transaction @db_multitenant_SaaS
        } else {
            // Create email with verification code and email it to user
            write-string define msg
                @From: vely@vely.dev
                @To: <<p-out email>>
                @Subject: verify your account
                @
                @Your verification code is: <<p-out verify>>
            end-write-string
            exec-program "/usr/sbin/sendmail" args "-i", "-t" input msg status define st
            if (st != 0) {
                @Could not send email to <<p-out email>>, code is <<p-out verify>>
                rollback-transaction @db_multitenant_SaaS
                exit-request
            }
            commit-transaction @db_multitenant_SaaS
            // Inform the user to go check email and enter verification code
            @Please check your email and enter verification code here:
            @<form action="https://opensource.com/?req=login" method="POST">
            @<input name="action" type="hidden" value="verify" size="50" maxlength="50">
            @<input name="email" type="hidden" value="<<p-out email>>">
            @<input name="code" type="text" value="" size="50" maxlength="50" required autofocus placeholder="Verification code">
            @<button type="submit">Verify</button>
            @</form>
        }
    // This runs when logged-in user logs out.    
    } else if (!strcmp (action, "logout")) {
        // Update user table to wipe out session, meaning no such user is logged in
        if (rd->is_logged_in) {
            run-query @db_multitenant_SaaS = "update users set session='' where userId='%s'" : rd->sess_userId no-loop affected-rows define arows
            if (arows == 1) {
                rd->is_logged_in = false; // indicate user not logged in
                @You have been logged out.<hr/>
            }
        }
        _show_home();
    // Login: this runs when user enters user name and password
    } else if (!strcmp (action, "login")) {
        input-param pwd
        input-param email
        // create one-way hash with the intention of comparing with user table - password is NEVER recorded
        hash-string pwd to define hashed_pwd
        // create random 30-long string for session ID
        random-string to rd->sess_id length 30
        // Check if user name and hashed password match
        run-query @db_multitenant_SaaS = "select userId from users where email='%s' and hashed_pwd='%s'" output sess_userId : email, hashed_pwd
            query-result sess_userId to rd->sess_userId
            // If match, update user table with session ID
            run-query @db_multitenant_SaaS no-loop = "update users set session='%s' where userId='%s'" : rd->sess_id, rd->sess_userId affected-rows define arows
            if (arows != 1) {
                @Could not create a session. Please try again. <<.login_or_signup();>> <hr/>
                exit-request
            }
            // Set user ID and session ID as cookies. User's browser will return those to us with every request
            set-cookie "sess_userId" = rd->sess_userId
            set-cookie "sess_id" = rd->sess_id
            // Display home, make sure session is correct first and set flags
            _check_session();
            _show_home();
            exit-request
        end-query
        @Email or password are not correct. <<.login_or_signup();>><hr/>
    // Login screen, asks user to enter user name and password    
    } else if (!strcmp (action, "")) {
        login_or_signup();
        @Please Login:<hr/>
        @<form action="https://opensource.com/?req=login" method="POST">
        @<input name="action" type="hidden" value="login" size="50" maxlength="50">
        @<input name="email" type="text" value="" size="50" maxlength="50" required autofocus placeholder="Email">
        @<input name="pwd" type="password" value="" size="50" maxlength="50" required placeholder="Password">
        @<button type="submit">Go</button>
        @</form>
    }
}
// Display Login or Sign Up links
void login_or_signup() {
        @<a href="https://opensource.com/?req=login">Login</a> & & <a href="https://opensource.com/?req=login&action=newuser">Sign Up</a><hr/>
}
```
#### General-purpose application (_show_home.vely)
With this tutorial, you can create any multitenant SaaS application you want. The multitenant-processing module above (`login.vely`) calls the **_show_home()** function, which can house any code of yours. This example code shows the Notes application, but it could be anything. The **_show_home()** function calls any code you wish and is a general-purpose multitenant application plug-in:
```
#include "vely.h"
void _show_home() {
    notes();
    exit-request
}
```
#### Notes application (notes.vely)
The application is able to add, list, and delete any given note:
```
#include "vely.h"
#include "login.h"
// Notes application in a multitenant Cloud
void notes () {
    // get global request data
    reqdata *rd;
    get-req data to rd
    // If session invalid, display Login or Signup
    if (!rd->is_logged_in) {
        login_or_signup();
    }
    // Greet the user
    @<h1>Welcome to Notes!</h1><hr/>
    // If not logged in, exit - this ensures security verification of user's identity
    if (!rd->is_logged_in) {
        exit-request
    }
    // Get URL parameter that tells Notes what to do
    input-param subreq
    // Display actions that Notes can do (add or list notes)
    @<a href="https://opensource.com/?req=notes&subreq=add">Add Note</a> <a href="https://opensource.com/?req=notes&subreq=list">List Notes</a><hr/>
    // List all notes for this user
    if (!strcmp (subreq, "list")) {
        // select notes for this user ONLY
        run-query @db_multitenant_SaaS = "select dateOf, note, noteId from notes where userId='%s' order by dateOf desc" : rd->sess_userId output dateOf, note, noteId
            query-result dateOf to define dateOf
            query-result note to define note
            query-result noteId to define noteId
            // change new lines to <br/> with fast cached Regex
            match-regex "\n" in note replace-with "<br/>\n" result define with_breaks status define st cache
            if (st == 0) with_breaks = note; // nothing was found/replaced, just use original
            // Display a note
            @Date: <<p-out dateOf>> (<a href="https://opensource.com/?req=notes&subreq=delete_note_ask&note_id=%3C%3Cp-out%20noteId%3E%3E">delete note</a>)<br/>
            @Note: <<p-out with_breaks>><br/>
            @<hr/>
        end-query
    }
    // Ask to delete a note
    else if (!strcmp (subreq, "delete_note_ask")) {
        input-param note_id
        @Are you sure you want to delete a note? Use Back button to go back, or <a href="https://opensource.com/?req=notes&subreq=delete_note&note_id=%3C%3Cp-out%20note_id%3E%3E">delete note now</a>.
    }
    // Delete a note
    else if (!strcmp (subreq, "delete_note")) {
        input-param note_id
        // Delete note
        run-query @db_multitenant_SaaS = "delete from notes where noteId='%s' and userId='%s'" : note_id, rd->sess_userId affected-rows define arows no-loop error define errnote
        // Inform user of status
        if (arows == 1) {
            @Note deleted
        } else {
            @Could not delete note (<<p-out errnote>>)
        }
    }
    // Add a note
    else if (!strcmp (subreq, "add_note")) {
        // Get URL POST data from note form
        input-param note
        // Insert note under this user's ID
        run-query @db_multitenant_SaaS = "insert into notes (dateOf, userId, note) values (now(), '%s', '%s')" : rd->sess_userId, note affected-rows define arows no-loop error define errnote
        // Inform user of status
        if (arows == 1) {
            @Note added
        } else {
            @Could not add note (<<p-out errnote>>)
        }
    }
    // Display an HTML form to collect a note, and send it back here (with subreq="add_note" URL param)
    else if (!strcmp (subreq, "add")) {
        @Add New Note
        @<form action="https://opensource.com/?req=notes" method="POST">
        @<input name="subreq" type="hidden" value="add_note">
        @<textarea name="note" rows="5" cols="50" required autofocus placeholder="Enter Note"></textarea>
        @<button type="submit">Create</button>
        @</form>
    }
}
```
### SaaS with C performance
Vely makes it possible to leverage the power of C in your web applications. A multitenant SaaS application is a prime example of a use case that benefits from that. Take a look at the code examples, write some code, and give Vely a try.
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/11/build-your-own-saas-vely
作者:[Sergio Mijatovic][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/vely
[b]: https://github.com/lkxed
[1]: https://opensource.com/article/22/5/write-c-appplications-vely-linux
[2]: https://opensource.com/sites/default/files/2022-10/1createuser.png
[3]: https://opensource.com/sites/default/files/2022-10/2verifyemail.png
[4]: https://opensource.com/sites/default/files/2022-10/3login.png
[5]: https://opensource.com/sites/default/files/2022-10/4addnote.png
[6]: https://opensource.com/sites/default/files/2022-10/5listnotes.png
[7]: https://opensource.com/sites/default/files/2022-10/6confirmdelete.png
[8]: https://opensource.com/sites/default/files/2022-10/7notedeleted.png
[9]: https://vely.dev/

View File

@ -0,0 +1,184 @@
[#]: subject: "How to Install Node.js on RHEL 9"
[#]: via: "https://www.linuxtechi.com/how-to-install-nodejs-on-rhel/"
[#]: author: "James Kiarie https://www.linuxtechi.com/author/james/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Install Node.js on RHEL 9
======
In this post, we will explain how to install Node.js on RHEL 9 system step-by-step.
Built on Googles V8 Javascript engine, [Node.js][1] is a free and opensource, cross-platform JavaScript runtime that is mostly used for building server-side applications. It uses an event-driven and asynchronous model that helps developers build highly scalable, data-intensive real-time applications (RTAs ). You can use NodeJS to build both front-end and back-end applications.
Node.js is commonly used in building the following applications:
- Chat applications
- Streaming applications
- Browser games
- Command-line tools
- Embedded systems
Top companies that use NodeJS in their tech stacks include PayPal, Netflix, and Uber to mention a few.
There are three main ways of installing Node.JS:
- Installing Node.JS from the NodeSource repository
- Installing Node.JS from the distributions Official repository
- Installing Node.JS using NVM
Let us check out how to install Node.JS on RHEL 9 using each of these methods.
##### Prerequisites
- Minimal Installed RHEL 9 System
- [Sudo User][2] with admin rights
- Internet Connectivity
- Red Hat Subscription or locally configured repository
### Installing Node.js from NodeSource Repository
[NodeSource][3]is a technology company that seeks to help organizations run production-ready Node.Js applications with more focus on resource usage and enhanced security and application performance. It provides the latest versions of Node.JS and NPM.
To install Node.SJ from Nodesource, first, update the system packages as shown.
```
$ sudo dnf update -y
```
Next, install the required build tools which will be required during the installation of Node.JS. These include the GCC c/c++ compiler, Perl, and Python debuggers to mention a few.
```
$ sudo dnf groupinstall 'Development Tools' -y
```
Next, we are going to install Node.JS 18.x from Nodesource. To do this, download and run the NodeSource setup script as follows.
```
$ curl -fsSL https://rpm.nodesource.com/setup_18.x | sudo bash -
```
The script adds the Nodesource repository to your system among other tasks
At the tail end of the output, you will see some additional instructions provided on how to install Node.JS and npm.
Therefore, to install Node.JS and npm (Node Package Manager), run the command:
```
$ sudo dnf install nodejs -y
```
Once the installation is complete, verify the version of Node.JS and NPM as shown.
```
$ node -v
$ npm -v
```
The output shows that we are running Node v18.12 which is the latest LTS release and NPM 8.19.2.
### Installing Node.js from the official RHEL repositories
The other way of installing NodeJS and NPM is by installing them from your distributions official repository. However, this approach does not provide the latest versions.
If you dont mind not installing the latest versions of Node and NPM. , then run the following command on the command line.
```
$ sudo dnf update -y
$ sudo dnf install nodejs npm -y
```
### Installing Node.js using NVM
Lastly, you can install Node.JS using NVM ( Node Version Manager) which is a tool for managing Node versions on your system. The tool helps developers work efficiently on different projects which require different versions of Node.JS
NVM is not installed by default You need to install it by running the Shell script which is available on the [Official GitHub Page][4].
```
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
```
This downloads and saves nvm in the .nvm directory in your home directory.
Once installed, close your terminal sessions and open a new terminal. Then run the following command to confirm that NVM has been installed.
```
$ command -v nvm
```
Next, you can list all the available versions of Node.JS using the following command:
```
$ nvm ls-remote
```
Alternatively, you can list all the latest LTS releases for Node.JS versions as shown.
```
$ nvm ls-remote | grep -i latest
```
To install the very latest version of Node.JS (currently v19.0.0 ), run the command:
```
$ nvm install node
```
You can then verify the version of Node installed as shown.
```
$ node -v
```
In addition, you can install a specific version of Node. JS. For example, to install v18.2.0, run the command:
```
$ nvm install v18.12.0
```
To list all the installed versions of NodeJS on your system, run the command:
```
$ nvm ls
```
The first entry with the sign ( > ) points to the version of Node.JS that is currently in use. This is then followed by other versions as indicated below
To switch to another version of Node.JS, use the syntax:
```
$ nvm use <version>
```
For example, to use Node version 19.0.0, run the command:
```
$ nvm use 19.0.0
```
Again, check the installed versions of Node.JS, and this time the  ( > ) sign will point to v19.0.0
##### Conclusion
In this guide, we have demonstrated how to install Node.js using three different methods. In addition, we have provided a few ways in which you can manage the Node versions using NVM. We hope that you can now comfortably install NodeJS on RHEL and choose the version that you want to work with on your project.
--------------------------------------------------------------------------------
via: https://www.linuxtechi.com/how-to-install-nodejs-on-rhel/
作者:[James Kiarie][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.linuxtechi.com/author/james/
[b]: https://github.com/lkxed
[1]: https://nodejs.org/en/about/
[2]: https://www.linuxtechi.com/create-sudo-user-on-rhel-rocky-linux-almalinux/
[3]: https://nodesource.com/
[4]: https://github.com/nvm-sh/nvm

View File

@ -0,0 +1,84 @@
[#]: subject: "How to Install OpenOffice in Arch Linux [Beginners Guide]"
[#]: via: "https://www.debugpoint.com/install-openoffice-arch/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Install OpenOffice in Arch Linux [Beginners Guide]
======
**An absolute beginners guide to install OpenOffice in Arch Linux and its derivatives.**
[OpenOffice][1] is the oldest free and open-source office productivity suite which has been under maintenance for some time. It was developed by Apache and is still a sought-after suite, although it has been forked as LibreOffice.
This tutorial is for those who want to install OpenOffice for their work and other needs.
**Note**: Before you install, remember that many updated features and compatibility with Microsoft Office are not thoroughly supported in OpenOffice. If you want a more modern version of Office suite, try [LibreOffice][2].
### Installing OpenOffice in Arch Linux
The [OpenOffice package][3] is available in Arch User Repository. So, to install it, you need to use an Aur helper program. Heres what you need to do. Follow the steps mentioned below to install Yay AUR helper. A detailed guide is [present here][4] if you want to learn more about Yay.
- Run the following commands in sequence to install basic packages and clone Yay.
```
sudo pacman -S base-develsudo pacman -S gitcd /optsudo git clone https://aur.archlinux.org/yay.git
```
- Run the following command by replacing `debugpoint` with your Arch systems user name.
```
sudo chown -R debugpoint:users ./yay
```
- Finally, install the AUR helper using the following command.
```
cd yaymakepkg -si
```
- Once finished, install OpenOffice using the following:
```
yay -S openoffice-bin
```
![Install OpenOffice in Arch Linux via Yay helper][5]
Follow the onscreen instructions. After installation, you can find it in the application menu, as shown in the below image.
Launch OpenOffice and add your name and details to the start wizard, and you are good to go.
![OpenOffice in Arch Linux Application Menu (XFCE)][6]
![Latest OpenOffice running in Arch Linux][7]
### Wrapping Up
Using the above method, you can also install OpenOffice in Majnaro and other Arch Linux-based distros. Although it is an older office productivity suite, you should remember that it is not fully compatible with modern Microsoft Office document types (such as docx, xlsx).
If you run into any errors during installation, drop us a note in the comment box below.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/install-openoffice-arch/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.openoffice.org/
[2]: https://www.debugpoint.com/install-latest-libreoffice-ubuntu-linux/
[3]: https://aur.archlinux.org/packages/openoffice-bin
[4]: https://www.debugpoint.com/install-yay-arch/
[5]: https://www.debugpoint.com/wp-content/uploads/2022/11/Install-OpenOffice-in-Arch-Linux-via-Yay-helper.jpg
[6]: https://www.debugpoint.com/wp-content/uploads/2022/11/OpenOffice-in-Arch-Linux-Application-Menu-XFCE.jpg
[7]: https://www.debugpoint.com/wp-content/uploads/2022/11/Latest-OpenOffice-running-in-Arch-Linux.jpg

View File

@ -0,0 +1,172 @@
[#]: subject: "Apt++? Nala is Like Apt in Ubuntu but Better"
[#]: via: "https://itsfoss.com/nala/"
[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Apt++? Nala is Like Apt in Ubuntu but Better
======
For decades Debian and Ubuntu users [used apt-get commands][1]. When its simpler form apt was released, people liked how it showed a progress bar while installing packages.
Irrespective of the progress bar, the packages get installed the same with apt-get and apt commands.
But the progress bar enhances the user experience (UX) and today if I dont see the green progress bar at the bottom, I feel something is amiss.
Why am I telling you all this? Because I got an [apt-get vs apt][2] feeling when I used [Nala][3], a Python-based front end for APT.
Take a look at a screenshot of [apt package upgrade][4] in progress with nala.
![installing packages using nala][5]
Like apt enhanced the user experience from apt-get, nala takes it to the next level by making it more human-readable and presenting only the relevant info with beautiful colors.
But Nala does a lot more than adding colors to the terminal.
### Nala: An enhanced, user-friendly tool for managing apt packages
![using nala to remove packages][6]
As you can see, It brought the list of packages that will be affected by the command I executed. And it presented only relevant info with beautiful colors.
This is only one of the core features of Nala. Here are others:
- Parallel downloads.
- Checks for the fastest mirrors and uses the fastest 3 by default to speed up downloads.
- Each command you execute will be stored as Nala history with a unique ID.
- Compatible with Fish and Zsh.
- Makes Apt more human-readable than ever.
Sounds interesting? Lets see how you can install and use it.
### Installing Nala in Ubuntu 22.04 and higher
Starting with 22.04, Nala is present in the universe repository of Ubuntu. So, the installation process is going to be one command only:
```
sudo apt install nala
```
For older versions, refer to the [official wiki][7] for installation instructions.
### Using Nala in Ubuntu
Using Nala is fairly simple as it follows almost the same command structure as apt. This means that you just have to interchange apt with nala in every command.
For example, you can update repositories with Nala using this command:
```
sudo nala update
```
![sudo nala update][8]
Similarly, to install a package:
```
sudo nala install package_name
```
And the package can be removed using:
```
sudo nala remove package_name
```
Thats elementary. Lets see about using other interesting features I mentioned earlier.
#### Fetch the fastest mirrors in Nala
To fetch the fastest mirrors, youd need to utilize the `fetch` utility. First, it will determine whether you are using Debian or Ubuntu and then list the fastest mirrors:
```
sudo nala fetch
```
![sudo nala fetch][9]
And as you can see, I kept the top 4 fastest mirrors by separating them with their index number. Once you select them and press enter, it will show the summary:
![saving fastest mirrors for nala][10]
Press `Y` and it will save changes. Now, update Nala to take effect:
```
sudo nala update
```
#### Use transactional history
This is the interactive way you list and use the history command inspired by the DNF history utility.
You have to pair `history` with the nala command, and it will bring previously executed commands with relevant info:
```
nala history
```
![nala history][11]
You can use an ID with `nala history` and it will get you the details of the specific operation. For example, if I want to have details of what it did while installing curl, Id have to use ID no 9:
```
nala history info 9
```
![nala history info 9][12]
But thats not it. You can alter the effect of a command using history. For example, I installed curl, so I can alter the effect (will remove the software) using the given command:
```
sudo nala history undo 9
```
![sudo nala history undo 9][13]
And you can redo the command from history using its ID. For example, I installed curl (ID = 9) previously, and if I want to do the same again, I have to use `redo` :
```
sudo nala history redo 9
```
![sudo nala history redo 9][14]
### Wrapping Up
I understand that the apt command works fine. And I am not suggesting that everyone should replace apt with nala. Its just good to see projects like these to focus on user experience.
They are clearly inspired by the DNF package manager of Fedora and thats not a bad thing. The apt developers can also take some hints and add similar features in future.
For now, please share in the comments whether you liked nala or not. And if you liked it, will you use it extensively in place of [apt commands][15]?
--------------------------------------------------------------------------------
via: https://itsfoss.com/nala/
作者:[Sagar Sharma][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/sagar/
[b]: https://github.com/lkxed
[1]: https://itsfoss.com/apt-get-linux-guide/
[2]: https://itsfoss.com/apt-vs-apt-get-difference/
[3]: https://gitlab.com/volian/nala
[4]: https://itsfoss.com/apt-update-vs-upgrade/
[5]: https://itsfoss.com/wp-content/uploads/2022/11/installing-packages-using-nala-1.png
[6]: https://itsfoss.com/wp-content/uploads/2022/11/using-nala-to-remove-packages.png
[7]: https://gitlab.com/volian/nala/-/wikis/Installation
[8]: https://itsfoss.com/wp-content/uploads/2022/11/sudo-nala-update.png
[9]: https://itsfoss.com/wp-content/uploads/2022/11/sudo-nala-fetch.png
[10]: https://itsfoss.com/wp-content/uploads/2022/11/saving-fastest-mirrors-for-nala.png
[11]: https://itsfoss.com/wp-content/uploads/2022/11/nala-history.png
[12]: https://itsfoss.com/wp-content/uploads/2022/11/nala-history-info-9.png
[13]: https://itsfoss.com/wp-content/uploads/2022/11/sudo-nala-history-undo-9.png
[14]: https://itsfoss.com/wp-content/uploads/2022/11/sudo-nala-history-redo-9.png
[15]: https://itsfoss.com/apt-command-guide/

View File

@ -0,0 +1,286 @@
[#]: subject: "How to Install LXQt Desktop in Arch Linux [Complete Guide]"
[#]: via: "https://www.debugpoint.com/lxqt-arch-linux-install/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Install LXQt Desktop in Arch Linux [Complete Guide]
======
**This guide explains the steps you need to install LXQt Desktop in Arch Linux.**
**This guide has two parts. The first part deals with installing the base Arch system. The second part is installing the complete LXQt desktop environment on top of Arch Linux.**
### What is the LXQt Desktop?
LXQt is a lightweight Linux desktop environment based on Qt technology. It is known to be lighter than all traditional desktop environments available today. Arguably it is faster and consumes fewer resources than its equivalents, such as Xfce and Mate desktops.
LXQt desktop is available in other Linux distributions as one of the offerings. Fedora and Ubuntu provide an LXQt flavour as well. However, you can also install it in Arch Linux to enjoy the latest LXQt tech as a rolling release.
### Install LXQt Desktop in Arch Linux
#### Part 1: Install Arch Linux
If you already have Arch Linux installed, you can skip this step and directly go to the install LXQt Desktop section below.
For a faster Arch Linux installation, refer to [this guide for installing Arch via automated script][1]. For the legacy way of installation method, refer to the below steps.
##### Download Arch Linux
Download Arch Linux .iso from the below link. There are magnet and torrent links available. Once you download, write the ISO to a USB drive. And then boot from the drive.
[Download Arch Linux][2]
If you plan to install it as a virtual machine image via GNOME Boxes, virt-manager, you do not need to write it to a USB drive.
##### Boot and Configure Partitions
After you boot from the Arch Linux iso, you must run a series of commands to install the base system.
First, run the below command to find out the device identifier.
```
fdisk -l
```
![fdisk -l before][3]
Then with the device identifier, run the below command to start partitioning your disk. Make sure to change `/dev/sda` as per your system.
```
cfdisk /dev/sda
```
Select `label type = dos` in the next prompt.
Select the free space and choose option NEW from the bottom. In this example, I will create three partitions as per below.
```
/dev/sda1 - 1G - for /boot/dev/sda2 - 5G - for root/dev/sda3 - 1G - for swap
```
![cfdisk][4]
In the next screen provide partition size for the boot partition (for this example, I gave 1 GB). Select it as the primary partition.
Repeat the same step for the main root partition of size 5GB.
![Swap partition type change][5]
Create a swap partition using the same steps with size 1G (you may change it as per your need). After you create the swap partition, make sure to choose Type at the bottom and mark it as a swap with the option “Linux Swap/Solaris”.
![final partition list in cfdisk][6]
Once done, write the changes to the disk using the Write option at the bottom. Make sure you take a backup before you write as this is a permanent change in your system.
Run the below command to check before you proceed. You can see in this example, three partitions are listed.
```
fdisk -l
```
![final partition list in fdisk][7]
Run the following commands in sequence to format and create an ext4 file system in the newly created partition above. Make sure you change the /dev/sda1 and /dev/sda2 as per your need.
```
mkfs.ext4 /dev/sda1mkfs.ext4 /dev/sda2mkswap /dev/sda3swapon /dev/sda3
```
After completion, mount the system and create necessary directories.
```
mount /dev/sda2 /mntmkdir /mnt/boot /mnt/var /mnt/homemount /dev/sda1 /mnt/boot
```
Again, make sure you change /dev/sda1, /dev/sda2 and /dev/sda3 as per your system.
![prepare file system][8]
##### Install the base system
I hope you are already connected to the internet. If not, try using a USB dongle or wired internet connection which Arch installer automatically configure and detect. If you do not have a wired connection available, follow [this guide][9] to configure a wireless or wifi network using Arch Linux installer.
Run the below commands in sequence to install the base system in the mounted partition. The download size is approx 400 MB.
```
pacman -Syypacstrap /mnt base base-devel linux linux-firmware nano dhcpcd net-tools grub
```
![Install base system][10]
Once complete, generate file system table without which you cant boot the system.
```
genfstab -U /mnt >> /mnt/etc/fstab
```
##### Configure the base system
Follow the below commands in sequence to configure the base system. This involves setting up your locale, language, add a login user, and setting up the internet.
```
arch-chroot /mntnano /etc/locale.gen
```
Uncomment the locale of your choice by removing # at the beginning. For this guide, I have chosen en_US.UTF-8 UTF-8. Press CTRL+O, Enter, and CTRL+X to exit from nano.
![change locale][11]
Generate the locale using:
```
locale-gen
```
Setup the language using the below command.
```
echo LANG=en_US.UTF-8 > /etc/locale.confexport LANG=en_US.UTF-8
```
Setup the local time zone.
```
ln -s /usr/share/zoneinfo/America/New_York /etc/localtime
```
Again, you can choose them as per your need. You can list the local timezones via the below commands.
```
ls /usr/share/zoneinfo
ls /usr/share/zoneinfo/America
```
Setup the hardware clock, create a hostname, and enable the DHCP for the internet using the below commands in sequence. You can change `"arindam-pc"` to any hostname as per your desire.
```
hwclock --systohc --utcecho arindam-pc > /etc/hostnamesystemctl enable dhcpcd
```
The next step is to set up the root user password, create an admin user, and add the user in the sudoers file.
Follow the below commands in sequence. Make sure to change the user name from `debugpoint` to something else as per your need.
```
passwd rootuseradd -m -g users -G wheel -s /bin/bash debugpointpasswd debugpoint
```
![create user][12]
Open the sudoers file and add the below lines.
```
nano /etc/sudoers
```
Add below lines. As you already created the root user, the entry should be there.
```
root ALL=(ALL) ALLdebugpoint ALL=(ALL) ALL
```
![update sudoers file][13]
Install grub, setup the initial ramdisk environment, unmount the system using the below commands in sequence.
```
grub-install /dev/sdagrub-mkconfig -o /boot/grub/grub.cfgmkinitcpio -p linuxexit
```
![configure grub][14]
Then reboot your system.
```
umount /mnt/bootumount /mntreboot
```
You have now successfully installed the Arch Linux base system. Its time to install the complete LXQt desktop.
![Arch is installed][15]
#### Part 2: Install LXQt Desktop in Arch Linux
After reboot, choose Arch Linux from grub. In the Arch Linux prompt, start running the following commands in sequence. These commands install the Xorg server, display manager, LXQt desktop components, controller packages, and additional applications.
For all the commands, use the default, i.e. press enter when asked.
- **Install Xorg. Approx install size is 80 MB.**
```
sudo pacman -S --needed xorg
```
- **Install display manager, lxqt desktop. Approx install size is 100 MB.**
```
sudo pacman -S --needed lxqt xdg-utils ttf-freefont sddm
```
- **Install additional components (approx 80 MB)**
```
sudo pacman -S --needed libpulse libstatgrab libsysstat lm_sensors network-manager-applet oxygen-icons pavucontrol-qt
```
- **Install applications**
This is just a reference. You can also install the ones you require.
```
sudo pacman -S --needed firefox vlc filezilla leafpad xscreensaver archlinux-wallpaper
```
Now its time to enable the display manager and network manager as a service. So that next time you log on, they can run automatically by systemd.
```
systemctl enable sddmsystemctl enable NetworkManager
```
Reboot the system using the reboot command.
```
reboot
```
You should see a nice login prompt on the LXQt desktop if all goes well.
And you can now login using the user id and password which you just created. A Nice and superfast LXQt desktop would greet you after successful login.
![LXQt Desktop in Arch Linux (version 1.2)][16]
I hope this guide helps you create your own Arch Linux environment with a lightweight LXQt desktop from scratch. If you run into trouble, let me know using the comment box below.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/lxqt-arch-linux-install/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/archinstall-guide/
[2]: https://www.archlinux.org/download/
[3]: https://www.debugpoint.com/wp-content/uploads/2020/12/fdisk-l-before.jpg
[4]: https://www.debugpoint.com/wp-content/uploads/2020/12/cfdisk-1024x159.jpg
[5]: https://www.debugpoint.com/wp-content/uploads/2020/12/Swap-parition-type-change.jpg
[6]: https://www.debugpoint.com/wp-content/uploads/2020/12/final-partition-list-in-cfdisk-1024x178.jpg
[7]: https://www.debugpoint.com/wp-content/uploads/2020/12/final-partition-list-in-fdisk.jpg
[8]: https://www.debugpoint.com/wp-content/uploads/2020/12/prepare-file-system.jpg
[9]: https://www.debugpoint.com/2020/11/connect-wifi-terminal-linux/
[10]: https://www.debugpoint.com/wp-content/uploads/2020/12/Install-base-system-1024x205.jpg
[11]: https://www.debugpoint.com/wp-content/uploads/2020/12/change-locale.jpg
[12]: https://www.debugpoint.com/wp-content/uploads/2020/12/create-user.jpg
[13]: https://www.debugpoint.com/wp-content/uploads/2020/12/update-sudoers-file.jpg
[14]: https://www.debugpoint.com/wp-content/uploads/2020/12/configure-grub-1024x639.jpg
[15]: https://www.debugpoint.com/wp-content/uploads/2020/12/Arch-is-installed.jpg
[16]: https://www.debugpoint.com/wp-content/uploads/2020/12/LXQt-Desktop-in-Arch-Linux-version-1.2-1024x639.jpg

View File

@ -0,0 +1,128 @@
[#]: subject: "Titan Linux: A Blend of Debian Stable and KDE Plasma"
[#]: via: "https://www.debugpoint.com/titan-linux-review-2022/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Titan Linux: A Blend of Debian Stable and KDE Plasma
======
**We review Titan Linux a rising star in the Linux distro space and bring Debian stable with KDE Plasma flavour with its unique tools.**
### Titan Linux What does it offer?
Titan Linux is a Debian-stable based Linux distribution which features the KDE Plasma desktop. It is a fairly new distribution that aspires to be user-friendly and minimal. Developed by a two-member team, Titan Linux brings a unique experience to Debians experience by eliminating several packages and giving out-of-the-box hardware support.
Moreover, it uses a different installer than Debian uses and brings some nifty in-house utilities.
![Titan Linux Desktop][1]
### Titan Linux Review 2022
#### Download and Installation
This review is based on the latest stable release of Titan Linux 1.2.1, “Cronus” Stable, bases on [Debian 11 bullseye][2].
There are no problems while downloading this distro via its torrents. Many budding distros dont do well while providing download options such as no server bandwidth, no torrent etc. However, the torrent speed was good, and the ISO of 2.5GB took a reasonable time to download.
Lets talk about the installation.
First, the LIVE desktop gives you a shortcut to kick off the installer. The installer that Titan Linux uses is Calamares. It is not [Debians own graphical installer][3]. This is one of the significant advantages of using the popular Calamares for Debian. The installer is configured in a simple manner and should not be a problem for new users or advanced users.
Second, the Calamares installer took around 4 minutes to install on average in both physical and virtual systems. After the installation is complete, the Grub is well configured, and I can boot into the desktop.
#### Look and Feel
Firstly, the desktop gives you a slightly different feel from a KDE Plasma desktop because of the dark colour palette and a somewhat different application menu. In addition, the Dragon Icons and cursors go well with its “Titan” themed desktop look.
Second, the application menu is the [legacy KDE Plasma kick off][4], which gives you easy access to the applications and system settings.
In addition, System Settings uses an alternative view than the traditional Plasma system settings. If you are a long-term KDE Plasma user, you may feel slightly different with these two subtle changes in this desktop.
Other than that, a nice set of wallpapers will help you further customize your desktop. And finally, the bottom main taskbar is almost the same as the standard Plasma desktop.
![The KDE Plasma kick off menu shows a legacy view][5]
![System Settings in Titan Linux][6]
#### Applications
Firstly, the application list is more customized than the KDE Plasma desktop apps. A set of different and lightweight applications that gives a lightweight feel.
Secondly, it is wise for the developers of this distro not to use the KDE Applications but instead use some of the traditional lightweight replacements.
For example, instead of the KWiter text editor, you get the Featherpad text editor. However, the file manager is Dolphin from KDE Applications. The Gwenview is replaced by the LXImage image viewer from the LXQt desktop.
Moreover, an exciting addition is the Titan Toolbox. Its a collection of utilities that is very handy for new and advanced users. The Toolbox contains utilities to tweak the desktop, change repo, APT tools, hardware configuration, etc. YOu can see a glimpse of it in the below image.
![A side-by-side view of two different options of Titan Toolbox][7]
For example, the Extra Software option from the Toolbox gives you the below graphical menu items to perform several tasks. It is one of the selling points of this distribution.
![One of the Titan Toolbox option - Extra Software][8]
Another item from the Toolbox is my favourite: the Advanced options to manage Kernel and Grub, as you can see below. I must say, this is handy for all users.
![Advanced Tools][9]
#### Performance
The performance metric is exciting, considering it is a KDE Plasma desktop. In a fresh install and idle state, it only uses 620 MB of RAM! And the CPU is at around 1%.
Next, when I pass it through a heavy workload with Firefox, Dolphin file manager, text editor, terminal, VLC media player, and system settings, it uses 1.3 GB of RAM, and the CPU is at 2% to 3% on average.
Finally, when I close all the applications on a heavy workload, the RAM consumption goes back to 676MB of RAM, and the CPU is at a 1% level.
I must say, it is well-optimized. And surprisingly, KWin is performing better with the Debian base than the Ubuntu or Fedora base.
It uses 10GB of disk space for a default installation.
![Titan Linux in Idle State][10]
![Titan Linux Performance in Heavy Workload][11]
#### Bugs
There are no bugs I encountered while reviewing this distribution. It is simply stable well, believing it is a new distribution.
However, I found one weird behaviour while changing resolution in a virtual machine (see below), which I think is a KWin bug and has nothing to do with Titan Linux.
![][12]
### Closing Notes
Having reviewed a large set of distributions over the years, I must say that Titan Linux gives you a stock Debian stable experience with a well-optimized KDE Plasma desktop. On top of that, the Titan toolbox is also a handy addition to helping users.
If you are looking for a Debian stable distribution with a KDE Plasma desktop experience, definitely go for it. Thanks to Debian, you can easily use this distro for your daily use and productive work.
You can download Titan Linux from the [official website][13].
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/titan-linux-review-2022/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/wp-content/uploads/2022/06/Titan-Linux-Desktop.jpg
[2]: https://www.debugpoint.com/2021/05/debian-11-features/
[3]: https://www.debugpoint.com/2021/01/install-debian-buster/
[4]: https://www.debugpoint.com/2021/02/legacy-kickoff-kde-plasma-5-21/
[5]: https://www.debugpoint.com/wp-content/uploads/2022/06/The-KDE-Plasma-kick-off-menu-shows-a-legacy-view.jpg
[6]: https://www.debugpoint.com/wp-content/uploads/2022/06/System-Settings-in-Titan-Linux.jpg
[7]: https://www.debugpoint.com/wp-content/uploads/2022/06/A-side-by-side-view-of-two-different-options-of-Titan-Toolbox.jpg
[8]: https://www.debugpoint.com/wp-content/uploads/2022/06/One-of-the-Titan-Toolbox-option-Extra-Software.jpg
[9]: https://www.debugpoint.com/wp-content/uploads/2022/06/Advanced-Tools.jpg
[10]: https://www.debugpoint.com/wp-content/uploads/2022/06/Titan-Linux-in-Idle-State.jpg
[11]: https://www.debugpoint.com/wp-content/uploads/2022/06/Titan-Linux-Performance-in-Heavy-Workload.jpg
[12]: https://www.debugpoint.com/wp-content/uploads/2022/06/Titan-Linux-Resolution-problem.mp4
[13]: https://techcafe757.wixsite.com/titanlinux

View File

@ -0,0 +1,537 @@
[#]: subject: "How To Install Netdata Performance Monitoring Tool In Linux"
[#]: via: "https://ostechnix.com/netdata-real-time-performance-monitoring-tool-linux/"
[#]: author: "sk https://ostechnix.com/author/sk/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How To Install Netdata Performance Monitoring Tool In Linux
======
This guide explains **what is Netdata**, how to **install Netdata in Linux** and how to analyze and **monitor a Linux system performance and resource usage** with Netdata.
### 1. What is Netdata?
**NetData** is a distributed, real-time, performance and health monitoring tool for systems and applications. It provides unparalleled insights of everything happening on a system in real-time. You can view the results in a highly interactive web-dashboard.
Using Netdata, you can get a clear idea of what is happening now, and what happened before in your systems and applications.
Netdata runs on all physical and virtual servers, containers, even IoT/edge devices.
You don't need to be an expert to deploy this tool in your Linux systems. Netdata just works fine out of the box with zero configuration, and zero dependencies. Just install this utility and sit back, Netdata will take care of the rest.
Netdata has its own **built-in webserver** to display the result in graphical format. Netdata is quite fast and efficient, and it will immediately start to analyze the performance of your system in no time after installing it.
Netdata is written using **C** programming language, so it is extremely light weight. It consumes less than 3% of a single core CPU usage and a 10-15MB of RAM.
We can easily embed the Netdata charts on any existing web pages. It has a plugin API, so that you can monitor any application.
Here is the list of things that will be monitored by Netdata utility in your Linux system.
- CPU usage,
- RAM Usage,
- Swap memory usage,
- Kernel memory usage,
- Hard disks and its usage,
- Network interfaces,
- IPtables,
- Netfilter,
- DDoS protection,
- Processes,
- Applications,
- NFS server,
- Web server (Apache & Nginx),
- Database servers (MySQL),
- DHCP server,
- DNS server,
- Email serve,r
- Proxy server,
- Tomcat,
- PHP,
- SNP devices,
- And many more.
Netdata is free, open source tool and it supports Linux, FreeBSD and Mac OS.
### 2. Install Netdata In Linux
Netdata can be installed on any Linux distributions that have **Bash** installed. There are two ways to install Netdata in Linux.
We can **install Netdata using an automatic one-liner script** or **install Netdata from git** checkout. First, we will see how to install
#### 2.1. Install Netdata using Automatic One-line Installation Script
The best as well as the easiest way to install Netdata is to run the following one-liner command as normal user:
```
$ wget -O /tmp/netdata-kickstart.sh https://my-netdata.io/kickstart.sh && sh /tmp/netdata-kickstart.sh
```
If `wget` is not available, use `curl` instead:
```
$ curl https://my-netdata.io/kickstart.sh > /tmp/netdata-kickstart.sh && sh /tmp/netdata-kickstart.sh
```
This method is fully automatic on any Linux and Unix distributions, such as Debian, Fedora, RHEL, CentOS, AlmaLinux, Rocky Linux, openSUSE and macOS etc.
The automatic installation script will download and install everything needed to up and run Netdata. It will also enable automatic and nightly updates.
If you don't like the auto-installer script method, you can follow the steps below to install Netdata from Git checkout.
#### 2.2. Install Netdata from Git
First, we need to install required dependencies. The prerequisites can be installed using automatic requirements installer script or manually using the package manager.
##### 2.2.1. Install Prerequisites using Automatic Requirements Installer
To install the necessary dependency packages for having a **basic Netdata installation** only, run:
```
$ curl -Ss 'https://raw.githubusercontent.com/netdata/netdata/master/packaging/installer/install-required-packages.sh' >/tmp/install-required-packages.sh && bash /tmp/install-required-packages.sh -i netdata
```
To install the necessary dependency packages for having a **full Netdata installation** to monitor everything, run:
```
$ curl -Ss 'https://raw.githubusercontent.com/netdata/netdata/master/packaging/installer/install-required-packages.sh' >/tmp/install-required-packages.sh && bash /tmp/install-required-packages.sh -i netdata-all
```
If you prefer manual prerequisites installation, follow the steps in the section below.
##### 2.2.2. Install Prerequisites using Manually Package Manager
Depending upon the Linux distribution, use any one of the following commands to install the necessary prerequisites using your distribution's default package manager.
**Debian / Ubuntu:**
```
$ sudo apt-get install zlib1g-dev uuid-dev libuv1-dev liblz4-dev libssl-dev libelf-dev libmnl-dev libprotobuf-dev protobuf-compiler gcc g++ make git autoconf autoconf-archive autogen automake pkg-config curl python cmake
```
**Fedora:**
```
$ sudo dnf install zlib-devel libuuid-devel libuv-devel lz4-devel openssl-devel elfutils-libelf-devel libmnl-devel protobuf-devel protobuf-compiler gcc gcc-c++ make git autoconf autoconf-archive autogen automake pkgconfig curl findutils python cmake
```
**CentOS / Red Hat Enterprise Linux older versions:**
```
$ sudo yum install autoconf automake curl gcc gcc-c++ git libmnl-devel libuuid-devel openssl-devel libuv-devel lz4-devel elfutils-libelf-devel protobuf protobuf-devel protobuf-compiler make nc pkgconfig python zlib-devel cmake
```
**RHEL 8.x / CentOS 8.x / AlmaLinux 8.x. / Rocky Linux 8.x:**
```
# Enable config-manager
$ sudo dnf install -y 'dnf-command(config-manager)'
# Enable PowerTools
$ sudo dnf config-manager --set-enabled powertools
# Enable EPEL
$ sudo dnf install -y epel-release
# Install Repo for libuv-devl (NEW)
$ sudo dnf install -y http://repo.okay.com.mx/centos/8/x86_64/release/okay-release-1-3.el8.noarch.rpm
# Install Devel Packages
$ sudo dnf install autoconf automake curl gcc git cmake libuuid-devel openssl-devel libuv-devel lz4-devel make nc pkgconfig python3 zlib-devel
```
**openSUSE:**
```
$ sudo zypper install zlib-devel libuuid-devel libuv-devel liblz4-devel libopenssl-devel libelf-devel libmnl-devel protobuf-devel gcc gcc-c++ make git autoconf autoconf-archive autogen automake pkgconfig curl findutils python cmake
```
After installing the required dependencies, install NetData from Git checkout as shown below.
##### 2.2.3. Install Netdata
Git clone the Netdata repository:
```
$ git clone https://github.com/netdata/netdata.git --depth=100 --recursive
```
The above command will create a directory called **'netdata'**in the current working directory.
Change to the 'netdata' directory:
```
$ cd netdata/
```
Finally, install and start Netdata using command:
```
$ sudo ./netdata-installer.sh
```
**Sample output:**
```
^
|.-. .-. .-. .-. .-. . netdata .-. .-. .-. .-. .-. .-
| '-' '-' '-' '-' '-' '-' '-' '-' '-' '-'
+----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+--->
--- real-time performance monitoring, done right! ---
You are about to build and install netdata to your system.
The build process will use /tmp for
any temporary files. You can override this by setting $TMPDIR to a
writable directory where you can execute files.
It will be installed at these locations:
- the daemon at /usr/sbin/netdata
- config files in /etc/netdata
- web files in /usr/share/netdata
- plugins in /usr/libexec/netdata
- cache files in /var/cache/netdata
- db files in /var/lib/netdata
- log files in /var/log/netdata
- pid file at /var/run/netdata.pid
- logrotate file at /etc/logrotate.d/netdata
This installer allows you to change the installation path.
Press Control-C and run the same command with --help for help.
NOTE:
Anonymous usage stats will be collected and sent to Netdata.
To opt-out, pass --disable-telemetry option to the installer or export
the environment variable DISABLE_TELEMETRY to a non-zero or non-empty value
(e.g: export DISABLE_TELEMETRY=1).
Press ENTER to build and install netdata to your system > **## Press ENTER Key**
[...]
netdata by default listens on all IPs on port 19999,
so you can access it with:
**http://this.machine.ip:19999/**
To stop netdata run:
systemctl stop netdata
To start netdata run:
systemctl start netdata
Uninstall script copied to: /usr/libexec/netdata/netdata-uninstaller.sh
--- Installing (but not enabling) the netdata updater tool ---
Update script is located at /usr/libexec/netdata/netdata-updater.sh
--- Wrap up environment set up ---
Preparing .environment file
[/home/ostechnix/netdata]# chmod 0644 /etc/netdata/.environment
OK ''
Setting netdata.tarball.checksum to 'new_installation'
--- We are done! ---
^
|.-. .-. .-. .-. .-. . netdata .-. .-. .-. .-. .-. .-
| '-' '-' '-' '-' '-' '-' '-' '-' '-' '-'
+----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+--->
--- is installed and running now! ---
enjoy real-time performance and health monitoring...
```
![Install Netdata in Linux][1]
Install Netdata in Linux
Congratulations! Netdata has been installed and started.
#### 2.3. Install Netdata using Package Manager
Netdata is available in the default repositories of some Linux distributions. These packages might be bit outdated.
**Alpine Linux:**
To install Netdata in Alpine Linux, use **[apk][2]** package manager:
```
$ sudo apk add netdata
```
**Arch Linux:**
The Netdata is available in the Arch Linux `**[community]**` repository. So, we can install it with [**pacman**][3] using command:
```
$ sudo pacman -S netdata
```
**Debian / Ubuntu:**
```
$ sudo apt install netdata
```
**Fedora:**
```
$ sudo dnf install netdata
```
**RHEL / CentOS / AlmaLinux / Rocky Linux:**
In Enterprise Linux operating systems, you need to enable **`[EPEL]`** repository and then install Netdata.
```
$ sudo dnf install epel-release
```
```
$ sudo dnf install netdata
```
**SUSE / openSUSE:**
```
$ sudo zypper install netdata
```
To know other installation methods, refer the [**official installation instructions page**][4].
### 3. Allow Netdata Default Port via Firewall or Router
If your system stays behind any firewall or router, you must allow the default port **19999** to access the NetData web interface from any remote systems on the network,.
**On Debian, Ubuntu:**
```
$ sudo ufw allow 19999
```
**On Fedora, RHEL, CentOS, AlmaLinux and Rocky Linux:**
```
$ sudo firewall-cmd --permanent --add-port=19999/tcp
```
```
$ sudo firewall-cmd --reload
```
### 4. Starting and Stopping Netdata Service
To enable and start Netdata service on systems that use **Systemd**, run:
```
$ sudo systemctl enable netdata
```
```
$ sudo systemctl start netdata
```
To stop Netdata service, run:
```
$ sudo systemctl stop netdata
```
To enable and start Netdata service on systems that use **Init**, run:
```
$ sudo service netdata start
```
```
$ sudo chkconfig netdata on
```
To stop Netdata service:
```
$ sudo service netdata stop
```
### 5. Access Netdata via Web Browser
Open your web browser, and navigate to **http://127.0.0.1:19999** or **http://localhost:19999/** or **http://ip-address:19999**. You will be pleased with Netdata dashboard as shown in the following screenshot.
![Netdata Main Dashboard][5]
Netdata Main Dashboard
From the dashboard, you will find the complete statistics of your Linux system. Scroll down to view each section. You can also click on any section on the right corner to immediately jump to that particular section.
### 6. Netdata Configuration
As stated already, Netdata requires zero configuration. It works out of the box.
The main configuration file of Netdata is located at **`/etc/netdata/netdata.conf`**. You can view it using any text editors to find most configuration options.
You can also download and/or view Netdata default configuration file at any time by simply navigating to **http://localhost:19999/netdata.conf**.
![Netdata Configuration File][6]
Netdata Configuration File
If you want to edit the Netdata configuration file, you can use `**edit-config**` script, which is the officially recommended way.
```
$ cd /etc/netdata
$ sudo ./edit-config netdata.conf
```
### 7. Netdata Metrics
Netdata gathers thousands of metrics with zero configuration using **[300+ pre-installed collectors][7]**. These collectors will search your node in default locations and ports to find running applications and gather as many metrics as possible without you having to configure them individually.
As I already stated, Most collectors will work without any configuration. However, you should know **[how collectors work][8]** and how to **[enable or configure collectors][9]** individually.
### 8. Updating Netdata
If you have installed Netdata using the Automatic one-liner installation script, Netdata will automatically update itself.
If you have installed Netdata using your package manager, you can run the distribution-specific update command to update Netdata. For example in Arch Linux, just run the following command to update Netdata. If the updated version is available in the repository, it will be automatically installed.
```
$ sudo pacman -Syyu
```
If you have installed Netdata using Git, just go to the directory where you have cloned it (In our case it's netdata).
```
$ cd netdata
```
Pull the latest update:
```
$ git pull
```
Then, rebuild and update it using command:
```
$ sudo ./netdata-installer.sh
```
### 9. Uninstalling Netdata
If you have installed Netdata from Git, go to the location where you have cloned Netdata:
```
$ cd netdata
```
Then, uninstall it using command:
```
$ sudo ./netdata-uninstaller.sh --force
```
If you have installed Netdata using the package manager, just use the appropriate command. For example in Arch Linux, the following command can be used to uninstall Netdata:
```
$ sudo pacman -Rns netdata
```
### 10. Frequently Asked Questions
#### What is Netdata?
Netdata is an Enterprise-grade, real-time infrastructure monitoring application. It is opensource and completely free. Netdata works on Linux, FreeBSD, and macOS. It also works on container platforms like Kubernetes clusters, and Docker.
#### Which platforms are supported by Netdata?
Netdata supports most Linux distributions (Ubuntu, Debian, CentOS, and more), container platforms (Kubernetes clusters, Docker), and many other operating systems (FreeBSD, macOS).
#### Where can I find the Netdata main configuration file?
Netdata main configuration file is located at **`/etc/netdata/netdata.conf`**. If you're not sure where to find it, simply open your web browser and point it **http://localhost:19999/netdata.conf**.
#### How to download Netdata configuration file?
Yes. After finding the location of the Netdata config file, use any one of the following commands to download Netdata configuration file.
```
wget -O /etc/netdata/netdata.conf http://localhost:19999/netdata.conf
```
Or
```
curl -o /etc/netdata/netdata.conf http://localhost:19999/netdata.conf
```
#### Who can use Netdata?
Netdata can be used by any user who wants to view the real-time performance metrics of their Linux or Unix system. It is used by system administrators, DevOps engineers, and developers to collect everything.
#### Is Netdata fast?
Yes, it is amazingly fast. It is optimized to utilize 1% of the CPU and consumes a few MB of RAM.
#### Is Netdata requires special system administration skills?
Absolutely NOT. It requires **zero configuration** as well as **zero maintenance**. Just run it on your machine and Netdata does everything on its own.
#### Can Netdata send notifications when something goes wrong?
Yes! Netdata's health watchdog sends warning and critical alarms to your favorite platform to inform you of anomalies just seconds after they affect your node.
#### Can I use Netdata to monitor my Cloud infrastructure?
Yes! Netdata Cloud works with Netdata's free, open-source monitoring agent to monitor and troubleshoot every layer of your systems to find weaknesses before they turn into outages.
Netdata Cloud provides:
- Infrastructure level dashboards (each chart aggregates data from multiple nodes)
- Central dispatch of alert notifications,
- Custom dashboards editor,
- Intelligence assisted troubleshooting, to help surface the root cause of issues.
### Conclusion
In this guide, we looked at what is Netdata and different ways to install Netdata in Linux. We also looked at how to access the Netdata dashboard, update Netdata and uninstall it.
Netdata is simple yet powerful real-time performance monitoring application. It requires zero configuration and works out of the box. If you ever looking for a easiest way to monitor your system performance, resource and application usage, Netdata is highly recommended.
**Resources:**
- [**NetData website**][10]
- [**NetData GitHub page**][11]
--------------------------------------------------------------------------------
via: https://ostechnix.com/netdata-real-time-performance-monitoring-tool-linux/
作者:[sk][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://ostechnix.com/author/sk/
[b]: https://github.com/lkxed
[1]: https://ostechnix.com/wp-content/uploads/2022/11/Install-Netdata-in-Linux.png
[2]: https://ostechnix.com/alpine-linux-apk-command-examples/
[3]: https://ostechnix.com/getting-started-pacman/
[4]: https://docs.netdata.cloud/packaging/installer/
[5]: https://ostechnix.com/wp-content/uploads/2022/11/Netdata-Main-Dashboard.png
[6]: https://ostechnix.com/wp-content/uploads/2022/11/Netdata-Configuration-File.png
[7]: https://learn.netdata.cloud/docs/agent/collectors/collectors
[8]: https://learn.netdata.cloud/docs/collect/how-collectors-work
[9]: https://learn.netdata.cloud/docs/collect/enable-configure
[10]: https://netdata.firehol.org/
[11]: https://github.com/firehol/netdata

View File

@ -0,0 +1,755 @@
[#]: subject: "31 Linux Commands Every Ubuntu User Should Know"
[#]: via: "https://itsfoss.com/essential-ubuntu-commands/"
[#]: author: "Abhishek Prakash https://itsfoss.com/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
31 Linux Commands Every Ubuntu User Should Know
======
What are the **essential Ubuntu commands**?
I have been asked this question several times by regular readers, and I have tried to avoid answering it.
Why? Dont I know Ubuntu commands? Nope. Thats not the reason. It is because it is difficult to categorize them. Whats essential to me may not be essential to you.
But I guess that applies to everything and every such list of recommended applications on our portal.
Thats why I finally gave in and created this list of basic yet **essential Linux commands** that should be helpful to you as a Ubuntu user. This is more focused on desktop Ubuntu users, but if you use Ubuntu as a server, they should also help you.
### Essential Ubuntu Commands
Every command I list here has multiple options and several uses. If I try giving even the most common examples of each command, it will easily turn into a pocketbook of more than 10,000 words.
I will not go into detail with any of these commands. Ill list the purpose of each command with its basic syntax. You can read more about using these commands from their linked tutorials.
**Recommended reading before you start following the list:**
- Concept of [path in Linux][1]
- [Concept of file permission][2]
- Knowing the [terminal jargon][3]
Another thing. I have used the term **folder** here more than the **directory**.
A [folder is called a directory in Linux][4], and puritans may not like this. However, I believe it is easier to grasp for beginners.
#### 1. ls command: List the content of a folder
This is among the first few commands a new Linux user learns. This command lets you see what files and folders are in your current folder.
```
ls
```
You can use the long listing option ls -l to see details like file size, permission, modified time, etc. You can sort and control these options if you want to.
```
ls -l
```
![ls command ubuntu][5]
**Related Read**: [ls command examples][6]
#### 2. cd command: Change the directory
By default, you start in your home directory. Youll often require to change the directory and move to another one.
For example, you downloaded a deb file or script. Now you want to run it. You can do that from your present working directory by providing the full path but switching to that location makes things easier.
The cd command stands for **change directory;**with this, you can change your location and move to another directory.
![cd command examples][7]
At this point, I highly recommend reading about the concept of paths in Linux so that things are easy to understand while navigating through directories in the Linux command line.
**Recommended Read**: [cd command examples][8]
#### 3. cat command: Read a text file
If you quickly want to see the contents of a text file in Linux, **cat** is the command you use. It displays the contents on the screen.
```
cat filename
```
![cat command example][9]
You can also use the cat command to create new files or add more text to existing files.
**Recommended Read**: [cat command examples][10]
#### 4. less command: Read a large text file
The cat command is good enough for viewing small text files. But I wont recommend using cat if you have a huge text file with hundreds of lines. It will flood your screen with all the text, and you will have difficulty with it.
This is where the less command comes into the picture. When you open a file with less, it opens the file in pages. You can scroll up/down, look for text, and more.
![reading large files with less command][11]
Once you are done reading the file, you can **exit the less view by pressing the Q key**. Youll notice that nothing is displayed on the screen. Your screen is clean.
**Suggested Read**: [less command examples][12]
#### 5. touch command: Create new files
There are multiple ways of creating new files in the Linux terminal. The cat command you saw above can also create new files.
However, I prefer the touch command for this purpose.
```
touch new_file_name
```
![touch command ubuntu][13]
If you use it with existing files, their timestamps will be modified.
**Also Read**: [touch command examples][14]
#### 6. mkdir command: Make new folders
While there is no specific command for creating new files, there is a dedicated command for making new folders (or directories, as we call them in Linux).
```
mkdir new_dir
```
![mkdir command example][15]
**Explore More Here**: [mkdir command examples][16]
#### 7. cp command: Copy files and folders
Copying files and folders in the command line is also one of the common tasks you will encounter. The cp command, short for copy, is used for this purpose.
Imagine that you have to modify a configuration file. A smart move will be to copy the file with another name. This way, youll have a backup of the file.
```
cp existing_file.txt existing_file.back
```
You can use the same cp command for copying directories as well. For that, you must specify the recursive option `**-r**`:
```
cp -r dir another_location
```
![cp command example][17]
**You May Also Read**: [cp command examples][18]
#### 8. mv command: Cut-paste or rename files and folders
The mv command stands for move. When you copy a file to another location, it remains in its original place.
The mv command moves the files and folders to the other location. You can think of it as a cut-paste operation.
```
mv file.txt /another/location
```
You can use the mv command to rename the file as well.
```
mv file.txt new_file.txt
```
The same mv command also moves or renames folders without any special options.
![mv command example][19]
**Recommended Read**: [mv command examples][20]
#### 9. rm command: Remove files and folders
To delete files in the Linux terminal, you use the **rm** (short for remove) command.
```
rm filename
```
There is no undo option after you delete files in the command line. This is why you should be extremely careful while deleting files. If you are afraid of deleting the wrong file, use the interactive mode with option -i, which gives you an additional prompt to confirm the action.
```
rm -i filename
```
With the recursive option -r, you can also use the same rm command to delete folders.
![rm command examples][21]
**Recommended Read**: [rm command examples][22]
#### 10. nano: Edit files
Sooner or later, youll be required to make changes to the contents of a file. Imagine that you have to change a configuration file of SSH, grub, or some other application.
There are [command line-based t][23]ext editors for this purpose. Ubuntu comes with Nano editor preinstalled, and it is relatively easier to use than Vim, Emacs, etc.
**If you are curious****about differences**, read our [Nano vs. Vim comparison][24] article.
Easier to use doesnt mean the same comfort as a GUI-based text editor. You will have to use the keyboard shortcuts for moving around, making changes, saving, and exiting files.
To open a new, unnamed file with nano, use:
```
nano
```
To edit an existing file in Nano, use:
```
nano filename
```
In both cases, you should see an interface like this.
![nano command example][25]
To save (or discord changes) and exit the editor interface, use the Ctrl+x keys.
Please refer to the [Nano beginner guide][26] I created earlier to get comfortable with it.
#### 11. clear: Clear terminal screen
Nano feels like a complicated one, right? Let me share a simple command.
The clear command clears the terminal. Thats it.
```
clear
```
And why do you need to do that? Well, if your terminal screen is flooded with random stuff and you want to do something new. Cleaning the terminal is like cleaning the board or opening a new page in your notebook.
#### 12. ps: Check and handle processes
The ps command is for handling the processes running on your system. Each process has an associated ID called PID, which can be used for various purposes, such as [terminating a process][27].
```
[[email protected]][28]:~$ ps
PID TTY TIME CMD
15358 ? 00:00:00 bash
15404 ? 00:00:00 ps
```
Here,
- **PID: Process ID**
- **TTY: Controlling terminal associated with the process (Not that important these days)**
- **TIME: Total CPU usage time**
- **CMD: Name of command that runs the process**
But a system cannot run just 2-3 processes, can it? To see all the processes running by all users, use:
```
ps aux
```
This will give a massive list of processes and more details about them. If you run this command, now will be an excellent time to use the **clear** command.
![list processes ubuntu][29]
**Recommended Read**: [ps command examples][30]
#### 13. top: System monitor
While the ps command gives you all the running processes, the top command gives you a real-time view of the processes and the system resource consumption.
```
top
```
Consider it like the terminal variant of the task manager in Linux. Youll see a lot of interesting details with the top command.
I primarily use the top command to check which process takes too much CPU or RAM. There are [better top alte][31][r][31][natives][31] if you are interested to experiment.
![top command ubuntu][32]
To [stop the running top command][33], use the **Ctrl+C** keyboard shortcut.
**Recommended Read**: [Using top command effectively as a task manager][34]
#### 14. lsblk: List disks and partitions
The **lsblk** command lists all the block devices on your system. In really simple (and not entirely technically accurate) terms, it displays the disks and partitions.
```
[email protected]:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 79.9M 1 loop /snap/lxd/22923
loop1 7:1 0 103M 1 loop /snap/lxd/23541
loop2 7:2 0 63.2M 1 loop /snap/core20/1623
loop3 7:3 0 48M 1 loop /snap/snapd/17336
loop4 7:4 0 48M 1 loop /snap/snapd/17029
loop6 7:6 0 63.2M 1 loop /snap/core20/1634
vda 252:0 0 25G 0 disk
├─vda1 252:1 0 24.9G 0 part /
├─vda14 252:14 0 4M 0 part
└─vda15 252:15 0 106M 0 part /boot/efi
vdb 252:16 0 466K 1 disk
[email protected]:~#
```
#### 15. fdisk: List and Manage disks and partition
Another similar but better command is the **fdisk** command. It lets you manipulate the disk partitions. This means you can create new partitions and delete and resize existing ones with this command.
You can also use it to list all the block devices, including [loop devices][35], on your system.
```
sudo fdisk -l
```
The output could be huge if you have many partitions, disks, and loop devices (created by snap applications). I am showing a relevant part of the output here:
```
Disk /dev/vda: 25 GiB, 26843545600 bytes, 52428800 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 0B7C796D-51CD-4DD4-962A-7D94B31690E2
Device Start End Sectors Size Type
/dev/vda1 227328 52428766 52201439 24.9G Linux filesystem
/dev/vda14 2048 10239 8192 4M BIOS boot
/dev/vda15 10240 227327 217088 106M EFI System
```
#### 16. find: Search for files
Even as a desktop user, youll encounter cases where you may have to search for files in the Linux command line.
The find command is an extensive and versatile command for this purpose. It has more than fifty options, and you will probably never need all of them.
Heres an example of the find command that will give you all the files that end with .**txt** extension in the current directory.
```
find . -type f -name "*.txt"
```
Other common examples include finding files by size, modified time, etc. You can [combine find with exec][36] or [xargs][37] to take actions on the result of the find command. For example, you can look for all the .txt files and choose to delete them.
**Also Read:**[find command examples][38]
#### 17. grep: Search in file content
The find command search for files based on their name and type. If you want to search based on the content of the files, you use the grep command.
So, instead of looking for all files ending with .txt, you look for all files containing the text foss with grep.
```
grep -ri search_term
```
![grep command examples][39]
Want more? Here are some more [practical examples of the grep command][40]. The handy [grep cheat sheet][41] should help you out.
#### 18. kill: Terminate processes
Violence is not the answer … its the solution.
Just kidding!
If you have a misbehaving process that takes too many system resources, you can [find it and then terminate][27] it [using the kill command][42].
```
sudo kill -9 process_ID_or_Name
```
As you can see in the above command, you need to know the process ID (PID) or the name to terminate it. You can use the ps or the top command to get the PID or exact process name.
```
ps aux | grep -i “name of your desired program”
```
Did you notice the use of grep command? You are already utilizing the commands mentioned in this list.
![find kill process ubuntu][43]
I dont know about you, but I feel like [Liam Nesson in Taken][44] when I look for rogue processes to terminate.
![taken meme find you kill you][45]
#### 19. history: Look back into what commands you ran in the past
So, you used a specific Linux command a few days ago. Now you need to run it again, but you cannot recall it correctly.
You can press the up and down arrow keys.
Thats a familiar scenario for many Linux users; this is where the history command helps.
In Ubuntu, your shell keeps a history of the commands you run. Enter history in the terminal, and you should see a history of commands you ran in the past.
![history command ubuntu][46]
You can choose to run an entry from the history using its number like this:
```
!number
```
But even the history could be huge, so (again) use the grep command to filter your search term.
```
[email protected]:~$ history | grep aux
1915 ps aux
1952 ps aux | grep -i spotify
1955 ps -aux | grep -i calculator
1957 ps -aux | grep -i calculator
1959 ps -aux | grep -i calculator
1970 history | grep aux
```
There is another way to access the command history and search it. Press **Ctrl+R** and then enter the search term.
**Recommended Read**: [history command examples][47]
#### 20. chmod: Change File Permissions
I highly recommend reading about [Linux file permissions][2] at this stage. That will help you understand things better than just running the [chmod command][48] blindly.
The chmod (change mode) command is used for changing the permissions on a file.
The most common use of this command is when you want to make a file executable. Got a shell script? Make it executable like this:
```
chmod u+x file executable
```
There are many more use cases that make chmod a must-know command for Ubuntu users.
**Fun fact**: The parent company of **Its FOSS** is **chmod777 Media Tech**. chmod 777 command gives all the permissions to all the users. This represents our motto of knowledge access to everyone.
#### 21. lshw: Get the Hardware Details
There are tons of command line [tools to get the hardware details][49] and other system information in Linux.
The one that probably comes preinstalled on Ubuntu is**lshw** (short for list hardware).
Now, by default, it displays a vast output with details about all the hardware component,s and trust me, thats not very easy to understand.
```
lshw
```
You may feel the temptation of using grep here, but there is no need for that. The output of lshw is divided into classes and you can use that to show the details for a class of hardware.
Want to [know the manufacturer of your network adapters][50]? Use this:
```
lshw -C network
```
![lshw command examples][51]
#### 22. sudo: Run Commands With root Privileges
You must have noticed that I used sudo as a prefix for some commands I discussed previously.
By default, in Ubuntu, **sudo** is configured in a way that it allows you (to the default admin user) to run any command with root privileges.
You are asked to enter a password, and its your user account password. When you enter the password, nothing is displayed on the screen. New users get baffled by it, but its the expected behavior in UNIX/Linux. You type the password and press enter.
![using sudo example ubuntu][52]
More about [root user in Ubuntu here][53].
#### 23. apt: Install, Remove and Manage .deb packages
The**apt** command is used for managing packages in Ubuntu. Youll have to use it with sudo as these are administrative tasks.
To install a package, use:
```
sudo apt install package_name
```
To delete an install software, use:
```
sudo apt remove package_name
```
To update your Ubuntu system with all upgradable packages at once:
```
sudo apt update && sudo apt upgrade
```
The [difference between apt update and upgrade][54] is that an update refreshes the package cache and the upgrade actually installs the update.
There is a lot more to the apt command. You can read [this detailed apt command guide][55].
#### 24. add-apt-repository: Add, and Remove PPAs
Alright! This one is not as popular as it was a decade ago. Youll still come across the [add-apt-repository command][56] here and there. Its used for managing PPA (unofficial, user-generated repositories) in your system.
While following tutorials on the web, you may come across installation instructions that are composed of three lines:
```
sudo add-apt-repository ppa:dr-akulavich/lighttable
sudo apt update
sudo apt install lighttable-installer
```
The first command is adding the PPA (external repository). You are already familiar with the following two, which are used to update the package cache and install software provided by the PPA repository you just added.
To delete a PPA, you should first delete the software you installed from it and then remove it like this:
```
sudo add-apt-repository -r ppa:dr-akulavich/lighttable
```
I have a [complete guide on PPA][57] for more details on this topic.
#### 25. snap: Install, Remove and Manage snap packages
So far, you know apt packages and their management. However, Ubuntu also uses and actively recommends using its snap packaging format.
Learning a few basic snap commands will help you manage these packages effectively.
To find a package, use:
```
snap find search_term
```
To install a package, use:
```
sudo snap install package_name
```
To list installed snap applications:
```
snap list
```
To remove an installed Snap application, use:
```
sudo snap remove package_name
```
#### 26. ip: Check IP address and other info
The **ip** command lets you [check your IP address][58]. You can also see and manipulate the routes, network devices, and more.
```
ip a
```
![ip address check ubuntu][59]
#### 27. ping: Check if the remote system is reachable
Ping is another [Linux networking command][60] you should be aware of. To check whether a remote system is available or not, give its IP address to the ping command:
```
ping ip_address
```
You can also use it to check if a website is down though it is not very accurate these days.
![ping command ubuntu][61]
Use **Ctrl+C** to stop the running ping command.
**Recommended Read**: [ping command examples][62]
#### 28. ssh: Connecting to remote systems
I was skeptical about adding ssh to the list of must-know Linux commands. Many desktop users may not need it. SSH is used for connecting to other Linux systems from your terminal.
```
ssh [email protected]_address_of_remote_system
```
You need to know the user and password of the remote system, of course.
If you have cloud servers or a home setup where other Linux systems are available, you can use it to connect to them from your primary system.
#### 29. scp: Copy files between remote systems
Since I included ssh in the list, it was only fair to include something for [transferring files between the remote systems over SSH connection][63].
The scp command works almost like the cp command you saw earlier.
Heres an example that copies the file from the home directory of the user on the remote system to the current directory of your locally logged in system.
```
scp [email protected]_address:/home/username/filename .
```
**Recommended Read**: [scp command examples][64]
#### 30. exit: Close the terminal
The list of essential Linux commands is ending. So lets talk about exiting the terminal. Its quite simple. Just enter:
```
exit
```
If you are using another user or shell, youll be logged out from that.
You may also use **Ctrl+D**keys to exit the terminal.
#### 31. shutdown: Turn off or reboot the system
Alright. Let me share a final command if you havent exited the terminal yet.
How about [turning off your system][65] from the command line?
[Use the shutdown command][66] for this purpose:
```
shutdown
```
The above command [schedules a shutdown][67] in one minute. You can make it turn off immediately with:
```
shutdown -now
```
You can use the same shutdown command for [rebooting your Ubuntu system][68] as well:
```
shutdown -r now
```
#### Bonus tip: man: Learn about commands in detail
One more, and this is the last one, I promise. All Linux systems come with a manual for the commands. Its called manpage, and you can access the manual page of an installed command with the following:
```
man command_name
```
[Understanding the manpage][69] can be overwhelming for new users, but it comes quite handy. It gives you the generic syntax and description of all the options a command has.
When you are unsure about using a command, try checking its man page before searching for it on the internet.
### Theres Always More …
**Thats just about 30 commands. And thats not even 20% of the Linux commands**. I havent covered many networking commands. I didnt even go for the user management commands.
I wrote this keeping a regular Ubuntu desktop user in mind. These are the kinds of commands you are more likely to use. Having some knowledge about them would be helpful in the long run.
Other than that, there is no end to learning. Even the most seasoned Linux users constantly discover and learn new stuff.
Considering that you are interested in learning Linux commands, let me recommend some[good Linux books][70] and resources.
- [How Linux Works][71]: Explains the working of Linux more than the commands
- [The Linux Command Line by William Shotts][72]: Legally available to download for free in PDF format
- [Linux Pocket Guide by Daniel J Barrett][73]: Linux commands into category and briefly explained with small examples
- [Learn Linux Quickly][74]: Entirely focused on Linux commands with proper examples and sample exercises
Apart from that, you can also learn from websites like [Linux Journey][75] and [Linux Handbook][76].
**I know its been a long read**, but its not even the tip of the iceberg. There is always more to learn, but its also not the case that you have to feel miserable if you dont know all the Linux commands.
**No one knows everything.**
Now, its your turn. Did you find this list of Ubuntu commands helpful?
**If you had to add some more commands to it, what would they be? The comment section is all yours.**
--------------------------------------------------------------------------------
via: https://itsfoss.com/essential-ubuntu-commands/
作者:[Abhishek Prakash][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/
[b]: https://github.com/lkxed
[1]: https://linuxhandbook.com/absolute-vs-relative-path/
[2]: https://linuxhandbook.com/linux-file-permissions/
[3]: https://itsfoss.com/basic-terminal-tips-ubuntu/
[4]: https://itsfoss.com/folder-directory-linux/
[5]: https://itsfoss.com/wp-content/uploads/2022/11/ls-command-ubuntu.png
[6]: https://linuxhandbook.com/ls-command/
[7]: https://itsfoss.com/wp-content/uploads/2022/11/cd-command-examples.png
[8]: https://linuxhandbook.com/cd-command-examples/
[9]: https://itsfoss.com/wp-content/uploads/2022/11/cat-command-example.png
[10]: https://linuxhandbook.com/cat-command/
[11]: https://itsfoss.com/wp-content/uploads/2022/11/reading-large-files-with-less-command.png
[12]: https://linuxhandbook.com/less-command/
[13]: https://itsfoss.com/wp-content/uploads/2022/11/touch-command-ubuntu.png
[14]: https://linuxhandbook.com/touch-command/
[15]: https://itsfoss.com/wp-content/uploads/2022/11/mkdir-command-example.png
[16]: https://linuxhandbook.com/mkdir-command/
[17]: https://itsfoss.com/wp-content/uploads/2022/11/cp-command-example.png
[18]: https://linuxhandbook.com/cp-command/
[19]: https://itsfoss.com/wp-content/uploads/2022/11/mv-command-example.png
[20]: https://linuxhandbook.com/mv-command/
[21]: https://itsfoss.com/wp-content/uploads/2022/11/rm-command-examples.png
[22]: https://linuxhandbook.com/remove-files-directories/
[23]: https://itsfoss.com/command-line-text-editors-linux/
[24]: https://itsfoss.com/vim-vs-nano/
[25]: https://itsfoss.com/wp-content/uploads/2022/11/nano-command-example.png
[26]: https://itsfoss.com/nano-editor-guide/
[27]: https://itsfoss.com/how-to-find-the-process-id-of-a-program-and-kill-it-quick-tip/
[28]: https://itsfoss.com/cdn-cgi/l/email-protection
[29]: https://itsfoss.com/wp-content/uploads/2022/11/list-processes-ubuntu.webp
[30]: https://linuxhandbook.com/ps-command/
[31]: https://itsfoss.com/linux-system-monitoring-tools/
[32]: https://itsfoss.com/wp-content/uploads/2022/11/top-command-ubuntu.png
[33]: https://itsfoss.com/stop-program-linux-terminal/
[34]: https://linuxhandbook.com/top-command/
[35]: https://itsfoss.com/loop-device-linux/
[36]: https://linuxhandbook.com/find-exec-command/
[37]: https://linuxhandbook.com/xargs-command/
[38]: https://linuxhandbook.com/find-command-examples/
[39]: https://itsfoss.com/wp-content/uploads/2022/11/grep-command-examples.png
[40]: https://linuxhandbook.com/grep-command-examples/
[41]: https://linuxhandbook.com/grep-command-cheatsheet/
[42]: https://linuxhandbook.com/kill-process/
[43]: https://itsfoss.com/wp-content/uploads/2022/11/find-kill-process-ubuntu-800x264.png
[44]: https://www.imdb.com/title/tt0936501/?ref_=tt_urv
[45]: https://itsfoss.com/wp-content/uploads/2022/11/taken-meme-find-you-kill-you.jpg
[46]: https://itsfoss.com/wp-content/uploads/2022/11/history-command-ubuntu-800x534.png
[47]: https://linuxhandbook.com/history-command/
[48]: https://linuxhandbook.com/chmod-command/
[49]: https://itsfoss.com/hardinfo/
[50]: https://itsfoss.com/find-network-adapter-ubuntu-linux/
[51]: https://itsfoss.com/wp-content/uploads/2022/11/lshw-command-examples.png
[52]: https://itsfoss.com/wp-content/uploads/2022/11/using-sudo-example-ubuntu.png
[53]: https://itsfoss.com/root-user-ubuntu/
[54]: https://itsfoss.com/apt-update-vs-upgrade/
[55]: https://itsfoss.com/apt-command-guide/
[56]: https://itsfoss.com/add-apt-repository-command-not-found/
[57]: https://itsfoss.com/ppa-guide/
[58]: https://itsfoss.com/check-ip-address-ubuntu/
[59]: https://itsfoss.com/wp-content/uploads/2022/11/ip-address-check-ubuntu.png
[60]: https://itsfoss.com/basic-linux-networking-commands/
[61]: https://itsfoss.com/wp-content/uploads/2022/11/ping-command-ubuntu.png
[62]: https://linuxhandbook.com/ping-command/
[63]: https://linuxhandbook.com/transfer-files-ssh/
[64]: https://linuxhandbook.com/scp-command/
[65]: https://learnubuntu.com/shutdown-ubuntu/
[66]: https://linuxhandbook.com/linux-shutdown-command/
[67]: https://itsfoss.com/schedule-shutdown-ubuntu/
[68]: https://learnubuntu.com/restart-ubuntu/
[69]: https://itsfoss.com/linux-man-page-guide/
[70]: https://itsfoss.com/best-linux-books/
[71]: https://nostarch.com/howlinuxworks3
[72]: https://linuxcommand.org/tlcl.php
[73]: https://www.oreilly.com/library/view/linux-pocket-guide/9780596806347/
[74]: https://linuxhandbook.gumroad.com/l/mEsrwA
[75]: https://linuxjourney.com/
[76]: https://linuxhandbook.com/a-to-z-linux-commands/

View File

@ -0,0 +1,188 @@
[#]: subject: "A Guide to systemd journal Maintenance [With Examples]"
[#]: via: "https://www.debugpoint.com/systemd-journald-clean/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
A Guide to systemd journal Maintenance [With Examples]
======
**Systemd comes with many built-in features to manage the system logs. In this guide, we explain how you can manage system journals, logs and take action on them such as rotating, archiving, and clear logs.****We also explain the manual systems journal clean method and using config file changes.**
If your Linux distribution supports [systemd][1], then it collects logs from all processes, applications of the system every second which starts from the boot. All these logging events are managed by `journald` daemon of systemd. The journald collects all the logs (info, warnings, errors, etc) and stores them as binary data in the disk files. 
As the logs remain in the disk and every second it is collected, it takes up huge disk space; especially for older systems, servers. For example, in one of my test systems which are running for around one year, the log file size is in GBs.
If you manage multiple systems, servers, it is always recommended to properly manage journald logs for efficient operation. Lets take a look at how you can manage the log files.
### The systemd journal Maintenance
Using the journalctl utility of systemd, you can query these logs, perform various operations on them. For example, viewing the log files from different boots, check for last warnings, errors from a specific process or applications. If you are unaware of these, I would suggest you quickly go through this tutorial [“use journalctl to View and Analyze Systemd Logs [With Examples]][2]” before you follow this guide. 
#### Where are the physical journal log files?
The systemds journald daemon collects logs from every boot. That means, it classifies the log files as per the boot. 
The logs are stored as binary in the path `/var/log/journal` with a folder as machine id.
**For example:**
![Screenshot of physical journal file -1][3]
![Screenshot of physical journal files -2][4]
Also, remember that based on system configuration, runtime journal files are stored at `/run/log/journal/`. And these are removed in each boot. 
#### Can I manually delete the log files?
You can, but dont do it. Instead, follow the below instructions to clear the log files to free up disk space using journalctl utilities.
#### How much disk space is used by systemd log files?
Open up a terminal and run the below command.
```
journalctl --disk-usage
```
This should provide you with how much is actually used by the log files in your system.
![journalctl disk usage command][5]
If you have a graphical desktop environment, you can open the file manager and browse the path `/var/log/journal` and check the properties.
#### systemd journal clean process
The effective way of clearing the log files should be done by `journald.conf` a configuration files. Ideally, you should not manually delete the log files even if the journalctl provides the utility to do that.
Lets take a look at how you can delete it [manually][6], then I will explain the configuration changes in `journald.conf` so that you do not need to manually delete the files from time to time; Instead, the systemd takes care of it automatically based on your configuration. 
##### Manual delete
First, you have to `flush` and `rotate` the log files. Rotating is a way of marking the current active log files as an archive and creating a fresh logfile from this moment. The flush switch asks the journal daemon to flush any log data stored in `/run/log/journal/` into `/var/log/journal/`, if persistent storage is enabled.
Then, after flushing and rotating, you need to run journalctl with`vacuum-size`, `vacuum-time`, and `vacuum-files` switches to force systemd to clear the logs. 
**Example 1:**
```
sudo journalctl --flush --rotate
```
```
sudo journalctl --vacuum-time=1s
```
The above set of commands removes all archived journal log files until the last second. This effectively clears everything. So, be careful while running the command. 
![journal clean up - example][7]
After clean up:
![After clean up - journal space usage][8]
You can also provide the following suffixes as per your need following the number.
- s: seconds
- m: minutes
- h: hours
- days
- months
- weeks
- years
**Example 2:**
```
sudo journalctl --flush --rotate
```
```
sudo journalctl --vacuum-size=400M
```
This clears all archived journal log files and retains the last 400MB files. Remember this switch applies to only archived log files only, not on active journal files. You can also use suffixes as below.
- K: KB
- M: MB
- G: GB
**Example 3:**
```
sudo journalctl --flush --rotate
```
```
sudo journalctl --vacuum-files=2
```
The vacuum-files switch clears all the journal files below the number specified. So, in the above example, only the last 2 journal files are kept and everything else is removed. Again, this only works on the archived files.
You can combine the switches if you want, but I would recommend not to. However, make sure to run with `--rotate` switch first.
### Automatic delete using config files
While the above methods are good and easy to use, it is recommended that you control the journal log file cleanup process using the journald configuration files which present at `/etc/systemd/journald.conf`. 
The systemd provides many parameters for you to effectively manage the log files. By combining these parameters you can effectively limit the disk space used by the journal files. Lets take a look.
| **journald.conf parameter** | **Description** | **Example** |
| :- | :- | :- |
| SystemMaxUse | Specifies the maximum disk space that can be used by the journal in persistent storage | SystemMaxUse=500M |
| SystemKeepFree | Specifies the amount of space that the journal should leave free when adding journal entries to persistent storage. | SystemKeepFree=100M |
| SystemMaxFileSize | Controls how large individual journal files can grow to in persistent storage before being rotated. | SystemMaxFileSize=100M |
| RuntimeMaxUse | Specifies the maximum disk space that can be used in volatile storage (within the /run filesystem). | RuntimeMaxUse=100M |
| RuntimeKeepFree | Specifies the amount of space to be set aside for other uses when writing data to volatile storage (within the /run filesystem). | RuntimeMaxUse=100M |
| RuntimeMaxFileSize | Specifies the amount of space that an individual journal file can take up in volatile storage (within the /run filesystem) before being rotated. | RuntimeMaxFileSize=200M |
If you add these values in a running system in `/etc/systemd/journald.conf` file, then you have to restart the journald after updating the file. To restart use the following command. 
```
sudo systemctl restart systemd-journald
```
### Verification of log files
It is wiser to check the integrity of the log files after you clean up the files. To do that run the below command. The command shows the PASS, FAIL against the journal file.
```
journalctl --verify
```
![verify log files][9]
### Closing Notes
I hope this guide helps you to understand the basics of the systemd journal management process. With these, you can manage the disk space used by the log files in your system or servers by limiting the space, clearing old log files. These are just the guideline commands, you can combine these in multiple ways to achieve your system demands. 
- [journalctl manual][10]
- [journald.conf manual][11]
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/systemd-journald-clean/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.freedesktop.org/wiki/Software/systemd/
[2]: https://www.debugpoint.com/2020/12/systemd-journalctl/
[3]: https://www.debugpoint.com/wp-content/uploads/2021/01/Screenshot-of-physical-journal-file-1.jpg
[4]: https://www.debugpoint.com/wp-content/uploads/2021/01/Screenshot-of-physical-journal-files-2.jpg
[5]: https://www.debugpoint.com/wp-content/uploads/2021/01/journalctl-disk-usage-command.jpg
[6]: https://www.debugpoint.com#delete-using-journal-conf
[7]: https://www.debugpoint.com/wp-content/uploads/2021/01/journal-clean-up-example.jpg
[8]: https://www.debugpoint.com/wp-content/uploads/2021/01/After-clean-up-journal-space-usage.jpg
[9]: https://www.debugpoint.com/wp-content/uploads/2021/01/verify-log-files.png
[10]: https://www.freedesktop.org/software/systemd/man/journalctl.html
[11]: https://www.freedesktop.org/software/systemd/man/journald.conf.html

View File

@ -0,0 +1,257 @@
[#]: subject: "How to use journalctl to View and Analyze Systemd Logs [With Examples]"
[#]: via: "https://www.debugpoint.com/systemd-journalctl/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to use journalctl to View and Analyze Systemd Logs [With Examples]
======
**This guide explains the basics of the journalctl utility of [Systemd][1] and its various commands. You can use these commands for troubleshooting desktop and server logs in Linux. This is how you can use journalctl to view and analyze Systemd Logs with different examples.**
### Introduction
Many say that Systemd is not good, it is heavy on the system and it is a debated topic always. But you can not deny that it provides a well set of utilities to manage, troubleshoot a system. Imagine you end up with a broken system with no GUI. You probably messed up boot and GRUB as well. In those kinds of scenarios or in general you can boot from a LIVE system, mount your Linux partition and explore the Systemd logs to find out about the problem.
Systemd has three basic components as follows
- **systemd**: System and service manager for Linux operating systems.
- **systemctl**: Command to introspect and control the state of the systemd system and service manager.
- **systemd-analyze**: Provides system boot-up performance statistics and retrieve other state and tracing information from the system and service manager
Apart from these three, there are additional services that systemd provides such as journald, logind, networkd, etc. In this guide we will talk about the journald service of systemd.
### journald systemd journal daemon
By design, systemd provides a centralized way of handing all operating system logs from processes, applications, etc. All these logging events are handled by journald daemon of systemd. The journald daemon collects all logs from everywhere of the Linux operating systems and stores themes as binary data in files.
The advantages of centralized logging of events, system problems as binary data are many. For example, as the system logs are stored as binary and not text you can translate in many ways such as text, JSON objects for various needs. Also, it is super easy to track down to a single event as the logs are stored sequentially via date/time manipulation of the logs.
Remember the log files that journald collects are in thousands of lines and it gets updated for every event, every boot. So if you have a long time running Linux operating system the journal logs size should in GBs. As the logs are in thousands, its better to filter with basic commands to find out more about the system problems.
#### The journald Configuration File
The configuration file of the journald is present in the below path. It contains various flags on how the logging happens. You can take a look at the file and make the changes necessary. But I would recommend not to modify this file unless you know what you are doing.
```
/etc/systemd/journald.conf
```
#### Where journald stores the binary log files
The journald stores the logs in binary format. They are stored inside a directory under this path.
```
/var/log/journal
```
For example, in the below path there is a directory that contains all the system logs to date.
![journalctl log file path][2]
Do not use cat command or use nano or vi to open these files. They would not be displayed properly.
### Use journalctl to View and Analyze Systemd Logs
#### Basic journald command
The basic command to view logs using journal daemon is
```
journalctl
```
![journalctl][3]
This gives you all the journal entries including errors, warnings, etc from all applications and processes. It shows the list with the oldest log at the top and current logs at the bottom. You need to keep pressing ENTER to scroll through it line by line. You can also use PAGE UP and PAGE DOWN keys to scroll. Press q to exit from this view.
#### How to view journal entries for time zones
By default, the journalctl shows the log time in the current system time zone. However, you can easily provide the timezone in your command to convert the same log to a different time zone. For example, to view the logs in UTC, use the below command.
```
journalctl --utc
```
![journalctl --utc][4]
#### How to view only errors, warnings, etc in journal logs
The logs that a system generates have different priorities. Some logs may be a warning which can be ignored or some may be critical errors. You might want to look at only errors, not warnings. That is also possible using the below command.
To view emergency system messages use:
```
journalctl -p 0
```
![journalctl -p 0][5]
Error codes
```
0: emergency
1: alerts
2: critical
3: errors
4: warning
5: notice
6: info
7: debug
```
When you specify the error code, it shows all messages from that code and above. For example, if you specify the below command, it shows all messages with priority 2, 1 and 0
```
journalctl -p 2
```
#### How to view journal logs for a specific boot
When you are running the journalctl command it shows the information from the current boot that is from the current session which you are running. But it is also possible to view information about past boots as well.
Journal logs keep on updating in every reboot. The journald keeps track of the logs in different boots. To view, the boot-wise logs use the below command.
```
journalctl --list-boots
```
![journalctl list-boots][6]
- The first number shows the unique journald boot track number which you can use in the next command to analyze that specific boot.
- The second number the boot ID which also you can specify in the commands.
- The next two date, time combinations are the duration of the logs stored in the respective file. This is super handy if you want to find out a log or error from a specific date, time.
To view a specific boot number you the first number or the boot ID as below.
```
journalctl -b -45
```
```
journalctl -b 8bab42c7e82440f886a3f041a7c95b98
```
![journalctl -b 45][7]
You can also use `-x` switch which can add an explanation of the systemd error messages in your display. This is a lifesaver in certain situations.
```
journalctl -xb -p 3
```
![journalctl -xb][8]
#### How to view journal logs for a specific time, date duration
The journalctl is powerful enough to provide “english” like argument in the command itself for time and date manipulation.
You can use`--since` switch with a combination of `“yesterday”, “today”, “tomorrow”, or “now”.`
Some of the examples of different commands below. You can modify them as per your need. They are self-explanatory. The date, time format in the below commands are `"YYYY-MM-DD HH:MM:SS"`
```
journalctl --since "2020-12-04 06:00:00"
```
```
journalctl --since "2020-12-03" --until "2020-12-05 03:00:00"
```
```
journalctl --since yesterday
```
```
journalctl --since 09:00 --until "1 hour ago"
```
![journalctl --since 09:00 --until][9]
You can combine the above with the error level switches as well.
#### How to see Kernel specific journal logs
The Linux Kernel messages can be extracted from journal logs as well. To view the Kernel messages from the current boot only use the below command.
```
journalctl -k
```
#### How to see journal logs for a service, PID
You can filter out specific logs from a systemd service unit only from the journald logs. For example, to find out the logs from NetworkManager service use the below command.
```
journalctl -u NetworkManager.service
```
![journalctl NetworkManager service][10]
If you do not know the service name, you can use the below command to list the systemd services in your system.
```
systemctl list-units --type=service
```
#### How to view journal logs for a user, group
If you are analyzing server logs this command is helpful where multiple users are logged in. You can first find out about the user id using the below command from the user name. For example, to find out the id of user “`debugpoint`”
```
id -u debugpoint
```
Then use that ID with `_UID` switch to view the logs generated by the user.
```
journalctl _UID=1000 --since today
```
![journalctl _UID][11]
Similarly use `_GID` switch to find out the same for user groups.
#### How to view journal logs for an executable
You can also find out journald logs of a specific program or executable. For example, if you want to find out the messages of gnome-shell, you can run the below command.
```
journalctl /usr/bin/gnome-shell --since today
```
![journalctl gnome-shell][12]
### Closing notes
I hope this guide helps you to use journalctl to view analyze systemd logs on your Linux desktop or server troubleshooting. The systemd journal management extremely powerful if you know how to use the commands, it makes your life a bit easy during debugging time. All major mainstream Linux distribution uses Systemd these days. Ubuntu, Debian, Fedora, Arch they all use systemd for their default OS offerings. In case if you are wondering about systemd-free Linux distributions, you might want to check out [MX-Linux][13], Gentoo, Slackware, Void Linux.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/systemd-journalctl/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://freedesktop.org/wiki/Software/systemd/
[2]: https://www.debugpoint.com/wp-content/uploads/2020/12/journalctl-log-file-path.jpg
[3]: https://www.debugpoint.com/wp-content/uploads/2020/12/journalctl.jpg
[4]: https://www.debugpoint.com/wp-content/uploads/2020/12/journalctl-utc.jpg
[5]: https://www.debugpoint.com/wp-content/uploads/2020/12/journalctl-p-0.jpg
[6]: https://www.debugpoint.com/wp-content/uploads/2020/12/journalctl-list-boots.jpg
[7]: https://www.debugpoint.com/wp-content/uploads/2020/12/journalctl-b-45.jpg
[8]: https://www.debugpoint.com/wp-content/uploads/2020/12/journalctl-xb.jpg
[9]: https://www.debugpoint.com/wp-content/uploads/2020/12/journalctl-since-0900-until.jpg
[10]: https://www.debugpoint.com/wp-content/uploads/2020/12/journalctl-NetworkManager-service.jpg
[11]: https://www.debugpoint.com/wp-content/uploads/2020/12/journalctl-_UID.jpg
[12]: https://www.debugpoint.com/wp-content/uploads/2020/12/journalctl-gnome-shell.jpg
[13]: https://www.debugpoint.com/tag/mx-linux

View File

@ -0,0 +1,144 @@
[#]: subject: "Why sysadmins should choose Awesome window manager on Linux"
[#]: via: "https://opensource.com/article/22/11/linux-awesome-window-manager"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Why sysadmins should choose Awesome window manager on Linux
======
The Awesome window manager takes a "tiling" approach, meaning that each window you launch takes up a fraction of your desktop according to the number of windows you have open.
Awesome is a window manager for the [Linux desktop][1]. A "window manager" is a graphical interface that primarily (if not literally) just manages the drawing and arrangement of windows. In practice, even the [most rudimentary][2] of window managers actually provides a little more than just the ability to draw a window. Most also provide a pop-up menu so you can launch an application, some provide a dock or panel so you can switch between different applications you have running. They stop short at providing desktop conveniences such as drawing a wallpaper in the background of your screen, mounting and unmounting devices, providing a system tray, and so on. A window manager assumes you can use other applications to build a desktop experience to your own liking, and so it focuses on managing windows. The Awesome window manager takes a "tiling" approach, meaning that each window you launch takes up a fraction of your desktop according to the number of windows you have open.
![Image of the Awesome desktop.][3]
### My Linux desktop is the terminal
When you're a [systems administrator][4], you tend to spend a lot of time in a terminal window. It's a direct and efficient interface to your local machine, to remote machines, the network, the Internet, and everything else, so it's usually the easiest and most sensible way to do a lot of things to a lot of computers at once. And when you spend all day in a terminal, you understandably start to question whether you actually need a desktop at all.
To be perfectly honest, the answer's often no, at least for 80% of your tasks. The reality of modern computing, however, is that there are some applications that are just easier to use through a graphical interface. For instance, even though there are issue tracking systems, like the open source Bugzilla, that provide terminal commands as an interface, sometimes you're on a team that uses an issue tracker (usually it's not open source) that provides only a web application. Like it or not, you need a web browser to interact with the ticketing system. And even though you may use a perfectly reasonable markup language like [AsciiDoc][5], you're probably sent a word processor document sometimes and, while you could use [Pandoc][6] to convert the document into AsciiDoc and then back into an office document, that risks losing something in translation. Like it or not, you need an office suite.
The bottom line is that, whether you like it or not, you need a desktop. Or at least a window manager.
### Tiling windows
Awesome understands your plight. With Awesome, your "primary" desktop can be your terminal. When you first launch it, your terminal window is full screen, just like the text console you really want to be greeted with upon login. When you really need web browser, though, you can launch it and Awesome makes room for it by splitting your screen in half. Your terminal is on one side, the web browser's on the other.
If you need to open a third application, you can launch that and Awesome makes room for it by splitting your screen into thirds.
![Image of Awesome tiles.][7]
When you're finished with an application, Awesome adjusts your layout again until, eventually, you're back to a full-screen terminal, just the way you like it.
### Lua configuration
Awesome uses the [Lua][8] scripting language for configuration. Lua has a similar philosophy to Awesome. It's a simple language that's pretty intuitive once you understand a few basic concepts.
The simplest concept, and yet the most important, is the Lua table construct. Lua stores information in what it calls a "table", and it means that most everything in Lua has a structured hierarchy. For instance, this creates a Lua table:
```
zombie = {}
zombie.apocalypse = true
zombie.defeat = false
```
Now when you need to know whether there's an active zombie apocalypse, you can "call" the zombie table and query the `apocalypse` value:
```
> print(zombie.apocalypse)
true
```
Both the `apocalypse` and the `defeat` values are "children" of the `zombie` table, which makes them each distinct from the `apocalypse` and `defeat` values of the `alien` table.
It's a simple system of data classification, and you see several tables used in the Awesome configuration:
```
-- Table of layouts
awful.layout.layouts = {
awful.layout.suit.floating,
awful.layout.suit.tile,
awful.layout.suit.tile.left,
awful.layout.suit.tile.bottom,
awful.layout.suit.tile.top,
awful.layout.suit.fair,
awful.layout.suit.fair.horizontal,
awful.layout.suit.spiral,
awful.layout.suit.spiral.dwindle,
awful.layout.suit.max,
awful.layout.suit.max.fullscreen,
awful.layout.suit.magnifier,
awful.layout.suit.corner.nw,
}
```
You may not know what options are available from reading the configuration file itself, but understanding that the options are grouped into Lua tables means you know what to look up in the Awesome documentation.
Of course, if you don't feel like reading through the documentation, you can also just comment options out and see what changes. A comment in Lua are two dashes, as in the first line of this snippet:
```
-- Create a launcher widget and a main menu
myawesomemenu = {
{ "hotkeys", function() hotkeys_popup.show_help(nil, awful.screen.focused()) end },
{ "manual", terminal .. " -e man awesome" },
{ "edit config", editor_cmd .. " " .. awesome.conffile },
{ "restart", awesome.restart },
{ "quit", function() awesome.quit() end },
}
```
Lua is a consistent and logical language. Any amount of Lua you pick up from configuring Awesome is Lua you can use for real life Lua scripting. If you're ready to move up from basic Bash scripting, you might consider Lua.
### Adjusting tiles
While you're working in a split screen in Awesome, you might find the need to adjust the proportions. To do this graphically, right-click on the intersection the windows you want to adjust, and then drag all window borders to suit your preference.
When you learn enough Lua to get really good at configuring Awesome, you can configure default preferences.
### Floating windows
Some applications never make sense as tiled windows. The Awesome configuration provided by your Linux distribution probably has a few examples set:
```
-- Floating clients.
class = {
"Blueman-manager",
"Kruler",
"MessageWin",
"Tor Browser",
"Wpa_gui"},
},
```
### Assemble your own Linux desktop
Using a window manager instead of a desktop means you get to choose the components you use for everything else you want to do with your computer. You can launch KDE applications from the [Plasma Desktop][9], or use bits and pieces of [XFCE][10] (such as the panel, the network manager, and more), or you can eschew the desktop model entirely and use a particularly robust file manager and the terminal commands you know and love.
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/11/linux-awesome-window-manager
作者:[Seth Kenlon][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lkxed
[1]: https://opensource.com/article/20/5/linux-desktops
[2]: https://opensource.com/article/19/12/twm-linux-desktop
[3]: https://opensource.com/sites/default/files/2022-10/awesome-desktop.png
[4]: https://www.redhat.com/sysadmin/?intcmp=7013a000002qLH8AAM
[5]: https://opensource.com/article/22/8/drop-markdown-asciidoc
[6]: https://opensource.com/article/20/5/pandoc-cheat-sheet
[7]: https://opensource.com/sites/default/files/2022-10/awesome-tiles.png
[8]: https://opensource.com/article/22/11/lua-worth-learning
[9]: https://opensource.com/article/19/12/linux-kde-plasma
[10]: https://opensource.com/article/18/6/xfce-desktop

View File

@ -0,0 +1,223 @@
[#]: collector: (lujun9972)
[#]: translator: (FYJNEVERFOLLOWS )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Convert audio files with this versatile Linux command)
[#]: via: (https://opensource.com/article/20/2/linux-sox)
[#]: author: (Klaatu https://opensource.com/users/klaatu)
使用这个多功能的 Linux 命令转换音频文件
======
SoX Sound Exchange 甚至可以为您的音频文件添加特效。
![HiFi vintage stereo][1]
我与媒体打交道,当你与任何一种媒体打交道时,你很快就会知道标准化是一种有价值的工具。就像你不会试图在不转换其中一个或另一个的情况下将分数加到小数中一样,我已经了解到组合不同格式的媒体并不是理想的。为了方便用户,大多数爱好者级应用程序使转换过程不可见。然而,对于那些需要控制媒体细节的用户的灵活软件,会通常让你自己提前将媒体转换为所需的格式。我有一些最喜欢的音频转换工具,其中之一就是号称“声音的瑞士军刀” —— [SoX][2]。
### 安装
在 Linux 或 BSD 上,可以从软件存储库或端口树中安装 **sox** 命令(和一些有用的符号链接)。
你也可以从 [Sourceforge.net][3] 上安装 SoX。它不经常发布但它的代码库往往是稳定的所以如果你想要最新的功能如 Opus 支持),构建它是容易和安全的。
SoX 主要提供了 **SoX** 命令,但是安装 SoX 也创建了一些有用的符号链接:**play**、**rec** 和 **soxi**
### 使用 SoX 获取有关文件的信息
SoX 读取和重写音频数据。它是否存储重写的音频数据取决于你。在有些情况下,你不需要存储转换后的数据,例如,当你将输出直接发送到扬声器进行回放时。然而,在进行任何转换之前,最好首先确定要处理的是什么。
使用 **soxi** 命令也可以收集音频文件信息。**soxi** 会符号链接到 **soxi--info**
```
$ soxi countdown.mp3
Input File输入文件    : '/home/tux/countdown.mp3'
Channels通道数       : 1
Sample Rate采样率    : 44100
Precision数据精度      : 16-bit16 比特)
Duration时长       : 00:00:11.21 = 494185 samples...11.21 秒 = 494185 采样点)
File Size文件大小      : 179k
Bit Rate比特率       : 128k
Sample Encoding编码格式: MPEG audio (layer I, II or III)
```
这个输出可以让你很好地了解音频文件的编码方式、文件长度、文件大小、采样率和通道数。其中一些你可能*认为*你已经知道了,但当客户把媒体带到我面前时,我从不相信这些假设。使用 **soxi** 验证媒体属性。
### 转换文件
在本例中,游戏节目的音频以 MP3 文件的形式展示倒计时。虽然几乎所有的编辑应用程序都接受压缩音频,但它们都没有真正编辑压缩数据。转换是在某个地方发生的,可能是一个秘密的后台任务,也可能是让你保存一份副本的提示。我通常喜欢自己提前完成转换。这样,我可以控制使用的格式。我可以在一夜之间批量制作大量的媒体,而不是浪费宝贵的制作时间,等待编辑应用程序按需浏览它们。
**sox** 命令用于转换音频文件。在 **sox** 流程中有几个阶段:
* 输入
* 合并
* 特效
* 输出
在命令语法中,特效步骤令人困惑地写到*最后一步*。这意味着 **sox** 流程是这样组成的:
```
输入 → 合并 → 输出 → 特效
```
### 编码
最简单的转换命令只涉及一个输入文件和一个输出文件。下面是转换 MP3 文件为无损 FLAC 文件的命令:
```
$ sox countdown.mp3 output.flac
$ soxi output.flac
Input File输入文件     : 'output.flac'
Channels通道数       : 1
Sample Rate采样率    : 44100
Precision数据精度      : 16-bit16 比特)
Duration时长       : 00:00:11.18 = 493056 samples...11.18 秒 = 493056 采样点)
File Size文件大小      : 545k
Bit Rate比特率       : 390k
Sample Encoding编码格式: 16-bit FLAC
Comment注释        : 'Comment=Processed by SoX'
```
#### 特效
特效可以在命令末尾指定。它可以在将数据发送到最终目的地之前更改音频。例如,有时声音太大会在转换过程中造成问题:
```
$ sox bad.wav bad.ogg
sox WARN sox: `bad.ogg' output clipped 126 samples; decrease volume?
```
应用**增益** (gain) 效果通常可以解决此问题:
```
`$ sox bad.wav bad.ogg gain -1`
```
#### 淡入淡出
另一个常用的效果是**淡入淡出**。此效果允许你定义淡入或淡出的形状,以及你希望淡入淡出效果持续的时间。
下面是一个使用倒抛物线的 6 秒淡入示例:
```
`$ sox intro.ogg intro.flac fade p 6`
```
这将对音频的头部应用 3 秒的淡入,并从 8 秒标记开始淡出(介绍音乐只有 11 秒因此在这种情况下淡出也是3秒
```
`$ sox intro.ogg intro.flac fade p 3 8`
```
**sox** 手册页中列出了不同类型的淡入淡出(正弦、线性、倒抛物线等)以及**淡入淡出提供的选项。
#### 特效语法
每个特效插件都有自己的语法,因此请参阅手册页了解如何调用每个特效插件的详细信息。要做到这一点,你需要一个图形声波编辑器或数字音频工作站,例如 [LMMS][4] 或 [Rosegarden][5]。但是,如果你只想应用一次特效,可以在同一命令中将它们一起列出。
此命令应用 -1 的**增益**效果、1.35 的速度**拉伸**和**淡入淡出**
```
$ sox intro.ogg output.flac gain -1 stretch 1.35 fade p 0 6
$ soxi output.flac
Input File输入文件     : 'output.flac'
Channels通道数       : 1
Sample Rate采样率    : 44100
Precision数据精度      : 16-bit16 比特)
Duration时长       : 00:00:15.10 = 665808 samples...15.10 秒 = 665808 采样点)
File Size文件大小      : 712k
Bit Rate比特率       : 377k
Sample Encoding编码格式: 16-bit FLAC
Comment注释        : 'Comment=Processed by SoX'
```
### 组合音频
SoX 还可以通过连接或混合音频文件来组合音频文件。
要连接(或*拼接*)文件合并为一个文件,请在命令中提供多个输入文件:
```
`$ sox countdown.mp3 intro.ogg output.flac`
```
在本例中,**output.flac** 现在包含 **倒计时** 音频,紧接着是**简介** 音乐。
但是,如果你希望两首曲目同时播放,可以使用 **\--combine mix** 选项:
```
`$ sox --combine mix countdown.mp3 intro.ogg output.flac`
```
然而想象一下这两个输入文件的不同之处不仅仅在于它们的编解码器。声音用单声道一个声道录制并不少见但音乐要用立体声至少两个声道来录制。SoX 不会给出默认的解决方案,因此你必须首先自己标准化这两个文件的格式。
#### 更改音频文件
选项只与后面列出的文件名相关。例如,此命令中的 **\--channels** 选项将*仅仅*应用于 **input.wav**,而*不被*应用于 **example.ogg****output.flac**
```
`$ sox --channels 2 input.wav example.ogg output.flac`
```
这意味着在 SoX 中,选项的位置非常重要。如果你在命令开始时指定一个选项,那么实际上只会覆盖 SoX 自己从输入文件中收集的内容。然而,在*输出文件*名 前的选项决定了 SoX 如何写入音频数据。
要解决以前的不兼容通道问题,你可以首先标准化输入,然后混合:
```
$ sox countdown.mp3 --channels 2 countdown-stereo.flac gain -1
$ soxi countdown-stereo.flac
Input File输入文件     : 'countdown-stereo.flac'
Channels通道数       : 2
Sample Rate采样率    : 44100
Precision数据精度      : 16-bit16 比特)
Duration时长       : 00:00:11.18 = 493056 samples...11.18 秒 = 493056 采样点)
File Size文件大小      : 545k
Bit Rate比特率       : 390k
Sample Encoding编码格式: 16-bit FLAC
Comment注释        : 'Comment=Processed by SoX'
$ sox --combine mix \
countdown-stereo.flac \
intro.ogg \
output.flac
```
SoX 绝对需要多个命令来执行复杂的操作,因此根据需要创建几个临时和中间文件是正常的。
### 多通道音频
当然,并非所有音频都被限制在一个或两个声道。如果您想将多个音频通道组合成一个文件,可以使用 SoX 和 **\--combine merge** 选项:
```
$ sox --combine merge countdown.mp3 intro.ogg output.flac
$ soxi output.flac
Input File     : 'output.flac'
Channels       : 3
[...]
```
### 简单的音频操作
在没有视觉界面的情况下操作音频似乎很奇怪而且对于某些任务来说SoX 绝对不是最好的工具。然而对于许多任务SoX 提供了一个简单而轻量级的工具包。SoX 是一个具有强大潜力的简单命令。有了它,你可以转换音频,操纵通道和波形,甚至生成自己的声音。本文仅简要概述了其功能,因此请阅读其手册页或[在线文档][2],然后看看你能创造什么。
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/2/linux-sox
作者:[Klaatu][a]
选题:[lujun9972][b]
译者:[FYJNEVERFOLLOWS](https://github.com/FYJNEVERFOLLOWS)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/klaatu
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/hi-fi-stereo-vintage.png?itok=KYY3YQwE (HiFi vintage stereo)
[2]: http://sox.sourceforge.net/sox.html
[3]: http://sox.sourceforge.net
[4]: https://opensource.com/life/16/2/linux-multimedia-studio
[5]: https://opensource.com/article/18/3/make-sweet-music-digital-audio-workstation-rosegarden

View File

@ -1,100 +0,0 @@
[#]: subject: "What you need to know about compiling code"
[#]: via: "https://opensource.com/article/22/10/compiling-code"
[#]: author: "Alan Smithee https://opensource.com/users/alansmithee"
[#]: collector: "lkxed"
[#]: translator: "Donkey-Hao"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
关于编译代码你应该知道的
======
用这个老鼠夹比喻来理解编译代码。然后下载我们新电子书《开源开发者开发应用指导手册》。
每个人都可以获取开源软件源代码,必须源代码要经过编译才能够运行程序。无论你是自己编写了代码,并且想要编译和运行它,还是你已经下载了某人的项目来尝试它,了解如何通过 [编译器][2] 处理源代码,以及编译器如何处理这些代码,这都很有用。
### 创建一个更好的老鼠夹
一般情况我们不会将一个老鼠夹比作电脑,但不管你信不信,它确实与你正在使用的设备(手机或电脑)的 CPU 有一些相似之处。经典的老鼠夹有两种状态:打开或者释放。你可以认为 *打开* 是将老鼠夹设置好准备捕获老鼠,以及 *释放* 是夹子被老鼠触发。某种意义上来说,老鼠夹就像是有鼠标的电脑。你可能会想到这个代码,用虚构的语言来描述这个过程:
```
if mousetrap == 0 then
There's a mouse!
else
There's no mouse yet.
end
```
换句话说,你可以基于老鼠夹的状态发现是否有老鼠。当然,老鼠夹不是万无一失的,有可能有一只老鼠在老鼠夹旁边,由于老鼠还没有触发老鼠夹,所以它的状态还是 *打开* 的。因此该程序可以进行改进,这都是非常典型的。
### 开关
总的来说,老鼠夹就是一个开关。你会在家里使用开关打开灯。可以从开关中获得许多信息。比如,人们会从你家灯的状态了解到你是否在家。
你可以根据邻居家灯的状态来改变行为。如果邻居家所有的灯都熄灭了,那么请关掉你大声的音乐,因为人们可能已经上床睡觉了。
乘以几个数量级,缩小到微观级别的 CPU 也使用这样的逻辑。当 CPU 在特定寄存器处接收到电信号时,可以触发其他一些寄存器,然后触发另一个,以此类推。如果这些寄存器有特定的意义,那么就可以通信。也许激活同一主板上某处的芯片,或者使 LED 亮起,或者改变屏幕上的像素颜色。
**[[ 相关阅读2022 年可以尝试的 6 个 Python 解释程序 ]][3]**
种瓜得瓜,种豆得豆。如果你真的想在多个位置而不是仅限于一处发现老鼠,但是你只有一个老鼠夹,那你应该开发一个应用才行。使用网络摄像头和一些基本的图像识别软件,你可以建立空厨房的模型,然后扫描变化。当老鼠进入厨房,在原先没有老鼠的图像上会有像素的变化。记录下这些数据,如果有无人机可以追踪老鼠并捕获会更好,这样就可以将老鼠赶出厨房了。这时,你通过打开和关闭信号的魔法,创造了一个更好的捕鼠器。
### 编译器
代码编译器将人们可阅读的代码转换成 CPU 可以理解的机器语言。这是非常复杂的过程,因为 CPU 非常复杂(甚至比老鼠夹更加复杂),同时因为该过程比严格“需要”的更加灵活。并不是所有的编译器都很灵活。有一些编译器只有一个目标,它们只会处理固定格式的代码文件,处理过程也因此而简单明了。
幸运的是,现代通用编译器不简单。它们允许你编写不同语言的代码,也允许你用不同的方式链接库文件,并且可以生成运行在不同架构的文件。[GNU C 语言编译器][4](GCC) 的 `--help` 会输出超过 50 行的选项LLVM 的 `clang` 编译器的 `--help` 输出超过 1000 行。GCC 指导手册的字数超过 10 万。当你在编译代码时会有很多选项。
当然,大多数人并不需要知道所有的选项。我从未读过 GCC 的手册页面(man page),因为它为 `Objective-C`、`Fortran` 以及我从未听说过的`芯片架构` 提供帮助。不过我重视它将代码编译为不同的架构—— 64 位或者 32 位——的能力,并且它是开源软件,这已经将其他的编译器甩在后面了。
### 编译生命周期
同样重要的是,真正厉害的是理解编译代码的不同阶段。这是一个简单的 C 语言程序的生命周期:
1、 带有宏定义的 C 源代码 `.c` 文件,会被当作 `.cpp` 文件进行预处理为 `.i` 文件。
2、带有扩展宏定义的 C 源代码 `.i` 文件,会被 `gcc` 翻译输出 `.s` 文件。
3、汇编语言文本文件 `.s` 会被汇编为 `.o` 文件。
4、带有 CPU 指令的二进制目标代码,以及相对于其他目标文件和库 (\*.o) 与内存区域无关的偏移量,使用 `ld` 链接以生成可执行文件。
5、最终的二进制文件要么包含所有需要的对象要么设置为加载链接的动态库\*.so 文件)。
你可以试试这个简单示例(可能需要对库路径做一些调整):
```
$ cat << EOF >> hello.c
#include
int main(void)
{ printf("hello world\n");
return 0; }
EOF
$ cpp hello.c > hello.i
$ gcc -S hello.i
$ as -o hello.o hello.s
$ ld -static -o hello \
-L/usr/lib64/gcc/x86_64-slackware-linux/5.5.0/ \
/usr/lib64/crt1.o /usr/lib64/crti.o hello.o \
/usr/lib64/crtn.o --start-group -lc -lgcc \
-lgcc_eh --end-group
$ ./hello
hello world
```
### 可获得的知识
计算机已经变得非常强大,并且用户友好。请不要走向这两种可能的极端中的任何一种:计算机不像捕鼠器和电灯开关那么简单,但它们也不是无法理解的。你可以了解编译代码、如何链接以及针对不同架构进行编译。一旦你知道了,你就可以更好地调试代码。你可以理解你下载的代码,甚至可以修复其中的一两个 `bug`。同时从理论上来讲,你可以建造一个更好的捕鼠器,或者 CPU 没有捕鼠器。由你决定。
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/10/compiling-code
作者:[Alan Smithee][a]
选题:[lkxed][b]
译者:[Donkey-Hao](https://github.com/Donkey-Hao)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/alansmithee
[b]: https://github.com/lkxed
[2]: https://opensource.com/article/19/5/primer-assemblers-compilers-interpreters
[3]: https://opensource.com/article/22/9/python-interpreters-2022
[4]: https://opensource.com/article/22/5/gnu-c-compiler

View File

@ -1,99 +0,0 @@
[#]: subject: "How to Enable Dark Mode in Web Browser"
[#]: via: "https://www.debugpoint.com/dark-mode-browser/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
# 如何在 Web 浏览器中启用深色模式
**本指南旨在帮助你在 Firefox、Google Chrome、Chromium 和 Microsoft Edge 等流行的网络浏览器中启用深色模式。**
我们都喜欢黑暗模式。与标准浅色模式相比,许多人更喜欢它。虽然许多桌面应用原生提供深色模式,但一些应用通过桌面环境的底层模式适应深色模式。
你不能否认我们在网络浏览器上花费数小时。我们很少使用桌面应用(除非你从事专门的工作,例如视频编辑等)。因此,当你花费大量时间在浏览器中阅读和学习时,你始终可以选择深色模式。但是,来到网络浏览器,事情就有些不同了。
本指南为你提供了在 Mozilla Firefox、Chromium、Google Chrome 和 Edge 浏览器中启用深色模式的简单步骤。
### 在 Web 浏览器中启用深色模式
#### 在 Firefox 中启用深色模式
- 打开 Firefox 并点击右上角的菜单。
- 单击 `设置 > 扩展和主题`
- 选择`深色主题`并点击`启用`。你应该会看到深色模式已应用于 Firefox。
![Enable dark mode in Firefox][1]
在 Firefox 浏览器中启用深色模式
![Firefox in Dark Mode][2]
深色模式下的 Firefox
- 要将其还原,请按照相同的步骤并选择浅色主题。
#### Chromium 和 Google Chrome 中的浅色模式
默认情况下Chromium 或 Google Chrome 不会预安装任何深色主题。因此,你需要前往 Chrome 应用商店并下载你想要的任何深色主题。对于本指南,我会推荐超过一百万用户使用的 “Morpheon Dark” 主题。
从 Chromium 浏览器打开 Morpheon Dark 主题页面(以下链接)。
[Chrome 应用商店中的 Morpheon Dark 主题][3]
点击 “Add To Chrome” 按钮。它应该会在 Chrome 中启用。
你可能想探索 Chrome 应用店中提供的其他深色或浅色主题。 [访问此页面获取所有深色主题的集合][4]。
但是,你应该要记住的一件事是:此主题不会更改设置或上下文菜单,这是显而易见的。因为它只是改变了浏览器窗口,而这些菜单(有时)是操作系统本身的一部分。
![Chromium Dark Theme][5]
Chromium 深色主题
对 Google Chrome 浏览器也遵循相同的步骤。
#### Edge 浏览器 深色模式
但是,[Microsoft Edge 浏览器][6]默认带有更好的深色主题。它允许你从设置中使用 GTK+、浅色和深色模式。
- 打开 Edge 浏览器
- 点击右上角的三个小点。
- 转到外观并选择深色。你应该准备好了。
Edge 的这种深色主题实现更好,因为它改变了上下文菜单和地址栏。
![Edge in Dark Theme][7]
深色主题的 Edge
### 结束语
如果你是高级用户,你可能不需要本指南。你可以弄清楚。
但我们为所有读者涵盖了所有基础到高级教程。许多新的 Linux 用户可能不知道如何在浏览器中启用深色模式。
所以,就是说,我希望这对你和其他人有帮助。如果你遇到任何问题,请在下面的评论框中告诉我。
---
via: https://www.debugpoint.com/dark-mode-browser/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者 ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux 中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/wp-content/uploads/2021/10/Enable-dark-mode-in-Firefox.jpg
[2]: https://www.debugpoint.com/wp-content/uploads/2021/10/Firefox-in-Dark-Mode-1024x423.jpg
[3]: https://chrome.google.com/webstore/detail/morpheon-dark/mafbdhjdkjnoafhfelkjpchpaepjknad?hl=en-GB
[4]: https://chrome.google.com/webstore/category/collection/dark_themes
[5]: https://www.debugpoint.com/wp-content/uploads/2021/10/Chromium-Dark-Theme-1024x463.jpg
[6]: https://www.debugpoint.com/2020/10/how-to-install-edge-ubuntu-linux/
[7]: https://www.debugpoint.com/wp-content/uploads/2021/10/Edge-in-Dark-Theme-1024x541.jpg

View File

@ -0,0 +1,84 @@
[#]: subject: "Move Virtual Machine Image to Another Host Using GNOME Boxes"
[#]: via: "https://www.debugpoint.com/move-virtual-machine-image-another-host/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
使用 GNOME Box 将虚拟机镜像移动到另一台主机
======
**本指南介绍了使用 GNOME Boxes 将虚拟机镜像移动到另一台主机所需的步骤。**
GNOME Boxes 是由 GNOME 项目创建的虚拟化程序。此程序用作 libvirt 的前端。 libvirt 是用于管理平台虚拟化的开源 API、守护进程和管理工具。它支持不同的虚拟化技术如 KVM、Xen、VMware ESXi、QEMU 等。
如果你想使用 GNOME Boxes 创建虚拟机,[请参阅本指南][1]。
在本教程中,我将解释如何将任何虚拟机镜像文件(已使用 GNOME Boxes 创建并运行)移动到不同的主机并运行它。
这样,你不再需要从操作系统重新安装虚拟机。此外,它是便携式的,你可以将虚拟机镜像放在 U 盘中。
### 如何使用 GNOME Box 将虚拟机镜像移动到另一台主机
我希望你已经在 GNOME Boxes 中创建了一个虚拟机。如果没有,请查看[本指南][1]。
- GNOME Boxes 和 [libvert][2] 使用以下目录存储虚拟机镜像和配置。如下所述,你需要仔细备份每个文件。
- GNOME Boxes 将虚拟机的物理镜像(通常为数 GB 大小)保存在以下路径中。对于你的每个虚拟机,你都会在其中找到一个镜像。
```
~/.local/share/gnome-boxes/images/
```
![机器镜像][3]
- 将图像文件复制到新主机的路径:`~/.local/share/gnome-boxes/images/`
- 将 libvirt 的 XML 配置从以下路径复制到新主机的相同位置。
```
~/.config/libvirt/qemu/
```
![镜像 XML][4]
- 在上述路径中,你应该会看到每个虚拟机的单独 xml 文件。复制你需要的那个。
- 在你当前的系统中打开以下文件。
```
~/.config/gnome-boxes/sources/'QEMU Session'
```
- 复制属于你的虚拟机的部分(从“[display” ... 到本部分的末尾)。你可以使用名称轻松找到它(看下面的 “last seen name”
![QEMU 会话文件][5]
- 在另一台主机上打开相同的上述文件并将复制的内容附加到末尾。保存文件。
- 关闭新主机中的所有应用,包括 GNOME Boxes。
现在打开 GNOME Boxes你应该会看到你的虚拟机和它的内容一起被移动到新主机中。
你现在可以拥有一个可以轻松携带和移动的便携式虚拟机。请记住,目标机器应该安装了 GNOME Boxes 才能完成这项工作。
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/move-virtual-machine-image-another-host/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/2020/05/install-use-gnome-boxes/
[2]: https://libvirt.org/
[3]: https://www.debugpoint.com/wp-content/uploads/2020/06/Machine-Images.png
[4]: https://www.debugpoint.com/wp-content/uploads/2020/06/Image-XML.png
[5]: https://www.debugpoint.com/wp-content/uploads/2020/06/QEMU-Session-File.png

View File

@ -0,0 +1,190 @@
[#]: subject: "Is Lua worth learning?"
[#]: via: "https://opensource.com/article/22/11/lua-worth-learning"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lkxed"
[#]: translator: "MuggleWei"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Lua值得学习吗?
======
Lua是一个有趣且强大的语言, 随着版本的推进, 功能愈发的强大, 开发者也在不断的增长. 这篇文章我们将探索一下它的可能性.
Lua是一个脚本语言, 它面向过程, 函数式编程, 甚至可以是[面向对象的][1]. 它使用类c的语法, 但却是动态类型, 具有自动内存管理和垃圾回收功能, 使用基于寄存器的虚拟机来解释字节码. 这些特点使得它对于初学者来说是个很好的语言, 同时也是经验丰富的程序员的强大工具.
虽然与[Python][2]和[JavaScript][3]相比, Lua现在已经有点儿黯然失色了, 但是Lua拥有的一些优点使得它在许多的重大软件项目中很受欢迎. Lua很容易嵌入到其他语言当中, 这意味着你可以在(例如)Java编写的代码中包含Lua文件, 就像原生的Java代码一样运行. 这听起来就像魔法一般, 现在有许多项目如[luaj][4]使得其成为可能, 之所以可以实现, 正是因为Lua就是为此而设计的. 正因这部分的灵活性, 你可以在许多游戏, 图形应用的程序中发现Lua脚本的身影.
就像其他任何事情一样, 做到完美是需要时间的, Lua是很易于学习(并且有趣)的语言. 它是一种一致性的语言, 一种带有有用的错误消息的友好的语言, 并且可以在网上轻松找到许多有用的资料. 那么就让我们开始吧!
### 安装Lua
在Linux下, 你可以使用发行版自带的包管理来安装Lua. 例如, 在Fedora, CentOS, Mageia, OpenMandriva以及相似的发行版中:
```
$ sudo dnf install lua
```
在Debian以及基于Debian的系统中:
```
$ sudo apt install lua
```
对于Mac, 你可以使用[MacPorts][5] 或者 [Homebrew][6].
```
$ sudo port install lua
```
对于Windows, 可以使用[Chocolatey][7]安装Lua.
完成安装后, 可以在终端中输入`lua`来在交互式解释器中使用Lua.
### 函数
如许多编程语言一样, Lua调用一个内建的函数或关键字, 后面跟着参数. 例如, `print`函数显示你传给它的所有参数.
```
$ lua
Lua 5.4.2 Copyright (C) 1994-2020 Lua.org, PUC-Rio
> print('hello')
hello
```
Lua的`string`库可以操作单词(在编程中称为"字符串"). 例如, 统计字符串中的字母数量, 你可以使用`string`库中`len`函数:
```
> string.len('hello')
5
```
### 变量
一个变量允许你在计算机内存中为临时的数据创建一个指定的空间. Lua中创建变量的方法是赋予变量一个名字, 接着将数据放入其中.
```
> foo = "hello world"
> print(foo)
hello world
> bar = 1+2
> print(bar)
3
```
### 表
在编程中, 数组的使用频率仅次于变量的存在. "数组"这个词的字面意思就是一种排列, 而这就是程序中数组的意义了. 它是数据的一种排列, 因为有排列, 所有数组具有结构化的优势. 本只上数组通常用于和变量相同的目的, 只不过数组会给对其中的数据进行排序. 在Lua中, 数组被称为`表`.
创建表和创建变量类似, 区别仅在于它的初始化内容被设置为`{}`:
```
> mytable = {}
```
当往表中增加数据时, 它就如同创建变量一样, 区别在于这里的变量之前总是以表名开头, 中间使用`.`来连接:
```
> mytable.foo = "hello world"
> mytable.bar = 1+2
> print(mytable.foo)
hello world
> print(mytable.bar)
3
```
### 使用Lua作为脚本
在终端交互环境中运行Lua可以得到良好的反馈, 但是将Lua作为脚本运行会更为有用. 一个Lua脚本就是包含Lua代码的文本文件, Lua命令可以解析并执行此文件.
对于开始学习一门编程语言, 永恒的问题是你怎么知道该写什么. 这篇文章将提供一个不错的开端, 截至目前, 你仅知道了两三个Lua函数. 懂得查阅文档是很关键的. Lua并不是一个复杂的语言, 可以通过[Lua文档网站][8]很方便的获取关键字以及函数的用法.
下面是一个练习题.
假设你想编写一个Lua脚本来统计句子中的单词数量. 与众多的编程挑战一样, 有许多方法可以解决这个问题, 假设你在Lua文档中找到的第一个相关的函数是`string.gmatch`, 此函数可以搜索字符串中的特定字符. 单词通常通过空格分隔开来, 所以你决定计算空格数并加1来作为单词的数量.
下面是实现的代码
```
function wc(words,delimiter)
count=1
for w in string.gmatch(words, delimiter) do
count = count + 1
end
return count
end
```
下面是这个样例代码的解释
- `function`: 这是声明函数开始的关键字. 自定义函数的工作方式与内置函数(如`print`和`string.len`)基本相同
- `words`和`delimiter`: 这是函数运行所需的参数. 正如`print('hello')`当中, `hello`是一个参数
- `counter`: 一个变量, 且被初始化为1
- `for`: 在循环中使用`string.gmatch`作为迭代器遍历`words`, 并且在其中搜索`delimiter`
- `count = count +1`: 当搜索到了`delimiter`, 则对`count`进行自增1的操作
- `end`: `for`循环的结束关键字
- `return count`: 这个函数输出(或返回)`count`变量的内容
- `end`: 函数结束的关键字
现在你已经创建了一个函数, 你可以使用它. 需要记住, 函数不会自动运行, 而是等待你在代码中调用它.
将下面的代码写入文件并保存为`words.lua`
```
function wc(words,delimiter)
count=1
for w in string.gmatch(words, delimiter) do
count = count + 1
end
return count
end
result = wc('zombie apocalypse', ' ')
print(result)
result = wc('ice cream sandwich', ' ')
print(result)
result = wc('can you find the bug? ', ' ')
print(result)
```
你现在创建了一个Lua脚本. 你可以使用Lua运行它. 随后你会发现统计单词的结果有些问题
```
$ lua ./words.lua
2
3
6
```
你也许已经注意到了最后一个句子的单词统计不正确, 因为在句子的最后带有一个额外的空格. Lua正确的检测到了空格, 并将其计入`count`中, 但是单子的统计是错误的, 因为有个空格并没有作为单词的分隔出现. 我把这个问题留给你来解决, 或者去发现其他方法, 即使这个方法不太理想. 编程中有很多需要思考的地方. 有时是纯粹学术性的思考, 有时也许是应用是否运训正常的思考.
### 学习Lua
Lua是一个有趣且强大的语言, 随着版本的推进, 功能愈发的强大, 开发者也在不断的增长. 你可以将Lua作为实用性的个人脚本使用, 或者在工作中使用, 或者仅仅是体验一下一个新的语言. 尝试一下, 看看Lua能给你带来什么吧.
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/11/lua-worth-learning
作者:[Seth Kenlon][a]
选题:[lkxed][b]
译者:[MuggleWei](https://github.com/MuggleWei)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lkxed
[1]: https://opensource.com/article/22/10/object-oriented-lua%20
[2]: https://opensource.com/resources/python
[3]: https://opensource.com/article/22/9/javascript-glossary
[4]: https://github.com/luaj/luaj
[5]: https://opensource.com/article/20/11/macports
[6]: https://opensource.com/article/20/6/homebrew-linux
[7]: https://opensource.com/article/20/3/chocolatey
[8]: http://www.lua.org/docs.html

View File

@ -0,0 +1,131 @@
[#]: subject: "How to Remove Firefox Snap from Ubuntu (21.10 +)"
[#]: via: "https://www.debugpoint.com/remove-firefox-snap-ubuntu/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
如何从 Ubuntu (21.10 +) 中删除 Firefox Snap
======
**Ubuntu 21.10 Impish Indri 及之后的版本将 Firefox Snap 设为默认浏览器。如果你不喜欢 Snap可以通过以下方式将其删除并使用库存版本。**
关于 Snap 是否是 apt 的更好替代品,一直存在争议。而许多用户更喜欢它的系统,也有一些人非常讨厌 snap。 Ubuntu 和 Canonical 认为它是 Linux 的最佳安装仓库和包管理工具之一。 Snap 被讨厌的主要原因是它的启动很慢。然而,这个论点是另一篇文章的内容。
### 从 Ubuntu 中删除 Firefox Snap 版本
所以,如果你还没有[听说过这个故事][1]Ubuntu 21.10(和所有后续版本)默认提供 Firefox Snap 包。因此,当你从 Ubuntu 21.10 开始安装时,默认的 left-dock 快捷方式是 Firefox 的 snap 版本。你可以使用以下各种方法对其进行验证。
![snap 列表 - Firefox][2]
![Firefox snap 桌面快捷方式][3]
如果你因为[性能][4]和存储问题而不喜欢 Snap可以通过以下命令将其删除。
- 如果打开,那么关闭所有 Firefox 实例。
- 打开一个终端。然后运行以下命令。
```
sudo snap remove firefox
```
- 等待命令完成。这将从你的系统中删除 snap 可执行文件,并断开 Firefox 与各种系统服务的连接。但是主 snap 目录仍然存在。你可以使用以下命令手动删除它。
```
cd ~/snaprm -r firefox
```
### 安装 Firefox 替代方法
现在,当你删除 Firefox 时,你可以通过以下选项来使用此浏览器。
#### 方法 1 使用 PPA推荐
- 在使用此方法之前,请确保如上删除了 Firefox 的 snap 版本。
- 有一个[官方 Firefox PPA][5],由其开发团队维护。你可以将此 PPA 添加到你的软件源中,并使用它来安装最新的 Firefox。
- 确保使用文本编辑器创建一个首选项文件,以阻止 Ubuntu 在运行 apt update 命令时获取 Firefox 的 snap 版本。
```
sudo gedit /etc/apt/preferences.d/firefox-no-snap
```
- 将以下行添加到上面的文件并保存。
```
Package: firefox*Pin: release o=Ubuntu*Pin-Priority: -1
```
- 依次使用以下命令。第一个命令将其从你的系统中完全删除。
```
sudo apt purge firefox
sudo add-apt-repository ppa:mozillateam/firefox
sudo apt-get update
sudo apt install firefox
```
- 安装完成后,请确保使用以下命令启用自动升级。
```
echo 'Unattended-Upgrade::Allowed-Origins:: "LP-PPA-mozillateam:${distro_codename}";' | sudo tee /etc/apt/apt.conf.d/51unattended-upgrades-firefox
```
- 重启系统(可选)并享受 deb 版本的 Firefox。
#### 方法 2 使用 Firefox 的压缩可执行文件
- 你可以从官方网站(下面的链接)下载适用于 Ubuntu 和其他 Linux 的压缩 Firefox 可执行文件。然后解压并双击运行 firefox 可执行文件。这是最安全的方法。如果你使用此方法,你仍然可以获得更新。
[下载 Firefox][6]
![下载 Firefox 并解压][7]
![然后运行可执行文件][8]
#### 方法 3 使用 Flatpak 版本的 Firefox
- 你也可以使用 [Flatpak 版本的 Firefox][9],这在 [Ubuntu 中设置 Flatpak][10] 后可用。然后你可以运行以下命令进行安装。
```
flatpak install flathub org.mozilla.firefox
```
#### 方法 4 使用与系统耦合更少的 Snap 版本 Firefox
- 如果你认为你仍然可以继续使用 Snap 版本但希望在系统中减少沙盒,那么你可能需要使用以下命令和 [classic 开关][11]重新安装 Firefox。
```
sudo snap install firefox --classic
```
### 结束语
因此,这是从 Ubuntu 21.10 开始删除 firefox snap 版本的步骤。以及一些替代品。我很想知道 Linux Mint 采取了什么措施,因为他们与 Snap 不兼容。。此外,这些发行版依赖于 Firefox 的 Ubuntu 上游仓库,看看它们会做什么很有趣。 Debian 维护自己的仓库,但主要是 ESR 版本。
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/remove-firefox-snap-ubuntu/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/1943840
[2]: https://www.debugpoint.com/wp-content/uploads/2021/09/snap-list-Firefox.jpg
[3]: https://www.debugpoint.com/wp-content/uploads/2021/09/Firefox-snap-desktop-shortcut-1024x490.jpg
[4]: https://www.debugpoint.com/2021/03/clean-up-snap/
[5]: https://launchpad.net/~mozillateam/+archive/ubuntu/ppa
[6]: https://www.mozilla.org/en-US/firefox/new/
[7]: https://www.debugpoint.com/wp-content/uploads/2021/09/Download-Firefox-and-Extract.jpg
[8]: https://www.debugpoint.com/wp-content/uploads/2021/09/And-then-run-the-executable.jpg
[9]: https://flathub.org/apps/details/org.mozilla.firefox
[10]: https://www.debugpoint.com/2018/07/how-to-install-flatpak-apps-ubuntu-linux/
[11]: https://snapcraft.io/docs/snap-confinement

View File

@ -0,0 +1,89 @@
[#]: subject: "How to Boost Speaker Volume in Ubuntu and Other Linux"
[#]: via: "https://www.debugpoint.com/boost-speaker-volume-ubuntu/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
如何提高 Ubuntu 和其他 Linux 系统中的扬声器音量
======
**以下是如何在 Ubuntu 和其他 Linux 发行版中提高笔记本和桌面的音量的方法。**
你有没有觉得你的 Ubuntu 笔记本的音量太小,尽管你把音量调到了 100%?我相信你有过。主要原因是:很明显,笔记本电脑的扬声器输出强度比大型扬声器要低。
此外Ubuntu 和其他发行版将默认的最大音量设置为 100%,也就是 0dB分贝。0dB 是最大音量的参考值。做个比较,如果你把音量设置为 -10dB这意味着你的音量比最大的 0dB 安静。
VLC 和一些媒体播放器允许你将音量提高到 200%。在最新的 Ubuntu 中使用一些设置,你可以将音量进一步提高。
**注意**:在你尝试和使用以下方法之前,请记住,每个扬声器都有其制造商设定的硬件限制。偶尔一次,播放超过 100% 的音频是可以的。但是,连续放大到更高的分贝可能会使输出的音频失真,并且从长远来看可能会损坏你的扬声器。因此,在使用时要小心谨慎,并有所限制。
### 在 Ubuntu 和其他发行版中提高扬声器音量
#### 对于最新的 Ubuntu 22.04 及以上版本GNOME
从应用菜单中打开设置,进入声音标签。
启用 “Over Amplification” 开关。在你启用的那一刻,你应该看到音量条被扩大了。
![在 Ubuntu 中提升音量超过 100%][1]
现在你可以享受音量提升来听音乐了。
#### Fedora, Arch Linux 和其他发行版
如果你使用带有 GNOME 的 Fedora 工作站,你将看不到上述选项,因为这是 Ubuntu 特有的设置。见下面。
![在 Fedora (GNOME)中,扬声器音量最大为 100%][2]
因此,对于任何其他 Linux 发行版Arch、Fedora、RedHat 等或桌面KDE、Xfce、LXQt 等),打开终端并安装 [PulseAudio Volume Control][3]。
**Fedora、RedHat Linux、OpenSUSE 和相关基于 rpm 的发行版:**
```
sudo dnf install pavucontrol
```
**对于 Arch Linux, Manjaro**
```
sudo pacman -S pavucontrol
```
**基于 Ubuntu 的非 GNOME 发行版**
```
sudo apt install pavucontrol
```
### 如何使用
安装后,从应用菜单中打开 `pavucontrol`,它应该有个 “PulseAudio Volume Control” 菜单项。
![使用PulseAudio音量控制增加音量][4]
### 总结
记住,上述方法可以提高整个系统的扬声器音量。这意味着系统的声音和警报也会受到影响。所以,要记住这一点。正如我前面提到的,如果连续使用,提升扬声器音量超过 100% 可能会导致扬声器变形或损坏。
我希望这个教程能帮助你提高系统音量。如果你遇到问题,请在评论栏里告诉我。
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/boost-speaker-volume-ubuntu/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/wp-content/uploads/2022/11/Boost-volume-more-than-100-percent-in-Ubuntu.jpg
[2]: https://www.debugpoint.com/wp-content/uploads/2022/11/Speaker-volume-is-max-100-percent-in-Fedora-GNOME.jpg
[3]: https://freedesktop.org/software/pulseaudio/pavucontrol/
[4]: https://www.debugpoint.com/wp-content/uploads/2022/11/Increase-Volume-using-PulseAudio-Volume-Control-1024x508.jpg

View File

@ -0,0 +1,82 @@
[#]: subject: "How to Find Systemd or Any Other init System in Linux"
[#]: via: "https://www.debugpoint.com/systemd-or-init/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
如何在 Linux 中查找 Systemd 或任何其他 init 系统
======
**你可以通过以下方式确定你的 Linux 发行版中是否正在运行系统或任何其他 init 系统。**
第一个进程在你启动 Linux 发行版时开始,称为 init初始化的缩写。它的进程标识符为 1即 pid=1。基于 Unix 的系统中的所有进程和应用程序都是这个 init 进程的直接后代。
根据功能和特性,存在不同类型的初始化进程。例如,[systemd][1]、Runit、OpenRC、sysVinit 等。其中systemd 是最流行和最现代的一种,被包括 Ubuntu 和 Fedora 在内的所有现代 Linux 发行版使用和采用。
与传统的基于 Unix 的 init 系统相比Systemd 及其性能一直存在争议。但这是另一篇文章的主题。
让我们看看如何确定在 Linux 发行版中运行的是 systemd 还是任何其他 init 系统。
### systemd 还是什么 init 系统?
不幸的是,没有直接的命令可以找到它。你可以从初始化进程 id=1 追溯它,它基本上是到 `/sbin/init` 的符号链接,即 pid=1。
使用 `[strings][2]` 命令打印嵌入在二进制文件 `/sbin/init` 中的文本并使用以下命令搜索 init。
```
strings /sbin/init | grep init
```
**示例 1**:在下面的输出中,它是一个运行 Debian通过 Peppermint OS的 sysVinit 系统。如你所见,它清楚地显示了 init 进程名称。
```
strings /sbin/init | grep init
```
![显示使用 init 而不是 systemd 的示例][3]
如果在上述同一个系统中找到 systemd那么不会有任何条目。因此你可以得出结论你正在运行 sysvinit 而不是 systemd。
**示例 2**:如果你在 systemd 系统中运行上述命令,你可以在输出的第一行轻松看到 systemd 及其版本。
```
strings /sbin/init | grep systemd
```
![显示它使用 systemd 的示例][4]
**示例 3**:你也可以尝试使用 `pstree` 命令打印进程树,它应该会显示第一个进程名称。它应该是 systemd 或 init如下例所示。
```
pstree
```
![pstree 显示使用 systemd][5]
![pstree 显示使用 init][6]
这就好了。这样你就可以轻松找出你的发行版是使用 systemd 还是其他的。
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/systemd-or-init/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/tag/systemd
[2]: https://linux.die.net/man/1/strings
[3]: https://www.debugpoint.com/wp-content/uploads/2022/11/example-showing-the-init-is-used-and-not-systemd.jpg
[4]: https://www.debugpoint.com/wp-content/uploads/2022/11/example-showing-it-uses-systemd.jpg
[5]: https://www.debugpoint.com/wp-content/uploads/2022/11/pstree-is-showing-systemd-is-used.jpg
[6]: https://www.debugpoint.com/wp-content/uploads/2022/11/pstree-is-showing-init-is-used.jpg

View File

@ -0,0 +1,117 @@
[#]: subject: "Using Python in VS Code and Codium"
[#]: via: "https://opensource.com/article/22/11/python-vs-code-codium"
[#]: author: "Don Watkins https://opensource.com/users/don-watkins"
[#]: collector: "lkxed"
[#]: translator: "Cubik65536"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
在 VS Code 和 Codium 中使用 Python
======
如果你正在寻找一个优秀的、通用的、开源的、带有 Python 集成的代码编辑器,那么你可以尝试一下 Codium。
在过去几年内,我有幸和中学生们一起,并带他们入门 [Python 开发][1] 和 Raspberry Pi 400。这一切都很有趣Pi 对于学生和我来说都是一个很好的平台。我们使用了 [Code with Mu][2],并且一切都很成功。我们的 Python 技能随着经验的增长而增长,因此最近我开始寻找给这些学生提供更多东西的方法。
我参与了一个 Python 课程并在课程中接触了 Microsoft 的 Visual Studio Code。我在课程中学到了很多关于如何为 Python 设置虚拟环境以及如何为 Python 编程配置 VS Code 的知识。在学习过程中,我也认识了 [Codium][3],它本质上是 VS Code但没有 Microsoft 的品牌和遥测。
如果你正在寻找一个优秀的、通用的、开源的、带有 Python 集成的代码编辑器,那么你可以尝试一下 Codium。下面是我在 Linux 系统上为 Python 设置 Codium 的方法。
### 在 Linux 上安装或更新 Python
首先,确保你正在运行最新版本的 Python。你可以使用你的软件包管理器来完成这项工作。在 Debian 和基于 Debian 的系统上:
```
$ sudo apt install python3-pip
```
在 Fedora、CentOS、Mageia、OpenMandriva 和类似的系统上:
```
$ sudo dnf update python3
```
在某些系统上,你可能还需要安装创建 Python 虚拟环境的软件:
```
$ sudo apt install python3.10-venv
```
### 安装 Codium
接下来,在你的电脑上 [安装 Codium][4]。在 Linux 上,你可以下载一个包并使用你的包管理器安装它,或者 [使用 Flatpak][5]。
在安装好 Codium 之后,打开你的应用程序或活动菜单,输入 “Code” 以启动它。
### 安装 VS Code Python 扩展
代码其实不是什么特别的东西。它只是一些其他应用程序(编译器或运行时)解释的纯文本。你可以在 Codium 中编写 Python 代码而不需要特殊的扩展。但是,有一个 Python 扩展可以为你带来一些方便的功能。
点击**文件**菜单,选择**首选项**,然后选择**扩展**。在**扩展**面板中,搜索 Python IntelliSense 扩展。
![VS Code 和 Codium 都有一个扩展管理器,它会在页面左侧打开,允许你安装附加模块。][6]
你已经在 Codium 中设置了 Python。剩下的就是把它用起来。
### 为 VS Code 或 Codium 设置虚拟环境
我们可以创建一个项目目录并将其添加到 Codium 中,这样在工作时,你创建和保存的文件都将默认保存到活动项目目录。这是一种快速的管理方式,可以让你不必经常点击文件保存和打开对话框。
在你创建一个虚拟 Python 环境作为工作目录时Codium因为你已经安装了 Python 扩展会检测到它。当你激活一个虚拟环境文件夹作为活动项目目录时Codium 会自动运行使用虚拟环境所需的激活代码。
要为 Python 创建一个虚拟环境,请打开终端并输入:
```
$ python3 -m venv ~/PythonCoding
```
### 添加项目目录
在 Codium 中,点击**文件**菜单,选择**将文件夹添加到工作区**。打开你刚刚设置的虚拟环境(对我来说,是 `/home/don/PythonCoding`)。
现在你已经准备好写一些 Python 代码了!在你的工作区中创建一个新的 Python 文件并插入一些基本代码。当你输入时你可能会注意到Codium 会为环境包含的 Python 模块提供自动补齐建议。
``` python
import sys
print("Codium running Python " + sys.version)
```
现在点击 Codium 窗口右上角的**运行**按钮。这会在窗口底部打开一个控制台面板显示你的代码的输出:
```
(PythonCode) sh-5.1$ /home/bogus/PythonCode/bin/python
/home/bogus/PythonCode/app.py
Codium running Python 3.10.6 (main…)[GCC 12.1.0]
(PythonCode) sh-5.1$
```
就像你从输出中看到的Codium 在 `PythonCode` 环境中运行,并成功运行了你的 Python 代码。
### Codium 和 Python
使用 Codium 编写 Python 代码比以往任何时候都更容易,但 Python 并不是 Codium 支持的唯一语言。你可以轻松地从 [Open VSX Registry][7] 中找到并安装其他扩展,这是一个中立的开源 VS Code 扩展 “市场”。
Codium 的界面比一些基本的编辑器更复杂,但它有我在学习过程中所需要的东西。如果你需要一个更专业的编辑器,或者你想从当前的编辑器切换到新的编辑器,那么试试 Codium 吧。
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/11/python-vs-code-codium
作者:[Don Watkins][a]
选题:[lkxed][b]
译者:[Cubik65536](https://github.com/Cubik65536)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/don-watkins
[b]: https://github.com/lkxed
[1]: https://opensource.com/article/22/8/math-python-raspberry-pi
[2]: https://codewith.mu/
[3]: https://opensource.com/article/20/6/open-source-alternatives-vs-code
[4]: https://github.com/VSCodium/vscodium/releases
[5]: https://flathub.org/apps/details/com.vscodium.codium
[6]: https://opensource.com/sites/default/files/2022-10/codium-extension-python.webp
[7]: https://open-vsx.org/