mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-16 22:42:21 +08:00
commit
3bd0587e46
181
published/20201014 Teach a virtual class with Moodle on Linux.md
Normal file
181
published/20201014 Teach a virtual class with Moodle on Linux.md
Normal file
@ -0,0 +1,181 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (stevenzdg988)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-13190-1.htmlhttps://linux.cn/article-13190-1.html)
|
||||
[#]: subject: (Teach a virtual class with Moodle on Linux)
|
||||
[#]: via: (https://opensource.com/article/20/10/moodle)
|
||||
[#]: author: (Don Watkins https://opensource.com/users/don-watkins)
|
||||
|
||||
基于 Linux 的 Moodle 虚拟课堂教学
|
||||
======
|
||||
|
||||
> 基于 Linux 的 Moodle 学习管理系统进行远程教学。
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202103/10/094113q0ggsbz0a0wb9eg4.jpg)
|
||||
|
||||
这次大流行对远程教育的需求比以往任何时候都更大。使得像 [Moodle][2] 这样的<ruby>学习管理系统<rt>learning management system</rt></ruby>(LMS)比以往任何时候都重要,因为越来越多的学校教育是借助虚拟现实技术的提供。
|
||||
|
||||
Moodle 是用 PHP 编写的免费 LMS,并以开源 [GNU 公共许可证][3](GPL)分发。它是由 [Martin Dougiamas][4] 开发的,自 2002 年发布以来一直在不断发展。Moodle 可用于混合学习、远程学习、<ruby>翻转课堂<rt>flipped classroom</rt></ruby>和其他形式的在线学习。目前,全球有超过 [1.9 亿用户][5] 和 145,000 个注册的 Moodle 网站。
|
||||
|
||||
我曾作为 Moodle 管理员、教师和学生等角色使用过 Moodle,在本文中,我将向你展示如何设置并开始使用它。
|
||||
|
||||
### 在 Linux 系统上安装 Moodle
|
||||
|
||||
Moodle 对 [系统要求][6] 适中,并且有大量文档可为你提供帮助。我最喜欢的安装方法是从 [Turnkey Linux][7] 下载并制作 ISO,然后在 VirtualBox 中安装 Moodle 网站。
|
||||
|
||||
首先,下载 [Moodle ISO][8] 保存到电脑中。
|
||||
|
||||
下一步,安装 VirtualBox 的 Linux 命令行如下:
|
||||
|
||||
```
|
||||
$ sudo apt install virtualbox
|
||||
```
|
||||
|
||||
或,
|
||||
|
||||
```
|
||||
$ sudo dnf install virtualbox
|
||||
```
|
||||
|
||||
当下载完成后,启动 VirtualBox 并在控制台中选择“<ruby>新建<rt>New</rt></ruby>”按钮。
|
||||
|
||||
![创建一个新的 VirtualBox 虚拟机][9]
|
||||
|
||||
选择使用的虚拟机的名称、操作系统(Linux)和 Linux 类型(例如 Debian 64 位)。
|
||||
|
||||
![命名 VirtualBox 虚拟机][11]
|
||||
|
||||
下一步,配置虚拟机内存大小,使用默认值 1024 MB。接下来选择 “<ruby>动态分配<rt>dynamically allocated</rt></ruby>”虚拟磁盘并在虚拟机中添加 `Moodle.iso` 镜像。
|
||||
|
||||
![添加 Moodle.iso 到虚拟机][12]
|
||||
|
||||
将你的网络设置从 NAT 更改为 “<ruby>桥接模式<rt>Bridged adapter</rt></ruby>”。然后启动虚拟机并安装 ISO 以创建 Moodle 虚拟机。在安装过程中,系统将提示为 root 帐户、MySQL 和Moodle 创建密码。Moodle 密码必须至少包含八个字符,至少一个大写字母和至少一个特殊字符。
|
||||
|
||||
重启虚拟机。安装完成后,请确保将 Moodle 应用配置内容记录在安全的地方。(安装后,可以根据需要删除 ISO 文件。)
|
||||
|
||||
![Moodle 应用配置][13]
|
||||
|
||||
重要提示,在互联网上的任何人还看不到你的 Moodle 实例。它仅存在于你的本地网络中:现在只有建筑物中与你连接到相同的路由器或 wifi 接入点的人可以访问你的站点。全世界的互联网无法连接到它,因为你位于防火墙(可能嵌入在路由器中,还可能嵌入在计算机中)的后面。有关网络配置的更多信息,请阅读 Seth Kenlon 关于 [打开端口和通过防火墙进行流量路由][14] 的文章。
|
||||
|
||||
### 开始使用 Moodle
|
||||
|
||||
现在你可以登录到 Moodle 机器并熟悉该软件了。使用默认的用户名 `admin` 和创建 Moodle VM 时设置的密码登录 Moodle。
|
||||
|
||||
![Moodle 登录界面][15]
|
||||
|
||||
首次登录后,你将看到初始的 Moodle 网站的主仪表盘。
|
||||
|
||||
![Moodle 管理员仪表盘][16]
|
||||
|
||||
默认的应用名称是 “Turnkey Moodle”,但是可以很容易地对其进行更改以适合你的学校、课堂或其他需要和选择。要使你的 Moodle 网站个性化,请在用户界面左侧的菜单中,选择“站点首页<rt>Site home</rt></ruby>”。然后,点击屏幕右侧的 “<ruby>设置<rt>Settings</rt></ruby>” 图标,然后选择 “<ruby>编辑设置<rt>Edit settings</rt></ruby>”。
|
||||
|
||||
![Moodle 设置][17]
|
||||
|
||||
你可以根据需要更改站点名称,并添加简短名称和站点描述。
|
||||
|
||||
![Moodle 网站名][18]
|
||||
|
||||
确保滚动到底部并保存更改。现在,你的网站已定制好。
|
||||
|
||||
![Moodle 保存更改][19]
|
||||
|
||||
默认类别为其他,这不会帮助人们识别你网站的目的。要添加类别,请返回主仪表盘,然后从左侧菜单中选择 “<ruby>站点管理<rt>Site administration</rt></ruby>”。 在 “<ruby>课程<rt>Courses</rt></ruby>”下,选择 “<ruby>添加类别<rt>Add a category</rt></ruby>”并输入有关你的网站的详细信息。
|
||||
|
||||
![在 Moodle 中添加类别选项][20]
|
||||
|
||||
要添加课程,请返回 “<ruby>站点管理<rt>Site administration</rt></ruby>”,然后单击 “<ruby>添加新课程<rt>Add a new course</rt></ruby>”。你将看到一系列选项,例如为课程命名、提供简短名称、设定类别以及设置课程的开始和结束日期。你还可以为课程形式设置选项,例如社交、每周式课程、主题,以及其外观、文件上传大小、完成情况跟踪等等。
|
||||
|
||||
![在 Moodle 中添加课程选项][21]
|
||||
|
||||
### 添加和管理用户
|
||||
|
||||
现在,你已经设置了课程,你可以添加用户。有多种方法可以做到这一点。如果你是家庭教师,则手动输入是一个不错的开始。Moodle 支持基于电子邮件的注册、[LDAP][22]、[Shibboleth(口令或暗语)][23] 和许多其他方式等。校区和其他较大的机构可以用逗号分隔的文件上传用户。也可以批量添加密码,并在首次登录时强制更改密码。有关更多信息,一定要查阅 Moodle [文档][24]。
|
||||
|
||||
Moodle 是一个非常细化的、面向许可的环境。使用 Moodle 的菜单将策略和角色分配给用户并执行这些分配很容易。
|
||||
|
||||
Moodle 中有许多角色,每个角色都有特定的特权和许可。默认角色有管理员、课程创建者、教师、非编辑教师、学生、来宾和经过身份验证的用户,但你可以添加其他角色。
|
||||
|
||||
### 为课程添加内容
|
||||
|
||||
一旦搭建了 Moodle 网站并设置了课程,就可以向课程中添加内容。Moodle 拥有创建出色内容所需要的所有工具,并且它建立在强调 [社会建构主义][25] 观点的坚实教学法之上。
|
||||
|
||||
我创建了一个名为 “Code with [Mu][26]” 的示例课程。它在 “<ruby>编程<rt>Programming</rt></ruby>” 类别和 “Python” 子类别中。
|
||||
|
||||
![Moodle 课程列表][27]
|
||||
|
||||
我为课程选择了每周式课程,默认为四个星期。使用编辑工具,我隐藏了除课程第一周以外的所有内容。这样可以确保我的学生始终专注于材料。
|
||||
|
||||
作为教师或 Moodle 管理员,我可以通过单击 “<ruby>添加活动或资源<rt>Add an activity or resource</rt></ruby>” 来将活动添加到每周的教学中。
|
||||
|
||||
![在 Moodle 中添加活动][28]
|
||||
|
||||
我会看到一个弹出窗口,其中包含可以分配给我的学生的各种活动。
|
||||
|
||||
![Moodle 活动菜单][29]
|
||||
|
||||
Moodle 的工具和活动使我可以轻松地创建学习材料,并以一个简短的测验来结束一周的学习。
|
||||
|
||||
![Moodle 活动清单][30]
|
||||
|
||||
你可以使用 1600 多个插件来扩展 Moodle,包括新的活动、问题类型,与其他系统的集成等等。例如,[BigBlueButton][31] 插件支持幻灯片共享、白板、音频和视频聊天以及分组讨论。其他值得考虑的包括用于视频会议的 [Jitsi][32] 插件、[抄袭检查器][33] 和用于颁发徽章的 [开放徽章工厂][34]。
|
||||
|
||||
### 继续探索 Moodle
|
||||
|
||||
Moodle 是一个功能强大的 LMS,我希望此介绍能引起你的兴趣,以了解更多信息。有很多出色的 [指南][35] 可以帮助你提高技能,如果想要查看 Moodle 的内容,可以在其 [演示站点][36] 上查看运行中的 Moodle;如果你想了解 Moodle 的底层结构或为开发做出 [贡献][38],也可以访问 [Moodle 的源代码][37]。如果你喜欢在旅途中工作,Moodle 也有一款出色的 [移动应用][39],适用于 iOS 和 Android。在 [Twitter][40]、[Facebook][41] 和 [LinkedIn][42] 上关注 Moodle,以了解最新消息。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/10/moodle
|
||||
|
||||
作者:[Don Watkins][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[stevenzdg988](https://github.com/stevenzdg988)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/don-watkins
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_desk_home_laptop_browser.png?itok=Y3UVpY0l (Digital images of a computer desktop)
|
||||
[2]: https://moodle.org/
|
||||
[3]: https://docs.moodle.org/19/en/GNU_General_Public_License
|
||||
[4]: https://dougiamas.com/about/
|
||||
[5]: https://docs.moodle.org/39/en/History
|
||||
[6]: https://docs.moodle.org/39/en/Installation_quick_guide#Basic_Requirements
|
||||
[7]: https://www.turnkeylinux.org/
|
||||
[8]: https://www.turnkeylinux.org/download?file=turnkey-moodle-16.0-buster-amd64.iso
|
||||
[9]: https://opensource.com/sites/default/files/uploads/virtualbox_new.png (Create a new VirtualBox)
|
||||
[10]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[11]: https://opensource.com/sites/default/files/uploads/virtualbox_namevm.png (Naming the VirtualBox VM)
|
||||
[12]: https://opensource.com/sites/default/files/uploads/virtualbox_attach-iso.png (Attaching Moodle.iso to VM)
|
||||
[13]: https://opensource.com/sites/default/files/uploads/moodle_appliance.png (Moodle appliance settings)
|
||||
[14]: https://opensource.com/article/20/9/firewall
|
||||
[15]: https://opensource.com/sites/default/files/uploads/moodle_login.png (Moodle login screen)
|
||||
[16]: https://opensource.com/sites/default/files/uploads/moodle_dashboard.png (Moodle admin dashboard)
|
||||
[17]: https://opensource.com/sites/default/files/uploads/moodle_settings.png (Moodle settings)
|
||||
[18]: https://opensource.com/sites/default/files/uploads/moodle_name-site.png (Name Moodle site)
|
||||
[19]: https://opensource.com/sites/default/files/uploads/moodle_saved.png (Moodle changes saved)
|
||||
[20]: https://opensource.com/sites/default/files/uploads/moodle_addcategory.png (Add category option in Moodle)
|
||||
[21]: https://opensource.com/sites/default/files/uploads/moodle_addcourse.png (Add course option in Moodle)
|
||||
[22]: https://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol
|
||||
[23]: https://www.shibboleth.net/
|
||||
[24]: https://docs.moodle.org/39/en/Main_page
|
||||
[25]: https://docs.moodle.org/39/en/Pedagogy#How_Moodle_tries_to_support_a_Social_Constructionist_view
|
||||
[26]: https://opensource.com/article/20/9/teach-python-mu
|
||||
[27]: https://opensource.com/sites/default/files/uploads/moodle_choosecourse.png (Moodle course list)
|
||||
[28]: https://opensource.com/sites/default/files/uploads/moodle_addactivity_0.png (Add activity in Moodle)
|
||||
[29]: https://opensource.com/sites/default/files/uploads/moodle_activitiesmenu.png (Moodle activities menu)
|
||||
[30]: https://opensource.com/sites/default/files/uploads/moodle_activitieschecklist.png (Moodle activities checklist)
|
||||
[31]: https://moodle.org/plugins/mod_bigbluebuttonbn
|
||||
[32]: https://moodle.org/plugins/mod_jitsi
|
||||
[33]: https://moodle.org/plugins/plagiarism_unicheck
|
||||
[34]: https://moodle.org/plugins/local_obf
|
||||
[35]: https://learn.moodle.org/
|
||||
[36]: https://school.moodledemo.net/
|
||||
[37]: https://git.in.moodle.com/moodle/moodle
|
||||
[38]: https://git.in.moodle.com/moodle/moodle/-/blob/master/CONTRIBUTING.txt
|
||||
[39]: https://download.moodle.org/mobile/
|
||||
[40]: https://twitter.com/moodle
|
||||
[41]: https://www.facebook.com/moodle
|
||||
[42]: https://www.linkedin.com/company/moodle/
|
@ -0,0 +1,98 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (robsean)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-13184-1.html)
|
||||
[#]: subject: (Run your favorite Windows applications on Linux)
|
||||
[#]: via: (https://opensource.com/article/21/2/linux-wine)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
在 Linux 上运行你最喜欢的 Windows 应用程序
|
||||
======
|
||||
|
||||
> WINE 是一个开源项目,它可以协助很多 Windows 应用程序在 Linux 上运行,就好像它们是原生程序一样。
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202103/07/231159kwsn2snlilwbs9ns.jpg)
|
||||
|
||||
在 2021 年,有很多比以往更喜欢 Linux 的原因。在这系列中,我将分享使用 Linux 的 21 种原因。这里是如何使用 WINE 来实现从 Windows 到 Linux 的无缝切换。
|
||||
|
||||
你有只能在 Windows 上运行的应用程序吗?那一个应用程序阻碍你切换到 Linux 的唯一因素吗?如果是这样的话,你将会很高兴知道 WINE,这是一个开源项目,它几乎重新发明了关键的 Windows 库,使为 Windows 编译的应用程序可以在 Linux 上运行。
|
||||
|
||||
WINE 代表着“Wine Is Not an Emulator” ,它指的是驱动这项技术的代码。开源开发者从 1993 年就开始致力将应用程序的任何传入 Windows API 调用翻译为 [POSIX][2] 调用。
|
||||
|
||||
这是一个令人十分惊讶的编程壮举,尤其是考虑到这个项目是独立运行的,没有来自微软的帮助(至少可以这样说),但是也有局限性。一个应用程序偏离 Windows API 的 “内核” 越远,WINE 就越不能预期应用程序的请求。有一些供应商可以弥补这一点,尤其是 [Codeweavers][3] 和 [Valve Software][4]。在需要翻译应用程序的制作者和翻译的人们及公司之间没有协调配合,因此,比如说一个更新的软件作品和从 [WINE 总部][5] 获得完美适配状态之间可能会有一些时间上的滞后。
|
||||
|
||||
然而,如果你想在 Linux 上运行一个著名的 Windows 应用程序,WINE 可能已经为它准备好了可能性。
|
||||
|
||||
### 安装 WINE
|
||||
|
||||
你可以从你的 Linux 发行版的软件包存储库中安装 WINE 。在 Fedora、CentOS Stream 或 RHEL 系统上:
|
||||
|
||||
```
|
||||
$ sudo dnf install wine
|
||||
```
|
||||
|
||||
在 Debian、Linux Mint、Elementary 及相似的系统上:
|
||||
|
||||
```
|
||||
$ sudo apt install wine
|
||||
```
|
||||
|
||||
WINE 不是一个你自己启动的应用程序。当启动一个 Windows 应用程序时,它是一个被调用的后端。你与 WINE 的第一次交互很可能就发生在你启动一个 Windows 应用程序的安装程序时。
|
||||
|
||||
### 安装一个应用程序
|
||||
|
||||
[TinyCAD][6] 是一个极好的用于设计电路的开源应用程序,但是它仅在 Windows 上可用。虽然它是一个小型的应用程序,但是它确实包含一些 .NET 组件,因此应该能对 WINE 进行一些压力测试。
|
||||
|
||||
首先,下载 TinyCAD 的安装程序。Windows 安装程序通常都是这样,它是一个 `.exe` 文件。在下载后,双击文件来启动它。
|
||||
|
||||
![WINE TinyCAD 安装向导][7]
|
||||
|
||||
*TinyCAD 的 WINE 安装向导*
|
||||
|
||||
像你在 Windows 上一样逐步完成安装程序。通常最好接受默认选项,尤其是与 WINE 有关的地方。WINE 环境基本上是独立的,隐藏在你的硬盘驱动器上的一个 `drive_c` 目录中,作为 Windows 应用程序使用的一个文件系统的仿真根目录。
|
||||
|
||||
![WINE TinyCAD 安装和目标驱动器][8]
|
||||
|
||||
*WINE TinyCAD 目标驱动器*
|
||||
|
||||
安装完成后,应用程序通常会为你提供启动机会。如果你正准备测试一下它的话,启动应用程序。
|
||||
|
||||
### 启动 Windows 应用程序
|
||||
|
||||
除了在安装后的第一次启动外,在正常情况下,你启动一个 WINE 应用程序的方式与你启动一个本地 Linux 应用程序相同。不管你使用应用程序菜单、活动屏幕或者只是在运行器中输入应用程序的名称,在 WINE 中运行的桌面 Windows 应用程序都会被视为在 Linux 上的本地应用程序。
|
||||
|
||||
![TinyCAD 使用 WINE 运行][9]
|
||||
|
||||
*通过 WINE 的支持来运行 TinyCAD*
|
||||
|
||||
### 当 WINE 失败时
|
||||
|
||||
我在 WINE 中的大多数应用程序,包括 TinyCAD ,都能如期运行。不过,也会有例外。在这些情况下,你可以等几个月来查看 WINE 开发者 (或者,如果是一款游戏,就等候 Valve Software)是否进行追加修补,或者你可以联系一个像 Codeweavers 这样的供应商来查看他们是否出售对你所需要的应用程序的服务支持。
|
||||
|
||||
### WINE 是种欺骗,但它用于正道
|
||||
|
||||
一些 Linux 用户觉得:如果你使用 WINE 的话,你就是在“欺骗” Linux。它可能会让人有这种感觉,但是 WINE 是一个开源项目,它使用户能够切换到 Linux ,并且仍然能够运行工作或爱好所需的应用程序。如果 WINE 解决了你的问题,让你使用 Linux,那就使用它,并拥抱 Linux 的灵活性。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/2/linux-wine
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[robsean](https://github.com/robsean)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_screen_windows_files.png?itok=kLTeQUbY (Computer screen with files or windows open)
|
||||
[2]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains
|
||||
[3]: https://www.codeweavers.com/crossover
|
||||
[4]: https://github.com/ValveSoftware/Proton
|
||||
[5]: http://winehq.org
|
||||
[6]: https://sourceforge.net/projects/tinycad/
|
||||
[7]: https://opensource.com/sites/default/files/wine-tinycad-install.jpg
|
||||
[8]: https://opensource.com/sites/default/files/wine-tinycad-drive_0.jpg
|
||||
[9]: https://opensource.com/sites/default/files/wine-tinycad-running.jpg
|
@ -3,40 +3,38 @@
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-13186-1.html)
|
||||
|
||||
你需要尝试的 3 种 Linux 终端
|
||||
值得尝试的 3 个 Linux 终端
|
||||
======
|
||||
Linux 让你能够选择你喜欢的终端界面,而不是它强加的界面。
|
||||
![4 different color terminal windows with code][1]
|
||||
|
||||
> Linux 让你能够选择你喜欢的终端界面,而不是它强加的界面。
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202103/09/054053zum6n77cpnnug0x1.jpg)
|
||||
|
||||
在 2021 年,人们喜欢 Linux 的理由比以往任何时候都多。在这个系列中,我将分享 21 个使用 Linux 的不同理由。能够选择自己的终端是使用 Linux 的一个重要原因。
|
||||
|
||||
很多人认为一旦你用过一个终端界面,你就已经用过所有的终端了。但喜欢终端的用户都知道,它们之间有一些细微但重要的区别。本文将介绍我最喜欢的三种。
|
||||
|
||||
不过在深入研究它们之前,先要了解 shell 和终端之间的区别。终端(技术上说是_终端模拟器_,因为终端曾经是物理硬件设备)是一个在桌面上的窗口中运行的应用。shell 是在终端窗口中对你可见的引擎。流行的 shell 有 [Bash][2]、[tcsh][3] 和 [zsh][4],它们都在终端中运行。
|
||||
不过在深入研究它们之前,先要了解 shell 和<ruby>终端<rt>terminal</rt></ruby>之间的区别。终端(技术上说是<ruby>终端模拟器<rt>terminal emulator</rt></ruby>,因为终端曾经是物理硬件设备)是一个在桌面上的窗口中运行的应用。shell 是在终端窗口中对你可见的引擎。流行的 shell 有 [Bash][2]、[tcsh][3] 和 [zsh][4],它们都在终端中运行。
|
||||
|
||||
在现代 Linux 上几乎不用说,但本文中所有的终端都有标签界面。
|
||||
在现代 Linux 上几乎不用说,至少本文中所有的终端都有标签界面。
|
||||
|
||||
### Xfce 终端
|
||||
|
||||
![Xfce ][5]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][6])
|
||||
[轻量级 Xfce 桌面][7] 提供了一个轻量级的终端,很好地平衡了功能和简单性。它提供了对 shell 的访问(如预期的那样),并且它可以轻松访问几个重要的配置选项。你可以设置当你双击文本时哪些字符会断字、选择你的默认字符编码,并禁用终端窗口的 Alt 快捷方式,这样你最喜欢的 Bash 快捷方式就会传递到 shell。你还可以设置字体和新的颜色主题,或者从常用预设列表中加载颜色主题。它甚至在顶部有一个可选的工具栏,方便你访问你最喜欢的功能。
|
||||
|
||||
[轻量级 Xfce 桌面][7]提供了一个轻量级的终端,很好地平衡了功能和简单性。它提供了对 shell 的访问(如预期的那样),并且它可以轻松访问几个重要的配置选项。你可以设置当你双击文本时哪些字符会断字,选择你的默认字符编码,并禁用终端窗口的 Alt 快捷方式,这样你最喜欢的 Bash 快捷方式就会传递到 shell。你还可以设置字体和新的颜色主题,或者从常用预设列表中加载颜色主题。它甚至在顶部有一个可选的工具栏,方便你访问你最喜欢的功能。
|
||||
|
||||
对我来说,Xfce 的亮点功能是非常容易地为你打开的每一个标签页改变背景颜色。当在服务器上运行远程 shell 时,这是非常有价值的。它让我知道自己在哪个标签页中,从而避免了我犯愚蠢的错误。
|
||||
对我来说,Xfce 的亮点功能是可以非常容易地为你打开的每一个标签页改变背景颜色。当在服务器上运行远程 shell 时,这是非常有价值的。它让我知道自己在哪个标签页中,从而避免了我犯愚蠢的错误。
|
||||
|
||||
### rxvt-unicode
|
||||
|
||||
![rxvt][8]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][6])
|
||||
|
||||
[rxvt 终端][9]是我最喜欢的轻量级控制台。它有许多老式 [xterm][10] 终端仿真器的功能,但它的扩展性更强。它的配置是在 `~/.Xdefaults` 中定义的,所以没有偏好面板或设置菜单,但这使得它很容易管理和备份你的设置。使用一些 Perl 库,rxvt 有标签,并且通过 xrdb,它可以访问字体和任何你能想到的颜色主题。你可以设置像 `URxvt.urlLancher: firefox` 这样的属性来设置当你打开 URL 时启动的网页浏览器,改变滚动条的外观,修改键盘快捷键等等。
|
||||
[rxvt 终端][9] 是我最喜欢的轻量级控制台。它有许多老式 [xterm][10] 终端仿真器的功能,但它的扩展性更强。它的配置是在 `~/.Xdefaults` 中定义的,所以没有偏好面板或设置菜单,但这使得它很容易管理和备份你的设置。通过使用一些 Perl 库,rxvt 可以有标签,并且通过 xrdb,它可以访问字体和任何你能想到的颜色主题。你可以设置像 `URxvt.urlLancher: firefox` 这样的属性来设置当你打开 URL 时启动的网页浏览器,改变滚动条的外观,修改键盘快捷键等等。
|
||||
|
||||
最初的 rxvt 不支持 Unicode(因为当时 Unicode 还不存在),但 `rxvt-unicode`(有时也叫 `urxvt`)包提供了一个完全支持 Unicode 的补丁版本。
|
||||
|
||||
@ -46,9 +44,7 @@ Linux 让你能够选择你喜欢的终端界面,而不是它强加的界面
|
||||
|
||||
![Konsole][11]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][6])
|
||||
|
||||
Konsole,KDE Plasma 桌面的终端,是我转到 Linux 后使用的第一个终端,所以它是我对所有其他终端的标准。它确实设定了一个很高的标准。Konsole 有所有通常的不错的功能(还有些其他的),比如简单的颜色主题加上配置文件支持、字体选择、编码、可分离标签、可重命名标签等等。但这在现代桌面上是可以预期的(至少,如果你的桌面运行的是 Plasma 的话)。
|
||||
Konsole 是 KDE Plasma 桌面的终端,是我转到 Linux 后使用的第一个终端,所以它是我对所有其他终端的标准。它确实设定了一个很高的标准。Konsole 有所有通常的不错的功能(还有些其他的),比如简单的颜色主题加上配置文件支持、字体选择、编码、可分离标签、可重命名标签等等。但这在现代桌面上是可以预期的(至少,如果你的桌面运行的是 Plasma 的话)。
|
||||
|
||||
Konsole 比其他终端领先许多年(或者几个月)。它可以垂直或水平地分割窗口。你可以把输入复制到所有的标签页上(就像 [tmux][12] 一样)。你可以将其设置为监视自身是否静音或活动并配置通知。如果你在 Android 手机上使用 KDE Connect,这意味着当一个任务完成时,你可以在手机上收到通知。你可以将 Konsole 的输出保存到文本或 HTML 文件中,为打开的标签页添加书签,克隆标签页,调整搜索设置等等。
|
||||
|
||||
@ -65,7 +61,7 @@ via: https://opensource.com/article/21/2/linux-terminals
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][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/) 荣誉推出
|
||||
|
@ -3,16 +3,18 @@
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-13182-1.html)
|
||||
|
||||
如何在 Ubuntu Linux 上安装最新的 Erlang?
|
||||
如何在 Ubuntu Linux 上安装最新的 Erlang
|
||||
======
|
||||
|
||||
[Erlang][1] 是一种用于构建大规模可扩展实时系统的函数式编程语言。Erlang 最初是由[爱立信][2]创建的专有软件,后来被开源。
|
||||
![](https://img.linux.net.cn/data/attachment/album/202103/07/001753blfwcg2gc2c2lcgl.jpg)
|
||||
|
||||
Erlang 在 [Ubuntu 的 Universe 仓库][3]中可用。启用该仓库后,你可以使用下面的命令轻松安装它:
|
||||
[Erlang][1] 是一种用于构建大规模可扩展实时系统的函数式编程语言。Erlang 最初是由 [爱立信][2] 创建的专有软件,后来被开源。
|
||||
|
||||
Erlang 在 [Ubuntu 的 Universe 仓库][3] 中可用。启用该仓库后,你可以使用下面的命令轻松安装它:
|
||||
|
||||
```
|
||||
sudo apt install erlang
|
||||
@ -20,36 +22,35 @@ sudo apt install erlang
|
||||
|
||||
![][4]
|
||||
|
||||
但是,_**Ubuntu 仓库提供的 Erlang 版本可能不是最新的**_。
|
||||
但是,*Ubuntu 仓库提供的 Erlang 版本可能不是最新的*。
|
||||
|
||||
|
||||
如果你想要 _**Ubuntu 上最新的 Erlang 版本**_,你可以添加 [Erlang Solutions 提供的][5]仓库。它们为各种 Linux 发行版、Windows 和 macOS 提供了预编译的二进制文件。
|
||||
如果你想要 Ubuntu 上最新的 Erlang 版本,你可以添加 [Erlang Solutions 提供的][5]仓库。它们为各种 Linux 发行版、Windows 和 macOS 提供了预编译的二进制文件。
|
||||
|
||||
如果你之前安装了一个名为 `erlang` 的包,那么它将会被升级到由添加的仓库提供的较新版本。
|
||||
|
||||
### 在 Ubuntu 上安装最新版本的 Erlang
|
||||
|
||||
你需要[在 Linux 终端下载密钥文件][6]。你可以使用 wget 工具,所以请确保你已经安装了它:
|
||||
你需要[在 Linux 终端下载密钥文件][6]。你可以使用 `wget` 工具,所以请确保你已经安装了它:
|
||||
|
||||
```
|
||||
sudo apt install wget
|
||||
```
|
||||
|
||||
接下来,使用 wget 下载 Erlang Solution 仓库的 GPG 密钥,并将其添加到你的 apt 打包系统中。添加了密钥后,你的系统就会信任来自该仓库的包。
|
||||
接下来,使用 `wget` 下载 Erlang Solution 仓库的 GPG 密钥,并将其添加到你的 apt 打包系统中。添加了密钥后,你的系统就会信任来自该仓库的包。
|
||||
|
||||
```
|
||||
wget -O- https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc | sudo apt-key add -
|
||||
```
|
||||
|
||||
现在,你应该在你的 APT sources.list.d 目录下为 Erlang 添加一个文件,这个文件将包含有关仓库的信息,APT 包管理器将使用它来获取包和未来的更新。
|
||||
现在,你应该在你的 APT `sources.list.d` 目录下为 Erlang 添加一个文件,这个文件将包含有关仓库的信息,APT 包管理器将使用它来获取包和未来的更新。
|
||||
|
||||
**对于 Ubuntu 20.04(和Ubuntu 20.10)**,使用以下命令:
|
||||
对于 Ubuntu 20.04(和 Ubuntu 20.10),使用以下命令:
|
||||
|
||||
```
|
||||
echo "deb https://packages.erlang-solutions.com/ubuntu focal contrib" | sudo tee /etc/apt/sources.list.d/erlang-solution.list
|
||||
```
|
||||
|
||||
我知道上面的命令提到了 focal(适用于 Ubuntu 20.04),但它也适用于 Ubuntu 20.10 groovy。
|
||||
我知道上面的命令提到了 Ubuntu 20.04 focal,但它也适用于 Ubuntu 20.10 groovy。
|
||||
|
||||
对于 **Ubuntu 18.04**,使用以下命令:
|
||||
|
||||
@ -73,7 +74,7 @@ sudo apt install erlang
|
||||
|
||||
![][7]
|
||||
|
||||
要退出 Erlang shell,使用 Ctrl+g,然后输入 q,由于我从来没有用过 Erlang,所以我只好尝试了一些按键,然后发现做法。
|
||||
要退出 Erlang shell,使用 `Ctrl+g`,然后输入 `q`,由于我从来没有用过 Erlang,所以我只好尝试了一些按键,然后发现了操作方法。
|
||||
|
||||
#### 删除 erlang
|
||||
|
||||
@ -104,7 +105,7 @@ via: https://itsfoss.com/install-erlang-ubuntu/
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][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/) 荣誉推出
|
||||
|
@ -4,12 +4,14 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-13189-1.html)
|
||||
|
||||
SysMonTask:一个类似于 Windows 任务管理器的 Linux 系统监控器
|
||||
======
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202103/09/232304ljsr5jfgluffn4a4.jpg)
|
||||
|
||||
得益于桌面环境,几乎所有的 [Linux 发行版都带有任务管理器应用程序][1]。除此之外,还有 [一些其他的 Linux 的系统监控应用程序][2],它们具有更多的功能。
|
||||
|
||||
但最近我遇到了一个为 Linux 创建的任务管理器,它看起来像……嗯……Windows 的任务管理器。
|
@ -3,20 +3,20 @@
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-13187-1.html)
|
||||
|
||||
Guake 终端:一个为专业用户定制的 Linux 终端(灵感来自于一个 FPS 游戏)
|
||||
Guake 终端:一个灵感来自于 FPS 游戏的 Linux 终端
|
||||
======
|
||||
|
||||
_**简介:使用 Guake 终端这个可自定义且强大的适合各种用户的工具快速访问你的终端**_
|
||||
> 使用 Guake 终端这个可自定义且强大的适合各种用户的工具快速访问你的终端。
|
||||
|
||||
### Guake 终端:GNOME 桌面中自上而下终端
|
||||
|
||||
![][1]
|
||||
![](https://img.linux.net.cn/data/attachment/album/202103/09/062119ba36tottztz4torn.jpg)
|
||||
|
||||
[Guake][2] 是一款为 GNOME 桌面量身定做的终端模拟器,采用自上而下的设计。
|
||||
[Guake][2] 是一款为 GNOME 桌面量身定做的终端模拟器,采用下拉式设计。
|
||||
|
||||
它最初的灵感来自于一款 FPS 游戏([Quake][3])中的终端。尽管它最初是作为一个快速和易于使用的终端而设计的,但它的功能远不止于此。
|
||||
|
||||
@ -26,15 +26,15 @@ Guake 终端提供了大量的功能,以及可定制的选项。在这里,
|
||||
|
||||
![][4]
|
||||
|
||||
* 键盘快捷键(**F12**)以覆盖方式在任何地方启动终端
|
||||
* 按下键盘快捷键(`F12`)以覆盖方式在任何地方启动终端
|
||||
* Guake 终端在后台运行,以便持久访问
|
||||
* 能够横向和纵向分割标签页
|
||||
* 从可用选项中更改默认的 shell(如果有的话)
|
||||
* 重新对齐选项
|
||||
* 从可用的 shell 中(如果有的话)更改默认的 shell
|
||||
* 重新对齐
|
||||
* 从多种调色板中选择改变终端的外观
|
||||
* 能够使用 GUI 选项将终端内容保存到文件中
|
||||
* 需要时切换全屏选项
|
||||
* 你可以轻松地保存标签或在需要时打开新的标签
|
||||
* 能够使用 GUI 方式将终端内容保存到文件中
|
||||
* 需要时切换全屏
|
||||
* 你可以轻松地保存标签,或在需要时打开新的标签
|
||||
* 恢复标签的能力
|
||||
* 可选择配置和学习新的键盘快捷键,以快速访问终端和执行任务
|
||||
* 改变特定选项卡的颜色
|
||||
@ -43,10 +43,9 @@ Guake 终端提供了大量的功能,以及可定制的选项。在这里,
|
||||
* 能够在启动或显示 Guake 终端时添加自己的命令或脚本。
|
||||
* 支持多显示器
|
||||
|
||||
|
||||
![][5]
|
||||
|
||||
只是为了乐趣,你可以做很多事情。 但是,我也相信,高级用户可以利用这些功能使他们的终端体验更轻松,更高效。
|
||||
只是出于乐趣,你可以做很多事情。但是,我也相信,高级用户可以利用这些功能使他们的终端体验更轻松,更高效。
|
||||
|
||||
就我用它来测试一些东西和写这篇文章的时候,说实话,我觉得我是在召唤终端。所以,我绝对觉得它很酷!
|
||||
|
||||
@ -54,7 +53,7 @@ Guake 终端提供了大量的功能,以及可定制的选项。在这里,
|
||||
|
||||
![][6]
|
||||
|
||||
**在 Ubuntu、Fedora 和 Arch 的默认仓库中都有 Guake 终端。**
|
||||
在 Ubuntu、Fedora 和 Arch 的默认仓库中都有 Guake 终端。
|
||||
|
||||
你可以按照它的官方说明来了解你可以使用的命令,如果你使用的是基于 Ubuntu 的发行版,只需输入:
|
||||
|
||||
@ -72,7 +71,7 @@ sudo apt install guake
|
||||
|
||||
无论是哪种情况,你也可以使用 [Pypi][8] 或者参考[官方文档][9]或从 [GitHub 页面][10]获取源码。
|
||||
|
||||
[Guake Terminal][10]
|
||||
- [Guake Terminal][10]
|
||||
|
||||
你觉得 Guake 终端怎么样?你认为它是一个有用的终端仿真器吗?你知道有什么类似的软件吗?
|
||||
|
||||
@ -85,7 +84,7 @@ via: https://itsfoss.com/guake-terminal/
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][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/) 荣誉推出
|
||||
|
138
sources/talk/20210308 How the ARPANET Protocols Worked.md
Normal file
138
sources/talk/20210308 How the ARPANET Protocols Worked.md
Normal file
@ -0,0 +1,138 @@
|
||||
[#]: subject: (How the ARPANET Protocols Worked)
|
||||
[#]: via: (https://twobithistory.org/2021/03/08/arpanet-protocols.html)
|
||||
[#]: author: (Two-Bit History https://twobithistory.org)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
How the ARPANET Protocols Worked
|
||||
======
|
||||
|
||||
The ARPANET changed computing forever by proving that computers of wildly different manufacture could be connected using standardized protocols. In my [post on the historical significance of the ARPANET][1], I mentioned a few of those protocols, but didn’t describe them in any detail. So I wanted to take a closer look at them. I also wanted to see how much of the design of those early protocols survives in the protocols we use today.
|
||||
|
||||
The ARPANET protocols were, like our modern internet protocols, organized into layers.[1][2] The protocols in the higher layers ran on top of the protocols in the lower layers. Today the TCP/IP suite has five layers (the Physical, Link, Network, Transport, and Application layers), but the ARPANET had only three layers—or possibly four, depending on how you count them.
|
||||
|
||||
I’m going to explain how each of these layers worked, but first an aside about who built what in the ARPANET, which you need to know to understand why the layers were divided up as they were.
|
||||
|
||||
### Some Quick Historical Context
|
||||
|
||||
The ARPANET was funded by the US federal government, specifically the Advanced Research Projects Agency within the Department of Defense (hence the name “ARPANET”). The US government did not directly build the network; instead, it contracted the work out to a Boston-based consulting firm called Bolt, Beranek, and Newman, more commonly known as BBN.
|
||||
|
||||
BBN, in turn, handled many of the responsibilities for implementing the network but not all of them. What BBN did was design and maintain a machine known as the Interface Message Processor, or IMP. The IMP was a customized Honeywell minicomputer, one of which was delivered to each site across the country that was to be connected to the ARPANET. The IMP served as a gateway to the ARPANET for up to four hosts at each host site. It was basically a router. BBN controlled the software running on the IMPs that forwarded packets from IMP to IMP, but the firm had no direct control over the machines that would connect to the IMPs and become the actual hosts on the ARPANET.
|
||||
|
||||
The host machines were controlled by the computer scientists that were the end users of the network. These computer scientists, at host sites across the country, were responsible for writing the software that would allow the hosts to talk to each other. The IMPs gave hosts the ability to send messages to each other, but that was not much use unless the hosts agreed on a format to use for the messages. To solve that problem, a motley crew consisting in large part of graduate students from the various host sites formed themselves into the Network Working Group, which sought to specify protocols for the host computers to use.
|
||||
|
||||
So if you imagine a single successful network interaction over the ARPANET, (sending an email, say), some bits of engineering that made the interaction successful were the responsibility of one set of people (BBN), while other bits of engineering were the responsibility of another set of people (the Network Working Group and the engineers at each host site). That organizational and logistical happenstance probably played a big role in motivating the layered approach used for protocols on the ARPANET, which in turn influenced the layered approach used for TCP/IP.
|
||||
|
||||
### Okay, Back to the Protocols
|
||||
|
||||
![ARPANET Network Stack][3] _The ARPANET protocol hierarchy._
|
||||
|
||||
The protocol layers were organized into a hierarchy. At the very bottom was “level 0.”[2][4] This is the layer that in some sense doesn’t count, because on the ARPANET this layer was controlled entirely by BBN, so there was no need for a standard protocol. Level 0 governed how data passed between the IMPs. Inside of BBN, there were rules governing how IMPs did this; outside of BBN, the IMP sub-network was a black box that just passed on any data that you gave it. So level 0 was a layer without a real protocol, in the sense of a publicly known and agreed-upon set of rules, and its existence could be ignored by software running on the ARPANET hosts. Loosely speaking, it handled everything that falls under the Physical, Link, and Internet layers of the TCP/IP suite today, and even quite a lot of the Transport layer, which is something I’ll come back to at the end of this post.
|
||||
|
||||
The “level 1” layer established the interface between the ARPANET hosts and the IMPs they were connected to. It was an API, if you like, for the black box level 0 that BBN had built. It was also referred to at the time as the IMP-Host Protocol. This protocol had to be written and published because, when the ARPANET was first being set up, each host site had to write its own software to interface with the IMP. They wouldn’t have known how to do that unless BBN gave them some guidance.
|
||||
|
||||
The IMP-Host Protocol was specified by BBN in a lengthy document called [BBN Report 1822][5]. The document was revised many times as the ARPANET evolved; what I’m going to describe here is roughly the way the IMP-Host protocol worked as it was initially designed. According to BBN’s rules, hosts could pass _messages_ to their IMPs no longer than 8095 bits, and each message had a _leader_ that included the destination host number and something called a _link number_.[3][6] The IMP would examine the designation host number and then dutifully forward the message into the network. When messages were received from a remote host, the receiving IMP would replace the destination host number with the source host number before passing it on to the local host. Messages were not actually what passed between the IMPs themselves—the IMPs broke the messages down into smaller _packets_ for transfer over the network—but that detail was hidden from the hosts.
|
||||
|
||||
![1969 Host-IMP Leader][7] _The Host-IMP message leader format, as of 1969. Diagram from [BBN Report 1763][8]._
|
||||
|
||||
The link number, which could be any number from 0 to 255, served two purposes. It was used by higher level protocols to establish more than one channel of communication between any two hosts on the network, since it was conceivable that there might be more than one local user talking to the same destination host at any given time. (In other words, the link numbers allowed communication to be multiplexed between hosts.) But it was also used at the level 1 layer to control the amount of traffic that could be sent between hosts, which was necessary to prevent faster computers from overwhelming slower ones. As initially designed, the IMP-Host Protocol limited each host to sending just one message at a time over each link. Once a given host had sent a message along a link to a remote host, it would have to wait to receive a special kind of message called an RFNM (Request for Next Message) from the remote IMP before sending the next message along the same link. Later revisions to this system, made to improve performance, allowed a host to have up to eight messages in transit to another host at a given time.[4][9]
|
||||
|
||||
The “level 2” layer is where things really start to get interesting, because it was this layer and the one above it that BBN and the Department of Defense left entirely to the academics and the Network Working Group to invent for themselves. The level 2 layer comprised the Host-Host Protocol, which was first sketched in RFC 9 and first officially specified by RFC 54. A more readable explanation of the Host-Host Protocol is given in the [ARPANET Protocol Handbook][10].
|
||||
|
||||
The Host-Host Protocol governed how hosts created and managed _connections_ with each other. A connection was a one-way data pipeline between a _write socket_ on one host and a _read socket_ on another host. The “socket” concept was introduced on top of the limited level-1 link facility (remember that the link number can only be one of 256 values) to give programs a way of addressing a particular process running on a remote host. Read sockets were even-numbered while write sockets were odd-numbered; whether a socket was a read socket or a write socket was referred to as the socket’s gender. There were no “port numbers” like in TCP. Connections could be opened, manipulated, and closed by specially formatted Host-Host control messages sent between hosts using link 0, which was reserved for that purpose. Once control messages were exchanged over link 0 to establish a connection, further data messages could then be sent using another link number picked by the receiver.
|
||||
|
||||
Host-Host control messages were identified by a three-letter mnemonic. A connection was established when two hosts exchanged a STR (sender-to-receiver) message and a matching RTS (receiver-to-sender) message—these control messages were both known as Request for Connection messages. Connections could be closed by the CLS (close) control message. There were further control messages that changed the rate at which data messages were sent from sender to receiver, which were needed to ensure again that faster hosts did not overwhelm slower hosts. The flow control already provided by the level 1 protocol was apparently not sufficient at level 2; I suspect this was because receiving an RFNM from a remote IMP was only a guarantee that the remote IMP had passed the message on to the destination host, not that the host had fully processed the message. There was also an INR (interrupt-by-receiver) control message and an INS (interrupt-by-sender) control message that were primarily for use by higher-level protocols.
|
||||
|
||||
The higher-level protocols all lived in “level 3”, which was the Application layer of the ARPANET. The Telnet protocol, which provided a virtual teletype connection to another host, was perhaps the most important of these protocols, but there were many others in this level too, such as FTP for transferring files and various experiments with protocols for sending email.
|
||||
|
||||
One protocol in this level was not like the others: the Initial Connection Protocol (ICP). ICP was considered to be a level-3 protocol, but really it was a kind of level-2.5 protocol, since other level-3 protocols depended on it. ICP was needed because the connections provided by the Host-Host Protocol at level 2 were only one-way, but most applications required a two-way (i.e. full-duplex) connection to do anything interesting. ICP specified a two-step process whereby a client running on one host could connect to a long-running server process on another host. The first step involved establishing a one-way connection from the server to the client using the server process’ well-known socket number. The server would then send a new socket number to the client over the established connection. At that point, the existing connection would be discarded and two new connections would be opened, a read connection based on the transmitted socket number and a write connection based on the transmitted socket number plus one. This little dance was a necessary prelude to most things—it was the first step in establishing a Telnet connection, for example.
|
||||
|
||||
That finishes our ascent of the ARPANET protocol hierarchy. You may have been expecting me to mention a “Network Control Protocol” at some point. Before I sat down to do research for this post and my last one, I definitely thought that the ARPANET ran on a protocol called NCP. The acronym is occasionally used to refer to the ARPANET protocols as a whole, which might be why I had that idea. [RFC 801][11], for example, talks about transitioning the ARPANET from “NCP” to “TCP” in a way that makes it sound like NCP is an ARPANET protocol equivalent to TCP. But there has never been a “Network Control Protocol” for the ARPANET (even if [Encyclopedia Britannica thinks so][12]), and I suspect people have mistakenly unpacked “NCP” as “Network Control Protocol” when really it stands for “Network Control Program.” The Network Control Program was the kernel-level program running in each host responsible for handling network communication, equivalent to the TCP/IP stack in an operating system today. “NCP”, as it’s used in RFC 801, is a metonym, not a protocol.
|
||||
|
||||
### A Comparison with TCP/IP
|
||||
|
||||
The ARPANET protocols were all later supplanted by the TCP/IP protocols (with the exception of Telnet and FTP, which were easily adapted to run on top of TCP). Whereas the ARPANET protocols were all based on the assumption that the network was built and administered by a single entity (BBN), the TCP/IP protocol suite was designed for an _inter_-net, a network of networks where everything would be more fluid and unreliable. That led to some of the more immediately obvious differences between our modern protocol suite and the ARPANET protocols, such as how we now distinguish between a Network layer and a Transport layer. The Transport layer-like functionality that in the ARPANET was partly implemented by the IMPs is now the sole responsibility of the hosts at the network edge.
|
||||
|
||||
What I find most interesting about the ARPANET protocols though is how so much of the transport-layer functionality now in TCP went through a janky adolescence on the ARPANET. I’m not a networking expert, so I pulled out my college networks textbook (Kurose and Ross, let’s go), and they give a pretty great outline of what a transport layer is responsible for in general. To summarize their explanation, a transport layer protocol must minimally do the following things. Here _segment_ is basically equivalent to _message_ as the term was used on the ARPANET:
|
||||
|
||||
* Provide a delivery service between _processes_ and not just host machines (transport layer multiplexing and demultiplexing)
|
||||
* Provide integrity checking on a per-segment basis (i.e. make sure there is no data corruption in transit)
|
||||
|
||||
|
||||
|
||||
A transport layer could also, like TCP does, provide _reliable data transfer_, which means:
|
||||
|
||||
* Segments are delivered in order
|
||||
* No segments go missing
|
||||
* Segments aren’t delivered so fast that they get dropped by the receiver (flow control)
|
||||
|
||||
|
||||
|
||||
It seems like there was some confusion on the ARPANET about how to do multiplexing and demultiplexing so that processes could communicate—BBN introduced the link number to do that at the IMP-Host level, but it turned out that socket numbers were necessary at the Host-Host level on top of that anyway. Then the link number was just used for flow control at the IMP-Host level, but BBN seems to have later abandoned that in favor of doing flow control between unique pairs of hosts, meaning that the link number started out as this overloaded thing only to basically became vestigial. TCP now uses port numbers instead, doing flow control over each TCP connection separately. The process-process multiplexing and demultiplexing lives entirely inside TCP and does not leak into a lower layer like on the ARPANET.
|
||||
|
||||
It’s also interesting to see, in light of how Kurose and Ross develop the ideas behind TCP, that the ARPANET started out with what Kurose and Ross would call a strict “stop-and-wait” approach to reliable data transfer at the IMP-Host level. The “stop-and-wait” approach is to transmit a segment and then refuse to transmit any more segments until an acknowledgment for the most recently transmitted segment has been received. It’s a simple approach, but it means that only one segment is ever in flight across the network, making for a very slow protocol—which is why Kurose and Ross present “stop-and-wait” as merely a stepping stone on the way to a fully featured transport layer protocol. On the ARPANET, “stop-and-wait” was how things worked for a while, since, at the IMP-Host level, a Request for Next Message had to be received in response to every outgoing message before any further messages could be sent. To be fair to BBN, they at first thought this would be necessary to provide flow control between hosts, so the slowdown was intentional. As I’ve already mentioned, the RFNM requirement was later relaxed for the sake of better performance, and the IMPs started attaching sequence numbers to messages and keeping track of a “window” of messages in flight in the more or less the same way that TCP implementations do today.[5][13]
|
||||
|
||||
So the ARPANET showed that communication between heterogeneous computing systems is possible if you get everyone to agree on some baseline rules. That is, as I’ve previously argued, the ARPANET’s most important legacy. But what I hope this closer look at those baseline rules has revealed is just how much the ARPANET protocols also influenced the protocols we use today. There was certainly a lot of awkwardness in the way that transport-layer responsibilities were shared between the hosts and the IMPs, sometimes redundantly. And it’s really almost funny in retrospect that hosts could at first only send each other a single message at a time over any given link. But the ARPANET experiment was a unique opportunity to learn those lessons by actually building and operating a network, and it seems those lessons were put to good use when it came time to upgrade to the internet as we know it today.
|
||||
|
||||
_If you enjoyed this post, more like it come out every four weeks! Follow [@TwoBitHistory][14] on Twitter or subscribe to the [RSS feed][15] to make sure you know when a new post is out._
|
||||
|
||||
_Previously on TwoBitHistory…_
|
||||
|
||||
> Trying to get back on this horse!
|
||||
>
|
||||
> My latest post is my take (surprising and clever, of course) on why the ARPANET was such an important breakthrough, with a fun focus on the conference where the ARPANET was shown off for the first time:<https://t.co/8SRY39c3St>
|
||||
>
|
||||
> — TwoBitHistory (@TwoBitHistory) [February 7, 2021][16]
|
||||
|
||||
1. The protocol layering thing was invented by the Network Working Group. This argument is made in [RFC 871][17]. The layering thing was also a natural extension of how BBN divided responsibilities between hosts and IMPs, so BBN deserves some credit too. [↩︎][18]
|
||||
|
||||
2. The “level” terminology was used by the Network Working Group. See e.g. [RFC 100][19]. [↩︎][20]
|
||||
|
||||
3. In later revisions of the IMP-Host protocol, the leader was expanded and the link number was upgraded to a _message ID_. But the Host-Host protocol continued to make use of only the high-order eight bits of the message ID field, treating it as a link number. See the “Host-to-Host” protocol section of the [ARPANET Protocol Handbook][10]. [↩︎][21]
|
||||
|
||||
4. John M. McQuillan and David C. Walden. “The ARPA Network Design Decisions,” p. 284, <https://www.walden-family.com/public/whole-paper.pdf>. Accessed 8 March 2021. [↩︎][22]
|
||||
|
||||
5. Ibid. [↩︎][23]
|
||||
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://twobithistory.org/2021/03/08/arpanet-protocols.html
|
||||
|
||||
作者:[Two-Bit History][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://twobithistory.org
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://twobithistory.org/2021/02/07/arpanet.html
|
||||
[2]: tmp.szauPoOKtk#fn:1
|
||||
[3]: https://twobithistory.org/images/arpanet-stack.png
|
||||
[4]: tmp.szauPoOKtk#fn:2
|
||||
[5]: https://walden-family.com/impcode/BBN1822_Jan1976.pdf
|
||||
[6]: tmp.szauPoOKtk#fn:3
|
||||
[7]: https://twobithistory.org/images/host-imp-1969.png
|
||||
[8]: https://walden-family.com/impcode/1969-initial-IMP-design.pdf
|
||||
[9]: tmp.szauPoOKtk#fn:4
|
||||
[10]: http://mercury.lcs.mit.edu/~jnc/tech/arpaprot.html
|
||||
[11]: https://tools.ietf.org/html/rfc801
|
||||
[12]: https://www.britannica.com/topic/ARPANET
|
||||
[13]: tmp.szauPoOKtk#fn:5
|
||||
[14]: https://twitter.com/TwoBitHistory
|
||||
[15]: https://twobithistory.org/feed.xml
|
||||
[16]: https://twitter.com/TwoBitHistory/status/1358487195905064960?ref_src=twsrc%5Etfw
|
||||
[17]: https://tools.ietf.org/html/rfc871
|
||||
[18]: tmp.szauPoOKtk#fnref:1
|
||||
[19]: https://www.rfc-editor.org/info/rfc100
|
||||
[20]: tmp.szauPoOKtk#fnref:2
|
||||
[21]: tmp.szauPoOKtk#fnref:3
|
||||
[22]: tmp.szauPoOKtk#fnref:4
|
||||
[23]: tmp.szauPoOKtk#fnref:5
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (stevenzdg988)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
@ -144,7 +144,7 @@ via: https://opensource.com/article/20/4/bash-programming-guide
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
译者:[stevenzdg988](https://github.com/stevenzdg988)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -1,104 +0,0 @@
|
||||
[#]: subject: (4 open source tools for running a Linux server)
|
||||
[#]: via: (https://opensource.com/article/21/3/linux-server)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
4 open source tools for running a Linux server
|
||||
======
|
||||
With Linux, you can turn any device into a server to share data, media
|
||||
files, and other resources.
|
||||
![A rack of servers, blue background][1]
|
||||
|
||||
In 2021, there are more reasons why people love Linux than ever before. In this series, I'll share 21 different reasons to use Linux. Here are four open source tools for turning any device into a Linux server.
|
||||
|
||||
Sometimes I detect a certain mystique around the idea of a server. Many people, should they have an image in their mind at all, think servers must be big, heavy, rack-mounted machines, carefully maintained by an overly deliberate sysadmin and a group of magical tinker gnomes. Other people envision servers as vaporous clouds that somehow power the internet.
|
||||
|
||||
While this reverence is good for IT job security, the reality is that nobody in open source computing believes that servers are or should be the exclusive domain of specialists. File and resource sharing are integral to open source, and open source makes it easier than ever, as these four open source server projects show.
|
||||
|
||||
### Samba
|
||||
|
||||
The [Samba project][2] is a Windows interoperability suite of programs for Linux and Unix. Although it's mostly low-level code that many users never knowingly interact with, its importance can't be understated. Historically, it was the biggest and most important target back when Microsoft was fighting to eliminate Linux and open source. Times have changed, and Microsoft has met with the Samba team to offer support (for now, at least), and through it all, the project has continued to ensure that Linux and Windows computers can easily co-exist on the same network. In other words, Samba makes it easy to share files over your local network, regardless of what platforms are used.
|
||||
|
||||
In the [KDE Plasma][3] desktop, you can right-click on any directory you own and select **Properties**. In the **Properties** dialogue box, click the **Share** tab, and enable **Share with Samba (Microsoft Windows)**.
|
||||
|
||||
![Samba][4]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][5])
|
||||
|
||||
Just like that, you've opened a directory for read-only access for users on your local network. That means that when you're home, anyone in your house on the same WiFi network can access that folder, or if you're at work, anyone on your workplace network can access that folder. Of course, to access it, other users need to know where to find it. The path to a computer can be expressed as either an [IP address][6] or, depending on your network configuration, a hostname.
|
||||
|
||||
### Snapdrop
|
||||
|
||||
If navigating a network through IP addresses and hostnames is confusing, or if you don't like the idea of opening a folder for sharing and forgetting that it's open for perusal, then you might prefer [Snapdrop][7]. This is an open source project that you can run yourself or use the demonstration instance on the internet to connect computers through WebRTC. WebRTC enables peer-to-peer connections through a web browser, meaning that two users on the same network can find each other by navigating to Snapdrop and then communicate with each other directly, without going through an external server.
|
||||
|
||||
![Snapdrop][8]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][5])
|
||||
|
||||
Once two or more clients have contacted a Snapdrop service, users can trade files and chat messages back and forth, right over the local network. The transfer is fast, and your data stays local.
|
||||
|
||||
### VLC
|
||||
|
||||
Streaming services are more common than ever, but I have unconventional tastes in music and movies, so the typical services rarely seem to have what I'm looking for. Fortunately, it's easy to beam my own content around my house from my computer with my big media drive connected to it. For instance, when I want to watch a movie on a screen other than my computer monitor, I can stream the movie file on my network and play it through any app that can receive HTTP, whether that app is on my TV, game console, or mobile.
|
||||
|
||||
[VLC][9] makes it easy to set up a stream. In fact, it's an option in the **Media** menu, or you can press **Ctrl**+**S** on your keyboard. Add a file or group of files to your streaming queue, and then click the **Stream** button.
|
||||
|
||||
![VLC][10]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][5])
|
||||
|
||||
VLC steps you through a configuration wizard to help you decide what protocol to use when streaming your data. I tend to use HTTP because it's generally available on any device. Once VLC starts playing the file, navigate to the IP address or hostname of the computer playing the file at the port you assigned to the stream (it's 8080 by default when using HTTP), then sit back and enjoy.
|
||||
|
||||
### PulseAudio
|
||||
|
||||
One of my favorite modern Linux features is [PulseAudio][11]. Pulse has enabled staggering flexibility for audio on Linux, including auto-discoverable local network streaming. The advantage of this feature for me is that I can play podcasts and tech conference videos on my workstation in my office and take that audio with me by streaming it over my mobile. I have perfect audio whether I wander into the kitchen, the lounge, or to the farthest border of my backyard. This ability existed long before PulseAudio, but Pulse makes it as easy as a button click.
|
||||
|
||||
Some setup is required. First, you must ensure that the PulseAudio preferences (**paprefs**) package is installed so that you can enable network audio in your PulseAudio configuration.
|
||||
|
||||
![PulseAudio][12]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][5])
|
||||
|
||||
In **paprefs**, enable network access to your local sound device, probably without authentication (assuming you trust the other people on your local network), and enable your computer as a **Multicast/RTP sender**. I usually just choose to stream any audio playing through my speakers, but you can create a separate audio device in your Pulse output tab so that you can choose exactly what gets streamed. You have three options here:
|
||||
|
||||
* Stream whatever is playing on your speakers
|
||||
* Stream all sound on all outputs
|
||||
* Stream only audio you direct to the multicast device (on demand)
|
||||
|
||||
|
||||
|
||||
Once enabled, your sound streams on your network and can be received by other local Linux devices. It's easy and dynamic audio sharing.
|
||||
|
||||
### Sharing more than just code
|
||||
|
||||
Linux is about sharing. It's famous on servers because it's great at _serving_. Whether it's serving audio streams, video streams, files, or a great user experience, every Linux computer is a great Linux server.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/3/linux-server
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rack_server_sysadmin_cloud_520.png?itok=fGmwhf8I (A rack of servers, blue background)
|
||||
[2]: http://samba.org
|
||||
[3]: https://opensource.com/article/19/12/linux-kde-plasma
|
||||
[4]: https://opensource.com/sites/default/files/uploads/samba_0.jpg (Samba)
|
||||
[5]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[6]: https://opensource.com/article/18/5/how-find-ip-address-linux
|
||||
[7]: https://github.com/RobinLinus/snapdrop
|
||||
[8]: https://opensource.com/sites/default/files/uploads/snapdrop.jpg (Snapdrop)
|
||||
[9]: https://www.videolan.org/index.html
|
||||
[10]: https://opensource.com/sites/default/files/uploads/vlc-stream.jpg (VLC)
|
||||
[11]: https://www.freedesktop.org/wiki/Software/PulseAudio/
|
||||
[12]: https://opensource.com/sites/default/files/uploads/pulse.jpg (PulseAudio)
|
@ -1,86 +0,0 @@
|
||||
[#]: subject: (An Introduction to WebAssembly)
|
||||
[#]: via: (https://www.linux.com/news/an-introduction-to-webassembly/)
|
||||
[#]: author: (Dan Brown https://training.linuxfoundation.org/announcements/an-introduction-to-webassembly/)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
An Introduction to WebAssembly
|
||||
======
|
||||
|
||||
_By Marco Fioretti_
|
||||
|
||||
## **What on Earth is WebAssembly?**
|
||||
|
||||
[WebAssembly, also called Wasm][1], is a Web-optimized code format and API (Application Programming Interface) that can greatly improve the performances and capabilities of websites. Version 1.0 of WebAssembly, was released in 2017, and became an official W3C standard in 2019.
|
||||
|
||||
The standard is actively supported by all major browser suppliers, for obvious reasons: the official list of [“inside the browser” use cases][2] mentions, among other things, video editing, 3D games, virtual and augmented reality, p2p services, and scientific simulations. Besides making browsers much more powerful than JavaScript could, this standard may even extend the lifespan of websites: for example, it is WebAssembly that powers the continued support of [Flash animations and games at the Internet Archive][3].
|
||||
|
||||
WebAssembly isn’t just for browsers though; it is currently being used in mobile and edge based environments with such products as Cloudflare Workers.
|
||||
|
||||
## **How WebAssembly works**
|
||||
|
||||
Files in .wasm format contain low level binary instructions (bytecode), executable at “near CPU-native speed” by a virtual machine that uses a common stack. The code is packaged in modules – that is objects that are directly executable by a browser – and each module can be instantiated multiple times by a web page. The functions defined inside modules are listed in one dedicated array, or Table, and the corresponding data are contained in another structure, called arraybuffer. Developers can explicitly allocate memory for .wasm code with the Javascript WebAssembly.memory() call.
|
||||
|
||||
A pure text version of the .wasm format – that can greatly simplify learning and debugging – is also available. WebAssembly, however, is not really intended for direct human use. Technically speaking, .wasm is just a browser-compatible **compilation target**: a format in which software compilers can automatically translate code written in high-level programming languages.
|
||||
|
||||
This choice is exactly what allows developers to program directly for the preferred user interface of billions of people, in languages they already know (C/C++, Python, Go, Rust and others) but could not be efficiently used by browsers before. Even better, programmers would get this – at least in theory – without ever looking directly at WebAssembly code or worrying (since the target is a **virtual** machine) about which physical CPUs will actually run their code.
|
||||
|
||||
## **But we already have JavaScript. Do we really need WebAssembly?**
|
||||
|
||||
Yes, for several reasons. To begin with, being binary instructions, .wasm files can be much smaller – that is much faster to download – than JavaScript files of equivalent functionality. Above all, Javascript files must be fully parsed and verified before a browser can convert them to bytecode usable by its internal virtual machine.
|
||||
|
||||
.wasm files, instead, can be verified and compiled in a single pass, thus making “Streaming Compilation” possible: a browser can start to compile and execute them the moment it starts **downloading them**, just like happens with streaming movies.
|
||||
|
||||
This said, not all conceivable WebAssembly applications would surely be faster – or smaller – than equivalent JavaScript ones that are manually optimized by expert programmers. This may happen, for example, if some .wasm needed to include libraries that are not needed with JavaScript.
|
||||
|
||||
## **Does WebAssembly make JavaScript obsolete?**
|
||||
|
||||
In a word: no. Certainly not for a while, at least inside browsers. WebAssembly modules still need JavaScript because by design they cannot access the Document Object Model (DOM), that is the [main API made to modify web pages][4]. Besides, .wasm code cannot make system calls or read the browser’s memory. WebAssembly only runs in a sandbox and, in general, can interact with the outside world even less than JavaScript can, and only through JavaScript interfaces.
|
||||
|
||||
Therefore – at least in the near future – .wasm modules will just provide, through JavaScript, the parts that would consume much more bandwidth, memory or CPU time if they were written in that language.
|
||||
|
||||
## **How web browsers run WebAssembly**
|
||||
|
||||
In general, a browser needs at least two pieces to handle dynamic applications: a virtual machine (VM) that runs the app code and standard APIs that that code can use to modify both the behaviour of the browser, and the content of the web page that it displays.
|
||||
|
||||
The VMs inside modern browsers support both JavaScript and WebAssembly in the following way:
|
||||
|
||||
1. The browser downloads a web page written in the HTML markup language, and renders it
|
||||
2. if that HTML calls JavaScript code, the browser’s VM executes it. But…
|
||||
3. if that JavaScript code contains an instance of a WebAssembly module, that one is fetched as explained above, and then used as needed by JavaScript, via the WebAssembly APIs
|
||||
4. and when the WebAssembly code produces something that would alter the DOM – that is the structure of the “host” web page – the JavaScript code receives it and proceeds to the actual alteration.
|
||||
|
||||
|
||||
|
||||
## **How can I create usable WebAssembly code?**
|
||||
|
||||
There are more and more programming language communities that are supporting compiling to Wasm directly, we recommend looking at the [introductory guides][5] from webassembly.org as a starting point depending what language you work with. Note that not all programming languages have the same level of Wasm support, so your mileage may vary.
|
||||
|
||||
We plan to release a series of articles in the coming months providing more information about WebAssembly. To get started using it yourself, you can enroll in The Linux Foundation’s free [Introduction to WebAssembly][6] online training course.
|
||||
|
||||
The post [An Introduction to WebAssembly][7] appeared first on [Linux Foundation – Training][8].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/news/an-introduction-to-webassembly/
|
||||
|
||||
作者:[Dan Brown][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://training.linuxfoundation.org/announcements/an-introduction-to-webassembly/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://webassembly.org/
|
||||
[2]: https://webassembly.org/docs/use-cases/
|
||||
[3]: https://blog.archive.org/2020/11/19/flash-animations-live-forever-at-the-internet-archive/
|
||||
[4]: https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Introduction
|
||||
[5]: https://webassembly.org/getting-started/developers-guide/
|
||||
[6]: https://training.linuxfoundation.org/training/introduction-to-webassembly-lfd133/
|
||||
[7]: https://training.linuxfoundation.org/announcements/an-introduction-to-webassembly/
|
||||
[8]: https://training.linuxfoundation.org/
|
@ -1,104 +0,0 @@
|
||||
[#]: subject: (You Can Now Install Official Evernote Client on Ubuntu and Debian-based Linux Distributions)
|
||||
[#]: via: (https://itsfoss.com/install-evernote-ubuntu/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
You Can Now Install Official Evernote Client on Ubuntu and Debian-based Linux Distributions
|
||||
======
|
||||
|
||||
[Evernote][1] is a popular note-taking application. It was a revolutionary product at the time of its launch. Since then, there have been several such application that allow you to save web clippings, notes etc into notebook formats.
|
||||
|
||||
For years, the desktop client of Evernote was not available for Linux. Evernote promised a Linux application some time ago and its beta version is finally available for Ubuntu-based distributions.
|
||||
|
||||
Non-FOSS alert!
|
||||
|
||||
Evernote Linux client is not open source. It’s been covered here because the application is made available on Linux and we cover popular non-foss applications for Linux users from time to time. This helps with regular desktop Linux users.
|
||||
|
||||
### Installing Evernote on Ubuntu and Debian-based Linux distributions
|
||||
|
||||
Go to the following page on Evernote’s website:
|
||||
|
||||
[Evernote Linux Beta Program][2]
|
||||
|
||||
Scroll down a bit to accept the terms and conditions of ‘early testing program’. You’ll see a ‘Install Now’ button appearing on the screen. Click on it to download the DEB file.
|
||||
|
||||
![][3]
|
||||
|
||||
To [install the application from the DEB file][4], double-click on it. It should open the Software Center app and give you the option to install it.
|
||||
|
||||
![][5]
|
||||
|
||||
Once the installation completes, search for Evernote in the system menu and launch it.
|
||||
|
||||
![][6]
|
||||
|
||||
When you start the application for the first time, you’ll need to log in to your Evernote account.
|
||||
|
||||
![][7]
|
||||
|
||||
The first run brings you to the ‘Home screen’ where you can organize your notebooks for even quicker access.
|
||||
|
||||
![][8]
|
||||
|
||||
You may enjoy using Evernote on Linux now.
|
||||
|
||||
### Experiencing the beta version of Evernote Linux client
|
||||
|
||||
There are a few annoyances here and there with the software being in beta.
|
||||
|
||||
As you can notice in the image above, Evernote Linux client detected the [dark mode in Ubuntu][9] and switched to dark theme automatically. However, when I changed the system theme to light or standard, it didn’t change theme application theme immediately. The changes took into effect only after I restarted Evernote app.
|
||||
|
||||
Another issue is about closing the application. If you click on the X button to close the Evernote application, the program goes in background instead of exiting.
|
||||
|
||||
There is an app indicator that seems like a way to launch a minimized Evernote application, like [Skype on Linux][10]. Unfortunately, that’s not the case. It opens the Scratch Pad for you to type a quick note.
|
||||
|
||||
This gives you another [note taking application on Linux][11] but it also presents a problem. There is no option to quit Evernote here. It is only for opening the quick note taking app.
|
||||
|
||||
![][12]
|
||||
|
||||
So, how do you quit the Evernote application? For that, open the Evernote application again. If it is running in the background, search for it in the menu and launch it as if you are opening it afresh.
|
||||
|
||||
When Evernote application is running in the foreground, go to File->Quit Evernote.
|
||||
|
||||
![][13]
|
||||
|
||||
This is something the developers should look to improve in the future versions.
|
||||
|
||||
I also cannot say how will the beta version of the program be updated in the future. It doesn’t add any repository. I just hope that the application itself notifies about the availability of a newer version so that users could download the new DEB file.
|
||||
|
||||
I do NOT have a premium Evernote subscription but still, I could access the saved web articles and notes without internet connection. Strange, right?
|
||||
|
||||
Overall, I am happy to see that Evernote finally made the effort to bring the application to Linux. Now you don’t have to try third-party applications to use Evernote on Linux, at least on Ubuntu and Debian-based distributions. You may, of course, use an [Evernote alternative][14] like [Joplin][15] that are actually open source.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/install-evernote-ubuntu/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://evernote.com/
|
||||
[2]: https://evernote.com/intl/en/b1433t1422
|
||||
[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/evernote-early-access-linux.png?resize=799%2C495&ssl=1
|
||||
[4]: https://itsfoss.com/install-deb-files-ubuntu/
|
||||
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/install-evernote-linux.png?resize=800%2C539&ssl=1
|
||||
[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/evernote-ubuntu.jpg?resize=800%2C230&ssl=1
|
||||
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/evernote-running-ubuntu.png?resize=800%2C505&ssl=1
|
||||
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/evernote-on-ubuntu.png?resize=800%2C537&ssl=1
|
||||
[9]: https://itsfoss.com/dark-mode-ubuntu/
|
||||
[10]: https://itsfoss.com/install-skype-ubuntu-1404/
|
||||
[11]: https://itsfoss.com/note-taking-apps-linux/
|
||||
[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/evernote-app-indicator.png?resize=800%2C480&ssl=1
|
||||
[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/quit-evernote-linux.png?resize=799%2C448&ssl=1
|
||||
[14]: https://itsfoss.com/5-evernote-alternatives-linux/
|
||||
[15]: https://itsfoss.com/joplin/
|
@ -0,0 +1,186 @@
|
||||
[#]: subject: (5 surprising things you can do with LibreOffice from the command line)
|
||||
[#]: via: (https://opensource.com/article/21/3/libreoffice-command-line)
|
||||
[#]: author: (Don Watkins https://opensource.com/users/don-watkins)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
5 surprising things you can do with LibreOffice from the command line
|
||||
======
|
||||
Convert, print, protect, and do more with your files directly from the
|
||||
command line.
|
||||
![hot keys for shortcuts or features on computer keyboard][1]
|
||||
|
||||
LibreOffice has all the productivity features you'd want from an office software suite, making it a popular open source alternative to Microsoft Office or Google Suite. One of LibreOffice's powers is the ability to operate from the command line. For example, Seth Kenlon recently explained how he uses a global [command-line option to convert multiple files][2] from DOCX to EPUB with LibreOffice. His article inspired me to share some other LibreOffice command-line tips and tricks.
|
||||
|
||||
Before we look at some hidden features of LibreOffice commands, you need to understand how to use options with applications. Not all applications accept options (aside from the basics like the `--help` option, which works in most Linux applications).
|
||||
|
||||
|
||||
```
|
||||
`$ libreoffice --help`
|
||||
```
|
||||
|
||||
This returns descriptions of other options LibreOffice accepts. Some applications don't have many options, but LibreOffice has a few screens worth, so there's plenty to play with.
|
||||
|
||||
That said, here are five useful things you can do with LibreOffice at the terminal to make the software even more useful.
|
||||
|
||||
### 1\. Customize your launch options
|
||||
|
||||
You can modify how you launch LibreOffice. For instance, if you want to open just LibreOffice's word processor component:
|
||||
|
||||
|
||||
```
|
||||
`$ libreoffice --writer #starts the word processor`
|
||||
```
|
||||
|
||||
You can open its other components similarly:
|
||||
|
||||
|
||||
```
|
||||
$ libreoffice --calc #starts the Calc document
|
||||
$ libreoffice --draw #starts an empty Draw document
|
||||
$ libreoffice --web #starts and empty HTML document
|
||||
```
|
||||
|
||||
You also can access specific help files from the command line:
|
||||
|
||||
|
||||
```
|
||||
`$ libreoffice --helpwriter`
|
||||
```
|
||||
|
||||
![LibreOffice Writer help][3]
|
||||
|
||||
(Don Watkins, [CC BY-SA 4.0][4])
|
||||
|
||||
Or if you need help with the spreadsheet application:
|
||||
|
||||
|
||||
```
|
||||
`$ libreoffice --helpcalc`
|
||||
```
|
||||
|
||||
You can start LibreOffice without the splash screen:
|
||||
|
||||
|
||||
```
|
||||
`$ libreoffice --writer --nologo`
|
||||
```
|
||||
|
||||
You can even have it launch minimized in the background while you finish working in your current window:
|
||||
|
||||
|
||||
```
|
||||
`$ libreoffice --writer --minimized`
|
||||
```
|
||||
|
||||
### 2\. Open a file in read-only mode
|
||||
|
||||
You can open files in read-only mode using `--view` to prevent accidentally making and saving changes to an important file:
|
||||
|
||||
|
||||
```
|
||||
`$ libreoffice --view example.odt`
|
||||
```
|
||||
|
||||
### 3\. Open a document as a template
|
||||
|
||||
Have you ever created a document to use as a letterhead or invoice form? LibreOffice has a rich built-in template system, but you can make any document a template with the `-n` option:
|
||||
|
||||
|
||||
```
|
||||
`$ libreoffice --writer -n example.odt`
|
||||
```
|
||||
|
||||
Your document will open in LibreOffice and you can make changes to it, but you won't overwrite the original file when you save it.
|
||||
|
||||
### 4\. Convert documents
|
||||
|
||||
When you need to do a small task like converting a file to a new format, it can take as long for the application to launch as it takes to do the task. The solution is the `--headless` option, which executes LibreOffice processes without launching the graphical user interface.
|
||||
|
||||
For example, converting a document to EPUB is a pretty simple task in LibreOffice—but it's even easier with the `libreoffice` command:
|
||||
|
||||
|
||||
```
|
||||
`$ libreoffice --headless --convert-to epub example.odt`
|
||||
```
|
||||
|
||||
Using wildcards means you can convert dozens of documents at once:
|
||||
|
||||
|
||||
```
|
||||
`$ libreoffice --headless --convert-to epub *.odt`
|
||||
```
|
||||
|
||||
You can convert files to several formats, including PDF, HTML, DOC, DOCX, EPUB, plain text, and many more.
|
||||
|
||||
### 5\. Print from the terminal
|
||||
|
||||
You can print LibreOffice documents from the command line without opening the application:
|
||||
|
||||
|
||||
```
|
||||
`$ libreoffice --headless -p example.odt`
|
||||
```
|
||||
|
||||
This option prints to the default printer without opening LibreOffice; it just sends the document to your printer.
|
||||
|
||||
To print all the files in a directory:
|
||||
|
||||
|
||||
```
|
||||
`$ libreoffice -p *.odt`
|
||||
```
|
||||
|
||||
(More than once, I've issued this command and then run out of paper, so make sure you have enough paper loaded in your printer before you start.)
|
||||
|
||||
You can also print files to PDF. There's usually no difference between this and using the `--convert-to-pdf` option but it's easy to remember:
|
||||
|
||||
|
||||
```
|
||||
`$ libreoffice --print-to-file example.odt --headless`
|
||||
```
|
||||
|
||||
### Bonus: Flatpak and command options
|
||||
|
||||
If you installed LibreOffice as a [Flatpak][5], all of these command options work, but you have to pass them through Flatpak. Here's an example:
|
||||
|
||||
|
||||
```
|
||||
`$ flatpak run org.libreoffice.LibreOffice --writer`
|
||||
```
|
||||
|
||||
It's a lot more verbose than a local install, so you might be inspired to [write a Bash alias][6] to make it easier to interact with LibreOffice directly.
|
||||
|
||||
### Surprising terminal options
|
||||
|
||||
Find out how you can extend the power of LibreOffice from the command line by consulting the man pages:
|
||||
|
||||
|
||||
```
|
||||
`$ man libreoffice`
|
||||
```
|
||||
|
||||
Were you aware that LibreOffice had such a rich set of command-line options? Have you discovered other options that nobody else seems to know about? Share them in the comments!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/3/libreoffice-command-line
|
||||
|
||||
作者:[Don Watkins][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/don-watkins
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/shortcut_command_function_editing_key.png?itok=a0sEc5vo (hot keys for shortcuts or features on computer keyboard)
|
||||
[2]: https://opensource.com/article/21/2/linux-workday
|
||||
[3]: https://opensource.com/sites/default/files/uploads/libreoffice-help.png (LibreOffice Writer help)
|
||||
[4]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[5]: https://www.libreoffice.org/download/flatpak/
|
||||
[6]: https://opensource.com/article/19/7/bash-aliases
|
@ -0,0 +1,105 @@
|
||||
[#]: subject: (5 useful Moodle plugins to engage students)
|
||||
[#]: via: (https://opensource.com/article/21/3/moodle-plugins)
|
||||
[#]: author: (Sergey Zarubin https://opensource.com/users/sergey-zarubin)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
5 useful Moodle plugins to engage students
|
||||
======
|
||||
Use plugins to give your e-learning platform new capabilities that
|
||||
motivate students.
|
||||
![Person reading a book and digital copy][1]
|
||||
|
||||
A good e-learning platform is important for education all over the world. Teachers need a way to hold classes, students need a friendly user interface to facilitate learning, and administrators need a way to monitor the educational system's effectiveness.
|
||||
|
||||
Moodle is an open source software package that allows you to create a private website with interactive online courses. It's helping people gather virtually, teach and learn from one another, and stay organized while doing it.
|
||||
|
||||
What makes Moodle unique is its high usability that can significantly increase with third-party solutions. If you visit the [Moodle plugins directory][2], you'll find over 1,700 plugins developed by the open source community.
|
||||
|
||||
Picking the best plugins for your learners might be a challenge with so many choices. To help get you started, here my top five plugins to add to your e-learning platform.
|
||||
|
||||
### Level up!
|
||||
|
||||
![Level up Moodle plugin][3]
|
||||
|
||||
Level up! Source: <https://levelup.plus/>
|
||||
|
||||
Motivating and engaging learners is one of the most difficult tasks for educators. The [Level up plugin][4] allows you to gamify the learning experience by attributing points to students for completing actions and allowing them to show progress and level up. This encourages your students to compete in a healthy atmosphere and be better learners.
|
||||
|
||||
What's more, you can take total control over the points your students earn, and they can unlock content when they reach a certain level. All of these features are available for free. If you are ready to pay, you can buy some extra functionality, such as individual rewards and team leaderboards.
|
||||
|
||||
### BigBlueButton
|
||||
|
||||
![BigBlueButton Moodle plugin][5]
|
||||
|
||||
BigBlueButton. Source: <https://bigbluebutton.org/>
|
||||
|
||||
[BigBlueButton][6] is probably the most well-known Moodle plugin. This open source videoconferencing solution allows educators to engage remote students with live online classes and group collaboration activities. It offers important features such as real-time screen sharing, audio and video calls, chat, emojis, and breakout rooms. This plugin also allows you to record your live sessions.
|
||||
|
||||
BigBlueButton enables you to create multiple activity links within any course, restrict your students from joining a session until you join, create a custom welcome message, manage your recordings, and more. All in all, BigBlueButton has everything you need to teach and participate in online classes.
|
||||
|
||||
### ONLYOFFICE
|
||||
|
||||
![ONLYOFFICE Moodle plugin][7]
|
||||
|
||||
ONLYOFFICE. Source: <https://www.onlyoffice.com/>
|
||||
|
||||
The [ONLYOFFICE plugin][8] allows learners and educators to create and edit text documents, spreadsheets, and presentations right in their browser. Without installing any additional apps, they can work with .docx, .xlsx, .pptx, .txt, and .csv files attached to their courses; open .pdf files for viewing; and apply advanced formatting and objects including autoshapes, tables, charts, equations, and more.
|
||||
|
||||
Moreover, ONLYFFICE makes it possible to co-edit documents in real time, which means several users can simultaneously work on the same document. Different permission rights (full access, commenting, reviewing, read-only, and form filling) make it easier to manage access to your documents flexibly.
|
||||
|
||||
### Global Chat
|
||||
|
||||
![Global Chat Moodle plugin][9]
|
||||
|
||||
Global Chat. Source: <https://moodle.org/plugins/block_gchat>
|
||||
|
||||
The [Global Chat plugin][10] allows educators and learners to communicate in real time via Moodle. The plugin provides a list of all the users in your courses, and when you click a user's name, it opens a chat window at the bottom of the page so that you can communicate.
|
||||
|
||||
With this easy-to-use tool, you don't need to open a separate window to start an online conversation. You can change between web pages, and your conversations will always remain open.
|
||||
|
||||
### Custom certificate
|
||||
|
||||
![Custom certificate Moodle plugin][11]
|
||||
|
||||
Custom certificate. Source: <https://moodle.org/plugins/mod_customcert>
|
||||
|
||||
Another effective way to engage students is to offer certificates as a reward for course completion. The promise of a completion certificate helps keep students on track and committed to their training.
|
||||
|
||||
The [Custom certificate plugin][12] allows you to generate fully customizable PDF certificates in your web browser. Importantly, the plugin is compatible with GDPR requirements, and the certificates have unique verification codes, so you can use them for authentic accreditation.
|
||||
|
||||
### Oodles of Moodle plugins
|
||||
|
||||
These are my top five favorite Moodle plugins. You can try them out by [signing up for an account][13] on Moodle.org, or you can host your own installation (or talk to your systems administrator or IT staff to set one up for you).
|
||||
|
||||
If these plugins aren't the right options for your learning goals, take a look at the many other plugins available. If you find a good one, leave a comment and tell everyone about it!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/3/moodle-plugins
|
||||
|
||||
作者:[Sergey Zarubin][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/sergey-zarubin
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/read_book_guide_tutorial_teacher_student_apaper.png?itok=_GOufk6N (Person reading a book and digital copy)
|
||||
[2]: https://moodle.org/plugins/
|
||||
[3]: https://opensource.com/sites/default/files/uploads/gamification.png (Level up Moodle plugin)
|
||||
[4]: https://moodle.org/plugins/block_xp
|
||||
[5]: https://opensource.com/sites/default/files/uploads/bigbluebutton.png (BigBlueButton Moodle plugin)
|
||||
[6]: https://moodle.org/plugins/mod_bigbluebuttonbn
|
||||
[7]: https://opensource.com/sites/default/files/uploads/onlyoffice_editors.png (ONLYOFFICE Moodle plugin)
|
||||
[8]: https://github.com/logicexpertise/moodle-mod_onlyoffice
|
||||
[9]: https://opensource.com/sites/default/files/uploads/global_chat.png (Global Chat Moodle plugin)
|
||||
[10]: https://moodle.org/plugins/block_gchat
|
||||
[11]: https://opensource.com/sites/default/files/uploads/certificate.png (Custom certificate Moodle plugin)
|
||||
[12]: https://moodle.org/plugins/mod_customcert
|
||||
[13]: https://moodle.com/getstarted/
|
@ -0,0 +1,282 @@
|
||||
[#]: subject: (Build a printer UI for Raspberry Pi with XML and Java)
|
||||
[#]: via: (https://opensource.com/article/21/3/raspberry-pi-totalcross)
|
||||
[#]: author: (Edson Holanda Teixeira Junior https://opensource.com/users/edsonhtj)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
Build a printer UI for Raspberry Pi with XML and Java
|
||||
======
|
||||
TotalCross makes it quick to build user interfaces for embedded
|
||||
applications.
|
||||
![Tips and gears turning][1]
|
||||
|
||||
Creating a GUI from scratch is a very time consuming process, dealing with all the positions and alignments in hard code can be really tough for some programmers. In this article, I demonstrate how to speed up this process using XML.
|
||||
|
||||
This project uses [TotalCross][2] as the target framework. TotalCross is an open source, cross-platform software development kit (SDK) developed to create GUIs for embedded devices faster. TotalCross provides Java's development benefits without needing to run Java on a device because it uses its own bytecode and virtual machine (TC bytecode and TCVM) for performance enhancement.
|
||||
|
||||
I also use Knowcode-XML, an open source XML parser for the TotalCross framework, which converts XML files into TotalCross components.
|
||||
|
||||
### Project requirements
|
||||
|
||||
To reproduce this project, you need:
|
||||
|
||||
* [KnowCode-XML][3]
|
||||
* [VSCode][4] [or VSCodium][5]
|
||||
* [An Android development environment][6]
|
||||
* [TotalCross plugin for VSCode][7]
|
||||
* Java 11 or greater for your development platform ([Linux][8], [Mac][9], or [Windows][10])
|
||||
* [Git][11]
|
||||
|
||||
|
||||
|
||||
### Building the embedded application
|
||||
|
||||
This application consists of an embedded GUI with basic print functionalities, such as scan, print, and copy.
|
||||
|
||||
![printer init screen][12]
|
||||
|
||||
(Edson Holanda Teixeira Jr, [CC BY-SA 4.0][13])
|
||||
|
||||
Several steps are required to create this GUI, including generating the GUI with Android-XML and then using the Knowcode-XML parser to run it on the TotalCross Framework.
|
||||
|
||||
#### 1\. Generate the Android XML
|
||||
|
||||
For creating the XML file, first create a simple Android screen, and then customize it. If you don't know how to write Android-XM, or you just want a headstart, you can download this application’s XML from this [GitHub project][14]. This project also contains the images you need to render the GUI.
|
||||
|
||||
#### 2\. Adjust the XML
|
||||
|
||||
After generating the XML files, you need to make some fine adjustments to make sure everything is aligned, with the right proportions, and has the correct path to the images.
|
||||
|
||||
Add the XML layouts to the **Layouts** folder and all the assets to the **Drawable** folder. Then you can start to customize the XML.
|
||||
|
||||
For example, if you want to change an XML object's background, change the `android:background` attribute:
|
||||
|
||||
|
||||
```
|
||||
`android:background="@drawable/scan"`
|
||||
```
|
||||
|
||||
You can change the object's position with `tools:layout_editor_absoluteX` and `tools:layout_editor_absoluteY`:
|
||||
|
||||
|
||||
```
|
||||
tools:layout_editor_absoluteX="830dp"
|
||||
tools:layout_editor_absoluteY="511dp"
|
||||
```
|
||||
|
||||
Change the object's size with `android:layout_width` and `android:layout_height`:
|
||||
|
||||
|
||||
```
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
```
|
||||
|
||||
If you want to put text on an object, you can use `android:textSize`, `android:text`, `android:textStyle`, and `android:textColor`:
|
||||
|
||||
|
||||
```
|
||||
android:textStyle="bold"
|
||||
android:textColor="#000000"
|
||||
android:textSize="20dp"
|
||||
android:text="2:45PM"
|
||||
```
|
||||
|
||||
Here is an example of a complete XML object:
|
||||
|
||||
|
||||
```
|
||||
<ImageButton
|
||||
android:id="@+id/ImageButton"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
tools:layout_editor_absoluteX="830dp"
|
||||
tools:layout_editor_absoluteY="511dp"
|
||||
android:background="@drawable/home_config" />
|
||||
```
|
||||
|
||||
#### 3\. Run the GUI on TotalCross
|
||||
|
||||
After you make all the XML adjustments, it's time to run it on TotalCross. Create a new project on the TotalCross extension and add the **XML** and **Drawable** folders to the **Main** folder. If you're not sure how to create a TotalCross project, see our [get started guide][15].
|
||||
|
||||
After configuring the environment, use `totalcross.knowcode.parse.XmlContainerFactory` and `import totalcross.knowcode.parse.XmlContainerLayout` to use the XML GUI on the TotalCross framework. You can find more information about using KnowCode-XML on its [GitHub page][3].
|
||||
|
||||
#### 4\. Add transitions
|
||||
|
||||
This project's smooth transition effect is created by the `SlidingNavigator` class, which uses TotalCross' `ControlAnimation` class to slide from one screen to the other.
|
||||
|
||||
Call `SlidingNavigator` on the `XMLpresenter` class:
|
||||
|
||||
|
||||
```
|
||||
`new SlidingNavigator(this).present(HomePresenter.class);`
|
||||
```
|
||||
|
||||
Implement the `present` function on the `SlidingNavigator` class:
|
||||
|
||||
|
||||
```
|
||||
public void present(Class<? extends XMLPresenter> presenterClass)
|
||||
throws [InstantiationException][16], [IllegalAccessException][17] {
|
||||
final XMLPresenter presenter = cache.containsKey(presenterClass) ? cache.get(presenterClass)
|
||||
: presenterClass.newInstance();
|
||||
if (!cache.containsKey(presenterClass)) {
|
||||
cache.put(presenterClass, presenter);
|
||||
}
|
||||
|
||||
if (presenters.isEmpty()) {
|
||||
window.add(presenter.content, LEFT, TOP, FILL, FILL);
|
||||
} else {
|
||||
XMLPresenter previous = presenters.lastElement();
|
||||
|
||||
window.add(presenter.content, AFTER, TOP, SCREENSIZE, SCREENSIZE, previous.content);
|
||||
```
|
||||
|
||||
`PathAnimation` in animation control creates the sliding animation from one screen to another:
|
||||
|
||||
|
||||
```
|
||||
PathAnimation.create(previous.content, -Settings.screenWidth, 0, new ControlAnimation.AnimationFinished() {
|
||||
@Override
|
||||
public void onAnimationFinished(ControlAnimation anim) {
|
||||
window.remove(previous.content);
|
||||
}
|
||||
}, 1000).with(PathAnimation.create(presenter.content, 0, 0, new ControlAnimation.AnimationFinished() {
|
||||
@Override
|
||||
public void onAnimation Finished(Control Animation anim) {
|
||||
presenter.content.setRect(LEFT, TOP, FILL, FILL);
|
||||
}
|
||||
}, 1000)).start();
|
||||
}
|
||||
presenter.setNavigator(this);
|
||||
presenters.push(presenter);
|
||||
presenter.bind2();
|
||||
if (presenter.isFirstPresent) {
|
||||
presenter.onPresent();
|
||||
presenter.isFirstPresent = false;
|
||||
}
|
||||
```
|
||||
|
||||
#### 5\. Load spinners
|
||||
|
||||
Another nice feature in the printer application is the loading screen animation that shows progress. It includes text and a spinning animation.
|
||||
|
||||
![Loading Spinner][18]
|
||||
|
||||
(Edson Holanda Teixeira Jr, [CC BY-SA 4.0][13])
|
||||
|
||||
Implement this feature by adding a timer and a timer listener to update the progress label, then call the function `spinner.start()`. All of the animations are auto-generated by TotalCross and KnowCode:
|
||||
|
||||
|
||||
```
|
||||
public void startSpinner() {
|
||||
time = content.addTimer(500);
|
||||
content.addTimerListener((e) -> {
|
||||
try {
|
||||
progress(); // Updates the Label
|
||||
} catch (InstantiationException | IllegalAccessException e1) {
|
||||
// TODO Auto-generated catch block
|
||||
e1.printStackTrace();
|
||||
}
|
||||
});
|
||||
Spinner spinner = (Spinner) ((XmlContainerLayout) content).getControlByID("@+id/spinner");
|
||||
spinner.start();
|
||||
}
|
||||
```
|
||||
|
||||
The spinner is instantiated as a reference to the `XmlContainerLayout` spinner described in the XML file:
|
||||
|
||||
|
||||
```
|
||||
<ProgressBar
|
||||
android:id="@+id/spinner"
|
||||
android:layout_width="362dp"
|
||||
android:layout_height="358dp"
|
||||
tools:layout_editor_absoluteX="296dp"
|
||||
tools:layout_editor_absoluteY="198dp"
|
||||
android:indeterminateTint="#2B05C7"
|
||||
style="?android:attr/progressBarStyle" />
|
||||
```
|
||||
|
||||
#### 6\. Build the application
|
||||
|
||||
It's time to build the application. You can see and change the target systems in `pom.xml`. Make sure the **Linux Arm** target is available.
|
||||
|
||||
If you are using VSCode, press **F1** on the keyboard, select **TotalCross: Package** and wait for the package to finish. Then you can see the installation files in the **Target** folder.
|
||||
|
||||
#### 7\. Deploy and run the application on Raspberry Pi
|
||||
|
||||
To deploy the application on a [Raspberry Pi 4][19] with the SSH protocol, press **F1** on the keyboard. Select **TotalCross: Deploy&Run** and provide information about your SSH connection: User, IP, Password, and Application Path.
|
||||
|
||||
![TotalCross: Deploy&Run][20]
|
||||
|
||||
(Edson Holanda Teixeira Jr, [CC BY-SA 4.0][13])
|
||||
|
||||
![SSH user][21]
|
||||
|
||||
(Edson Holanda Teixeira Jr, [CC BY-SA 4.0][13])
|
||||
|
||||
![IP address][22]
|
||||
|
||||
(Edson Holanda Teixeira Jr, [CC BY-SA 4.0][13])
|
||||
|
||||
![Password][23]
|
||||
|
||||
(Edson Holanda Teixeira Jr, [CC BY-SA 4.0][13])
|
||||
|
||||
![Path][24]
|
||||
|
||||
(Edson Holanda Teixeira Jr, [CC BY-SA 4.0][13])
|
||||
|
||||
Here's what the application looks like running on the machine.
|
||||
|
||||
### What's next?
|
||||
|
||||
KnowCode makes it easier to create and manage your application screens using Java. Knowcode-XML translates your XML into a TotalCross GUI that in turn generates the binary to run on your Raspberry Pi.
|
||||
|
||||
Combining KnowCode technology with TotalCross enables you to create embedded applications faster. Find out what else you can do by accessing our [embedded samples][25] on GitHub and editing your own application.
|
||||
|
||||
If you have questions, need help, or just want to interact with other embedded GUI developers, feel free to join our [Telegram][26] group to discuss embedded applications on any framework.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/3/raspberry-pi-totalcross
|
||||
|
||||
作者:[Edson Holanda Teixeira Junior][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/edsonhtj
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/gears_devops_learn_troubleshooting_lightbulb_tips_520.png?itok=HcN38NOk (Tips and gears turning)
|
||||
[2]: https://opensource.com/article/20/7/totalcross-cross-platform-development
|
||||
[3]: https://github.com/TotalCross/knowcode-xml
|
||||
[4]: https://code.visualstudio.com/
|
||||
[5]: https://opensource.com/article/20/6/open-source-alternatives-vs-code
|
||||
[6]: https://developer.android.com/studio
|
||||
[7]: https://marketplace.visualstudio.com/items?itemName=totalcross.vscode-totalcross
|
||||
[8]: https://opensource.com/article/19/11/install-java-linux
|
||||
[9]: https://opensource.com/article/20/7/install-java-mac
|
||||
[10]: http://adoptopenjdk.net
|
||||
[11]: https://opensource.com/life/16/7/stumbling-git
|
||||
[12]: https://opensource.com/sites/default/files/uploads/01_printergui.png (printer init screen)
|
||||
[13]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[14]: https://github.com/TotalCross/embedded-samples/tree/main/printer-application/src/main/resources/layout
|
||||
[15]: https://totalcross.com/get-started/?utm_source=opensource&utm_medium=article&utm_campaign=printer
|
||||
[16]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+instantiationexception
|
||||
[17]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+illegalaccessexception
|
||||
[18]: https://opensource.com/sites/default/files/uploads/03progressspinner.png (Loading Spinner)
|
||||
[19]: https://www.raspberrypi.org/products/raspberry-pi-4-model-b/
|
||||
[20]: https://opensource.com/sites/default/files/uploads/04_totalcross-deployrun.png (TotalCross: Deploy&Run)
|
||||
[21]: https://opensource.com/sites/default/files/uploads/05_ssh.png (SSH user)
|
||||
[22]: https://opensource.com/sites/default/files/uploads/06_ip.png (IP address)
|
||||
[23]: https://opensource.com/sites/default/files/uploads/07_password.png (Password)
|
||||
[24]: https://opensource.com/sites/default/files/uploads/08_path.png (Path)
|
||||
[25]: https://github.com/TotalCross/embedded-samples
|
||||
[26]: https://t.me/totalcrosscommunity
|
@ -0,0 +1,284 @@
|
||||
[#]: subject: (Manage containers on Raspberry Pi with this open source tool)
|
||||
[#]: via: (https://opensource.com/article/21/3/bastille-raspberry-pi)
|
||||
[#]: author: (Peter Czanik https://opensource.com/users/czanik)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
Manage containers on Raspberry Pi with this open source tool
|
||||
======
|
||||
Create and maintain your containers (aka jails) at scale on FreeBSD with
|
||||
Bastille.
|
||||
![Parts, modules, containers for software][1]
|
||||
|
||||
Containers became widely popular because of Docker on Linux, but there are [much earlier implementations][2], including the [jail][3] system on FreeBSD. A container is called a "jail" in FreeBSD terminology. The jail system was first released in FreeBSD 4.0 way back in 2000, and it has continuously improved since. While 20 years ago it was used mostly on large servers, now you can run it on your Raspberry Pi.
|
||||
|
||||
### Jails vs. containers on Linux
|
||||
|
||||
Container development took a very different path on FreeBSD than on Linux. On FreeBSD, containerization was developed as a strict security feature in the late '90s for virtual hosting and its flexibility grew over the years. Limiting a container's computing resources was not part of the original concept; this was added later.
|
||||
|
||||
When I started to use jails in production in 2001, it was quite painful. I had to prepare my own scripts to automate working with them.
|
||||
|
||||
On the Linux side, there were quite a few attempts at containerization, including [lxc][4].
|
||||
|
||||
Docker brought popularity, accessibility, and ease of use to containers. There are now many other tools on Linux (for example, I prefer to use [Podman on my laptop][5]). And Kubernetes allows you to work with containers at really large scale.
|
||||
|
||||
[Bastille][6] is one of several tools available in [FreeBSD ports][7] to manage jails. It is comparable to Docker or Podman and allows you to create and maintain jails at scale instead of manually. It has a template system to automatically install and configure applications within jails, similar to Dockerfile. It also supports advanced FreeBSD functionality, like ZFS or VNET.
|
||||
|
||||
### Install FreeBSD on Raspberry Pi
|
||||
|
||||
Installing [BSD on Raspberry Pi][8] is pretty similar to installing Linux. You download a compressed image from the FreeBSD website and `dd` it to an SD card. You can also use a dedicated image writer tool; there are many available for all operating systems (OS). Download and write an image from the command line with:
|
||||
|
||||
|
||||
```
|
||||
wget <https://download.freebsd.org/ftp/releases/arm64/aarch64/ISO-IMAGES/13.0/FreeBSD-13.0-BETA1-arm64-aarch64-RPI.img.xz>
|
||||
xzcat FreeBSD-13.0-BETA1-arm64-aarch64-RPI.img.xz | dd of=/dev/XXX
|
||||
```
|
||||
|
||||
That writes the latest beta image available for 64-bit Raspberry Pi boards; check the [download page][9] if you use another Raspberry Pi board or want to use another build. Replace `XXX` with your SD card's device name, which depends on your OS and how the card connects to your machine. I purposefully did not use a device name so that you won't overwrite anything if you just copy and paste the instructions mindlessly. I did that and was lucky to have a recent backup of my laptop, but it was _not_ a pleasant experience.
|
||||
|
||||
Once you've written the SD card, put it in your Raspberry Pi and boot it. The first boot takes a bit longer than usual; I suspect the partition sizes are being adjusted to the SD card's size. After a while, you will receive the familiar login prompt on a good old text-based screen. The username is **root**, and the password is the same as the user name. The SSH server is enabled by default, but don't worry; the root user cannot log in. It is still a good idea to change the password to something else. The network is automatically configured by DHCP for the Ethernet connection (I did not test WiFi).
|
||||
|
||||
The easiest way to configure Bastille on the system is to SSH into Raspberry Pi and copy and paste the commands and configuration in this article. You have a couple of options, depending on how much you care about industry best practices or are willing to treat it as a test system. You can either enable root login in the SSHD configuration (scary, but this is what I did at first) or create a regular user that can log in remotely. In the latter case, make sure that the user is part of the "wheel" group so that it can use `su -` to become root and use Bastille:
|
||||
|
||||
|
||||
```
|
||||
root@generic:~ # adduser
|
||||
Username: czanik
|
||||
Full name: Peter Czanik
|
||||
Uid (Leave empty for default):
|
||||
Login group [czanik]:
|
||||
Login group is czanik. Invite czanik into other groups? []: wheel
|
||||
Login class [default]:
|
||||
Shell (sh csh tcsh bash rbash git-shell nologin) [sh]: bash
|
||||
Home directory [/home/czanik]:
|
||||
Home directory permissions (Leave empty for default):
|
||||
Use password-based authentication? [yes]:
|
||||
Use an empty password? (yes/no) [no]:
|
||||
Use a random password? (yes/no) [no]:
|
||||
Enter password:
|
||||
Enter password again:
|
||||
Lock out the account after creation? [no]:
|
||||
Username : czanik
|
||||
Password : *****
|
||||
Full Name : Peter Czanik
|
||||
Uid : 1002
|
||||
Class :
|
||||
Groups : czanik wheel
|
||||
Home : /home/czanik
|
||||
Home Mode :
|
||||
Shell : /usr/local/bin/bash
|
||||
Locked : no
|
||||
OK? (yes/no): yes
|
||||
adduser: INFO: Successfully added (czanik) to the user database.
|
||||
Add another user? (yes/no): no
|
||||
Goodbye!
|
||||
```
|
||||
|
||||
The fifth line adds the user to the wheel group. Note that you might have a different list of shells on your system, and Bash is not part of the base system. Install Bash before adding the user:
|
||||
|
||||
|
||||
```
|
||||
`pkg install bash`
|
||||
```
|
||||
|
||||
PKG needs to bootstrap itself on the first run, so invoking the command takes a bit longer this time.
|
||||
|
||||
### Get started with Bastille
|
||||
|
||||
Managing jails with the tools in the FreeBSD base system is possible—but not really convenient. Using a tool like Bastille can simplify it considerably. It is not part of the base system, so install it:
|
||||
|
||||
|
||||
```
|
||||
`pkg install bastille`
|
||||
```
|
||||
|
||||
As you can see from the command's output, Bastille has no external dependencies. It is a shell script that relies on commands in the FreeBSD base system (with an exception I'll note later when explaining templates).
|
||||
|
||||
If you want to start your containers on boot, enable Bastille:
|
||||
|
||||
|
||||
```
|
||||
`sysrc bastille_enable="YES"`
|
||||
```
|
||||
|
||||
Start with a simple use case. Many people use containers to install different development tools in different containers to avoid conflicts or simplify their environments. For example, no sane person wants to install Python 2 on a brand-new system—but you might need to run an ancient script every once in a while. So, create a jail for Python 2.
|
||||
|
||||
Before creating your first jail, you need to bootstrap a FreeBSD release and configure networking. Just make sure that you bootstrap the same or an older release than the host is running. For example:
|
||||
|
||||
|
||||
```
|
||||
`bastille bootstrap 12.2-RELEASE`
|
||||
```
|
||||
|
||||
It downloads and extracts this release under the `/usr/local/bastille` directory structure.
|
||||
|
||||
Networking can be configured in many different ways using Bastille. One option that works everywhere—on your local machine and in the cloud—is using cloned interfaces. This allows jails to use an internal network that does not interfere with the external network. Configure and start this internal network:
|
||||
|
||||
|
||||
```
|
||||
sysrc cloned_interfaces+=lo1
|
||||
sysrc ifconfig_lo1_name="bastille0"
|
||||
service netif cloneup
|
||||
```
|
||||
|
||||
With this network setup, services in your jails are not accessible from the outside network, nor can they reach outside. You need forward ports from your host's external interface to the jails and to enable network access translation (NAT). Bastille integrates with BSD's [PF firewall][10] for this task. The following `pf.conf` configures the PF firewall such that Bastille can add port forwarding rules to the firewall dynamically:
|
||||
|
||||
|
||||
```
|
||||
ext_if="ue0"
|
||||
|
||||
set block-policy return
|
||||
scrub in on $ext_if all fragment reassemble
|
||||
set skip on lo
|
||||
|
||||
table <jails> persist
|
||||
nat on $ext_if from <jails> to any -> ($ext_if)
|
||||
|
||||
rdr-anchor "rdr/*"
|
||||
|
||||
block in all
|
||||
pass out quick modulate state
|
||||
antispoof for $ext_if inet
|
||||
pass in inet proto tcp from any to any port ssh flags S/SA modulate state
|
||||
```
|
||||
|
||||
You also need to enable and start PF for these rules to take effect. Note that if you work through an SSH connection, starting PF will terminate your connection, and you will need to log in again:
|
||||
|
||||
|
||||
```
|
||||
sysrc pf_enable="YES"
|
||||
service pf restart
|
||||
```
|
||||
|
||||
### Create your first jail
|
||||
|
||||
To create a jail, Bastille needs a few parameters. First, it needs a name for the jail you're creating. It is an important parameter, as you will always refer to a jail by its name. I chose the name of the most famous Hungarian jail for the most elite criminals, but in real life, jail names often refer to the jail's function, like `syslogserver`. You also need to set the FreeBSD release you're using and an internet protocol (IP) address. I used a random `10.0.0.0/8` IP address range, but if your internal network already uses addresses from that, then using the `192.168.0.0/16` is probably a better idea:
|
||||
|
||||
|
||||
```
|
||||
`bastille create csillag 12.2-RELEASE 10.17.89.51`
|
||||
```
|
||||
|
||||
Your new jail should be up and running within a few seconds. It is a complete FreeBSD base system without any extra packages. So install some packages, like my favorite text editor, inside the jail:
|
||||
|
||||
|
||||
```
|
||||
root@generic:~ # bastille pkg csillag install joe
|
||||
[csillag]:
|
||||
Updating FreeBSD repository catalogue...
|
||||
FreeBSD repository is up to date.
|
||||
All repositories are up to date.
|
||||
The following 1 package(s) will be affected (of 0 checked):
|
||||
|
||||
New packages to be INSTALLED:
|
||||
joe: 4.6,1
|
||||
|
||||
Number of packages to be installed: 1
|
||||
|
||||
The process will require 2 MiB more space.
|
||||
442 KiB to be downloaded.
|
||||
|
||||
Proceed with this action? [y/N]: y
|
||||
[csillag] [1/1] Fetching joe-4.6,1.txz: 100% 442 KiB 452.5kB/s 00:01
|
||||
Checking integrity... done (0 conflicting)
|
||||
[csillag] [1/1] Installing joe-4.6,1...
|
||||
[csillag] [1/1] Extracting joe-4.6,1: 100%
|
||||
```
|
||||
|
||||
You can install multiple packages at the same time. Install Python 2, Bash, and Git:
|
||||
|
||||
|
||||
```
|
||||
`bastille pkg csillag install bash python2 git`
|
||||
```
|
||||
|
||||
Now you can start working in your new, freshly created jail. There are no network services installed in it, but you can reach it through its console:
|
||||
|
||||
|
||||
```
|
||||
root@generic:~ # bastille console csillag
|
||||
[csillag]:
|
||||
root@csillag:~ # python2
|
||||
Python 2.7.18 (default, Feb 2 2021, 01:53:44)
|
||||
[GCC FreeBSD Clang 10.0.1 ([git@github.com][11]:llvm/llvm-project.git llvmorg-10.0.1- on freebsd12
|
||||
Type "help", "copyright", "credits" or "license" for more information.
|
||||
>>>
|
||||
root@csillag:~ # logout
|
||||
|
||||
root@generic:~ #
|
||||
```
|
||||
|
||||
### Work with templates
|
||||
|
||||
The previous example manually installed some packages inside a jail. Setting up jails manually is no fun, even if Bastille makes it easy. Templates make the process even easier; they are similar to Dockerfiles but not entirely the same concept. You bootstrap templates for Bastille just like FreeBSD releases and then apply them to jails. When you apply a template, it will install the necessary packages and change configurations as needed.
|
||||
|
||||
To use templates, you need to install Git on the host:
|
||||
|
||||
|
||||
```
|
||||
`pkg install git`
|
||||
```
|
||||
|
||||
For example, to bootstrap the `syslog-ng` template, use:
|
||||
|
||||
|
||||
```
|
||||
`bastille bootstrap https://gitlab.com/BastilleBSD-Templates/syslog-ng`
|
||||
```
|
||||
|
||||
Create a new jail, apply the template, and redirect an external port to it:
|
||||
|
||||
|
||||
```
|
||||
bastille create alcatraz 12.2-RELEASE 10.17.89.50
|
||||
bastille template alcatraz BastilleBSD-Templates/syslog-ng
|
||||
bastille rdr alcatraz tcp 514 514
|
||||
```
|
||||
|
||||
To test the new service within the jail, use telnet to connect port 514 of your host and enter some random text. Use the `tail` command within your jail to see what you just entered:
|
||||
|
||||
|
||||
```
|
||||
root@generic:~ # tail /usr/local/bastille/jails/alcatraz/root/var/log/messages
|
||||
Feb 6 03:57:27 alcatraz sendmail[3594]: gethostbyaddr(10.17.89.50) failed: 1
|
||||
Feb 6 04:07:13 alcatraz syslog-ng[1186]: Syslog connection accepted; fd='23', client='AF_INET(192.168.1.126:50104)', local='AF_INET(0.0.0.0:514)'
|
||||
Feb 6 04:07:18 192.168.1.126 this is a test
|
||||
Feb 6 04:07:20 alcatraz syslog-ng[1186]: Syslog connection closed; fd='23', client='AF_INET(192.168.1.126:50104)', local='AF_INET(0.0.0.0:514)'
|
||||
```
|
||||
|
||||
Since I'm a [syslog-ng][12] evangelist, I used the syslog-ng template in my example, but there are many more available. Check the full list of [Bastille templates][13] to learn about them.
|
||||
|
||||
### What's next?
|
||||
|
||||
I hope that this article inspires you to try FreeBSD and Bastille on your Raspberry Pi. It was just enough information to get you started; to learn about all of Bastille's cool features—like auditing your jails for vulnerabilities and updating software within them—in the [documentation][14].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/3/bastille-raspberry-pi
|
||||
|
||||
作者:[Peter Czanik][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/czanik
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/containers_modules_networking_hardware_parts.png?itok=rPpVj92- (Parts, modules, containers for software)
|
||||
[2]: https://opensource.com/article/18/1/history-low-level-container-runtimes
|
||||
[3]: https://docs.freebsd.org/en/books/handbook/jails/
|
||||
[4]: https://opensource.com/article/18/11/behind-scenes-linux-containers
|
||||
[5]: https://opensource.com/article/18/10/podman-more-secure-way-run-containers
|
||||
[6]: https://bastillebsd.org/
|
||||
[7]: https://www.freebsd.org/ports/
|
||||
[8]: https://opensource.com/article/19/3/netbsd-raspberry-pi
|
||||
[9]: https://www.freebsd.org/where/
|
||||
[10]: https://en.wikipedia.org/wiki/PF_(firewall)
|
||||
[11]: mailto:git@github.com
|
||||
[12]: https://www.syslog-ng.com/
|
||||
[13]: https://gitlab.com/BastilleBSD-Templates/
|
||||
[14]: https://bastille.readthedocs.io/en/latest/
|
@ -0,0 +1,201 @@
|
||||
[#]: subject: (How to Install Nvidia Drivers on Linux Mint [Beginner’s Guide])
|
||||
[#]: via: (https://itsfoss.com/nvidia-linux-mint/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
How to Install Nvidia Drivers on Linux Mint [Beginner’s Guide]
|
||||
======
|
||||
|
||||
[Linux Mint][1] is a fantastic Ubuntu-based Linux distribution that aims to make it easy for newbies to experience Linux by minimizing the learning curve.
|
||||
|
||||
Not just limited to being one of the [best beginner-friendly Linux distros][2], it also does a [few things better than Ubuntu][3]. Of course, if you’re using Linux Mint like I do, you’re probably already aware of it.
|
||||
|
||||
We have many beginner-focused Mint tutorials on It’s FOSS. Recently some readers requested help with Nvidia drivers with Linux Mint and hence I came up with this article.
|
||||
|
||||
I have tried to mention different methods with a bit of explaining what’s going on and what you are doing in these steps.
|
||||
|
||||
But before that, you should know this:
|
||||
|
||||
* Nvidia has two categories of drivers. Open source drivers called Nouveau and proprietary drivers from Nvidia itself.
|
||||
* Most of the time, Linux distributions install the open source Nouveau driver and you can manually enable the proprietary drivers.
|
||||
* Graphics drivers are tricky things. For some systems, Nouveau works pretty well while for some it could create issues like blank screen or poor display. You may switch to proprietary drivers in such cases.
|
||||
* The proprietary driver from Nvidia has different version numbers like 390, 450, 460. The higher the number, the more recent is the driver. I’ll show you how to change between them in this tutorial.
|
||||
* If you are opting for proprietary drivers, you should go with the latest one unless you encounter some graphics issue. In those cases, opt for an older version of the driver and see if that works fine for you.
|
||||
|
||||
|
||||
|
||||
Now that you have some familiarity with the terms, let’s see how to go about installing Nvidia drivers on Linux Mint.
|
||||
|
||||
### How to Install Nvidia Drivers on Linux Mint: The Easy Way (Recommended)
|
||||
|
||||
Linux Mint comes baked in with a [Driver Manager][4] which easily lets you choose/install a driver that you need for your hardware using the GUI.
|
||||
|
||||
By default, you should see the open-source [xserver-xorg-video-nouveau][5] driver for Nvidia cards installed, and it works pretty well until you start playing a high-res video or want to play a [game on Linux][6].
|
||||
|
||||
So, to get the best possible experience, proprietary drivers should be preferred.
|
||||
|
||||
You should get different proprietary driver versions when you launch the Driver Manager as shown in the image below:
|
||||
|
||||
![][7]
|
||||
|
||||
Basically, the higher the number, the latest driver it is. At the time of writing this article, driver **version 460** was the latest recommendation for my Graphics Card. You just need to select the driver version and hit “**Apply Changes**“.
|
||||
|
||||
Once done, all you need to do is just reboot your system and if the driver works, you should automatically get the best resolution image and the refresh rate depending on your monitor for the display.
|
||||
|
||||
For instance, here’s how it looks for me (while it does not detect the correct size of the monitor):
|
||||
|
||||
![][8]
|
||||
|
||||
#### Troubleshooting tips
|
||||
|
||||
Depending on your card, the list would appear to be different. So, **what driver version should you choose?** Here are some pointers for you:
|
||||
|
||||
* The latest drivers should ensure compatibility with the latest games and should technically offer better performance overall. Hence, it is the recommended solution.
|
||||
* If the latest driver causes issues or fails to work, choose the next best offering. For instance, version 460 didn’t work, so I tried applying driver version 450, and it worked!
|
||||
|
||||
|
||||
|
||||
Initially, in my case (**Linux Mint 20.1** with **Linux Kernel 5.4**), the latest driver 460 version did not work. Technically, it was successfully installed but did not load up every time I booted.
|
||||
|
||||
**What to do if drivers fail to load at boot**
|
||||
|
||||
_How do you know when it does not work?_ You will boot up with a low-resolution screen, and you will be unable to tweak the resolution or the refresh rate of the monitor.
|
||||
|
||||
It will also inform you about the same in the form of an error:
|
||||
|
||||
![][9]
|
||||
|
||||
Fortunately, a solution from [Linux Mint’s forum][10] solved it for me. Here’s what you need to do:
|
||||
|
||||
1\. Access the modules file using the command:
|
||||
|
||||
```
|
||||
xed admin:///etc/modules
|
||||
```
|
||||
|
||||
2\. You’ll be prompted to authenticate the access with your account password. Once done, you just need to add the following lines at the bottom:
|
||||
|
||||
```
|
||||
nvidia
|
||||
nvidia-drm
|
||||
nvidia-modeset
|
||||
```
|
||||
|
||||
Here’s what it looks like:
|
||||
|
||||
![][11]
|
||||
|
||||
If that doesn’t work, you can launch the Driver Manager and opt for another version of Nvidia driver. It’s more of a hit and try.
|
||||
|
||||
### Install Nvidia Driver Using the Terminal (Special Use-Cases)
|
||||
|
||||
For some reasons, if you are not getting the latest drivers for your Graphics Card using the Driver Manager, opting for the terminal method could help.
|
||||
|
||||
It may not be the safest way to do it, but I did not have any issues installing the latest Nvidia driver 460 version.
|
||||
|
||||
I’ll always recommend sticking to the Driver Manager app unless you have your reasons.
|
||||
|
||||
To get started, first you have to check the available drivers for your GPU. Type in the following command to get the list:
|
||||
|
||||
```
|
||||
ubuntu-drivers devices
|
||||
```
|
||||
|
||||
Here’s how it looks in my case:
|
||||
|
||||
![][12]
|
||||
|
||||
**non-free** refers to the proprietary drivers and **free** points at the open-source nouveau Nvidia drivers.
|
||||
|
||||
As mentioned above, usually, it is preferred to try installing the recommended driver. In order to do that, you just type in:
|
||||
|
||||
```
|
||||
sudo ubuntu-drivers autoinstall
|
||||
```
|
||||
|
||||
If you want something specific, type in:
|
||||
|
||||
```
|
||||
sudo apt install nvidia-driver-450
|
||||
```
|
||||
|
||||
You just have to replace “**450**” with the driver version that you want and it will install the driver in the same way that you install an application via the terminal.
|
||||
|
||||
Once installed, you just need to restart the system or type it in the terminal:
|
||||
|
||||
```
|
||||
reboot
|
||||
```
|
||||
|
||||
**To check the Nvidia driver version and verify the installation, you can type the following command in the terminal:**
|
||||
|
||||
```
|
||||
nvidia-smi
|
||||
```
|
||||
|
||||
Here’s how it may look like:
|
||||
|
||||
![][13]
|
||||
|
||||
To remove the driver and its associated dependencies, simply mention the exact version of the driver:
|
||||
|
||||
```
|
||||
sudo apt remove nvidia-driver-450
|
||||
sudo apt autoremove
|
||||
```
|
||||
|
||||
And, simply reboot. It should fallback to use the open-source nouveau driver.
|
||||
|
||||
install the open-source driver using the following command and then reboot to revert to the default open-source driver:
|
||||
|
||||
```
|
||||
sudo apt install xserver-xorg-video-nouveau
|
||||
```
|
||||
|
||||
### Installing Nvidia Drivers using the .run file from Official Website (Time Consuming/Not Recommended)
|
||||
|
||||
Unless you want the latest version of the driver from the official website or just want to experiment the process, you can opt to download the file (.run) and install it.
|
||||
|
||||
To proceed, you need to first disable the X server and then install the Nvidia driver which could turn out to be troublesome and risky.
|
||||
|
||||
You can follow the [official documentation][14] if you want to explore this method, but you may not need it at all.
|
||||
|
||||
### Wrapping Up
|
||||
|
||||
While it’s easy to install Nvidia drivers in Linux Mint, occasionally, you might find something that does not work for your hardware.
|
||||
|
||||
If one driver version does not work, I’d suggest you to try other available versions for your Graphics Card and stick to the one that works. Unless you’re gaming and want the latest software/hardware compatibility, you don’t really need the latest Nvidia drivers installed.
|
||||
|
||||
Feel free to share your experiences with installing Nvidia drivers on Linux Mint in the comments down below.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/nvidia-linux-mint/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://linuxmint.com/
|
||||
[2]: https://itsfoss.com/best-linux-beginners/
|
||||
[3]: https://itsfoss.com/linux-mint-vs-ubuntu/
|
||||
[4]: https://github.com/linuxmint/mintdrivers
|
||||
[5]: https://nouveau.freedesktop.org/
|
||||
[6]: https://itsfoss.com/linux-gaming-guide/
|
||||
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/linux-mint-driver-manager.jpg?resize=800%2C548&ssl=1
|
||||
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/linux-mint-display-settings.jpg?resize=800%2C566&ssl=1
|
||||
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/linux-mint-no-driver.jpg?resize=593%2C299&ssl=1
|
||||
[10]: https://forums.linuxmint.com/viewtopic.php?p=1895521#p1895521
|
||||
[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/03/etc-modules-nvidia.jpg?resize=800%2C587&ssl=1
|
||||
[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/linux-mint-device-drivers-list.jpg?resize=800%2C506&ssl=1
|
||||
[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/nvidia-smi.jpg?resize=800%2C556&ssl=1
|
||||
[14]: https://download.nvidia.com/XFree86/Linux-x86_64/440.82/README/installdriver.html
|
@ -0,0 +1,89 @@
|
||||
[#]: subject: (Track your family calendar with a Raspberry Pi and a low-power display)
|
||||
[#]: via: (https://opensource.com/article/21/3/family-calendar-raspberry-pi)
|
||||
[#]: author: (Javier Pena https://opensource.com/users/jpena)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
Track your family calendar with a Raspberry Pi and a low-power display
|
||||
======
|
||||
Help everyone keep up with your family's schedule using open source
|
||||
tools and an E Ink display.
|
||||
![Calendar with coffee and breakfast][1]
|
||||
|
||||
Some families have a complex schedule: the kids have school and afterschool activities, you have important events you want to remember, everyone has multiple appointments, and so forth. While you can keep track of everything using your cellphone and an app, wouldn't it be better to have a large, low-power display at home to show your family's calendar? Meet the E Ink calendar!
|
||||
|
||||
![E Ink calendar][2]
|
||||
|
||||
(Javier Pena, [CC BY-SA 4.0][3])
|
||||
|
||||
### The hardware
|
||||
|
||||
The calendar started as a holiday project, so I tried to reuse as much as I could. This included a Raspberry Pi 2 that had been unused for too long. I did not have an E Ink display, so I had to buy it. Fortunately, I found a vendor that provided [open source drivers and examples][4] for its Raspberry Pi-ready screen, which is connected using some [GPIO][5] ports.
|
||||
|
||||
My family also wanted to switch between different calendars, and that required some form of input. Instead of adding a USB keyboard, I opted for a simpler solution and bought a 1x4 matrix keypad, similar to the one described in [this article][6]. This allowed me to connect the keypad to some GPIO ports in the Raspberry Pi.
|
||||
|
||||
Finally, I needed a photo frame to house the whole setup. It looks a bit messy on the back, but it gets the job done.
|
||||
|
||||
![Calendar internals][7]
|
||||
|
||||
(Javier Pena, [CC BY-SA 4.0][3])
|
||||
|
||||
### The software
|
||||
|
||||
I took inspiration from a [similar project][8] and started writing the Python code for my project. I needed to get data from two areas:
|
||||
|
||||
* Weather data, which I got from the [OpenWeather API][9]
|
||||
* Calendar data; I decided to use the [CalDav standard][10], which lets me connect to a calendar running on my home server
|
||||
|
||||
|
||||
|
||||
Since I had to wait for some parts to arrive, I used a modular approach for the input and display so that I could debug most of the code without the hardware. The calendar application supports drivers, and I wrote a [Pygame][11] driver to run it on a desktop PC.
|
||||
|
||||
The best part of writing the code was being able to reuse existing open source projects, so accessing the different APIs was easy. I could focus on the user interface—having per-person weekly and everyone daily calendars, allowing calendar selection using the keypad—and I had time to add some extra touches, like custom screen savers for special days.
|
||||
|
||||
![E Ink calendar screensaver][12]
|
||||
|
||||
(Javier Pena, [CC BY-SA 4.0][3])
|
||||
|
||||
The final integration step was making sure my calendar application would run on startup and be resilient to errors. I used a base [Raspberry Pi OS][13] image and installed the application as a systemd service so that it would survive failures and system restarts.
|
||||
|
||||
Once I finished everything, I uploaded the code [to GitHub][14]. So if you want to create a similar calendar, feel free to have a look and reuse it!
|
||||
|
||||
### The result
|
||||
|
||||
The calendar has become an everyday appliance in our kitchen. It helps us remember our daily activities, and even our kids use it to check their schedule before going to school.
|
||||
|
||||
On a personal note, the project helped me appreciate the _power of open_. Without open source drivers and libraries and open APIs, we would still be organizing our schedule with paper and a pen. Crazy, isn't it?
|
||||
|
||||
Need to keep your schedule straight? Learn how to do it using open source with these free...
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/3/family-calendar-raspberry-pi
|
||||
|
||||
作者:[Javier Pena][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/jpena
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/calendar-coffee.jpg?itok=9idm1917 (Calendar with coffee and breakfast)
|
||||
[2]: https://opensource.com/sites/default/files/uploads/calendar.jpg (E Ink calendar)
|
||||
[3]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[4]: https://github.com/waveshare/e-Paper
|
||||
[5]: https://opensource.com/article/19/3/gpio-pins-raspberry-pi
|
||||
[6]: https://www.instructables.com/1x4-Membrane-Keypad-w-Arduino/
|
||||
[7]: https://opensource.com/sites/default/files/uploads/calendar_internals.jpg (Calendar internals)
|
||||
[8]: https://github.com/zli117/EInk-Calendar
|
||||
[9]: https://openweathermap.org
|
||||
[10]: https://en.wikipedia.org/wiki/CalDAV
|
||||
[11]: https://github.com/pygame/pygame
|
||||
[12]: https://opensource.com/sites/default/files/uploads/calendar_screensaver.jpg (E Ink calendar screensaver)
|
||||
[13]: https://www.raspberrypi.org/software/
|
||||
[14]: https://github.com/javierpena/eink-calendar
|
@ -0,0 +1,111 @@
|
||||
[#]: subject: (6 open source tools for wedding planning)
|
||||
[#]: via: (https://opensource.com/article/21/3/open-source-wedding-planning)
|
||||
[#]: author: (Jessica Cherry https://opensource.com/users/cherrybomb)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
6 open source tools for wedding planning
|
||||
======
|
||||
Create the event of your dreams with open source software.
|
||||
![Outdoor wedding sign][1]
|
||||
|
||||
If I were to say I had planned on writing this article a year or so ago, I would be wrong. So, I'll give you a small amount of backstory about how this came to be.
|
||||
|
||||
On March 21st, I will be "getting married." I put that in quotes because I got married in Las Vegas on March 21, 2019. But I'm getting married again because my mom, who told us to elope, decided she was wrong and wanted a real wedding. So here I am, planning a wedding.
|
||||
|
||||
![Vegas wedding][2]
|
||||
|
||||
(Jess Cherry, [CC BY-SA 4.0][3])
|
||||
|
||||
Planning hasn't been smooth. We have moved the event twice due to the pandemic. My wedding planner got pregnant in the middle of it all, and since she's due in March, everything is now in my lap. About three-quarters of our invitations did not make it to their destinations because of weird mail issues, so we're sorting out our guests by text messages.
|
||||
|
||||
But all of my poor luck has led to this, a moment when I can share my list of open source tools that are helping me survive wedding planning, even at the last minute.
|
||||
|
||||
### Budgeting this whole thing
|
||||
|
||||
Let's talk about budgets. As seems to be typical, mine went above and beyond what I'd originally allocated. I chose [HomeBank][4], which I wrote about last year, so I am familiar with it.
|
||||
|
||||
I put all my wedding expenses in HomeBank as debts so that I could show my overall basic costs (not counting all the extra stuff I bought for the most expensive party I will ever throw). Once they are marked as debts, I can add a transaction and an income to it to pay for everything and keep track of what I owe.
|
||||
|
||||
Here's an example of what such a budgeting might look like in HomeBank.
|
||||
|
||||
![HomeBank][5]
|
||||
|
||||
(Jess Cherry, [CC BY-SA 4.0][3])
|
||||
|
||||
### Keep track of invitations and guests
|
||||
|
||||
I did not have a proper guest list at the outset, so I needed a way to manage my guests. I went with [LibreOffice Calc][6], because everyone needs sheets with counts and plans. Here is an example of what I ended up with. I used it to tally up numbers, so I could move on to planning how many tables I needed at the party. I summed the number of guests at the bottom of Column B to get the total.
|
||||
|
||||
![LibreOffice Calc][7]
|
||||
|
||||
(Jess Cherry, [CC BY-SA 4.0][3])
|
||||
|
||||
### Table time
|
||||
|
||||
Certain venues, like mine, require you to provide table arrangements a month before the event so that they can be prepared for the right amount of settings and silverware. And drinks, because that's important to have for dancing and whatnot.
|
||||
|
||||
The venue gave me a PDF for my table setup, but I decided to use [LibreOffice Draw][8] instead because I had an extra table I didn't need, and my counts were off due to our original guest list dropping considerably. But here's my drawing of where I want the tables to be (including the table I tossed due to our lower number of guests).
|
||||
|
||||
![LibreOffice Draw][9]
|
||||
|
||||
(Jess Cherry, [CC BY-SA 4.0][3])
|
||||
|
||||
### How about a timeline?
|
||||
|
||||
One of the major pieces of event planning is having a timeline for the day to make sure everything goes according to plan. Spoiler alert: I can promise mine won't. I asked Opensource.com's productivity expert [Kevin Sonney][10] for help finding something to help me outline the big day and the rehearsal dinner the day before.
|
||||
|
||||
I have two problems. One, I need to share the timeline with multiple people. Two, those people do not do computers for a living, like we do, so a heavily command-line option wouldn't work. I selected something Kevin wrote about in his [productivity article series][11] this year: KDE Plasma Kontact's [KOrganizer][12] using the timeline mode. I stacked an entire day into one timeline and produced this fancy set of blocks. (Don't mind this looking weird; it's a first draft.)
|
||||
|
||||
![KOrganizer][13]
|
||||
|
||||
(Jess Cherry, [CC BY-SA 4.0][3])
|
||||
|
||||
I also suggest keeping everything on your to-do lists inside KOrganizer, so you don't get lost while you're working through everything. Best of all, if you need to export all of this information and put it somewhere like a popular, regularly used application (e.g., Google, because well, it's Google), it exports and imports well.
|
||||
|
||||
### Open source wedding tools for the pandemic
|
||||
|
||||
OK, so before we all rush to judgment on this, I am aware we're still in the middle of a pandemic. The wedding planning started forever ago, and guess when the pandemic started. March… It all started in March of last year. That should tell you exactly how my plans have been going.
|
||||
|
||||
In case you are wondering about my backup plan (since nearly three-quarters of the original guest list can't attend), the plan is to livestream this show. This leads me to two different conversations. One, I believe this is the future of weddings because it's cool to show everyone in your life this amazing moment, so from now on, wedding planners will have to add this to their services list, pandemic or not.
|
||||
|
||||
Two, how can I achieve this goal of livestreaming the whole event? That's easy: I have a laptop and a camera, the DJ has clip-on microphones, and a bunch of cool people write about livestreaming all the time. [Seth Kenlon][14] wrote an entire article on [live streaming with OBS][15], so I can just walk through everything about a week before and share it out. If I decide to edit and publish the video, [Don Watkins][16] gave a great walkthrough of [Kaltura][17] to get me through the post-wedding things.
|
||||
|
||||
### Final thoughts
|
||||
|
||||
If you are good with open source software and organizing, you can be the wedding planner of anyone's dreams, or you can just plan your own wedding and stay organized. I would give bonus points to anyone who can get all of this running on a [Raspberry Pi 400][18] because that would be the easiest way to have everything with you in a package that's smaller than a laptop.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/3/open-source-wedding-planning
|
||||
|
||||
作者:[Jessica Cherry][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/cherrybomb
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/wedding-sign.jpg?itok=e3zagA4b (Outdoor wedding sign)
|
||||
[2]: https://opensource.com/sites/default/files/uploads/wedding.jpg (Vegas wedding)
|
||||
[3]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[4]: https://opensource.com/article/20/2/open-source-homebank
|
||||
[5]: https://opensource.com/sites/default/files/uploads/homebank.png (HomeBank)
|
||||
[6]: https://www.libreoffice.org/discover/calc/
|
||||
[7]: https://opensource.com/sites/default/files/uploads/libreofficecalc.png (LibreOffice Calc)
|
||||
[8]: https://www.libreoffice.org/discover/draw/
|
||||
[9]: https://opensource.com/sites/default/files/uploads/libreofficedraw.png (LibreOffice Draw)
|
||||
[10]: https://opensource.com/users/ksonney
|
||||
[11]: https://opensource.com/article/21/1/kde-kontact
|
||||
[12]: https://kontact.kde.org/components/korganizer.html
|
||||
[13]: https://opensource.com/sites/default/files/uploads/kontact-korganizer.png (KOrganizer)
|
||||
[14]: https://opensource.com/users/seth
|
||||
[15]: https://opensource.com/article/20/4/open-source-live-stream
|
||||
[16]: https://opensource.com/users/don-watkins
|
||||
[17]: https://opensource.com/article/18/9/kaltura-video-editing
|
||||
[18]: https://www.raspberrypi.org/products/raspberry-pi-400/
|
@ -0,0 +1,151 @@
|
||||
[#]: subject: (Cast your Android device with a Raspberry Pi)
|
||||
[#]: via: (https://opensource.com/article/21/3/android-raspberry-pi)
|
||||
[#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
Cast your Android device with a Raspberry Pi
|
||||
======
|
||||
Use Scrcpy to turn your phone screen into an app running alongside your
|
||||
applications on a Raspberry Pi or any other Linux-based device.
|
||||
![A person looking at a phone][1]
|
||||
|
||||
It's hard to stay away from the gadgets we use on a daily basis. In the hustle and bustle of modern life, I want to make sure I don't miss out on the important notifications from friends and family that pop up on my phone screen. I'm also busy and do not want to get lost in distractions, and picking up a phone and replying to messages tends to be distracting.
|
||||
|
||||
To further complicate matters, there are a lot of devices out there. Luckily, most of them, from powerful workstations to laptops and even the humble Raspberry Pi, can run Linux. Because they run Linux, almost every solution I find for one device is a perfect fit for the others.
|
||||
|
||||
### One size fits all
|
||||
|
||||
I wanted a way to unify the different sources of data in my life on whatever screen I am staring at.
|
||||
|
||||
I decided to solve this problem by copying my phone's screen onto my computer. In essence, I made my phone into an app running alongside all of my other applications. This helps me keep my attention on my desktop, prevents me from mentally wandering away, and makes it easier for me to reply to urgent notifications.
|
||||
|
||||
Sound appealing? Here's how you can do it too.
|
||||
|
||||
### Set up Scrcpy
|
||||
|
||||
[Scrcpy][2], commonly known as Screen Copy, is an open source screen-mirroring tool that displays and controls Android devices from Linux, Windows, or macOS. Communication between the Android device and the computer is primarily done over a USB connection and Android Debug Bridge (ADB). It uses TCP/IP and does not require any root access.
|
||||
|
||||
Scrcpy's setup and configuration are very easy. If you're running Fedora, you can install it from a Copr repository:
|
||||
|
||||
|
||||
```
|
||||
$ sudo dnf copr enable zeno/scrcpy
|
||||
$ sudo dnf install scrcpy -y
|
||||
```
|
||||
|
||||
On Debian or Ubuntu:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo apt install scrcpy`
|
||||
```
|
||||
|
||||
You can also compile scrcpy yourself. It doesn't take long to build, even on a Raspberry Pi, using the instructions on [scrcpy's GitHub page][3].
|
||||
|
||||
### Set up the phone
|
||||
|
||||
Once scrcpy is installed, you must enable USB debugging and authorize each device (your Raspberry Pi, laptop, or workstation) as a trusted controller.
|
||||
|
||||
Open the **Settings** app on your Android and scroll down to **Developer options.** If Developer options is not activated, follow Android's [instructions to unlock it][4].
|
||||
|
||||
Next, enable **USB debugging**.
|
||||
|
||||
![Enable USB Debugging option][5]
|
||||
|
||||
(Sudeshna Sur, [CC BY-SA 4.0][6])
|
||||
|
||||
Then connect the phone to your Raspberry Pi or laptop (or whatever device you're using) over USB and set the mode to [PTP][7], if that's an option. If your phone doesn't use PTP, set the mode your phone uses for transferring files (rather than, for instance, serving as a tethering or MIDI device).
|
||||
|
||||
Your phone will probably prompt you to authorize your computer, identified by its RSA fingerprint. You only have to do this the first time you connect; after that, your phone will recognize and trust your computer.
|
||||
|
||||
Confirm the setting with the `lsusb` command:
|
||||
|
||||
|
||||
```
|
||||
$ lsusb
|
||||
Bus 007 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
|
||||
Bus 011 Device 004: ID 046d:c21d Logitech, Inc. F310 Gamepad
|
||||
Bus 005 Device 005: ID 0951:1666 Kingston Technology DataTraveler G4
|
||||
Bus 005 Device 004: ID 05e3:0608 Genesys Logic, Inc. Hub
|
||||
Bus 004 Device 001: ID 18d1:4ee6 Google Inc. Nexus/Pixel Device (PTP + debug)
|
||||
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
|
||||
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
|
||||
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
|
||||
```
|
||||
|
||||
Then execute `$ scrcpy` to launch it with the default settings.
|
||||
|
||||
![Scrcpy running on a Raspberry Pi][8]
|
||||
|
||||
(Opensource.com, [CC BY-SA 4.0][6])
|
||||
|
||||
Performance and responsiveness vary depending on what device you're using to control your mobile. On a Pi, some of the animations can be slow, and even the response sometimes lags. Scrcpy provides an easy fix for this: Reducing the bitrate and resolution of the image scrcpy displays makes it easier for your computer to keep up. Do this with:
|
||||
|
||||
|
||||
```
|
||||
`$ scrcpy --bit-rate 1M --max-size 800`
|
||||
```
|
||||
|
||||
Try different values to find the one you prefer. To make it easier to type, once you've settled on a command, consider [making your own Bash alias][9].
|
||||
|
||||
### Cut the cord
|
||||
|
||||
Once scrcpy is running, you can even connect your mobile and your computer over WiFi. The scrcpy installation process also installs `adb`, a command to communicate with Android devices. Scrcpy also uses this command to communicate with your device and `adb` can connect over TCP/IP.
|
||||
|
||||
![Scrcpy running on a computer][10]
|
||||
|
||||
(Sudeshna Sur, [CC BY-SA 4.0][6])
|
||||
|
||||
To try it, make sure your phone is connected over WiFi on the same wireless network your computer is using. Do NOT disconnect your phone from USB yet!
|
||||
|
||||
Next, get your phone's IP address by navigating to **Settings** and selecting **About phone**. Look at the **Status** option to get your address. It usually starts with 192.168 or 10.
|
||||
|
||||
Alternately, you can get your mobile's IP address using `adb`:
|
||||
|
||||
|
||||
```
|
||||
$ adb shell ip route | awk '{print $9}'
|
||||
|
||||
To connect to your device over WiFi, you must enable TCP/IP connections. This, you must do through the adb command:
|
||||
$ adb tcpip 5555
|
||||
Now you can disconnect your mobile from USB.
|
||||
Whenever you want to connect over WiFi, first connect to the mobile with the command adb connect. For instance, assuming my mobile's IP address is 10.1.1.22, the command is:
|
||||
$ adb connect 10.1.1.22:5555
|
||||
```
|
||||
|
||||
Once it's connected, you can run scrcpy as usual.
|
||||
|
||||
### Remote control
|
||||
|
||||
Scrcpy is easy to use. You can try it in a terminal or as [a GUI application][11].
|
||||
|
||||
Do you use another screen-mirroring application? If so, let us know about it in the comments.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/3/android-raspberry-pi
|
||||
|
||||
作者:[Sudeshna Sur][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/sudeshna-sur
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/idea_innovation_mobile_phone.png?itok=RqVtvxkd (A person looking at a phone)
|
||||
[2]: https://github.com/Genymobile/scrcpy
|
||||
[3]: https://github.com/Genymobile/scrcpy/blob/master/BUILD.md
|
||||
[4]: https://developer.android.com/studio/debug/dev-options
|
||||
[5]: https://opensource.com/sites/default/files/uploads/usb-debugging.jpg (Enable USB Debugging option)
|
||||
[6]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[7]: https://en.wikipedia.org/wiki/Picture_Transfer_Protocol
|
||||
[8]: https://opensource.com/sites/default/files/uploads/scrcpy-pi.jpg (Scrcpy running on a Raspberry Pi)
|
||||
[9]: https://opensource.com/article/19/7/bash-aliases
|
||||
[10]: https://opensource.com/sites/default/files/uploads/ssur-desktop.png (Scrcpy running on a computer)
|
||||
[11]: https://opensource.com/article/19/9/mirror-android-screen-guiscrcpy
|
@ -0,0 +1,206 @@
|
||||
[#]: subject: (How to use Poetry to manage your Python projects on Fedora)
|
||||
[#]: via: (https://fedoramagazine.org/how-to-use-poetry-to-manage-your-python-projects-on-fedora/)
|
||||
[#]: author: (Kader Miyanyedi https://fedoramagazine.org/author/moonkat/)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
How to use Poetry to manage your Python projects on Fedora
|
||||
======
|
||||
|
||||
![Python & Poetry on Fedora][1]
|
||||
|
||||
Python developers often create a new virtual environment to separate project dependencies and then manage them with tools such as _pip, pipenv, etc._ Poetry is a tool for simplifying dependency management and packaging in Python. This post will show you how to use Poetry to manage your Python projects on Fedora.
|
||||
|
||||
Unlike other tools, Poetry uses only a single configuration file for dependency management, packaging, and publishing. This eliminates the need for different files such as _Pipfile, MANIFEST.in, setup.py_, etc. It is also faster than **using multiple tools.
|
||||
|
||||
Detailed below is a brief overview of commands used when getting started with Poetry.
|
||||
|
||||
### **Installing Poetry on Fedora**
|
||||
|
||||
If you already use Fedora 32 or above, you can install Poetry directly from the command line using this command:
|
||||
|
||||
```
|
||||
$ sudo dnf install poetry
|
||||
```
|
||||
|
||||
```
|
||||
Editor note: on Fedora Silverblue or CoreOs Python 3.9.2 is part of the core commit, you would layer Poetry with '
|
||||
```
|
||||
|
||||
rpm-ostree install poetry
|
||||
|
||||
```
|
||||
'
|
||||
```
|
||||
|
||||
### Initialize a project
|
||||
|
||||
Create a new project using the _new_ command.
|
||||
|
||||
```
|
||||
$ poetry new poetry-project
|
||||
```
|
||||
|
||||
The structure of a project created with Poetry looks like this:
|
||||
|
||||
```
|
||||
├── poetry_project
|
||||
│ └── init.py
|
||||
├── pyproject.toml
|
||||
├── README.rst
|
||||
└── tests
|
||||
├── init.py
|
||||
└── test_poetry_project.py
|
||||
```
|
||||
|
||||
Poetry uses _pyproject.toml_ to manage the dependencies of your project. Initially, this file will look similar to this:
|
||||
|
||||
```
|
||||
[tool.poetry]
|
||||
name = "poetry-project"
|
||||
version = "0.1.0"
|
||||
description = ""
|
||||
authors = ["Kadermiyanyedi <kadermiyanyedi@hotmail.com>"]
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.9"
|
||||
|
||||
[tool.poetry.dev-dependencies]
|
||||
pytest = "^5.2"
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry>=0.12"]
|
||||
build-backend = "poetry.masonry.api"
|
||||
```
|
||||
|
||||
This file contains 4 sections:
|
||||
|
||||
* The first section contains information describing the project such as project name, project version, etc.
|
||||
* The second section contains project dependencies. These dependencies are necessary to build the project.
|
||||
* The third section contains development dependencies.
|
||||
* The fourth section describes a building system as in [PEP 517][2]
|
||||
|
||||
|
||||
|
||||
If you already have a project, or create your own project folder, and you want to use poetry, run the _init_ command within your project.
|
||||
|
||||
```
|
||||
$ poetry init
|
||||
```
|
||||
|
||||
After this command, you will see an interactive shell to configure your project.
|
||||
|
||||
### Create a virtual environment
|
||||
|
||||
If you want to create a virtual environment or activate an existing virtual environment, use the command below:
|
||||
|
||||
```
|
||||
$ poetry shell
|
||||
```
|
||||
|
||||
Poetry creates the virtual environment in the _/home/username/.cache/pypoetry_ project by default. You can change the default path by editing the poetry config. Use the command below to see the config list:
|
||||
|
||||
```
|
||||
$ poetry config --list
|
||||
|
||||
cache-dir = "/home/username/.cache/pypoetry"
|
||||
virtualenvs.create = true
|
||||
virtualenvs.in-project = true
|
||||
virtualenvs.path = "{cache-dir}/virtualenvs"
|
||||
```
|
||||
|
||||
Change the _virtualenvs.in-project_ configuration variable to create a virtual environment within your project directory. The Poetry command is:
|
||||
|
||||
```
|
||||
$ poetry config virtualenv.in-project true
|
||||
```
|
||||
|
||||
### Add dependencies
|
||||
|
||||
Install a dependency for the project with the _poetry add_ command.
|
||||
|
||||
```
|
||||
$ poetry add django
|
||||
```
|
||||
|
||||
You can identify any dependencies that you use only for the development environment using the _add_ command with the _–dev_ option.
|
||||
|
||||
```
|
||||
$ poetry add black --dev
|
||||
```
|
||||
|
||||
The **add** command creates a _poetry.lock file_ that is used to track package versions. If the _poetry.lock_ file doesn’t exist, the latest versions of all dependencies in _pyproject.toml_ are installed. If _poetry.lock_ does exist, Poetry uses the exact versions listed in the file to ensure that the package versions are consistent for everyone working on your project.
|
||||
|
||||
Use the poetry _install_ command to install all dependencies in your current project.
|
||||
|
||||
```
|
||||
$ poetry install
|
||||
```
|
||||
|
||||
Prevent development dependencies from being installed by using the _no-dev_ option.
|
||||
|
||||
```
|
||||
$ poetry install --no-dev
|
||||
```
|
||||
|
||||
### List packages
|
||||
|
||||
The _show_ command lists all of the available packages. The _tree_ option will list packages as a tree.
|
||||
|
||||
```
|
||||
$ poetry show --tree
|
||||
|
||||
django 3.1.7 A high-level Python Web framework that encourages rapid development and clean, pragmatic design.
|
||||
├── asgiref >=3.2.10,<4
|
||||
├── pytz *
|
||||
└── sqlparse >=0.2.2
|
||||
```
|
||||
|
||||
Include the package name to list details of a specific package.
|
||||
|
||||
```
|
||||
$ poetry show requests
|
||||
|
||||
name : requests
|
||||
version : 2.25.1
|
||||
description : Python HTTP for Humans.
|
||||
|
||||
dependencies
|
||||
- certifi >=2017.4.17
|
||||
- chardet >=3.0.2,<5
|
||||
- idna >=2.5,<3
|
||||
- urllib3 >=1.21.1,<1.27
|
||||
```
|
||||
|
||||
Finally, if you want to learn the latest version of the packages, you can pass the _latest_ option.
|
||||
|
||||
```
|
||||
$ poetry show --latest
|
||||
|
||||
idna 2.10 3.1 Internationalized Domain Names in Applications
|
||||
asgiref 3.3.1 3.3.1 ASGI specs, helper code, and adapters
|
||||
```
|
||||
|
||||
### Further information
|
||||
|
||||
More details on Poetry are available in the [documentation][3].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/how-to-use-poetry-to-manage-your-python-projects-on-fedora/
|
||||
|
||||
作者:[Kader Miyanyedi][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://fedoramagazine.org/author/moonkat/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2021/03/Poetry_Python-816x345.jpg
|
||||
[2]: https://www.python.org/dev/peps/pep-0517/
|
||||
[3]: https://python-poetry.org/docs/
|
@ -0,0 +1,276 @@
|
||||
[#]: subject: (Collect sensor data with your Raspberry Pi and open source tools)
|
||||
[#]: via: (https://opensource.com/article/21/3/sensor-data-raspberry-pi)
|
||||
[#]: author: (Peter Czanik https://opensource.com/users/czanik)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
Collect sensor data with your Raspberry Pi and open source tools
|
||||
======
|
||||
Learning more about what is going on in your home is not just useful;
|
||||
it's fun!
|
||||
![Working from home at a laptop][1]
|
||||
|
||||
I have lived in 100-plus-year-old brick houses for most of my life. They look nice, they are comfortable, and usually, they are not too expensive. However, humidity is high in the winter in my climate, and mold is a recurring problem. A desktop thermometer that displays relative humidity is useful for measuring it, but it does not provide continuous monitoring.
|
||||
|
||||
In comes the Raspberry Pi: It is small, inexpensive, and has many sensor options, including temperature and relative humidity. It can collect data around the clock, do some alerting, and forward data for analysis.
|
||||
|
||||
Recently, I participated in an experiment by [miniNodes][2] to collect and process environmental data on an all-[Arm][3] network of computers. One of my network's nodes was a [Raspberry Pi][4] that collected environmental data above my desk. Once the project was over, I was allowed to keep the hardware and play with it. This became my winter holiday project. Learning [Python][5] or [Elasticsearch][6] just to know more about them is boring. Having a practical project that utilizes these technologies is not just useful but also makes learning fun.
|
||||
|
||||
Originally, I planned to utilize only these two technologies. Unfortunately, my good old Arm "server," an [OverDrive 1000][7] machine for developers, and my Xeon server are too loud for continuous use above my desk. I turn them on only when I need them, which means some kind of buffering is necessary when the servers are offline. Implementing buffering for Elasticsearch as a beginner Python coder looked a bit difficult. Luckily, I know a tool that can buffer data and send it to Elasticsearch: [syslog-ng][8].
|
||||
|
||||
### A note about licensing
|
||||
|
||||
Elastic, the maintainer of Elasticsearch, has recently changed the project's license from the Apache License, an extremely permissive license approved by the Open Source Initiative, to a more restrictive license "[to protect our products and brand from abuse][9]." The term "abuse" in this context refers to the tendency of companies using Elasticsearch and Kibana and providing them to customers directly as a service without collaborating with Elastic or the Elastic community (a common critique of permissive licenses). It's still unclear how this affects users, but it's an important discussion for the open source community to have, especially as cloud services become more and more common.
|
||||
|
||||
To keep your project open source, use Elasticsearch version 7.10 under the Apache License.
|
||||
|
||||
### Configure data collection
|
||||
|
||||
For data collection, I have a [Raspberry Pi Model 3B+][10] with the latest Raspberry Pi OS version and a set of sensors from [SparkFun][11] connected to a [Qwiic pHat][12] add-on board (this board has been discontinued, but there are more recent boards that provide the same functionality). Since monitoring GPS does not make much sense with a fixed location and there is no lightning to detect during the winter, I connected only the environmental sensor. You can collect data from the sensor using [Python scripts available on GitHub][13].
|
||||
|
||||
Install the Python modules locally as a user:
|
||||
|
||||
|
||||
```
|
||||
`pip3 install sparkfun-qwiic-bme280`
|
||||
```
|
||||
|
||||
There are three example scripts you can use to check data collection. You can download them using your browser or Git:
|
||||
|
||||
|
||||
```
|
||||
`git clone https://github.com/sparkfun/Qwiic_BME280_Py/`
|
||||
```
|
||||
|
||||
When you start the script, it will print data in a nice, human-readable format:
|
||||
|
||||
|
||||
```
|
||||
pi@raspberrypi:~/Documents/Qwiic_BME280_Py/examples $ python3 qwiic_bme280_ex1.py
|
||||
|
||||
SparkFun BME280 Sensor Example 1
|
||||
|
||||
Humidity: 58.396
|
||||
Pressure: 128911.984
|
||||
Altitude: -6818.388
|
||||
Temperature: 70.43
|
||||
|
||||
Humidity: 58.390
|
||||
Pressure: 128815.051
|
||||
Altitude: -6796.598
|
||||
Temperature: 70.41
|
||||
|
||||
^C
|
||||
Ending Example 1
|
||||
```
|
||||
|
||||
I am from Europe, so the default temperature data did not make much sense to me. Luckily, you can easily rewrite the code to use the metric system: just replace `temperature_fahrenheit` with `temperature_celsius`. Pressure and altitude showed some crazy values, even when I changed to the metric system, but I did not debug them. The humidity and temperature values were pretty close to what I expected (based on my desktop thermometer).
|
||||
|
||||
Once I verified that the relevant sensors work as expected, I started to develop my own code. It is pretty simple. First, I made sure that it printed values every second to the terminal, then I added syslog support:
|
||||
|
||||
|
||||
```
|
||||
#!/usr/bin/python3
|
||||
|
||||
import qwiic_bme280
|
||||
import time
|
||||
import sys
|
||||
import syslog
|
||||
|
||||
# initialize sensor
|
||||
sensor = qwiic_bme280.QwiicBme280()
|
||||
if sensor.connected == False:
|
||||
print("Sensor not connected. Exiting")
|
||||
sys.exit(1)
|
||||
sensor.begin()
|
||||
|
||||
# collect and log time, humidity and temperature
|
||||
while True:
|
||||
t = time.localtime()
|
||||
current_time = time.strftime("%H:%M:%S", t)
|
||||
current_humidity = sensor.humidity
|
||||
current_temperature = sensor.temperature_celsius
|
||||
print("time={} humidity={} temperature={}".format(current_time,current_humidity,current_temperature))
|
||||
message = "humidity=" + str(current_humidity) + " temperature=" + str(current_temperature)
|
||||
syslog.syslog(message)
|
||||
time.sleep(1)
|
||||
```
|
||||
|
||||
As I start the Python script using the [screen][14] utility, I also print data to the terminal. Check if the collected data arrives into syslog-ng using the `tail` command:
|
||||
|
||||
|
||||
```
|
||||
pi@raspberrypi:~ $ tail -3 /var/log/messages
|
||||
Jan 5 12:11:24 raspberrypi sensor2syslog_v2.py[6213]: humidity=58.294921875 temperature=21.4
|
||||
Jan 5 12:11:25 raspberrypi sensor2syslog_v2.py[6213]: humidity=58.294921875 temperature=21.4
|
||||
Jan 5 12:11:26 raspberrypi sensor2syslog_v2.py[6213]: humidity=58.294921875 temperature=21.39
|
||||
```
|
||||
|
||||
### Configure Elasticsearch
|
||||
|
||||
The 1GB RAM in my Pi 3B+ is way too low to run Elasticsearch and [Kibana][15], so I host them on a second machine. [Installing Elasticsearch and Kibana][16] is different on every platform, so I will not cover that. What I will cover is mapping. By default, syslog-ng sends all data as text. If you want to prepare nice graphs in Kibana, you need temperature and humidity values as floating-point numbers.
|
||||
|
||||
You need to set up mapping before sending data from syslog-ng. The syslog-ng configuration expects that the Sensors index uses this mapping:
|
||||
|
||||
|
||||
```
|
||||
{
|
||||
"mappings": {
|
||||
"_doc": {
|
||||
"properties": {
|
||||
"@timestamp": {
|
||||
"type": "date"
|
||||
},
|
||||
"sensors": {
|
||||
"properties": {
|
||||
"humidity": {
|
||||
"type": "float"
|
||||
},
|
||||
"temperature": {
|
||||
"type": "float"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Elasticsearch is now ready to collect data from syslog-ng.
|
||||
|
||||
### Install and configure syslog-ng
|
||||
|
||||
Version 3.19 of syslog-ng is included in Raspberry Pi OS, but it does not yet have Elasticsearch support. Therefore, I installed the latest version of syslog-ng from an unofficial repository. First, I added the repository key:
|
||||
|
||||
|
||||
```
|
||||
`wget -qO - https://download.opensuse.org/repositories/home:/laszlo_budai:/syslog-ng/Raspbian_10/Release.key | sudo apt-key add -`
|
||||
```
|
||||
|
||||
Then I added the following line to `/etc/apt/sources.list.d/sng.list`:
|
||||
|
||||
|
||||
```
|
||||
`deb https://download.opensuse.org/repositories/home:/laszlo_budai:/syslog-ng/Raspbian_10/ ./`
|
||||
```
|
||||
|
||||
Finally, I updated the repositories and installed the necessary syslog-ng packages (which also removed rsyslog from the system):
|
||||
|
||||
|
||||
```
|
||||
apt-get update
|
||||
apt-get install syslog-ng-mod-json syslog-ng-mod-http
|
||||
```
|
||||
|
||||
There are many other syslog-ng subpackages, but only these two are needed to forward sensor logs to Elasticsearch.
|
||||
|
||||
Syslog-ng's main configuration file is `/etc/syslog-ng/syslog-ng.conf`, and you do not need to modify it. You can extend the configuration by creating new text files with a `.conf` extension under the `/etc/syslog-ng/conf.d` directory.
|
||||
|
||||
I created a file called `sens2elastic.conf` with the following content:
|
||||
|
||||
|
||||
```
|
||||
filter f_sensors {program("sensor2syslog_v2.py")};
|
||||
parser p_kv {kv-parser(prefix("sensors."));};
|
||||
destination d_sensors {
|
||||
file("/var/log/sensors" template("$(format-json @timestamp=${ISODATE} --key sensors.*)\n\n"));
|
||||
elasticsearch-http(
|
||||
index("sensors")
|
||||
type("")
|
||||
url("<http://192.168.1.129:9200/\_bulk>")
|
||||
template("$(format-json @timestamp=${ISODATE} --key sensors.*)")
|
||||
disk-buffer(
|
||||
disk-buf-size(1G)
|
||||
reliable(no)
|
||||
dir("/tmp/disk-buffer")
|
||||
)
|
||||
);
|
||||
};
|
||||
log {
|
||||
source(s_src);
|
||||
filter(f_sensors);
|
||||
parser(p_kv);
|
||||
destination(d_sensors);
|
||||
};
|
||||
```
|
||||
|
||||
If you are new to syslog-ng, read my article about [syslog-ng's building blocks][17] to learn about syslog-ng's configuration. The configuration snippet above shows some of the possible building blocks, except for the source, as you need to use the local log source defined in `syslog-ng.conf` (`s_src`).
|
||||
|
||||
The first line is a filter: it matches the program name. Mine is `sensor2syslog_v2.py`. Make sure this value is the same as the name of your Python script.
|
||||
|
||||
The second line is a key-value parser. By default, syslog-ng treats the message part of incoming log messages as plain text. Using this parser, you can create name-value pairs within syslog-ng from data in the log messages that you can use later when sending logs to Elasticsearch.
|
||||
|
||||
The next block is a bit larger. It is a destination containing two different destination drivers. The first driver saves logs to a local file in JSON format. I use this for debugging. The second driver is the Elasticsearch destination. Make sure that the index name and the URL match your environment. Using this large disk buffer, you can ensure you don't lose any data even if your Elasticsearch server is offline for days.
|
||||
|
||||
The last block is a bit different. It is the log statement, the part of the configuration that connects the above building blocks. The name of the source comes from the main configuration.
|
||||
|
||||
Save the configuration and create the `/tmp/disk-buffer/` directory. Reload syslog-ng to make the configuration live:
|
||||
|
||||
|
||||
```
|
||||
`systemctl restart syslog-ng`
|
||||
```
|
||||
|
||||
### Test the system
|
||||
|
||||
The next step is to test the system. Elasticsearch is already running and prepared to receive data. Syslog-ng is configured to forward data to Elasticsearch. So, start the script to make sure data is actually collected.
|
||||
|
||||
For a quick test, you can start it in a terminal window. For continuous data collection, I recommend starting it from the screen utility so that it keeps running even after you disconnect from the machine. Of course, this is not fail-safe, as it will not start "automagically" on a reboot. If you want to collect data 24/7, create an init script or a systemd service file for it.
|
||||
|
||||
Check that logs arrive in the `/var/log/sensors` file. If it is not empty, then the filter is working as expected. Next, open Kibana. I cannot give exact instructions here, as the menu structure seems to change with each release. Create an index pattern for Kibana from the Sensors index, then change to Kibana's Discover mode, and select the freshly defined index. You should already see incoming temperature and humidity data on the screen.
|
||||
|
||||
You are now ready to visualize data. I used Kibana's new [Lens][18] mode to visualize temperature and humidity values. While it is not very flexible, it is definitely easier to handle than the other visualization tools in Kibana. This diagram shows the data I collected, including how values change when I ventilate my room with fresh, cold air by opening my windows.
|
||||
|
||||
![Graph of sensor data in Kibana Lens][19]
|
||||
|
||||
(Peter Czanik, [CC BY-SA 4.0][20])
|
||||
|
||||
### What have I learned?
|
||||
|
||||
My original goal was to monitor my home's relative humidity while brushing up on my Python and Elasticsearch skills. Even staying at basic levels, I now feel more comfortable working with Python and Elasticsearch.
|
||||
|
||||
Best of all: Not only did I practice these tools, but I also learned about relative humidity from the graphs. Previously, I often ventilated my home by opening the windows for just one or two minutes. The Kibana graphs showed that humidity went back to the original levels quite quickly after I shut the windows. When I opened the windows for five to 10 minutes instead, humidity stayed low for many hours.
|
||||
|
||||
### What's next?
|
||||
|
||||
The more adventurous can use a Raspberry Pi and sensors not just to monitor but also to control their homes. I configured everything from the ground up, but there are ready-to-use tools available such as [Home Assistant][21]. You can also configure alerting in syslog-ng to do things like [sending an alert to your Slack channel][22] if the temperature drops below a set level. There are many sensors available for the Raspberry Pi, so there are countless possibilities on both the software and hardware side.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/3/sensor-data-raspberry-pi
|
||||
|
||||
作者:[Peter Czanik][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/czanik
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/wfh_work_home_laptop_work.png?itok=VFwToeMy (Working from home at a laptop)
|
||||
[2]: https://www.mininodes.com/
|
||||
[3]: https://www.arm.com/
|
||||
[4]: https://opensource.com/resources/raspberry-pi
|
||||
[5]: https://opensource.com/tags/python
|
||||
[6]: https://www.elastic.co/elasticsearch/
|
||||
[7]: https://softiron.com/blog/news_20160624/
|
||||
[8]: https://www.syslog-ng.com/products/open-source-log-management/
|
||||
[9]: https://www.elastic.co/pricing/faq/licensing
|
||||
[10]: https://www.raspberrypi.org/products/raspberry-pi-3-model-b-plus/
|
||||
[11]: https://www.sparkfun.com/
|
||||
[12]: https://www.sparkfun.com/products/retired/15351
|
||||
[13]: https://github.com/sparkfun/Qwiic_BME280_Py/
|
||||
[14]: https://www.gnu.org/software/screen/
|
||||
[15]: https://www.elastic.co/kibana
|
||||
[16]: https://opensource.com/article/19/7/install-elasticsearch-and-kibana-linux
|
||||
[17]: https://www.syslog-ng.com/community/b/blog/posts/building-blocks-of-syslog-ng
|
||||
[18]: https://www.elastic.co/kibana/kibana-lens
|
||||
[19]: https://opensource.com/sites/default/files/uploads/kibanalens_data.png (Graph of sensor data in Kibana Lens)
|
||||
[20]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[21]: https://www.home-assistant.io/
|
||||
[22]: https://www.syslog-ng.com/community/b/blog/posts/send-your-log-messages-to-slack
|
@ -0,0 +1,167 @@
|
||||
[#]: subject: (Learn Python dictionary values with Jupyter)
|
||||
[#]: via: (https://opensource.com/article/21/3/dictionary-values-python)
|
||||
[#]: author: (Lauren Maffeo https://opensource.com/users/lmaffeo)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
Learn Python dictionary values with Jupyter
|
||||
======
|
||||
Implementing data structures with dictionaries helps you access
|
||||
information more quickly.
|
||||
![Hands on a keyboard with a Python book ][1]
|
||||
|
||||
Dictionaries are the Python programming language's way of implementing data structures. A Python dictionary consists of several key-value pairs; each pair maps the key to its associated value.
|
||||
|
||||
For example, say you're a teacher who wants to match students' names to their grades. You could use a Python dictionary to map the keys (names) to their associated values (grades).
|
||||
|
||||
If you need to find a specific student's grade on an exam, you can access it from your dictionary. This lookup shortcut should save you time over parsing an entire list to find the student's grade.
|
||||
|
||||
This article shows you how to access dictionary values through each value's key. Before you begin the tutorial, make sure you have the [Anaconda package manager][2] and [Jupyter Notebook][3] installed on your machine.
|
||||
|
||||
### 1\. Open a new notebook in Jupyter
|
||||
|
||||
Begin by opening Jupyter and running it in a tab in your web browser. Then:
|
||||
|
||||
1. Go to **File** in the top-left corner.
|
||||
2. Select **New Notebook**, then **Python 3**.
|
||||
|
||||
|
||||
|
||||
![Create Jupyter notebook][4]
|
||||
|
||||
(Lauren Maffeo, [CC BY-SA 4.0][5])
|
||||
|
||||
Your new notebook starts off untitled, but you can rename it anything you'd like. I named mine **OpenSource.com Data Dictionary Tutorial**.
|
||||
|
||||
The line number you see in your new Jupyter notebook is where you will write your code. (That is, your input.)
|
||||
|
||||
On macOS, you'll hit **Shift** then **Return** to receive your output. Make sure to do this before creating new line numbers; otherwise, any additional code you write might not run.
|
||||
|
||||
### 2\. Create a key-value pair
|
||||
|
||||
Write the keys and values you wish to access in your dictionary. To start, you'll need to define what they are in the context of your dictionary:
|
||||
|
||||
|
||||
```
|
||||
empty_dictionary = {}
|
||||
grades = {
|
||||
"Kelsey": 87,
|
||||
"Finley": 92
|
||||
}
|
||||
|
||||
one_line = {a: 1, b: 2}
|
||||
```
|
||||
|
||||
![Code for defining key-value pairs in the dictionary][6]
|
||||
|
||||
(Lauren Maffeo, [CC BY-SA 4.0][5])
|
||||
|
||||
This allows the dictionary to associate specific keys with their respective values. Dictionaries store data by name, which allows faster lookup.
|
||||
|
||||
### 3\. Access a dictionary value by its key
|
||||
|
||||
Say you want to find a specific dictionary value; in this case, a specific student's grade. To start, hit **Insert** then **Insert Cell Below**.
|
||||
|
||||
![Inserting a new cell in Jupyter][7]
|
||||
|
||||
(Lauren Maffeo, [CC BY-SA 4.0][5])
|
||||
|
||||
In your new cell, define the keys and values in your dictionary.
|
||||
|
||||
Then, find the value you need by telling your dictionary to print that value's key. For example, look for a specific student's name—Kelsey:
|
||||
|
||||
|
||||
```
|
||||
# Access data in a dictionary
|
||||
grades = {
|
||||
"Kelsey": 87,
|
||||
"Finley": 92
|
||||
}
|
||||
|
||||
print(grades["Kelsey"])
|
||||
87
|
||||
```
|
||||
|
||||
![Code to look for a specific value][8]
|
||||
|
||||
(Lauren Maffeo, [CC BY-SA 4.0][5])
|
||||
|
||||
Once you've asked for Kelsey's grade (that is, the value you're trying to find), hit **Shift** (if you're on macOS), then **Return**.
|
||||
|
||||
You see your desired value—Kelsey's grade—as an output below your cell.
|
||||
|
||||
### 4\. Update an existing key
|
||||
|
||||
What if you realize you added the wrong grade for a student to your dictionary? You can fix it by updating your dictionary to store an additional value.
|
||||
|
||||
To start, choose which key you want to update. In this case, say you entered Finley's grade incorrectly. That is the key you'll update in this example.
|
||||
|
||||
To update Finley's grade, insert a new cell below, then create a new key-value pair. Tell your cell to print the dictionary, then hit **Shift** and **Return**:
|
||||
|
||||
|
||||
```
|
||||
grades["Finley"] = 90
|
||||
print(grades)
|
||||
|
||||
{'Kelsey': 87; "Finley": 90}
|
||||
```
|
||||
|
||||
![Code for updating a key][9]
|
||||
|
||||
(Lauren Maffeo, [CC BY-SA 4.0][5])
|
||||
|
||||
The updated dictionary, with Finley's new grade, appears as your output.
|
||||
|
||||
### 5\. Add a new key
|
||||
|
||||
Say you get a new student's grade for an exam. You can add that student's name and grade to your dictionary by adding a new key-value pair.
|
||||
|
||||
Insert a new cell below, then add the new student's name and grade as a key-value pair. Once you're done, tell your cell to print the dictionary, then hit **Shift** and **Return**:
|
||||
|
||||
|
||||
```
|
||||
grades["Alex"] = 88
|
||||
print(grades)
|
||||
|
||||
{'Kelsey': 87, 'Finley': 90, 'Alex': 88}
|
||||
```
|
||||
|
||||
![Add a new key][10]
|
||||
|
||||
(Lauren Maffeo, [CC BY-SA 4.0][5])
|
||||
|
||||
All key-value pairs should appear as output.
|
||||
|
||||
### Using dictionaries
|
||||
|
||||
Remember that keys and values can be any data type, but it's rare for them to be [non-primitive types][11]. Additionally, dictionaries don't store or structure their content in any specific order. If you need an ordered sequence of items, it's best to create a list in Python, not a dictionary.
|
||||
|
||||
If you're thinking of using a dictionary, first confirm if your data is structured the right way, i.e., like a phone book. If not, then using a list, tuple, tree, or other data structure might be the best option.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/3/dictionary-values-python
|
||||
|
||||
作者:[Lauren Maffeo][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/lmaffeo
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python-programming-code-keyboard.png?itok=fxiSpmnd (Hands on a keyboard with a Python book )
|
||||
[2]: https://docs.anaconda.com/anaconda/
|
||||
[3]: https://opensource.com/article/18/3/getting-started-jupyter-notebooks
|
||||
[4]: https://opensource.com/sites/default/files/uploads/new-jupyter-notebook.png (Create Jupyter notebook)
|
||||
[5]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[6]: https://opensource.com/sites/default/files/uploads/define-keys-values.png (Code for defining key-value pairs in the dictionary)
|
||||
[7]: https://opensource.com/sites/default/files/uploads/jupyter_insertcell.png (Inserting a new cell in Jupyter)
|
||||
[8]: https://opensource.com/sites/default/files/uploads/lookforvalue.png (Code to look for a specific value)
|
||||
[9]: https://opensource.com/sites/default/files/uploads/jupyter_updatekey.png (Code for updating a key)
|
||||
[10]: https://opensource.com/sites/default/files/uploads/jupyter_addnewkey.png (Add a new key)
|
||||
[11]: https://www.datacamp.com/community/tutorials/data-structures-python
|
@ -0,0 +1,105 @@
|
||||
[#]: subject: (Use gImageReader to Extract Text From Images and PDFs on Linux)
|
||||
[#]: via: (https://itsfoss.com/gimagereader-ocr/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
Use gImageReader to Extract Text From Images and PDFs on Linux
|
||||
======
|
||||
|
||||
_Brief: gImageReader is a GUI tool to utilize tesseract OCR engine for extracting texts from images and PDF files in Linux._
|
||||
|
||||
[gImageReader][1] is a front-end for [Tesseract Open Source OCR Engine][2]. _Tesseract_ was originally developed at HP and then was open-sourced in 2006.
|
||||
|
||||
Basically, the OCR (Optical Character Recognition) engine lets you scan texts from a picture or a file (PDF). It can detect several languages by default and also supports scanning through Unicode characters.
|
||||
|
||||
However, the Tesseract by itself is a command-line tool without any GUI. So, here, gImageReader comes to the rescue to let any user utilize it to extract text from images and files.
|
||||
|
||||
Let me highlight a few things about it while mentioning my experience with it for the time I tested it out.
|
||||
|
||||
### gImageReader: A Cross-Platform Front-End to Tesseract OCR
|
||||
|
||||
![][3]
|
||||
|
||||
To simplify things, gImageReader comes in handy to extract text from a PDF file or an image that contains any kind of text.
|
||||
|
||||
Whether you need it for spellcheck or translation, it should be useful for a specific group of users.
|
||||
|
||||
To sum up the features in a list, here’s what you can do with it:
|
||||
|
||||
* Add PDF documents and images from disk, scanning devices, clipboard and screenshots
|
||||
* Ability to rotate images
|
||||
* Common image controls to adjust brightness, contrast, and resolution
|
||||
* Scan images directly through the app
|
||||
* Ability to process multiple images or files in one go
|
||||
* Manual or automatic recognition area definition
|
||||
* Recognize to plain text or to [hOCR][4] documents
|
||||
* Editor to display the recognized text
|
||||
* Can spellcheck the text extracted
|
||||
* Convert/Export to PDF documents from hOCR document
|
||||
* Export extracted text as a .txt file
|
||||
* Cross-platform (Windows)
|
||||
|
||||
|
||||
|
||||
### Installing gImageReader on Linux
|
||||
|
||||
**Note**: _You need to explicitly install Tesseract language packs to detect from images/files from your software manager._
|
||||
|
||||
![][5]
|
||||
|
||||
You can find gImageReader in the default repositories for some Linux distributions like Fedora and Debian.
|
||||
|
||||
For Ubuntu, you need to add a PPA and then install it. To do that, here’s what you need to type in the terminal:
|
||||
|
||||
```
|
||||
sudo add-apt-repository ppa:sandromani/gimagereader
|
||||
sudo apt update
|
||||
sudo apt install gimagereader
|
||||
```
|
||||
|
||||
You can also find it for openSUSE from its build service and [AUR][6] will be the place for Arch Linux users.
|
||||
|
||||
All the links to the repositories and the packages can be found in their [GitHub page][1].
|
||||
|
||||
[gImageReader][1]
|
||||
|
||||
### Experience with gImageReader
|
||||
|
||||
gImageReader is a quite useful tool for extracting texts from images when you need them. It works great when you try from a PDF file.
|
||||
|
||||
For extracting images from a picture shot on a smartphone, the detection was close but a bit inaccurate. Maybe when you scan something, recognition of characters from the file could be better.
|
||||
|
||||
So, you’ll have to try it for yourself to see how well it works for your use-case. I tried it on Linux Mint 20.1 (based on Ubuntu 20.04).
|
||||
|
||||
I just had an issue to manage languages from the settings and I didn’t get a quick solution for that. If you encounter the issue, you might want to troubleshoot it and explore more about it how to fix it.
|
||||
|
||||
![][7]
|
||||
|
||||
Other than that, it worked just fine.
|
||||
|
||||
Do give it a try and let me know how it worked for you! If you know of something similar (and better), do let me know about it in the comments below.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/gimagereader-ocr/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://github.com/manisandro/gImageReader
|
||||
[2]: https://tesseract-ocr.github.io/
|
||||
[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/gImageReader.png?resize=800%2C456&ssl=1
|
||||
[4]: https://en.wikipedia.org/wiki/HOCR
|
||||
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/tesseract-language-pack.jpg?resize=800%2C620&ssl=1
|
||||
[6]: https://itsfoss.com/aur-arch-linux/
|
||||
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/gImageReader-1.jpg?resize=800%2C460&ssl=1
|
107
sources/tech/20210310 How to Update openSUSE Linux System.md
Normal file
107
sources/tech/20210310 How to Update openSUSE Linux System.md
Normal file
@ -0,0 +1,107 @@
|
||||
[#]: subject: (How to Update openSUSE Linux System)
|
||||
[#]: via: (https://itsfoss.com/update-opensuse/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
How to Update openSUSE Linux System
|
||||
======
|
||||
|
||||
I have been an Ubuntu user for as long as I remember. I distrohopped a little but keep on coming back to Ubuntu. But recently, I have started using openSUSE to try something non-Debian.
|
||||
|
||||
As I keep exploring [openSUSE][1], I keep on stumbling upon things that are slightly different in SUSE-worse and I plan to cover them in tutorials on It’s FOSS.
|
||||
|
||||
As a first, I am writing about updating openSUSE system. There are two ways you can do that:
|
||||
|
||||
* Using terminal (valid for openSUSE desktops and servers)
|
||||
* Using a graphical tool (valid for openSUSE desktops)
|
||||
|
||||
|
||||
|
||||
### Update openSUSE via command line
|
||||
|
||||
The simplest way to update openSUSE is by using the zypper command. It provides full functionality of patches and updates management. It takes care of the file conflicts and dependency problems. The updates also include Linux kernel.
|
||||
|
||||
If you are using openSUSE Leap, use this command:
|
||||
|
||||
```
|
||||
sudo zypper update
|
||||
```
|
||||
|
||||
You may also use `up` instead of `update` but I find it easier to remember.
|
||||
|
||||
If you are using openSUSE Tumbleweed, use the `dist-upgrade` or `dup` (in short). Tumbleweed is [rolling release distribution][2] and hence it is advised to use dist-upgrade option.
|
||||
|
||||
```
|
||||
sudo zypper dist-upgrade
|
||||
```
|
||||
|
||||
It will show you the list of the packages to be upgraded, removed or installed.
|
||||
|
||||
![][3]
|
||||
|
||||
You’ll be notified if your system requires reboots.
|
||||
|
||||
If you just want to refresh the repositories (like sudo apt update), you may use this command:
|
||||
|
||||
```
|
||||
sudo zypper refresh
|
||||
```
|
||||
|
||||
If you want to list the available updates, you can also do that:
|
||||
|
||||
```
|
||||
sudo zypper list-updates
|
||||
```
|
||||
|
||||
### Graphical way to update openSUSE
|
||||
|
||||
If you are using openSUSE as a desktop, you’ll have the additional option of using the GUI tools for installing the updates. This tool may change depending on [which desktop environment you are using][4].
|
||||
|
||||
For example, KDE has its own Software center called Discover. You can use it to search and install new applications. You can also use it to install system updates.
|
||||
|
||||
![][5]
|
||||
|
||||
In fact, KDE notifies you of available system updates in the notification area. You’ll have to open Discover explicitly because clicking on the notification doesn’t automatically take you to Discover.
|
||||
|
||||
![][6]
|
||||
|
||||
If you find that annoying, you may disable it using these commands:
|
||||
|
||||
```
|
||||
sudo zypper remove plasma5-pk-updates
|
||||
sudo zypper addlock plasma5-pk-updates
|
||||
```
|
||||
|
||||
I wouldn’t recommend it though. It’s better to get notified of available updates.
|
||||
|
||||
There is also the YAST Software Management [GUI tool][7] which you can use for more granular control on package managements.
|
||||
|
||||
![][8]
|
||||
|
||||
That’s it. It was a short one. In the next SUSE tutorial, I’ll show you some common zypper commands with examples. Stay tuned.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/update-opensuse/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.opensuse.org/
|
||||
[2]: https://itsfoss.com/rolling-release/
|
||||
[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/update-opensuse-with-zypper.png?resize=800%2C406&ssl=1
|
||||
[4]: https://itsfoss.com/find-desktop-environment/
|
||||
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/opensuse-update-gui.png?resize=800%2C500&ssl=1
|
||||
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/03/update-notification-opensuse.png?resize=800%2C259&ssl=1
|
||||
[7]: https://itsfoss.com/gui-cli-tui/
|
||||
[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/03/yast-software-management-suse.png?resize=800%2C448&ssl=1
|
@ -1,210 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (stevenzdg988)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Teach a virtual class with Moodle on Linux)
|
||||
[#]: via: (https://opensource.com/article/20/10/moodle)
|
||||
[#]: author: (Don Watkins https://opensource.com/users/don-watkins)
|
||||
|
||||
基于 Linux 的 Moodle 虚拟课堂教学
|
||||
======
|
||||
基于 Linux 的 Moodle 学习管理系统远程学校教学。
|
||||
|
||||
![计算机桌面的数字图像][1]
|
||||
|
||||
远程教育创造的需求大流行比以往任何时候都更大。像 [Moodle][2] 这样的学习管理系统(LMS)变得比以往任何时候都重要,越来越多的借助虚拟现实技术提供教育的学校确保教育步入正轨。
|
||||
|
||||
Moodle 是用 PHP 编写的免费 LMS,并以开源 [GNU Public License(GNU 公共许可)][3](GPL)分发。它是由[Martin Dougiamas][4] 开发的,自 2002 年发布以来一直在不断发展。Moodle 可用于混合学习,远程学习,翻转课堂和其他形式的在线学习。目前,全球有超过 [1.9 亿用户][5] 和 145,000 个注册的 Moodle 网站。
|
||||
|
||||
我已经使用 Moodle 作为管理员,教师和学生等角色,在本文中,我将向您展示如何设置并开始使用它。
|
||||
|
||||
### 在 Linux 系统上安装 Moodle
|
||||
|
||||
Moodle 对 [系统要求][6] 适中,并且有大量文档可为您提供帮助。我最喜欢的安装方法是从 [Turnkey Linux][7] 下载并制作 ISO 在 VirtualBox 中安装 Moodle 站点。
|
||||
|
||||
首先,下载 [Moodle ISO][8] 保存到电脑中。
|
||||
|
||||
下一步,安装 VirtualBox 的 Linux 命令行如下
|
||||
|
||||
```
|
||||
$ sudo apt install virtualbox
|
||||
```
|
||||
|
||||
或
|
||||
|
||||
```
|
||||
$ sudo dnf install virtualbox
|
||||
```
|
||||
|
||||
当下载完成后,启动 VirtualBox 并在控制台中选择 **New** 按钮。
|
||||
|
||||
![创建一个新的 VirtualBox(虚拟机)][9]
|
||||
|
||||
(Don Watkins, [CC BY-SA 4.0][10])
|
||||
|
||||
选择使用的虚拟机的名称,操作系统(Linux)和 Linux 类型(例如 Debian 64 位)。
|
||||
|
||||
![命名 VirtualBox VM(虚拟机)][11]
|
||||
|
||||
(Don Watkins, [CC BY-SA 4.0][10])
|
||||
|
||||
下一步,配置虚拟机(VM)内存大小-使用默认值 1024 MB。接下来选择 **dynamically allocated** (动态分配)虚拟磁盘并在虚拟机中添加 `Moodle.iso` 镜像。
|
||||
|
||||
![添加 Moodle.iso 到 VM(虚拟机)][12]
|
||||
|
||||
(Don Watkins, [CC BY-SA 4.0][10])
|
||||
|
||||
将您的网络设置从 NAT 更改为 **Bridged adapter**(桥接模式)。然后启动虚拟机并安装 ISO 以创建 Moodle 虚拟机。在安装过程中,系统将提示为 root 帐户,MySQL 和Moodle 创建密码。 Moodle 密码必须至少包含八个字符,至少一个大写字母和至少一个特殊字符。
|
||||
|
||||
重启虚拟机。安装完成后,请确保将 Moodle 应用配置内容记录在安全的地方。(安装后,可以根据需要删除ISO文件。)
|
||||
|
||||
![Moodle 应用配置][13]
|
||||
|
||||
(Don Watkins, [CC BY-SA 4.0][10])
|
||||
|
||||
重要提示,在 Internet(互联网)上的任何人还看不到你的 Moodle 实例。它仅存在于你的本地网络中:现在只有建筑物中与您连接到相同的路由器或 wifi 接入点的人可以访问您的站点。世界范围的 Internet(互联网)无法连接到它,因为您位于防火墙(嵌入在路由器中,还可能嵌入在计算机中)的后面。有关网络配置的更多信息,请阅读 Seth Kenlon 在 [打开端口并选择路由通信通过防火墙。][14] 上的文章。
|
||||
|
||||
### 开始使用 Moodle
|
||||
|
||||
现在您可以登录到 Moodle 机器并熟悉该软件了。使用默认的用户名 **admin** 和创建 Moodle VM 时设置的密码登录 Moodle。
|
||||
|
||||
![Moodle 登录界面][15]
|
||||
|
||||
(Don Watkins, [CC BY-SA 4.0][10])
|
||||
|
||||
首次登录后,您将看到初始的 Moodle 网站的主仪表盘。
|
||||
|
||||
![Moodle 管理员仪表盘][16]
|
||||
|
||||
(Don Watkins, [CC BY-SA 4.0][10])
|
||||
|
||||
默认的应用名称是 **Turnkey Moodle**,但是可以很容易地对其进行更改以适合您的学校,课堂或其他需要和选择。要使您的Moodle网站个性化,请在用户界面左侧的菜单中,选择 **Site home** (站点首页)。然后,点击屏幕右侧的 **Settings** (设置)图标,然后选择 **Edit settings**(编辑设置)。
|
||||
|
||||
![Moodle 设置][17]
|
||||
|
||||
(Don Watkins, [CC BY-SA 4.0][10])
|
||||
|
||||
您可以根据需要更改站点名称,并添加简短名称和站点描述。
|
||||
|
||||
![Moodle 网站名][18]
|
||||
|
||||
(Don Watkins, [CC BY-SA 4.0][10])
|
||||
|
||||
确保滚动到底部并保存更改。现在,您的网站已定制。
|
||||
|
||||
![Moodle 保存更改][19]
|
||||
|
||||
(Don Watkins, [CC BY-SA 4.0][10])
|
||||
|
||||
默认类别为其他,这不会帮助人们识别您网站的目的。要添加类别,请返回主仪表盘,然后从左侧菜单中选择 **Site administration** (站点管理)。 在 **Courses**(**课程**)下,选择 **Add a category**(**添加类别**)并输入有关您的网站的详细信息。
|
||||
|
||||
![在 Moodle 中添加类别选项][20]
|
||||
|
||||
(Don Watkins, [CC BY-SA 4.0][10])
|
||||
|
||||
要添加课程,请返回 **Site administration**(**站点管理**),然后单击 **Add a new course**(**添加新课程**)。您将看到一系列选项,例如为课程命名,提供简短名称,设定类别以及设置课程的开始和结束日期。您还可以为课程格式设置选项,例如社交,每周的和主题,以及其外观,文件上传大小,完成情况跟踪等等。
|
||||
|
||||
![在 Moodle 中添加课程选项][21]
|
||||
|
||||
(Don Watkins, [CC BY-SA 4.0][10])
|
||||
|
||||
### 添加和管理用户
|
||||
|
||||
现在,您已经设置了课程,您可以添加用户。有多种方法可以做到这一点。如果您是自学者,则手动入门是一个不错的开始。Moodle 支持基于电子邮件的注册,[LDAP][22],[Shibboleth(口令或暗语)][23]等。学区和其他较大的装置支持用逗号分隔的文件上传用户。也可以批量添加密码,并在首次登录时强制更改密码。有关更多信息,请确保查阅 Moodle [文档][24]。
|
||||
|
||||
Moodle是一个非常细化的,面向许可的环境。使用 Moodle 的菜单将策略和角色分配给用户并执行这些分配很容易。
|
||||
|
||||
Moodle 中有许多角色,每个角色都有特定的特权和许可。 默认角色是管理员,课程创建者,教师,非编辑教师,学生,来宾和经过身份验证的用户,但您可以添加其他角色。
|
||||
|
||||
### 为课程添加内容
|
||||
|
||||
一旦搭建了 Moodle 网站并设置了课程,就可以向课程中添加内容。Moodle 具有创建出色内容所需要的所有工具,并且它以强调 [社会建构主义][25] 观点的扎实的教学法为基础。
|
||||
|
||||
我用 [Mu][26] 创建了一个名为 Code 的示例课程。它在 **Programming**(**编程**)类别和 **Python** 子类别中。
|
||||
|
||||
![Moodle 课程列表][27]
|
||||
|
||||
(Don Watkins, [CC BY-SA 4.0][10])
|
||||
|
||||
我为课程选择了每周格式,默认为四个星期。使用编辑工具,我隐藏了除课程第一周以外的所有内容。这样可以确保我的学生始终专注于材料。
|
||||
|
||||
作为教师或 Moodle 管理员,我可以通过单击 **Add an activity**(**添加活动**) **or resource**(**或资源**)来将活动添加到每周的教学中。
|
||||
|
||||
![在 Moodle 中添加活动][28]
|
||||
|
||||
(Don Watkins, [CC BY-SA 4.0][10])
|
||||
|
||||
我会看到一个弹出窗口,其中包含可以分配给我的学生的各种活动。
|
||||
|
||||
![Moodle 活动菜单][29]
|
||||
|
||||
(Don Watkins, [CC BY-SA 4.0][10])
|
||||
|
||||
Moodle 的工具和活动使我可以轻松地创建学习材料并进行简短的测验来结束一周的学习。
|
||||
|
||||
![Moodle 活动清单][30]
|
||||
|
||||
(Don Watkins, [CC BY-SA 4.0][10])
|
||||
|
||||
您可以使用 1,600 多个插件来扩展 Moodle 的新活动,问题类型,与其他系统的集成等等。例如,[BigBlueButton][31] 插件支持幻灯片共享,白板,音频和视频聊天以及小组讨论室。其他需要考虑的包括用于视频会议的 [Jitsi][32] 插件,用于复制徽章的 [抄袭检查器][33] 和 [开放徽章工厂][34]。
|
||||
|
||||
### 继续探索 Moodle
|
||||
|
||||
Moodle 是功能强大的 LMS,我希望此介绍能引起你的兴趣,以了解更多信息。有很多出色的 [指南][35] 可以帮助您提高技能,如果想要查看 Moodle 的内容,可以在其 [演示站点][36] 上查看运行中的 Moodle,或访问 [Moodle的源代码][37] 查看罩或对发展作出 [贡献][38]。如果您喜欢在旅途中工作,Moodle 也有一款出色的 [移动应用][39],适用于 iOS 和 Android。在[Twitter][40],[Facebook][41] 和 [LinkedIn][42] 上关注 Moodle,以了解最新消息。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/10/moodle
|
||||
|
||||
作者:[Don Watkins][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[stevenzdg988](https://github.com/stevenzdg988)
|
||||
校对:[校对者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/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_desk_home_laptop_browser.png?itok=Y3UVpY0l (Digital images of a computer desktop)
|
||||
[2]: https://moodle.org/
|
||||
[3]: https://docs.moodle.org/19/en/GNU_General_Public_License
|
||||
[4]: https://dougiamas.com/about/
|
||||
[5]: https://docs.moodle.org/39/en/History
|
||||
[6]: https://docs.moodle.org/39/en/Installation_quick_guide#Basic_Requirements
|
||||
[7]: https://www.turnkeylinux.org/
|
||||
[8]: https://www.turnkeylinux.org/download?file=turnkey-moodle-16.0-buster-amd64.iso
|
||||
[9]: https://opensource.com/sites/default/files/uploads/virtualbox_new.png (Create a new VirtualBox)
|
||||
[10]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[11]: https://opensource.com/sites/default/files/uploads/virtualbox_namevm.png (Naming the VirtualBox VM)
|
||||
[12]: https://opensource.com/sites/default/files/uploads/virtualbox_attach-iso.png (Attaching Moodle.iso to VM)
|
||||
[13]: https://opensource.com/sites/default/files/uploads/moodle_appliance.png (Moodle appliance settings)
|
||||
[14]: https://opensource.com/article/20/9/firewall
|
||||
[15]: https://opensource.com/sites/default/files/uploads/moodle_login.png (Moodle login screen)
|
||||
[16]: https://opensource.com/sites/default/files/uploads/moodle_dashboard.png (Moodle admin dashboard)
|
||||
[17]: https://opensource.com/sites/default/files/uploads/moodle_settings.png (Moodle settings)
|
||||
[18]: https://opensource.com/sites/default/files/uploads/moodle_name-site.png (Name Moodle site)
|
||||
[19]: https://opensource.com/sites/default/files/uploads/moodle_saved.png (Moodle changes saved)
|
||||
[20]: https://opensource.com/sites/default/files/uploads/moodle_addcategory.png (Add category option in Moodle)
|
||||
[21]: https://opensource.com/sites/default/files/uploads/moodle_addcourse.png (Add course option in Moodle)
|
||||
[22]: https://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol
|
||||
[23]: https://www.shibboleth.net/
|
||||
[24]: https://docs.moodle.org/39/en/Main_page
|
||||
[25]: https://docs.moodle.org/39/en/Pedagogy#How_Moodle_tries_to_support_a_Social_Constructionist_view
|
||||
[26]: https://opensource.com/article/20/9/teach-python-mu
|
||||
[27]: https://opensource.com/sites/default/files/uploads/moodle_choosecourse.png (Moodle course list)
|
||||
[28]: https://opensource.com/sites/default/files/uploads/moodle_addactivity_0.png (Add activity in Moodle)
|
||||
[29]: https://opensource.com/sites/default/files/uploads/moodle_activitiesmenu.png (Moodle activities menu)
|
||||
[30]: https://opensource.com/sites/default/files/uploads/moodle_activitieschecklist.png (Moodle activities checklist)
|
||||
[31]: https://moodle.org/plugins/mod_bigbluebuttonbn
|
||||
[32]: https://moodle.org/plugins/mod_jitsi
|
||||
[33]: https://moodle.org/plugins/plagiarism_unicheck
|
||||
[34]: https://moodle.org/plugins/local_obf
|
||||
[35]: https://learn.moodle.org/
|
||||
[36]: https://school.moodledemo.net/
|
||||
[37]: https://git.in.moodle.com/moodle/moodle
|
||||
[38]: https://git.in.moodle.com/moodle/moodle/-/blob/master/CONTRIBUTING.txt
|
||||
[39]: https://download.moodle.org/mobile/
|
||||
[40]: https://twitter.com/moodle
|
||||
[41]: https://www.facebook.com/moodle
|
||||
[42]: https://www.linkedin.com/company/moodle/
|
@ -1,98 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (robsean)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Run your favorite Windows applications on Linux)
|
||||
[#]: via: (https://opensource.com/article/21/2/linux-wine)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
在 Linux 上运行你最喜欢的 Windows 应用程序
|
||||
======
|
||||
WINE 是一个开放源文件的项目,它协助很多 Windows 应用程序在 Linux 上运行,就好像它们是本地程序一样。
|
||||
![打开文件或窗口的计算机屏幕][1]
|
||||
|
||||
在 2021 年,有很多人们比为什么以往更喜欢 Linux 的原因。在这系列中,我将分享使用 Linux 的 21 种的不同原因。这里是如何使用 WINE 来实现从 Windows 到 Linux 的无缝切换。
|
||||
|
||||
你有仅在 Windows 上运行的应用程序吗?是这个应用程序的事情阻碍你切换到 Linux 吗?如果是这样的话,你将会很高兴知道 WINE, 一个开放源文件工程,几乎彻底改造了关键的 Windows 库,以便为 Windows 编译的应用程序可以在 Linux 上运行。
|
||||
|
||||
WINE 代表着 "Wine Is Not an Emulator" ,它引用驱动这项技术的代码。开放源文件开发者从 1993 年开始致力将应用程序任何传入的 Windows API调用翻译为 [POSIX][2] 调用。
|
||||
|
||||
这是一个令人十分惊讶的编程壮举,尤其是考虑到这个项目是独立运行的,没有来自 Microsoft (客观的说)的帮助,但是这里有局限性。一个应用程序偏离 Windows API 的 “内核” 越远,WINE 就越不能预期应用程序的请求。这里有一些供应商可以弥补这一点,尤其是 [Codeweavers][3] 和 [Valve Software][4]。在需要翻译应用程序的制作者和制作翻译的人们和公司之间没有协调配合,因此,在两者之间可能会有一些时间上的滞后,例如,一个更新的软件标题和当它从 [WINE 总部][5] 获得“黄金”身份时。
|
||||
|
||||
然而,如果你想在 Linux 上运行一个著名的 Windows 应用程序,WINE 可能已经为它准备好了可能性。
|
||||
|
||||
### 安装 WINE
|
||||
|
||||
你可以从你的 Linux 发行版的软件包存储库中安装 WINE 。在 Fedora ,CentOS Stream ,或 RHEL 系统上:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo dnf install wine`
|
||||
```
|
||||
|
||||
在 Debian ,Linux Mint ,Elementary 及相似的系统上:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo apt install wine`
|
||||
```
|
||||
|
||||
WINE 不是一个你启动它本身的应用程序。当启动一个 Windows 应用程序时,它是一个被调用的后端。你与 WINE 的第一次交互很可能就发生在你启动一个 Windows 应用程序的安装程序。
|
||||
|
||||
### 安装一个应用程序
|
||||
|
||||
[TinyCAD][6] 是一个极好的用于设计电路的开放源文件的应用程序,但是它仅在 Windows 上可用。虽然它是一个小型的应用程序,但是它确实包含一些 .NET 组件,因此应该能对 WINE 进行一些压力测试。
|
||||
|
||||
首先,下载 TinyCAD 的安装程序。Windows 安装程序通常都是这样,它是一个 `.exe` 文件。在下载后,双击文件来启动它。
|
||||
|
||||
![WINE TinyCAD 安装向导][7]
|
||||
|
||||
针对 TinyCAD 的 WINE 安装向导
|
||||
|
||||
像你在 Windows 上一样逐步a完成安装程序。通常最好接受默认选项,尤其是与 WINE 有关的地方。WINE 环境基本上是独立的,隐藏在你的硬盘驱动器上的一个 **drive_c** 目录中,作为Windows 应用程序使用的一个文件系统的仿真根目录。
|
||||
|
||||
![WINE TinyCAD 安装和明白驱动器][8]
|
||||
|
||||
WINE TinyCAD 目标驱动器
|
||||
|
||||
在它安装后,应用程序通常会为你提供启动器。如果你正准备测试一下它的话,启动应用程序。
|
||||
|
||||
### 启动一个 Windows 应用程序
|
||||
|
||||
除了在安装后的第一次启动外,在正常情况下,你启动一个 WINE 应用程序的方式与你启动一个本地 Linux 应用程序相同。不管你使用一个应用程序菜单或一个 Activities 屏幕或者只是在一个运行器中输入应用程序的名称,在 WINE 中运行的桌面 Windows 应用程序都会被视为在 Linux 上的本地应用程序。
|
||||
|
||||
![TinyCAD 使用 WINE 运行][9]
|
||||
|
||||
通过 WINE 的支持来运行 TinyCAD
|
||||
|
||||
### 当 WINE 失败时
|
||||
|
||||
我在 WINE 中的大多数应用程序,包括 TinyCAD ,都能如期运行。不过,也会有意外。在这些情况下,你可以静候几个月来查看 WINE 开发者 (或者,如果它是一款游戏,等候 Valve Software) 是否进行追加修补,或者你可以联系一个像or you can contact a vendor like Codeweavers 这样的供应商来查看他们是否出售对你所需要的应用程序的服务支持。
|
||||
|
||||
### WINE 是作弊的,但是它使用了一种很好的方法。
|
||||
|
||||
一些 Linux 用户觉得:如果你使用 WINE 的话,你就是在 Linux 上“作弊”。它可能会让人有这种感觉,但是 WINE 是一个开放源文件的项目,它能够使用户切换到 Linux ,并且仍然能为他们运行工作或爱好所必要的应用程序。如果 WINE 能解决你的问题,并且让你使用 Linux 的话,那么就使用它,并拥抱 Linux 的灵活性。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/2/linux-wine
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][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/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_screen_windows_files.png?itok=kLTeQUbY (Computer screen with files or windows open)
|
||||
[2]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains
|
||||
[3]: https://www.codeweavers.com/crossover
|
||||
[4]: https://github.com/ValveSoftware/Proton
|
||||
[5]: http://winehq.org
|
||||
[6]: https://sourceforge.net/projects/tinycad/
|
||||
[7]: https://opensource.com/sites/default/files/wine-tinycad-install.jpg
|
||||
[8]: https://opensource.com/sites/default/files/wine-tinycad-drive_0.jpg
|
||||
[9]: https://opensource.com/sites/default/files/wine-tinycad-running.jpg
|
@ -0,0 +1,102 @@
|
||||
[#]: subject: (4 open source tools for running a Linux server)
|
||||
[#]: via: (https://opensource.com/article/21/3/linux-server)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
运行 Linux 服务器的 4 个开源工具
|
||||
======
|
||||
通过 Linux,你可以将任何设备变成服务器,以共享数据、媒体文件,以及其他资源。
|
||||
![A rack of servers, blue background][1]
|
||||
|
||||
在 2021 年,人们喜欢 Linux 的理由比以往任何时候都多。在这个系列中,我将分享 21 个使用 Linux 的不同理由。这里有四个开源工具,可以将任何设备变成 Linux 服务器。
|
||||
|
||||
有时,我会发现有关服务器概念的某种神秘色彩。许多人,如果他们在脑海中有一个形象的话,他们认为服务器一定是又大又重的机架式机器,由一个谨慎的系统管理员和一群神奇的修理工精心维护。另一些人则把服务器设想成虚无缥缈的云朵,以某种方式为互联网提供动力。
|
||||
|
||||
虽然这种敬畏对 IT 工作的安全性是有好处的,但事实上,在开源计算中,没有人认为服务器是或应该是专家的专属领域。文件和资源共享是开源不可或缺的,而开源让它变得比以往任何时候都更容易,正如这四个开源服务器项目所展示的那样。
|
||||
|
||||
### Samba
|
||||
|
||||
[Samba 项目][2]是 Linux 和 Unix 的 Windows 互操作程序套件。尽管它是大多数用户从未与之交互的底层代码,但它的重要性却不容小觑。从历史上看,早在微软争相消灭 Linux 和开源的时候,它就是最大最重要的目标。时代变了,微软已经与 Samba 团队会面以提供支持(至少目前是这样),在这一切中,该项目继续确保 Linux 和 Windows 计算机可以轻松地在同一网络上共存。换句话说,无论你使用什么平台,Samba 都可以让你可以轻松地在本地网络上共享文件。
|
||||
|
||||
在 [KDE Plasma][3] 桌面上,你可以右键点击自己的任何目录,选择**属性**。在**属性**对话框中,点击**共享**选项卡,并启用**与 Samba 共享 (Microsoft Windows)**。
|
||||
|
||||
![Samba][4]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][5])
|
||||
|
||||
就这样,你已经为本地网络上的用户打开了一个只读访问的目录。也就是说,当你在家的时候,你家同一个 WiFi 网络上的任何人都可以访问该文件夹,如果你在工作,工作场所网络上的任何人都可以访问该文件夹。当然,要访问它,其他用户需要知道在哪里可以找到它。通往计算机的路径可以用 [IP 地址][6]表示,也可以根据你的网络配置,用主机名表示。
|
||||
|
||||
### Snapdrop
|
||||
|
||||
如果通过 IP 地址和主机名来打开网络是令人困惑的,或者如果你不喜欢打开一个文件夹进行共享而忘记它是开放的,那么你可能更喜欢 [Snapdrop][7]。这是一个开源项目,你可以自己运行,也可以使用互联网上的演示实例通过 WebRTC 连接计算机。WebRTC 可以通过 Web 浏览器实现点对点的连接,也就是说同一网络上的两个用户可以通过 Snapdrop 找到对方,然后直接进行通信,而不需要通过外部服务器。
|
||||
|
||||
![Snapdrop][8]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][5])
|
||||
|
||||
一旦两个或更多的客户端连接了同一个 Snapdrop 服务,用户就可以通过本地网络来回交换文件和聊天信息。传输的速度很快,而且你的数据也保持在本地。
|
||||
|
||||
### VLC
|
||||
|
||||
流媒体服务比以往任何时候都更常见,但我在音乐和电影方面有非常规的口味,所以典型的服务似乎很少有我想要的东西。幸运的是,通过连接到媒体驱动器,我可以很容易地将自己的内容从我的电脑上传送到我的房子各个角落。例如,当我想在电脑显示器以外的屏幕上观看一部电影时,我可以在我的网络上串流电影文件,并通过任何可以接收 HTTP 的应用来播放它,无论该应用是在我的电视、游戏机还是手机上。
|
||||
|
||||
[VLC][9] 可以轻松设置流媒体。事实上,它是**媒体**菜单中的一个选项,或者你可以按下键盘 **Ctrl**+**S**。将一个文件或一组文件添加到你的流媒体队列中,然后点击 **Stream** 按钮。
|
||||
|
||||
![VLC][10]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][5])
|
||||
|
||||
VLC 通过配置向导来帮助你决定流媒体数据时使用什么协议。我倾向于使用 HTTP,因为它通常在任何设备上可用。当 VLC 开始播放文件时, 请进入播放文件计算机的 IP 或主机名以及给它分配的端口 (当使用 HTTP,默认是 8080), 然后坐下来享受。
|
||||
|
||||
### PulseAudio
|
||||
|
||||
我最喜欢的现代 Linux 功能之一是 [PulseAudio][11]。Pulse 为 Linux 上的音频实现了惊人的灵活性,包括可自动发现的本地网络流媒体。这个功能对我来说的好处是,我可以在办公室的工作站上播放播客和技术会议视频,并通过手机串流音频。无论我走进厨房、休息室还是后院最远的地方,我都能获得完美的音频。此功能在 PulseAudio 之前很久就存在,但是 Pulse 使它像单击按钮一样容易。
|
||||
|
||||
需要进行一些设置。首先,你必须确保安装 PulseAudio preferences(**paprefs**)包,以便在 PulseAudio 配置中启用网络音频。
|
||||
|
||||
![PulseAudio][12]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][5])
|
||||
|
||||
在 **paprefs** 中,启用网络访问你的本地声音设备,可能不需要认证(假设你信任本地网络上的其他人),并启用你的计算机作为 **Multicast/RTP 发送者**。我通常只选择串流通过我的扬声器播放的任何音频,但你可以在 Pulse 输出选项卡中创建一个单独的音频设备,这样你就可以准确地选择串流的内容。你在这里有三个选项:
|
||||
|
||||
* 串流任何在扬声器上播放的音频
|
||||
* 串流所有输出的声音
|
||||
* 只将音频直接串流到多播设备(按需)。
|
||||
|
||||
|
||||
一旦启用,你的声音就会串流道网络中,并可被其他本地 Linux 设备接收。这是简单和动态的音频共享。
|
||||
|
||||
### 分享的不仅仅是代码
|
||||
|
||||
Linux 是关于共享的。它在服务器领域很有名,因为它很擅长_服务_。无论是提供音频流、视频流、文件,还是出色的用户体验,每一台 Linux 电脑都是一台出色的 Linux 服务器。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/3/linux-server
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rack_server_sysadmin_cloud_520.png?itok=fGmwhf8I (A rack of servers, blue background)
|
||||
[2]: http://samba.org
|
||||
[3]: https://opensource.com/article/19/12/linux-kde-plasma
|
||||
[4]: https://opensource.com/sites/default/files/uploads/samba_0.jpg (Samba)
|
||||
[5]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[6]: https://opensource.com/article/18/5/how-find-ip-address-linux
|
||||
[7]: https://github.com/RobinLinus/snapdrop
|
||||
[8]: https://opensource.com/sites/default/files/uploads/snapdrop.jpg (Snapdrop)
|
||||
[9]: https://www.videolan.org/index.html
|
||||
[10]: https://opensource.com/sites/default/files/uploads/vlc-stream.jpg (VLC)
|
||||
[11]: https://www.freedesktop.org/wiki/Software/PulseAudio/
|
||||
[12]: https://opensource.com/sites/default/files/uploads/pulse.jpg (PulseAudio)
|
85
translated/tech/20210304 An Introduction to WebAssembly.md
Normal file
85
translated/tech/20210304 An Introduction to WebAssembly.md
Normal file
@ -0,0 +1,85 @@
|
||||
[#]: subject: (An Introduction to WebAssembly)
|
||||
[#]: via: (https://www.linux.com/news/an-introduction-to-webassembly/)
|
||||
[#]: author: (Dan Brown https://training.linuxfoundation.org/announcements/an-introduction-to-webassembly/)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
WebAssembly 介绍
|
||||
======
|
||||
|
||||
_Marco Fioretti 编写_
|
||||
|
||||
## **到底什么是 WebAssembly?**
|
||||
|
||||
[WebAssembly,也叫 Wasm][1],是一种 Web 优化的代码格式和 API(应用编程接口),它可以大大提高网站的性能和能力。WebAssembly 的 1.0 版本,于 2017 年发布,并于 2019 年成为 W3C 官方标准。
|
||||
|
||||
该标准得到了所有主流浏览器供应商的积极支持,原因显而易见:官方列出的[“浏览器内部”用例][2]中提到了,其中包括视频编辑、3D 游戏、虚拟和增强现实、p2p 服务和科学模拟。除了让浏览器的功能比J avaScript 强大得多,该标准甚至可以延长网站的寿命:例如,正是 WebAssembly 为[互联网档案馆的 Flash 动画和游戏][3]提供了持续的支持。
|
||||
|
||||
不过,WebAssembly 并不只用于浏览器,目前它还被用于移动和基于边缘环境的 Cloudflare Workers 等产品中。
|
||||
|
||||
## **WebAssembly 如何工作**
|
||||
|
||||
.wasm 格式的文件包含低级二进制指令(字节码),可由使用通用栈的虚拟机以“接近 CPU 原生速度”执行。这些代码被打包成模块,也就是可以被浏览器直接执行的对象。每个模块可以被一个网页多次实例化。模块内部定义的函数被列在一个专用数组中,或称为 Table,相应的数据被包含在另一个结构中,称为 arraybuffer。开发者可以通过 Javascript WebAssembly.memory() 的调用,为 .wasm 代码显式分配内存。
|
||||
|
||||
.wasm 格式的纯文本版本可以大大简化学习和调试,同样也可以使用。然而,WebAssembly 并不是真的要供人直接使用。从技术上讲,.wasm 只是一个与浏览器兼容的**编译目标**:一种软件编译器可以自动翻译用高级编程语言编写的代码的格式。
|
||||
|
||||
这种选择正是使开发人员能够使用数十亿人熟悉的语言(C/C++、Python、Go、Rust 等)直接为用户界面进行编程的方式,但以前浏览器无法对其进行有效利用。更妙的是,程序员将得到这些,至少在理论上无需直接查看 WebAssembly 代码,也无需担心(因为目标是一个**虚拟**机)物理 CPU 将实际运行他们的代码。
|
||||
|
||||
## **但是我们已经有了 JavaScript,我们真的需要 WebAssembly 吗?**
|
||||
|
||||
是的,有几个原因。首先,作为二进制指令,.wasm 文件比同等功能的 JavaScript 文件小得多,下载速度也快得多。最重要的是,Javascript 文件必须在浏览器将其转换为其内部虚拟机可用的字节码之前进行完全解析和验证。
|
||||
|
||||
而 .wasm 文件则可以一次性验证和编译,从而使“流式编译”成为可能:浏览器在开始**下载它们**的那一刻就可以开始编译和执行它们,就像串流电影一样。
|
||||
|
||||
这就是说,并不是所有可以想到的 WebAssembly 应用肯定会比由专业程序员手动优化的等效 JavaScript 应用更快或更小。例如,如果一些 .wasm 需要包含 JavaScript 不需要的库,这种情况可能会发生。
|
||||
|
||||
## **WebAssembly 是否会让 JavaScript 过时?**
|
||||
|
||||
一句话:不会。当然暂时不会,至少在浏览器内不会。WebAssembly 模块仍然需要 JavaScript,因为在设计上它们不能访问文档对象模型 (DOM),也就是[主要用于修改网页的 API][4]。此外,.wasm 代码不能进行系统调用或读取浏览器的内存。WebAssembly 只能在沙箱中运行,一般来说,它能与外界的交互甚至比 JavaScript 更少,而且只能通过 JavaScript 接口进行。
|
||||
|
||||
因此,至少在不久的将来 .wasm 模块将只是通过 JavaScript 提供那些如果用 JavaScript 语言编写会消耗更多带宽、内存或 CPU 时间的部分。
|
||||
|
||||
## **网络浏览器如何运行 WebAssembly**
|
||||
|
||||
一般来说,浏览器至少需要两块来处理动态应用:运行应用代码的虚拟机 (VM),以及可以同时修改浏览器行为和网页显示的 API。
|
||||
|
||||
现代浏览器内部的虚拟机通过以下方式同时支持 JavaScript 和 WebAssembly:
|
||||
|
||||
1. 浏览器下载一个用 HTML 标记语言编写的网页,然后进行渲染
|
||||
2. 如果该 HTML 调用 JavaScript 代码,浏览器的虚拟机就会执行该代码。但是...
|
||||
3. 如果 JavaScript 代码中包含了 WebAssembly 模块的实例,那么就按照上面的描述获取该实例,然后根据需要通过 JavaScript 的 WebAssembly API 来使用该实例
|
||||
4. 当 WebAssembly 代码产生的东西将修改 DOM 即“宿主”网页的结构,JavaScript 代码就会接收到,并继续进行实际的修改。
|
||||
|
||||
|
||||
## **我如何才能创建可用的 WebAssembly 代码?**
|
||||
|
||||
越来越多的编程语言社区支持直接编译到 Wasm,我们建议从 webassembly.org 的[入门指南][5]开始,这取决于你使用什么语言。请注意,并不是所有的编程语言都有相同水平的 Wasm 支持,因此你的工作量可能会有所不同。
|
||||
|
||||
我们计划在未来几个月内发布一系列文章,提供更多关于 WebAssembly 的信息。要自己开始使用它,你可以报名参加 Linux 基金会的免费 [WebAssembly 介绍][6]在线培训课程。
|
||||
|
||||
这篇[WebAssembly 介绍][7]首次发布在 [Linux Foundation – Training][8]。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/news/an-introduction-to-webassembly/
|
||||
|
||||
作者:[Dan Brown][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://training.linuxfoundation.org/announcements/an-introduction-to-webassembly/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://webassembly.org/
|
||||
[2]: https://webassembly.org/docs/use-cases/
|
||||
[3]: https://blog.archive.org/2020/11/19/flash-animations-live-forever-at-the-internet-archive/
|
||||
[4]: https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Introduction
|
||||
[5]: https://webassembly.org/getting-started/developers-guide/
|
||||
[6]: https://training.linuxfoundation.org/training/introduction-to-webassembly-lfd133/
|
||||
[7]: https://training.linuxfoundation.org/announcements/an-introduction-to-webassembly/
|
||||
[8]: https://training.linuxfoundation.org/
|
@ -0,0 +1,104 @@
|
||||
[#]: subject: (You Can Now Install Official Evernote Client on Ubuntu and Debian-based Linux Distributions)
|
||||
[#]: via: (https://itsfoss.com/install-evernote-ubuntu/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
你现在可以在 Ubuntu 和基于 Debian 的 Linux 发行版上安装官方 Evernote 客户端了
|
||||
======
|
||||
|
||||
[Evernote][1] 是一款流行的笔记应用。它在推出时是一个革命性的产品。从那时起,已经有好几个这样的应用,可以将网络剪报、笔记等保存为笔记本格式。
|
||||
|
||||
多年来,Evernote 的桌面客户端一直没有在 Linux 上使用。前段时间 Evernote 承诺推出 Linux 应用,其测试版终于可以在基于 Ubuntu 的发行版上使用了。
|
||||
|
||||
非 FOSS 警报!
|
||||
|
||||
Evernote Linux 客户端不是开源的。之所以在这里介绍它,是因为该应用是在 Linux 上提供的,我们也会不定期地介绍 Linux 用户常用的非 foss 应用。这对普通桌面 Linux 用户有帮助。
|
||||
|
||||
### 在 Ubuntu 和基于 Debian 的 Linux 发行版上安装 Evernote
|
||||
|
||||
进入下面这个 Evernote 的网站页面:
|
||||
|
||||
[Evernote Linux Beta Program][2]
|
||||
|
||||
向下滚动一点,接受“早期测试计划”的条款和条件。你会看到一个“立即安装”的按钮出现在屏幕上。点击它来下载 DEB 文件。
|
||||
|
||||
![][3]
|
||||
|
||||
要[从 DEB 文件安装应用][4],请双击它。它应该会打开软件中心,并给你选择安装它。
|
||||
|
||||
![][5]
|
||||
|
||||
安装完成后,在系统菜单中搜索 Evernote 并启动它。
|
||||
|
||||
![][6]
|
||||
|
||||
当你第一次启动应用时,你需要登录到你的 Evernote 账户。
|
||||
|
||||
![][7]
|
||||
|
||||
第一次运行会带你进入“主页面”,在这里你可以整理你的笔记本,以便更快速地访问。
|
||||
|
||||
![][8]
|
||||
|
||||
你现在可以享受在 Linux 上使用 Evernote 了。
|
||||
|
||||
### 体验 Evernote 的 Linux 测试版客户端
|
||||
|
||||
由于软件处于测试版,因此这里或那里会有些问题。
|
||||
|
||||
如上图所示,Evernote Linux 客户端检测到 [Ubuntu 中的深色模式][9]并自动切换到深色主题。然而,当我把系统主题改为浅色或标准主题时,它并没有立即改变应用主题。这些变化是在我重启 Evernote 应用后才生效的。
|
||||
|
||||
另一个问题是关于关闭应用。如果你点击 X 按钮关闭 Evernote,程序会进入后台而不是退出。
|
||||
|
||||
有一个应用指示器,似乎可以启动最小化的 Evernote,就像 [Linux 上的 Skype][10]。不幸的是,事实并非如此。它打开了便笺,让你快速输入笔记。
|
||||
|
||||
这为你提供了另一个 [Linux 上的笔记应用][11],但它也带来了一个问题。这里没有退出 Evernote 的选项。它只用于打开快速记事应用。
|
||||
|
||||
![][12]
|
||||
|
||||
那么,如何退出 Evernote 应用呢?为此,再次打开 Evernote 应用。如果它在后台运行,在菜单中搜索它,并启动它,就像你重新打开它一样。
|
||||
|
||||
当 Evernote 应用在前台运行时,点击 File->Quit 退出 Evernote。
|
||||
|
||||
![][13]
|
||||
|
||||
这一点开发者应该在未来的版本中寻求改进。
|
||||
|
||||
我也不能说测试版的程序将来会如何更新。它没有添加任何仓库。我只是希望程序本身能够通知用户有新的版本,这样用户就可以下载新的 DEB 文件。
|
||||
|
||||
我并没有订阅 Evernote Premium,但我仍然可以在没有网络连接的情况下访问保存的网络文章和笔记。很奇怪,对吧?
|
||||
|
||||
总的来说,我很高兴看到 Evernote 终于努力把这个应用带到了 Linux 上。现在,你不必再尝试第三方应用来在 Linux 上使用 Evernote 了,至少在 Ubuntu 和基于 Debian 的发行版上是这样。当然,你可以使用 [Evernote 替代品][14],比如 [Joplin][15],它们都是开源的。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/install-evernote-ubuntu/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://evernote.com/
|
||||
[2]: https://evernote.com/intl/en/b1433t1422
|
||||
[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/evernote-early-access-linux.png?resize=799%2C495&ssl=1
|
||||
[4]: https://itsfoss.com/install-deb-files-ubuntu/
|
||||
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/install-evernote-linux.png?resize=800%2C539&ssl=1
|
||||
[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/evernote-ubuntu.jpg?resize=800%2C230&ssl=1
|
||||
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/evernote-running-ubuntu.png?resize=800%2C505&ssl=1
|
||||
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/evernote-on-ubuntu.png?resize=800%2C537&ssl=1
|
||||
[9]: https://itsfoss.com/dark-mode-ubuntu/
|
||||
[10]: https://itsfoss.com/install-skype-ubuntu-1404/
|
||||
[11]: https://itsfoss.com/note-taking-apps-linux/
|
||||
[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/evernote-app-indicator.png?resize=800%2C480&ssl=1
|
||||
[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/quit-evernote-linux.png?resize=799%2C448&ssl=1
|
||||
[14]: https://itsfoss.com/5-evernote-alternatives-linux/
|
||||
[15]: https://itsfoss.com/joplin/
|
Loading…
Reference in New Issue
Block a user