Merge branch 'master' of https://github.com/LCTT/TranslateProject into translating

This commit is contained in:
geekpi 2022-06-15 08:39:11 +08:00
commit f8a47e414f
22 changed files with 1765 additions and 1124 deletions

View File

@ -0,0 +1,117 @@
[#]: subject: "How to Recover Arch Linux Install via chroot"
[#]: via: "https://www.debugpoint.com/2021/07/recover-arch-linux/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-14708-1.html"
如何通过 chroot 恢复 Arch Linux 系统
======
![](https://img.linux.net.cn/data/attachment/album/202206/14/111204hm20rzjmmf5ib9nr.jpg)
> 这个快速指南解释了恢复 Arch Linux 安装的一些方便步骤。
作为一个滚动发布的版本,[Arch Linux][1] 中有时会出现一些问题。不是因为你自己的行为而是数以百计的其他原因如新内核与你的硬件或软件的兼容性。但是Arch Linux 仍然很棒,它提供了最新的软件包和应用。
但有时,它也会给你带来麻烦,你最终只能看到一个闪烁的光标,其他什么都没有。
所以,在这种情况下,与其重新格式化或重新安装,不如在放弃希望之前尝试恢复安装和数据。本指南概述了这个方向的一些步骤。
### 恢复 Arch Linux 安装
第一步是用 Arch Linux 创建一个可启动的<ruby>现场<rt>Live</rt></ruby> USB。从 [这个链接][3] 下载 .ISO 并创建一个可启动的 USB。你可以查看这个 [如何使用 Etcher 创建可启动的 USB][2] 的指南。记住这一步需要另一个稳定的工作系统,因为你目前的系统不能使用。
你需要知道你的 Arch Linux 安装在哪个分区上。这是一个非常重要的步骤。如果你不知道,你可以用 GParted 来查找。或者在你的 GRUB 菜单中查看,或者你可以运行下面的命令来了解。这将列出你所有的磁盘分区及其大小、标签:
```
sudo lsblk -o name,mountpoint,label,size,uuid
```
完成后,插入 USB 盘并从它启动。你应该在现场介质中看到 Arch Linux 的提示符。
现在,用下面的方法挂载 Arch Linux 分区。记得把 `/dev/sda3` 改成你对应的分区。
```
mount /dev/sda3 /mnt
arch-chroot /mnt
```
`arch-chroot` 命令将在终端挂载你的 Arch Linux 分区,所以用你的 Arch 凭证登录。现在,在这个阶段,根据你的需要,你有以下选择。
* 你可以通过 `/home` 文件夹来备份你的数据。如果,故障排除方式无效的话。你可以把文件复制到外部 USB 或其他分区。
* 核查日志文件,特别是 pacman 日志。因为,不稳定的系统可能是由升级某些软件包引起的,如图形驱动或任何其他驱动。根据日志,如果你需要的话,可以降级任何特定的软件包。
你可以使用下面的命令来查看 pacman 日志文件的最后 200 行,以找出任何失败的项目或依赖性删除。
```
tail -n 200 /var/log/pacman.log | less
```
上面的命令给出了你的 `pacman.log` 文件末尾的 200 行来验证。现在,仔细检查哪些软件包在你成功启动后被更新了。
并记下软件包的名称和版本。你可以尝试逐一降级软件包,或者如果你认为某个特定的软件包产生了问题。使用 `pacman -U` 开关来降级。
```
pacman -U <package name>
```
如果有的话,你可以在降级后运行以下命令来启动你的 Arch 系统。
```
exec /sbin/init
```
检查你的显示管理器的状态,是否有任何错误。有时,显示管理器会产生一个问题,无法与 X 服务器通信。例如,如果你正在使用 Lightdm那么你可以通过以下方式检查它的状态。
```
systemctl status lightdm
```
或者,可以通过下面的命令启动它,并检查出现了错误。
```
lightdm --test-mode --debug
```
下面是一个 Lightdm 失败的例子,它导致了一个不稳定的 Arch 系统。
![lightdm - test mode][4]
或者通过使用 `startx` 启动 X 服务器来检查。
```
startx
```
根据我的经验,如果你在上述命令中看到错误,尝试安装另一个显示管理器并启用它,如 sddm。它可能会消除这个错误。
根据你的系统状态,尝试上述步骤,并进行故障排除。对于特定于显示管理器 lightdm 的错误,我们有一个 [指南][5],你可以看看。
如果你使用的是 sddm那么请查看 [这些故障排除步骤][6]。
### 总结
每个安装环境都是不同的。上述步骤可能对你不起作用。但它值得一试,根据经验,它是有效的。如果它起作用,那么,对你来说是好事。无论哪种方式,请在下面的评论区中告诉我结果如何。
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/2021/07/recover-arch-linux/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/tag/arch-linux
[2]: https://www.debugpoint.com/2021/01/etcher-bootable-usb-linux/
[3]: https://archlinux.org/download/
[4]: https://www.debugpoint.com/wp-content/uploads/2021/03/lightdm-test-mode.jpg
[5]: https://www.debugpoint.com/2021/03/failed-to-start-lightdm/
[6]: https://wiki.archlinux.org/title/SDDM#Troubleshooting

View File

@ -0,0 +1,276 @@
[#]: subject: "How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 22.04 / 20.04 / 18.04"
[#]: via: "https://ostechnix.com/how-to-boot-into-rescue-mode-or-emergency-mode-in-ubuntu-18-04/"
[#]: author: "sk https://ostechnix.com/author/sk/"
[#]: collector: "lkxed"
[#]: translator: "robsean"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-14709-1.html"
详解在 Ubuntu 中引导到救援模式或紧急模式
======
![](https://img.linux.net.cn/data/attachment/album/202206/14/153639n33fg3e2gc7xnvv3.jpg)
这篇教程将介绍如何在 Ubuntu 22.04、20.04 和 18.04 LTS 版本中引导到 <ruby>救援<rt>Rescue</rt></ruby> 模式或 <ruby>紧急<rt>Emergency</rt></ruby> 模式。
> 你可能已经知道,在 RHEL 7 、RHEL 8 、Ubuntu 16.04 LTS 及其更新的版本的 Linux 发行版中 <ruby>运行等级<rt>Runlevels</rt></ruby> 已经被 <ruby>系统目标<rt>Systemd target</rt></ruby> 所替代。更多关于 <ruby>运行等级<rt>Runlevel</rt></ruby><ruby>系统目标<rt>Systemd targets</rt></ruby> 的信息,参考 [这篇指南][1] 。
这篇指南是针对 Ubuntu 编写的,但是,下面所给的步骤应该也适用于大多数使用 systemd 作为默认服务管理器的 Linux 发行版。
在进入主题前,让我们简单的理解:什么是 <ruby>救援<rt>rescue</rt></ruby> 模式 和 <ruby>紧急<rt>Emergency</rt></ruby> 模式,以及这两种模式的目的是什么。
### 什么是救援模式?
在 Linux 发行版中,救援模式等效于使用 SysV 作为默认的服务器管理器的 <ruby>单用户<rt>single user</rt></ruby> 模式。在救援模式中,将挂载所有的本地文件系统,将仅启动一些重要的服务。但是,不会启动一般的服务(例如,网络服务)。
救援模式在不能正常引导系统的情况下是很有用的。此外,我们可以在救援模式下执行一些重要的救援操作,例如,[重新设置 root 密码][2] 。
### 什么是紧急模式?
与救援模式相比,在紧急模式中,不会启动任何的东西。不会启动服务、不会挂载挂载点、不会建立套接字、什么都不会启动。你将所拥有的只是一个 **原始的 shell** 。紧急模式适用于调试目的。
首先,我们将看到如何在 Ubuntu 22.04 和 20.04 LTS 发行版中引导到救援模式或紧急模式。在 Ubuntu 22.04 和 20.04 LTS 中的过程是完全相同的!
### 在 Ubuntu 22.04 / 20.04 LTS 中引导到救援模式
我们可以使用两种方法来引导到救援模式。
#### 方法 1
打开你的 Ubuntu 系统。在 BIOS 徽标出现后,按下 `ESC` 按键来显示 GRUB 菜单。
在 GRUB 菜单中,选择第一项,并按下 `e` 按键来编辑它。
![GRUB Menu In Ubuntu 22.04 / 20.04 LTS][3]
按下 `↓` 按键,并找到以单词 `linux` 开头的一行代码,并在其结尾处添加下面的一行代码。为到达其结尾处,只需要按下 `Ctrl + e` 组合键,或使用你键盘上的 `END` 按键或 `←`/`→` 按键。
```
systemd.unit=rescue.target
```
![Edit Grub Boot Menu Entries To Enter Into Rescue Mode In Ubuntu 22.04 / 20.04 LTS][4]
在添加上面的代码行后,按下 `Ctrl + x` 组合键或按下 `F10` 按键来引导到救援模式。
数秒后,你将作为 root 用户来登录到救援模式(即单用户模式)。将会提示你按下回车键来进入维护。
下图是 Ubuntu 22.04 / 20.04 LTS 系统的救援模式的样子:
![Boot Into Rescue Mode In Ubuntu 22.04 / 20.04 LTS][5]
现在,在救援模式中做你想做的任何事。在救援模式中,在你执行任何操作前,你可能需要以 读/写模式来挂载根(`/`)文件系统。
```
mount -n -o remount,rw /
```
![Mount Root File System In Read Write Mode In Ubuntu 22.04 / 20.04 LTS][6]
在完成后,按下 `Ctrl + d` 组合键来引导到正常模式。或者,你可以输入下面的任意一个命令来引导到正常模式。
```
systemctl default
```
或者,
```
exit
```
如果你想重新启动系统,而不是引导到正常的模式,输入:
```
systemctl reboot
```
#### 方法 2
在这种方法中,你不需要编辑 GRUB 启动菜单项目。
打开系统电源,并从 GRUB 启动菜单中选择 <ruby>Ubuntu 高级选项<rt>Advanced options for Ubuntu</rt></ruby>
![Choose Advanced Options For Ubuntu From Grub Boot Menu][7]
接下来,你将看到一个带有内核版本的可用的 Ubuntu 版本的列表。在 Ubuntu 中的 GRUB 启动菜单中选择 <ruby>恢复模式<rt>Recovery mode</rt></ruby>
![Choose Recovery Mode In Grub Boot Menu In Ubuntu 22.04 / 20.04 LTS][8]
数秒后,你将看到 Ubuntu 的 <ruby>恢复<rt>Recovery</rt></ruby> 菜单。从恢复菜单中,选择 <ruby>进入 root 的 shell 提示符<rt>Drop to root shell prompt</rt></ruby> 选项 ,并按下回车键。
![Enter Into Root Shell Prompt In Ubuntu 22.04 / 20.04 LTS][9]
现在,你将进入维护。
![Ubuntu Maintenance Mode][10]
通过输入下面的命令来 以读/写模式的方式 来挂载根(`/`)文件系统:
```
mount -n -o remount,rw /
```
![Mount Root File System In Read Write Mode In Ubuntu][11]
在救援模式中做你想做的任何事。
在完成后,输入 `exit` 来返回到恢复菜单。
```
exit
```
最后,选择 <ruby>救援正常启动<rt>Resume normal boot</rt></ruby> 选项,并按下回车键。
![Boot Into Normal Mode In Ubuntu][12]
再次按下回车键来退出恢复模式,并继续引导到正常模式。
![Exit The Recovery Mode In Ubuntu][13]
如果你不想引导到正常模式,从救援模式中输入 `reboot` 并按下回车键来重新启动你的系统。
### 在 Ubuntu 22.04 / 20.04 LTS 中引导到紧急模式
当 GRUB 菜单出现时,按下 `e` 按键来编辑它。
![GRUB Menu In Ubuntu 22.04 / 20.04 LTS][14]
找到以单词 `linux` 开头的一行代码,并在其结尾处添加下面的一行代码:
```
systemd.unit=emergency.target
```
![Edit Grub Boot Menu Entries To Enter Into Emergency Mode In Ubuntu 22.04 / 20.04 LTS][15]
在添加上面的代码行后,按下 `Ctrl + x` 组合键,或按下 `F10` 按键来引导到紧急模式。
数秒后,你将作为 `root` 用户来进入维护。将会提示你按下回车键来进入紧急模式。
下图是 Ubuntu 22.04 / 20.04 LTS 系统的紧急模式的样子:
![Boot Into Emergency Mode In Ubuntu 22.04 / 20.04 LTS][16]
现在,在紧急模式中做你想做的任何事。在紧急模式中,在你执行任何操作前,你可能需要以读/写模式来挂载根(`/`)文件系统。
```
mount -n -o remount,rw /
```
在完成后,按下 `Ctrl + d` 组合键来引导到正常模式。或者,你可以输入下面的任意一个命令来引导到正常模式。
```
systemctl default
```
或者,
```
exit
```
如果你想重新启动系统,而不是引导到正常模式,输入:
```
systemctl reboot
```
### 在 Ubuntu 18.04 LTS 中引导到救援模式
启动你的 Ubuntu 系统。当 GRUB 菜单出现时,选择第一项并按下按键 `e` 来编辑。(为到达其行尾处,只需要按下 `Ctrl + e` 组合键,或使用你键盘上的 `END` 按键或 `←`/`→` 按键):
![Grub Menu][17]
如果你没有看到 GRUB 菜单,只需要在 BIOS 徽标出现后,按下 `ESC` 按键来显示 GRUB 菜单。
找到以单词 `linux` 开头的一行代码,并在其结尾处添加下面的一行代码(为到达其行尾处,只需要按下 `Ctrl + e` 组合键,或使用你键盘上的 END` 按键或 `←`/`→` 按键):
```
systemd.unit=rescue.target
```
![Edit Grub Menu][18]
在添加上面的代码行后,只需要按下 `Ctrl + x` 组合键,或按下 `F10` 按键来引导到救援模式。数秒后,你将作为 `root` 用户进入维护(即单用户模式)。
下图是 Ubuntu 18.04 LTS 服务器系统的救援模式的样子:
![Ubuntu Rescue Mode][19]
接下来,输入下面的命令来挂载根(`/`)文件系统为读/写模式。
```
mount -n -o remount,rw /
```
### 在 Ubuntu 18.04 LTS 中引导到紧急模式
引导你的 Ubuntu 到紧急模式基本与上述方法相同。你所需要做的全部工作是,在编辑 GRUB 菜单时,将 `systemd.unit=rescue.target` 替换为 `systemd.unit=emergency.target`
![Edit Grub Menu][20]
在你添加 `systemd.unit=emergency.target` 后,按下 `Ctrl + x` 组合键,或按下 `F10` 按键来引导到紧急模式。
![Ubuntu Emergency Mode][21]
最后,你可以使用下面的命令来以读/写模式的方式来挂载根(`/`)文件系统:
```
mount -n -o remount,rw /
```
### 在救援模式和紧急模式之间切换
如果你正在救援模式中,你不必像我上述提到的那样来编辑 GRUB 的菜单启动项。相反,你只想要输入下面的命令来立刻切换到紧急模式:
```
systemctl emergency
```
同样,为从紧急模式切换到救援模式,输入:
```
systemctl rescue
```
### 总结
现在,你知道了什么是救援模式和紧急模式,以及如何在 Ubuntu 22.04 、20.04 和 18.04 LTS 系统中启动到这些模式。正如我已经提到的,在这里提供的这些步骤应该也适用于大多数当前使用 systemd 作为默认服务管理器的 Linux 发行版。
--------------------------------------------------------------------------------
via: https://ostechnix.com/how-to-boot-into-rescue-mode-or-emergency-mode-in-ubuntu-18-04/
作者:[sk][a]
选题:[lkxed][b]
译者:[robsean](https://github.com/robsean)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://ostechnix.com/author/sk/
[b]: https://github.com/lkxed
[1]: https://ostechnix.com/check-runlevel-linux/
[2]: https://ostechnix.com/how-to-reset-or-recover-root-user-password-in-linux/
[3]: https://ostechnix.com/wp-content/uploads/2022/05/GRUB-Menu-In-Ubuntu-22.04-LTS.png
[4]: https://ostechnix.com/wp-content/uploads/2022/05/Edit-Grub-Boot-Menu-Entries-To-Enter-Into-Rescue-Mode-In-Ubuntu-22.04-LTS.png
[5]: https://ostechnix.com/wp-content/uploads/2022/05/Boot-Into-Rescue-Mode-In-Ubuntu-22.04.png
[6]: https://ostechnix.com/wp-content/uploads/2022/05/Mount-Root-File-System-In-Read-Write-Mode-In-Ubuntu.png
[7]: https://ostechnix.com/wp-content/uploads/2022/05/Choose-Advanced-Options-For-Ubuntu-From-Grub-Boot-Menu.png
[8]: https://ostechnix.com/wp-content/uploads/2022/05/Choose-Recovery-Mode-In-Grub-Boot-Menu-In-Ubuntu.png
[9]: https://ostechnix.com/wp-content/uploads/2022/05/Enter-Into-Root-Shell-Prompt-In-Ubuntu.png
[10]: https://ostechnix.com/wp-content/uploads/2022/05/Ubuntu-Maintenance-Mode.png
[11]: https://ostechnix.com/wp-content/uploads/2022/05/Mount-Root-File-System-In-Read-Write-Mode-In-Ubuntu-1.png
[12]: https://ostechnix.com/wp-content/uploads/2022/05/Boot-Into-Normal-Mode-In-Ubuntu.png
[13]: https://ostechnix.com/wp-content/uploads/2022/05/Exit-The-Recovery-Mode-In-Ubuntu.png
[14]: https://ostechnix.com/wp-content/uploads/2022/05/GRUB-Menu-In-Ubuntu-22.04-LTS.png
[15]: https://ostechnix.com/wp-content/uploads/2022/05/Edit-Grub-Boot-Menu-Entries-To-Enter-Into-Emergency-Mode-In-Ubuntu.png
[16]: https://ostechnix.com/wp-content/uploads/2018/12/Boot-Into-Emergency-Mode-In-Ubuntu-20.04-LTS.png
[17]: https://ostechnix.com/wp-content/uploads/2018/12/Grub-menu.png
[18]: https://ostechnix.com/wp-content/uploads/2018/12/Edit-grub-menu.png
[19]: https://ostechnix.com/wp-content/uploads/2018/12/Ubuntu-rescue-mode.png
[20]: https://ostechnix.com/wp-content/uploads/2018/12/emergency-mode.png
[21]: https://ostechnix.com/wp-content/uploads/2018/12/emergency-mode-1.png

View File

@ -3,31 +3,31 @@
[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/"
[#]: collector: "lkxed"
[#]: translator: "lkxed"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-14707-1.html"
OpenInfra 基金会启动“定向资助”以支持开源项目
======
![OpenInfra][1]
OpenInfra 基金会的前身为 OpenStack 基金会,几年前它将范围扩展到其旗舰项目之外,于是改了名字。今天2022 年 6 月 7 日),它宣布了一种有趣的新方式,以供公司在基金会内资助开源项目。一般来说开源基金会的企业成员通过支付会员费来支持该组织然后基金会按照他们认为合适的方式分发这些费用。OpenInfra 基金会现在推出了一种新的“定向资助”模式,允许成员将他们的资金直接用于项目。
OpenInfra 基金会的前身为 OpenStack 基金会,几年前它将范围扩展到其旗舰项目之外,于是改了名字。2022 年 6 月 7 日,它宣布了一种有趣的新方式,让企业资助基金会内的开源项目。一般来说开源基金会的企业成员通过支付会员费来支持该组织然后基金会按照他们认为合适的方式分发这些费用。OpenInfra 基金会现在推出了一种新的“定向资助”模式,允许成员将他们的资金直接用于项目。
此前,基金会并不允许这样做,因为正如 Bryce 指出的那样,它可能会产生混合激励和付费游戏动态,而该组织一直试图避免这种情况。然而,社区对支持特定项目有很大的兴趣,这是有道理的,因为该基金会现在拥有更多种类的项目,但并不是每个成员都对每个项目进行了投入了大量精力
此前,基金会并不允许这样做,因为正如 Bryce 指出的那样,它可能会产生混合激励和付费游戏动态,而该组织一直试图避免这种情况。然而,社区对支持特定项目有很大的兴趣,这是有道理的,因为该基金会现在拥有更多种类的项目,但并不是每个成员都对每个项目进行了大量投入。
Bryce 表示,基金会的领导层和董事会,花费了大量时间来考虑,如何使基金会的核心原则与这种新模式相协调。因此,该模型试图将过去十年运行良好的 OpenStack/OpenInfra 技术治理模型的优点,与这些新的财务考虑相结合。
在这种“定向资助”模式下每个新项目都将拥有自己的法人实体来持有项目资金。为确保新项目的合法性OpenInfra Platinum 会员(目前为 9 家包括蚂蚁集团、华为、Meta、微软和红帽必须担任项目的发起人之后其他组织才能加入项目基金。如果赞助公司还不是 OpenInfra 成员,则必须成为其中的成员。然后所有这些资助成员组成一个项目基金管理委员会决定创建预算的费用。与此同时OpenInfra 基金会将为这些项目提供社区建设服务。
在这种“定向资助”模式下每个新项目都将拥有自己的法人实体来持有项目资金。为确保新项目的合法性OpenInfra 白金会员(目前为 9 家包括蚂蚁集团、华为、Meta、微软和红帽必须担任项目的发起人之后其他组织才能加入项目基金。如果赞助公司还不是 OpenInfra 成员则必须成为成员。然后所有这些资助成员组成一个项目基金管理委员会决定创建预算的费用。与此同时OpenInfra 基金会将为这些项目提供社区建设服务。
这种新模式暂时只适用于加入基金会的新项目。Bryce 和 Collier 指出,组织可能会在一些现有项目中追溯应用这种新模式,但这个考虑目前不在路线图上。
自从将范围扩展到 OpenStack 之后OpenInfra 基金会增加了一些新项目,例如用于提高容器安全性的 Kata Containers、用于基础设施生命周期管理的 Airship、Startling X 边缘计算堆栈以及 Zuul CI/CD 平台。
自从将范围扩展到 OpenStack 之OpenInfra 基金会增加了一些新项目,例如用于提高容器安全性的 Kata Containers、用于基础设施生命周期管理的 Airship、Startling X 边缘计算堆栈以及 Zuul CI/CD 平台。
“我们从每个成功的项目中学到的最重要的一点是,协作是关键,支持生态系统的范围越广越好,” OpenInfra 基金会总经理 Thierry Carrez 说,“事实上,我们发现最成功的开源项目是由多家公司资助的,因为他们能够整合资源以实现更高的回报率。”
这种新模式显然是 OpenInfra 基金会引入新项目和新成员的一种方式。正如领导团队欣然承认的那样,其在多方生态系统中管理开源项目的模型 —— 无论是通过新的定向资金还是更传统的方法 —— 可能并不适合每个项目。即使 OpenInfra 基金会只收到一小部分项目,随着对这些复杂云基础设施项目需求的增长,开源项目的数量也在增加,同时它们也变得更加复杂。
基金会还宣布了其各个项目的几个里程碑版本,包括 Kata Containers 2.0 版、Zuul 5.0 版和 StarlingX 6.0 的发布
基金会还宣布了其各个项目的几个里程碑版本的发布,包括 Kata Containers 2.0 版、Zuul 5.0 版和 StarlingX 6.0 。
Collier 说:“基金会今年庆祝成立 10 周年,在展望下一个十年的开放基础设施之际,我们正在推动我们的模型如此成功的关键,那就是:将希望合作的公司和个人联合起来,为他们提供一个框架和有效协作的工具,并帮助他们投资资金以最好地帮助他们关心的项目。”
@ -38,7 +38,7 @@ via: https://www.opensourceforu.com/2022/06/openinfra-foundation-launches-direct
作者:[Laveesh Kocher][a]
选题:[lkxed][b]
译者:[lkxed](https://github.com/lkxed)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,43 @@
[#]: subject: "Adobe Launches Open Source Toolkit To Contain Visual Misinformation"
[#]: via: "https://www.opensourceforu.com/2022/06/adobe-launches-open-source-toolkit-to-contain-visual-misinformation/"
[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Adobe Launches Open Source Toolkit To Contain Visual Misinformation
======
![adobe][1]
Adobe envisions a web littered with photos and videos labelled with information about where they came from. The companys primary goal is to reduce the spread of visual misinformation, but the system could also benefit content creators who want to keep their names associated with their work.
Adobes Content Authenticity Initiative (CAI) project, first announced in 2019, has since released a whitepaper on a technology to do just that, integrated the system into its own software, and partnered with newsrooms and hardware makers to help universalize its vision.
The company is now announcing the release of a three-part open source toolkit to get the technology into the hands of developers and out into the wild. Adobes new open source tools include a JavaScript SDK for developing ways to display content credentials in browsers, a command line utility, and a Rust SDK for developing desktop apps, mobile apps, and other experiences for creating, viewing, and verifying embedded content credentials.
In the same way that EXIF data stores information about aperture and shutter speed, the new standard also records information about a files creation, such as how it was created and edited. And if the companys shared vision comes true, that metadata, which Adobe refers to as “content credentials,” will be widely viewable across social media platforms, image search platforms, image editors, search engines.
C2PA is the result of a collaboration between Adobes CAI and partners such as Microsoft, Sony, Intel, Twitter, and the BBC. The Wall Street Journal, Nikon, and the Associated Press have recently joined Adobes pledge to make content authentication more widely available.
With the new tools, a social media platform could use Adobes JavaScript to quickly have all of its images and videos display the content credentials, which appear as a mouse-over icon in the upper-right corner. Instead of requiring a dedicated team and a larger software buildout, that implementation could be completed in a few weeks by a couple of developers.
The CAIs primary goal is to combat visual misinformation on the internet, such as recirculated old images distorting the Ukrainian war or the infamous Nancy Pelosi “cheapfake.” However, a digital chain of custody could also benefit content creators who have had their work stolen or sold, a problem that has plagued visual artists for years and is now causing problems in NFT markets.
According to Parsons, the CAI is also attracting a surprising amount of interest from companies that create synthetic images and videos. Companies can ensure that generative images arent easily mistaken for the real thing by embedding origin metadata into the kind of AI creations were seeing from models like DALL-E.
--------------------------------------------------------------------------------
via: https://www.opensourceforu.com/2022/06/adobe-launches-open-source-toolkit-to-contain-visual-misinformation/
作者:[Laveesh Kocher][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.opensourceforu.com/author/laveesh-kocher/
[b]: https://github.com/lkxed
[1]: https://www.opensourceforu.com/wp-content/uploads/2022/06/adobe.jpeg

View File

@ -0,0 +1,37 @@
[#]: subject: "Thunderbird, The Open Source Email Client, Is Coming To Android"
[#]: via: "https://www.opensourceforu.com/2022/06/thunderbird-the-open-source-email-client-is-coming-to-android/"
[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Thunderbird, The Open Source Email Client, Is Coming To Android
======
![android-developer][1]
Thunderbird, the open source email client, is coming to Android via the K-9 Mail Android email app project, which is merging with Thunderbird to form the Thunderbird Android email app. Thunderbird was moved to the Mozilla Foundations subsidiary MZLA Technologies Corporation two years ago, in a similar ownership structure to Firefox under the foundations subsidiary, Mozilla Corporation. With new features such as OpenPGP end-to-end encryption and a long-awaited mobile app, the Thunderbird project was able to forge its own path.
According to the Thunderbird team, discussions began in 2018 between Thunderbird product manager Ryan Lee Sipes and K-9s lead maintainer Christian Ketterer about a possible collaboration for a Thunderbird email app. In 2022, the two have decided that rather than Thunderbird developing its own app from scratch, K-9 should simply join Thunderbird.
“Many Thunderbird users have asked for a Thunderbird experience on mobile, which we intend to provide by helping make K-9 amazing (and turning it into Thunderbird on Android). K-9 will supplement the Thunderbird experience and enhance where and how users are able to have a great email experience. Our commitment to desktop Thunderbird is unchanged, most of our team is committed to making that a best-in-class email client and it will remain that way,” Thunderbird said.
K-9 isnt a particularly popular email app on Google Play, but it has received 5 million downloads. K-9 Mails roadmap currently includes: account setup using Thunderbird account auto-configuration; improved folder management; message filter support; and syncing between desktop and mobile Thunderbird. While Thunderbird acknowledges that there has been interest in a Thunderbird app for iOS, the project only states in a FAQ that it is “evaluating” the possibility.
The Thunderbird team also intends to include Firefox Sync as a method for syncing accounts between Thunderbird and K-9 Mail. This should go into effect in the summer of 2023. The project is also investigating which Thunderbird features to bring to the Android app, such as calendar, task, feed, and chat support.
--------------------------------------------------------------------------------
via: https://www.opensourceforu.com/2022/06/thunderbird-the-open-source-email-client-is-coming-to-android/
作者:[Laveesh Kocher][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.opensourceforu.com/author/laveesh-kocher/
[b]: https://github.com/lkxed
[1]: https://www.opensourceforu.com/wp-content/uploads/2022/06/android-developer.jpg

View File

@ -1,56 +0,0 @@
[#]: subject: "6 easy ways to make your first open source contribution with LibreOffice"
[#]: via: "https://opensource.com/article/22/5/first-open-source-contribution-libreoffice"
[#]: author: "Klaatu https://opensource.com/users/klaatu"
[#]: collector: "lkxed"
[#]: translator: "lkskjjk"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
6 easy ways to make your first open source contribution with LibreOffice
======
May 2022 is LibreOffice month. Here are some easy ways to make your first open source contribution.
![Dandelion zoomed in][1]
(Photo by Rob Tiller, CC BY-SA 4.0)
"Getting involved" with open source can seem a little confusing. Where do you go to get started? What if you don't know how to code? Who do you talk to? How does anybody know that you have contributed, and besides that does anybody care?
There are actually answers to questions like those (your choice, it's OK, nobody, you tell them, yes) but during the month of May 2022, there's one simple answer: LibreOffice. This month is a month of participation at LibreOffice and its governing body, The Document Foundation. They're inviting contributors of all sorts to help in any of six different ways, and only one of those has anything at all to do with code. No matter what your skill, you can probably find a way to help the world's greatest office suite.
### 6 ways to contribute to LibreOffice
Here's what you can do:
* Handy Helper: Go answer questions from other LibreOffice users on Ask LibreOffice. If you're an avid user of LibreOffice and think you have useful tips and tricks that will help others, this is the role you've been waiting for.
* First Responder: Bug reports are better when they're confirmed by more than just one user. If you're good at installing software (sometimes bug reports are for older versions than what you might be using normally) then go to the LibreOffice Bugzilla and find new bugs that have yet to be confirmed. When you find one, try to replicate what's been reported. Assuming you can do that, add a comment like “CONFIRMED on Linux (Fedora 35) and LibreOffice 7.3.2”.
* Drum Beater: Open source projects rarely have big companies funneling marketing money into promoting them. It would be nice if all the companies claiming to love open source would help out, but not all of them do, so why not lend your voice? Get on social media and tell your friends why you love LibreOffice, or what youre using it for (and of course add the #libreoffice hashtag.)
* Globetrotter: LibreOffice is already available in many different languages, but not literally all languages. And LibreOffice is actively being developed, so its interface translations need to be kept up-to-date. Get involved here.
* Docs Doctor: LibreOffice has online help as well as user handbooks. If you're great at explaining things to other people, or if you're great at proof-reading other people's documentation, then you should contact the docs team.
* Code Cruncher: You're probably not going to dive into LibreOffice's code base and make major changes right away, but that's not generally what projects need. If you know how to code, then you can join the developer community by following the instructions on this wiki page.
```
#libreoffice
```
### Free stickers
I didn't want to mention this up-front because obviously you should get involved with LibreOffice just because you're excited to get involved with a great open source project. However, you're going to find out eventually so I may as well tell you: By contributing to LibreOffice, you can sign up to get free stickers from The Document Foundation. Surely you've been meaning to [decorate your laptop][2]?
Don't get distracted by the promise of loot, though. If you're confused but excited to get involved with open source, this is a great opportunity to do so. And it is representative of how you get involved with open source in general: You look for something that needs to be done, you do it, and then you talk about it with others so you can get ideas for what you can do next. Do that often enough, and you find your way into a community. Eventually, you stop wondering how to get involved with open source, because you're too busy contributing!
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/5/first-open-source-contribution-libreoffice
作者:[Klaatu][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/klaatu
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/dandelion_zoom.jpg
[2]: https://opensource.com/business/15/11/open-source-stickers

View File

@ -1,142 +0,0 @@
[#]: subject: "7 pieces of Linux advice for beginners"
[#]: via: "https://opensource.com/article/22/5/linux-advice-beginners"
[#]: author: "Opensource.com https://opensource.com/users/admin"
[#]: collector: "lkxed"
[#]: translator: "lightchaserhy"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
7 pieces of Linux advice for beginners
======
We asked our community of writers for the best advice they got when they first started using Linux.
![Why the operating system matters even more in 2017][1]
Image by: Internet Archive Book Images. Modified by Opensource.com. CC BY-SA 4.0
What advice would you give a new Linux user? We asked our community of writers to share their favorite Linux advice.
### 1. Use Linux resources
My brother told me that Linux was like a "software erector set" (that's a dated reference to the old Erector sets that could be purchased in the 1950s and 1960s) which was a helpful metaphor. I was using Windows 3.1 and Windows NT at the time and was trying to build a useful and safe K-12 school district website. This was in 2001 and 2002 and there were very few texts or resources on the web that were helpful. One of the resources recommended was the "Root Users Guide," a very large book that had lots of printed information in it but was tough to decipher and know just how to proceed.
One of the most useful resources for me was an online course that Mandrake Linux maintained. It was a step-by-step explanation of the nuances of using and administering a Linux computer or server. I used that along with a listserv that Red Hat maintained in those days, where you could pose questions and get answers.
—— [Don Watkins][2]
### 2. Ask the Linux community for help
My advice is to ask questions, in all of their settings. You can start out with an Internet search, looking for others who have had the same or similar questions (maybe even better questions.) It takes a while to know what to ask and how to ask it.
Once you become more familiar with Linux, check through the various forums out there, to find one or more that you like, and again, before you ask something yourself, look to see if someone else has already had the question and had it answered.
Getting involved in a mail list is also helpful, and eventually, you may find yourself knowledgeable enough to answer some questions yourself. As they say, you learn the most about something by becoming able to answer someone else's questions about it.
Meanwhile, you also become more familiar with using a system that's not a black box that you never understand how something is done except by paying for it.
—— [Greg Pittman][3]
My advice is to get familiar with help utilities such as man and info.  Also, spend as much time as possible at the command line interface and really get used to the fundamental UNIX design. As a matter of fact, one of my favorite books is a UNIX book from the 80s because it really helps in understanding files, directories, devices, basic commands, and more.
—— [Alan Formy-Duval][4]
The best advice I got was to trust the community with answers and manual pages for detailed information and "how-to" use different options. However, I started off around 2009-ish, there were a lot of tools and resources available, including a project called [Linux from Scratch (LFS)][5]. This project really taught me a lot about the internals and how to actually build an LFS image.
—— [Sumantro Mukherjee][6]
My advice is to read. Using places like [Ask Fedora][7] or the Fedora Matrix chat or other forum type areas. Just read what others are saying, and trying to fix. I learned a lot from just reading what others were struggling with, and then I would try to figure out how the issue was caused.
—— [Steve Morris][8]
### 3. Try dual booting
I started with a dual-boot system in the late 90s (Windows and Linux), and while I wanted to really use Linux, I ended up booting Windows to work in my familiar desktop environment. One of the best pieces of advice was to change the boot order, so every time I wasn't quick enough, I ended up using Linux. ;)
—— [Heike Jurzik][9]
I was challenged by one of my team to do a knowledge swap.
He (our Linux sysadmin) built his website in **Joomla!** (which our web team specialized in, and he wanted to know more about) and I adopted Linux (having been Windows only to that point.) We dual booted to start with, as I still had a bunch of OS-dependent software I needed to use for the business, but it jump-started my adoption of Linux.
It was really helpful to have each other as an expert to call on while we were each learning our way into the new systems, and quite a challenge to keep going and not give up because he hadn't!
I did have a big sticky note on my monitor saying "anything with `rm`  in the command, ask first" after a rather embarrassing blunder early on. He wrote a command-line cheat sheet (there are dozens [online now][10]) for me, which really helped me get familiar with the basics. I also started with the [KDE version][11] of Ubuntu, which I found really helpful as a novice used to working with a GUI.
I've used Linux ever since (aside from my work computer) and he's still on Joomla, so it seemed to work for both of us!
—— [Ruth Cheesley][12]
### 4. Back it up for safety
My advice is to use a distro with an easy and powerful backup app. A new Linux user will touch, edit, destroy and restore configurations. They probably will reach a time when their OS will not boot and losing data is frustrating.
With a backup app, they're always sure that their data is safe.
We all love Linux because it allows us to edit everything, but the dark side of this is that making fatal errors is always an option.
—— [Giuseppe Cassibba][13]
### 5. Share the Linux you know and use
My advice is to share the Linux you use. I used to believe the hype that there were distributions that were "better" for new users, so when someone asked me to help them with Linux, I'd show them the distro "for new users." Invariably, this resulted in me sitting in front of their computer looking like I had never seen Linux before myself, because something would be just unfamiliar enough to confuse me.  Now when someone asks about Linux, I show them how to use what I use. It may not be branded as the "best" Linux for beginners, but it's the distro I know best, so when their problems become mine, I'm able to help solve them (and sometimes I learn something new, myself.)
—— [Seth Kenlon][14]
There was a saying back in the old days, "Do not just use a random Linux distro from a magazine cover. Use the distro your friend is using, so you can ask for help when you need it." Just replace "from a magazine cover" with "off the Internet" and it's still valid :-) I never followed this advice, as I was the only Linux user in a 50km radius. Everyone else was using FreeBSD, IRIX, Solaris, and Windows 3.11 around me. Later I was the one people were asking for Linux help.
—— [Peter Czanik][15]
### 6. Keep learning Linux
I was a reseller partner prior to working at Red Hat, and I had a few home health agencies with traveling nurses. They used a quirky package named Carefacts, originally built for DOS, that always got itself out of sync between the traveling laptops and the central database.
The best early advice I heard was to take a hard look at the open source movement. Open source is mainstream in 2022, but it was revolutionary a generation ago when nonconformists bought Red Hat Linux CDs from retailers. Open source turned conventional wisdom on its ear. I learned it was not communism and not cancer, but it scared powerful people.
My company built its first customer firewall in the mid-1990s, based on Windows NT and a product from Altavista. That thing regularly crashed and often corrupted itself. We built a Linux-based firewall for ourselves and it never gave us a problem. And so, we replaced that customer Altavista system with a Linux-based system, and it ran trouble-free for years. I built another customer firewall in late 1999. It took me three weeks to go through a book on packet filtering and get the `ipchains` commands right. But it was beautiful when I finally finished, and it did everything it was supposed to do. Over the next 15+ years, I built and installed hundreds more, now with `iptables` ; some with bridges or proxy ARP and QOS to support video conferencing, some with [IPSEC][16] and [OpenVPN tunnels][17]. I got pretty good at it and earned a living managing individual firewalls and a few active/standby pairs, all with Windows systems behind them. I even built a few virtual firewalls.
But progress never stops. By 2022, [iptables is obsolete][18] and my firewall days are a fond memory.
The ongoing lesson? Never stop exploring.
—— [Greg Scott][19]
### 7. Enjoy the process
Be patient. Linux is a different system than what you are used to, be prepared for a new world of endless possibilities. Enjoy it.
—— [Alex Callejas][20]
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/5/linux-advice-beginners
作者:[Opensource.com][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/admin
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/yearbook-haff-rx-linux-file-lead_0.png
[2]: https://opensource.com/users/don-watkins
[3]: https://opensource.com/users/greg-p
[4]: https://opensource.com/users/alanfdoss
[5]: https://linuxfromscratch.org/
[6]: https://opensource.com/users/sumantro
[7]: https://ask.fedoraproject.org
[8]: https://opensource.com/users/smorris12
[9]: https://opensource.com/users/hej
[10]: https://opensource.com/downloads/linux-common-commands-cheat-sheet
[11]: https://opensource.com/article/22/2/why-i-love-linux-kde
[12]: https://opensource.com/users/rcheesley
[13]: https://opensource.com/users/peppe8o
[14]: https://opensource.com/users/seth
[15]: https://opensource.com/users/czanik
[16]: https://www.redhat.com/sysadmin/run-your-own-vpn-libreswan
[17]: https://opensource.com/article/21/8/openvpn-server-linux
[18]: https://opensource.com/article/19/7/make-linux-stronger-firewalls
[19]: https://opensource.com/users/greg-scott
[20]: https://opensource.com/users/darkaxl

View File

@ -1,128 +0,0 @@
[#]: subject: "Why Do Enterprises Use and Contribute to Open Source Software"
[#]: via: "https://www.linux.com/news/why-do-enterprises-use-and-contribute-to-open-source-software/"
[#]: author: "Dan Whiting https://www.linuxfoundation.org/blog/why-do-enterprises-use-and-contribute-to-open-source-software/"
[#]: collector: "lkxed"
[#]: translator: "aREversez"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Why Do Enterprises Use and Contribute to Open Source Software
======
When people find out I work at the Linux Foundation they invariably ask what we do? Sometimes it is couched around the question, As in the Linux operating system? I explain open source software and try to capture the worldwide impact into 20 seconds before I lose their attention. If they happen to stick around for more, we often dig into the question, Why would enterprises want to participate in open source software projects or use open source software? The reality is they do, whether they know it or not. And the reality is thousands of companies donate their code to open source projects and invest time and resources helping to further develop and improve open source software.
### How extensively used is open source software
To quote from our recently released report, A Guide to Enterprise Open Source, “Open source software (OSS) has transformed our world and become the backbone of our digital economy and the foundation of our digital world. From the Internet and the mobile apps we use daily to the operating systems and programming languages we use to build the future, OSS has played a vital role. It is the lifeblood of the technology industry. Today, OSS powers the digital economy and enables scientific and technological breakthroughs that improve our lives. Its in our phones, our cars, our airplanes, our homes, our businesses, and our governments. But just over two decades ago, few people had ever heard of OSS, and its use was limited to a small group of dedicated enthusiasts.”
Open source software (OSS) has transformed our world and become the backbone of our digital economy and the foundation of our digital world.
But what does this look like practically:
* In vertical software stacks across industries, open source penetration ranges from 20 to 85 percent of the overall software used.
* Linux fuels 90%+ of web servers and Internet-connected devices.
* The Android mobile operating system is built on the Linux kernel.
* Immensely [popular libraries and tools][1] to build web applications, such as: AMP, Appium, Dojo, jQuery, Marko, Node.js and so many more are open source.
* The worlds top 100 supercomputers run Linux.
* 100% of mainframe customers use Linux.
* The major cloud-service providers AWS, Google, and Microsoft all utilize open-source software to run their services and host open-source solutions delivered through the cloud.
### Why do companies want to participate in open source software projects
Companies primarily participate in open source software projects in three ways:
* They donate software they created to the open source community.
* They provide direct funding and/or allocate software developers and other staff to contribute to open source software projects
The question often asked is, why wouldnt they want to keep all of their software proprietary or only task their employees to work on their proprietary software?
The 30,000-foot answer is that it is about organizations coming together to collectively solve common problems so they can separately innovate and differentiate on top of the common baseline. They see that they are better off pooling resources to make the baseline better. Sometimes it is called “coopetition.” It generally means that while companies may be in competition with each other in certain areas, they can still cooperate on others.
It is about organizations coming together to collectively solve common problems so they can separately innovate and differentiate
Some old-school examples of this principle:
* Railroads agreed on a common track size and build so they can all utilize the same lines and equipment was interchangeable.
* Before digital cameras, companies innovated and differentiated on film and cameras, but they all agreed on the spacing for the sprockets to advance the film.
* The entertainment industry united around the VHS and Blu-Ray formats over their rivals.
Now, we see companies, organizations, and individuals coming together to solve problems while simultaneously improving their businesses and products:
[Lets Encrypt][2] is a free, automated, and open certificate authority with the goal of dramatically increasing the use of secure web protocols by making it much easier and less expensive to setup. They are serving 225+ million websites, issuing ~1.5 million certificates each day on average.
The [Academy Software Foundation][3] [creates value in the film industry][4] through collectively engineering software that powers much of the entertainment, gaming, and media industry productions and open standards needed for growth.
The Hyperledger Foundation hosts enterprise-grade blockchain software projects, notably [using significantly fewer energy resources][5] than other popular solutions.
[LF Energy][6] is [making the electric grid more modular, interoperable, and scalable][7] to help increase the use of renewable energy sources.
[Dronecode][8] is enabling the development of drone software so companies can use their resources to innovate further.
[OpenSSF][9] is the top technology companies coming together to strengthen the security and resiliency of open source software.
[Kubernetes][10] was donated by Google and is the go-to solution for managing cloud-based software.
These are just a small sampling of the open source software projects that enterprises are participating in. You can explore all of the ones hosted at the Linux Foundation [here][11].
### How can companies effectively use and participate in open source software projects?
Enterprises looking to better utilize and participate in open source projects can look to the Linux Foundations resources to help. Much of what organizations need to know is provided in the just-published report,[A Guide to Enterprise Open Source][12]. The report is packed with information and insights from open source leaders at top companies with decades of combined experience. It includes chapters on these topics:
* Leveraging Open Source Software
* Preparing the Enterprise for Open Source
* Developing an Open Source Strategy
* Setting Up Your Infrastructure for Implementation
* Setting Up Your Talent for Success
* Challenges
Additionally, the Linux Foundation offers many open source [training courses][13], [events][14] throughout the year, the [LFX Platform][15], and hosts projects that help organizations manage open source utilization and participation, such as:
The [TODO Group][16] provides resources to setup and run an open source program office, including their [extensive guides][17].
The [Openchain Project][18] maintains an international standard for sharing what software package licenses are included in a larger package, including information on the various licensing requirements so enterprises can ensure they are complying with all of the legal requirements.
The [FinOps Foundation][19] is fostering an, “evolving cloud financial management discipline and cultural practice that enables organizations to get maximum business value by helping engineering, finance, technology, and business teams to collaborate on data-driven spending decisions.”.
The [Software Data Package Exchange (SPDX)][20] is an open standard for communication software bill of materials (SBOMs) so it is clear to every user which pieces of software are included in the overall package.
Again, this is just a snippet of the projects at the Linux Foundation that are working to help organizations adapt, utilize, contribute, and donate open source projects.
The bottom line: Enterprises are increasingly turning to open source software projects to solve common problems and innovate beyond the baseline, and the Linux Foundation is here to help.
The post [Why Do Enterprises Use and Contribute to Open Source Software][21] appeared first on [Linux Foundation][22].
--------------------------------------------------------------------------------
via: https://www.linux.com/news/why-do-enterprises-use-and-contribute-to-open-source-software/
作者:[Dan Whiting][a]
选题:[lkxed][b]
译者:[aREversez](https://github.com/aREversez)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.linuxfoundation.org/blog/why-do-enterprises-use-and-contribute-to-open-source-software/
[b]: https://github.com/lkxed
[1]: https://openjsf.org/projects/
[2]: https://letsencrypt.org/
[3]: https://www.aswf.io/
[4]: https://linuxfoundation.org/tools/open-source-in-entertainment/
[5]: https://linuxfoundation.org/tools/carbon-footprint-of-nfts/
[6]: https://www.lfenergy.org/
[7]: https://linuxfoundation.org/tools/paving-the-way-to-battle-climate-change-how-two-utilities-embraced-open-source-to-speed-modernization-of-the-electric-grid/
[8]: https://www.dronecode.org/projects/
[9]: https://openssf.org/
[10]: https://kubernetes.io/
[11]: https://linuxfoundation.org/projects/
[12]: https://linuxfoundation.org/tools/guide-to-enterprise-open-source/
[13]: https://training.linuxfoundation.org/
[14]: https://events.linuxfoundation.org/
[15]: https://lfx.linuxfoundation.org/
[16]: https://todogroup.org/
[17]: https://linuxfoundation.org/resources/open-source-guides/
[18]: https://www.openchainproject.org/resources
[19]: https://www.finops.org/introduction/what-is-finops/
[20]: https://spdx.dev/
[21]: https://www.linuxfoundation.org/blog/why-do-enterprises-use-and-contribute-to-open-source-software/
[22]: https://www.linuxfoundation.org/

View File

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

View File

@ -1,393 +0,0 @@
[#]: subject: (Create a countdown clock with a Raspberry Pi)
[#]: via: (https://opensource.com/article/21/3/raspberry-pi-countdown-clock)
[#]: author: (Chris Collins https://opensource.com/users/clcollins)
[#]: collector: (lujun9972)
[#]: translator: ( Donkey-Hao )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Create a countdown clock with a Raspberry Pi
======
Start counting down the days to your next holiday with a Raspberry Pi
and an ePaper display.
![Alarm clocks with different time][1]
For 2021, [Pi Day][2] has come and gone, leaving fond memories and [plenty of Raspberry Pi projects][3] to try out. The days after any holiday can be hard when returning to work after high spirits and plenty of fun, and Pi Day is no exception. As we look into the face of the Ides of March, we can long for the joys of the previous, well, day. But fear no more, dear Pi Day celebrant! For today, we begin the long countdown to the next Pi Day!
OK, but seriously. I made a Pi Day countdown timer, and you can too!
A while back, I purchased a [Raspberry Pi Zero W][4] and recently used it to [figure out why my WiFi was so bad][5]. I was also intrigued by the idea of getting an ePaper display for the little Zero W. I didn't have a good use for one, but, dang it, it looked like fun! I purchased a little 2.13" [Waveshare display][6], which fit perfectly on top of the Raspberry Pi Zero W. It's easy to install: Just slip the display down onto the Raspberry Pi's GIPO headers and you're good to go.
I used [Raspberry Pi OS][7] for this project, and while it surely can be done with other operating systems, the `raspi-config` command, used below, is most easily available on Raspberry Pi OS.
### Set up the Raspberry Pi and the ePaper display
Setting up the Raspberry Pi to work with the ePaper display requires you to enable the Serial Peripheral Interface (SPI) in the Raspberry Pi software, install the BCM2835 C libraries (to access the GPIO functions for the Broadcom BCM 2835 chip on the Raspberry Pi), and install Python GPIO libraries to control the ePaper display. Finally, you need to install the Waveshare libraries for working with the 2.13" display using Python.
Here's a step-by-step walkthrough of how to do these tasks.
#### Enable SPI
The easiest way to enable SPI is with the Raspberry Pi `raspi-config` command. The SPI bus allows serial data communication to be used with devices—in this case, the ePaper display:
```
`$ sudo raspi-config`
```
From the menu that pops up, select **Interfacing Options** -&gt; **SPI** -&gt; **Yes** to enable the SPI interface, then reboot.
#### Install BCM2835 libraries
As mentioned above, the BCM2835 libraries are software for the Broadcom BCM2385 chip on the Raspberry Pi, which allows access to the GPIO pins and the ability to use them to control devices.
As I'm writing this, the latest version of the Broadcom BCM 2835 libraries for the Raspberry Pi is v1.68. To install the libraries, you need to download the software tarball and build and install the software with `make`:
```
# Download the BCM2853 libraries and extract them
$ curl -sSL <http://www.airspayce.com/mikem/bcm2835/bcm2835-1.68.tar.gz> -o - | tar -xzf -
# Change directories into the extracted code
$ pushd bcm2835-1.68/
# Configure, build, check and install the BCM2853 libraries
$ sudo ./configure
$ sudo make check
$ sudo make install
# Return to the original directory
$ popd
```
#### Install required Python libraries
You also need some Python libraries to use Python to control the ePaper display, the `RPi.GPIO` pip package. You also need the `python3-pil` package for drawing shapes. Apparently, the PIL package is all but dead, but there is an alternative, [Pillow][8]. I have not tested Pillow for this project, but it may work:
```
# Install the required Python libraries
$ sudo apt-get update
$ sudo apt-get install python3-pip python3-pil
$ sudo pip3 install RPi.GPIO
```
_Note: These instructions are for Python 3. You can find Python 2 instructions on Waveshare's website_
#### Download Waveshare examples and Python libraries
Waveshare maintains a Git repository with Python and C libraries for working with its ePaper displays and some examples that show how to use them. For this countdown clock project, you will clone this repository and use the libraries for the 2.13" display:
```
# Clone the WaveShare e-Paper git repository
$ git clone <https://github.com/waveshare/e-Paper.git>
```
If you're using a different display or a product from another company, you'll need to use the appropriate software for your display.
Waveshare provides instructions for most of the above on its website:
* [WaveShare ePaper setup instructions][9]
* [WaveShare ePaper libraries install instructions][10]
#### Get a fun font (optional)
You can display your timer however you want, but why not do it with a little style? Find a cool font to work with!
There's a ton of [Open Font License][11] fonts available out there. I am particularly fond of Bangers. You've seen this if you've ever watched YouTube—it's used _all over_. It can be downloaded and dropped into your user's local shared fonts directory to make it available for any application, including this project:
```
# The "Bangers" font is a Open Fonts License licensed font by Vernon Adams (<https://github.com/vernnobile>) from Google Fonts
$ mkdir -p ~/.local/share/fonts
$ curl -sSL <https://github.com/google/fonts/raw/master/ofl/bangers/Bangers-Regular.ttf> -o fonts/Bangers-Regular.ttf
```
### Create a Pi Day countdown timer
Now that you have installed the software to work with the ePaper display and a fun font to use, you can build something cool with it: a timer to count down to the next Pi Day!
If you want, you can just grab the [countdown.py][12] Python file from this project's [GitHub repo][13] and skip to the end of this article.
For the curious, I'll break down that file, section by section.
#### Import some libraries
```
#!/usr/bin/python3
# -*- coding:utf-8 -*-
import logging
import os
import sys
import time
from datetime import datetime
from pathlib import Path
from PIL import Image,ImageDraw,ImageFont
logging.basicConfig(level=logging.INFO)
basedir = Path(__file__).parent
waveshare_base = basedir.joinpath('e-Paper', 'RaspberryPi_JetsonNano', 'python')
libdir = waveshare_base.joinpath('lib')
```
At the start, the Python script imports some standard libraries used later in the script. You also need to add `Image`, `ImageDraw`, and `ImageFont` from the PIL package, which you'll use to draw some simple geometric shapes. Finally, set some variables for the local `lib` directory that contains the Waveshare Python libraries for working with the 2.13" display, and which you can use later to load the library from the local directory.
#### Font size helper function
The next part of the script has a helper function for setting the font size for your chosen font: Bangers-Regular.ttf. It takes an integer for the font size and returns an ImageFont object you can use with the display:
```
def set_font_size(font_size):
    logging.info("Loading font...")
    return ImageFont.truetype(f"{basedir.joinpath('Bangers-Regular.ttf').resolve()}", font_size)
```
#### Countdown logic
Next is a small function that calculates the meat of this project: how long it is until the next Pi Day. If it were, say, January, it would be relatively straightforward to count how many days are left, but you also need to consider whether Pi Day has already passed for the year (sadface), and if so, count how very, very many days are ahead until you can celebrate again:
```
def countdown(now):
    piday = datetime(now.year, 3, 14)
    # Add a year if we're past PiDay
    if piday &lt; now:
        piday = datetime((now.year + 1), 3, 14)
    days = (piday - now).days
    logging.info(f"Days till piday: {days}")
    return day
```
#### The main function
Finally, you get to the main function, which initializes the display and begins writing data to it. In this case, you'll write a welcome message and then begin the countdown to the next Pi Day. But first, you need to load the Waveshare library:
```
def main():
    if os.path.exists(libdir):
        sys.path.append(f"{libdir}")
        from waveshare_epd import epd2in13_V2
    else:
        logging.fatal(f"not found: {libdir}")
        sys.exit(1)
```
The snippet above checks to make sure the library has been downloaded to a directory alongside the countdown script, and then it loads the `epd2in13_V2` library. If you're using a different display, you will need to use a different library. You can also write your own if you are so inclined. I found it kind of interesting to read the Python code that Waveshare provides with the display. It's considerably less complicated than I would have imagined it to be, if somewhat tedious.
The next bit of code creates an EPD (ePaper Display) object to interact with the display and initializes the hardware:
```
    logging.info("Starting...")
    try:
        # Create an a display object
        epd = epd2in13_V2.EPD()
        # Initialize the displace, and make sure it's clear
        # ePaper keeps it's state unless updated!
        logging.info("Initialize and clear...")
        epd.init(epd.FULL_UPDATE)
        epd.Clear(0xFF)
```
An interesting aside about ePaper: It uses power only when it changes a pixel from white to black or vice-versa. This means when the power is removed from the device or the application stops for whatever reason, whatever was on the screen remains. That's great from a power-consumption perspective, but it also means you need to clear the display when starting up, or your script will just write over whatever is already on the screen. Hence, `epd.Clear(0xFF)` is used to clear the display when the script starts.
Next, create a "canvas" where you will draw the rest of your display output:
```
    # Create an image object
    # NOTE: The "epd.heigh" is the LONG side of the screen
    # NOTE: The "epd.width" is the SHORT side of the screen
    # Counter-intuitive...
    logging.info(f"Creating canvas - height: {epd.height}, width: {epd.width}")
    image = Image.new('1', (epd.height, epd.width), 255)  # 255: clear the frame
    draw = ImageDraw.Draw(image)
```
This matches the width and height of the display—but it is somewhat counterintuitive, in that the short side of the display is the width. I think of the long side as the width, so this is just something to note. Note that the `epd.height` and `epd.width` are set by the Waveshare library to correspond to the device you're using.
#### Welcome message
Next, you'll start to draw something. This involves setting data on the "canvas" object you created above. This doesn't draw it to the ePaper display yet—you're just building the image you want right now. Create a little welcome message celebrating Pi Day, with an image of a piece of pie, drawn by yours truly just for this project:
![drawing of a piece of pie][14]
(Chris Collins, [CC BY-SA 4.0][15])
Cute, huh?
```
    logging.info("Set text text...")
    bangers64 = set_font_size(64)
    draw.text((0, 30), 'PI DAY!', font = bangers64, fill = 0)
    logging.info("Set BMP...")
    bmp = Image.open(basedir.joinpath("img", "pie.bmp"))
    image.paste(bmp, (150,2))
```
Finally, _finally_, you get to display the canvas you drew, and it's a little bit anti-climactic:
```
    logging.info("Display text and BMP")
    epd.display(epd.getbuffer(image))
```
That bit above updates the display to show the image you drew.
Next, prepare another image to display your countdown timer.
#### Pi Day countdown timer
First, create a new image object that you can use to draw the display. Also, set some new font sizes to use for the image:
```
    logging.info("Pi Date countdown; press CTRL-C to exit")
    piday_image = Image.new('1', (epd.height, epd.width), 255)
    piday_draw = ImageDraw.Draw(piday_image)
    # Set some more fonts
    bangers36 = set_font_size(36)
    bangers64 = set_font_size(64)
```
To display a ticker like a countdown, it's more efficient to update part of the image, changing the display for only what has changed in the data you want to draw. The next bit of code prepares the display to function this way:
```
    # Prep for updating display
    epd.displayPartBaseImage(epd.getbuffer(piday_image))
    epd.init(epd.PART_UPDATE)
```
Finally, you get to the timer bit, starting an infinite loop that checks how long it is until the next Pi Day and displays the countdown on the ePaper display. If it actually _is_ Pi Day, you can handle that with a little celebration message:
```
    while (True):
        days = countdown(datetime.now())
        unit = get_days_unit(days)
        # Clear the bottom half of the screen by drawing a rectangle filld with white
        piday_draw.rectangle((0, 50, 250, 122), fill = 255)
        # Draw the Header
        piday_draw.text((10,10), "Days till Pi-day:", font = bangers36, fill = 0)
        if days == 0:
            # Draw the Pi Day celebration text!
            piday_draw.text((0, 50), f"It's Pi Day!", font = bangers64, fill = 0)
        else:
            # Draw how many days until Pi Day
            piday_draw.text((70, 50), f"{str(days)} {unit}", font = bangers64, fill = 0)
        # Render the screen
        epd.displayPartial(epd.getbuffer(piday_image))
        time.sleep(5)
```
The last bit of the script does some error handling, including some code to catch keyboard interrupts so that you can stop the infinite loop with **Ctrl**+**C** and a small function to print "day" or "days" depending on whether or not the output should be singular (for that one, single day each year when it's appropriate):
```
    except IOError as e:
        logging.info(e)
    except KeyboardInterrupt:
        logging.info("Exiting...")
        epd.init(epd.FULL_UPDATE)
        epd.Clear(0xFF)
        time.sleep(1)
        epd2in13_V2.epdconfig.module_exit()
        exit()
def get_days_unit(count):
    if count == 1:
        return "day"
    return "days"
if __name__ == "__main__":
    main()
```
And there you have it! A script to count down and display how many days are left until Pi Day! Here's an action shot on my Raspberry Pi (sped up by 86,400; I don't have nearly enough disk space to save a day-long video):
![Pi Day Countdown Timer In Action][16]
(Chris Collins, [CC BY-SA 4.0][15])
#### Install the systemd service (optional)
If you'd like the countdown display to run whenever the system is turned on and without you having to be logged in and run the script, you can install the optional systemd unit as a [systemd user service][17]).
Copy the [piday.service][18] file on GitHub to `${HOME}/.config/systemd/user`, first creating the directory if it doesn't exist. Then you can enable the service and start it:
```
$ mkdir -p ~/.config/systemd/user
$ cp piday.service ~/.config/systemd/user
$ systemctl --user enable piday.service
$ systemctl --user start piday.service
# Enable lingering, to create a user session at boot
# and allow services to run after logout
$ loginctl enable-linger $USER
```
The script will output to the systemd journal, and the output can be viewed with the `journalctl` command.
### It's beginning to look a lot like Pi Day!
And _there_ you have it! A Pi Day countdown timer, displayed on an ePaper display using a Raspberry Pi Zero W, and starting on system boot with a systemd unit file! Now there are just 350-something days until we can once again come together and celebrate the fantastic device that is the Raspberry Pi. And we can see exactly how many days at a glance with our tiny project.
But in truth, anyone can hold Pi Day in their hearts year-round, so enjoy creating some fun and educational projects with your own Raspberry Pi!
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/3/raspberry-pi-countdown-clock
作者:[Chris Collins][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/clcollins
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/clocks_time.png?itok=_ID09GDk (Alarm clocks with different time)
[2]: https://en.wikipedia.org/wiki/Pi_Day
[3]: https://opensource.com/tags/raspberry-pi
[4]: https://www.raspberrypi.org/products/raspberry-pi-zero-w/
[5]: https://opensource.com/article/21/3/troubleshoot-wifi-go-raspberry-pi
[6]: https://www.waveshare.com/product/displays/e-paper.htm
[7]: https://www.raspberrypi.org/software/operating-systems/
[8]: https://pypi.org/project/Pillow/
[9]: https://www.waveshare.com/wiki/2.13inch_e-Paper_HAT
[10]: https://www.waveshare.com/wiki/Libraries_Installation_for_RPi
[11]: https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL
[12]: https://github.com/clcollins/epaper-pi-ex/blob/main/countdown.py
[13]: https://github.com/clcollins/epaper-pi-ex/
[14]: https://opensource.com/sites/default/files/uploads/pie.png (drawing of a piece of pie)
[15]: https://creativecommons.org/licenses/by-sa/4.0/
[16]: https://opensource.com/sites/default/files/uploads/piday_countdown.gif (Pi Day Countdown Timer In Action)
[17]: https://wiki.archlinux.org/index.php/systemd/User
[18]: https://github.com/clcollins/epaper-pi-ex/blob/main/piday.service

View File

@ -2,7 +2,7 @@
[#]: via: "https://opensource.com/article/21/5/learn-lisp"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: translator: "lkxed"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "

View File

@ -2,7 +2,7 @@
[#]: via: "https://itsfoss.com/love-thy-terminal/"
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: translator: "duoluoxiaosheng"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "

View File

@ -0,0 +1,141 @@
[#]: subject: "Build a Smart Parking System for a Metro Station"
[#]: via: "https://www.opensourceforu.com/2022/06/build-a-smart-parking-system-for-a-metro-station/"
[#]: author: "Dr Maheswari R. https://www.opensourceforu.com/author/dr-maheswari-r/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Build a Smart Parking System for a Metro Station
======
This article will help you design a Web based application that automates a smart parking system for cars in a metro station using Node-RED.
![Smart car parking][1]
A Web application is software that gets executed on a Web server. Every Web application is accessed by the end user through a Web browser. These Web applications are programmed using a client-server architecture, where the user (client) is provided services through a remotely located server that might be hosted by a third-party. A Web API (application programming interface) is available across the Web and can be accessed by the user using the HTTP protocol, as shown in Figure 1.
This article will demonstrate how to design a Web based application for an automated smart parking system for cars in a metro station. It is designed using open source Node-RED. This system creates an interactive and stylish user login form using a template node, where HTML and CSS are coded to get car owner details to automate the parking system. We can see the login and submission form flow diagrams in Figures 2 and 3.
The nodes used are as follows:
**[Metro smart parking node flow design][2]**
Node-RED is triggered using the command node-red. Through the URL *http://127.0.0.1:1880/*, the node-RED UI flow browser is enabled. We have considered that the Node-RED setup is done and working.
![table function][3]
![Figure 1: Web API][4]
Follow the steps given below to create the login and submission forms.
![Figure 2: Login form flow diagram][5]
![Figure 3: Submission form flow diagram][6]
*Login form*
1) From the node palette, drag and drop http in node, which creates an HTTP end point for creating Web services.
2) Connect http in node to function node. The latter helps to code JavaScript functions to run against the messages being received by the node.
![Figure 4: Login form for smart parking for cars][7]
3) Connect function node to template node, where the latter creates a Web API based on the provided template.
4) Connect template node to http response node; the latter sends responses back to requests received from an http input node.
![Figure 5: Submission form for smart parking for cars][8]
**Submission form**
1) Drag and drop http in node and connect it to json node, which converts and communicates the data as JSON string.
2) Connect http in node to debug node, which gives output in a debug monitor.
3) Place and connect json node to function node and connect the latter to http response node.
After the creation of a complete flow, click on the Deploy button in the top right corner of the Node-RED window. To view the user interface, go to the link*127.0.0.1:1880/ui/.*
Once you enter and then click Submit, it will take you to the next page where you can read all the news articles.
**Node-RED workflow**
In a single flow of Node-RED, you can create both the login form and submission form, as shown in Figures 4 and 5.
Now we will configure the Node properties.
*Login form:* Edit the http in property by choosing the method Get and set the URL to /MetroStation and configure the name as Smart Parking.
![Figure 6: Http in node property configurations][9]
| - |
| :- |
| Note: The URL can be any user defined local variable. |
Now select the function node and edit its properties by coding the msg.url = project and configure the name field with Project Submission.
![Figure 7: Function node property configurations][10]
In the Property window of the template node, configure the appropriate HTML code required for the login form and specify the name as Display panel. The Mustache template format is being used in this flow. Mustache is a simple Web template system that is described as a logicless template engine. It does not have any explicit control flow statements, such as if and else conditionals or for loops. Looping and conditional evaluation can be achieved using section tags processing lists and lambdas.
![Figure 8: Template node property configurations][11]
Configure the edit property of http response node with the name Smart Parking (Figure 9).
![Figure 9: Http response node property configurations][12]
*Submission form:*In the edit property window of http in node, choose the method POST and the URL /project.
![Figure 10: Http in node property configurations][13]
In the JSON node edit window, set *Action* as Convert between JSON String & Object. Refer to Figure 11.
![Figure 11: JSON node property configurations][14]
The function node is configured as specified in Figure 12.
![Figure 12: Function node property configurations][15]
In http response node, edit the property name as Project Submitted.
![Figure 13: Http response node property configurations][16]
| - |
| :- |
| Note: Also add the comment node with comments as Login Form and Submission Form |
![Figure 14: Debug node property configurations][17]
**Dashboard UI Web page**
When the user clicks on Submit, the data given will be displayed in the UI and the debug node. If Reset is clicked, the details will be cleared, allowing the user to enter new details (Figure 15).
![Figure 15: User login UI][18]
Metro parking rates are provided through a hyperlink, and the tariff output is displayed in the UI. So the smart parking for cars is automated with appropriate hyperlinks to exhibit the parking tariff at the metro station. The final outputs of this automated system are retrieved and displayed in the Node-RED dashboard UI and debug monitor.
![Figure 16: Metro parking tariff][19]
--------------------------------------------------------------------------------
via: https://www.opensourceforu.com/2022/06/build-a-smart-parking-system-for-a-metro-station/
作者:[Dr Maheswari R.][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.opensourceforu.com/author/dr-maheswari-r/
[b]: https://github.com/lkxed
[1]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Smart-car-parking.jpg
[2]: https://www.opensourceforu.com/wp-content/uploads/2022/04/table-function-node-red.jpg
[3]: https://www.opensourceforu.com/wp-content/uploads/2022/04/table-function-node-red.jpg
[4]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-1-Web-Application-Programming-Interface300.jpg
[5]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-2-Login-Form-Flow-Diagram300.jpg
[6]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-3-Submission-Form-Flow-Diagram300.jpg
[7]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-4-Login-Form-of-Metro-Smart-Car-Parking300.jpg
[8]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-5-Submission-Form-of-Metro-Smart-Car-Parking300.jpg
[9]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-6-Http-in-Node-Property-Configurations300.jpg
[10]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-7-Function-Node-Property-Configurations300.jpg
[11]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-8-Template-Node-Property-Configurations300.jpg
[12]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-9-Template-Node-Property-Configurations300.jpg
[13]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-10-Http-in-Node-Property-Configurations300.jpg
[14]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-11-Json-Node-Property-Configurations300.jpg
[15]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-12-Function-Node-Property-Configurations300.jpg
[16]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-13-Http-Response-Node-Property-Configurations300.jpg
[17]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-14-Debug-Node-Property-Configurations300.jpg
[18]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-15-User-Login-UI300.jpg
[19]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-16-Parking-Tariff-Metro300.jpg

View File

@ -0,0 +1,84 @@
[#]: subject: "Building the metaverse with open source"
[#]: via: "https://opensource.com/article/22/6/open-source-metaverse"
[#]: author: "Liv Erickson https://opensource.com/users/liverickson"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Building the metaverse with open source
======
Ensuring that virtual worlds are open, accessible, and safe to all is paramount to a successful metaverse.
![Why and how to handle exceptions in Python Flask][1]
Image by: Image from Unsplash.com, Creative Commons Zero
The word metaverse has been thrown around a lot these days. Whether you believe it's a reality or not, the adoption of the term has signaled a significant shift in the way people think about the future of online interactions. With today's technological advancements and an increase in geographically distributed social circles, the idea of seamlessly connected virtual worlds as part of a metaverse has never felt more appealing.
Virtual worlds enable a wide range of scenarios, and brings to life a rich and vibrant array of experiences. Students can explore the past by stepping inside a past time period, embodying historic figures, and interacting with buildings that were built centuries ago. [Coworkers][2] can gather for coffee chats, regardless of where in the world they're working. Musicians and artists can interact with fans from around the world in small or large digital venues. Conferences can reach new audiences, and friends can connect to explore interactive spaces.
When we built virtual world platforms (the predecessors to today's metaverse applications) in the past, there was only limited access to powerful graphics hardware, scalable servers, and high-bandwidth network infrastructure. However, recent advancements in cloud computing and hardware optimization have allowed virtual worlds to reach new audiences. The complexity of what we're able to simulate has increased significantly.
Today, there are several companies investing in new online virtual worlds and technologies. To me, this is indicative of a fundamental shift in the way people interact with one another, create, and consume content online.
Some tenets associated with the concept of the metaverse and virtual worlds are familiar through the traditional web, including identity systems, communication protocols, social networks, and online economies. Other elements, though, are newer. The metaverse is already starting to see a proliferation of 3D environments (often created and shared by users), the use of digital bodies, or "avatars", and the incorporation of virtual and augmented reality technology.
### Building virtual worlds the open source way
With this shift in computing paradigms, there's an opportunity to drive forward open standards and projects encouraging the development of decentralized, distributed, and interoperable virtual worlds. This can begin at the hardware level with projects like Razer's [Open source virtual reality (OSVR)][3] schematics encouraging experimentation for headset development, and go all the way up the stack. At the device layer, the Khronos Group's [OpenXR][4] standard has been widely adopted by headset manufacturers, which allows applications and engines to target a single API, with device-specific capabilities supported through extensions.
This allows creators and developers of virtual worlds to focus on mechanics and content. While the techniques used to build 3D experiences aren't new, the increased interest in metaverse applications has resulted in new tools and engines for creating immersive experiences. Although there are many libraries and engines that have differences in how they run their virtual worlds, most virtual worlds share the same underlying development concepts.
At the core of a virtual world is the 3D graphics and simulation engine (such as [Babylon.js][5] and the WebGL libraries it interacts with). This code is responsible for managing the game state of the world, so that interactions manipulating the state of the world are shared between the visitors of the space, and drawing updates to the environment on screen. Game simulation states can include objects in the world and avatar movement, so that when one user moves through a space, everyone else sees it happening in real time. The rendering engine uses the perspective of a virtual camera to draw a 2D image on the screen, mapped to what a user is looking at in digital space.
The video game world is made up of 2D and 3D objects that represent a virtual location. These experiences can vary, ranging from small rooms to entire planets, limited only by the creator's imagination. Inside of the virtual world, objects have *transforms* that instantiate the object to a particular place in the world's 3D coordinate system. The transform represents the object's position, rotation, and scale within the digital environment. These objects, which can have mesh geometry created in a 3D modeling program, materials, and textures assigned to them, can trigger other events in the world, play sounds, or interact with the user.
Once a virtual world has been created, the application renders content to the screen using a virtual camera. Like a camera in the real world, a camera inside of a game engine has a viewport and settings that change the way a frame is captured. For immersive experiences, the camera draws many updates every second (up to 120 frames per second for some high-end virtual reality headsets) to reflect the way you're moving within the space. Virtual reality experiences specifically also require that the camera draws twice: once for each eye, slightly offset by your *interpupillary distance* (the distance between the center of your pupils in each eye).
If camera rendering components of developing a virtual world sound complex, don't fret. Most libraries and frameworks for authoring immersive content have these capabilities available so you can focus on the content and interactivity. Open source game engines, such as [Open 3D Engine (O3de)][6] and [Godot Engine][7] offer these rendering capabilities and many other tools as built-in features. With open source engines, developers have the additional flexibility of extending or changing core systems, which allows for more control over the end experience.
Other key characteristics that make up the metaverse include users taking on digital bodies (often referred to as *avatars*), user-generated content that's created and shared by users of the platform, voice and text chat, and the ability to navigate between differently themed worlds and rooms.
### Approaches to building the metaverse
Before choosing a development environment for building the metaverse, you should consider what tenets are most critical for the types of experiences and worlds your users are going to experience. The first choice you're faced with is whether to target a native experience or the browser. Both have different considerations for how a virtual world unfolds.
A proprietary metaverse necessarily offers limited connections to virtual worlds. Open source and browser-based platforms have emerged, building on top of web standards and operating through the [Khronos group and][8][W3C][9] to ensure interoperability and content portability.
Web applications such as [Mozilla Hubs][10] and Element's [Third Room][11] build on existing web protocols to create open source options for building browser-based virtual world applications. These experiences, linking together 3D spaces embedded into web pages, utilize open source technologies including [three.js][12], [Babylon.js][13], and [A-Frame][14] for content authoring. They also utilize open source realtime communication protocols for voice and synchronized avatar movement.
### Open access
As with all emerging technologies, it's critical to consider the use case and impact to the humans who use it. Immersive virtual and augmented reality devices have unprecedented capabilities to capture, process, store, and utilize data about an individual, including their physical movement patterns, cognitive state, and attention. Additionally, virtual worlds themselves significantly amplify the benefits and problems of today's social media, and require careful implementation of trust and safety systems, moderation techniques, and appropriate access permissions to ensure that users have a positive experience when they venture into these spaces.
As the web evolves and encompasses immersive content and spatial computing devices, it's important to think critically and carefully about the experiences being created, and interoperability across different applications. Ensuring that these virtual worlds are open, accessible, and safe to all is paramount. The prospect of the metaverse is an exciting one, and one that can only be realized through collaborative open source software movements.
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/6/open-source-metaverse
作者:[Liv Erickson][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/liverickson
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/computer_code_programming_laptop.jpg
[2]: https://enterprisersproject.com/article/2022/2/4-metaverse-tools-workplace-collaboration
[3]: https://www2.razer.com/osvr
[4]: https://www.khronos.org/OpenXR/
[5]: https://www.babylonjs.com/community/
[6]: https://www.o3de.org/
[7]: https://godotengine.org/
[8]: https://www.khronos.org
[9]: http://www.w3c.org
[10]: http://github.com/mozilla/hubs/
[11]: https://github.com/matrix-org/thirdroom
[12]: http://threejs.org
[13]: http://babylonjs.com
[14]: http://aframe.io

View File

@ -0,0 +1,235 @@
[#]: subject: "Distrobox: Try Multiple Linux Distributions via the Terminal"
[#]: via: "https://itsfoss.com/distrobox/"
[#]: author: "Pratham Patel https://itsfoss.com/author/pratham/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Distrobox: Try Multiple Linux Distributions via the Terminal
======
Distrobox is a software tool that allows you to run any Linux distribution inside the terminal.
It aims to let you run a variety of software on top of host distribution without any hassle.
For instance, — is there anything that is available only in the AUR and you want to access it from your Ubuntu system? Distrobox can give you that comfort.
### So, what exactly is Distrobox?
![distrobox][1]
Distrobox is a wrapper for `podman` or `docker` (whatever you prefer). The reason Distrobox exists is to integrate the containers within your system, as if it were native software.
A few things that it integrates into are removable devices (USB storage devices), D-Bus, users $HOME directory, Wayland and X11 sockets, and much more!
**Long story short**:
Distrobox is a way to make containerized software integrate like native apps, even if that containerized software belongs to a different distribution altogether.
The best thing about it, you get to build a development environment without requiring root privileges.
You do not have to change your host distribution just because of software compatibility issues. You can keep using what youre comfortable with and use Distrobox to fill the gap for backward/forward software compatibility using any other Linux distribution.
### Features of Distrobox
![distrobox 1][2]
Now that you have an idea about Distrobox, what does it let you do overall? Are the functionalities useful to your use-case?
Let me mention the key highlights for Distrobox:
* Ability to make a test environment for making changes without affecting your host distribution.
* A development environment that does not need sudo privileges can be flexible for your work. For instance, if you have a work laptop, a sudoless setup can help you.
* Easy way to manage multiple environments.
* Supports a variety of distributions.
### How to install Distrobox?
There is a prerequisite for installing Distrobox. That is, you must have either `podman` or `docker` installed. If you have a relatively modern Linux distribution, I recommend installing `podman` from your software repositories. Otherwise, install `docker` and follow the steps mentioned below.
At the time of writing this article, Distrobox is available in the following repositories:
* Arch Linux (AUR)
* EPEL 8 and later
* Fedora 34 and later
* Ubuntu 22.10 and later
As you might have noticed, the latest version of Ubuntu available to the wider public is Ubuntu 22.04. Not many distributions have Distrobox packaged yet…
If you do not find it in the repositories, you can run the following command to install Distrobox:
```
curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/install | sudo sh
```
The above command will download a shell script and run it with superuser privileges. In case you cannot verify the source yourself, below is the command you can use without feeling anxious about granting superuser privilege to an unknown script.
```
curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/install | sh -s -- --prefix ~/.local
```
Now that you have Distrobox installed, let us proceed to a few examples of using it.
### Getting started with Distrobox
Having a screwdriver in your toolbox but never using is not going to improve your craftsmanship. So lets go over a few basic commands to use [Distrobox][3], what they do and more.
Moreover, if you are curious, you can take a look at this video from a fellow YouTuber who tried Distrobox on Fedora Silverblue:
![A Video from YouTube][4]
#### 1. Create a new container
A container in this context refers not to a containerized software like nextcloud, syncthing, etc but rather an operating system itself.
The syntax to create a new container is as follows:
```
distrobox-create --name CONTAINER-NAME --image OS-NAME:VERSION
```
In here, you can specify what name you wish to address your container by (CONTAINER-NAME), the name of OS you want to use (OS-NAME) and its version (VERSION).
Let us take a look at how to create a new container for Fedora 36 with the name **fedoraonfoss**. I will do so with the following command:
```
distrobox-create --name fedoraonfoss --image fedora:36
```
You may also substitute 36 with latest in case you want the latest version of any operating system.
This command will take only a moment to download the container image for Fedora 36.
Once the process finishes, you will get a message letting you know that the container was created.
![Distrobox 'fedoraonfoss' successfully created][5]
#### 2. Start and enter the container
An OS container is of no use if we do not start it and access its shell.
To do so, use the **distrobox-enter** command. The syntax is as following:
```
distrobox-enter CONTAINER-NAME
```
When you start the container for the first time, Distrobox will do an automatic initial setup of installing a few containers, setting up the mounts, themes, icons, fonts, groups, users and more.
Based on your computers processing power, this may take quite a long time. Please be patient for ~15 minutes during the first power-on.
When that is completed, you will be dropped in the shell of the container automatically.
![Entering the 'fedoraonfoss' Distrobox container][6]
If you look carefully, previously, when I ran the command distrobox-enter, the hostname shown on my prompt was itsfoss. Once the initial setup was done, now I am in a shell with a different hostname, that is fedoraonfoss.
Let us also check the VERSION from /etc/os-release file.
![Comparing VERSION string from '/etc/os-release' between Ubuntu and Fedora][7]
#### 3. Install software
If you have reached this stage, this is the equivalent of freshly installing Fedora on your computer and the OS just booted.
Just like a virtual machine, the OS on our host machine does not matter. We have to use the package manager provided by the guest OS. Hence, I will be using the DNF package manager on Fedora 36.
My host operating system, Ubuntu 22.04 LTS, does not [yet] have [Foliate][8] in the first party repositories. But Fedora 36 has Foliate in the first party repositories. This way, I can easily install Foliate as a native software without making use of heavy virtualization.
So, let us install Foliate, since it is available in Fedoras repositories but not in Ubuntus repositories.
I will run the following command (inside the container shell) to install Foliate:
```
sudo dnf install foliate.noarch
```
After dnf finishes installing Foliate, I will run the following command (inside the container shell) as well:
```
distrobox-export --app foliate
```
When you run the **distrobox-export** command from the container, it will make the specified software available to the host operating system as well. This means, even though Foliate is installed inside the Fedora container, I will be able to see it in Ubuntus Application Menu.
![Getting Foliate (installed in Fedora) visible in Ubuntu's Application Menu][9]
As you can see, I have Foliate visible in Ubuntus Application Menu, even though that was installed in a Fedora 36 container.
Isnt that amazing?
#### 4. Integration of Distrobox applications
For the purposes of this demonstration, I have downloaded [The Linux Command Line][10]PDF book, written by William Shotts. It saved it in my Documents directory.
Let us see if a containerized software—that is packaged for a entirely different operating system—reacts to changes like switch from light mode to dark mode. Can it see my ~/Documents directory?
![Testing Foliate if it can pick up theme changes and also my $HOME directory][11]
As you can see, the theme changes are detected correctly, even the top bar has the correct icons for close button and hamburger menu.
On top of that, I do not need to copy my epub file to anywhere else. My ~/Documents directory was also correctly picked up.
Just like a native application!
#### 5. Manage Distrobox images
Distobox provides a few commands that can be used to manage Distrobox images.
The first command is **distrobox list**. As evident from the name, it lists all the containers that are installed.
![Listing all Distrobox containers][12]
Since I have only one container, only fedoraonfoss showed up, even though it exited a few moments ago.
The second command is **distrobox stop**. This command is used to stop a running container.
Below is the syntax:
```
distrobox stop CONTAINER-NAME
```
Finally, to delete any Distrobox container, use the distrobox rm command. The syntax is given below:
```
distrobox rm CONTAINER-NAME
```
To explore more technical details, head to its [GitHub page][13].
### Conclusion
Distrobox is a wonderful tool that allows you to install operating systems as a simple podman/docker container and use them as a full-fledged operating system.
Using Distrobox you can install virtually any software, even if it is not available in your distributions repositories, or even if it is not packaged for your Linux distribution. How useful is that?
There can be various use-cases for Distrobox. What do you think you will be using it for? Share your thoughts in the comments section down below.
--------------------------------------------------------------------------------
via: https://itsfoss.com/distrobox/
作者:[Pratham Patel][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/pratham/
[b]: https://github.com/lkxed
[1]: https://itsfoss.com/wp-content/uploads/2022/06/distrobox.jpg
[2]: https://itsfoss.com/wp-content/uploads/2022/06/distrobox-1.jpg
[3]: https://github.com/89luca89/distrobox
[4]: https://youtu.be/Q2PrISAOtbY
[5]: https://itsfoss.com/wp-content/uploads/2022/05/01_distrobox_create-800x579.webp
[6]: https://itsfoss.com/wp-content/uploads/2022/05/02_distrobox_enter-800x579.webp
[7]: https://itsfoss.com/wp-content/uploads/2022/05/03_distrobox_os_release-800x579.webp
[8]: https://itsfoss.com/foliate-ebook-viewer/
[9]: https://itsfoss.com/wp-content/uploads/2022/05/04_distrobox_export-800x600.webp
[10]: https://www.linuxcommand.org/tlcl.php
[11]: https://itsfoss.com/wp-content/uploads/2022/05/distrobox_app_test.gif
[12]: https://itsfoss.com/wp-content/uploads/2022/05/05_distrobox_list-800x226.webp
[13]: https://github.com/89luca89/distrobox

View File

@ -0,0 +1,107 @@
[#]: subject: "Share your Linux terminal with tmate"
[#]: via: "https://opensource.com/article/22/6/share-linux-terminal-tmate"
[#]: author: "Sumantro Mukherjee https://opensource.com/users/sumantro"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Share your Linux terminal with tmate
======
Tmate expands your options for session sharing with the Linux terminal.
![Terminal command prompt on orange background][1]
Image by: [iradaturrahmat][2]via [Pixabay][3], CC0
As a member of the Fedora Linux QA team, I sometimes find myself executing a bunch of commands that I want to broadcast to other developers. If you've ever used a [terminal multiplexer][4] like [tmux][5] or [GNU Screen][6], you might think that that's a relatively easy task. But not all of the people I want to see my demonstration are connecting to my terminal session from a laptop or desktop. Some might have casually opened it from their phone browser—which they can readily do because I use [tmate][7].
### Linux terminal sharing with tmate
Watching someone else work in a Linux terminal is very educational. You can learn new commands, new workflows, or new ways to debug and automate. But it can be difficult to capture what you're seeing so you can try it yourself later. You might resort to taking screenshots or a screen recording of a shared terminal session so you can type out each command later. The only other option is for the person demonstrating the commands to record the session using a tool like [Asciinema][8] or [script and scriptreplay][9].
But with tmate, a user can share a terminal either in read-only mode or over SSH. Both the SSH and the read-only session can be accessed through a terminal or as an HTML webpage.
I use read-only mode when I'm onboarding people for the Fedora QA team because I need to run commands and show the output, but with tmate, folks can keep notes by copying and pasting from their browser to a text editor.
### Linux tmate in action
On Linux, you can install tmate with your package manager. For instance, on Fedora:
```
$ sudo dnf install tmate
```
On Debian and similar distributions:
```
$ sudo apt install tmate
```
On macOS, you can install it using [Homebrew][10] or [MacPorts][11]. If you need instructions for other Linux distributions, refer to the [install][12] guide.
![Screenshot of terminal showing the options for tmate sharing: web session (regular and read-only) and ssh session (regular and read-only)][13]
Once installed, start tmate:
```
$ tmate
```
When tmate launches, links are generated to provide access to your terminal session over HTTP and SSH. Each protocol features a read-only option as well as a reverse SSH session.
Here's what a web session looks like:
![Screenshot showing tmate terminal window and 2 versions of sharing sessions demonstrating the same code][14]
Tmate's web console is HTML5, so, as a result, a user can copy the entire screen and paste it into a terminal to run the same commands.
### Keeping a session alive
You may wonder what happens if you accidentally close your terminal. You may also wonder about sharing your terminal with a different console application. After all, tmate is a multiplexer, so it should be able to keep sessions alive, detach and re-attach to a session, and so on.
And of course, that's exactly what tmate can do. If you've ever used tmux, this is probably pretty familiar.
```
$ tmate -F -n web new-session vi  console
```
This command opens up `new-session` in Vi, and the `-F` option ensures that the session re-spawns even when closed.
![A screenshot of the terminal showing the output after using the new-session and -F options: connection information for either a web session (regular or read-only) or ssh session (regular or read-only)][15]
### Social multiplexing
Tmate gives you the freedom of tmux or GNU Screen plus the ability to share your sessions with others. It's a valuable tool for teaching other users how to use a terminal, demonstrating the function of a new command, or debugging unexpected behavior. It's open source, so give it a try!
Image by: (Sumantro Mukherjee, CC BY-SA 4.0)
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/6/share-linux-terminal-tmate
作者:[Sumantro Mukherjee][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/sumantro
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/terminal_command_linux_desktop_code.jpg
[2]: https://pixabay.com/en/users/iradaturrahmat-3964359/
[3]: https://pixabay.com/en/ubuntu-computer-program-interface-3145957/
[4]: https://opensource.com/article/21/5/linux-terminal-multiplexer
[5]: https://opensource.com/downloads/tmux-cheat-sheet
[6]: https://opensource.com/article/17/3/introduction-gnu-screen
[7]: https://tmate.io/
[8]: https://opensource.com/article/22/1/record-your-terminal-session-asciinema
[9]: https://www.redhat.com/sysadmin/record-terminal-script-scriptreplay
[10]: https://opensource.com/article/20/6/homebrew-mac
[11]: https://opensource.com/article/20/11/macports
[12]: https://tmate.io/
[13]: https://opensource.com/sites/default/files/2022-06/install%20tmate_0.png
[14]: https://opensource.com/sites/default/files/2022-06/tmate%20web%20session.png
[15]: https://opensource.com/sites/default/files/2022-06/tmate%20keeping%20session%20alive.png

View File

@ -0,0 +1,66 @@
[#]: subject: "6 easy ways to make your first open source contribution with LibreOffice"
[#]: via: "https://opensource.com/article/22/5/first-open-source-contribution-libreoffice"
[#]: author: "Klaatu https://opensource.com/users/klaatu"
[#]: collector: "lkxed"
[#]: translator: "lkskjjk"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
使用 LibreOffice 进行首次开源贡献的 6 种简单方法
======
2022 年 5 月是 LibreOffice 月。这里有一些简单的方法来完成你的第一个开源贡献。
![Dandelion zoomed in][1]
(摄影Rob TillerCC BY-SA 4.0)
“参与”开源似乎有点令人困惑。你从哪里开始?如果你不知道如何编码怎么办?你跟谁说话?怎么会有人知道你做出了贡献,除此之外还有人关心吗?
这类问题实际上有答案(你的选择,没关系,没有人,你告诉他们,是的),但在 2022 年 5 月有一个简单的答案LibreOffice。本月是参与 LibreOffice 及其管理机构 The Document Foundation 的一个月。他们正在邀请各种各样的贡献者以六种不同的方式提供帮助,其中只有一种与代码有任何关系。无论您的技能如何,您都可以找到一种方法来帮助世界上最好的办公套件
### 为 LibreOffice 做出贡献的 6 种方式
以下是您可以做的:
* Handy Helper在 [Ask LibreOffice][3]上回答其他 LibreOffice 用户的问题。如果您是 LibreOffice 的狂热用户,并且认为您有可以帮助他人的有用提示和技巧,那么这就是您一直在等待的角色。
* First Responder错误报告在被不止一个用户确认时会更好。如果您擅长安装软件有时错误报告是针对比您通常使用的版本更旧的版本那么请访问 [LibreOffice Bugzilla][4] 并查找尚未确认的新错误。当你找到一个时试着复制报告的内容。假设您可以做到这一点请添加一条评论例如“CONFIRMED on Linux (Fedora 35) and LibreOffice 7.3.2”。
* Drum Beater开源项目很少有大公司投入营销资金来推广它们。如果所有声称喜欢开源的公司都能提供帮助那就太好了但不是所有的公司都这样做那么为什么不发出你的声音呢在社交媒体上告诉你的朋友你为什么喜欢 LibreOffice或者你用它做什么当然还要加上#libreoffice 标签。)
* GlobetrotterLibreOffice 已经支持多种不同的语言,但并不是所有语言。 LibreOffice 正在积极开发中,因此它的界面翻译需要保持最新。[在这里参与][5]。
* Docs DoctorLibreOffice 有在线帮助和用户手册。如果您擅长向其他人解释事情,或者如果您擅长校对其他人的文档,那么您应该联系[文档团队][6]。
* Code Cruncher您可能不会立即深入了解 LibreOffice 的代码库并进行重大更改,但这通常不是项目所需要的。如果您知道如何编码,那么您可以[按照此 wiki 页面上的说明][8]加入[开发人员社区][7]。
```
#libreoffice
```
### 免费贴纸
我不想提前提到这一点,因为很明显你应该参与 LibreOffice 只是因为你很高兴参与一个优秀的开源项目。但是,您最终会发现,所以我不妨告诉您:通过为 LibreOffice 做出贡献,您可以注册然后从文档基金会获得免费贴纸。你肯定一直想[装饰你的笔记本电脑吗][2]
不过,不要被战利品的承诺分心。如果您对参与开源感到困惑但很兴奋,那么这是一个很好的机会。它代表了你一般如何参与开源:你寻找需要做的事情,去做,然后你和其他人讨论它,这样你就可以获得下一步可以做什么的想法。经常这样做,你就会找到进入社区的方式。最终,您不再想知道如何参与开源,因为您太忙于贡献!
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/5/first-open-source-contribution-libreoffice
作者:[Klaatu][a]
选题:[lkxed][b]
译者:[lkskjjk](https://github.com/lkskjjk)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/klaatu
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/dandelion_zoom.jpg
[2]: https://opensource.com/business/15/11/open-source-stickers
[3]: http://ask.libreoffice.org/
[4]: https://bugs.documentfoundation.org/buglist.cgi?bug_status=__open__&content=&no_redirect=1&order=changeddate%20DESC%2Cpriority%2Cbug_severity&product=&query_based_on=&query_format=specific
[5]: https://www.libreoffice.org/community/localization/
[6]: https://www.libreoffice.org/community/docs-team
[7]: https://www.libreoffice.org/community/developers/
[8]: https://wiki.documentfoundation.org/Development/GetInvolved
https://cyber.nankai.edu.cn/2022/0311/c13350a436040/page.htm
https://www.dameng.com/list_73.html#job_content hr@starrocks.com

View File

@ -0,0 +1,138 @@
[#]: subject: "7 pieces of Linux advice for beginners"
[#]: via: "https://opensource.com/article/22/5/linux-advice-beginners"
[#]: author: "Opensource.com https://opensource.com/users/admin"
[#]: collector: "lkxed"
[#]: translator: "lightchaserhy"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
给Linux初学者的7条建议
======
我们咨询了社区Linux专家分享他们的初学经验。
![Why the operating system matters even more in 2017][1]
对Linux的新用户有什么建议我们咨询了社区专家分享他们初学时的最佳经验。
### 1.用好Linux资源
我哥们儿告诉我Linux就像一个“软件积木搭建套装”相当于50到60年代流行的建筑积木玩具这个比喻比较恰当。在2001年和2002年我曾经利用Windows3.1 和Windows NT尝试搭建安全易用的K12学校区域网站当时网上可用的资料不多。其中被推荐的“ROOT用户指南”是一本“大部头”专业教程信息丰富但是有一定上手难度。
于我而言Mandrake Linux的线上课程是最有用的资源。课程对使用和管理Linux桌面或服务器进行了详细的解读。我通过课程学习同时利用 Red Hat网站的列表资源进行实验有问题时就在社区提问寻求帮助。
—— [Don Watkins][2]
### 2.在Linux社区寻求帮助
我的建议是要多问,你可以从网上搜索信息开始,看看其他人类似的问题(甚至是更好的提问)。问什么和如何问需要花一定时间熟悉。
一旦你更加熟悉Linux查看你感兴趣的各种相关论坛在提问前先看看是否有人已经提过相同问题并获得了答案。
加入一个邮件小组也很有用,最后你会发现自己也能专业地答复提问。正如他们说,通过回答他人的问题也会学到更多知识。
同时,你会越来越熟悉这个操作系统内部运行机制,再也不是初学时的一无所知。
—— [Greg Pittman][3]
我的建议是利用man、info等帮助命令获取信息。当然尽可能花时间熟悉命令行界面且真正理解UNIX的设计理念。事实上我最喜欢的书之一就是一本80年代的UNIX书籍对理解文件、目录、设备、基础命令等非常有帮助。
—— [Alan Formy-Duval][4]
我最好的建议是充分相信社区的答复以及关于详细介绍“如何”使用不同选项的操作手册。无论如何我在2009年左右开始学习当时有很多可用的工具和资源包括一个叫“Linux from Scratch(LFS)”的项目从源码开始创建Linux系统在这个项目我学会了很多内部原理知识和创建一个LFS镜像。
—— [Sumantro Mukherjee][6]
我的建议是泛读。利用像“Ask Fedora”、“the Fedora Matrix chat”等论坛阅读他人的经验观点并且尝试实践。我通过阅读他人的网上争论学习到很多东西特别是要清楚问题产生的原因。
—— [Steve Morris][8]
### 3.安装双操作系统
我在90年代末就开始安装双操作系统Windows和Linux当我想学习Linux操作系统时便重启工作时使用的Windows系统。最好的建议之一是改变计算机系统启动顺序默认进入Windows避免启动时因为手速不快自动进入Linux系统还得重启。:)
—— [Heike Jurzik][9]
我的挑战来自于团队工作,做一个知识交换平台。
我们的Linux系统管理员利用Joomla搭建网站Joomla是我们web团队研发的内容管理系统管理员也想了解这个系统我打算采用Linux服务器以前一直是用Windows
我们一开始就安装双操作系统因为有大量依赖操作系统的业务软件但这促使了我要采用Linux。在我们各自学习新系统时成员都作为专家互相鼓励、交流非常有助于共同成长“一个都不能少坚持不懈是一个很大的挑战。
我经历一个相当尴尬的低级错误后在显示器上贴了一个大便签上面写着“在使用任何rm操作前首先要思考一下”。管理员给我写了一个命令行大全网上有很多类似资料对于熟悉基础操作非常有用。我开始使用Ubuntu的桌面环境时发现初学者在图像化的操作界面能快速上手。
从那以后我就开始长期使用Linux除了我的工作计算机管理员仍然忙于 Joomla看起来我俩都得到了成长。
—— [Ruth Cheesley][12]
### 4.为了安全请先备份
我的建议是使用一个简单且专业的备份软件发行版。一般新的Linux用户将创建、编辑、破坏和恢复系统配置。当操作系统无法启动、丢失数据时会让他们非常沮丧。
有了备份软件,他们的数据就有了保障。
我们都喜爱Linux因为它能让我们自由飞翔但这是“双刃剑”使用不当也有可能发生非常严重的错误。
—— [Giuseppe Cassibba][13]
### 5.分享你的Linux经验
我的建议是分享你的Linux使用经验。我曾经认为新的发行版本更适合新用户所以当他们咨询Linux时我总是推荐新的发行版。但是当我坐在他们的计算机前发现似乎眼前的Linux系统从未看见过因为一些新功能我也不熟悉。现在当有人咨询时我会推荐自己使用的版本虽说这不一定是初学者的最佳版本但毕竟我最熟悉他们遇到的问题我就能够快速解决当然我自己也会在分享中学到新东西
—— [Seth Kenlon][14]
以前有句俗话叫“不要随便使用杂志封面上宣传的发行版,使用你朋友都在用的,当你遇到问题时才能更好地需求帮助”。将关键词“杂志封面”替换为“互联网”,这句话依然有效:-) 。我从未听从过这个建议所以我是50公里半径内唯一使用Linux的人周围都在用 FreeBSD、 IRIX、 Solaris和 Windows 3.11等操作系统最后我就是那个寻求Linux帮助的人。
—— [Peter Czanik][15]
### 6. 6.坚持学习Linux
在到Red Hat工作前我是一名分销商合作伙伴我有几个带旅行护士的家庭健康代理机构客户他们使用了一个叫“Carefacts”的软件包最初用于DOS在旅行笔记本电脑和中心数据库同步中总是出错。
早期我听到的最好建议是认真关注开源运动。开源在2022年是主流思想但在一代人以前从Red Hat的零售商购买Linux安装光盘是带有革命性的创新行为。开源打破了常规我认为要客观看待开源但确实惊叹到了相当一部分人。
我的公司在20世纪90年代中期搭建了第一个客户防火墙基于Windows NT和Altavista的一个产品但是经常发生错误崩溃。我们自己又搭建了一个基于Linux的防火墙再也没有出问题了。因此我们用Linux替换了那套客户Altavista系统稳定地运行了多年。我们在1999年底搭建了另一个客户防火墙当时我花三周读完了一本关书关于数据包过滤和ipchains的正确使用当我完成时感觉超赞解决了所有问题。在接下来的15年我搭建安装了数百个防火墙系统主要采用iptables技术有些利用桥接器或ARP代理以及QOS保障视频会议传输有些利用IPSEC和 OpenVPN tunnels。我靠管理个人防火墙和一些双机热备系统赚取生活所需费用非常不错而以前都是用的Windows系统。我甚至还建了一些虚拟防火墙。
但是技术在高速发展2022年iptables已过时我以前的防火墙技术也成了美好的回忆。目前的经验之谈永远不要停止探索。
—— [Greg Scott][19]
### 7.享受过程
耐心点Linux和之前你熟悉的操作系统不太相同准备拥抱一个充满无限可能的新世界尽情享受吧。
—— [Alex Callejas][20]
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/5/linux-advice-beginners
作者:[Opensource.com][a]
选题:[lkxed][b]
译者:[lightchaserhy](https://github.com/lightchaserhy)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/admin
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/yearbook-haff-rx-linux-file-lead_0.png
[2]: https://opensource.com/users/don-watkins
[3]: https://opensource.com/users/greg-p
[4]: https://opensource.com/users/alanfdoss
[5]: https://linuxfromscratch.org/
[6]: https://opensource.com/users/sumantro
[7]: https://ask.fedoraproject.org
[8]: https://opensource.com/users/smorris12
[9]: https://opensource.com/users/hej
[10]: https://opensource.com/downloads/linux-common-commands-cheat-sheet
[11]: https://opensource.com/article/22/2/why-i-love-linux-kde
[12]: https://opensource.com/users/rcheesley
[13]: https://opensource.com/users/peppe8o
[14]: https://opensource.com/users/seth
[15]: https://opensource.com/users/czanik
[16]: https://www.redhat.com/sysadmin/run-your-own-vpn-libreswan
[17]: https://opensource.com/article/21/8/openvpn-server-linux
[18]: https://opensource.com/article/19/7/make-linux-stronger-firewalls
[19]: https://opensource.com/users/greg-scott
[20]: https://opensource.com/users/darkaxl

View File

@ -0,0 +1,125 @@
[#]: subject: "Why Do Enterprises Use and Contribute to Open Source Software"
[#]: via: "https://www.linux.com/news/why-do-enterprises-use-and-contribute-to-open-source-software/"
[#]: author: "Dan Whiting https://www.linuxfoundation.org/blog/why-do-enterprises-use-and-contribute-to-open-source-software/"
[#]: collector: "lkxed"
[#]: translator: "aREversez"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
企业为何使用开源软件,又为何推动开源软件的发展
======
每当人们知道我在 <ruby>Linux 基金会<rt>Linux Foundation</rt></ruby> 工作,他们总是会问我们的工作具体是做什么的。有时候,他们会一直问我是不是开发 Linux 操作系统的。我只能回答说,我们做的是开源软件,并试图在他们失去兴趣之前,将对世界的重大影响赌在短短的 20 秒上。如果他们的兴趣还在,想要进一步了解,我就会给他们深入分析一番:企业为何想参与到开源软件项目之中?它们为何会使用开源软件?没错,企业确实会这样做,无论它们有没有意识到这一点。此外,成千上万的企业会将企业内部代码捐给开源项目,为推动开源软件的进一步开发和优化投入大量的时间和资源。
### 开源软件的使用范围有多广
引用我们基金会最近发表的一项报告 <ruby>《企业开源指南》<rt>A Guide to Enterprise Open Source</rt></ruby>,“<ruby>开源软件<rt>open source software</rt></ruby>OSS改变了世界是数字经济的支柱数字世界的基石。从我们日常使用的互联网和移动应用到开拓未来的操作系统和程序语言开源软件无不发挥着重要的作用可谓是科技行业的命脉。在今天开源软件驱动数字经济发展推进科学技术取得突破不断改善人们的生活水平。手机、汽车和飞机等设备家庭、企业和政府等群体都在使用着开源软件。但就在 20 年前,开源软件还仅仅为少数人所知,为少数热心爱好者们组成的群体所用。”
如今,情况可大不相同了:
* 在各行业的 <ruby>垂类软件栈<rt>vertical software stacks</rt></ruby> 中,开源软件的占比达到了 20%-85%。
* 超过 90% 的网站服务器和联网设备都依靠 Linux 来运行。
* 安卓手机系统也是基于 Linux 内核。
* 用于应用程序开发的 AMP、Appium、Dojo、jQuery、Marko、Node.js 等 [主流的库和工具][1] 均属于开源项目。
* 世界上排名位列前 100 名的超级计算机都在使用 Linux。
* 大型机客户均在使用 Linux。
* AWS、Google 以及 Microsoft 三大云服务供应商都在使用开源软件运行服务,策划并在云端发起开源解决方案。
### 企业为何想参与到开源软件项目之中
企业参与开源软件项目主要通过三种方式:
* 企业向开源社区捐赠自家开发的软件。
* 企业向开源软件项目提供直接的资金援助。
* 企业向开源项目分派软件开发人员以及其他员工。
人们经常会问,为什么这些企业愿意放弃自家软件的所有权?为什么它们不让员工专攻自家软件的开发呢?
从整体上来看,这一问题的答案就是,企业和组织聚集起来,合力解决共同的难题,如此一来,他们就可以各自专注于在这基础上的各类难题。这些企业明白,将资源聚集在一起,能够更好地解决基础问题。有时,这种现象被叫做“竞合”,大概的意思是企业在一些领域可能互为竞争对手,但是它们在另一些领域则会互相合作。
“竞合”现象的一些典型例子:
* 铁路公司采用统一的铁轨尺寸,统一规划建设。得益于此,火车就可以在同样铁轨上运行,铁路公司之间也可以互相交换设备。
* 在数码相机诞生之前,不同的公司在电影和摄像机行业各行创新之路,形成了各自的优势,但为了推进电影行业的发展,它们在相机链轮间距这一问题上达成了统一。
* 娱乐产业在开展竞争的同时,也一致坚持采用家用录像系统和蓝光格式。
如今,企业、组织以及个体在合力解决难题的同时,也在不断地改进自身的产品与业务。
[<ruby>来此加密<rt>Lets Encrypt</rt></ruby>][2] 是一个免费开放的自动化证书颁发机构,旨在通过简化安装程序,减低安装费用,快速扩大安全网络协议的应用范围。该机构为超过 2.25 亿个网站提供服务,每天平均发放证书约 150 万张。
好莱坞成立的 [<ruby>学院软件基金会<rt>Academy Software Foundation</rt></ruby>][3] 通过共同开发软件,推动娱乐、游戏和媒体等产业的增长,为产业发展提供开放标准,在电影行业内 [创造了巨大的价值][4]。
<ruby>超级账本<rt>Hyperledger</rt></ruby> 基金会发起了多个企业级区块链软件项目。众所周知,这些项目 [消耗的能源远比其他解决方案要少][5]。
[LF Energy 基金会][6] 推动 [电网朝着更加模块化、互操作和可拓展的方向发展][7],助力提升可再生能源的利用率。
[Dronecode 基金会][8] 致力于无人机软件的开发,促进企业在无人机领域进一步开拓创新。
[<ruby>开源软件软件安全基金会<rt>OpenSSF</rt></ruby>][9] 聚集了顶尖的科技企业,共同强化开源软件的安全与韧性。
[Kubernetes][10] 是 Google 捐赠给 Linux 基金会下属的云原生计算基金会CNCF的一个项目是管理基于云计算软件的首选方案。
上述只是企业参与的一小部分开源软件项目,点击[此处][11],在 Linux 基金会官网浏览全部项目列表。
### 企业如何有效利用和参与开源软件项目?
若想要更好地利用开源项目,更有效地参与开源项目,企业可以向 Linux 基金会寻求帮助。我们最新发布的报告 [《企业开源指南》][12] 提供了企业与组织需要了解的大部分信息。这份报告凝聚了来自多家顶级企业、具有几十年丰富经验的开源领袖的知识与智慧,报告主要分为以下六个章节:
* 使用开源软件
* 准备参与开源
* 制定开源策略
* 部署基础设施
* 建立人才团队
* 应对多方挑战
此外Linux 基金会还提供了许多开源 [培训课程][13]、全年 [活动][14]、[LFX 平台][15],发起开源项目,协助企业与组织利用和参与开源项目,比如:
[TODO 工作组][16] 为开源项目办公室的建立和运作提供资源,包括其自身 [丰富的指导意见][17]。
[Openchain 项目][18] 旨在提供和维护国际开源许可标准,包括各种许可规定的相关信息。依赖于此,企业可以确保自身行为符合法律规定。
[FinOps 基金会][19] 目前正在将自身打造为“不断发展的云财务管理和文化实践平台,通过促进工程、财务、技术以及商业团队之间在数据驱动支出决策方面的合作,确保企业能够最大化实现商业价值”。
[Software Data Package Exchange (SPDX)][20] 是一个用于交流 <ruby>软件构成清单<rt>software bill of materials</rt></ruby>SBOMs的开放标准。在该标准下每个用户都能清楚了解整个软件包中包括哪些软件。
重复一遍,上述这些只是 Linux 基金会所有项目中的一小部分。所有这些项目都致力于帮助企业接受和使用开源项目,引导企业为开源项目做出贡献、提供捐赠。
总而言之,目前,企业正在迅速投向开源软件项目,借此解决共同的难题,并探索进一步的创新发展,而 Linux 基金会将为它们提供帮助。
该文 [《企业为何使用开源软件,又为何推动开源软件的发展》][21] 首发于 [Linux 基金会][22] 官网。
--------------------------------------------------------------------------------
via: https://www.linux.com/news/why-do-enterprises-use-and-contribute-to-open-source-software/
作者:[Dan Whiting][a]
选题:[lkxed][b]
译者:[aREversez](https://github.com/aREversez)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.linuxfoundation.org/blog/why-do-enterprises-use-and-contribute-to-open-source-software/
[b]: https://github.com/lkxed
[1]: https://openjsf.org/projects/
[2]: https://letsencrypt.org/
[3]: https://www.aswf.io/
[4]: https://linuxfoundation.org/tools/open-source-in-entertainment/
[5]: https://linuxfoundation.org/tools/carbon-footprint-of-nfts/
[6]: https://www.lfenergy.org/
[7]: https://linuxfoundation.org/tools/paving-the-way-to-battle-climate-change-how-two-utilities-embraced-open-source-to-speed-modernization-of-the-electric-grid/
[8]: https://www.dronecode.org/projects/
[9]: https://openssf.org/
[10]: https://kubernetes.io/
[11]: https://linuxfoundation.org/projects/
[12]: https://linuxfoundation.org/tools/guide-to-enterprise-open-source/
[13]: https://training.linuxfoundation.org/
[14]: https://events.linuxfoundation.org/
[15]: https://lfx.linuxfoundation.org/
[16]: https://todogroup.org/
[17]: https://linuxfoundation.org/resources/open-source-guides/
[18]: https://www.openchainproject.org/resources
[19]: https://www.finops.org/introduction/what-is-finops/
[20]: https://spdx.dev/
[21]: https://www.linuxfoundation.org/blog/why-do-enterprises-use-and-contribute-to-open-source-software/
[22]: https://www.linuxfoundation.org/

View File

@ -0,0 +1,384 @@
[#]: subject: (Create a countdown clock with a Raspberry Pi)
[#]: via: (https://opensource.com/article/21/3/raspberry-pi-countdown-clock)
[#]: author: (Chris Collins https://opensource.com/users/clcollins)
[#]: collector: (lujun9972)
[#]: translator: (Donkey-Hao)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
使用树莓派做一个倒计时闹钟
======
使用树莓派和 ePaper 显示器开始倒计时您的下一个假期。
![Alarm clocks with different time][1]
2021年[ Pi Day ][2]来了又走,留下美好的回忆以及[许多树莓派项目][3]等待我们去尝试。在任何令人精神振奋、充满欢乐的假期后回到工作中都很难, Pi Day 也不例外。当我们回望三月的时候,渴望那些天的快乐。但是不用害怕,亲爱的 Pi Day 庆祝者们,我们开始下一个 Pi Day 的漫长倒计时!
好了,严肃点。我做了一个 Pi Day 倒计时器,你也可以!
不久前,我购买了一个 [树莓派 Zero W][4] 并且用它来 [解决 WiFi 较差的原因][5] 。我也对使用 ePaper 来作为显示器十分感兴趣。而我却没有一个很好的用途,但是那看起来很有趣!我买了一个十分适合放在树莓派的顶部的 2.13 英寸的 [ WaveShare 显示器][6] 。安装很简单:只需要将显示器接到树莓派的 GPIO 上即可。
我使用 [树莓派系统][7] 来实现该项目,虽然其他的操作系统肯定也能完成。但是下面的 `raspi-config` 指令在树莓派系统上很容易使用。
### 设置树莓派和 ePaper 显示器
设置树莓派和 ePaper 显示器一起工作,需要你在树莓派上启用串行外设接口 (SPI) 软件,安装 BCM2835 C 库(来访问树莓派上的 Broadcom BCM 2835 芯片的 GPIO 函数),安装 Python GPIO 库来控制 ePaper 显示器。最后,你需要安装 WaveShare 的库来使用 Python 控制 2.13 英寸的显示器。
下面是完成这些的步骤。
#### 启用 SPI
树莓派上启用 SPI 最简单的方式是使用`raspi-config` 命令。SPI 总线允许串行数据通信与设备一起使用——在本例中ePaper 显示:
```
`$ sudo raspi-config`
```
从弹出的菜单中, 选择 **Interfacing Options** -&gt; **SPI** -&gt; **Yes** 来启用 SPI 接口,然后启动。
#### 安装 BCM2835 库
如上所述BCM2835 库是用在树莓派 Broadcom BCM2385 芯片的软件,它允许访问 GPIO 引脚来控制设备。
在我写这篇文章之时,用于树莓派的最新 Broadcom BCM2385 库版本是 v1.68 。安装此库需要下载软件压缩包然后使用 `make` 来安装:
```
# 下载 BCM2853 库并解压
$ curl -sSL <http://www.airspayce.com/mikem/bcm2835/bcm2835-1.68.tar.gz> -o - | tar -xzf -
# 进入解压后的文件夹
$ pushd bcm2835-1.68/
# 配置、检查并安装 BCM2853 库
$ sudo ./configure
$ sudo make check
$ sudo make install
# 返回上级目录
$ popd
```
#### 安装需要的 Python 库
你用 Python 控制 ePaper 显示器需要安装 Python 库 `RPi.GPIO` ,还需要 `python3-pil` 包画图。显然, PIL 包已经不行了, Pillow 可以作为代替方案。我还没有为该项目测试 Pillow ,但它可行:
```
# 安装需要的 Python 库
$ sudo apt-get update
$ sudo apt-get install python3-pip python3-pil
$ sudo pip3 install RPi.GPIO
```
_注意这些是 Python3 的指令。你可以在 WaveShare 网站查到 Python2 的指令。_
#### 下载 WaveShare 示例和 Python 库
Waveshare 维护一个 Python 和 C 的 Git 库,用于使用其 ePaper 显示器和一些展示如何使用它们的示例。对这个倒计时时钟而言,你需要克隆这个库并用于 2.13 英寸的显示器:
```
# 克隆这个 WaveShare e-Paper git 库
$ git clone <https://github.com/waveshare/e-Paper.git>
```
如果你用不同的显示器或者其他公司产品,需要使用适配软件。
Waveshare 提供了很多指导:
* [WaveShare ePaper 设置指导][9]
* [WaveShare ePaper 库安装指导][10]
#### 获得有趣的字体(选做)
你可以随心所欲的使用显示器,为什么不搞点花样?找一个炫酷的字体!
这有大量 [开放字体许可][11] 的字体可用。我十分喜爱 Bangers 字体。如果你看过 YouTube 那你见过这种字体了,它十分流行。你可以下载到本地的共享字体目录文件中,并且所有的应用都可以使用,包括这个项目:
```
# “Bangers” 字体是 Vernon Adams 用 Google 字体开放许可授权的字体
$ mkdir -p ~/.local/share/fonts
$ curl -sSL <https://github.com/google/fonts/raw/master/ofl/bangers/Bangers-Regular.ttf> -o fonts/Bangers-Regular.ttf
```
### 创建一个 Pi Day 倒计时器
现在你已经安装好了软件,可以使用带有炫酷字体的 ePaper 显示器了。你可以创建一个有趣的项目:倒计时到下一个 Pi Day
如果你想,你可以从该项目的 [GitHub repo][13] 直接下载 [countdown.py][12] 这个 Python 文件并跳到文章结尾。
为了满足大家的好奇心,我将逐步讲解。
#### 导入一些库
```
#!/usr/bin/python3
# -*- coding:utf-8 -*-
import logging
import os
import sys
import time
from datetime import datetime
from pathlib import Path
from PIL import Image,ImageDraw,ImageFont
logging.basicConfig(level=logging.INFO)
basedir = Path(__file__).parent
waveshare_base = basedir.joinpath('e-Paper', 'RaspberryPi_JetsonNano', 'python')
libdir = waveshare_base.joinpath('lib')
```
开始先导入一些标准库之后脚本中用。也需要你添加一些 PIL 的包: `Image`, `ImageDraw` ,和 `ImageFont` ,你会 用到这些包来画一些简单的图形。最后,为包含用于 2.13 英寸显示器的 Waveshare Python 库的本地 `lib` 目录设置一些变量,稍后你可以使用这些变量从本地目录加载库。
#### 字体大小辅助函数
下一部分是为你选择的字体建立一个修改大小的辅助函数: Bangers-Regular.ttf 。该函数将整型变量作为大小参数并返回一个图形字体对象来用于显示:
```
def set_font_size(font_size):
    logging.info("Loading font...")
    return ImageFont.truetype(f"{basedir.joinpath('Bangers-Regular.ttf').resolve()}", font_size)
```
#### 倒计时逻辑
接下来是计算这个项目的一个函数:距下次 Pi Day 还有多久。如果 Pi Day 在一月,那么计算剩余天数将很简单。但是你需要考虑是否今年的 Pi Day 这一天已经过去了。如果是这样的话,那么计算量将会很大:
```
def countdown(now):
    piday = datetime(now.year, 3, 14)
    # 如果错过了就增加一年
    if piday &lt; now:
        piday = datetime((now.year + 1), 3, 14)
    days = (piday - now).days
    logging.info(f"Days till piday: {days}")
    return day
```
#### 主函数
最后,到了主函数,需要初始化显示器并向它写数据。这时,你应该写一个欢迎语然后再开始倒计时。但是首先,你需要加载 Waveshare 库:
```
def main():
    if os.path.exists(libdir):
        sys.path.append(f"{libdir}")
        from waveshare_epd import epd2in13_V2
    else:
        logging.fatal(f"not found: {libdir}")
        sys.exit(1)
```
上面的代码片段检查以确保该库已下载到倒计时脚本旁边的目录中然后加载“epd2in13_V2”库。 如果你使用不同的显示器,则需要使用不同的库。 如果你愿意,也可以自己编写。我发现阅读 Waveshare 随显示器提供的 Python 代码很有趣,它比我想象的要简单得多。
下一段代码创建一个 EPD ePaper 显示器)对象以与显示器交互并初始化硬件:
```
    logging.info("Starting...")
    try:
        # 创建一个显示对象
        epd = epd2in13_V2.EPD()
        # 初始化并清空显示
        # ePaper 保持它的状态处分更新
        logging.info("Initialize and clear...")
        epd.init(epd.FULL_UPDATE)
        epd.Clear(0xFF)
```
关于 ePaper 的一个有趣之处:它仅在将像素从白色变为黑色或从黑色变为白色时才使用电源。这意味着当设备断电或应用程序因任何原因停止时,屏幕上的任何内容都会保留下来。从功耗的角度来看,这很好,但这也意味着您需要在启动时清除显示,否则您的脚本只会覆盖屏幕上已有的内容。 因此,`epd.Clear(0xFF)` 用于在脚本启动时清除显示。
接下来,创建一个“画布”来绘制剩余的显示输出:
```
    # 创建一个图形对象
# 注意:"epd.heigh" 是屏幕的长边
# 注意:"epd.width" 是屏幕的短边
    # 真是反直觉…
    logging.info(f"Creating canvas - height: {epd.height}, width: {epd.width}")
    image = Image.new('1', (epd.height, epd.width), 255)  # 255: clear the frame
    draw = ImageDraw.Draw(image)
```
这与显示器的宽度和高度相匹配——但它有点反直觉,因为显示器的短边是宽度。我认为长边是宽度,所以这只是需要注意的一点。 请注意,`epd.height` 和 `epd.width` 由 Waveshare 库设置以对应于你使用的设备。
#### 欢迎语
接下来,你将开始画一些画。这涉及在你之前创建的“画布”对象上设置数据。这还没有将它绘制到 ePaper 显示器上——你现在只是在构建你想要的图像。由你为这个项目绘制带有一块馅饼的图像,来创建一个庆祝 Pi Day 的欢迎信息:
![画一块馅饼][14]
(Chris Collins, [CC BY-SA 4.0][15])
很可爱,不是吗?
```
    logging.info("Set text text...")
    bangers64 = set_font_size(64)
    draw.text((0, 30), 'PI DAY!', font = bangers64, fill = 0)
    logging.info("Set BMP...")
    bmp = Image.open(basedir.joinpath("img", "pie.bmp"))
    image.paste(bmp, (150,2))
```
最后_最后_你可以展示你画的图画
```
    logging.info("Display text and BMP")
    epd.display(epd.getbuffer(image))
```
That bit above updates the display to show the image you drew.
接下来,准备另一幅图像展示你的倒计时:
#### Pi Day 倒计时
首先,创建一个用来展示倒计时的项目。也需要设置数字的字体大小:
```
    logging.info("Pi Date countdown; press CTRL-C to exit")
    piday_image = Image.new('1', (epd.height, epd.width), 255)
    piday_draw = ImageDraw.Draw(piday_image)
    # 设置字体大小
    bangers36 = set_font_size(36)
    bangers64 = set_font_size(64)
```
为了使它显示的时候更像一个倒计时,更新图像的一部分是更加有效的手段,仅更改已经改变的显示数据部分。下面的代码准备以这样方式运行:
```
    # 准备更新显示
    epd.displayPartBaseImage(epd.getbuffer(piday_image))
    epd.init(epd.PART_UPDATE)
```
最后,需要计时,开始一个无限循环来检查据下次 Pi Day 还有多久并显示在 ePaper上。如果到了 Pi Day ,你可以输出一些庆祝短语:
```
    while (True):
        days = countdown(datetime.now())
        unit = get_days_unit(days)
        # 通过绘制一个填充有白色的矩形来清除屏幕的下半部分
        piday_draw.rectangle((0, 50, 250, 122), fill = 255)
        # 绘制页眉
        piday_draw.text((10,10), "Days till Pi-day:", font = bangers36, fill = 0)
        if days == 0:
            # 绘制庆祝语
            piday_draw.text((0, 50), f"It's Pi Day!", font = bangers64, fill = 0)
        else:
            # 绘制距下一次 Pi Day 的时间
            piday_draw.text((70, 50), f"{str(days)} {unit}", font = bangers64, fill = 0)
        # 渲染屏幕
        epd.displayPartial(epd.getbuffer(piday_image))
        time.sleep(5)
```
脚本最后做了一些错误处理,包括捕获键盘中断,这样你可以使用 **Ctrl**+**C** 来结束无限循环,以及一个根据计数来打印 'day' 或 'days' 的函数:
```
    except IOError as e:
        logging.info(e)
    except KeyboardInterrupt:
        logging.info("Exiting...")
        epd.init(epd.FULL_UPDATE)
        epd.Clear(0xFF)
        time.sleep(1)
        epd2in13_V2.epdconfig.module_exit()
        exit()
def get_days_unit(count):
    if count == 1:
        return "day"
    return "days"
if __name__ == "__main__":
    main()
```
现在你已经拥有一个倒计时脚本并显示剩余天数!这是在我的树莓派上的显示(视频经过加速,我没有足够的磁盘空间来保存一整天的视频):
![Pi Day Countdown Timer In Action][16]
(Chris Collins, [CC BY-SA 4.0][15])
#### 安装 systemd 服务(选做)
如果你希望在系统打开时运行倒计时显示并且无需登录并运行脚本,您可以将可选的 systemd 单元安装为 [systemd 用户服务][17].
将 GitHub 上的 [piday.service][18] 文件复制到 `${HOME}/.config/systemd/user`,如果该目录不存在,请先创建该目录。然后你可以启用该服务并启动它:
```
$ mkdir -p ~/.config/systemd/user
$ cp piday.service ~/.config/systemd/user
$ systemctl --user enable piday.service
$ systemctl --user start piday.service
# Enable lingering, to create a user session at boot
# and allow services to run after logout
$ loginctl enable-linger $USER
```
该脚本将输出到 systemd 日志,可以使用 `journalctl` 命令查看输出。
### 它开始看起来很像 Pi Day
现在你拥有了一个树莓派 Zero W 显示在 ePaper显示器上的 Pi Day 倒计时器!并在系统启动时使用 systemd 单元文件启动!现在只有 350 天左右我们才可以再次相聚庆祝奇妙的设备———树莓派。通过我们的小项目,我们可以一目了然地看到确切的天数。
但事实上,任何人都可以全年都在心中举行 Pi Day因此请享受使用自己的树莓派创建一些有趣且具有教育意义的项目吧
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/3/raspberry-pi-countdown-clock
作者:[Chris Collins][a]
选题:[lujun9972][b]
译者:[Donkey](https://github.com/Donkey-Hao)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/clcollins
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/clocks_time.png?itok=_ID09GDk (Alarm clocks with different time)
[2]: https://en.wikipedia.org/wiki/Pi_Day
[3]: https://opensource.com/tags/raspberry-pi
[4]: https://www.raspberrypi.org/products/raspberry-pi-zero-w/
[5]: https://opensource.com/article/21/3/troubleshoot-wifi-go-raspberry-pi
[6]: https://www.waveshare.com/product/displays/e-paper.htm
[7]: https://www.raspberrypi.org/software/operating-systems/
[8]: https://pypi.org/project/Pillow/
[9]: https://www.waveshare.com/wiki/2.13inch_e-Paper_HAT
[10]: https://www.waveshare.com/wiki/Libraries_Installation_for_RPi
[11]: https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL
[12]: https://github.com/clcollins/epaper-pi-ex/blob/main/countdown.py
[13]: https://github.com/clcollins/epaper-pi-ex/
[14]: https://opensource.com/sites/default/files/uploads/pie.png (drawing of a piece of pie)
[15]: https://creativecommons.org/licenses/by-sa/4.0/
[16]: https://opensource.com/sites/default/files/uploads/piday_countdown.gif (Pi Day Countdown Timer In Action)
[17]: https://wiki.archlinux.org/index.php/systemd/User
[18]: https://github.com/clcollins/epaper-pi-ex/blob/main/piday.service

View File

@ -1,120 +0,0 @@
[#]: subject: "How to Recover Arch Linux Install via chroot"
[#]: via: "https://www.debugpoint.com/2021/07/recover-arch-linux/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
如何通过 chroot 恢复 Arch Linux 的安装
======
这个快速指南解释了恢复 Arch Linux 安装的一些步骤。
作为一个滚动发布的版本,[Arch Linux][1] 中有时会出现一些问题。不是因为你自己的行为而是数以百计的其他原因如新内核与你的硬件或软件的兼容性。但是Arch Linux 仍然是更好的,它提供了最新的软件包和应用。
但有时,它也会给你带来麻烦,你最终只能看到一个闪烁的光标,其他什么都没有。
所以,在这种情况下,与其重新格式化或重新安装,不如在放弃希望之前尝试恢复安装和数据。本指南概述了这个方向的一些步骤。
### 恢复 Arch Linux 安装
* 第一步是用 Arch Linux 创建一个可启动的 Live USB。从这个链接下载 .ISO 并创建一个可启动的 .ISO。你可以查看这个指南[如何使用 Etcher 创建可启动的 .ISO][2]。记住这一步需要另一个稳定的工作系统,因为你目前的系统不能使用。
[下载 arch linux][3]
* 你需要知道你的 Arch Linux 安装在哪个分区上。这是一个非常重要的步骤。如果你不知道,你可以用 GParted 来查找。或者在你的 Grub 菜单中查看,或者你可以运行下面的命令来了解。这将列出你所有的磁盘分区及其大小、标签。
```
sudo lsblk -o name,mountpoint,label,size,uuid
```
* 完成后,插入 U 盘并从它启动。你应该在 Live 介质中看到 Arch Linux 的提示。
* 现在,用下面的方法挂载到 Arch Linux 分区。把 /dev/sda3 改成你各自的分区。
```
/dev/sda3
```
```
mount /dev/sda3 /mntarch-chroot /mnt
```
* arch-chroot 命令将在终端挂载你的 Arch Linux 分区,所以用你的 Arch 凭证登录。现在,在这个阶段,根据你的需要,你有以下选择。
* 你可以通过 /home 文件夹来备份你的数据。如果,故障排除器无效的话。你可以把文件复制到外部 USB 或其他分区。
* 核查日志文件,特别是 pacman 日志。因为,不稳定的系统可能是由升级某些软件包引起的,如图形驱动或任何其他驱动。根据日志,如果你想降级任何特定的软件包,你可能要降级。
* 你可以使用下面的命令来查看 pacman 日志文件的最后 200 行,以找出任何失败的项目或依赖性删除。
```
tail -n 200 /var/log/pacman.log | less
```
* 上面的命令给了你从 pacman.log 文件末尾的 200 行来验证。现在,仔细检查哪些软件包在你成功启动后被更新了。
* 并记下软件包的名称和版本。你可以尝试逐一降级软件包,或者如果你认为某个特定的软件包产生了问题。使用 pacman 命令的 -U 开关来降级。
```
pacman -U <package name>
```
* 如果有的话,你可以在降级后运行以下命令来启动你的 Arch 系统。
```
exec /sbin/init
```
* 检查你的显示管理器的状态,是否有任何错误。有时,显示管理器会产生一个问题,无法与 X 服务器通信。例如,如果你正在使用 lightdm那么你可以通过以下方式检查它的状态。
```
systemctl status lightdm
```
* 或者,可以通过下面的命令启动它,并检查什么是错误。
```
lightdm --test-mode --debug
```
、* 下面是一个 lightdm 失败的例子,它导致了一个不稳定的 Arch 系统。
![lightdm - test mode][4]
* 或者通过使用 startx 启动 X 服务器来检查。
```
startx
```
* 根据我的经验,如果你在上述命令中看到错误,尝试安装另一个显示管理器,如 sddm 并启用它。它可能会消除这个错误。
* 根据你的系统状态,尝试上述步骤,并进行故障排除。对于特定于显示管理器 lightdm 的错误,我们有一个[指南][5],你可能想查看一下。
* 如果你使用的是 sddm那么请查看[这些故障排除步骤][6]是否可以。
### 结束语
每个安装都是不同的。上述步骤可能对你不起作用。但它值得一试,根据经验,它是有效的。如果它起作用,那么,对你来说是好事。无论哪种方式,请在下面的评论区中告诉我,它结果如何。
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/2021/07/recover-arch-linux/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/tag/arch-linux
[2]: https://www.debugpoint.com/2021/01/etcher-bootable-usb-linux/
[3]: https://archlinux.org/download/
[4]: https://www.debugpoint.com/wp-content/uploads/2021/03/lightdm-test-mode.jpg
[5]: https://www.debugpoint.com/2021/03/failed-to-start-lightdm/
[6]: https://wiki.archlinux.org/title/SDDM#Troubleshooting

View File

@ -1,273 +0,0 @@
[#]: subject: "How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 22.04 / 20.04 / 18.04"
[#]: via: "https://ostechnix.com/how-to-boot-into-rescue-mode-or-emergency-mode-in-ubuntu-18-04/"
[#]: author: "sk https://ostechnix.com/author/sk/"
[#]: collector: "lkxed"
[#]: translator: "robsean"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
如何在 Ubuntu 22.04 / 20.04 / 18.04 中启动到 <ruby>救援<rt>Rescue</rt></ruby> 模式 或 <ruby>紧急<rt>Emergency</rt></ruby> 模式
======
这篇教程将介绍如何在 Ubuntu 22.04、20.04 和 18.04 LTS 版本中启动到 <ruby>救援<rt>Rescue</rt></ruby> 模式 或 <ruby>紧急<rt>Emergency</rt></ruby> 模式。
你可能已经知道,在 Linux 发行版中 **<ruby>运行等级<rt>Runlevels</rt></ruby>** 已经被 **<ruby>系统目标<rt>Systemd targets</rt></ruby>** 所替代,例如, RHEL 7 、RHEL 8 、Ubuntu 16.04 LTS 及其更新的版本。更多关于 <ruby>运行等级<rt>Runlevels</rt></ruby><ruby>系统目标<rt>Systemd targets</rt></ruby> 的信息,参考 [这篇指南][1] 。
这篇指南是针对 Ubuntu 编写的,但是,下面所给的步骤应该也适用于大多数使用 **Systemd** 作为默认服务管理器的 Linux 发行版。
在进入主题前,让我们简单的理解:什么是 <ruby>救援<rt>rescue</rt></ruby> 模式 和 <ruby>紧急<rt>Emergency</rt></ruby> 模式,以及这两种模式的目的是什么。
### 什么是 <ruby>救援<rt>rescue</rt></ruby> 模式?
在 Linux 发行版中,<ruby>救援<rt>rescue</rt></ruby> 模式 等效于 <ruby>单用户<rt>single user</rt></ruby> 模式,它使用 **SysV** 作为默认的服务器管理器。在 <ruby>救援<rt>rescue</rt></ruby> 模式 中,将挂载所有的本地文件系统,将仅启动一些重要的服务。但是,不会启动一般的服务 (例如,网络服务)。
<ruby>救援<rt>rescue</rt></ruby> 模式 在不能正常启动系统的情况下是很有用的。此外,我们可以在 <ruby>救援<rt>rescue</rt></ruby> 模式 下执行一些重要的 <ruby>救援<rt>rescue</rt></ruby> 操作,例如,[重新设置 root 密码][2] 。
### 什么是 <ruby>紧急<rt>Emergency</rt></ruby> 模式?
<ruby>救援<rt>rescue</rt></ruby> 模式相比, 在 <ruby>紧急<rt>Emergency</rt></ruby> 模式中,不会启动任何的东西。不会启动服务,不会挂载挂载点,不会建立套接字,什么都不会启动。你将所拥有的只是一个 **原始的 shell**<ruby>紧急<rt>Emergency</rt></ruby> 模式适用于调试目的。
首先,我们将看到如何在 Ubuntu 22.04 和 20.04 LTS 发行版中启动到 <ruby>救援<rt>Rescue</rt></ruby> 模式 或 <ruby>紧急<rt>Emergency</rt></ruby> 模式。在 Ubuntu 22.04 和 20.04 LTS 中进入 <ruby>救援<rt>rescue</rt></ruby> 模式 的过程是完全相同的!
### 在 Ubuntu 22.04 / 20.04 LTS 中启动到 <ruby>救援<rt>rescue</rt></ruby> 模式
我们可以使用两种方法来启动到 <ruby>救援<rt>rescue</rt></ruby> 模式。
#### 方法 1
打开你的 Ubuntu 系统。在 BIOS 徽标出现后,按下 ESC 按键来显示 GRUB 菜单。
在 GRUB 菜单中,选择第一项,并按下 **"e"** 按键来编辑它。
![GRUB Menu In Ubuntu 22.04 / 20.04 LTS][3]
按下 **下箭头** 按键,并找到以单词 **"linux"** 开头的一行代码,并在其结尾处添加下面的一行代码。为到达其结尾处,只需要按下 **CTRL+e** 组合键,或使用你键盘上的 **END** 按键或 **左箭头/右箭头** 按键。
```
systemd.unit=rescue.target
```
![Edit Grub Boot Menu Entries To Enter Into Rescue Mode In Ubuntu 22.04 / 20.04 LTS][4]
在添加上面的代码行后,按下 **Ctrl+x** 组合键 或按下 **F10** 按键来启动到 <ruby>救援<rt>rescue</rt></ruby> 模式.
数秒后,你将作为 root 用户来登陆到 <ruby>救援<rt>rescue</rt></ruby> 模式 (<ruby>单用户<rt>single user</rt></ruby> 模式) 。将会提示你按下 <ruby>回车<rt>ENTER</rt></ruby> 按键来进入维护模式。
下图是 Ubuntu 22.04 / 20.04 LTS 系统的 <ruby>救援<rt>rescue</rt></ruby> 模式 的样子:
![Boot Into Rescue Mode In Ubuntu 22.04 / 20.04 LTS][5]
现在,在 <ruby>救援<rt>rescue</rt></ruby> 模式 中做你想做的任何事。在 <ruby>救援<rt>rescue</rt></ruby> 模式 中,在你执行任何操作前,你可能需要以 读/写 模式 的方式来挂载 root (**/**) 文件系统。
```
mount -n -o remount,rw /
```
![Mount Root File System In Read Write Mode In Ubuntu 22.04 / 20.04 LTS][6]
在完成后,按下 **"Ctrl+d"** 组合键来启动到正常模式。或者,你可以输入下面的任意一个命令来启动到正常模式。
```
systemctl default
```
或者,
```
exit
```
如果你想重新启动系统,而不是启动到正常的模式,输入:
```
systemctl reboot
```
#### 方法 2
在这种方法中,你不需要编辑 GRUB 启动菜单项目。
打开系统电源,并从 GRUB 启动菜单中选择 <ruby>Ubuntu 高级选项<rt>Advanced options for Ubuntu</rt></ruby>
![Choose Advanced Options For Ubuntu From Grub Boot Menu][7]
接下来,你将看到一个带有内核版本的可用的 Ubuntu 版本的列表。在 Ubuntu 中的 GRUB 启动菜单中选择 <ruby>恢复<rt>Recovery</rt></ruby> 模式。
![Choose Recovery Mode In Grub Boot Menu In Ubuntu 22.04 / 20.04 LTS][8]
数秒后,你将看到 Ubuntu 的 <ruby>恢复<rt>Recovery</rt></ruby> 菜单。从 <ruby>恢复<rt>Recovery</rt></ruby> 菜单中,选择 **<ruby>进入 root 的 shell 提示符<rt>Drop to root shell prompt</rt></ruby>** 选项 ,并按下 <ruby>回车<rt>ENTER</rt></ruby> 按键。
![Enter Into Root Shell Prompt In Ubuntu 22.04 / 20.04 LTS][9]
现在,你将登陆到 <ruby>救援<rt>rescue</rt></ruby> 模式。
![Ubuntu Maintenance Mode][10]
通过输入下面的命令来 以 读/写 模式的方式 来挂载 root (**/**) 文件系统:
```
mount -n -o remount,rw /
```
![Mount Root File System In Read Write Mode In Ubuntu][11]
<ruby>救援<rt>rescue</rt></ruby> 模式 中做你想做的任何事。
在完成后,输入 **exit** 来返回到 <ruby>恢复<rt>Recovery</rt></ruby> 菜单。
```
exit
```
最后,选择 **<ruby>救援正常启动<rt>Resume normal boot</rt></ruby>** 选项,并按下 <ruby>回车<rt>ENTER</rt></ruby> 按键。
![Boot Into Normal Mode In Ubuntu][12]
再次按下 <ruby>回车<rt>ENTER</rt></ruby> 按键来退出 <ruby>恢复<rt>Recovery</rt></ruby> 模式,并继续启动到正常模式。
![Exit The Recovery Mode In Ubuntu][13]
如果你不想启动到正常模式,输入 **reboot** 并从维护模式中按下 <ruby>回车<rt>ENTER</rt></ruby> 按键来重新启动你的系统。
### 在 Ubuntu 22.04 / 20.04 LTS 中启动到 <ruby>紧急<rt>Emergency</rt></ruby> 模式
当 GRUB 菜单出现时,按下 **"e"** 按键来编辑它。
![GRUB Menu In Ubuntu 22.04 / 20.04 LTS][14]
找到以单词 **"linux"** 开头的一行代码,并在其结尾处添加下面的一行代码。
```
systemd.unit=emergency.target
```
![Edit Grub Boot Menu Entries To Enter Into Emergency Mode In Ubuntu 22.04 / 20.04 LTS][15]
在添加上面的代码行后,按下 **Ctrl+x** 组合键,或按下 **F10** 按键来启动到 <ruby>紧急<rt>Emergency</rt></ruby> 模式。
数秒后,你将作为 `root` 用户来登陆到 <ruby>紧急<rt>Emergency</rt></ruby> 模式。将会提示你按下 <ruby>回车<rt>ENTER</rt></ruby> 按键来进入维护模式。
下图是 Ubuntu 22.04 / 20.04 LTS 系统的 <ruby>紧急<rt>Emergency</rt></ruby> 模式 的样子:
![Boot Into Emergency Mode In Ubuntu 22.04 / 20.04 LTS][16]
现在,在 <ruby>紧急<rt>Emergency</rt></ruby> 模式 中做你想做的任何事。在 <ruby>紧急<rt>Emergency</rt></ruby> 模式 中,在你执行任何操作前,你可能需要以 读/写 模式 的方式来挂载 root (**/**) 文件系统。
```
mount -n -o remount,rw /
```
在完成后,按下 **"Ctrl+d"** 组合键来启动到正常模式。或者,你可以输入下面的任意一个命令来启动到正常模式。
```
systemctl default
```
或者,
```
exit
```
如果你想重新启动系统,而不是启动到正常的模式,输入:
```
systemctl reboot
```
### 在 Ubuntu 18.04 LTS 中启动到 <ruby>救援<rt>rescue</rt></ruby> 模式
启动你的 Ubuntu 系统。当 GRUB 菜单出现时,选择第一项并按下按键 **"e"** 来编辑。(为到达其结尾处,只需要按下 **CTRL+e** 组合键,或使用你键盘上的 **END** 按键或 **左箭头/右箭头** 按键)
![Grub Menu][17]
如果你没有看到 GRUB 菜单,只需要在 BIOS 徽标出现后,按下 ESC 按键来显示 GRUB 菜单。
找到以单词 **"linux"** 开头的一行代码,并在其结尾处添加下面的一行代码 (为到达其结尾处,只需要按下 **CTRL+e** 组合键,或使用你键盘上的 **END** 按键或 **左箭头/右箭头** 按键)
```
systemd.unit=rescue.target
```
![Edit Grub Menu][18]
在添加上面的代码行后,只需要按下 **Ctrl+x** 组合键,或按下 **F10** 按键来启动到 <ruby>救援<rt>rescue</rt></ruby> 模式。数秒后,你将作为 `root` 用户来登陆到 <ruby>救援<rt>rescue</rt></ruby> 模式 (<ruby>单用户<rt>single user</rt></ruby> 模式) 。
下图是 Ubuntu 18.04 LTS 服务器 系统的 <ruby>救援<rt>rescue</rt></ruby> 模式 的样子:
![Ubuntu Rescue Mode][19]
接下来,输入下面的命令来挂载 root (**/**) 文件系统为 读/写 模式。
```
mount -n -o remount,rw /
```
### 启动到 <ruby>紧急<rt>Emergency</rt></ruby> 模式
启动你的 Ubuntu 到 <ruby>紧急<rt>Emergency</rt></ruby> 模式 基本与上述方法相同。你所需要做的全部工作是,在编辑 GRUB 菜单时,将 **"systemd.unit=rescue.target"** 替换为 **"systemd.unit=emergency.target"** 。
![Edit Grub Menu][20]
在你添加 "systemd.unit=emergency.target" 后,按下 **Ctrl+x** 组合键,或按下 **F10** 按键来启动到 <ruby>紧急<rt>Emergency</rt></ruby> 模式。
![Ubuntu Emergency Mode][21]
最后,你可以使用下面的命令来以 读/写 模式的方式 来挂载 root (**/**) 文件系统:
```
mount -n -o remount,rw /
```
### 在 <ruby>救援<rt>rescue</rt></ruby> 模式 和 <ruby>紧急<rt>Emergency</rt></ruby> 模式 之间切换
如果你正在 <ruby>救援<rt>rescue</rt></ruby> 模式 中,你不必像我上述提到的那样来编辑 GRUB 的菜单启动项。相反,你只想要输入下面的命令来立刻切换到 <ruby>紧急<rt>Emergency</rt></ruby> 模式:
```
systemctl emergency
```
同样,为从 <ruby>紧急<rt>Emergency</rt></ruby> 模式 切换到 <ruby>救援<rt>rescue</rt></ruby> 模式,输入:
```
systemctl rescue
```
### 总结
现在,你知道了什么是 <ruby>救援<rt>Rescue</rt></ruby> 模式 和 <ruby>紧急<rt>Emergency</rt></ruby> 模式,以及如何在 Ubuntu 22.04 、20.04 和 18.04 LTS 系统中启动到这些模式。 正如我已经提到的,在这里提供的这些步骤应该也适用于大多数当前使用 **Systemd** 作为默认服务管理器的 Linux 发行版。
--------------------------------------------------------------------------------
via: https://ostechnix.com/how-to-boot-into-rescue-mode-or-emergency-mode-in-ubuntu-18-04/
作者:[sk][a]
选题:[lkxed][b]
译者:[robsean](https://github.com/robsean)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://ostechnix.com/author/sk/
[b]: https://github.com/lkxed
[1]: https://ostechnix.com/check-runlevel-linux/
[2]: https://ostechnix.com/how-to-reset-or-recover-root-user-password-in-linux/
[3]: https://ostechnix.com/wp-content/uploads/2022/05/GRUB-Menu-In-Ubuntu-22.04-LTS.png
[4]: https://ostechnix.com/wp-content/uploads/2022/05/Edit-Grub-Boot-Menu-Entries-To-Enter-Into-Rescue-Mode-In-Ubuntu-22.04-LTS.png
[5]: https://ostechnix.com/wp-content/uploads/2022/05/Boot-Into-Rescue-Mode-In-Ubuntu-22.04.png
[6]: https://ostechnix.com/wp-content/uploads/2022/05/Mount-Root-File-System-In-Read-Write-Mode-In-Ubuntu.png
[7]: https://ostechnix.com/wp-content/uploads/2022/05/Choose-Advanced-Options-For-Ubuntu-From-Grub-Boot-Menu.png
[8]: https://ostechnix.com/wp-content/uploads/2022/05/Choose-Recovery-Mode-In-Grub-Boot-Menu-In-Ubuntu.png
[9]: https://ostechnix.com/wp-content/uploads/2022/05/Enter-Into-Root-Shell-Prompt-In-Ubuntu.png
[10]: https://ostechnix.com/wp-content/uploads/2022/05/Ubuntu-Maintenance-Mode.png
[11]: https://ostechnix.com/wp-content/uploads/2022/05/Mount-Root-File-System-In-Read-Write-Mode-In-Ubuntu-1.png
[12]: https://ostechnix.com/wp-content/uploads/2022/05/Boot-Into-Normal-Mode-In-Ubuntu.png
[13]: https://ostechnix.com/wp-content/uploads/2022/05/Exit-The-Recovery-Mode-In-Ubuntu.png
[14]: https://ostechnix.com/wp-content/uploads/2022/05/GRUB-Menu-In-Ubuntu-22.04-LTS.png
[15]: https://ostechnix.com/wp-content/uploads/2022/05/Edit-Grub-Boot-Menu-Entries-To-Enter-Into-Emergency-Mode-In-Ubuntu.png
[16]: https://ostechnix.com/wp-content/uploads/2018/12/Boot-Into-Emergency-Mode-In-Ubuntu-20.04-LTS.png
[17]: https://ostechnix.com/wp-content/uploads/2018/12/Grub-menu.png
[18]: https://ostechnix.com/wp-content/uploads/2018/12/Edit-grub-menu.png
[19]: https://ostechnix.com/wp-content/uploads/2018/12/Ubuntu-rescue-mode.png
[20]: https://ostechnix.com/wp-content/uploads/2018/12/emergency-mode.png
[21]: https://ostechnix.com/wp-content/uploads/2018/12/emergency-mode-1.png