mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-26 21:30:55 +08:00
Merge branch 'master' of https://github.com/LCTT/TranslateProject into translating
This commit is contained in:
commit
323e73d297
@ -3,15 +3,20 @@
|
|||||||
[#]: author: "sk https://ostechnix.com/author/sk/"
|
[#]: author: "sk https://ostechnix.com/author/sk/"
|
||||||
[#]: collector: "lkxed"
|
[#]: collector: "lkxed"
|
||||||
[#]: translator: "robsean"
|
[#]: translator: "robsean"
|
||||||
[#]: reviewer: " "
|
[#]: reviewer: "wxy"
|
||||||
[#]: publisher: " "
|
[#]: publisher: "wxy"
|
||||||
[#]: url: " "
|
[#]: url: "https://linux.cn/article-14642-1.html"
|
||||||
|
|
||||||
如何在 Fedora Linux 中安装多媒体编码器
|
如何在 Fedora Linux 中安装多媒体编码器
|
||||||
======
|
======
|
||||||
在新安装 Fedora后,安装多媒体编码器来播放音频和视频是第一件要事。在这篇简单的教程中,我们将看到如何在 Fedora 36 workstation 中从 RPM Fusion 软件包存储库中安装多媒体编码器。
|
|
||||||
|
|
||||||
### 序言
|
![](https://img.linux.net.cn/data/attachment/album/202205/27/112826w7kyg5vddudxwwdg.jpg)
|
||||||
|
|
||||||
|
> 在新安装 Fedora后,安装多媒体编码器来播放音频和视频是第一件要事。
|
||||||
|
|
||||||
|
在这篇简单的教程中,我们将看到如何在 Fedora 36 工作站中从 RPM Fusion 软件包存储库安装多媒体编码器。
|
||||||
|
|
||||||
|
### 介绍
|
||||||
|
|
||||||
很多多媒体编码器要么是闭源的,要么是非自由的,因此出于法律的原因,它们没有包含在 Fedora Linux 的默认存储库中。
|
很多多媒体编码器要么是闭源的,要么是非自由的,因此出于法律的原因,它们没有包含在 Fedora Linux 的默认存储库中。
|
||||||
|
|
||||||
@ -49,7 +54,7 @@ $ sudo dnf group upgrade --with-optional Multimedia
|
|||||||
|
|
||||||
#### 安装多媒体播放器
|
#### 安装多媒体播放器
|
||||||
|
|
||||||
一些流行的媒体播放器,诸如 VLC、Celluloid、SMplayer 和 Plex-media-palyer 等等,将提供所有需要是编码器。你不需要将它们全部都安装,只要任意一两个就足够了。下面给出安装这些播放器的命令:
|
一些流行的媒体播放器,诸如 VLC、Celluloid、SMplayer 和 Plex-media-palyer 等等,将提供所有需要的编码器。你不需要将它们全部都安装,只要任意一两个就足够了。下面给出安装这些播放器的命令:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ sudo dnf install vlc
|
$ sudo dnf install vlc
|
||||||
@ -69,9 +74,9 @@ $ sudo dnf install smplayer
|
|||||||
$ sudo dnf install plex-media-player
|
$ sudo dnf install plex-media-player
|
||||||
```
|
```
|
||||||
|
|
||||||
这将不仅为你提供 h264、h265、vp8 和 vp9 编码器 (均带硬件支持),它也将启用一种更高效的编码器 av1 (又名 av01)。你可以使用 [AV1 Beta Launch Playlist][2]来测试你的浏览器是否支持这个编码器。
|
这将不仅为你提供 H264、H265、VP8 和 VP9 编码器(均带硬件支持),它也将启用一种更高效的编码器 AV1(又名 AV01)。你可以使用 [AV1 Beta Launch Playlist][2] 来测试你的浏览器是否支持这个编码器。
|
||||||
|
|
||||||
它们中的一些播放器也可以作为 **flatpak** 格式的应用程序来使用的。如果与传统的软件包管理器相比,你更喜欢 flatpak 格式的应用程序,你可以安装它们。现在大多数的 Linux 发行版都支持开箱即用的 flatpak 格式的应用程序
|
它们中的一些播放器也可以作为 **flatpak** 格式的应用程序来使用。如果与传统的软件包管理器相比,你更喜欢 flatpak 格式的应用程序,你可以安装它们。现在大多数的 Linux 发行版都支持开箱即用的 flatpak 格式的应用程序
|
||||||
|
|
||||||
为安装 VLC 的 flatpak 版本,运行:
|
为安装 VLC 的 flatpak 版本,运行:
|
||||||
|
|
||||||
@ -81,13 +86,13 @@ $ flatpak install vlc
|
|||||||
|
|
||||||
#### 可选 - 安装 FFmpeg
|
#### 可选 - 安装 FFmpeg
|
||||||
|
|
||||||
**FFmpeg** 是一个功能强大的多媒体框架,它可用于编码、解码、转码、mux, demux, record, stream, filter, 以及播放各种类型的媒体文件。你可以通过在你的系统上安装 FFmpeg 来获取相应的解码器。
|
**FFmpeg** 是一个功能强大的多媒体框架,它可用于编码、解码、转码、混流、解混流、录制、音轨、过滤等,以及播放各种类型的媒体文件。你可以通过在你的系统上安装 FFmpeg 来获取相应的解码器。
|
||||||
|
|
||||||
* [如何在 Linux 中安装 FFmpeg][3]
|
* [如何在 Linux 中安装 FFmpeg][3]
|
||||||
|
|
||||||
希望这有帮助。
|
希望这有帮助。
|
||||||
|
|
||||||
**相关阅读:**
|
**相关阅读:**
|
||||||
|
|
||||||
* [在 Fedora Silverblue 中的 Chromium 和 Firefox 上启用 H264][4]
|
* [在 Fedora Silverblue 中的 Chromium 和 Firefox 上启用 H264][4]
|
||||||
* [如何在 OpenSUSE 中安装多媒体解码器][5]
|
* [如何在 OpenSUSE 中安装多媒体解码器][5]
|
||||||
@ -99,7 +104,7 @@ via: https://ostechnix.com/how-to-install-multimedia-codecs-in-fedora-linux/
|
|||||||
作者:[sk][a]
|
作者:[sk][a]
|
||||||
选题:[lkxed][b]
|
选题:[lkxed][b]
|
||||||
译者:[robsean](https://github.com/robsean)
|
译者:[robsean](https://github.com/robsean)
|
||||||
校对:[校对者ID](https://github.com/校对者ID)
|
校对:[wxy](https://github.com/wxy)
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
@ -0,0 +1,42 @@
|
|||||||
|
[#]: subject: "Google To Start Distributing A Collection Of Open Source Software libraries"
|
||||||
|
[#]: via: "https://www.opensourceforu.com/2022/05/google-to-start-distributing-a-collection-of-open-source-software-libraries/"
|
||||||
|
[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/"
|
||||||
|
[#]: collector: "lkxed"
|
||||||
|
[#]: translator: "beamrolling"
|
||||||
|
[#]: reviewer: "wxy"
|
||||||
|
[#]: publisher: "wxy"
|
||||||
|
[#]: url: "https://linux.cn/article-14641-1.html"
|
||||||
|
|
||||||
|
谷歌开始分发一系列开源软件库
|
||||||
|
======
|
||||||
|
|
||||||
|
![](https://img.linux.net.cn/data/attachment/album/202205/27/104331cwwqji26wlwwfw2n.jpg)
|
||||||
|
|
||||||
|
5 月 17 日,谷歌推出了一项新计划,该计划向谷歌云用户策划并提供经过安全审查的开源包选项,以保护开源软件供应链。该公司在一篇 [博文][2] 中宣布了这项名为 “<ruby>安心开源软件<rt>Assured Open Source Software</rt></ruby>” 的新服务。在博文中,谷歌云安全和隐私部门产品经理 Andy Chang 强调了保障开源软件的一些问题,并强调了谷歌对开源的承诺。
|
||||||
|
|
||||||
|
“开发者社区、企业及政府对软件供应链风险的意识越来越强,”Chang 写道,并以去年的 log4j 重大漏洞为例。“谷歌仍是开源代码最大的维护者、贡献者和使用者之一,并深入参与了帮助开源软件生态系统更加安全的工作。”
|
||||||
|
|
||||||
|
据谷歌称,“安心开源软件”服务将让云客户能够访问谷歌的大量软件审计知识。另据其称,所有通过该服务提供的开源软件包也在公司内部使用,该公司会定期检查和分析其漏洞。
|
||||||
|
|
||||||
|
谷歌目前正在审核的 550 个重要开源库的清单可以在 [GitHub][3] 上找到。虽然这些库都可以独立于谷歌下载,但该计划将呈现通过谷歌云提供的审核版本,防止开发者破坏广泛使用的开放源码库。这项服务现在处于预先体验阶段,将在 2022 年第三季度准备好进行更广泛的消费者测试。
|
||||||
|
|
||||||
|
谷歌的声明只是广大行业努力加强开源软件供应链的安全的一部分,这份努力得到了拜登政府的支持。今年 1 月,美国国土安全部和美国网络安全与基础设施安全局的代表与美国一些主要 IT 公司的高管会面,研究 log4j 漏洞之后的开源软件安全问题。此后,有关公司在最近的一次峰会上承诺提供超过 3000 万美元的资金,以改善开源软件的安全问题。
|
||||||
|
|
||||||
|
除了现金,谷歌还在投入工程时间来确保供应链的安全。该公司已宣布发展一个“<ruby>开源维护小组<rt>Open Source Maintenance Crew</rt></ruby>”,该团队将与库维护人员合作以提高安全性。
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://www.opensourceforu.com/2022/05/google-to-start-distributing-a-collection-of-open-source-software-libraries/
|
||||||
|
|
||||||
|
作者:[Laveesh Kocher][a]
|
||||||
|
选题:[lkxed][b]
|
||||||
|
译者:[beamrolling](https://github.com/beamrolling)
|
||||||
|
校对:[wxy](https://github.com/wxy)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]: https://www.opensourceforu.com/author/laveesh-kocher/
|
||||||
|
[b]: https://github.com/lkxed
|
||||||
|
[1]: https://www.opensourceforu.com/wp-content/uploads/2022/05/google3-1-e1652863988525.jpg
|
||||||
|
[2]: https://cloud.google.com/blog/products/identity-security/introducing-assured-open-source-software-service
|
||||||
|
[3]: https://github.com/google/oss-fuzz/tree/master/projects
|
@ -0,0 +1,128 @@
|
|||||||
|
[#]: subject: "How To Reset Sudo Password In Ubuntu 22.04 / 20.04 LTS"
|
||||||
|
[#]: via: "https://ostechnix.com/how-to-reset-sudo-password-in-ubuntu-20-04-lts/"
|
||||||
|
[#]: author: "sk https://ostechnix.com/author/sk/"
|
||||||
|
[#]: collector: "lkxed"
|
||||||
|
[#]: translator: "robsean"
|
||||||
|
[#]: reviewer: "wxy"
|
||||||
|
[#]: publisher: "wxy"
|
||||||
|
[#]: url: "https://linux.cn/article-14648-1.html"
|
||||||
|
|
||||||
|
如何在 Ubuntu 22.04 / 20.04 LTS 中重新设置 sudo 密码
|
||||||
|
======
|
||||||
|
|
||||||
|
![](https://img.linux.net.cn/data/attachment/album/202205/29/083429wzrvirffinihrfv5.jpg)
|
||||||
|
|
||||||
|
> 在 Ubuntu 中重新设置已忘记的 root 用户的密码
|
||||||
|
|
||||||
|
这篇简单的指南将向你解释,如何在 Ubuntu 22.04 好 20.04 LTS 桌面环境中,以及从服务器版本中的 <ruby>恢复<rt>rescue</rt></ruby> 模式中重新设置 sudo 密码。
|
||||||
|
|
||||||
|
### 介绍
|
||||||
|
|
||||||
|
在 [安装 Ubuntu][1] 时,创建的一个新用户将会带有 `sudo` 权限,用以执行各种各样的管理任务。
|
||||||
|
|
||||||
|
如果你的 Ubuntu 系统有多个 `sudo` 用户,你能够从另外一个 `sudo` 用户的账号下,轻松地重新设置所忘记的一个 `sudo` 用户或管理员用户的密码。
|
||||||
|
|
||||||
|
如果你只有一个 `sudo` 用户,并且忘记了密码怎么办?没有问题! 从 Ubuntu 的 <ruby>恢复<rt>rescue</rt></ruby> 或 <ruby>单一用户<rt>single user</rt></ruby> 模式中恢复 `sudo` 用户密码很容易。
|
||||||
|
|
||||||
|
虽然这篇指南是在 Ubuntu 22.04 和 20.04 LTS 版本上进行的正式测试,不过,下面给定的步骤对于其它的 Ubuntu 版本和衍生版本来说是相同的。
|
||||||
|
|
||||||
|
### 在 Ubuntu 22.04 / 20.04 LTS 中重新设置 sudo 密码
|
||||||
|
|
||||||
|
首先,启动你的 Ubuntu 系统到 <ruby>恢复<rt>rescue</rt></ruby> 模式下,来重新设置一个 `sudo` 用户的密码,操作如下面的链接所述。
|
||||||
|
|
||||||
|
> [如何启动到 Ubuntu 22.04 / 20.04 / 18.04 的 <ruby>恢复<rt>rescue</rt></ruby> 模式 或 <ruby>急救<rt>Emergency</rt></ruby>模式 ][2]
|
||||||
|
|
||||||
|
现在,进入到 <ruby>恢复<rt>rescue</rt></ruby> 模式下,通过运行下面的命令,以读/写的模式挂载根(`/`)文件系统:
|
||||||
|
|
||||||
|
```
|
||||||
|
# mount -n -o remount,rw /
|
||||||
|
```
|
||||||
|
|
||||||
|
现在,使用 `passwd` 命令来重新设置 `sudo` 用户的密码:
|
||||||
|
|
||||||
|
```
|
||||||
|
# passwd ostechnix
|
||||||
|
```
|
||||||
|
|
||||||
|
在这里,`ostechnix` 是 sudo 用户的名称。使用你自己的用户名称来替换掉它。
|
||||||
|
|
||||||
|
输入两次密码:
|
||||||
|
|
||||||
|
```
|
||||||
|
New password:
|
||||||
|
Retype new password:
|
||||||
|
passwd: password updated successfully
|
||||||
|
```
|
||||||
|
|
||||||
|
![Reset Sudo Password In Ubuntu 22.04 / 20.04 LTS][3]
|
||||||
|
|
||||||
|
就这样。我们已经重新设置 `sudo` 用户密码。如果你按照上面链接所述的方法 1 进入到 <ruby>恢复<rt>rescue</rt></ruby> 模式,按下 `Ctrl+d` 组合键来启动到正常模式。或者,你也可以输入下面的任意一个命令来启动到正常模式。
|
||||||
|
|
||||||
|
```
|
||||||
|
# systemctl default
|
||||||
|
```
|
||||||
|
|
||||||
|
或,
|
||||||
|
|
||||||
|
```
|
||||||
|
# exit
|
||||||
|
```
|
||||||
|
|
||||||
|
如果你想重新启动系统,而不是启动到正常模式,输入:
|
||||||
|
|
||||||
|
```
|
||||||
|
# systemctl reboot
|
||||||
|
```
|
||||||
|
|
||||||
|
如果你已经按照上面链接所述的方法 2 进入到<ruby>恢复<rt>rescue</rt></ruby> 模式,输入:
|
||||||
|
|
||||||
|
```
|
||||||
|
# exit
|
||||||
|
```
|
||||||
|
|
||||||
|
你将返回到 <ruby>恢复菜单<rt>recovery menu</rt></ruby>。现在选择 “<ruby>恢复正常启动<rt>Resume normal boot</rt></ruby>”,并按下回车键。
|
||||||
|
|
||||||
|
![Boot Into Normal Mode In Ubuntu][4]
|
||||||
|
|
||||||
|
在强调一次,选择 “<ruby>确定<rt>OK</rt></ruby>” 按钮,并按下回车按键来继续启动到正常模式:
|
||||||
|
|
||||||
|
![Exit Recovery Mode And Boot Into Normal Mode][5]
|
||||||
|
|
||||||
|
现在,你在运行管理命令时可以使用新的 `sudo` 密码。
|
||||||
|
|
||||||
|
### 如果我把用户名称和密码都忘了怎么办?
|
||||||
|
|
||||||
|
如果你忘记了用户名称,在 <ruby>恢复<rt>rescue</rt></ruby> 模式下,你可以很容易地列出你的 Linux 系统中的用户名称,使用目录:
|
||||||
|
|
||||||
|
```
|
||||||
|
# cat etc/passwd
|
||||||
|
```
|
||||||
|
|
||||||
|
来自我 Ubuntu 22.04 系统的输出示例:
|
||||||
|
|
||||||
|
```
|
||||||
|
[...]
|
||||||
|
ostechnix:x:1000:1000:Ostechnix,,,:/home/ostechnix:/bin/bash
|
||||||
|
[...]
|
||||||
|
```
|
||||||
|
|
||||||
|
好了,现在,你找到用户名称了。只需要按照上面的步骤来重新设置用户的密码即可。
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://ostechnix.com/how-to-reset-sudo-password-in-ubuntu-20-04-lts/
|
||||||
|
|
||||||
|
作者:[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/install-ubuntu-desktop/
|
||||||
|
[2]: https://ostechnix.com/how-to-boot-into-rescue-mode-or-emergency-mode-in-ubuntu-18-04/
|
||||||
|
[3]: https://ostechnix.com/wp-content/uploads/2022/05/Reset-Sudo-Password-In-Ubuntu.png
|
||||||
|
[4]: https://ostechnix.com/wp-content/uploads/2020/05/Boot-into-normal-mode-in-Ubuntu.png
|
||||||
|
[5]: https://ostechnix.com/wp-content/uploads/2020/05/Booting-into-normal-mode-from-rescue-mode-in-Ubuntu.png
|
132
published/20220520 Customize GNOME 42 with A Polished Look.md
Normal file
132
published/20220520 Customize GNOME 42 with A Polished Look.md
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
[#]: subject: "Customize GNOME 42 with A Polished Look"
|
||||||
|
[#]: via: "https://www.debugpoint.com/2022/05/customize-gnome-42-look-1/"
|
||||||
|
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||||
|
[#]: collector: "lkxed"
|
||||||
|
[#]: translator: "geekpi"
|
||||||
|
[#]: reviewer: "wxy"
|
||||||
|
[#]: publisher: "wxy"
|
||||||
|
[#]: url: "https://linux.cn/article-14646-1.html"
|
||||||
|
|
||||||
|
如何把你的 GNOME 42 打磨得更精致
|
||||||
|
======
|
||||||
|
|
||||||
|
![](https://img.linux.net.cn/data/attachment/album/202205/28/191525nx791r930j88ra3z.jpg)
|
||||||
|
|
||||||
|
> 在 5 分钟内将你最喜欢的 GNOME 桌面打磨得更精致。
|
||||||
|
|
||||||
|
你可以使用图标、主题、光标和壁纸等多种方式来定制你最喜爱的 GNOME 桌面。本文向你展示了如何使你的 GNOME 42 桌面看起来更精致。在最近发布的 Ubuntu 22.04 LTS 和 Fedora 36 上提供了 GNOME 42 桌面环境。
|
||||||
|
|
||||||
|
在你进一步阅读之前,先看看调整之前和之后的外观比较。
|
||||||
|
|
||||||
|
![GNOME before customisation][1]
|
||||||
|
|
||||||
|
![GNOME after customisation][2]
|
||||||
|
|
||||||
|
我将把本教程分为两个部分。
|
||||||
|
|
||||||
|
第一部分涉及设置和安装所需的软件包。然后第二部分是如何应用各种设置来获得你想要的外观。
|
||||||
|
|
||||||
|
本教程主要在 Ubuntu 22.04 LTS 上测试。但是,它应该适用于 Ubuntu 和 Fedora 的其他变体。
|
||||||
|
|
||||||
|
### 将 GNOME 42 定制得更精致
|
||||||
|
|
||||||
|
#### 设置
|
||||||
|
|
||||||
|
首先,为你的系统启用 Flatpak,因为我们需要安装扩展管理器来下载本教程所需的 GNOME Shell 扩展。
|
||||||
|
|
||||||
|
因此,要做到这一点,请打开一个终端并运行以下命令:
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo apt install flatpak gnome-software-plugin-flatpak
|
||||||
|
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||||
|
```
|
||||||
|
|
||||||
|
完成后重启计算机。
|
||||||
|
|
||||||
|
然后从终端运行以下命令,来安装扩展管理器应用以下载 GNOME Shell 扩展:
|
||||||
|
|
||||||
|
```
|
||||||
|
flatpak install flathub com.mattjakeman.ExtensionManager
|
||||||
|
```
|
||||||
|
|
||||||
|
打开扩展管理器应用,并安装两个扩展。第一个是 “<ruby>浮动停靠区<rt>Floating Dock</rt></ruby>”,它提供了超酷的停靠区,你可以在桌面上的任何位置移动它。第二个,安装 “<ruby>用户主题<rt>User themes</rt></ruby>” 扩展来帮助你在 Ubuntu Linux 中安装外部 GTK 主题。
|
||||||
|
|
||||||
|
![User Themes Extension][3]
|
||||||
|
|
||||||
|
![Floating Dock Extension][4]
|
||||||
|
|
||||||
|
接着,使用以下命令安装 [Materia 主题][5]。你必须构建它,因为它没有任何可执行文件。在 Ubuntu 中依次运行以下命令进行安装:
|
||||||
|
|
||||||
|
```
|
||||||
|
git clone https://github.com/ckissane/materia-theme-transparent.git
|
||||||
|
cd materia-theme-transparent
|
||||||
|
meson _build
|
||||||
|
meson install -C _build
|
||||||
|
```
|
||||||
|
|
||||||
|
此外,请从 [这里][7] 下载 [Kora 图标主题][6]。下载后解压文件,将以下四个文件夹复制到 `/home/<用户名>/.icons` 路径下。如果 `.icons` 文件夹不存在,请创建它。
|
||||||
|
|
||||||
|
![Kora Icon Theme][8]
|
||||||
|
|
||||||
|
除了上述更改,从 [这里][9] 下载 Bibata 光标主题。下载后,解压文件夹并将其复制到相同的 `/home/<用户名>/.icons` 文件夹中。
|
||||||
|
|
||||||
|
除了上述之外,如果你想要一个与上述主题相匹配的漂亮字体,请从谷歌字体 [下载 Robot 字体][10],并将它们复制到 `/home/<user name>/.fonts` 文件夹。
|
||||||
|
|
||||||
|
最后,再次重启系统。
|
||||||
|
|
||||||
|
#### 配置
|
||||||
|
|
||||||
|
打开扩展管理器,启用 “<ruby>浮动停靠区<rt>Floating Dock</rt></ruby>” 和 “<ruby>用户主题<rt>User themes</rt></ruby>”,并禁用 “Ubuntu Dock”。
|
||||||
|
|
||||||
|
![Changes to Extensions][11]
|
||||||
|
|
||||||
|
此外,打开 “<ruby>浮动停靠区<rt>Floating Dock</rt></ruby>” 设置并进行以下更改:
|
||||||
|
|
||||||
|
![Floating Dock Settings][12]
|
||||||
|
|
||||||
|
此外,打开 <ruby>[GNOME 优化工具][13]<rt>GNOME Tweak Tool</rt></ruby>,然后转到<ruby>外观<rt>Appearance</rt></ruby>选项卡。设置以下内容:
|
||||||
|
|
||||||
|
* 光标:Bibata-Original-Ice
|
||||||
|
* Shell 主题:Materia
|
||||||
|
* 图标:Kora
|
||||||
|
|
||||||
|
除此之外,你可能还想更改字体。为此,请转到<ruby>字体<rt>Fonts</rt></ruby>选项卡并将文档和界面更改为 “Robot 10pt”。
|
||||||
|
|
||||||
|
或者,你也可以从 Ubuntu 22.04 的默认设置中更改强调色和样式。
|
||||||
|
|
||||||
|
最后,根据你的喜好下载漂亮的壁纸。对于本教程,我从 [这里][14] 下载了一个示例壁纸。
|
||||||
|
|
||||||
|
如果一切顺利,你应该有一个漂亮的桌面,如下图所示:
|
||||||
|
|
||||||
|
![Customize GNOME 42 – Final Look][15]
|
||||||
|
|
||||||
|
享受你的精致的 GNOME 42!干杯。
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://www.debugpoint.com/2022/05/customize-gnome-42-look-1/
|
||||||
|
|
||||||
|
作者:[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://i2.wp.com/www.debugpoint.com/wp-content/uploads/2022/05/GNOME-before-customisation.jpg?ssl=1
|
||||||
|
[2]: https://i0.wp.com/www.debugpoint.com/wp-content/uploads/2022/05/GNOME-after-customisation.jpg?ssl=1
|
||||||
|
[3]: https://www.debugpoint.com/wp-content/uploads/2022/05/User-Themes-Extension2.jpg
|
||||||
|
[4]: https://www.debugpoint.com/wp-content/uploads/2022/05/Floating-Doc-Extension.jpg
|
||||||
|
[5]: https://github.com/ckissane/materia-theme-transparent
|
||||||
|
[6]: https://github.com/bikass/kora/
|
||||||
|
[7]: https://github.com/bikass/kora/archive/refs/heads/master.zip
|
||||||
|
[8]: https://www.debugpoint.com/wp-content/uploads/2022/05/Kora-Icon-Theme.jpg
|
||||||
|
[9]: https://www.pling.com/p/1197198/
|
||||||
|
[10]: https://fonts.google.com/specimen/Roboto
|
||||||
|
[11]: https://www.debugpoint.com/wp-content/uploads/2022/05/Changes-to-Extensions.jpg
|
||||||
|
[12]: https://www.debugpoint.com/wp-content/uploads/2022/05/Floating-Dock-Settings.jpg
|
||||||
|
[13]: https://www.debugpoint.com/2018/05/customize-your-ubuntu-desktop-using-gnome-tweak/
|
||||||
|
[14]: https://www.pexels.com/photo/colorful-blurred-image-6985048/
|
||||||
|
[15]: https://www.debugpoint.com/wp-content/uploads/2022/05/Customize-GNOME-42-Final-Look.jpg
|
@ -3,21 +3,22 @@
|
|||||||
[#]: author: "Dr Kumar Gaurav https://www.opensourceforu.com/author/dr-gaurav-kumar/"
|
[#]: author: "Dr Kumar Gaurav https://www.opensourceforu.com/author/dr-gaurav-kumar/"
|
||||||
[#]: collector: "lkxed"
|
[#]: collector: "lkxed"
|
||||||
[#]: translator: "geekpi"
|
[#]: translator: "geekpi"
|
||||||
[#]: reviewer: " "
|
[#]: reviewer: "wxy"
|
||||||
[#]: publisher: " "
|
[#]: publisher: "wxy"
|
||||||
[#]: url: " "
|
[#]: url: "https://linux.cn/article-14649-1.html"
|
||||||
|
|
||||||
DAML:区块链中智能合约的编程语言
|
DAML:区块链中智能合约的编程语言
|
||||||
======
|
======
|
||||||
DAML 智能合约语言是一种专门设计的特定领域语言,用于编码应用的共享业务逻辑。它用于区块链环境中分布式应用的开发和部署。
|
|
||||||
|
|
||||||
![blockchain-hand-shake][1]
|
> DAML 智能合约语言是一种专门设计的<ruby>特定领域语言<rt>domain specific language</rt></ruby>(DSL),用于编码应用的共享业务逻辑。它用于区块链环境中分布式应用的开发和部署。
|
||||||
|
|
||||||
|
![](https://img.linux.net.cn/data/attachment/album/202205/29/090752supudcno3dufa41j.jpg)
|
||||||
|
|
||||||
区块链技术是一种安全机制,以一种使人难以或不可能修改或入侵的方式来跟踪信息。区块链整合了交易的数字账本,它被复制并发送至其网络上的每台计算机。在链的每个区块中,都有一些交易。当区块链上发生新的交易时,该交易的记录就会被添加到属于该链的每个人的账簿中。
|
区块链技术是一种安全机制,以一种使人难以或不可能修改或入侵的方式来跟踪信息。区块链整合了交易的数字账本,它被复制并发送至其网络上的每台计算机。在链的每个区块中,都有一些交易。当区块链上发生新的交易时,该交易的记录就会被添加到属于该链的每个人的账簿中。
|
||||||
|
|
||||||
区块链使用分布式账本技术(DLT),其中数据库并不保存在一个服务器或节点中。在区块链中,交易被记录在一个被称为哈希的不可改变的加密符号中。这意味着,如果一个通道或链上的一个区块被改变,黑客将很难改变链上的那个区块,因为他们必须对外面的每一个版本的链都要这样做。区块链,如比特币和以太坊,随着新的区块被添加到链上而不断增长,这使得账本更加安全。
|
区块链使用<ruby>分布式账本技术<rt>distributed ledger technology</rt></ruby>(DLT),其中数据库并不保存在一个服务器或节点中。在区块链中,交易被记录在一个被称为<ruby>哈希<rt>hash</rt></ruby>的不可改变的加密符号中。这意味着,如果一个通道或链上的一个区块被改变,黑客将很难改变链上的那个区块,因为他们必须对外面的每一个版本的链都要这样做。区块链,如比特币和以太坊,随着新的区块被添加到链上而不断增长,这使得账本更加安全。
|
||||||
|
|
||||||
随着区块链中智能合约的实施,在没有任何人工干预的情况下,有自动执行的场景。智能合约技术使得执行最高级别的安全、隐私和反黑客实施成为可能。
|
随着区块链中智能合约的实施,在没有任何人工干预的情况下,有了自动执行的场景。智能合约技术使得执行最高级别的安全、隐私和反黑客实施成为可能。
|
||||||
|
|
||||||
![Figure 1: Market size of blockchain technology (Source: Statista.com)][2]
|
![Figure 1: Market size of blockchain technology (Source: Statista.com)][2]
|
||||||
|
|
||||||
@ -34,7 +35,7 @@ DAML 智能合约语言是一种专门设计的特定领域语言,用于编码
|
|||||||
* 数字投票
|
* 数字投票
|
||||||
* 供应链管理
|
* 供应链管理
|
||||||
|
|
||||||
根据 *Statista.com*,自过去几年以来,区块链技术市场的规模正在以非常快的速度增长,预计到 2025 年将达到 400 亿美元。
|
根据 Statista.com,自过去几年以来,区块链技术市场的规模正在以非常快的速度增长,预计到 2025 年将达到 400 亿美元。
|
||||||
|
|
||||||
### 区块链的编程语言和工具箱
|
### 区块链的编程语言和工具箱
|
||||||
|
|
||||||
@ -46,7 +47,7 @@ DAML 智能合约语言是一种专门设计的特定领域语言,用于编码
|
|||||||
|
|
||||||
开发区块链的主要平台有:
|
开发区块链的主要平台有:
|
||||||
|
|
||||||
* Ethereum
|
* 以太坊
|
||||||
* XDC Network
|
* XDC Network
|
||||||
* Tezos
|
* Tezos
|
||||||
* Stellar
|
* Stellar
|
||||||
@ -63,7 +64,7 @@ DAML 智能合约语言是一种专门设计的特定领域语言,用于编码
|
|||||||
|
|
||||||
### DAML:一种高性能的编程语言
|
### DAML:一种高性能的编程语言
|
||||||
|
|
||||||
数字资产建模语言或 DAML(daml.com)是一种高性能的编程语言,用于开发和部署区块链环境中的分布式应用。它是一个轻量级和简洁的平台,用于快速应用开发。
|
<ruby>数字资产建模语言<rt>Digital Asset Modeling Language</rt></ruby>,即 DAML(daml.com),是一种高性能的编程语言,用于开发和部署区块链环境中的分布式应用。它是一个轻量级和简洁的平台,用于快速应用开发。
|
||||||
|
|
||||||
![Figure 3: Official portal of DAML][4]
|
![Figure 3: Official portal of DAML][4]
|
||||||
|
|
||||||
@ -83,14 +84,14 @@ DAML 的主要特点是:
|
|||||||
|
|
||||||
### 安装和使用 DAML
|
### 安装和使用 DAML
|
||||||
|
|
||||||
DAML SDK 可以安装在 Linux、macOS 或 Windows 上。在多个操作系统上安装 DAML 的详细说明可访问 *https://docs.daml.com/getting-started/installation.html*。
|
DAML SDK 可以安装在 Linux、macOS 或 Windows 上。在多个操作系统上安装 DAML 的详细说明可访问 https://docs.daml.com/getting-started/installation.html 。
|
||||||
|
|
||||||
你必须具备以下条件才能使用 DAML:
|
你必须具备以下条件才能使用 DAML:
|
||||||
|
|
||||||
* Visual Studio Code
|
* Visual Studio Code
|
||||||
* Java 开发套件(JDK)
|
* Java 开发套件(JDK)
|
||||||
|
|
||||||
DAML 可以通过下载并运行可执行的安装程序在 Windows 上安装,你可访问 *https://github.com/digital-asset/daml/releases/download/v1.18.1/daml-sdk-1.18.1-windows.exe。*
|
DAML 可以通过下载并运行可执行的安装程序在 Windows 上安装,你可访问 https://github.com/digital-asset/daml/releases/download/v1.18.1/daml-sdk-1.18.1-windows.exe 。
|
||||||
|
|
||||||
在 Linux 或 Mac 上安装 DAML 可以通过在终端执行以下内容来完成:
|
在 Linux 或 Mac 上安装 DAML 可以通过在终端执行以下内容来完成:
|
||||||
|
|
||||||
@ -112,13 +113,13 @@ WorkingDirectory>npm install
|
|||||||
WorkingDirectory>npm start
|
WorkingDirectory>npm start
|
||||||
```
|
```
|
||||||
|
|
||||||
WebUI 被启动,该应用可在 Web 浏览器上通过 URL *http://localhost:3000/* 访问。
|
这样启动了 WebUI,该应用可在 Web 浏览器上通过 URL http://localhost:3000/ 访问。
|
||||||
|
|
||||||
![Figure 6: Login panel in DAML app][7]
|
![Figure 6: Login panel in DAML app][7]
|
||||||
|
|
||||||
### 研究和开发的范围
|
### 研究和开发的范围
|
||||||
|
|
||||||
区块链技术为不同类别的应用提供了广泛的开发平台和框架。其中许多平台是免费和开源的,可以下载和部署以用于基于研究的实现。研究学者、从业者和院士可以使用这些平台为众多应用提出和实施他们的算法。
|
区块链技术为不同类别的应用提供了广泛的开发平台和框架。其中许多平台是免费和开源的,可以下载和部署以用于基于研究的实现。研究学者、从业者和专家们可以使用这些平台为众多应用提出和实施他们的算法。
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -127,7 +128,7 @@ via: https://www.opensourceforu.com/2022/05/daml-the-programming-language-for-sm
|
|||||||
作者:[Dr Kumar Gaurav][a]
|
作者:[Dr Kumar Gaurav][a]
|
||||||
选题:[lkxed][b]
|
选题:[lkxed][b]
|
||||||
译者:[geekpi](https://github.com/geekpi)
|
译者:[geekpi](https://github.com/geekpi)
|
||||||
校对:[校对者ID](https://github.com/校对者ID)
|
校对:[wxy](https://github.com/wxy)
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
@ -135,7 +136,7 @@ via: https://www.opensourceforu.com/2022/05/daml-the-programming-language-for-sm
|
|||||||
[b]: https://github.com/lkxed
|
[b]: https://github.com/lkxed
|
||||||
[1]: https://www.opensourceforu.com/wp-content/uploads/2022/04/blockchain-hand-shake.jpg
|
[1]: https://www.opensourceforu.com/wp-content/uploads/2022/04/blockchain-hand-shake.jpg
|
||||||
[2]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-1-Market-size-of-blockchain-technology.jpg
|
[2]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-1-Market-size-of-blockchain-technology.jpg
|
||||||
[3]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-2-Factors-to-look-at-when-selecting-a-blockchain-platform-2.jpg
|
[3]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Untitled.png
|
||||||
[4]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-3-Official-portal-of-DAML-1.jpg
|
[4]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-3-Official-portal-of-DAML-1.jpg
|
||||||
[5]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-4-Creating-a-new-app.jpg
|
[5]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-4-Creating-a-new-app.jpg
|
||||||
[6]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-5-Running-DAML.jpg
|
[6]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-5-Running-DAML.jpg
|
@ -0,0 +1,135 @@
|
|||||||
|
[#]: subject: "Linux Kernel 5.18 Released with Graphics Driver Changes and New Hardware Support"
|
||||||
|
[#]: via: "https://news.itsfoss.com/linux-kernel-5-18-release/"
|
||||||
|
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
||||||
|
[#]: collector: "lkxed"
|
||||||
|
[#]: translator: "PeterPan0106"
|
||||||
|
[#]: reviewer: "wxy"
|
||||||
|
[#]: publisher: "wxy"
|
||||||
|
[#]: url: "https://linux.cn/article-14640-1.html"
|
||||||
|
|
||||||
|
Linux 内核 5.18 版本正式发布,新增显卡驱动以及硬件支持
|
||||||
|
======
|
||||||
|
|
||||||
|
> 最新的 Linux 内核 5.18 版本现已如期发布,本次更新包括针对新硬件的支持以及许多其他核心变化。
|
||||||
|
|
||||||
|
![Linux kernel 5.18 release][1]
|
||||||
|
|
||||||
|
[Linux 5.17 内核][2] 发布时包含了对下一代硬件的支持,同时增强了 Steam Deck 的游戏体验。
|
||||||
|
|
||||||
|
每一代内核都包含了令人兴奋的技术进步,Linux 内核 5.18 也不例外。
|
||||||
|
|
||||||
|
### Linux 内核 5.18 有哪些变化呢?
|
||||||
|
|
||||||
|
本次我们可以看到,内核针对雷蛇外设硬件、苹果妙控键盘和 AMD 显卡增强了支持,还有一些网络、核心和安全方面的更新。
|
||||||
|
|
||||||
|
#### 新的雷蛇驱动
|
||||||
|
|
||||||
|
说到游戏装备,Linux 的硬件支持亟待更新。
|
||||||
|
|
||||||
|
目前存在一些开源驱动程序的变通解决方案。但是这些方案不具有普适性,适配和支持较少。
|
||||||
|
|
||||||
|
正如 [Phoronix][3] 所发现的,Linux 内核 5.18 中一同发布了一个新的雷蛇 HID 驱动程序,它适配了雷蛇黑寡妇蜘蛛键盘,并修复了宏键此前存在的问题。
|
||||||
|
|
||||||
|
此外,这个驱动程序应该也有助于解决其他雷蛇硬件的问题。
|
||||||
|
|
||||||
|
#### AMD 显卡特性 FreeSync 模式被默认开启
|
||||||
|
|
||||||
|
![][4]
|
||||||
|
|
||||||
|
虽然对 FreeSync 视频的支持足够好,但这只是改善 FreeSync 显示器用户体验的一个临时解决方案。
|
||||||
|
|
||||||
|
现在在 Linux 内核 5.18 版本中这一显示模式已被默认启用,用户无需调整任何设置即可使用 FreeSync([见更新日志][5])。
|
||||||
|
|
||||||
|
#### 显卡驱动更新
|
||||||
|
|
||||||
|
针对当前和未来的 AMD 显卡的驱动进行了改进。此外,支持英特尔 Arch 图形处理器和英特尔 Alder Lake N 的工作也取得了一些进展。
|
||||||
|
|
||||||
|
更高刷新率的 DisplayPort 也在这一个版本中得到支持。
|
||||||
|
|
||||||
|
#### 从 C89 标准升级到 C11 标准(GNU11)
|
||||||
|
|
||||||
|
![][6]
|
||||||
|
|
||||||
|
在 Linux 内核中使用的是 C89 C 语言标准,在当前已经稍显老旧并且缺失了许多十分必要的新特性。
|
||||||
|
|
||||||
|
考虑到目前的编译器版本 GCC 5.1 的要求,从 Linux 内核 5.18 开始决定用 C11 标准来取代它。
|
||||||
|
|
||||||
|
#### 网络优化
|
||||||
|
|
||||||
|
Linux 内核 5.18 增加了对新的无线硬件的支持,这包括联发科 MT7916、MT7921U 和博通 BCM43454/6。
|
||||||
|
|
||||||
|
![][7]
|
||||||
|
|
||||||
|
针对移动设备的改进也包括对英特尔 M.2 WWAN 卡的支持。
|
||||||
|
|
||||||
|
Realtek W89 驱动现在支持 AP 模式、6GHz 频段并增加了硬件扫描功能。
|
||||||
|
|
||||||
|
在配置 IPv6 和其他各种协议方面,通过一系列的改进提升了性能。
|
||||||
|
|
||||||
|
你可以在 Linux 内核 5.18 中网络方面的变更提交中了解所有情况(包括对驱动 API、协议和一些核心功能的改进)。
|
||||||
|
|
||||||
|
#### USB 改进
|
||||||
|
|
||||||
|
Xen USB 驱动程序进行了改进,以抵御恶意主设备,USB DWC3 驱动程序也支持了更多的硬件类型。
|
||||||
|
|
||||||
|
其他改进详见 [更新日志][8]。
|
||||||
|
|
||||||
|
#### 增强对苹果键盘以及平板的支持
|
||||||
|
|
||||||
|
![][9]
|
||||||
|
|
||||||
|
当前版本针对苹果妙控键盘(包含第一代型号)的使用体验进行了优化。
|
||||||
|
|
||||||
|
改进了功能键映射、键盘背光事件,以及 2021 款的妙控键盘通过 USB 连接时报告电池水平的能力。
|
||||||
|
|
||||||
|
Linux 内核 5.18 改进了输入处理,在平板电脑上输入将变得更为容易。
|
||||||
|
|
||||||
|
硬件相关的改进详见 [更新日志][10]。
|
||||||
|
|
||||||
|
#### ARM 架构芯片的支持(特斯拉 FSD,树莓派 Zero 2 W)
|
||||||
|
|
||||||
|
![][11]
|
||||||
|
|
||||||
|
Linux 内核 5.18 现在支持特斯拉的全套自动驾驶 SoC。三星工程师将其贡献到了 Linux 内核上游。
|
||||||
|
|
||||||
|
其他芯片支持包括高通骁龙 625/632,以及三星 Exynos 850/7885。
|
||||||
|
|
||||||
|
你还会发现 Linux 内核 5.18 支持了树莓派 Zero 2 W,而同时去除了旧的硬件/主板的支持。详见 [更新日志][12]。
|
||||||
|
|
||||||
|
你可以参考 [官方更新日志][13] 和 Linus Torvald 的官方公告获取更多信息。
|
||||||
|
|
||||||
|
### 如何安装 Linux 内核 5.18?
|
||||||
|
|
||||||
|
你可以在 [Linux Kernel Archives][14] 网站上找到最新版本的内核。你可以下载 [Tarball][15] 以进行测试。你也可以参照我们的 [Linux 内核升级指南][16] 获取帮助。
|
||||||
|
|
||||||
|
如果不想自己编译它,你可以稍等几周,等 Linux 发行版们把它推到仓库。
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://news.itsfoss.com/linux-kernel-5-18-release/
|
||||||
|
|
||||||
|
作者:[Ankush Das][a]
|
||||||
|
选题:[lkxed][b]
|
||||||
|
译者:[PeterPan0106](https://github.com/PeterPan0106)
|
||||||
|
校对:[wxy](https://github.com/wxy)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]: https://news.itsfoss.com/author/ankush/
|
||||||
|
[b]: https://github.com/lkxed
|
||||||
|
[1]: https://news.itsfoss.com/wp-content/uploads/2022/05/kernel-5-18-release.png
|
||||||
|
[2]: https://news.itsfoss.com/linux-kernel-5-17-release/
|
||||||
|
[3]: https://www.phoronix.com/scan.php?page=news_item&px=Linux-5.18-HID
|
||||||
|
[4]: https://news.itsfoss.com/wp-content/uploads/2022/05/amd-linux-5-18-1024x576.jpg
|
||||||
|
[5]: https://lists.freedesktop.org/archives/amd-gfx/2022-February/075262.html
|
||||||
|
[6]: https://news.itsfoss.com/wp-content/uploads/2022/05/c-linux-5-18-1024x576.jpg
|
||||||
|
[7]: https://news.itsfoss.com/wp-content/uploads/2022/05/networking-linux-5-18-1024x576.jpg
|
||||||
|
[8]: https://lore.kernel.org/lkml/Yj7vGtn8fILavjyL@kroah.com/
|
||||||
|
[9]: https://news.itsfoss.com/wp-content/uploads/2022/05/apple-linux-5-18-1024x576.jpg
|
||||||
|
[10]: https://lore.kernel.org/lkml/nycvar.YFH.7.76.2203231015060.24795@cbobk.fhfr.pm/
|
||||||
|
[11]: https://news.itsfoss.com/wp-content/uploads/2022/05/arm-linux-5-18-1024x576.jpg
|
||||||
|
[12]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=baaa68a9796ef2cadfe5caaf4c730412eda0f31c
|
||||||
|
[13]: https://lore.kernel.org/lkml/CAHk-=wjiqyoH6qntYvYTjR1F2L-pHtgX9esZMRS13iktCOJ1zA@mail.gmail.com/T/#u
|
||||||
|
[14]: https://www.kernel.org/
|
||||||
|
[15]: https://git.kernel.org/torvalds/t/linux-5.16.tar.gz
|
||||||
|
[16]: https://itsfoss.com/upgrade-linux-kernel-ubuntu/
|
@ -0,0 +1,75 @@
|
|||||||
|
[#]: subject: "System76 Collaborates with HP for a Powerful Linux Laptop for Developers"
|
||||||
|
[#]: via: "https://news.itsfoss.com/hp-dev-one-system76/"
|
||||||
|
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
||||||
|
[#]: collector: "lkxed"
|
||||||
|
[#]: translator: "lkxed"
|
||||||
|
[#]: reviewer: "wxy"
|
||||||
|
[#]: publisher: "wxy"
|
||||||
|
[#]: url: "https://linux.cn/article-14645-1.html"
|
||||||
|
|
||||||
|
System76 与惠普合作为开发者提供功能强大的 Linux 笔记本电脑
|
||||||
|
======
|
||||||
|
|
||||||
|
> 惠普正在以开箱即用的 Pop!_OS 为特色进入 Linux 硬件市场,貌似有点激动人心?还是先来看一看吧!
|
||||||
|
|
||||||
|
![hp][1]
|
||||||
|
|
||||||
|
System76 不是早就自己生产 Linux 笔记本电脑了吗?那么,这次和惠普合作是怎么回事?
|
||||||
|
|
||||||
|
嗯,这一次是惠普要发行一款 Linux 笔记本电脑,搭载 Pop!_OS,也就是 System76 的基于 Ubuntu 的 Linux 发行版。
|
||||||
|
|
||||||
|
Carl Richell(System76 的创始人)在他的 Twitter 上宣布了这一消息,并附带了一个网站链接,该网站提供了更多相关信息。推文如下:
|
||||||
|
|
||||||
|
> Hp-Pop 好耶!来看看这个:[https://t.co/gf2brjjUl8][2]
|
||||||
|
|
||||||
|
### HP Dev One:专为开发者打造的 Linux 笔记本电脑
|
||||||
|
|
||||||
|
一方面,System76 笔记本电脑与 Pop!_OS 有着开箱即用硬件兼容性,因此它备受赞誉。
|
||||||
|
|
||||||
|
另一方面,Pop!_OS 也与笔记本电脑完美搭配,适配没有太多麻烦。
|
||||||
|
|
||||||
|
Pop!_OS 也一直在推出更新和新增功能,以改进工作流程并充分利用 Linux 的可用硬件。
|
||||||
|
|
||||||
|
此时,和惠普合作听起来是一个提高档次的好主意。
|
||||||
|
|
||||||
|
![HP System76][3]
|
||||||
|
|
||||||
|
所以说,Pop!_OS 和惠普合作的想法有点激动人心啊!
|
||||||
|
|
||||||
|
挂上了惠普这个牌子,笔记本电脑的可用性/保修(在纸面上)就比 System76 要好了,考虑到后者在某些地区是不提供保修的。
|
||||||
|
|
||||||
|
### AMD 驱动的笔记本电脑可帮助你更好地写代码
|
||||||
|
|
||||||
|
HP Dev One 似乎是把“为开发者提供多任务处理的能力,从而快速完成任务”作为卖点。
|
||||||
|
|
||||||
|
这款笔记本电脑的入门款搭载了 **8 核的 AMD Ryzen 7 PRO 处理器** 和 **16 GB RAM**(DDR4 @ 3200 MHz)。
|
||||||
|
|
||||||
|
预计它还会搭载由 AMD Radeon Graphics 提供支持的 14 英寸全高清防眩光显示屏。
|
||||||
|
|
||||||
|
对于 HP Dev One,Carl Richell 提到了这款笔记本电脑将通过 [LVFS][5](Linux 供应商固件服务)接收**固件更新**。
|
||||||
|
|
||||||
|
他还提到,这款笔记本电脑(以上规格)的定价为 **1099 美元** 起。
|
||||||
|
|
||||||
|
网站上只显示了它即将推出。因此,我们目前还不知道正式的发布日期。
|
||||||
|
|
||||||
|
对于像惠普这样的商业制造商来说,笔记本电脑的定价听起来并不令人兴奋(LCTT 译注:毕竟不是国内互联网品牌的笔记本),但可能是一个划算的交易。
|
||||||
|
|
||||||
|
你怎么看这款惠普笔记本电脑(运行 Linux、为开发者量身定制)的定价?你觉得这个价格合理吗?你对这款笔记本电脑有什么期望呢?
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://news.itsfoss.com/hp-dev-one-system76/
|
||||||
|
|
||||||
|
作者:[Ankush Das][a]
|
||||||
|
选题:[lkxed][b]
|
||||||
|
译者:[lkxed](https://github.com/lkxed)
|
||||||
|
校对:[wxy](https://github.com/wxy)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]: https://news.itsfoss.com/author/ankush/
|
||||||
|
[b]: https://github.com/lkxed
|
||||||
|
[1]: https://news.itsfoss.com/wp-content/uploads/2022/05/hpdevone-laptop.jpg
|
||||||
|
[2]: https://t.co/gf2brjjUl8
|
||||||
|
[3]: https://news.itsfoss.com/wp-content/uploads/2022/05/hpdevone-illustration-1024x576.jpg
|
||||||
|
[4]: https://fwupd.org/
|
@ -0,0 +1,59 @@
|
|||||||
|
[#]: subject: "DeepMind’s Open Source MuJoCo Is Available On GitHub"
|
||||||
|
[#]: via: "https://www.opensourceforu.com/2022/05/deepminds-open-source-mujoco-is-available-on-github/"
|
||||||
|
[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/"
|
||||||
|
[#]: collector: "lkxed"
|
||||||
|
[#]: translator: "lkxed"
|
||||||
|
[#]: reviewer: "wxy"
|
||||||
|
[#]: publisher: "wxy"
|
||||||
|
[#]: url: "https://linux.cn/article-14650-1.html"
|
||||||
|
|
||||||
|
DeepMind 的开源物理引擎 MuJoCo 已在 GitHub 发布
|
||||||
|
======
|
||||||
|
|
||||||
|
![deepmind1][1]
|
||||||
|
|
||||||
|
DeepMind 是 Alphabet 的子公司和 AI 研究实验室,在 2021 年 10 月,它收购了用于机器人研发的 MuJoCo 物理引擎,并承诺该模拟器将作为免费、开源、社区驱动的项目进行维护。现在,DeepMind 声称开源计划已完成,它的整个代码库 [可在 GitHub 上获得][2]。
|
||||||
|
|
||||||
|
MuJoCo 是 “Multi-Joint Dynamics with Contact” 的缩写,它是一个物理引擎,旨在帮助机器人、生物力学、图形和动画等领域的研究和开发(也包括其他需要快速准确模拟的领域)。MuJoCo 可用于帮助机器学习应用实现基于模型的计算,例如<ruby>控制综合<rt>control synthesis</rt></ruby>、<ruby>状态估计<rt>state estimation</rt></ruby>、<ruby>系统识别<rt>system identification</rt></ruby>、<ruby>机制设计<rt>mechanism design</rt></ruby>、通过<ruby>逆动力学<rt>inverse dynamics</rt></ruby>来进行数据分析,以及<ruby>并行采样<rt>parallel sampling</rt></ruby>。它也可以用作标准模拟器,例如用于游戏和交互式虚拟环境。(LCTT 译注:这段话中涉及到不少专业词汇,鉴于译者水平有限,若有谬误,请在评论中指出,同时也欢迎在评论中科普,一起学习~)
|
||||||
|
|
||||||
|
根据 DeepMind 的说法,以下是 MuJoCo 适合协作的一些功能:
|
||||||
|
|
||||||
|
* 能够模拟复杂机制的综合模拟器
|
||||||
|
* 可读、高性能、可移植的代码
|
||||||
|
* 易于扩展的代码库
|
||||||
|
* 丰富的文档,包括面向用户的和代码注释 —— 我们希望学术界和 OSS 社区的同事能够使用这个平台并为代码库做出贡献,从而改善所有人的研究
|
||||||
|
|
||||||
|
DeepMind 还说:
|
||||||
|
|
||||||
|
> “作为没有动态内存分配的 C 库,MuJoCo 非常快。不幸的是,原始物理速度一直受到 Python 包装器的阻碍:全局解释器锁(GIL)和非编译代码的存在,使得批处理、多线程操作无法执行。在下面的路线图中,我们将解决这个问题。”
|
||||||
|
|
||||||
|
(LCTT 译注: 这里补充了原文没有提及的路线图和基准测试结果。)
|
||||||
|
|
||||||
|
路线图:
|
||||||
|
|
||||||
|
* 通过批处理、多线程模拟释放 MuJoCo 的速度潜力
|
||||||
|
* 通过改进内部内存管理支持更大的场景
|
||||||
|
* 新的增量编译器,带来更好的模型可组合性
|
||||||
|
* 通过 Unity 集成支持更好的渲染
|
||||||
|
* 对物理导数的原生支持,包括解析和有限差分
|
||||||
|
|
||||||
|
> “目前,我们想分享两个常见模型的基准测试结果。注意,这个结果是在运行 Windows 10 的标准 AMD Ryzen 9 5950X 机器上获得的。”
|
||||||
|
|
||||||
|
![基准测试结果][3]
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://www.opensourceforu.com/2022/05/deepminds-open-source-mujoco-is-available-on-github/
|
||||||
|
|
||||||
|
作者:[Laveesh Kocher][a]
|
||||||
|
选题:[lkxed][b]
|
||||||
|
译者:[lkxed](https://github.com/lkxed)
|
||||||
|
校对:[wxy](https://github.com/wxy)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]: https://www.opensourceforu.com/author/laveesh-kocher/
|
||||||
|
[b]: https://github.com/lkxed
|
||||||
|
[1]: https://www.opensourceforu.com/wp-content/uploads/2022/05/deepmind1.jpg
|
||||||
|
[2]: https://github.com/deepmind/mujoco
|
||||||
|
[3]: https://assets-global.website-files.com/621e749a546b7592125f38ed/628b971675cb60d74f5fa189_2A54E864-FE90-49E4-8E58-FE40298303E2.jpeg
|
@ -0,0 +1,81 @@
|
|||||||
|
[#]: subject: "AlmaLinux Continues the Legacy of CentOS with the Release of Version 9"
|
||||||
|
[#]: via: "https://news.itsfoss.com/almalinux-9-release/"
|
||||||
|
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
||||||
|
[#]: collector: "lkxed"
|
||||||
|
[#]: translator: "PeterPan0106"
|
||||||
|
[#]: reviewer: "wxy"
|
||||||
|
[#]: publisher: "wxy"
|
||||||
|
[#]: url: "https://linux.cn/article-14644-1.html"
|
||||||
|
|
||||||
|
CentOS 的继承者 AlmaLinux 9 发布
|
||||||
|
======
|
||||||
|
|
||||||
|
> AlmaLinux 9 是基于 Red Hat Enterprise Linux 9 的最新版本,添加了新的壁纸并进一步增强了性能。
|
||||||
|
|
||||||
|
![almalinux][1]
|
||||||
|
|
||||||
|
如果你一直在关注我们的话,应当知道 [AlmaLinux 9.0 测试版][2] 已于上月发布。
|
||||||
|
|
||||||
|
AlmaLinux 是目前 [最好的 RHEL 替代版][3] 之一。其最新的稳定版是基于 RHEL 9 的,这也成为了 CentOS 的一个很好的替代品。
|
||||||
|
|
||||||
|
最新的 AlmaLinux 9 支持所有主流架构,包括 Intel/AMD(x86_64)、ARM64 (aarch64)、IBM PowerPC(ppc64le)和 IBM Z(s390x)。
|
||||||
|
|
||||||
|
### AlmaLinux 9.0 有哪些改变呢
|
||||||
|
|
||||||
|
AlmaLinux 9.0 在这个版本中使用了 Linux 内核 5.14。它包括对云和容器开发的改进,以及对网络控制台的完善。
|
||||||
|
|
||||||
|
还包括其他变化带来的性能改进。更新包括:
|
||||||
|
|
||||||
|
#### 新壁纸
|
||||||
|
|
||||||
|
![AlmaLinux 9][4]
|
||||||
|
|
||||||
|
在 AlmaLinux 9.0 中,更新了一些新的壁纸。
|
||||||
|
|
||||||
|
这些新的壁纸看起来很美观,并提供了更丰富的选择。
|
||||||
|
|
||||||
|
#### Linux 内核 5.14
|
||||||
|
|
||||||
|
最大的变化是升级到了 Linux 内核 5.14,它带来了更新的硬件支持,以及其他各种改进。
|
||||||
|
|
||||||
|
Linux 内核 5.14 的改进详见 [这篇文章][5]。
|
||||||
|
|
||||||
|
#### 更新的软件包
|
||||||
|
|
||||||
|
这个版本带有新的软件包更新。其中包括 Git 2.31、PHP 8.0、Perl 5.32 和 MySQL 8.0。
|
||||||
|
|
||||||
|
GCC 也被更新到最新的 GCC 11。
|
||||||
|
|
||||||
|
其它更新包括 Python 3.9 和最新版的 LLVM、Rust 和 Go compilers,使应用程序的现代化更快、更容易。
|
||||||
|
|
||||||
|
更多技术方面的更新详见 [官方更新日志][6]。
|
||||||
|
|
||||||
|
### 下载 AlmaLinux 9.0
|
||||||
|
|
||||||
|
你可以在 [官方镜像网站][7] 下载最新的镜像。在镜像站也包含了 .torrent 文件的下载选项。
|
||||||
|
|
||||||
|
> **[AlmaLinux 9.0][8]**
|
||||||
|
|
||||||
|
*你认为基于 RHEL 的最新版 AlmaLinux 9.0 怎么样呢?你有计划在服务器上迁移到最新的版本吗?欢迎评论。*
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://news.itsfoss.com/almalinux-9-release/
|
||||||
|
|
||||||
|
作者:[Ankush Das][a]
|
||||||
|
选题:[lkxed][b]
|
||||||
|
译者:[PeterPan0106](https://github.com/PeterPan0106)
|
||||||
|
校对:[wxy](https://github.com/wxy)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]: https://news.itsfoss.com/author/ankush/
|
||||||
|
[b]: https://github.com/lkxed
|
||||||
|
[1]: https://news.itsfoss.com/wp-content/uploads/2022/05/alma-linux-9.jpg
|
||||||
|
[2]: https://linux.cn/article-14500-1.html
|
||||||
|
[3]: https://itsfoss.com/rhel-based-server-distributions/
|
||||||
|
[4]: https://news.itsfoss.com/wp-content/uploads/2022/05/alma-linux-wallpapers-9-1024x609.jpg
|
||||||
|
[5]: https://news.itsfoss.com/kernel-5-14-release/
|
||||||
|
[6]: https://wiki.almalinux.org/release-notes/9.0.html
|
||||||
|
[7]: https://mirrors.almalinux.org/isos.html
|
||||||
|
[8]: https://mirrors.almalinux.org/isos.html
|
@ -1,130 +0,0 @@
|
|||||||
[#]: subject: "Linux Kernel 5.18 Released with Graphics Driver Changes and New Hardware Support"
|
|
||||||
[#]: via: "https://news.itsfoss.com/linux-kernel-5-18-release/"
|
|
||||||
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
|
||||||
[#]: collector: "lkxed"
|
|
||||||
[#]: translator: "PeterPan0106"
|
|
||||||
[#]: reviewer: " "
|
|
||||||
[#]: publisher: " "
|
|
||||||
[#]: url: " "
|
|
||||||
|
|
||||||
Linux Kernel 5.18 Released with Graphics Driver Changes and New Hardware Support
|
|
||||||
======
|
|
||||||
The latest Linux Kernel 5.18 is now available as per the expected schedule without any delays. The release includes support for new hardware, and some core changes.
|
|
||||||
|
|
||||||
![Linux kernel 5.18 release][1]
|
|
||||||
|
|
||||||
[Linux Kernel 5.17][2] came loaded with support for next-gen hardware, including improvements for the Steam Deck.
|
|
||||||
|
|
||||||
Not to forget, every Linux Kernel release is technically exciting, and Linux Kernel 5.18 is no exception.
|
|
||||||
|
|
||||||
### Linux Kernel 5.18: What’s New?
|
|
||||||
|
|
||||||
This time around, we get to see improved support for Razer hardware, Apple Magic keyboard, AMD graphics, and numerous networking, core, and security changes.
|
|
||||||
|
|
||||||
#### A New Razer Driver
|
|
||||||
|
|
||||||
When it comes to gaming gears, the hardware support in Linux needs serious upgrades.
|
|
||||||
|
|
||||||
Yes, there are useful workarounds with open-source drivers. But, that’s not always the solution for every user.
|
|
||||||
|
|
||||||
As spotted by [Phoronix][3], a new Razer HID driver comes with Linux Kernel 5.18, which focuses on Razer BlackWidow keyboards fixing the macro key handling.
|
|
||||||
|
|
||||||
#### AMDGPU FreeSync Video Mode Enabled by Default
|
|
||||||
|
|
||||||
![][4]
|
|
||||||
|
|
||||||
While the support for FreeSync video was good enough, it was a temporary solution to improve the user experience with FreeSync monitors.
|
|
||||||
|
|
||||||
Now, with Linux Kernel 5.18, the FreeSync video mode is enabled by default ([changelog][5]). You do not have to do anything from your side to enable it with supported monitors.
|
|
||||||
|
|
||||||
#### Graphics Driver Updates
|
|
||||||
|
|
||||||
In addition to the improvements to the AMDGPU driver, you also get updates preparing for future hardware.
|
|
||||||
|
|
||||||
There have been changes to support higher DisplayPort rates as well.
|
|
||||||
|
|
||||||
#### Switch from C89 to C11 (GNU11)
|
|
||||||
|
|
||||||
![][6]
|
|
||||||
|
|
||||||
The C programming used for the Linux Kernel was limited to the old C89 standard, which lacked certain features for the current requirements.
|
|
||||||
|
|
||||||
So, C11 was decided to replace it considering the current compiler version requirement i.e. GCC 5.1 sounds perfectly fine with it.
|
|
||||||
|
|
||||||
#### Networking Tweaks
|
|
||||||
|
|
||||||
Linux Kernel 5.18 adds support for new wireless hardware, including MediaTek MT7916, MT7921U, and Broadcom BCM43454/6.
|
|
||||||
|
|
||||||
![][7]
|
|
||||||
|
|
||||||
When it comes to mobile solutions, support for Intel M.2 WWAN card has also been added.
|
|
||||||
|
|
||||||
The Realtek W89 driver now supports AP mode, 6 GHz band, and adds a hardware scan feature.
|
|
||||||
|
|
||||||
Several other improvements have been made to configure IPv6, and handle various protocols, including performance optimizations.
|
|
||||||
|
|
||||||
#### USB Improvements
|
|
||||||
|
|
||||||
Xen USB driver is being hardened against malicious hosts, and the USB DWC3 driver received improvements to support more hardware types.
|
|
||||||
|
|
||||||
You can find various other refinements in the [commit log][8].
|
|
||||||
|
|
||||||
#### Enhanced Apple Keyboard and Tablet Support
|
|
||||||
|
|
||||||
![][9]
|
|
||||||
|
|
||||||
Advancements were made to improve the experience with Apple Magic Keyboards, including the first-generation models.
|
|
||||||
|
|
||||||
Some of the fixes included correcting function-key mapping, keyboard backlight events, and the ability to report the battery level for the 2021 Magic Keyboard model when connected via USB.
|
|
||||||
|
|
||||||
Linux Kernel 5.18 improves input handling and makes things reliable when it comes to tablets.
|
|
||||||
|
|
||||||
You can find changes for new hardware, touchscreens, and other stuff in the related [commit][10].
|
|
||||||
|
|
||||||
#### New ARM Chip Support (Tesla FSD, Raspberry Pi Zero 2 W)
|
|
||||||
|
|
||||||
![][11]
|
|
||||||
|
|
||||||
Tesla’s full self-driving SoC is now supported with Linux Kernel 5.18. Samsung engineers made it possible to upstream into the Linux Kernel.
|
|
||||||
|
|
||||||
Other interesting chip additions include Qualcomm Snapdragon 625/632, and Samsung Exynos 850/7885.
|
|
||||||
|
|
||||||
You also find the support for Raspberry Pi Zero 2 W with Linux Kernel 5.18. In addition to the new entrants, old hardware/boards were removed as well. You can explore the [commit l][12]og to know more.
|
|
||||||
|
|
||||||
You can refer to the [official changelog][13] and Linus Torvald’s announcement to explore more details.
|
|
||||||
|
|
||||||
### How to Install Linux Kernel 5.18?
|
|
||||||
|
|
||||||
You should find the newer kernel listed on [Linux Kernel Archives][14]. So, you can download the [tarball][15] to test it out. Or, you can follow our [Linux Kernel upgrade guide][16] for help.
|
|
||||||
|
|
||||||
If you want to avoid compiling it yourself, you should wait for a few weeks for Linux distributions to push it to the repositories.
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: https://news.itsfoss.com/linux-kernel-5-18-release/
|
|
||||||
|
|
||||||
作者:[Ankush Das][a]
|
|
||||||
选题:[lkxed][b]
|
|
||||||
译者:[PeterPan0106](https://github.com/PeterPan0106)
|
|
||||||
校对:[校对者ID](https://github.com/校对者ID)
|
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
|
||||||
|
|
||||||
[a]: https://news.itsfoss.com/author/ankush/
|
|
||||||
[b]: https://github.com/lkxed
|
|
||||||
[1]: https://news.itsfoss.com/wp-content/uploads/2022/05/kernel-5-18-release.png
|
|
||||||
[2]: https://news.itsfoss.com/linux-kernel-5-17-release/
|
|
||||||
[3]: https://www.phoronix.com/scan.php?page=news_item&px=Linux-5.18-HID
|
|
||||||
[4]: https://news.itsfoss.com/wp-content/uploads/2022/05/amd-linux-5-18-1024x576.jpg
|
|
||||||
[5]: https://lists.freedesktop.org/archives/amd-gfx/2022-February/075262.html
|
|
||||||
[6]: https://news.itsfoss.com/wp-content/uploads/2022/05/c-linux-5-18-1024x576.jpg
|
|
||||||
[7]: https://news.itsfoss.com/wp-content/uploads/2022/05/networking-linux-5-18-1024x576.jpg
|
|
||||||
[8]: https://lore.kernel.org/lkml/Yj7vGtn8fILavjyL@kroah.com/
|
|
||||||
[9]: https://news.itsfoss.com/wp-content/uploads/2022/05/apple-linux-5-18-1024x576.jpg
|
|
||||||
[10]: https://lore.kernel.org/lkml/nycvar.YFH.7.76.2203231015060.24795@cbobk.fhfr.pm/
|
|
||||||
[11]: https://news.itsfoss.com/wp-content/uploads/2022/05/arm-linux-5-18-1024x576.jpg
|
|
||||||
[12]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=baaa68a9796ef2cadfe5caaf4c730412eda0f31c
|
|
||||||
[13]: https://lore.kernel.org/lkml/CAHk-=wjiqyoH6qntYvYTjR1F2L-pHtgX9esZMRS13iktCOJ1zA@mail.gmail.com/T/#u
|
|
||||||
[14]: https://www.kernel.org/
|
|
||||||
[15]: https://git.kernel.org/torvalds/t/linux-5.16.tar.gz
|
|
||||||
[16]: https://itsfoss.com/upgrade-linux-kernel-ubuntu/
|
|
@ -1,77 +0,0 @@
|
|||||||
[#]: subject: "System76 Collaborates with HP for a Powerful Linux Laptop for Developers"
|
|
||||||
[#]: via: "https://news.itsfoss.com/hp-dev-one-system76/"
|
|
||||||
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
|
||||||
[#]: collector: "lkxed"
|
|
||||||
[#]: translator: " "
|
|
||||||
[#]: reviewer: " "
|
|
||||||
[#]: publisher: " "
|
|
||||||
[#]: url: " "
|
|
||||||
|
|
||||||
System76 Collaborates with HP for a Powerful Linux Laptop for Developers
|
|
||||||
======
|
|
||||||
HP is entering the Linux hardware market featuring Pop!_OS out-of-the-box, making things exciting. Let’s take a look.
|
|
||||||
|
|
||||||
![hp][1]
|
|
||||||
|
|
||||||
System76 already makes Linux laptops. So, what is this all about?
|
|
||||||
|
|
||||||
Well, this time, it will be a Linux laptop by HP, powered by Pop!_OS, i.e., the Ubuntu-based Linux distribution by System76.
|
|
||||||
|
|
||||||
*Carl Richell* (System76’s Founder) made the announcement through his Twitter handle, with a link to the website that provides additional information on this.
|
|
||||||
|
|
||||||
> Hp-Pop Hooray! Check out [https://t.co/gf2brjjUl8][2]
|
|
||||||
|
|
||||||
[May 20, 2022][3]
|
|
||||||
|
|
||||||
### HP Dev One: A Linux Laptop Built for Developers
|
|
||||||
|
|
||||||
System76 laptops are highly praised for their out-of-the-box hardware compatibility with Pop!_OS. A
|
|
||||||
|
|
||||||
More of the reason Pop!_OS sits nicely with laptops without many hiccups.
|
|
||||||
|
|
||||||
Pop!_OS constantly comes up with updates and feature additions to improve the workflow and make the best out of the available hardware for Linux.
|
|
||||||
|
|
||||||
Now, teaming up with HP sounds like a great idea to step up the notch.
|
|
||||||
|
|
||||||
![HP System76][4]
|
|
||||||
|
|
||||||
So, the idea of a partnership between Pop!_OS and HP is exciting!
|
|
||||||
|
|
||||||
With HP, the availability/warranty of the laptop sounds good on paper compared to System76 laptops in the region where it is not available.
|
|
||||||
|
|
||||||
### AMD-Powered Laptop to Help You Code Better
|
|
||||||
|
|
||||||
HP Dev One seems to start featuring the essentials for developers to multitask, and get things done quickly.
|
|
||||||
|
|
||||||
The laptop uses an **8-core AMD Ryzen 7 PRO processor** coupled with **16 GB RAM** (DDR4 @ 3200 MHz) for starters.
|
|
||||||
|
|
||||||
You can expect a 14-inch full-HD anti-glare display powered by AMD’s Radeon Graphics.
|
|
||||||
|
|
||||||
With HP Dev One, Carl Richell mentions that the laptop will receive **firmware updates** via the [LVFS][5] (Linux Vendor Firmware Service).
|
|
||||||
|
|
||||||
The pricing for the laptop has been mentioned to start at **$1099** for the mentioned specifications.
|
|
||||||
|
|
||||||
The website only says that it is coming soon. So, we do not have an official launch date as of now.
|
|
||||||
|
|
||||||
For a commercial manufacturer like HP, the pricing for the laptop does not sound mind-blowing, but could be a fair deal.
|
|
||||||
|
|
||||||
*What do you think about the pricing for the HP laptop tailored for developers using Linux? Does the price tag sound good? What are your expectations from the laptop?*
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: https://news.itsfoss.com/hp-dev-one-system76/
|
|
||||||
|
|
||||||
作者:[Ankush Das][a]
|
|
||||||
选题:[lkxed][b]
|
|
||||||
译者:[译者ID](https://github.com/译者ID)
|
|
||||||
校对:[校对者ID](https://github.com/校对者ID)
|
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
|
||||||
|
|
||||||
[a]: https://news.itsfoss.com/author/ankush/
|
|
||||||
[b]: https://github.com/lkxed
|
|
||||||
[1]: https://news.itsfoss.com/wp-content/uploads/2022/05/hpdevone-laptop.jpg
|
|
||||||
[2]: https://t.co/gf2brjjUl8
|
|
||||||
[3]: https://twitter.com/carlrichell/status/1527757934364479488?ref_src=twsrc%5Etfw
|
|
||||||
[4]: https://news.itsfoss.com/wp-content/uploads/2022/05/hpdevone-illustration-1024x576.jpg
|
|
||||||
[5]: https://fwupd.org/
|
|
@ -1,60 +0,0 @@
|
|||||||
[#]: subject: "Woah! Broadcom Could Acquire VMware for $60 Billion"
|
|
||||||
[#]: via: "https://news.itsfoss.com/broadcom-vmware-deal/"
|
|
||||||
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
|
||||||
[#]: collector: "lkxed"
|
|
||||||
[#]: translator: " "
|
|
||||||
[#]: reviewer: " "
|
|
||||||
[#]: publisher: " "
|
|
||||||
[#]: url: " "
|
|
||||||
|
|
||||||
Woah! Broadcom Could Acquire VMware for $60 Billion
|
|
||||||
======
|
|
||||||
Broadcom’s interested to acquire VMware for $60 billion, making it one of the biggest tech deals in 2022.
|
|
||||||
|
|
||||||
![broadcom][1]
|
|
||||||
|
|
||||||
Broadcom, a semiconductor chip company, is infamous among desktop Linux users for the incompatibility issues with its wireless adapter/card and drivers.
|
|
||||||
|
|
||||||
And, it is now planning to get into the cloud computing market by acquiring one of the biggest players in the industry, i.e., **VMware**.
|
|
||||||
|
|
||||||
VMware is not an open-source company, but it offers some open-source tools and Linux support for its virtualization software.
|
|
||||||
|
|
||||||
In this case, **The Wall Street Journal** [reports][2] that Broadcom and VMware can potentially announce this acquisition later this week on Thursday.
|
|
||||||
|
|
||||||
### Broadcom to Enter the Cloud Computing Market
|
|
||||||
|
|
||||||
[Broadcom][3] should be a familiar name to Linux users when we talk about wireless network chips and their drivers.
|
|
||||||
|
|
||||||
And, with the $60 billion deal for [VMware][4], they could expand their take on the industry through VMware’s reach in the cloud computing sector.
|
|
||||||
|
|
||||||
So, their decision also influences the talk about the acquisition by Broadcom.
|
|
||||||
|
|
||||||
Hence, it is safe to say that the deal may or may not go through if the discussions fall apart.
|
|
||||||
|
|
||||||
And, for the payment to succeed, the report also mentions that Broadcom plans to take help of banks for a $40 billion debt package.
|
|
||||||
|
|
||||||
Considering that the report mentions the final price is still up for discussion, the $60 billion value can change (but something around it).
|
|
||||||
|
|
||||||
### Wrapping Up
|
|
||||||
|
|
||||||
You can keep an eye on VMware’s shares and Broadcom Inc if you are someone who is interested in getting involved in the market.
|
|
||||||
|
|
||||||
What do you think about Broadcom acquiring VMware? Do you think it’s going to go through with Dell involved with a major stake in the company? Feel free to share your thoughts in the comments below.
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: https://news.itsfoss.com/broadcom-vmware-deal/
|
|
||||||
|
|
||||||
作者:[Ankush Das][a]
|
|
||||||
选题:[lkxed][b]
|
|
||||||
译者:[译者ID](https://github.com/译者ID)
|
|
||||||
校对:[校对者ID](https://github.com/校对者ID)
|
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
|
||||||
|
|
||||||
[a]: https://news.itsfoss.com/author/ankush/
|
|
||||||
[b]: https://github.com/lkxed
|
|
||||||
[1]: https://news.itsfoss.com/wp-content/uploads/2022/05/broadcom-vmware-acquisition.jpg
|
|
||||||
[2]: https://www.wsj.com/articles/broadcom-discussing-paying-around-140-a-share-for-vmware-people-say-11653334946
|
|
||||||
[3]: https://www.broadcom.com/
|
|
||||||
[4]: https://www.vmware.com/i
|
|
@ -1,42 +0,0 @@
|
|||||||
[#]: subject: "Open Source Initiative Releases News Blog On WordPress"
|
|
||||||
[#]: via: "https://www.opensourceforu.com/2022/05/open-source-initiative-releases-news-blog-on-wordpress/"
|
|
||||||
[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/"
|
|
||||||
[#]: collector: "lkxed"
|
|
||||||
[#]: translator: " "
|
|
||||||
[#]: reviewer: " "
|
|
||||||
[#]: publisher: " "
|
|
||||||
[#]: url: " "
|
|
||||||
|
|
||||||
Open Source Initiative Releases News Blog On WordPress
|
|
||||||
======
|
|
||||||
![osi][1]
|
|
||||||
|
|
||||||
The Open Source Initiative (OSI), a public benefit corporation that oversees the Open Source Definition, has launched a WordPress news [blog][2]. Stefano Maffulli was appointed as OSI’s first Executive Director in 2021, and he is leading the organisation in overhauling its web presence.
|
|
||||||
|
|
||||||
The blog was launched on a subdomain of the opensource.org website, which runs Drupal 7 and is self-hosted on a Digital Ocean droplet. It is also tightly integrated with CiviCRM to manage member subscriptions, individual donations, sponsorship tracking, and newsletter distribution.
|
|
||||||
|
|
||||||
As Drupal 7 approaches its end of life in November 2022, the team intends to migrate everything to WordPress. They looked into managed Drupal hosting but discovered it was more expensive and required them to migrate to a more recent version of Drupal. Because D7 themes and plugins are incompatible with D9+, they saw no advantage in terms of time or simplicity.
|
|
||||||
|
|
||||||
Because the Tavern’s theme wasn’t yet on GitHub, Maffulli hired a developer to create a simple child theme based on the Twenty Twenty-Two default theme using WordPress’ new full-site editing features. He expressed gratitude for the opportunity to learn the fundamentals of FSE while overseeing the project.
|
|
||||||
|
|
||||||
Some OSI employees were already familiar with WordPress, which influenced their decision to use the software. The extensive functionality and third-party integrations were also important considerations. OSI is also looking into ways to give its members the ability to comment. This would necessitate a method to integrate authentication with CiviCRM in order to access members’ records.
|
|
||||||
|
|
||||||
The new Voices of Open Source blog began by highlighting the OSI affiliate network, which includes 80 organisations such as Mozilla, Wikimedia, the Linux Foundation, OpenUK, and others.
|
|
||||||
|
|
||||||
“One of the main objectives for OSI in 2022 is to reinforce our communication channels,” Maffulli said. “We’re improving the perception of OSI as a reliable, trustworthy organization. The OSI didn’t have a regular publishing schedule before, nor a content plan. Now we have established a regular cadence, publishing at least once a week (often more), commenting on recent news like a winning against a patent troll or court decisions about open source licenses, featuring our sponsors, and offering opinions on topics of interest for the wider community. It’s a starting point to affirm OSI as a convener of conversations among various souls of the open source communities.”
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: https://www.opensourceforu.com/2022/05/open-source-initiative-releases-news-blog-on-wordpress/
|
|
||||||
|
|
||||||
作者:[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/05/osi-e1653464907238.jpg
|
|
||||||
[2]: https://blog.opensource.org/
|
|
@ -1,91 +0,0 @@
|
|||||||
[#]: subject: "ProtonMail is Now Just ‘Proton’ Offering a Privacy Ecosystem"
|
|
||||||
[#]: via: "https://news.itsfoss.com/protonmail-now-proton/"
|
|
||||||
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
|
||||||
[#]: collector: "lkxed"
|
|
||||||
[#]: translator: " "
|
|
||||||
[#]: reviewer: " "
|
|
||||||
[#]: publisher: " "
|
|
||||||
[#]: url: " "
|
|
||||||
|
|
||||||
ProtonMail is Now Just ‘Proton’ Offering a Privacy Ecosystem
|
|
||||||
======
|
|
||||||
ProtonMail announced a re-brand with a new website, new name, updated pricing plans, a refreshed UI, and more changes.
|
|
||||||
|
|
||||||
![proton][1]
|
|
||||||
|
|
||||||
[ProtonMail][2] is rebranding itself as “Proton” to unify all its offerings under a single umbrella.
|
|
||||||
|
|
||||||
Let us not confuse it with Steam’s Proton (which is also simply referred to as Proton), *right?*
|
|
||||||
|
|
||||||
In other words, there will no longer be a separate product page for ProtonMail, ProtonVPN, or any of its services.
|
|
||||||
|
|
||||||
### Proton: An Open-Source Privacy Ecosystem
|
|
||||||
|
|
||||||
![Updated Proton, unified protection][3]
|
|
||||||
|
|
||||||
Proton will have a new single platform (new website) where you can access all the services including:
|
|
||||||
|
|
||||||
* Proton Mail
|
|
||||||
* Proton VPN
|
|
||||||
* Proton Drive
|
|
||||||
* Proton Calendar
|
|
||||||
|
|
||||||
For new log-in sessions, you will be redirected to **proton.me** instead of **protonmail.com/mail.protonmail.com/protonvpn.com** and so on.
|
|
||||||
|
|
||||||
Not just limited to the name/brand, the overall brand accent color, and the approach to its existing user experience will also be impacted by this change.
|
|
||||||
|
|
||||||
![][4]
|
|
||||||
|
|
||||||
Instead of choosing separate upgrades for VPN and Mail, the entire range of services will now be available with a single paid subscription. This also means that the pricing for the premium upgrades is more affordable with the change.
|
|
||||||
|
|
||||||
![][5]
|
|
||||||
|
|
||||||
Overall, the change to make “Proton” a privacy ecosystem aims to appeal to more users who aren’t interested to learn the tech jargon to know how it all works.
|
|
||||||
|
|
||||||
You can take a look at all the details on its new official website ([proton.me][6])
|
|
||||||
|
|
||||||
The new website looks much cleaner, organized, and a bit more commercially attractive.
|
|
||||||
|
|
||||||
### What’s New?
|
|
||||||
|
|
||||||
You can expect a refreshed user interface with the re-branding and a new website.
|
|
||||||
|
|
||||||
![proton][7]
|
|
||||||
|
|
||||||
In addition to that, Proton also mentions that it has improved the integration between the services for a better user experience.
|
|
||||||
|
|
||||||
![][8]
|
|
||||||
|
|
||||||
If you have already been using ProtonMail, you probably know that they offered existing users to activate their “**@proton.me**” account, which is also a part of this change.
|
|
||||||
|
|
||||||
You can choose to make your new email address **xyz@proton.me** the default, which is shorter and makes more sense with the new name.
|
|
||||||
|
|
||||||
* The old email address isn’t going away. But, a new address is available @proton.me
|
|
||||||
* Existing paid subscribers should receive a storage boost at no extra cost.
|
|
||||||
* Refreshed user experience across web applications and mobile applications.
|
|
||||||
* A new website (you will be automatically redirected to it for new sessions).
|
|
||||||
* New pricing plans with more storage for Proton Drive.
|
|
||||||
|
|
||||||
*Excited about the change? Do you like the new name and its approach to it? Feel free to drop your thoughts in the comments section below.*
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: https://news.itsfoss.com/protonmail-now-proton/
|
|
||||||
|
|
||||||
作者:[Ankush Das][a]
|
|
||||||
选题:[lkxed][b]
|
|
||||||
译者:[译者ID](https://github.com/译者ID)
|
|
||||||
校对:[校对者ID](https://github.com/校对者ID)
|
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
|
||||||
|
|
||||||
[a]: https://news.itsfoss.com/author/ankush/
|
|
||||||
[b]: https://github.com/lkxed
|
|
||||||
[1]: https://news.itsfoss.com/wp-content/uploads/2022/05/proton-ft.jpg
|
|
||||||
[2]: https://itsfoss.com/recommends/protonmai
|
|
||||||
[3]: https://youtu.be/s5GNTQ63HJE
|
|
||||||
[4]: https://news.itsfoss.com/wp-content/uploads/2022/05/proton-ui-new-1024x447.jpg
|
|
||||||
[5]: https://news.itsfoss.com/wp-content/uploads/2022/05/proton-pricing-1024x494.jpg
|
|
||||||
[6]: https://proton.me/
|
|
||||||
[7]: https://news.itsfoss.com/wp-content/uploads/2022/05/Proton-me-website.png
|
|
||||||
[8]: https://news.itsfoss.com/wp-content/uploads/2022/05/Proton-Product.png
|
|
@ -1,45 +0,0 @@
|
|||||||
[#]: subject: "DeepMind’s Open Source MuJoCo Is Available On GitHub"
|
|
||||||
[#]: via: "https://www.opensourceforu.com/2022/05/deepminds-open-source-mujoco-is-available-on-github/"
|
|
||||||
[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/"
|
|
||||||
[#]: collector: "lkxed"
|
|
||||||
[#]: translator: " "
|
|
||||||
[#]: reviewer: " "
|
|
||||||
[#]: publisher: " "
|
|
||||||
[#]: url: " "
|
|
||||||
|
|
||||||
DeepMind’s Open Source MuJoCo Is Available On GitHub
|
|
||||||
======
|
|
||||||
![deepmind1][1]
|
|
||||||
|
|
||||||
DeepMind, an Alphabet subsidiary and AI research lab, acquired the MuJoCo physics engine for robotics research and development in October 2021. The simulator was to be open-sourced and maintained as a free, open source, community-driven project. DeepMind claims that the open sourcing is now complete, with the entire codebase [available on GitHub][2].
|
|
||||||
|
|
||||||
MuJoCo, which stands for Multi-Joint Dynamics with Contact, is a physics engine designed to aid research and development in robotics, biomechanics, graphics and animation, and other fields that require fast and accurate simulation. MuJoCo can be used to implement model-based computations for machine learning applications such as control synthesis, state estimation, system identification, mechanism design, data analysis through inverse dynamics, and parallel sampling. It can also be used as a standard simulator, such as for gaming and interactive virtual environments.
|
|
||||||
|
|
||||||
According to DeepMind, the following are some of the features that make MuJoCo appealing for collaboration:
|
|
||||||
|
|
||||||
* Comprehensive simulator capable of simulating complex mechanisms
|
|
||||||
* Readable, performant, portable code
|
|
||||||
* Codebase that is easily extensible
|
|
||||||
* Extensive documentation, including both user-facing and code comments – We hope that colleagues from academia and the OSS community will use this platform and contribute to the codebase, thereby improving research for all.
|
|
||||||
|
|
||||||
DeepMind has more to say:
|
|
||||||
|
|
||||||
“As a C library with no dynamic memory allocation, MuJoCo is very fast. Unfortunately, raw physics speed has historically been hindered by Python wrappers, which made batched, multi-threaded operations non-performant due to the presence of the Global Interpreter Lock (GIL) and non-compiled code. In our roadmap below, we address this issue going forward.
|
|
||||||
|
|
||||||
“For now, we’d like to share some benchmarking results for two common models. The results were obtained on a standard AMD Ryzen 9 5950X machine, running Windows 10.”
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: https://www.opensourceforu.com/2022/05/deepminds-open-source-mujoco-is-available-on-github/
|
|
||||||
|
|
||||||
作者:[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/05/deepmind1.jpg
|
|
||||||
[2]: https://github.com/deepmind/mujoco
|
|
@ -0,0 +1,65 @@
|
|||||||
|
[#]: subject: "Tails Linux Users Warned Against Using the Tor Browser: Here’s why!"
|
||||||
|
[#]: via: "https://news.itsfoss.com/tails-tor-browser/"
|
||||||
|
[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/"
|
||||||
|
[#]: collector: "lkxed"
|
||||||
|
[#]: translator: " "
|
||||||
|
[#]: reviewer: " "
|
||||||
|
[#]: publisher: " "
|
||||||
|
[#]: url: " "
|
||||||
|
|
||||||
|
Tails Linux Users Warned Against Using the Tor Browser: Here’s why!
|
||||||
|
======
|
||||||
|
A crucial fix for a dangerous vulnerability that bypasses security in Tor browser is due to arrive in Tails 5.1. Here’s what it is all about.
|
||||||
|
|
||||||
|
![tails][1]
|
||||||
|
|
||||||
|
The developers of the security-focused portable Linux distro, **Tails**, have recently released an important advisory regarding its current release. They have warned users to avoid entering or using any personal or sensitive information while using Tor Browser on **Tails 5.0 or older**.
|
||||||
|
|
||||||
|
Tor Browser is the de-facto web browser used in Tails and helps protect the user’s identity online when connected to the Internet. It is mainly used by various journalists and activists to evade censorship. Everyday users can use it too.
|
||||||
|
|
||||||
|
### What’s the problem?
|
||||||
|
|
||||||
|
Recently, two nasty vulnerabilities have been found that enable harmful websites to steal the user’s information from other websites.
|
||||||
|
|
||||||
|
To be specific, the vulnerabilities have been identified as CVE-2022-1802 and CVE-2022-1529 in an [advisory published by Mozilla.][2]
|
||||||
|
|
||||||
|
The Tails advisory best explains this:
|
||||||
|
|
||||||
|
> “For example, after you visit a malicious website, an attacker controlling this website might access the password or other sensitive information that you send to other websites afterwards during the same Tails session.”
|
||||||
|
|
||||||
|
### Should You Stop Using Tails Linux Distro?
|
||||||
|
|
||||||
|
Not necessarily.
|
||||||
|
|
||||||
|
Other apps in Tails, especially Thunderbird, are safe to use since the JavaScript is disabled if in use.
|
||||||
|
|
||||||
|
Furthermore, you can even enable the safest security level in the Tor browser. This is preferred because the JavaScript engine gets disabled. Do note that this will make websites function improperly.
|
||||||
|
|
||||||
|
In other words, the Tails Linux distro is still safe to use if you know what you’re doing.
|
||||||
|
|
||||||
|
### A Fix is Coming Soon
|
||||||
|
|
||||||
|
Good news! Mozilla has already patched these bugs upstream and now it’s up to the Tails team when it comes to releasing the fix.
|
||||||
|
|
||||||
|
Here’s what they have stated –
|
||||||
|
|
||||||
|
> This vulnerability will be fixed in Tails 5.1 (**May 31**), but our team doesn’t have the capacity to publish an emergency release earlier.
|
||||||
|
|
||||||
|
So, your best option is to wait for the Tails 5.1 release next week. You can read the [official advisory][3] released by Tails devs to know more.
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://news.itsfoss.com/tails-tor-browser/
|
||||||
|
|
||||||
|
作者:[Rishabh Moharir][a]
|
||||||
|
选题:[lkxed][b]
|
||||||
|
译者:[译者ID](https://github.com/译者ID)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]: https://news.itsfoss.com/author/rishabh/
|
||||||
|
[b]: https://github.com/lkxed
|
||||||
|
[1]: https://news.itsfoss.com/wp-content/uploads/2022/05/tails-5-0-privacy-issue.jpg
|
||||||
|
[2]: https://www.mozilla.org/en-US/security/advisories/mfsa2022-19/
|
||||||
|
[3]: https://tails.boum.org/security/prototype_pollution/index.en.html
|
@ -0,0 +1,79 @@
|
|||||||
|
[#]: subject: "TypeScript Based Headless CMS ‘Payload’ Becomes Open Source"
|
||||||
|
[#]: via: "https://news.itsfoss.com/payload-open-source/"
|
||||||
|
[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/"
|
||||||
|
[#]: collector: "lkxed"
|
||||||
|
[#]: translator: " "
|
||||||
|
[#]: reviewer: " "
|
||||||
|
[#]: publisher: " "
|
||||||
|
[#]: url: " "
|
||||||
|
|
||||||
|
TypeScript Based Headless CMS ‘Payload’ Becomes Open Source
|
||||||
|
======
|
||||||
|
A new option added to the list of open-source headless CMS. Now, a better headless WordPress alternative?
|
||||||
|
|
||||||
|
![payload][1]
|
||||||
|
|
||||||
|
Since its first beta release a little over a year ago, Payload has slowly built a name for itself within the web development community as a headless Content Management System (CMS). For a bit of background information, Payload is a CMS tailored specifically toward being simpler to develop websites, web apps, or native applications.
|
||||||
|
|
||||||
|
Recently, they decided to go completely open-source, putting it among the likes of some of the [best open-source CMS available][2].
|
||||||
|
|
||||||
|
However, that raises some questions, like what will their business model look like? And what are the plans for Payload CMS? Let’s take a brief look.
|
||||||
|
|
||||||
|
### Why Has Payload Gone Open-Source?
|
||||||
|
|
||||||
|
Since its initial launch back in 2021, Payload has received many contributions from the open-source community. As Payload said in their [recent announcement][3], the decision to go open-source is massive, and it allows projects to read much greater heights than could ever be possible if kept behind closed doors.
|
||||||
|
|
||||||
|
![][4]
|
||||||
|
|
||||||
|
In addition, this openness often results in much greater levels of trust from the developer community. This trust also extends to businesses, naturally turning to the platform with the greatest developer support and trust.
|
||||||
|
|
||||||
|
Due to all these reasons, Payload is now switching to the MIT license. This allows anyone to modify, distribute, and use Payload for free and without limitations.
|
||||||
|
|
||||||
|
However, Payload still needs money flowing in to operate sustainably. So, that begs the question, how will Payload make money?
|
||||||
|
|
||||||
|
### How Payload Is Going To Make Money?
|
||||||
|
|
||||||
|
As is always the case, Payload requires some financial backing to remain afloat. They have outlined a two-part plan that should both provide users with even more convenience-focused features while still leaving self-hosted customers incredible flexibility.
|
||||||
|
|
||||||
|
![][5]
|
||||||
|
|
||||||
|
#### Enterprise Licenses
|
||||||
|
|
||||||
|
This option is extremely similar to other open-source CMS software services. These licenses would provide more advanced SSO options and give the developers guaranteed response times from the core Payload team.
|
||||||
|
|
||||||
|
These licenses should look appealing to larger corporations, especially those that require the utmost reliability.
|
||||||
|
|
||||||
|
#### Cloud Hosting
|
||||||
|
|
||||||
|
This option is quite attractive, as it combines multiple services to create the most convenient experience possible. Although traditional hosting remains reasonably easy, as soon as you add in a database, permanent file storage, and deliberate infrastructure for Node apps, you are left with four or five different services that all need to work seamlessly together.
|
||||||
|
|
||||||
|
It should be noted that this is not required, and users are still encouraged to host their instances. However, this service simply takes a lot of the expenses and challenges associated with hosting out of the equation.
|
||||||
|
|
||||||
|
As of now, things haven’t been finalized. But, you can keep an eye on the discussions on [GitHub][6] to keep up with it.
|
||||||
|
|
||||||
|
### Wrapping Up
|
||||||
|
|
||||||
|
As an emerging CMS option, it is great to see Payload take this step to become a popular alternative to WordPress and other options. Additionally, it appears to me that the Payload team is confident in their new business model, signifying a (hopefully) bright future for them.
|
||||||
|
|
||||||
|
[Payload CMS][7]
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://news.itsfoss.com/payload-open-source/
|
||||||
|
|
||||||
|
作者:[Jacob Crume][a]
|
||||||
|
选题:[lkxed][b]
|
||||||
|
译者:[译者ID](https://github.com/译者ID)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]: https://news.itsfoss.com/author/jacob/
|
||||||
|
[b]: https://github.com/lkxed
|
||||||
|
[1]: https://news.itsfoss.com/wp-content/uploads/2022/05/payload-opensource.jpg
|
||||||
|
[2]: https://itsfoss.com/open-source-cms/
|
||||||
|
[3]: https://payloadcms.com/blog/open-source
|
||||||
|
[4]: https://news.itsfoss.com/wp-content/uploads/2022/05/payloadcms-demo.png
|
||||||
|
[5]: https://news.itsfoss.com/wp-content/uploads/2022/05/payload-free-opensource-1024x576.jpg
|
||||||
|
[6]: https://github.com/payloadcms/payload
|
||||||
|
[7]: https://payloadcms.com/
|
@ -1,207 +0,0 @@
|
|||||||
[#]: subject: "An introduction to Go arrays and slices"
|
|
||||||
[#]: via: "https://opensource.com/article/18/7/introduction-go-arrays-and-slices"
|
|
||||||
[#]: author: "Mihalis Tsoukalos https://opensource.com/users/mtsouk"
|
|
||||||
[#]: collector: "lkxed"
|
|
||||||
[#]: translator: "lkxed"
|
|
||||||
[#]: reviewer: " "
|
|
||||||
[#]: publisher: " "
|
|
||||||
[#]: url: " "
|
|
||||||
|
|
||||||
An introduction to Go arrays and slices
|
|
||||||
======
|
|
||||||
Learn the pros and cons of storing data in Go using arrays and slices and why one is usually better than the other.
|
|
||||||
|
|
||||||
![Testing certificate chains with a 34-line Go program][1]
|
|
||||||
|
|
||||||
Image by: carrotmadman6. Modified by Opensource.com. CC BY-SA 2.0
|
|
||||||
|
|
||||||
In this fourth article in the series, I will explain [Go][5] arrays and slices, how to use them, and why you'll usually want to choose one over the other.
|
|
||||||
|
|
||||||
### Arrays
|
|
||||||
|
|
||||||
Arrays are one of the most popular data structures among programming languages for two main reasons: They are simple and easy to understand, and they can store many different kinds of data.
|
|
||||||
|
|
||||||
You can declare a Go array named `anArray` that stores four integers with the following:
|
|
||||||
|
|
||||||
```
|
|
||||||
anArray := [4]int{-1, 2, 0, -4}
|
|
||||||
```
|
|
||||||
|
|
||||||
The array's size should be stated before its type, which should be defined before its elements. The `len()` function can help you find the length of any array. The size of the array above is 4.
|
|
||||||
|
|
||||||
If you are familiar with other programming languages, you might try to access all the elements of an array using a `for` loop. However, as you will see below, Go's `range` keyword allows you to access all the elements of an array or a slice in a more elegant way.
|
|
||||||
|
|
||||||
Last, here is how you can define an array with two dimensions:
|
|
||||||
|
|
||||||
```
|
|
||||||
twoD := [3][3]int{
|
|
||||||
{1, 2, 3},
|
|
||||||
{6, 7, 8},
|
|
||||||
{10, 11, 12}}
|
|
||||||
```
|
|
||||||
|
|
||||||
The `arrays.go` source file explains the use of Go arrays. The most important code in `arrays.go` is:
|
|
||||||
|
|
||||||
```
|
|
||||||
for i := 0; i < len(twoD); i++ {
|
|
||||||
k := twoD[i]
|
|
||||||
for j := 0; j < len(k); j++ {
|
|
||||||
fmt.Print(k[j], " ")
|
|
||||||
}
|
|
||||||
fmt.Println()
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, a := range twoD {
|
|
||||||
for _, j := range a {
|
|
||||||
fmt.Print(j, " ")
|
|
||||||
}
|
|
||||||
fmt.Println()
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
This shows how you can iterate over the elements of an array using a `for` loop and the `range` keyword. The rest of the code of `arrays.go` shows how to pass an array into a function as a parameter.
|
|
||||||
|
|
||||||
Following is the output of `arrays.go` :
|
|
||||||
|
|
||||||
```
|
|
||||||
$ go run arrays.go
|
|
||||||
Before change(): [-1 2 0 -4]
|
|
||||||
After change(): [-1 2 0 -4]
|
|
||||||
1 2 3
|
|
||||||
6 7 8
|
|
||||||
10 11 12
|
|
||||||
1 2 3
|
|
||||||
6 7 8
|
|
||||||
10 11 12
|
|
||||||
```
|
|
||||||
|
|
||||||
This output demonstrates that the changes you make to an array inside a function are lost after the function exits.
|
|
||||||
|
|
||||||
### Disadvantages of arrays
|
|
||||||
|
|
||||||
Go arrays have many disadvantages that will make you reconsider using them in your Go projects. First, you can't change the size of an array after you define it, which means Go arrays are not dynamic. Putting it simply, if you need to add an element to an array that doesn't have any space left, you will need to create a bigger array and copy all the elements of the old array to the new one. Second, when you pass an array to a function as a parameter, you actually pass a copy of the array, which means any changes you make to an array inside a function will be lost after the function exits. Last, passing a large array to a function can be pretty slow, mostly because Go has to create a copy of the array.
|
|
||||||
|
|
||||||
The solution to all these problems is to use Go slices.
|
|
||||||
|
|
||||||
### Slices
|
|
||||||
|
|
||||||
A Go slice is similar to a Go array without the shortcomings. First, you can add an element to an existing slice using the `append()` function. Moreover, Go slices are implemented internally using arrays, which means Go uses an underlying array for each slice.
|
|
||||||
|
|
||||||
Slices have a *capacity* property and a *length* property, which are not always the same. The length of a slice is the same as the length of an array with the same number of elements, and it can be found using the `len()` function. The capacity of a slice is the room that has currently been allocated for the slice, and it can be found with the `cap()` function.
|
|
||||||
|
|
||||||
As slices are dynamic in size, if a slice runs out of room (which means the current length of the array is the same as its capacity while you are trying to add another element to the array), Go automatically doubles its current capacity to make room for more elements and adds the requested element to the array.
|
|
||||||
|
|
||||||
Additionally, slices are passed by reference to functions, which means what is actually passed to a function is the memory address of the slice variable, and any modifications you make to a slice inside a function won't get lost after the function exits. As a result, passing a big slice to a function is significantly faster than passing an array with the same number of elements to the same function. This is because Go will not have to make a copy of the slice—it will just pass the memory address of the slice variable.
|
|
||||||
|
|
||||||
Go slices are illustrated in `slice.go`, which contains the following code:
|
|
||||||
|
|
||||||
```
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
)
|
|
||||||
|
|
||||||
func negative(x []int) {
|
|
||||||
for i, k := range x {
|
|
||||||
x[i] = -k
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func printSlice(x []int) {
|
|
||||||
for _, number := range x {
|
|
||||||
fmt.Printf("%d ", number)
|
|
||||||
}
|
|
||||||
fmt.Println()
|
|
||||||
}
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
s := []int{0, 14, 5, 0, 7, 19}
|
|
||||||
printSlice(s)
|
|
||||||
negative(s)
|
|
||||||
printSlice(s)
|
|
||||||
|
|
||||||
fmt.Printf("Before. Cap: %d, length: %d\n", cap(s), len(s))
|
|
||||||
s = append(s, -100)
|
|
||||||
fmt.Printf("After. Cap: %d, length: %d\n", cap(s), len(s))
|
|
||||||
printSlice(s)
|
|
||||||
|
|
||||||
anotherSlice := make([]int, 4)
|
|
||||||
fmt.Printf("A new slice with 4 elements: ")
|
|
||||||
printSlice(anotherSlice)
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
The biggest difference between a slice definition and an array definition is that you do not need to specify the size of the slice, which is determined by the number of elements you want to put in it. Additionally, the `append()` function allows you to add an element to an existing slice—notice that even if the capacity of a slice allows you to add an element to that slice, its length will not be modified unless you call `append()`. The `printSlice()` function is a helper function used for printing the elements of its slice parameter, whereas the `negative()` function processes all the elements of its slice parameter.
|
|
||||||
|
|
||||||
The output of `slice.go` is:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ go run slice.go
|
|
||||||
0 14 5 0 7 19
|
|
||||||
0 -14 -5 0 -7 -19
|
|
||||||
Before. Cap: 6, length: 6
|
|
||||||
After. Cap: 12, length: 7
|
|
||||||
0 -14 -5 0 -7 -19 -100
|
|
||||||
A new slice with 4 elements: 0 0 0 0
|
|
||||||
```
|
|
||||||
|
|
||||||
Please note that when you create a new slice and allocate memory space for a given number of elements, Go will automatically initialize all the elements to the zero value of its type, which in this case is 0.
|
|
||||||
|
|
||||||
### Referencing arrays with slices
|
|
||||||
|
|
||||||
Go allows you to reference an existing array with a slice using the `[:]` notation. In that case, any changes you make into a slice's function will be propagated to the array—this is illustrated in `refArray.go`. Please remember that the `[:]` notation does not create a copy of the array, just a reference to it.
|
|
||||||
|
|
||||||
The most interesting part of `refArray.go` is:
|
|
||||||
|
|
||||||
```
|
|
||||||
func main() {
|
|
||||||
anArray := [5]int{-1, 2, -3, 4, -5}
|
|
||||||
refAnArray := anArray[:]
|
|
||||||
|
|
||||||
fmt.Println("Array:", anArray)
|
|
||||||
printSlice(refAnArray)
|
|
||||||
negative(refAnArray)
|
|
||||||
fmt.Println("Array:", anArray)
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
The output of `refArray.go` is:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ go run refArray.go
|
|
||||||
Array: [-1 2 -3 4 -5]
|
|
||||||
-1 2 -3 4 -5
|
|
||||||
Array: [1 -2 3 -4 5]
|
|
||||||
```
|
|
||||||
|
|
||||||
So, the elements of the `anArray` array changed because of the slice reference to it.
|
|
||||||
|
|
||||||
### Summary
|
|
||||||
|
|
||||||
Although Go supports both arrays and slices, it should be clear by now that you will most likely use slices because they are more versatile and powerful than Go arrays. There are only a few occasions where you will need to use an array instead of a slice. The most obvious one is when you are absolutely sure that you will need to store a fixed number of elements.
|
|
||||||
|
|
||||||
You can find the Go code of `arrays.go`, `slice.go`, and `refArray.go` at [GitHub][6].
|
|
||||||
|
|
||||||
If you have any questions or feedback, please leave a comment below or reach out to me on [Twitter][7].
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: https://opensource.com/article/18/7/introduction-go-arrays-and-slices
|
|
||||||
|
|
||||||
作者:[Mihalis Tsoukalos][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/mtsouk
|
|
||||||
[b]: https://github.com/lkxed
|
|
||||||
[1]: https://opensource.com/sites/default/files/lead-images/traffic-light-go.png
|
|
||||||
[2]: https://opensource.com/article/18/5/creating-random-secure-passwords-go
|
|
||||||
[3]: https://opensource.com/article/18/5/building-concurrent-tcp-server-go
|
|
||||||
[4]: https://opensource.com/article/18/6/copying-files-go
|
|
||||||
[5]: https://golang.org/
|
|
||||||
[6]: https://github.com/mactsouk/opensource.com
|
|
||||||
[7]: https://twitter.com/mactsouk
|
|
@ -1,208 +0,0 @@
|
|||||||
[#]: collector: (lujun9972)
|
|
||||||
[#]: translator: (FYJNEVERFOLLOWS )
|
|
||||||
[#]: reviewer: ( )
|
|
||||||
[#]: publisher: ( )
|
|
||||||
[#]: url: ( )
|
|
||||||
[#]: subject: (Learn awk by coding a "guess the number" game)
|
|
||||||
[#]: via: (https://opensource.com/article/21/1/learn-awk)
|
|
||||||
[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen)
|
|
||||||
|
|
||||||
Learn awk by coding a "guess the number" game
|
|
||||||
======
|
|
||||||
Programming languages tend to share many common traits. One great way to
|
|
||||||
learn a new language is to create a familiar program. In this article, I
|
|
||||||
will create a "guess the number" game by using awk to demonstrate
|
|
||||||
familiar concepts.
|
|
||||||
![question mark in chalk][1]
|
|
||||||
|
|
||||||
When you learn a new programming language, it's good to focus on the things most programming languages have in common:
|
|
||||||
|
|
||||||
* Variables – places where information is stored
|
|
||||||
* Expressions – ways to calculate things
|
|
||||||
* Statements – the means by which state changes are expressed in a program
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
These concepts are the basis of most programming languages.
|
|
||||||
|
|
||||||
Once you understand these concepts, you can start figuring the rest out. For example, most languages have a "way of doing things" supported by their design, and those ways can be quite different from one program to another. These ways include modularity (grouping related functionality together), declarative vs. imperative, object-orientation, low- vs. high-level syntactic features, and so on. An example familiar to many programmers is "ceremony," that is, the amount of work required to set the scene before tackling the problem. The Java programming language is said to have a significant ceremony requirement, stemming from its design, which requires all code to be defined within a class.
|
|
||||||
|
|
||||||
But back to the basics. Programming languages usually share similarities. Once you know one programming language, start by learning the basics of another to appreciate the differences in that new language.
|
|
||||||
|
|
||||||
A good way to proceed is to create a set of basic test programs. With these in hand, learning starts with these similarities.
|
|
||||||
|
|
||||||
One test program you can use is a "guess the number" program. The computer picks a number between one and one hundred and asks you to guess the number. The program loops until you make a correct guess.
|
|
||||||
|
|
||||||
The "guess the number" program exercises several concepts in programming languages:
|
|
||||||
|
|
||||||
* Variables
|
|
||||||
* Input
|
|
||||||
* Output
|
|
||||||
* Conditional evaluation
|
|
||||||
* Loops
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
That's a great practical experiment to learn a new programming language.
|
|
||||||
|
|
||||||
**Note**: This article is adapted from Moshe Zadka's article on doing using this approach in [Julia][2] and Jim Hall's article on doing it in [Bash][3].
|
|
||||||
|
|
||||||
### Guess the number in awk
|
|
||||||
|
|
||||||
Let's write a "guess the number" game as an Awk program.
|
|
||||||
|
|
||||||
Awk is dynamically typed, is a scripting language oriented toward data transformation, and has surprisingly good support for interactive use. Awk has been around since the 1970s, originally as a part of the Unix operating system. If you don't know Awk but love spreadsheets, this is a sign… [go learn Awk][4]!
|
|
||||||
|
|
||||||
You can begin your exploration of Awk by writing a version of the "guess the number" game.
|
|
||||||
|
|
||||||
Here is my implementation (with line numbers so we can review some of the specific features):
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
1 BEGIN {
|
|
||||||
2 srand(42)
|
|
||||||
3 randomNumber = int(rand() * 100) + 1
|
|
||||||
4 print "random number is",randomNumber
|
|
||||||
5 printf "guess a number between 1 and 100\n"
|
|
||||||
6 }
|
|
||||||
7 {
|
|
||||||
8 guess = int($0)
|
|
||||||
9 if (guess < randomNumber) {
|
|
||||||
10 printf "too low, try again:"
|
|
||||||
11 } else if (guess > randomNumber) {
|
|
||||||
12 printf "too high, try again:"
|
|
||||||
13 } else {
|
|
||||||
14 printf "that's right\n"
|
|
||||||
15 exit
|
|
||||||
16 }
|
|
||||||
17 }
|
|
||||||
```
|
|
||||||
|
|
||||||
We can immediately see similarities between Awk control structures and those of C or Java, but unlike Python. In statements such as _if-then-else_ or _while_, the _then_, _else_, and _while_ parts take either a statement or a group of statements enclosed within **{** and **}**. However, there is one big difference about AWk that needs to be understood from the start:
|
|
||||||
|
|
||||||
By design, Awk is built around a data pipeline.
|
|
||||||
|
|
||||||
What does that mean? Most Awk programs are snippets of code that receive a line of input, do something with the data, and write it to output. Recognizing the need for such a transformation pipeline, Awk by default provides all the transformation plumbing. Let's explore that through the above program by asking a basic question: Where is the 'read data from the console' structure?
|
|
||||||
|
|
||||||
The answer to that is – it's built-in. In particular, lines 7 – 17 tell Awk what to do with each line that is read. Given that context, it's pretty easy to see that lines 1 – 6 are executed before anything is read.
|
|
||||||
|
|
||||||
More specifically, the **BEGIN** keyword on line 1 is a kind of "pattern," in this case indicating to Awk that, before reading any data, it should execute what follows the **BEGIN** in the { … }. A similar **END** keyword, not used in this program, indicates to Awk what to do when everything has been read.
|
|
||||||
|
|
||||||
Coming back to lines 7 – 17, we see they create a block of code { … } that is similar, but there is no keyword in front. Because there is nothing before the **{** for Awk to match, it will apply this line to every line of input received. Each line of input will be entered as guesses by the user.
|
|
||||||
|
|
||||||
Let's look at the code being executed. First, the preamble that happens before any input is read.
|
|
||||||
|
|
||||||
In line 2, we initialize the random number generator with the number 42 (if we don't provide an argument, the system clock is used). 42? [Of course 42][5]. Line 3 calculates a random number between 1 and 100, and line 4 prints that number out for debugging purposes. Line 5 invites the user to guess a number. Note this line uses `printf`, not `print`. Like C, `printf'`s first argument is a template used to format the output.
|
|
||||||
|
|
||||||
Now that the user is aware the program expects input, she can type a guess on the console. Awk supplies this guess to the code in lines 7 – 17, as mentioned previously. Line 18 converts the input record to an integer; `$0` indicates the entire input record, whereas `$1` indicates the first field of the input record, `$2` the second, and so on. Yup, Awk splits an input line into constituent fields, using the predefined separator, which defaults to white space. Lines 9 – 15 compare the guess to the random number, printing appropriate responses. If the guess is correct, line 15 exits prematurely from the input line processing pipeline.
|
|
||||||
|
|
||||||
Simple!
|
|
||||||
|
|
||||||
Given the unusual structure of Awk programs as code snippets that react to specific input line configurations and do stuff with the data, let’s look at an alternative structure just to see how the filtering part works:
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
1 BEGIN {
|
|
||||||
2 srand(42)
|
|
||||||
3 randomNumber = int(rand() * 100) + 1
|
|
||||||
4 print "random number is",randomNumber
|
|
||||||
5 printf "guess a number between 1 and 100\n"
|
|
||||||
6 }
|
|
||||||
7 int($0) < randomNumber {
|
|
||||||
8 printf "too low, try again: "
|
|
||||||
9 }
|
|
||||||
10 int($0) > randomNumber {
|
|
||||||
11 printf "too high, try again: "
|
|
||||||
12 }
|
|
||||||
13 int($0) == randomNumber {
|
|
||||||
14 printf "that's right\n"
|
|
||||||
15 exit
|
|
||||||
16 }
|
|
||||||
```
|
|
||||||
|
|
||||||
Lines 1 – 6 haven’t changed. But now we see that lines 7 – 9 is code that is executed when the integer value of the line is less than the random number, lines 10 – 12 is code that is executed when the integer value of the line is greater than the random number, and lines 13 – 16 is code that is executed when the two match.
|
|
||||||
|
|
||||||
This should seem "cool but weird" – why would we repeatedly calculate `int($0)`, for example? And for sure, it would be a weird way to solve the problem. But those patterns can be really quite wonderful ways to separate conditional processing since they can employ regular expressions or any other structure supported by Awk.
|
|
||||||
|
|
||||||
For completeness, we can use these patterns to separate common computations from things that only apply to specific circumstances. Here’s a third version to illustrate:
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
1 BEGIN {
|
|
||||||
2 srand(42)
|
|
||||||
3 randomNumber = int(rand() * 100) + 1
|
|
||||||
4 print "random number is",randomNumber
|
|
||||||
5 printf "guess a number between 1 and 100\n"
|
|
||||||
6 }
|
|
||||||
7 {
|
|
||||||
8 guess = int($0)
|
|
||||||
9 }
|
|
||||||
10 guess < randomNumber {
|
|
||||||
11 printf "too low, try again: "
|
|
||||||
12 }
|
|
||||||
13 guess > randomNumber {
|
|
||||||
14 printf "too high, try again: "
|
|
||||||
15 }
|
|
||||||
16 guess == randomNumber {
|
|
||||||
17 printf "that's right\n"
|
|
||||||
18 exit
|
|
||||||
19 }
|
|
||||||
```
|
|
||||||
|
|
||||||
Recognizing that, no matter what value of input comes in, it needs to be converted to an integer, we have created lines 7 – 9 to do just that. Now the three groups of lines, 10 – 12, 13 – 15 and 16 – 19, refer to the already-defined variable guess instead of converting the input line each time.
|
|
||||||
|
|
||||||
Let's go back to the list of things we wanted to learn:
|
|
||||||
|
|
||||||
* variables – yup, Awk has those; we can infer that input data comes in as strings but can be converted to a numeric value when required
|
|
||||||
* input – Awk just sends input through its "data transformation pipeline" approach to reading stuff
|
|
||||||
* output – we have used Awk's `print` and `printf` procedures to write stuff to output
|
|
||||||
* conditional evaluation – we have learned about Awk's _if-then-else_ and input filters that respond to specific input line configurations
|
|
||||||
* loops – huh, imagine that! We didn't need a loop here, once again, thanks to the "data transformation pipeline" approach that Awk takes; the loop "just happens." Note the user can exit the pipeline prematurely by sending an end-of-file signal to Awk (a **CTRL-D** when using a Linux terminal window)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
It's well worth considering the importance of not needing a loop to handle input. One reason Awk has remained viable for so long is that Awk programs are compact, and one of the reasons they are compact is there is no boilerplate required to read from the console or a file.
|
|
||||||
|
|
||||||
Let's run the program:
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
$ awk -f guess.awk
|
|
||||||
random number is 25
|
|
||||||
guess a number between 1 and 100: 50
|
|
||||||
too high, try again: 30
|
|
||||||
too high, try again: 10
|
|
||||||
too low, try again: 25
|
|
||||||
that's right
|
|
||||||
$
|
|
||||||
```
|
|
||||||
|
|
||||||
One thing we didn't cover was comments. An Awk comment begins with a `#` and ends with the end of line.
|
|
||||||
|
|
||||||
### Wrap up
|
|
||||||
|
|
||||||
Awk is incredibly powerful and this "guess the number" game is a great way to get started. It shouldn't be the end of your journey, though. You can [read about the history of Awk and Gawk (GNU Awk)][6], an expanded version of Awk and probably the one you have on your computer if you're running Linux, or [read all about the original from its initial developers][7].
|
|
||||||
|
|
||||||
You can also [download our cheatsheet][8] to help you keep track of everything you learn.
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: https://opensource.com/article/21/1/learn-awk
|
|
||||||
|
|
||||||
作者:[Chris Hermansen][a]
|
|
||||||
选题:[lujun9972][b]
|
|
||||||
译者:[译者ID](https://github.com/FYJNEVERFOLLOWS)
|
|
||||||
校对:[校对者ID](https://github.com/校对者ID)
|
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
|
||||||
|
|
||||||
[a]: https://opensource.com/users/clhermansen
|
|
||||||
[b]: https://github.com/lujun9972
|
|
||||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/question-mark_chalkboard.jpg?itok=DaG4tje9 (question mark in chalk)
|
|
||||||
[2]: https://opensource.com/article/20/12/julia
|
|
||||||
[3]: https://opensource.com/article/20/12/learn-bash
|
|
||||||
[4]: https://opensource.com/article/20/9/awk-ebook
|
|
||||||
[5]: https://en.wikipedia.org/wiki/42_(number)#The_Hitchhiker's_Guide_to_the_Galaxy
|
|
||||||
[6]: https://www.gnu.org/software/gawk/manual/html_node/History.html
|
|
||||||
[7]: https://archive.org/details/pdfy-MgN0H1joIoDVoIC7
|
|
||||||
[8]: https://opensource.com/downloads/cheat-sheet-awk-features
|
|
@ -2,7 +2,7 @@
|
|||||||
[#]: via: "https://opensource.com/article/22/2/kubernetes-architecture"
|
[#]: via: "https://opensource.com/article/22/2/kubernetes-architecture"
|
||||||
[#]: author: "Nived Velayudhan https://opensource.com/users/nivedv"
|
[#]: author: "Nived Velayudhan https://opensource.com/users/nivedv"
|
||||||
[#]: collector: "lujun9972"
|
[#]: collector: "lujun9972"
|
||||||
[#]: translator: " "
|
[#]: translator: "MjSeven"
|
||||||
[#]: reviewer: " "
|
[#]: reviewer: " "
|
||||||
[#]: publisher: " "
|
[#]: publisher: " "
|
||||||
[#]: url: " "
|
[#]: url: " "
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
[#]: via: "https://www.linuxtechi.com/dual-boot-ubuntu-22-04-and-windows-11/"
|
[#]: via: "https://www.linuxtechi.com/dual-boot-ubuntu-22-04-and-windows-11/"
|
||||||
[#]: author: "James Kiarie https://www.linuxtechi.com/author/james/"
|
[#]: author: "James Kiarie https://www.linuxtechi.com/author/james/"
|
||||||
[#]: collector: "lkxed"
|
[#]: collector: "lkxed"
|
||||||
[#]: translator: " "
|
[#]: translator: "robsean"
|
||||||
[#]: reviewer: " "
|
[#]: reviewer: " "
|
||||||
[#]: publisher: " "
|
[#]: publisher: " "
|
||||||
[#]: url: " "
|
[#]: url: " "
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
[#]: via: "https://ostechnix.com/how-to-boot-into-rescue-mode-or-emergency-mode-in-ubuntu-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/"
|
[#]: author: "sk https://ostechnix.com/author/sk/"
|
||||||
[#]: collector: "lkxed"
|
[#]: collector: "lkxed"
|
||||||
[#]: translator: " "
|
[#]: translator: "robsean"
|
||||||
[#]: reviewer: " "
|
[#]: reviewer: " "
|
||||||
[#]: publisher: " "
|
[#]: publisher: " "
|
||||||
[#]: url: " "
|
[#]: url: " "
|
||||||
|
@ -1,125 +0,0 @@
|
|||||||
[#]: subject: "How To Reset Sudo Password In Ubuntu 22.04 / 20.04 LTS"
|
|
||||||
[#]: via: "https://ostechnix.com/how-to-reset-sudo-password-in-ubuntu-20-04-lts/"
|
|
||||||
[#]: author: "sk https://ostechnix.com/author/sk/"
|
|
||||||
[#]: collector: "lkxed"
|
|
||||||
[#]: translator: "robsean"
|
|
||||||
[#]: reviewer: " "
|
|
||||||
[#]: publisher: " "
|
|
||||||
[#]: url: " "
|
|
||||||
|
|
||||||
How To Reset Sudo Password In Ubuntu 22.04 / 20.04 LTS
|
|
||||||
======
|
|
||||||
Reset Forgotten Root Password In Ubuntu
|
|
||||||
|
|
||||||
This brief guide explains how to reset sudo password in Ubuntu 22.04 and 20.04 LTS desktop and server editions from rescue mode.
|
|
||||||
|
|
||||||
### Introduction
|
|
||||||
|
|
||||||
When **[installing Ubuntu][1]**, a new user will be created with sudo privileges to perform all sorts of administrative tasks.
|
|
||||||
|
|
||||||
If your Ubuntu system have multiple sudo users, you can easily reset the forgotten password of a sudo user or administrative user from another sudo user's account.
|
|
||||||
|
|
||||||
What If you have only one sudo user and you lost the password? No problem! It is very easy to recover forgotten sudo user password in Ubuntu from the **"rescue"** or **"single user"** mode.
|
|
||||||
|
|
||||||
This guide has been officially tested on Ubuntu 22.04 and 20.04 LTS editions, however the steps given below are same for other Ubuntu versions and derivatives.
|
|
||||||
|
|
||||||
### Reset Sudo Password In Ubuntu 22.04 / 20.04 LTS
|
|
||||||
|
|
||||||
First, boot your Ubuntu system into rescue mode to reset a sudo user's password as described in the link below.
|
|
||||||
|
|
||||||
> [How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 22.04 / 20.04 / 18.04][2]
|
|
||||||
|
|
||||||
After you entered into the rescue mode, mount the root (**/**) file system in read/write mode by running the following command:
|
|
||||||
|
|
||||||
```
|
|
||||||
# mount -n -o remount,rw /
|
|
||||||
```
|
|
||||||
|
|
||||||
Now, reset the sudo user's password using **"passwd"** command:
|
|
||||||
|
|
||||||
```
|
|
||||||
# passwd ostechnix
|
|
||||||
```
|
|
||||||
|
|
||||||
Here, **"ostechnix"** is the sudo user. Replace it with your own user name.
|
|
||||||
|
|
||||||
Enter the password twice:
|
|
||||||
|
|
||||||
```
|
|
||||||
New password:
|
|
||||||
Retype new password:
|
|
||||||
passwd: password updated successfully
|
|
||||||
```
|
|
||||||
|
|
||||||
![Reset Sudo Password In Ubuntu 22.04 / 20.04 LTS][3]
|
|
||||||
|
|
||||||
That's it. We have reset the sudo user password. If you have followed the **Method 1** to enter into rescue mode as described in the above link, press **“Ctrl+d”** to boot into normal mode. Alternatively, you can type any one of the following commands to boot into normal mode.
|
|
||||||
|
|
||||||
```
|
|
||||||
# systemctl default
|
|
||||||
```
|
|
||||||
|
|
||||||
Or,
|
|
||||||
|
|
||||||
```
|
|
||||||
# exit
|
|
||||||
```
|
|
||||||
|
|
||||||
If you want to reboot the system instead of booting into normal mode, enter:
|
|
||||||
|
|
||||||
```
|
|
||||||
# systemctl reboot
|
|
||||||
```
|
|
||||||
|
|
||||||
If you have followed the **Method 2** to enter into rescue mode as described in the above link, type:
|
|
||||||
|
|
||||||
```
|
|
||||||
# exit
|
|
||||||
```
|
|
||||||
|
|
||||||
You will go back to the recovery menu. Choose "**Resume normal boot**" and hit ENTER key.
|
|
||||||
|
|
||||||
![Boot Into Normal Mode In Ubuntu][4]
|
|
||||||
|
|
||||||
Again, choose OK and press ENTER to continue booting into normal mode:
|
|
||||||
|
|
||||||
![Exit Recovery Mode And Boot Into Normal Mode][5]
|
|
||||||
|
|
||||||
You can now use the new sudo password when running administrative commands.
|
|
||||||
|
|
||||||
##### What If I Forgot Both Username And Password?
|
|
||||||
|
|
||||||
If you forget the username, you can easily list the available users in your Linux system from the rescue mode using command:
|
|
||||||
|
|
||||||
```
|
|
||||||
# cat etc/passwd
|
|
||||||
```
|
|
||||||
|
|
||||||
Sample output from my Ubuntu 22.04 system:
|
|
||||||
|
|
||||||
```
|
|
||||||
[...]
|
|
||||||
ostechnix:x:1000:1000:Ostechnix,,,:/home/ostechnix:/bin/bash
|
|
||||||
[...]
|
|
||||||
```
|
|
||||||
|
|
||||||
Well, you now have the user name. Just follow the aforementioned steps to reset the user's password.
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: https://ostechnix.com/how-to-reset-sudo-password-in-ubuntu-20-04-lts/
|
|
||||||
|
|
||||||
作者:[sk][a]
|
|
||||||
选题:[lkxed][b]
|
|
||||||
译者:[译者ID](https://github.com/译者ID)
|
|
||||||
校对:[校对者ID](https://github.com/校对者ID)
|
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
|
||||||
|
|
||||||
[a]: https://ostechnix.com/author/sk/
|
|
||||||
[b]: https://github.com/lkxed
|
|
||||||
[1]: https://ostechnix.com/install-ubuntu-desktop/
|
|
||||||
[2]: https://ostechnix.com/how-to-boot-into-rescue-mode-or-emergency-mode-in-ubuntu-18-04/
|
|
||||||
[3]: https://ostechnix.com/wp-content/uploads/2022/05/Reset-Sudo-Password-In-Ubuntu.png
|
|
||||||
[4]: https://ostechnix.com/wp-content/uploads/2020/05/Boot-into-normal-mode-in-Ubuntu.png
|
|
||||||
[5]: https://ostechnix.com/wp-content/uploads/2020/05/Booting-into-normal-mode-from-rescue-mode-in-Ubuntu.png
|
|
@ -2,7 +2,7 @@
|
|||||||
[#]: via: "https://itsfoss.com/apt-install-specific-version-2/"
|
[#]: via: "https://itsfoss.com/apt-install-specific-version-2/"
|
||||||
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
|
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
|
||||||
[#]: collector: "lkxed"
|
[#]: collector: "lkxed"
|
||||||
[#]: translator: " "
|
[#]: translator: "robsean"
|
||||||
[#]: reviewer: " "
|
[#]: reviewer: " "
|
||||||
[#]: publisher: " "
|
[#]: publisher: " "
|
||||||
[#]: url: " "
|
[#]: url: " "
|
||||||
|
@ -1,272 +0,0 @@
|
|||||||
[#]: subject: "A programmer's guide to GNU C Compiler"
|
|
||||||
[#]: via: "https://opensource.com/article/22/5/gnu-c-compiler"
|
|
||||||
[#]: author: "Jayashree Huttanagoudar https://opensource.com/users/jayashree-huttanagoudar"
|
|
||||||
[#]: collector: "lkxed"
|
|
||||||
[#]: translator: "robsean"
|
|
||||||
[#]: reviewer: " "
|
|
||||||
[#]: publisher: " "
|
|
||||||
[#]: url: " "
|
|
||||||
|
|
||||||
A programmer's guide to GNU C Compiler
|
|
||||||
======
|
|
||||||
Get a behind-the-scenes look at the steps it takes to produce a binary file so that when something goes wrong, you know how to step through the process to resolve problems.
|
|
||||||
|
|
||||||
![GitHub launches Open Source Friday][1]
|
|
||||||
Image by: Opensource.com
|
|
||||||
|
|
||||||
C is a well-known programming language, popular with experienced and new programmers alike. Source code written in C uses standard English terms, so it's considered human-readable. However, computers only understand binary code. To convert code into machine language, you use a tool called a *compiler*.
|
|
||||||
|
|
||||||
A very common compiler is GCC (GNU C Compiler). The compilation process involves several intermediate steps and adjacent tools.
|
|
||||||
|
|
||||||
### Install GCC
|
|
||||||
|
|
||||||
To confirm whether GCC is already installed on your system, use the `gcc` command:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ gcc --version
|
|
||||||
```
|
|
||||||
|
|
||||||
If necessary, install GCC using your packaging manager. On Fedora-based systems, use `dnf` :
|
|
||||||
|
|
||||||
```
|
|
||||||
$ sudo dnf install gcc libgcc
|
|
||||||
```
|
|
||||||
|
|
||||||
On Debian-based systems, use `apt` :
|
|
||||||
|
|
||||||
```
|
|
||||||
$ sudo apt install build-essential
|
|
||||||
```
|
|
||||||
|
|
||||||
After installation, if you want to check where GCC is installed, then use:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ whereis gcc
|
|
||||||
```
|
|
||||||
|
|
||||||
### Simple C program using GCC
|
|
||||||
|
|
||||||
Here's a simple C program to demonstrate how to compile code using GCC. Open your favorite text editor and paste in this code:
|
|
||||||
|
|
||||||
```
|
|
||||||
// hellogcc.c
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
printf("Hello, GCC!\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Save the file as `hellogcc.c` and then compile it:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ ls
|
|
||||||
hellogcc.c
|
|
||||||
|
|
||||||
$ gcc hellogcc.c
|
|
||||||
|
|
||||||
$ ls -1
|
|
||||||
a.out
|
|
||||||
hellogcc.c
|
|
||||||
```
|
|
||||||
|
|
||||||
As you can see, `a.out` is the default executable generated as a result of compilation. To see the output of your newly-compiled application, just run it as you would any local binary:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ ./a.out
|
|
||||||
Hello, GCC!
|
|
||||||
```
|
|
||||||
|
|
||||||
### Name the output file
|
|
||||||
|
|
||||||
The filename `a.out` isn't very descriptive, so if you want to give a specific name to your executable file, you can use the `-o` option:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ gcc -o hellogcc hellogcc.c
|
|
||||||
|
|
||||||
$ ls
|
|
||||||
a.out hellogcc hellogcc.c
|
|
||||||
|
|
||||||
$ ./hellogcc
|
|
||||||
Hello, GCC!
|
|
||||||
```
|
|
||||||
|
|
||||||
This option is useful when developing a large application that needs to compile multiple C source files.
|
|
||||||
|
|
||||||
### Intermediate steps in GCC compilation
|
|
||||||
|
|
||||||
There are actually four steps to compiling, even though GCC performs them automatically in simple use-cases.
|
|
||||||
|
|
||||||
1. Pre-Processing: The GNU C Preprocessor (cpp) parses the headers (#include statements), expands macros (#define statements), and generates an intermediate file such as `hellogcc.i` with expanded source code.
|
|
||||||
2. Compilation: During this stage, the compiler converts pre-processed source code into assembly code for a specific CPU architecture. The resulting assembly file is named with a `.s` extension, such as `hellogcc.s` in this example.
|
|
||||||
3. Assembly: The `as`sembler (as) converts the assembly code into machine code in an object file, such as `hellogcc.o`.
|
|
||||||
4. Linking: The linker (ld) links the object code with the library code to produce an executable file, such as `hellogcc`.
|
|
||||||
|
|
||||||
When running GCC, use the `-v` option to see each step in detail.
|
|
||||||
|
|
||||||
```
|
|
||||||
$ gcc -v -o hellogcc hellogcc.c
|
|
||||||
```
|
|
||||||
|
|
||||||
![Compiler flowchart][2]
|
|
||||||
|
|
||||||
Image by:
|
|
||||||
|
|
||||||
(Jayashree Huttanagoudar, CC BY-SA 4.0)
|
|
||||||
|
|
||||||
### Manually compile code
|
|
||||||
|
|
||||||
It can be useful to experience each step of compilation because, under some circumstances, you don't need GCC to go through all the steps.
|
|
||||||
|
|
||||||
First, delete the files generated by GCC in the current folder, except the source file.
|
|
||||||
|
|
||||||
```
|
|
||||||
$ rm a.out hellogcc.o
|
|
||||||
|
|
||||||
$ ls
|
|
||||||
hellogcc.c
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Pre-processor
|
|
||||||
|
|
||||||
First, start the pre-processor, redirecting its output to `hellogcc.i` :
|
|
||||||
|
|
||||||
```
|
|
||||||
$ cpp hellogcc.c > hellogcc.i
|
|
||||||
|
|
||||||
$ ls
|
|
||||||
hellogcc.c hellogcc.i
|
|
||||||
```
|
|
||||||
|
|
||||||
Take a look at the output file and notice how the pre-processor has included the headers and expanded the macros.
|
|
||||||
|
|
||||||
#### Compiler
|
|
||||||
|
|
||||||
Now you can compile the code into assembly. Use the `-S` option to set GCC just to produce assembly code.
|
|
||||||
|
|
||||||
```
|
|
||||||
$ gcc -S hellogcc.i
|
|
||||||
|
|
||||||
$ ls
|
|
||||||
hellogcc.c hellogcc.i hellogcc.s
|
|
||||||
|
|
||||||
$ cat hellogcc.s
|
|
||||||
```
|
|
||||||
|
|
||||||
Take a look at the assembly code to see what's been generated.
|
|
||||||
|
|
||||||
#### Assembly
|
|
||||||
|
|
||||||
Use the assembly code you've just generated to create an object file:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ as -o hellogcc.o hellogcc.s
|
|
||||||
|
|
||||||
$ ls
|
|
||||||
hellogcc.c hellogcc.i hellogcc.o hellogcc.s
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Linking
|
|
||||||
|
|
||||||
To produce an executable file, you must link the object file to the libraries it depends on. This isn't quite as easy as the previous steps, but it's educational:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ ld -o hellogcc hellogcc.o
|
|
||||||
ld: warning: cannot find entry symbol _start; defaulting to 0000000000401000
|
|
||||||
ld: hellogcc.o: in function `main`:
|
|
||||||
hellogcc.c:(.text+0xa): undefined reference to `puts'
|
|
||||||
```
|
|
||||||
|
|
||||||
An error referencing an`undefined puts` occurs after the linker is done looking at the `libc.so` library. You must find suitable linker options to link the required libraries to resolve this. This is no small feat, and it's dependent on how your system is laid out.
|
|
||||||
|
|
||||||
When linking, you must link code to core runtime (CRT) objects, a set of subroutines that help binary executables launch. The linker also needs to know where to find important system libraries, including libc and libgcc, notably within special start and end instructions. These instructions can be delimited by the `--start-group` and `--end-group` options or using paths to `crtbegin.o` and `crtend.o`.
|
|
||||||
|
|
||||||
This example uses paths as they appear on a RHEL 8 install, so you may need to adapt the paths depending on your system.
|
|
||||||
|
|
||||||
```
|
|
||||||
$ ld -dynamic-linker \
|
|
||||||
/lib64/ld-linux-x86-64.so.2 \
|
|
||||||
-o hello \
|
|
||||||
/usr/lib64/crt1.o /usr/lib64/crti.o \
|
|
||||||
--start-group \
|
|
||||||
-L/usr/lib/gcc/x86_64-redhat-linux/8 \
|
|
||||||
-L/usr/lib64 -L/lib64 hello.o \
|
|
||||||
-lgcc \
|
|
||||||
--as-needed -lgcc_s \
|
|
||||||
--no-as-needed -lc -lgcc \
|
|
||||||
--end-group
|
|
||||||
/usr/lib64/crtn.o
|
|
||||||
```
|
|
||||||
|
|
||||||
The same linker procedure on Slackware uses a different set of paths, but you can see the similarity in the process:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ ld -static -o hello \
|
|
||||||
-L/usr/lib64/gcc/x86_64-slackware-linux/11.2.0/ \
|
|
||||||
/usr/lib64/crt1.o /usr/lib64/crti.o \
|
|
||||||
hello.o /usr/lib64/crtn.o \
|
|
||||||
--start-group -lc -lgcc -lgcc_eh \
|
|
||||||
--end-group
|
|
||||||
```
|
|
||||||
|
|
||||||
Now run the resulting executable:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ ./hello
|
|
||||||
Hello, GCC!
|
|
||||||
```
|
|
||||||
|
|
||||||
### Some helpful utilities
|
|
||||||
|
|
||||||
Below are a few utilities that help examine the file type, symbol table, and the libraries linked with the executable.
|
|
||||||
|
|
||||||
Use the `file` utility to determine the type of file:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ file hellogcc.c
|
|
||||||
hellogcc.c: C source, ASCII text
|
|
||||||
|
|
||||||
$ file hellogcc.o
|
|
||||||
hellogcc.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped
|
|
||||||
|
|
||||||
$ file hellogcc
|
|
||||||
hellogcc: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=bb76b241d7d00871806e9fa5e814fee276d5bd1a, for GNU/Linux 3.2.0, not stripped
|
|
||||||
```
|
|
||||||
|
|
||||||
The use the `nm` utility to list symbol tables for object files:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ nm hellogcc.o
|
|
||||||
0000000000000000 T main
|
|
||||||
U puts
|
|
||||||
```
|
|
||||||
|
|
||||||
Use the `ldd` utility to list dynamic link libraries:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ ldd hellogcc
|
|
||||||
linux-vdso.so.1 (0x00007ffe3bdd7000)
|
|
||||||
libc.so.6 => /lib64/libc.so.6 (0x00007f223395e000)
|
|
||||||
/lib64/ld-linux-x86-64.so.2 (0x00007f2233b7e000)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Wrap up
|
|
||||||
|
|
||||||
In this article, you learned the various intermediate steps in GCC compilation and the utilities to examine the file type, symbol table, and libraries linked with an executable. The next time you use GCC, you'll understand the steps it takes to produce a binary file for you, and when something goes wrong, you know how to step through the process to resolve problems.
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: https://opensource.com/article/22/5/gnu-c-compiler
|
|
||||||
|
|
||||||
作者:[Jayashree Huttanagoudar][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/jayashree-huttanagoudar
|
|
||||||
[b]: https://github.com/lkxed
|
|
||||||
[1]: https://opensource.com/sites/default/files/lead-images/build_structure_tech_program_code_construction.png
|
|
||||||
[2]: https://opensource.com/sites/default/files/2022-05/compiler-flowchart.png
|
|
@ -0,0 +1,149 @@
|
|||||||
|
[#]: subject: "4 cool new projects to try in Copr for May 2022"
|
||||||
|
[#]: via: "https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-may-2022/"
|
||||||
|
[#]: author: "Miroslav Suchý https://fedoramagazine.org/author/msuchy/"
|
||||||
|
[#]: collector: "lkxed"
|
||||||
|
[#]: translator: " "
|
||||||
|
[#]: reviewer: " "
|
||||||
|
[#]: publisher: " "
|
||||||
|
[#]: url: " "
|
||||||
|
|
||||||
|
4 cool new projects to try in Copr for May 2022
|
||||||
|
======
|
||||||
|
|
||||||
|
![4 packages to try from the Copr repos][1]
|
||||||
|
|
||||||
|
[Copr][2] is a build system for anyone in the Fedora community. It hosts thousands of projects for various purposes and audiences. Some of them should never be installed by anyone, some are already being transitioned to the official Fedora Linux repositories, and the rest are somewhere in between. Copr gives you the opportunity to install third-party software that is not available in Fedora Linux repositories, try nightly versions of your dependencies, use patched builds of your favorite tools to support some non-standard use cases, and just experiment freely.
|
||||||
|
|
||||||
|
If you don’t know [how to enable a repository][3] or if you are concerned about whether [it is safe to use Copr][4], please consult the [project documentation][5].
|
||||||
|
|
||||||
|
This article takes a closer look at interesting projects that recently landed in Copr.
|
||||||
|
|
||||||
|
### Python-QT6
|
||||||
|
|
||||||
|
Do you miss QT6 Python bindings for Fedora Linux? Here they are. [https://copr.fedorainfracloud.org/coprs/g/kdesig/python-qt6/][6]
|
||||||
|
|
||||||
|
KDE SIG owns this project. Therefore, it should be a quality one. And one day, it may land in Fedora Linux.
|
||||||
|
|
||||||
|
Example of usage:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ python
|
||||||
|
Python 3.10.4 (main, Mar 25 2022, 00:00:00) [GCC 12.0.1 20220308 (Red Hat 12.0.1-0)] on linux
|
||||||
|
Type "help", "copyright", "credits" or "license" for more information.
|
||||||
|
>>> import PyQt6
|
||||||
|
>>> from PyQt6.QtWidgets import QApplication, QWidget
|
||||||
|
>>> import sys
|
||||||
|
>>> app = QApplication(sys.argv)
|
||||||
|
>>> window = QWidget()
|
||||||
|
>>> window.show()
|
||||||
|
>>> app.exec()
|
||||||
|
0
|
||||||
|
```
|
||||||
|
|
||||||
|
More documentation can be found at
|
||||||
|
|
||||||
|
[https://www.pythonguis.com/tutorials/pyqt6-creating-your-first-window/][7].
|
||||||
|
|
||||||
|
**Installation instructions**
|
||||||
|
|
||||||
|
This package is available for Fedora Linux 36 and Rawhide. To install it, enter these commands:
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo dnf copr enable @kdesig/python-qt6
|
||||||
|
sudo dnf install python3-qt6
|
||||||
|
```
|
||||||
|
|
||||||
|
### Cloud-Native Utilities
|
||||||
|
|
||||||
|
[A collection of cloud-native development tools][8].
|
||||||
|
|
||||||
|
These packages do not follow Fedora packaging guidelines, are statically built, and opt to bundle all dependencies.
|
||||||
|
|
||||||
|
**Currently available packages**:
|
||||||
|
|
||||||
|
* Terraform – terraform
|
||||||
|
* Packer – packer
|
||||||
|
* Helm – helm
|
||||||
|
* Tekton CLI – tektoncd-cli tektoncd-cli-doc
|
||||||
|
* Knative CLI – knative-client knative-client-doc
|
||||||
|
* Buildpack CLI – pack
|
||||||
|
|
||||||
|
All build recipes can be viewed in dist-git or from Pagure:[https://pagure.io/mroche/cloud-utilities][9]
|
||||||
|
|
||||||
|
**Installation instructions**
|
||||||
|
|
||||||
|
These packages are available for Fedora 36 Linux and Rawhide. To install them, enter this command:
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo dnf copr enable mroche/cloud-native-utilities
|
||||||
|
```
|
||||||
|
|
||||||
|
### DNF 5
|
||||||
|
|
||||||
|
You may be aware the DNF team is working on DNF5. There is a [change proposal][10] for Fedora Linux 38. The benefit is that every package management software — including PackageKit, and DNFDragora — should use a common *libdnf* library. If you have an application that handles RPM packages, you should definitely check out this project.
|
||||||
|
|
||||||
|
[https://copr.fedorainfracloud.org/coprs][11][/][12][rpmsoftwaremanagement/dnf5-unstable/][13]
|
||||||
|
|
||||||
|
Another similar project from the DNF team is
|
||||||
|
|
||||||
|
[https://copr.fedorainfracloud.org/coprs/jmracek/dnf5-alternatives/][14].
|
||||||
|
|
||||||
|
**Installation instructions**
|
||||||
|
|
||||||
|
These packages are available for Fedora Linux 35, 36 and Rawhide. To install them, enter these commands:
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo dnf copr enable rpmsoftwaremanagement/dnf5-unstable
|
||||||
|
sudo dnf install dnf5
|
||||||
|
sudo dnf copr enable jmracek/dnf5-alternatives
|
||||||
|
sudo dnf install microdnf-deprecated
|
||||||
|
```
|
||||||
|
|
||||||
|
### Hare
|
||||||
|
|
||||||
|
[Hare][15] is a systems programming language designed to be simple, stable and robust. Hare uses a static type system, manual memory management, and a minimal runtime. It is well suited to writing operating systems, system tools, compilers, networking software, and other low-level, high-performance tasks. A detailed overview can be found in [these slides][16].
|
||||||
|
|
||||||
|
My summary is: Hare is simpler than C. It can be easy. But if you insist on shooting in your legs, Hare will allow you to do it.
|
||||||
|
|
||||||
|
[Copr project][17].
|
||||||
|
|
||||||
|
**Installation Instructions**
|
||||||
|
|
||||||
|
These packages are available for Fedora Linux 35, 36 and Rawhide. They are also available for OpenSUSE Leap and Tumbleweed. To install them, enter these commands:
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo dnf copr enable sentry/qbe
|
||||||
|
sudo dnf copr enable sentry/hare
|
||||||
|
sudo dnf install hare harec qbe
|
||||||
|
```
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-may-2022/
|
||||||
|
|
||||||
|
作者:[Miroslav Suchý][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://fedoramagazine.org/author/msuchy/
|
||||||
|
[b]: https://github.com/lkxed
|
||||||
|
[1]: https://fedoramagazine.org/wp-content/uploads/2017/08/4-copr-945x400.jpg
|
||||||
|
[2]: https://copr.fedorainfracloud.org/
|
||||||
|
[3]: https://docs.pagure.org/copr.copr/how_to_enable_repo.html#how-to-enable-repo
|
||||||
|
[4]: https://docs.pagure.org/copr.copr/user_documentation.html#is-it-safe-to-use-copr
|
||||||
|
[5]: https://docs.pagure.org/copr.copr/user_documentation.html
|
||||||
|
[6]: https://copr.fedorainfracloud.org/coprs/g/kdesig/python-qt6/
|
||||||
|
[7]: https://www.pythonguis.com/tutorials/pyqt6-creating-your-first-window/
|
||||||
|
[8]: https://copr.fedorainfracloud.org/coprs/mroche/cloud-native-utilities/
|
||||||
|
[9]: https://pagure.io/mroche/cloud-utilities
|
||||||
|
[10]: https://fedoraproject.org/wiki/Changes/MajorUpgradeOfMicrodnf
|
||||||
|
[11]: https://copr.fedorainfracloud.org/coprs/rpmsoftwaremanagement/dnf5-unstable/
|
||||||
|
[12]: https://copr.fedorainfracloud.org/coprs/rpmsoftwaremanagement/dnf5-unstable/
|
||||||
|
[13]: https://copr.fedorainfracloud.org/coprs/rpmsoftwaremanagement/dnf5-unstable/
|
||||||
|
[14]: https://copr.fedorainfracloud.org/coprs/jmracek/dnf5-alternatives/
|
||||||
|
[15]: https://harelang.org/
|
||||||
|
[16]: https://mirror.drewdevault.com/hare.pdf
|
||||||
|
[17]: https://copr.fedorainfracloud.org/coprs/sentry/hare/
|
311
sources/tech/20220527 Plotting Data in R- Graphs.md
Normal file
311
sources/tech/20220527 Plotting Data in R- Graphs.md
Normal file
@ -0,0 +1,311 @@
|
|||||||
|
[#]: subject: "Plotting Data in R: Graphs"
|
||||||
|
[#]: via: "https://www.opensourceforu.com/2022/05/plotting-data-in-r-graphs/"
|
||||||
|
[#]: author: "Shakthi Kannan https://www.opensourceforu.com/author/shakthi-kannan/"
|
||||||
|
[#]: collector: "lkxed"
|
||||||
|
[#]: translator: " "
|
||||||
|
[#]: reviewer: " "
|
||||||
|
[#]: publisher: " "
|
||||||
|
[#]: url: " "
|
||||||
|
|
||||||
|
Plotting Data in R: Graphs
|
||||||
|
======
|
||||||
|
R has a number of packages for plotting graphs and data visualisation, such as graphics, lattice, and ggplot2. In this ninth article in the R series, we shall explore the various functions to plot data in R.
|
||||||
|
|
||||||
|
![business-man-visulising-graphs][1]
|
||||||
|
|
||||||
|
We will be using R version 4.1.2 installed on Parabola GNU/Linux-libre (x86-64) for the code snippets.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ R --version
|
||||||
|
|
||||||
|
R version 4.1.2 (2021-11-01) -- “Bird Hippie”
|
||||||
|
Copyright (C) 2021 The R Foundation for Statistical Computing
|
||||||
|
Platform: x86_64-pc-linux-gnu (64-bit)
|
||||||
|
```
|
||||||
|
|
||||||
|
R is free software and comes with absolutely no warranty. You are welcome to redistribute it under the terms of the GNU General Public License versions 2 or 3. For more information about these matters, see *https://www.gnu.org/licenses/.*
|
||||||
|
|
||||||
|
### Plot
|
||||||
|
|
||||||
|
Consider the all-India consumer price index (CPI – rural/urban) data set up to November 2021 available at *https://data.gov.in/catalog/all-india-consumer-price-index-ruralurban-0* for the different states in India. We can read the data from the downloaded file using the read.csv function, as shown below:
|
||||||
|
|
||||||
|
```
|
||||||
|
> cpi <- read.csv(file=”CPI.csv”, sep=”,”)
|
||||||
|
|
||||||
|
> head(cpi)
|
||||||
|
Sector Year Name Andhra.Pradesh Arunachal.Pradesh Assam Bihar
|
||||||
|
1 Rural 2011 January 104 NA 104 NA
|
||||||
|
2 Urban 2011 January 103 NA 103 NA
|
||||||
|
3 Rural+Urban 2011 January 103 NA 104 NA
|
||||||
|
4 Rural 2011 February 107 NA 105 NA
|
||||||
|
5 Urban 2011 February 106 NA 106 NA
|
||||||
|
6 Rural+Urban 2011 February 105 NA 105 NA
|
||||||
|
Chattisgarh Delhi Goa Gujarat Haryana Himachal.Pradesh Jharkhand Karnataka
|
||||||
|
1 105 NA 103 104 104 104 105 104
|
||||||
|
2 104 NA 103 104 104 103 104 104
|
||||||
|
3 104 NA 103 104 104 103 105 104
|
||||||
|
4 107 NA 105 106 106 105 107 106
|
||||||
|
5 106 NA 105 107 107 105 107 108
|
||||||
|
6 105 NA 104 105 106 104 106 106
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
Let us aggregate the CPI values per year for the state of Punjab, and plot a line chart using the plot function, as follows:
|
||||||
|
|
||||||
|
```
|
||||||
|
> punjab <- aggregate(x=cpi$Punjab, by=list(cpi$Year), FUN=sum)
|
||||||
|
|
||||||
|
> head(punjab)
|
||||||
|
Group.1 x
|
||||||
|
1 2011 3881.76
|
||||||
|
2 2012 4183.30
|
||||||
|
3 2013 4368.40
|
||||||
|
4 2014 4455.50
|
||||||
|
5 2015 4584.30
|
||||||
|
6 2016 4715.80
|
||||||
|
|
||||||
|
> plot(punjab$Group.1, punjab$x, type=”l”, main=”Punjab Consumer Price Index upto November 2021”, xlab=”Year”, ylab=”Consumer Price Index”)
|
||||||
|
```
|
||||||
|
|
||||||
|
The following arguments are supported by the plot function:
|
||||||
|
|
||||||
|
| Argument | Description |
|
||||||
|
| :- | :- |
|
||||||
|
| x | A vector for the x-axis |
|
||||||
|
| y | The vector or list in the y-axis |
|
||||||
|
| type | ‘p’ for points, ‘l’ for lines, ‘o’ for overplotted plots and lines, ‘s’ for stair steps, ‘h’ for histogram |
|
||||||
|
| xlim | The x limits of the plot |
|
||||||
|
| ylim | The y limits of the plot |
|
||||||
|
| main | The title of the plot |
|
||||||
|
| sub | The subtitle of the plot |
|
||||||
|
| xlab | The label for the x-axis |
|
||||||
|
| ylab | The label for the y-axis |
|
||||||
|
| axes | Logical value to draw the axes |
|
||||||
|
|
||||||
|
The line chart is shown in Figure 1.
|
||||||
|
|
||||||
|
![Figure 1: Line chart][2]
|
||||||
|
|
||||||
|
The autocorrelation plot can be used to obtain correlation statistics for time series analysis, and the same can be generated using the acf function in R. You can specify the following autocorrelation types: *correlation, covariance*, or partial. Figure 2 shows the ACF chart that represents the CPI values (‘x’ in the chart) for the state of Punjab.
|
||||||
|
|
||||||
|
![Figure 2: ACF chart][3]
|
||||||
|
|
||||||
|
The function*acf* accepts the following arguments:
|
||||||
|
|
||||||
|
| Argument | Description |
|
||||||
|
| :- | :- |
|
||||||
|
| x | A univariate or multivariate object or vector or matrix |
|
||||||
|
| lag.max | The maximum lag to calculate the acf |
|
||||||
|
| type | Supported values ‘correlation’, ‘covariance’, ‘partial’ |
|
||||||
|
| plot | The acf is plotted if this value is TRUE |
|
||||||
|
| i | A set of time difference lags to retain |
|
||||||
|
| j | A collection of names or numbers to retain |
|
||||||
|
|
||||||
|
### Bar chart
|
||||||
|
|
||||||
|
The barplot function is used to draw a bar chart. The chart for Punjab’s CPI can be generated as follows, and is shown in Figure 3:
|
||||||
|
|
||||||
|
![Figure 3: Line chart of Punjab’s CPI][4]
|
||||||
|
|
||||||
|
```
|
||||||
|
> barplot(punjab$x, main=”Punjab Consumer Price Index”, sub=”Upto November 2021”, xlab=”Year”, ylab=”Consumer Price Index”, col=”navy”)
|
||||||
|
```
|
||||||
|
|
||||||
|
The function is quite flexible and supports the following arguments:
|
||||||
|
|
||||||
|
| Argument | Description |
|
||||||
|
| :- | :- |
|
||||||
|
| height | A numeric vector or matrix that contains the values |
|
||||||
|
| width | A numeric vector that specifies the widths of the bars |
|
||||||
|
| space | The amount of space between bars |
|
||||||
|
| beside | A logical value to specify if the bars should be stacked or next to each other |
|
||||||
|
| density | A numerical value that specifies the density of the shading lines |
|
||||||
|
| angle | The angle used to shade the lines |
|
||||||
|
| border | The colour of the border |
|
||||||
|
| main | The title of the chart |
|
||||||
|
| sub | The sub-title of the chart |
|
||||||
|
| xlab | The label for the x-axis |
|
||||||
|
| ylab | The label for the y-axis |
|
||||||
|
| xlim | The limits for the x-axis |
|
||||||
|
| ylim | The limits for the y-axis |
|
||||||
|
| axes | A value that specifies whether the axes should be drawn |
|
||||||
|
|
||||||
|
You can get more details on the barplot function using the help command, as shown below:
|
||||||
|
|
||||||
|
```
|
||||||
|
> help(barplot)
|
||||||
|
|
||||||
|
acf package:stats R Documentation
|
||||||
|
|
||||||
|
Auto- and Cross- Covariance and -Correlation Function Estimation
|
||||||
|
|
||||||
|
Description:
|
||||||
|
|
||||||
|
The function ‘acf’ computes (and by default plots) estimates of
|
||||||
|
the autocovariance or autocorrelation function. Function ‘pacf’
|
||||||
|
is the function used for the partial autocorrelations. Function
|
||||||
|
‘ccf’ computes the cross-correlation or cross-covariance of two
|
||||||
|
univariate series.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
|
||||||
|
acf(x, lag.max = NULL,
|
||||||
|
type = c(“correlation”, “covariance”, “partial”),
|
||||||
|
plot = TRUE, na.action = na.fail, demean = TRUE, ...)
|
||||||
|
|
||||||
|
pacf(x, lag.max, plot, na.action, ...)
|
||||||
|
|
||||||
|
## Default S3 method:
|
||||||
|
pacf(x, lag.max = NULL, plot = TRUE, na.action = na.fail,
|
||||||
|
...)
|
||||||
|
|
||||||
|
ccf(x, y, lag.max = NULL, type = c(“correlation”, “covariance”),
|
||||||
|
plot = TRUE, na.action = na.fail, ...)
|
||||||
|
|
||||||
|
## S3 method for class ‘acf’
|
||||||
|
x[i, j]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Pie chart
|
||||||
|
|
||||||
|
Pie charts need to be used wisely, as they may not actually show relative differences among the slices. We can generate the Rural, Urban, and Rural+Urban values for the month of January 2021 for Gujarat as follows, using the subset function:
|
||||||
|
|
||||||
|
```
|
||||||
|
> jan2021 <- subset(cpi, Name==”January” & Year==”2021”)
|
||||||
|
|
||||||
|
> jan2021$Gujarat
|
||||||
|
[1] 153.9 151.2 149.1
|
||||||
|
|
||||||
|
> names <- c(‘Rural’, ‘Urban’, ‘Rural+Urban’)
|
||||||
|
```
|
||||||
|
|
||||||
|
![Figure 4: Pie chart][5]
|
||||||
|
|
||||||
|
The pie function can be used to generate the actual pie chart for the state of Gujarat, as shown below:
|
||||||
|
|
||||||
|
```
|
||||||
|
> pie(jan2021$Gujarat, names, main=”Gujarat CPI Rural and Urban Pie Chart”)
|
||||||
|
```
|
||||||
|
|
||||||
|
The following arguments are supported by the pie function:
|
||||||
|
|
||||||
|
| Argument | Description |
|
||||||
|
| :- | :- |
|
||||||
|
| x | Positive numeric values to be plotted |
|
||||||
|
| label | A vector of character strings for the labels |
|
||||||
|
| radius | The size of the pie |
|
||||||
|
| clockwise | A value to indicate if the pie should be drawn clockwise or counter-clockwise |
|
||||||
|
| density | A value for the density of shading lines per inch |
|
||||||
|
| angle | The angle that specifies the slope of the shading lines in degrees |
|
||||||
|
| col | A numeric vector of colours to be used |
|
||||||
|
| lty | The line type for each slice |
|
||||||
|
| main | The title of the chart |
|
||||||
|
|
||||||
|
### Boxplot
|
||||||
|
|
||||||
|
A boxplot shows the interquartile range between the 25th and 75th percentile using two ‘whiskers’ for the distribution of a variable. The values outside the range are plotted separately. The boxplot functions take the following arguments:
|
||||||
|
|
||||||
|
| Argument | Description |
|
||||||
|
| :- | :- |
|
||||||
|
| data | A data frame or list that is defined |
|
||||||
|
| x | A vector that contains the values to plot |
|
||||||
|
| width | The width of the boxes to be plotted |
|
||||||
|
| outline | A logical value indicating whether to draw the outliers |
|
||||||
|
| names | The names of the labels for each box plot |
|
||||||
|
| border | The colour to use for the outline of each box plot |
|
||||||
|
| range | A maximum numerical amount the whiskers should extend from the boxes |
|
||||||
|
| plot | The boxes are plotted if this value is TRUE |
|
||||||
|
| horizontal | A logical value to indicate if the boxes should be drawn horizontally |
|
||||||
|
|
||||||
|
The boxplot for a few states from the CPI data is shown below:
|
||||||
|
|
||||||
|
```
|
||||||
|
> names <- c (‘Andaman and Nicobar’, ‘Lakshadweep’, ‘Delhi’, ‘Goa’, ‘Gujarat’, ‘Bihar’)
|
||||||
|
> boxplot(cpi$Andaman.and.Nicobar, cpi$Lakshadweep, cpi$Delhi, cpi$Goa, cpi$Gujarat, cpi$Bihar, names=names)
|
||||||
|
```
|
||||||
|
|
||||||
|
![Figure 5: Box plot][6]
|
||||||
|
|
||||||
|
![Figure 6: Q-Q plot][7]
|
||||||
|
|
||||||
|
### Q-Q plot
|
||||||
|
|
||||||
|
The Quantile-Quantile (Q-Q) plot is a way to compare two data sets. You can also compare a data set with a theoretical distribution. The qqnorm function is a generic function, and we can view the Q-Q plot for the Punjab CPI data as shown below:
|
||||||
|
|
||||||
|
```
|
||||||
|
> qqnorm(punjab$x)
|
||||||
|
```
|
||||||
|
|
||||||
|
![Figure 7: Volcano][8]
|
||||||
|
|
||||||
|
The*qqline* function adds a theoretical line to a normal, quantile-quantile plot. The following arguments are accepted by these functions:
|
||||||
|
|
||||||
|
| Argument | Description |
|
||||||
|
| :- | :- |
|
||||||
|
| x | The first data sample |
|
||||||
|
| y | The second data sample |
|
||||||
|
| datax | A logical value indicating if values should be on the x-axis |
|
||||||
|
| probs | A numerical vector representing probabilities |
|
||||||
|
| xlab | The label for x-axis |
|
||||||
|
| ylab | The label for y-axis |
|
||||||
|
| qtype | The type of quantile computation |
|
||||||
|
|
||||||
|
### Contour plot
|
||||||
|
|
||||||
|
The contour function is useful for plotting three-dimensional data. You can generate a new contour plot, or add contour lines to an existing chart. These are commonly used along with image charts. The volcano data set in R provides information on the Maunga Whau (Mt Eden) volcanic field, and the same can be visualised with the contour function as follows:
|
||||||
|
|
||||||
|
```
|
||||||
|
> contour(volcano)
|
||||||
|
```
|
||||||
|
|
||||||
|
The contour function accepts the following arguments:
|
||||||
|
|
||||||
|
| Argument | Description |
|
||||||
|
| :- | :- |
|
||||||
|
| x,y | The location of the grid for z |
|
||||||
|
| z | A numeric vector to be plotted |
|
||||||
|
| nlevels | The number of contour levels |
|
||||||
|
| labels | A vector of labels for the contour lines |
|
||||||
|
| xlim | The x limits for the plot |
|
||||||
|
| ylim | The y limits for the plot |
|
||||||
|
| zlim | The z limits for the plot |
|
||||||
|
| axes | A value to indicate to print the axes |
|
||||||
|
| col | The colour for the contour lines |
|
||||||
|
| lty | The line type to draw |
|
||||||
|
| lwd | Width for the lines |
|
||||||
|
| vfont | The font for the labels |
|
||||||
|
|
||||||
|
The areas between the contour lines can be filled using a solid colour to indicate the levels, as shown below:
|
||||||
|
|
||||||
|
```
|
||||||
|
> filled.contour(volcano, asp = 1)
|
||||||
|
```
|
||||||
|
|
||||||
|
The same volcano data set with the filled.contour colours is illustrated in Figure 8.
|
||||||
|
|
||||||
|
![Figure 8: Filled volcano][9]
|
||||||
|
|
||||||
|
You are encouraged to explore the other functions and charts in the graphics package in R.
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://www.opensourceforu.com/2022/05/plotting-data-in-r-graphs/
|
||||||
|
|
||||||
|
作者:[Shakthi Kannan][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/shakthi-kannan/
|
||||||
|
[b]: https://github.com/lkxed
|
||||||
|
[1]: https://www.opensourceforu.com/wp-content/uploads/2022/04/business-man-visulising-graphs.jpg
|
||||||
|
[2]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-1-Line-chart.jpg
|
||||||
|
[3]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-2-ACF-chart.jpg
|
||||||
|
[4]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-3-Line-chart-of-Punjabs-CPI.jpg
|
||||||
|
[5]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-4-Pie-chart.jpg
|
||||||
|
[6]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-5-ox-plot.jpg
|
||||||
|
[7]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-6-Q-Q-plot.jpg
|
||||||
|
[8]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-7-Volcano.jpg
|
||||||
|
[9]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-8-Filled-volcano.jpg
|
@ -0,0 +1,90 @@
|
|||||||
|
[#]: subject: "How I automate plant care using Raspberry Pi and open source tools"
|
||||||
|
[#]: via: "https://opensource.com/article/22/5/plant-care"
|
||||||
|
[#]: author: "Kevin Sonney https://opensource.com/users/ksonney"
|
||||||
|
[#]: collector: "lkxed"
|
||||||
|
[#]: translator: " "
|
||||||
|
[#]: reviewer: " "
|
||||||
|
[#]: publisher: " "
|
||||||
|
[#]: url: " "
|
||||||
|
|
||||||
|
How I automate plant care using Raspberry Pi and open source tools
|
||||||
|
======
|
||||||
|
I keep tabs on all my houseplants by using Home Assistant and a Raspberry Pi.
|
||||||
|
|
||||||
|
![Digital images of a computer desktop][1]
|
||||||
|
|
||||||
|
Image by: Opensource.com
|
||||||
|
|
||||||
|
> Automation is a hot topic right now. In my day job as an SRE part of my remit is to automate as many repeating tasks as possible. But how many of us do that in our daily, not-work, lives? This year, I am focused on automating away the toil so that we can focus on the things that are important.
|
||||||
|
|
||||||
|
Home Assistant has so many features and integrations, it can be overwhelming at times. And as I’ve mentioned in previous articles, I use it for many things, including monitoring plants.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ bluetoothctl scan le
|
||||||
|
Discovery started
|
||||||
|
[NEW] Device
|
||||||
|
[NEW] Device
|
||||||
|
[NEW] Device
|
||||||
|
[NEW] Device
|
||||||
|
[NEW] Device
|
||||||
|
[NEW] Device
|
||||||
|
[NEW] Device
|
||||||
|
```
|
||||||
|
|
||||||
|
There are numerous little devices you can buy to keep an eye on your plants. The Xiomi MiaFlora devices are small, inexpensive, and have a native integration with Home Assistant. Which is great—as long as the plant and Home Assistant are in the same room.
|
||||||
|
|
||||||
|
We've all been in places where one spot there is a great signal, and moving 1mm in any direction makes it a dead zone—and it is even more frustrating when you are indoors. Most Bluetooth LE (Low Energy) devices have a range of about 100m, but that's using line of sight, and does not include interference from things like walls, doors, windows, or major appliances (seriously, a refrigerator is a great big signal blocker). Remote Home Assistant is perfect for this. You can set up a Raspberry Pi with Home Assistant Operating System (HASSOS) in the room with the plants, and then use the main Home Assistant as a central control panel. I tried this on a Raspberry Pi Zero W, and while the Pi Zero W can run Home Assistant, it doesn't do it very well. You probably want a Pi 3 or Pi 4 when doing this.
|
||||||
|
|
||||||
|
Start with a fresh HASSOS installation, and make sure everything is up-to-date, then install HACS and Remote Home Assistant like I did in my article [Automate and manage multiple devices with Remote Home Assistant][2]. Now for the tricky bits. Install the `SSH and Web Terminal` Add-on, and turn off `Protection Mode` so that you can get a session on the base OS and not in a container. Start the add-on, and it appears on the sidebar. Click on it to load the terminal.
|
||||||
|
|
||||||
|
You are now in a root session terminal on the Pi. Insert all the warnings here about being careful and how you can mess up the system (you know the ones). Inside the terminal, run `bluetoothctl scan le` to find the plant sensor, often named "Flower Care" like mine.
|
||||||
|
|
||||||
|
![Image of finding plant sensors][3]
|
||||||
|
|
||||||
|
Image by: (Kevin Sonney, CC BY-SA 40)
|
||||||
|
|
||||||
|
Make a note of the address for the plant sensor. If you have more than one, it could be confusing to figure out which is which, and can take some trial and error. Once you've identified the plant sensor, it is time to add it to Home Assistant. This requires editing the `configuration.yml` file directly, either with the file editor add on, or in the terminal you just created. In my case, I added both a sensor and a plant block to the configuration.
|
||||||
|
|
||||||
|
```
|
||||||
|
sensor:
|
||||||
|
- platform: miflora
|
||||||
|
scan_interval: 60
|
||||||
|
mac: "C4:7C:8D:6C:DE:FE"
|
||||||
|
name: "pitcher_plant"
|
||||||
|
plant:
|
||||||
|
pitcher_plant:
|
||||||
|
sensors:
|
||||||
|
moisture: sensor.pitcher_plant_moisture
|
||||||
|
battery: sensor.pitcher_plant_battery
|
||||||
|
temperature: sensor.pitcher_plant_temperature
|
||||||
|
conductivity: sensor.pitcher_plant_conductivity
|
||||||
|
brightness: sensor.pitcher_plant_brightness
|
||||||
|
```
|
||||||
|
|
||||||
|
Save the file, and restart Home Assistant, and you should see a plant card on the Overview tab.
|
||||||
|
|
||||||
|
![Image showing plant needs watering][4]
|
||||||
|
|
||||||
|
Image by: (Kevin Sonney, CC BY-SA 40)
|
||||||
|
|
||||||
|
Once that's done, go back to the main Home Assistant, and add the newly available `plant` component to the list of things to import from the remote. You can then add the component to dashboards on the main HASS installation, and create automations and notifications based on the plant status.
|
||||||
|
|
||||||
|
I use this to monitor a pitcher plant, and I have more sensors on the way so I can keep tabs on all my houseplants—all of which live outside the Bluetooth range of my central Home Assistant Pi.
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://opensource.com/article/22/5/plant-care
|
||||||
|
|
||||||
|
作者:[Kevin Sonney][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/ksonney
|
||||||
|
[b]: https://github.com/lkxed
|
||||||
|
[1]: https://opensource.com/sites/default/files/lead-images/computer_desk_home_laptop_browser.png
|
||||||
|
[2]: https://opensource.com/article/22/5/remote-home-assistant
|
||||||
|
[3]: https://opensource.com/sites/default/files/2022-05/Day_06-2.png
|
||||||
|
[4]: https://opensource.com/sites/default/files/2022-05/Day_06-3.png
|
@ -0,0 +1,114 @@
|
|||||||
|
[#]: subject: "Portmaster: A GlassWire Alternative for Linux to Monitor & Secure Network Connections"
|
||||||
|
[#]: via: "https://itsfoss.com/portmaster/"
|
||||||
|
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
|
||||||
|
[#]: collector: "lkxed"
|
||||||
|
[#]: translator: " "
|
||||||
|
[#]: reviewer: " "
|
||||||
|
[#]: publisher: " "
|
||||||
|
[#]: url: " "
|
||||||
|
|
||||||
|
Portmaster: A GlassWire Alternative for Linux to Monitor & Secure Network Connections
|
||||||
|
======
|
||||||
|
GlassWire is a popular network monitoring app (with no support for Linux) that helps you track data usage, unusual network activity, malicious access to the network, and more.
|
||||||
|
|
||||||
|
I wish it supports Linux, but for now, it only works on Windows and Android.
|
||||||
|
|
||||||
|
For Linux, we do not have a full-fledged GUI-based application that helps us [monitor the network in Linux][1].
|
||||||
|
|
||||||
|
However, I recently stumbled upon “Portmaster”, an open-source network monitor available for Linux and other platforms. Interestingly, it offers some of the same abilities as seen with Glasswire, with some extras.
|
||||||
|
|
||||||
|
Note that it is not exactly a replacement for “GlassWire” but a potential alternative in the making.
|
||||||
|
|
||||||
|
Here, I shall share more details about it.
|
||||||
|
|
||||||
|
Note
|
||||||
|
|
||||||
|
> Safing Portmaster (or simply ‘Portmaster’) is in its early stages of development (Alpha). We feature it here, considering it aims to offer something new to Linux users.
|
||||||
|
>
|
||||||
|
> While it worked fine in our quick tests, you can expect issues with it.
|
||||||
|
|
||||||
|
### Portmaster: Open-Source App to Monitor Computer’s Network Connection
|
||||||
|
|
||||||
|
![portmaster][2]
|
||||||
|
|
||||||
|
Portmaster by [Safing][3] is an open-source GUI program available for Windows and Linux.
|
||||||
|
|
||||||
|
You can track every connection being made through the applications and services used in your Linux distribution.
|
||||||
|
|
||||||
|
It is an entirely free and open-source software that aims to make money using its paid VPN service (**SPN**), which uses onion-encryption (inspired by Tor) to route your connections from through destinations keeping your identity private.
|
||||||
|
|
||||||
|
The paid VPN is a part of the tool, but it is also in the alpha testing stage.
|
||||||
|
|
||||||
|
Even if you download things from your terminal, it tracks them and provides you the detailed information regarding the domain, IP, encryption status, protocol, and the option to block future connections if needed.
|
||||||
|
|
||||||
|
![portmaster network monitor][4]
|
||||||
|
|
||||||
|
You also get several abilities to manage the network connections, add filter lists, rules, and some other advanced options.
|
||||||
|
|
||||||
|
Portmaster gives you an overview of all the connections per application/service and also lets you view the data associated with an individual application.
|
||||||
|
|
||||||
|
![portmaster connection details][5]
|
||||||
|
|
||||||
|
It supports numerous useful features that include real-time network monitoring.
|
||||||
|
|
||||||
|
### Features of Portmaster
|
||||||
|
|
||||||
|
![portmaster firewall network][6]
|
||||||
|
|
||||||
|
Portmaster is not just a simple network connection monitor, it also gives you great control to enforce a secure DNS, and filter your network connections for best security.
|
||||||
|
|
||||||
|
Some key features include:
|
||||||
|
|
||||||
|
* Network monitor overview to sum up connections from the entire system.
|
||||||
|
* Provide debug information for every app connection history.
|
||||||
|
* Ability to block a domain from the connection list.
|
||||||
|
* Retain connection history offline.
|
||||||
|
* Manage P2P connections.
|
||||||
|
* Ability to block incoming connections.
|
||||||
|
* Option to add outgoing rules to manage the network connections easily.
|
||||||
|
* Add a filter list to easily block connections that you do not want. For instance, preventing NSFW domains to load on your network.
|
||||||
|
* Choose from different secure DNS servers (Cloudflare as the preferred default)
|
||||||
|
* Stats about network connections, destinations connected, countries involved, allowed, and blocked connections.
|
||||||
|
|
||||||
|
In addition to the mentioned features, you will find fine-grained controls to get prompts for network connections (block/allow), customize your privacy filter, choose a different DNS, inspect DNS requests for the connections made, and so much more.
|
||||||
|
|
||||||
|
### Install Portmaster on Linux
|
||||||
|
|
||||||
|
Portmaster is officially supported for Ubuntu and Fedora with .deb and .rpm packages available.
|
||||||
|
|
||||||
|
You can download the package from its [official website][7] to try on a supported Linux distribution.
|
||||||
|
|
||||||
|
The [installation documentation][8] gives you more details about the steps for Arch Linux and other Linux distributions.
|
||||||
|
|
||||||
|
You can also explore more about it in its [GitHub page][9].
|
||||||
|
|
||||||
|
### Wrapping Up
|
||||||
|
|
||||||
|
Portmaster is certainly an interesting addition to the Linux and open-source world. It could become the one tool that everyone uses to monitor, and secure networks while enhancing their online privacy.
|
||||||
|
|
||||||
|
The feature set is promising, but whether it can replace proprietary network monitors like “GlassWire” is another story to be unraveled in the future.
|
||||||
|
|
||||||
|
*What do you think about Portmaster? Please let me know your thoughts in the comments below.*
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://itsfoss.com/portmaster/
|
||||||
|
|
||||||
|
作者:[Ankush Das][a]
|
||||||
|
选题:[lkxed][b]
|
||||||
|
译者:[译者ID](https://github.com/译者ID)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]: https://itsfoss.com/author/ankush/
|
||||||
|
[b]: https://github.com/lkxed
|
||||||
|
[1]: https://itsfoss.com/network-speed-monitor-linux/
|
||||||
|
[2]: https://itsfoss.com/wp-content/uploads/2022/05/portmaster.jpg
|
||||||
|
[3]: https://safing.io/
|
||||||
|
[4]: https://itsfoss.com/wp-content/uploads/2022/05/portmaster-network-monitor.jpg
|
||||||
|
[5]: https://itsfoss.com/wp-content/uploads/2022/05/portmaster-connection-details.jpg
|
||||||
|
[6]: https://itsfoss.com/wp-content/uploads/2022/05/portmaster-firewall-network.jpg
|
||||||
|
[7]: https://safing.io/portmaster/#download
|
||||||
|
[8]: https://docs.safing.io/portmaster/install/linux
|
||||||
|
[9]: https://github.com/safing/portmaster/
|
@ -0,0 +1,205 @@
|
|||||||
|
[#]: subject: "Top 10 GNOME Themes for Your Ubuntu Desktop"
|
||||||
|
[#]: via: "https://www.debugpoint.com/2022/05/gnome-themes-2022/"
|
||||||
|
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||||
|
[#]: collector: "lkxed"
|
||||||
|
[#]: translator: " "
|
||||||
|
[#]: reviewer: " "
|
||||||
|
[#]: publisher: " "
|
||||||
|
[#]: url: " "
|
||||||
|
|
||||||
|
Top 10 GNOME Themes for Your Ubuntu Desktop
|
||||||
|
======
|
||||||
|
You can use this list of 10 GNOME themes to transform your Ubuntu distro look in 2022.
|
||||||
|
|
||||||
|
You can use GTK themes to give your GNOME or Ubuntu a sassy look without much effort. Themes are straightforward to download/install, and the result is a stunning desktop.
|
||||||
|
|
||||||
|
There are hundreds of GTK themes available. It’s challenging to pick the best ten among them. To help you choose some of the best ones, we give you the ten best GTK based themes on this page.
|
||||||
|
|
||||||
|
### Points to Note
|
||||||
|
|
||||||
|
Before you apply these themes to your latest GNOME desktop and Ubuntu, a few important points.
|
||||||
|
|
||||||
|
* All the below GNOME themes uses the GNOME Tweak tool for configuration. Also, you should install the User Themes GNOME extensions to apply these themes.
|
||||||
|
|
||||||
|
* Moreover, if you apply these themes, the GNOME’s default light and dark styles in settings are automatically turned off. If you are using Ubuntu 22.04 and above, the accent colour is also turned off to honour custom themes. Because accent colours and the light/dark style combinations set the respective Yaru theme variant.
|
||||||
|
|
||||||
|
* Make sure to close the Settings application in Ubuntu while applying the themes because the settings window gives default Yaru themes higher priority via the Appearance tab.
|
||||||
|
|
||||||
|
* Finally, change the Shell and Legacy Application themes to custom themes (see the below example image).
|
||||||
|
|
||||||
|
![Changing GNOME Theme in Tweaks Tool][1]
|
||||||
|
|
||||||
|
### Best GNOME Themes For Your Ubuntu Desktop in 2022
|
||||||
|
|
||||||
|
### 1. Arc
|
||||||
|
|
||||||
|
The first GNOME theme we want to feature in this list is the Arc theme. It is the most popular GNOME theme and is suitable for giving the best look with its looks. Arc brings a simple 2D interface with a basic flat look across the desktop. The Flat look is designed so lovely that it gives you a perfect modern desktop look without gradient or glossy effects. It also provides a nice touch to the sidebars in Nautilus and other sidebar-based apps with its Dark version.
|
||||||
|
|
||||||
|
Arc theme comes in light, dark and darker versions. Installing the Arc theme is easy in Ubuntu because it is available in the official repo. Fire up a terminal window and run the following command to install.
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo apt install arc-theme
|
||||||
|
```
|
||||||
|
|
||||||
|
If you want to install via source, you can grab the files on [GitHub][2] and follow the compilation instructions.
|
||||||
|
|
||||||
|
After the installation, set the theme using the Tweaks tool and pair it using any Yaru-blue icons in Ubuntu for the best look.
|
||||||
|
|
||||||
|
![Arc Darker Theme in Ubuntu GNOME][3]
|
||||||
|
|
||||||
|
#### 2. Layan
|
||||||
|
|
||||||
|
The second theme we highlight here is Layan. Based on material design (materia-gtk), Layan gives you a flat layout for the entire GNOME Shell. In addition, it comes with a few more rounded corners in the windows and larger shadows. Moreover, it brings light and dark variants for every taste bud.
|
||||||
|
|
||||||
|
Perhaps the unique feature of this theme is the sidebar in Nautilus (see below image). It’s a sleek vertical bar with a little mountain icon at the top. I must say, it enhances the entire desktop look with this touch.
|
||||||
|
|
||||||
|
We recommend that you pair it with Yaru-prusiangreen icon and a nice gradient wallpaper for best results.
|
||||||
|
|
||||||
|
For installation, [download the theme from GitHub][4]and extract it. Then run the install.sh.
|
||||||
|
|
||||||
|
It is also available as a snap if you prefer.
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo snap install layan-themes
|
||||||
|
```
|
||||||
|
|
||||||
|
![Layan GNOME Theme][5]
|
||||||
|
|
||||||
|
#### 3. Orchis
|
||||||
|
|
||||||
|
If you ask me to choose one theme for all possible renovation of your desktop, then I would suggest Orchis. The Orchis theme combines Google’s material design and rounded corners with a sober colour palette. Furthermore, Orchis is bound to make an impression with its visual tone, which brings eight colour options, with each having dark, compact and light variants.
|
||||||
|
|
||||||
|
![Orchis colour options][6]
|
||||||
|
|
||||||
|
For an instant desktop makeover, you can easily pair Orchis with any icon themes and wallpaper.
|
||||||
|
|
||||||
|
Installation is super easy for Orchis. [Download the package from Github][7]. Then run the below command from the installation directory for all variants and colours.
|
||||||
|
|
||||||
|
```
|
||||||
|
./install.sh -t all
|
||||||
|
```
|
||||||
|
|
||||||
|
![Orchis GNOME Theme][8]
|
||||||
|
|
||||||
|
#### 4. Numix
|
||||||
|
|
||||||
|
Numix theme for GNOME desktops is similar to the Arc theme featured in this list. But it’s a little different in terms of its colour tone. The primary highlight colour is complemented by its flat design. It comes with light and dark variants. However, you can only download and install the light version for free.
|
||||||
|
|
||||||
|
You can easily install it using the following command in Ubuntu.
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo apt install numix-gtk-theme
|
||||||
|
```
|
||||||
|
|
||||||
|
If you prefer the dark variant, you can get it via the [developer’s home page][9] instructions.
|
||||||
|
|
||||||
|
![Numix Theme | image credit: Author of Numix][10]
|
||||||
|
|
||||||
|
#### 5. Adapta
|
||||||
|
|
||||||
|
[Adapta][11] is one of the most popular GTK themes, which inspired many child themes. The theme creators often base their theme on Adapta and modify it further. Hence you can imagine its flexibility and features. In addition, Adapta is based on Google’s Material Design principle.
|
||||||
|
|
||||||
|
Moreover, if you like the Android user interface, you will enjoy the Adapta theme on your GNOME desktop because it brings ample padding, well-placed shadows and layers, better contrast, etc.
|
||||||
|
|
||||||
|
Before installing, you should know that the installation size is slightly larger for a theme (~200MB+).
|
||||||
|
|
||||||
|
Finally, you can easily install the Adapta theme using the command below.
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo apt install adapta-gtk-theme
|
||||||
|
```
|
||||||
|
|
||||||
|
![Adapta Theme – follows Android Style][12]
|
||||||
|
|
||||||
|
#### 6. Cloudy
|
||||||
|
|
||||||
|
Cloudy provides a comfortable and smooth look. It is based on the Arc theme featured in this list. In addition, it follows the material design approach that offers a unique feel of “cloudy sky”. Moreover, the Cloudy theme offers grey and blue flavour with light/dark variants.
|
||||||
|
|
||||||
|
If you love the colour sky blue and want a material design theme, then choose this one.
|
||||||
|
|
||||||
|
Download this theme from the gnome-look website [here][13] and copy the extracted files in your ~/.themes directory to install.
|
||||||
|
|
||||||
|
![Cloudy GNOME Theme][14]
|
||||||
|
|
||||||
|
#### 7. Nord
|
||||||
|
|
||||||
|
The Nord theme is one of the famous GTK themes you can install on the GNOME desktop. It tenders a cool and stylish piece with several colour options. In addition, all the colour options come with light and dark variants.
|
||||||
|
|
||||||
|
The colour options are blue, green and grey. If you want this for your desktop, follow the below instructions to install.
|
||||||
|
|
||||||
|
[Download the files][15] from gnome-look and place them in the ~/.themes folder after extract.
|
||||||
|
|
||||||
|
![Nord Theme | Image Credit: Ant Author][16]
|
||||||
|
|
||||||
|
#### 8. Prof-GNOME
|
||||||
|
|
||||||
|
The eighth theme in this list is the Prof-GNOME theme. It is a perfect theme that calms your mind with its unique way of resting your eyes. In my opinion, if you want to renovate your GNOME desktop but still want it to look like a professional desktop with a legacy macOS look, then choose Prof-GNOME.
|
||||||
|
|
||||||
|
Moreover, it is not a fancy theme but rather a legacy theme with a modern approach to design, keeping the older macOS look alive.
|
||||||
|
|
||||||
|
To try this theme, download the files from [GitHub][17] and place them to ~/.themes after extracting.
|
||||||
|
|
||||||
|
However, a word of caution is that it’s not updated for some time.
|
||||||
|
|
||||||
|
![Prof-GNOME Theme][18]
|
||||||
|
|
||||||
|
#### 9. Whitesur
|
||||||
|
|
||||||
|
A list of GNOME themes is incomplete without a theme which makes your desktop look like macOS. Hence, as its name suggests, we present the 9th theme in this list – the popular [Whitesur theme][19]. It’s a GTK theme that helps you make your desktop look like macOS Big Sur.
|
||||||
|
|
||||||
|
Furthermore, the Whitesur theme is compatible with non-GNOME based desktop Xfce, Cinnamon, etc.
|
||||||
|
|
||||||
|
Pair it with the Plack Dock and Whitesur Icon theme for a complete macOS makeover.
|
||||||
|
|
||||||
|
[Download][20] the theme from GitHub and place the files in the ~/.themes after extracting.
|
||||||
|
|
||||||
|
![Whitesur theme for GNOME][21]
|
||||||
|
|
||||||
|
#### 10. Ant
|
||||||
|
|
||||||
|
The final theme in this list is Ant. The Ant is an exciting theme which is a little bold in its approach. It brings the Flat look and feels but with a twist of “Dracula” and “Bloody” flavour.
|
||||||
|
|
||||||
|
I must say a perfect Halloween theme, and you can download it from [here][22].
|
||||||
|
|
||||||
|
![Ant Theme for GNOME | Image Credit: Author of Ant theme][23]
|
||||||
|
|
||||||
|
### Closing Notes
|
||||||
|
|
||||||
|
I hope this list of 10 best GNOME themes of 2022 encourages your to renovate the rather mundane Ubuntu distro look or any GNOME desktop setup. In the comment box below, let me know which one is your favourite? Also, add your favourite one, which you think should be on the list.
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://www.debugpoint.com/2022/05/gnome-themes-2022/
|
||||||
|
|
||||||
|
作者:[Arindam][a]
|
||||||
|
选题:[lkxed][b]
|
||||||
|
译者:[译者ID](https://github.com/译者ID)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]: https://www.debugpoint.com/author/admin1/
|
||||||
|
[b]: https://github.com/lkxed
|
||||||
|
[1]: https://www.debugpoint.com/wp-content/uploads/2022/05/Changing-GNOME-Theme-in-Tweaks-Tool.jpg
|
||||||
|
[2]: https://github.com/jnsh/arc-theme
|
||||||
|
[3]: https://www.debugpoint.com/wp-content/uploads/2022/05/Arc-Darker-Theme-in-Ubuntu-GNOME-1.jpg
|
||||||
|
[4]: https://github.com/vinceliuice/Layan-gtk-theme/archive/refs/heads/master.zip
|
||||||
|
[5]: https://www.debugpoint.com/wp-content/uploads/2022/05/Layan-GNOME-Theme.jpg
|
||||||
|
[6]: https://www.debugpoint.com/wp-content/uploads/2022/05/Orchis-colour-options.jpg
|
||||||
|
[7]: https://github.com/vinceliuice/Orchis-theme/archive/refs/heads/master.zip
|
||||||
|
[8]: https://www.debugpoint.com/wp-content/uploads/2022/05/Orchis-GNOME-Theme.jpg
|
||||||
|
[9]: https://satya164.deviantart.com/art/Numix-GTK3-theme-360223962
|
||||||
|
[10]: https://www.debugpoint.com/wp-content/uploads/2022/05/Numix-Theme.jpg
|
||||||
|
[11]: https://github.com/adapta-project/adapta-gtk-theme
|
||||||
|
[12]: https://www.debugpoint.com/wp-content/uploads/2022/05/Adapta-Theme-follows-Android-Style.jpg
|
||||||
|
[13]: https://www.gnome-look.org/p/1242416/
|
||||||
|
[14]: https://www.debugpoint.com/wp-content/uploads/2022/05/Cloudy-GNOME-Theme.jpg
|
||||||
|
[15]: https://www.gnome-look.org/p/1267246/
|
||||||
|
[16]: https://www.debugpoint.com/wp-content/uploads/2022/05/Nord-Theme.jpg
|
||||||
|
[17]: https://github.com/paullinuxthemer/Prof-Gnome/archive/refs/heads/master.zip
|
||||||
|
[18]: https://www.debugpoint.com/wp-content/uploads/2022/05/Prof-GNOME-Theme.jpg
|
||||||
|
[19]: https://github.com/vinceliuice/WhiteSur-gtk-theme
|
||||||
|
[20]: https://github.com/vinceliuice/WhiteSur-gtk-theme
|
||||||
|
[21]: https://www.debugpoint.com/wp-content/uploads/2022/05/Whitesur-theme-for-GNOME.jpg
|
||||||
|
[22]: https://www.gnome-look.org/p/1099856/#files
|
||||||
|
[23]: https://www.debugpoint.com/wp-content/uploads/2022/05/Ant-Theme-for-GNOME.jpg
|
@ -0,0 +1,168 @@
|
|||||||
|
[#]: subject: "Compile GNOME Shell and Apps From Source [Beginner’s Guide]"
|
||||||
|
[#]: via: "https://www.debugpoint.com/2022/05/compile-gnome-source/"
|
||||||
|
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||||
|
[#]: collector: "lkxed"
|
||||||
|
[#]: translator: " "
|
||||||
|
[#]: reviewer: " "
|
||||||
|
[#]: publisher: " "
|
||||||
|
[#]: url: " "
|
||||||
|
|
||||||
|
Compile GNOME Shell and Apps From Source [Beginner’s Guide]
|
||||||
|
======
|
||||||
|
Here’s a quick guide for you on how to compile GNOME from its source, including the shell, mutter and some native apps.
|
||||||
|
|
||||||
|
Before you compile, you need to make sure certain things because the following compilation is directly from the master branch in GitLab, which contains some development packages.
|
||||||
|
|
||||||
|
In general, you can compile in any Linux distribution of your choice. But I would recommend using Fedora Rawhide which is the development branch of Fedora, for future releases.
|
||||||
|
|
||||||
|
Also, do not try this in a stable system. Because things may go wrong, you may end up with a broken system.
|
||||||
|
|
||||||
|
To summarize, you need the following to compile GNOME from the source.
|
||||||
|
|
||||||
|
* A test setup ([Virtual machine][1] or a test system)
|
||||||
|
* Fedora Rawhide Distro (recommended. [Download from here][2])
|
||||||
|
* Make sure your distro is up to date.
|
||||||
|
* And you are logged in to an X.Org session.
|
||||||
|
|
||||||
|
I would not recommend compiling in the Wayland session because you will run into problems.
|
||||||
|
|
||||||
|
### Compile GNOME from the Source
|
||||||
|
|
||||||
|
The GNOME desktop is a collection of packages based on their functions. The desktop component of a Linux distribution works under a window manager and shell.
|
||||||
|
|
||||||
|
So for GNOME, I will first compile mutter – the window manager for GNOME Shell. And then followed by the compilation of GNOME Shell. Finally, I will compile some native apps.
|
||||||
|
|
||||||
|
I will use the meson build system for compilation. The meson is a beautiful build system which is fast and user friendly.
|
||||||
|
|
||||||
|
#### Compile Mutter
|
||||||
|
|
||||||
|
Open a terminal and install the required packages for GNOME Shell and mutter.
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo dnf build-dep mutter gnome-shell
|
||||||
|
```
|
||||||
|
|
||||||
|
Create a demo directory in your home drive (or anywhere you want).
|
||||||
|
|
||||||
|
```
|
||||||
|
cd ~
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
mkdir demo
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
cd demo
|
||||||
|
```
|
||||||
|
|
||||||
|
Clone the mutter master branch from GitLab.
|
||||||
|
|
||||||
|
git clone https://gitlab.gnome.org/GNOME/mutter
|
||||||
|
|
||||||
|
Go to the cloning directory and use the below meson command to prepare the build files. By default, meson uses `/usr/local` for building files. However, you can also use prefix switch to redirect the output to a specific folder (shown below).
|
||||||
|
|
||||||
|
```
|
||||||
|
cd mutter
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
meson _build --prefix=/usr
|
||||||
|
```
|
||||||
|
|
||||||
|
![Compile Mutter for GNOME][3]
|
||||||
|
|
||||||
|
Install mutter in your system when the build is complete using the below command.
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo ninja install -C _build
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Compile GNOME Shell
|
||||||
|
|
||||||
|
The compilation of GNOME Shell and other packages are similar. First, clone the GNOME Shell master repository from GitLab, then build and install. You can follow the below commands in sequence.
|
||||||
|
|
||||||
|
There are two dependencies which you need for GNOME Shell. They are [asciidoc][4] and [sassc][5]. Install them before you build GNOME Shell.
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo dnf install asciidoc
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo dnf install sassc
|
||||||
|
```
|
||||||
|
|
||||||
|
After installing these dependencies, follow the below commands to build and install GNOME Shell. Make sure you go back to the `demo` folder (which I created in the first step) before running this command.
|
||||||
|
|
||||||
|
```
|
||||||
|
git clone https://gitlab.gnome.org/GNOME/gnome-shellcd gnome-shellmeson _build --prefix=/usrsudo ninja install -C _build
|
||||||
|
```
|
||||||
|
|
||||||
|
### Running the GNOME Shell
|
||||||
|
|
||||||
|
After you finish compiling, you can try restarting the GNOME Shell to see the changes from the master branch.
|
||||||
|
|
||||||
|
Before you restart, as I mentioned earlier, make sure you are in the X.Org session. Press `ALT+F2` and type `r`. Then press enter. This command will restart GNOME Shell.
|
||||||
|
|
||||||
|
![Restart GNOME Shell (X11)][6]
|
||||||
|
|
||||||
|
And congratulations! You have successfully compiled GNOME Shell and Mutter.
|
||||||
|
|
||||||
|
Now, it’s time to compile some sample GNOME native applications.
|
||||||
|
|
||||||
|
### Compile GNOME Native Applications
|
||||||
|
|
||||||
|
The steps are the same for all sources of GNOME or any applications. You need to change the repo name. So, here are some sample commands to compile necessary GNOME native apps.
|
||||||
|
|
||||||
|
#### Files (Nautilus)
|
||||||
|
|
||||||
|
```
|
||||||
|
git clone https://gitlab.gnome.org/GNOME/nautilus/cd gnome-shellmeson _build --prefix=/usrsudo ninja install -C _build
|
||||||
|
```
|
||||||
|
|
||||||
|
#### GNOME Software
|
||||||
|
|
||||||
|
```
|
||||||
|
git clone https://gitlab.gnome.org/GNOME/gnome-software/cd gnome-shellmeson _build --prefix=/usrsudo ninja install -C _build
|
||||||
|
```
|
||||||
|
|
||||||
|
#### GNOME Control Center
|
||||||
|
|
||||||
|
```
|
||||||
|
git clone https://gitlab.gnome.org/GNOME/gnome-control-center/cd gnome-shellmeson _build --prefix=/usrsudo ninja install -C _build
|
||||||
|
```
|
||||||
|
|
||||||
|
### FAQ
|
||||||
|
|
||||||
|
1. Using the above steps, you can compile any source branch. Not only GNOME.
|
||||||
|
2. The GitLab server is sometimes slow, and it may take a longer time to clone a repo. If the `git clone` fails, I would recommend you to try again.
|
||||||
|
|
||||||
|
### Closing Notes
|
||||||
|
|
||||||
|
I hope this little advanced tutorial helps you try out new GNOME features before they land in GNOME nightly OS. Since you compiled, you may also contribute to testing new GNOME features and report any bugs or problems on the GitLab Issues page for specific packages.
|
||||||
|
|
||||||
|
This article is the first instalment of the open-source app compilation series. Stay tuned for more compilation articles of more open-source apps.
|
||||||
|
|
||||||
|
Also, do let me know your comments, suggestions, or any error you faced using these instructions in the comment box.
|
||||||
|
|
||||||
|
Cheers.
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://www.debugpoint.com/2022/05/compile-gnome-source/
|
||||||
|
|
||||||
|
作者:[Arindam][a]
|
||||||
|
选题:[lkxed][b]
|
||||||
|
译者:[译者ID](https://github.com/译者ID)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]: https://www.debugpoint.com/author/admin1/
|
||||||
|
[b]: https://github.com/lkxed
|
||||||
|
[1]: https://www.debugpoint.com/tag/virtual-machine
|
||||||
|
[2]: https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Workstation/x86_64/iso/
|
||||||
|
[3]: https://www.debugpoint.com/wp-content/uploads/2022/05/Compile-Mutter-for-GNOME.jpg
|
||||||
|
[4]: https://asciidoc.org/
|
||||||
|
[5]: https://github.com/sass/sassc
|
||||||
|
[6]: https://www.debugpoint.com/wp-content/uploads/2022/05/Restart-GNOME-Shell-X11.jpg
|
@ -1,48 +0,0 @@
|
|||||||
[#]: subject: "Google To Start Distributing A Collection Of Open Source Software libraries"
|
|
||||||
[#]: via: "https://www.opensourceforu.com/2022/05/google-to-start-distributing-a-collection-of-open-source-software-libraries/"
|
|
||||||
[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/"
|
|
||||||
[#]: collector: "lkxed"
|
|
||||||
[#]: translator: "beamrolling"
|
|
||||||
[#]: reviewer: " "
|
|
||||||
[#]: publisher: " "
|
|
||||||
[#]: url: " "
|
|
||||||
|
|
||||||
Google To Start Distributing A Collection Of Open Source Software libraries谷歌开始分发一系列开源软件库
|
|
||||||
======
|
|
||||||
![][1]
|
|
||||||
|
|
||||||
On Tuesday, Google unveiled a new program aimed at safeguarding the open-source software supply chain by curating and delivering a security-vetted selection of open source packages to Google Cloud users. The business announced the new service, dubbed Assured Open Source Software, in a blog [post][2]. Andy Chang, Google Cloud’s group product manager for security and privacy, highlighted some of the problems of safeguarding open source software and emphasised Google’s commitment to open source in his blog post.
|
|
||||||
5 月 17 日,谷歌推出了一项新计划,该计划向谷歌云用户策划并提供经过安全审查的开源包选项,以保护开源软件供应链。该公司在一篇[博文][2]中宣布了这项名为 Assured Open Source Software 的新服务。在博文中,谷歌云安全和隐私部门产品经理 Andy Chang 强调了保障开源软件的一些问题,并强调了谷歌对开源的承诺。
|
|
||||||
|
|
||||||
“There has been an increasing awareness in the developer community, enterprises, and governments of software supply chain risks,” Chang wrote, citing last year’s major log4j vulnerability as an example. “Google continues to be one of the largest maintainers, contributors, and users of open source and is deeply involved in helping make the open source software ecosystem more secure.”
|
|
||||||
“开发者社区、企业及政府对软件供应链风险的意识越来越强,”Chang 写道,并以去年的 log4j 重大漏洞为例。“谷歌仍是开源代码最大的维护者、贡献者和使用者之一,并深入参与了帮助开源软件生态系统更加安全的工作。”
|
|
||||||
|
|
||||||
According to Google, the Assured Open Source Software service will give Cloud clients access to Google’s substantial software auditing knowledge. According to Google, all open source packages made available through the service are also used internally by the corporation and are inspected and analysed for vulnerabilities on a regular basis.
|
|
||||||
据谷歌称,Assured Open Source Software 服务将让云客户能够访问谷歌的大量软件审计知识。另据其称,所有通过该服务提供的开源软件包也在公司内部使用,公司会定期检查和分析其漏洞。
|
|
||||||
|
|
||||||
A list of the 550 important open source libraries that Google is currently reviewing is available on [GitHub][3]. While these libraries may all be downloaded independently of Google, the Assured OSS program will see audited versions provided through Google Cloud, preventing developers from corrupting widely used open source libraries. This service is now in early access phase and will be ready for wider consumer testing in Q3 2022.
|
|
||||||
谷歌目前正在审核的 550 个重要开源库的清单可以在[GitHub][3]上找到。虽然这些库都可以独立于谷歌下载,但该计划将呈现通过谷歌云提供的审核版本,防止开发者破坏广泛使用的开放源码库。这项服务现在处于预先体验阶段,将在 2022 年第三季度准备好进行更广泛的消费者测试。
|
|
||||||
|
|
||||||
|
|
||||||
The Google statement is part of a broader industry effort to strengthen the security of the open source software supply chain, which has the support of the Biden administration. In January, representatives from the Department of Homeland Security and the Cybersecurity and Infrastructure Security Agency met with executives from some of the country’s major IT companies to examine open-source software security in the wake of the log4j bug. Since then, the corporations involved have pledged more than $30 million in financing to improve open source software security during a recent summit.
|
|
||||||
谷歌的声明只是广大行业努力加强开源软件供应链的安全的一部分,这份努力得到了拜登政府的支持。今年 1 月,国土安全部和网络安全与基础设施安全局的代表与美国一些主要 IT 公司的高管会面,研究 log4j 漏洞之后的开源软件安全问题。此后,有关公司在最近的一次峰会上承诺提供超过 3000 万美元的资金,以改善开源软件的安全问题。
|
|
||||||
|
|
||||||
In addition to cash, Google is devoting engineering time to ensuring the supply chain’s security. The corporation has announced the development of a “Open Source Maintenance Crew” that will collaborate with library maintainers to improve security.
|
|
||||||
除了现金,谷歌还在投入工程时间来确保供应链的安全。该公司已宣布发展“开源维护小组”,该团队将与库维护人员合作以提高安全性。
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: https://www.opensourceforu.com/2022/05/google-to-start-distributing-a-collection-of-open-source-software-libraries/
|
|
||||||
|
|
||||||
作者:[Laveesh Kocher][a]
|
|
||||||
选题:[lkxed][b]
|
|
||||||
译者:[beamrolling](https://github.com/beamrolling)
|
|
||||||
校对:[校对者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/05/google3-1-e1652863988525.jpg
|
|
||||||
[2]: https://cloud.google.com/blog/products/identity-security/introducing-assured-open-source-software-service
|
|
||||||
[3]: https://github.com/google/oss-fuzz/tree/master/projects
|
|
@ -0,0 +1,63 @@
|
|||||||
|
[#]: subject: "Woah! Broadcom Could Acquire VMware for $60 Billion"
|
||||||
|
[#]: via: "https://news.itsfoss.com/broadcom-vmware-deal/"
|
||||||
|
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
||||||
|
[#]: collector: "lkxed"
|
||||||
|
[#]: translator: "lkxed"
|
||||||
|
[#]: reviewer: " "
|
||||||
|
[#]: publisher: " "
|
||||||
|
[#]: url: " "
|
||||||
|
|
||||||
|
震惊!博通或以 600 亿美元收购 VMware
|
||||||
|
======
|
||||||
|
Broadcom’s interested to acquire VMware for $60 billion, making it one of the biggest tech deals in 2022.
|
||||||
|
博通有意以 600 亿美元收购 VMware,这或将成为 2022 年最大的科技交易之一。
|
||||||
|
|
||||||
|
![博通][1]
|
||||||
|
|
||||||
|
<ruby>博通<rt>Broadcom</rt></ruby> 是一家半导体芯片公司,其无线适配器/无线网卡和驱动程序的不兼容问题,使得它在桌面 Linux 用户中臭名昭著。
|
||||||
|
|
||||||
|
现在,它正计划通过收购业内最大的参与者之一,也就是 **VMware**,来进入云计算市场。
|
||||||
|
|
||||||
|
VMware 不是一家开源公司,但它为其虚拟化软件提供了一些开源工具和 Linux 支持。
|
||||||
|
|
||||||
|
据 **《华尔街日报》** [报道][2],博通和 VMware 可能会在本周四(5 月 26 日)的晚些时候宣布此次收购。(LCTT 译注:抱歉,我们来晚了……)
|
||||||
|
|
||||||
|
### 博通进军云计算市场
|
||||||
|
|
||||||
|
当谈到无线网络芯片及其驱动程序时,[博通][3] 应该是一个 Linux 用户熟悉的名称。
|
||||||
|
|
||||||
|
现在,若能以 600 亿美元交易收购 [VMware][4],他们就可以借助 VMware 在云计算领域的影响力,来扩大自身在该行业的影响力。
|
||||||
|
|
||||||
|
因此,他们的决定也会影响有关博通收购的讨论。
|
||||||
|
|
||||||
|
可以肯定地说,如果讨论的意见不一,这笔交易就不一定能继续进行下去了。
|
||||||
|
|
||||||
|
为了能够成功支付(这笔巨款),该报告还提到博通计划接受银行提供的 400 亿美元的债务帮助。
|
||||||
|
|
||||||
|
考虑到该报告提到最终价格仍有待讨论,600 亿美元的价值可能会发生变化(但不会太大)。(LCTT 译注:最新的数字是 610 亿美元,该收购预计要到 2023 年才能完成。)
|
||||||
|
|
||||||
|
### 说在最后
|
||||||
|
|
||||||
|
如果你有兴趣踏入股市,(这段时间)你可以关注一下 VMware 的股票和博通公司(的动态)。
|
||||||
|
|
||||||
|
你怎么看待博通收购 VMware 这件事呢?你认为它最后的结局会是戴尔成为公司的大股东吗?(LCTT 译注:这里的关系有点复杂,简单来说,VMware 曾经是 EMC 的子公司,后来戴尔收购了 EMC,再后来 VMware 独立。)
|
||||||
|
|
||||||
|
有任何想法,都请在下面的评论中分享吧!
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://news.itsfoss.com/broadcom-vmware-deal/
|
||||||
|
|
||||||
|
作者:[Ankush Das][a]
|
||||||
|
选题:[lkxed][b]
|
||||||
|
译者:[lkxed](https://github.com/lkxed)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]: https://news.itsfoss.com/author/ankush/
|
||||||
|
[b]: https://github.com/lkxed
|
||||||
|
[1]: https://news.itsfoss.com/wp-content/uploads/2022/05/broadcom-vmware-acquisition.jpg
|
||||||
|
[2]: https://www.wsj.com/articles/broadcom-discussing-paying-around-140-a-share-for-vmware-people-say-11653334946
|
||||||
|
[3]: https://www.broadcom.com/
|
||||||
|
[4]: https://www.vmware.com/i
|
@ -0,0 +1,91 @@
|
|||||||
|
[#]: subject: "ProtonMail is Now Just ‘Proton’ Offering a Privacy Ecosystem"
|
||||||
|
[#]: via: "https://news.itsfoss.com/protonmail-now-proton/"
|
||||||
|
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
||||||
|
[#]: collector: "lkxed"
|
||||||
|
[#]: translator: "lkxed"
|
||||||
|
[#]: reviewer: " "
|
||||||
|
[#]: publisher: " "
|
||||||
|
[#]: url: " "
|
||||||
|
|
||||||
|
ProtonMail 改名为 “Proton”,致力于提供一个隐私生态系统
|
||||||
|
======
|
||||||
|
ProtonMail 宣布了重塑后的品牌,包括新网站、新名称、新的定价计划、新的 UI 和其他变化。
|
||||||
|
|
||||||
|
![proton][1]
|
||||||
|
|
||||||
|
[ProtonMail][2] 将自己重新命名为 ”Proton”,以将其所有产品囊括在统一的品牌下。
|
||||||
|
|
||||||
|
注意,别把它和 Steam 的 Proton(它也简称为 Proton)混淆哦!
|
||||||
|
|
||||||
|
换句话说,ProtonMail、ProtonVPN 和它的任何服务将不再有单独的产品页面。
|
||||||
|
|
||||||
|
### Proton:一个开源隐私生态系统
|
||||||
|
|
||||||
|
![更新后的 Proton,统一保护][3]
|
||||||
|
|
||||||
|
Proton 将拥有一个新的统一平台(新网站),您可以在其中访问所有服务,包括:
|
||||||
|
|
||||||
|
* Proton 邮件
|
||||||
|
* Proton VPN
|
||||||
|
* Proton 网盘
|
||||||
|
* Proton 日历
|
||||||
|
|
||||||
|
现在,新的登录会话将会被重定向到 **proton.me** 而不是 **protonmail.com/mail.protonmail.com/protonvpn.com** 等等。
|
||||||
|
|
||||||
|
不仅限于名称/品牌,整体的强调色和现有的用户体验,也将受到影响。
|
||||||
|
|
||||||
|
![][4]
|
||||||
|
|
||||||
|
现在,你只需一次付费订阅即可获得全部服务,而不必单独升级 VPN 和邮件。这也意味着,经过这次改变,高级订阅的价格变得更加实惠了。
|
||||||
|
|
||||||
|
![][5]
|
||||||
|
|
||||||
|
总体而言,让 “Proton” 成为隐私生态系统,是为了吸引更多对技术细节不感兴趣的用户来了解它是如何运作的。
|
||||||
|
|
||||||
|
你可以在其新的官方网站([proton.me][6])上查看所有详细信息。
|
||||||
|
|
||||||
|
新网站看起来更干净、更有条理,并且更具商业吸引力。
|
||||||
|
|
||||||
|
### 本次更改的内容
|
||||||
|
|
||||||
|
你可以期待有一个焕然一新的用户界面,包括新的品牌和新的网站。
|
||||||
|
|
||||||
|
![proton][7]
|
||||||
|
|
||||||
|
除此之外,Proton 还提到它改进了服务之间的集成,以获得更好的用户体验。
|
||||||
|
|
||||||
|
![][8]
|
||||||
|
|
||||||
|
如果你已经在使用 ProtonMail,你可能知道,他们正在主动建议现有用户激活 “**@proton.me**” 帐户,这也是本次更改的一部分。
|
||||||
|
|
||||||
|
你可以选择将新电子邮件地址 **xyz@proton.me** 设为默认值,它更短,看起来也更有意义一些。
|
||||||
|
|
||||||
|
* 旧的电子邮件地址不会消失,只是额外提供了新地址(@proton.me)。
|
||||||
|
* 现有的付费订阅者应该可以免费获得存储空间提升。
|
||||||
|
* 升级了网页和移动应用中的用户体验。
|
||||||
|
* 新的官方网站(你将被自动重定向到它以进行新会话)。
|
||||||
|
* 新的定价计划,为 Proton 网盘提供更多存储空间。
|
||||||
|
|
||||||
|
你对本次变更感兴趣吗?你喜欢 Proton 的新名字和新的服务方式吗?请在下方评论中分享你的想法吧!
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://news.itsfoss.com/protonmail-now-proton/
|
||||||
|
|
||||||
|
作者:[Ankush Das][a]
|
||||||
|
选题:[lkxed][b]
|
||||||
|
译者:[lkxed](https://github.com/lkxed)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]: https://news.itsfoss.com/author/ankush/
|
||||||
|
[b]: https://github.com/lkxed
|
||||||
|
[1]: https://news.itsfoss.com/wp-content/uploads/2022/05/proton-ft.jpg
|
||||||
|
[2]: https://itsfoss.com/recommends/protonmai
|
||||||
|
[3]: https://youtu.be/s5GNTQ63HJE
|
||||||
|
[4]: https://news.itsfoss.com/wp-content/uploads/2022/05/proton-ui-new-1024x447.jpg
|
||||||
|
[5]: https://news.itsfoss.com/wp-content/uploads/2022/05/proton-pricing-1024x494.jpg
|
||||||
|
[6]: https://proton.me/
|
||||||
|
[7]: https://news.itsfoss.com/wp-content/uploads/2022/05/Proton-me-website.png
|
||||||
|
[8]: https://news.itsfoss.com/wp-content/uploads/2022/05/Proton-Product.png
|
@ -0,0 +1,216 @@
|
|||||||
|
[#]: subject: "An introduction to Go arrays and slices"
|
||||||
|
[#]: via: "https://opensource.com/article/18/7/introduction-go-arrays-and-slices"
|
||||||
|
[#]: author: "Mihalis Tsoukalos https://opensource.com/users/mtsouk"
|
||||||
|
[#]: collector: "lkxed"
|
||||||
|
[#]: translator: "lkxed"
|
||||||
|
[#]: reviewer: " "
|
||||||
|
[#]: publisher: " "
|
||||||
|
[#]: url: " "
|
||||||
|
|
||||||
|
Go 数组和切片的介绍
|
||||||
|
======
|
||||||
|
了解使用数组和切片在 Go 中存储数据的优缺点,以及为什么其中一个比另一个更好。
|
||||||
|
|
||||||
|
![][1]
|
||||||
|
|
||||||
|
图源:carrotmadman6,经 Opensource.com 修改,CC BY-SA 2.0
|
||||||
|
|
||||||
|
在本系列的第四篇文章中,我将解释 [Go][5] 数组和切片,包括如何使用它们,以及为什么你通常要选择其中一个而不是另一个。
|
||||||
|
|
||||||
|
### 数组
|
||||||
|
|
||||||
|
数组是编程语言中最流行的数据结构之一,主要原因有两个:一是简单易懂,二是可以存储许多不同类型的数据。
|
||||||
|
|
||||||
|
你可以声明一个名为 `anArray` 的 Go 数组,该数组存储四个整数,如下所示:
|
||||||
|
|
||||||
|
```
|
||||||
|
anArray := [4]int{-1, 2, 0, -4}
|
||||||
|
```
|
||||||
|
数组的大小应该在它的类型之前声明,而类型应该在声明元素之前定义。`len()` 函数可以帮助你得到任何数组的长度。上面数组的大小是 4。
|
||||||
|
|
||||||
|
如果你熟悉其他编程语言,你可能会尝试使用 `for` 循环来遍历数组。Go 当然也支持 `for` 循环,不过,正如你将在下面看到的,Go 的 `range` 关键字可以让你更优雅地遍历数组或切片。
|
||||||
|
|
||||||
|
最后,你也可以定义一个二维数组,如下:
|
||||||
|
|
||||||
|
```
|
||||||
|
twoD := [3][3]int{
|
||||||
|
{1, 2, 3},
|
||||||
|
{6, 7, 8},
|
||||||
|
{10, 11, 12}}
|
||||||
|
```
|
||||||
|
|
||||||
|
The `arrays.go` source file explains the use of Go arrays. The most important code in `arrays.go` is:
|
||||||
|
`arrays.go` 源文件中包含了 Go 数组的示例代码。其中最重要的部分是:
|
||||||
|
|
||||||
|
```
|
||||||
|
for i := 0; i < len(twoD); i++ {
|
||||||
|
k := twoD[i]
|
||||||
|
for j := 0; j < len(k); j++ {
|
||||||
|
fmt.Print(k[j], " ")
|
||||||
|
}
|
||||||
|
fmt.Println()
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, a := range twoD {
|
||||||
|
for _, j := range a {
|
||||||
|
fmt.Print(j, " ")
|
||||||
|
}
|
||||||
|
fmt.Println()
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
通过上述代码,我们知道了如何使用 `for` 循环和 `range` 关键字迭代数组的元素。`arrays.go` 的其余代码则展示了如何将数组作为参数传递给函数。
|
||||||
|
|
||||||
|
以下是 `arrays.go` 的输出:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ go run arrays.go
|
||||||
|
Before change(): [-1 2 0 -4]
|
||||||
|
After change(): [-1 2 0 -4]
|
||||||
|
1 2 3
|
||||||
|
6 7 8
|
||||||
|
10 11 12
|
||||||
|
1 2 3
|
||||||
|
6 7 8
|
||||||
|
10 11 12
|
||||||
|
```
|
||||||
|
|
||||||
|
这个输出告诉我们:对函数内的数组所做的更改,会在函数退出后丢失。
|
||||||
|
|
||||||
|
### 数组的缺点
|
||||||
|
|
||||||
|
Go 数组有很多缺点,你应该重新考虑是否要在 Go 项目中使用它们。
|
||||||
|
|
||||||
|
首先,数组定义之后,大小就无法改变,这意味着 Go 数组不是动态的。简而言之,如果你需要将一个元素添加到一个没有剩余空间的数组中,你将需要创建一个更大的数组,并将旧数组的所有元素复制到新数组中。
|
||||||
|
|
||||||
|
其次,当你将数组作为参数传递给函数时,实际上是传递了数组的副本,这意味着你对函数内部的数组所做的任何更改,都将在函数退出后丢失。
|
||||||
|
|
||||||
|
最后,将大数组传递给函数可能会很慢,主要是因为 Go 必须创建数组的副本。
|
||||||
|
|
||||||
|
以上这些问题的解决方案,就是使用 Go 切片。
|
||||||
|
|
||||||
|
### 切片
|
||||||
|
|
||||||
|
Go 切片与 Go 数组类似,但是它没有后者的缺点。
|
||||||
|
|
||||||
|
首先,你可以使用 `append()` 函数将元素添加到现有切片中。此外,Go 切片在内部使用数组实现,这意味着 Go 中每个切片都有一个底层数组。
|
||||||
|
|
||||||
|
切片具有 `capacity` 属性和 `length` 属性,它们并不总是相同的。切片的长度与元素个数相同的数组的长度相同,可以使用 `len()` 函数得到。切片的容量是当前为切片分配的空间,可以使用 `cap()` 函数得到。
|
||||||
|
|
||||||
|
由于切片的大小是动态的,如果切片空间不足(也就是说,当你尝试再向切片中添加一个元素时,底层数组的长度恰好与容量相等),Go 会自动将它的当前容量加倍,使其空间能够容纳更多元素,然后将请求的元素添加到底层数组中。
|
||||||
|
|
||||||
|
此外,切片是通过引用传递给函数的,这意味着实际传递给函数的是切片变量的内存地址,这样一来,你对函数内部的切片所做的任何修改,都不会在函数退出后丢失。因此,将大切片传递给函数,要比将具有相同数量元素的数组传递给同一函数快得多。这是因为 Go 不必拷贝切片 —— 它只需传递切片变量的内存地址。
|
||||||
|
|
||||||
|
Go slices are illustrated in `slice.go`, which contains the following code:
|
||||||
|
`slice.go` 源文件中有 Go 切片的代码示例,其中包含以下代码:
|
||||||
|
|
||||||
|
```
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
func negative(x []int) {
|
||||||
|
for i, k := range x {
|
||||||
|
x[i] = -k
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func printSlice(x []int) {
|
||||||
|
for _, number := range x {
|
||||||
|
fmt.Printf("%d ", number)
|
||||||
|
}
|
||||||
|
fmt.Println()
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
s := []int{0, 14, 5, 0, 7, 19}
|
||||||
|
printSlice(s)
|
||||||
|
negative(s)
|
||||||
|
printSlice(s)
|
||||||
|
|
||||||
|
fmt.Printf("Before. Cap: %d, length: %d\n", cap(s), len(s))
|
||||||
|
s = append(s, -100)
|
||||||
|
fmt.Printf("After. Cap: %d, length: %d\n", cap(s), len(s))
|
||||||
|
printSlice(s)
|
||||||
|
|
||||||
|
anotherSlice := make([]int, 4)
|
||||||
|
fmt.Printf("A new slice with 4 elements: ")
|
||||||
|
printSlice(anotherSlice)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
切片和数组在定义方式上的最大区别就在于:你不需要指定切片的大小。实际上,切片的大小取决于你要放入其中的元素数量。此外,`append()` 函数允许你将元素添加到现有切片 —— 请注意,即使切片的容量允许你将元素添加到该切片,它的长度也不会被修改,除非你调用 `append ()`。上述代码中的 `printSlice()` 函数是一个辅助函数,用于打印切片中的所有元素,而 `negative()` 函数将切片中的每个元素都变为各自的相反数。
|
||||||
|
|
||||||
|
运行 `slice.go` 将得到以下输出:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ go run slice.go
|
||||||
|
0 14 5 0 7 19
|
||||||
|
0 -14 -5 0 -7 -19
|
||||||
|
Before. Cap: 6, length: 6
|
||||||
|
After. Cap: 12, length: 7
|
||||||
|
0 -14 -5 0 -7 -19 -100
|
||||||
|
A new slice with 4 elements: 0 0 0 0
|
||||||
|
```
|
||||||
|
|
||||||
|
请注意,当你创建一个新切片,并为给定数量的元素分配内存空间时,Go 会自动地将所有元素都初始化为其类型的零值,在本例中为 0(`int` 类型的零值)。
|
||||||
|
|
||||||
|
### 使用切片来引用数组
|
||||||
|
|
||||||
|
Go 允许你使用 `[:]` 语法,使用切片来引用现有的数组。在这种情况下,你对切片所做的任何更改都将传播到数组中 —— 详见 `refArray.go`。请记住,使用 `[:]` 不会创建数组的副本,它只是对数组的引用。
|
||||||
|
|
||||||
|
`refArray.go` 中最有趣的部分是:
|
||||||
|
|
||||||
|
```
|
||||||
|
func main() {
|
||||||
|
anArray := [5]int{-1, 2, -3, 4, -5}
|
||||||
|
refAnArray := anArray[:]
|
||||||
|
|
||||||
|
fmt.Println("Array:", anArray)
|
||||||
|
printSlice(refAnArray)
|
||||||
|
negative(refAnArray)
|
||||||
|
fmt.Println("Array:", anArray)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
运行 `refArray.go`,输出如下:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ go run refArray.go
|
||||||
|
Array: [-1 2 -3 4 -5]
|
||||||
|
-1 2 -3 4 -5
|
||||||
|
Array: [1 -2 3 -4 5]
|
||||||
|
```
|
||||||
|
|
||||||
|
我们可以发现:对 `anArray` 数组的切片引用进行了操作后,它本身也被改变了。
|
||||||
|
|
||||||
|
### 总结
|
||||||
|
|
||||||
|
尽管 Go 提供了数组和切片两种类型,你很可能还是会使用切片,因为它们比 Go 数组更加通用、强大。只有少数情况需要使用数组而不是切片,特别是当你完全确定元素的数量固定不变时。
|
||||||
|
|
||||||
|
你可以在 [GitHub][6] 上找到 `arrays.go`、`slice.go` 和 `refArray.go` 的源代码。
|
||||||
|
|
||||||
|
如果您有任何问题或反馈,请在下方发表评论或在 [Twitter][7] 上与我联系。
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://opensource.com/article/18/7/introduction-go-arrays-and-slices
|
||||||
|
|
||||||
|
作者:[Mihalis Tsoukalos][a]
|
||||||
|
选题:[lkxed][b]
|
||||||
|
译者:[lkxed](https://github.com/lkxed)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]: https://opensource.com/users/mtsouk
|
||||||
|
[b]: https://github.com/lkxed
|
||||||
|
[1]: https://opensource.com/sites/default/files/lead-images/traffic-light-go.png
|
||||||
|
[2]: https://opensource.com/article/18/5/creating-random-secure-passwords-go
|
||||||
|
[3]: https://opensource.com/article/18/5/building-concurrent-tcp-server-go
|
||||||
|
[4]: https://opensource.com/article/18/6/copying-files-go
|
||||||
|
[5]: https://golang.org/
|
||||||
|
[6]: https://github.com/mactsouk/opensource.com
|
||||||
|
[7]: https://twitter.com/mactsouk
|
@ -0,0 +1,199 @@
|
|||||||
|
[#]: collector: (lujun9972)
|
||||||
|
[#]: translator: (FYJNEVERFOLLOWS )
|
||||||
|
[#]: reviewer: ( )
|
||||||
|
[#]: publisher: ( )
|
||||||
|
[#]: url: ( )
|
||||||
|
[#]: subject: (Learn awk by coding a "guess the number" game)
|
||||||
|
[#]: via: (https://opensource.com/article/21/1/learn-awk)
|
||||||
|
[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen)
|
||||||
|
|
||||||
|
编写一个“猜数”游戏的程序来学习 awk
|
||||||
|
======
|
||||||
|
编程语言往往具有许多共同特征。学习一门新语言的好方法是去写一个熟悉的程序。在本文中,我将会使用 awk 编写一个“猜数”程序来展示熟悉的概念。
|
||||||
|
|
||||||
|
![question mark in chalk][1]
|
||||||
|
|
||||||
|
当你学习一门新的编程语言时,最好把重点放在大多数编程语言都有的共同点上:
|
||||||
|
* 变量 —— 存储信息的地方
|
||||||
|
* 表达式 —— 计算的方法
|
||||||
|
* 语句 —— 在程序中表示状态变化的方法
|
||||||
|
|
||||||
|
|
||||||
|
这些概念是大多是编程语言的基础。
|
||||||
|
|
||||||
|
一旦你理解了这些概念,你就可以开始把其他的弄清楚。例如,大多数语言都有得到其设计支持的“处理方式”,这些方式在不同语言之间可能有很大的不同。这些方法包括模块化(将相关功能分组在一起)、声明性与命令性、面向对象、低级与高级语法特性等等。许多程序员熟悉的一个例子是“仪式”,即,在处理问题之前设置场景所需的工作量。据说 Java 编程语言有一个重要的仪式要求,这源于它的设计,要求所有代码都在一个类中定义。
|
||||||
|
|
||||||
|
但是回到最基本的,编程语言通常有相似之处。一旦你掌握了一种编程语言,就从学习另一种语言的基本知识开始,去品味这种新语言的不同之处。
|
||||||
|
|
||||||
|
继续进行的一个好方法是创建一组基本的测试程序。有了这些,就可以从这些相似之处开始学习。
|
||||||
|
|
||||||
|
你可以选择创建的一个测试程序是“猜数字”程序。电脑从 1 到 100 之间选择一个数字,让你猜这个数字。程序一直循环,直到你猜对为止。
|
||||||
|
|
||||||
|
“猜数字”程序练习了编程语言中的几个概念:
|
||||||
|
* 变量
|
||||||
|
* 输入
|
||||||
|
* 输出
|
||||||
|
* 条件判断
|
||||||
|
* 循环
|
||||||
|
|
||||||
|
|
||||||
|
这是学习一门新的编程语言的一个很好的实践实验。
|
||||||
|
|
||||||
|
|
||||||
|
**注**:本文改编自 Moshe Zadka 关于在 [Julia][2] 中使用这种方法的文章和Jim Hall关于在 [Bash][3] 中使用这种方法的文章。
|
||||||
|
|
||||||
|
### 在 awk 程序中猜数
|
||||||
|
让我们编写一个实现“猜数字”游戏的 awk 程序。
|
||||||
|
|
||||||
|
Awk 是动态类型的,是一种面向数据转换的脚本语言,并且对交互使用有着令人惊讶的良好支持。Awk 出现于 20 世纪 70 年代,最初是 Unix 操作系统的一部分。如果你不了解 Awk,但是喜欢电子表格,可以看一下这个链接 [去学习 Awk][4]!
|
||||||
|
|
||||||
|
您可以通过编写一个版本的“猜数字”游戏来开始对 Awk 的探索。
|
||||||
|
|
||||||
|
以下是我的实现(带有行号,以便我们可以查看一些特定功能):
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
1 BEGIN {
|
||||||
|
2 srand(42)
|
||||||
|
3 randomNumber = int(rand() * 100) + 1
|
||||||
|
4 print "random number is",randomNumber
|
||||||
|
5 printf "guess a number between 1 and 100\n"
|
||||||
|
6 }
|
||||||
|
7 {
|
||||||
|
8 guess = int($0)
|
||||||
|
9 if (guess < randomNumber) {
|
||||||
|
10 printf "too low, try again:"
|
||||||
|
11 } else if (guess > randomNumber) {
|
||||||
|
12 printf "too high, try again:"
|
||||||
|
13 } else {
|
||||||
|
14 printf "that's right\n"
|
||||||
|
15 exit
|
||||||
|
16 }
|
||||||
|
17 }
|
||||||
|
```
|
||||||
|
我们可以立即看到 Awk 控制结构与 C 或 Java 的相似之处,但与 Python 不同。
|
||||||
|
在像 *if-then-else*、*while* 这样的语句中,*then*、*else* 和 *while* 部分接受一个语句或一组被 **{** 和 **}** 包围的语句。然而,Awk 有一个很大的区别需要从一开始就了解:
|
||||||
|
|
||||||
|
根据设计,Awk 是围绕数据管道构建的。
|
||||||
|
|
||||||
|
这是什么意思呢?大多数 Awk 程序都是一些代码片段,它们接收一行输入,对数据做一些处理,然后将其写入输出。认识到这种转换管道的需要,Awk 默认情况下提供了所有的转换管道。让我们通过关于上面程序的一个基本问题来探索:“从控制台读取数据”的结构在哪里?
|
||||||
|
|
||||||
|
答案是——“内置的”。特别的,第 7-17 行告诉 Awk 如何处理被读取的每一行。在这种情况下,很容易看到第 1-6 行在读取任何内容之前被执行。
|
||||||
|
|
||||||
|
更具体地说,第 1 行上的 **BEGIN** 关键字是一种“模式”,在本例中,它指示 Awk 在读取任何数据之前,应该先执行 { … } 中 **BEGIN** 后面的内容。另一个类似的关键字 **END**,在这个程序中没有被使用,它指示 Awk 在读取完所有内容后要做什么。
|
||||||
|
|
||||||
|
回到第 7-17 行,我们看到它们创建了一个类似代码块 { … } 的片段,但前面没有关键字。因为在 **{** 之前没有任何东西可以让 Awk 匹配,所以它将把这一行用于接收每一行输入。每一行的输入都将由用户输入作为猜测。
|
||||||
|
|
||||||
|
让我们看看正在执行的代码。首先,在读取任何输入之前发生的序言。
|
||||||
|
|
||||||
|
在第 2 行,我们用数字 42 初始化随机数生成器(如果不提供参数,则使用系统时钟)。为什么要用 42?[当然要选 42!][5] 第 3 行计算 1 到 100 之间的随机数,第 4 行输出该随机数以供调试使用。第 5 行邀请用户猜一个数字。注意这一行使用的是 `printf`,而不是 `print`。和 C 语言一样,`printf` 的第一个参数是一个用于格式化输出的模板。
|
||||||
|
|
||||||
|
既然用户知道程序需要输入,她就可以在控制台上键入猜测。如前所述,Awk 将这种猜测提供给第 7-17 行的代码。第 18 行将输入记录转换为整数;`$0` 表示整个输入记录,而 `$1` 表示输入记录的第一个字段,`$2` 表示第二个字段,以此类推。是的,Awk 使用预定义的分隔符(默认为空格)将输入行分割为组成字段。第 9-15 行将猜测结果与随机数进行比较,打印适当的响应。如果猜对了,第 15 行就会从输入行处理管道中提前退出。
|
||||||
|
|
||||||
|
就这么简单!
|
||||||
|
|
||||||
|
考虑到 Awk 程序不同寻常的结构,代码片段会对特定的输入行配置做出反应,并处理数据,让我们看看另一种结构,看看过滤部分是如何工作的:
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
1 BEGIN {
|
||||||
|
2 srand(42)
|
||||||
|
3 randomNumber = int(rand() * 100) + 1
|
||||||
|
4 print "random number is",randomNumber
|
||||||
|
5 printf "guess a number between 1 and 100\n"
|
||||||
|
6 }
|
||||||
|
7 int($0) < randomNumber {
|
||||||
|
8 printf "too low, try again: "
|
||||||
|
9 }
|
||||||
|
10 int($0) > randomNumber {
|
||||||
|
11 printf "too high, try again: "
|
||||||
|
12 }
|
||||||
|
13 int($0) == randomNumber {
|
||||||
|
14 printf "that's right\n"
|
||||||
|
15 exit
|
||||||
|
16 }
|
||||||
|
```
|
||||||
|
|
||||||
|
第 1–6 行代码没有改变。但是现在我们看到第 7-9 行是当输入整数值小于随机数时执行的代码,第 10-12 行是当输入整数值大于随机数时执行的代码,第 13-16 行是两者相等时执行的代码。
|
||||||
|
|
||||||
|
这看起来“很酷但很奇怪” —— 例如,为什么我们会重复计算 `int($0)`?可以肯定的是,用这种方法来解决问题会很奇怪。但这些模式确实是分离条件处理的非常好的方式,因为它们可以使用正则表达式或 Awk 支持的任何其他结构。
|
||||||
|
|
||||||
|
为了完整起见,我们可以使用这些模式将普通的计算与只适用于特定环境的计算分离开来。下面是第三个版本:
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
1 BEGIN {
|
||||||
|
2 srand(42)
|
||||||
|
3 randomNumber = int(rand() * 100) + 1
|
||||||
|
4 print "random number is",randomNumber
|
||||||
|
5 printf "guess a number between 1 and 100\n"
|
||||||
|
6 }
|
||||||
|
7 {
|
||||||
|
8 guess = int($0)
|
||||||
|
9 }
|
||||||
|
10 guess < randomNumber {
|
||||||
|
11 printf "too low, try again: "
|
||||||
|
12 }
|
||||||
|
13 guess > randomNumber {
|
||||||
|
14 printf "too high, try again: "
|
||||||
|
15 }
|
||||||
|
16 guess == randomNumber {
|
||||||
|
17 printf "that's right\n"
|
||||||
|
18 exit
|
||||||
|
19 }
|
||||||
|
```
|
||||||
|
认识到这一点,无论输入的是什么值,都需要将其转换为整数,因此我们创建了第 7-9 行来完成这一任务。现在第 10-12、13-15 和 16-19 行这三组代码,都是指已经定义好的变量 guess,而不是每次都对输入行进行转换。
|
||||||
|
|
||||||
|
让我们回到我们想要学习的东西列表:
|
||||||
|
* 变量 —— 是的,Awk 有这些;我们可以推断出,输入数据以字符串形式输入,但在需要时可以转换为数值
|
||||||
|
* 输入 —— Awk 只是通过它的“数据转换管道”的方式发送输入来读取数据
|
||||||
|
* 输出 —— 我们已经使用了 Awk 的 `print` 和 `printf` 函数来将内容写入输出
|
||||||
|
* 条件判断 —— 我们已经学习了 Awk 的 *if-then-else* 和对应特定输入行配置的输入过滤器
|
||||||
|
* 循环 —— 嗯,想象一下!我们在这里不需要循环,这还是多亏了 Awk 采用的“数据转换管道”方法;循环“就这么发生了”。注意,用户可以通过向 Awk 发送一个文件结束信号(当使用 Linux 终端窗口时可通过快捷键 **CTRL-D**)来提前退出管道。
|
||||||
|
|
||||||
|
考虑不需要循环来处理输入的重要性是非常值得的。Awk 能够长期存在的一个原因是 Awk 程序是紧凑的,而它们紧凑的一个原因是不需要从控制台或文件中读取样板文件。
|
||||||
|
|
||||||
|
让我们运行下面这个程序:
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
$ awk -f guess.awk
|
||||||
|
random number is 25
|
||||||
|
guess a number between 1 and 100: 50
|
||||||
|
too high, try again: 30
|
||||||
|
too high, try again: 10
|
||||||
|
too low, try again: 25
|
||||||
|
that's right
|
||||||
|
$
|
||||||
|
```
|
||||||
|
|
||||||
|
我们没有涉及的一件事是注释。Awk 注释以“#”开头,以行尾结束。
|
||||||
|
|
||||||
|
### 总结
|
||||||
|
|
||||||
|
Awk 非常强大,这种“猜数字”游戏是入门的好方法。但这不应该是你探索 Awk 的终点。你可以 [阅读关于 Awk 和 Gawk (GNU Awk) 的历史][6],Gawk是 Awk 的扩展版本,如果你在电脑上运行Linux,可能会有这个。或者,你可以 [阅读所有关于它最初开发者的原始版本][7]。
|
||||||
|
|
||||||
|
你还可以 [下载我们的备忘单][8] 来帮你记录下你所学的一切。
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://opensource.com/article/21/1/learn-awk
|
||||||
|
|
||||||
|
作者:[Chris Hermansen][a]
|
||||||
|
选题:[lujun9972][b]
|
||||||
|
译者:[FYJNEVERFOLLOWS](https://github.com/FYJNEVERFOLLOWS)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]: https://opensource.com/users/clhermansen
|
||||||
|
[b]: https://github.com/lujun9972
|
||||||
|
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/question-mark_chalkboard.jpg?itok=DaG4tje9 (question mark in chalk)
|
||||||
|
[2]: https://opensource.com/article/20/12/julia
|
||||||
|
[3]: https://opensource.com/article/20/12/learn-bash
|
||||||
|
[4]: https://opensource.com/article/20/9/awk-ebook
|
||||||
|
[5]: https://en.wikipedia.org/wiki/42_(number)#The_Hitchhiker's_Guide_to_the_Galaxy
|
||||||
|
[6]: https://www.gnu.org/software/gawk/manual/html_node/History.html
|
||||||
|
[7]: https://archive.org/details/pdfy-MgN0H1joIoDVoIC7
|
||||||
|
[8]: https://opensource.com/downloads/cheat-sheet-awk-features
|
@ -0,0 +1,125 @@
|
|||||||
|
[#]: subject: "How To Reset Sudo Password In Ubuntu 22.04 / 20.04 LTS"
|
||||||
|
[#]: via: "https://ostechnix.com/how-to-reset-sudo-password-in-ubuntu-20-04-lts/"
|
||||||
|
[#]: author: "sk https://ostechnix.com/author/sk/"
|
||||||
|
[#]: collector: "lkxed"
|
||||||
|
[#]: translator: "robsean"
|
||||||
|
[#]: reviewer: " "
|
||||||
|
[#]: publisher: " "
|
||||||
|
[#]: url: " "
|
||||||
|
|
||||||
|
如何在 Ubuntu 22.04 / 20.04 LTS 中重新设置 sudo 密码
|
||||||
|
======
|
||||||
|
在 Ubuntu 中重新设置已忘记的 root 用户的密码
|
||||||
|
|
||||||
|
这篇简单的指南将向你解释,如何在 Ubuntu 22.04 好 20.04 LTS 桌面环境中,以及从服务器版本中的 <ruby>恢复<rt>rescue</rt></ruby> 模式中重新设置 sudo 密码。
|
||||||
|
|
||||||
|
### 介绍
|
||||||
|
|
||||||
|
在 **[安装 Ubuntu][1]** 时,新创建的一个用户将会带有 sudo 权限,用以执行各种各样的管理任务。
|
||||||
|
|
||||||
|
如果你的 Ubuntu 系统有多个 sudo 用户,你能够从另外一个 sudo 用户的账号下,轻松地重新设置所忘记的一个 sudo 用户或管理员用户的密码。
|
||||||
|
|
||||||
|
如果你只有一个 sudo 用户,并且忘记了密码怎么办?没有问题! 从 Ubuntu 的 **<ruby>恢复<rt>rescue</rt></ruby>** 或 **<ruby>单一用户<rt>single user</rt></ruby>**** 模式中恢复 sudo 用户密码很容易。
|
||||||
|
|
||||||
|
虽然这篇指南是在 Ubuntu 22.04 和 20.04 LTS 版本上进行的正式测试,不过,下面给定的步骤对于其它的 Ubuntu 版本和衍生版本来说是相同的。
|
||||||
|
|
||||||
|
### 在 Ubuntu 22.04 / 20.04 LTS 中重新设置 sudo 密码
|
||||||
|
|
||||||
|
首先,启动你的 Ubuntu 系统到 **<ruby>恢复<rt>rescue</rt></ruby>** 模式下,来重新设置一个 sudo 用户的密码,如下面的链接所述。
|
||||||
|
|
||||||
|
> [如何启动到 Ubuntu 22.04 / 20.04 / 18.04 的 <ruby>恢复<rt>rescue</rt></ruby> 模式 或 <ruby>急救<rt>Emergency</rt></ruby> 模式 ][2]
|
||||||
|
|
||||||
|
在吗进入到 **<ruby>恢复<rt>rescue</rt></ruby>** 模式下,通过运行下面的命令,以读/写的模式挂载 root (**/**) 文件系统:
|
||||||
|
|
||||||
|
```
|
||||||
|
# mount -n -o remount,rw /
|
||||||
|
```
|
||||||
|
|
||||||
|
现在,使用 **"passwd"** 命令来重新设置 sudo 用户的密码:
|
||||||
|
|
||||||
|
```
|
||||||
|
# passwd ostechnix
|
||||||
|
```
|
||||||
|
|
||||||
|
在这里,**"ostechnix"** 是 sudo 用户的名称。 使用你自己的用户名称来替换掉它。
|
||||||
|
|
||||||
|
输入两次密码:
|
||||||
|
|
||||||
|
```
|
||||||
|
New password:
|
||||||
|
Retype new password:
|
||||||
|
passwd: password updated successfully
|
||||||
|
```
|
||||||
|
|
||||||
|
![Reset Sudo Password In Ubuntu 22.04 / 20.04 LTS][3]
|
||||||
|
|
||||||
|
就这样。我们已经重新设置 sudo 用户密码。如果你按照上面链接所述的 **方法 1** 来进入到 **<ruby>恢复<rt>rescue</rt></ruby>** 模式,按下 **“Ctrl+d”** 组合键来启动到正常模式。或者,你也可以输入下面的任意一个命令来启动到正常模式。
|
||||||
|
|
||||||
|
```
|
||||||
|
# systemctl default
|
||||||
|
```
|
||||||
|
|
||||||
|
或,
|
||||||
|
|
||||||
|
```
|
||||||
|
# exit
|
||||||
|
```
|
||||||
|
|
||||||
|
如果你想重新启动系统,而不是启动到正常模式,输入:
|
||||||
|
|
||||||
|
```
|
||||||
|
# systemctl reboot
|
||||||
|
```
|
||||||
|
|
||||||
|
如果你已经按照上面链接所述的 **方法 2** 进入到<ruby>恢复<rt>rescue</rt></ruby> 模式,输入:
|
||||||
|
|
||||||
|
```
|
||||||
|
# exit
|
||||||
|
```
|
||||||
|
|
||||||
|
你将返回到 <ruby>恢复菜单<rt>recovery menu</rt></ruby> 。 现在 "**<ruby>恢复正常启动<rt>Resume normal boot</rt></ruby>**" ,并按下 <ruby>回车<rt>ENTER</rt></ruby> 键。
|
||||||
|
|
||||||
|
![Boot Into Normal Mode In Ubuntu][4]
|
||||||
|
|
||||||
|
在强调一次,选择 <ruby>确定<rt>OK</rt></ruby> 按钮,并按下 <ruby>回车<rt>ENTER</rt></ruby> 按键来继续启动到正常模式:
|
||||||
|
|
||||||
|
![Exit Recovery Mode And Boot Into Normal Mode][5]
|
||||||
|
|
||||||
|
现在,你在运行管理命令时可以使用新的 sudo 密码。
|
||||||
|
|
||||||
|
##### 如果我把用户名称和密码都忘了怎么办?
|
||||||
|
|
||||||
|
如果你忘记了用户名称,在 <ruby>恢复<rt>rescue</rt></ruby> 模式下,你可以很容易地列出你的 Linux 系统中的用户名称,使用目录:
|
||||||
|
|
||||||
|
```
|
||||||
|
# cat etc/passwd
|
||||||
|
```
|
||||||
|
|
||||||
|
来自我 Ubuntu 22.04 系统的输出示例:
|
||||||
|
|
||||||
|
```
|
||||||
|
[...]
|
||||||
|
ostechnix:x:1000:1000:Ostechnix,,,:/home/ostechnix:/bin/bash
|
||||||
|
[...]
|
||||||
|
```
|
||||||
|
|
||||||
|
好了,现在,你找到用户名称了。只需要按照上面的步骤来重新设置用户的密码即可。
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://ostechnix.com/how-to-reset-sudo-password-in-ubuntu-20-04-lts/
|
||||||
|
|
||||||
|
作者:[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/install-ubuntu-desktop/
|
||||||
|
[2]: https://ostechnix.com/how-to-boot-into-rescue-mode-or-emergency-mode-in-ubuntu-18-04/
|
||||||
|
[3]: https://ostechnix.com/wp-content/uploads/2022/05/Reset-Sudo-Password-In-Ubuntu.png
|
||||||
|
[4]: https://ostechnix.com/wp-content/uploads/2020/05/Boot-into-normal-mode-in-Ubuntu.png
|
||||||
|
[5]: https://ostechnix.com/wp-content/uploads/2020/05/Booting-into-normal-mode-from-rescue-mode-in-Ubuntu.png
|
@ -1,129 +0,0 @@
|
|||||||
[#]: subject: "Customize GNOME 42 with A Polished Look"
|
|
||||||
[#]: via: "https://www.debugpoint.com/2022/05/customize-gnome-42-look-1/"
|
|
||||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
|
||||||
[#]: collector: "lkxed"
|
|
||||||
[#]: translator: "geekpi"
|
|
||||||
[#]: reviewer: " "
|
|
||||||
[#]: publisher: " "
|
|
||||||
[#]: url: " "
|
|
||||||
|
|
||||||
自定义 GNOME 42 的精致外观
|
|
||||||
======
|
|
||||||
一个关于如何在 5 分钟内为你最喜欢的 GNOME 桌面提供精美外观的教程。
|
|
||||||
|
|
||||||
你可以通过多种方式使用图标、主题、光标和壁纸自定义你最喜爱的 GNOME 桌面。本文向你展示了如何使 GNOME 42 桌面看起来更加精致。GNOME 42 桌面环境可用于最近发布的 Ubuntu 22.04 LTS 和 Fedora 36。
|
|
||||||
|
|
||||||
在你进一步阅读之前,这是并排比较(之前和之后)的外观。
|
|
||||||
|
|
||||||
![GNOME before customisation][1]
|
|
||||||
|
|
||||||
![GNOME after customisation][2]
|
|
||||||
|
|
||||||
我将把本教程分为两个部分。
|
|
||||||
|
|
||||||
第一部分涉及设置和安装所需的软件包。其次,如何应用各种设置来获得你想要的外观。
|
|
||||||
|
|
||||||
本教程主要在 Ubuntu 22.04 LTS 上测试。但是,它应该适用于 Ubuntu 和 Fedora 的其他变体。
|
|
||||||
|
|
||||||
### 使用精致外观自定义 GNOME 42
|
|
||||||
|
|
||||||
#### 设置
|
|
||||||
|
|
||||||
* 首先,为你的系统启用 Flatpak,因为我们需要安装扩展管理器来下载本教程所需的 GNOME Shell 扩展。
|
|
||||||
|
|
||||||
* 因此,要做到这一点,请打开一个终端并运行以下命令。
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo apt install flatpak gnome-software-plugin-flatpakflatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
|
||||||
```
|
|
||||||
|
|
||||||
* 完成后重启计算机。
|
|
||||||
|
|
||||||
* 然后从终端运行以下命令来安装扩展管理器应用以下载 GNOME Shell 扩展。
|
|
||||||
|
|
||||||
```
|
|
||||||
flatpak install flathub com.mattjakeman.ExtensionManager
|
|
||||||
```
|
|
||||||
|
|
||||||
* 打开扩展管理器应用并安装两个扩展。第一个是浮动 dock,它具有超酷的 dock,你可以在桌面上的任何位置移动。其次,安装用户主题扩展来帮助你在 Ubuntu Linux 中安装外部 GTK 主题。
|
|
||||||
|
|
||||||
![User Themes Extension][3]
|
|
||||||
|
|
||||||
![Floating Dock Extension][4]
|
|
||||||
|
|
||||||
* 其次,使用以下命令安装 [Materia 主题][5]。你必须构建它,因为它没有任何可执行文件。在 Ubuntu 中依次运行以下命令进行安装。
|
|
||||||
|
|
||||||
```
|
|
||||||
git clone https://github.com/ckissane/materia-theme-transparent.gitcd materia-theme-transparentmeson _buildmeson install -C _build
|
|
||||||
```
|
|
||||||
|
|
||||||
* 此外,请从以下链接下载 [Kora 图标主题][6]。下载后解压文件,将以下四个文件夹复制到 `/home/<用户名>/.icons` 路径下。如果 .icons 文件夹不存在,请创建它。
|
|
||||||
|
|
||||||
[下载 Kora 图标主题][7]
|
|
||||||
|
|
||||||
![Kora Icon Theme][8]
|
|
||||||
|
|
||||||
* 除了上述更改,从下面的链接下载 Bibata 光标主题。下载后,解压文件夹并将其复制到相同的 `/home/<用户名>/.icons` 文件夹中。
|
|
||||||
|
|
||||||
[下载 Bibata 光标主题][9]
|
|
||||||
|
|
||||||
* 除了上述之外,如果你想要一个与上述主题相匹配的漂亮字体,请从 Google Fonts [下载 Robot font][10] 并将它们复制到 `/home/<user name>/.fonts` 文件夹。
|
|
||||||
|
|
||||||
* 最后,再次重启系统。
|
|
||||||
|
|
||||||
#### 配置
|
|
||||||
|
|
||||||
* 打开扩展管理器,启用浮动 dock 和用户主题,并禁用 Ubuntu Dock。
|
|
||||||
|
|
||||||
![Changes to Extensions][11]
|
|
||||||
|
|
||||||
* 此外,打开浮动 dock 设置并进行以下更改。
|
|
||||||
|
|
||||||
![Floating Dock Settings][12]
|
|
||||||
|
|
||||||
* 此外,打开 [GNOME Tweak Tool][13],然后转到外观选项卡。设置以下内容。
|
|
||||||
|
|
||||||
* 光标:Bibata-Original-Ice
|
|
||||||
* Shell 主题:Materia
|
|
||||||
* 图标:Kora
|
|
||||||
|
|
||||||
* 除此之外,你可能还想更改字体。为此,请转到字体选项卡并将文档和界面更改为 Robot 10pt。
|
|
||||||
|
|
||||||
* 或者,你也可以从 Ubuntu 22.04 的默认设置中更改强调色和样式。
|
|
||||||
|
|
||||||
* 最后,根据你的喜好下载漂亮的壁纸。对于本教程,我从[这里][14]下载了一个示例壁纸。
|
|
||||||
|
|
||||||
* 如果一切顺利,你应该有一个漂亮的桌面,如下图所示。
|
|
||||||
|
|
||||||
![Customize GNOME 42 – Final Look][15]
|
|
||||||
|
|
||||||
享受精致的 GNOME 42。干杯。
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: https://www.debugpoint.com/2022/05/customize-gnome-42-look-1/
|
|
||||||
|
|
||||||
作者:[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://i2.wp.com/www.debugpoint.com/wp-content/uploads/2022/05/GNOME-before-customisation.jpg?ssl=1
|
|
||||||
[2]: https://i0.wp.com/www.debugpoint.com/wp-content/uploads/2022/05/GNOME-after-customisation.jpg?ssl=1
|
|
||||||
[3]: https://www.debugpoint.com/wp-content/uploads/2022/05/User-Themes-Extension2.jpg
|
|
||||||
[4]: https://www.debugpoint.com/wp-content/uploads/2022/05/Floating-Doc-Extension.jpg
|
|
||||||
[5]: https://github.com/ckissane/materia-theme-transparent
|
|
||||||
[6]: https://github.com/bikass/kora/
|
|
||||||
[7]: https://github.com/bikass/kora/archive/refs/heads/master.zip
|
|
||||||
[8]: https://www.debugpoint.com/wp-content/uploads/2022/05/Kora-Icon-Theme.jpg
|
|
||||||
[9]: https://www.pling.com/p/1197198/
|
|
||||||
[10]: https://fonts.google.com/specimen/Roboto
|
|
||||||
[11]: https://www.debugpoint.com/wp-content/uploads/2022/05/Changes-to-Extensions.jpg
|
|
||||||
[12]: https://www.debugpoint.com/wp-content/uploads/2022/05/Floating-Dock-Settings.jpg
|
|
||||||
[13]: https://www.debugpoint.com/2018/05/customize-your-ubuntu-desktop-using-gnome-tweak/
|
|
||||||
[14]: https://www.pexels.com/photo/colorful-blurred-image-6985048/
|
|
||||||
[15]: https://www.debugpoint.com/wp-content/uploads/2022/05/Customize-GNOME-42-Final-Look.jpg
|
|
Loading…
Reference in New Issue
Block a user