mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-03-21 02:10:11 +08:00
Merge branch 'LCTT:master' into master
This commit is contained in:
commit
8ef64c155c
@ -3,23 +3,26 @@
|
||||
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "hanszhao80"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-14806-1.html"
|
||||
|
||||
在 Linux 中用非重命名的方法隐藏文件和文件夹
|
||||
在 Linux 中隐藏文件和文件夹的那些事
|
||||
======
|
||||
简介:这篇面向初学者的文章探讨了在 Linux 中如何在普通视图中隐藏文件和文件夹。图形用户界面和命令行方法都有所涉猎。
|
||||
|
||||

|
||||
|
||||
> 这篇面向初学者的文章探讨了在 Linux 中如何在普通视图中隐藏文件和文件夹。图形用户界面和命令行方法都有所涉猎。
|
||||
|
||||
有时你需要在 Linux 中隐藏文件。
|
||||
|
||||
不要误会,我不是指那些你不想让你的家人看到的“特殊文件”。尽管你可以隐藏这些特殊文件,但更好的办法还是用密码锁定它们以提供额外的保护。
|
||||
|
||||
回到隐藏文件的话题。 **名称以 `.` 开头的任何文件或文件夹在 Linux 中是“隐藏的”。**
|
||||
回到隐藏文件的话题。**名称以 `.` 开头的任何文件或文件夹在 Linux 中是“隐藏的”。**
|
||||
|
||||
Linux 有很多这样的文件和文件夹,在普通视图中它们是隐藏的。这些主要是系统和程序所需的配置文件。
|
||||
|
||||
用户通常不需要它们,因此它们在普通视图中是隐藏的,这样一来你就不会被许多看起来很奇怪的而不是你所创建的文件所淹没。
|
||||
用户通常不需要理会它们,因此它们在普通视图中是隐藏的,这样一来你就不会被许多看起来很奇怪的而不是你所创建的文件所淹没。
|
||||
|
||||
下图展示了我的主目录中隐藏的文件和文件夹。
|
||||
|
||||
@ -27,9 +30,9 @@ Linux 有很多这样的文件和文件夹,在普通视图中它们是隐藏
|
||||
|
||||
![linux 显示隐藏文件][2]
|
||||
|
||||
如果你使用的是桌面版 Linux,你可以通过在文件管理器中按 Ctrl+H 快捷键来轻松 [查看隐藏文件][3]。在终端中,你可以使用 `ls -a` 命令显示隐藏文件和普通文件。
|
||||
如果你使用的是桌面版 Linux,你可以通过在文件管理器中按 `Ctrl+H` 快捷键来轻松 [查看隐藏文件][3]。在终端中,你可以使用 `ls -a` 命令显示隐藏文件和普通文件。
|
||||
|
||||
那么,如何在 Linux 中创建隐藏文件呢?你只需用一个在命名的时候加一个`.`前缀。就是这样。
|
||||
那么,如何在 Linux 中创建隐藏文件呢?你只需用一个在命名的时候加一个 `.` 前缀。就是这样。
|
||||
|
||||
### 在桌面版 Linux 里创建隐藏文件和文件夹(GUI 方法)
|
||||
|
||||
@ -41,9 +44,9 @@ Linux 有很多这样的文件和文件夹,在普通视图中它们是隐藏
|
||||
|
||||
你可以以相同的方式隐藏文件夹及其所有内容。
|
||||
|
||||
你可以按 Ctrl+H 键来显示隐藏文件。哦!我是多么的喜欢 [Ubuntu 中的键盘快捷键][5] 和我使用的任何其他程序或操作系统!
|
||||
你可以按 `Ctrl+H` 键来显示隐藏文件。哦!我是多么的喜欢 [Ubuntu 中的键盘快捷键][5] 和我使用的任何其他程序或操作系统!
|
||||
|
||||
要使隐藏文件变回普通文件,只需再次重命名这些文件删掉文件名前缀的`.`即可。
|
||||
要使隐藏文件变回普通文件,只需再次重命名这些文件删掉文件名前缀的 `.` 即可。
|
||||
|
||||
### 在 Linux 终端创建隐藏文件和文件夹(CLI 方法)
|
||||
|
||||
@ -65,7 +68,7 @@ ls -la
|
||||
|
||||
你刚刚学了在 Linux 中隐藏文件。问题是你必须重命名文件,而这种操作不适用于所有的场合。
|
||||
|
||||
例如,在 Ubuntu 中,你会在目录中看到一个名为“snap”的文件夹。你不会使用它,但如果重命名它,你的 snap 应用程序将无法按预期工作。类似的情况是,在 Ubuntu 22.04(安装有 snap 版本的 Firefox)的 Downloads 目录下有一个 firefox.tmp 文件夹。
|
||||
例如,在 Ubuntu 中,你会在目录中看到一个名为 `snap` 的文件夹。你不会使用它,但如果重命名它,你的 Snap 应用程序将无法按预期工作。类似的情况是,在 Ubuntu 22.04(安装有 Snap 版本的 Firefox)的 `Downloads` 目录下有一个 `firefox.tmp` 文件夹。
|
||||
|
||||
有一个巧妙的技巧可以在 Linux 桌面中使用。它应该可以在 Nemo、Thunar、Dolphin 等各种文件管理器下工作,但我不能保证。它确实适用于 GNOME 的 Nautilus 文件管理器。
|
||||
|
||||
@ -73,7 +76,7 @@ ls -la
|
||||
|
||||
![在 Linux 中隐藏文件的另一种方法][7]
|
||||
|
||||
按 Ctrl+H 显示隐藏文件并 **打开 .hidden 文件** 进行编辑。**在单独的行中添加文件或文件夹的名称**。注意不能使用绝对或相对路径。你想要隐藏的**文件和文件夹应与此特殊 .hidden 文件** 位于同一路径下。
|
||||
按 `Ctrl+H` 显示隐藏文件并 **打开 `.hidden` 文件** 进行编辑。**在单独的行中添加文件或文件夹的名称**。注意不能使用绝对或相对路径。你想要隐藏的 **文件和文件夹应与此特殊 `.hidden` 文件** 位于同一路径下。
|
||||
|
||||
这是我以不重命名的方式隐藏 `cpufetch` 目录和 `pcloud` 文件的示例:
|
||||
|
||||
@ -82,27 +85,25 @@ pcloud
|
||||
cpufetch
|
||||
```
|
||||
|
||||
按 Ctrl+H 以再次隐藏 `.hidden` 文件。
|
||||
按 `Ctrl+H` 以再次隐藏 `.hidden` 文件。
|
||||
|
||||
现在,**关闭你的文件资源管理器并重新启动它**。你将不会再看到 .hidden 文件中提到的文件和目录。
|
||||
现在,**关闭你的文件资源管理器并重新启动它**。你将不会再看到 `.hidden` 文件中提到的文件和目录。
|
||||
|
||||
如果你想再次查看它们,请按 Ctrl+H 键。
|
||||
如果你想再次查看它们,请按 `Ctrl+H` 键。
|
||||
|
||||
如果你不想再隐藏文件,请从 .hidden 文件中删除其名称或完全删除 .hidden 文件。
|
||||
如果你不想再隐藏文件,请从 `.hidden` 文件中删除其名称或完全删除 `.hidden` 文件。
|
||||
|
||||
### 额外琐事:隐藏文件“功能”实际上是一个 bug
|
||||
|
||||
你知道吗?在文件名的开头添加一个 `.` 来隐藏文件的`功能`[实际上是一个 bug][8]?
|
||||
你知道吗?在文件名的开头添加一个 `.` 来隐藏文件的“功能” [实际上是一个 bug][8]?
|
||||
|
||||
在早期的 UNIX 时代,当创建文件系统时,`.`(当前目录)和 `..`(父目录)文件被添加以方便导航。
|
||||
在早期的 UNIX 时代,当创建文件系统时,添加了 `.`(当前目录)和 `..`(父目录)文件以方便导航。
|
||||
|
||||
由于这些特殊的 `.` 和 `..` 文件中没有实际数据,因此给 `ls` 命令添加了一个新的“功能”。
|
||||
由于这些特殊的 `.` 和 `..` 文件中没有实际数据,因此给 `ls` 命令添加了一个新的“功能”:该功能是检查文件名的第一个字符,如果它是一个点(`.`),则不再使用 `ls` 命令显示它。
|
||||
|
||||
该功能是检查文件名的第一个字符,如果它是一个点 (.),则不再使用 ls 命令显示。
|
||||
这对隐藏 `.` 和 `..` 文件有效,但它引入了一个 “bug”:`ls` 命令的输出会隐藏任何文件名以 `.` 开头的文件。
|
||||
|
||||
这对隐藏 `.` 和 `..` 文件有效,但它引入了一个 `bug`:`ls` 命令的输出会隐藏任何文件名以 `.` 开头的文件。
|
||||
|
||||
这个 bug 变成了一个功能,因为程序员喜欢它来“隐藏”他们的配置文件。`ls` 命令可能后来被修改为添加显示隐藏点文件的选项。
|
||||
这个 bug 变成了一个功能,因为程序员喜欢它来“隐藏”他们的配置文件。`ls` 命令可能是后来修改添加了一个显示隐藏点文件的选项。
|
||||
|
||||
Linux 遵循相同的约定,因为 Linux 是以 UNIX 为原型开发的。
|
||||
|
||||
@ -119,7 +120,7 @@ via: https://itsfoss.com/hide-files-folders-linux/
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[hanszhao80](https://github.com/hanszhao80)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -3,21 +3,22 @@
|
||||
[#]: author: "abhimanyu rathore https://www.opensourceforu.com/author/abhimanyu-rathore/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-14805-1.html"
|
||||
|
||||
改变数据中心行业的主要趋势
|
||||
======
|
||||
|
||||
![Data center][1]
|
||||
|
||||
大流行加快了全国数字化转型的速度,这需要对数据中心进行更多投资。由于快速的数字化和云采用,印度数据中心市场的容量预计在未来几年将翻一番。据报道,2021 年印度数据中心市场规模为 43.5 亿美元,到 2027 年将达到 100.9 亿美元,2022-2027 年的复合年增长率为 15.07%。
|
||||
大流行加快了印度全国数字化转型的速度,这需要对数据中心进行更多投资。由于快速的数字化和云采用,印度数据中心市场的容量预计在未来几年将翻一番。据报道,2021 年印度数据中心市场规模为 43.5 亿美元,到 2027 年将达到 100.9 亿美元,2022-2027 年的复合年增长率为 15.07%。
|
||||
|
||||
现在,出现的一个关键问题是印度数据中心行业的未来是什么?哪些新趋势将塑造其未来?下面提到的是将对印度数据中心行业产生重大影响的主要趋势。
|
||||
|
||||
### 数据本地化
|
||||
|
||||
数据本地化仅仅意味着限制数据从一个国家流向另一个国家。印度政府已发布指导方针,强调需要在该国境内存储印度用户的数据。数据本地化使得收集关键消费者数据的公司必须在本地数据中心存储和处理这些数据。这给本地数据中心带来了巨大的增长。此外,印度的成本优势和熟练劳动力的便利性使其成为亚洲数据中心的重要枢纽。
|
||||
数据本地化就意味着限制数据从一个国家流向另一个国家。印度政府已发布指导方针,强调需要在该国境内存储印度用户的数据。数据本地化使得收集关键消费者数据的公司必须在本地数据中心存储和处理这些数据。这给本地数据中心带来了巨大的增长。此外,印度的成本优势和熟练劳动力的便利性使其成为亚洲数据中心的重要枢纽。
|
||||
|
||||
### 可持续数据中心
|
||||
|
||||
@ -42,7 +43,7 @@ via: https://www.opensourceforu.com/2022/06/top-trends-changing-data-center-indu
|
||||
作者:[abhimanyu rathore][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -0,0 +1,96 @@
|
||||
[#]: subject: "Why I love Tig for visualizing my Git workflows"
|
||||
[#]: via: "https://opensource.com/article/22/7/visualize-git-workflow-tig"
|
||||
[#]: author: "Sumantro Mukherjee https://opensource.com/users/sumantro"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-14809-1.html"
|
||||
|
||||
使用 Tig 来可视化 Git 工作流
|
||||
======
|
||||
|
||||

|
||||
|
||||
> Tig 是审查 Git 仓库的绝佳工具,它鼓励你探索日志,而无需构建冗长且有时复杂的查询。
|
||||
|
||||
如果你发现浏览你的 Git 仓库非常复杂,我已经为你准备好了工具,来了解一下 Tig。
|
||||
|
||||
Tig 是一个 [基于 ncurses][2] 的 Git 文本模式界面,它允许你浏览 Git 仓库中的更改。它还可以充当各种 Git 命令输出的分页器。使用这个工具可以让我很好地了解在哪个提交中发生了哪些更改,最新的提交合并是什么等等。请跟随这个简短的教程,亲自尝试一下。
|
||||
|
||||
### 安装 Tig
|
||||
|
||||
在 Linux 上,你可以使用包管理器安装 Tig。例如,在 Fedora 和 Mageia 上:
|
||||
|
||||
```
|
||||
$ sudo dnf install tig
|
||||
```
|
||||
|
||||
在 Debian、Linux Mint、Elementary、Pop_OS 和其他基于 Debian 的发行版上:
|
||||
|
||||
```
|
||||
$ sud apt install tig
|
||||
```
|
||||
|
||||
在 macOS 上,使用 [MacPorts][3] 或 [Homebrew][4]。 Tig 的完整安装指南可在 [Tig 手册][5] 中找到。
|
||||
|
||||
### 使用 Tig
|
||||
|
||||
Tig 提供了常见 Git 输出的交互式视图。例如,使用 Git,你可以使用命令 `git show-ref` 查看所有引用:
|
||||
|
||||
```
|
||||
$ git show-ref
|
||||
98b108... refs/heads/master
|
||||
6dae95... refs/remotes/origin/1010-internal-share-partition-format-reflexion
|
||||
84e1f8... refs/remotes/origin/1015-add-libretro-openlara
|
||||
e62c7c... refs/remotes/origin/1016-add-support-for-retroarch-project-cd
|
||||
1c29a8... refs/remotes/origin/1066-add-libretro-mess
|
||||
ffd3f53... refs/remotes/origin/1155-automatically-generate-assets-for-external-installers
|
||||
ab4d14... refs/remotes/origin/1160-release-on-bare-metal-servers
|
||||
28baa9... refs/remotes/origin/1180-ipega-pg-9118
|
||||
8dff1d... refs/remotes/origin/1181-add-libretro-dosbox-core-s
|
||||
81a7fe... refs/remotes/origin/1189-allow-manual-build-on-master
|
||||
[...]
|
||||
```
|
||||
|
||||
使用 Tig,你可以在可滚动列表中获取该信息以及更多信息,此外还可以使用键盘快捷键来打开其他视图,其中包含每个引用的详细信息。
|
||||
|
||||
![][6]
|
||||
|
||||
### 分页模式
|
||||
|
||||
当输入来自标准输入时,Tig 进入分页模式。当指定 `show` 子命令并给出 `--stdin` 选项时,标准输入被假定为提交 ID 列表,它被转发到 `git-show` :
|
||||
|
||||
```
|
||||
$ git rev-list --author=sumantrom HEAD | tig show –stdin
|
||||
```
|
||||
|
||||
### 日志和差异视图
|
||||
|
||||
当你在 Tig 的日志视图中时,你可以按键盘上的 `d` 键来显示差异。这将显示提交中更改的文件以及删除和添加的行。
|
||||
|
||||
### 交互式 Git 数据
|
||||
|
||||
Tig 是对 Git 的一个很好的补充。它鼓励你探索日志,而无需构建冗长且有时复杂的查询,从而可以轻松查看你的 Git 仓库。
|
||||
|
||||
立即将 Tig 添加到你的 Git 工具包中!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/22/7/visualize-git-workflow-tig
|
||||
|
||||
作者:[Sumantro Mukherjee][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/sumantro
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://opensource.com/sites/default/files/images/life/computer_code_programming_laptop_0.jpg
|
||||
[2]: https://opensource.com/article/21/8/ncurses-linux
|
||||
[3]: https://opensource.com/article/20/11/macports
|
||||
[4]: https://opensource.com/article/20/6/homebrew-mac
|
||||
[5]: https://jonas.github.io/tig/doc/manual.html
|
||||
[6]: https://opensource.com/sites/default/files/2022-06/tig%201.png
|
@ -0,0 +1,70 @@
|
||||
[#]: subject: "More Linux Developers Joining Microsoft, Systemd Creator Adds to the List"
|
||||
[#]: via: "https://news.itsfoss.com/systemd-creator-microsoft/"
|
||||
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "wxy"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-14804-1.html"
|
||||
|
||||
又有 Linux 开发者加入微软,这次是 systemd 的创建者
|
||||
======
|
||||
|
||||
> 看来微软拿了一手好牌,在 Linux 和开源方面取得行业成功。
|
||||
|
||||
![microsoft][1]
|
||||
|
||||
出于某种原因,微软在开源和 Linux 方面总是受到关注。
|
||||
|
||||
而且,当我们谈论 Linux 开发者时,它也会成为焦点……为什么会这样?
|
||||
|
||||
微软似乎正在为一系列的项目招聘大量 Linux 开发人员。而且,一个知名人物也加入了这个名单。
|
||||
|
||||
据 [Phoronix][2] 报道,systemd 和 PulseAudio 的创建者 **Lennart Poettering**,现在已在微软工作,继续专注于 systemd 的开发。
|
||||
|
||||
或许你不知道,Lennart 曾在红帽工作,领导 PulseAudio 项目和其他一些事情。
|
||||
|
||||
除了 Lennart 之外,Python 之父 **Guido Van Rossum** 等一些关键的开发人员之前就加入了微软。
|
||||
|
||||
(LCTT 译注:据 Phoronix 总结,还有更多的开源开发者加入了(或加入过)微软,这包括:GNOME 创建者 Miguel de Icaza 曾在 2016 年微软收购 Xamarin 时受雇,到今年早些时候离开;Nat Friedman 作为 Xamarin 的成员在微软收购后加入,后担任微软旗下的 GitHub 的 CEO;Gentoo Linux 创始人 Daniel Robbins 之前受雇于微软;Steve French 作为 Linux CIFS/SMB2/SMB3 的维护者和 Samba 团队的成员为微软工作;以及大量的上游 Linux 开发者,如 Matteo Croce、Matthew Wilcox、Tyler Hicks、Shyam Prasad N、Michael Kelley、Christian Brauner 等等也曾被微软雇佣。)
|
||||
|
||||
### 微软在为最佳状态做准备
|
||||
|
||||
毫不奇怪,微软希望提高其对基于开源的项目的关注,并尽可能有效地利用 Linux 为其业务服务。
|
||||
|
||||
Azure 平台对开源的利用最多,而且,不要忘了 **Windows Subsystem for Linux**(WSL)。
|
||||
|
||||
因此,微软一直在招聘 Linux 开发人员。如果你想试试,你会在 [微软职业][3] 栏目中找到很多与 Linux 有关的职位。
|
||||
|
||||
虽然这对微软的产品线来说是一件大事,但它一般不会影响到 Linux 桌面用户。事实上,我认为,Linux 开发者得到的资源越多,由于他们工作角色转换,他们可以帮助 Linux 生态系统更好地增强其愿景。
|
||||
|
||||
当然,让所有关键的 Linux 开发者都在微软拥有的项目上工作并不是一件喜闻乐见的事情,但是,事实就是如此。
|
||||
|
||||
### 微软正在做正确的事情
|
||||
|
||||
这不仅仅是经济上的回报,Linux 开发者加入微软团队的趋势意味着他们在开源和 Linux 上的一些努力是成功的。
|
||||
|
||||
只要微软努力改善 Linux 生态系统,我认为我们就没有什么可担心的。
|
||||
|
||||
我不想被提醒“<ruby>拥抱、扩展和熄灭<rt>Embrace, extend, and extinguish</rt></ruby>”(3E)。毕竟,这对所有公司来说都是生意。当涉及到赚钱的决定时,没有人应该被认为是英雄。
|
||||
|
||||
因此,我们只能希望微软在不久的将来为 Linux 开发者和用户准备好一些好东西。
|
||||
|
||||
你对此有何看法?在下面的评论区分享你的想法。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/systemd-creator-microsoft/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://news.itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://news.itsfoss.com/wp-content/uploads/2022/07/more-linux-devs-joing-microsoft-systemd-creator-add-list.jpg
|
||||
[2]: https://www.phoronix.com/scan.php?page=news_item&px=Systemd-Creator-Microsoft
|
||||
[3]: https://careers.microsoft.com/us/en/search-results?keywords=Linux
|
@ -0,0 +1,66 @@
|
||||
[#]: subject: "Raspberry Pi 4 Support is Coming to Fedora Linux"
|
||||
[#]: via: "https://news.itsfoss.com/fedora-raspberry-pi-4/"
|
||||
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "wxy"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-14808-1.html"
|
||||
|
||||
Fedora Linux 37 即将正式支持树莓派 4
|
||||
======
|
||||
|
||||
> 由于上游的一些改进,Fedora Linux 37 将引入对树莓派 4 的正式支持。
|
||||
|
||||
![Fedora raspberry pi][1]
|
||||
|
||||
Fedora Linux 的工作站版很适合台式机使用。不过,如果你想让它用于服务器或物联网需求,可以使用 Fedora ARM 项目。
|
||||
|
||||
它也支持树莓派,只是最新的树莓派 4 除外(其实早在 2019 年就发布了)。
|
||||
|
||||
现在,随着 [Phoronix][2] 发现的一项拟议的变化,看起来 Fedora Linux 37 可能会正式增加对树莓派 4 的支持。
|
||||
|
||||
### 目前还不是正式的...
|
||||
|
||||
到现在为止,对树莓派 4 的支持只是一个拟议的变化。
|
||||
|
||||
Fedora Linux 通常会公开其拟议的变化列表,以接受社区反馈并让其他人跟踪其进展。
|
||||
|
||||
所以,Fedora Linux 37 中的正式支持只有在得到 Fedora 工程指导委员会的批准后才会实施。
|
||||
|
||||
但是,**支持树莓派 4 的阻碍是什么呢?**
|
||||
|
||||
这是由于缺乏加速图形以及缺失一些功能,所以不方便增加对它的支持。
|
||||
|
||||
现在,随着新的 Linux 内核和 Mesa 的上游工作为树莓派 4 带来了图形加速功能,可以让他们启用对它的支持。
|
||||
|
||||
拟议的变化文件中提到:
|
||||
|
||||
> 上游现在支持使用 V3D GPU 的 OpenGL-ES 和 Vulkan 加速图形。对有线网络也有增强,支持 CM4/4B 上的 PTPv2。
|
||||
|
||||
此外,不仅仅是引入对树莓派 4 的支持,一些拟议的变化还涉及对树莓派 3 系列和 Zero 2 W 的改进。
|
||||
|
||||
因此,如果如人们所期望的那样发生,这应该是一个有趣的变化。
|
||||
|
||||
请注意,对树莓派 400 的 Wi-Fi 的支持不是这个过程的一部分,但对音频支持的测试将是这个变化的一部分。
|
||||
|
||||
你可以在 [拟议文件][3] 中阅读所有的细节。
|
||||
|
||||
你对 Fedora Linux 37 对树莓派 4 的支持有什么看法?请在下面的评论中分享你的想法。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/fedora-raspberry-pi-4/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://news.itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://news.itsfoss.com/wp-content/uploads/2022/07/fedora-coming-to-raspberry-pi.jpg
|
||||
[2]: https://www.phoronix.com/scan.php?page=news_item&px=Fedora-37-Raspberry-Pi-4
|
||||
[3]: https://fedoraproject.org/wiki/Changes/RaspberryPi4
|
@ -1,40 +0,0 @@
|
||||
[#]: subject: "An Open Source Organisation Has Left GitHub And Encourages You To Do The Same"
|
||||
[#]: via: "https://www.opensourceforu.com/2022/07/an-open-source-organisation-has-left-github-and-encourages-you-to-do-the-same/"
|
||||
[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
An Open Source Organisation Has Left GitHub And Encourages You To Do The Same
|
||||
======
|
||||
![sfc][1]
|
||||
|
||||
The Software Freedom Conservancy (SFC), a non-profit dedicated to free and open source software (FOSS), has announced that it will no longer use Microsoft’s GitHub for project hosting and is urging other software developers to do the same. Denver Gingerich, SFC FOSS licence compliance engineer, and Bradley M. Kuhn, SFC policy fellow, wrote in a [blog][2] post on Thursday that GitHub has come to play a dominant role in FOSS development over the last decade by building an interface and social features around Git, the widely used open source version control software. They claim that by doing so, the company has persuaded FOSS developers to contribute to the development of a proprietary service that leverages FOSS.
|
||||
|
||||
“We are ending all our own uses of GitHub, and announcing a long-term plan to assist FOSS projects to migrate away from GitHub,” said Gingerich and Kuhn.
|
||||
|
||||
The SFC says it mostly uses self-hosted Git repositories, but it does use GitHub to mirror its repos. The SFC has added a Give Up on GitHub section to its website and is encouraging FOSS developers to switch to a different code hosting service voluntarily.
|
||||
|
||||
GitHub claims 83 million users and more than 200 million repositories, many of which are licenced under an open source licence. The cloud hosting service specifically promotes open source development. The SFC’s decision to leave GitHub was prompted by the general availability of GitHub Copilot, an AI coding assistant tool. According to the SFC, GitHub’s decision to release a for-profit product based on FOSS code is “too much to bear.” Based on OpenAI’s Codex, Copilot suggests code and functions to developers as they work. According to GitHub, it can do so because it was trained “on natural language text and source code from publicly available sources, including code in public repositories on GitHub.”
|
||||
|
||||
Gingerich and Kuhn see this as a problem because Microsoft and GitHub have refused to answer questions about the copyright implications of training its AI system on public code, why Copilot was trained on FOSS code but not copyrighted Windows code, and whether the company can specify all software licences and copyright holders associated with code used in the training data set. Kuhn has previously expressed his concern that Copilot’s training may pose legal risks, and others have expressed similar concerns. Matthew Butterick, a designer, programmer, and attorney, published a blog post last week in which he stated that he agrees with those who claim Copilot is an engine for violating open source licences.
|
||||
|
||||
Such claims have not been settled and are unlikely to be until actual litigation and judgement are obtained. Other attorneys point out that GitHub’s Terms of Service allow it to use hosted code to improve the service. And, without a doubt, legal experts at Microsoft and GitHub believe they are exempt from licence compliance, which they pass on to those who use Copilot to generate code.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.opensourceforu.com/2022/07/an-open-source-organisation-has-left-github-and-encourages-you-to-do-the-same/
|
||||
|
||||
作者:[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/07/sfc-e1656663655825.jpg
|
||||
[2]: https://sfconservancy.org/blog/2022/jun/30/give-up-github-launch/
|
@ -1,92 +0,0 @@
|
||||
[#]: subject: "Pine64 Is Now Working On A Powerful RISC-V Single Board Computer"
|
||||
[#]: via: "https://news.itsfoss.com/pine64-riscv/"
|
||||
[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Pine64 Is Now Working On A Powerful RISC-V Single Board Computer
|
||||
======
|
||||
Pine64’s hinted at a new RISC-V based single board computer. This should be interesting!
|
||||
|
||||
![pine64][1]
|
||||
|
||||
Pine64, the single board computer manufacturer known for their range of open-source-supporting [phones][2], laptops, smartwatches, and, of course, SBCs, has recently revealed that they are working on a new RISC-V powered computer.
|
||||
|
||||
This isn’t the first time Pine64 has dabbled in the realm of RISC-V; the Pinecil soldering iron and the Pinecone IoT board are both powered by RISC-V. However, this offering promises to be different, with desktop-class performance.
|
||||
|
||||
### What To Expect?
|
||||
|
||||
As Pine64 pointed out in their [announcement][3], some details haven’t been finalized yet, and they haven’t revealed everything yet. However, this is what we do know now:
|
||||
|
||||
* Similar performance to the Quartz64
|
||||
* 133mm x 80mm footprint
|
||||
* 4 or 8 GB RAM
|
||||
* USB 3.0
|
||||
* Open PCIe slot
|
||||
* One or two Gigabit Ethernet ports
|
||||
* Vulkan 1.2 and OpenGL 1.1/2.0/3.x support
|
||||
|
||||
As you may have noticed, “similar performance to the Quartz64” is a little unambiguous. However, it does at least give us an indication of the performance.
|
||||
|
||||
Well, they aim for this to be an affordable option and a decently powerful one.
|
||||
|
||||
However, all this power is useless if there’s no IO for it to interact with. Fortunately, the board should have a similar layout to Pine64’s other boards, so at least have a general idea of the I/O.
|
||||
|
||||
If it is anything like the Quartz 64, I expect three to four USB ports, one or two of which will be USB 3.0. Additionally, there should be one HDMI connector, as well as a MIPI-DSI interface. In terms of PCIe, there is going to be an open slot on the board. In line with previous boards, this is likely to be a PCIe 2.0 1x slot, opening up possibilities for NVMe SSDs and other PC expansion cards.
|
||||
|
||||
Overall, I expect this board to be quite powerful for an SBC, and especially a RISC-V-powered one. It should be an interesting one for sure!
|
||||
|
||||
### How Much Does It Cost?
|
||||
|
||||
With most new and niche technologies, generally comes a higher price tag. Fortunately, this does not appear to be the case with this new SBC, as Pine64 has confirmed a general price range.
|
||||
|
||||
> The board will premiere in our signature model-A form factor, feature CPU performance which falls somewhere in the neighbourhood of the Quartz64, offer plenty of IO, and sport a price-tag similar to that of the Quartz64.
|
||||
|
||||
Considering that the Quartz64 has a price tag of 60 USD for the 4 GB model, I expect a price somewhere in the range of $70 – $80 for the 4 GB, and $90 – $100 for the 8 GB model.
|
||||
|
||||
This is all around the same price as the equivalent Raspberry Pi’s, while offering more features and an exciting new architecture.
|
||||
|
||||
### A Riddle for the Name
|
||||
|
||||
In signature Pine64 style, we don’t yet know what it will be called. However, they have left us a riddle:
|
||||
|
||||
> **Victoria Line Station** \
|
||||
> *I sing, act and dance* \
|
||||
> *celebrated by them all* \
|
||||
> *I never climb my stage* \
|
||||
> *but I sometimes fall* \
|
||||
> *In the sea I dwell* \
|
||||
> *and in every magic book* \
|
||||
> *By heaven!* \
|
||||
> *adding 64 is all it took* \
|
||||
> *On my stage I shine* \
|
||||
> *and when I feel truly blue* \
|
||||
> *then there’s nothing* \
|
||||
> *This is the final clue*
|
||||
|
||||
Although I am still clueless as to what it means, there are a few hints. First, they are likely to continue naming their SBCs after certain natural materials. Think pine64, Rock64, Quartz64. When combined with the information provided in the riddle, I’m sure someone will be able to guess it correctly. And, that person is promised to get the first board off the production line for free!
|
||||
|
||||
If you want to have a crack, all you need to do is post your guess on the [Pine64 announcement page’s comments][4].
|
||||
|
||||
Overall, I’m really excited to see what this board is going to turn out like, and I’m optimistic about its performance. I’ll be sure to grab one as soon as they’re available!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/pine64-riscv/
|
||||
|
||||
作者:[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/07/pine64-working-on-a-powerful-risv-sbc.jpg
|
||||
[2]: https://news.itsfoss.com/pinephone-review/
|
||||
[3]: https://www.pine64.org/2022/06/28/june-update-who-likes-risc-v/
|
||||
[4]: https://www.pine64.org/2022/06/28/june-update-who-likes-risc-v/
|
@ -1,7 +1,7 @@
|
||||
[#]: subject: "The Next-Gen TUXEDO Pulse 15 is a Workstation Powerhouse"
|
||||
[#]: via: "https://news.itsfoss.com/tuxedo-pulse-gen-2/"
|
||||
[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
@ -9,6 +9,9 @@
|
||||
|
||||
The Next-Gen TUXEDO Pulse 15 is a Workstation Powerhouse
|
||||
======
|
||||
TUXEDO’s all-new Pulse 15 Gen 2 now packs an improved WQHD 165Hz display and AMD’s Ryzen 7 5700U that runs at 35W!
|
||||
|
||||
![tuxedo][1]
|
||||
|
||||
TUXEDO Computers is a German manufacturer popular for offering a wide range of consumer Linux desktops and laptops.
|
||||
|
||||
@ -16,7 +19,7 @@ One of their latest notebook releases, the **Pulse 15** – which was introduced
|
||||
|
||||
### Tuxedo Pulse 15 Gen-2: What’s New?
|
||||
|
||||
![Source: TUXEDO][1]
|
||||
![][2]
|
||||
|
||||
The notebook’s new 15.6-inch display takes the center stage here. A **2560 x 1440 pixels LED panel** is definitely a huge enhancement compared to the 1080p display used in the previous model. So you can expect clearer and more detailed images, not to mention fluid movements thanks to the high **165Hz refresh rate**!
|
||||
|
||||
@ -24,11 +27,11 @@ The AMD Ryzen 5 4600H is now replaced by the year-old **Ryzen 7 5700U**. Offerin
|
||||
|
||||
TUXEDO has optimized the CPU to run at a whopping 35W instead of the maximum recommended 25W. Moreover, a 35% decrease in power consumption compared to the Ryzen 5 4600H has been benchmarked. The integrated AMD RX Vega 8 graphics running at 1900MHz will be slightly more powerful thanks to the increased wattage.
|
||||
|
||||
![Source: TUXEDO][2]
|
||||
![][3]
|
||||
|
||||
Lastly, the criticisms of the cooling system should be addressed by a new design that features an **“above-average” dual-fan setup** and includes two heat pipes. TUXEDO stated that users shouldn’t come across thermal throttling issues and loud fan noise when at full load.
|
||||
|
||||
![Source: TUXEDO][3]
|
||||
![][4]
|
||||
|
||||
#### Other Specifications
|
||||
|
||||
@ -40,33 +43,31 @@ As far as the battery is concerned, the same **91-Wh** battery is being used pro
|
||||
|
||||
The connectivity options also include a new DisplayPort via USB-C, which was absent with the first-generation model. Other options contain:
|
||||
|
||||
* Intel Dual Band AX 200 (WiFi 6 & Bluetooth 5.2)
|
||||
* 1 x USB 3.2 Gen2 Type-C
|
||||
* 2 x USB 3.2 Gen2 Type-A
|
||||
* 1 x USB 2.0 Type-A
|
||||
* 1 x HDMI 2.0
|
||||
* 1 x Gigabit RJ45 LAN
|
||||
* 2-in-1 Headphone & Microphone
|
||||
* Kensington Lock
|
||||
* UHS-50 Micro SD Cardreader
|
||||
* Intel Dual Band AX 200 (WiFi 6 & Bluetooth 5.2)
|
||||
* 1 x USB 3.2 Gen2 Type-C
|
||||
* 2 x USB 3.2 Gen2 Type-A
|
||||
* 1 x USB 2.0 Type-A
|
||||
* 1 x HDMI 2.0
|
||||
* 1 x Gigabit RJ45 LAN
|
||||
* 2-in-1 Headphone & Microphone
|
||||
* Kensington Lock
|
||||
* UHS-50 Micro SD Cardreader
|
||||
|
||||
### Pricing & Availability
|
||||
|
||||
|
||||
### Pricing & Availability
|
||||
|
||||
The base configuration which includes 8 GB Samsung 3200 MHz DDR 4 RAM and 250 GB NVMe SSD costs **1149 EUR or 1185 USD**. You can choose the flagship TUXEDO_OS 22.04 LTS, Ubuntu 22.04 LTS, Kubuntu 22.04 LTS, or Ubuntu Budgie 22.04 LTS as the operating system of your choice.
|
||||
The base configuration which includes 8 GB Samsung 3200 MHz DDR 4 RAM and 250 GB NVMe SSD costs**1149 EUR or 1185 USD**. You can choose the flagship TUXEDO_OS 22.04 LTS, Ubuntu 22.04 LTS, Kubuntu 22.04 LTS, or Ubuntu Budgie 22.04 LTS as the operating system of your choice.
|
||||
|
||||
Shipping for orders starts on July 15, 2022. You can pre-order the laptop now.
|
||||
|
||||
You can check out the official website product page for more details.
|
||||
|
||||
[TUXEDO Pulse 15 Gen-2][4]
|
||||
[TUXEDO Pulse 15 Gen-2][5]
|
||||
|
||||
### Powerful Linux Laptop Lineup
|
||||
|
||||
The Tuxedo Pulse 15 specs indicate that it is a solid offering. Thus, developers and business users should not have any complaints regarding its performance.
|
||||
|
||||
Not to forget, we also had a recent launch of [HP Dev One][5], and a teaser for [StarFighter][6] with a 4K 10-bit IPS display by Star Labs.
|
||||
Not to forget, we also had a recent launch of [HP Dev One][6], and a teaser for [StarFighter][7] with a 4K 10-bit IPS display by Star Labs.
|
||||
|
||||
Looks like you’re in for a treat if you are saving up for a premium Linux-specific laptop.
|
||||
|
||||
@ -75,17 +76,18 @@ Looks like you’re in for a treat if you are saving up for a premium Linux-spec
|
||||
via: https://news.itsfoss.com/tuxedo-pulse-gen-2/
|
||||
|
||||
作者:[Rishabh Moharir][a]
|
||||
选题:[lujun9972][b]
|
||||
选题:[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/lujun9972
|
||||
[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjkwMSIgd2lkdGg9IjEwMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmVyc2lvbj0iMS4xIi8+
|
||||
[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjEwMjQiIHdpZHRoPSIxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIvPg==
|
||||
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE2MDAiIHdpZHRoPSIxNjAwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIvPg==
|
||||
[4]: https://www.tuxedocomputers.com/en/Linux-Hardware/Notebooks/15-16-inch/TUXEDO-Pulse-15-Gen2.tuxedo
|
||||
[5]: https://news.itsfoss.com/hp-dev-one-system76/
|
||||
[6]: https://news.itsfoss.com/starfighter-laptop-reveal/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://news.itsfoss.com/wp-content/uploads/2022/07/TUXEDO-Pulse-15-linux-laptop.jpg
|
||||
[2]: https://news.itsfoss.com/wp-content/uploads/2022/07/1250-1100-max-1-1024x901.png
|
||||
[3]: https://news.itsfoss.com/wp-content/uploads/2022/07/1600-1600-max-1-1024x1024.png
|
||||
[4]: https://news.itsfoss.com/wp-content/uploads/2022/07/1600-1600-max-2.png
|
||||
[5]: https://www.tuxedocomputers.com/en/Linux-Hardware/Notebooks/15-16-inch/TUXEDO-Pulse-15-Gen2.tuxedo
|
||||
[6]: https://news.itsfoss.com/hp-dev-one-system76/
|
||||
[7]: https://news.itsfoss.com/starfighter-laptop-reveal/
|
||||
|
136
sources/news/20220707 Google Summer of Code + Zephyr RTOS.md
Normal file
136
sources/news/20220707 Google Summer of Code + Zephyr RTOS.md
Normal file
@ -0,0 +1,136 @@
|
||||
[#]: subject: "Google Summer of Code + Zephyr RTOS"
|
||||
[#]: via: "https://www.linux.com/news/google-summer-of-code-zephyr-rtos/"
|
||||
[#]: author: "The Linux Foundation https://www.linuxfoundation.org/blog/google-summer-of-code-zephyr-rtos/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Google Summer of Code + Zephyr RTOS
|
||||
======
|
||||
|
||||
The **Google Summer of Code** (**GSoC)** is an international annual program in which [Google][1] awards [stipends][2] to contributors who successfully complete a [free and open source software][3] coding project during the summer. Launched in 2005, GSoC takes place from May to August. Project ideas are submitted by host organizations involved in open source software development, though students can also propose their own project ideas.
|
||||
|
||||
This year, the program was opened to anyone 18 years or older – not just students and recent graduates. Participants get paid to write software, with the amount of their [stipend][4] depending on the [purchasing power parity][5] of the country where they are located.
|
||||
|
||||
This is also the first time the Zephyr Project is participating in GSoC under The Linux Foundation umbrella. Please join us in welcoming these contributors and their projects:
|
||||
|
||||
### Project #1: Arduino module based on Zephyr
|
||||
|
||||
1 contributor full-size (350 hours).
|
||||
|
||||
[Arduino][6]’s popularity is renowned as a popular framework for providing a simplified interface to program embedded devices. Recently, Arduino adopted mbed OS as the base RTOS for some of their newer devices. With that work, they separated out [Arduino Core][7] as an independent abstraction layer from [Arduino Core for mbed][8]. This opens up the possibility for leveraging Arduino Core on other OSes. The project idea is to create a Zephyr module that leverages the Arduino Core so that a developer can use Zephyr as the underlying OS when they use the Arduino framework on Arduino-compatible devices. The benefits to the user include:
|
||||
|
||||
* Access to Arduino APIs as well as advanced Zephyr capabilities
|
||||
* Broader set of devices than the standard Arduino ecosystem thanks to Zephyrs’ device support
|
||||
* Ability to re-use Arduino tools like the Arduino IDE and wealth of libraries
|
||||
|
||||
Arduino Core is licensed under the GNU Lesser General Public License and Zephyr is licensed under Apache 2. That means this project will most likely need to be developed out of tree and in a separate repo to keep code and license separation. See [#22247][9] for a historic discussion & [soburi/arduino-on-zephyr][10] for an earlier attempt prior to the Arduino Core architecture.
|
||||
|
||||
**The contributor’s task is thus:**
|
||||
|
||||
* Implement a bare-bones Module based on Arduino Core that can compile for any target (no functionality, possibly in QEMU)
|
||||
* Implement a common peripheral from the Arduino API based on Zephyr such as [Serial][11]
|
||||
* Target one physical board, such as the Arduino Zero
|
||||
|
||||
**Mentors:**
|
||||
|
||||
[Jonathan Beri][12]– CEO of Golioth and Zephyr TSC
|
||||
[Alvaro Viebrantz][13] – Founding Engineer of Golioth and Google GDE
|
||||
|
||||
**Code License:** LGPL
|
||||
|
||||
**Contributor Details:**
|
||||
|
||||
* Name: Dhruva Gole
|
||||
* Project Blog: [https://dhruvag2000.github.io/Blog-GSoC22/][14]
|
||||
* Project Poster:
|
||||
|
||||
![][15]
|
||||
|
||||
**About the contributor:**
|
||||
|
||||
![][16]
|
||||
|
||||
Dhruva is an undergraduate student majoring in Electrical engineering. He has a broad range of interests from embedded software development to hardware design and has experience in working on SBCs, microcontrollers, and embedded Linux platforms.
|
||||
|
||||
### Project #2: Apache Thrift Module for Zephyr
|
||||
|
||||
1 contributor full-size (350 hours).
|
||||
|
||||
[Apache Thrift][17] is an [IDL][18] specification,[RPC][19] framework, and code generator that abstracts away transport and protocol details to let developers focus on application logic.It works across all major operating systems, supports over 27 programming languages, 7 protocols, and 6 low-level transports. Originally [developed at Facebook in 2007][20], it was subsequently shared with the Apache Software Foundation.
|
||||
|
||||
![][21]
|
||||
|
||||
![][22]
|
||||
|
||||
Supporting Thrift in the Zephyr RTOS would benefit the community greatly. It would lead to new software and hardware technologies, new products, and additional means for cloud integration. Thrift can be used over virtually any transport as well and for that reason, it is a natural choice for the many different physical communication layers supported by Zephyr. The project idea is to get the proof-of-concept [Thrift for Zephyr Module][23] into shape for upstreaming. To achieve that, the contributor must:
|
||||
|
||||
Perform additional integration for Thrift features (protocols, transports)
|
||||
Author additional sample applications using [supported boards][24] or [Qemu][25]
|
||||
Author additional tests and generate coverage reports using the [Zephyr Test Framework][26]
|
||||
Ensure the module follows appropriate [coding guidelines][27] and satisfies [module requirements][28]
|
||||
Contribute any necessary improvements back to the Apache Thrift Project.
|
||||
Contribute any necessary improvements back to the Zephyr Project.
|
||||
|
||||
**Mentors:**
|
||||
|
||||
* [Christopher Friedt][29] – SWE / ASIC FW at Meta and Zephyr TSC member
|
||||
* [Stephanos Ioannidis][30] – Zephyr CXX Subsystem Maintainer
|
||||
|
||||
**Code License:** Apache 2.0.
|
||||
|
||||
**Contributor Details:**
|
||||
|
||||
**Name:** Young
|
||||
|
||||
**About the contributor:** Young is a student majoring in communication engineering, and he will pursue his Master’s degree in computer engineering. He has a broad range of interests from front-end development to hardware design, and has experience in working on the Web, IoT and embedded platforms. A low-cost single-board computer with a RISC-V 64 processor designed by him in 2021 was reported by several geek media.
|
||||
|
||||
The post [Google Summer of Code + Zephyr RTOS][31] appeared first on [Linux Foundation][32].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/news/google-summer-of-code-zephyr-rtos/
|
||||
|
||||
作者:[The Linux Foundation][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.linuxfoundation.org/blog/google-summer-of-code-zephyr-rtos/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://en.wikipedia.org/wiki/Google
|
||||
[2]: https://en.wikipedia.org/wiki/Stipend
|
||||
[3]: https://en.wikipedia.org/wiki/Free_and_open-source_software
|
||||
[4]: https://en.wikipedia.org/wiki/Stipend
|
||||
[5]: https://en.wikipedia.org/wiki/Purchasing_power_parity
|
||||
[6]: https://www.arduino.cc/
|
||||
[7]: https://github.com/arduino/ArduinoCore-API
|
||||
[8]: https://github.com/arduino/ArduinoCore-mbed
|
||||
[9]: https://github.com/zephyrproject-rtos/zephyr/issues/22247
|
||||
[10]: https://github.com/soburi/arduino-on-zephyr
|
||||
[11]: https://www.arduino.cc/reference/en/language/functions/communication/serial/
|
||||
[12]: https://www.linkedin.com/in/jonathanberi/
|
||||
[13]: https://www.linkedin.com/in/alvaro-viebrantz-55119048/
|
||||
[14]: https://dhruvag2000.github.io/Blog-GSoC22/
|
||||
[15]: https://www.linuxfoundation.org/wp-content/uploads/project-poster.png
|
||||
[16]: https://www.linuxfoundation.org/wp-content/uploads/dhruva.jpeg
|
||||
[17]: https://github.com/apache/thrift
|
||||
[18]: https://en.wikipedia.org/wiki/Interface_description_language
|
||||
[19]: https://en.wikipedia.org/wiki/Remote_procedure_call
|
||||
[20]: https://thrift.apache.org/static/files/thrift-20070401.pdf
|
||||
[21]: https://www.linuxfoundation.org/wp-content/uploads/apache-thrift-layered-architecture.png
|
||||
[22]: https://www.linuxfoundation.org/wp-content/uploads/SPDX-license.png
|
||||
[23]: https://github.com/cfriedt/thrift-for-zephyr
|
||||
[24]: https://docs.zephyrproject.org/latest/boards/index.html
|
||||
[25]: https://docs.zephyrproject.org/latest/guides/networking/qemu_user_setup.html
|
||||
[26]: https://docs.zephyrproject.org/latest/guides/test/ztest.html
|
||||
[27]: https://docs.zephyrproject.org/latest/contribute/coding_guidelines/index.html
|
||||
[28]: https://docs.zephyrproject.org/latest/guides/modules.html
|
||||
[29]: https://www.linkedin.com/in/christopher-friedt/
|
||||
[30]: https://www.linkedin.com/in/stephanosio/
|
||||
[31]: https://www.linuxfoundation.org/blog/google-summer-of-code-zephyr-rtos/
|
||||
[32]: https://www.linuxfoundation.org/
|
@ -0,0 +1,65 @@
|
||||
[#]: subject: "Do You Miss Firefox Send? Internxt Send is Ready as a Replacement"
|
||||
[#]: via: "https://news.itsfoss.com/internxt-send/"
|
||||
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Do You Miss Firefox Send? Internxt Send is Ready as a Replacement
|
||||
======
|
||||
A new offering by Internxt lets you send encrypted files to anyone quickly while retaining your privacy. We can only hope that it does not shut down like Firefox Send.
|
||||
|
||||
![internxt][1]
|
||||
|
||||
[Internxt][2] is a fairly new open-source encrypted cloud service that aims to replace the offerings by the big tech. For instance, you can use it as an alternative to Google Photos, and Drive.
|
||||
|
||||
You get 10 GB for free. So, you can sign up for it to test it out.
|
||||
|
||||
Recently, they have also added another product “Internxt Send”, as a replacement to fill the void for Firefox Send.
|
||||
|
||||
Unfortunately, Firefox Send was discontinued, but it was a good tool!
|
||||
|
||||
[Internxt Send][3] lets you send/share images, videos, documents, and other files securely, just like Firefox Send.
|
||||
|
||||
### Internxt Send: A Secure File Sharing Service
|
||||
|
||||
![][4]
|
||||
|
||||
While I couldn’t find the repository on GitHub for Internxt Send, I’ve asked them for clarification.
|
||||
|
||||
As one would expect, you can upload your files to Internxt Send without needing to create an account.
|
||||
|
||||
The file upload limit is 5 GB. And, you cannot increase the limit in any way.
|
||||
|
||||
You can choose to upload the files required and generate a link to share. Or, you can directly send an email to the recipient, where you would also need to share your email address.
|
||||
|
||||
![][5]
|
||||
|
||||
Interestingly, it also lets you add custom text to the email you send with the file uploaded.
|
||||
|
||||
Unlike Firefox Send, you cannot tweak the expiry for the link generated to share the file or set it to stop working after a number of downloads. The link expires in 15 days by default, and you cannot change that. So, that is a bummer.
|
||||
|
||||
But, if you were waiting for an encrypted service that lets you privately share files, this can be an alternative.
|
||||
|
||||
*It is good to have more Firefox Send alternatives I think! What are your thoughts on Internxt Send?*
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/internxt-send/
|
||||
|
||||
作者:[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/07/internxt-send-ft-1.jpg
|
||||
[2]: https://itsfoss.com/internxt-cloud-service/
|
||||
[3]: https://send.internxt.com/
|
||||
[4]: https://news.itsfoss.com/wp-content/uploads/2022/07/internxt-send-1024x640.png
|
||||
[5]: https://news.itsfoss.com/wp-content/uploads/2022/07/internxt-send-screenshot-1024x782.png
|
@ -0,0 +1,72 @@
|
||||
[#]: subject: "Meta’s AI Model That Helps Overcome Language Barrier Is Now Open-Source"
|
||||
[#]: via: "https://news.itsfoss.com/meta-open-source-ai-model/"
|
||||
[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "fenglyulin"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Meta’s AI Model That Helps Overcome Language Barrier Is Now Open-Source
|
||||
======
|
||||
No Language Left Behind by Meta is an ambitious open-source project which aims to translate languages with the highest level of accuracy.
|
||||
|
||||
![meta][1]
|
||||
|
||||
Meta (formerly known as Facebook) has made quite a splash in the open-source world. If you did not know, Meta works on various research and innovative projects like React (a JavaScript library) apart from focusing on the metaverse and its social media platforms.
|
||||
|
||||
Researchers at Meta have decided to open-source one such project, an AI model called ‘*No Language Left Behind*‘.
|
||||
|
||||
### Meta’s Attempt To Leave No Language Behind
|
||||
|
||||
![200 languages within a single AI model: A breakthrough in high-quality machine translation][2]
|
||||
|
||||
While around 7000 languages are spoken in the world today, most of the online content is available in a handful of popular languages like English. This leaves many people who don’t know such languages at a disadvantage.
|
||||
|
||||
While many tools exist for translation, grammatical errors can make content difficult to read and understand. Moreover, if you are looking to translate it into a language that is not popular, it won’t be a pretty experience.
|
||||
|
||||
Specifically, for languages of Africa and Asia.
|
||||
|
||||
Hence, Meta is working on a translational tool with one of the highest quality results recorded that can help counter this global issue.
|
||||
|
||||
No Language Left Behind or simply **NLLB-200** is a machine translation model that can translate over 200 languages using artificial intelligence
|
||||
|
||||
NLLB’s performance in each language is determined and evaluated using a complex dataset called FLORES-200 (if you’re curious).
|
||||
|
||||
As stated by Meta, NLLB’s results are 40% better than “previous AI research” methods. It even has an accuracy of over 70% for some of the least-common languages. That’s quite an impressive feat!
|
||||
|
||||
To help develop and improve the quality of translations, Meta has made the source code open to all interested researchers. This includes code for NLLB-200, FLORES-200, model training, and re-creating the training database.
|
||||
|
||||
You can find the source code on [GitHub][3] and learn more about the project in its [research blog post][4].
|
||||
|
||||
### Rewards for Social Cause
|
||||
|
||||
Meta has announced rewards of up to $200,00 of grants for non-profit organizations and researchers who are working on any areas of the UN Sustainable Development Goals and translating African languages.
|
||||
|
||||
Other researchers currently working in academic fields like linguistics and machine translation are also encouraged to apply.
|
||||
|
||||
### The Impact of this Project
|
||||
|
||||
Although Meta intends to mostly make use of NLLB across its digital platforms, particularly the Metaverse, it can be hugely impactful in other domains as well.
|
||||
|
||||
Many users will be able to access and easily read online resources in their native languages without a lot of effort. The idea of making it an open-source project should allow the community to help make this happen.
|
||||
|
||||
*What are your thoughts on this project by Meta?*
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/meta-open-source-ai-model/
|
||||
|
||||
作者:[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/07/meta-makes-ai-language-model-opensource.jpg
|
||||
[2]: https://youtu.be/uCxSPPiwrNE
|
||||
[3]: https://github.com/facebookresearch/fairseq/tree/nllb
|
||||
[4]: https://ai.facebook.com/blog/nllb-200-high-quality-machine-translation/
|
@ -0,0 +1,80 @@
|
||||
[#]: subject: "Meet Free Software Foundation Executive Director Zoë Kooyman"
|
||||
[#]: via: "https://opensource.com/article/22/7/meet-fsf-executive-director-zoe-kooyman"
|
||||
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Meet Free Software Foundation Executive Director Zoë Kooyman
|
||||
======
|
||||
Find out what the Free Software Foundation (FSF) is all about.
|
||||
|
||||
![Dandelion zoomed in][1]
|
||||
|
||||
Image by: Photo by Rob Tiller, CC BY-SA 4.0
|
||||
|
||||
The [Free Software Foundation (FSF)][2] started promoting the idea of sharing code way back in 1985, and since then it's defended the rights of computer users and developers. The FSF says that the terms "open" and "closed" are not effective words when classifying software, and instead considers programs either *freedom-respecting* ("free" or "libre") or *freedom-trampling* ("non-free" or "proprietary"). Whatever terminology you use, the imperative is that computers must belong, part and parcel, to the users, and not to the corporations that owns the software the computers run. This is why the GNU Project, and the Linux kernel, Freedesktop.org, and so many other open source projects are so important.
|
||||
|
||||
Recently, the FSF has acquired a new executive director, Zoë Kooyman. I met Zoë in 2019 at an [All Things Open][3] conference. She wasn't yet the executive director of the FSF at that time, of course, but was managing their growing list of major events, including [LibrePlanet][4]. I was captivated by her energy and sincerity as she introduced me to a seemingly nonstop roster of people creating the freedom-respecting software I used on a *daily basis*. I had stumbled into an FSF meetup and ended up hanging out with the people who were actively defining the way I lived my digital life. These were the people who ensured that I had what Zoë Kooyman and the FSF calls the [four essential freedoms][5]:
|
||||
|
||||
* The freedom to run the program as you wish, for any purpose (freedom 0).
|
||||
* The freedom to study how the program works and change it so it does your computing as you wish (freedom 1). Access to the source code is a precondition for this.
|
||||
* The freedom to redistribute copies so you can help others (freedom 2).
|
||||
* The freedom to distribute copies of your modified versions to others (freedom 3). By doing this you can give the whole community a chance to benefit from your changes. Access to the source code is a precondition for this.
|
||||
|
||||
When I heard about Zoë's appointment as executive director, I emailed her for an interview and she was kind enough to take some time out of her very busy schedule to have a chat.
|
||||
|
||||
**Seth Kenlon: You're the executive director of the FSF! How did you get here?**
|
||||
|
||||
**Zoë Kooyman:** In my working life, I started out as an event organizer, traveling the world while producing some of the world's biggest music shows. Working with so many different cultures in ever-changing locations is exciting, as is making all the different elements of production come together, whether that's the show, technique, or the other live elements. It's a juggling game to have everything fall into place at the right moment. I spent a lot of time living and working in different countries, and learning a lot about organization and communication thanks to this work. I also studied, and worked with different forms of media, how they are experienced, and their relationship with society.
|
||||
|
||||
It was in university that I first learned about copyleft. About how we can use existing structures to our benefit, and drive change. It was also then that media (as well as the Internet, and software) landscapes started changing rapidly with encroachments on freedom as a consequence. Moving to the US changed things for me. In the US, I developed a much stronger sense of urgency for matters of social responsibility, and so I decided to act on it. I was thankful to John Sullivan (the FSF executive director at that time) for hiring me based on what I knew about free software and my organizing experience, and allowed me to bring the two together.
|
||||
|
||||
**Seth: How did you get into Free Software?**
|
||||
|
||||
**Zoë:** We tend to expect technical people to be the main people affected by free software, but free software is a movement to defend freedom for anyone using a computer. Actually, software freedom affects members of marginalized communities who are unable to have regular access to a computer. Software shapes their lives as well.
|
||||
|
||||
What the concept of copyleft, as well as the GNU Project, has achieved is exceptional. To truly observe the direction society was heading in, and say, "It doesn't have to be this way. We can take matters in our own hands." That changed my outlook on life early on. I started working on the idea of using already existing materials and reintroducing it to different subcultures. In the entertainment industry you see this all the time, the inspiration from and building on other people's work, and the result is a reflection of the time we live in, as well as a nod to history. True progression cannot happen without that freedom.
|
||||
|
||||
As a commentary on copyright for film, I spent time working with the National Film Institute in the Netherlands to create a compilation of "orphaned footage" that was shown at a large scale dance event for thousands of young people in an area with a 170m panoramic screen and a live DJ playing to it. They have continued to play it regularly at events like the Dutch *Museumnacht*.
|
||||
|
||||
Not being a technical person, I expressed these ideas culturally, but over the years, I was confronted with the ideas of free software more and more, and I realized that with the continued integration of software into our lives (and sometimes our bodies), the fight for free software is becoming more relevant every day. In a world where proprietary software prevails, our society will progress in a way that favors profit and the progression of the few over the freedom of many. Without free software, there are so many aspects of life, so many important social causes that cannot truly succeed.
|
||||
|
||||
**Seth:** When did you start with the FSF?
|
||||
|
||||
**Zoë:** Early 2019, one week before the last in-person edition of LibrePlanet.
|
||||
|
||||
**Seth:** What attracted you to the Executive Director role?
|
||||
|
||||
**Zoë:** The FSF is just one organization that is trying to move the needle towards a more equitable, more collaborative, and more software-literate society, but it has been at the core of the movement for a long time. Society is changing rapidly, and most people are not being properly prepared in how to deal with the digital building blocks of today's society i.e. software. This is all incredibly important work, and there are not enough people doing this work. It is important to have an organization that can handle the different challenges that lay ahead.
|
||||
|
||||
The executive director role, is in a way, merely a facilitating role for the staff and the community to be able to make significant changes toward free software. I believe it is vitally important that we continue to spread the free software message, and with the team we have at the FSF, I believe we can make a real difference. I believe I can use the lessons of working with so many different cultures and people, organizing really challenging projects globally, to help get the best out of all of us. The support I received from staff, management, the community, and the board in this decision, convinced me it was a good decision to take this on.
|
||||
|
||||
**Seth:** What do you see as the biggest challenges in software freedom today? What should the FSF's role be in addressing those challenges?
|
||||
|
||||
**Zoë:** As software has integrated itself more and more into the basic fabric of society, it's also become more invisible. Software is now so widespread, and we've been conditioned to overlook it. We focus on what a program can do, not how it does it, let alone if it respects you as a user. And in the meantime, software is proliferating more rapidly than ever before. If people don't understand the fabric out of which a program is made, and all they do, all day, is use these programs, then how can we even begin to explain to them that they are being treated unjustly?
|
||||
|
||||
The FSF's role is to bring every conversation back to this logic of user freedom, to remind us that the tools we use are not benign. Education and government adoption are important focus areas for that reason. If we get people to focus on the issue of software freedom in those areas, we will truly make a difference. Education will help make sure future generations have a chance at freedom, and free software in government is about protecting citizens from unjust influences through proprietary software (maintaining digital sovereignty).
|
||||
|
||||
We can show people that today's society is teaching us a faulty lesson: that it is normal to be subjected to encroachments on your freedoms for reasons "too complex to understand." If you want convenience, connection, or just to do your job, you need to trust these organizations and abide by their will. That is not true. We have an entire community of people who believe we can have a society that doesn't ask you to surrender your freedoms to function in it. And we have this legal framework that supports our ideas. People of all backgrounds and skill levels join our conversations daily, more and more people care about their freedom, and everyone has their own reasons. We learn new things every day about how we can protect ourselves and others, and I look forward to a freer future.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/22/7/meet-fsf-executive-director-zoe-kooyman
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://opensource.com/sites/default/files/dandelion_zoom.jpg
|
||||
[2]: https://www.fsf.org/
|
||||
[3]: https://www.allthingsopen.org/
|
||||
[4]: https://libreplanet.org
|
||||
[5]: https://www.gnu.org/philosophy/free-sw.en.html
|
@ -2,7 +2,7 @@
|
||||
[#]: 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: " "
|
||||
[#]: translator: "tanloong"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
@ -1,223 +0,0 @@
|
||||
[#]: subject: "How dynamic linking for modular libraries works on Linux"
|
||||
[#]: via: "https://opensource.com/article/22/5/dynamic-linking-modular-libraries-linux"
|
||||
[#]: author: "Jayashree Huttanagoudar https://opensource.com/users/jayashree-huttanagoudar"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "robsean"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How dynamic linking for modular libraries works on Linux
|
||||
======
|
||||
Learn how to combine multiple C object files into single executable with dynamic libraries.
|
||||
|
||||
![Links][1]
|
||||
|
||||
Image by: Paul Lewin. Modified by Opensource.com. CC BY-SA 2.0
|
||||
|
||||
When you write an application using the C programming language, your code usually has multiple source files.
|
||||
|
||||
Ultimately, these files must be compiled into a single executable. You can do this by creating either static or dynamic libraries (the latter are also referred to as shared libraries). These two types of libraries vary in how they are created and linked. Both have advantages and disadvantages, depending on your use case.
|
||||
|
||||
Dynamic linking is the most common method, especially on Linux systems. Dynamic linking keeps libraries modular, so just one library can be shared between any number of applications. Modularity also allows a shared library to be updated independently of the applications that rely upon it.
|
||||
|
||||
In this article, I demonstrate how dynamic linking works. In a future article, I'll demonstrate static linking.
|
||||
|
||||
### Linker
|
||||
|
||||
A linker is a command that combines several pieces of a program together and reorganizes the memory allocation for them.
|
||||
|
||||
The functions of a linker include:
|
||||
|
||||
* Integrating all the pieces of a program
|
||||
* Figuring out a new memory organization so that all the pieces fit together
|
||||
* Reviving addresses so that the program can run under the new memory organization
|
||||
* Resolving symbolic references
|
||||
|
||||
As a result of all these linker functionalities, a runnable program called an executable is created. Before you can create a dynamically linked executable, you need some libraries to link *to* and an application to compile. Get your [favorite text editor][2] ready and follow along.
|
||||
|
||||
### Create the object files
|
||||
|
||||
First, create the header file `mymath.h` with these function signatures:
|
||||
|
||||
```
|
||||
int add(int a, int b);
|
||||
int sub(int a, int b);
|
||||
int mult(int a, int b);
|
||||
int divi(int a, int b);
|
||||
```
|
||||
|
||||
Create `add.c`, `sub.c` , `mult.c` and `divi.c` with these function definitions. I'm placing all of the code in one code block, so divide it up among four files, as indicated in the comments:
|
||||
|
||||
```
|
||||
// add.c
|
||||
int add(int a, int b){
|
||||
return (a+b);
|
||||
}
|
||||
|
||||
//sub.c
|
||||
int sub(int a, int b){
|
||||
return (a-b);
|
||||
}
|
||||
|
||||
//mult.c
|
||||
int mult(int a, int b){
|
||||
return (a*b);
|
||||
}
|
||||
|
||||
//divi.c
|
||||
int divi(int a, int b){
|
||||
return (a/b);
|
||||
}
|
||||
```
|
||||
|
||||
Now generate object files `add.o`, `sub.o`, `mult.o`, and `divi.o` using GCC:
|
||||
|
||||
```
|
||||
$ gcc -c add.c sub.c mult.c divi.c
|
||||
```
|
||||
|
||||
The `-c` option skips the linking step and creates only object files.
|
||||
|
||||
### Creating a shared object file
|
||||
|
||||
Dynamic libraries are linked during the execution of the final executable. Only the name of the dynamic library is placed in the final executable. The actual linking happens during runtime, when both executable and library are placed in the main memory.
|
||||
|
||||
In addition to being sharable, another advantage of a dynamic library is that it reduces the size of the final executable file. Instead of having a redundant copy of the library, an application using a library includes only the name of the library when the final executable is created.
|
||||
|
||||
You can create dynamic libraries from your existing sample code:
|
||||
|
||||
```
|
||||
$ gcc -Wall -fPIC -c add.c sub.c mult.c divi.c
|
||||
```
|
||||
|
||||
The option `-fPIC` tells GCC to generate position-independent code (PIC). The `-Wall` option isn't necessary and has nothing to do with how the code is compiling. Still, it's a valuable option because it enables compiler warnings, which can be helpful when troubleshooting.
|
||||
|
||||
Using GCC, create the shared library `libmymath.so` :
|
||||
|
||||
```
|
||||
$ gcc -shared -o libmymath.so \
|
||||
add.o sub.o mult.o divi.o
|
||||
```
|
||||
|
||||
You have now created a simple example math library, `libmymath.so`, which you can use in C code. There are, of course, very complex C libraries out there, and this is the process their developers use to generate the final product that you or I install for use in C code.
|
||||
|
||||
Next, you can use your new math library in some custom code, then link it.
|
||||
|
||||
### Creating a dynamically linked executable
|
||||
|
||||
Suppose you've written a command for mathematics. Create a file called `mathDemo.c` and paste this code into it:
|
||||
|
||||
```
|
||||
#include <mymath.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
int x, y;
|
||||
printf("Enter two numbers\n");
|
||||
scanf("%d%d",&x,&y);
|
||||
|
||||
printf("\n%d + %d = %d", x, y, add(x, y));
|
||||
printf("\n%d - %d = %d", x, y, sub(x, y));
|
||||
printf("\n%d * %d = %d", x, y, mult(x, y));
|
||||
|
||||
if(y==0){
|
||||
printf("\nDenominator is zero so can't perform division\n");
|
||||
exit(0);
|
||||
}else{
|
||||
printf("\n%d / %d = %d\n", x, y, divi(x, y));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Notice that the first line is an `include` statement referencing, by name, your own `libmymath` library. To use a shared library, you must have it installed. If you don't install the library you use, then when your executable runs and searches for the included library, it won't be able to find it. Should you need to compile code without installing a library to a known directory, there are [ways to override default settings][3]. For general use, however, it's expected that libraries exist in known locations, so that's what I'm demonstrating here.
|
||||
|
||||
Copy the file `libmymath.so` to a standard system directory, such as `/usr/lib64`, and then run `ldconfig`. The `ldconfig` command creates the required links and cache to the most recent shared libraries found in the standard library directories.
|
||||
|
||||
```
|
||||
$ sudo cp libmymath.so /usr/lib64/
|
||||
$ sudo ldconfig
|
||||
```
|
||||
|
||||
### Compiling the application
|
||||
|
||||
Create an object file called `mathDemo.o` from your application source code (`mathDemo.c` ):
|
||||
|
||||
```
|
||||
$ gcc -I . -c mathDemo.c
|
||||
```
|
||||
|
||||
The `-I` option tells GCC to search for header files (`mymath.h` in this case) in the directory listed after it. In this case, you're specifying the current directory, represented by a single dot (`.` ). Create an executable, referring to your shared math library by name using the `-l` option:
|
||||
|
||||
```
|
||||
$ gcc -o mathDynamic mathDemo.o -lmymath
|
||||
```
|
||||
|
||||
GCC finds `libmymath.so` because it exists in a default system library directory. Use `ldd` to verify the shared libraries used:
|
||||
|
||||
```
|
||||
$ ldd mathDemo
|
||||
linux-vdso.so.1 (0x00007fffe6a30000)
|
||||
libmymath.so => /usr/lib64/libmymath.so (0x00007fe4d4d33000)
|
||||
libc.so.6 => /lib64/libc.so.6 (0x00007fe4d4b29000)
|
||||
/lib64/ld-linux-x86-64.so.2 (0x00007fe4d4d4e000)
|
||||
```
|
||||
|
||||
Take a look at the size of the `mathDemo` executable:
|
||||
|
||||
```
|
||||
$ du ./mathDynamic
|
||||
24 ./mathDynamic
|
||||
```
|
||||
|
||||
It's a small application, of course, and the amount of disk space it occupies reflects that. For comparison, a statically linked version of the same code (as you'll see in my next article) is 932K!
|
||||
|
||||
```
|
||||
$ ./mathDynamic
|
||||
Enter two numbers
|
||||
25
|
||||
5
|
||||
|
||||
25 + 5 = 30
|
||||
25 - 5 = 20
|
||||
25 * 5 = 125
|
||||
25 / 5 = 5
|
||||
```
|
||||
|
||||
You can verify that it's dynamically linked with the `file` command:
|
||||
|
||||
```
|
||||
$ file ./mathDynamic
|
||||
./mathDynamic: ELF 64-bit LSB executable, x86-64,
|
||||
dynamically linked,
|
||||
interpreter /lib64/ld-linux-x86-64.so.2,
|
||||
with debug_info, not stripped
|
||||
```
|
||||
|
||||
Success!
|
||||
|
||||
### Dynamically linking
|
||||
|
||||
A shared library leads to a lightweight executable, as the linking happens during runtime. Because it resolves references during runtime, it does take more time for execution. However, since the vast majority of commands on everyday Linux systems are dynamically linked and on modern hardware, the time saved is negligible. Its inherent modularity is a powerful feature for developers and users alike.
|
||||
|
||||
In this article, I described how to create dynamic libraries and link them into a final executable. I'll use the same source code to create a statically linked executable in my next article.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/22/5/dynamic-linking-modular-libraries-linux
|
||||
|
||||
作者:[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/links.png
|
||||
[2]: https://opensource.com/article/21/2/open-source-text-editors
|
||||
[3]: https://opensource.com/article/22/5/compile-code-ldlibrarypath
|
@ -1,129 +0,0 @@
|
||||
[#]: subject: "How to Boot into an Older Kernel By Default in Ubuntu and Other Linux"
|
||||
[#]: via: "https://itsfoss.com/boot-older-kernel-default/"
|
||||
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "hanszhao80"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How to Boot into an Older Kernel By Default in Ubuntu and Other Linux
|
||||
======
|
||||
Here’s a possible scenario. Your system received a kernel update but somehow things are not working as smoothly as previously.
|
||||
|
||||
You realized that if you boot into the older kernel (yes, you can downgrade kernel), things are back to normal.
|
||||
|
||||
That makes you happy with a little inconvenience. You have to manually select the older kernel at each boot.
|
||||
|
||||
This problem was faced by an elderly It’s FOSS reader. The new kernel update in [Linux Mint][1] wasn’t working as expected. Booting into the older kernel ‘fixed’ the issues but choosing the older kernel at each boot was a problem.
|
||||
|
||||
Removing the new kernel (while using the older kernel) is not a good idea because the new kernel will be installed and used with the next system updates.
|
||||
|
||||
So, I suggested booting into the older Linux kernel by default. How to do that? That’s what I am going to show you in this tutorial.
|
||||
|
||||
### Booting into the older Linux kernel
|
||||
|
||||
If you are not already familiar with it, your Linux distribution keeps more than one Linux kernel installed on your system. Don’t believe me? [List the installed kernels in Ubuntu][2] with this command:
|
||||
|
||||
```
|
||||
apt list --installed | grep linux-image
|
||||
```
|
||||
|
||||
When you get a new kernel version with the system updates, your system automatically chooses to boot into the latest available kernel.
|
||||
|
||||
From the [grub][3] screen, you can **go to the Advanced options** (or older Linux versions):
|
||||
|
||||
![ubuntu grub][4]
|
||||
|
||||
Here, you can see the available kernels to boot into. Choose the older one (without recovery option):
|
||||
|
||||
![grub advanced options][5]
|
||||
|
||||
You won’t notice any visual difference. Your files and applications remain the same.
|
||||
|
||||
Now that you have booted into the older kernel, it’s time to make your system boot into it automatically.
|
||||
|
||||
### Making older kernel the default
|
||||
|
||||
If you are comfortable with Linux terminal and commands, you can modify the /etc/default/grub file and add the following lines to it:
|
||||
|
||||
```
|
||||
GRUB_DEFAULT=saved
|
||||
GRUB_SAVEDEFAULT=true
|
||||
```
|
||||
|
||||
And then [update grub][6] with:
|
||||
|
||||
```
|
||||
sudo update-grub
|
||||
```
|
||||
|
||||
What you did here is to tell your system to save the currently used entry as the default entry for the future runs of GRUB.
|
||||
|
||||
However, not everyone is okay with the command line and hence I’ll focus on a GUI tool called [Grub Customizer][7].
|
||||
|
||||
#### Installing Grub Customizer
|
||||
|
||||
Use the official PPA to [install Grub Customizer in Ubuntu-based distributions][8]:
|
||||
|
||||
```
|
||||
sudo add-apt-repository ppa:danielrichter2007/grub-customizer
|
||||
sudo apt update
|
||||
sudo apt install grub-customizer
|
||||
```
|
||||
|
||||
For other distributions, please use your package manager to install this tool.
|
||||
|
||||
#### Using Grub Customizer to change the default boot entry
|
||||
|
||||
When you run Grub Customizer, it shows the available boot entries.
|
||||
|
||||
![grub customizer ubuntu][9]
|
||||
|
||||
You have two options here.
|
||||
|
||||
**Option1:** Select the desired kernel entry and use the arrow (displayed on the top menu) to move it up the order.
|
||||
|
||||
![move older kernel up the order ubntu grub][10]
|
||||
|
||||
**Option2:** Make the ‘previously booted entry’ the ‘default entry’.
|
||||
|
||||
![make currently booted entry as default ubuntu][11]
|
||||
|
||||
I would suggest going with option 2 because it will work even when there are new kernel updates.
|
||||
|
||||
This way you downgrade the kernel in Ubuntu or other distributions without even removing the older kernel version.
|
||||
|
||||
Do note that most distributions like Ubuntu only keep two kernel versions at a time. So eventually, your preferred older kernel will be removed with the newer kernel versions.
|
||||
|
||||
This neat trick helped me when I [installed the latest Linux kernel in Ubuntu][12] and it had issues with my audio system for some reason.
|
||||
|
||||
Whatever may be the reason, you now know how to boot into an older kernel automatically.
|
||||
|
||||
Questions? Suggestions? The comment section is all yours.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/boot-older-kernel-default/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[hanszhao80](https://github.com/hanszhao80)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://linuxmint.com/
|
||||
[2]: https://learnubuntu.com/list-installed-kernels/
|
||||
[3]: https://itsfoss.com/what-is-grub/
|
||||
[4]: https://itsfoss.com/wp-content/uploads/2022/06/ubuntu-grub.jpg
|
||||
[5]: https://itsfoss.com/wp-content/uploads/2022/06/Grub-Advanced-Options.jpg
|
||||
[6]: https://itsfoss.com/update-grub/
|
||||
[7]: https://itsfoss.com/customize-grub-linux/
|
||||
[8]: https://itsfoss.com/install-grub-customizer-ubuntu/
|
||||
[9]: https://itsfoss.com/wp-content/uploads/2022/06/grub-customizer-ubuntu.png
|
||||
[10]: https://itsfoss.com/wp-content/uploads/2022/06/move-older-kernel-up-the-order-ubntu-grub.png
|
||||
[11]: https://itsfoss.com/wp-content/uploads/2022/06/make-currently-booted-entry-as-default-ubuntu.png
|
||||
[12]: https://itsfoss.com/upgrade-linux-kernel-ubuntu/
|
@ -2,7 +2,7 @@
|
||||
[#]: via: "https://opensource.com/article/22/7/manage-files-linux-terminal-ranger"
|
||||
[#]: author: "Sumantro Mukherjee https://opensource.com/users/sumantro"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
@ -1,99 +0,0 @@
|
||||
[#]: subject: "Why I love Tig for visualizing my Git workflows"
|
||||
[#]: via: "https://opensource.com/article/22/7/visualize-git-workflow-tig"
|
||||
[#]: author: "Sumantro Mukherjee https://opensource.com/users/sumantro"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Why I love Tig for visualizing my Git workflows
|
||||
======
|
||||
Tig is an excellent tool for reviewing your Git repository by encouraging you to explore the logs without having to construct long and sometimes complex queries.
|
||||
|
||||
![][1]
|
||||
|
||||
Image by: opensource.com
|
||||
|
||||
If you find navigating your Git repositories frustratingly complex, have I got the tool for you. Meet Tig.
|
||||
|
||||
Tig is an [ncurses-based][2] text-mode interface for Git that allows you to browse changes in a Git repository. It also acts as a pager for the output of various Git commands. I use this tool to give me a good idea of what’s been changed in which commit by whom, the latest commit merged, and so much more. Try it for yourself, starting with this brief tutorial.
|
||||
|
||||
### Installing Tig
|
||||
|
||||
On Linux, you can install Tig using your package manager. For instance, on Fedora and Mageia:
|
||||
|
||||
```
|
||||
$ sudo dnf install tig
|
||||
```
|
||||
|
||||
On Debian, Linux Mint, Elementary, Pop_OS, and other Debian-based distributions:
|
||||
|
||||
```
|
||||
$ sud apt install tig
|
||||
```
|
||||
|
||||
On macOS, use [MacPorts][3] or [Homebrew][4]. Tig’s complete installation guide can be found in the [Tig Manual][5].
|
||||
|
||||
### Using Tig
|
||||
|
||||
Tig provides an interactive view of common Git output. For instance, with Git you can view all refs with the command `git show-ref` :
|
||||
|
||||
```
|
||||
$ git show-ref
|
||||
98b108... refs/heads/master
|
||||
6dae95... refs/remotes/origin/1010-internal-share-partition-format-reflexion
|
||||
84e1f8... refs/remotes/origin/1015-add-libretro-openlara
|
||||
e62c7c... refs/remotes/origin/1016-add-support-for-retroarch-project-cd
|
||||
1c29a8... refs/remotes/origin/1066-add-libretro-mess
|
||||
ffd3f53... refs/remotes/origin/1155-automatically-generate-assets-for-external-installers
|
||||
ab4d14... refs/remotes/origin/1160-release-on-bare-metal-servers
|
||||
28baa9... refs/remotes/origin/1180-ipega-pg-9118
|
||||
8dff1d... refs/remotes/origin/1181-add-libretro-dosbox-core-s
|
||||
81a7fe... refs/remotes/origin/1189-allow-manual-build-on-master
|
||||
[...]
|
||||
```
|
||||
|
||||
With Tig, you can get that information and much more in a scrollable list, plus keyboard shortcuts to open additional views with details about each ref.
|
||||
|
||||
![Screenshot of a terminal using Tig. On the left there is a scrollable list of outputs, on the right the details of the selected output (add become an ambassador page) is shown, such as author, date, commit date, sign off, etc.][6]
|
||||
|
||||
Image by: (Sumantro Mukherjee, CC BY-SA 4.0)
|
||||
|
||||
### Pager mode
|
||||
|
||||
Tig enters pager mode when input is provided to stdin (standard input). When the `show` subcommand is specified and the `--stdin` option is given, stdin is assumed to be a list of commit IDs, which is forwarded to `git-show` :
|
||||
|
||||
```
|
||||
$ git rev-list --author=sumantrom HEAD | tig show –stdin
|
||||
```
|
||||
|
||||
### Log and diff views
|
||||
|
||||
When you're in Tig's log view, you can press the d key on your keyboard to display diffs. This displays the files changed in the commit and the lines that were removed and added.
|
||||
|
||||
### Interactive Git data
|
||||
|
||||
Tig is an excellent addition to Git. It makes it easy to review your Git repository by encouraging you to explore the logs without having to construct long and sometimes complex queries.
|
||||
|
||||
Add Tig to your Git toolkit today!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/22/7/visualize-git-workflow-tig
|
||||
|
||||
作者:[Sumantro Mukherjee][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/sumantro
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://opensource.com/sites/default/files/images/life/computer_code_programming_laptop_0.jpg
|
||||
[2]: https://opensource.com/article/21/8/ncurses-linux
|
||||
[3]: https://opensource.com/article/20/11/macports
|
||||
[4]: https://opensource.com/article/20/6/homebrew-mac
|
||||
[5]: https://jonas.github.io/tig/doc/manual.html
|
||||
[6]: https://opensource.com/sites/default/files/2022-06/tig%201.png
|
310
sources/tech/20220707 10 Great KDE Apps for Everyone [Part 2].md
Normal file
310
sources/tech/20220707 10 Great KDE Apps for Everyone [Part 2].md
Normal file
@ -0,0 +1,310 @@
|
||||
[#]: subject: "10 Great KDE Apps for Everyone [Part 2]"
|
||||
[#]: via: "https://www.debugpoint.com/great-kde-apps-part-2/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
10 Great KDE Apps for Everyone [Part 2]
|
||||
======
|
||||
A list of ten great KDE apps spread across productivity, utilities and games. Have a look.
|
||||
|
||||
Many new Linux users don’t know that the KDE ecosystem contains hundreds of “Kool” applications across all functionalities and use cases. This article series aims to highlight them for awareness and collaboration among the users and creators of those apps.
|
||||
|
||||
This is part 2 of the “KDE Apps” series. If you missed the first part, you could read it here.
|
||||
|
||||
[Part 1][1]
|
||||
|
||||
### 10 Great KDE Apps – Part 2
|
||||
|
||||
#### Plan – Project management application
|
||||
|
||||
The first project I would like to feature in this list is one of the best apps – “Plan”. The Plan is a project management application (like Microsoft Project) that can help you to manage moderate to large projects. It is a part of the Calligra suite of applications and is loaded with all necessary features. Additionally, you can create tasks, schedule, assign resources and calculate costs. Other notable features of the Plan include supporting Microsoft Project documents and files you can import and export.
|
||||
|
||||
Perhaps, Plan is one of the feature-rich applications unknown to many project management professionals, and companies end up paying hefty licensing fees to Microsoft Project.
|
||||
|
||||
If you have not checked it out, do it today and manage your projects using this free, open-source software.
|
||||
|
||||
![Plan – KDE App][2]
|
||||
|
||||
**How to Install**
|
||||
|
||||
Installation of the Plan is easy. On the KDE desktop, open Discover and search for “Plan”. And then hit install.
|
||||
|
||||
If you prefer the command line, you can also use the following commands to install Plan.
|
||||
|
||||
For Ubuntu and related distros:
|
||||
|
||||
```
|
||||
sudo apt install calligraplan
|
||||
```
|
||||
|
||||
For Fedora and related distros:
|
||||
|
||||
```
|
||||
sudo dnf install calligraplan
|
||||
```
|
||||
|
||||
**More information**
|
||||
|
||||
* [Home page][3]
|
||||
* [Documentation][4]
|
||||
* [Source code][5]
|
||||
|
||||
#### ISO Image Writer
|
||||
|
||||
As its name says, the second app in this great KDE apps list is “ISO Image Writer”. It is similar to the [Fedora Media Writer][6] tool but with minimal features.
|
||||
|
||||
Using this application, you can choose an ISO image file and directly write it to the target USB device. In addition, you can also erase the contents of the USB file using this app.
|
||||
|
||||
It is available for Windows executable and macOS to help to create Linux ISO files.
|
||||
|
||||
![ISO Image Writer][7]
|
||||
|
||||
**Download**
|
||||
|
||||
You can download the Windows Exe files and macOS packages on [this page][8].
|
||||
|
||||
**More information**
|
||||
|
||||
* [Home page][9]
|
||||
* [Source Code][10]
|
||||
|
||||
#### Muon – Package Manager
|
||||
|
||||
Muon is a package manager similar to the “Synaptic” package manager. It beings features such as system updates, custom software sources, and an easy-to-use package search. You can also search and mark packages for installation using Muon. It is smart enough to prompt you for dependencies before installing a package. I would say, Muon is almost a replica of Synaptic, and the only difference is that it is built using Qt.
|
||||
|
||||
Perhaps, a not-so-popular app for KDE desktop, but a useful one.
|
||||
|
||||
![Muon Package Manager][11]
|
||||
|
||||
Installing the Muon package manager is easy using the following commands for Ubuntu and related distributions.
|
||||
|
||||
```
|
||||
sudo apt install muon
|
||||
```
|
||||
|
||||
**More information**
|
||||
|
||||
* [Home page][12]
|
||||
* [Source code][13]
|
||||
|
||||
#### Peruse – Comic Book Reader
|
||||
|
||||
If you are looking for an avid comic book lover, you should try out the next KDE app – “Peruse”. Peruse is a desktop comic book reader that gives you a unique experience while reading your favourite comics. The welcome screen gives you a thumbnail view of your comics collection sorted by the recently read. In addition, you can enjoy its frame-based navigation, which is available alongside page-based navigation. Moreover, you can also start from where you left off after closing the application.
|
||||
|
||||
Also, it supports all the popular comic book formats as listed below.
|
||||
|
||||
* Comic Book Archive (cbz, cbr, cb7, cbt, cba)
|
||||
* PDF
|
||||
* ePub Books
|
||||
* DeVice Independent files (dvi)
|
||||
* DeJaVu (djvu)
|
||||
* Compiled Help files (chm)
|
||||
|
||||
![Peruse][14]
|
||||
|
||||
Installing Peruse is easy by using the following commands in Ubuntu Linux.
|
||||
|
||||
```
|
||||
sudo apt install peruse
|
||||
```
|
||||
|
||||
It is also available as a Snap package for other Linux distributions. You can download the Snap package [here][15].
|
||||
|
||||
**More information**
|
||||
|
||||
* [Home page][16]
|
||||
* [Source code][17]
|
||||
|
||||
#### Ruqola
|
||||
|
||||
The next app which we list here is “Ruqola”, which is a “Rocket.Chat” client. The “Rocket.Chat” is a fully customisable communication platform which provides data security for those who need it. It is one of the famous and secure communication platforms which is free and open-source. You can either host your server or opt for paid cloud server for Rocket Chat.
|
||||
|
||||
After you set up the server, you can access using Ruqola. Plenty of desktop clients are available, but you can try this app because it is loaded with features and well-integrated with the KDE desktop.
|
||||
|
||||
For example, you can reply to the messages from the notification pop-up on the KDE desktop. Besides that, it supports thread messages, channels, search, offline chat access, multi-account support and many more.
|
||||
|
||||
![Ruqola – A Rocket.Chat Client][18]
|
||||
|
||||
You can install Ruqola in Ubuntu and related distros using the following command.
|
||||
|
||||
```
|
||||
sudo apt install ruqola
|
||||
```
|
||||
|
||||
If you prefer Flatpak, you can install it using the instructions presented [here][19] via the Flathub repo.
|
||||
|
||||
**More information**
|
||||
|
||||
* [Home page][20]
|
||||
* [Source code][21]
|
||||
|
||||
#### Ikona
|
||||
|
||||
The next app is only for the KDE desktop named “Ikona”. If you are a graphics designer, then perhaps this app can assist you in designing icons and visualising your icons in their environment. You can also access Plasma’s Breeze colour palette and export your icons to multiple resolutions.
|
||||
|
||||
Moreover, it is a companion application that helps you when designing icons. Ikona lets you visualize your icons in an environment similar to a Plasma desktop, access the Breeze colour palette and export your icons in multiple sizes.
|
||||
|
||||
![Ikona][22]
|
||||
|
||||
Installing Ikona is easy using the Flatpak. First, set up Flatpak using [this guide][23] and click on the below link to install Ikona.
|
||||
|
||||
[Install Ikona using Flathub][24]
|
||||
|
||||
**More information**
|
||||
|
||||
* [Home page][25]
|
||||
* [Source Code][26]
|
||||
|
||||
#### Kig
|
||||
|
||||
In the first part of this series, we featured a similar graph plotter tool called “Khipu”. However, here’s another minimal version of it – called “Kig”. Kig is a mathematical graph plotter application that teachers and students can use to teach and learn geometry with its interactive plotting interface.
|
||||
|
||||
It has a grid-based canvas where you can draw using your mouse via points, vectors and lines. In addition, it has a wide range of tools to draw more complex plots. Kig is part of [KDE Education project][27].
|
||||
|
||||
![Kig][28]
|
||||
|
||||
Install Kig using the following command in Ubuntu and related Linux distributions.
|
||||
|
||||
```
|
||||
sudo apt install kig
|
||||
```
|
||||
|
||||
**More information**
|
||||
|
||||
* [Home page][29]
|
||||
* [Source code][30]
|
||||
|
||||
#### Kwave
|
||||
|
||||
Kwave is an audio file editor for KDE desktops. Like the famous and “controversial” Audacity audio editor, Kwave is loaded with features to perform many tasks on your audio files.
|
||||
|
||||
If you are looking for an alternative to Audacity, you should check this out. It has a graphical user interface which shows the waveform of your audio file, which you can cut, paste, reduce noise, zoom in/out, scroll and performs multiple channel operations. It is one of the unknown applications for many users.
|
||||
|
||||
![KWave][31]
|
||||
|
||||
Installing Kwave is easy by using the command line. For Ubuntu and related distribution, you can use the following command to install.
|
||||
|
||||
```
|
||||
sudo apt install kwave
|
||||
```
|
||||
|
||||
It is also available as a Snap package [from here][32].
|
||||
|
||||
**More information**
|
||||
|
||||
* [Home page][33]
|
||||
* [Source code][34]
|
||||
|
||||
#### Kapman
|
||||
|
||||
Like the famous “Pac-Man” game? Then try “Kapman”, a clone of the classic Pac-Man game for KDE desktops. You can play around the maze to eat all the pills avoiding the ghost.
|
||||
|
||||
Besides that, Kapman features health boosts via energizers, difficulty levels and several themes for a retro Pac-Man experience.
|
||||
|
||||
![Kapman][35]
|
||||
|
||||
You can install this game using the terminal using the following command in Ubuntu and related distributions.
|
||||
|
||||
```
|
||||
sudo apt install kapman
|
||||
```
|
||||
|
||||
Also, you can install it using [Flatpak][36] or [Snap][37].
|
||||
|
||||
**More information**
|
||||
|
||||
* [Handbook/Documentation][38]
|
||||
* [Source code][39]
|
||||
|
||||
#### Francis
|
||||
|
||||
The popular Pomodoro technique is to break your time into 25-minute chunks separated by 5 minutes break – called one Pomodoro. After 4 Pomodoro, you can take a more extended break. The final app in this list is “Francis”, a Pomodoro-style time tracking app for KDE desktops.
|
||||
|
||||
Francis comes with a single-window which displays a timer. You can start, pause or stop the Pomodoro timer from the toolbar.
|
||||
|
||||
Installing Francis is difficult because the executable link is broken on the official website. You may build it from Source using the Flatpak via the below commands.
|
||||
|
||||
```
|
||||
git clone https://invent.kde.org/fhek/francis.gitcd francisflatpak-builder --repo=repo build-dir --force-clean org.kde.francis.json --install-deps-from=flathubflatpak build-bundle repo francis.flatpak org.kde.francis
|
||||
```
|
||||
|
||||
```
|
||||
flatpak install francis.flatpak
|
||||
```
|
||||
|
||||
**More information:**
|
||||
|
||||
* [Home page][40]
|
||||
* [Source code][41]
|
||||
|
||||
### Conclusion
|
||||
|
||||
That’s a wrap the Part 2 of great KDE Apps, and I hope you get to know some of the unique and homegrown KDE applications. If you missed the first part, you could read it here:
|
||||
|
||||
[Part 1][42]
|
||||
|
||||
Also, if you want to read similar app discovery series for Ubuntu and GNOME desktops, you can read them here.
|
||||
|
||||
Stay tuned for Part 3.
|
||||
|
||||
Cheers.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/great-kde-apps-part-2/
|
||||
|
||||
作者:[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/best-kde-apps-part-1/
|
||||
[2]: https://www.debugpoint.com/wp-content/uploads/2022/07/Plan-KDE-App.jpg
|
||||
[3]: https://calligra.org/plan/
|
||||
[4]: https://docs.kde.org/index.php?application=calligraplan
|
||||
[5]: https://invent.kde.org/office/calligraplan
|
||||
[6]: https://www.debugpoint.com/fedora-media-writer/
|
||||
[7]: https://www.debugpoint.com/wp-content/uploads/2022/07/ISO-Image-Writer.jpg
|
||||
[8]: https://binary-factory.kde.org/job/KDE%20ISO%20Image%20Writer_Nightly_win64/
|
||||
[9]: https://apps.kde.org/isoimagewriter/
|
||||
[10]: https://invent.kde.org/utilities/isoimagewriter
|
||||
[11]: https://www.debugpoint.com/wp-content/uploads/2022/07/Muon-Package-Manager.jpg
|
||||
[12]: https://apps.kde.org/muon/
|
||||
[13]: https://invent.kde.org/system/muon
|
||||
[14]: https://www.debugpoint.com/wp-content/uploads/2022/07/Peruse.jpg
|
||||
[15]: https://snapcraft.io/peruse
|
||||
[16]: https://peruse.kde.org/
|
||||
[17]: https://invent.kde.org/graphics/peruse
|
||||
[18]: https://www.debugpoint.com/wp-content/uploads/2022/07/Ruqola-A-Rocket.Chat-Client.jpg
|
||||
[19]: https://flathub.org/apps/details/org.kde.ruqola
|
||||
[20]: https://apps.kde.org/ruqola/
|
||||
[21]: https://invent.kde.org/network/ruqola
|
||||
[22]: https://www.debugpoint.com/wp-content/uploads/2022/07/Ikona.jpg
|
||||
[23]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/
|
||||
[24]: https://dl.flathub.org/repo/appstream/org.kde.Ikona.flatpakref
|
||||
[25]: https://apps.kde.org/ikona/
|
||||
[26]: https://invent.kde.org/sdk/ikona
|
||||
[27]: https://edu.kde.org/
|
||||
[28]: https://www.debugpoint.com/wp-content/uploads/2022/07/Kig.gif
|
||||
[29]: https://edu.kde.org/kig/
|
||||
[30]: https://invent.kde.org/education/kig
|
||||
[31]: https://www.debugpoint.com/wp-content/uploads/2022/07/KWave.jpg
|
||||
[32]: https://snapcraft.io/kwave
|
||||
[33]: http://kwave.sourceforge.net/
|
||||
[34]: https://invent.kde.org/multimedia/kwave
|
||||
[35]: https://www.debugpoint.com/wp-content/uploads/2022/07/Kapman.jpg
|
||||
[36]: https://flathub.org/apps/details/org.kde.kapman
|
||||
[37]: https://snapcraft.io/kapman
|
||||
[38]: https://docs.kde.org/?application=kapman
|
||||
[39]: https://invent.kde.org/games/kapman
|
||||
[40]: https://apps.kde.org/francis/
|
||||
[41]: https://invent.kde.org/utilities/francis
|
||||
[42]: https://www.debugpoint.com/best-kde-apps-part-1/
|
155
sources/tech/20220707 Check disk usage in Linux.md
Normal file
155
sources/tech/20220707 Check disk usage in Linux.md
Normal file
@ -0,0 +1,155 @@
|
||||
[#]: subject: "Check disk usage in Linux"
|
||||
[#]: via: "https://opensource.com/article/22/7/check-disk-usage-linux"
|
||||
[#]: author: "Don Watkins https://opensource.com/users/don-watkins"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "MjSeven"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Check disk usage in Linux
|
||||
======
|
||||
The du and ncdu commands provide two different views of the same information, making it easy to keep track of what's stored on your computer.
|
||||
|
||||
![Data stack in blue][1]
|
||||
|
||||
Knowing how much of your disk is being used by your files is an important consideration, no matter how much storage you have. My laptop has a relatively small 250GB NVME drive. That's okay most of the time, but I began to explore gaming on Linux a couple of years ago. Installing Steam and a few games can make storage management more critical.
|
||||
|
||||
### The du command
|
||||
|
||||
The easiest way to examine what's left for storage on your disk drive is the [du command][2]. This command line utility estimates file space usage. Like all Linux tools, `du` is very powerful, but knowing how to use it for your particular needs is helpful. I always consult the man page for any utility. This specific tool has several switches to give you the best possible snapshot of file storage and how much space they consume on your system.
|
||||
|
||||
There are many options for the `du` command. Here are some of the common ones:
|
||||
|
||||
* -a - write counts for all files and not just directories
|
||||
* --apparent-size - prints apparent sizes rather than disk usage
|
||||
* -h - human-readable format
|
||||
* -b - bytes
|
||||
* -c -grand total
|
||||
* -k - block size
|
||||
* -m - size in megabytes
|
||||
|
||||
Be sure to check the `du` man page for a complete listing.
|
||||
|
||||
#### Display all files
|
||||
|
||||
The first option you could choose is `du -a`. It provides a readout of all files on your system and the directories they are stored in. This command lets me know I've got 11555168 bytes stored in my home directory. Using `du -a` provides a quick recursive look at my storage system. What if I want a more meaningful number, and I want to drill down into the directories to see where the big files are on my system?
|
||||
|
||||
I think there are some big files in my `Downloads` directory, so I enter `du -a /home/don/Downloads` to get a good look at that `Downloads` directory.
|
||||
|
||||
```
|
||||
$ du -a ~/Downloads
|
||||
4923 ./UNIX_Driver_5-0/UNIX Driver 50
|
||||
4923 ./UNIX_Driver_5-0
|
||||
20 ./epel-release-latest-9.noarch.rpm
|
||||
12 ./rpmfusion-free-release-9.noarch.rpm
|
||||
2256 ./PZO9297 000 Cover.pdf
|
||||
8 ./pc.md
|
||||
2644 ./geckodriver-v0.31.0-linux64.tar.gz
|
||||
466468
|
||||
```
|
||||
|
||||
The numbers on the far left are the file sizes in bytes. I want something more helpful to me so I add the switch for the human-readable format to my `du -h /home/don/Downloads` command. The result is 4.8 G(igabytes) which is a more useful number format for me.
|
||||
|
||||
```
|
||||
$ du -a ~/Downloads
|
||||
4.9M ./UNIX_Driver_5-0/UNIX Driver 50
|
||||
4.9M ./UNIX_Driver_5-0
|
||||
20K ./epel-release-latest-9.noarch.rpm
|
||||
12K ./rpmfusion-free-release-9.noarch.rpm
|
||||
2.2M ./PZO9297 000 Cover.pdf
|
||||
8.0K ./pc.md
|
||||
2.6M ./geckodriver-v0.31.0-linux64.tar.gz
|
||||
456M .
|
||||
```
|
||||
|
||||
As with most Linux commands, you can combine options. To look at your `Downloads` directory in a human-readable format, use the `du -ah ~/Downloads` command.
|
||||
|
||||
**[[ Read also: 5 Linux commands to check free disk space ]][3]**
|
||||
|
||||
#### Grand total
|
||||
|
||||
The `-c` option provides a grand total for disk usage at the last line. I can use `du -ch /home/don` to display every file and directory in my home directory. There is a lot of information, and I really just want what is at the end, so I will pipe the disk usage command to `tail`. The command is `du -ch /home/don | tail`.
|
||||
|
||||
![pipe the du command output into tail][4]
|
||||
|
||||
Image by:
|
||||
|
||||
(Don Watkins, CC BY-SA 4.0)
|
||||
|
||||
### The ncdu command
|
||||
|
||||
Another option for Linux users interested in what is stored on their drive is the [ncdu command][5]. The command stands for *NCurses Disk Usage*. Depending on your Linux distribution, you may need to download and install it.
|
||||
|
||||
On Linux Mint, Elementary, Pop_OS!, and other Debian-based distributions:
|
||||
|
||||
```
|
||||
$ sudo apt install ncdu
|
||||
```
|
||||
|
||||
On Fedora, Mageia, and CentOS:
|
||||
|
||||
```
|
||||
$ sudo dnf install ncdu
|
||||
```
|
||||
|
||||
On Arch, Manjaro, and similar:
|
||||
|
||||
```
|
||||
$ sudo pacman -S ncdu
|
||||
```
|
||||
|
||||
Once installed, you can use `ncdu` to analyze your filesystem. Here is a sample output after issuing `ncdu` inside my home directory. The man page for `ncdu` states that "ncdu (NCurses Disk Usage) is a curses-based version of the well-known `du`, and provides a fast way to see what directories are using your disk space."
|
||||
|
||||
![du command home directory output][6]
|
||||
|
||||
Image by:
|
||||
|
||||
(Don Watkins, CC BY-SA 4.0)
|
||||
|
||||
I can use the arrow keys to navigate up and down and press the **Enter** key to enter a directory. An interesting note is that `du` reported total disk usage in my home directory as 12GB, and `ncdu` reports that I have total disk usage of 11GB. You can find more information in the `ncdu` man page.
|
||||
|
||||
You can explore a particular directory by pointing `ncdu` to that directory. For example, `ncdu /home/don/Downloads`.
|
||||
|
||||
![ncdu command output][7]
|
||||
|
||||
Image by:
|
||||
|
||||
(Don Watkins, CC BY-SA 4.0)
|
||||
|
||||
Press the **?** key to display the Help menu
|
||||
|
||||
![ncdu help][8]
|
||||
|
||||
Image by:
|
||||
|
||||
(Don Watkins, CC BY-SA 4.0)
|
||||
|
||||
### Wrap up
|
||||
|
||||
The `du` and `ncdu` commands provide two different views of the same information, making it easy to keep track of what's stored on your computer.
|
||||
|
||||
If you're not comfortable in the terminal or just looking for yet another view of this kind of information, check out the [GNOME Disk Usage Analyzer][9]. You can easily install and use it if it's not already on your system. Check your distribution for `baobab` and install it if you'd like to experiment.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/22/7/check-disk-usage-linux
|
||||
|
||||
作者:[Don Watkins][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/don-watkins
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://opensource.com/sites/default/files/lead-images/data_stack_blue_disks.png
|
||||
[2]: https://opensource.com/article/21/7/check-disk-space-linux-du
|
||||
[3]: https://opensource.com/article/18/7/how-check-free-disk-space-linux
|
||||
[4]: https://opensource.com/sites/default/files/2022-06/1-du-tail.png
|
||||
[5]: https://opensource.com/article/21/8/ncdu-check-free-disk-space-linux
|
||||
[6]: https://opensource.com/sites/default/files/2022-06/2home.png
|
||||
[7]: https://opensource.com/sites/default/files/2022-06/3downloads.png
|
||||
[8]: https://opensource.com/sites/default/files/2022-06/4ncdu.png
|
||||
[9]: https://help.gnome.org/users/baobab/stable/
|
@ -0,0 +1,307 @@
|
||||
[#]: subject: "Recommender Systems: An Overview of the Mathematics"
|
||||
[#]: via: "https://www.opensourceforu.com/2022/07/recommender-systems-an-overview-of-the-mathematics/"
|
||||
[#]: author: "Dibyendu Banerjee https://www.opensourceforu.com/author/dibyendu-banerjee/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Recommender Systems: An Overview of the Mathematics
|
||||
======
|
||||
This two-part series of articles explains and demonstrates how to implement a recommender system for an online retail store using Python. In this first part of the series, the focus is on the theory behind such a system. The implementation will be covered in the second part.
|
||||
|
||||
![retail-amazon-featured-img][1]
|
||||
|
||||
Recommender systems are now widely used to personalise your online experience, advising you on what to buy, where to dine, and even who you should be friends with. People’s preferences vary, yet they tend to follow a pattern. They have a tendency to like things that are comparable to the other things they enjoy, and they have tastes that are similar to the tastes of the people they know. Recommender systems attempt to capture these trends to forecast what users might enjoy in the future. E-commerce sites, social networks, and online news platforms actively implement their own recommender systems to assist customers in making product choices more efficiently.
|
||||
|
||||
You would have observed that Netflix and Amazon Prime recommend content that is similar to what you watched previously. So, how does this happen? It’s because of a machine learning based recommendation engine that figures out how similar the videos are to other things you like, and then it predicts your choices.
|
||||
|
||||
In 2006, Netflix announced a competition to develop an algorithm that would “significantly increase the accuracy of forecasts about how much someone will enjoy a movie based on their movie tastes.” Since then, Netflix has expanded its use of data to include personalised ranking, page generation, search, picture selection, messaging, and marketing, among other things. The Netflix Recommendation Engine (NRE), its most effective algorithm, is made up of algorithms that select content based on each individual user profile. It’s so accurate that customised recommendations drive 80 per cent of Netflix’s viewer engagement.
|
||||
|
||||
Netflix isn’t the only business that uses a recommender system. Amazon, LinkedIn, Spotify, Instagram, YouTube, and a few other websites employ recommendation algorithms to anticipate customer preferences and grow their businesses.
|
||||
|
||||
With the growth of YouTube, Amazon, Netflix, and other similar Web services over the last few decades, recommender systems have become increasingly important in our lives. In a broad sense, these systems are algorithms that try to propose relevant items to consumers (these can range from music to perfumes, books, products to buy or anything else, depending on the industries).
|
||||
|
||||
![Figure 1: E-commerce sites show alternative products][2]
|
||||
|
||||
Now let’s look at the various recommender system paradigms and how they work, outline their mathematical foundations, and discuss the strengths and weaknesses of each of them.
|
||||
|
||||
#### Relationships in the context of developing a recommendation system
|
||||
|
||||
*User-product relationship:* When some users have an affinity or desire for specific items, this is known as the user-product connection. An athlete, for example, may have a taste for athletics-related things; therefore the e-commerce website will create an *Athletics -> Sports user-product* relationship.
|
||||
|
||||
*Product-product relationship:* When items are similar in nature, whether by look or description, they form product-product associations. Books or music in the same genre, and dishes from the same cuisine are all such examples.
|
||||
|
||||
*User-user relationship:* When two or more customers have similar tastes in a product or service, they form user-user relationships. Mutual friends, same backgrounds, comparable ages, and so on, are examples of this.
|
||||
|
||||
![Figure 2: Related product recommendations][3]
|
||||
|
||||
#### Providing data for a recommender system, and some challenges
|
||||
|
||||
Data can be provided to a recommender system in a variety of methods. Explicit and implicit ratings are two of the most essential methods.
|
||||
|
||||
**Explicit ratings:** The user expresses his or her opinion through explicit ratings. Star ratings, reviews, feedbacks, likes, and following someone are just a few examples. Exact ratings can be difficult to obtain because people do not always rate things.
|
||||
|
||||
![Figure 3: Location specific recommendations][4]
|
||||
|
||||
*Implicit ratings:* When people interact with an item, they give implicit ratings. These infer a user’s activity and are simple to obtain because consumers click implicit ratings subconsciously. Clicks, views, and purchases are all examples of such ratings.
|
||||
|
||||
![Figure 4: Content based filtering][5]
|
||||
|
||||
| - |
|
||||
| :- |
|
||||
| Note: Users spend time and money on what is most important to them; therefore views and purchases are a better entity to promote. |
|
||||
|
||||
There are some specific technical challenges to building a recommendation engine, some of which are explained below.
|
||||
|
||||
* Lack of data: To produce effective predictions, recommender systems require a huge amount of data. Large firms like Google, Apple and Amazon can generate better
|
||||
recommendations since they collect data about their customers on a regular basis. There are also recommender systems that are based just on purchases, with no ratings recorded. If clients do not rate a book, Amazon does not know how much they enjoyed it.
|
||||
* Cold start: This situation comes when new customers or new items are added to the system; a new item cannot be recommended to customers when it is first introduced to the recommender system because it lacks ratings or reviews, making it difficult to predict the choice or interest of customers, resulting in less accurate recommendations. A newly released movie, for example, cannot be recommended to the user until it has received some ratings. A new customer item added-based problem is difficult to handle because it is impossible to find similar users without prior knowledge of their interests or preferences.
|
||||
Sparsity: This occurs when the majority of users do not provide ratings or reviews for the items they purchase, causing the rating model to become very sparse, potentially leading to data sparsity issues. This reduces the chances of finding a group of users with similar ratings or interests.
|
||||
* Latency: Many products are added frequently to the database of recommendation systems; however, only the previously existing products are generally recommended to users because newly added products have not yet been rated.
|
||||
|
||||
![Figure 5: Collaborative filtering][6]
|
||||
|
||||
#### Use cases for recommender systems
|
||||
|
||||
The following are some of the potential use cases of a recommender system that can add value to a business.
|
||||
|
||||
* Alternative product recommendations: You’ve probably tried to buy something you wanted, only to find it wasn’t available. But it’s unlikely you left the website after that. Instead, you may come across something similar, which you may or may not purchase. Companies utilise a recommendation system to keep customers online by providing them with alternatives to the product they want.
|
||||
* Related product recommendations: Another important application of recommender systems is related product recommendations. When customers make a purchase, it’s only natural to offer them something complementary. If a customer purchases a wrist watch, the system may suggest a wallet, which goes well with it.
|
||||
* Real-time true personalisation: With every second of customer activity on e-commerce sites, recommender systems can provide product or content or lifestyle recommendations. They can serve as a shopping assistant, using all the information the customer gives to offer improved recommendations, thus creating a better shopping experience.
|
||||
|
||||
### Recommender systems: A broad categorisation
|
||||
|
||||
#### Content-based filters
|
||||
|
||||
Content-based recommender systems give recommendations based on objects or user metadata. The user’s previous purchases are scrutinised. For example, if a user has previously read a book by a particular author or purchased a product from a particular brand, it is considered that the user has a preference for that author or brand and is likely to purchase a similar product in the future. For example, if a user likes the book ‘The Adventures of Feluda’ by Satyajit Ray, then the system recommends more books by the same author or other detective books like ‘The Mystery of the Fortress & Other Stories’.
|
||||
|
||||
Two types of data are used in this filtering. The first includes the user’s preferences, interests, and personal information such as age or, in some cases, the user’s history. The user vector represents this information. The second is an item vector, which is a collection of information about a product. The item vector contains all the information that can be used to calculate the similarity between things. Cosine similarity is used to determine the recommendations.
|
||||
|
||||
#### Collaborative filtering
|
||||
|
||||
This is regarded as one of the most intelligent recommender systems, and is based on the similarity between different users and things such as e-commerce websites and online movie websites. It makes recommendations based on the preferences of comparable users. Similarity is not limited to the user’s preference; it can also be considered between distinct objects. If we have a big amount of knowledge about people and things, the algorithm will make more efficient recommendations.
|
||||
|
||||
Collaborative filtering is a method of recommending items that a user might enjoy based on the reactions of other users. It works by sifting through a huge group of people to locate a smaller group of users with likes similar to a specific user. It analyses their favourite things and creates a ranked list of recommendations.
|
||||
|
||||
A collaborative filtering system’s workflow is usually as follows:
|
||||
|
||||
* A user expresses his or her choices by rating system objects (for example, music, books, or movies). These ratings might be considered as an approximation of the user’s interest in the topic.
|
||||
* The system matches this user’s preferences against other user preferences and finds the people with the most ‘similar’ choice.
|
||||
* The system recommends items that similar users have rated the most but have not yet been rated by this user (the absence of rating is often considered as unfamiliarity with an item).
|
||||
|
||||
The main challenge of collaborative filtering is combining and weighing the preferences of user neighbours. Users can sometimes rate the recommended items right away. As aresult, over time, the system obtains a more accurate depiction of consumer preferences.
|
||||
|
||||
#### The math behind finding the ‘similarity’ to recommend
|
||||
|
||||
So, how does a recommender system determine ‘similarity’? The distance metric is used to do this. Similarity is a subjective concept that varies greatly depending on the domain and application. The points closest to each other are the most similar, while the points furthest apart are the least relevant. Two films, for example, may be comparable in terms of genre, length, or actors. When measuring distance between unrelated dimensions/features, caution is advised. The relative values of each element must be normalised, else the distance calculation will be dominated by one feature.
|
||||
|
||||
**Minkowski distance:** The Minkowski distance is the general form when the dimension of a data point is numeric. It’s a metric for vector spaces with real values. Minkowski distance can only be calculated in a normed vector space, which is a space where distances can be represented as a vector with a length that cannot be negative. Manhattan(r=1) and Euclidean(r=2) distance measurements are generalisations of this generic distance metric.
|
||||
|
||||
The formula shown above for Minkowski distance is in a generalised form, and we can manipulate it to get different distance metrics. Here, the ‘p’ value can be manipulated to give us different distances like:
|
||||
|
||||
![][7]
|
||||
|
||||
* p = 1; when p is set to 1, it is Manhattan distance
|
||||
* p = 2; when p is set to 2, it is Euclidean distance
|
||||
|
||||
**Manhattan distance:** This distance is also known as taxicab distance or city block distance because of how it is calculated. The sum of the absolute differences of two places’ Cartesian coordinates is the distance between them – it’s the distance between two places when measured at right angles along axes. The formula is:
|
||||
|
||||
**[Euclidean distance:][8]** The square root of the sum of squares of the difference between the coordinates is given by the Pythagorean theorem:
|
||||
|
||||
![][9]
|
||||
|
||||
**[Cosine similarity:][10]** This is a metric that is useful in determining how similar the data objects are, irrespective of their size. Cosine similarity calculates the cosine of the angle between two vectors to determine how similar they are. In cosine similarity, data objects in a data set are treated as a vector. The formula to find the cosine similarity between two vectors is:
|
||||
|
||||
![][11]
|
||||
|
||||
```
|
||||
Cos(x, y) = x . y / ||x|| * ||y||
|
||||
```
|
||||
|
||||
where,
|
||||
|
||||
* x, y = product (dot) of the vectors ‘x’ and ‘y’
|
||||
* ||x|| and ||y|| = length of the two vectors ‘x’ and ‘y’
|
||||
* ||x|| * ||y|| = cross product of the two vectors ‘x’ and ‘y’
|
||||
|
||||
The cosine similarity between two vectors is measured in ‘θ’. If θ = 0°, the ‘x’ and ‘y’ vectors overlap, thus proving they are similar. If θ = 90°, the ‘x’ and ‘y’ vectors are dissimilar.
|
||||
|
||||
#### Word embedding in the context of building a recommender system
|
||||
|
||||
Word embeddings are texts that have been translated into numbers, and there may be multiple numerical representations of the same text. But before we get into the specifics of word embedding, we need to consider the following question: Why do we need it?
|
||||
|
||||
Many machine learning algorithms and almost all deep learning architectures are unable to interpret strings or plain text in their raw form, as we all know. They need numbers as inputs to accomplish any task, including classification, regression, and so forth. Word embedding is nothing but the process of converting text data to numerical vectors. These vectors are then utilised to create a variety of machine learning models. In a sense, we could describe this as extracting features from text in order to create numerous natural language processing models.
|
||||
|
||||
We can transform text data into numerical vectors in a variety of ways. We’ll learn about numerous word embedding strategies with examples in this post, as well as how to apply them in Python.
|
||||
|
||||
### Techniques for word embedding
|
||||
|
||||
The common and easy word embedding methods for extracting characteristics from text are:
|
||||
|
||||
* TF-IDF
|
||||
* Bag of words
|
||||
* Word2vec
|
||||
|
||||
#### TF-IDF
|
||||
|
||||
A popular word embedding technique for extracting features from corpus or language is TF-IDF. It is a statistical way of finding how important a word is to a document over other documents.
|
||||
|
||||
TF stands for ‘term frequency’. In TF, we assign a score to each word or symbol according to how frequently it appears. The frequency of a word is determined by the document’s length. This means that a word appears more frequently in huge documents than in small or medium documents. To solve this problem, we can normalise the frequency of a word by dividing it by the length of the document (total number of words).
|
||||
|
||||
Using this method, we may create a sparse matrix with the frequency of each word.
|
||||
|
||||
```
|
||||
TF=Number of times a term occurs in a document/total number of words in a document
|
||||
```
|
||||
|
||||
#### IDF
|
||||
|
||||
The full form of IDF is ‘inverse document frequency’. Here, we are assigning a score value to a word, which explains how infrequent a word is across all documents. Infrequent words have higher IDF scores.
|
||||
|
||||
```
|
||||
IDF = log base e (total number of documents/number of documents that have the term)
|
||||
|
||||
TF - IDF = TF * IDF
|
||||
```
|
||||
|
||||
TF-IDF value is increased based on the frequency of the word in a document. This approach is mostly used for document/text classification, and also successfully used by search engines like Google as a ranking factor for content.
|
||||
|
||||
When compared to the words that are relevant to a document, some common words (like ‘a’, ‘the’, ‘is’) appear relatively frequently in a huge text corpus. These popular words convey very little information about the document’s actual contents. If we fed the count data of these commonly occurring words directly to a classifier, the frequencies of rarer but more intriguing phrases would be overshadowed. So, ideally, what we want is to give lesser weightage to the common words occurring in almost all documents and give more importance to words that appear in a subset of documents.
|
||||
|
||||
The TF-IDF transform is frequently used to re-weigh count features into floating point values suitable for use by a classifier. This technique considers the occurrence of a word over the entire corpus, not just in a single document. Consider a business article — it will have more business-related terms like stock markets, prices, shares, and so on, than any other article, but terms like ‘a’, ‘an’, and ‘the’ will also appear frequently in it. As a result, this technique will punish certain high-frequency words.
|
||||
|
||||
Consider the table given below, which shows the total number of terms (tokens/words) in two papers.
|
||||
|
||||
| - | - | - | - |
|
||||
| :- | :- | :- | :- |
|
||||
| Document 1 | Document 2 |
|
||||
| TERM | COUNT | TERM | COUNT |
|
||||
| this | 1 | this | 1 |
|
||||
| is | 1 | is | 2 |
|
||||
| about | 2 | about | 1 |
|
||||
| pandemic | 4 | technology | 1 |
|
||||
|
||||
Let’s define a few terminologies associated with TF-IDF now.
|
||||
|
||||
```
|
||||
Term Frequency (TF) = (Number of times term t appears in a document)/(Number of terms in the document)
|
||||
So, TF (This, Document1) = 1/8
|
||||
TF (This, Document2) =1/5
|
||||
```
|
||||
|
||||
This denotes the word’s contribution to the document, i.e., terms that are relevant to the document should appear frequently. For example, a document discussing a pandemic should use the word ‘pandemic’ frequently.
|
||||
|
||||
```
|
||||
IDF = log (N/n), where, N is the number of documents and n is the number of documents a term t has appeared in.
|
||||
So, IDF (This) = log (2/2) = 0.
|
||||
```
|
||||
|
||||
So, what’s the best way to explain why IDF exists. Ideally, if a term appears multiple times in a paper, it is unlikely that it is significant to that document. However, if it appears in a subset of papers, it is likely that the word is relevant to the documents in which it appears.
|
||||
|
||||
Let us compute IDF for the word ‘pandemic’:
|
||||
|
||||
```
|
||||
IDF (pandemic) = log (2/1) = 0.301.
|
||||
```
|
||||
|
||||
Now, let us compare the TF-IDF for a common word ‘this’ and a word ‘pandemic’ which seems to be of relevance to Document 1.
|
||||
|
||||
```
|
||||
TF-IDF (this, Document1) = (1/8) * (0) = 0
|
||||
TF-IDF (this, Document2) = (1/5) * (0) = 0
|
||||
TF-IDF (pandemic, Document1) = (4/8)*0.301 = 0.15
|
||||
```
|
||||
|
||||
As you can see, for Document 1, the TF-IDF method heavily penalises the word ‘this’, but assigns greater weight to ‘pandemic‘. So, this may be understood as ‘pandemic’ is an important word for Document 1 from the context of the entire corpus.
|
||||
|
||||
### Bag of words
|
||||
|
||||
Humans can understand a language in a fraction of a second. Machines, on the other hand, are unable to comprehend a language. We need to translate the text into a numerical format that the system can interpret. Because most machine learning and statistical models deal with quantitative data, we must transform all the texts to numbers. Bag of words is one of the simplest techniques to do this. In this approach, we perform two operations:
|
||||
|
||||
* Tokenization
|
||||
* Vectors creation
|
||||
|
||||
**Tokenization:** This is the process of breaking down each sentence into words or smaller chunks. Each word or symbol is referred to as a token in this context. We can take unique words from the corpus after tokenization. The tokens we have from all the documents we’re examining for the bag of words construction are referred to as ‘corpus’.
|
||||
|
||||
**Vectors creation:** Here, the size of the vector is equal to the number of unique words of the corpus. We can fill each position of a vector with the corresponding word frequency in each sentence. Let’s look at an example.
|
||||
|
||||
* I like to drink tea.
|
||||
* Tea is good for your health.
|
||||
* Tea is more popular than coffee in India.
|
||||
|
||||
If we want to analyse the above sentences or build any ML model, we first need to convert them into numbers, as I mentioned above.
|
||||
|
||||
The first step is to tokenize the sentences. This is nothing but splitting the above three sentences into individual words.
|
||||
|
||||
![Figure 6: Euclidean distance and Manhattan distance][12]
|
||||
|
||||
The next step is to find all the unique words from the above sentences and build the vocabulary. We’ll have to make a dictionary with keys and values. The words in our corpus serve as keys, and the frequency of those terms throughout the corpus serves as values. To put it another way, simply count the number of times each word appears in each sentence.
|
||||
From Table 1, we can see the numbers corresponding to the respective sentences. The first row represents the vector for sentence 1. Given below are the vectors for:
|
||||
|
||||
```
|
||||
Sentence 1 = [1,1,1,1,1,0,0,0,0,0,0,0,0,0,0]
|
||||
Sentence 2 = [0,0,0,0,1,1,1,1,1,0,0,0,0,0,0]
|
||||
Sentence 3 = [0,0,0,0,1,1,0,0,0,1,1,1,1,1,0]
|
||||
```
|
||||
|
||||
The bag of words paradigm is based on this concept. The above vector representation can be used as an input for ML or statistical models.
|
||||
|
||||
![table 1][13]
|
||||
|
||||
### Word2vec
|
||||
|
||||
In a sentence, every word is dependent on another word or words. Word dependencies must be captured if we are to uncover commonalities and relationships between words.
|
||||
|
||||
We can’t capture the meaning or relationship of words from vectors using the bag of words and TF-IDF approaches. Word2vec creates embeddings, which are vectors. The word2vec model takes a big corpus as input and outputs it in vector space. The dimensionality of this vector space could be in the hundreds. This vector space will be used to position each word vector.
|
||||
|
||||
![Figure 7: Cosine similarity][14]
|
||||
|
||||
In vector space, all words in a corpus that are closer to each other share a common context. In this space, a word vector contains the positions of associated words.
|
||||
|
||||
Continuous bag of words (CBOW) and skip-gram are two neural network-based versions offered by word2vec. The neural network model in CBOW takes a variety of words as input and predicts a target word that is closely connected to the input words’ context. The skip-gram design, on the other hand, takes one word as input and anticipates its closely related context terms.
|
||||
|
||||
CBOW is faster and finds better numerical representations for common words, although skip-gram can represent rare words effectively. Word2vec models excel at capturing semantic connections between words. Consider the relationship between a country and its capital, such as France’s capital, Paris, and Germany’s capital, Berlin. These models are best at doing semantic analysis, which is useful for making recommendations.
|
||||
|
||||
**Applicability of word2vec models in building product recommendations:** Word2vec uses the sequential nature of the text as a fundamental property of a natural language to produce vector representations of text. There is a word sequence in every sentence or phrase. We would have great difficulty understanding the text without this sequence.
|
||||
|
||||
One such example is the purchases made by consumers on e-commerce websites online. There is generally a pattern in the buying behaviour of consumers. For instance, a person involved in sports-related activities might have an online buying pattern similar to what is shown in Figure 8.
|
||||
|
||||
![Figure 8: Purchase history][15]
|
||||
|
||||
We can quickly locate related products if we can represent each of these things as a vector. So, if a user is looking at a product online, we can quickly offer related things to him or her based on the product’s vector similarity score. However, how can we obtain a vector representation of these items? Is it possible to obtain these vectors using the word2vec model? Yes, it is! Consider a customer’s purchasing history as a sentence, with the products as the words, as shown in Figure 9.
|
||||
|
||||
![Figure 9: Customer’s purchasing history as a sentence][16]
|
||||
|
||||
So we have seen how a recommender system works and the mathematics behind it. We have also covered some basics of the ML being used in such a system. In the next part of this two-part series of articles, we will see how we can apply the knowledge learnt here to build a recommender system in Python.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.opensourceforu.com/2022/07/recommender-systems-an-overview-of-the-mathematics/
|
||||
|
||||
作者:[Dibyendu Banerjee][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/dibyendu-banerjee/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://www.opensourceforu.com/wp-content/uploads/2022/05/retail-amazon-featured-img.jpg
|
||||
[2]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-1-E-commerce-sites-show-alternative-products.jpg
|
||||
[3]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-2-Related-product-recommendations.jpg
|
||||
[4]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-3-Location-specific-recommendations.jpg
|
||||
[5]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-4-Content-based-filtering.jpg
|
||||
[6]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-5-Collaborative-filtering.jpg
|
||||
[7]: https://www.opensourceforu.com/wp-content/uploads/2022/05/equation-1.jpg
|
||||
[8]: https://www.opensourceforu.com/wp-content/uploads/2022/05/equation-2.jpg
|
||||
[9]: https://www.opensourceforu.com/wp-content/uploads/2022/05/equation-2.jpg
|
||||
[10]: https://www.opensourceforu.com/wp-content/uploads/2022/05/equation-3.jpg
|
||||
[11]: https://www.opensourceforu.com/wp-content/uploads/2022/05/equation-3.jpg
|
||||
[12]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-6-Euclidean-distance-and-Manhattan-distance.jpg
|
||||
[13]: https://www.opensourceforu.com/wp-content/uploads/2022/05/table-1.jpg
|
||||
[14]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-7-Cosine-similarity.jpg
|
||||
[15]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-8-Purchase-history.jpg
|
||||
[16]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-9-Customers-purchasing-history-as-a-sentence.jpg
|
151
sources/tech/20220707 Use secret keyboard keys on Linux.md
Normal file
151
sources/tech/20220707 Use secret keyboard keys on Linux.md
Normal file
@ -0,0 +1,151 @@
|
||||
[#]: subject: "Use secret keyboard keys on Linux"
|
||||
[#]: via: "https://opensource.com/article/22/7/linux-compose-key-cheat-sheet"
|
||||
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Use secret keyboard keys on Linux
|
||||
======
|
||||
With a compose key, you're not limited to what's on your keyboard. Download the cheat sheet.
|
||||
|
||||
![Linux keys on the keyboard for a desktop computer][1]
|
||||
|
||||
A typical computer keyboard has only about 100 keys on it.
|
||||
|
||||
Most keys double up on characters, also called glyphs, thanks to the Shift key. Glyphs are frequently used to type letters with accents and umlauts, to produce characters used in mathematic or monetary expressions, or just to add fun emojis. In some regions there are even three glyphs available on select keys.
|
||||
|
||||
Regardless of your region, however, some glyphs don't make it onto your keyboard. Fortunately, Linux provides access to these through a compose key.
|
||||
|
||||
There's no compose key on your keyboard, at least not by default, but you can designate a key you're not otherwise using as your compose key. I use the Alt key to the right of the spacebar on my desktop keyboard and the Menu key on my laptop.
|
||||
|
||||
**[[ Download the cheat sheet: Linux compose key ]][2]**
|
||||
|
||||
### Setting a Compose key in GNOME
|
||||
|
||||
![A screenshot shows the keyboard and mouse options visible. The "Compose Key" option is set to Right Alt.][3]
|
||||
|
||||
Image by:
|
||||
|
||||
(Seth Kenlon, CC BY-SA 4.0)
|
||||
|
||||
On the GNOME desktop, install the Tweaks application from your software repository. You can also install it from a terminal (use `apt` for Debian-based distributions, `dnf` for Fedora and similar):
|
||||
|
||||
```
|
||||
$ sudo dnf install gnome-tweaks
|
||||
```
|
||||
|
||||
After you launch Tweaks:
|
||||
|
||||
1. Click on the Keyboard & Mouse category in the left column.
|
||||
2. Locate the Compose key setting and choose a key to designate.
|
||||
3. Close Tweaks.
|
||||
|
||||
### Setting a Compose key in KDE Plasma Desktop
|
||||
|
||||
![A screenshot shows the advanced options threaded under Keyboard settings. "Configure keyboard options" is checked, "Position of Compose Key" is checked within that menu, and "Right Alt" is checked within that menu.][4]
|
||||
|
||||
Image by:
|
||||
|
||||
(Seth Kenlon, CC BY-SA 4.0)
|
||||
|
||||
On the KDE Plasma Desktop, open System Settings and navigate to the Input Devices control panel. Then:
|
||||
|
||||
1. In the Input Devices panel, click the Advanced tab.
|
||||
2. Find the Compose key list item and choose a key to designate.
|
||||
3. Click the Apply button in the bottom right corner of the window and then close System Settings.
|
||||
|
||||
### Using compose sequences
|
||||
|
||||
To enter a hidden character, press the compose key and then release it. You're now in compose mode. While in compose mode, you can press and release one key and then another to combine characters.
|
||||
|
||||
For instance:
|
||||
|
||||
1. Press the compose key and release it. You are now in compose mode.
|
||||
2. Press an apostrophe (') and then release it.
|
||||
3. Press the letter E and then release it. This is a valid combination, so you are now out of compose mode.
|
||||
|
||||
You've just typed the letter É!
|
||||
|
||||
Some compose sequences are a combination of just two keys, while others require three keys, and at least one special glyph uses a series of four key presses.
|
||||
|
||||
### The secret glyphs
|
||||
|
||||
It's a small world, so there's a good chance you've got friends whose names use glyphs that aren't native to your keyboard. You can now stop skipping over diacritics and type names using the appropriate modifiers.
|
||||
|
||||
Here's a sample list of compose sequences for common diacritics:
|
||||
|
||||
* ' + <letter> = á é í ó ú ć ń ý j́́ ẃ ź
|
||||
* ` + <letter> = à è ì ò ù ǹ ỳ ẁ
|
||||
* ~ + <letter> = ã ẽ ĩ õ ũ ñ ỹ
|
||||
* ^ + <letter> = â ê î ô û ĉ ŷ ĵ ŵ ẑ
|
||||
* u + <letter> = ă ĕ ĭ ŏ ŭ
|
||||
* c + c = č
|
||||
* - + <letter> = ā ē ī ō ū đ
|
||||
* , + <letter> = ą ę į ǫ ų ç ḑ ţ
|
||||
|
||||
That's not a complete list, but it covers a lot of the common ones.
|
||||
|
||||
#### Currency
|
||||
|
||||
International banking gets a little easier thanks to the compose key, too:
|
||||
|
||||
* - + Y = ¥
|
||||
* - + L = £
|
||||
* = + E = €
|
||||
* = + L = ₤
|
||||
* = + N = ₦
|
||||
* = + R = ₹
|
||||
* = + W = ₩
|
||||
* / + m = ₥
|
||||
* R + s = ₨
|
||||
* C + r = ₢
|
||||
* F + r = ₣
|
||||
|
||||
Once again, that's not a complete list, but it's a good start.
|
||||
|
||||
#### Fun glyphs
|
||||
|
||||
Diacritics and currency are useful, but the compose key can be used just for fun, too.
|
||||
|
||||
* < + 3 = ♥
|
||||
* < + > = ⋄
|
||||
* # + q = ♩
|
||||
* : + ) = ☺
|
||||
* : + ( = ☹
|
||||
* p + o + o = 💩
|
||||
|
||||
#### Live long and prosper
|
||||
|
||||
My favorite "secret" glyph in Linux is the traditional Vulcan salutation, "Live long and prosper."
|
||||
|
||||
* L + L + A + P = 🖖
|
||||
|
||||
### Finding all the glyphs
|
||||
|
||||
There are many more glyphs available through the compose key, and you can have fun discovering new ones by pressing random compose sequences. A more methodical method for finding glyphs is to refer to the `Compose` file, located in `/usr/share/X11/locale/en_US.UTF-8` (adjust the exact path depending on the locale your keyboard uses).
|
||||
|
||||
That file can admittedly be overwhelming, as it consists of over 6,000 lines of compose sequences, many of which are complex combinations of ASCII and Unicode. For a quick and easy reference of common and foundational sequences, you can [download our compose key cheat sheet][5]. It provides sequences covering mathematics, typography, music, arrows, diacritics, currency, and more.
|
||||
|
||||
Now that you're in on the secret, your range of expression just got a whole lot bigger.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/22/7/linux-compose-key-cheat-sheet
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://opensource.com/sites/default/files/lead-images/linux_keyboard_desktop.png
|
||||
[2]: https://opensource.com/downloads/linux-compose-key-cheat-sheet
|
||||
[3]: https://opensource.com/sites/default/files/2022-04/gnome-tweaks-compose.jpeg
|
||||
[4]: https://opensource.com/sites/default/files/2022-04/kde-settings-input-advanced-compose.jpeg
|
||||
[5]: https://opensource.com/downloads/linux-compose-key-cheat-sheet
|
396
sources/tech/20220708 Data Visualisation in R- Graphs.md
Normal file
396
sources/tech/20220708 Data Visualisation in R- Graphs.md
Normal file
@ -0,0 +1,396 @@
|
||||
[#]: subject: "Data Visualisation in R: Graphs"
|
||||
[#]: via: "https://www.opensourceforu.com/2022/07/data-visualisation-in-r-graphs/"
|
||||
[#]: author: "Shakthi Kannan https://www.opensourceforu.com/author/shakthi-kannan/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Data Visualisation in R: Graphs
|
||||
======
|
||||
In this tenth article in the R series, we will continue to explore data visualisation in R with the lattice and ggplot2 packages.
|
||||
|
||||
![Data-Visualisation-in-R-Graphs-Featured-image][1]
|
||||
|
||||
We will be using the R version 4.1.2 installed on Parabola GNU/Linux-libre (x86-64) for the example code snippets in this article.
|
||||
|
||||
```
|
||||
$ 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/.
|
||||
|
||||
### Lattice
|
||||
|
||||
#### Line chart
|
||||
|
||||
Consider the consumer prices (annual per cent) inflation data for India between 1960 and 2022 available from the World Bank. You can use the years in the x-axis, and the inflation on the y-axis to produce a line chart using the xyplot function, as shown below:
|
||||
|
||||
```
|
||||
> x<-c(1960:2020)
|
||||
|
||||
> y<-c(1.77,1.69,3.63,2.94,13.35,9.47,10.80,13.06,3.23,-0.58,5.09,3.07,6.44,16.94,28.59,5.74,
|
||||
|
||||
-7.63,8.30,2.52,6.27,11.34,13.11,7.89,11.86,8.31,5.55,8.72,8.80,9.38,7.07,8.97,13.87,11.78,6.32,10.24,10.22,8.97,7.16,13.23,4.66,4.00,3.77,4.29,3.80,3.76,4.24,5.79,6.37,8.34,10.88,11.98,8.85,9.31,11.06,6.64,4.90,4.94,3.32,3.94,3.72,6.62)
|
||||
|
||||
> d <- data.frame(x,y)
|
||||
|
||||
> xyplot(y~x, data=d, type=”l”, main=”Inflation, consumer prices (annual %)”)
|
||||
```
|
||||
|
||||
The line chart is shown in Figure 1.
|
||||
|
||||
![Figure 1: Line chart][2]
|
||||
|
||||
The *xyplot* accepts the following arguments:
|
||||
|
||||
| Argument | Description |
|
||||
| :- | :- |
|
||||
| data | A data frame containing values |
|
||||
| groups | A grouping variable in the data |
|
||||
| main | The title of the chart |
|
||||
| strip | A logical condition on whether to draw strips |
|
||||
| x | The primary numeric variable |
|
||||
| xlab | The label for x-axis |
|
||||
| xlim | A numeric vector that specifies left and right limits for x-axis |
|
||||
| ylab | The label for y-axis |
|
||||
| ylim | A numeric vector of length two that mentions lower and upper limits for y-axis |
|
||||
|
||||
**The barchart function**
|
||||
|
||||
The *bar chart* function produces a bar chart for the given data. In the following example, we specify a function to the axis argument to use the year on the x-axis.
|
||||
|
||||
![Figure 2: Bar chart][3]
|
||||
|
||||
```
|
||||
> barchart(y~x|x, data=d, horizontal=FALSE, axis=function(side, ...) { if (side==”bottom”) panel.axis(at=seq_along(d$x), label=d$x, outside=TRUE, rot=0, tck=0) else axis.default(side, ...)}, main=”Inflation, consumer prices (annual %)”)
|
||||
```
|
||||
|
||||
The additional set of arguments available to the xyplot and barchart are listed below:
|
||||
|
||||
| Argument | Description |
|
||||
| :- | :- |
|
||||
| box.ratio | Specifies the ratio of the width of rectangles in barchart |
|
||||
| panel | Plots x and y variables in each panel |
|
||||
| default.prepanel | A default function as a fallback to the prepanel function |
|
||||
| auto.key | Used to produce a suitable legend |
|
||||
| aspect | The physical aspect ratio of the panels |
|
||||
| axis | A function responsible for drawing the axis annotation |
|
||||
| horizontal | The orientation of the bar chart |
|
||||
| subscripts | A logical flag to pass a ‘subscripts’ vector to the panel function |
|
||||
| subset | A set of rows from the data is used in the plot |
|
||||
|
||||
**Scatter plot**
|
||||
|
||||
You can also display individual charts on a panel grid. For example, the all India consumer price index (rural/urban) data set up to November 2021 is available from 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 05 107 106
|
||||
5 106 NA 105 107 107 105 107 108
|
||||
6 105 NA 104 105 106 104 106 106
|
||||
```
|
||||
|
||||
The aggregate function can be used to obtain the values for the state of Andhra Pradesh as follows:
|
||||
|
||||
```
|
||||
ap <- aggregate(x=cpi$Andhra.Pradesh, by=list(cpi$Year), FUN=sum)
|
||||
|
||||
> head(ap)
|
||||
Group.1 x
|
||||
1 2011 3911.28
|
||||
2 2012 4255.40
|
||||
3 2013 4516.60
|
||||
4 2014 4673.60
|
||||
5 2015 4822.20
|
||||
6 2016 4921.50
|
||||
```
|
||||
|
||||
A simple scatter plot can be displayed for the consumer price indexes using the following arguments to the xyplot function:
|
||||
|
||||
```
|
||||
> xyplot(x~Group.1, ap, main=”Andhra Pradesh Consumer Price Index upto November 2021”, xlab=”Year”, ylab=”Consumer Price Index”)
|
||||
```
|
||||
|
||||
The corresponding scatter plot illustration is shown in Figure 3.
|
||||
|
||||
![Figure 3: Scatter plot][4]
|
||||
|
||||
#### Panel grid
|
||||
|
||||
You can also visualise the values per year (Group.1) using the xyplot:
|
||||
|
||||
```
|
||||
> xyplot(x~Group.1|Group.1, ap, groups=Group.1, main=”Andhra Pradesh Consumer Price Index upto November 2021”, xlab=”Year”, ylab=”Consumer Price Index”, auto.key=TRUE)
|
||||
```
|
||||
|
||||
The output chart produced by R is as shown in Figure 4.
|
||||
|
||||
![Figure 4: Grouping chart][5]
|
||||
|
||||
In addition to the above listed plotting functions, lattice provides the bwplot function for box-and-whisker plots, and the stripplot function for one-dimensional scatter plots.
|
||||
|
||||
### ggplot2
|
||||
|
||||
The ggplot2 R package implements a grammar of graphics that specifies how to plot data. You can install the package using the following command:
|
||||
|
||||
```
|
||||
> install.packages(“ggplot2”)
|
||||
|
||||
*** installing help indices
|
||||
*** copying figures
|
||||
** building package indices
|
||||
** installing vignettes
|
||||
** testing if installed package can be loaded from temporary location
|
||||
** testing if installed package can be loaded from final location
|
||||
** testing if installed package keeps a record of temporary installation path
|
||||
* DONE (ggplot2)
|
||||
```
|
||||
|
||||
The library needs to be loaded into the R session before you can use its functions:
|
||||
|
||||
```
|
||||
library(ggplot2)
|
||||
```
|
||||
|
||||
#### Scatter plot
|
||||
|
||||
The same consumer prices (annual per cent) inflation data for India can be plotted using the quick plot or qplot function from the ggplot2 package in R. For example:
|
||||
|
||||
```
|
||||
> x<-c(1960:2020)
|
||||
> y<-c(1.77,1.69,3.63,2.94,13.35,9.47,10.80,13.06,3.23,-0.58,5.09,3.07,6.44,16.94,28.59,5.74,-7.63,8.30,2.52,6.27,11.34,13.11,7.89,11.86,8.31,5.55,8.72,8.80,9.38,7.07,8.97,13.87,11.78,6.32,10.24,10.22,8.97,7.16,13.23,4.66,4.00,3.77,4.29,3.80,3.76,4.24,5.79,6.37,8.34,10.88,11.98,8.85,9.31,11.06,6.64,4.90,4.94,3.32,3.94,3.72,6.62)
|
||||
> d <- data.frame(x,y)
|
||||
> qplot(x=x, y=y, data=d, xlab=”Year”, ylab=”Inflation”, main=”Inflation, consumer prices (annual %)”)
|
||||
```
|
||||
|
||||
The simple scatter plot is shown in Figure 5.
|
||||
|
||||
![Figure 5: Simple qplot][6]
|
||||
|
||||
We can also store the results of the plot to a variable and ask R to provide a summary of the same, as shown below:
|
||||
|
||||
```
|
||||
> ex1 <- qplot(x=x, y=y, data=d)
|
||||
> summary(ex1)
|
||||
data: x, y [61x2]
|
||||
mapping: x = ~x, y = ~y
|
||||
faceting: <ggproto object: Class FacetNull, Facet, gg>
|
||||
compute_layout: function
|
||||
draw_back: function
|
||||
draw_front: function
|
||||
draw_labels: function
|
||||
draw_panels: function
|
||||
finish_data: function
|
||||
init_scales: function
|
||||
map_data: function
|
||||
params: list
|
||||
setup_data: function
|
||||
setup_params: function
|
||||
shrink: TRUE
|
||||
train_scales: function
|
||||
vars: function
|
||||
super: <ggproto object: Class FacetNull, Facet, gg>
|
||||
-----------------------------------
|
||||
geom_point: na.rm = FALSE
|
||||
stat_identity: na.rm = FALSE
|
||||
position_identity
|
||||
```
|
||||
|
||||
#### Line chart
|
||||
|
||||
We can generate a line chart by specifying the geom attribute as ‘line’, as shown below:
|
||||
|
||||
```
|
||||
> qplot(x=x, y=y, data=d, xlab=”Year”, ylab=”Inflation”, main=”Inflation, consumer prices (annual %)”, geom=”line”)
|
||||
```
|
||||
|
||||
The corresponding line graph is shown in Figure 6.
|
||||
|
||||
![Figure 6: qplot line graph][7]
|
||||
|
||||
The ‘Bank Marketing Data Set’ for a Portuguese banking institution is available from the UCI machine learning repository available at https://archive.ics.uci.edu/ml/datasets/Bank+Marketing. The data can be used for public research use. There are four data sets available, and we will use the read.csv() function to import the data from a ‘bank.csv’ file into a data frame.
|
||||
|
||||
```
|
||||
bank <- read.csv(file=”bank.csv”, sep=”;”)
|
||||
|
||||
> bank[1:3,]
|
||||
age job marital education default balance housing loan contact day
|
||||
1 30 unemployed married primary no 1787 no no cellular 19
|
||||
2 33 services married secondary no 4789 yes yes cellular 11
|
||||
3 35 management single tertiary no 1350 yes no cellular 16
|
||||
month duration campaign pdays previous poutcome y
|
||||
1 oct 79 1 -1 0 unknown no
|
||||
2 may 220 1 339 4 failure no
|
||||
3 apr 185 1 330 1 failure no
|
||||
```
|
||||
|
||||
### Bar chart
|
||||
|
||||
The geometry argument can be specified as ‘bar’ to produce a bar chart, as indicated below:
|
||||
|
||||
```
|
||||
> qplot(x=job, data=bank, geom=”bar”, weight=balance, ylab=”Balance”, xlab=”Category”)
|
||||
```
|
||||
|
||||
The produced bar chart is shown in Figure 7.
|
||||
|
||||
![Figure 7: Bar chart][8]
|
||||
|
||||
We can also list a summary of the chart by storing the results of the plot to a variable, and invoking the summary function on the same. For example:
|
||||
|
||||
```
|
||||
> barchart <- qplot(x=job, data=bank, geom=”bar”, weight=balance, ylab=”Balance”, xlab=”Category”)
|
||||
|
||||
> summary (barchart)
|
||||
data: age, job, marital, education, default, balance, housing, loan,
|
||||
contact, day, month, duration, campaign, pdays, previous, poutcome, y
|
||||
[4521x17]
|
||||
mapping: x = ~job, weight = ~balance
|
||||
faceting: <ggproto object: Class FacetNull, Facet, gg>
|
||||
compute_layout: function
|
||||
draw_back: function
|
||||
draw_front: function
|
||||
draw_labels: function
|
||||
draw_panels: function
|
||||
finish_data: function
|
||||
init_scales: function
|
||||
map_data: function
|
||||
params: list
|
||||
setup_data: function
|
||||
setup_params: function
|
||||
shrink: TRUE
|
||||
train_scales: function
|
||||
vars: function
|
||||
super: <ggproto object: Class FacetNull, Facet, gg>
|
||||
-----------------------------------
|
||||
geom_bar: width = NULL, na.rm = FALSE, orientation = NA
|
||||
stat_count: width = NULL, na.rm = FALSE, orientation = NA
|
||||
position_stack
|
||||
```
|
||||
|
||||
The qplot function accepts the following arguments:
|
||||
|
||||
| Argument | Description |
|
||||
| :- | :- |
|
||||
| asp | The y/x aspect ratio |
|
||||
| data | Optional data frame that contains x and y |
|
||||
| geom | The geometry to use |
|
||||
| main | The title of the chart |
|
||||
| margin | Display margins |
|
||||
| position | The adjustments to specify the position |
|
||||
| x | X values |
|
||||
| xlab | The x-axis label |
|
||||
| xlim | The limits for the x-axis |
|
||||
| y | Y values |
|
||||
| ylab | The y-axis label |
|
||||
| ylim | The limits for the y-axis |
|
||||
|
||||
#### ggplot
|
||||
|
||||
The ggplot function can be used to create a new ggplot object for input data, and also specify aesthetic mappings for the same.
|
||||
|
||||
For the bank.csv data, we can tabulate the job and marital status together using the with function as follows:
|
||||
|
||||
```
|
||||
> with(bank, table(job, marital))
|
||||
marital
|
||||
|
||||
job divorced married single
|
||||
admin. 69 266 143
|
||||
blue-collar 79 693 174
|
||||
entrepreneur 16 132 20
|
||||
housemaid 13 84 15
|
||||
management 119 557 293
|
||||
retired 43 176 11
|
||||
self-employed 15 127 41
|
||||
services 62 236 119
|
||||
student 0 10 74
|
||||
technician 89 411 268
|
||||
unemployed 22 75 31
|
||||
unknown 1 30 7
|
||||
```
|
||||
|
||||
You can now plot the above categorical data using ggplot, as follows:
|
||||
|
||||
```
|
||||
> ggplot(bank, aes(x = job, fill = marital)) + geom_bar()
|
||||
```
|
||||
|
||||
The resultant graph is shown in Figure 8.
|
||||
|
||||
![Figure 8: ggplot categorical graph][9]
|
||||
|
||||
The age distribution can be plotted as a density using the geom_density function as follows:
|
||||
|
||||
```
|
||||
> ggplot(bank, aes(x = age)) + geom_density()
|
||||
```
|
||||
|
||||
The corresponding graph is shown in Figure 9.
|
||||
|
||||
![Figure 9: ggplot density graph][10]
|
||||
|
||||
A box plot for the age and marital status can be visualised using the following arguments to ggplot:
|
||||
|
||||
```
|
||||
> ggplot(bank, aes(x = age, y = marital)) + geom_boxplot() + coord_flip()
|
||||
```
|
||||
|
||||
The output graph is as shown in Figure 10.
|
||||
|
||||
![Figure 10: ggplot boxplot graph][11]
|
||||
|
||||
The ggplot function accepts the following arguments:
|
||||
|
||||
| Argument | Description |
|
||||
| :- | :- |
|
||||
| data | The data frame for the plot |
|
||||
| mapping | The aesthetic mappings to be used in the plot |
|
||||
| environment | The globalenv() environment for the aesthetics |
|
||||
|
||||
Do try and explore more functions and charts in the graphics packages available in R.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.opensourceforu.com/2022/07/data-visualisation-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/05/Data-Visualisation-in-R-Graphs-Featured-image.jpg
|
||||
[2]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-1-Line-chart.jpg
|
||||
[3]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-2-Bar-chart.jpg
|
||||
[4]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-3-Scatter-plot.jpg
|
||||
[5]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-4-Grouping-chart.jpg
|
||||
[6]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-5-Simple-qplot.jpg
|
||||
[7]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-6-qplot-line-graph.jpg
|
||||
[8]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-7-Bar-chart.jpg
|
||||
[9]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-8-ggplot-categorical-graph.jpg
|
||||
[10]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-9-ggplot-density-graph.jpg
|
||||
[11]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-10-ggplot-boxplot-graph.jpg
|
@ -0,0 +1,416 @@
|
||||
[#]: subject: "Reptyr – Move A Running Process From One Terminal To Another Without Closing It"
|
||||
[#]: via: "https://ostechnix.com/reptyr-move-running-process-new-terminal/"
|
||||
[#]: author: "sk https://ostechnix.com/author/sk/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Reptyr – Move A Running Process From One Terminal To Another Without Closing It
|
||||
======
|
||||
This step by step tutorial explains what is **Reptyr** application and how to **move a running process to a new terminal using Reptyr command in Linux and Unix** operating systems.
|
||||
|
||||
### Introduction
|
||||
|
||||
Let us say, you are running a task in a remote server via a SSH session from your local system.
|
||||
|
||||
When you started the task, you didn't know that the remote job would take long time to complete. You just want to leave the running job on the remote server itself, and close the SSH session without terminating the remote job, and then re-attach it to the SSH session later or at the next day.
|
||||
|
||||
Of course, you can start the job in screen or tmux session, and detach from the screen session without exiting the remote job, and exit SSH session.
|
||||
|
||||
But if you forgot to start the screen session in the first place, there is no way to reattach to the running process later. Once you closed the SSH session, the running processes will also be closed on the remote system.
|
||||
|
||||
So, what would you do in such situation? Worry not! Here is where Reptyr command comes in help.
|
||||
|
||||
### What Is Reptyr?
|
||||
|
||||
**Reptyr** is a command line tool for moving running processes between ptys.
|
||||
|
||||
Using Reptyr, we can easily migrate or move a long-running process from one Terminal to another Terminal instantly without terminate it. Reptyr uses **ptrace** system call to attach to the target program.
|
||||
|
||||
Just start a long-running process on your remote system via SSH session from your local machine, and close the SSH session, go home, and re-attach the running process on the next day.
|
||||
|
||||
Reptyr is an opensource command line application. It supports both Linux and FreeBSD.
|
||||
|
||||
### Install Reptyr In Your Remote Linux Systems
|
||||
|
||||
First of all, make sure you've installed **tmux** or **screen** in your remote systems in-order to move running process from local terminal to remote terminal. If you haven't installed tmux/screen yet, refer the following links.
|
||||
|
||||
> **[Tmux Commands Examples To Manage Multiple Terminal Sessions In Linux][1]**
|
||||
|
||||
> **[Screen Command Examples To Manage Multiple Terminal Sessions][2]**
|
||||
|
||||
Next, you should install Reptyr application on your REMOTE systems.
|
||||
|
||||
To install Reptyr in Arch Linux and its derivatives such as Endeavour OS and Manjaro Linux, run:
|
||||
|
||||
```
|
||||
$ sudo pacman -S reptyr
|
||||
```
|
||||
|
||||
In Debian, Ubuntu, Linux Mint, Pop!_OS, run the following command to install Reptyr:
|
||||
|
||||
```
|
||||
$ sudo apt install reptyr
|
||||
```
|
||||
|
||||
On Fedora, RHEL, CentOS, AlmaLinux, and Rocky Linux, reptyr can be installed from **EPEL** repository.
|
||||
|
||||
To install EPEL repository in RHEL-based systems, run the following commands:
|
||||
|
||||
```
|
||||
$ sudo dnf config-manager --set-enabled powertools
|
||||
```
|
||||
|
||||
```
|
||||
$ sudo dnf install epel-release
|
||||
```
|
||||
|
||||
After enabling EPEL repository, run the following command to install Reptyr:
|
||||
|
||||
```
|
||||
$ sudo dnf install reptyr
|
||||
```
|
||||
|
||||
### Install Reptyr From Source
|
||||
|
||||
Install the necessary development tools as described in the following link.
|
||||
|
||||
> **[How To Install Development Tools In Linux][3]**
|
||||
|
||||
Git clone reptyr repository with command as `root` or `sudo` user:
|
||||
|
||||
```
|
||||
$ git clone https://github.com/nelhage/reptyr.git
|
||||
```
|
||||
|
||||
Go to the reptyr directory:
|
||||
|
||||
```
|
||||
$ cd reptyr/
|
||||
```
|
||||
|
||||
Run the following commands to compile and install it.
|
||||
|
||||
```
|
||||
$ make
|
||||
```
|
||||
|
||||
```
|
||||
$ sudo make install
|
||||
```
|
||||
|
||||
I compiled and installed Reptyr from source in CentOS 7 64 bit server edition, and it worked pretty good as described above.
|
||||
|
||||
### Move A Running Process From One Terminal To Another Without Closing It Using Reptyr
|
||||
|
||||
Make sure you installed the following on your remote Linux systems.
|
||||
|
||||
* Reptyr.
|
||||
* Tmux or Screen.
|
||||
|
||||
#### Example 1:
|
||||
|
||||
For demonstration purpose, I will be using the following system.
|
||||
|
||||
* Remote system - Debian 11 Bullseye (username - ostechnix, IP - 192.168.1.20)
|
||||
|
||||
##### Step 1 - SSH Into The Remote System
|
||||
|
||||
Usually, we connect to the remote server from any local system via SSH as shown below.
|
||||
|
||||
```
|
||||
ssh remote_username@IP_of_remote_system
|
||||
```
|
||||
|
||||
I am going to SSH into my remote system(AlmaLinux 8) from my local system(Debian 11).
|
||||
|
||||
```
|
||||
$ ssh ostechnix@192.168.1.20
|
||||
```
|
||||
|
||||
![SSH Into A Remote Linux System][4]
|
||||
|
||||
Here, "ostechnix" is the remote system's username and "192.168.1.20" is the remote system's IP address. Replace these two values with your own.
|
||||
|
||||
##### Step 2 - Start a Long-running Process
|
||||
|
||||
After connecting to the remote system, start any long-running process. I will start "top" command.
|
||||
|
||||
```
|
||||
$ top
|
||||
```
|
||||
|
||||
Here is "top" command running in my AlmaLinux connected via SSH. Let us call it **Terminal 1**.
|
||||
|
||||
![Running Top Command In Remote Linux System][5]
|
||||
|
||||
As you see in the above output, I run "top" command in Debian 11 virtual machine via SSH from my local system. The top command will keep running until we manually stop it by pressing **CTRL+C**.
|
||||
|
||||
What we are going to do now is simply move the top command process inside the tmux or screen session of our remote system(i.e. Debian 11) using Reptyr. And then we finally close the SSH session in our local system. During the transition, the top command will keep running without any interruption.
|
||||
|
||||
##### Step 3 - Background The Process
|
||||
|
||||
Now press **CTRL+Z** to put the process in the background. And then run **bg** to resume the process in the background.
|
||||
|
||||
```
|
||||
$ bg
|
||||
```
|
||||
|
||||
Verify the running background jobs with `jobs` command:
|
||||
|
||||
```
|
||||
$ jobs -l
|
||||
```
|
||||
|
||||
Here, the **-l** flag will list the PID of the background job.
|
||||
|
||||
You will see the following output.
|
||||
|
||||
```
|
||||
[1]+ 1972 Stopped (signal) top
|
||||
```
|
||||
|
||||
![Background The Process][6]
|
||||
|
||||
Note down the PID. We will need it later to attach the process to remote terminal. Here, the PID of top command is **1972**.
|
||||
|
||||
##### Step 4 - Disown The Process
|
||||
|
||||
Disown the running process from the current parent using command:
|
||||
|
||||
```
|
||||
$ disown top
|
||||
```
|
||||
|
||||
**Sample output:**
|
||||
|
||||
```
|
||||
-bash: warning: deleting stopped job 1 with process group 1972
|
||||
```
|
||||
|
||||
Now the `jobs -l` command will not show the job anymore, but the **ps -a** command will.
|
||||
|
||||
```
|
||||
$ ps -a
|
||||
PID TTY TIME CMD
|
||||
1972 pts/1 00:00:00 top
|
||||
2061 pts/1 00:00:00 ps
|
||||
```
|
||||
|
||||
![Disown The Process][7]
|
||||
|
||||
##### Step 5 - Start A Tmux Or Screen Session
|
||||
|
||||
Start a new Tmux or Screen session in the same terminal or new terminal window. For the sake of easy understanding, I am going to call the new tmux session as **Terminal 2**.
|
||||
|
||||
```
|
||||
$ tmux
|
||||
```
|
||||
|
||||
![Start A New Tmux Session][8]
|
||||
|
||||
Please note that you should start the tmux/screen multiplexer in the remote(Debian 11) console, not in our local system's console.
|
||||
|
||||
##### Step 6 - Attach To The Background Process
|
||||
|
||||
Remember we put the top command in the background in **Step 3**. The PID of the background process is **1972**. If you don't remember the PID, run `ps -a` command.
|
||||
|
||||
Now, attach to the background process with Reptyr using command:
|
||||
|
||||
```
|
||||
$ reptyr 1972
|
||||
```
|
||||
|
||||
![Attach To The Background Process using Reptyr][9]
|
||||
|
||||
That's it. We have successfully moved the background process inside the tmux sesssion.
|
||||
|
||||
![Top Command Is Moved Into The Tmux Session][10]
|
||||
|
||||
You can now safely detach from the Tmux session by pressing **CTRL+B** and **D**. It will only close the tmux session, but not the process(top command) which is running inside of it.
|
||||
|
||||
We are back to the Terminal 1. Verify the list of active Tmux panes using command:
|
||||
|
||||
```
|
||||
$ tmux list-panes -F '#{pane_active} #{pane_pid}'
|
||||
1 2072
|
||||
```
|
||||
|
||||
Here,
|
||||
|
||||
* pane_active will show 1 if active pane.
|
||||
* pane_pid is the PID of first process in pane.
|
||||
|
||||
##### Step 7 - Close The SSH Connection
|
||||
|
||||
You can now close the SSH session. The process(Top command in our case) will keep running inside the Tmux session of your remote system as long as your remote system is up. Closing the SSH connection will not terminate the process.
|
||||
|
||||
##### Step 8 - Reattach To Tmux
|
||||
|
||||
To reattach to the process, simply SSH to your remote system:
|
||||
|
||||
```
|
||||
$ ssh remote_user@remote_ip
|
||||
```
|
||||
|
||||
And run the following command to attach the tmux session where the top process is still running.
|
||||
|
||||
```
|
||||
$ tmux attach
|
||||
```
|
||||
|
||||
![Reattach To Tmux][11]
|
||||
|
||||
You will now see the running process inside the Tmux session.
|
||||
|
||||
This way you can start any number of Tmux panes and move the running processes inside to each pane.
|
||||
|
||||
Let me show you another example.
|
||||
|
||||
#### Example 2:
|
||||
|
||||
In this example, I use how to move a running process (E.g. wget) in CentOS server.
|
||||
|
||||
**Step 1** - SSH into Remote system.
|
||||
|
||||
**Step 2** - After you connected to the remote system, start a long-running process. For example, I am going to download Ubuntu 16.04 desktop ISO with **wget** command.
|
||||
|
||||
```
|
||||
# wget http://cdimage.ubuntu.com/daily-live/current/xenial-desktop-amd64.iso
|
||||
```
|
||||
|
||||
**Sample output:**
|
||||
|
||||
![Download Ubuntu ISO][12]
|
||||
|
||||
As you see in the above screenshot, the total download size is 1.5GB, and it will take more than 90 minutes to complete.
|
||||
|
||||
I don't want to wait that much longer, and also I don't want to quit the remote job either.
|
||||
|
||||
So, what I am going to do now is start a **screen** or **tmux** session in a new terminal, use **reptyr** utility to grab the running process inside the screen or tmux session. Finally, I will terminate both ssh sessions, and reattach to the running process whenever I want.
|
||||
|
||||
**Step 3** - Let us open a new terminal window or new tab, and start a screen or tmux session by typing **screen** or **tmux** in the terminal:
|
||||
|
||||
```
|
||||
# screen
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```
|
||||
# tmux
|
||||
```
|
||||
|
||||
![Start A Screen Session][13]
|
||||
|
||||
As you see in the above screenshot, the screen session has been started and it is running.
|
||||
|
||||
**Step 4** - Now, let us find the the running processes from the new Terminal by using the following command:
|
||||
|
||||
```
|
||||
# ps -a
|
||||
```
|
||||
|
||||
**Sample output:**
|
||||
|
||||
```
|
||||
PID TTY TIME CMD
|
||||
2320 pts/0 00:00:11 wget
|
||||
2343 pts/1 00:00:00 screen
|
||||
2358 pts/2 00:00:00 ps
|
||||
```
|
||||
|
||||
Note down the PID for the **wget** process, and attach the running process inside screen session using command:
|
||||
|
||||
```
|
||||
# reptyr 2320
|
||||
```
|
||||
|
||||
![Attach The Running Process Inside Screen Session Using Reptyr][14]
|
||||
|
||||
Done! As you see in the above screenshot, wget process has been moved (migrated) from old terminal to the new terminal window (the one running with screen session).
|
||||
|
||||
Once you moved the running process from the original terminal (i.e. remote terminal), it will be closed immediately in the local terminal, and start to continue where we left it off in the new terminal.
|
||||
|
||||
![Wget Download Process Is Stopped][15]
|
||||
|
||||
**Step 5** - Now, you can safely detach or close the terminal and the job will continue running on your remote server.
|
||||
|
||||
To detach from screen session, press **CTRL+A**and**D**. If it is Tmux session, press CTRL+B and D.
|
||||
|
||||
After you detached from screen session, you will see the following output.
|
||||
|
||||
```
|
||||
[detached from 2344.pts-1.server1]
|
||||
```
|
||||
|
||||
**Step 6** - To reattach the running process, SSH to your remote system:
|
||||
|
||||
```
|
||||
# ssh root@192.168.1.150
|
||||
```
|
||||
|
||||
Here. 192.168.1.150 is my remote server IP address.
|
||||
|
||||
**Step 7** - And run the following if you use screen session:
|
||||
|
||||
```
|
||||
# screen -Dr
|
||||
```
|
||||
|
||||
For tmux session, run:
|
||||
|
||||
```
|
||||
# tmux attach
|
||||
```
|
||||
|
||||
Voila! The running process has been reattached again, and you'll see there that the download process is still running.
|
||||
|
||||
![Move A Running Process From One Terminal To Another Using Reptyr][16]
|
||||
|
||||
As you see in the above screenshot, wget job isn't interrupted or terminated, and is still running. It will continue to run as long as your remote system is up and running.
|
||||
|
||||
### Summary
|
||||
|
||||
To summing up, Reptyr is very very important and useful tool for a Linux users and system administrators of any level. In case you fed up with a process that took a really long time to complete, Reptyr will definitely be helpful. Just open a new Terminal window, SSH to your remote server, find the running processes ID, and safely move them inside the screen or tmux sessions, and exit from the SSH session. For further details, refer the links attached at the end of this tutorial.
|
||||
|
||||
That's all for now folks. Well then, I leave you to get acquainted with this useful tool. Give it a try, and you won't be disappointed.
|
||||
|
||||
**Resources:**
|
||||
|
||||
* [Reptyr GitHub][17]
|
||||
* [Reptyr guide][18]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://ostechnix.com/reptyr-move-running-process-new-terminal/
|
||||
|
||||
作者:[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/tmux-command-examples-to-manage-multiple-terminal-sessions/
|
||||
[2]: https://ostechnix.com/screen-command-examples-to-manage-multiple-terminal-sessions/
|
||||
[3]: https://ostechnix.com/install-development-tools-linux/
|
||||
[4]: https://ostechnix.com/wp-content/uploads/2022/07/SSH-Into-A-Remote-Linux-System.png
|
||||
[5]: https://ostechnix.com/wp-content/uploads/2022/07/Running-Top-Command-In-Remote-Linux-System.png
|
||||
[6]: https://ostechnix.com/wp-content/uploads/2022/07/Background-The-Process-2.png
|
||||
[7]: https://ostechnix.com/wp-content/uploads/2022/07/Disown-The-Process-2.png
|
||||
[8]: https://ostechnix.com/wp-content/uploads/2022/07/Start-A-New-Tmux-Session-1.png
|
||||
[9]: https://ostechnix.com/wp-content/uploads/2022/07/Attach-To-The-Background-Process-using-Reptyr.png
|
||||
[10]: https://ostechnix.com/wp-content/uploads/2022/07/Top-Command-Is-Moved-Into-The-Tmux-Session.png
|
||||
[11]: https://ostechnix.com/wp-content/uploads/2022/07/Reattach-To-Tmux.png
|
||||
[12]: https://ostechnix.com/wp-content/uploads/2016/03/root@server1_002-2.jpg
|
||||
[13]: https://ostechnix.com/wp-content/uploads/2016/03/screen-0-root@server1-_003-1.jpg
|
||||
[14]: https://ostechnix.com/wp-content/uploads/2016/03/screen-0-root@server1-_004-1.jpg
|
||||
[15]: https://ostechnix.com/wp-content/uploads/2016/03/root@server1_005-1-1.jpg
|
||||
[16]: https://ostechnix.com/wp-content/uploads/2016/03/screen-0-root@server1-_009-1.jpg
|
||||
[17]: https://github.com/nelhage/reptyr
|
||||
[18]: https://blog.nelhage.com/2011/02/changing-ctty/
|
@ -0,0 +1,205 @@
|
||||
[#]: subject: "Umbrel: Unique Linux Distro for Self Hosting Open Source Software for Your Homelab"
|
||||
[#]: via: "https://itsfoss.com/umbrel-review/"
|
||||
[#]: author: "Pratham Patel https://itsfoss.com/author/pratham/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Umbrel: Unique Linux Distro for Self Hosting Open Source Software for Your Homelab
|
||||
======
|
||||
Umbrel is a beautiful operating system as well as a services dashboard that is a good start for someone interested in self-hosting. It has a nice web GUI and enables easy installation of containerized web services with a one-click install.
|
||||
|
||||
This is perfect if you want a homelab setup with open source software for personal usage but can’t (or don’t want to) do all the technical configuration manually.
|
||||
|
||||
### Umbrel: Self-hoster’s paradise
|
||||
|
||||
Well, it depends on how you install Umbrel. On [the website][1], there are two ways to “get” Umbrel. One is an image for the Raspberry Pi and another method is to install the Umbrel Docker image on an existing Linux installation as a Docker container.
|
||||
|
||||
So *technically*, it is a management tool for Docker containers.
|
||||
|
||||
![A Video from YouTube][2]
|
||||
|
||||
I gave it a go with my Raspberry Pi 4 and here I share my experience and views on using Umbrel.
|
||||
|
||||
#### Hardware support
|
||||
|
||||
At the time of writing, there doesn’t seem to be an official guideline from Umbrel regarding this…
|
||||
|
||||
But fret not! I flashed Umbrel to my SD Card and looked under the ‘/boot’ partition. The only kernel to be found was named ‘kernel8.img’.
|
||||
|
||||
According to Raspberry Pi’s [official documentation][3], ‘kernel8’ means a 64-bit kernel, whereas ‘kernel7’ and ‘kernel7l’ are 32-bit kernels.
|
||||
|
||||
As for non-Raspberry Pi hardware, below is a what I assume from my experience using Umbrel:
|
||||
|
||||
* Any 64-bit CPU (all modern CPUs are 64-bit)
|
||||
* Any Linux-based OS, Ubuntu/Debian is preferred
|
||||
* Minimum 4 to 8 Gigabytes of RAM
|
||||
* An external SSD/HDD in at least 750 Gigabytes of capacity (ALL DATA WILL BE ERASED ON FIRST BOOT)
|
||||
|
||||
### Installing Umbrel
|
||||
|
||||
If you like the idea of an operating system like Umbrel and you want to install it, you need to decide if you want to install it on a Raspberry Pi or on any other computer.
|
||||
|
||||
NOTICE
|
||||
|
||||
Umbrel is still in an early stage and things are expected to break every now and then. It is NOT recommended to run Umbrel in any mission-critical scenario yet.[][4]
|
||||
|
||||
#### Raspberry Pi (64-bit)
|
||||
|
||||
If you want to install Umbrel on a Raspberry Pi, it is available on their Github at [this link][5]. There will be three files available for download, please download the ‘umbrel-os-VERSION.zip’ file.
|
||||
|
||||
While the Umbrel image gets downloaded, download an image-burning tool like [BalenaEtcher][6].
|
||||
|
||||
Once Umbrel and BalenaEtcher are downloaded, insert the SD Card and use BalenaEtcher to flash Umbrel on the SD Card.
|
||||
|
||||
When the flashing finishes, insert the SD Card in the Raspberry Pi along with a 750+ Gigabyte HDD/SSD and boot your Raspberry Pi.
|
||||
|
||||
The web GUI will now be available at [http://umbrel.local][7] from your web browser.
|
||||
|
||||
#### Linux PC
|
||||
|
||||
If you do not have a Raspberry Pi but have a *spare* computer running Debian/Ubuntu, you can easily install Umbrel using a simple script that is provided.
|
||||
|
||||
The recommended way to do so is to run it with the curl command:
|
||||
|
||||
```
|
||||
curl -L https://umbrel.sh | bash
|
||||
```
|
||||
|
||||
The install script will install the necessary dependencies, Docker, Docker Compose and finally, the necessary containers.
|
||||
|
||||
Upon successful installation, you will see the methods of accessing the web GUI.
|
||||
|
||||
![Different ways of accessing Umbrel web GUI listed by the installer][8]
|
||||
|
||||
Installing Umbrel on my Ubuntu VM, I got the following methods of accessing the web GUI. One is a domain name, the second is an IP address and the third is a TOR address.
|
||||
|
||||
### Using Umbrel: The good and bad
|
||||
|
||||
Like anything in this world, everything has its own positives and negatives. Umbrel is no exception.
|
||||
|
||||
It excels at ease of use but fails at basic customization.
|
||||
|
||||
#### The good parts
|
||||
|
||||
Let’s kick off this review piece by taking a look at the good parts of Umbrel. Things I enjoyed while using Umbrel, and my experience.
|
||||
|
||||
The web GUI is simply amazing and looks second to none.
|
||||
|
||||
![The Umbrel web GUI (taken from umbrel.com)][9]
|
||||
|
||||
##### App Store
|
||||
|
||||
Umbrel, being advertised as an Operating System, comes with its own App Store. It has some of the most popular “self-hosting” software that you can imagine. Some of my favorite software available from the App Store are Gitea, Home Assistant, [Nextcloud][10], Pi-hole, Synapse, [Syncthing][11], Tailscale, Uptime Kuma, and much, much more.
|
||||
|
||||
![The app store on Umbrel][12]
|
||||
|
||||
The idea behind Umbrel’s App Store is very fascinating. Since Umbrel deals with Docker containers, the Apps are just docker-compose YAML files tailored to run on Umbrel. That is the most elegant solution I’ve ever seen yet! You can view those files [here][13].
|
||||
|
||||
![Easy, one click installation of containerized services from the App Store][14]
|
||||
|
||||
That means complex software like Nextcloud is now a ‘one-click install’.
|
||||
|
||||
##### Settings
|
||||
|
||||
The Settings app in the web GUI shows useful metrics like storage and RAM usage. You can also shut down and restart your computer from the Umbrel web GUI itself. No longer need to SSH in a remote computer and run sudo shutdown +0 :)
|
||||
|
||||
![The Settings app on Umbrel][15]
|
||||
|
||||
The Settings app also lets you enable 2 Factor Authentication for the web GUI (not SSH connection). 2FA is always a good security feature.
|
||||
|
||||
##### TOR
|
||||
|
||||
Umbrel enables TOR by default. That allows you to access the Umbrel web GUI over a TOR network without any worries!
|
||||
|
||||
That means, even if you are behind a router, you can remotely access your services like Nextcloud over the TOR network without having to get a public IP address or enable port forwarding from your router. Now this is extra cool! I need to do this for my homelab :p
|
||||
|
||||
##### Bitcoin and Lightning
|
||||
|
||||
Umbrel actually started as an open source software that allowed easily setting up a Bitcoin node. And it got popular in crypto enthusiasts who wanted to run their own nodes.
|
||||
|
||||
The developers later realized that they don’t have to stick with a Bitcoin and other cryptocurrency software. They can extend this ‘one-click install’ feature to other popular open source software like Nextcloud, [PhotoPrism][16].
|
||||
|
||||
If you are interested in crypto, you can still find those software and install them. I don’t have any interest in the cryptocurrency and hence I didn’t install those software to check their performance.
|
||||
|
||||
#### The bad parts
|
||||
|
||||
Since Umbrel is still in v0.5, I will try not to go too hard, as I understand it takes time to implement certain features. But I still need to let *you* — the potential user — know the current situation with Umbrel.
|
||||
|
||||
##### An empty external disk is a must
|
||||
|
||||
The first problem I faced on my Raspberry Pi was that the **GUI would not start without an external HDD/SSD attached to it** :(
|
||||
|
||||
Actually, it’s a requirement by design. Umbrel keeps the OS on one disk (the SD card of your Pi) and it needs a separate disk for the application data.
|
||||
|
||||
**Do note that the external disk must not have any useful data because it will be erased the first time you install Umbrel.**
|
||||
|
||||
##### No multiple disks (with Raspberry Pi)
|
||||
|
||||
The second issue is that there are a few limitations with the Settings app on Umbrel’s web GUI. With a new drive attached, you can not add it to Umbrel to be used by apps like Nextcloud, Gitea, etc. Which essentially means, the inability to use separate drives. That further means no RAID, of any sort.
|
||||
|
||||
I think this is more of an issue from the Raspberry Pi side as it cannot handle multiple external disks.
|
||||
|
||||
##### Storage configuration issues
|
||||
|
||||
The third “oversight” I encountered is that there seems no way to change the storage location for any app, before or after the installation. This is okay for devices with single physical storage, but not for a Raspberry Pi or an x86 computer where the host computer might have 2 or more drives attached to it.
|
||||
|
||||
The only thing that you can manage about the apps is, to either install them or remove them. The web GUI does not (yet) let you change things like the port number that a container uses.
|
||||
|
||||
Remember the previous notice that if you put in a HDD/SSD at *first* boot, all data on it gets erased? Well… What happens if you re-install Umbrel? Is your previous data, which was stored by Umbrel, now deleted by Umbrel itself? I don’t see if such checks like this are present or absent.
|
||||
|
||||
### Conclusion
|
||||
|
||||
All in all, if you are just starting with your home lab, I do recommend you give Umbrel-a-try (I’ll show myself out)! It puts your [Raspberry Pi to some good use][17].
|
||||
|
||||
It is a beautiful web GUI for simple management of containers, which can give you a good kickstart. If you want something that “just works” without getting fine-tuned control over knobs and switches, Umbrel is a good candidate for you.
|
||||
|
||||
[Deployment from Scratch][18]
|
||||
|
||||
**Don't sweat** taking web applications to **production**.
|
||||
|
||||
Learn the core transferable skills of setting up Linux virtual servers and containers. Provision **web servers and databases**.
|
||||
|
||||
![Deployment from Scratch][19]
|
||||
|
||||
[Use 'linuxhandbook' coupon code][20]
|
||||
|
||||
We earn a commission if you make a purchase, at no additional cost to you.
|
||||
|
||||
#### Read More Articles
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/umbrel-review/
|
||||
|
||||
作者:[Pratham Patel][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/pratham/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://umbrel.com/
|
||||
[2]: https://youtu.be/Uu1TuE6RdKM
|
||||
[3]: https://www.raspberrypi.com/documentation/computers/linux_kernel.html#default_configuration
|
||||
[4]: https://github.com/getumbrel/umbrel-os#%EF%B8%8F-contributing
|
||||
[5]: https://github.com/getumbrel/umbrel-os/releases/latest
|
||||
[6]: https://www.balena.io/etcher/
|
||||
[7]: http://umbrel.local
|
||||
[8]: https://itsfoss.com/wp-content/uploads/2022/07/umbrel-address.webp
|
||||
[9]: https://itsfoss.com/wp-content/uploads/2022/07/umbrel-web-gui-800x516.webp
|
||||
[10]: https://itsfoss.com/nextcloud/
|
||||
[11]: https://itsfoss.com/syncthing/
|
||||
[12]: https://itsfoss.com/wp-content/uploads/2022/07/umbrel-app-store-800x451.webp
|
||||
[13]: https://github.com/getumbrel/umbrel-apps
|
||||
[14]: https://itsfoss.com/wp-content/uploads/2022/07/element-install-800x451.webp
|
||||
[15]: https://itsfoss.com/wp-content/uploads/2022/07/umbrel-settings-800x451.webp
|
||||
[16]: https://photoprism.app/
|
||||
[17]: https://itsfoss.com/raspberry-pi-projects/
|
||||
[18]: https://itsfoss.com/go/deployment-from-scratch-link/
|
||||
[19]: https://itsfoss.com/go/deployment-from-scratch-link/
|
||||
[20]: https://itsfoss.com/go/deployment-from-scratch-link/
|
284
sources/tech/20220709 How to Use Microsoft Office on Linux.md
Normal file
284
sources/tech/20220709 How to Use Microsoft Office on Linux.md
Normal file
@ -0,0 +1,284 @@
|
||||
[#]: subject: "How to Use Microsoft Office on Linux"
|
||||
[#]: via: "https://itsfoss.com/use-microsoft-office-linux/"
|
||||
[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How to Use Microsoft Office on Linux
|
||||
======
|
||||
For many users, not having native support for Microsoft Office is the only reason why they do not switch to Linux.
|
||||
|
||||
Yes, **Microsoft Office is not available to install on Linux**.
|
||||
|
||||
For some existing users, not having Microsoft Office on Linux creates additional pain.
|
||||
|
||||
Sure, there are several good open source office suites available and they are sufficient for most users.
|
||||
|
||||
But there are situations when you are compelled to use MS Office.
|
||||
|
||||
If other people at work send you Office documents with complex macros, it may not work well with LibreOffice.
|
||||
|
||||
Similarly, if your university or workplace requires you to write in .docx or .xlsx and you use LibreOffice, there might be compatibility issues if tables, macros and other elements are involved.
|
||||
|
||||
These are practical difficulties that are encountered by people who have to collaborate with MS office users.
|
||||
|
||||
**If you are in a situation where you must use Microsoft Office, you don’t need to ditch Linux altogether.**
|
||||
|
||||
Here are a few suggestions on how you could use Microsoft Office on the Linux desktop.
|
||||
|
||||
### Your options for using Microsoft Office on Linux
|
||||
|
||||
There are various **alternative methods** you can use to access Microsoft’s Office on Linux.
|
||||
|
||||
Sure, it’s not the same using MS Office on Windows, but at least it allows you to work with Office documents.
|
||||
|
||||
#### 1. Use Microsoft Office 365 Online
|
||||
|
||||
Yes, you can use Microsoft Office applications in your web browser. And this works on any operating system. That includes Linux, of course.
|
||||
|
||||
This is the best way to access Microsoft Office apps if you have a stable internet connection.
|
||||
|
||||
Do note that the online Office version doesn’t have all the features you get in the desktop version. Still, it’s a good enough choice in many cases.
|
||||
|
||||
If you have a Microsoft account, you can [sign in to Microsoft 365 directly][1]. If you don’t have one, you must create a Microsoft account.
|
||||
|
||||
Without any paid subscription, you can use a lite version of all the essential office tools like Microsoft Word, Excel, and more, right on your web browser.
|
||||
|
||||
Sounds good, right?
|
||||
|
||||
![microsoft office linux][2]
|
||||
|
||||
The best part of this service is you can utilize free 5 GB of OneDrive storage to keep your documents online, and it integrates well will all the apps available in the suit. Not to forget, you can also use the mobile app on the go.
|
||||
|
||||
Note that there are some feature differences between Office Online and its native desktop applications. You can know more about it in its [official documentation][3].
|
||||
|
||||
Moreover, if you want to make the most out of it, with more cloud storage, and some premium features, you may opt for the Microsoft 365 subscription as well.
|
||||
|
||||
##### Pros
|
||||
|
||||
* Comes free with Microsoft account
|
||||
* Documents are saved in the cloud and can be accessed from any device
|
||||
* 5 GB of free storage with OneDrive
|
||||
* Can be used on any operating system without installing the software
|
||||
|
||||
##### Cons
|
||||
|
||||
* You must create a Microsoft account
|
||||
* Free version lacks features
|
||||
* You can only store documents up to 5 GB for free
|
||||
* Needs internet connection to access and edit files
|
||||
|
||||
#### 2. Using a Windows compatibility program
|
||||
|
||||
What if you would like to experience the desktop app of Microsoft Office from within your Linux system?
|
||||
|
||||
You can use a virtual machine to install Windows, but we discuss that next, considering it is time-consuming.
|
||||
|
||||
Instead, you can use Windows compatibility layers for specific software, by which you can run them on Linux machines.
|
||||
|
||||
I’ll suggest two ways to install Microsoft Office desktop application on Linux
|
||||
|
||||
* Using PlayOnLinux (free but provides older versions of MS office)
|
||||
* Using CrossOver (paid and comes with proper support)
|
||||
|
||||
Let me give you a brief overview of how to use them
|
||||
|
||||
##### Using PlayOnLinux
|
||||
|
||||
[PlayOnLinux][4] is one of the best ways to run Windows applications on Linux.
|
||||
|
||||
On Ubuntu, you can install it using a command through the terminal as follows:
|
||||
|
||||
```
|
||||
sudo apt install winbind playonlinux winetricks -y
|
||||
```
|
||||
|
||||
After installation, launch the program and click on the Install button which will sync available packages and will allow us to install MS Office (desired version).
|
||||
|
||||
![Using PlayOnLinux on Ubuntu][5]
|
||||
|
||||
Now, you’ll be given a prompt where we will be searching for our desired software.
|
||||
|
||||
If you already purchased Microsoft Office earlier, you can have the installation media or the ISO file ready from their [official download page][6].
|
||||
|
||||
Enable the option labeled as “No-cd needed” if you do not plan to use your installer, and search “Office”.
|
||||
|
||||
It will list all compatible Microsoft Office programs. Select your desired version and click on the **Install** button to download/install it automatically.
|
||||
|
||||
![Searching for MS Office in PlayOnLinux][7]
|
||||
|
||||
It will automatically create a virtual space for MS Office and will install Wine through the installer. Once you are done with the basic steps, it will show you a prompt where you have to choose the installation method between the setup file and DVD.
|
||||
|
||||
We’ll be going with the first option for convenience. After selecting the first option, locate the setup file and all the other processes will be handled automatically.
|
||||
|
||||
![using setup file][8]
|
||||
|
||||
Soon the installer will start the installation process and in no time you will get your favorite office suite installed on your system. You can directly access it without PlayOnLinux from your Linux system or from within the application as well.
|
||||
|
||||
![MS Office suit on Linux with PlayOnLinux][9]
|
||||
|
||||
For example, let’s try launching MS Word. Here’s what it looks like:
|
||||
|
||||
![Running MS Office][10]
|
||||
|
||||
Note that you won’t find the latest version of Microsoft Office with this method, and probably not the best experience in terms of performance.
|
||||
|
||||
##### Using CrossOver
|
||||
|
||||
[CrossOver][11] is a paid software that lets you run Windows applications on Linux in the best way possible.
|
||||
|
||||
![crossover][12]
|
||||
|
||||
It is built on top of Wine, and several open-source projects. The CrossOver developers contribute heavily to the [WINE project][13].
|
||||
|
||||
You just need to purchase it once and use it as long as you want. Unfortunately, you still cannot get the latest Microsoft Office version 2021 to work with it. The [ratings are poor][14]. The newest that works well with CrossOver is Office 2016 at the time of writing this article.
|
||||
|
||||
Oh, yes! CrossOver has a [compatibility database][15]. You can search for the desired Windows software and see if it is well supported or not.
|
||||
|
||||
If you want convenience, and a tool to run Windows applications on Linux (not just Microsoft Office) and you don’t mind paying for it, you should try it out.
|
||||
|
||||
##### Pros
|
||||
|
||||
* No need for internet while using Office
|
||||
* Your existing Office license may work the same
|
||||
|
||||
##### Cons
|
||||
|
||||
* Only older versions are available
|
||||
|
||||
[Use Windows Software on Linux with Crossover][16]
|
||||
|
||||
Thousands of Windows games and programs to run on your favorite Linux distro.
|
||||
|
||||
Supported Windows apps will run at native speed, play games at full fps all while maintaining the Linux OS integration. Simply magic!
|
||||
|
||||
Your purchase supports WINE development as well.
|
||||
|
||||
![Use Windows Software on Linux with Crossover][17]
|
||||
|
||||
[Get it now][18]
|
||||
|
||||
We earn a commission if you make a purchase, at no additional cost to you.
|
||||
|
||||
#### 3. Use a virtual machine to run Windows
|
||||
|
||||
So if you are someone with enough system resources to spare, this option will enable you to use a wide range of exclusive software. It’s because, you will be using Windows from within Linux, as a virtual machine.
|
||||
|
||||
If you are not familiar with it, the virtual machine mechanism allows you to use another operating system (like Windows) inside Linux like a regular application.
|
||||
|
||||
![A Video from YouTube][19]
|
||||
|
||||
You can choose to use options like [Quickgui][20], VMware, [GNOME Boxes][21], or VirtualBox.
|
||||
|
||||
As an example, you can follow our guide on [installing Windows 10 using VirtualBox on Linux][22].
|
||||
|
||||
It can be exciting, you know! But to run a virtual machine, you need to have a computer with enough system resources. It will struggle miserably if you try to use it on a 4 GB RAM and i3 processor.
|
||||
|
||||
It’s not perfect. As you may have trouble sharing clipboards and files between the guest OS (Windows) and host OS (Linux).
|
||||
|
||||
Another thing is about Windows licensing. If you have a new system that came preinstalled with Windows, your license is linked to your machine on BIOS/firmware level. You should be able to use Windows in the virtual machine without issues. But if that was not the case, you may have to activate Windows.
|
||||
|
||||
##### Pros
|
||||
|
||||
* No need for internet while using Office
|
||||
* Use the latest version of MS Office
|
||||
* Use other Windows-only software
|
||||
|
||||
##### Cons
|
||||
|
||||
* Only works well with high-end computers with good system resources
|
||||
* Licensing could be an issue
|
||||
|
||||
#### 4. Use alternative office suits that are compatible with MS Office files
|
||||
|
||||
So if you are using Linux for a while, the chances of your distro being shipped with LibreOffice are quite high. But LibreOffice is not always compatible with MS Office file formats.
|
||||
|
||||
I would suggest **two office suites which are known for better compatibilty with your Microsoft Office files**:
|
||||
|
||||
##### 1. OnlyOffice
|
||||
|
||||
![onlyoffice][23]
|
||||
|
||||
If you are looking for an office suite that is identical to Microsoft Office with several essential features, [OnlyOffice][24] can be a great choice.
|
||||
|
||||
You can download the desktop edition for free on Linux, Windows, and macOS.
|
||||
|
||||
If you have a [Nextcloud][25] instance or similar, you can also integrate it with that for usage.
|
||||
|
||||
##### 2. WPS Office
|
||||
|
||||
![wps office][26]
|
||||
|
||||
WPS Office was previously known as Kingsoft Office. The Chinese developers of WPS Offices are unabashed about imitating the look and feel of the MS Office products.
|
||||
|
||||
**This is not open-source, though.**
|
||||
|
||||
WPS is fine-tuned for personal use and provides good compatibility with Microsoft Office documents.
|
||||
|
||||
Being one of the best alternatives to MS Office, you can follow [our guide][27] for easy installation and get WPS running in no time on Linux.
|
||||
|
||||
##### Pros
|
||||
|
||||
* No need for internet while using Office
|
||||
* Use the latest version of MS Office
|
||||
* Use other Windows-only software
|
||||
|
||||
##### Cons
|
||||
|
||||
* Only works well with high-end computers with good system resources
|
||||
* Licensing could be an issue
|
||||
|
||||
### No real love for Linux from Microsoft but you’ll always find a way
|
||||
|
||||
Microsoft has clarified that it loves open-source as much as everyone. But, we still need to resort to numerous ways to run Microsoft Office on Linux. Instead of bringing its Office suite to Linux, [Microsoft gifted its calculator][28] to the community.
|
||||
|
||||
Linux users always find a way around things. Though MS Office is not officially available for Linux, you can still employ one of the workarounds I suggested here.
|
||||
|
||||
In my opinion, Office 365 is a pretty good option if you are always connected to the internet.
|
||||
|
||||
What do you think?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/use-microsoft-office-linux/
|
||||
|
||||
作者:[Sagar Sharma][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/sagar/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://www.microsoft.com/en-in/microsoft-365/free-productivity-apps
|
||||
[2]: https://itsfoss.com/wp-content/uploads/2022/07/microsoft-office-linux.jpg
|
||||
[3]: https://docs.microsoft.com/en-us/office365/servicedescriptions/office-online-service-description/office-online-service-description
|
||||
[4]: https://www.playonlinux.com/en/
|
||||
[5]: https://itsfoss.com/wp-content/uploads/2022/07/Sync-available-software-1-2.png
|
||||
[6]: https://www.microsoft.com/en-us/download/office.aspx
|
||||
[7]: https://itsfoss.com/wp-content/uploads/2022/07/Searching-for-MS-Office-2.png
|
||||
[8]: https://itsfoss.com/wp-content/uploads/2022/07/Using-setup-file-2.png
|
||||
[9]: https://itsfoss.com/wp-content/uploads/2022/07/Installed-office-suit-800x445.png
|
||||
[10]: https://itsfoss.com/wp-content/uploads/2022/07/MS-Office-800x660.png
|
||||
[11]: https://itsfoss.com/go/crossover/
|
||||
[12]: https://itsfoss.com/wp-content/uploads/2022/07/crossover-21-1-0.png
|
||||
[13]: https://www.winehq.org/
|
||||
[14]: https://www.codeweavers.com/compatibility/crossover/microsoft-office-2021
|
||||
[15]: https://www.codeweavers.com/compatibility
|
||||
[16]: https://itsfoss.com/go/crossover/
|
||||
[17]: https://itsfoss.com/go/crossover/
|
||||
[18]: https://itsfoss.com/go/crossover/
|
||||
[19]: https://youtu.be/_Kh_Y3xg890
|
||||
[20]: https://itsfoss.com/quickgui/
|
||||
[21]: https://itsfoss.com/share-files-gnome-boxes/
|
||||
[22]: https://itsfoss.com/install-windows-10-virtualbox-linux/
|
||||
[23]: https://itsfoss.com/wp-content/uploads/2022/07/OnlyOffice-800x518.png
|
||||
[24]: https://itsfoss.com/recommends/onlyoffice/
|
||||
[25]: https://itsfoss.com/nextcloud/
|
||||
[26]: https://itsfoss.com/wp-content/uploads/2022/07/WPS-office-1-800x443.png
|
||||
[27]: https://itsfoss.com/wps-office-linux/
|
||||
[28]: https://itsfoss.com/windows-calculator-linux/
|
@ -2,44 +2,44 @@
|
||||
[#]: via: "https://opensource.com/article/22/1/linux-desktop-notifications"
|
||||
[#]: author: "Tomasz Waraksa https://opensource.com/users/tomasz"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: translator: "mcfd"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Send desktop notifications and reminders from Linux terminal
|
||||
从 Linux 终端发送桌面通知与提醒
|
||||
======
|
||||
This Linux tutorial demonstrates how to use script commands to send
|
||||
yourself desktop notifications and reminders.
|
||||
本 Linux 教程演示如何使用脚本命令来发送
|
||||
自己的桌面通知与提醒。
|
||||
![Person using a laptop][1]
|
||||
|
||||
Sometimes it's useful to get visual feedback from a script. For example, when a script or cron job completes, a long-running build fails, or there is an urgent problem during script execution. Desktop applications can do this with popup notifications, but it can be done from a script too! You can use script commands to send yourself desktop notifications and reminders.
|
||||
有时候,来自脚本的视觉回馈是很有用的。例如,当一个脚本或计划任务完成时,一个长期运行的构建任务失败时,或者当脚本执行中出现了紧急问题时。桌面应用程序可以通过弹出通知来做到这一点,但脚本也可以做到这一点!你可以使用脚本命令来给自己发送桌面通知与提醒。
|
||||
|
||||
![Example notification][2]
|
||||
|
||||
(Tomasz Waraksa, CC BY-SA 4.0)
|
||||
|
||||
The below code has been written and tested on Linux. It can also be done on macOS with a bit of effort. See the last section for some [hints and tips][3].
|
||||
下面的代码是在 Linux 上编写和测试的。它也可以在 macOS 上运行,只需花点功夫。请参见最后一节 [提示与技巧][3]。
|
||||
|
||||
### Sending notifications from the Linux terminal
|
||||
### 从 Linux 终端发送通知
|
||||
|
||||
To send notifications from the Linux terminal, use the [`notify-send`][4] command. Run `which ``notify-send` to see if it's present on your system. If not, install it with your package manager of choice.
|
||||
要从 Linux 终端发送通知,请使用 [`notify-send`][4] 命令。运行 `which ``notify-send` 命令来查看它是否在于你的系统中。如果没有,请使用包管理器来安装它。
|
||||
|
||||
On Fedora, type:
|
||||
在 Fedora 上,输入:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo dnf install notify-send`
|
||||
```
|
||||
|
||||
On Debian-based distributions, type:
|
||||
在基于 Debian 的发行版上,输入:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo apt install notify-send`
|
||||
```
|
||||
|
||||
A few examples of simple notifications:
|
||||
几个简单的通知示例:
|
||||
|
||||
|
||||
```
|
||||
@ -50,7 +50,7 @@ $ notify-send "Tip of the Day" "How about a nap?"
|
||||
|
||||
```
|
||||
|
||||
You can customize the notification with options such as urgency level, custom icon, etc. Find out more with `man notify-send`. You can use a small set of HTML tags in the notification body to give your messages a nice touch. On top of that, URLs are rendered as clickable. For example:
|
||||
你可以用紧急程度、自定义图标等选项来自定义通知。过 `man notify-send` 了解更多。你也可以在通知正文中使用一小组 HTML 标记,以使消息有一个棒的视觉感受。最重要的是,URL 被呈现为可点击的。例如:
|
||||
|
||||
|
||||
```
|
||||
@ -66,18 +66,18 @@ $ notify-send -u critical \
|
||||
|
||||
(Tomasz Waraksa, CC BY-SA 4.0)
|
||||
|
||||
Sent notifications are picked up by the desktop environment and displayed just like any other notification. They will have the same consistent look, feel, and behavior.
|
||||
发送的通知会被桌面环境接收,并像其他通知一样显示。它们将具有相同的外观、交互和行为。
|
||||
|
||||
### Combine notify-send with at
|
||||
### 将 notify-send 与 at 结合使用
|
||||
|
||||
Cron is commonly used to schedule commands at regular intervals. The `at` command schedules the single execution of a command at a specified time. If you run it like this, it starts in interactive mode, where you can enter commands to execute at a given time:
|
||||
计划任务通常被用来定期安排命令。`at` 命令安排在一个指定的时间执行一条命令。 如果你像这样运行它,它会以交互模式启动,你可以在其中输入要在指定时间执行的命令:
|
||||
|
||||
|
||||
```
|
||||
`$ at 12:00`
|
||||
```
|
||||
|
||||
This isn't useful for scripts. Luckily, `at` accepts parameters from standard input so that we can use it this way:
|
||||
这对脚本来说并不有用。幸运的是, `at` 接受来自标准输入的参数,所以我们可以这样使用它:
|
||||
|
||||
|
||||
```
|
||||
@ -88,7 +88,7 @@ $ echo "backup-db" | at 13:00
|
||||
|
||||
```
|
||||
|
||||
There are many ways of specifying time. From absolute time, such as `10:00` through relative time, such as `now + 2 hours`, to special times such as `noon` or `midnight`. We can combine it with `notify-send` to show ourselves reminders at some time in the future. For example:
|
||||
有许多指定时间的方法。 从绝对时间,如 `10:00`,到相对时间,如 `now + 2 hours` ,再特殊时间,如`noon` 或 `midnight`。我们可以把它和 `notify-send` 结合起来,在未来的某个时间向自己发送提醒。例如:
|
||||
|
||||
|
||||
```
|
||||
@ -99,9 +99,9 @@ There are many ways of specifying time. From absolute time, such as `10:00` thro
|
||||
|
||||
(Tomasz Waraksa, CC BY-SA 4.0)
|
||||
|
||||
### The remind command
|
||||
### 提醒的命令
|
||||
|
||||
Now, build a custom Bash command for sending yourself reminders. How about something as simple and human-friendly as:
|
||||
现在,建立一个自定义的 Bash 命令来给自己发送提醒信息。像这样简单且人性化的命令:
|
||||
|
||||
|
||||
```
|
||||
@ -115,18 +115,18 @@ $ remind "It's Friday pints time!" at 17:00
|
||||
|
||||
```
|
||||
|
||||
This is better than Alexa! How to get this goodness?
|
||||
这比 Alexa 更好!该怎样做?
|
||||
|
||||
See the code below. It defines a shell function called **remind**, which supports the above syntax. The actual work is done in the last two lines. The rest is responsible for help, parameter validation, etc., which roughly matches the proportion of useful code vs. necessary white-noise in any large application.
|
||||
请看下面的代码。它定义了一个名为 **remind** 的函数,它支持上述语法。实际工作是在最后两行完成的。其余的部分负责显示帮助信息、参数校验等,这与任何大型应用程序中有用的代码与必要的白噪声的比例大致相同。
|
||||
|
||||
Save the code somewhere, for example, in the `~/bin/remind` file, and source the function in your `.bashrc` profile so that it's loaded when you log in:
|
||||
把代码保存在某个地方,例如,在 `~/bin/remind` 文件中,并在你的 `.bashrc` 配置文件写入该函数,以便在你登录时加载它:
|
||||
|
||||
|
||||
```
|
||||
`$ source ~/bin/remind`
|
||||
```
|
||||
|
||||
Reload the terminal, then type remind to see the syntax. Enjoy!
|
||||
重新打开终端,然后输入 remind 来查看语法。尽情享受吧!
|
||||
|
||||
|
||||
```
|
||||
@ -195,13 +195,13 @@ function remind () {
|
||||
|
||||
```
|
||||
|
||||
### Easy notifications
|
||||
### 简单的提醒
|
||||
|
||||
With these few simple open source commands, you can integrate your own scripts, applications, and tasks with your desktop. Try it out!
|
||||
通过这几个简单的开源命令,你可以将你自己的脚本、应用程序和任务与你的桌面结合起来。试一试吧!
|
||||
|
||||
* * *
|
||||
|
||||
_This article has been adapted with the author's permission from the original article, found [here][7]._
|
||||
_本文经作者许可改编自原文,详情见[此处][7]。_
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -209,7 +209,7 @@ via: https://opensource.com/article/22/1/linux-desktop-notifications
|
||||
|
||||
作者:[Tomasz Waraksa][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
译者:[mcfd](https://github.com/mcfd)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
@ -0,0 +1,223 @@
|
||||
[#]: subject: "How dynamic linking for modular libraries works on Linux"
|
||||
[#]: via: "https://opensource.com/article/22/5/dynamic-linking-modular-libraries-linux"
|
||||
[#]: author: "Jayashree Huttanagoudar https://opensource.com/users/jayashree-huttanagoudar"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "robsean"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
如何在 Linux 上动态链接模块库
|
||||
======
|
||||
学习如何将多个 C <ruby>对象<rt>object</rt></ruby> 文件组合到一个带有动态库的单个可执行文件文件之中
|
||||
|
||||
![Links][1]
|
||||
|
||||
图片作者: Paul Lewin ,由 Opensource.com 稍微修改,CC BY-SA 2.0
|
||||
|
||||
当不使用 C 编程语言编写一个应用程序时,你的代码通常有多个源文件代码。
|
||||
|
||||
归根结底,这些文件必需被编译到一个单个的可执行文件之中。你可以通过创建静态或动态库 (后者也被称为 <ruby>共享<rt>shared</rt></ruby> 库) 来实现这一点。这两种类型的库在创建和链接方面有所差异。两者都有缺点和优点,这取决于你的使用实例。
|
||||
|
||||
动态链接是最常见的方法,由其是在 Linux 系统上。动态链接会保持库模块化,因此,很多应用程序可以共享一个库。应用程序的模块化也允许单独更新其依赖的共享库。
|
||||
|
||||
在这篇文章中,我将演示动态链接是如何工作的。在后期的文章中,我将演示静态链接。
|
||||
|
||||
### 链接器
|
||||
|
||||
链接器是一个命令,它将一个程序的数个部分组合到一起,并为它们重新组织存储器分配。
|
||||
|
||||
链接器的功能包括:
|
||||
|
||||
* 集成一个程序的所有的部分
|
||||
* 计算组织出一个新的存储器结构,以便所有的部分组合在一起
|
||||
* 重新复活存储器地址,以便程序可以在新的存储器组织下运行
|
||||
* 解析符号引用
|
||||
|
||||
作为这些链接器功能的结果,创建了一个名称为可执行文件的一个可运行程序。在你创建一个动态链接的可执行文件前,你需要一些将被链接 *到* 的库,和一个应用程序来编译。准备好你 [最喜欢的文本编辑器][2] 并继续。
|
||||
|
||||
### 创建 <ruby>对象<rt>object</rt></ruby> 文件
|
||||
|
||||
首先,创建带有这些函数识别标志的头文件 `mymath.h` :
|
||||
|
||||
```
|
||||
int add(int a, int b);
|
||||
int sub(int a, int b);
|
||||
int mult(int a, int b);
|
||||
int divi(int a, int b);
|
||||
```
|
||||
|
||||
使用这些函数定义来创建 `add.c` 、`sub.c` 、`mult.c` 和 `divi.c` 文件。我将把所有的代码都放置到一个代码块中,因此将其分为四个文件,如注释所示:
|
||||
|
||||
```
|
||||
// add.c
|
||||
int add(int a, int b){
|
||||
return (a+b);
|
||||
}
|
||||
|
||||
//sub.c
|
||||
int sub(int a, int b){
|
||||
return (a-b);
|
||||
}
|
||||
|
||||
//mult.c
|
||||
int mult(int a, int b){
|
||||
return (a*b);
|
||||
}
|
||||
|
||||
//divi.c
|
||||
int divi(int a, int b){
|
||||
return (a/b);
|
||||
}
|
||||
```
|
||||
|
||||
现在,使用 GCC 来创建对象文件 `add.o`、`sub.o`、`mult.o` 和 `divi.o` :
|
||||
|
||||
```
|
||||
$ gcc -c add.c sub.c mult.c divi.c
|
||||
```
|
||||
|
||||
`-c` 选项跳过链接步骤,并且只创建对象文件。
|
||||
|
||||
### 创建一个共享的对象文件
|
||||
|
||||
在最终可执行文件的执行过程中将链接动态库。在最终可执行文件中仅放置动态库的名称。实际上的链接过程发生在运行时,在此期间,可执行文件和库都被放置到了主存储器之中。
|
||||
|
||||
除了可共享外,动态库的另外一个优点是它减少最终可执行文件的大小。在一个应用程序的最终可执行文件生成时,其使用的库只包括该库的名称,而不再包含该库的一个多余的副本。
|
||||
|
||||
你可以从你现有的示例代码中创建动态库:
|
||||
|
||||
```
|
||||
$ gcc -Wall -fPIC -c add.c sub.c mult.c divi.c
|
||||
```
|
||||
|
||||
选项 `-fPIC` 告诉 GCC 来生成位置独立代码 (PIC) 。`-Wall` 选项不是必需的,并且与代码的编译方式是无关的。不过,它却是有价值的选项,因为它会启用编译器警告,这在解决难题时是很有帮助的。
|
||||
|
||||
使用 GCC ,创建共享库 `libmymath.so` :
|
||||
|
||||
```
|
||||
$ gcc -shared -o libmymath.so \
|
||||
add.o sub.o mult.o divi.o
|
||||
```
|
||||
|
||||
现在,你已经创建了一个简单的示例数学库 `libmymath.so` ,你可以在 C 代码中使用它。当然,这里有非常复杂的 C 库,这就是他们这些开发者来生成最终产品的工艺流程,你和我可以安装这些库并在 C 代码中使用。
|
||||
|
||||
接下来,你可以在一些自定义代码中使用你的新的数学库,然后链接它。
|
||||
|
||||
### 创建一个动态链接的可执行文件
|
||||
|
||||
假设你已经为数学运算编写了一个命令。创建一个名称为 `mathDemo.c` 的文件,并将这些代码复制粘贴至其中:
|
||||
|
||||
```
|
||||
#include <mymath.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
int x, y;
|
||||
printf("Enter two numbers\n");
|
||||
scanf("%d%d",&x,&y);
|
||||
|
||||
printf("\n%d + %d = %d", x, y, add(x, y));
|
||||
printf("\n%d - %d = %d", x, y, sub(x, y));
|
||||
printf("\n%d * %d = %d", x, y, mult(x, y));
|
||||
|
||||
if(y==0){
|
||||
printf("\nDenominator is zero so can't perform division\n");
|
||||
exit(0);
|
||||
}else{
|
||||
printf("\n%d / %d = %d\n", x, y, divi(x, y));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
注意:第一行是一个 `include` 语句,通过名称来引用你自己的 `libmymath` 库。为使用一个共享库,你必须已经安装了它,如果你没有安装你将要使用的库,那么当你的可执行文件在运行和搜索其包含的库时,它将不能找到共享库。在已知目录中未安装所需库的情况下,你需要能够编译代码,这里有 [一些方法来重写默认的设置][3]。不过,对于一般使用来说,库存在于已知位置是可以预期的,因此,这就是我在这里演示的东西。
|
||||
|
||||
复制文件 `libmymath.so` 到一个标准的系统目录,例如:`/usr/lib64`, 然后运行 `ldconfig` 。`ldconfig` 命令会在标准库目录中创建所需要的链接,并将其缓存到可找到的最近的共享库。
|
||||
|
||||
```
|
||||
$ sudo cp libmymath.so /usr/lib64/
|
||||
$ sudo ldconfig
|
||||
```
|
||||
|
||||
### 编译应用程序
|
||||
|
||||
从你的应用程序源文件代码 (`mathDemo.c`) 中创建一个名称为 `mathDemo.o` 的对象文件:
|
||||
|
||||
```
|
||||
$ gcc -I . -c mathDemo.c
|
||||
```
|
||||
|
||||
`-I` 选项告诉 GCC 来在其后所列出的目录中搜索头文件 (在这个实例中是 `mymath.h` )。在这个实例中,你正在具体指定当前目录,通过一个单个点 (`.` ) 来表示。创建一个可执行文件,使用 `-l` 选项来通过名称来引用到你的共享数学库:
|
||||
|
||||
```
|
||||
$ gcc -o mathDynamic mathDemo.o -lmymath
|
||||
```
|
||||
|
||||
GCC 会找到 `libmymath.so` ,因为它存在于一个默认的系统库目录中。使用 `ldd` 来查证所使用的共享库:
|
||||
|
||||
```
|
||||
$ ldd mathDemo
|
||||
linux-vdso.so.1 (0x00007fffe6a30000)
|
||||
libmymath.so => /usr/lib64/libmymath.so (0x00007fe4d4d33000)
|
||||
libc.so.6 => /lib64/libc.so.6 (0x00007fe4d4b29000)
|
||||
/lib64/ld-linux-x86-64.so.2 (0x00007fe4d4d4e000)
|
||||
```
|
||||
|
||||
看看 `mathDemo` 可执行文件的大小:
|
||||
|
||||
```
|
||||
$ du ./mathDynamic
|
||||
24 ./mathDynamic
|
||||
```
|
||||
|
||||
当然,它是一个小的应用程序,它所占用的磁盘空间量也反映了这一点。相比之下,相同代码的一个静态链接版本 (正如你将在我后期的文章所看到的一样) 是 932K !
|
||||
|
||||
```
|
||||
$ ./mathDynamic
|
||||
Enter two numbers
|
||||
25
|
||||
5
|
||||
|
||||
25 + 5 = 30
|
||||
25 - 5 = 20
|
||||
25 * 5 = 125
|
||||
25 / 5 = 5
|
||||
```
|
||||
|
||||
你可以使用 `file` 命令来查证它是动态链接的:
|
||||
|
||||
```
|
||||
$ file ./mathDynamic
|
||||
./mathDynamic: ELF 64-bit LSB executable, x86-64,
|
||||
dynamically linked,
|
||||
interpreter /lib64/ld-linux-x86-64.so.2,
|
||||
with debug_info, not stripped
|
||||
```
|
||||
|
||||
成功!
|
||||
|
||||
### 动态链接
|
||||
|
||||
因为链接发生在运行时,所以,使用一个共享库会导致产生一个轻量型的可执行文件。因为它在运行时解析引用,所以它会花费更多的执行时间。不过,因为 在日常使用的 Linux 系统上绝大多数的命令是动态链接的,并且在现代硬件上,所以和使用静态编译程序所能节省的时间相比是可以忽略的。对开发者和用户来说,它的固有模块性是一种强大的特色功能。
|
||||
|
||||
在这篇文章中,我描述了如何创建动态库并将其链接到一个最终可执行文件。在我的下一篇文章中,我将使用相同的源文件代码来创建一个静态链接的可执行文件。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/22/5/dynamic-linking-modular-libraries-linux
|
||||
|
||||
作者:[Jayashree Huttanagoudar][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://opensource.com/users/jayashree-huttanagoudar
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://opensource.com/sites/default/files/lead-images/links.png
|
||||
[2]: https://opensource.com/article/21/2/open-source-text-editors
|
||||
[3]: https://opensource.com/article/22/5/compile-code-ldlibrarypath
|
@ -0,0 +1,129 @@
|
||||
[#]: subject: "How to Boot into an Older Kernel By Default in Ubuntu and Other Linux"
|
||||
[#]: via: "https://itsfoss.com/boot-older-kernel-default/"
|
||||
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "hanszhao80"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
如何给 Ubuntu 等 Linux 系统的旧内核设置默认启动
|
||||
======
|
||||
这是一个可能的情景。你的系统收到了内核更新,但不知何故,事情不像以前那样顺利。
|
||||
|
||||
你意识到,如果你启动到较旧的内核(是的,你可以降级内核),一切都会恢复正常。
|
||||
|
||||
高兴之余你会觉得有点儿不爽。因为你不得不在每次启动时手动选择较旧的内核。
|
||||
|
||||
一位年长的 It's FOSS 读者遇到了这个问题。[Linux Mint][1] 中的新内核更新没有按预期工作。启动到较旧的内核“修复”了问题,但麻烦的是在每次启动时要去手动选择较旧的内核。
|
||||
|
||||
删除新内核而使用旧内核不是一个好主意,因为新内核将会在下一次系统更新时被安装使用。
|
||||
|
||||
因此,我建议设置成默认启动到较旧的 Linux 内核。怎么做?这就是我将在本教程中向你展示的内容。
|
||||
|
||||
### 启动至较旧的 Linux 内核
|
||||
|
||||
你可能不了解,你的 Linux 发行版会在你的系统上安装多个 Linux 内核。不信?使用以下命令 [列出 Ubuntu 中已安装的内核][2]:
|
||||
|
||||
```
|
||||
apt list --installed | grep linux-image
|
||||
```
|
||||
|
||||
当你升级系统时会获得一个新版本的内核,这时你的系统会自动选择启动至最新的可用内核。
|
||||
|
||||
在 [grub][3] 屏幕中,你可以 **转到<ruby>高级选项<rt>Advanced option</rt></ruby>**(或较旧的 Linux 版本):
|
||||
|
||||
![ubuntu grub][4]
|
||||
|
||||
在这里,你可以看到要启动的可用内核。选择较旧的(不带<ruby>恢复选项<rt>recovery option</rt></ruby>):
|
||||
|
||||
![grub 高级选项][5]
|
||||
|
||||
你不会注意到任何显示的差异。你的文件和应用程序保持不变。
|
||||
|
||||
现在你已经启动到旧内核,是时候让你的系统自动启动到它了。
|
||||
|
||||
### 使旧内核成为默认启动项
|
||||
|
||||
如果你乐于使用 Linux 终端和命令,你可以修改 /etc/default/grub 文件并在其中添加以下行:
|
||||
|
||||
```
|
||||
GRUB_DEFAULT=saved
|
||||
GRUB_SAVEDEFAULT=true
|
||||
```
|
||||
|
||||
然后使用如下命令 [更新 grub][6]:
|
||||
|
||||
```
|
||||
sudo update-grub
|
||||
```
|
||||
|
||||
你在这里所做的是告诉你的系统将当前使用的启动项保存为将来运行 GRUB 的默认启动项。
|
||||
|
||||
然而,并不是每个人都善于使用命令行,因此我将专注于一个名为 [Grub Customizer][7] 的 GUI 工具。
|
||||
|
||||
#### 安装 Grub Customizer
|
||||
|
||||
使用官方 PPA [在基于 Ubuntu 的发行版中安装 Grub Customizer][8]:
|
||||
|
||||
```
|
||||
sudo add-apt-repository ppa:danielrichter2007/grub-customizer
|
||||
sudo apt update
|
||||
sudo apt install grub-customizer
|
||||
```
|
||||
|
||||
对于其他发行版,请使用你的包管理器来安装此工具。
|
||||
|
||||
#### 使用 Grub Customizer 更改默认启动项
|
||||
|
||||
当你运行 Grub Customizer 时,它会显示可用的启动项。
|
||||
|
||||
![ubuntu 的 grub customizer][9]
|
||||
|
||||
在这里你有两个选择。
|
||||
|
||||
**选择一:** 选择所需的内核项并使用箭头(显示在顶部菜单上)将其向上移动。
|
||||
|
||||
![在 Ubuntu grub 将旧内核向上移动][10]
|
||||
|
||||
**选择二:** 将<ruby>先前的启动项<rt>previously booted entry</rt></ruby>设为<ruby>默认启动项<rt>default entry</rt></ruby>。
|
||||
|
||||
![将当前启动项设为默认 Ubuntu 启动项][11]
|
||||
|
||||
我建议使用第二个选择,因为即使有新的内核更新它也可以工作。
|
||||
|
||||
这样你就可以在 Ubuntu 或其他发行版中降级内核,甚至无需删除旧内核版本。
|
||||
|
||||
请注意,像 Ubuntu 这样的发行版大部分一次只保留两个内核版本。因此,最终你首选的旧内核将在新的内核版本释出时被删除。
|
||||
|
||||
这个巧妙的技巧曾助我脱困。当时我 [在 Ubuntu 中安装最新的 Linux 内核][12] ,由于某种原因它与我的音频系统有问题。
|
||||
|
||||
无论是什么原因,你现在都知道如何自动启动到旧内核。
|
||||
|
||||
如果有问题或建议,请在评论区留言。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.c择m/boot-older-kernel-default/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[hanszhao80](https://github.com/hanszhao80)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://linuxmint.com/
|
||||
[2]: https://learnubuntu.com/list-installed-kernels/
|
||||
[3]: https://itsfoss.com/what-is-grub/
|
||||
[4]: https://itsfoss.com/wp-content/uploads/2022/06/ubuntu-grub.jpg
|
||||
[5]: https://itsfoss.com/wp-content/uploads/2022/06/Grub-Advanced-Options.jpg
|
||||
[6]: https://itsfoss.com/update-grub/
|
||||
[7]: https://itsfoss.com/customize-grub-linux/
|
||||
[8]: https://itsfoss.com/install-grub-customizer-ubuntu/
|
||||
[9]: https://itsfoss.com/wp-content/uploads/2022/06/grub-customizer-ubuntu.png
|
||||
[10]: https://itsfoss.com/wp-content/uploads/2022/06/move-older-kernel-up-the-order-ubntu-grub.png
|
||||
[11]: https://itsfoss.com/wp-content/uploads/2022/06/make-currently-booted-entry-as-default-ubuntu.png
|
||||
[12]: https://itsfoss.com/upgrade-linux-kernel-ubuntu/
|
Loading…
Reference in New Issue
Block a user