Merge pull request #1 from LCTT/master

sync
This commit is contained in:
CanYellow 2022-12-14 16:24:20 +08:00 committed by GitHub
commit f0ba63eb77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 2843 additions and 701 deletions

View File

@ -0,0 +1,90 @@
[#]: collector: (lujun9972)
[#]: translator: (CanYellow)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-15344-1.html)
[#]: subject: (Understanding Linus's Law for open source security)
[#]: via: (https://opensource.com/article/21/2/open-source-security)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
理解开源安全中的林纳斯定律
======
<ruby>林纳斯定律<rt>Linus's Law</rt></ruby>即“<ruby>只要有足够多的眼睛关注,任何漏洞都无处隐藏<rt>given enough eyeballs, all bugs are shallow</rt></ruby>”。那么林纳斯定律是如何应用于开源软件安全的呢?
![][0]
这篇文章讨论 Linux 对开源软件安全的影响。
开源软件的一个常被赞扬的优点是它的代码能够被任何人审查(安全专家通常称之为“代码审计”)。然而,如果你真的去问很多开源软件用户他们上一次检查代码是什么时候。你大概只能收获他们茫然的眼神或者是喃喃的低语。此外,对于一些相当大型的开源应用,有效地审查每一行代码也是困难的。
根据上述这些稍显不安的事实,我们不得不思考:如果没有人察看这些代码,它是开源还是闭源真的有关系吗?
### 你应该相信开源吗?
计算机爱好者倾向于作出认为开源软件比其他软件更加安全的传统假设。我们通常不会讨论这意味者什么:比较的基础是什么(比什么“更”安全?),或者上述结论是如何得到的。这是一个危险的陈述,因为它表明只要你将一些东西称之为“开源”,它就自动如魔法般地继承了更高的安全性。这不是开源,事实上,这正是开源安全非常反对的。
除非你已经亲自审计并理解了软件代码,否则就不应该假定一个应用程序是安全的。一但你做到了这一点,就可以给予它 <ruby>终极信任<rt>ultimate trust</rt></ruby>。_终极信任_ 不是对计算机而言的,而是对你本人而言的,至少在这一应用程序被渗透攻击之前,你信任它是因为你选择了相信它是安全的。
使用者本人是唯一可以对软件代码给予终极信任的人,因此任何人想要获得这样的享受都必须亲自审查代码。相信其他人的话是不管用的。
在你已经亲自审计并理解了软件代码之前,你对一个应用程序给予的最大信任度是一个范围,可以是从 _根本不信任__相当信任_ 之间。然而我们并没有一个关于信任程度的标准对照表,这是一个你必须亲自做出的个人选择。如果你已经从非常信任的人那里听说了一款应用程序是安全的,那么你可能会更信任这个软件,而不是信任那些你没有得到信任建议的东西。
然而,因为无法审计专有(闭源)软件代码,你不可能给予它 _终极信任_
### 林纳斯定律
现实很骨感,并不是每个人都是程序员,同时也不是每个程序员都有时间检查数以万计的代码行。因此如果你没有亲自审查代码,你就只能选择(一定程度上)相信那些 _亲自_ 审查了代码的人。
那么,有哪些人会审查代码呢?
林纳斯定律声称 _只要有足够的眼睛关注任何漏洞都无处隐藏_,然而我们并不知道多少双眼睛是“足够”的。请不要低估这一数量,应用程序往往经过了远超你想象数量的人员审查。原始开发人员以及后续开发人员显然清楚他们自己写下的代码,不过开源软件往往都是团队成果,开源时间越长,阅读了代码的开发人员越多。新加入的开发人员也必须回顾项目代码的核心部分,因为他们必须学习基础代码以加入新的功能。
同时,为了使开源软件能够在 Linux 发行版上可用,负责开源软件打包分发的开发人员会加入多个项目。有时一个应用程序可能会在不熟悉项目代码的情况下打包,但是大多数时候,开源软件打包人员都是熟悉所打包的项目代码的。这不仅仅是因为他们不想在他们不信任的软件上签名,还由于他们可能不得不修改代码来使得程序能够正确编译。漏洞报告人员和漏洞修复人员一般也是熟悉代码库的,因为他们需要尝试解决小到运行异常,大到程序崩溃的问题。当然,一些漏洞报告人员不是通过亲自审查项目代码,而是通过关注明显未按预期工作的现象,无意中揭示了代码漏洞。系统管理员通常都是通晓用户依赖的重要应用软件的代码的。最后,还有一些安全研究人员,他们专门深入代码内部以揭露潜在的漏洞。
### 信任与透明
很多人先入为主的认为大型软件的审计是基本不可能的,因为它由数以万计的代码行组成。不要被软件运行所需的代码量欺骗了。我们不需要真的阅读数以万计的代码行。代码是高度结构化的,可被利用的代码漏洞仅仅只是其中的一行,不过它通常影响软件的全部功能。
当然,也有例外。有时仅仅一个系统调用或者链接一个有缺陷的库文件就可能引入一系列漏洞。幸运的是,多亏安全研究人员以及漏洞数据库所扮演的积极角色,这些错误相对而言是容易发现的。
一些人指着错误追踪系统,比如 <ruby>[通用漏洞披露][2]<rt>Common Vulnerabilities and Exposures</rt></ruby>CVE网站并推断开源软件显而易见是不安全的。毕竟已经向公众公开了大量的安全风险涉及许多开源项目。但是不要被数据欺骗了。只是因为我们看不到现闭源软件的漏洞并不意味着闭源软件中不存在漏洞。事实上已经有很多针对闭源软件的漏洞攻击提出了闭源软件也是存在漏洞的。区别在于开发者以及用户可以查看开源软件的 _所有的漏洞_ 从而降低漏洞的影响。这是扩大对开源软件信任的系统机制的一部分,却正是闭源软件软件所缺少的。
对于任何代码而言,可能永远没有“足够的眼睛”来发现漏洞,但是开发社区越壮大、越多样化,越有机会发现和修复代码中的缺陷。
### 信任与人
在开源社区中,参与同一项目的众多开发者已经发现“不安全”的漏洞,却保持沉默的的可能性是微乎其微的,因为人们很少同意以这样的方式合谋。我们已经看到了在应对 COVID-19 的过程中,人类的行为是如何不一致了,在这里也一样:
* 我们都发现了漏洞(病毒)。
* 我们知晓如何避免它传播(待在家里)。
* 然而病毒还是在持续传播,因为总是有一个或者多个人偏离了消减疫情的计划。
开源软件中的漏洞也一样,如果有人发现了漏洞总会公之于众(当然,我们说的是“假如”能够发现)。
然而就专有软件而言,有很大可能参与项目的众多开发者即使注意到不安全的漏洞却仍然保持沉默,因为专有模式依赖于薪水。如果一个开发者将漏洞泄漏出来,他可能只是伤害了该专有软件的声誉,进而降低软件的销售额;或者,在更糟糕的情况下,他可能因此而丢了工作。开发人员拿着薪水秘密地研究软件,往往不会谈论其缺陷。如果你曾经是一名开发者,你可能曾经签署过 NDA LCTT 译注:<ruby>保密协议<rt>Non-Disclosure Agreement</rt></ruby>),也被培训过商业秘密的重要性,等等不一而足。专有软件鼓励在面对严重的秘密缺陷时保持沉默,更多时候甚至是强制要求沉默。
### 信任与软件
不要信任未经你审计的软件。
如果你必须相信未经你审计的软件,那么选择相信已经面向那些更有可能将软件缺陷公之于众的开发者公开代码的软件。
开源软件并没有比专有软件继承更高的安全性,但是修复它的系统得到了更好的规划、实施和人员配置。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/2/open-source-security
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[CanYellow](https://github.com/CanYellow)
校对:[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/yearbook-haff-rx-linux-file-lead_0.png?itok=-i0NNfDC (Hand putting a Linux file folder into a drawer)
[2]: https://cve.mitre.org
[0]: https://img.linux.net.cn/data/attachment/album/202212/13/114637dg6w34suucuupucv.jpg

View File

@ -3,18 +3,20 @@
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15346-1.html"
Monica人关系管理的开源应用
Monica关系管理的开源应用
======
你可能已经知道 CRM 代表 **客户关系管理**。 我们已经有了一份帮助小型企业的[开源 CRM 软件][1]列表。
![][0]
在这里,我将讨论一个有趣的开源 Web 应用,它采用相同的人际关系概念。 听起来很独特,对吧?
你可能已经知道 CRM 代表 <ruby>客户关系管理<rt>Customer Relationship Management</rt></ruby>。 我们已经有了一份帮助小型企业的 [开源 CRM 软件][1] 列表。
Monica 是一款可让你组织和记录你与亲人互动的应用。 **如果你自行托管,它是免费的,如果你需要托管版本那么订阅**
在这里,我将讨论一个有趣的开源 Web 应用,它采用相同的人际关系概念。听起来很独特,对吧?
Monica 是一款可让你组织和记录你与亲人互动的应用。**如果你自行托管,它是免费的,如果你需要托管版本那么订阅**。
### Monica跟踪社交互动
@ -22,11 +24,11 @@ Monica 是一款可让你组织和记录你与亲人互动的应用。 **如果
很难记住与家人、朋友或同事互动的每一个细节。
你可以使用[笔记应用][3]或 [CubyText][4] 等知识管理应用来添加一些信息。 但这些并不是为记录你的互动而量身定制的。 因此,你将不得不付出一些努力,以在需要时得心应手的方式添加信息。
你可以使用 [笔记应用][3] 或 [CubyText][4] 等知识管理应用来添加一些信息。但这些并不是为记录你的互动而量身定制的。 因此,你将不得不付出一些努力,以在需要时得心应手的方式添加信息。
使用 Monica添加你的家庭、工作、联系人之间的关系、活动、日记、重要日期的提醒、债务等信息变得更加容易。
可以将其安装在自己的服务器上或选择 **$90/年**的订阅以获得托管版本。
可以将其安装在自己的服务器上或选择 **$90/年** 的订阅以获得托管版本。
有趣的是,开发人员最初是根据他的个人要求构建它的。
@ -34,26 +36,26 @@ Monica 是一款可让你组织和记录你与亲人互动的应用。 **如果
![dashboard][5]
你可以获得大量选项来添加有关你日常生活中的人和互动的信息。 其中一些包括:
你可以获得大量选项来添加有关你日常生活中的人和互动的信息。其中一些包括:
- 添加关于一个人的注释
- 列出与联系人相关的重要其他人的姓名(他们的孩子、宠物等)
- 通话记录
- 每个联系人的备用联系方式
- 重要约会和重要事件提醒。 生日会自动设置为提醒。
- 重要约会和重要事件提醒。生日会自动设置为提醒。
- 管理礼物信息
- 有用的仪表板,一目了然
- 支持日记条目
Monica 似乎配备了各种功能,使其成为写日记、做笔记、添加联系信息、添加事件等的一体化工具。
不幸的是,没有可用的移动应用。 你可以从 Web 浏览器访问它,但它可能不是每个人的最佳体验。 所以,如果你坚持用智能手机做笔记和其他东西,你可能想看看其他的。
不幸的是,没有可用的移动应用。你可以从 Web 浏览器访问它,但它可能不是每个人的最佳体验。所以,如果你坚持用智能手机做笔记和其他东西,你可能想看看其他的。
### 自托管或订阅访问
如果你想要 Monica 的托管版本,可以查看它的[定价页面][6]了解更多信息。
如果你想要 Monica 的托管版本,可以查看它的 [定价页面][6] 了解更多信息。
对于自托管,你需要前往其 [GitHub 页面][7]并按照说明下载并安装它。 可以选择在 Platform.sh 或 Heroku 上快速部署。
对于自托管,你需要前往其 [GitHub 页面][7] 并按照说明下载并安装它。可以选择在 Platform.sh 或 Heroku 上快速部署。
在选择服务器来托管 Monica 之前,请检查最低系统要求。
@ -61,7 +63,7 @@ Monica 似乎配备了各种功能,使其成为写日记、做笔记、添加
这一切都很方便。 所以,选择对你来说不错的。
前往其[官方网站][8]获取所有详细信息并开始使用。
前往其 [官方网站][8] 获取所有详细信息并开始使用。
--------------------------------------------------------------------------------
@ -84,3 +86,4 @@ via: https://itsfoss.com/monica/
[6]: https://www.monicahq.com/pricing
[7]: https://github.com/monicahq/monica#get-started
[8]: https://www.zdnet.com/article/microsoft-office-365-banned-in-german-schools-over-privacy-fears/
[0]: https://img.linux.net.cn/data/attachment/album/202212/14/093133zpw06jndpzbdpphp.jpg

View File

@ -31,7 +31,7 @@ $ sudo dnf install cinnamon-desktop
在 Linux Mint、Debian 和类似系统上:
```
$ sudo dnf install cinnamon-desktop-environment
$ sudo apt install cinnamon-desktop-environment
```
当然作为该桌面的发源地Linux Mint 也预装了 Cinnamon。

View File

@ -0,0 +1,146 @@
[#]: subject: "Linux Kernel 6.1 Released With Initial Rust Code"
[#]: via: "https://news.itsfoss.com/linux-kernel-6-1-release/"
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
[#]: collector: "lkxed"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15343-1.html"
Linux 内核 6.1 发布,包含初始 Rust 支持
======
> Linux 内核 6.1 现在可以使用了!考虑到这是今年最后一个稳定版本,它有可能是 LTS 版本。
![Linux 内核 6.1 发布,包含初始 Rust 支持][1]
Linux 内核 6.1 终于来了,它以改进和支持新硬件的形式为我们提前带来了节日礼物。🎄
它是在 Linux 内核 6.0 发布的几个月后出现的,当时的命名方案从 5.x.x 改为 6.x以减少小版本号太多带来的混乱。
像往常一样,今年的最后一个内核版本 **可能被作为一个长期发布的版本**,从而得到几年的支持。
Linux 内核 6.1 如约带来了许多改进,并初步支持了 AMD 和英特尔尚未发布的硬件。
在发布公告中Linus Torvalds 提到:
> 所以到现在,我们晚了一个星期,不过上周已经没那么紧迫了,而且很顺利,我对 6.1 的状态要比几个星期前感到放心多了,当时似乎还比较紧迫。当然,这意味着现在我们有一个可怕的合并窗口,就在节日假期之前,而且我也有一些节前的旅行要安排。因此,虽然推迟一周是正确的做法,但它确实使 6.2 合并窗口的时间变得很尴尬。
他进一步补充说,考虑到每个人都应该过一个平静的假日季,他将会更严格的对合并窗口的规则进行要求。
### 🆕 Linux 内核 6.1 有什么新内容?
在这个版本中,我们看到了各种变化,例如改进了对 ARM SoC 的支持,初步支持英特尔即将推出的 Meteor Lake CPU以及 AMD 的 RDNA 3 GPU。
你可以在其 [公告][2] 中找到更多技术细节。
#### 对 Rust 的实验性支持
![linux 6.1 rust][3]
虽然我们预计这将发生在 Linux 内核 6.0,但它在 Linux 内核 6.1 中才出现,这将允许开发者用 Rust 编写内核代码。
#### 英特尔 Meteor Lake 的启用
![英特尔][4]
英特尔的开源开发者一直在努力工作,为即将到来的 Meteor Lake 芯片提供初步支持。
它被称为英特尔的第一个 7 纳米微架构,开发人员已经向 DRM-next 推送了各种提交。
这些包括各种固件提交,对 Meteor Lake CPU 及其集成 GPU 的初步支持。
#### 对 AMD RDNA 3 图形的初始支持
![AMD][5]
这段时间AMD 一直在为 Linux 内核 6.1 添加 RDNA 3 图形架构的代码。
这包括对他们即将推出的 GPU 的支持和对他们之前的 GPU 产品的各种修复。
你可以通过 [这里][6] 查看完整的补丁列表。
#### 对 AMD 电脑的优化
![优化 AMD][7]
AMD PMFAMD 平台管理框架)已经被引入这个内核版本。
该驱动旨在为 AMD PC 更安静、更高效的运行提供支持。
它利用板载传感器与 AMD 的各种热能和功率内核驱动来实现这一目标。
#### 改进的 ARM SoC 支持
![arm soc][8]
Linux 内核 6.1 带来了对 ARM SoC 的更多支持,例如:
- 联发科 MT8186
- 德州仪器 AM62A
- 恩智浦 i.MX8DXL
- 高通 IPQ8064 的各种变体
该内核还对一些智能手机提供了支持,如 PINE64 PinePhone Pro、索尼 Xperia 1 IV 和三星 Galaxy E5/E7/Grand Max。
#### 存储的改进
内核在存储方面有很多改进。
例如Btrfs 在这次更新中带来了异步缓冲写入,提供了超过 2 倍的吞吐量。
然后是对 EXT4 的改进,包括性能优化和一些错误修复。
与此同时,[EROFS][9] 为 Linux 内核 6.1 引入了基于 FSCache 的共享域支持。
#### 🛠️ 其他改进措施
这些并不是 Linux 内核 6.1 提供的唯一改进,以下是其他一些值得注意的改进:
- 对微软 Surface Pro 9 和 Surface Laptop 5 的支持。
- 启用 AMD Zen 4 LbrExtV2。
- AMD CPU “缓存到缓存”和内存报告功能。
- 引入 AMD IOMMU v2。
- 为 Wi-Fi 802.11be/Wi-Fi 7 做准备。
### 如何安装 Linux 内核 6.1
如果你使用基于 Arch 的发行版或 Fedora你可以轻松升级。
不幸的是,如果你使用其他 Linux 发行版Pop!_OS 和 Linux Lite 在某种程度上可以是个例外),你可能无法直接从发行版中获得升级。
然而,几乎所有的 Linux 发行版都明确地允许你安装最新的内核。这里有一个关于 Ubuntu 的指南👇
> **[如何在 Ubuntu 中安装最新的主线 Linux 内核版本](https://itsfoss.com/upgrade-linux-kernel-ubuntu/)**
所以,如果你乐于冒险(并且知道自己在做什么),你可以在 [Linux 内核档案][10] 上找到列出的较新的内核。你可以下载 [tarball][11] 来测试它。
然而,像往常一样,如果你不想冒任何风险,我们建议等待你的 Linux 发行版推送更新。最好是坚持使用你的 Linux 发行版默认提供的东西。
> **[下载 Linux 6.1][12]**
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/linux-kernel-6-1-release/
作者:[Sourav Rudra][a]
选题:[lkxed][b]
译者:[wxy](https://github.com/wxy)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/sourav/
[b]: https://github.com/lkxed
[1]: https://news.itsfoss.com/content/images/size/w2000/2022/12/linux-kernel-6-1-release.png
[2]: https://lore.kernel.org/lkml/CAHk-=wj_HcgFZNyZHTLJ7qC2613zphKDtLh6ndciwopZRfH0aQ@mail.gmail.com/T/#u
[3]: https://news.itsfoss.com/content/images/2022/12/linux-6-1-rust.png
[4]: https://news.itsfoss.com/content/images/2022/12/intel-meteor.png
[5]: https://news.itsfoss.com/content/images/2022/12/amd-rdna-3.png
[6]: https://lists.freedesktop.org/archives/dri-devel/2022-September/373430.html
[7]: https://news.itsfoss.com/content/images/2022/12/amd-rdna-3--1-.png
[8]: https://news.itsfoss.com/content/images/2022/12/amd-rdna-3--2-.png
[9]: https://en.wikipedia.org/wiki/EROFS
[10]: https://www.kernel.org/
[11]: https://git.kernel.org/torvalds/t/linux-6.1.tar.gz
[12]: https://www.kernel.org

View File

@ -0,0 +1,89 @@
[#]: subject: "Unfortunately, Komodo IDE is now Open Source!"
[#]: via: "https://news.itsfoss.com/komodo-ide-open-source/"
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Unfortunately, Komodo IDE is now Open Source!
======
Komodo IDE is now open-source and not at a great time. Curious to take a peek at the source code? Learn more here.
![Unfortunately, Komodo IDE is now Open Source!][1]
Komodo IDE is a popular integrated development environment for dynamic programming languages that was introduced back in May 2000.
Used by many programmers around the world, it has proved to be quite helpful over the years.
Unfortunately, all good things end.
This is the case with Komodo IDE, it has now been retired, and all development has ceased.
But there's a silver lining to this 😃
The company behind it, called '[ActiveState][2]', has now made the code openly available for anyone to use and modify.
> 💡 Similar to "Komodo Edit" application, which was made open-source in 2008.
They have cited numerous factors for their decision, which I will explain.
### So, Why Open-Source it Now?
![komodo ide][3]
ActiveState felt that it was becoming difficult to maintain Komodo IDE without encountering various compatibility issues on newer systems.
**What were the contributing factors?:** There were many factors that led to this. Take, for instance, the frameworks on which Komodo was built, '_XUL and XULRunner_'; they were retired by Mozilla back in 2016.
Then there was the amount of effort needed to make Komodo compatible with newer systems. They would have to completely rewrite Komodo using a newer framework they felt was not feasible.
And the final nail in the coffin was the fact that there are already a lot of free code editors available on the market right now doing better. They feel that '_its not a good business to be in anymore_'.
**What now?:** ActiveState have made the whole Komodo IDE codebase available on their [GitHub repo][4] without the revision history.
They have provided 3.2 million lines of code that consist of various programming languages such as Python, JavaScript, XUL, HTML, C++, and more.
Anyone can copy, change, and use the code as they see fit.
The forums for Komodo will be kept open for a year from their [original announcement][5], as it contains a treasure trove of information relating to Komodo.
They are also open to moving the content to a different platform if anyone is willing to take on the task of managing it.
On this topic, one of the employees from the Komodo dev team, Carey Hoffman, had this to add:
> The extensive existing help information in the forums can act as a significant knowledge base for users and continue to be a central place to ask questions of the community and receive answers. Ill very likely be there periodically on my own time to help where I can, such as when people are trying to build Komodo at home, or having difficulty making any kind of code edits.
### Community Gets a Chance
This can come in pretty handy for the community in general, as people can now try their hand at creating something truly special out of the code for Komodo.
A Reddit user, [yvrelna][6] mentions:
> I never used Komodo, but it's great to hear that Komodo is now freed from its cage. Companies should do this more often. If they're unwilling to support a software anymore, they should just release it as open source.It would've been better if the software is open source to begin with of course, but there's really no reason for a company to retain their codebase closed if they have no interest in maintaining it.Only thing is that they should've done it sooner, when there are still enough people that still cares about the software to possibly pick it up to maintain it.
Indeed, the user is not wrong here; companies should go the extra mile by making code for their deprecated software open so that the community has a chance to create something out of it or even maintain it for the long term.
ActiveState seems to have understood this sentiment and has thanked its users by open-sourcing Komodo.
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/komodo-ide-open-source/
作者:[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/w2000/2022/12/komodo-ide-goes-open-source.png
[2]: https://www.activestate.com/
[3]: https://news.itsfoss.com/content/images/2022/12/Komodo_IDE.png
[4]: https://github.com/ActiveState/OpenKomodoIDE
[5]: https://www.activestate.com/blog/activestate-komodo-ide-now-open-source/
[6]: https://www.reddit.com/user/yvrelna/

View File

@ -0,0 +1,69 @@
[#]: subject: "FreeBSD 12.4 is out with 100+ improvements and fixes"
[#]: via: "https://debugpointnews.com/freebsd-12-4/"
[#]: author: "arindam https://debugpointnews.com/author/dpicubegmail-com/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
FreeBSD 12.4 is out with 100+ improvements and fixes
======
![][1]
**FreeBSD 12.4 was released a few days back with several updates and improvements. Heres a release roundup.**
FreeBSD is a UNIX-like operating system based on [U.C. Berkleys BSD-Lite version][2]. It is primarily used for core infra systems, routers, networking devices, and possibly running in millions of devices. FreeBSD bundles thousands of packages from desktop apps to core modules, making it easier to build your system running this awesome operating system.
### FreeBSD 12.4 Release: Key updates
FreeBSD 12.4 is the 5th release of the current 12 stable series and coming up after a years package updates, improvements and bug fixes.
Key changes in the release include the OpenSSL version being updated to 1.1.1q, whereas OpenSSH is bumped up to 9.1p1. The LLVM toolchain suite was also upgraded to 13.0.0. Other key version upgrades include `ena` kernel driver 2.6.1, `file` 5.43, `libarchieve` 3.6.0 and `dma` 2022-01-27.
![FreeBSD 12.4 with Xfce desktop][3]
Furthermore, this release now allows multiple cores to process traffic to improve performance by `if_repair` driver. Also, the `tcpdump` command now allows users to set several rules which will be exposed as part of the `pflog` header.
On top of that, the `telnetd` daemon is deprecated in this version which should be noted for network professionals.
The total number of changes and fixes exceeds 100+, which you can read in detail in the [change log][4].
### Download and Upgrade
If you are running FreeBSD 12.3 version, you can upgrade your system by issuing the following commands:
```
freebsd-update -r 12.4-RELEASE upgrade
```
```
freebsd-update install
```
For a fresh download, you can get the ISO image from the following page.
[Download FreeBSD 12.4-RELEASE][5]
Via [announcements][6] & [change log][4].
--------------------------------------------------------------------------------
via: https://debugpointnews.com/freebsd-12-4/
作者:[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://debugpointnews.com/author/dpicubegmail-com/
[b]: https://github.com/lkxed
[1]: https://debugpointnews.com/wp-content/uploads/2022/12/bsd-generic-head.jpg
[2]: https://www.debugpoint.com/unix-history/
[3]: https://debugpointnews.com/wp-content/uploads/2022/12/FreeBSD-12.4-with-Xfce-desktop.jpg
[4]: https://www.freebsd.org/releases/12.4R/relnotes/
[5]: https://download.freebsd.org/ftp/releases/ISO-IMAGES/12.4/
[6]: https://www.freebsd.org/releases/12.4R/announce/

View File

@ -0,0 +1,82 @@
[#]: subject: "Puppy Linux 22.12 (S15Pup) Arrives Based on Slackware 15"
[#]: via: "https://debugpointnews.com/puppy-linux-22-12-s15pup/"
[#]: author: "arindam https://debugpointnews.com/author/dpicubegmail-com/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Puppy Linux 22.12 (S15Pup) Arrives Based on Slackware 15
======
![][1]
**A new Puppy Linux flavour (Puppy Linux 22.12 S15Pup) is now available based on Slackware 15.**
Puppy Linux is a super lightweight distro which runs entirely on RAM and requires a very low memory footprint. It is almost loaded with all the necessary applications for everything you need. It is quite remarkable that the Puppy Linux team managed to package all these applications, which run in low memory and surprisingly within 400 MB of ISO size. There are many variants of Puppy Linux based on Ubuntu and other distros thanks to the fantastic Puppy Builder Woof-CE.
### Puppy Linux 22.12 (s15pup): Whats New
The recent release of Puppy Linux 22.12 is based on the Slackware 15.0 components, which were released in February 2022. At its core, the JWM (Joes Window Manager) provides flexibility and good performance in Puppy Linux because it runs off the RAM.
![Puppy Linux 22.12 based on Slackware 15][2]
Based on Slackware, Puppy 22.12 comes with Linux Kernel LTS series 5.15 for the 64-bit. And the 5.10 for the 32-bit system. The desktop feel is the same as other Puppy flavours based on the JWM 2.4.3. The JWM is used in other distro-based Puppy flavours as well.
In addition, FFmpeg is loaded with Mplayer for your media playing needs if at all required in a LIVE system. Also, the “Light” web browser, based on Firefox, gives you easy and performant access to the internet. Alternative browser installation options are also present.
Furthermore, Puppy Linux 22.12 s15pup pre-loads most of the LXDE apps and components for the overall lightweight experience, such as Lxrandr 0.3.2, Lxtask 0.1.10 and Lxterminal 0.4.0.
ISO of this Slackware flavour is less than 400 MB in size, and, amazingly, all of the following applications are pre-loaded on it. Heres a summary of the key packages in this version:
| Abiword 3.0.1 | Gparted 1.3.1 | Parcellite 1.2.1 |
| Bash 5.1.016 | Grep 3.7 | Rox-filer 17w |
| Busybox 1.35.0 | Gtk+2 2.24.33 | Samba 4.12.15 |
| Cups 2.4.2 | Gtk+3 3.24.31 | Sed 4.8 |
| Curl 7.86.0 | Gtkdialog 0.8.5a | Sylpheed 3.7.0 |
| Dhcpcd 9.4.1 | Icu4c 69.1 | Syslinux 4.07 |
| Didiwiki 0.8 | Jwm 2.4.3 | Transmission 2.60 |
| Evince 2.32.0 | Lxrandr 0.3.2 | Util-linux 2.37.4 |
| Ffmpeg 4.4.3 | Lxtask 0.1.10 | Viewnior 1.7 |
| Gcc 11.2.0 | Lxterminal 0.4.0 | Xdelta 30.16 |
| Geany 1.35 | Mesa 21.3.5 | Xsane 0.999 |
| Ghostscript 9.55.0 | MPlayer 1.4 |
| Glib2 2.70.3 | Mtpaint 3.50.09 |
| Glibc 2.33 | Ncurses 6.3 |
| Gnumeric 1.10.17 | Openssl 1.1.1s |
### Download
Puppy Linux is one of those few distros which still provides a 32-bit installation file alongside 64-bit. You can download this version from the following links for the respective architectures.
- [S15Pup 64-bit based on Slackware 15.0][3]
- [S15Pup 32-bit based on Slackware 15.0][4]
- [ScPup 64-bit based on Slackware current][5]
- [ScPup 32-bit based on Slackware current][6]
If you are running it on a virtual machine, make sure to change the CPU architecture to 64-bit before installing it.
_Via [release announcement][7] & [release notes][8]_
--------------------------------------------------------------------------------
via: https://debugpointnews.com/puppy-linux-22-12-s15pup/
作者:[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://debugpointnews.com/author/dpicubegmail-com/
[b]: https://github.com/lkxed
[1]: https://debugpointnews.com/wp-content/uploads/2022/12/pups15head.jpg
[2]: https://debugpointnews.com/wp-content/uploads/2022/12/Puppy-Linux-22.12-based-on-Slackware-15.jpg
[3]: https://sourceforge.net/projects/spup/files/S15Pup64/
[4]: https://sourceforge.net/projects/spup/files/S15Pup32/
[5]: https://sourceforge.net/projects/spup/files/ScPup64/
[6]: https://sourceforge.net/projects/spup/files/ScPup/
[7]: https://forum.puppylinux.com/viewtopic.php?t=7464&sid=5ee2c343a8dbc0babc476139d188c50f
[8]: http://distro.ibiblio.org/puppylinux/puppy-s15pup/release-S15Pup-22.12.htm

View File

@ -0,0 +1,88 @@
[#]: subject: "Get ready to upgrade your video creation with Kdenlive 22.12"
[#]: via: "https://debugpointnews.com/kdenlive-22-12/"
[#]: author: "arindam https://debugpointnews.com/author/dpicubegmail-com/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Get ready to upgrade your video creation with Kdenlive 22.12
======
![][1]
**Kdenlive 22.12: the free and open-source video editor scores another sizable update.**
The best free and [open-source video editor][2] Kdenlive 22.12, released with new filters, UI improvements, user-requested features and bug fixes. This release improves Kdenlive on top of its [already existing features][3] and gives you a platform to create professional-quality videos.
Heres whats new.
![Kdenlive 22.12 Running in Linux Mint][4]
### Kdenlive 22.12: New Features
A new “Timelines Guides” dock now lists all the timeline markers in your video project. Click on the timeline video clip to view the markers in this new dock. This is an imp[rovement in the marker features introduced in the past release.
In addition to that, three new audio graph filters were introduced. They are audio level visualization filter, spectrum filter and waveform filter. These can be used in keyframe animations for more granular controls. Talking about keyframes, you can now use the standard CTRL+C and CTRL+V to copy/paste keyframes.
Furthermore, if you are working in a complex timeline, you can now remove all the spaces between clips with two new options remove spaces after playhead and all after playhead.
![Two new UI improvements on timeline][5]
Kdenlive also started work to move to Qt6 from Qt5 build for the upcoming releases. A continuous integration build pipeline is added for Qt6 to check the current build. However, the current version is not yet complete per the transition timeline. However, it is expected that Kdenline will be built with Qt6 as stable by mid of 2023.
On top of the above changes, here are some key updates on this release:
- More custom colour codes for categories
- Improved marker management with edit, add/remove multiple markers and import/export.
- Kdenlive now sends the content of the timeline to Glaxnimate (version >= 0.5.1), which then shows it as background.
- Set maximum cache with custom data storage size
- Option to hide the menu bar, replacing it with a hamburger menu
- The settings panel is cleaned up with better visibility and removed obsolete entries
- Work underway for Qt6 and KDE Frameworks 6 migration
- Improved Track composition
### Download and upgrade
If you are already running Kdenlive via the official distro repo, you should get this update within a couple of days. Simply update your system to get this version.
Those of you running the Flatpak version, run the following command to get the update.
```
flatpak update org.kde.kdenlive
```
For fresh download and installation, visit the following page.
[Download Kdenlive][6]
If you prefer Flatpak, you can install this version from Flathub using the following command, after [setting up your system as Flatpak][7].
```
flatpak install flathub org.kde.kdenlive
```
Via [release announcement][8]
--------------------------------------------------------------------------------
via: https://debugpointnews.com/kdenlive-22-12/
作者:[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://debugpointnews.com/author/dpicubegmail-com/
[b]: https://github.com/lkxed
[1]: https://debugpointnews.com/wp-content/uploads/2022/12/kdenlive-head.jpg
[2]: https://www.debugpoint.com/best-free-video-editors-linux-ubuntu/
[3]: https://www.debugpoint.com/kdenlive-features/
[4]: https://debugpointnews.com/wp-content/uploads/2022/12/Kdenlive-22.12-Running-in-Linux-Mint.jpg
[5]: https://debugpointnews.com/wp-content/uploads/2022/12/Two-new-UI-improvements-on-timeline.jpg
[6]: https://kdenlive.org/en/download/
[7]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/
[8]: https://kdenlive.org/en/2022/12/kdenlive-22-12-released/

View File

@ -0,0 +1,73 @@
[#]: subject: "Firefox 108 unlocks the power of music on the web with new WebMIDI API support"
[#]: via: "https://debugpointnews.com/firefox-108/"
[#]: author: "arindam https://debugpointnews.com/author/dpicubegmail-com/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Firefox 108 unlocks the power of music on the web with new WebMIDI API support
======
![][1]
**Firefox 108 is now available to download, bringing the following new features.**
The final Firefox release of this year is here Firefox 108, closing an eventful year of this free and open-source web browser from Mozilla.
![Firefox 108 Running in Ubuntu][2]
### Firefox 108: Best new features
If you are a music enthusiast, then some good news for you. Firefox now supports the [WebMIDI API][3] inside your browser with proper access controls. When you try to access MIDI devices via Firefox, then you get a prompt for installing a “[site permission add-on][4]” to enable this API.
In addition, Firefox 108 enabled import maps by default, which means web pages can now control the behaviour of JavaScript imports more easily. And if you use Firefox, youll be happy to hear that it now supports proper colour correction for images tagged with ICCv4 profiles.
Furthermore, developers added a handy keyboard shortcut press SHIFT+ESC to open the Process Manager and quickly identify any processes using too many resources. And on Windows 11, Firefox added efficiency mode for processes used in background tabs to help save on resources.
Elsewhere, your browsers bookmark toolbar gets an option “Only show on New Tab” state, which now works correctly for blank new tabs. Also improved in this release is the handling of non-ASCII characters while exporting PDF forms from web pages.
If you are a web developer, Firefox 108 also arrives with a handful of Math function updates which are summarised alongside other vital changes:
- The `source` element supports `height` & `width` attributes when it is a child of a `picture` element.
- Trigonometric functions are now enabled with the `layout.css.trig.enabled` preference set to true by default. This allows the use of sin(), cos(), tan(), asin(), acos(), atan(), and atan2() functions
- CSS `calc-constant`type is implemented to allow for well-known constants such as pi and e within math functions
- Container query length units are now supported via the the `layout.css.container-queries.enabled` preference, which is set to false by default
### Download and update
For Linux distributions, if you used Firefox via your distributions official repository, then you should get this update within a couple of days from today.
However, you can also download the compressed version of this release from the below page. For other download options, do visit our [Firefox download guide][5].
[Download Firefox 108][6]
Happy browsing!
- [Official release notes][7]
- [Beta108 release notes][8]
- [Developer release notes][9]
--------------------------------------------------------------------------------
via: https://debugpointnews.com/firefox-108/
作者:[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://debugpointnews.com/author/dpicubegmail-com/
[b]: https://github.com/lkxed
[1]: https://debugpointnews.com/wp-content/uploads/2022/04/firefox-head.jpg
[2]: https://debugpointnews.com/wp-content/uploads/2022/12/Firefox-108-Running-in-Ubuntu.jpg
[3]: https://developer.mozilla.org/en-US/docs/Web/API/Web_MIDI_API
[4]: https://support.mozilla.org/en-US/kb/site-permission-addons
[5]: https://www.debugpoint.com/download-firefox/
[6]: https://ftp.mozilla.org/pub/firefox/releases/108.0/
[7]: https://www.mozilla.org/en-US/firefox/108.0/releasenotes/
[8]: https://www.mozilla.org/en-US/firefox/108.0beta/releasenotes/
[9]: https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/108

View File

@ -0,0 +1,106 @@
[#]: subject: "Kdenlive 22.12 Release Adds Useful New Features"
[#]: via: "https://news.itsfoss.com/kdenlive-22-12-released/"
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Kdenlive 22.12 Release Adds Useful New Features
======
Kdenlive 22.12 upgrade is here with nice enhancements across the board.
![Kdenlive 22.12 Release Adds Useful New Features][1]
Kdenlive is an open-source cross-platform video editing software built by the KDE community, which has been around since 2003.
Built using Qt and KDE Frameworks, it has been the editor of choice for many users out there.
Recently, the latest upgrade to it i.e Kdenlive 22.12 has been made available, let me take you through the release.
### 🆕 Kdenlive 22.12: What's New?
![kdenlive 22.12][2]
Kdenlive 22.12 features numerous improvements, with over 350 commits made. It brings in many new features, bug fixes, and prepares the code base for future releases.
Let me take you through some of the notable improvements with this release.
#### Revamped Guide and Marker System
![kdenlive 22.12 guides dock][3]
The guide and marker system on Kdenlive has received a major overhaul, with the key changes being:
- All marker and guide features are now made available in the new 'Guides' dock.
- The 'Guides' dock also lets you easily seek, search, sort, and filter through the various markers and guides. It also allows for navigation with keyboard.
- You can now create many categories to suit your needs, compared to the nine categories limit previously.
- It is now also possible to edit, add, or remove multiple markers at a time, and the import/export of markers has been improved.
#### Improved Glaxnimate Integration
![kdenlive 22.12 glaxnimate integration][4]
Kdenlive already had support for Glaxnimate with its previous release, but now the developers have taken it a step further.
The editor now lets you send the content of your Kdenlive timeline to [Glaxnimate][5] (version >= 0.5.1), which will then show up in the background.
> 💡 Glaxnimate is an open-source 2D vector drawing and animation program.
This allows you to create animations that play together with your videos in a much easier fashion than was possible before.
#### Various UX Improvements
Kdenlive includes a variety of usability improvements, such as:
- A new hamburger menu in the toolbar that can be used instead of the menu bar.
- 'What's This?' Text has been added in several places to show what a specific element does.
- You can now define a maximum size for the cached data stored by Kdenlive in the environment settings.
- The 'Settings' page has received a cleanup, and now features a reordered list of all the important options.
#### Keyframeable Audio Graph Filters
Existing audio graph filters like the audio level visualization filter, audio spectrum filter and audio wave form filter are now keyframeable with Kdenlive 22.12.
They also fixed several effects that were affected due to syntax errors in the XML code and added automated tests to the build system to avoid such an issue in the future.
#### 🛠️ Other Changes
Besides the changes listed above, here are some of the other notable ones:
- Improved track composition.
- PipeWire as SDL output.
- The Color Picker has been fixed on Wayland.
- Pixabay as the new video provider.
- Improved search performance.
If you want to dive deep into the release notes, refer to the [official announcement][6].
### 📥 Download Kdenlive 22.12
For Linux, the latest release is available as an AppImage, on Flathub, and as an Ubuntu PPA.
Head over to the [official website][7] to download those.
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/kdenlive-22-12-released/
作者:[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/w2000/2022/12/kdenlive-22-12-release.png
[2]: https://news.itsfoss.com/content/images/2022/12/Kdenlive_22.12.png
[3]: https://news.itsfoss.com/content/images/2022/12/Kdenlive_22.12_Guides_Dock.png
[4]: https://news.itsfoss.com/content/images/2022/12/Kdenlive_22.12_Glaxnimate.png
[5]: https://glaxnimate.mattbas.org
[6]: https://kdenlive.org/en/2022/12/kdenlive-22-12-released/
[7]: https://kdenlive.org/en/download/

View File

@ -1,90 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (CanYellow)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Understanding Linus's Law for open source security)
[#]: via: (https://opensource.com/article/21/2/open-source-security)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
Understanding Linus's Law for open source security
======
Linus's Law is that given enough eyeballs, all bugs are shallow. How
does this apply to open source software security?
![Hand putting a Linux file folder into a drawer][1]
In 2021, there are more reasons why people love Linux than ever before. In this series, I'll share 21 different reasons to use Linux. This article discusses Linux's influence on the security of open source software.
An often-praised virtue of open source software is that its code can be reviewed (or "audited," as security professionals like to say) by anyone and everyone. However, if you actually ask many open source users when the last time they reviewed code was, you might get answers ranging from a blank stare to an embarrassed murmur. And besides, there are some really big open source applications out there, so it can be difficult to review every single line of code effectively.
Extrapolating from these slightly uncomfortable truths, you have to wonder: When nobody looks at the code, does it really matter whether it's open or not?
### Should you trust open source?
We tend to make a trite assumption in hobbyist computing that open source is "more secure" than anything else. We don't often talk about what that means, what the basis of comparison is ("more" secure than what?), or how the conclusion has even been reached. It's a dangerous statement to make because it implies that as long as you call something _open source_, it automatically and magically inherits enhanced security. That's not what open source is about, and in fact, it's what open source security is very much against.
You should never assume an application is secure unless you have personally audited and understood its code. Once you have done this, you can assign _ultimate trust_ to that application. Ultimate trust isn't a thing you do on a computer; it's something you do in your own mind: You trust software because you choose to believe that it is secure, at least until someone finds a way to exploit that software.
You're the only person who can place ultimate trust in that code, so every user who wants that luxury must audit the code for themselves. Taking someone else's word for it doesn't count!
So until you have audited and understood a codebase for yourself, the maximum trust level you can give to an application is a spectrum ranging from approximately, _not trustworthy at all_ to _pretty trustworthy_. There's no cheat sheet for this. It's a personal choice you must make for yourself. If you've heard from people you strongly trust that an application is secure, then you might trust that software more than you trust something for which you've gotten no trusted recommendations.
Because you cannot audit proprietary (non-open source) code, you can never assign it _ultimate trust_.
### Linus's Law
The reality is, not everyone is a programmer, and not everyone who is a programmer has the time to dedicate to reviewing hundreds and hundreds of lines of code. So if you're not going to audit code yourself, then you must choose to trust (to some degree) the people who _do_ audit code.
So exactly who does audit code, anyway?
Linus's Law asserts that _given enough eyeballs, all bugs are shallow_, but we don't really know how many eyeballs are "enough." However, don't underestimate the number. Software is very often reviewed by more people than you might imagine. The original developer or developers obviously know the code that they've written. However, open source is often a group effort, so the longer code is open, the more software developers end up seeing it. A developer must review major portions of a project's code because they must learn a codebase to write new features for it.
Open source packagers also get involved with many projects in order to make them available to a Linux distribution. Sometimes an application can be packaged with almost no familiarity with the code, but often a packager gets familiar with a project's code, both because they don't want to sign off on software they don't trust and because they may have to make modifications to get it to compile correctly. Bug reporters and triagers also sometimes get familiar with a codebase as they try to solve anomalies ranging from quirks to major crashes. Of course, some bug reporters inadvertently reveal code vulnerabilities not by reviewing it themselves but by bringing attention to something that obviously doesn't work as intended. Sysadmins frequently get intimately familiar with the code of an important software their users rely upon. Finally, there are security researchers who dig into code exclusively to uncover potential exploits.
### Trust and transparency
Some people assume that because major software is composed of hundreds of thousands of lines of code, it's basically impossible to audit. Don't be fooled by how much code it takes to make an application run. You don't actually have to read millions of lines. Code is highly structured, and exploitable flaws are rarely just a single line hidden among the millions of lines; there are usually whole functions involved.
There are exceptions, of course. Sometimes a serious vulnerability is enabled with just one system call or by linking to one flawed library. Luckily, those kinds of errors are relatively easy to notice, thanks to the active role of security researchers and vulnerability databases.
Some people point to bug trackers, such as the [Common Vulnerabilities and Exposures (CVE)][2] website, and deduce that it's actually as plain as day that open source isn't secure. After all, hundreds of security risks are filed against lots of open source projects, out in the open for everyone to see. Don't let that fool you, though. Just because you don't get to see the flaws in closed software doesn't mean those flaws don't exist. In fact, we know that they do because exploits are filed against them, too. The difference is that _all_ exploits against open source applications are available for developers (and users) to see so those flaws can be mitigated. That's part of the system that boosts trust in open source, and it's wholly missing from proprietary software.
There may never be "enough" eyeballs on any code, but the stronger and more diverse the community around the code, the better chance there is to uncover and fix weaknesses.
### Trust and people
In open source, the probability that many developers, each working on the same project, have noticed something _not secure_ but have all remained equally silent about that flaw is considered to be low because humans rarely mutually agree to conspire in this way. We've seen how disjointed human behavior can be recently with COVID-19 mitigation:
* We've all identified a flaw (a virus).
* We know how to prevent it from spreading (stay home).
* Yet the virus continues to spread because one or more people deviate from the mitigation plan.
The same is true for bugs in software. If there's a flaw, someone noticing it will bring it to light (provided, of course, that someone sees it).
However, with proprietary software, there can be a high probability that many developers working on a project may notice something not secure but remain equally silent because the proprietary model relies on paychecks. If a developer speaks out against a flaw, then that developer may at best hurt the software's reputation, thereby decreasing sales, or at worst, may be fired from their job. Developers being paid to work on software in secret do not tend to talk about its flaws. If you've ever worked as a developer, you've probably signed an NDA, and you've been lectured on the importance of trade secrets, and so on. Proprietary software encourages, and more often enforces, silence even in the face of serious flaws.
### Trust and software
Don't trust software you haven't audited.
If you must trust software you haven't audited, then choose to trust code that's exposed to many developers who independently are likely to speak up about a vulnerability.
Open source isn't inherently more secure than proprietary software, but the systems in place to fix it are far better planned, implemented, and staffed.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/2/open-source-security
作者:[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/yearbook-haff-rx-linux-file-lead_0.png?itok=-i0NNfDC (Hand putting a Linux file folder into a drawer)
[2]: https://cve.mitre.org

View File

@ -2,7 +2,7 @@
[#]: via: "https://www.opensourceforu.com/2022/06/wifi-6-promises-much-more-than-faster-speeds/"
[#]: author: "Sharon Katta https://www.opensourceforu.com/author/sharon-katta/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: translator: "cool-summer-021"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
@ -84,7 +84,7 @@ via: https://www.opensourceforu.com/2022/06/wifi-6-promises-much-more-than-faste
作者:[Sharon Katta][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
译者:[cool-summer-021](https://github.com/cool-summer-021)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,100 +0,0 @@
[#]: subject: "Learn the OSI model in 5 minutes"
[#]: via: "https://opensource.com/article/22/10/osi-model-network-communications"
[#]: author: "Anamika https://opensource.com/users/anamika"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Learn the OSI model in 5 minutes
======
Get the basics of the Open Systems Interconnection (OSI) framework for conceptualizing communication within a computer system.
The Open Systems Interconnection (OSI) model is a standard for how computers, servers, and people communicate within a system. It was the first standard model for network communications and was adopted in the early 1980s by all major computer and telecommunications companies.
The OSI model provides a universal language for describing networks and thinking about them in discrete chunks, or layers.
### Layers of the OSI model
The model describes the seven layers through which computer systems communicate over a network.
1. [Application layer][2]
2. [Presentation layer][3]
3. [Session layer][4]
4. [Transport layer][5]
5. [Network layer][6]
6. [Data link layer][7]
7. [Physical layer][8]
Each of these layers has its own way of working, with its own set of protocols that distinguish it from the others. This article provides a breakdown of the layers one by one.
### Application layer
The application layer is implemented in software. It is the layer used to interact with applications.
Consider the example of sending a message. The sender will interact with the application layer and send the message. The application layer sends the message to the next layer in the OSI Model, the presentation layer.
### Presentation layer
The data from the application layer is forwarded to the presentation layer. The presentation layer receives the data in the form of words, characters, letters, numbers, and so on, and converts them into machine representable binary format. This process is known as translation.
At this stage, ASCII characters (American Standard Code for Information Interchange) are converted into Extended Binary Coded Decimal Interchange Code (EBCDIC). Before the converted data goes further, it also undergoes encoding and encryption processes, using the SSL protocol for encryption and decryption.
The presentation layer provides abstraction and assumes that the layers following it will take care of the data forwarded to them from this layer. It also plays a role in compression of the data. The compression can be lossy or lossless, depending on various factors beyond this article's scope.
### Session layer
The session layer helps in setting up and managing connections. The main work of this layer is to establish a session. For example, on an online shopping site, a session is created between your computer and the site's server.
The session layer enables the sending and receiving of data, followed by the termination of connected sessions. Authentication is done before a session is established, followed by authorization. Like the previous layers, the session layer also assumes that, after its work is done, the data will be correctly handled by the subsequent layers.
### Transport layer
The transport layer manages data transportation and its own set of protocols for how data will be transferred. The data received here from the session layer is divided into smaller data units called segments. This process is known as segmentation. Every segment contains the source's and destination's port numbers and a sequence number. Port numbers identify the application on which the data needs to be sent. Note that the data is transferred in chunks. The sequence numbers are used to reassemble the segments in the correct order.
The transport layer takes care of the flow control, or the amount of data transferred at a given time. It also accounts for error control, such as data loss, data corruption, and so on. It makes use of an error-detecting value known as a checksum. The transport layer adds a checksum to every data segment to check whether the sent data is received correctly. Data is then transferred to the network layer.
### Network layer
The network layer helps communicate with other networks. It works to transmit received data segments from one computer to another located in a different network. The router lives in the network layer.
The function of the network layer is logical addressing (IP Addressing). It assigns the sender's and receiver's IP addresses to each data packet to ensure it is received at the correct destination. The network layer then routes the data packets. Load balancing also happens in the network layer to make sure that no overloading takes place. Next, the data is transported to the data link layer.
### Data link layer
The data link layer allows direct communication with other devices, such as computers and hosts.
It receives data packets containing the IP addresses of the sender and receiver from the network layer and does the physical addressing, assigning the media access control (MAC) addresses of the sender and receiver to a data packet to form a frame.
### Physical layer
This layer consists of all the hardware and mechanical elements of a system, including the configuration of wires, pins, adapters, and so forth. The data received here by the preceding layers is in the form of 0s and 1s. The physical layer converts this data and transports it to local media via various means, including wires, electrical signals, light signals (as in optical fiber cables), and radio signals (as in WiFi).
Note that the physical layer works at the receiver's end and transports the received signal to the data link as a frame (by converting it back to bits). The frame is moved to the higher layers, and ultimately the required data is received at the application layer, which is the software.
### Conclusion
The OSI model is helpful when you need to describe network architecture or troubleshoot network problems. I hope this article gave you a clearer understanding of the elements this model.
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/10/osi-model-network-communications
作者:[Anamika][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/anamika
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/code_computer_development_programming.png
[2]: https://opensource.com/article/22/10/osi-model-network-communications#application-layer
[3]: https://opensource.com/article/22/10/osi-model-network-communications#presentation-layer
[4]: https://opensource.com/article/22/10/osi-model-network-communications#session-layer
[5]: https://opensource.com/article/22/10/osi-model-network-communications#transport-layer
[6]: https://opensource.com/article/22/10/osi-model-network-communications#network-layer
[7]: https://opensource.com/article/22/10/osi-model-network-communications#data-link-layer
[8]: https://opensource.com/article/22/10/osi-model-network-communications#physical-layer

View File

@ -1,283 +0,0 @@
[#]: subject: "Introducing Rust calls to C library functions"
[#]: via: "https://opensource.com/article/22/11/rust-calls-c-library-functions"
[#]: author: "Marty Kalin https://opensource.com/users/mkalindepauledu"
[#]: collector: "lkxed"
[#]: translator: "yzuowei"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Introducing Rust calls to C library functions
======
Why call C functions from Rust? The short answer is software libraries. A longer answer touches on where C stands among programming languages in general and towards Rust in particular. C, C++, and Rust are systems languages, which give programmers access to machine-level data types and operations. Among these three systems languages, C remains the dominant one. The kernels of modern operating systems are written mainly in C, with assembly language accounting for the rest. The standard system libraries for input and output, number crunching, cryptography, security, networking, internationalization, string processing, memory management, and more, are likewise written mostly in C. These libraries represent a vast infrastructure for applications written in any other language. Rust is well along the way to providing fine libraries of its own, but C libraries—around since the 1970s and still growing—are a resource not to be ignored. Finally, C is still the [lingua franca][1] among programming languages: most languages can talk to C and, through C, to any other language that does so.
### Two proof-of-concept examples
Rust has an FFI (Foreign Function Interface) that supports calls to C functions. An issue for any FFI is whether the calling language covers the data types in the called language. For example, `ctypes` is an FFI for calls from Python into C, but Python doesn't cover the unsigned integer types available in C. As a result, `ctypes` must resort to workarounds.
By contrast, Rust covers all the primitive (that is, machine-level) types in C. For example, the Rust `i32` type matches the C `int` type. C specifies only that the `char` type must be one byte in size and other types, such as `int`, must be at least this size; but nowadays every reasonable C compiler supports a four-byte `int`, an eight-byte `double` (in Rust, the `f64` type), and so on.
There is another challenge for an FFI directed at C: Can the FFI handle C's raw pointers, including pointers to arrays that count as strings in C? C does not have a string type, but rather implements strings as character arrays with a non-printing terminating character, the _null terminator_ of legend. By contrast, Rust has two string types: `String` and `&str` (string slice). The question, then, is whether the Rust FFI can transform a C string into a Rust one—and the answer is _yes_.
Pointers to structures also are common in C. The reason is efficiency. By default, a C structure is passed _by_value (that is, by a byte-per-byte copy) when a structure is either an argument passed to a function or a value returned from one. C structures, like their Rust counterparts, can include arrays and nest other structures and so be arbitrarily large in size. Best practice in either language is to pass and return structures by reference, that is, by passing or returning the structure's address rather than a copy of the structure. Once again, the Rust FFI is up to the task of handling C pointers to structures, which are common in C libraries.
The first code example focuses on calls to relatively simple C library functions such as `abs` (absolute value) and `sqrt` (square root). These functions take non-pointer scalar arguments and return a non-pointer scalar value. The second code example, which covers strings and pointers to structures, introduces the [bindgen][2] utility, which generates Rust code from C interface (header) files such as `math.h` and `time.h`. C header files specify the calling syntax for C functions and define structures used in such calls. The two code examples are [available on my homepage][3].
### Calling relatively simple C functions
The first code example has four Rust calls to C functions in the standard mathematics library: one call apiece to `abs` (absolute value) and `pow` (exponentiation), and two calls to `sqrt` (square root). The program can be built directly with the `rustc` compiler, or more conveniently with the `cargo build` command:
```
use std::os::raw::c_int; // 32 bits
use std::os::raw::c_double; // 64 bits
// Import three functions from the standard library libc.
// Here are the Rust declarations for the C functions:
extern "C" {
fn abs(num: c_int) -> c_int;
fn sqrt(num: c_double) -> c_double;
fn pow(num: c_double, power: c_double) -> c_double;
}
fn main() {
let x: i32 = -123;
println!("\nAbsolute value of {x}: {}.", unsafe { abs(x) });
let n: f64 = 9.0;
let p: f64 = 3.0;
println!("\n{n} raised to {p}: {}.", unsafe { pow(n, p) });
let mut y: f64 = 64.0;
println!("\nSquare root of {y}: {}.", unsafe { sqrt(y) });
y = -3.14;
println!("\nSquare root of {y}: {}.", unsafe { sqrt(y) }); //** NaN = NotaNumber
}
```
The two `use` declarations at the top are for the Rust data types `c_int` and `c_double`, which match the C types `int` and `double`, respectively. The standard Rust module `std::os::raw` defines fourteen such types for C compatibility. The module `std::ffi` has the same fourteen type definitions together with support for strings.
The `extern "C"` block above the `main` function then declares the three C library functions called in the `main` function below. Each call uses the standard C function's name, but each call must occur within an `unsafe` block. As every programmer new to Rust discovers, the Rust compiler enforces memory safety with a vengeance. Other languages (in particular, C and C++) do not make the same guarantees. The `unsafe` block thus says: Rust takes no responsibility for whatever unsafe operations may occur in the external call.
The first program's output is:
```
Absolute value of -123: 123.
9 raised to 3: 729
Square root of 64: 8.
Square root of -3.14: NaN.
```
In the last output line, the `NaN` stands for Not a Number: the C `sqrt` library function expects a non-negative value as its argument, which means that the argument -3.14 generates `NaN` as the returned value.
### Calling C functions involving pointers
C library functions in security, networking, string processing, memory management, and other areas regularly use pointers for efficiency. For example, the library function `asctime` (time as an ASCII string) expects a pointer to a structure as its single argument. A Rust call to a C function such as `asctime` is thus trickier than a call to `sqrt`, which involves neither pointers nor structures.
The C structure for the `asctime` function call is of type `struct tm`. A pointer to such a structure also is passed to library function `mktime` (make a time value). The structure breaks a time into units such as the year, the month, the hour, and so forth. The structure's fields are of type `time_t`, an alias for for either `int` (32 bits) or `long` (64 bits). The two library functions combine these broken-apart time pieces into a single value: `asctime` returns a string representation of the time, whereas `mktime` returns a `time_t` value that represents the number of elapsed seconds since the _epoch_, which is a time relative to which a system's clock and timestamp are determined. Typical epoch settings are January 1 00:00:00 (zero hours, minutes, and seconds) of either 1900 or 1970.
The C program below calls `asctime` and `mktime`, and uses another library function `strftime` to convert the `mktime` returned value into a formatted string. This program acts as a warm-up for the Rust version:
```
#include <stdio.h>
#include <time.h>
int main () {
struct tm sometime; /* time broken out in detail */
char buffer[80];
int utc;
sometime.tm_sec = 1;
sometime.tm_min = 1;
sometime.tm_hour = 1;
sometime.tm_mday = 1;
sometime.tm_mon = 1;
sometime.tm_year = 1;
sometime.tm_hour = 1;
sometime.tm_wday = 1;
sometime.tm_yday = 1;
printf("Date and time: %s\n", asctime(&sometime));
utc = mktime(&sometime);
if( utc < 0 ) {
fprintf(stderr, "Error: unable to make time using mktime\n");
} else {
printf("The integer value returned: %d\n", utc);
strftime(buffer, sizeof(buffer), "%c", &sometime);
printf("A more readable version: %s\n", buffer);
}
return 0;
}
```
The program outputs:
```
Date and time: Fri Feb  1 01:01:01 1901
The integer value returned: 2120218157
A more readable version: Fri Feb  1 01:01:01 1901
```
In summary, the Rust calls to library functions `asctime` and `mktime` must deal with two issues:
- Passing a raw pointer as the single argument to each library function.
- Converting the C string returned from `asctime` into a Rust string.
### Rust calls to `asctime` and `mktime`
The `bindgen` utility generates Rust support code from C header files such as `math.h` and `time.h`. In this example, a simplified version of `time.h` will do but with two changes from the original:
- The built-in type `int` is used instead of the alias type `time_t`. The bindgen utility can handle the `time_t` type but generates some distracting warnings along the way because `time_t` does not follow Rust naming conventions: in `time_t` an underscore separates the `t` at the end from the `time` that comes first; Rust would prefer a CamelCase name such as `TimeT`.
- The type `struct tm` type is given `StructTM` as an alias for the same reason.
Here is the simplified header file with declarations for `mktime` and `asctime` at the bottom:
```
typedef struct tm {
int tm_sec; /* seconds */
int tm_min; /* minutes */
int tm_hour; /* hours */
int tm_mday; /* day of the month */
int tm_mon; /* month */
int tm_year; /* year */
int tm_wday; /* day of the week */
int tm_yday; /* day in the year */
int tm_isdst; /* daylight saving time */
} StructTM;
extern int mktime(StructTM*);
extern char* asctime(StructTM*);
```
With `bindgen` installed, `%` as the command-line prompt, and `mytime.h` as the header file above, the following command generates the required Rust code and saves it in the file `mytime.rs`:
```
% bindgen mytime.h > mytime.rs
```
Here is the relevant part of `mytime.rs`:
```
/* automatically generated by rust-bindgen 0.61.0 */
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tm {
pub tm_sec: ::std::os::raw::c_int,
pub tm_min: ::std::os::raw::c_int,
pub tm_hour: ::std::os::raw::c_int,
pub tm_mday: ::std::os::raw::c_int,
pub tm_mon: ::std::os::raw::c_int,
pub tm_year: ::std::os::raw::c_int,
pub tm_wday: ::std::os::raw::c_int,
pub tm_yday: ::std::os::raw::c_int,
pub tm_isdst: ::std::os::raw::c_int,
}
pub type StructTM = tm;
extern "C" {
pub fn mktime(arg1: *mut StructTM) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn asctime(arg1: *mut StructTM) -> *mut ::std::os::raw::c_char;
}
#[test]
fn bindgen_test_layout_tm() {
const UNINIT: ::std::mem::MaybeUninit<tm> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tm>(),
36usize,
concat!("Size of: ", stringify!(tm))
);
...
```
The Rust structure `struct tm`, like the C original, contains nine 4-byte integer fields. The field names are the same in C and Rust. The `extern "C"` blocks declare the library functions `asctime` and `mktime` as taking one argument apiece, a raw pointer to a mutable `StructTM` instance. (The library functions may mutate the structure via the pointer passed as an argument.)
The remaining code, under the `#[test]` attribute, tests the layout of the Rust version of the time structure. The test can be run with the `cargo test` command. At issue is that C does not specify how the compiler must lay out the fields of a structure. For example, the C `struct tm` starts out with the field `tm_sec` for the second; but C does not require that the compiled version has this field as the first. In any case, the Rust tests should succeed and the Rust calls to the library functions should work as expected.
### Getting the second example up and running
The code generated from `bindgen` does not include a `main` function and, therefore, is a natural module. Below is the `main` function with the `StructTM` initialization and the calls to `asctime` and `mktime`:
```
mod mytime;
use mytime::*;
use std::ffi::CStr;
fn main() {
let mut sometime = StructTM {
tm_year: 1,
tm_mon: 1,
tm_mday: 1,
tm_hour: 1,
tm_min: 1,
tm_sec: 1,
tm_isdst: -1,
tm_wday: 1,
tm_yday: 1
};
unsafe {
let c_ptr = &mut sometime; // raw pointer
// make the call, convert and then own
// the returned C string
let char_ptr = asctime(c_ptr);
let c_str = CStr::from_ptr(char_ptr);
println!("{:#?}", c_str.to_str());
let utc = mktime(c_ptr);
println!("{}", utc);
}
}
```
The Rust code can be compiled (using either `rustc` directly or `cargo`) and then run. The output is:
```
Ok(
    "Mon Feb  1 01:01:01 1901\n",
)
2120218157
```
The calls to the C functions `asctime` and `mktime` again must occur inside an `unsafe` block, as the Rust compiler cannot be held responsible for any memory-safety mischief in these external functions. For the record, `asctime` and `mktime` are well behaved. In the calls to both functions, the argument is the raw pointer `ptr`, which holds the (stack) address of the `sometime` structure.
The call to `asctime` is the trickier of the two calls because this function returns a pointer to a C `char`, the character `M` in `Mon` of the text output. Yet the Rust compiler does not know where the C string (the null-terminated array of `char`) is stored. In the static area of memory? On the heap? The array used by the `asctime` function to store the text representation of the time is, in fact, in the static area of memory. In any case, the C-to-Rust string conversion is done in two steps to avoid compile-time errors:
- The call `Cstr::from_ptr(char_ptr)` converts the C string to a Rust string and returns a reference stored in the `c_str` variable.
- The call to `c_str.to_str()` ensures that `c_str` is the owner.
The Rust code does not generate a human-readable version of the integer value returned from `mktime`, which is left as an exercise for the interested. The Rust module `chrono::format` includes a `strftime` function, which can be used like the C function of the same name to get a text representation of the time.
### Calling C with FFI and bindgen
The Rust FFI and the `bindgen` utility are well designed for making Rust calls out to C libraries, whether standard or third-party. Rust talks readily to C and thereby to any other language that talks to C. For calling relatively simple library functions such as `sqrt`, the Rust FFI is straightforward because Rust's primitive data types cover their C counterparts.
For more complicated interchanges—in particular, Rust calls to C library functions such as `asctime` and `mktime` that involve structures and pointers—the `bindgen` utility is the way to go. This utility generates the support code together with appropriate tests. Of course, the Rust compiler cannot assume that C code measures up to Rust standards when it comes to memory safety; hence, calls from Rust to C must occur in `unsafe` blocks.
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/11/rust-calls-c-library-functions
作者:[Marty Kalin][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/mkalindepauledu
[b]: https://github.com/lkxed
[1]: https://en.wikipedia.org/wiki/Lingua_franca
[2]: https://github.com/rust-lang/rust-bindgen
[3]: https://condor.depaul.edu/mkalin

View File

@ -1,122 +0,0 @@
[#]: subject: "How to Access UEFI Settings in Linux Systems"
[#]: via: "https://itsfoss.com/access-uefi-from-linux/"
[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Access UEFI Settings in Linux Systems
======
Want to check the boot order or the power settings at the firmware level? **You can access the UEFI settings by pressing the F2, F10 or Del buttons when your system boots**.
The problem with this approach is that you may not know the exact key and must be alert about pressing those keys at the right time.
![Mr. Bean][1a]
If you dont want to feel like Mr. Bean in the above Gif, you can access the UEFI settings from the [Grub bootloader][1] screen in Linux.
![uefi firmware settings grub linux][2]
You see this screen when you turn on your Linux system. Most Linux distributions like Fedora and Ubuntu use Grub and they allow you to access the UEFI settings from the Grub screen like this.
What if you dont see this screen or your distro doesnt use Grub? There are still ways to access UEFI settings from within Linux.
Before you see how to do that, please [ensure that your system uses UEFI][3].
**_Another important thing. Your system will reboot into UEFI settings._** _You cannot access and modify the firmware settings from within an operating system._
### Boot into UEFI settings from Linux
This method will only work on Linux distros having systemd. This means this method will work on anything based on Ubuntu, Debian, Fedora, and any mainstream Arch-based distros, including Manjaro and EndeavourOS.
It is still a good idea to [ensure that your Linux distro uses systemd][4]. Use the given command and if it returns systemd you are good to go:
```
ps --no-headers -o comm 1
```
![how to know if i am using systemd on linux?][5]
Once you figure out that your distro is utilizing systemd, you can use the given command to boot into UEFI settings:
```
systemctl reboot --firmware-setup
```
Let me break down the used options first:
- `reboot`: As its name suggest, it will reboot your system.
- `--firmware-setup`: When this option is used with `reboot`, it will indicate to the systems firmware to boot into the firmware setup interface.
Yup, that was it! A single command and you will be kicked into UEFI settings. I know Windows allows [booting into UEFI firmware settings from within Windows][6]. Its good to see something similar in Linux as well.
#### Create a desktop shortcut to boot into UEFI settings (optional)
If you often find yourself booting into the UEFI settings and dont remember the command all the time, you can make your life easier by creating a desktop shortcut. This will let you boot into UEFI by clicking on desktop icon.
_**Now, this is unnecessary and not required for most Linux users. Do it only if you feel the need for it. The method requires [editing files in the command line][7].**_
First, use the given command to create a desktop shortcut file for UEFI settings:
```
sudo nano /usr/share/applications/uefi-reboot.desktop
```
And paste the following content in the file:
```
[Desktop Entry]
Name=UEFI Firmware Setup (Reboot)
Comment=Access the motherboard configuration utility
Exec=systemctl reboot --firmware-setup
Icon=system-restart
Terminal=false
Type=Application
Categories=System;Settings;
```
![create a desktop shortcut to boot into uefi settings][8]
Once done, [save the changes and exit from the nano][9] text editor.
And now, you will find the shortcut for UEFI Firmware Setup in your system menu:
![boot into uefi firmware from system menu][10]
Thats it! A neat way to get into UEFI settings.
### Wrapping Up
The classic ways of accessing the boot settings may be a little inconvenient for some people. The grub screen may not show the UEFI option for older versions.
And this is where the systemd method shines. I found this method a lifesaver when my system crashed and my function keys were not responding, which are necessary to boot into UEFI (thats what I thought then!).
I hope you find it equally helpful.
--------------------------------------------------------------------------------
via: https://itsfoss.com/access-uefi-from-linux/
作者:[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
[1a]: https://external-preview.redd.it/dxmsKYDmzgfb1thu3EFI8Ni-DNfprNX8W8xDtff4QWU.gif?format=mp4&s=c31204644ac6a2a348133986714ff97cf3c4a48a
[1]: https://itsfoss.com/what-is-grub/
[2]: https://itsfoss.com/wp-content/uploads/2022/12/uefi-firmware-settings-grub-linux.webp
[3]: https://itsfoss.com/check-uefi-or-bios/
[4]: https://linuxhandbook.com/check-if-systemd/
[5]: https://itsfoss.com/wp-content/uploads/2022/12/how-to-know-if-i-am-using-systemd-on-linux.png
[6]: https://itsfoss.com/access-uefi-settings-windows-10/
[7]: https://learnubuntu.com/edit-files-command-line/
[8]: https://itsfoss.com/wp-content/uploads/2022/12/create-a-desktop-shortcut-to-boot-into-uefi-settings.png
[9]: https://linuxhandbook.com/nano-save-exit/
[10]: https://itsfoss.com/wp-content/uploads/2022/12/boot-into-uefi-firmware-from-system-menu.png

View File

@ -1,87 +0,0 @@
[#]: subject: "Convert and Manipulate Images With Converter GUI Tool in Linux"
[#]: via: "https://itsfoss.com/converter-tool/"
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Convert and Manipulate Images With Converter GUI Tool in Linux
======
You can always [install ImageMagick][1] on your system to convert images, but not everyone likes to use the terminal for converting and manipulating images.
So, what if you have a GUI app as a front-end to help with that? **Converter** is precisely that.
It is a front-end to ImageMagick. So you do not need to use commands to convert and manipulate images.
Note that most Ubuntu systems usually have ImageMagick pre-installed. You can always refer to our [installation guide][1] if you do not have it on your system.
### Converter: A Graphical Front-end to ImageMagick
![converter gui][2]
It should not take a lot of effort to convert images. It is a simple task, and that is how it should be.
I do not want to type a command to convert an image quickly. Hence, I prefer graphical tools that enable me to do things faster.
[Converter][3] is an open-source graphical front-end that enables you to do that. It is a GTK4+libadwaita application.
You can convert the images to various file formats that include **png, webp, jpeg, heif, heic, and bmp**. It is safe to say that you get support for the most popular image file formats. So, it should come in pretty handy.
![file format converter][4]
You can set a location to save all the files, and the converted images will automatically be stored at that location.
![customize converter][5]
You can also adjust an images quality, size, and background color. To access these options, click on “**More Options**” in the user interface before converting the image.
![converter more options][6]
The image size can be customized using its percentage, exact pixels, or ratio. For precise manipulation, changing the dimensions should help.
If you want the image scaled to an extent, the percentage or ratio functionality should help you do that. You can also choose to add filters to your images.
Overall, you get the basic options to re-size, convert, and optimize the image quality with Converter.
You can also [tweak Nautilus][7] to have the [resize option in the right-click context menu][8]. It wont be as versatile as this tool.
### Install Converter on Linux
Converter is available as a Flatpak on [Flathub][9] to install on any Linux distribution of your choice.
Unfortunately, you do not get any binary packages to install on your Linux system. So, you might want to refer to our [Flatpak guide][10] to get it installed.
```
flatpak install flathub io.gitlab.adhami3310.Converter
```
You can explore more about it on its [GitLab page][3].
_Do you have any suggestions to nifty tools like this for us to highlight next? Let us know in the comments._
--------------------------------------------------------------------------------
via: https://itsfoss.com/converter-tool/
作者:[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/install-imagemagick-ubuntu/
[2]: https://itsfoss.com/wp-content/uploads/2022/12/converter-gui.png
[3]: https://gitlab.com/adhami3310/Converter
[4]: https://itsfoss.com/wp-content/uploads/2022/12/file-format-converter.png
[5]: https://itsfoss.com/wp-content/uploads/2022/12/customize-converter.png
[6]: https://itsfoss.com/wp-content/uploads/2022/12/converter-more-options.png
[7]: https://itsfoss.com/nautilus-tips-tweaks/
[8]: https://itsfoss.com/resize-images-with-right-click/
[9]: https://flathub.org/apps/details/io.gitlab.adhami3310.Converter
[10]: https://itsfoss.com/flatpak-guide/

View File

@ -2,7 +2,7 @@
[#]: via: "https://opensource.com/article/22/12/open-source-solar-power-home"
[#]: author: "Joshua Pearce https://opensource.com/users/joshuapearce"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "

View File

@ -0,0 +1,301 @@
[#]: subject: "How to Install the Minimalist ArchBang Linux Distro"
[#]: via: "https://itsfoss.com/install-archbang/"
[#]: author: "Sreenath https://itsfoss.com/author/sreenath/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Install the Minimalist ArchBang Linux Distro
======
ArchBang is a minimal and lightweight [Arch Linux based distribution][1]. It uses the i3 window manager. With its minimal nature, ArchBang can help you revive your old computer or low-end devices.
There are two ways to install Arch Bang:
- Using the guided installer script
- Following Arch wiki
No prizes for guessing that using the guided installer script will be easier to follow.
In this tutorial, Ill show you the steps for installing ArchBang with its text-based installer script.
Please [check if your computer has UEFI or the legacy BIOS system][2]. Some steps are different for them.
I have performed the demo in a virtual machine. And hence the wifi configuration part is not there. Internet connection is not mandatory here; you can also install it offline. You can connect to wifi from within the system after successfully installing ArchBang.
Also, this method will remove any other operating system installed on your disk. Please be mindful of that.
### Download ArchBang Live ISO
To install ArchBang, you need the live ISO first.
You can go to their [official website and download the required ISO][3], as shown in the below screenshot.
![go to archbang iso images to download the iso file from sourceforge][4]
It brings you to their Sourceforge page. Download the ISO, which is approximately 1.2 GiB in size.
### Create the Live USB of ArchBang
Once downloaded, you should make a bootable USB of ArchBang. You can [use software like Balena Etcher][5] to create it. Its quite simple to use.
Plug in your USB, browse to the downloaded ISO file and then hit the Flash button.
![etcher flash][6]
### Using text-based ArchBang installer
ArchBang live ISO will bring you to the default i3 desktop with conky running.
![archbang live iso home screen][7]
You have two methods to start the installation process:
- Press **Super + I** (as per desktop conky) to start installation directly.
- Press **Super + T** to enter the terminal and use the command: `sudo abinstall`
A terminal with several options will appear when you do the above step:
![archbang installer][8]
The above screenshot shows the main menu of ArchBang installer. You can select each section with the associated number.
When you complete each category of the above installer, it will return to this menu and you can select the next category by pressing the corresponding number and Enter key.
Also, the completed sections will be checked with an “x” mark.
#### Step 1: Select / Set Partition
On the new installer screen, enter “1” to start [partitioning the disk][9].
Inside this, select the **Default** option. The installer has several tools to partition the disk, like cfdisk, fdisk, parted, etc. I used fdisk to do the job.
##### Partitioning for Non-UEFI system
Once the tool is selected, it will ask to choose the storage device. In my case, it was `/dev/sda` . Select the appropriate choice in your context.
To start partitioning, enter “n” for a new partition. After that, select **Primary Partition.**
![creating partition for non uefi system][10]
For [non-UEFI systems][2], you can create one single root partition for all purposes. So, accept all the default values for “First Sector” and “Last Sector”. Then, press “w” to write the changes.
On the next screen, you have to choose your filesystem and swap method. In this tutorial, I am using the EXT4 file system and Swap to File as the swap method.
So set those according to the screenshot.
![format the disk and select ext4 partition][11]
##### Partitioning for UEFI system
For UEFI users, you need to have two partitions, one EFI, with a 550 MB space, and another main root partition with the rest of the space (Swap as a file setting).
Press n and select **Primary Partition.** Then select the Partition number as 1.
Accept the default value for “First sector”. Now enter “+550M” as the value for “Last Sector”.
Once again, press “n” and select **Primary Partition**. Accept the default value for the first and last sectors.
![create two partitions for efi system][12]
Press “t” to change the type and select the partition number “1” or `/dev/sda1`, whose type is to be changed from “Linux” to “EFI”.
Select the partition type as EFI, as shown below:
![change type of smaller partition to efi][13]
Press “w” to write the changes. Then it will ask for filesystem selection. Here, you need to select the larger partition as the root partition (/dev/sda2, that is option 2 in the below screenshot).
![select larger partition for root partition in efi system][14]
Select EXT4 filesystem. This will again ask for mounting EFI partition.
![select efi partition][15]
In this step, you need to select the EFI partition at `/dev/sda1` and choose the mount point as `/boot/efi` . This will ask for format. Give consent by pressing “y”.
Also, dont forget to choose the swap to file option.
#### Step 2: Start ArchBang installation
This is pretty simple. Select the Install ArchBang option from the main menu by pressing the corresponding number (2 in this case). It will start the installation process.
![installing archbang progress bar][16]
You should wait for some time to complete the installation.
#### Step 3: Set Hostname
Once installation is completed, Select the 3rd option on the main menu, which is for setting the hostname. You need to enter a hostname.
![provide hostname and press enter][17]
#### Step 4: Set Location
Location/Time Zone is typically mentioned in Zone/City format. I used Asia/Kolkata as the time zone.
The installer provides the list of available zones and cities; you need to enter the number corresponding to your choice.
![set time zone info][18]
Also, set your location the same way.
#### Step 5: Set Hardware Clock
You have two options; Set Hardware Clock to UTC or Local Time.
![set hardware clock time][19]
There are two time standards:** localtime** and Coordinated Universal Time (UTC). The localtime standard depends on the current time zone, while UTC is the global time standard and is independent of time zone values.
Enter your choice and press Enter key.
#### Step 6: Set Locale
Usually, you set the locale to en_US, if you are unsure what to do. That should be fine for most English-speaking users.
If you want to use the operating system in some other language like French, Spanish, Dutch etc, you can choose the appropriate locale from the list.
![set locale][20]
#### Step 7: Desktop Keyboard Layout
Similarly, most users should be fine with US keyboard. If you have some other keyboard (like French, or Italian), enter the appropriate choice from the available ones.
![set desktop keyboard layout][21]
#### Step 8: Configure Bootloader
In ArchBang, you get GRUB2, Syslinux, or Systemd for the bootloader. To make it simple, I am selecting GRUB2 from the choice.
![select grub2 as bootloader][22]
Now, it will ask you to specify the method to install GRUB. Select **Automatic** and press enter.
![select automatic grub][23]
#### Step 9: Set Root Password
Now, you should enter the root password. Select “Root Password” from the main menu.
![enter and confirm root password][24]
Here, enter and confirm the root password.
#### Step 10: Create a New User
Using a system with only a Root User is not secure. So, you should create a new user. In this installer, select the 10th option. Here, you should type a user name, password and confirm the password.
![create user and password][25]
Once done, press Enter to go to the main menu.
#### Step 11: Finish configuration
At this stage, you have reviewed all the configurations needed. You can now make it to effect by entering the letter “d” as shown in the screenshot below:
![enter d option to finish the installation][26]
This will ask permission to reboot your system.
![press y to reboot your system to new archbang][27]
Entering “y” will reboot your system to the newly installed ArchBang system.
### Post Installation Tweaks
Once rebooted, you will land in the same console. Probably there is no [display manager][28] installed. Here you should enter the username and password and press enter.
![login to archbang through tty][29]
This will bring you to the i3WM.
![installed archbang with i3wm][30]
Once installed, you need to do a couple of update tasks. **Connect to the internet first**.
Firstly, you need to update the Pacman keys and archlinux-keyring.
To do the same, open a terminal by pressing **Super + T** and run the following commands one by one:
```
sudo pacman-key init
sudo pacman-key populate
sudo pacman -Syyu archlinux-keyring
```
This will update system packages and keyrings. Reboot your system.
Now, you should install a display manager. I prefer LightDM display manager. So open a terminal and enter the following command to install it:
```
sudo pacman -S lightdm lightdm-gtk-greeter
```
Once installed, use the following command to start the Lightdm service:
```
sudo systemctl enable lightdm.service
```
You will get a good and minimal login screen from the next reboot.
![lightdm login screen in archbang][31]
You can now enjoy ArchBang Linux according to your liking.
### Wrapping Up
ArchBang brings a good Arch Linux experience coupled with a not-so-hard installer and i3WM as the window manager.
I understand that using a text-based installer like this one could be intimidating for some users. But then, it is [one of the joys of the Arch Linux][32] domain. It feels like a challenge and when you successfully install it, it gives you a sense of accomplishment.
I have tried to detail all the steps with the necessary explanation. Please let me know if you face any issues or if you have any questions.
--------------------------------------------------------------------------------
via: https://itsfoss.com/install-archbang/
作者:[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://itsfoss.com/arch-based-linux-distros/
[2]: https://itsfoss.com/check-uefi-or-bios/
[3]: https://sourceforge.net/projects/archbang/files/
[4]: https://itsfoss.com/wp-content/uploads/2022/12/go-to-archbang-iso-images-to-download-the-iso-file-from-sourceforge.png
[5]: https://itsfoss.com/install-etcher-linux/
[6]: https://itsfoss.com/wp-content/uploads/2022/06/etcher-flash.png
[7]: https://itsfoss.com/wp-content/uploads/2022/12/archbang-live-iso-home-screen.webp
[8]: https://itsfoss.com/wp-content/uploads/2022/12/archbang-installer.png
[9]: https://itsfoss.com/partition-managers-linux/
[10]: https://itsfoss.com/wp-content/uploads/2022/12/creating-partition-for-non-uefi-system.png
[11]: https://itsfoss.com/wp-content/uploads/2022/12/format-the-disk-and-select-ext4-partition.png
[12]: https://itsfoss.com/wp-content/uploads/2022/12/create-two-partitions-for-efi-system.png
[13]: https://itsfoss.com/wp-content/uploads/2022/12/change-type-of-smaller-partition-to_efi.png
[14]: https://itsfoss.com/wp-content/uploads/2022/12/select-larger-partition-for-root-partition-in-efi-system.png
[15]: https://itsfoss.com/wp-content/uploads/2022/12/select-efi-partition.png
[16]: https://itsfoss.com/wp-content/uploads/2022/12/installing-archbang-progress-bar.png
[17]: https://itsfoss.com/wp-content/uploads/2022/12/provide-hostname-and-press-enter.png
[18]: https://itsfoss.com/wp-content/uploads/2022/12/set-time-zone-info.png
[19]: https://itsfoss.com/wp-content/uploads/2022/12/set-hardware-clock-time.png
[20]: https://itsfoss.com/wp-content/uploads/2022/12/set-locale.png
[21]: https://itsfoss.com/wp-content/uploads/2022/12/set-desktop-keyboard-layout.png
[22]: https://itsfoss.com/wp-content/uploads/2022/12/select-grub2-as-bootloader.png
[23]: https://itsfoss.com/wp-content/uploads/2022/12/select-automatic-grub.png
[24]: https://itsfoss.com/wp-content/uploads/2022/12/enter-and-confirm-root-password.png
[25]: https://itsfoss.com/wp-content/uploads/2022/12/create-user-and-password.png
[26]: https://itsfoss.com/wp-content/uploads/2022/12/enter-d-option-to-finish-the-installation.png
[27]: https://itsfoss.com/wp-content/uploads/2022/12/press-y-to-reboot-your-system-to-new-archbang.png
[28]: https://itsfoss.com/display-manager/
[29]: https://itsfoss.com/wp-content/uploads/2022/12/login-to-archbang-through-tty.png
[30]: https://itsfoss.com/wp-content/uploads/2022/12/installed-archbang-with-i3wm.png
[31]: https://itsfoss.com/wp-content/uploads/2022/12/lightdm-login-screen-in-archbang.png
[32]: https://itsfoss.com/why-arch-linux/

View File

@ -0,0 +1,119 @@
[#]: subject: "A sysadmin's guide to Carbonio"
[#]: via: "https://opensource.com/article/22/12/carbonio-community-edition-sysadmin"
[#]: author: "Arman Khosravi https://opensource.com/users/arman-khosravi"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
A sysadmin's guide to Carbonio
======
[Carbonio Community Edition (Carbonio CE)][1] is an open source no-cost email and collaboration platform by Zextras. It provides privacy for organizations seeking digital sovereignty by using on-premises self-hosted servers. Using self-hosted servers offers a deeper level of control over infrastructure and data. However, it requires more attention to server configurations and infrastructure management to guarantee data sovereignty. Tasks done by system administrators play an important role in this matter. This makes administrative tasks a crucial part of achieving digital sovereignty, therefore, an administrative console dedicated to such tasks becomes extremely valuable to facilitate sysadmins' everyday jobs.
This is why Zextras launched the first release of its own admin panel for Carbonio CE on October 2022. For Carbonio CE system administrators, it is the first step toward the creation of an all-inclusive admin console.
In this article, I go into detail about the Carbonio CE Admin Panel and take a deeper look into what it can accomplish.
![Image of the Carbonio admin panel.][2]
### What is the Carbonio CE Admin Panel?
The Carbonio CE Admin Panel is designed to assist the Carbonio CE system administrators with the most repetitive and frequent tasks such as user management and domain configuration. It is a browser-based application that runs on a particular port and is available for system administrators to use in production environments as soon as Carbonio CE is installed.
### Why do you need the admin panel?
Everything done in Carbonio CE Admin Panel can be done through the command-line interface as well. This raises the question: why might system administrators prefer using the admin panel rather than the command-line interface?
Using the admin panel has its own obvious advantages such as:
- Making repetitive activities much easier to perform
- Saving system administrators' time monitoring servers
- Providing a much easier learning process for junior system administrators
Even though using the admin panel makes administrative tasks easier to perform, there is more to using this native user interface for Carboino CE. In essence, the Carbonio CE Admin Panel gives you the ability to monitor and manage your organization server from a single centralized location. Even when you're far away, you may still access your admin panel to check the status of servers and carry out various administrative activities.
### Creating and managing user accounts
Managing users has always been one of the most, if not the most, performed action by sysadmins. Therefore it should be an essential part of every administrative GUI available for system administrators. Suppose you, as the system administrator of the company have received some request by users to edit some information on their account. For instance, giving them access to some features, or your company has hired new employees, or some employees have left the company. All these scenarios require a sysadmin to manage user accounts frequently.
Using the Carbonio CE Admin Panel you can simply go to **Domains > select a domain > Accounts** and select any account to modify, or press the **+** button to add a new account.
![Image of the accounts Carbonio adminpanel.][3]
### Creating and managing mailing lists
Besides creating user accounts, a system administrator is often required to create different mailing lists that reflect the organizational structure of the company. Using mailing lists, users can simply send emails to a group of users by inserting the list address instead of every user address one by one.
Creating mailing lists in Carbonio CE is extremely easy using the admin panel. You need to go to **Domains > select a domain > Mailing List > press the + button**. You can now use the wizard that opens up to create a mailing list.
![Image of the Carbonio admin panel mailing list.][4]
The essential steps to follow are:
- Insert the name
- Insert the mailing list address
- Press **NEXT**
- Insert the members
- Press **CREATE**.
You can follow the same path to edit mail lists created before.
### Creating and managing domains
Managing domains is another task frequently done by system administrators. Similar to accounts, creating a domain is very easy in the Carbonio Admin Panel. You only need to go to **Domains > select a domain > under the details** and find different entries to monitor the status of the domain. To create a new domain simply click on the **CREATE** button on the top bar and select **Create New Domain** and insert the necessary information such as:
- Domain name
- Maximum number of accounts and maximum email quota
- Mail server where the domain is hosted
![Image of the Carbonio admin domains panel.][5]
### Creating and managing mailstore servers
The Carbonio CE Admin Panel allows system administrators to manage different servers present in the infrastructure and provide them with different tools to configure them. To monitor a new mailstore server you can go to **Mailstores > Servers List** and find all the available mailstore servers in your infrastructure in a list (when just one server is installed, only one server is shown in this area).
Under **Server Details**, you can select any of the available servers in the list and select **Data Volumes** to show more details of the storage volumes attached to it. While multiple volumes can be mounted simultaneously, only one primary volume, one secondary volume, and one index volume can be designated as active. You can add new volumes using the **NEW VOLUME +** button in the same section. You can also change the volume properties simply by clicking on them to open their detail window.
![Image of the Carbonio admin panel volumes.][6]
### Creating and managing classes of service
Another scenario that can be facilitated with the help of the admin panel is creating classes of service (COS). After the installation, a system administrator might need to create different classes (groups) and assign different properties to them. This way, later in the process each user or a group of users can be easily nominated to a class of service in order to have access to the features and properties assigned to that specific COS.
![Image of the Carbonio admin panel COS features.][7]
To create a COS simply click on the **CREATE** button and select **Create New COS** or alternatively go to **COS** on the left panel and click on **CREATE NEW COS +**. You can then insert the name of the COS and define the different services available to this specific class.
To edit a COS, go to **COS** on the left panel and select a COS from the dropdown menu at top of the list.
You can define settings like quotas, the mail servers that can host accounts from this COS, or enable features for this COS. You can also define features for general features like Mail, Calendar, and Contacts. Additional customizable options include Tagging, Out of Office Reply, Distribution List Folders, and so on.
![Image of the Carbonio admin panel classes of service preferences.][8]
### Conclusion
In this article, you saw a few scenarios in which the Carbonio CE Admin Panel saves you time and effort. The admin panel is an evolution of classical administrative tools in a new and centralized interface that gives the possibility of accessing different functionalities and monitoring tools from the same location.
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/12/carbonio-community-edition-sysadmin
作者:[Arman Khosravi][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/arman-khosravi
[b]: https://github.com/lkxed
[1]: https://opensource.com/article/22/3/open-source-collaboration-carbonio
[2]: https://opensource.com/sites/default/files/2022-11/carbonio_admin_panel.webp
[3]: https://opensource.com/sites/default/files/2022-11/accounts_carbonio_admin_panel.webp
[4]: https://opensource.com/sites/default/files/2022-11/mailing_list_carbonio_admin_panel.webp
[5]: https://opensource.com/sites/default/files/2022-11/domains_carbonio_admin_panel.webp
[6]: https://opensource.com/sites/default/files/2022-11/volumes_carbonio_admin_panel.webp
[7]: https://opensource.com/sites/default/files/2022-11/cos_features_carbonio_admin_panel.webp
[8]: https://opensource.com/sites/default/files/2022-11/cos_preferences_carbonio_admin_panel.webp

View File

@ -0,0 +1,226 @@
[#]: subject: "5 Best Linux Phones to Watch Out for in 2023"
[#]: via: "https://www.debugpoint.com/best-linux-phones/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
5 Best Linux Phones to Watch Out for in 2023
======
**Heres a list of the best Linux Phones which may become more mainstream in 2023 with their features and price.**
Android and iOS smartphones are the most popular ones around the world. However, many of you look for something more “open” and better at privacy. If you use Android, you forfeit your privacy. Apples iOS is a little better on that but again its a “walled garden”.
Thats why Linux phones are becoming popular nowadays because they contain many options for developers and end users. Although various types of Linux phones are currently available, it still becomes confusing to choose the best one. Looking at the trends of 2022, here are some of the Linux Phones which may become more mainstream in 2023.
### Things you should know about Linux Phones
Before you read or even plan to buy one, there are a couple of things you should know about. Here are some of them:
- The Linux phones use a modified version of mainstream Linux distribution with a mobile-friendly desktop environment. This is the same for most of the phones available today.
- You must manage your expectations if you plan to buy a phone and use it for your daily driver. Because the Linux phone operating systems, device features, and app ecosystem is still in the early stages, and its not close to the Android or iOS ecosystem,
- However, Linux phones with the operating system provide the best privacy feature, which might be the reason you can make a move.
### Best Linux Phones
#### Librem from Purism
The Librem 5 Purism is quite a famous brand in the Linux phone market. The Librem 5 model comes with PureOS, an OS designed for Linux Mobiles and not based on the android or iOS platform. It is a natively designed free and open-source OS. PureOS also supports convergence. That means you can plug your phone into a monitor via a USB hub and use it as a desktop OS.
The phone has premium hardware and feels and focuses on security and privacy. However, this impressive smartphone comes with a little higher price tag of $1299.
#### Key features & specification
- Fully free and open-source Linux-based mobile operating system: PureOS
- Separate modem, Wi-Fi and Bluetooth chip
- Three dedicated hardware keys to enable and disable internet, camera, Wi-Fi and Bluetooth
- Smart card reader
- SD card reader
- User-replaceable battery
![Librem 5][1]
| Specification | Description |
| :- | :- |
| **Screen** | 5.7″ (IPS TFT 720×1440) |
| **RAM** | 3 GB |
| **Storage** | 32 GB eMMC |
| **Battery** | 4500mAh |
| **CPU** | NXP i.MX 8M QUAD CORE Cortex-A53 with 64 bit ARM @max 1.5GHz |
| **GPU** | Vivante GC7000 Lite |
| **Screen** | 5.7Inches IPS TFT 720×1440 |
| **Camera** | 13 Mpx with LED Flash (Rear) and 8 Mpx (Front) |
| **USB** | USB Type C |
[Official page for buying options of Librem 5][2]
#### Pinephone
Second on the list is Pinephone, perhaps the most complete and usable Linux phone in the market. Developed by Pine64, it has excellent features and supports multiple Linux ARM distributions for mobile phones.
In addition, PinePhone comes in multiple versions, including a pro version, simultaneously. It is an excellent option for Linux phones as it is also cheaper. PinePhone focuses on the users privacy and extensibility and can be a good option if you want to start the first time with Linux phones.
#### Key features & specification
- Supports KDE Plasma mobile, Manjaro mobile, Sailfish OS, and Ubuntu touch
- It comes with five kill switches for LTE, Cameras, Wifi/BT, and Microphones
- Bootable microSD and 16GB/32GB eMMC
- USB Type C (Power, Data and Video Out)
- Six pogo pins allow custom hardware extensions such as a thermal camera, wireless charging, NFC, an extended battery case, or a keyboard case.
- 3.5 headphone jack
- Supports convergence to extend it as a PC
- Affordable price with starting $149 and $199
![Pinephone][3]
| Specification | Description |
| :- | :- |
| **Screen** | 5.95 Inches, HD IPS capacitive touchscreen |
| **CPU** | Allwinner A64 ARM QUAD Core Cortex-A53 and 64bit |
| **GPU** | Mali-400 MP2 |
| **RAM** | Two Variants: 2GB and 3GB LPDDR3 SDRAM |
| **Storage** | Two Variants: 16GB and 32GB eMMC. |
| **Camera** | Single 5MP, 1/4″, LED Flash (Rear) and Single 2MP, f/2.8, 1/5″ (Front) |
| **Battery** | Li-ion (capacity 2800mAh) |
| **Audio Jack** | 3.5 mm |
[Pinephone buying options][4]
#### Pro 1 X F(X)tec
[Pro 1 X F(X)tec][5] is a smartphone that offers various options for operating systems. And its arguably the more exciting product in this Linux phone list.
You can use LineageOS, Android, Ubuntu Touch, etc., on the same phone. Moreover, an inbuilt slide-out keyboard makes it more unique and attractive.
Developed by F(x)tec company in London, its new in the market and shows promise. However, its not yet out, with planned shipping on December 2022. Hence, you may need to wait a few days for a review.
![Pro 1 X][6]
#### Key features
- First Linux-based smartphone startup with a sliding QUERTY keyboard
- Supports Ubuntu touch out of the box with an Android option
- Unlocked bootloader
- 3.5 headphone jack
- AMOLED display
- 128GB/6GB (storage and RAM) starting price $829
- 256GB/8GB (storage and RAM) starting price $899
| Specification | Description |
| :- | :- |
| **CPU** | Snapdragon 662 Qualcomm |
| **GPU** | Adreno 610 Qualcomm |
| **RAM** | Two Variants: 6GB and 8GB LPDDR4 |
| **Storage** | 128GB (expandable up to 2TB) |
| **Screen** | 5.99″ with curved edge Corning® Gorilla® Glass 3 ( 2160 x 1080 FHD AMOLED Display) |
| **Camera** | 12MP Sony IMX363 (Rear) and 8MP (Front) |
| **Battery** | 3200 mAh |
| **Audio Jack** | 3.5 mm  |
[pro 1 x buying options][5]
#### Volla Phone
[Volla Phone][7] can operate simultaneously with two operating systems: Ubuntu Touch and VollaOS. Moreover, VollaOS is a modified android that is google-free and simultaneously focuses on the users privacy. At the same time, Ubuntu Touch is a popular Linux phone distro.
#### Key features & specifications
- Free from Google and services
- No cloud dependency
- Encrypted device storage
- Modified Android OS: Volla OS
- Supports Ubuntu Touch, Manjaro, Sailfish OS
- USB C charging
- 3.5 headphone jack
- Fingerprint log in
- Offline maps
![Volla Phone][8]
| Specification | Description |
| :- | :- |
| **CPU** | MediaTek Helio P23 |
| **GPU** | ARM Mali-G71 MP2  |
| **Storage** | 64 GB, eMMC |
| **RAM** | 4 GB DDR3 RAM |
| **Screen** | 6.3Inches, IPS, 2340×1080 Pixels |
| **Camera** | 16MP with Flash (Rear) and 16MP (Front) |
| **Battery** | 4700 mAh |
| **USB** | Type C & 3.5mm Audio Jack |
[Volla Phone buying options][9]
#### Fairphone 4
It comes with PostmarketOS; [Fairphone 4][10] is another smartphone that has modular hardware. You can replace its battery effortlessly. Moreover, not just the battery, you can also replace its display, etc., just with a screwdriver.  
Fairphone is another Linux phone which comes with modular hardware. It supports PostmarketOS and uses a modified version of Android: FairPhone OS. The primary selling point of this device is its modularity, where you can replace any part of the mobile phone. That includes the display, battery and other components of this device.
#### Specifications
| Specification | Description |
| :- | :- |
| **CPU** | Octa-Core Kryo 570 |
| **RAM** | Two variants: 6GB and 8GB |
| **Storage** | Two variants: 128GB or 256GB |
| **GPU** | Adreno 619 |
| **Screen** | 6.3 inch Full HD+ IPS |
| **Camera** | Dual 48MP (Rear) and 25MP (Front) |
| **Battery** | 3905 mAh Li-ion |
| **Chipset** | Qualcomm SM7225 Snapdragon 750G |
[FairPhone buying options][11]
#### Are there any mainstream Android phones that support Linux OS?
If you dont want to buy an off-the-shelf mobile phone as listed above, then you can continue using Linux mobile OS in older branded phones because Android is a modified Linux Kernel-based. Hence these devices should work with Ubuntu Touch or PostmarketOS.
- Google Pixel 3a/3a XL
- Sony Xperia X (F5121 & F5122)
- Google Nexus 5
- OnePlus One
- Supported by Ubuntu Touch OS ([full list][12])
- Xiaomi Redmi 2
- Xiaomi Mi Note 2
- OnePlus GT
- OnePlus 6
- Supported by PostmarketOS ([full list][13])
### Closing notes
So, thats about the best Linux phones available in the market today and will continue in 2023. You can learn more about the above devices from the official website. However, I believe there will be more adoption of Linux phones in the coming days as Privacy becomes a myth every day.
Its true that to compete with Android and iOS, the device or OS is not sufficient. What is important is the standard, global availability for buying, low entry-level pricing in emerging markets and investment in the app ecosystem. A streamlined vision is required in the phone ecosystem to win. Without it, Linux phones will become more fragmented, as in desktops. The device makers and major FOSS players need to work together to make it successful.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/best-linux-phones/
作者:[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/12/Librem-5-image2.jpg
[2]: https://puri.sm/products/librem-5/
[3]: https://www.debugpoint.com/wp-content/uploads/2022/12/Pinephone.jpg
[4]: https://pine64.com/product-category/pinephone
[5]: https://www.fxtec.com/pro1x
[6]: https://www.debugpoint.com/wp-content/uploads/2022/12/Pro-1-X.jpg
[7]: https://volla.online/de/index.html
[8]: https://www.debugpoint.com/wp-content/uploads/2022/12/Volla-Phone.jpg
[9]: https://volla.online/de/shop/
[10]: https://shop.fairphone.com/en/buy-fairphone-4
[11]: https://shop.fairphone.com/
[12]: https://devices.ubuntu-touch.io/
[13]: https://wiki.postmarketos.org/wiki/Devices

View File

@ -0,0 +1,257 @@
[#]: subject: "Battle of the Texts and the Unicode Savior"
[#]: via: "https://itsfoss.com/unicode-linux/"
[#]: author: "Sylvain Leroux https://www.yesik.it/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Battle of the Texts and the Unicode Savior
======
We all know how to type text on the keyboard. Dont we?
So, may I challenge you to type that text in your favorite text editor:
![«Ayumi moved to Tokyo in 1993 to pursue her career» said Dmitrii][1]
This text is challenging to type since it contains:
- typographical signs not directly available on the keyboard,
- hiragana Japanese characters,
- the name of the Japanese capital written with a macron on top of the two letters “o” to comply with the Hepburn romanization standard,
- and finally, the first name Dmitrii written using the Cyrillic alphabet.
No doubt, writing such a sentence on early computers would have been simply impossible. Because computers used limited character sets, unable to let coexist several writing systems. But today such limitations are lifted as we will see in this article.
### How do computers store text?
Computers stores characters as numbers. And they use tables to map those numbers to the glyph used to represent them.
For a long time, computers stored each character as a number between 0 and 255 (which fits exactly one byte). But that was far from being sufficient to represent the whole set of characters used in human writing. So, the trick was to use a different correspondence table depending on where in the world you lived.
Here is the [ISO 8859-15][2] correspondence table commonly used in France:
![The ISO 8859-15 encoding][3]
But if you lived in Russia, your computer would have probably used the [KOI8-R][4] or [Windows-1251][5] encoding instead. Lets assume that later was used:
![The Windows-1251 encoding is a popular choice to store text written using the Cyrillic alphabets][6]
For numbers lower than 128, the two tables are identical. This range is corresponding to the [US-ASCII][7] standard, some kind of minimum-compatible set between characters tables. But beyond 128, the two tables are completely different.
For example, according to Windows-1251, the string _“said Дмитрий”_ is stored as:
```
115 97 105 100 32 196 236 232 242 240 232 233
```
To follow a common practice in computer sciences, those twelve numbers can be rewritten using the more compact hexadecimal notation:
```
73 61 69 64 20 c4 ec e8 f2 f0 e8 e9
```
If Dmitrii sends me that file, and I open it I might end up seeing that:
```
said Äìèòðèé
```
The file _appears_ to be corrupted. But it isnt. The data— that is the _numbers_stored in that file dont have changed. As I live in France, my computer has _assumed_ the file to be encoded as ISO8859-15. And it displayed the characters _of that table_ corresponding to the data. And not the character of the encoding table used when the text was originally written.
To give you an example, take the character Д. It has the numeric code 196 (c4) according to Windows-1251. The only thing stored in the file is the number 196. But that same number corresponds to Ä according to ISO8859-15. So my computer wrongly believed it was the glyph intended to be displayed.
![When the same text file is written then read again but using a different encoding][8]
As a side note, you can still occasionally see an illustration of those issues on ill-configured websites or in email send by [mail user agents][9] making false assumptions about the character encoding used on the recipients computer. Such glitches are sometimes nicknamed [mojibake][10]. Hopefully, this is less and less frequent today.
![Example of Mojibake on the website of a French movie distributor. The website name has been changed to preserve the innocent.][11]
### Unicode comes to save to the day
I explained encoding issues when exchanging files between different countries. But things were even worst since the encodings used by different manufacturers for the same country were not always the same. You can understand what I mean if you had to exchange files between Mac and PC in the 80s.
Is it a coincidence or not, the [Unicode][12] project started in 1987, led by people of Xerox and … Apple.
The goal of the project was to define a universal character set allowing to _simultaneously_ use any character used in human writing within the same text. The original Unicode project was limited to 65536 different characters (each character being represented using 16 bits— that is two bytes per character). A number that has proven to be insufficient.
So, in 1996 Unicode has been extended to support up to 1 million different [code points][13]. Roughly speaking, a “code point” a number that identifies an entry in the Unicode character table. And one core job of the Unicode project is to make an inventory of all letters, symbols, punctuation marks and other characters that are (or were) used worldwide, and to assign to each of them a code point that will uniquely identify that character.
This is a huge project: to give you some idea, the version 10 of Unicode, published in 2017, defines over 136,000 characters covering 139 modern and historic scripts.
With such a large number of possibilities, a basic encoding would require 32 bits (that is 4 bytes) per character. But for text using mainly the characters in the US-ASCII range, 4 bytes per character means 4 times more storage required to save the data and 4 times more bandwidth to transmit them.
![Encoding text as UTF-32 requires 4 bytes per character][14]
So besides the [UTF-32][15] encoding, the Unicode consortium defined the more space-efficient [UTF-16][16] and [UTF-8][17] encodings, using respectively 16 and 8 bits. But how to store over 100,000 different values in only 8 bits? Well, you cant. But the trick is to use one code value (8 bits in UTF-8, 16 in UTF-16) to store the most frequently used characters. And to use several code values for the least commonly used characters. So UTF-8 and UTF-16 are _variable length_ encoding. Even if this has drawbacks, UTF-8 is a good compromise between space and time efficiency. Not mentioning being backward compatible with most 1-byte pre-Unicode encoding, since UTF-8 was specifically designed so any valid US-ASCII file is also a valid UTF-8 file. In a sense, UTF-8 is a superset of US-ASCII. And today, there is no reason for not using the UTF-8 encoding. Unless of course if you write mostly with languages requiring multi-byte encodings or if you have to deal with legacy systems.
I let you compare the UTF-16 and UTF-8 encoding of the same string on the illustrations below. Pay special attention to the UTF-8 encoding using one byte to store the characters of the Latin alphabet. But using two bytes to store characters of the Cyrillic alphabet. That is twice more space than when storing the same characters using the Windows-1251 Cyrillic encoding.
![UTF-16 is a variable length encoding requiring 2 bytes to encode most characters. Some character still requires 4 bytes though (for example][18]
![UTF-8 is a variable length encoding requiring 1, 2, 3 or 4 bytes per character][19]
### And how does that help for typing text?
Well… It doesnt hurt to have some knowledge of the underlying mechanism to understand the capabilities and limitations of your computer. Especially we will talk about Unicode and hexadecimal a little later. But for now… a little bit more history. Just a little bit, I promise…
… just enough to say starting in the 80s, computer keyboard used to have a [compose key][20] (sometimes labeled the “multi” key) next to the shift key. By pressing that key, you entered in “compose” mode. And once in that mode, you were able to enter characters not directly available on your keyboard by entering mnemonics instead. For example, in compose mode, typing RO produced the ® character (which is easy to remember as an R inside an O).
![compose key on lk201 keyboard][21]
It is now a rarity to see the compose key on modern keyboards. Probably because of the domination of PCs that dont make use of it. But on Linux (and possibly on other systems?) you can emulate the compose key. This is something that can be configured in the GUI on many desktop environments using the “keyboard” control panel: But the exact procedure varies depending on your desktop environment or even depending its version. If you changed that setting, dont hesitate to use the comment section to share the specific steps youve followed on your computer.
As for myself, for now, I will assume you use the default Shift+AltGr combination to emulate the compose key.
So, as a practical example, to enter the LEFT-POINTING DOUBLE ANGLE QUOTATION MARK, you can type Shift+AltGr<< (you dont have to maintain Shift+AltGr pressed when entering the mnemonic). If you managed to do that, I think you should be able to guess by yourself how to enter the _RIGHT-POINTING_ DOUBLE ANGLE QUOTATION MARK.
As another example, try Shift+AltGr--- to produce an EM DASH. For that to work, you have to press the [hyphen-minus][22] key on the main keyboard, not the one you will find on your numeric keypad.
Worth mentioning the “compose” key works in a non-GUI environment too. But depending if you use you use X11 or a text-only console, the supported compose key sequence are not the same.
On the console, you can check the list of supported compose key by using the `dumpkeys` command:
```
dumpkeys --compose-only
```
On the GUI, compose key is implemented at Gtk/X11 level. For a list of all mnemonics supported by the Gtk, take a look at that page: [https://help.ubuntu.com/community/GtkComposeTable][23]
### Is there a way to avoid relying on Gtk for character composition?
Maybe Im a purist, but I found somewhat unfortunate the compose key support being hard-coded in Gtk. After all, not all GUI applications are using that library. And I cannot add my own mnemonics without re-compiling the Gtk.
Hopefully, there is support for character composition at X11-level too. Formerly, through the venerable [X Input Method (XIM)][24].
This will work at lower-level than Gtk-based character composition. But will allow a great amount of flexibility. And will work with many X11 applications.
For example, lets imagine I just want to add the --> composition to enter the → character (U+2192 RIGHTWARDS ARROW), I would create a `~/.XCompose` file containing those lines:
```
cat > ~/.XCompose << EOT
# Load default compose table for the current local
include "%L"
# Custom definitions
<Multi_key> <minus> <minus> <greater> : U2192 # RIGHTWARDS ARROW
EOT
```
Then you can test by starting a new X11 application, forcing libraries to use XIM as input method:
```
GTK_IM_MODULE="xim" QT_IM_MODULE="xim" xterm
```
The new compose sequence should be available in the application you launched. I encourage you to learn more about the compose file format by typing `man 5 compose`.
To make XIM the default input method for all your applications, just add to your `~/.profile` file the following two lines. that change will be effective the next time youll open a session on your computer:
```
export GTK_IM_MODULE="xim"
export QT_IM_MODULE="xim"
```
Its pretty cool, isnt it? That way you can add all the compose sequences you might want. And there are already a couple of funny ones in the default XIM settings. Try for example to press composeLLAP.
Well, I must mention two drawbacks though. XIM is relatively old and is probably only suitable for those of us who dont regularly need multi-bytes input methods. Second, when using XIM as your input method, you no longer can enter Unicode characters by their code point using the Ctrl+Shift+u sequence. What? Wait a minute? I didnt talk about that yet? So lets do it now:
### What if there is no compose key sequence for the character I need?
The compose key is a nice tool to type some characters not available on the keyboard. But the default set of combinations is limited, and switching to XIM and defining a new compose sequence for a character you will need only once in a lifetime can be cumbersome.
Does that prevent you to mix Japanese, Latin and Cyrillic characters in the same text? Certainly not, thanks to Unicode. For example, the name あゆみ is made of:
- the [HIRAGANA LETTER A (U+3042)][25]
- the [HIRAGANA LETTER YU (U+3086)][26]
- and the [HIRAGANA LETTER MI (U+307F)][27]
I mentioned above the official Unicode character names, following the convention to write them in all upper cases. After their name, you will find their Unicode code point, written between parenthesis, as a 16-bit hexadecimal number. Does that remind you something?
Anyway, once you know the code point of a character, you can enter it using the following combination:
- Ctrl+Shift+u, then XXXX (the _hexadecimal_ code point of the character you want) and finally Enter.
As a shorthand, if you dont release Ctrl+Shift while entering the code point, you wont have to press Enter.
Unfortunately, that feature is implemented at software library level rather than at X11 level. So the support may be variable among different applications. In LibreOffice, for example, you have to type the code point using the main keyboard. Whereas Gtk-based application will accept entry from the numeric keypad as well.
Finally, when working at the console on my Debian system, there is a similar feature, but requiring instead to press Alt+XXXXX where XXXXX is the code point of the character you want, but written in _decimal_ this time. I wonder if this is Debian-specific or related to the fact Im using the en_US.UTF-8 locale. If you have more information about that, I would be curious to read you in the comment section!
| GUI | Console | Character |
| :- | :- | :- |
| Ctrl+Shift+u3042Enter | Alt+12354 | あ |
| Ctrl+Shift+u3086Enter | Alt+12422 | ゆ |
| Ctrl+Shift+u307FEnter | Alt+12415 | み |
### Dead keys
Last but not least, there is a simpler method to enter key combinations that do not rely (necessarily) on the compose key.
Some keys on your keyboard were specifically designed to create a combination of characters. Those are called [dead keys][28]. Because when you press them once, nothing seems to happen. But they will silently modify the character produced by the next key you will press. This is a behavior inspired from mechanical typewriter: with them, pressing a dead key imprinted a character, but will not move the carriage. So the next keystroke will imprint another character at the same position. Visually resulting in a combination of the two pressed keys.
We use that a lot in French. For example, to enter the letter “ë” I have to press the ¨ dead key followed by the e key. Similarly, Spanish people have the ~ dead key on their keyboard. And on the keyboard layout for Nordic languages, you can find the ° key. And I could continue that list for a very long time.
![hungary dead keys][29]
Obviously, not all dead keys are available on all keyboard. I fact, most dead keys are NOT available on your keyboard. For example, I assume very few of you— if any— have a dead key ­­­¯ to enter the macron (“flat accent”) used to write Tōkyō.
For those dead keys that are not directly available on your keyboard, you need to resort to other solutions. The good news is weve already used those techniques. But this time we will use them to emulate dead keys. Not “ordinary” keys.
So, a first option could be to generate the macron dead key by using Compose- (the hyphen-minus key available on your keyboard). Nothing appears. But if after that you press the o key it will finally produce “ō”.
The list of dead keys that Gtk can produce using the compose mode can be found [here][30].
A different solution would use the Unicode COMBINING MACRON (U+0304) character. Followed by the letter o. I will leave the details up to you. But if youre curious, you may discover this leads to a very subtlely different result, rather than really producing a LATIN SMALL LETTER O WITH MACRON. And if I wrote the end of the previous sentence in all uppercase, this is a hint guiding you toward a method to enter ō with fewer keystrokes than by using a Unicode combining character… But I let that to your sagacity.
### Your turn to practice!
So, did you get it all? Does that work on your computer? Its your turn to try that: using the clues given above, and a little bit of practice, now you can enter the text of the challenge given in the beginning of this article. Do it, then copy-paste your text in the comment section below as proof of your success.
There is nothing to win, except maybe the satisfaction of impressing your peers!
--------------------------------------------------------------------------------
via: https://itsfoss.com/unicode-linux/
作者:[Sylvain Leroux][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.yesik.it/
[b]: https://github.com/lkxed
[1]: https://itsfoss.com/wp-content/uploads/2017/10//text-challenge.png
[2]: https://en.wikipedia.org/wiki/ISO/IEC_8859-15
[3]: https://itsfoss.com/wp-content/uploads/2017/10//ISO_8859-15.png
[4]: https://en.wikipedia.org/wiki/KOI8-R
[5]: https://en.wikipedia.org/wiki/Windows-1251
[6]: https://itsfoss.com/wp-content/uploads/2017/10//Windows-1251.png
[7]: https://en.wikipedia.org/wiki/ASCII
[8]: https://itsfoss.com/wp-content/uploads/2017/10//windows-1251-to-iso8859-15-encoding-decoding-error-example.png
[9]: https://en.wikipedia.org/wiki/Email_client
[10]: https://en.wikipedia.org/wiki/Mojibake
[11]: https://itsfoss.com/wp-content/uploads/2017/10/Mojibake-french-example.png
[12]: https://en.wikipedia.org/wiki/Unicode
[13]: https://en.wikipedia.org/wiki/Code_point
[14]: https://itsfoss.com/wp-content/uploads/2017/10//unicode-utf-32-encoding-example.png
[15]: https://en.wikipedia.org/wiki/UTF-32
[16]: https://en.wikipedia.org/wiki/UTF-16
[17]: https://en.wikipedia.org/wiki/UTF-8
[18]: https://itsfoss.com/wp-content/uploads/2017/10//unicode-utf-16-encoding-example.png
[19]: https://itsfoss.com/wp-content/uploads/2017/10//unicode-utf-8-encoding-example.png
[20]: https://en.wikipedia.org/wiki/Compose_key
[21]: https://itsfoss.com/wp-content/uploads/2022/12/compose_key_on_lk201_keyboard.jpg
[22]: https://en.wikipedia.org/wiki/Hyphen-minus
[23]: https://help.ubuntu.com/community/GtkComposeTable
[24]: https://en.wikipedia.org/wiki/X_Input_Method
[25]: http://www.fileformat.info/info/unicode/char/3042/index.htm
[26]: http://www.fileformat.info/info/unicode/char/3086/index.htm
[27]: http://www.fileformat.info/info/unicode/char/307F/index.htm
[28]: https://en.wikipedia.org/wiki/Dead_key
[29]: https://itsfoss.com/wp-content/uploads/2022/12/hungary_dead_keys.png
[30]: https://help.ubuntu.com/community/GtkDeadKeyTable

View File

@ -0,0 +1,104 @@
[#]: subject: "Linux Mint Upgrade Tool: Usage Guide"
[#]: via: "https://www.debugpoint.com/mint-upgrade-tool/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Linux Mint Upgrade Tool: Usage Guide
======
**Heres how you can upgrade to new Linux Mint versions using the Mint upgrade tool, i.e. mintupgrade GUI with actual upgrade process screenshots.**
If you are looking for **detailed upgrade** steps to the recently released **Linux Mint 21 Vanessa**, read this guide 👉 [upgrade-linux-mint-21-from-20-3][1]
### Linux Mint Upgrade Tool
The Linux Mint team [announced][2] a few months back, that they built a new utility to upgrade the Linux Mints significant versions. Its called the “mintupgrade2”. Development is complete, and It is currently under the support and planning for upgrading to the major versions—for example, Linux Mint 20 to 21 and not the minor version upgrades.
Although you can upgrade the versions using the standard apt commands, the Mint team believes significant version upgrades are tricky. It would be difficult for the new users to perform a seamless upgrade because it involves the terminal and a set of complex steps with commands.
Moreover, the GUI is a wrapper with additional features to the mintupgrade program, which brings a set of pre-system checks and upgrade processes with a one-click Fix.
In addition, the mintupgrade checks basic checks, whether you are connected to power, the system is up to date, disk space availability and many more features.
To show you how it looks and works, we set up a testbed with LMDE 4 and give it a go.
But before that, heres a quick set of features:
- Entirely GUI-driven upgrade process
- Multi-language support
- Pre-upgrade checks: system backup, power, disk space, list of removed packages
- Configurable
- Alert you about the orphaned packages from the prior version
- It gives you the option to fix issues
### How it works
When we ran the mint upgrade utility via the command `mintupgrade`, the GUI, the friendly welcome screen gives you an excellent starting point and starts the upgrade process. And then, it begins with a series of checks on its own.
![Starting the upgrade process][3]
In addition to that, when it finds some problem in your system, it stops and gives you sufficient details about it. Once you click on Fix, it can resume the process again.
Thats not all; it can resume the upgrade process if interrupted due to network or internet or any other problem.
The utility found the following errors in our test system during our test and fixed them with just one click.
![Apt Cache check][4]
![Mint Upgrade detects that system snapshots not present][5]
![Check for Orphan Packages][6]
![Status before upgrade][7]
![Mint Upgrade can detect the packages require downgrade][8]
Lastly, we successfully upgraded a test system from LMDE 4 to LMDE 5.
![Upgrade Complete][9]
#### How to get this upgrade utility
The installation of the utility is easy using the commands below. However, if you are running the latest version of Linux Mint 21, it should already be installed and try by running mintupgrade from the terminal.
```
sudo apt update
```
```
sudo apt install mintupgrade
```
### Closing Notes
Finally, I think its one of the best utilities by the Linux Mint team. As you can see above, it handled many errors on its own. All I did was click the “Fix” button. And the utility is smart enough to understand all the failure points and take care of the remediations.
[GitHub and source code of mintupgrade][10]
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/mint-upgrade-tool/
作者:[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/upgrade-linux-mint-21-from-20-3/
[2]: https://www.debugpoint.com/2022/04/linux-mint-21-announcement/
[3]: https://www.debugpoint.com/wp-content/uploads/2022/04/Starting-the-upgrade-process.jpg
[4]: https://www.debugpoint.com/wp-content/uploads/2022/04/Apt-Cache-check.jpg
[5]: https://www.debugpoint.com/wp-content/uploads/2022/04/Mint-Upgrade-detects-that-system-snapshots-not-present.jpg
[6]: https://www.debugpoint.com/wp-content/uploads/2022/04/Check-for-Orphan-Packages.jpg
[7]: https://www.debugpoint.com/wp-content/uploads/2022/04/Status-before-upgrade.jpg
[8]: https://www.debugpoint.com/wp-content/uploads/2022/04/Mint-Upgrade-can-detect-the-packages-require-downgrade.jpg
[9]: https://www.debugpoint.com/wp-content/uploads/2022/04/Upgrade-Complete.jpg
[10]: https://github.com/linuxmint/mintupgrade

View File

@ -0,0 +1,300 @@
[#]: subject: "Use Django to send emails with SMTP"
[#]: via: "https://opensource.com/article/22/12/django-send-emails-smtp"
[#]: author: "Sofiia Tarhonska https://opensource.com/users/sofiiatarhonska"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Use Django to send emails with SMTP
======
Numerous professions utilize simple mail transfer protocol (SMTP) to deliver emails to their end users. SMTP also retrieves messages, though that has not been its primary use case. Open source frameworks like Django, a Python-based web framework, allows more control for sending emails using functions and expressions.
This article shows how to configure an SMTP server and send emails in Django using SMTP.
### Project setup and overview
Before proceeding, this tutorial requires a code editor (such as [VS Code or Codium][1]) on your preferred device.
Start by creating a new directory using the command in the terminal:
```
mkdir exampledirectory
```
Then change into the directory using the command:
```
cd exampledirectory
```
Within the newly created directory, create a [virtual environment][2] using the built-in venv module in the command terminal:
```
python -m venv
```
This command creates a virtual environment within the folder created earlier. To activate it, use the following command in the terminal:
On Linux and Mac:
```
source .virtenv/bin/activate
```
On Windows:
```
\Scripts\activate
```
### Creating a Django project
After activating the virtual environment, proceed to install the Django package from [pip][3]:
```
pip install django
```
Create a new Django project:
```
python -m django startproject NewEmailProject
```
This command creates a project with the name `NewEmailProject`. To run the project, head to the project directory (`NewEmailProject`) and run the server:
```
python manage.py runserver
```
Open the link for the developmental server in a browser. You see the Django homepage with release notes.
### Configuration for sending emails
Next, open the `settings.py` file (in the `NewEmailProject` folder) to customize configurations for sending emails using Django.
Scroll to the end of the code and update the file with the following code:
```
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.yourserver.com'
EMAIL_USE_TLS = False
EMAIL_PORT = 465
EMAIL_USE_SSL = True
EMAIL_HOST_USER = 'your@djangoapp.com'
EMAIL_HOST_PASSWORD = 'your password'
```
Change the value of the `EMAIL_HOST` depending on your email client. Here are the acceptable values for common email clients:
- **Gmail:**`smtp.gmail.com`
- **Outlook:**`smtp-mail.outlook.com`
- **Yahoo:**`smtp.mail.yahoo.com`
You can change the `EMAIL_PORT` or leave 465 as the default.
You can use the secure socket layer (SSL) and transport socket layer (TSL) interchangeably as they specify connection security.
To figure out other custom configurations for your email server, check out the full [Django Project documentation][4].
### SMTP email backend
The `EMAIL_BACKEND` expression helps determine the most suitable backend when sending emails through the Django SMTP server. This variable points to `smtp.EmailBackend`, which receives all the parameters needed for sending emails. It tells Django to send the email to the recipient email using SMTP and not to the console.
### Sending emails with SMTP
When the environment is set up and `settings.py` is updated, you can send emails in Django. You can use an HTML form that sends a post request of the necessary information needed for sending an email.
Create a Django application for sending emails:
```
python manage.py startapp mail
```
Next, open the `settings.py` file and add the Django application (mail) to the `INSTALLED_APPS` list:
```
INSTALLED_APPS = [
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"mail"]
```
### Send mail function
In the mail application's `views.py` file, start by importing the `EmailMessage` and `get_connection` from `django.core.mail`:
```
from django.core.mail import EmailMessage, get_connection
```
The `EmailMessage` class is responsible for creating the email message itself. The `get_connection()` function returns an instance of the email backend specified in `EMAIL_BACKEND`.
Now create a function that accepts a `POST` request, which contains form data submitted from the client side. Followed by the `get_connection()` functions parameters containing the email configurations created in the project `settings.py` file.
Next, import the settings:
```
from django.conf import settings
```
This import allows access to the email configurations created in the `settings.py`. Next, create the variables:
```
subject, recipient_list,
```
Then you can `message`, and store the corresponding attributes used in the HTML form. The `email_from` variable contains the sender email, which is obtained from `EMAIL_HOST_USER` in the `settings.py` file.
After the variables are processed, the `EmailMessage` class sends an email using the `sends()` method, and then closes the connection. The `send_email()` function renders the `home.html` file containing the email form.
You can create a templates folder within your mail application and store the HTML files within that folder:
```
from django.core.mail import EmailMessage, get_connectionfrom django.conf import settingsdef send_email(request):  
   if request.method == "POST":
       with get_connection(  
           host=settings.EMAIL_HOST,
     port=settings.EMAIL_PORT,  
     username=settings.EMAIL_HOST_USER,
     password=settings.EMAIL_HOST_PASSWORD,
     use_tls=settings.EMAIL_USE_TLS  
       ) as connection:  
           subject = request.POST.get("subject")  
           email_from = settings.EMAIL_HOST_USER  
           recipient_list = [request.POST.get("email"), ]  
           message = request.POST.get("message")  
           EmailMessage(subject, message, email_from, recipient_list, connection=connection).send()  
 
   return render(request, 'home.html')
```
This is a bootstrap form for generating a message:
```
<form method="post" action=".">
 {% csrf_token %}
 <div class="mb-3">
     <label for="exampleFormControlInput1" class="form-label">Receipt email address</label>
     <input type="text" class="form-control" name="email" id="exampleFormControlInput1" placeholder="Receipt email address">
   </div>
   <div class="mb-3">
     <label for="exampleInputSubject" class="form-label">Subject</label>
     <input type="text" class="form-control" name="subject" id="exampleInputSubject">
   </div>
   <div class="mb-3">
     <label for="exampleFormControlTextarea1" class="form-label">Message</label>
     <textarea class="form-control" id="exampleFormControlTextarea1" name="message" rows="3"></textarea>
   </div>
   <button type="submit" class="btn btn-primary">Send</button>
 </form>
```
This form sends a post request to the `send_email()` function. This processes the form data and sends the email to the recipients.
Now open the `urls.py` file in the `NewEmailProject` folder to create the homepage URL. Update the `urlpattern` list by adding the code `path("", send_email)` .
### Sending email to multiple recipients
To specify multiple recipients when sending the same email, create a new function called `send_emails` within the `views.py` file and modify the send function code:
```
def send_emails(request):  
    if request.method == "POST":
        with get_connection(  
              host=settings.EMAIL_HOST,
        port=settings.EMAIL_PORT,  
       username=settings.EMAIL_HOST_USER,  
       password=settings.EMAIL_HOST_PASSWORD,  
        use_tls=settings.EMAIL_USE_TLS
        ) as connection:  
            recipient_list = request.POST.get("email").split()  
            subject = request.POST.get("subject")  
            email_from = settings.EMAIL_HOST_USER  
            message = request.POST.get("message")  
            print(type(recipient_list))
            EmailMessage(subject, message, email_from, recipient_list, connection=connection).send()  
 
    return render(request, 'send_emails.html')
```
For the `recipient_list` variable, I'm using the Python `split()` method to convert the recipients email string to list so that I can email all of them.
Next, create another HTML file called `send_emails.html` in the templates folder and use the same form code for the `home.html` file within it.
To specify multiple email recipients, use a space between each email address:
```
first@gmail.com second@gmail.com third@gmail.com
```
You should also update the `urlpattern` list by adding the code:
```
path("send-emails/", send_email)
```
### Sending HTML emails
You can also send HTML emails with Django using a slightly modified version of the `send_email` function:
```
html_message = '''<h1>this is an automated message</h1>'''
msg = EmailMessage(subject, html_message, email_from,recipient_list, connection=connection)
msg.content_subtype = "html"
msg.send()
```
### Sending emails with attachment
To include attachment to mails, create a variable and put it in the file path in a string like this:
```
attachment = "mail/templates/example.png"
```
Then, move the `EmailMessage` function to a variable and call the `attach_file` method followed by the `send` method:
```
msg = EmailMessage(subject, message, email_from, recipient_list, connection=connection)
msg.attach_file(attachment)
msg.send()
```
### Django email libraries
This guide on sending emails in Django would not be complete if I didn't mention the email libraries that are available to users. Here are some noteworthy email libraries.
- **Django mailer** is a Django app for queuing as it saves emails in a database and sends the mail out at a designated time.
- **Django templated email** aims to send templated emails. It offers features like configurable template naming and location, template inheritance, and adding recipients to the CC and BCC lists.
- **Anymail** allows the use of an email service provider (ESP). By using `django.core.mail`, it provides a sustained API that avoids tying your code to a single ESP.
### Emailing with Django
Sending emails in Django can sound daunting, but it's as simple as creating a virtual environment. You can add Django to the environment and create an email backend. Finally, you can set up an HTML template. Give it a try.
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/12/django-send-emails-smtp
作者:[Sofiia Tarhonska][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/sofiiatarhonska
[b]: https://github.com/lkxed
[1]: https://opensource.com/article/20/6/open-source-alternatives-vs-code#vscodium
[2]: https://opensource.com/article/21/2/python-virtualenvwrapper
[3]: https://www.redhat.com/sysadmin/install-python-pip-linux
[4]: https://docs.djangoproject.com/en/3.2/ref/settings/#email-backend

View File

@ -0,0 +1,79 @@
[#]: subject: "Drupal 10 is worth a fresh look"
[#]: via: "https://opensource.com/article/22/12/drupal-10-fresh-look"
[#]: author: "Martin Anderson-Clutz https://opensource.com/users/mandclu"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Drupal 10 is worth a fresh look
======
The popular Drupal open source content management system (CMS) reaches a significant milestone when version 10 is released on December 14. Personally, I think Drupal X sounds way cooler, but so far, my calls to name it that haven't gotten much traction. I enlisted the help of my friend Aaron Judd of [Northern Commerce][1] to give us a sense of how cool Drupal X could look:
![New Drupal 10 racing 10 logo][2]
### What's a Drupal, anyway?
Drupal is an open source CMS and development framework. While other CMS options focus on simple long-form content (think blogs) or entirely free-form content (like in Wix or Squarespace), Drupal has made a name for itself in handling more complex content architectures, in multiple languages, with robust content governance. Drupal sites (like this site, Opensource.com!) benefit from a strong role-based access control (RBAC) system, unlimited custom roles and workflows, and a powerful and extensible media library.
Here's a rundown for anyone who hasn't kept tabs on what's coming in the newest major version.
### A fresh face
Most Drupal sites use custom themes to give them a unique look and feel. Still, the initial experience you have when installing a CMS matters. In Drupal, themes define the look and feel of a site, and you can use different themes for public and administrative experiences. Until recently, the Bartik and Seven themes had been the default face of Drupal for more than a decade. To put that in context, when Bartik was released, the most popular browser in the world was Internet Explorer 8. A lot has changed since then, particularly around best practices for building websites.
In fact, a significant change in Drupal 10 will be the removal of support for Internet Explorer (IE), which is itself no longer supported by Microsoft and hasn't seen major updates since 2013. That may not sound like an improvement, but continued support for IE kept the community from adopting modern markup and styling. For example, thanks to being unencumbered by support for legacy browsers, Drupal 10 includes a new responsive grid layout that's so innovative it got a writeup in [CSS Tricks][3].
![Responsive grid configuration][4]
The new faces of Drupal are two brand new themes: Olivero for visitors and Claro for admins. In addition to being fresh and modern designs, both were developed with accessibility as a top priority.
### Improvements under the hood
More than a decade ago, the Drupal community decided to "Get Off the Drupal Island." That meant adopting solutions shared across popular projects and frameworks instead of ones developed and maintained exclusively by the Drupal community. Today Drupal leverages a variety of projects and libraries whose names will be familiar to open source developers who have never touched Drupal: Symfony, Composer, CKEditor, Twig, Nightwatch, and more.
That has brought a variety of powerful capabilities to Drupal and allowed it to contribute back to those solutions, benefitting a broader set of developers. It has also become a determining factor for the cadence of Drupal's major version releases.
To illustrate, consider that Drupal 7 was released in early 2011. Drupal 8 was released almost five years later, towards the end of 2015. Drupal 9 was released in June of 2020, with a key motivator being the move to supported versions of underlying dependencies and removing deprecated code. And now, roughly two and half years later, we're already planning to release Drupal 10. This new major version will leverage updated versions of PHP, Symfony, and Composer, among others.
### An all-new editor
An upgrade of particular note is the move to CKEditor 5. Although notionally an incremental update, under the hood CKEditor 5 was completely rewritten, much the same as the transition from Drupal 7 to 8. In addition to a sleeker interface, CKEditor 5 has the potential for exciting new capabilities, such as real-time collaboration. Drupal's CKEditor integration for version 5 has already been augmented with a number of UI enhancements. For example, media placed within content can be configured using an overlaid toolbar ribbon instead of needing to launch a modal dialog to access these settings. Also, the styles dropdown now includes a preview of each type available.
![Real-time collaboration][5]
### A look ahead
Earlier in 2022, Drupal creator and project lead Dries Buytaert announced a focus on "ambitious site builders." This means that while the community will continue to work on making the developer experience better in general, moving forward there is a particular focus on making it easier to create engaging experiences in Drupal without having to write code or use command-line tools. Three strategic initiatives embody this new focus: Automatic Updates, the Project Browser, and Recipes.
**Automatic Updates** will reduce the total cost of ownership for Drupal sites and help them be more secure by ensuring they always have the latest core security patches. This will be a major benefit for site owners and Drupal development teams everywhere. However, judging by personal experience, Wednesday night pizza sales may take a hit (traditionally, the Drupal security team releases updates on the third Wednesday of the month). There is now a stable release of Automatic Updates as a contrib module. Work has begun to move this into Drupal core, so all Drupal sites will eventually be able to leverage this capability.
The **[Project Browser][6]** makes Drupal sites easier to build, maintain, and evolve by allowing site builders to search and browse through a subset of Drupal's vast catalog of available modules, prefiltered to the site's Drupal version, for security, stability, and more. A site builder can select, download, and install a module without leaving the site's web interface. In fact, there's an "app store" like interface meant to promote the most popular modules available that are compatible with the current site's version of Drupal. While other CMS options have had similar offerings, this advancement means you don't need to sacrifice ease-of-use to take advantage of the power of Drupal. Also, all of the thousands of modules listed are 100% free.
For many years Drupal has had a concept of distributions. These are opinionated versions of Drupal designed to meet specific use cases such as media publishing, fundraising, intranet portals, and more. While distributions have proven an excellent way to accelerate initial development, in practice, they have been known to require significant work to maintain and create extra work for site owners during maintenance. The **Recipes** initiative aims to make more granular, composable functionality available when building a site. Want to add a staff directory, events calendar, or locations map to your site? In the future, this will be as easy as installing a recipe and then customizing it to meet your site's specific needs.
### It's an exciting time to try Drupal
Drupal 10 is the culmination of work contributed by thousands of dedicated and talented community members worldwide. If you're not already using Drupal, we hope you'll try it out for your next project. There's a common saying among Drupalists: "Come for the code, stay for the community."
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/12/drupal-10-fresh-look
作者:[Martin Anderson-Clutz][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/mandclu
[b]: https://github.com/lkxed
[1]: https://www.northern.co/
[2]: https://opensource.com/sites/default/files/2022-12/DrupalX-RacerSticker-DrupalBlue-300ppi.png
[3]: https://css-tricks.com/an-auto-filling-css-grid-with-max-columns
[4]: https://opensource.com/sites/default/files/2022-11/responsive-grid-config.png
[5]: https://opensource.com/sites/default/files/2022-11/realtime-collaboration_0.gif
[6]: https://www.drupal.org/project/project_browser

View File

@ -0,0 +1,96 @@
[#]: subject: "Try this Linux web browser as your file manager"
[#]: via: "https://opensource.com/article/22/12/linux-file-manager-konqueror"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Try this Linux web browser as your file manager
======
Konqueror is a file manager and web browser for the KDE Plasma Desktop. In many ways, Konqueror defined "network transparency," as it applied to a personal desktop. With Konqueror, you can browse remote network files (including the Internet itself, which really is just a collection of remote files viewed through a fancy lens) just as easily as browsing your local files. Sometimes there was some configuration and setup required, depending on what kind of file share you needed to access. But ultimately, the goal of having instant access to all the data you had permission to view was a reality with Konqueror in ways no other file manager had achieved. And at its peak, the open source web engine it developed (KHTML) was adopted by both Apple and Google, and lives on today as the core library of modern web browsing and, technically, Electron app development.
Today, the KDE Plasma Desktop lists Konqueror as a web browser. Officially, file management has shifted over to [Dolphin][1], but Konqueror is still capable of doing the job. For the full and classic Konqueror experience, you should try the Plasma Desktop 3.x fork [TDE][2], but in this article I use Konqueror in KDE Plasma Desktop version 5.
### Install Konqueror
If you're running KDE Plasma Desktop already, you may already have Konqueror installed. If not, you can install it from your distribution's software repository. On Fedora, CentOS, Mageia, OpenMandriva, and similar:
```
$ sudo dnf install -y konqueror konqueror-plugins
```
On Debian, Linux Mint, Elementary, and similar:
```
$ sudo apt install -y konqueror konqueror-plugins
```
![Image of Konqueror's file manager.][3]
### Configure Konqueror as a file manager
The most convenient feature of Konqueror is that it's a web browser in addition to being a file manager. Or at least, that's theoretically its most convenient feature. If you're not using Konqueror as a web browser, then you may not want the URL field or the search engine field at the top of every file manager window.
As with most KDE applications, Konqueror is highly configurable. You can reposition and add and remove toolbars, add or remove buttons, and so on.
To adjust what toolbars are displayed, launch Konqueror and go to the **Settings** menu and select **Toolbars Shown**. The **Main** toolbar is probably all you really need for file management. It's the toolbar with navigation buttons on it. However, you may not even need that, as long as you're happy to navigate with keyboard shortcuts or using the **Go** menu.
Keyboard navigation in Konqueror is the same as in Dolphin:
- **Alt+Left arrow**: Back one step
- **Alt+Up arrow**: Move to parent directory
- **Alt+Home**: Go to home directory
### Side panel
To get a side panel with a listing of common folders, press **F9** or select **Show Sidebar** from the **Settings** menu. This adds a button bar along the left side of the Konqueror window. Click the **Home** icon to display a file tree of your home directory.
![Image of Konqueror with a sidebar.][4]
As the button bar suggests, this side panel can serve many purposes. Instead of your home directory, you can display bookmarked locations, a history of recent locations you've visited, remote filesystems, and more.
### Applications
Some people are used to an application menu. It's efficient and quick, and always in the same place. Other people prefer to launch applications from the terminal.
There's yet another way to view application launchers, though. Konqueror's **Go** menu allows you go to a meta location called **Applications**, which lists application launchers, by category, as files in a file manager.
![Image of applications in Konqueror.][5]
You can see this in Dolphin, too, by manually typing **applications:** in the location field, but of the two it's Konqueror that provides a menu option to go there directly.
### Network folders
Similarly, Konqueror also provides a menu selection to go to network folders. The greatest network folder of them all is the Internet, but **Network Folders** is the meta location for network protocols other than HTTP. Most remote locations require some setup because they usually require authentication to access. Most of them can be configured through **System Settings**, including file systems accessible over Bluetooth, SMB or CIFS, MTP devices, Fish (file system over SSH), and even Google Drive.
### Split view
You can split the Konqueror window into panes, allowing you to see two folders at once without opening two windows. There are two split options: a vertical split with one pane on the left and the other on the right, or a horizontal split with one pane above the other.
To split the Konqueror window, go to the **Window** menu and select either **Split View Left/Right** or **Spit View Top/Bottom**. Each pane is independent of the other, so you can navigate around in one pane, and then drag and drop files from one to the other.
### Conquering your file system
Konqueror isn't _just_ a file manager, and I don't think the developers of the Plasma Desktop expect you to use it as your primary file manager. There's even an option in the **File** menu to open a location in **Dolphin**, which indicates that Konqueror is a web browser with a file manager component. But that file manager component is a nice feature to have when you need it. And if you're not a fan of all the features Dolphin offers, Konqueror could be a suitable alternative.
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/12/linux-file-manager-konqueror
作者:[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/12/linux-file-manager-dolphin
[2]: https://opensource.com/article/19/12/linux-trinity-desktop-environment-tde
[3]: https://opensource.com/sites/default/files/2022-10/konqueror-filemanager.png
[4]: https://opensource.com/sites/default/files/2022-10/konqueror-sidebar.png
[5]: https://opensource.com/sites/default/files/2022-10/konqueror-applications.png

View File

@ -0,0 +1,100 @@
[#]: subject: "Learn the OSI model in 5 minutes"
[#]: via: "https://opensource.com/article/22/10/osi-model-network-communications"
[#]: author: "Anamika https://opensource.com/users/anamika"
[#]: collector: "lkxed"
[#]: translator: "cool-summer-021"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
5 分钟内了解 OSI 模型
======
理解OSI框架的基本概念掌握计算机系统通信机制
开放系统互联OSI模型是一个定义计算机、服务器和用户如何在一个系统内通信的标准。它是第一个网络通信标准模型在20世纪80年代早期所有主流的计算机和通信公司都采用了这个标准。
OSI 模型提供了一种通用语言,用于描述网络,以及在离散的块或层中考虑相关的问题。
### OSI模型的各个层
该模型描述了计算机系统通过网络进行通信的七个层。
1. [应用层][2]
2. [表现层][3]
3. [会话层][4]
4. [传输层][5]
5. [网络层][6]
6. [数据链路层][7]
7. [物理层][8]
每个层都有自己的工作方式和一系列跟其他层不同的协议。本文将逐个剖析这些层级。
### 应用层
应用层是在软件中实现的。它是与应用程序交互的层级。
考虑发送消息的例子。发送消息的程序与应用层进行交互,并发送消息。接着,应用层向 OSI 模型的下一个层级(即表现层)发送消息。
### 表现层
来自应用层的数据被转发到表现层。表现层接收到文字、字符、字母、数字等形式的数据,并把它们转换为机器可识读的二进制格式数据。这个过程叫做编译。
在此阶段ASCII美国信息交换标准码 字符被转换为扩充的二进制编码的十进制交换码EBCDIC。转换后的数据在继续传输前也会进行编码和加密过程使用SSL协议进行加密和解密。
表现层的作用是抽象化,它假设下面的层级会处理它们收到的数据。它也负责压缩数据。数据的压缩可能是有损的,也有可能是无损的,这取决于很多因素,不属于本文的讨论范围。
### 会话层
会话层的作用是建立和管理连接。该层级的主要工作是建立会话。例如,你登录网上商城,就在你的机器和服务器之间建立了会话。
会话层的作用是实现数据的发送和接收,完成后连接的会话就终止了。在一个会话建立前,会进行身份验证。与上一层类似,会话层也假设在它的工作完成后,下面的层级也会准确无误地处理数据。
### 传输层
传输层的作用是管理数据传输和其自身的关于数据如何传输的一些协议。从会话层传到这里的数据被分为更小的数据单元,这些数据单元称为片段。这个过程叫做“分割”。每个片段包含来源端口号、目标端口号和一个序列号。端口号用来识别发送数据的应用程序。注意,数据以块的形式传输。序列号用于把这些片段按正确的顺序排列。
传输层负责控制流量或在给定的时间内传输的数据量。它也负责错误的管理,比如数据丢失、损坏等情况。它利用一种错误探测值,通常叫做校验和。传输层对每个数据片段加上校验和,就可以检查所发送的数据是否被正确接收。然后数据传输到网络层。
### 网络层
网络层的作用是跟其他网络进行通信。它把从一台机器接收到的数据片段传输给另一台位于不同网络的机器。路由器是作用于网络层的。
网络层的功能是逻辑寻址(就是确定 IP 地址)。它为发送方和接收方分配 IP 地址,数据包附带了这个地址,就可以被传输到正确的目标机器。接着网络层对数据包进行路由。负载均衡也是在网络层进行的,旨在确保不会发生过载。下一步,数据传输到数据链路层。
### 数据链路层
数据链路层支持跟其他设备直接通信。
它接收到来自网络层、包含发送方和接收方 IP 地址的数据包,进行物理寻址,然后将发送方和接收方的 MAC 地址分配给数据包,形成帧。
### 物理层
物理层由系统的所有硬件和物理设备(包括网线、导航系统、适配器等)组成。在这里,从前面层级接收到的数据都是 0 和 1 形式的。物理层把这些数据转换并通过各种方式(如果是光纤电缆,有电线、电信号、光信号;如果是 WIFI则为无线电信号传输至本地媒介。
注意,物理层作用于接收方的一端,把接收到的信号以帧的形式传输到数据链路层(把它转换回二进制数据形式)。然后帧传输到上面的层级,最终应用层(应用软件)会接收到需要的数据。
### 结语
当你需要描述网络架构或排除网络问题时OSI 模型的相关知识会对你有所帮助。我希望本文能令你对这个模型的方方面面有清晰的理解。
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/10/osi-model-network-communications
作者:[Anamika][a]
选题:[lkxed][b]
译者:[cool-summer-021](https://github.com/cool-summer-021)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/anamika
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/code_computer_development_programming.png
[2]: https://opensource.com/article/22/10/osi-model-network-communications#application-layer
[3]: https://opensource.com/article/22/10/osi-model-network-communications#presentation-layer
[4]: https://opensource.com/article/22/10/osi-model-network-communications#session-layer
[5]: https://opensource.com/article/22/10/osi-model-network-communications#transport-layer
[6]: https://opensource.com/article/22/10/osi-model-network-communications#network-layer
[7]: https://opensource.com/article/22/10/osi-model-network-communications#data-link-layer
[8]: https://opensource.com/article/22/10/osi-model-network-communications#physical-layer

View File

@ -0,0 +1,287 @@
[#]: subject: "Introducing Rust calls to C library functions"
[#]: via: "https://opensource.com/article/22/11/rust-calls-c-library-functions"
[#]: author: "Marty Kalin https://opensource.com/users/mkalindepauledu"
[#]: collector: "lkxed"
[#]: translator: "yzuowei"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
介绍从 Rust 调用 C 库函数
======
为什么要从 Rust 调用 C 函数?简短的回答就是软件库。冗长的答案则触及到 C 在众多编程语言中的地位,特别是相对 Rust 而言。CC++,还有 Rust 都是系统语言这意味着程序员会访问机器层面的数据类型与操作。在这三个系统语言中C 依然占据主导地位。现代操作系统的内核大致用 C 来写,其余部分依靠汇编语言来补充。在标准系统函数库中,输入与输出、数字处理、加密计算、安全、网络、国际化、字符串处理、内存管理,还用更多,都大体用 C 来写。这些函数库所代表的是一个庞大的基础架构支撑着用其他语言写出来的应用。Rust 发展至今也有着可观的函数库,但是 C 的函数库——自1970年代就已存在迄今还在蓬勃发展——是一个无法被忽视的资源。最后一点是 C 依然还是编程语言中的 [lingua franca][1]:大部分语言都与 C 交流,透过 C语言互相交流。
### 两个概念证明的例子
Rust 支持 FFI (外部函数接口)用以调用 C 函数。任何 FFI 所需要面临的问题是调用方语言是否包括了被调用语言的数据类型。例如,`ctypes` 是 Python 调用 C 的 FFI但是 Python 并没有包括 C 所支持的无符号整数类型。结果就是,`ctypes` 必须寻求解决方案。
与之相对的是Rust 包含了所有 C 中的原始机器层面类型。比如说Rust 中的 `i32` 类对应 C 中的 `int` 类。C 特别声明了 `char` 类必须是一个字节大小,而其他类型,比如 `int`必须至少是这个大小LCTT 译注:原文处有评论指出 `int` 大小依照 C 标准应至少为2字节然而如今所有合理的 C 编译器都支持四字节的 `int`,以及八字节的 `double`Rust 中则是 `f64` 类),以此类推。
面向 C 的 FFI 所面临的另一个挑战是FFI 是否能够处理 C 的裸指针包括指向被看作是字符串的数组指针。C 没有字符串类型它通过结合字符组和一个不会被打印的终止符来实现字符串大名鼎鼎的_空终止符_。与之相对Rust 有两个字符串类型:`String` 和 `&str` 字符串切片。问题是Rust FFI 是否能将 C 字符串转化成 Rust 字符串——答案是_肯定的_。
出于对效率的追求,结构体指针在 C 中也很常见。一个 C 结构体在作为一个函数的参数或者返回值的时候其默认行为是传递值一个字节一个字节的复制。C 结构体,如同它在 Rust 中的对应部分一样可以包含数组和嵌套其他结构体所以其大小是不定的。结构体在两种语言中的最佳用法是传递或返回引用也就是说传递或返回结构体的地址而不是结构体本身的复制。Rust 再一次成功处理了 C 的结构体指针,其在 C 函数库中十分普遍。
第一段代码案例专注于调用相对简单的 C 库函数,比如 `abs`(绝对值)和 `sqrt`(平方根)。这些函数使用非指针标量参数并返回一个非指针标量值。第二段代码案例则涉及了字符串和结构体指针,在这里会介绍工具 [bindgen][2],其通过 C 接口(头)文件生成 Rust 代码,比如 `math.h` 以及 `time.h`。C 头文件声明了 C 函数的调用语法并定义了会被调用的结构体。两段代码都能在[我的主页上][3]找到。
### 调用相对简单的 C 函数
第一段代码案例有四处 Rust 对标准数学库内的 C 函数的调用:两处分别调用了 `abs`(绝对值)和 `pow`(幂),两处重复调用了 `sqrt`(平方根)。这个程序可以直接用 `rustc` 编译器进行构建,或者使用更方便的命令 `cargo build`
```
use std::os::raw::c_int; // 32位
use std::os::raw::c_double; // 64位
// 从标准库 libc 中引入三个函数。
// 此处是 Rust 对三个 C 函数的声明:
extern "C" {
fn abs(num: c_int) -> c_int;
fn sqrt(num: c_double) -> c_double;
fn pow(num: c_double, power: c_double) -> c_double;
}
fn main() {
let x: i32 = -123;
println!("\n{x}的绝对值是: {}.", unsafe { abs(x) });
let n: f64 = 9.0;
let p: f64 = 3.0;
println!("\n{n}的{p}次方是: {}.", unsafe { pow(n, p) });
let mut y: f64 = 64.0;
println!("\n{y}的平方根是: {}.", unsafe { sqrt(y) });
y = -3.14;
println!("\n{y}的平方根是: {}.", unsafe { sqrt(y) }); //** NaN = NotaNumber不是数字
}
```
顶部的两个 `use` 声明是 Rust 的数据类型 `c_int``c_double`,对应 C 类型里的 `int``double`。Rust 标准模块 `std::os::raw` 定义了十四个类似的类型以确保跟 C 的兼容性。模块 `std::ffi` 中有十四个同样的类型定义以及对字符串的支持。
位于 `main` 函数上的 `extern "C"` 区域声明了三个 C 库函数,这些函数会在 `main` 函数内被调用。每次调用都使用了标准的 C 函数名,但每次调用都必须发生在一个 `unsafe` 区域内。正如每个新接触 Rust 的程序员所发现的那样Rust 编译器极度强制内存安全。其他语言(特别是 C 和 C++)作不出相同的保证。`unsafe` 区域其实是说Rust 对外部调用中可能存在的不安全行为不负责。
第一个程序输出为:
```
-123的绝对值是: 123.
9的3次方是: 729.
64的平方根是: 8.
-3.14的平方根是: NaN.
```
输出的最后一行的 `NaN` 表示不是数字 (Not a Number)C 库函数 `sqrt` 期待一个非负值作为参数,这使得参数-3.14生成了 `NaN` 作为返回值。
### 调用涉及指针的 C 函数
C 库函数为了提高效率经常在安全、网络、字符串处理、内存管理,以及其他领域中使用指针。例如,库函数 `asctime`(时间作为 ASCII 字符串期待一个结构体指针作为其参数。Rust 调用类似 `asctime` 的 C 函数就会比调用 `sqrt` 要更加棘手一些,后者既没有牵扯到指针,也不涉及到结构体。
函数 `asctime` 调用的 C 结构体类型为 `struct tm`。一个指向此结构体的指针会作为参数被传递给库函数 `mktime`(时间作为值)。此结构体会将时间拆分成诸如年、月、小时之类的单位。此结构体的字段 (fields) 类型为 `time_t`,是 `int`32位`long`64位的异名。两个库函数将这些破碎的时间碎片组合成了一个单一值`asctime` 返回一个字符串用以表达时间,而 `mktime` 返回一个 `time_t` 值表示自 [_epoch_][4],即系统时钟和时间戳被决定的那一刻,以来所经历的秒数。典型的 epoch 设置为1900年或1970年1月1日0时0分0秒。
以下的 C 程序调用了 `asctime``mktime`,并使用了其他库函数 `strftime` 来将 `mktime` 的返回值转化成一个格式化的字符串。这个程序可被视作 Rust 对应版本的预热:
```
#include <stdio.h>
#include <time.h>
int main () {
struct tm sometime; /* 时间被打破细分 */
char buffer[80];
int utc;
sometime.tm_sec = 1;
sometime.tm_min = 1;
sometime.tm_hour = 1;
sometime.tm_mday = 1;
sometime.tm_mon = 1;
sometime.tm_year = 1;
sometime.tm_hour = 1; /*LCTT 译注:这里作者多敲了一行*/
sometime.tm_wday = 1;
sometime.tm_yday = 1;
printf("日期与时间: %s\n", asctime(&sometime));
utc = mktime(&sometime);
if( utc < 0 ) {
fprintf(stderr, "错误: mktime 无法生成时间\n");
} else {
printf("返回的整数值: %d\n", utc);
strftime(buffer, sizeof(buffer), "%c", &sometime);
printf("更加可读的版本: %s\n", buffer);
}
return 0;
}
```
程序输出为:
```
日期与时间: Fri Feb  1 01:01:01 1901
返回的整数值: 2120218157
更加可读的版本: Fri Feb  1 01:01:01 1901
```
LCTT 译注:如果你尝试在自己电脑上运行这段代码,然后得到了一行关于 `mktime` 的错误信息,然后又在网上随便找了个在线 C 编译器,复制代码然后得到了跟这里的结果有区别但是没有错误的结果,不要慌,我的电脑上也是这样的。导致本地机器上 `mktime` 失败的原因是作者没有设置 `tm_isdst`,这个是用来标记夏令时的 flag。[`tm_isdst` 大于零则夏令时生效中,等于零则不生效,小于零标记未知][5]。加入 `sometime.tm_isdst = 0``= -1` 后应该就能得到跟在线编译器大致一样的结果。不同的地方在于结果第一行我得到的是 `Mon Feb ...`,这个与作者代码中 `sometime.tm_wday = 1` 对应,这里因该是作者写错了;第二行我和作者和网上得到的数字都不一样,这大概是合理的,因为这与机器的 epoch 有关第三行我跟作者的结果是一样的1901年2月1日也确实是周五这是因为 [`mktime` 其实会修正时间参数中不合理的地方][6]。至于夏令时具体是如何影响 `mktime` 这个问题,我能查到的只有 `mktime` 的计算受时区影响,更底层的原因我也不知道了。)
总的来说Rust 在调用库函数 `asctime``mktime` 时,必须处理以下两个问题:
- 将裸指针作为唯一参数传递给每个库函数。
- 把从 `asctime` 返回的 C 字符串转化为 Rust 字符串。
### Rust 调用 `asctime``mktime`
工具 `bindgen` 会根据类似 `math.h``time.h` 之类的 C 头文件生成 Rust 支持的代码。下面这个简化版的 `time.h` 就可以用来做例子,简化版与原版主要有两个不同:
- 内置类型 `int` 被用来取代异名类型 `time_t`。工具 bindgen 可以处理 `time_t` 类但是会生成一些烦人的警告,因为 `time_t` 不符合 Rust 的命名规范:`time_t` 以下划线区分 `time``t`Rust 更偏好驼峰式命名方法,比如 `TimeT`
- 出于同样的原因,这里选择 `StructTM` 作为 `struct tm` 的异名。
以下是一份简化版的头文件,`mktime` 和 `asctime` 在文件底部:
```
typedef struct tm {
int tm_sec; /* 秒 */
int tm_min; /* 分钟 */
int tm_hour; /* 小时 */
int tm_mday; /* 日 */
int tm_mon; /* 月 */
int tm_year; /* 年 */
int tm_wday; /* 星期 */
int tm_yday; /* 一年中的第几天 */
int tm_isdst; /* 夏令时 */
} StructTM;
extern int mktime(StructTM*);
extern char* asctime(StructTM*);
```
`bindgen` 安装好后,`%` 作为命令行提示,`mytime.h` 作为以上提到的头文件,以下命令可以生成所需的 Rust 代码并将其保存到文件 `mytime.rs`
```
% bindgen mytime.h > mytime.rs
```
以下是 `mytime.rs` 中的重要部分:
```
/* automatically generated by rust-bindgen 0.61.0 */
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tm {
pub tm_sec: ::std::os::raw::c_int,
pub tm_min: ::std::os::raw::c_int,
pub tm_hour: ::std::os::raw::c_int,
pub tm_mday: ::std::os::raw::c_int,
pub tm_mon: ::std::os::raw::c_int,
pub tm_year: ::std::os::raw::c_int,
pub tm_wday: ::std::os::raw::c_int,
pub tm_yday: ::std::os::raw::c_int,
pub tm_isdst: ::std::os::raw::c_int,
}
pub type StructTM = tm;
extern "C" {
pub fn mktime(arg1: *mut StructTM) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn asctime(arg1: *mut StructTM) -> *mut ::std::os::raw::c_char;
}
#[test]
fn bindgen_test_layout_tm() {
const UNINIT: ::std::mem::MaybeUninit<tm> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tm>(),
36usize,
concat!("Size of: ", stringify!(tm))
);
...
```
Rust 结构体 `struct tm`,跟原本在 C 中的一样包含了九个4字节的整型字段。这些字段名称在 C 和 Rust 中是一样的。`extern "C"` 区域声明了库函数 `astime``mktime` 分别需要只一个参数,一个指向可变实例 `extern "C"` 的裸指针。(库函数可能会通过指针改变作为参数传递的结构体。)
`#[test]` 属性下的其余代码是用来测试 Rust 版的时间结构体的布局。通过命令 `cargo test` 可以进行这些测试。一个 C 不会声明的问题是编译器应该如何对结构体中的字段进行布局。比如说C 的 `struct tm` 以字段 `tm_sec` 开头用以表示秒;但是 C 不需要编译版本遵循这个排序。不管怎样Rust 测试应该会成功而 Rust 对库函数的调用也应如预期般工作。
### 设置好第二个案例并开始运行
`bindgen` 生成的代码不包含 `main` 函数,所以是一个天然的模块。以下是一个 `main` 函数初始化了 `StructTM` 并调用了 `asctime``mktime`
```
mod mytime;
use mytime::*;
use std::ffi::CStr;
fn main() {
let mut sometime = StructTM {
tm_year: 1,
tm_mon: 1,
tm_mday: 1,
tm_hour: 1,
tm_min: 1,
tm_sec: 1,
tm_isdst: -1,
tm_wday: 1,
tm_yday: 1
};
unsafe {
let c_ptr = &mut sometime; // 裸指针
// 调用,转化,并拥有
// 返回的 C 字符串
let char_ptr = asctime(c_ptr);
let c_str = CStr::from_ptr(char_ptr);
println!("{:#?}", c_str.to_str());
let utc = mktime(c_ptr);
println!("{}", utc);
}
}
```
这段 Rust 代码可以被编译(直接用 `rustc` 或使用 `cargo`)并运行。输出为:
```
Ok(
    "Mon Feb  1 01:01:01 1901\n",
)
2120218157
```
对 C 函数 `asctime``mktime` 的调用必须再一次被放在 `unsafe` 区域内,因为 Rust 编译器无法对这些外部函数的潜在内存安全风险负责。此处声明一下,`asctime` 和 `mktime` 并没有安全风险。调用的两个函数的参数是裸指针 `ptr`,其指向结构体 `sometime` (在栈 (stack) 中)的地址。
`asctime` 是两个函数中调用起来更棘手的那个,因为这个函数返回的是一个指向 C `char` 的指针,如果函数返回 `Mon` 那么指针就指向 `M`。但是 Rust 编译器并不知道 C 字符串 `char` 的空终止数组)的储存位置。是内存里的静态空间?还是堆 (heap)`asctime` 函数内用来储存时间的文字表达的数组实际上是在内存的静态空间里。无论如何C 到 Rust 字符串转化需要两个步骤来避免编译错误:
- 调用 `Cstr::from_ptr(char_ptr)` 来将 C 字符串转化为 Rust 字符串并返回一个引用储存在变量 `c_str` 中。
- 对 `c_str.to_str()` 的调用确保了 `c_str` 是所有者。
Rust 代码不会增加从 `mktime` 返回的整型值的易读性这一部分留作课外作业给感兴趣的人去探究。Rust 模板 `chrono::format` 也有一个 `strftime` 函数,它可以被当作 C 的同名函数来使用,两者都是获取时间的文字表达。
### 使用 FFI 和 bindgen 调用 C
Rust FFI 和工具 `bindgen` 都能够出色地协助 Rust 调用 C 库无论是标准库还是第三方库。Rust 轻松地与 C 交流,并透过 C 与其他语言交流。对于调用像 `sqrt` 一样简单的库函数Rust FFI 表现直截了当,这是因为 Rust 的原始数据类型覆盖了它们在 C 中的对应部分。
对于更为复杂的交流——特别是 Rust 调用像 `asctime``mktime` 一样,会涉及到结构体和指针的 C 库函数——工具 `bindgen` 是优秀的帮手。这个工具会生成支持代码以及所需要的测试。当然Rust 编译器无法假设 C 代码对内存安全的考虑会符合 Rust 的标准因此Rust 必须在 `unsafe` 区域内调用 C。
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/11/rust-calls-c-library-functions
作者:[Marty Kalin][a]
选题:[lkxed][b]
译者:[yzuowei](https://github.com/yzuowei)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/mkalindepauledu
[b]: https://github.com/lkxed
[1]: https://baike.baidu.com/item/lingua%20franka/5359711
[2]: https://github.com/rust-lang/rust-bindgen
[3]: https://condor.depaul.edu/mkalin
[4]: https://baike.baidu.com/item/UNIX时间/8932323
[5]: https://cplusplus.com/reference/ctime/tm/
[6]: https://cplusplus.com/reference/ctime/mktime/

View File

@ -0,0 +1,122 @@
[#]: subject: "How to Access UEFI Settings in Linux Systems"
[#]: via: "https://itsfoss.com/access-uefi-from-linux/"
[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
如何在 Linux 系统中访问 UEFI 设置
======
想要在固件级别检查启动顺序或电源设置? **你可以在系统启动时按 F2、F10 或 Del 按键访问 UEFI 设置**
这种方法的问题是你可能不知道确切的键,并且必须警惕在正确的时间按下这些键。
![Mr. Bean][1a]
如果你不想像上面 Gif 中的憨豆先生,你可以从 Linux 中的 [Grub bootloader][1] 也没访问 UEFI 设置。
![uefi firmware settings grub linux][2]
当你打开 Linux 系统时你会看到这个页面。Fedora 和 Ubuntu 等大多数 Linux 发行版都使用 Grub它们允许你像这样从 Grub 页面访问 UEFI 设置。
如果你没有看到此页面或你的发行版不使用 Grub 怎么办? 仍然有一些方法可以从 Linux 中访问 UEFI 设置。
在你了解如何操作之前,请[确保你的系统使用 UEFI][3]。
**_另一件重要的事情。你的系统将重启进入 UEFI 设置。_** _你无法从操作系统中访问和修改固件设置。_
### 从 Linux 启动到 UEFI 设置
此方法仅适用于具有 systemd 的 Linux 发行版。这意味着这种方法适用于任何基于 Ubuntu、Debian、Fedora 和任何主流的基于 Arch 的发行版,包括 Manjaro 和 EndeavourOS。
[确保你的 Linux 发行版使用 systemd][4] 仍然是一个好主意。使用给定的命令,如果它返回 systemd你就可以开始了
```
ps --no-headers -o comm 1
```
![how to know if i am using systemd on linux?][5]
当你发现你的发行版正在使用 systemd你可以使用给定的命令启动到 UEFI 设置:
```
systemctl reboot --firmware-setup
```
让我首先分解使用的选项:
- `reboot`:顾名思义,它将重启你的系统。
- `--firmware-setup`: 当此选项与 `reboot` 一起使用时,它会指示系统固件启动进入固件设置界面。
就是这样! 一个命令,你将进入 UEFI 设置。我知道 Windows 允许[从 Windows 中启动进入 UEFI 固件设置][6]。很高兴在 Linux 中看到类似的东西。
#### 创建桌面快捷方式以启动到 UEFI 设置(可选)
如果你经常发现自己启动进入 UEFI 设置并且不记得所有命令,你可以通过创建桌面快捷方式让你的生活更轻松。这将使你可以通过单击桌面图标启动到 UEFI。
_**现在,对于大多数 Linux 用户来说,这是不必要的,也不是必需的。只有当你觉得有必要时才去做。该方法需要[在命令行中编辑文件][7]。**_
首先,使用给定的命令为 UEFI 设置创建桌面快捷方式文件:
```
sudo nano /usr/share/applications/uefi-reboot.desktop
```
并将以下内容粘贴到文件中:
```
[Desktop Entry]
Name=UEFI Firmware Setup (Reboot)
Comment=Access the motherboard configuration utility
Exec=systemctl reboot --firmware-setup
Icon=system-restart
Terminal=false
Type=Application
Categories=System;Settings;
```
![create a desktop shortcut to boot into uefi settings][8]
完成后,[保存更改并退出 nano][9] 文本编辑器。
现在,你将在系统菜单中找到 UEFI 固件设置的快捷方式:
![boot into uefi firmware from system menu][10]
完成了! 一种进入 UEFI 设置的巧妙方法。
### 总结
访问启动设置的经典方法对某些人来说可能有点不方便。grub 页面可能不会显示旧版本的 UEFI 选项。
这就是 systemd 方法的亮点所在。当我的系统崩溃并且我的功能键没有响应时,我发现这种方法是救命稻草,这是启动到 UEFI 所必需的(我当时就是这么想的!)。
我希望你发现它同样有用。
--------------------------------------------------------------------------------
via: https://itsfoss.com/access-uefi-from-linux/
作者:[Sagar Sharma][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://itsfoss.com/author/sagar/
[b]: https://github.com/lkxed
[1a]: https://external-preview.redd.it/dxmsKYDmzgfb1thu3EFI8Ni-DNfprNX8W8xDtff4QWU.gif?format=mp4&s=c31204644ac6a2a348133986714ff97cf3c4a48a
[1]: https://itsfoss.com/what-is-grub/
[2]: https://itsfoss.com/wp-content/uploads/2022/12/uefi-firmware-settings-grub-linux.webp
[3]: https://itsfoss.com/check-uefi-or-bios/
[4]: https://linuxhandbook.com/check-if-systemd/
[5]: https://itsfoss.com/wp-content/uploads/2022/12/how-to-know-if-i-am-using-systemd-on-linux.png
[6]: https://itsfoss.com/access-uefi-settings-windows-10/
[7]: https://learnubuntu.com/edit-files-command-line/
[8]: https://itsfoss.com/wp-content/uploads/2022/12/create-a-desktop-shortcut-to-boot-into-uefi-settings.png
[9]: https://linuxhandbook.com/nano-save-exit/
[10]: https://itsfoss.com/wp-content/uploads/2022/12/boot-into-uefi-firmware-from-system-menu.png

View File

@ -0,0 +1,87 @@
[#]: subject: "Convert and Manipulate Images With Converter GUI Tool in Linux"
[#]: via: "https://itsfoss.com/converter-tool/"
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
在 Linux 中使用 “Converter” GUI 工具转换和操作图像
======
你可以随时在您的系统上[安装 ImageMagick][1] 来转换图像,但并不是每个人都喜欢使用终端来转换和操作图像。
那么,如果你有一个 GUI 应用作为前端来帮助解决这个问题呢? **Converter** 就是这样的工具。
它是 ImageMagick 的前端。所以你不需要使用命令来转换和操作图像。
请注意,大多数 Ubuntu 系统通常都预装了 ImageMagick。如果你的系统上还没有安装你可以随时参考我们的[安装指南][1]。
### ConverterImageMagick 的图形前端
![converter gui][2]
转换图像不应该花费很多精力。这是一项简单的任务,而且应该如此。
我不想键入命令来快速转换图像。因此,我更喜欢使我能够更快地做事的图形工具。
[Converter][3] 是一个开源图形前端,可以让你做到这点。它是一个 GTK4+libadwaita 应用。
你可以将图像转换为各种文件格式,包括 **png、webp、jpeg、heif、heic 和 bmp**。可以肯定地说,你获得了对最流行的图像文件格式的支持。所以,它应该会派上用场。
![file format converter][4]
你可以设置一个位置来保存所有文件,转换后的图像将自动存储在该位置。
![customize converter][5]
你还可以调整图像的质量、大小和背景颜色。要访问这些选项,请在转换图像之前单击用户界面中的“**更多选项**”。
![converter more options][6]
可以使用百分比、精确像素或比率自定义图像大小。对于精确操作,更改尺寸应该有所帮助。
如果你希望图像缩放到一定程度,百分比或比例功能应该可以帮助你做到这一点。你还可以选择为图像添加滤镜。
总体而言,您可以获得使用 Converter 调整大小、转换和优化图像质量的基本功能。
你还可以[调整 Nautilus][7] 以获得[右键单击上下文菜单中的调整大小选项][8]。它不会像这个工具那样通用。
### 在 Linux 上安装 Converter
Converter 在 [Flathub][9] 上以 Flatpak 的形式提供,可以安装在你选择的任何 Linux 发行版上。
遗憾的是,你无法在 Linux 系统上安装任何二进制包。因此,你可能需要参考我们的 [Flatpak 指南][10]来安装它。
```
flatpak install flathub io.gitlab.adhami3310.Converter
```
你可以在其 [GitLab 页面][3]上探索更多相关信息。
_你对我们接下来要重点介绍的此类有趣工具有什么建议吗 让我们在评论中知道。_
--------------------------------------------------------------------------------
via: https://itsfoss.com/converter-tool/
作者:[Ankush Das][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://itsfoss.com/author/ankush/
[b]: https://github.com/lkxed
[1]: https://itsfoss.com/install-imagemagick-ubuntu/
[2]: https://itsfoss.com/wp-content/uploads/2022/12/converter-gui.png
[3]: https://gitlab.com/adhami3310/Converter
[4]: https://itsfoss.com/wp-content/uploads/2022/12/file-format-converter.png
[5]: https://itsfoss.com/wp-content/uploads/2022/12/customize-converter.png
[6]: https://itsfoss.com/wp-content/uploads/2022/12/converter-more-options.png
[7]: https://itsfoss.com/nautilus-tips-tweaks/
[8]: https://itsfoss.com/resize-images-with-right-click/
[9]: https://flathub.org/apps/details/io.gitlab.adhami3310.Converter
[10]: https://itsfoss.com/flatpak-guide/