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

This commit is contained in:
geekpi 2021-07-27 08:49:43 +08:00
commit e17cac36e4
45 changed files with 4286 additions and 1315 deletions

View File

@ -0,0 +1,50 @@
[#]: collector: "lujun9972"
[#]: translator: "Arzelan"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13610-1.html"
[#]: subject: "6 evening rituals for working in tech"
[#]: via: "https://opensource.com/article/20/11/evening-rituals-working-tech"
[#]: author: "Jen Wike Huger https://opensource.com/users/jen-wike"
IT 人的 6 个晚上放松方式
======
> 在结束了一天的远程会议、邮件往来、写代码和其他协作工作后,你在晚上如何放松自己呢?
![](https://img.linux.net.cn/data/attachment/album/202107/24/100720afeq20kf2wfp4qwi.jpg)
这个奇怪的时代一方面给我们放慢脚步的机会,但另一方面来说,却比以前更忙了,尤其是当你除了照顾自己还要照顾家人的时候。俗话说,空杯子倒不出酒。所以,让我们看看在关上电脑或者完成最后一件工作之后,能为自己做些什么?
1、走出家门做几次深呼吸不要在乎是不是下雪天让新鲜的空气从肺部充满全身。如果可以的话在院子里走走或者去街上逛逛。
2、如果有时间的话给自己沏杯茶红茶含有咖啡因最好不要晚上喝可以喝绿茶或者花果茶然后在你穿上鞋或许还有外套时让它稍微凉一下。把茶倒在保温杯里在小区周围散散步。不用设置目标或者目的地就随便走走。如果你时间不充裕的话可以定一个 15 分钟的闹钟。
3、放一首突然想到的歌或者听之前想听但是一直没机会听的歌。
4、如果你有时间的话别在椅子上继续坐着可以站起来跳一段舞活动活动或者到床上平躺着躺着的时候什么也不要想放空自己让大脑休息休息。研究表明给大脑一段空白时间后可以更好的思考。
5、打开你的 [电子书应用][2] 或者拿起一本纸质书,看纸质书相对来说对眼睛好点。享受轻松的阅读,如果不能长时间阅读的话,起码给自己留出能阅读一个章节的时间。
6、制做一些美食。享受把从杂货店买到的基本的食材按照菜谱做成一份美味佳肴的成就感和兴奋感。
你也可以在晚上把其中一些综合起来做,好好放松。如果你是 IT 人,那么无论是在 [早上][3]、中午、晚上用这些方式放松都很有效,因为现在我们都是在家工作,远程办公,没有和同事面对面交流时的闲暇。
那么,你的晚上放松方式是什么?
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/11/evening-rituals-working-tech
作者:[Jen Wike Huger][a]
选题:[lujun9972][b]
译者:[Arzelan](https://github.com/Arzelan)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/jen-wike
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDUCATION_jadud_farm-road.png?itok=of8IuSM5 "A farm road"
[2]: https://opensource.com/article/20/2/linux-ebook-readers
[3]: https://opensource.com/article/20/10/tech-morning-rituals

View File

@ -0,0 +1,197 @@
[#]: subject: (Configuring Vim as a Writing Tool)
[#]: via: (https://news.itsfoss.com/configuring-vim-writing/)
[#]: author: (Theena https://news.itsfoss.com/author/theena/)
[#]: collector: (lujun9972)
[#]: translator: (piaoshi)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13607-1.html)
将 Vim 配置成一个写作工具
======
> 我使用 Vim 来写小说。我是这样配置它的。
![](https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/05/Setting-Up-Vim-for-Writing.jpg?w=1200&ssl=1)
在我的第一个专栏中,我谈到了我为什么把 [我的写作工作迁移到了 Vim 上][1] —— 远离了现代写作者们的标准工具如文字处理器MS Word 及它的开源替代方案)、文本编辑器(记事本,因为直到去年我一直是 Windows 用户)和云存储技术。如果你是一个写作者,在继续下面的内容前,我建议你先阅读一下 [那篇文章的第一部分][1] 。
基本上可以说,你使用的设备越多,你需要的写作工具就越多,最终你的工作流程就越复杂。这一点对我来说是很贴切的,因为我有四台设备,包括一部安卓手机,一台日常用的运行 Linux 的主力笔记本电脑,还有两台旧的笔记本电脑,其中一台是 Mac我去户外拍摄时会带着它。
Vim 对于我和我的工作方式来说是一个完美的解决方案;虽然我不会说我的新的工作流程是现代写作者工作的最佳方式,但我可以说的是,对于写作者来说,拥有一个能在我们所有设备上工作的工具非常重要的,并且这个工具要足够强大以满足我们写作者每天从事的不同类型的写作需求。
从这个角度来看Vim 的主要优势是它是跨平台的 —— 无论在什么设备上Vim 都能工作。在苹果生态系统中使用 Vim 的情况我就不细说了,但粗略地看一下 [这个应用程序][2] 的评论,我就会知道,总会有人在各种地方使用 Vim不管他们使用的是什么设备。
现在我们假设你是一个想开始使用 Vim 的写作者。当你安装了它,你该从哪里开始呢?
我在这一部分给你的并不算是教程,而是一系列的建议,包含对一个用于诗歌写作的 `.vimrc` 配置文件的解读。只要有可能,我就会链接到我学习相应内容时用到的 YouTube 上的教程。
对于 Linux 用户来说,系统已经预装了 Vim —— 通过你喜欢的终端模拟器就可以启动它。对于 Windows 和 Mac 用户,你可以从 [Vim 官方网站][3] 下载它。
### 建议
**安装/启用 Vim 后**
* 通过终端打开 Vim Tutor。Mac 用户可以用这种方式启动,而 Windows 用户也可以用这种方法启动。[LCTT 译注:原文这里本应该有链接,可能作者忘记添加了。无论如何,在终端中, Linux 中的命令是 `vimtutor`Windows 在安装目录下找到 `vimtutor.bat` 命令并运行Mac应该与 Linux 一样?我没 Mac 呀!])在这个阶段,你不会使用 Vim 进行任何写作 —— 相反,你要每天花 15 分钟做 Vim 教程。不要多花一分钟或少花一分钟;看看在规定的 15 分钟内,你能在教程中取得多大的进展。你会发现,每天你都会在教程中取得更大的进步。在一个月内,你应该能够利用这些 15 分钟完成整个教程。
* 成为一个更好的打字员对 Vim 的使用来说有极大的好处。这不是必须的,但我正在重新学习打字,它的副作用是使 Vim 变得更加有用了。我每次都以花 15 分钟练习打字开始,作为进入 Vim 教程前的热身。
在每一天的开始,我分配了 30 分钟的时间做这两项练习进行热身,而每天晚上睡觉前再分配 30 分钟进行练习以让我安定下来。这样的做法帮我快速从旧的工具包过渡到了 Vim但你的安排可能有所不同。
我再次强调,**除了 Vim Tutor 之外**,上述步骤都是可选的;这完全取决于你个人的动机水平。
现在我们来到了这篇文章的重点:如何配置 Vim ,使它对写作者友好?
### 如何配置用于写作的 .vimrc
在开始之前,我想在这里提醒各位读者,我不是一个技术人员 —— 我是一个小说家 —— 你在下面看到的任何错误都是我自己的;我希望有经验的 Vim 用户能提供反馈,告诉我如何进一步完善我的配置文件。
下面是我的 `.vimrc` 文件。你可以从我的 [GitHub][4] 上下载,并进一步完善它:
```
syntax on
set noerrorbells " 取消 Vim 的错误警告铃声,关闭它以免打扰到我们
set textwidth=100 " 确保每一行不超过 100 字符
set tabstop=4 softtabstop=4
set shiftwidth=4
set expandtab
set smartindent
set linebreak
set number
set showmatch
set showbreak=+++
set smartcase
set noswapfile
set undodir=~/.vim/undodir
set undofile
set incsearch
set spell
set showmatch
set confirm
set ruler
set autochdir
set autowriteall
set undolevels=1000
set backspace=indent,eol,start
" 下面的设置确保按写作者而不是程序员喜欢的方式折行
set wrap
nnoremap <F5> :set linebreak<CR>
nnoremap <C-F5> :set nolinebreak<CR>
call plug#begin('~/.vim/plugged')
" 这是颜色风格插件
Plug 'colepeters/spacemacs-theme.vim'
Plug 'sainnhe/gruvbox-material'
Plug 'phanviet/vim-monokai-pro'
Plug 'flazz/vim-colorschemes'
Plug 'chriskempson/base16-vim'
Plug 'gruvbox-community/gruvbox'
" 这是为了更容易的诗歌写作选择的一些插件
Plug 'dpelle/vim-LanguageTool'
Plug 'ron89/thesaurus_query.vim'
Plug 'junegunn/goyo.vim'
Plug 'junegunn/limelight.vim'
Plug 'reedes/vim-pencil'
Plug 'reedes/vim-wordy'
" 这一部分是为了更容易地与机器集成,用了 vim-airline 这类插件
Plug 'vim-airline/vim-airline'
" 这一部分外理工作区和会话管理
Plug 'thaerkh/vim-workspace'
" 与上面插件相关, 下面的代码将你的所有的会话文件保存到一个你工作区之外的目录
let g:workspace_session_directory = $HOME . '/.vim/sessions/'
" 与上面插件相关,这是一个 Vim 活动的跟踪器
Plug 'wakatime/vim-wakatime'
" 一个干扰因素:我在这里使用了一些 Emacs 的功能,特别是 org-mode
Plug 'jceb/vim-orgmode'
" 这是文件格式相关插件
Plug 'plasticboy/vim-markdown'
call plug#end()
colorscheme pacific
set background=dark
if executable('rg')
let g:rg_derive_root='true'
endif
```
学习如何安装 Vim 插件时,这个[教程](https://www.youtube.com/watch?v=n9k9scbTuvQ)帮助了我。我使用 Vim Plugged 插件管理器是因为在我看来它是最简单、最优雅的。
![][5]
#### 对于写作者的 .vimrc 选项的整理
* `syntax on`:这可以确保 Vim 知道我在使用什么语法。做笔记、写这种文章时我主要使用 Markdown而在写小说的时候纯文本是我的首选格式。
* `set noerrorbells`:为了你的精神状态,我强烈建议打开这个选项。
* `set textwidth=100`:为了便于阅读,没有人愿意横向滚动一个文本文件。
* `set spell`:如果有拼写错误的话提醒你。
* `set wrap`:确保文本以写作者而不是程序员的方式进行折行。
你会注意到,我没有花更多时间讨论其他一些基本配置选项,因为我并不觉得那些对写作者来说有多重要。因为我做一些业余的编码工作,所以我的 `.vimrc` 配置反映了这一点。如果你只想在 Vim 上写作,那么上述配置就应该能让你顺利开始。
从这点上来说,你的 `.vimrc` 是一个活的文档,它能生动地反映你想用 Vim 做什么,以及你希望 Vim 如何为你做这些事情。
#### 关于插件的说明
第 43-98 行之间是我对插件的配置。如果你已经学习了关于如何安装 Vim 插件的教程,我强烈推荐你从以下专为写作开发的 Vim 插件开始:
* `vim-LanguageTool`
* `thesaurus_query.vim`
* `vim-pencil`
* `vim-wordy`
* `vim-goyo`
* `vim-markdown`
#### 总结
在这篇文章中,我们简单地[介绍](https://youtu.be/Pq3JMp3stxQ)了写作者可以怎样开始使用 Vim以及一个在写作工作中需要的 `.vimrc` 入门配置。除了我的 `.vimrc` 之外,我还将在这里链接到我在 GitHub 上发现的其他写作者的 `.vimrc`,它们是我自己配置时的灵感来源。
![][6]
请劳记,这只是一个写作者的 `.vimrc` 的入门配置。你会发现随着你的需求的发展Vim 也可以随之发展。因此,投入一些时间学习配置你的 `.vimrc` 是值得的。
在下一篇文章中,我将会检视我在写作时的工作流程的具体细节,这个工作流程中我使用了 Vim 和 Git 及 GitHub。
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/configuring-vim-writing/
作者:[Theena][a]
选题:[lujun9972][b]
译者:[piaoshi](https://github.com/piaoshi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/theena/
[b]: https://github.com/lujun9972
[1]: https://news.itsfoss.com/how-i-started-loving-vim/
[2]: https://apps.apple.com/us/app/ivim/id1266544660
[3]: https://www.vim.org/
[4]: https://github.com/MiragianCycle/dotfiles
[5]: https://i1.wp.com/i.ytimg.com/vi/n9k9scbTuvQ/hqdefault.jpg?w=780&ssl=1
[6]: https://i2.wp.com/i.ytimg.com/vi/Pq3JMp3stxQ/hqdefault.jpg?w=780&ssl=1

View File

@ -0,0 +1,40 @@
[#]: subject: (My family's Linux story)
[#]: via: (https://opensource.com/article/21/5/my-linux-story)
[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen)
[#]: collector: (lujun9972)
[#]: translator: (shiboi77)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13614-1.html)
我家的 Linux 故事
======
> 我们在 Linux 的第一次尝试只是一个 apt-get 的距离。
![](https://img.linux.net.cn/data/attachment/album/202107/25/065040z2zt9lb9fc99kcho.jpg)
我在 Linux 的第一次尝试是那种“或许我应该试一试”的情况。
那是 1990 年代,我在一些软盘上找到了用某种打包方式打包的红帽发行版,我为家里的笔记本电脑买了第二个硬盘,然后开始安装它。这是一件有趣的实验,但是我记得当时家人还没有准备好在电脑上使用 Linux。转眼到了 2005 年,我最终放弃了这种做法,买了一台可爱的东芝笔记本电脑,来运行 Windows XP。在工作中我有一台有点年头的 SUN SPARCStation 5并且我不太喜欢当时整个 Solaris 的发展方向(基于 Motif 的桌面)。我真的想要用 GIMP 来完成一些这样或那样的项目,但是在 Solaris 上安装 GNOME 1.x也许是 1.4?)的曲折旅程是很有挑战性的。所以,我实际上是在考虑跳槽到 Windows XP。但是在我的家用机上用了几个月之后我发现我更不喜欢在 Solaris 上运行 GNOME所以我安装了 Ubuntu Hoary Hedgehog 5.04,随后在我的笔记本电脑上安装了 Breezy Badger 5.10。这太棒了,那台拥有 3.2GHz 奔腾处理器、2GB 内存和 100GB 的硬盘的机器就在我的 SPARCStation 5 旁边运行。
突然之间,我不再用拼凑起来的 Solaris 安装包来试图去让东西运行起来,而只是用 apt-get 就可以了。并且这个时机也很好。我家庭和我从 2006 年 8 月到 2007 年 7 月居住在法国格勒诺布尔,当时我的妻子在休假。因为有了运行 Linux 的东芝笔记本,我可以带着我的工作一起走。那个时候我在几个大的项目上做了大量的 GIS 数据处理,我发现我可以在 PostGIS / PostgreSQL 上做同样的事情,比我们在加拿大家中使用的昂贵得多的商业 GIS 软件要快得多。大家都很开心,尤其是我。
这一路上发生的有趣的事情是,我们把另外两台电脑带到了法国 —— 我妻子的类似的东芝电脑(运行 XP对她来说很好用和我们孩子最近新买的东芝牌笔记本电脑也运行 XP。也就在圣诞节过后他们有一些朋友过来无意中在他们的电脑上安装了一个讨厌的、无法清除的病毒。经过几个小时甚至几天后我的一个孩子问我“爸爸我们就不能安装和你电脑上一样的东西吗”然后三个新的 Linux 用户就这样产生了。我的儿子29 岁了,依然是一个快乐的 Linux 用户,我猜他有第四或第五台 Linux 笔记本电脑了,最后几台都是由 System 76 提供的。我的一个女儿三年前开始读法学院时被迫转换为 Windows因为她所在的学校有一个强制性的测试框架只能在 Windows 上运行,而且据称会检测虚拟机之类的东西(请不要让我开始骂人)。而我的另一个女儿被她的公司为她买的 Macbook Air 诱惑了。
哦,好吧,不可能全都赢了吧!
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/5/my-linux-story
作者:[Chris Hermansen][a]
选题:[lujun9972][b]
译者:[shiboi77](https://github.com/shiboi77)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/clhermansen
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE (Terminal command prompt on orange background)

View File

@ -3,24 +3,26 @@
[#]: author: "Sarvottam Kumar https://itsfoss.com/author/sarvottam/"
[#]: collector: "lujun9972"
[#]: translator: "mcfd"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13608-1.html"
Hash Linux: 预配置 Xmonad、Awesome、i3 和 Bspwm 窗口管理器的 Arch Linux 衍生版
Hash Linux:预配置了四种平铺窗口管理器的 Arch Linux 衍生版
======
通过一些努力,[你可以安装 Arch Linux][1]。也可以在你的 Arch 系统上安装一个你选择的桌面环境或窗口管理器。
![](https://img.linux.net.cn/data/attachment/album/202107/23/112405tt57nu7neuddkk7k.jpg)
通过一些努力,[你能安装上 Arch Linux][1],也可以在你的 Arch 系统上安装一个你选择的桌面环境或窗口管理器。
这需要一些时间和精力,但肯定是可以实现的。但是,有一些项目可以减轻你的痛苦,为你提供一个预先配置好的桌面环境或窗口管理器的系统。[ArcoLinux][2] 就是这样一个例子。
最近,我发现了另一个项目,它只专注于在出色的 Arch 发行版上提供完善的窗口管理器的选择。
[Hash Project][3] 提供了四种预配置平铺式窗口管理器的 Arch 变体Awesome、 [Xmonad][4]、 i3、和 Bspwm。
[Hash 项目][3] 提供了四种预配置有平铺式窗口管理器的 Arch 变体Awesome、[Xmonad][4]、 i3 和 Bspwm。
如果你是一个初学窗口管理器的人Hash Project 绝对是你应该马上尝试的。不用先投入时间去配置它,你就可以探索窗口管理器的潜力,并习惯由键盘驱动的系统。
如果你是一个刚刚接触窗口管理器的人Hash 项目绝对是你应该马上尝试的。不用先投入时间去配置它,你就可以深入探索窗口管理器,并习惯由键盘驱动的系统。
在本文中,我将讨论我在使用 **Hash Linux Xmonad 版本** 时的部分体验,该版本采用 Linux 5.12的内核。
在本文中,我将讨论我在使用 **Hash Linux Xmonad 版本** 时的部分体验,该版本采用 Linux 5.12 的内核。
### 安装 Hash Linux
@ -28,7 +30,7 @@ Hash Linux 四个版本的 ISO 镜像均可 [下载][5] ,适用于 x86_64 系
为了避免在实体机上安装时出现的各种意外错误,我在 GNOME Boxes 中创建了一个 Hash Linux Xmonad 版本的虚拟机。
当我启动到 Hash Linux 时,我注意到两件事。 首先是一个面板,提供用于管理窗口和命令的快捷方式。 我将在安装后讨论它。 其次,是一个漂亮且易于使用的 GUI 安装程序。
当我启动到 Hash Linux 时,我注意到两件事。首先是一个面板,提供用于管理窗口和命令的快捷方式。我将在安装后讨论它。其次,是一个漂亮且易于使用的 GUI 安装程序。
![Hash Linux GUI Installer][6]
@ -40,7 +42,7 @@ Hash Linux 四个版本的 ISO 镜像均可 [下载][5] ,适用于 x86_64 系
![Hash Linux][8]
如果你曾经在你的 Linux 系统上安装过 Xmonad 窗口管理器,那么你重启后首先看到的是什么? 空白的屏幕吧。
如果你曾经在你的 Linux 系统上安装过 Xmonad 窗口管理器,那么你重启后首先看到的是什么?空白的屏幕吧。
如果你是一个初学者,或者你不知道默认的按键绑定,你会被卡在一个屏幕上。因此,在使用任何窗口管理器之前,你必须先阅读其键盘快捷键。
@ -48,17 +50,17 @@ Hash Linux 四个版本的 ISO 镜像均可 [下载][5] ,适用于 x86_64 系
因此为了简化和方便初学者Hash Linux 将重要的快捷键都钉在了桌面上。
所以,让我们先尝试其中的一些。从最重要的一个开始 `[Super]+Enter`,它可以打开默认的 termite 终端模拟器与 Z shell (ZSH)
所以,让我们先尝试其中的一些。从最重要的一个开始 `Super+Enter`,它可以打开默认的 termite 终端模拟器与 Z shellZSH
如果你多次点击它,你会发现默认情况下 Xmonad 遵循一个缩小布局,它首先将一个窗口固定在右边,然后以同样的方式将其余的全部安排在左边。
如果你多次按下它,你会发现默认情况下 Xmonad 遵循一个缩减布局,它首先将一个窗口固定在右边,然后以同样的方式将其余的全部安排在左边。
![Xmonad default layout][9]
按下 `[Super]+[Space]`,你也可以将当前的布局改为标签式布局。甚至你可以按下 `[Super]+[left+click]` 将窗口拖动。
按下 `Super+Space`,你也可以将当前的布局改为标签式布局。甚至你可以按下 `Super+leftclick` 将窗口拖动。
![Moved to float][10]
要退出当前的窗口,你可以按下 `[Super]+Q`。
要退出当前的窗口,你可以按下 `Super+Q`。
### Hash Linux 中的应用
@ -68,7 +70,7 @@ Hash Linux 四个版本的 ISO 镜像均可 [下载][5] ,适用于 x86_64 系
它还拥有大量的图形应用程序Firefox 89、Gparted、Nitrogen、Conky、Flameshot、Geany 和 CPU-X。
`[Super]+D` 是 Hash Linux 中打开应用程序搜索菜单的默认快捷键。
`Super+D` 是 Hash Linux 中打开应用程序搜索菜单的默认快捷键。
![Application search menu][12]
@ -88,17 +90,17 @@ Hash Theme Selector 是一个自制的 Hash Linux 应用程序,你可以用它
### 结束语
如果你想使用一个窗口管理器来代替桌面环境但又不想花很多时间来配置它Hash Project 可以节省你的时间。
如果你想使用一个窗口管理器来代替桌面环境但又不想花很多时间来配置它Hash 项目可以节省你的时间。
首先,它可以节省你大量的配置时间和精力,其次,它可以很轻松地让你适应使用键盘控制的系统。以后,你肯定可以学会根据自己的需要进行配置。
由于 Hash Linux 已经提供了4个带有不同的窗口管理器的 ISO你可以开始使用任何一个版本并找到你最喜欢的一个版本。总的来说它是一个[很好的 Arch Linux 衍生版][15]。
由于 Hash Linux 已经提供了 4 个带有不同的窗口管理器的 ISO你可以开始使用任何一个版本并找到你最喜欢的一个版本。总的来说它是一个 [很好的 Arch Linux 衍生版][15]。
最后我还要提一下,目前 Hash Linux 的官方[网站][3]并没有包含很多关于它的信息。
最后我还要提一下,目前 Hash Linux 的官方 [网站][3] 并没有包含很多关于它的信息。
![][16]
早期的[网站][17](我现在无法访问)也在发布信息中提到,在我上次访问时,其中包含了许多关于它的信息,包括配置细节等。
在发布信息中也提到了一个早期的 [网站][17](我现在无法访问),在我上次访问时,其中包含了许多关于它的信息,包括配置细节等。
不想入 Arch 的教,只想用平铺式窗口管理器?可以试试 [Regolith Linux][18] 。它是预先配置了 i3wm 的 Ubuntu。棒极了对吧
@ -109,7 +111,7 @@ via: https://itsfoss.com/hash-linux-review/
作者:[Sarvottam Kumar][a]
选题:[lujun9972][b]
译者:[mcfd](https://github.com/mcfd)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -3,14 +3,16 @@
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13617-1.html)
在 Linux 上批量处理图像的 Converseen
======
Converseen 是一个免费的开源软件,用于批量图像转换。有了这个工具,你可以一次将多张图片转换成另一种格式,调整大小,改变它们的长宽比,旋转或翻转它们。
![](https://img.linux.net.cn/data/attachment/album/202107/25/215958jd5jl9q2jlzqvvg6.jpg)
Converseen 是一个用于批量图像转换的自由开源软件。有了这个工具,你可以一次将多张图片转换成另一种格式、调整大小、改变它们的长宽比、旋转或翻转它们。
对于像我这样的人来说,这是一个很方便的工具,我必须处理多个不同大小的截图,但在上传到网站之前必须调整它们的大小。
@ -26,7 +28,7 @@ Converseen 是一个免费的开源软件,用于批量图像转换。有了这
![][3]
你也可以选择将转换后的图像以不同的名称保存在同一目录或其他位置。你也可以覆盖现有的图像。
你也可以选择将转换后的图像以不同的名称保存在同一目录或其他位置也可以覆盖现有的图像。
你不能添加文件夹,但你可以一次选择并添加多个图像。
@ -66,11 +68,11 @@ sudo dnf install converseen
sudo pacman -Sy converseen
```
Converseen 也可用于 Windows 和 FreeBSD。你可以在项目网站的下载页面获得相关说明。
Converseen 也可在 Windows 和 FreeBSD 下使用。你可以在项目网站的下载页面获得相关说明。
[下载 Converseen][6]
- [下载 Converseen][6]
它的源码可在 GitHub 仓库[获取][7]。
它的源码可在 GitHub 仓库 [获取][7]。
如果你正在寻找一个更简单的方法来调整一张图片的大小,你可以使用这个巧妙的技巧,[在 Nautilus 文件管理器中用右键菜单调整图片大小和旋转图片][8]。
@ -83,7 +85,7 @@ via: https://itsfoss.com/converseen/
作者:[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/) 荣誉推出

View File

@ -3,22 +3,20 @@
[#]: author: (Yazan Monshed https://fedoramagazine.org/author/yazanalmonshed/)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13615-1.html)
在 Fedora 上开始使用 Podman
如何在 Fedora 上使用 Podman
======
![][1]
来自 Podman 项目的 Podman 标志 <https://github.com/containers/podman/tree/main/logo>
[Podman][2] 是一个无守护程序的容器引擎,用于在你的 Linux 系统上开发、管理和运行 OCI 容器。在这篇文章中,我们将介绍 podman 以及如何用 nodejs 构建一个小型应用来使用它。该应用将是非常简单和干净的。
[Podman][2] 是一个无守护程序的容器引擎,用于在你的 Linux 系统上开发、管理和运行 OCI 容器。在这篇文章中,我们将介绍 Podman 以及如何用 nodejs 构建一个小型应用来使用它。该应用将是非常简单和干净的。
### 安装 Podman
如果你已经安装了 docker只需在终端输入 **alias docker=podman**,那么 Podman 的命令就与 [docker][3] 相同
Podman 的命令就与 [docker][3] 相同,如果你已经安装了 Docker只需在终端输入 `alias docker=podman`
在 Fedora 中Podman 是默认安装的。但是如果你因为任何原因没有安装,你可以用下面的命令安装它:
@ -26,9 +24,9 @@
sudo dnf install podman
```
对于 Fedora [silverblue][4] 用户,podman 已经安装在你的操作系统中了。
对于 Fedora [silverblue][4] 用户,Podman 已经安装在你的操作系统中了。
安装后,运行 hello world 镜像,以确保一切正常:
安装后,运行 hello world 镜像,以确保一切正常:
```
podman pull hello-world
@ -55,13 +53,13 @@ This message shows that your installation appears to be working correctly.
### 简单的 Nodejs 应用
首先,我们将创建一个文件夹 **webapp**,在终端输入以下命令
首先,我们将创建一个文件夹 `webapp`,在终端输入以下命令:
```
mkdir webapp && cd webapp
```
现在创建文件 **_package.json_**,该文件包括项目运行所需的所有依赖项。在文件 _package.json_ 中复制以下代码:
现在创建文件 `package.json`,该文件包括项目运行所需的所有依赖项。在文件 `package.json` 中复制以下代码:
```
{
@ -74,7 +72,7 @@ mkdir webapp && cd webapp
}
```
创建文件 _index.js_,并在其中添加以下代码:
创建文件 `index.js`,并在其中添加以下代码:
```
const express = require('express')
@ -89,11 +87,11 @@ app.listen(8081, () => {
});
```
你可以从[这里][5]下载源代码。
你可以从 [这里][5] 下载源代码。
### 创建 Dockerfile
首先,创建一个名为 _Dockerfile_ 的文件,并确保第一个字符是大写,而不是小写,然后在那里添加以下代码:
首先,创建一个名为 `Dockerfile` 的文件,并确保第一个字符是大写,而不是小写,然后在那里添加以下代码:
```
FROM node:alpine
@ -103,13 +101,13 @@ RUN npm install
CMD ["npm", "start"]
```
确保你在 _webapp_ 文件夹内,然后显示镜像,然后输入以下命令:
确保你在 `webapp` 文件夹内,然后显示镜像,然后输入以下命令:
```
podman build .
```
确保加了**点**。镜像在你的机器上被创建,你可以用以下命令显示它:
确保加了 `.`。镜像将在你的机器上创建,你可以用以下命令显示它:
```
podman images
@ -121,11 +119,11 @@ podman images
podman run -p 8080:8080 <image-name>
```
现在在你的浏览器中打开 _localhost:8080_,你会看到你的应用已经工作。
现在在你的浏览器中打开 `localhost:8080`,你会看到你的应用已经工作。
### 停止和删除容器
使用 _CTRL-C_ 退出容器,你可以使用容器 ID 来删除容器。获取 ID 并使用这些命令停止容器:
使用 `CTRL-C` 退出容器,你可以使用容器 ID 来删除容器。获取 ID 并使用这些命令停止容器:
```
podman ps -a
@ -138,7 +136,7 @@ podman stop <container_id>
podman rmi <image_id>
```
[官方网站][2]上阅读更多关于 podman 和它如何工作的信息。
[官方网站][2] 上阅读更多关于 Podman 和它如何工作的信息。
--------------------------------------------------------------------------------
@ -147,7 +145,7 @@ via: https://fedoramagazine.org/getting-started-with-podman-in-fedora/
作者:[Yazan Monshed][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/) 荣誉推出

View File

@ -0,0 +1,216 @@
[#]: subject: (Linux package managers: dnf vs apt)
[#]: via: (https://opensource.com/article/21/7/dnf-vs-apt)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
[#]: collector: (lujun9972)
[#]: translator: (perfiffer)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13620-1.html)
Linux 包管理器比较dnf 和 apt
======
> 包管理器提供大致相同的功能:安装、管理和移除应用,但是它们还是有一些不一样的地方。
![](https://img.linux.net.cn/data/attachment/album/202107/27/083002sd5zzxu37yhiz6yc.jpg)
[在 Linux 系统上获取一个应用][2] 有多种方式。例如,有新的 Flatpak 和容器方式,也有 DEB 和 RPM 这样一直以来经过考验的方式。
并没有一种通用的可以用于所有的操作系统的应用安装程序。如今,因为有无数的开发者发布软件,这导致了大部分的操作系统使用了应用商店(包括第一方和第三方)、拖放式安装,还有安装向导。不同的开发者对于他们发布的代码有不同的需求,这直接导致了他们所选择的安装方式的不同。
Linux 开创了一种通过命令行安装、管理、移除应用的包管理器的概念。`apt` 和 `dnf` 就是两种较为常见的包管理器。`apt` 命令是用来管理 DEB 格式的包,`dnf` 命令是用来管理 RPM 格式的包。这两种包管理器在理论上并不是完全互斥的尽管在实际的实践中Linux 发行版通常只会使用到其中的一种。理论上,这两种命令可以运行在同一个系统上,但是会造成安装包的重叠,版本控制也会更加困难,命令也会是冗余的。然而,如果你是在一个混合的 Linux 环境下工作,比如你的工作站运行的是一个发行版,同时需要与运行另外一种发行版的服务器进行交互,那么你最好同时掌握这两种包管理器。
### 搜索应用
当你通过包管理器安装一个应用时,你需要先知道包的名称。通常,应用的名称和包的名称是一样的。`dnf` 和 `apt` 验证要安装的包名的过程是完全相同的。
```
$ sudo dnf search zsh
====== Name Exactly Matched: zsh ======
zsh.x86_64 : Powerful interactive shell
[...]
```
使用 `apt`:
```
$ sudo apt search zsh
Sorting... Done
Full Text Search... Done
csh/stable 20110502-4+deb10u1 amd64
Shell with C-like syntax
ddgr/stable 1.6-1 all
DuckDuckGo from the terminal
direnv/stable 2.18.2-2 amd64
Utility to set directory specific environment variables
draai/stable 20180521-1 all
Command-line music player for MPD
[...]
```
如果想通过 `apt` 更快的获取相关的搜索结果,你可以使用 [正则表达式][3]
```
apt search ^zsh
Sorting... Done
Full Text Search... Done
zsh/stable 5.7.1-1 amd64
shell with lots of features
[...]
```
### 查找应用程序包
有一些命令是与其它命令捆绑在一起的,都在一个包中。在这种情况下,你可以通过包管理器去了解哪个包提供了你需要的命令。`dnf` 和 `apt` 命令在如何搜索这类元数据上是有区别的。
使用 `dnf`
```
$ sudo dnf provides pgrep
procps-ng-3.3.15-6.el8.x86_64 : System and process monitoring utilities
Repo : baseos
Matched from:
Filename : /usr/bin/pgrep
```
`apt` 命令使用子命令 `apt-file`。要使用 `apt-file`,你必须先安装它,然后提示它更新缓存:
```
$ sudo apt install apt-file
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libapt-pkg-perl libexporter-tiny-perl liblist-moreutils-perl libregexp-assemble-perl
The following NEW packages will be installed:
apt-file libapt-pkg-perl libexporter-tiny-perl liblist-moreutils-perl libregexp-assemble-perl
0 upgraded, 5 newly installed, 0 to remove and 14 not upgraded.
Need to get 297 kB of archives.
After this operation, 825 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
$ sudo apt-file update
[...]
```
你可以通过 `apt-file` 搜索命令。你可以使用此命令进行广泛的全局搜索,但假如你知道命令的执行路径,它会更准确:
```
$ sudo apt-file search /usr/bin/pgrep
pgreplay: /usr/bin/pgreplay              
procps: /usr/bin/pgrep
```
### 安装应用程序
使用`apt` 和 `dnf` 安装应用程序基本上是相同的:
```
$ sudo apt install zsh
```
使用 `dnf`,你可以使用同样的方式来安装一个包:
```
$ sudo dnf install zsh
```
许多基于 RPM 的发行版都具有组包安装的特性它会将有时表面相关的应用程序收集到一个易于安装的目标中。例如Fedora 中的 [Design Suite][4] 组包就包含流行的创意应用程序。那些想要某一个创意应用程序的艺术家可能也想要类似的应用程序,选择安装一整个组包一个简单而快速的方法,可以合理地开始建立一个数字工作室。你可以通过 `group list` 来查看可用的组包(使用 `-v` 来查看不带空格的组名):
```
$ sudo dnf group list -v
[...]
Available Groups:
Container Management (container-management)
RPM Development Tools (rpm-development-tools)
Design Suite (design-suite)
Development Tools (development)
[...]
```
使用 `group install` 子命令安装 RPM 组包:
```
$ sudo dnf group install design-suite
```
你可以使用 `@` 符号来减少输入:
```
$ sudo dnf install @design-suite
```
### 更新应用程序
使用包管理器的一个优点是,它知道所有已经安装的应用。这样你不必去寻找应用程序的更新版本。相反,你可以通过包管理器去获取更新的版本。
`dnf``apt` 使用的子命令略有不同。因为 `apt` 保存了一个需要定期更新的缓存信息,它使用 `upgrade` 子命令来更新应用程序:
```
$ sudo apt upgrade
```
相比之下,`dnf` 命令在你每次使用时都会更新元信息,所以 `update``upgrade` 子命令是可以互换的:
```
$ sudo dnf upgrade
```
这等同于:
```
$ sudo dnf update
```
### 移除应用程序
如果你曾经尝试在任何一个平台上手动删除一个应用程序,你就会知道,应用程序删除后,在硬盘上会残留各种文件,比如首选项文件、数据或图标。所以包管理器的另一个优点是,包管理器管理着包中安装的每一个文件,可以很方便的删除:
```
$ sudo dnf remove zsh
```
`remove` 子命令也适用于 `apt`
```
$ sudo apt remove zsh
```
使用 `apt` 命令删除一个包并不会删除已修改的用户配置文件,以防你意外删除了包。如果你想通过 `apt` 命令删除一个应用及其配置文件,请在你之前删除过的应用程序上使用 `purge` 子命令:
```
$ sudo apt purge zsh
```
`apt``dnf` 都不会删除家目录中的数据和配置文件(即使使用 `purge` 子命令)。如果想要从家目录中删除数据,你必须手动操作(通常你可以在 `~/.config``~/.local` 文件中找到)。
### 了解包管理
无论你选择的发行版支持的是 `apt` 还是 `dnf`,这些命令的用途大致相同。它们可以帮助你安装、更新和移除包。这两种包管理器是目前最通用的包管理器。它们的语法元素在很大程度上是相同的,所以在两者之间切换非常容易。
`apt``dnf` 还有一些高级功能,例如仓库管理,但这些功能并不像你使用 `search``install` 那样频繁。
无论你更经常使用哪种包管理器,你都可以下载我们的 [apt 备忘单][5] 和 [dnf 备忘单][6],以便你在最需要的时候可以查询使用语法。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/dnf-vs-apt
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[perfiffer](https://github.com/perfiffer)
校对:[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/OSDC_gift_giveaway_box_520x292.png?itok=w1YQhNH1 (Gift box opens with colors coming out)
[2]: https://opensource.com/article/18/1/how-install-apps-linux
[3]: https://opensource.com/article/18/5/getting-started-regular-expressions
[4]: https://labs.fedoraproject.org/en/design-suite/
[5]: https://opensource.com/downloads/apt-cheat-sheet
[6]: https://opensource.com/downloads/dnf-cheat-sheet

View File

@ -0,0 +1,69 @@
[#]: subject: (Ubuntu 20.10 Reached End of Life, Time to Upgrade!)
[#]: via: (https://news.itsfoss.com/ubuntu-20-10-end-of-life/)
[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/)
[#]: collector: (lujun9972)
[#]: translator: (zd200572)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13611-1.html)
Ubuntu 20.10 到达生命终点,该升级啦!
======
> 哦Ubuntu 20.10 将不再收到任何更新。如果你还在使用它,你的系统将面临风险,请考虑升级到 Ubuntu 21.04
![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/ubuntu-20-10-eof.png?w=1200&ssl=1)
Ubuntu 20.10Groovy Gorilla2021 年 7 月 22 日停止支持啦。它是一个非长期支持发行版本,[带来了一些令人兴奋的新特性][1]。
通常,非长期支持发行版维护 9 个月所以生命周期结束意味着Ubuntu 20.10 用户将没有安全和维护更新。
你也会错过已安装应用的更新,[使用 apt 命令][2] 安装新软件也会面临问题。如果不手动修改 `sources.list`(不推荐),使用软件中心也将是个问题。
支持周期的结束会影响所有的其他 Ubuntu 特色版本,像 Kubuntu、Lubuntu、MATE 等。
但是像 Linux Mint 和 elementary OS 这样的发行版不依赖于非长期支持发行版,你不必有任何担心。
使用下面的命令在终端 [检查下你安装的 Ubuntu 版本][3]是个好主意:
```
lsb_release -a
```
### 升级到 Ubuntu 21.04Hirsute Hippo正是时候
毫无疑问,你需要升级到 Ubuntu 21.04 才能获得最新的更新和安全改进。
[Ubuntu 21.10 版本][4] 将在几个月后发布,所以你也可以尝试到时升级到这个版本。
现在,你可以按照我们的 [Ubuntu 升级][5]教程来开始升级。
我推荐你备份一下,以防升级过程中出现问题。
如果你想重新安装,也可以。
### 还在用 Ubuntu 20.10?
从技术上来说,你可以继续使用不受支持的版本,如果你不想安全问题蔓延,建议还是升级到最新的版本,比如 Ubuntu 21.04。
Ubuntu 21.04 将会提供支持到 2022 年 1 月,升级前你可能想看下 [Ubuntu 21.04 的特性][6]。
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/ubuntu-20-10-end-of-life/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[zd200572](https://github.com/zd200572)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/ubuntu-20-10-features/
[2]: https://itsfoss.com/apt-command-guide/
[3]: https://itsfoss.com/how-to-know-ubuntu-unity-version/
[4]: https://news.itsfoss.com/ubuntu-21-10-release-schedule/
[5]: https://itsfoss.com/upgrade-ubuntu-version/
[6]: https://news.itsfoss.com/ubuntu-21-04-features/

View File

@ -0,0 +1,237 @@
[#]: subject: (Top 7 Linux Laptops You Can Buy in 2021)
[#]: via: (https://news.itsfoss.com/best-linux-laptops-2021/)
[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Top 7 Linux Laptops You Can Buy in 2021
======
Linux laptops are the perfect alternatives to macOS and Windows-powered laptops.
Technically, you can turn any laptop of your choice into a Linux machine by choosing to install any Linux distribution available.
But, here, our focus will be on the laptops that offer Linux out-of-the-box, ensuring the best compatibility and support no matter what kind of budget you have.
### Linux Laptops by Popular Brands
It is often the best choice for a consumer to opt for a Linux laptop built by a popular manufacturer.
You do not have to worry about the after-sales, warranty extensions, and service repairs.
Dell and Lenovo are usually the ones who provide laptops with Linux pre-installed.
Do note that everything is subject to availability depending on the country/region.
*_Pricing mentioned in this article is converted to USD for easy comparison, excluding shipping and other extras._
#### 1\. Lenovo Thinkpad X1 Carbon (Gen 8 / Gen 9)
![][1]
_**Pricing**: Starts at **$1535**_
The entire Thinkpad series by Lenovo is a popular choice among Linux users. It is built to last and offers good compatibility
However, it stays on the expensive side.
You will have three choices to go with depending on what you go for. If you are customizing a Gen 9 Thinkpad laptop, you will have Ubuntu 20.04 and Fedora 33 as your options to have installed.
For Gen 8 models, it seems that Fedora 33 is off the table, and it is Fedora 32 instead, along with Ubuntu 20.04.
All the variants are powered by Intel chipsets, 10th gen for Gen 8 and 11th gen for Gen 9.
Most of the other specifications remain similar with a 14-inch display (FHD, WQHD, and UHD options available), up to 32 GB RAM, 1 TB SSD, fingerprint reader, and Wi-Fi 6 support.
[Thinkpad X1 Carbon (Gen 9)][2]
[Thinkpad X1 Carbon (Gen 8)][3]
#### 2\. Dell XPS 13 Developers Edition
![][4]
_**Pricing**: Starts at **$1059**_
Dell XPS series is an impressive laptop lineup to consider running Linux.
It has been tailored to run Linux (Ubuntu 20.04) with developers in mind.
You get a 13.4-inch display (FHD and UHD options available), 11th gen i5/i7 processor, up to 32 GB RAM, 2 TB SSD, fingerprint reader, and Wi-FI 6 support.
[Dell XPS 13 Developer Edition][5]
### Laptops by Linux-only Manufacturers
If you do not want mainstream options but some unique choices to support Linux-only manufacturers in the process, there are a couple of them that you can consider.
#### 1\. System76 Gazelle
![][6]
_**Pricing**: Starts at **$1499**_
System76s laptop will come baked in with their Pop!_OS operating system which is based on Ubuntu but provides a **hassle-free out-of-the-box experience**.
It is safe to assume that System76 is like the Apple of Linux laptops who try their best to optimize Pop!_OS for their hardware offered.
They have total control over the software and hardware, so that should be some exciting product integration for end consumers.
Along with impressive essentials like 144 Hz 16.5-inch display, i7 11th gen processor, up to 8 TB NVMe SSD support—you also get an RTX 3050 GPU which should enable you to tackle a variety of demanding tasks on your laptop.
While there are some other laptops by System76, it was not available at the time of writing this. So, feel free to check out the official store page and order a customized configuration.
System76 Gazelle
#### 2\. Purism Laptop
![][7]
![][8]
_**Pricing**: Starts at **$1599**_
A laptop by Purism can be an option if you are a security-conscious user.
Librem 14 is one of their latest laptops that comes baked in with [PureOS][9] (also built by them).
While it may not offer the latest generation processors, you should be fine with the i7 10th Gen chip on board.
It supports up to 64 GB of RAM and features hardware kill switches to disable the webcam, headphone jack, Bluetooth, or wireless audio
[Librem 14][10]
#### 3\. TUXEDO Aura 15
![][7]
![][11]
_**Pricing**: Starts at **$899**_
If you want an AMD-powered laptop (with its last-gen processor Ryzen 7 4700U), Aura 15 by TUXEDO Computers is a great pick.
The key specifications include a Full HD display, up to 64 GB RAM, Wi-Fi 6 support, and an LTE module.
It comes with either Ubuntu or TUXEDO OS (based on Ubuntu Budgie) as per your customization.
[TUXEDO Aura 15][12]
#### 4\. TUXEDO Stellaris 15
![][7]
![][13]
_**Pricing**: Starts at **$2160**_
If you are looking for the latest and greatest powerhouse with options to get RTX 3080 on board, this should be a fantastic option.
It offers the latest Intel/Ryzen processor with the configuration choices and features a 3K-res display with a 165 Hz refresh rate.
Definitely not something that you would find convenient to travel with, but if you need the computing power, you can choose to go with it.
TUXEDO Stellaris 15
#### 5\. Slimbook Pro X
![][14]
_**Pricing:** Starts at **$1105**_
Slimbook focuses on lighter Laptop models that you can conveniently travel with.
It gives you the option to choose from a variety of distributions that include Ubuntu (_GNOME, KDE, MATE_), KDE Neon, Manjaro, and Fedora.
You get most of the essential specifications that include up to 2 TB SSD support, 64 GB of RAM, Full HD IPS display, and more.
While you get options for Intel and Ryzen (last-gen processors) coupled with Nvidia and Vega graphics respectively, only Ryzen was available in stock at the time of writing this.
Slimbook Pro X
#### 6\. Slimbook Essential
![][1]
_**Pric**__**ing:** Starts at **$646**_
An impressive option for a budget-friendly Linux laptop.
It offers both Ryzen and Intel variants (last-gen) to choose from. You should get the basic specifications that include up to 64 GB RAM, 2 TB SSD support, minus a great screen and dedicated graphics onboard.
[Slimbook Essential][15]
#### 7\. Jupiter 14 Pro by Juno Computers
![][16]
_**Pricing**: Starts at **$1199**_
Featuring the 11th gen Intel processors, Jupiter 14 by Juno Computers is a sweet deal with NVIDIA GTX 1650 on board.
It comes baked in with Ubuntu 20.04 with no other options to choose from.
The base configuration includes 16 GB RAM, which could make the value offering slightly better compared to some others.
You will find the ability to choose your region on their website (UK/Europe or US/Canada), make sure to utilize that.
[Jupiter Pro 14][17]
#### Honorable Mention: **PineBook Pro**
![][18]
PineBook Pro is an ARM-based laptop (with Manjaro ARM edition) that is budget-friendly and should work fine for a lot of basic tasks on Linux.
It is out of stock (until further notice) at the time of writing this. However, you might want to check that for yourself when you read this.
[Pinebook Pro][19]
### Wrapping Up
If you do not like the choices presented here, you may check out [other places from where you can by Linux laptops][20]. Depending on your budget, pick what you feel is best for you.
After all, everything comes with Linux baked in. Some give you the ability to choose from multiple distros but most of them stick to Ubuntu pre-installed.
#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
I'm not interested
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/best-linux-laptops-2021/
作者:[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://news.itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[2]: https://www.lenovo.com/us/en/laptops/thinkpad/thinkpad-x1/X1-Carbon-G9/p/22TP2X1X1C9
[3]: https://www.lenovo.com/us/en/laptops/thinkpad/thinkpad-x1/X1-Carbon-Gen-8-/p/22TP2X1X1C8
[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ3MiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[5]: https://www.dell.com/en-us/work/shop/dell-laptops-and-notebooks/new-xps-13-developer-edition/spd/xps-13-9310-laptop/ctox139w10p2c3000u
[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU0MCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9Ijc4MCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[8]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/librem14.png?resize=780%2C780&ssl=1
[9]: https://www.pureos.net
[10]: https://puri.sm/products/librem-14/
[11]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/tuxedo-aura-15.jpg?resize=780%2C780&ssl=1
[12]: https://www.tuxedocomputers.com/en/Linux-Hardware/Linux-Notebooks/15-16-inch/TUXEDO-Aura-15-Gen1.tuxedo
[13]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/tuxedo-stellaris.jpg?resize=780%2C780&ssl=1
[14]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQyMyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[15]: https://slimbook.es/en/essential-en
[16]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[17]: https://junocomputers.com/us/product/jupiter-14-pro/
[18]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ0MSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[19]: https://www.pine64.org/pinebook-pro/
[20]: https://itsfoss.com/get-linux-laptops/

View File

@ -2,7 +2,7 @@
[#]: via: (https://news.itsfoss.com/how-i-started-loving-vim/)
[#]: author: (Theena https://news.itsfoss.com/author/theena/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (piaoshi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -1,210 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Trace code in Fedora with bpftrace)
[#]: via: (https://fedoramagazine.org/trace-code-in-fedora-with-bpftrace/)
[#]: author: (Augusto Caringi https://fedoramagazine.org/author/acaringi/)
Trace code in Fedora with bpftrace
======
![][1]
bpftrace is [a new eBPF-based tracing tool][2] that was first included in Fedora 28. It was developed by Brendan Gregg, Alastair Robertson and Matheus Marchini with the help of a loosely-knit team of hackers across the Net. A tracing tool lets you analyze what a system is doing behind the curtain. It tells you which functions in code are being called, with which arguments, how many times, and so on.
This article covers some basics about bpftrace, and how it works. Read on for more information and some useful examples.
### eBPF (extended Berkeley Packet Filter)
[eBPF][3] is a tiny virtual machine, or a virtual CPU to be more precise, in the Linux Kernel. The eBPF can load and run small programs in a safe and controlled way in kernel space. This makes it safer to use, even in production systems. This virtual machine has its own instruction set architecture ([ISA][4]) resembling a subset of modern processor architectures. The ISA makes it easy to translate those programs to the real hardware. The kernel performs just-in-time translation to native code for main architectures to improve the performance.
The eBPF virtual machine allows the kernel to be extended programmatically. Nowadays several kernel subsystems take advantage of this new powerful Linux Kernel capability. Examples include networking, seccomp, tracing, and more. The main idea is to attach eBPF programs into specific code points, and thereby extend the original kernel behavior.
eBPF machine language is very powerful. But writing code directly in it is extremely painful, because its a low level language. This is where bpftrace comes in. It provides a high-level language to write eBPF tracing scripts. The tool then translates these scripts to eBPF with the help of clang/LLVM libraries, and then attached to the specified code points.
## Installation and quick start
To install bpftrace, run the following command in a terminal [using][5] _[sudo][5]_:
```
$ sudo dnf install bpftrace
```
Try it out with a “hello world” example:
```
$ sudo bpftrace -e 'BEGIN { printf("hello world\n"); }'
```
Note that you must run _bpftrace_ as _root_ due to the privileges required. Use the _-e_ option to specify a program, and to construct the so-called “one-liners.” This example only prints _hello world_, and then waits for you to press **Ctrl+C**.
_BEGIN_ is a special probe name that fires only once at the beginning of execution. Every action inside the curly braces _{ }_ fires whenever the probe is hit — in this case, its just a _printf_.
Lets jump now to a more useful example:
```
$ sudo bpftrace -e 't:syscalls:sys_enter_execve { printf("%s called %s\n", comm, str(args->filename)); }'
```
This example prints the parent process name _(comm)_ and the name of every new process being created in the system. _t:syscalls:sys_enter_execve_ is a kernel tracepoint. Its a shorthand for _tracepoint:syscalls:sys_enter_execve_, but both forms can be used. The next section shows you how to list all available tracepoints.
_comm_ is a bpftrace builtin that represents the process name. _filename_ is a field of the _t:syscalls:sys_enter_execve_ tracepoint. You can access these fields through the _args_ builtin.
All available fields of the tracepoint can be listed with this command:
```
bpftrace -lv "t:syscalls:sys_enter_execve"
```
## Example usage
### Listing probes
A central concept for _bpftrace_ are **probe points**. Probe points are instrumentation points in code (kernel or userspace) where eBPF programs can be attached. They fit into the following categories:
* _kprobe_ kernel function start
* _kretprobe_ kernel function return
* _uprobe_ user-level function start
* _uretprobe_ user-level function return
* _tracepoint_ kernel static tracepoints
* _usdt_ user-level static tracepoints
* _profile_ timed sampling
* _interval_ timed output
* _software_ kernel software events
* _hardware_ processor-level events
All available _kprobe/kretprobe_, _tracepoints_, _software_ and _hardware_ probes can be listed with this command:
```
$ sudo bpftrace -l
```
The _uprobe/uretprobe_ and _usdt_ probes are userspace probes specific to a given executable. To use them, use the special syntax shown later in this article.
The _profile_ and _interval_ probes fire at fixed time intervals. Fixed time intervals are not covered in this article.
### Counting system calls
**Maps** are special BPF data types that store counts, statistics, and histograms. You can use maps to summarize how many times each syscall is being called:
```
$ sudo bpftrace -e 't:syscalls:sys_enter_* { @[probe] = count(); }'
```
Some probe types allow wildcards to match multiple probes. You can also specify multiple attach points for an action block using a comma separated list. In this example, the action block attaches to all tracepoints whose name starts with _t:syscalls:sys_enter__, which means all available syscalls.
The bpftrace builtin function _count()_ counts the number of times this function is called. _@[]_ represents a map (an associative array). The key of this map is _probe_, which is another bpftrace builtin that represents the full probe name.
Here, the same action block is attached to every syscall. Then, each time a syscall is called the map will be updated, and the entry is incremented in the map relative to this same syscall. When the program terminates, it automatically prints out all declared maps.
This example counts the syscalls called globally, its also possible to filter for a specific process by _PID_ using the bpftrace filter syntax:
```
$ sudo bpftrace -e 't:syscalls:sys_enter_* / pid == 1234 / { @[probe] = count(); }'
```
### Write bytes by process
Using these concepts, lets analyze how many bytes each process is writing:
```
$ sudo bpftrace -e 't:syscalls:sys_exit_write /args->ret > 0/ { @[comm] = sum(args->ret); }'
```
_bpftrace_ attaches the action block to the write syscall return probe (_t:syscalls:sys_exit_write_). Then, it uses a filter to discard the negative values, which are error codes _(/args-&gt;ret &gt; 0/)_.
The map key _comm_ represents the process name that called the syscall. The _sum()_ builtin function accumulates the number of bytes written for each map entry or process. _args_ is a bpftrace builtin to access tracepoints arguments and return values. Finally, if successful, the _write_ syscall returns the number of written bytes. _args-&gt;ret_ provides access to the bytes.
### Read size distribution by process (histogram):
_bpftrace_ supports the creation of histograms. Lets analyze one example that creates a histogram of the _read_ size distribution by process:
```
$ sudo bpftrace -e 't:syscalls:sys_exit_read { @[comm] = hist(args->ret); }'
```
Histograms are BPF maps, so they must always be attributed to a map (_@_). In this example, the map key is _comm_.
The example makes _bpftrace_ generate one histogram for every process that calls the _read_ syscall. To generate just one global histogram, attribute the _hist()_ function just to _@_ (without any key).
bpftrace automatically prints out declared histograms when the program terminates. The value used as base for the histogram creation is the number of read bytes, found through _args-&gt;ret_.
### Tracing userspace programs
You can also trace userspace programs with _uprobes/uretprobes_ and _USDT_ (User-level Statically Defined Tracing). The next example uses a _uretprobe_, which probes to the end of a user-level function. It gets the command lines issued in every _bash_ running in the system:
```
$ sudo bpftrace -e 'uretprobe:/bin/bash:readline { printf("readline: \"%s\"\n", str(retval)); }'
```
To list all available _uprobes/uretprobes_ of the _bash_ executable, run this command:
```
$ sudo bpftrace -l "uprobe:/bin/bash"
```
_uprobe_ instruments the beginning of a user-level functions execution, and _uretprobe_ instruments the end (its return). _readline()_ is a function of _/bin/bash_, and it returns the typed command line. _retval_ is the return value for the instrumented function, and can only be accessed on _uretprobe_.
When using _uprobes_, you can access arguments with _arg0..argN_. A _str()_ call is necessary to turn the _char *_ pointer to a _string_.
## Shipped Scripts
There are many useful scripts shipped with bpftrace package. You can find them in the _/usr/share/bpftrace/tools/_ directory.
Among them, you can find:
* _killsnoop.bt_ Trace signals issued by the kill() syscall.
* _tcpconnect.bt_ Trace all TCP network connections.
* _pidpersec.bt_ Count new procesess (via fork) per second.
* _opensnoop.bt_ Trace open() syscalls.
* _vfsstat.bt_ Count some VFS calls, with per-second summaries.
You can directly use the scripts. For example:
```
$ sudo /usr/share/bpftrace/tools/killsnoop.bt
```
You can also study these scripts as you create new tools.
## Links
* bpftrace reference guide <https://github.com/iovisor/bpftrace/blob/master/docs/reference_guide.md>
* bpftrace (DTrace 2.0) for Linux 2018 <http://www.brendangregg.com/blog/2018-10-08/dtrace-for-linux-2018.html>
* BPF: the universal in-kernel virtual machine <https://lwn.net/Articles/599755/>
* Linux Extended BPF (eBPF) Tracing Tools <http://www.brendangregg.com/ebpf.html>
* Dive into BPF: a list of reading material [https://qmonnet.github.io/whirl-offload/2016/09/01/dive-into-bpf][6]
* * *
_Photo by _[_Roman Romashov_][7]_ on _[_Unsplash_][8]_._
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/trace-code-in-fedora-with-bpftrace/
作者:[Augusto Caringi][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/acaringi/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2019/08/bpftrace-816x345.jpg
[2]: https://github.com/iovisor/bpftrace
[3]: https://lwn.net/Articles/740157/
[4]: https://github.com/iovisor/bpf-docs/blob/master/eBPF.md
[5]: https://fedoramagazine.org/howto-use-sudo/
[6]: https://qmonnet.github.io/whirl-offload/2016/09/01/dive-into-bpf/
[7]: https://unsplash.com/@wehavemegapixels?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[8]: https://unsplash.com/search/photos/trace?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText

View File

@ -1,49 +0,0 @@
[#]: collector: "lujun9972"
[#]: translator: "Arzelan"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: subject: "6 evening rituals for working in tech"
[#]: via: "https://opensource.com/article/20/11/evening-rituals-working-tech"
[#]: author: "Jen Wike Huger https://opensource.com/users/jen-wike"
6 evening rituals for working in tech
======
After a busy day of virtual meetings, emails, coding, and collaborating,
how do you wind down for the night?
![A farm road][1]
This strange time has given us, on one hand, the chance to slow down, yet on the other, it's busier than ever. Especially if you have others in your life to care for in addition to yourself. But you can't give from an empty cup, so, this list of evening rituals is focused on what you can do for yourself right after you turn the computer off, shut the laptop, or say goodbye to the last virtual meeting of the day.
1\. Head to the nearest door and take a big, deep belly breath in... and out. I don't care if it's snowing. Fill your lungs with fresh air. Stay for a while if you can -- take a lap around the yard, or walk down the street and back.
2\. If you have some time, make a cup of tea -- black (is caffeinated, so beware), green, or herbal -- and, let it cool down while you get your shoes (and maybe a jacket) on. Pop it in a favorite thermos, and take a stroll around your neighborhood. You don't have to have a plan or a place you're walking to. Set a timer for 15 minutes if you only have a short window.
3\. Turn on a song that pops into your head or the one you didn't get a chance to jam/relax to earlier today.
4\. If you have some time, stand up and dance it out or lay all the way down with your feet up. No more sitting. Don't think, just listen. Research shows giving your brain blank space helps you think and deal better later.
5\. Open your [reader app][2] or pick up a book (the latter is easier on your eyes), and fully indulge, letting the day slip away, or give yourself enough time to read at least one chapter.
6\. Make food that feels good. Maybe that means a few basic ingredients and simple instructions. Maybe that means putting together that new, complex meal you've been excited about since you picked up the items at the grocery store.
Can you combine some of these to get even more out of your evening ritual time? If you're working in tech, creating rituals like this—whether they're [in the morning][3], middle of your day, or evening—is critical as we live out a new normal working from home, taking meetings virtually, and missing the energy of in-person connections with colleagues. 
What is your evening ritual?
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/11/evening-rituals-working-tech
作者:[Jen Wike Huger][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/jen-wike
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDUCATION_jadud_farm-road.png?itok=of8IuSM5 "A farm road"
[2]: https://opensource.com/article/20/2/linux-ebook-readers
[3]: https://opensource.com/article/20/10/tech-morning-rituals

View File

@ -1,218 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (tanloong)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Machine learning made easy with Python)
[#]: via: (https://opensource.com/article/21/1/machine-learning-python)
[#]: author: (Girish Managoli https://opensource.com/users/gammay)
Machine learning made easy with Python
======
Solve real-world machine learning problems with Naïve Bayes classifiers.
![arrows cycle symbol for failing faster][1]
Naïve Bayes is a classification technique that serves as the basis for implementing several classifier modeling algorithms. Naïve Bayes-based classifiers are considered some of the simplest, fastest, and easiest-to-use machine learning techniques, yet are still effective for real-world applications.
Naïve Bayes is based on [Bayes' theorem][2], formulated by 18th-century statistician [Thomas Bayes][3]. This theorem assesses the probability that an event will occur based on conditions related to the event. For example, an individual with [Parkinson's disease][4] typically has voice variations; hence such symptoms are considered related to the prediction of a Parkinson's diagnosis. The original Bayes' theorem provides a method to determine the probability of a target event, and the Naïve variant extends and simplifies this method.
### Solving a real-world problem
This article demonstrates a Naïve Bayes classifier's capabilities to solve a real-world problem (as opposed to a complete business-grade application). I'll assume you have basic familiarity with machine learning (ML), so some of the steps that are not primarily related to ML prediction, such as data shuffling and splitting, are not covered here. If you are an ML beginner or need a refresher, see _[An introduction to machine learning today][5]_ and _[Getting started with open source machine learning][6]_.
The Naïve Bayes classifier is [supervised][7], [generative][8], non-linear, [parametric][9], and [probabilistic][10].
In this article, I'll demonstrate using Naïve Bayes with the example of predicting a Parkinson's diagnosis. The dataset for this example comes from this [UCI Machine Learning Repository][11]. This data includes several speech signal variations to assess the likelihood of the medical condition; this example will use the first eight of them:
* **MDVP:Fo(Hz):** Average vocal fundamental frequency
* **MDVP:Fhi(Hz):** Maximum vocal fundamental frequency
* **MDVP:Flo(Hz):** Minimum vocal fundamental frequency
* **MDVP:Jitter(%)**, **MDVP:Jitter(Abs)**, **MDVP:RAP**, **MDVP:PPQ**, and **Jitter:DDP:** Five measures of variation in fundamental frequency
The dataset used in this example, shuffled and split for use, is available in my [GitHub repository][12].
### ML with Python
I'll use Python to implement the solution. The software I used for this application is:
* Python 3.8.2
* Pandas 1.1.1
* scikit-learn 0.22.2.post1
There are several open source Naïve Bayes classifier implementations available in Python, including:
* **NLTK Naïve Bayes:** Based on the standard Naïve Bayes algorithm for text classification
* **NLTK Positive Naïve Bayes:** A variant of NLTK Naïve Bayes that performs binary classification with partially labeled training sets
* **Scikit-learn Gaussian Naïve Bayes:** Provides partial fit to support a data stream or very large dataset
* **Scikit-learn Multinomial Naïve Bayes:** Optimized for discrete data features, example counts, or frequency
* **Scikit-learn Bernoulli Naïve Bayes:** Designed for binary/Boolean features
I will use [sklearn Gaussian Naive Bayes][13] for this example.
Here is my Python implementation of `naive_bayes_parkinsons.py`:
```
import pandas as pd
# Feature columns we use
x_rows=['MDVP:Fo(Hz)','MDVP:Fhi(Hz)','MDVP:Flo(Hz)',
        'MDVP:Jitter(%)','MDVP:Jitter(Abs)','MDVP:RAP','MDVP:PPQ','Jitter:DDP']
y_rows=['status']
# Train
# Read train data
train_data = pd.read_csv('parkinsons/Data_Parkinsons_TRAIN.csv')
train_x = train_data[x_rows]
train_y = train_data[y_rows]
print("train_x:\n", train_x)
print("train_y:\n", train_y)
# Load sklearn Gaussian Naive Bayes and fit
from sklearn.naive_bayes import GaussianNB
gnb = GaussianNB()
gnb.fit(train_x, train_y)
# Prediction on train data
predict_train = gnb.predict(train_x)
print('Prediction on train data:', predict_train)
# Accuray score on train data
from sklearn.metrics import accuracy_score
accuracy_train = accuracy_score(train_y, predict_train)
print('Accuray score on train data:', accuracy_train)
# Test
# Read test data
test_data = pd.read_csv('parkinsons/Data_Parkinsons_TEST.csv')
test_x = test_data[x_rows]
test_y = test_data[y_rows]
# Prediction on test data
predict_test = gnb.predict(test_x)
print('Prediction on test data:', predict_test)
# Accuracy Score on test data
accuracy_test = accuracy_score(test_y, predict_test)
print('Accuray score on test data:', accuracy_train)
```
Run the Python application:
```
$ python naive_bayes_parkinsons.py
train_x:
      MDVP:Fo(Hz)  MDVP:Fhi(Hz) ...  MDVP:RAP  MDVP:PPQ  Jitter:DDP
0        152.125       161.469  ...   0.00191   0.00226     0.00574
1        120.080       139.710  ...   0.00180   0.00220     0.00540
2        122.400       148.650  ...   0.00465   0.00696     0.01394
3        237.323       243.709  ...   0.00173   0.00159     0.00519
..           ...           ...           ...  ...       ...       ...        
155      138.190       203.522  ...   0.00406   0.00398     0.01218
[156 rows x 8 columns]
train_y:
      status
0         1
1         1
2         1
3         0
..      ...
155       1
[156 rows x 1 columns]
Prediction on train data: [1 1 1 0 ... 1]
Accuracy score on train data: 0.6666666666666666
Prediction on test data: [1 1 1 1 ... 1
 1 1]
Accuracy score on test data: 0.6666666666666666
```
The accuracy scores on the train and test sets are 67% in this example; its performance can be optimized. Do you want to give it a try? If so, share your approach in the comments below.
### Under the hood
The Naïve Bayes classifier is based on Bayes' rule or theorem, which computes conditional probability, or the likelihood for an event to occur when another related event has occurred. Stated in simple terms, it answers the question: _If we know the probability that event x occurred before event y, then what is the probability that y will occur when x occurs again?_ The rule uses a prior-prediction value that is refined gradually to arrive at a final [posterior][14] value. A fundamental assumption of Bayes is that all parameters are of equal importance.
At a high level, the steps involved in Bayes' computation are:
1. Compute overall posterior probabilities ("Has Parkinson's" and "Doesn't have Parkinson's")
2. Compute probabilities of posteriors across all values and each possible value of the event
3. Compute final posterior probability by multiplying the results of #1 and #2 for desired events
Step 2 can be computationally quite arduous. Naïve Bayes simplifies it:
1. Compute overall posterior probabilities ("Has Parkinson's" and "Doesn't have Parkinson's")
2. Compute probabilities of posteriors for desired event values
3. Compute final posterior probability by multiplying the results of #1 and #2 for desired events
This is a very basic explanation, and several other factors must be considered, such as data types, sparse data, missing data, and more.
### Hyperparameters
Naïve Bayes, being a simple and direct algorithm, does not need hyperparameters. However, specific implementations may provide advanced features. For example, [GaussianNB][13] has two:
* **priors:** Prior probabilities can be specified instead of the algorithm taking the priors from data.
* **var_smoothing:** This provides the ability to consider data-curve variations, which is helpful when the data does not follow a typical Gaussian distribution.
### Loss functions
Maintaining its philosophy of simplicity, Naïve Bayes uses a [0-1 loss function][15]. If the prediction correctly matches the expected outcome, the loss is 0, and it's 1 otherwise.
### Pros and cons
**Pro:** Naïve Bayes is one of the easiest and fastest algorithms.
**Pro:** Naïve Bayes gives reasonable predictions even with less data.
**Con:** Naïve Bayes predictions are estimates, not precise. It favors speed over accuracy.
**Con:** A fundamental Naïve Bayes assumption is the independence of all features, but this may not always be true.
In essence, Naïve Bayes is an extension of Bayes' theorem. It is one of the simplest and fastest machine learning algorithms, intended for easy and quick training and prediction. Naïve Bayes provides good-enough, reasonably accurate predictions. One of its fundamental assumptions is the independence of prediction features. Several open source implementations are available with traits over and above what are available in the Bayes algorithm.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/1/machine-learning-python
作者:[Girish Managoli][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/gammay
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/fail_progress_cycle_momentum_arrow.png?itok=q-ZFa_Eh (arrows cycle symbol for failing faster)
[2]: https://en.wikipedia.org/wiki/Bayes%27_theorem
[3]: https://en.wikipedia.org/wiki/Thomas_Bayes
[4]: https://en.wikipedia.org/wiki/Parkinson%27s_disease
[5]: https://opensource.com/article/17/9/introduction-machine-learning
[6]: https://opensource.com/business/15/9/getting-started-open-source-machine-learning
[7]: https://en.wikipedia.org/wiki/Supervised_learning
[8]: https://en.wikipedia.org/wiki/Generative_model
[9]: https://en.wikipedia.org/wiki/Parametric_model
[10]: https://en.wikipedia.org/wiki/Probabilistic_classification
[11]: https://archive.ics.uci.edu/ml/datasets/parkinsons
[12]: https://github.com/gammay/Machine-learning-made-easy-Naive-Bayes/tree/main/parkinsons
[13]: https://scikit-learn.org/stable/modules/generated/sklearn.naive_bayes.GaussianNB.html
[14]: https://en.wikipedia.org/wiki/Posterior_probability
[15]: https://en.wikipedia.org/wiki/Loss_function#0-1_loss_function

View File

@ -2,7 +2,7 @@
[#]: via: (https://opensource.com/article/21/5/linux-security-tools)
[#]: author: (Peter Gervase https://opensource.com/users/pgervase)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (MjSeven)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -1,136 +0,0 @@
[#]: subject: (What is XML?)
[#]: via: (https://opensource.com/article/21/7/what-xml)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
[#]: collector: (lujun9972)
[#]: translator: (amwps290)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
What is XML?
======
Get to know XML, a strict yet flexible markup language used for
everything from documentation to graphics.
![Computer screen with files or windows open][1]
XML is a hierarchical markup language. It uses opening and closing tags to define data. It's used to store and exchange data, and because of its extreme flexibility, it's used for everything from [documentation][2] to [graphics][3].
Here's a sample XML document:
```
&lt;xml&gt;
  &lt;os&gt;
   &lt;linux&gt;
    &lt;distribution&gt;
      &lt;name&gt;Fedora&lt;/name&gt;
      &lt;release&gt;8&lt;/release&gt;
      &lt;codename&gt;Werewolf&lt;/codename&gt;
    &lt;/distribution&gt;
    &lt;distribution&gt;
      &lt;name&gt;Slackware&lt;/name&gt;
      &lt;release&gt;12.1&lt;/release&gt;
      &lt;mascot&gt;
        &lt;official&gt;Tux&lt;/official&gt;
        &lt;unofficial&gt;Bob Dobbs&lt;/unofficial&gt;
      &lt;/mascot&gt;
    &lt;/distribution&gt;
   &lt;/linux&gt;
  &lt;/os&gt;    
&lt;/xml&gt;
```
Reading the sample XML, you might find there's an intuitive quality to the format. You can probably understand the data in this document whether you're familiar with the subject matter or not. This is partly because XML is considered verbose. It uses lots of tags, the tags can have long and descriptive names, and the data is ordered in a hierarchical manner that helps explain the data's relationships. You probably understand from this sample that the Fedora distribution and the Slackware distribution are two different and unrelated instances of Linux because each one is "contained" inside its own independent `<distribution>` tag.
XML is also extremely flexible. Unlike HTML, there's no predefined list of tags. You are free to create whatever data structure you need to represent.
### Components of XML
Data exists to be read, and when a computer "reads" data, the process is called _parsing_. Using the sample XML data again, here are the terms that most XML parsers consider significant.
* **Document:** The `<xml>` tag opens a _document_, and the `</xml>` tag closes it.
* **Node:** The `<os>`, `<distribution>`, and `<mascot>` are _nodes_. In parsing terminology, a node is a tag that contains other tags.
* **Element:** An entity such as `<name>Fedora</name>` and `<official>Tux</official>`, from the first `<` to the last `>` is an _element_.
* **Content:** The data between two element tags is considered _content_. In the first `<name>` element, the string `Fedora` is the content.
### XML schema
Tags and tag inheritance in an XML document are known as _schema_.
Some schemas are made up as you go (for example, the sample XML code in this article was purely improvised), while others are strictly defined by a standards group. For example, the Scalable Vector Graphics (SVG) schema is [defined by the W3C][4], while the [DocBook schema][5] is defined by Norman Walsh.
A schema enforces consistency. The most basic schemas are usually also the most restrictive. In my example XML code, it wouldn't make sense to place a distribution name within the `<mascot>` node because the implied schema of the document makes it clear that a mascot must be a "child" element of a distribution.
### Data object model (DOM)
Talking about XML would get confusing if you had to constantly describe tags and positions (e.g., "the name tag of the second distribution tag in the Linux part of the OS section"), so parsers use the concept of a Document Object Model (DOM) to represent XML data. The DOM places XML data into a sort of "family tree" structure, starting from the root element (in my sample XML, that's the `os` tag) and including each tag.
![Document Object Model][6]
(Seth Kenlon, [CC BY-SA 4.0][7])
This same XML data structure can be expressed as paths, just like files in a Linux system or the location of web pages on the internet. For instance, the path to the `<mascot>` tag can be represented as `//os/linux/distribution/slackware/mascot`.
The path to _both_ `<distribution>` tags can be represented as `//os/linux/distribution`. Because there are two distribution nodes, a parser loads both nodes (and the contents of each) into an array that can be queried.
### Strict XML
XML is also known for being strict. This means that most applications are designed to intentionally fail when they encounter errors in XML. That may sound problematic, but it's one of the things developers appreciate most about XML because unpredictable things can happen when applications try to guess how to resolve an error. For example, back before HTML was well defined, most web browsers included a "quirks mode" so that when people tried to view poor HTML code, the web browser could load what the author _probably_ intended. The results were wildly unpredictable, especially when one browser guessed differently than another.
XML disallows this by intentionally failing when there's an error. This lets the author fix errors until they produce valid XML. Because XML is well-defined, there are validator plugins for many applications and standalone commands like `xmllint` and `xmlstarlet` to help you locate errors early.
### Transforming XML
Because XML is often used as an interchange format, it's common to transform XML into some other data format or into some other XML schema. Classic examples include XSLTProc, xmlto, and [pandoc][8], but technically there are many other applications designed, at least in part, to convert XML.
In fact, LibreOffice uses XML to layout its word processor and spreadsheet documents, so any time you export or [convert a file from LibreOffice][9], you're transforming XML.
[Ebooks in the open source EPUB format][10] use XML, so any time you [convert a document into an EPUB][11] or from an EPUB, you're transforming XML.
Inkscape, the vector-based illustration application, saves its files in SVG, which is an XML schema designed for graphics. Any time you export an image from Inkscape as a PNG file, you're transforming XML.
The list could go on and on. XML is a data storage format, and it's designed to ensure that your data, whether it's points and lines on a canvas, nodes on a chart, or just words in a document, can be easily and accurately extracted, updated, and converted. 
### Learning XML
Writing XML is a lot like writing HTML. Thanks to the hard work of Jay Nick, [free and fun XML lessons are available online][3] that teach you how to create graphics with XML.
In general, very few special tools are required to explore XML. Thanks to the close relationship between HTML and XML, you can [view XML using a web browser][12]. In addition, open source text editors like [QXmlEdit][13], [NetBeans][14], and [Kate][15] make typing and reading XML easy with helpful prompts, autocompletion, syntax verification, and more.
### Choose XML
XML may look like a lot of data at first, but it's not that much different than HTML (in fact, HTML has been [reimplemented as XML in the form of XHTML][16]). XML has the unique benefit that the components forming its structure also happen to be metadata providing information about what it's storing. A well-designed XML schema contains and describes your data, allowing a user to understand it at a glance and parse it quickly, and enabling developers to [parse it efficiently][17] with convenient programming libraries.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/what-xml
作者:[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/browser_screen_windows_files.png?itok=kLTeQUbY (Computer screen with files or windows open)
[2]: https://opensource.com/article/17/9/docbook
[3]: https://opensource.com/article/17/5/coding-scalable-vector-graphics-make-steam
[4]: https://www.w3.org/TR/SVG11/
[5]: http://docbook.org
[6]: https://opensource.com/sites/default/files/uploads/dom.jpg (Document Object Model)
[7]: https://creativecommons.org/licenses/by-sa/4.0/
[8]: https://opensource.com/article/20/5/pandoc-cheat-sheet
[9]: https://opensource.com/article/21/3/libreoffice-command-line
[10]: https://opensource.com/education/15/11/ebook-open-formats
[11]: https://opensource.com/life/13/8/how-create-ebook-open-source-way
[12]: https://opensource.com/article/18/12/xml-browser
[13]: https://opensource.com/article/17/7/7-ways-handle-xml-qxmledit
[14]: https://opensource.com/article/20/12/netbeans
[15]: https://opensource.com/article/20/12/kate-text-editor
[16]: https://www.w3.org/TR/xhtml1/
[17]: https://opensource.com/article/21/6/parsing-config-files-java

View File

@ -2,7 +2,7 @@
[#]: via: (https://opensource.com/article/21/7/rust-tools-linux)
[#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (amwps290 )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -1,232 +0,0 @@
[#]: subject: (Linux package managers: dnf vs apt)
[#]: via: (https://opensource.com/article/21/7/dnf-vs-apt)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Linux package managers: dnf vs apt
======
Package managers do the same general things—installing, managing, and
uninstalling applications—but they don't do everything the same.
![Gift box opens with colors coming out][1]
There are many ways to [get applications onto a Linux system][2]. Some, like Flatpak and containers, are new. Others, like DEB and RPM, are classic formats that have withstood the test of time.
There isn't a universal installer for any operating system. Today, all major OSes use a mix of app stores (both first and third party), drag-and-drop installation, and installation wizards because there are innumerable developers delivering software. Different developers have different requirements for the code they deliver, and this informs the installation method they each choose.
Linux pioneered the concept of a _package manager_, a command to install, manage, and uninstall applications. Two common package manager commands are `apt` and `dnf`. The `apt` command manages DEB packages, while `dnf` manages RPM packages. The two are not strictly exclusive of one another in theory, although in practice, a Linux distribution generally uses one or the other. It's theoretically possible to run both on one system, but package installations would overlap, versioning would be difficult, and the commands would be redundant to one another. However, if you work in a mixed Linux environment, interacting with workstations running one distribution and servers running another, you may need to know both.
### Searching for applications
Before you can install an application with a package manager, you need to know the package's name. Usually, the application name and the package name are the same. The process to verify the name of the package you want to install is exactly the same on `dnf` and `apt`:
```
$ sudo dnf search zsh
====== Name Exactly Matched: zsh ======
zsh.x86_64 : Powerful interactive shell
[...]
```
With `apt`:
```
$ sudo apt search zsh
Sorting... Done
Full Text Search... Done
csh/stable 20110502-4+deb10u1 amd64
  Shell with C-like syntax
ddgr/stable 1.6-1 all
  DuckDuckGo from the terminal
direnv/stable 2.18.2-2 amd64
  Utility to set directory specific environment variables
draai/stable 20180521-1 all
  Command-line music player for MPD
[...]
```
To get relevant results from `apt` earlier in the search, you can use [regex][3]:
```
apt search ^zsh
Sorting... Done
Full Text Search... Done
zsh/stable 5.7.1-1 amd64
  shell with lots of features
[...]
```
### Finding an application's package
Some commands come bundled with other commands, all in one package. When that happens, you can use your package manager to learn which package provides what you need. The `dnf` and `apt` commands diverge on how they search for this kind of metadata.
On `dnf`:
```
$ sudo dnf provides pgrep
procps-ng-3.3.15-6.el8.x86_64 : System and process monitoring utilities
Repo        : baseos
Matched from:
Filename    : /usr/bin/pgrep
```
The `apt` command uses a subcommand, `apt-file`. To use `apt-file`, you must first install it and then prompt it to update its cache:
```
$ sudo apt install apt-file
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following additional packages will be installed:
  libapt-pkg-perl libexporter-tiny-perl liblist-moreutils-perl libregexp-assemble-perl
The following NEW packages will be installed:
  apt-file libapt-pkg-perl libexporter-tiny-perl liblist-moreutils-perl libregexp-assemble-perl
0 upgraded, 5 newly installed, 0 to remove and 14 not upgraded.
Need to get 297 kB of archives.
After this operation, 825 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
$ sudo apt-file update
[...]
```
You can use `apt-file` to search for a command. You can cast a very wide net by just searching for the command, but if you happen to know the command's expected path, it's more accurate:
```
$ sudo apt-file search /usr/bin/pgrep
pgreplay: /usr/bin/pgreplay              
procps: /usr/bin/pgrep
```
### Installing applications
Installing applications is essentially identical with `apt` and `dnf`:
```
`$ sudo apt install zsh`
```
With `dnf`, you can install a single package using the same option:
```
`$ sudo dnf install zsh`
```
Many RPM-based distributions feature _installation groups_, which collect sometimes superficially related applications into one easily installable target. For instance, the [Design Suite][4] group in Fedora contains popular creative applications. Many artists who want one creative application are likely to want similar applications, and installing the whole group is an easy and quick way to get a sensible start on building a digital studio. You can view available groups with `group list` (use `-v` to see the group names without spaces):
```
$ sudo dnf group list -v
[...]
Available Groups:
   Container Management (container-management)
   RPM Development Tools (rpm-development-tools)
   Design Suite (design-suite)
   Development Tools (development)
[...]
```
Install an RPM group using the `group install` subcommands:
```
`$ sudo dnf group install design-suite`
```
You can use the `@` notation to reduce typing:
```
`$ sudo dnf install @design-suite`
```
### Upgrading applications
One advantage of using a package manager is that it is aware of _all_ the applications it has ever installed. That means you don't have to go hunting for updated versions of applications. Instead, you can tell your package manager to scan for updates.
The subcommands used by `dnf` and `apt` are slightly different. Because `apt` keeps a cache of information that requires regular updating, it uses the `upgrade` subcommand for application updates:
```
`$ sudo apt upgrade`
```
By contrast, `dnf` updates metadata every time you use the command, so the `update` and `upgrade` subcommands are interchangeable:
```
`$ sudo dnf upgrade`
```
This is the same as:
```
`$ sudo dnf update`
```
### Removing applications
If you've ever tried to remove an application manually on any platform, then you know there are inevitably leftover files, such as preference files or assets or icons, scattered all around your hard drive after you remove the application. Yet another advantage to using a package manager is that your package manager knows _every single file_ installed with a package:
```
`$ sudo dnf remove zsh`
```
The `remove` subcommand is also used for `apt`:
```
`$ sudo apt remove zsh`
```
Removing a package with `apt` doesn't remove modified user configuration files, in case you removed the package by accident. If you want `apt` to remove an application _and_ its configuration files, use `purge` on an application you've previously removed:
```
`$ sudo apt purge zsh`
```
Both `apt` and `dnf` (even with `purge`) don't remove data or configuration files in your home directory. To remove data from your home directory, you must do it manually (it's usually found in `~/.config` and `~/.local`).
### Learning package management
Whether your Linux distribution of choice favors `apt` or `dnf`, the commands' purposes are broadly identical. They help you install, update, and remove packages. These two, being the most common package managers, largely mirror one another's most important syntactical elements, so switching between them is pretty easy.
Each has some advanced features, such as repository management, that diverge substantially, but those tend not to be run as frequently as the classic sequence of `search` and `install`.
Regardless of which package manager you use more often, you can download our [apt cheat sheet][5] and [dnf cheat sheet][6] so that you have the most important syntax close at hand when you need it the most.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/dnf-vs-apt
作者:[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/OSDC_gift_giveaway_box_520x292.png?itok=w1YQhNH1 (Gift box opens with colors coming out)
[2]: https://opensource.com/article/18/1/how-install-apps-linux
[3]: https://opensource.com/article/18/5/getting-started-regular-expressions
[4]: https://labs.fedoraproject.org/en/design-suite/
[5]: https://opensource.com/downloads/apt-cheat-sheet
[6]: https://opensource.com/downloads/dnf-cheat-sheet

View File

@ -0,0 +1,164 @@
[#]: subject: (How to Upgrade to Debian 11 from Debian 10)
[#]: via: (https://www.debugpoint.com/2021/07/upgrade-debian-11-from-debian-10/)
[#]: author: (Arindam https://www.debugpoint.com/author/admin1/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
How to Upgrade to Debian 11 from Debian 10
======
This guide explains the steps to upgrade debian 11 from debian 10.
[Debian][1] releases are rare. Because it is often a multi-year effort from the community. That is why Debian is truly universal operating system and rock solid stability wise.
[Debian 11][2], code named Bullseye, officially releases soon. On July 15, 2021, Debian 11 went to complete freeze, which means the release is imminent. Although the official date is not finalized, but you can install or upgrade to Debian 11 from Debian 10 right now.
This is how.
### Pre-Requisites
* The upgrade process is very straightforward. However, it is a good practice to take certain pre-cautions. Specially if you are upgrading a server.
* Take backup of your system, including all important data and files.
* Try to disable/remove any external repositories (PPA) you may have added over the time. You can enable them after upgrade one-by-one.
* Close all the running applications.
* Stop any running services that you may have enabled. You can start them via [systemctl][3] after upgrade is complete. This includes web server, SSH server, FTP server or any other servers.
* Make sure you have stable internet connection.
* And have sufficient downtime of your system. Because depending on your system configuration, a Debian version upgrade takes time ~ between 1.5 hours to 2 hours.
### Upgrade Debian 10 Buster to 11 Bullseye Linux
* Make sure your system is up-to-date, and your package list is up-to-date.
```
sudo apt update && sudo apt upgrade
```
* Install the gcc-8-base package using the below command. This is required because, historically it has been seen, that upgrade fails because of certain dependencies which included in the below package.
```
sudo apt install gcc-8-base
```
![upgrade debian system check][4]
* Open the /etc/apt/sources.list and update with bullseye repositories, by commenting the Debian 10 buster packages.
* Comment out all the buster repo by “#” at the beginning of the lines.
![Comment the Debian 10 lines][5]
* Add the following lines at the end of the file.
```
deb http://deb.debian.org/debian bullseye main contrib non-free
deb http://deb.debian.org/debian bullseye-updates main contrib non-free
deb http://security.debian.org/debian-security bullseye-security main
deb http://ftp.debian.org/debian bullseye-backports main contrib non-free
```
![Add Debian 11 lines][6]
* Press Ctrl + O to save the file and Ctrl + X to exit nano.
* Update the system repository list once to verify the addition of the repositories.
```
sudo apt update
```
* If the above command doesnt give any error, then you have successfully added the bullseye repo.
* Now, start the upgrade process by running the below command. The download size is around 1.2 GB for a base installation. That may be different based on your system config.
```
sudo apt full-upgrade
```
![Debian upgrade start][7]
* This command takes time. But do not leave the system unattended. Because upgrade process requires various inputs during the course of upgrade.
![lib6 config][8]
![sudoers file][9]
* Once it is completed, you can restart the system using
```
systemctl reboot
```
* After reboot, run the following commands to make sure your system is up-to-date, and you cleaned up all the unnecessary packages that is not required anymore.
```
sudo apt --purge autoremove
```
* If all goes well, you should be seeing the Debian 11 bullseye. You can verify the version using the below command:
```
cat /etc/os-release
```
![Debian 11 after upgrade][10]
### Closing Notes
I hope this guide helps you to upgrade your system to Debian 11 bullseye. If you face any issues, let me know using the comment box below.
[][11]
SEE ALSO:   Debian 11 bullseye - Default Theme Revealed
* * *
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/2021/07/upgrade-debian-11-from-debian-10/
作者:[Arindam][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://www.debugpoint.com/author/admin1/
[b]: https://github.com/lujun9972
[1]: https://www.debian.org/
[2]: https://www.debugpoint.com/2021/05/debian-11-features/
[3]: https://www.debugpoint.com/2020/12/systemd-systemctl-service/
[4]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/upgrade-debian-system-check-1024x503.jpeg
[5]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Cpmment-the-Debian-10-lines-1024x636.jpeg
[6]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Add-Debian-11-lines-1024x635.jpeg
[7]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Debian-upgrade-start-1024x226.jpeg
[8]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/lib6-config-1024x195.jpeg
[9]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/sudoers-file.jpeg
[10]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Debian-11-after-upgrade.jpeg
[11]: https://www.debugpoint.com/2020/11/debian-11-bullseye-theme/

View File

@ -0,0 +1,90 @@
[#]: subject: (Install Shutter in Fedora 34 and Above)
[#]: via: (https://www.debugpoint.com/2021/07/install-shutter-fedora/)
[#]: author: (Arindam https://www.debugpoint.com/author/admin1/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Install Shutter in Fedora 34 and Above
======
This quick guide explains the steps required to install shutter in
Fedora 34 and above.
There are many alternatives and options for screenshot tool. But in my personal opinion, there is none that come close to the flexibility of Shutter. Unfortunately over the years, Linux distributions such as Ubuntu, Fedora faced problem packaging this application in official repo for various dependency problem and specially how it is designed.
The primary problem is it still based on GTK2 and Perl. While most of the application moved to GTK3, it remained in GTK2. This created a dependency problem as Debian/Ubuntu, Fedora they removed the dependent GTK2 version of certain packages.
Installing [Shutter][1] screenshot tool in Fedora 34 and above requires an alternative approach.
Right now, you can only install this tool via personal package archive only. Heres how to install it in Fedora 34 and above.
![Shutter in Fedora][2]
### Install Shutter in Fedora 34 and above
Open a terminal in your Fedora and enable the following [Copr repository for Shutter][3]. This package archive provides a separate build for Shutter for Fedora with all the unmet dependencies.
```
sudo dnf copr enable geraldosimiao/shutter
```
Once this is done, you can simply install shutter in Fedora 34 and above by dnf.
```
sudo dnf install shutter
```
Though the latest release is v0.97 at present. The repository sadly contains the old v0.94.x at the moment. I hope the repo owner soon include the latest version.
After installation, you can launch it via application menu.
#### Uninstall Shutter
If you want, you can easily remove this third-party repository via command:
```
sudo dnf copr remove geraldosimiao/shutter
```
And followed by below to remove Shutter completely including dependencies.
```
sudo dnf autoremove shutter
```
#### Install Shutter in Other Linux Distributions
If you want to install it in Debian, Ubuntu or related distribution [check out this guide][4].
[][5]
SEE ALSO:   How to fix disabled Edit Image Option in Shutter in Ubuntu 18.04 LTS
### Development of Shutter
Recently this project [moved to GitHub][6] for better collaboration and a GTK3 port is underway. And it is fairly active and recently had a release. We hope it gets ported to gtk3 soon and available in native repo of respective distributions.
Let me know using the comment box below if you face any error installing Shutter.
* * *
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/2021/07/install-shutter-fedora/
作者:[Arindam][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://www.debugpoint.com/author/admin1/
[b]: https://github.com/lujun9972
[1]: https://www.debugpoint.com/tag/shutter
[2]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Shutter-in-Fedora.jpeg
[3]: https://copr.fedorainfracloud.org/coprs/geraldosimiao/shutter/
[4]: https://www.debugpoint.com/2020/04/shutter-install-ubuntu/
[5]: https://www.debugpoint.com/2018/05/shutter-fix-disable-edit/
[6]: https://github.com/shutter-project/shutter

View File

@ -1,119 +0,0 @@
[#]: subject: (Run a Linux virtual machine in Podman)
[#]: via: (https://opensource.com/article/21/7/linux-podman)
[#]: author: (Sumantro Mukherjee https://opensource.com/users/sumantro)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Run a Linux virtual machine in Podman
======
Use Podman Machine to create a basic Fedora CoreOS VM to use with
containers and containerized workloads.
![woman on laptop sitting at the window][1]
Fedora CoreOS is an automatically updating, minimal [rpm-ostree][2]-based operating system for running containerized workloads securely and at scale.
[Podman][3] "is a tool for managing containers and images, volumes mounted into those containers, and pods made from groups of containers. Podman is based on libpod, a library for container lifecycle management."
Magical things happen when you use [Podman Machine][4], a feature that helps you create a basic Fedora CoreOS virtual machine (VM) to use with containers and containerized workloads.
### Getting started with Podman Machine
The first step is to install Podman. If you already have the latest version of Podman installed, you can skip the step. On my Fedora 34 machine, I installed Podman with:
```
`$ sudo dnf install podman`
```
I'm using podman-3.2.2-1.fc34.x86_64.
### Initializing a Fedora CoreOS
Once Podman is installed, initialize it with:
```
podman machine init vm2
Downloading VM image: fedora-coreos-34.20210626.1.0-qemu.x86_64.qcow2.xz: done  
Extracting compressed file
```
This command creates `vm2` and downloads Fedora CoreOS's qcow2 file in .xz format and extracts it.
### Listing your VMs
It's always important to know your VMs and their status, and the `list` command helps with that. The following example shows the names of all my VMs, the date they were created, and the last time they were up:
```
podman machine list  
NAME                    VM TYPE         CREATED         LAST UP
podman-machine-default*  qemu           6 days ago      Currently running
vm2                     qemu            11 minutes ago  11 minutes ago
```
### Starting a VM
To start a VM, run:
```
podman machine start
Waiting for VM …
```
### SSHing into the VM
You can use secure shell (SSH) to access your VM and use it to run workloads without any setup hassles:
```
podman machine ssh  
Connecting to vm podman-machine-default. To close connection, use `~.` or `exit`
Fedora CoreOS 34.20210611.1.0
Tracker: <https://github.com/coreos/fedora-coreos-tracker>
Discuss: <https://discussion.fedoraproject.org/c/server/coreos/>
 
Last login: Wed Jun 23 13:23:36 2021 from 10.0.2.2
[core@localhost ~]$ uname -a
Linux localhost 5.12.9-300.fc34.x86_64 #1 SMP Thu Jun 3 13:51:40 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
[core@localhost ~]$
```
Currently, Podman only supports running one VM at a time.
### Stopping your VM
To stop a running VM, use the `stop` command:
```
podman machine stop
[core@localhost ~]$ Connection to localhost closed by remote host.
Connection to localhost closed.
Error: exit status 255
```
I hope this helps you get started with Podman Machine. Give it a try, and let us know what you think in the comments.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/linux-podman
作者:[Sumantro Mukherjee][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/sumantro
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop)
[2]: http://coreos.github.io/rpm-ostree/
[3]: https://github.com/containers/podman
[4]: http://docs.podman.io/en/latest/markdown/podman-machine.1.html

View File

@ -0,0 +1,167 @@
[#]: subject: (Accessibility in open source for people with ADHD, dyslexia, and Autism Spectrum Disorder)
[#]: via: (https://opensource.com/article/21/7/open-source-neurodiversity)
[#]: author: (Rikard Grossman-Nielsen https://opensource.com/users/rikardgn)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Accessibility in open source for people with ADHD, dyslexia, and Autism Spectrum Disorder
======
Open source accommodations help people with neurodiversity use their
talents to their highest ability.
![a magnifying glass looking at a brain illustration][1]
For a long time, attention deficit hyperactivity disorder (ADHD), autism, Asperger syndrome, dyslexia, and other neurodiverse conditions were considered things that hold people back. But now, many researchers and employers recognize that [neurodiversity is a competitive advantage][2], especially in technology, and especially when certain accommodations are provided.
This is certainly true for me. I'm a 39-year-old teacher in Sweden diagnosed with ADHD and Asperger's (also referred to as Autism Level 1). I'm also an intermediate Linux user and use it daily for Java programming, productivity, and gaming. I've been using Linux since the late 1990s, and I've learned ways open source programs can be made more accessible for people with these conditions. For example, I use accessibility software, including speech synthesis to find spelling errors and calendar software accommodations to help with my Asperger's and ADHD.
### Asperger's, ADHD, and dyslexia
Before I get into open source software accommodations, I'll share some information about these conditions.
#### Asperger syndrome
[Asperger's][3] is a form of autism without intellectual disability. People with Asperger's often have:
* Difficulties in social contact with other people
* Special interest areas that may consume a large part of their attention and time
* Difficulties understanding and using language in communicating with other people
* Deficits in motor skills
* A tendency to easily get caught in up certain routines or actions
* Unusual perception of and sensitivity to stimuli such as sound, light, etc.
#### ADHD
The three core symptoms of [ADHD][4] are:
* **Attention:** Difficulties in concentration and forgetfulness; distractability; easily bored and fail to complete things that don't interest them
* **Impulsivity:** Strong emotional reactions to different things; difficulty listening to others; problems handling unstructured situations that require reflection and thinking things through; sometimes impulsivity may lead to difficulties in motor control
* **Hyperactivity:** Difficulty regulating activity to an appropriate level for the situation; trouble sitting still and winding down, possibly mixed with periods of exhaustion
Hyperactivity in children is often physical; in adults, it's more of an internal restlessness that might cause sleeping problems (among other things). Some people with ADHD have one of the three core symptoms, and others have two or all of them.
#### Dyslexia
Some people with neurodiverse conditions also have problems with reading and writing. This might be related to difficulties in attention, hyperactivity, and impulsivity. However, they might also be caused by [dyslexia][5].
* People with dyslexia have difficulty recognizing and understanding words. They might place letters in the incorrect order, making reading comprehension more difficult.
* Dyslexia isn't correlated with intelligence.
* Dyslexia can't be cured, but accommodations can help a great deal in school and work.
* Reading a lot and listening to audiobooks can improve the ability of people with dyslexia to read and write.
### Asperger's and ADHD at work
While the symptoms associated with Asperger's and ADHD can make some parts of work challenging, other aspects give neurodiverse people advantages in the workplace.
#### Asperger's
Some of the skills people with [autism spectrum disorders bring to the workplace][6]:
* High concentration power and precision in work
* Attention to minute details
* Patience for repetitive tasks
* Higher memory power (can remember tiny details)
* Hard-working
* Loyal
#### ADHD
Some of the skills people with [ADHD bring to the workforce][7]:
* Able to find unique solutions to difficult problems
* Can talk about many different topics at one time
* Good in a crisis; some of the most stressful jobs are staffed by those with ADHD
* Empathetic and intuitive
* Entrepreneurial
### Making software more accessible
The descriptions above are highly generalized and may not apply to all adults with Asperger's, ADHD, and dyslexia. One problem with current accessibility standards is that they confuse different neurodiversities. For example, they may not differentiate between autism with and without intellectual disability, the latter of which is called Asperger's or Autism Level 1, or they may assume dyslexia is an intellectual disability.
In his article [_User interface for people with autism spectrum disorders_][8], Nikolay Pavlov provides some suggestions to improve UI design:
* Use simple graphics
* Strive for simple, clear navigation
* Do not use complex menus
People with Asperger's have different needs, abilities, and preferences, so these accommodations won't be beneficial to everyone. These UI features could also help people who have autism with intellectual disability, ADHD, dyslexia without intellectual disability, and other conditions. Therefore, when considering making accommodations in software, think carefully about your target group. And know that if you ask people for input, you will probably get many different answers.
People with ADHD especially might benefit from one of Pavlov's other recommendations:
* Use visual indicators for time-consuming actions
This is valuable when people perceive that an app or web page is not loading quickly enough. I appreciate when systems give continuous feedback on their progress because it tells me that everything is in working order.
### Examples of accessibility
The GNOME calendar offers a good example of making software more accessible.
Compare the standard date view:
![Standard GNOME calendar][9]
(Rikard Grossman-Nielsen, [CC BY-SA 4.0][10])
To this modified view:
![Modified GNOME calendar][11]
(Rikard Grossman-Nielsen, [CC BY-SA 4.0][10])
It's a lot easier to find the marked date with the yellow circle around the number 29.
In contrast, [Vi and Vim][12] are among the least accessible text editors I've ever used, but note they aren't designed with accessibility in mind. My biggest problem is that that they don't offer any cues to their different commands. When I use a terminal editor, I prefer [Nano][13] because it provides cues to what keyboard commands to use. Most often, I use a graphical user interface (GUI) editor like [Gedit][14] or Nedit because it's easier for me to create text in a GUI editor.
### How GNOME embraces diversity
I've found that [GNOME][15] is the best of the large Linux desktop environments for offering accessibility features, but it can definitely still improve. Because I'm interested in Linux on the desktop and making it even more accessible, I joined the team planning [GUADEC][16], the GNOME Users And Developers European Conference.
GUADEC embraces a climate of diversity, both in theory and practice. The conference provides accommodations, such as captioning for online lectures and quiet rooms at physical events. The 2021 conference, to be held online July 2125, will have a few lectures on UI design, and I will offer a workshop on [making open source applications more accessible][17]. If you'd like to learn more, visit the GUADEC website and [register][18].
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/open-source-neurodiversity
作者:[Rikard Grossman-Nielsen][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/rikardgn
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LAW_EvidencedBasedIP_520x292_CS.png?itok=mmhCWuZR (a magnifying glass looking at a brain illustration)
[2]: https://hbr.org/2017/05/neurodiversity-as-a-competitive-advantage
[3]: https://en.wikipedia.org/wiki/Asperger_syndrome
[4]: https://en.wikipedia.org/wiki/Attention_deficit_hyperactivity_disorder
[5]: https://en.wikipedia.org/wiki/Dyslexia
[6]: https://www.thehrdigest.com/autistic-workers-strength-not-weakness/
[7]: https://adhdatwork.add.org/potential-benefits-of-having-an-adhd-employee/
[8]: https://www.researchgate.net/publication/276495184_User_Interface_for_People_with_Autism_Spectrum_Disorders
[9]: https://opensource.com/sites/default/files/uploads/gnome-calendar-standard.png (Standard GNOME calendar)
[10]: https://creativecommons.org/licenses/by-sa/4.0/
[11]: https://opensource.com/sites/default/files/uploads/gnome-calendar-modified.png (Modified GNOME calendar)
[12]: https://opensource.com/resources/what-vim
[13]: https://opensource.com/article/20/12/gnu-nano
[14]: https://opensource.com/article/20/12/gedit
[15]: https://opensource.com/downloads/cheat-sheet-gnome-3
[16]: https://events.gnome.org/event/9/
[17]: https://events.gnome.org/event/9/contributions/240/
[18]: https://events.gnome.org/event/9/registrations/34/

View File

@ -0,0 +1,191 @@
[#]: subject: (Write your first web component)
[#]: via: (https://opensource.com/article/21/7/web-components)
[#]: author: (Ramakrishna Pattnaik https://opensource.com/users/rkpattnaik780)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Write your first web component
======
Don't repeat yourself; create elements you can reuse when writing web
apps for any browser.
![Digital creative of a browser on the internet][1]
Web components are a collection of open source technologies such as JavaScript and HTML that allow you to create custom elements that you can use and reuse in web apps. The components you create are independent of the rest of your code, so they're easy to reuse across many projects.
Best of all, it's a platform standard supported by all major modern browsers.
### What's in a web component?
* **Custom elements:** This JavaScript API allows you to define new types of HTML elements.
* **Shadow DOM:** This JavaScript API provides a way to attach a hidden separate [Document Object Model][2] (DOM) to an element. This encapsulates your web component by keeping the styling, markup structure, and behavior isolated from other code on the page. It ensures that styles are not overridden by external styles or, conversely, that a style from your web component doesn't "leak" into the rest of the page**.**
* **HTML templates:** The element allows you to define reusable DOM elements. The element and its contents are not rendered in the DOM but can still be referenced using JavaScript.
### Write your first web component
You can write a simple web component with your favorite text editor and JavaScript. This how-to uses bootstrap to generate simple stylings then creates a simple card web component to display the temperature of a location passed to it as an attribute. The component uses the [Open Weather API][3], which requires you to generate an APPID/APIKey by signing in.
The syntax of calling this web component requires the location's longitude and latitude:
```
`<weather-card longitude='85.8245' latitude='20.296' />`
```
Create a file named **weather-card.js** that will contain all the code for your web component. Start by defining your component. This can be done by creating a template element and adding some simple HTML elements into it:
```
const template = document.createElement('template');
template.innerHTML = `
  &lt;div class="card"&gt;
    &lt;div class="card-body"&gt;&lt;/div&gt;
  &lt;/div&gt;
`
```
Start defining the WebComponent class and its constructor:
```
class WeatherCard extends HTMLElement {
  constructor() {
    super();
    this._shadowRoot = this.attachShadow({ 'mode': 'open' });
    this._shadowRoot.appendChild(template.content.cloneNode(true));
  }
  ….
}
```
The constructor attaches the shadowRoot and sets it to open mode. Then the template is cloned to shadowRoot.
Next, access the attributes. These are the longitude and latitude, and you need them to make a GET request to the Open Weather API. This needs to be done in the `connectedCallback` function. You can use the `getAttribute` method to access the attributes or define getters to bind them to this object:
```
get longitude() {
  return this.getAttribute('longitude');
}
get latitude() {
  return this.getAttribute('latitude');
}
```
Now define the `connectedCallBack` method that fetches weather data whenever it is mounted:
```
connectedCallback() {
  var xmlHttp = new XMLHttpRequest();
  const url = `[http://api.openweathermap.org/data/2.5/weather?lat=${this.latitude}\&amp;lon=${this.longitude}\&amp;appid=API\\_KEY\\`][4]
  xmlHttp.open("GET", url, false);
  xmlHttp.send(null);
  this.$card = this._shadowRoot.querySelector('.card-body');
  let responseObj = JSON.parse(xmlHttp.responseText);
  let $townName = document.createElement('p');
  $townName.innerHTML = `Town: ${responseObj.name}`;
  this._shadowRoot.appendChild($townName);
  let $temperature = document.createElement('p');
  $temperature.innerHTML = `${parseInt(responseObj.main.temp - 273)} &amp;deg;C`
  this._shadowRoot.appendChild($temperature);
}
```
Once the weather data is retrieved, additional HTML elements are added to the template. Now, your class is defined.
Finally, define and register a new custom element by using the method `window.customElements.define`:
```
`window.customElements.define('weather-card', WeatherCard);`
```
The first argument is the name of the custom element, and the second argument is the defined class. Here's a [link to the entire component][5].
You've written your first web component! Now it's time to bring it to the DOM. To do that, you must load the JavaScript file with your web component definition in your HTML file (name it **index.html**):
```
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;meta charset="UTF-8"&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;weather-card longitude='85.8245' latitude='20.296'&gt;&lt;/weather-card&gt;
  &lt;script src='./weather-card.js'&gt;&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
```
Here's your web component in a browser:
![Web component displayed in a browser][6]
(Ramakrishna Pattnaik, [CC BY-SA 4.0][7])
Because web components need only HTML, CSS, and JavaScript, they are natively supported by browsers and can be used seamlessly with frontend frameworks, including React and Vue. The following simple code snippet shows how to use web components with a simple React App bootstrapped with [Create React App][8]. For this, you need to import the **weather-card.js** file you defined earlier and use it as a component:
```
import './App.css';
import './weather-card';
function App() {
  return (
  &lt;weather-card longitude='85.8245' latitude='20.296'&gt;&lt;/weather-card&gt;
  );
}
export default App;
```
### Lifecycle of a web component
All components follow a lifecycle from initialization to removal from the DOM (i.e., unmount). Methods are associated with each lifecycle event so that you can control the components better. The various lifecycle events of a web component include:
* **Constructor:** The constructor for a web component is called before it is mounted, meaning it's created before the element is attached to the document. It's used for initializing local state, binding event handlers, and creating the shadow DOM. The constructor must make a call to `super()` to call the class the Web Component class extends.
* **ConnectedCallBack:** This is called when an element is mounted (that is, inserted into the DOM tree). It deals with initializations creating DOM nodes and is used mostly for operations like instantiating network requests. React developers can relate it to `componentDidMount`.
* **attributeChangedCallback:** This method accepts three arguments: `name`, `oldValue`, and `newValue`. It is called whenever one of the component's observed attributes gets changed. Attributes are declared observed attributes using a static `observedAttributes` getter: [code] static get observedAttributes() {
  return ['name', '_id'];
} [/code] `attributeChangedCallback` will be called whenever the attribute name or `_id` is changed.
* **DisconnectedCallBack:** This is called when an element is removed from the DOM tree (i.e., unmounted). It is equivalent to React's `componentWillUnmount`. It is used to free resources that won't be garbage-collected automatically, like unsubscribing from DOM events, stopping interval timers, or unregistering all registered callbacks.
* **AdoptedCallback:** It is called each time the custom element is moved to a new document. It only occurs when dealing with IFrames.
### Modular open source
Web components can be a powerful way to develop web apps. Whether you're comfortable with JavaScript or just getting started with it, it's easy to create reusable code with this great open standard, no matter what browser your target audience uses.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/web-components
作者:[Ramakrishna Pattnaik][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/rkpattnaik780
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet)
[2]: https://en.wikipedia.org/wiki/Document_Object_Model
[3]: https://openweathermap.org/api
[4]: http://api.openweathermap.org/data/2.5/weather?lat=${this.latitude}\&lon=${this.longitude}\&appid=API\_KEY\`
[5]: https://gist.github.com/rkpattnaik780/acc683d3796102c26c1abb03369e31f8
[6]: https://opensource.com/sites/default/files/uploads/webcomponent.png (Web component displayed in a browser)
[7]: https://creativecommons.org/licenses/by-sa/4.0/
[8]: https://create-react-app.dev/docs/getting-started/

View File

@ -0,0 +1,99 @@
[#]: subject: (How to manage feedback on your open project)
[#]: via: (https://opensource.com/open-organization/21/7/manage-feedback-open-project)
[#]: author: (Laura Hilliger https://opensource.com/users/laurahilliger)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
How to manage feedback on your open project
======
Open projects generate feedback—lots of it. How can leaders manage it
all? This process might help.
![red pen editing mistakes][1]
People who let open principles guide their leadership practices in open organizations inevitably find themselves fielding feedback. Lots of feedback.
That's by design. Open leaders [invite comment and critique][2] on just about anything they can.
But it also poses a regular challenge: How to sift through, manage, evaluate, and address that feedback in authentic and useful ways?
Members of the Open Organization project got a taste of this process recently. Working on the Open Leadership Definition—a robust, [collaborative description][3] of the specific mindsets and behaviors associated with open styles of leadership—collaborators solicited community-wide feedback on a multi-hundred-word draft document. The results were impressive—even if a bit intimidating.
As we continue diligently working through the feedback we received, we thought we'd offer some insight into our own process for managing a significant amount of feedback—in case it's useful to others trying to do the same.
### The challenge
First, we [invited anyone to read and comment][4] directly on our draft documents. Results were humbling. We're so pleased to have received so many thoughtful comments and ideas for improvement. But we received _a lot_ of comments.
We needed some way to organize, analyze, review, address, and respond to all those comments. After all, in open organizations, feedback is only valuable and effective to the extent that people respond to and act on it. 
So we turned to a well-known technological advancement that has changed the lives of many: the spreadsheet. We collected all the comments we received in a single place—and made sure everyone could see what we were doing along the way.
The result: a [collaborative and transparent worksheet][5] anyone can follow as they watch us edit and revise in line with the community's stellar feedback.
### The process
But collecting feedback is only part of the work (and the easiest part, at that). Next, we knew we needed to create (and publish) a step-by-step process anyone could follow when collaborating on edits to the Open Leadership Definition.
But collecting feedback is only part of the work (and the easiest part, at that).
Here's what we can up with:
1. Review feedback left in section documents.
2. Record/transcribe feedback, comments, and suggestions into our spreadsheet.
3. Assign editorial leads for each document section.
4. (Editorial leads) Systematically review comments in biweekly community calls with other contributors.
5. (Editorial leads) Address reviewer comments, make necessary editorial changes to documents.
6. (Editorial leads) Record their decisions, changes, and/or correspondence in the spreadsheet.
Without a doubt, it's more work than simply jumping into the document and making the changes we thought were most appropriate. Because all our work—all the feedback we received, and all the ways we were _responding_ to that feedback—was open and transparent, we'll need to _reflect on_ and _justify_ every editorial decision we made. It takes time. But it's the least we can do to reciprocate the kindness our community showed us in leaving their feedback (after all, that took time, too!).
### The results (so far)
As we've worked, we've categorized feedback into seven different "types." Some, like typos and grammar issues, are no-brainers; we'll integrate this feedback and clean up our mistakes. Others, like those that suggest additional ideas or ask us to rethink assumptions, might _also_ be no-brainers—but not all of them can be integrated so easily. So, we're using our biweekly calls to work through and discuss this feedback.
That's the most fun part—the part where we get to connect for live chatter and debate about how we are—or aren't—going to address what the community has raised.
Here's a summary of what we've seen and debated so far.
#### Working on the preamble
The first section we reviewed was the document's "preamble," which received a lot of insightful and important comments that underscored the importance of nuance. This piece of the definition summarizes the rest, and so we need to get it right. Here's what we discussed.
**The types of organizations where open leaders thrive.** We've discussed the ways open leaders can enhance organizations operating with all kinds of cultures—but argued that they're _especially_ important in _open_ organizations (because of the way command-and-control thinking can stymie openness). We acknowledge that all kinds of organizations can be open organizations—not just those wrestling with ambiguity or focusing on innovation.
**Organizations as actors.** One interesting debate centered on writing that seemed to treat _organizations themselves_ as individual actors—rather than, say, _groups_ of individual actors. Some of us argued that organizations are more than the sum of their components and that sentences like "open leaders make organizations more self-aware" made perfect sense. Others countered that this made organizations seem like sentient beings, when in fact they're _collections_ of sentient beings. We were personifying organizations, in other words. Ultimately, we were able to find a way to both defend the sentiment that an organization can be reflective (concerned with its own context, boundaries, and limitations) and yet do so in a way that doesn't completely anthropomorphize the organization. The line is blurry at best. So we discussed how open leaders support a culture of self awareness and edited our language in the preamble to try and better balance this philosophical point.
That's the most fun part—the part where we get to connect for live chatter and debate about how we are—or aren't—going to address what the community has raised.
**Mindsets and behaviors.** Here again we arrived at the question that motivated this project in the first place: _What is open leadership?_ We debated the status of "open leadership" as a "mindset" versus a "skill" versus a "practice" (each of these designations has implications for how we define open leadership and how we help others adopt it), and doing this meant negotiating the complexities of character, ego, mindfulness, and more. For instance, a skill can generally be taught, but there's more nuance to what we all believe can be "taught" versus "experienced." And as our document shows, open leadership isn't just a set of things people _do_; it's a _way of thinking_, too. So we settled on open leadership as being a specific set of "mindsets and behaviors," an organic decision [inspired by Red Hat's definition][6] of the "open leadership" concept.
**Open leaders and character.** Other excellent reviewer comments led us to discuss distributed leadership, planned obsolescence as a positive attribute and how "authority" to lead only lasts as long as people grant that authority. We discussed a nebulous quality open leaders have, character traits and experience that people value and therefore are willing to go to when support is needed. Some of our revisions will certainly reflect this discussion.
### Slow and steady wins the race
We've only just begun processing feedback on the Open Leadership Definition draft. We'll continue revising (and discussing!) in our biweekly calls, and we're planning new pieces about this work. We're eager to learn from our community and hear how this work can be more useful, so while the current draft is closed to comments, we always invite feedback. [Why not follow along][5]? And keep an eye out for future opportunities to get involved.
--------------------------------------------------------------------------------
via: https://opensource.com/open-organization/21/7/manage-feedback-open-project
作者:[Laura Hilliger][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/laurahilliger
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_mistakes.png?itok=dN0OoIl5 (red pen editing mistakes)
[2]: https://opensource.com/open-organization/17/8/what-to-do-when-nobody-participates
[3]: https://github.com/open-organization/editorial/issues/94
[4]: https://opensource.com/open-organization/21/6/celebrate-sixth-anniversary
[5]: https://docs.google.com/spreadsheets/d/1ETyMtoNK9MpkTOm2wUvqBBtcnf1S6wGWOUPvOYFyrx8/edit#gid=0
[6]: https://github.com/red-hat-people-team/red-hat-multiplier

View File

@ -0,0 +1,204 @@
[#]: subject: (Write your first JavaScript code)
[#]: via: (https://opensource.com/article/21/7/javascript-cheat-sheet)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
[#]: collector: (lujun9972)
[#]: translator: (lixin555)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Write your first JavaScript code
======
JavaScript was created for the web, but it can do so much more. Learn
the basics, then download our cheat sheet so you always have the details
at hand.
![Code with javascript on white background][1]
JavaScript is a programming language full of pleasant surprises. Many people first encounter JavaScript as a language for the web. There's a JavaScript engine in all the major browsers, there are popular frameworks such as JQuery, Cash, and Bootstrap to help make web design easier, and there are even programming environments written in JavaScript. It seems to be everywhere on the internet, but it turns out that it's also a useful language for projects like [Electron][2], an open source toolkit for building cross-platform desktop apps with JavaScript.
JavaScript is a surprisingly multipurpose language with a wide assortment of libraries for much more than just making websites. Learning the basics of the language is easy, and it's a gateway to building whatever you imagine.
### Install JavaScript
As you progress with JavaScript, you may find yourself wanting advanced JavaScript libraries and runtimes. When you're just starting, though, you don't have to install JavaScript at all. All major web browsers include a JavaScript engine to run the code. You can write JavaScript using your favorite text editor, load it into your web browser, and see what your code does.
### Get started with JavaScript
To write your first JavaScript code, open your favorite text editor, such as [Notepad++][3], [Atom][4], or [VSCode][5]. Because it was developed for the web, JavaScript works well with HTML, so first, just try some basic HTML:
```
&lt;[html][6]&gt;
  &lt;[head][7]&gt;
    &lt;[title][8]&gt;JS&lt;/[title][8]&gt;
  &lt;/[head][7]&gt;
  &lt;[body][9]&gt;
    &lt;[p][10] id="example"&gt;Nothing here.&lt;/[p][10]&gt;
  &lt;/[body][9]&gt;
&lt;/[html][6]&gt;
```
Save the file, and then open it in a web browser.
![HTML displayed in browser][11]
(Seth Kenlon, [CC BY-SA 4.0][12])
To add JavaScript to this simple HTML page, you can either create a JavaScript file and refer to it in the page's `head` or just embed your JavaScript code in the HTML using the `<script>` tag. In this example, I embed the code:
```
&lt;[html][6]&gt;
  &lt;[head][7]&gt;
    &lt;[title][8]&gt;JS&lt;/[title][8]&gt;
  &lt;/[head][7]&gt;
  &lt;[body][9]&gt;
    &lt;[p][10] id="example"&gt;Nothing here.&lt;/[p][10]&gt;
    &lt;[script][13]&gt;
      let myvariable = "Hello world!";
      document.getElementById("example").innerHTML = myvariable;
    &lt;/[script][13]&gt;
   
  &lt;/[body][9]&gt;
&lt;/[html][6]&gt;
```
Reload the page in your browser.
![HTML with JavaScript displayed in browser][14]
(Seth Kenlon, [CC BY-SA 4.0][12])
As you can see, the `<p>` tag as written still contains the string "Nothing here," but when it's rendered, JavaScript alters it so that it contains "Hello world" instead. Yes, JavaScript has the power to rebuild (or just help build) a webpage.
The JavaScript in this simple script does two things. First, it creates a variable called `myvariable` and places the string "Hello world!" into it. Finally, it searches the current document (the web page as the browser is rendering it) for any HTML element with the ID `example`. When it locates `example`, it uses the `innerHTML` function to replace the contents of the HTML element with the contents of `myvariable`.
Of course, using a custom variable isn't necessary. It's just as easy to populate the HTML element with something being dynamically created. For instance, you could populate it with a timestamp:
```
&lt;[html][6]&gt;
  &lt;[head][7]&gt;
    &lt;[title][8]&gt;JS&lt;/[title][8]&gt;
  &lt;/[head][7]&gt;
  &lt;[body][9]&gt;
    &lt;[p][10] id="example"&gt;Date and time appears here.&lt;/[p][10]&gt;
    &lt;[script][13]&gt;
      document.getElementById("example").innerHTML = Date();
    &lt;/[script][13]&gt;
   
  &lt;/[body][9]&gt;
&lt;/[html][6]&gt;
```
Reload the page to see a timestamp generated at the moment the page is rendered. Reload a few times to watch the seconds increment.
### JavaScript syntax
In programming, **syntax** refers to the rules of how sentences (or "lines") are written. In JavaScript, each line of code must end in a semicolon (`;`) so that the JavaScript engine running your code understands when to stop reading.
Words (or "strings") must be enclosed in quotation marks (`"`), while numbers (or "integers") go without.
Almost everything else is a convention of the JavaScript language, such as variables, arrays, conditional statements, objects, functions, and so on.
### Creating variables in JavaScript
Variables are containers for data. You can think of a variable as a box where you can put data to share with your program. Creating a variable in JavaScript is done with two keywords you choose based on how you intend to use the variable: `let` and `var`. The `var` keyword denotes a variable intended for your entire program to use, while `let` creates variables for specific purposes, usually inside functions or loops.
JavaScript's built-in `typeof` function can help you identify what kind of data a variable contains. Using the first example, you can find out what kind of data `myvariable` contains by modifying the displayed text to:
```
&lt;string&gt;
let myvariable = "Hello world!";
document.getElementById("example").innerHTML = typeof(myvariable);
&lt;/string&gt;
```
This renders "string" in your web browser because the variable contains "Hello world!" Storing different kinds of data (such as an integer) in `myvariable` would cause a different data type to be printed to your sample web page. Try changing the contents of `myvariable` to your favorite number and then reloading the page.
### Creating functions in JavaScript
Functions in programming are self-contained data processors. They're what makes programming _modular_. It's because functions exist that programmers can write generic libraries that, for instance, resize images or keep track of the passage of time for other programmers (like you) to use in their own code.
You create a function by providing a custom name for your function followed by any amount of code enclosed within braces.
Here's a simple web page featuring a resized image and a button that analyzes the image and returns the true image dimensions. In this example code, the `<button>` HTML element uses the built-in JavaScript function `onclick` to detect user interaction, which triggers a custom function called `get_size`:
```
&lt;[html][6]&gt;
  &lt;[head][7]&gt;
    &lt;[title][8]&gt;Imager&lt;/[title][8]&gt;
  &lt;/[head][7]&gt;
  &lt;[body][9]&gt;
    &lt;[div][15]&gt;
      &lt;[button][16] onclick="get_size(document.getElementById('myimg'))"&gt;
        Get image size
    &lt;/[button][16]&gt;
    &lt;/[div][15]&gt;
   
    &lt;[div][15]&gt;
      &lt;[img][17] style="width: 15%" id="myimg" src="penguin.png" /&gt;
    &lt;/[div][15]&gt;
   
    &lt;[script][13]&gt;
      function get_size(i) {
        let w = i.naturalWidth;
        let h = i.naturalHeight;
        alert(w + " by " + h);
      }
    &lt;/[script][13]&gt;
   
  &lt;/[body][9]&gt;
&lt;/[html][6]&gt;
```
Save the file and load it into your web browser to try the code.
![Custom get_size function returns image dimensions][18]
(Seth Kenlon, [CC BY-SA 4.0][12])
### Cross-platform apps with JavaScript
You can see from the code sample how JavaScript and HTML work closely together to create a cohesive user experience. This is one of the great strengths of JavaScript. When you write code in JavaScript, you inherit one of the most common user interfaces of modern computing regardless of platform: the web browser. Your code is cross-platform by nature, so your application, whether it's just a humble image size analyzer or a complex image editor, video game, or whatever else you dream up, can be used by everyone with a web browser (or a desktop, if you deliver an Electron app).
Learning JavaScript is easy and fun. There are lots of websites with tutorials available. There are also over a million JavaScript libraries to help you interface with devices, peripherals, the Internet of Things, servers, file systems, and lots more. And as you're learning, keep our [**JavaScript cheat sheet**][19] close by so you remember the fine details of syntax and structure.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/javascript-cheat-sheet
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[lixin555](https://github.com/lixin555)
校对:[校对者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/code2.png?itok=JCJTJszs (Code with javascript on white background)
[2]: https://www.electronjs.org/
[3]: https://opensource.com/article/16/12/notepad-text-editor
[4]: https://opensource.com/article/20/12/atom
[5]: https://opensource.com/article/20/6/open-source-alternatives-vs-code
[6]: http://december.com/html/4/element/html.html
[7]: http://december.com/html/4/element/head.html
[8]: http://december.com/html/4/element/title.html
[9]: http://december.com/html/4/element/body.html
[10]: http://december.com/html/4/element/p.html
[11]: https://opensource.com/sites/default/files/pictures/plain-html.jpg (HTML displayed in browser)
[12]: https://creativecommons.org/licenses/by-sa/4.0/
[13]: http://december.com/html/4/element/script.html
[14]: https://opensource.com/sites/default/files/uploads/html-javascript.jpg (HTML with JavaScript displayed in browser)
[15]: http://december.com/html/4/element/div.html
[16]: http://december.com/html/4/element/button.html
[17]: http://december.com/html/4/element/img.html
[18]: https://opensource.com/sites/default/files/uploads/get-size.jpg (Custom get_size function returns image dimensions)
[19]: https://opensource.com/downloads/javascript-cheat-sheet

View File

@ -0,0 +1,95 @@
[#]: subject: (5 useful ways to manage Kubernetes with kubectl)
[#]: via: (https://opensource.com/article/21/7/kubectl)
[#]: author: (Alan Smithee https://opensource.com/users/alansmithee)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
5 useful ways to manage Kubernetes with kubectl
======
Learn kubectl to enhance how you interact with Kubernetes.
![Ship captain sailing the Kubernetes seas][1]
Kubernetes is software to help you run lots of containers in an organized way. Aside from providing tools to manage (or [orchestrate][2]) the containers you run, Kubernetes also helps those containers scale out as needed. With Kubernetes as your central control panel (or _control plane_), you need a way to manage Kubernetes, and the tool for that job is kubectl. The `kubectl` command lets you control, maintain, analyze, and troubleshoot Kubernetes clusters. As with many tools using the `ctl` (short for "control") suffix, such as systemctl and sysctl, kubectl has purview over a broad array of functions and tasks, so you end up using it a lot if you're running Kubernetes. It's a big command with lots of options, so here are five common tasks that kubectl makes easy.
### 1\. List and describe resources
Containers, by design, tend to multiply. Under certain conditions, they can multiply rapidly. This can get overwhelming if the only way you have to see running containers is `podman ps` or `docker ps`. With `kubectl get` and `kubectl describe`, you can get information about what pods are running and the containers they're handling. What's more is that you can get just the information you need by using options like `--namespace` or `name` or `--selector`.
The `get` subcommand is useful for a lot more than just pods and containers. It has information about nodes, namespaces, deployments, services, and replicas.
### 2\. Create resources
If you've only ever created deployments through a web user interface (UI) like one provided by OpenShift, OKD, or Kubernetes, but you're looking to take control of your cluster from your Linux terminal instead, then get ready to use `kubectl create`. The `kubectl create` command doesn't just instantiate a new app deployment, though. There are lots of other components available in Kubernetes that you can create, such as services, quotas, and [CronJobs][3].
A CronJob in Kubernetes can create a transient pod meant to perform some task on a schedule of your choice. They're not difficult to set up. Here's a CronJob to have a BusyBox image echo "hello world" every minute:
```
$ kubectl create cronjob \
hello-world \
\--image=busybox \
\--schedule="*/1 * * * *" -- echo "hello world"
```
### 3\. Edit files
You may have an understanding that objects in Kubernetes have accompanying configuration files, but rummaging through your filesystem to find the appropriate file can be troublesome. With `kubectl edit`, you can keep your mind on the objects and not on the files that define them. You can have `kubectl` find and open the file for you (it respects the `KUBE_EDITOR` environment variable, so you can set your editor to whatever you prefer):
```
$ KUBE_EDITOR=emacs \
kubectl edit cronjob/hello-world
```
### 4\. Trade files between containers
Newcomers to containers are often baffled by the concept of a shared system that they can't apparently access. They may learn about `exec` options in their container engine or in kubectl itself, but containers still can seem impervious when they can't just grab a file from or place a file into a container. Using the `kubectl cp` command, you can treat containers as if they were remote servers, making copying files to and from containers no more complex than an SSH command:
```
`$ kubectl cp foo my-pod:/tmp`
```
### 5\. Apply changes
Making changes to Kubernetes objects can be done at any time with the `kubectl apply` command. All you have to do is point the command to a configuration file:
```
`$ kubectl apply -f ./mypod.json`
```
Akin to running an Ansible playbook or a Bash script, `apply` makes it easy to "import" settings quickly into a running Kubernetes instance. For instance, the GitOps tool [ArgoCD][4] is surprisingly simple to install thanks to the `apply` subcommand:
```
$ kubectl create namespace argocd
$ kubectl apply -n argocd \
-f <https://raw.githubusercontent.com/argoproj/argo-cd/vx.y.z/manifests/install.yaml>
```
### Use kubectl
Kubectl is a powerful tool, and because it's a terminal command it can be scripted and used in many ways a web UI cannot. Learning kubectl is a great way to further your understanding of Kubernetes, containers, pods, and all the technologies that surround these important cloud innovations. [Download our kubectl cheat sheet][5] for a quick reference, complete with sample commands, to help you as you learn and remind you of the details once you're a pro.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/kubectl
作者:[Alan Smithee][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/alansmithee
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ship_captain_devops_kubernetes_steer.png?itok=LAHfIpek (Ship captain sailing the Kubernetes seas)
[2]: https://opensource.com/article/20/11/orchestration-vs-automation
[3]: https://opensource.com/article/20/11/kubernetes-jobs-cronjobs
[4]: https://argoproj.github.io/argo-cd/
[5]: https://opensource.com/downloads/kubectl-cheat-sheet

View File

@ -0,0 +1,84 @@
[#]: subject: (Fixing Flatpak Error: No remote refs found similar to flathub)
[#]: via: (https://itsfoss.com/no-remote-ref-found-flatpak/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Fixing Flatpak Error: No remote refs found similar to flathub
======
So, I just installed Fedora. Installing my favorite applications was among the list of things to do after installing Fedora.
I tried installing VLC in Flatpak form, but it gave me an error:
**error: No remote refs found similar to flathub**
![No remote refs found error displayed with Flatpak][1]
### Fixing “no remote refs found similar to flathub” error
The fix is rather simple. Add the Flathub repository in the following way:
```
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
```
It will ask for your password, or you could use the above command with sudo.
Now, if you try to install a Fltapak package from Fltahub, it should work as expected.
![Adding the Flathub repoistory fixes the issue][2]
### Reason why you see this error and how it was fixed
Now that have fixed the error, it would be a good idea to also learn why you saw this error in the first place and how it was fixed.
Like most other package managers in Linux, Flatpak also works on the concept of repositories. In simpler words, you can imagine package repositories as a warehouse where packages are stored.
But in order to retrieve a package from this warehouse, you need to know the address of the warehouse first.
Thats what happens here. You are trying to download (and install) a package from a certain repository (Flathub in this case). But your system doesnt know about this “flathub”.
In order to solve this issue, you added the Flathub repository. When you do that, your Linux system can look for the package you are trying to install in this repository.
You may see all the remote Flatpak repository added to your system.
![List Flatpak repositories added to your system][3]
Lets have a deeper look at the command which was used for adding the repository:
```
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
```
* flatpak: this is the flatpak CLI tool.
* remote-add: this option indicates that you are adding a new remote repository.
* if-not-exists: this ensures that the remote repository is only added if it is not added already.
* flathub: this is short reference for the complete URL of the actual repository. You may name it something else but the convention is to use the one provided by the developer.
* <https://flathub.org/repo/flathub.flatpakrepo>: The actual repository address.
_**So, the bottom line is that when you see Flatpak complaining about no remote refs found similar to xyz, verify that the said repository is not added and if thats the case, figure out its URL and add it to the system.**_
I hope this quick tip help you with this Flatpak issue.
--------------------------------------------------------------------------------
via: https://itsfoss.com/no-remote-ref-found-flatpak/
作者:[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://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/flatpak-remote-ref-not-found-error-800x265.png?resize=800%2C265&ssl=1
[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/flatpak-no-remote-ref-problem-fixed.png?resize=800%2C317&ssl=1
[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/flatpak-list-repositories.png?resize=800%2C317&ssl=1

View File

@ -0,0 +1,146 @@
[#]: subject: (28 books recommended by open source technologists to read right now)
[#]: via: (https://opensource.com/article/21/7/open-source-books)
[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
28 books recommended by open source technologists to read right now
======
Members of the Opensource.com community share what books they are
enjoying reading.
![Ceramic mug of tea or coffee with flowers and a book in front of a window][1]
Did you get our [summer reading list][2]?
It may not be the season of summer where you are, but summer reading lists are quintessential and somewhat cozy no matter what part of the world you live in. I love the idea of a cool breeze, a lounge chair, a drink, and a snack... all wrapped up together with a good book to pour over.
Fiction and non-fiction. Dramas, mysteries, science, romance... let us know in the comments what you're reading.
* * *
I'm working through _[How to Measure Anything][3]_, which is pretty cool. Recommended! —Moshe Zadka
For science fiction lovers, I recommend Luis McMaster Bujold's _[Vorkosigan Saga][4]_. I had never heard of her until reading Larry Wall's lecture _[Perl, the first postmodern computer language][5]_: "Note how we still periodically hear the phrase 'serious literature'. This is literature that is supposedly about Real Life. Let me tell you something. The most serious literature Ive ever read is by Lois McMaster Bujold. Any of you read her? Its also the funniest literature Ive ever read. Its also space opera. 'Genre fiction,' sneers the Modernist. Meaning it follows certain conventions. So what? Nobody in the world can mix gravity and levity the way Bujold does in her Vorkosigan books. Its oh so definitely about real life. So what if it follows space opera conventions. Sonnets follow certain conventions too, but I dont see them getting sneered at much these days. Certainly, they were always called 'serious'."
So, I started with the [_Vor Game_][6] and then couldn't stop until I finished all of the series. Moving, funny, entertaining. —Petr Beranek
I finished reading _[The Sleep Revolution][7]_ by Arianna Huffington last week. Currently reading _[The Devil in the White City][8]_ by Erik Larson. —Lauren Maffeo
I'm currently reading [_Nemesis Games_][9] (book 5 in _The Expanse_sci-fi series).
Next on my reading list is [_Greater Good_][10] (book 2 in the_Star Wars: Thrawn Ascendency_series). I fell into the Star Wars books a few years ago, and have been reading them in between other books on my reading list. I loved the original _Thrawn_ series, the _Ahsoka_ book, the _Darth Bane_ series, and the _Darth Plagueis_ book. Some are not so great, like _Outbound Flight_ (didn't get into it), _Master &amp; Apprentice_ (kind of dull), and _Light of the Jedi_ (the first in the "High Republic" series). And then there are some in the middle, like the _Tarkin_ book (interesting character) and _Lords of the Sith_ (predictable, but good).
McCloud's _[Understanding Comics][11]_ is a great book! I read it when I was working on my Master's degree, about 8 years ago, during my independent study on visual rhetoric. My instructor and I found it to be a very useful reference in how images communicate.
Another one: _[Picture This][12]_ by Molly Bang. I thumbed through that so many times when learning about icons (same visual rhetoric class) that some of the pages started falling out. —Jim Hall
Sometimes, I wonder what I haven't been reading, because I always have a book or two or three on my Kindle.
I am a huge reader of SciFi and Fantasy, so I just finished the Hugo and Nebula winner, [_A Memory Called Empire_][13]. It has a fascinating premise and good characterizations, but I thought the writing would be a little stronger. Like Ancillary Justice, this book explores the idea of colonization. But in the case of A Memory Called Empire the colonizers look a lot like the Aztec Empire writ large. Oh, and this empire is obsessed with complicated poetry. Citizens use poems to encrypt email and provide travelogues.
My favorite book in a while is _[All Systems Red][14]_, the first book in The Murderbot Diaries, by Martha Wells. Imagine that you have an artificial human, who's a little bit of a clone and a little bit of a robot. She's sentient and self-aware, can destroy a human or a building in seconds flat, and has overwritten her governor program, but really she just wants to curl up in her cubby and binge-watch her favorite infotainment. Oh, and she has social anxiety. Except for the part about being able to destroy a spaceship, she's a lot like me.
I'm also currently reading Brandon Sanderson's [_Words of Radiance_][15]. —Ingrid Towey
One of the best recent books I read was _[Bomber Mafia][16]_ by Malcolm Gladwell. It was a fascinating read. I also read *[Persist][17] *by Elizabeth Warren which I found interesting. I just started reading [_While Justice Sleeps_][18] by Stacey Abrams. I recently read "Killing Crazy Horse" by Bill O'Reilly and "The Soul of a Woman" by Isabel Allende. That book was so compelling that I bought copies for my daughter and daughter-in-law. —Don Watkins
Im currently reading the new Christine Morgan novel _[Trench Mouth][19]_, having just finished the original *Metropolis *(the one Fritz Lang adapted the movie from), and next up is _Cultish: The Language of Fanaticism_ by Amanda Montell. Ive also got _Workplace Jazz_ and _Culture is the Bass_ by Gerold Leonard in there, and am eagerly awaiting _Final Girl Support Group_ by Grady Hendrix, which will be out next month. —Kevin Sonney
I've got two books I'm reading: _[Laziness Does Not Exist][20]_ by Devon Price. This is a look at how the over-emphasis on productivity has gone too far in our culture. And, [_His Truth is Marching On_][21] by Jon Meacham. This is a look at the life and experience of John Lewis. —Steve Morris
My year-round reading continues to be mainly books from Project Gutenberg. Recently I've read a number of books by Hillaire Belloc, mainly his commentaries on various topics ("On Anything", "On Everything" to name two). I also enjoy reading things by GK Chesterton. It can be hard to decide what the real point is that he is trying to make as he complains about this or that, but he's entertaining nonetheless.
Currently, I'm reading _[Thirty Strange Stories][22]_ by HG Wells. I've also read a number of his commentaries, which are quite good generally. It seems that most books I read come from the late 19th or very early 20th century.
**[Read next: [10 must-read technology books for 2021][23]]**
A book I would recommend if you've never read it is _[Candide][24]_ by Voltaire. I went through it hopping back and forth from the English to the French versions. The French seemed just a bit more entertaining.
I do all this with my tablet. Something I've really gotten attached to is the ability to highlight some word or phrase, then immediately be able to look it up on the internet on the tablet, or translate with an app. —Greg Pittman
I recommend: _[Mastermind][25]_ by Maria Konnikova, and _[The Mind Map Book][26]_ by Tony Buzan —Hüseyin GÜÇ
I've been reading a lot of work-related books through a couple of work bookclubs. One I'm reading now that I really like is _[No Hard Feelings][27]_ by Fosslien and Duffy-West. It's a light read that talks about the ways emotions show up at work, and how to manage (your and other people's) emotions at work.
Outside work, I've been reading some books on design. _[Understanding Comics][11]_ by Scott McCloud is my current read, and I recently finished the very enjoyable _[How Design Makes the World][28]_ by Scott Berkun, simultaneously a great lit review of books on the design of everyday things around us, and an overview of how (conscious and unconscious) design decisions impact our lives, and how we can improve the world by being aware of when we make our own design decisions.
Finally, I have also been reading some historical non-fiction. Most recently, I loved _[The Guns of August][29]_ by Barbara Tuchman about the outbreak and early days of World War One. And I'm looking forward to reading "How the Irish Became White" (a book I heard about from Christine Dunbar-Hester, who wrote the book Bryan recommended) about the evolution of the Irish cultural identity through the 19th and 20th century. —Dave Neary
A little out of the how-to corner: I am currently reading [_Learn You a Haskell for Great Good!_][30] It is a beginner's guide to the Haskell programming language, a very strange thing from my viewpoint. —Stephan Avenwedde
Here in Vancouver, Canada we have hit summer weather as well as passing the solstice; today we're expecting a high of 26ºC and by late in the week we may hit 30ºC (which is unusually warm hereabouts). But lovely, for sure. And I'm looking forward to kicking back in the late afternoon with a nice cool beverage and a good book, so just in time for the summer reading list!
My colleagues in Chile are in quarantine right now and it's winter there. The Mapuche new year We Tripantu and the Aymara Willkakuti are upon us, a time of reflection, celebration, and anticipation of the year to come: all, I am sure, hoping for better! There is also the winter school vacation that in theory runs from the 12th to the 23rd of July, which in a normal year would give an opportunity for digging into the recommendations on the summer reading list after a day of chasing the kids around a park or skiing or sledding in the mountains. For anyone interested, here is a short English article on [Willkakuti in Bolivia][31], and here is another on [We Tripantu in Argentina and Chile][32]. —Chris Hermansen
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/open-source-books
作者:[Jen Wike Huger][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/jen-wike
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tea-cup-mug-flowers-book-window.jpg?itok=JqThhl51 (Ceramic mug of tea or coffee with flowers and a book in front of a window)
[2]: https://opensource.com/article/21/6/2021-opensourcecom-summer-reading-list
[3]: https://openlibrary.org/books/OL7596184M/How_to_Measure_Anything
[4]: https://en.wikipedia.org/wiki/Vorkosigan_Saga
[5]: http://www.wall.org/~larry/pm.html
[6]: https://en.wikipedia.org/wiki/The_Vor_Game
[7]: https://www.ariannahuffington.com/the-sleep-revolution/
[8]: https://eriklarsonbooks.com/book/the-devil-in-the-white-city/
[9]: https://en.wikipedia.org/wiki/Nemesis_Games
[10]: https://starwars.fandom.com/wiki/Thrawn_Ascendancy:_Greater_Good
[11]: https://en.wikipedia.org/wiki/Understanding_Comics
[12]: https://www.mollybang.com/Pages/picture.html
[13]: https://en.wikipedia.org/wiki/A_Memory_Called_Empire
[14]: https://en.wikipedia.org/wiki/All_Systems_Red
[15]: https://stormlightarchive.fandom.com/wiki/Words_of_Radiance
[16]: https://en.wikipedia.org/wiki/Bomber_Mafia
[17]: https://us.macmillan.com/books/9781250799241
[18]: https://www.penguinrandomhouse.com/books/648021/while-justice-sleeps-by-stacey-abrams/
[19]: https://www.fantasticfiction.com/m/christine-morgan/trench-mouth.htm
[20]: https://bookshop.org/books/laziness-does-not-exist/9781982140106
[21]: https://www.penguinrandomhouse.com/books/606295/his-truth-is-marching-on-by-jon-meacham/
[22]: http://www.gutenberg.org/ebooks/59774
[23]: https://enterprisersproject.com/article/2021/1/10-technology-books-must-read-2021
[24]: https://en.wikipedia.org/wiki/Candide
[25]: https://www.mariakonnikova.com/books/mastermind/
[26]: https://tonybuzan.com/product/the-mind-map-book/
[27]: https://www.penguinrandomhouse.com/books/564051/no-hard-feelings-by-liz-fosslien-and-mollie-west-duffy/
[28]: https://designmtw.com/
[29]: https://en.wikipedia.org/wiki/The_Guns_of_August
[30]: http://learnyouahaskell.com/
[31]: https://info.handicraft-bolivia.com/Aymara-New-Year-a33-sm162
[32]: https://www.mapuche-nation.org/english/html/news/n-276.html

View File

@ -0,0 +1,77 @@
[#]: subject: (How to Fix yay: error while loading shared libraries: libalpm.so.12)
[#]: via: (https://www.debugpoint.com/2021/07/yay-error-libalpm-so-12/)
[#]: author: (Arindam https://www.debugpoint.com/author/admin1/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
How to Fix yay: error while loading shared libraries: libalpm.so.12
======
This quick guide is to help you to fix yay error while loading shared
libraries: libalpm.so.12.
If you are running [Arch Linux][1] in a system for a longer time, things can break due to its rolling release nature combined with your hardware support. If you use the [AUR Helper Yay][2], then sometimes, yay can be corrupted due to several installations, upgrade of other packages.
The YAY helper itself is very stable, but sometimes it gets messed up, and you can not do any installation using it until you fix it. And one of the nagging error is this:
```
yay: error while loading shared libraries: libalpm.so.12: cannot open shared object file: No such file or directory
```
This error particularly comes after upgrading to pacman 6.0 due to incompatibility of shared libraries.
![error while loading shared libraries yay][3]
### How to fix yay error while loading shared libraries: libalpm.so.12
* This error can only be fixed by uninstalling yay completely, including its dependencies.
* Then re-installing yay.
* There is no other way to solve this error.
* We already have a guide [how to install Yay][4], however, here are the steps to fix.
* Clone the yay repo from AUR and build. Run the following command in sequence from a terminal window.
```
cd /tmp
git clone 'https://aur.archlinux.org/yay.git'
cd /tmp/yay
makepkg -si
cd ~
rm -rf /tmp/yay/
```
After installation, you can try running the command which gave you this error. And you should be all set. If youre still having error, let me know in the comment box below.
Apparently, this has been encountered by many people and [several discussions][5] happened across web. Above is the only solution to this error. And I could not find exact root cause of the problem anywhere except it starts after pacman 6.0 update.
[][6]
SEE ALSO:   How to Install Java in Arch Linux and Manjaro
* * *
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/2021/07/yay-error-libalpm-so-12/
作者:[Arindam][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://www.debugpoint.com/author/admin1/
[b]: https://github.com/lujun9972
[1]: https://archlinux.org/
[2]: https://aur.archlinux.org/packages/yay/
[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/error-while-loading-shared-libraries-yay.jpg
[4]: https://www.debugpoint.com/2021/01/install-yay-arch/
[5]: https://github.com/Jguer/yay/issues/1519
[6]: https://www.debugpoint.com/2021/02/install-java-arch/

View File

@ -0,0 +1,118 @@
[#]: subject: (UVdesk: A Free and Open-Source Helpdesk Ticket System)
[#]: via: (https://itsfoss.com/uvdesk/)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
UVdesk: A Free and Open-Source Helpdesk Ticket System
======
There are countless open-source solutions (including [website creation tools][1] and [forum software][2]) that power the web, and a helpdesk system is one of the vital areas that can benefit from it.
UVdesk is a free and open-source PHP based support ticket system with impressive options that you can start for free.
Here I shall mention more about it and how you can set it up for your business.
### UVDesk: Open-Source Customer Support Solution
![][3]
[UVDesk][4] is a helpdesk system built on [Symfony][5] (PHP framework for web development). An exciting alternative to proprietary ticketing systems like Zendesk.
It is another open-source offering from the same company responsible for [Bagisto][6] (an ecommerce platform that weve covered before).
UVDesk is primarily free but offers paid options if you want extra features and added security for your business.
You can respond to customer queries, create documentations, manage the support tickets, and do a lot of things from a single place. This is especially helpful if you have an [eCommerce platform][7] setup.
To explore more about it, let me highlight the key features it offers.
### Features of UVDesk Helpdesk System
In addition to the basic abilities of a support system, it also offers some interesting features.
![][8]
Heres an overview of the features offered:
* Ticket management and administration
* Task management options to assign tickets and set a deadline for support agents
* Email management to convert emails to support tickets
* Ability to create documentations (knowledgebase) to guide customers for self-help
* Theme customization of the support system/portal
* Multi-channel support (aggregating support requests from different platforms like Facebook, Amazon, Website)
* Automated options for customer follow-up reminders
* Improve the workflow with the ability to automate tasks and how theyre handled
* Progress Web App support
* Social Media App integration
* Ecommerce multi-channel integration
* Form builder
* Monitor agents support performance
* Easy migration options when switching from a different support system to UVdesk
* Self-hosting
Do note that some of the features will be limited to the paid option. But the essential features should be available completely for free.
### Get Started Using UVdesk
You can directly download the zip package from the [official website][4]. It can be deployed using Docker as well.
For installation instructions, you can check their [GitHub page][9] and the [official documentation][10] to check the system requirements. In either case, you can also opt for a one-click setup on your Linux server using [Softaculous installer][11].
[UVdesk][4]
### Quick Impressions on the Demo
They offer you the ability to try a [live demo][12] before you consider using it.
![][13]
Ive never worked on a support system before, but limited to eCommerce projects using OpenCart, which is one of the [best open source eCommerce platforms][7].
But I found the back-end system to be pretty simple and accessible. It is not a breathtaking experience on the back-end side, but ranging from the branding customization options to managing the knowledge base, it is an easy-to-use experience.
![][14]
I also found the ticket management good enough.
![][15]
### Wrapping Up
Overall, UVdesk is a flexible, open-source helpdesk system that you can try and use for free. Of course, if you have a sizable business, you may need to opt for the paid plans available.
What other open-source helpdesk systems do you know of? How important do you think a helpdesk portal is? Let me know in the comments below!
--------------------------------------------------------------------------------
via: https://itsfoss.com/uvdesk/
作者:[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://itsfoss.com/open-source-cms/
[2]: https://itsfoss.com/open-source-forum-software/
[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/uvdesk-open-source.png?resize=800%2C461&ssl=1
[4]: https://www.uvdesk.com/en/opensource/
[5]: https://symfony.com/
[6]: https://itsfoss.com/bagisto/
[7]: https://itsfoss.com/open-source-ecommerce/
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/uvdesk-contact.png?resize=800%2C548&ssl=1
[9]: https://github.com/uvdesk/community-skeleton
[10]: https://docs.uvdesk.com
[11]: https://www.softaculous.com
[12]: https://demo.uvdesk.com/
[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/uvdesk-admin.png?resize=800%2C830&ssl=1
[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/uvdesk-mail-settings.png?resize=800%2C469&ssl=1
[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/uvdesk-ticket-management.png?resize=800%2C664&ssl=1

View File

@ -0,0 +1,77 @@
[#]: subject: (How to Install VLC on Fedora Linux)
[#]: via: (https://itsfoss.com/install-vlc-fedora/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
How to Install VLC on Fedora Linux
======
If you have just installed Fedora and now wants to install your favorite video player VLC on it, you probably wont find it in the software center. Not immediately, at least.
For reasons best known to their developers, Fedora neither ship with [VLC][1] nor does it include in the official Fedora repository.
So, how do you install VLC on Fedora then? Simple. RPM Fusion is your friend here. Let me show you the steps in detail.
### Installing VLC on Fedora Linux
Using the command line will be easier here. You may use the graphical method as well. Ill discuss it later.
Open a terminal and use the following command to add and enable RPM Fusion repository that contains the VLC package:
```
sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
```
Press Y when asked to confirm adding the new repo. Next, install VLC using DNF command:
```
sudo dnf install vlc
```
It will install VLC in Fedora from the RPM Fusion repository and a few additional dependencies from various repositories.
![Installing VLC in Fedora with DNF command][2]
Once installed, you can search for VLC in the application menu or search for it in the “activities area”.
![Search for VLC][3]
Click on it, start it and enjoy it.
#### Alternate method: Installing VLC from software center
When you have enabled RPM Fusion repository, you can display the applications from this repo in the software center. To do that, use the following command in the terminal:
```
sudo dnf groupupdate core
```
After that, open software center and search for VLC and install from there.
![VLC in Fedora software center][4]
If you have added FlatHub repository, please avoid installing the Flatpak version of VLC because it is around 1 GB in size. The RPM version is a lot smaller in size.
I hope you find this quick tutorial helpful in installing VLC on Fedora. Enjoy.
--------------------------------------------------------------------------------
via: https://itsfoss.com/install-vlc-fedora/
作者:[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.videolan.org/
[2]: https://itsfoss.com/wp-content/uploads/2021/07/installing-vlc-fedora-800x422.webp
[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/vlc-fedora.png?resize=799%2C223&ssl=1
[4]: https://itsfoss.com/wp-content/uploads/2021/07/vlc-in-fedora-software-center-800x486.webp

View File

@ -0,0 +1,144 @@
[#]: subject: (How to Recover Arch Linux Install via chroot)
[#]: via: (https://www.debugpoint.com/2021/07/recover-arch-linux/)
[#]: author: (Arindam https://www.debugpoint.com/author/admin1/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
How to Recover Arch Linux Install via chroot
======
This quick guide explains some of the steps which may come in handy to
recover an Arch Linux Install.
Being a rolling release, sometimes things breaks in [Arch Linux][1]. Not because of your own actions, but hundreds of other reasons such as new Kernel vs your hardware, or software compatibility. But still, Arch Linux is still better and provides the latest packages and applications.
But sometimes, it gives you trouble and you end up with a blinking cursor and nothing else.
So, in those scenarios, instead of re-formatting or reinstalling, you may want to try to recover the installation including the data before giving up your hope. This guide outlines some steps in that direction.
### Recover Arch Linux Installation
* First step is to **create a bootable LIVE USB** with Arch Linux. Download the .ISO from this link and create a bootable .ISO. You can check out this guide on [how to create bootable .ISO using Etcher][2]. Remember this step require another working stable system obviously as your current system is not usable.
[download arch linux][3]
* You need to know on **which partition your Arch Linux** is installed. This is a very important step. If you dont know, you can use GParted to find out. Or check in your Grub menu, Or you can run the below command to find out. This will list all of your disk partitions with their size, labels.
```
sudo lsblk -o name,mountpoint,label,size,uuid
```
* Once done, plug-in the USB stick and boot from it. And you should see the Arch Linux prompt in the LIVE medium.
* Now, mount to the Arch Linux partition using below. Change the `/dev/sda3` to your respective partition.
```
mount /dev/sda3 /mnt
arch-chroot /mnt
```
* The arch-chroot command will mount your Arch Linux partition in the terminal, so login using your Arch credentials. Now, at this stage, you have the following options, based on what you want.
* You can take backups of your data by going through /home folders. In case, troubleshooter doesnt work. You may copy the files to external USB or another partition.
* Verify the log files, specially the **pacman logs**. Because, unstable system may be caused by upgrading some packages such graphics driver or any other driver. Based on the log, you may want to downgrade any specific package if you want.
* You may use the below command to view last 200 lines of the pacman log file to find out any failing items or dependency removal.
```
tail -n 200 /var/log/pacman.log | less
```
* The above command gives you the 200 lines from the end of the pacman.log file to verify. Now, carefully check which of the packages were updates since your successful boot.
* And note down the package name and version somewhere. And you may try to downgrade packages one-by-one or if you think a specific package created a problem. Use the -U switch of pacman command to downgrade.
```
pacman -U <package name>
```
* You can run the following to start your Arch system after downgrading, if any.
```
exec /sbin/init
```
* Check the status of your display manager, whether if there are any errors. Sometimes, display manager creates a problem which cant communicate with X Server. For example, if you are using lightdm, then you can check its status via below.
```
systemctl status lightdm
```
* Or, may want to start it via below command and check what is the error.
```
lightdm --test-mode --debug
```
* Here is an example of lightdm failure which caused an unstable Arch system.
![lightdm test mode][4]
* Or check via kicking off the X server using `startx`.
* In my experience, if you see errors in the above command, try to install another display manager such as **sddm** and enable it. It may eliminate the error.
* Try the above steps, based on the state of your system, and troubleshoot. For errors specific to display manager lightdm, we have a [guide][5] which you may want to check out.
* If you are using sddm, then check out [these troubleshooting steps][6] if something works.
[][7]
SEE ALSO:   Essential Pacman Commands for Arch Linux [With Examples]
### Closing Notes
Every installation is different. And above steps may/may not work for you. But it is worth a try and as per experience, it works. If it works, well, good for you. Either way, do let me know in the comment box below, how it goes.
* * *
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/2021/07/recover-arch-linux/
作者:[Arindam][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://www.debugpoint.com/author/admin1/
[b]: https://github.com/lujun9972
[1]: https://www.debugpoint.com/tag/arch-linux
[2]: https://www.debugpoint.com/2021/01/etcher-bootable-usb-linux/
[3]: https://archlinux.org/download/
[4]: https://www.debugpoint.com/blog/wp-content/uploads/2021/03/lightdm-test-mode.jpg
[5]: https://www.debugpoint.com/2021/03/failed-to-start-lightdm/
[6]: https://wiki.archlinux.org/title/SDDM#Troubleshooting
[7]: https://www.debugpoint.com/2021/02/pacman-command-arch-examples/

View File

@ -0,0 +1,63 @@
[#]: subject: (Making PDFs more accessible to screen readers with open source)
[#]: via: (https://opensource.com/article/21/7/pdf-latex)
[#]: author: (Quinn Foster https://opensource.com/users/quinn-foster)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Making PDFs more accessible to screen readers with open source
======
One university open source program office is working to improve
accessibility of an open access journal with LaTeX.
![Person using a laptop][1]
A screen reader is a vital tool that helps individuals who are blind or low-vision read digital text. Unfortunately, not all file formats receive the same level of support from screen readers. For example, while PDF files have accessibility features that you can use, they are often not the preferred file format for screen reader users. Between line breaks, multiple columns, symbols, and images, screen readers can have trouble reading PDFs in a cohesive way to their users.
This is what the folks at [Open@RIT][2] are trying to change.
Open@RIT is the open source program office at the Rochester Institute of Technology, offering RIT faculty and staff assistance in opening their research projects and maintaining communities of practice around their work. One such faculty member is Dr. Todd Pagano, Professor of Chemistry and Associate Dean for Teaching and Scholarship Excellence at the National Technical Institute for the Deaf. Dr. Pagano came to Open@RIT seeking help to increase the accessibility of an open-access journal, the publications of which currently exist as PDFs.
The Open@RIT team, consisting of UX designer Rahul Jaiswal and full-stack developer Suhas C.V., have used this project as a stepping stone to begin exploring ways to convert PDFs into accessible HTML.
> "It's very difficult to make PDFs fully accessible, especially in an automated way," says Mike Nolan, assistant director of Open@RIT. 
Open@RIT tested multiple tools that already included accessibility features in their quest to convert PDFs into HTML successfully. Despite these features, the resulting HTML files still had many issues that made them difficult for screen readers to read, such as pauses and interruptions.
At this point, Open@RIT decided to pursue a more open source tool-chain to assist in the conversion from received submissions to accessible formats like HTML while maintaining the same style and general look of the published article, in which the use of LaTeX was instrumental.
The workflow with LaTeX is simple:
* A submitted paper—in the form of a PDF—is pasted into a  `.tex` template and turned into a `.tex` file.
This `.tex` template is an edited version of the Association for Computing Machinery ([ACM][3]) `.tex` template.
* Then [_tex2html_][4]—the conversion tool built by Open@RIT—is applied to the `.tex` file that uses an open source LaTeX converter called LaTeXML to convert it to HTML finally.
* The resulting HTML file shows significant improvement with screen readers.
Some standing issues with the tool-chain are still being worked on, but using LaTeX to facilitate and standardize the generation of the resulting formats (PDF and HTML) has shown great promise in achieving this goal. Publishing journal articles in PDF and HTML gives readers a choice and more options for compatibility with screen readers.
Those who want to learn more about the project will get the chance very soon. During their explorations of LaTeX, Rahul and Suhas contacted experts associated with [TeX Users Group (TUG) 2021][5]—this year's conference run by [TUC][6] for all things TeX and LaTeX. They're invited to do a presentation on their project. The duo, along with Dr. Pagano, will discuss how they have been using LaTeX in their accessibility efforts and the need for journals to be accessible. TUG 2021 will be running online from August 5-8, 2021.
Their work shows the capacity for open source to be used in a way that doesn't just increase digital transparency but also accessibility for all people.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/pdf-latex
作者:[Quinn Foster][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/quinn-foster
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop)
[2]: https://www.rit.edu/research/open
[3]: https://services.acm.org/public/qj/keep_inventing/qjprofm_control.cfm?promo=DA4SCA
[4]: https://gitlab.com/open-rit/tex2html
[5]: https://tug.org/tug2021/
[6]: https://www.tug.org/

View File

@ -0,0 +1,386 @@
[#]: subject: (Command line quick tips: wc, sort, sed and tr)
[#]: via: (https://fedoramagazine.org/command-line-quick-tips-wc-sort-sed-and-tr/)
[#]: author: (mahesh1b https://fedoramagazine.org/author/mahesh1b/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Command line quick tips: wc, sort, sed and tr
======
![][1]
Image by Ryan Lerch (CC BY-SA 4.0)
Linux distributions are great to use and they have some tricks under their sleeves which users may not be aware of. Lets have a look at some command line utilities which really come in handy when youre the guy that likes to stick with the terminal rather than using a GUI. 
We all know that using a terminal is more efficient to use the system. In case you are editing or playing with text files on a terminal then these tools will surely make your life easy.
For this article lets have a look at _wc_, _sort_, _tr_, and _sed_ commands.
## **wc**
wc is a utility whose name stands for “word count”. As the name suggests it will count the lines, words or byte count from any file. 
Lets see how it works:
```
$ wc filename
lines words characters filename
```
So in output we get the total number of newlines in the file, total number of words, total number of characters, and the filename.
To get some specific output we have to use options:
* -c To print the byte counts
* -l   To print the newline counts
* -w To print the word counts
* -m To print the character counts
### wc demo
Lets see it in action:
Here we start with a text file, _loremipsm.txt_. First, we print out the file and then use _wc_ on it.
```
$ cat loremipsm.txt
Linux is the best-known and most-used open source operating system.
As an operating system, Linux is software that sits underneath all of the other software on a computer,
receiving requests from those programs and replaying these requests to the computer's hardware.
$ wc loremipsm.txt
3 41 268 loremipsm.txt
```
Suppose I only want to see the byte count of the file: 
```
$ wc -c loremipsm.txt
268 loremipsm.txt
```
For the newline count of the file:
```
$ wc -l loremipsm.txt
3 loremipsm.txt
```
To see the word count of the file:
```
$ wc -w loremipsm.txt
41 loremipsm.txt
```
Now only the character count of the file:
```
$ wc -m loremipsm.txt
268 loremipsm.txt
```
## **sort**
The _sort_ command is one of the most useful tools. It will sort the data in a file. Sorting is by either characters or numbers in ascending or descending order. It can also be used to sort or randomize the lines of files.
Using _sort_ can be very simple.  All we need to do is provide the name of the file.
```
$ sort filename
```
By default it sorts the data in alphabetical order. One thing to note is that the _sort_ command just displays the sorted data. It does not overwrite the file.
Some useful options for _sort_: 
* -r  To sort the lines in the file in reverse order
* -R To shuffle the lines in the file into random order
* -o To save the output in another file
* -k To sort as per specific column
* -t To mention the field separator
* -n To sort the data according to numerical value
### sort demo
Lets use _sort_ in some short demos:
We have a file, _list.txt_, containing names and numeric values separated by commas.
First lets print out the file and just do simple sorting.
```
$ cat list.txt
Cieran Wilks, 9
Adelina Rowland, 4
Hayden Mcfarlnd, 1
Ananya Lamb, 5
Shyam Head, 2
Lauryn Fuents, 8
Kristian Felix, 10
Ruden Dyer, 3
Greyson Meyers, 6
Luther Cooke, 7
$ sort list.txt
Adelina Rowland, 4
Ananya Lamb, 5
Cieran Wilks, 9
Greyson Meyers, 6
Hayden Mcfarlnd, 1
Kristian Felix, 10
Lauryn Fuents, 8
Luther Cooke, 7
Ruden Dyer, 3
Shyam Head, 2
```
Now sort the data in the reverse order.
```
$ sort -r list.txt
Shyam Head, 2
Ruden Dyer, 3
Luther Cooke, 7
Lauryn Fuents, 8
Kristian Felix, 10
Hayden Mcfarlnd, 1
Greyson Meyers, 6
Cieran Wilks, 9
Ananya Lamb, 5
Adelina Rowland, 4
```
Lets shuffle the data.
```
$ sort -R list.txt
Cieran Wilks, 9
Greyson Meyers, 6
Adelina Rowland, 4
Kristian Felix, 10
Luther Cooke, 7
Ruden Dyer, 3
Lauryn Fuents, 8
Hayden Mcfarlnd, 1
Ananya Lamb, 5
Shyam Head, 2
```
Lets make it more complex. This time we sort the data according to the second field, which is the numeric value, and save the output in another file using the -o option.
```
$ sort -n -k2 -t ',' -o sorted_list.txt list.txt
$ ls
sorted_list.txt list.txt
$ cat sorted_list.txt
Hayden Mcfarlnd, 1
Shyam Head, 2
Ruden Dyer, 3
Adelina Rowland, 4
Ananya Lamb, 5
Greyson Meyers, 6
Luther Cooke, 7
Lauryn Fuents, 8
Cieran Wilks, 9
Kristian Felix, 10
```
Here we used -n to sort in numerical order, -k to specify the field to sort (2 in this case) -t to indicate the delimiter or field-separator (a comma) and -o to save the output in the file _sorted_list.txt_. 
## **sed**
Sed is a stream editor that will filter and transform text in the output. This means we are not making changes in the file, only to the output. We can also save the changes in a new file if needed. Sed comes with a lot of options that are useful in filtering or editing the data. 
The syntax for sed is:
```
$ sed [OPTION] PATTERN filename
```
Some of the options used with sed:
* -n : To suppress the printing 
* p: To print the current pattern 
* d : To delete the pattern 
* q : To quit the sed script
### sed demo
Lets see _sed_ in action. We start with the file _data_ with the fields indicating number, name, age and operating system.
Printing the lines twice if they occur in a specific range of lines.
```
$ cat data
1 Vicky Grant 20 linux
2 Nora Burton 19 Mac
3 Willis Castillo 21 Windows
4 Gilberto Mack 30 Windows
5 Aubrey Hayes 17 windows
6 Allan Snyder 21 mac
7 Freddie Dean 25 linux
8 Ralph Martin 19 linux
9 Mindy Howard 20 Mac
$ sed '3,7 p' data
1 Vicky Grant 20 linux
2 Nora Burton 19 Mac
3 Willis Castillo 21 Windows
3 Willis Castillo 21 Windows
4 Gilberto Mack 30 Windows
4 Gilberto Mack 30 Windows
5 Aubrey Hayes 17 windows
5 Aubrey Hayes 17 windows
6 Allan Snyder 21 mac
6 Allan Snyder 21 mac
7 Freddie Dean 25 linux
7 Freddie Dean 25 linux
8 Ralph Martin 19 linux
9 Mindy Howard 20 Mac
```
Here the operation is specified in single quotes indicating lines 3 through 7 and using p to print the pattern found. The default behavior of sed is to print every line after parsing it. This means lines 3 through 7 appear twice because of the p instruction.
So how can you print specific lines from the file? Use the -n option to eliminate lines that do not match from the output.
```
$ sed -n '3,7 p' data
3 Willis Castillo 21 Windows
4 Gilberto Mack 30 Windows
5 Aubrey Hayes 17 windows
6 Allan Snyder 21 mac
7 Freddie Dean 25 linux
```
Only lines 3 through 7 will appear using -n .
Omitting specific lines from the file. This uses the d to delete the lines from the output.
```
$ sed '3 d' data
1 Vicky Grant 20 linux
2 Nora Burton 19 Mac
4 Gilberto Mack 30 Windows
5 Aubrey Hayes 17 windows
6 Allan Snyder 21 mac
7 Freddie Dean 25 linux
8 Ralph Martin 19 linux
9 Mindy Howard 20 Mac
$ sed '5,9 d' data
1 Vicky Grant 20 linux
2 Nora Burton 19 Mac
3 Willis Castillo 21 Windows
4 Gilberto Mack 30 Windows
```
Searching for a specific keyword in the file.
```
$ sed -n '/linux/ p' data
7 Freddie Dean 25 linux
8 Ralph Martin 19 linux
$ sed -n '/linux/I p' data
1 Vicky Grant 20 Linux
7 Freddie Dean 25 linux
8 Ralph Martin 19 linux
```
In these examples we have a regular expression which appears in / /. If we have similar words in the file but not with proper case then we use the “I” to make the search case insensitive. Recall that the -n eliminates the lines that do not match from the output.
Replacing the words in the file.
```
$ sed 's/linux/linus/' data
1 Vicky Grant 20 Linux
2 Nora Burton 19 Mac
3 Willis Castillo 21 Windows
4 Gilberto Mack 30 Windows
5 Aubrey Hayes 17 windows
6 Allan Snyder 21 mac
7 Freddie Dean 25 linus
8 Ralph Martin 19 linus
9 Mindy Howard 20 Mac
```
Here s/ / / denotes that it is a regex. The located word and then the new word to replace it appear between the two /.
## **tr**
The _tr_ command will translate or delete characters. It can transform the lowercase letters to uppercase or vice versa, eliminate repeating characters, and delete specific characters.
One thing weird about _tr_ is that it does not take files as input like _wc_, _sort_ and _sed_ do. We use “|” (the pipe symbol) to provide input to the _tr_ command.
```
$ cat filename | tr [OPTION]
```
Some options used with _tr_:
* -d : To delete the characters in first set of output
* -s : To replace the repeated characters with single occurrence
### tr demo
Now lets use the _tr_ command with the file _letter_ to convert all the characters from lowercase to uppercase.
```
$ cat letter
Linux is too easy to learn,
And you should try it too.
$ cat letter | tr 'a-z' 'A-Z'
LINUX IS TOO EASY TO LEARN,
AND YOU SHOULD TRY IT TOO.
```
Here a-z A-Z denotes that we want to convert characters in the range from “a” to “z” from lowercase to uppercase.
Deleting the “o” character  from the file.
```
$ cat letter | tr -d 'o'
Linux is t easy t learn,
And yu shuld try it t.
```
Squeezing the character “o” from the file means that if “o” is repeated in line then it will remove it and print it only once. 
```
$ cat letter | tr -s 'o'
Linux is to easy to learn,
And you should try it to.
```
## **Conclusion**
This was a quick demonstration of the _wc_, _sort_, _sed_ and _tr_ commands. These commands make it easy to manipulate the text files on the terminal in a quick and efficient way. You may use the _man_ command to learn more about these commands.
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/command-line-quick-tips-wc-sort-sed-and-tr/
作者:[mahesh1b][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/mahesh1b/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2018/10/commandlinequicktips-816x345.jpg

View File

@ -0,0 +1,229 @@
[#]: subject: (Get started with WildFly for Java web development)
[#]: via: (https://opensource.com/article/21/7/wildfly)
[#]: author: (Ranabir Chakraborty https://opensource.com/users/ranabir-chakraborty)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Get started with WildFly for Java web development
======
WildFly is a popular choice for developers who want to develop
enterprise-ready applications.
![Coding on a computer][1]
[WildFly][2] is a production-ready, cross-platform, flexible, lightweight, managed application runtime that provides all the necessary features to run a Java web application. It is also a Java EE 8 certified application server almost exclusively in Java, and it implements the [Jakarta EE][3], which was the Java Platform, Enterprise Edition (Java EE) specifications. Therefore you can run it on any operating system.
WildFly, formerly known as JBoss AS, is a fully implemented JEE container—application server, developed by JBoss, which became a part of Red Hat on June 5, 2006, and since then, WildFly became their product.
### **How to get started with WildFly?**
This Java middleware application server known as [WildFly][4] is a robust implementation of the Jakarta platform specification. The latest WildFly 24 architecture built on the Modular Service Container enables services on-demand when your application requires them.
#### **Prerequisites**
Before installing WildFly, there are a few prerequisites:
* Check that you have a JDK on your machine—JDK 8 or higher recommended to start WildFly. You can use the open source JDK called [OpenJDK][5].
Once you install the JDK, set the JAVA_HOME environment variable.
* Ensure you have Maven 3.6.0 or higher installed. You can download Maven from [here][6] and set the environment variables.
* After loading both the variables, check the versions of JDK and Maven.
```
$ java -version
openjdk version “11.0.9” 2020-10-20 OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.9+11)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.9+11, mixed mode)
[/code] [code]
$ mvn -version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) Maven home: /usr/share/maven
Java version: 11.0.9, vendor: AdoptOpenJDK, runtime: /usr/lib64/adoptopenjdk
Default locale: en_US, platform encoding: UTF-8
OS name: “linux”, version: “5.9.1”, arch: “amd64”, family: “unix”
```
### Download and install WildFly
There are many ways you can install WildFly, including unzipping our traditional download zip, provisioning a custom installation using Galleon, or building a bootable jar. The official [installation guide][7] helps you identify the kind of WildFly installation that best fits your applications deployment needs. In this article, we'll focus on the typical approach of installing the download zip.
You can download WildFly from [here][8]. The standard WildFly variant is the right choice for most users, but if you'd like a technical preview look at what's coming in the future, try out WildFly Preview. Once downloaded, extract the archive to a folder and install it on any operating system that supports the zip or tar formats.
```
`$ unzip wildfly-preview-24.0.0.Final.zip`
```
### Running WildFly
WildFly has two server modes—_standalone_ and _domain_. The difference between the two modes is not about the capabilities available but about the application server's management. Use the _standalone_ mode when you only need one instance of the server. On the other hand, use the _domain_ mode when you want to run several instances of WildFly, and you want a single point from where you can control the configuration. You can find more about the domain mode in the [documentation][9].
To start WildFly using the default configuration in _standalone_ mode, change the directory to `$JBOSS_HOME/bin` and issue:
```
`$ ./standalone.sh`
```
To start the application server using the default configuration in _domain_ mode, change the directory to `$JBOSS_HOME/bin` and issue:
```
`$ ./domain.sh`
```
After starting the standalone mode, you should find something like the following in your console at the end of the start-up process:
```
00:46:04,500 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Preview 24.0.0.Final (WildFly Core 16.0.0.Final) started in 4080ms - Started 437 of 638 services (350 services are lazy, passive or on-demand)
00:46:04,502 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on <http://127.0.0.1:9990/management>
00:46:04,502 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on <http://127.0.0.1:9990>
```
You can point your browser to `http://localhost:9990` (if using the default configured HTTP port), bringing you to the WildFly welcome page.
![WildFly welcome page][10]
(Ranabir Chakraborty, [CC-BY SA 4.0][11])
#### **Authentication**
Though now you can see that WildFly is running, you can not access the admin console because you need to add a user for that. By default, security comes enabled for the WildFly management interfaces. That means that before you connect using the administration console or remotely using the CLI, you'll need to add a new user. You can achieve that simply by using the `add-user.sh` or the `add-user.bat` script in the bin folder.
After starting the script, the system guides you through the process of adding a new user.
```
$ ./add-user.sh
What type of user do you wish to add?
a) Management User (mgmt.users.properties)
b) Application User (application-users.properties)
(a):
```
Select the default option "a" to add a management user, where the user gets added to the ManagementRealm. Therefore, the user is authorized to perform management operations using the web-based Admin Console or the CLI. The other option is "b," where the user gets added to the ApplicationRealm. This realm provides for use with applications.
```
Enter the details of the new user to add.
Using realm ManagementRealm as discovered from the existing property files.
Username : Ranabir
Password recommendations are listed below. To modify these restrictions, edit the add-user.properties configuration file.
[…]
Passward :
Re-enter Password :
```
Here you choose the management user option and provide the required username and password.
```
What groups do you want this user to belong to?
(Please enter a comma-separated list, or leave blank for none) [ ]:
```
Users can be associated with arbitrary groups of your choice, and you get prompted to consider assigning a new user to a group. Groups are helpful for simplified administration of things like access permissions, but leaving this blank is OK for getting started. You then confirm adding the user. The user gets written to the properties files used for authentication, and a confirmation message displays.
```
Is this new user going to be used for AS process to connect to another AS process?
e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server Jakarta Enterprise Beans calls.
yes/no? no
```
Finally, you get asked whether or not you'll use the account you've added to identify one WildFly process to another—typically in a WildFly managed domain. The answer for this should be "no" because the account you are adding here is for use by a human administrator.
After successfully adding the user, now you can refresh the browser, and the console will look like the following:
![WildFly HAL Management console][12]
#### **Deploy an application**
WildFly provides many ways to deploy your application on the server. But if you are running a standalone WildFly service, a simple way to deploy your application is to copy your application archive (`war/ear/jar`) into the `$JBOSS_HOME/standalone/deployments` directory in the server installation. The deployment-scanner subsystem detects the archive and deploys it. Another straightforward way to perform the same is to go to the **Deployments** section of the console and upload your application archive.
![How to deploy your application from console][13]
You can make your own application and deploy it accordingly but here I have used a demo [helloworld][14] application from [WildFly quickstart][15].
#### **Steps to use WildFly quickstart samples:**
1. Make a separate folder locally and inside that, clone the WildFly quickstart project. After cloning the repository, change the directory to `helloworld` (or you can play with any other sample projects) and build the maven project.
```
$ mkdir WFLY
$ cd WFLY
$ git clone depth 1 [git@github.com][16]:wildfly/quickstart.git
$ cd quickstart/helloworld
$ mvn clean install
```
2. If you face any project build issues, then you must clone the `boms` repository into your current working directory (WFLY in my example) and build it. After that, build the sample project. This step is only required when building a development version of the WildFly server. It isnt required when running a [tagged][17] or [released][18] version of the WildFly server.
```
$ git clone [git@github.com][16]:wildfly/boms.git
$ cd boms
$ mvn clean install
```
3. After successfully building the sample project, take the application archive `helloworld.war` from the target folder and copy it inside the `$JBOSS_HOME/standalone/deployments` directory in the server installation.
```
$ cd quickstart/helloworld/target/
$ cp helloworld.war …/…/…/wildfly-preview-24.0.0.Final/standalone/deployments/
```
4. Now point your browser to `http://localhost:8080/helloworld/` to see your successfully deployed WildFly application.
### **Conclusions**
Despite WildFly being in the market for almost two decades, it's still a popular choice for developers who want to develop enterprise-ready applications. The code quality remains at a high and efficient level. The developers are continuously doing many unique and significant work that is taking WildFly to its new peak. The [latest WildFly][8] runs well on SE 16 and 17, supporting SE 17 in standard WildFly later this year.
Michael Dowden takes a look at four Java web frameworks built for scalability.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/wildfly
作者:[Ranabir Chakraborty][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/ranabir-chakraborty
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_laptop_hack_work.png?itok=aSpcWkcl (Coding on a computer)
[2]: https://www.wildfly.org/
[3]: https://opensource.com/article/18/5/jakarta-ee
[4]: https://github.com/wildfly/wildfly
[5]: http://openjdk.java.net/
[6]: https://maven.apache.org/download.cgi
[7]: https://docs.wildfly.org/24/Installation_Guide.html
[8]: https://www.wildfly.org/downloads/
[9]: https://docs.wildfly.org/24/Admin_Guide.html#Operating_modes
[10]: https://opensource.com/sites/default/files/pictures/welcome_page.png (WildFly welcome page)
[11]: https://creativecommons.org/licenses/by-sa/4.0/
[12]: https://opensource.com/sites/default/files/uploads/console.png (WildFly HAL Management console)
[13]: https://opensource.com/sites/default/files/uploads/deployment.png (How to deploy your application from console)
[14]: https://github.com/wildfly/quickstart/tree/master/helloworld
[15]: https://github.com/wildfly/quickstart
[16]: mailto:git@github.com
[17]: https://github.com/wildfly/quickstart/tags
[18]: https://github.com/wildfly/boms/releases

View File

@ -0,0 +1,84 @@
[#]: subject: (How to Install elementary Tweaks Tool)
[#]: via: (https://www.debugpoint.com/2021/07/elementary-tweaks-install/)
[#]: author: (Arindam https://www.debugpoint.com/author/admin1/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
How to Install elementary Tweaks Tool
======
This quick tutorial demonstrates the steps to install elementary Tweaks
tool/Pantheon Tweaks Tool.
The elementary Tweaks tool is a handy utility specially designed for [elementary OS][1]. It gives you various options to change certain settings for elementary. Although elementary provides most of the settings already, however, few Pantheon desktop tweaks are not available via standard settings. Hence, this tool. This is a similar tool like we have in GNOME called [GNOME Tweaks][2].
That said, installing this tool is straight forward. Although its a bit different in [elementary OS 6 Odin][3] than earlier versions such as elementary OS 5 Juno. From the elementary OS 6 Odin onwards, this tool is renamed as Pantheon Tweaks tool. Heres how to install.
### Install elementary Tweaks Tool
The elementary OS doesnt include the software-properties-common package, which is required for adding a PPA. If it is not install already, use the following command to install.
```
sudo apt install software-properties-common
```
#### elementary OS 6 Odin
The Tweak tool is renamed with a new name and being developed separately. It is called [Pantheon Tweaks][4]. And using the following commands you can install it.
```
sudo add-apt-repository -y ppa:philip.scott/pantheon-tweaks
sudo apt install -y pantheon-tweaks
```
#### elementary OS 5 Juno and below
If you are using elementary OS 5 June and below, you can install the earlier [elementary-tweaks][5] using the same PPA. Follow the below commands from terminal.
```
sudo add-apt-repository -y ppa:philip.scott/elementary-tweaks
sudo apt install -y elementary-tweaks
```
### Usage
After installation, you can run it via `Application Menu > System Settings > Tweaks`.
![tweak in settings][6]
In the Tweaks window, you can find several options to change and configure your elementary desktop.
![elementary tweaks after install options][7]
For your information, this tool is just a front end to elementary desktop settings. You can very well change them via terminal provided you know the exact name or property. The settings you get in this tool can also be changed via `dconf` editor in `io.elementary` path.
[][8]
SEE ALSO:   elementary OS 5.1 Hera Released. Heres Whats New
Let me know in the comment box below, if you face any trouble installing, or using this tweak tool.
* * *
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/2021/07/elementary-tweaks-install/
作者:[Arindam][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://www.debugpoint.com/author/admin1/
[b]: https://github.com/lujun9972
[1]: https://www.debugpoint.com/tag/elementary
[2]: https://www.debugpoint.com/2018/05/customize-your-ubuntu-desktop-using-gnome-tweak/
[3]: https://www.debugpoint.com/2020/09/elementary-os-6-odin-new-features-release-date/
[4]: https://github.com/pantheon-tweaks/pantheon-tweaks
[5]: https://github.com/elementary-tweaks/elementary-tweaks
[6]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/tweak-in-settings.png
[7]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/elementary-tweaks-after-install-options.png
[8]: https://www.debugpoint.com/2019/12/elementary-os-hera-released/

View File

@ -0,0 +1,116 @@
[#]: subject: (How to use cron on Linux)
[#]: via: (https://opensource.com/article/21/7/cron-linux)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
How to use cron on Linux
======
The cron system is a method to automatically run commands on a schedule.
![Cron expression][1]
The cron system is a method to automatically run commands on a schedule. A scheduled job is called a _cronjob_, and its created in a file called a _crontab_. Its the easiest and oldest way for a computer user to automate their computer.
### Writing a cronjob
To create a cronjob, you edit your `crontab` using the `-e` option:
```
`$ crontab -e`
```
This opens your crontab your default text editor. To set the text editor explicitly, use the `EDITOR` [environment variable][2]:
```
`$ EDITOR=nano crontab -e`
```
### Cron syntax
To schedule a cronjob, you provide the command you want your computer to execute, followed by a cron expression. The cron expression schedules when the command gets run:
* minute (0 to 59)
* hour (0 to 23, with 0 being midnight)
* day of month (1 to 31)
* month (1 to 12)
* day of week (0 to 6, with Sunday being 0)
An asterisk (`*`) in a field translates to "every." For example, this expression runs a backup script at the 0th minute of _every_ hour on _every_ day of _every_ month:
```
`/opt/backup.sh 0 * * * *`
```
This expression runs a backup script at 3:30 AM on Sunday:
```
`/opt/backup.sh 30 3 * * 0`
```
### Simplified syntax
Modern cron implementations accept simplified macros instead of a cron expression:
* `@hourly` runs at the 0th minute of every hour of every day
* `@daily` runs at the 0th minute of the 0th hour of every day
* `@weekly` runs at the 0th minute of the 0th hour on Sunday
* `@monthly` runs at the 0th minute of the 0th hour on the first day of the month
For example, this crontab line runs a backup script every day at midnight:
```
`/opt/backup.sh @daily`
```
### How to stop a cronjob
Once you've started a cronjob, it's designed to run on schedule forever. To stop a cronjob once you've started it, you must edit your crontab, remove the line that triggers the job, and then save the file.
```
`$ EDITOR=nano crontab -e`
```
To stop a job that's actively running, [use standard Linux process commands][3] to stop a running process.
### Its automated
Once youve written your crontab, save the file and exit your editor. Your cronjob has been scheduled, so cron does the rest.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/cron-linux
作者:[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/cron-splash.png?itok=AoBigzts (Cron expression)
[2]: https://opensource.com/article/19/8/what-are-environment-variables
[3]: https://opensource.com/article/18/5/how-kill-process-stop-program-linux

25
sources/tech/20210727 .md Normal file
View File

@ -0,0 +1,25 @@
[#]: subject: ()
[#]: via: (https://www.2daygeek.com/recover-restore-deleted-logical-volume-linux/)
[#]: author: ( )
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
======
--------------------------------------------------------------------------------
via: https://www.2daygeek.com/recover-restore-deleted-logical-volume-linux/
作者:[][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:
[b]: https://github.com/lujun9972

View File

@ -0,0 +1,118 @@
[#]: subject: (Zathura: A Minimalist Document Viewer for Keyboard Shortcut Pros)
[#]: via: (https://itsfoss.com/zathura-document-viewer/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Zathura: A Minimalist Document Viewer for Keyboard Shortcut Pros
======
Every Linux distribution comes with a document viewer app that lets you read PDF and other documents.
Most of the time, it is [Evince from GNOME][1] that is displayed as Document Viewer in Ubuntu and some other distributions. Evince is a handy tool and supports a wide variety of document formats.
However, there are other applications for reading documents. Take [Foliate][2] for example. Its an excellent [application for reading ebooks on Linux][3].
I recently came across another document viewer called Zathura.
### Enjoy a mouse-free document reading experience with Zathura
[Zathura][4] is a highly customizable document viewer based on the [girara user interface][5] and several document libraries. girara implements a simple and minimalist user interface.
Zathura sure feels to load fast. It is minimalist, so you just get an application window with no sidebar, application menu or anything of that sort.
![Zathura Document Viewer Interface][6]
You may open its command line prompt by pressing the : key. You may close the CLI prompt with Esc key.
If you want to create a bookmark, type :bmark and then provide an index number to the bookmarked page.
![Bookmarking in Zathura][7]
You may highlight all the links by pressing the F key. It will also display a number beside the highlighted URL and the command line prompt will appear at the bottom. If you type the URL number and press enter, the URL will be opened in the default web browser.
![Highlighting and opening links in documents][8]
Zathura also has automatic reloading feature. So if you make some changes to the document with some other application, the changes will be reflected as Zathura reloads the document.
You may also install additional plugins to improve the capabilities of Zathura and use it for reading comics or PostScript.
The problem with Zathura is that you wont see any documentation or help option anywhere on the application interface. This makes things a bit more difficult if you are not already familiar with the tool.
You may get the default keyboard shortcuts information from its [man page][9]. Here are a few of them:
* R: Rotate
* D: Toggle between single and double page viewing mode
* F: Highlight all links on the current screen
* HJKL: Moving with the Vim type keys
* Arrows or PgUp/PgDown or the mouse/touchpad for moving up and down
* / and search for text, press n or N for moving to next or previous search (like less command)
* Q: Close
You may find the documentation on the project website to learn about configuration, but I still found it confusing.
### Installing Zathura on Linux
Zathura is available in the repositories of the most Linux distributions. I could see it available for Ubuntu, Fedora, Arch and Debian, thanks to the [pkgs.org website][10]. This means that you can use the [package manager of your distribution][11] or the software center to install it.
On Debian and Ubuntu based distributions, use this command to install Zathura:
```
sudo apt install zathura
```
On Fedora, use:
```
sudo dnf install zathura
```
[Use pacman command on Arch Linux][12]:
```
sudo pacman -Sy zathura
```
And if you want to have a look at its source code, you may visit its GitLab repository:
[Zathura Source Code][13]
### Conclusion
Ill be honest with you. I am not a fan of mouse-free tools. This is why I prefer Nano over Vim as I cannot remember so many shortcuts.
I know there are people who swear by their keyboards. However, I would prefer not to spend time learning to configure a document viewer. This is more because I do not read too many documents on my desktop and for the limited PDF viewing, the default application is sufficient.
Its not that Zathura does not have it usage. If you are someone who has to deal a lot with documents, be it PDF or LaTex, Zathura could be your next favorite tool if you are a keyboard love.
--------------------------------------------------------------------------------
via: https://itsfoss.com/zathura-document-viewer/
作者:[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://wiki.gnome.org/Apps/Evince
[2]: https://itsfoss.com/foliate-ebook-viewer/
[3]: https://itsfoss.com/best-ebook-readers-linux/
[4]: https://pwmt.org/projects/zathura/
[5]: https://git.pwmt.org/pwmt/girara
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/Zathura-Document-Viewer-Interface.png?resize=800%2C492&ssl=1
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/bookmarking-in-zathura.png?resize=800%2C639&ssl=1
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/Follow-link-in-Zathura.png?resize=800%2C639&ssl=1
[9]: https://itsfoss.com/linux-man-page-guide/
[10]: https://pkgs.org/
[11]: https://itsfoss.com/package-manager/
[12]: https://itsfoss.com/pacman-command/
[13]: https://git.pwmt.org/pwmt/zathura

View File

@ -7,109 +7,93 @@
[#]: publisher: ( )
[#]: url: ( )
How the ARPANET Protocols Worked
ARPANET 协议是如何工作的
======
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 didnt 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.
ARPANET 通过证明可以使用标准化协议连接完全不同的制造商的计算机,永远改变了计算。 在我的[关于 ARPANET 的历史意义的帖子][1]中,我提到了其中的一些协议,但没有详细描述它们。所以我想仔细看看它们。也想看看那些早期协议的设计有多少保留到了我们今天使用的协议中。
ARPANET 通过证明完全不同制造商的计算机能够使用标准化的协议连接起来,从而永久的改变了计算。在我的[关于 ARPANET 的历史意义的帖子][1]中,我提到了其中的一些协议,但没有详细描述它们。所以我想更进一步探索它们。也想看看那些早期协议的设计在我们今天使用的协议中有多少被保留了下来。
ARPANET 协议像我们现代的互联网协议,是通过分层形式来组织的。[1][2] 较高层协议运行在较低层协议之上。如今的 TCP/IP 套件有 5 层(物理层、链路层、网络层、传输层、以及应用层),但是这个 ARPANET 仅有 3 层或者可能 4 层,这取决于你怎样计算它们。
我将会解释每一层是如何工作的,但首先,你需要知道谁在 ARPANET 中是构建了些什么,以及还需要了解为什么要分层。
### 短暂的历史背景
ARPANET 由美国联邦政府资助,确切的说是位于美国国防部的高级研究计划属(因此命名为 “ ARPANET ” )。美国政府并没有直接建设这个网络;而是,把这项工作外包给了位于波士顿的一家名为 Bolt, Beranek, and Newman, 的咨询公司,通常更多时候被称为 BBN。
相反, BBN 承担了实现这个网络的大部分任务,但不是全部。 BBN 所做的是设计和维护一台称为接口消息处理机或简称 IMP 的机器。这个 IMP 是一种定制的 Honeywell 小型计算机,它们被分配给那些想要接入这个 ARPANET 的遍及全国各地的各个站点。它们充当通往 ARPANET 的网关为每个站点提供多达四台主机的连接支持。它基本上是一台路由器。BBN 能控制在 IMP 上运行的软件,把数据包从一个 IMP 转发到另一个 IMP ,但是该公司无法直接控制那些将要连接到 IMP 上并且成为 ARPANET 网络中实际主机的机器。
那些主机被网络中作为终端用户的计算机科学家们所控制。位于遍及全国各地的主机站点中的这些计算机科学家们,他们负责编写允许主机之间相互通信的软件。而 IMP 赋予主机之间互相发送消息的能力,但是那并没有多大用处除非主机之间能商定一种用于消息的格式。为了解决这个问题,一群杂七杂八的人员组成了网络工作组,其中有大部分是来自各个站点的研究生,该组力求指定主机计算机使用的协议。
因此,如果你设想通过 ARPANET 进行一次成功的网络互动例如发送一封电子邮件使这些互动成功的一些工程由一组人负责BBN然而其他的一些工程则由另一组人负责网络工作组和在每个站点的工程师们。这种有组织有保障的情景或许对推动采用分层的方法来管理 ARPANET 网络中的协议起到很大的作用这反过来又影响了TCP/IP的分层方式。
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.
### 好的,回到协议上来
ARPANET 协议类似与如今的互联网协议,也是通过分层形式来组织管理的。[1][2] 较高层协议运行在较低层协议之上。如今的 TCP/IP 协议栈有5层物理层、数据链路层、网络层、传输层、以及应用层但是这个 ARPANET 仅有3层或者可能4层这取决于你们怎样去数它们。
![ARPANET Network Stack][3] _ARPANET 协议层次结构_
Im 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.
协议层被组织成一个层次结构,在最底部是 “ level 0. ” [2][4] 这在某种意义上是不算数的,因为在 ARPANET 中这层完全由 BBN 控制所以不需要标准协议。level 0 的作用是管理数据在 IMP 之间如何传输。在 BBN 内部,有管理 IMP 如何做到这一点的规则;在 BBN 之外IMP 子网是一个黑匣子它只会传送你提供的任意数据。因此level 0 是一个没有真正协议的层,就公开已知和商定的规则集而言,它的存在可以被运行在 ARPANET 的主机上的软件忽略。粗略地说,它处理相当于当今使用的 TCP/IP 套件的物理层、链路层和网络层下的所有内容,甚至还包括相当多的传输层,这是我将在这篇文章的末尾回来讨论的内容。
我将会解释每一层是如何工作的,但首先,你需要知道谁在 ARPANET 中构建了些什么,以及需要了解为什么层要被划分成这样。
“ level 1 ” 层在 ARPANET 的主机和它们所连接的 IMP 之间建立了接口。如果你愿意可以认为它是为 BBN 构建的 “ level 0 ” 层的黑匣子使用的一个应用程序接口。 当时它也被称为 IMP-Host 协议。 必须编写和发布该协议,因为在首次建立 ARPANET 网络时,每个主机站点都必须编写自己的软件来与 IMP 连接。 除非 BBN 给他们一些指导,否则他们不会知道如何做到这一点
### 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.
ARPANET 由美国联邦政府资助确切的说是位于美国国防部内的高级研究计划属因此命名为“ARPANET”。美国政府并没有直接建设这个网络而是它把这项工作外包给了基于波士顿的一家名为 Bolt, Beranek, 和 Newman, 通常更多时候被称为 BBN 的咨询公司。
BBN 在一份名为 [BBN Report 1822][5] 的冗长文件中指定了 IMP-Host 协议。 随着 ARPANET 的发展,该文件多次被修订; 我将在这里大致描述 IMP-Host 协议最初设计时的工作方式。 根据 BBN 的规则,主机可以将长度不超过 8095 位的消息传递给它们的 IMP并且每条消息都有一个包含目标主机号和链路识别号的头部字段。[3][6] IMP 将检查指定的主机号,然后尽职尽责地将消息转发到网络中。 当从远端主机接收到消息时,接收 IMP 在将消息传递给本地主机之前会把目标主机号替换为源主机号。 实际上在 IMP 之间传递的内容并不是消息——IMP 将消息分解成更小的数据包以便通过网络传输——但该细节对主机来说是不可见的。
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.
![1969 Host-IMP Leader][7]_Host-IMP 消息头部格式, 截至 1969. 图标来自 [BBN Report 1763][8]_
反过来BBN 承担了实现这个网络的大部门责任但不是全部。BBN 所做的是设计和维护一个称为接口消息处理器或者简称IMP的机器。
链路号的取值范围为 0 到 255 ,它有两个作用。一是更高级别的协议可以利用它在网络上的任何两台主机之间建立多个通信信道,因为可以想象得到,在任何时刻都有可能存在多个本地用户与同一个目标主机进行通信的场景(换句话说,链路号允许在主机之间进行多路通信。)二是它也被用在 “ level 1 ” 层去控制主机之间发送的大量流量,以防止高性能计算机压制低性能计算机的情况出现。按照最初的设计,这个 IMP-Host 协议限制每台主机在某一时刻通过某条链路仅发送一条消息。一旦某台主机沿着某条链路发送了一条消息给远端主机后,在它沿着该链路发送下一条消息之前,必须等待接收一条来自远端的 IMP 的特别类型的消息,叫做 RFNM请求下一条消息。针对这个体系的后期修订为了改善它的性能允许一台主机在给定的时刻传送多达8条消息给另一台主机。.[4][9]
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.
“ level 2 ” 层才是事情真正开始变得有趣的地方,因为这一层和在它上面的那一层由 BBN 和国防部全部留给学者们和网络工作组自己去研发。 “ level 2 ” 层包括了 Host-Host 协议,这个协议在 RFC9 中第一次被草拟并且在 RFC54 中第一次被官方指定。更多可读的 Host-Host 协议的解释在 [ ARPANET 协议手册][10] 中被给出。
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.
“ Host-Host 协议 ” 管理主机之间如何创建和管理链接。链接是某个主机上的写套接字和另一个主机上的读套接字之间的一个单向的数据管道。“ 套接字 ” 的概念是在 “ level-1 ” 层的有限的链路设施(记住链路号只是那 256 个值中的一个)之上被引入的,是为了给程序提供寻找运行在远端主机上的特定进程地址的一种方式。“ 读套接字 ” 是用偶数表示的,而“写套接字”是用奇数表示的;套接字是 “ 读 ” 还是 “ 写 ” 被称为套接字的 “性别”。并没有类似于 TCP 协议那样的 “ 端口号 ” 机制,链接的打开、维持以及关闭操作是通过主机之间使用 “ 链路 0 ” 发送指定格式的 Host-Host 控制消息来实现的,这也是 “ 链路0 ” 被保留的目的。一旦控制消息在“链路 0”上被交换来建立起一个连接后就可以使用接收端挑选的另一个链路号来发送进一步的数据消息。
### Okay, Back to the Protocols
Host-Host控制消息一般通过 3 个字母型的助记符来表示。当两个主机交换一条 STR发送端到接收端消息和一条配对的 RTS接收端到发送端消息后就建立起了一条链接。——这些控制消息都被称为请求链接消息。链接能够被 CLS (关闭)控制消息关闭。存在更进一步的控制信息能够改变从发送端到接收端发送消息的速率。从而需要确保较快的主机不会压制较慢的主机。在 “ level 1 ” 层上的协议提供了流量控制的功能,但对 “ level 2 ” 层来说显然是不够的;我怀疑这是因为从远端 IMP 接收到的 RFNM 只能保证远端 IMP 已经传送该消息到目标主机,不能保证目标主机已经全部处理了该消息。 还有 INR接收端中断、INS发送端中断控制消息它们主要是被高层协议使用。
![ARPANET Network Stack][3] _The ARPANET protocol hierarchy._
更高级别的协议都位于 “ level 3 ” ,这层是 ARPANET 的应用层。Telnet 协议,它提供到另一台主机的一个虚拟电传链接,其可能是这些协议中最重要的。但在这层中也有许多其他协议,例如用于传输文件的 FTP 协议和各种用于发送email的实验协议。
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 doesnt 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 Ill come back to at the end of this post.
在这一层中有一个不同于其他的协议初始链接协议ICP。ICP被认为是一个 “ level-3 ” 层协议,但实际上它是一种 “ level-2.5 ” 层协议,因为其他 “ level-3 ” 层协议都依赖它。ICP的存在是因为 “ level 2 ” 层的 Host-Host 协议提供的链接只是单向的,但大多数的应用需要一个双向(列如:全双工)的链接来做任何有趣的事情。要使得运行在某个主机上的客户端能够链接到另一个主机上长时间运行的服务进程, ICP 定义了两个步骤。第一步是建立一个从服务端到客户端的单向链接,通过使用服务端进程的众所周知的 socket 号来实现。第二步服务端通过建立的这个链接发送一个新的 socket 号给客户端。到那时,那个存在的链接就会被丢弃,然后有另外两个新的链接会被开启,它们是基于传输的 socket 号建立的“读”链接和基于传输的 socket 号加 1 的 “ 写 ” 链接。这个小插曲是大多数事务的一个前提——比如它是建立 Telnet 链接的第一步。
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 wouldnt have known how to do that unless BBN gave them some guidance.
以上是我们对 ARPANET 协议层次结构的提升。你们可能一直期待我在某个时候提一下 “ Network Control Protocol ” 。在我坐下来去研究这篇贴子和我的最后一篇贴子之前,我坚定的认为 ARPANET 运行在一个叫做 NCP 的协议之上。那个首字母缩略词有时用来指代整个 ARPANET 协议,这可能就是我为什么有这个想法的原因。举个例子,[RFC801][11] 讨论了将 ARPANET 从 “ NCP ” 过渡到 “ TCP ” 的方式,这使 NCP 听起来像是一个等同TCP的 ARPANET 协议。但是对于 ARPANET 来说,从来都没有一个叫 “ Network Control Protocol ” 的东西(即使[大英百科全书是这样认为的][12]),我怀疑人们错误地将 “ NCP ” 解释为 “ Network Control Protocol ” ,而实际上它代表的是 “ Network Control Pragram ” 。网络控制程序是一个运行在各个主机上的内核级别的程序,主要负责处理网络通信,等同于现如今操作系统中的 TCP/IP 协议栈。用在 RFC 801 的 “ NCP ” 是一种转喻,而不是协议。
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 Im going to describe here is roughly the way the IMP-Host protocol worked as it was initially designed. According to BBNs 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.
### 与TCP/IP的比较
![1969 Host-IMP Leader][7] _The Host-IMP message leader format, as of 1969. Diagram from [BBN Report 1763][8]._
ARPANET 协议以后都会被 TCP/IP 协议替换(但 Telnet 和 FTP 协议除外,因为它们很容易就能在 TCP 上适配运行)。然而 ARPANET 协议都基于这么一个假设就是网络是由一个单一实体BBN来构建和管理的。 TCP/IP 协议套件是为具有可变性和不可靠性的互联的网络而设计的。这就导致了现代协议套件和 ARPANET 协议有明显的不同,比如我们现在怎样区分网络层和传输层。在 ARPANET 中部分由 IMP 实现的类似传输层的功能现在完全由在网络边界的主机负责。
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]
我发现关于ARPANET协议最有趣的事情是现在在 TCP 中的传输层的功能有多少在 ARPANET 上经历了一个糟糕的青春期。我不是一个网络专家因此我拿出大学时的网络课本Kurose and Ross, lets go他们对传输层通常负责什么给出了一个非常好的概述。总结一下他们的解释一个传输层协议必须至少做到以下几点。这里的 “ segment ” 在 ARPANET 上基本等同于 “ message ” 作为术语被使用:
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 sockets 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.
像 TCP 那样,传输层也能够提供可靠的数据传输,这意味着:
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.
似乎在 ARPANET 上关于如何进行多路复用和多路分解以便进程可以通信存在一些混淆—— BBN 在 IMP-Host 层引入了链路号来做到这一点,但结果证明在 Host-Host 层上无论如何套接字号都是必要的。然后链路号只是用于 IMP-Host 级别的流量控制,但 BBN 似乎后来放弃了它,转而支持在唯一的主机对之间进行流量控制,这意味着链路号开始时只是作为这个重载的东西基本上变成了遗迹。 TCP 现在使用端口代替,分别对每一个 TCP 链接进行流量控制。进程间的多路复用和多路分解完全在 TCP 内部进行,不会像 ARPANET 一样泄露到较低层去。
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.
同样有趣的是,鉴于 Kurose 和 Ross 如何开发 TCP 背后的想法ARPANET 开始于 Kurose 和 Ross 所调用的一个严谨的 “stop-and-wait” 方法,以便在 IMP-Host 层上进行可靠的数据传输。这个 “stop-and-wait” 方法发送一个 “段” 然后就拒绝再去发送更多 “段” ,直到一个最近发送的 “段” 的确认被接收到为止。这是一种简单的方法,但这意味着只有一个 “段” 在整个网络中运行,从而导致协议非常缓慢——这就是为什么 Kurose 和 Ross 将 “stop-and-wait” 仅仅作为在通往功能齐全的传输层协议的路上的垫脚石的原因。在 ARPANET 上“stop-and-wait” 是一段时间的工作方式,因为在 IMPHost 层,必须接收下一条消息的请求以响应每条发出的消息,然后才能发送任何进一步的消息。客观的说 BBN 起初认为这对于提供主机之间的流量控制是必要的因此减速是故意的。正如我已经提到的为了更好的性能RFNM 的要求后来放宽松了,而且 IMP 也开始向消息中添加序列号和保持对传输中的消息的 “窗口” 的跟踪,这或多或少与如今 TCP 的实现如出一辙。[5][13]
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 its used in RFC 801, is a metonym, not a protocol.
ARPANET 表明,如果你能让每个人都遵守一些基本规则,异构计算系统之间的通信是可能的。正如我先前所说的,那个是 ARPANET 的最重要的遗产。但是我希望通过这次仔细研究的哪些基本规则所透露的是有多少 ARPANET 协议影响了我们如今所用的协议。在主机和 IMP 之间分担传输层职责的方式上肯定有很多笨拙之处,有时候是冗余的。回想起来,主机之间一开始只能通过给出的任意链路在某刻只发送一条消息,这真的很有趣。 但是 ARPANET 实验是一个独特的机会,可以通过实际构建和操作网络来学习这些经验,当到了是时候升级到我们今天所知的互联网时,似乎这些经验变得很有用。
### A Comparison with TCP/IP
_如果你喜欢这篇贴子更喜欢每四周发布一次的方式那么在Twitter上关注[@TwoBitHistory][14] 或者订阅[RSS提要][15]以确保你知道新帖子的发布时间。_
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. Im not a networking expert, so I pulled out my college networks textbook (Kurose and Ross, lets 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 arent 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.
Its 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. Its 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 Ive 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 Ive previously argued, the ARPANETs 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 its 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…_
_以前在 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]
> 我最近的贴子是我的一些关于为什么ARPANET是一个如此重要的突破的看法当然是令人惊讶和新颖的并重点关注ARPANET被首次展示的发布会:<https://t.co/8SRY39c3St>
>
> — TwoBitHistory (@TwoBitHistory) [2021年2月7日][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]
1. 协议分层是网络工作组发明的。 这个论点是在[ RFC 871][17] 中提出的。分层也是 BBN 如何在主机和 IMP 之间划分职责的自然延伸,因此 BBN 也值得称赞。 [↩︎][18]
2. The “level” terminology was used by the Network Working Group. See e.g. [RFC 100][19]. [↩︎][20]
2. The “level” 是被网络工作组使用的术语。 详见[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]
3. 在 IMP-Host 协议的后续版本中,扩展了头部字段,并且将链路号升级为消息 ID。 但是 Host-Host 协议仅仅继续使用消息 ID 字段的高位 8 位,并将其视为链路号。 请参阅 [ARPANET 协议手册][10]的 “ Host-Host ” 协议部分。[↩︎][21]
4. John M. McQuillan 和 David C. Walden。 “ARPA 网络设计决策”,第 284页<https://www.walden-family.com/public/whole-paper.pdf>。 2021 年 3 月 8 日访问。[↩︎][22]
5. 同上。[↩︎][23]
@ -120,7 +104,7 @@ via: https://twobithistory.org/2021/03/08/arpanet-protocols.html
作者:[Two-Bit History][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
译者:[Lin-vy](https://github.com/Lin-vy)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,38 +0,0 @@
[#]: subject: (My family's Linux story)
[#]: via: (https://opensource.com/article/21/5/my-linux-story)
[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen)
[#]: collector: (lujun9972)
[#]: translator: (shiboi77 )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
我的家庭 Linux 故事
======
我们在Linux的第一次尝试只是一个简单的方法。
![在橙色背景的终端命令提示][1]
我在linux的第一次尝试是“或许我应该试一试”的这种情况。
回到1990年我在相当多的软盘上找到了一些打包的红帽发行版我为家庭笔记本买了第二个硬盘然后设置安装了它。 这是一件有趣的实验但是我记起家中并没有准备在这程度上分享电脑。快进到2005年我最终崩溃了买了一台运行windows xp的可爱的东芝笔记本电脑。在工作中我有一个老化的SUN SPARCStation 5并且我不太喜欢整个solaris的发展方向基于Motif的桌面。我真的想要用GIMP来完成一些项目或其他项目但是安装GNOME1.x的是复杂的也许它是1.4在Solaris是具有挑战性的。所以我实际上是在考虑跳槽到Windows xp。 但是在我的家用机器上用了几个月之后我发现自己喜欢它的程度甚至低于在Solaris上运行GNOME所以我安装了Ubuntu Hoary Hedgehog 5.04然后在我的笔记本电脑上安装了Breezy Badger 5.10。这太棒了。那台拥有3.2GHz奔腾处理器2GB内存和100GB的硬盘的机器在我的SPARCStation 5周围运行。
突然之间不再是用拼凑起来的Solaris安装包试图去让东西运行这些事情仅仅是一个轻松地方式。并且时机也很好。我家庭和我从2006年8月到2007年7月居住在法国格勒诺布尔而我的妻子在休假。因为有了linux东芝我才能随身带着我的工作。那个时候我在几大项目上做了大量的GIS数据处理我发现我可以在PostGIS / PostgreSQL上做同样的事情比我们在加拿大使用的昂贵得多的商业GIS软件要快得多。大家都很开心尤其是我。
一路上发生的有趣的事情是我们把另外两台电脑逮到了法国——我妻子的类似的东芝电脑运行xp对她来说很好用和我们孩子最近新买的东芝牌笔记本电脑也运行xp。仅仅就在圣诞节过后他们有一些朋友在无意中安装了一个讨厌的并且无法清除的病毒在他们的电脑上。经过几个小时甚至几天后我的一个孩子问我“爸爸我们就不能安装和你电脑上一样的东西吗”然后创建了三个新的Linux用户。我的儿子在29岁依然是一个快乐的Linux用户我猜他第四或第五台Linux笔记本电脑的系统全部由最近的系统76支持。我的一个女儿三年前开始读法学院因为他所在的学校有一个强制性的测试框架只能在Windows上运行而且据称会检测VM之类的东西请不要让我开始。而且我的另一个女儿被她的公司为她买的Macbook Air诱惑了。
哦,好吧,不能赢得他们所有!
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/5/my-linux-story
作者:[Chris Hermansen][a]
选题:[lujun9972][b]
译者:[shiboi77](https://github.com/shiboi77)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/clhermansen
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE (Terminal command prompt on orange background)

View File

@ -0,0 +1,210 @@
[#]: collector: (lujun9972)
[#]: translator: (YungeG)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Trace code in Fedora with bpftrace)
[#]: via: (https://fedoramagazine.org/trace-code-in-fedora-with-bpftrace/)
[#]: author: (Augusto Caringi https://fedoramagazine.org/author/acaringi/)
在 Fedora 中用 bpftrace 追踪代码
======
![][1]
bpftrace 是一个[基于 eBPF 的新型追踪工具][2],在 Fedora 28 第一次引入。Brendan GreggAlastair Robertson 和 Matheus Marchini 在分散于全网络的黑客团队的帮助下开发了 bpftrace一个允许你分析系统在幕后正在执行的操作的追踪工具告诉你代码中正在被调用的函数、传递给函数的参数、函数的调用次数等。
这篇文章的内容涉及了 bpftrace 的一些基础,以及它是如何工作的,请继续阅读获取更多的信息和一些有用的实例。
### eBPF (extended Berkeley Packet Filter)
[eBPF][3] 是一个微型虚拟机,更确切的说是一个虚拟 CPU位于 Linux 内核中。eBPF 可以在内核空间以一种安全可控的方式加载和运行体积较小的程序,保证 eBPF 的使用更加安全即使在生产环境系统中。eBPF 虚拟机有自己的指令集([ISA][4]),类似于现代处理器架构的一个子集。通过这个 ISA可以很容易将 eBPF 程序转化为真实硬件上的代码。内核即时将程序转化为主流处理器架构上的本地代码,从而提升性能。
eBPF 虚拟机允许通过编程扩展内核,目前已经有一些内核子系统使用这一新型强大的 Linux Kernel 功能,比如网络,安全计算、追踪等。这些子系统的主要思想是添加 eBPF 程序到特定的代码点,从而扩展原生的内核行为。
虽然 eBPF 机器语言功能强大由于是一种底层语言直接用于编写代码很费力bpftrace 就是为了解决这个问题而生的。eBPF 提供了一种高级语言编写 eBPF 追踪脚本,然后在 clang / LLVM 库的帮助下将这些脚本转化为 eBPF最终添加到特定的代码点。
## 安装和快速入门
在终端 [使用][5] _[sudo][5]_ 执行下面的命令安装 bpftrace
```
$ sudo dnf install bpftrace
```
使用“hello world”进行实验
```
$ sudo bpftrace -e 'BEGIN { printf("hello world\n"); }'
```
注意,出于特权级的需要,你必须使用 _root_ 运行 _bpftrace_,使用 _-e_ 选项指明一个程序,构建一个所谓的“单行程序”。这个例子只会打印 _hello world_,接着等待你按下 **Ctrl+C**
_BEGIN_ 是一个特殊的探针名,只在执行一开始生效一次;每次探针命中时,大括号 _{}_ 内的操作——这个例子中只是一个 _printf_——都会执行。
现在让我们转向一个更有用的例子:
```
$ sudo bpftrace -e 't:syscalls:sys_enter_execve { printf("%s called %s\n", comm, str(args->filename)); }'
```
这个例子打印系统中正在创建的每个新进程的父进程名 _(comm)_。_t:syscalls:sys_enter_execve_ 是一个内核追踪点,是 _tracepoint:syscalls:sys_enter_execve_ 的简写,两种形式都可以使用。下一部分会向你展示如何列出所有可用的追踪点。
_comm_ 是一个 bpftrace 内建指令代表进程名_filename_ 是 _t:syscalls:sys_enter_execve_ 追踪点的一个域,这些域可以通过 _args_ 内建指令访问。
追踪点的所有可用域可以通过这个命令列出:
```
bpftrace -lv "t:syscalls:sys_enter_execve"
```
## 示例用法
### 列出探针
_bpftrace_ 的一个核心概念是 **探针点**,即 eBPF 程序可以连接到的(内核或用户空间)代码中的测量点,可以分成以下几大类:
* _kprobe_——内核函数的开始处
* _uprobe_——内核函数的返回处
* _uprobe_——用户级函数的开始处
* _uretprobe_——用户级函数的返回处
* _tracepoint_——内核静态追踪点
* _usdt_——用户级静态追踪点
* _profile_——基于时间的采样
* _interval_——基于时间的输出
* _software_——内核软件事件
* _hardware_——用户级事件
所有可用的 _kprobe / kretprobe_、_tracepoints_、_software_ 和 _hardware_ 探针可以通过这个命令列出:
```
$ sudo bpftrace -l
```
_uprobe / uretprobe_ 和 _usdt_ 是用户空间探针,专用于某个可执行文件。要使用这些探针,通过下文中的特殊语法。
_profile_ 和 _interval_ 探针以固定的时间间隔触发;固定的时间间隔不在本文的范畴内。
### 统计系统调用数
### Counting system calls
**Maps** 是保存计数、统计数据和柱状图的特殊 BPF 数据类型,你可以使用映射统计每个系统调用正在被调用的次数:
```
$ sudo bpftrace -e 't:syscalls:sys_enter_* { @[probe] = count(); }'
```
一些探针类型允许使用通配符匹配多个探针,你也可以使用一个逗号隔开的列表为一个操作块指明多个连接点。上面的例子中,操作块连接到了所有名称以 _t:syscalls:sysenter__ 开头的追踪点,即所有可用的系统调用。
bpftrace 的内建函数 _count()_ 统计系统调用被调用的次数_@[]_ 代表一个映射(一个关联的数组)。映射的键是另一个内建指令 _probe_,代表完整的探针名。
这个例子中,相同的操作块连接到了每个系统调用,之后每次有系统调用被调用时,映射就会被更新,映射中和系统调用对应的项就会增加。程序终止时,自动打印出所有声明的映射。
下面的例子统计所有的系统调用,然后通过 bpftrace 过滤语法使用 _PID_ 过滤出某个特定进程调用的系统调用:
```
$ sudo bpftrace -e 't:syscalls:sys_enter_* / pid == 1234 / { @[probe] = count(); }'
```
### 进程写的字节数
让我们使用上面的概念分析每个进程正在写的字节数:
```
$ sudo bpftrace -e 't:syscalls:sys_exit_write /args->ret > 0/ { @[comm] = sum(args->ret); }'
```
_bpftrace_ 连接操作块到写系统调用的返回探针_t:syscalls:sys_exit_write_然后使用过滤器丢掉代表错误代码的负值_/arg->ret > 0/_
映射的键 _comm_ 代表调用系统调用的进程名;内建函数 _sum()_ 累计每个映射项或进程写的字节数_args_ 是一个 `bpftrace` 内建指令用于访问追踪点的参数和返回值。如果执行成功_write_ 系统调用返回写的字节数_arg->ret_ 用于访问这个字节数。
### 进程的读取大小分布(柱状图):
_bpftrace_ 支持创建柱状图。让我们分析一个创建进程的 _read_ 大小分布的柱状图的例子:
```
$ sudo bpftrace -e 't:syscalls:sys_exit_read { @[comm] = hist(args->ret); }'
```
柱状图是 BPF 映射因此必须保存为一个映射_@_这个例子中映射键是 _comm_
这个例子使 _bpftrace_ 给每个调用 _read_ 系统调用的进程生成一个柱状图。要生成一个全局柱状图,直接保存 _hist()_ 函数到 _'@'_(不使用任何键)。
程序终止时bpftrace 自动打印出声明的柱状图。创建柱状图的基准值是通过 _args->ret_ 获取到的读取的字节数。
### 追踪用户空间程序
你也可以通过 _uprobes / uretprobes__USDT_(用户级静态定义的追踪)追踪用户空间程序。下一个例子使用探测用户级函数结尾处的 _uretprobe_ ,获取系统中运行的每个 _bash_ 发出的命令行:
```
$ sudo bpftrace -e 'uretprobe:/bin/bash:readline { printf("readline: \"%s\"\n", str(retval)); }'
```
要列出可执行文件 _bash_ 的所有可用 _uprobes / uretprobes_ 执行这个命令:
```
$ sudo bpftrace -l "uprobe:/bin/bash"
```
_uprobe_ 指向用户级函数执行的开始_uretprobe_ 指向执行的结束返回处_readline()_ 是 _/bin/bash_ 的一个函数返回键入的命令行_retval_ 是被探测的指令的返回值,只能在 _uretprobe_ 访问。
使用 _uprobes_ 时,你可以用 _arg0..argN_ 访问参数。需要调用 _str()__char *_ 指针转化成一个 _string_
## 自带脚本
bpftrace 软件包附带了许多有用的脚本,可以在 _/usr/share/bpftrace/tools/_ 目录找到。
这些脚本中,你可以找到:
* _killsnoop.bt_——追踪 `kill()` 系统调用发出的信号
* _tcpconnect.bt_——追踪所有的 TCP 网络连接
* _pidpersec.bt_——统计每秒钟(通过 fork创建的新进程
* _opensnoop.bt_——追踪 `open()` 系统调用
* _bfsstat.bt_——追踪一些 VFS 调用,按秒统计
你可以直接使用这些脚本,比如:
```
$ sudo /usr/share/bpftrace/tools/killsnoop.bt
```
你也可以在创建新的工具时参考这些脚本。
## 链接
* bpftrace 参考指南——<https://github.com/iovisor/bpftrace/blob/master/docs/reference_guide.md>
* Linux 2018 `bpftrace`DTrace 2.0)——<http://www.brendangregg.com/blog/2018-10-08/dtrace-for-linux-2018.html>
* BPF通用的内核虚拟机——<https://lwn.net/Articles/599755/>
* Linux Extended BPFeBPFTracing Tools——<http://www.brendangregg.com/ebpf.html>
* 深入 BPF一个阅读材料列表—— [https://qmonnet.github.io/whirl-offload/2016/09/01/dive-into-bpf][6]
* * *
_Photo by _[_Roman Romashov_][7]_ on _[_Unsplash_][8]_._
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/trace-code-in-fedora-with-bpftrace/
作者:[Augusto Caringi][a]
选题:[lujun9972][b]
译者:[YungeG](https://github.com/YungeG)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://fedoramagazine.org/author/acaringi/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2019/08/bpftrace-816x345.jpg
[2]: https://github.com/iovisor/bpftrace
[3]: https://lwn.net/Articles/740157/
[4]: https://github.com/iovisor/bpf-docs/blob/master/eBPF.md
[5]: https://fedoramagazine.org/howto-use-sudo/
[6]: https://qmonnet.github.io/whirl-offload/2016/09/01/dive-into-bpf/
[7]: https://unsplash.com/@wehavemegapixels?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[8]: https://unsplash.com/search/photos/trace?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText

View File

@ -0,0 +1,228 @@
[#]: collector: (lujun9972)
[#]: translator: (tanloong)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Machine learning made easy with Python)
[#]: via: (https://opensource.com/article/21/1/machine-learning-python)
[#]: author: (Girish Managoli https://opensource.com/users/gammay)
用 Python 轻松实现机器学习
======
用朴素贝叶斯分类器解决现实世界里的机器学习问题
![arrows cycle symbol for failing faster][1]
朴素贝叶斯是一种分类技术,它是许多分类器建模算法的基础。基于朴素贝叶斯的分类器是简单、快速和易用的机器学习技术之一,而且在现实世界的应用中很有效。
朴素贝叶斯是从 [贝叶斯定理][2] 发展来的。贝叶斯定理由 18 世纪的统计学家 [托马斯·贝叶斯][3] 提出,它根据与一个事件相关联的其他事件来计算该事件发生的概率。比如,[帕金森氏病][4] 患者通常嗓音会发生变化,因此嗓音变化就是与预测帕金森氏病相关联的症状。贝叶斯定理提供了计算目标事件发生概率的方法,而朴素贝叶斯是对该方法的推广和简化。
### 解决一个现实世界里的问题
这篇文章展示了朴素贝叶斯分类器解决现实世界问题 (与商业级应用相反) 的能力。我会假设你对机器学习有基本的了解,所以文章里会跳过一些与机器学习预测不大相关的步骤,比如 <ruby>数据打乱<rt>(date shuffling)</rt></ruby><ruby>数据切片<rt>(data splitting)</rt></ruby>。如果你是机器学习方面的新手或者需要一个进修课程,请查看 _[An introduction to machine learning today][5]__[Getting started with open source machine learning][6]_
朴素贝叶斯分类器是 <ruby>[有监督的][7]<rt>(supervised)</rt></ruby>、属于 <ruby>[生成模型][8]<rt>(generative)</rt></ruby> 的、非线性的、属于 <ruby>[参数模型][9]<rt>(parametric)</rt></ruby> 的和 <ruby>[基于概率的][10]<rt>(probabilistic)</rt></ruby>
在这篇文章里,我会演示如何用朴素贝叶斯预测帕金森氏病。需要用到的数据集来自 [UCI Machine Learning Repository][11]。这个数据集包含许多语音信号的指标,用于计算患帕金森氏病的可能性;在这个例子里我们将使用这些指标中的前 8 个:
* **MDVP:Fo(Hz)** 平均声带基频
* **MDVP:Fhi(Hz)** 最高声带基频
* **MDVP:Flo(Hz)** 最低声带基频
* **MDVP:Jitter(%)**、**MDVP:Jitter(Abs)**、**MDVP:RAP**、**MDVP:PPQ** 和 **Jitter:DDP** 5 个衡量声带基频变化的指标
这个例子里用到的数据集,可以在我的 [GitHub 仓库][12] 里找到。数据集已经事先做了打乱和分片。
### 用 Python 实现机器学习
接下来我会用 Python 来解决这个问题。我用的软件是:
* Python 3.8.2
* Pandas 1.1.1
* scikit-learn 0.22.2.post1
Python 有多个朴素贝叶斯分类器的实现,都是开源的,包括:
* **NLTK Naïve Bayes:** 基于标准的朴素贝叶斯算法,用于文本分类
* **NLTK Positive Naïve Bayes:** NLTK Naïve Bayes 的变体,用于对只标注了一部分的训练集进行二分类
* **Scikit-learn Gaussian Naïve Bayes:** 提供了 partial fit 方法来支持数据流或很大的数据集 (它们都可能无法一次性导入内存,用 partial fit 可以动态地增加数据)
* **Scikit-learn Multinomial Naïve Bayes:** 针对离散型特征变量作了优化
* **Scikit-learn Bernoulli Naïve Bayes:** 用于各个特征都是二元变量的情况
在这个例子里我将使用 [sklearn Gaussian Naive Bayes][13]。
我的 Python 实现在 `naive_bayes_parkinsons.py` 里,如下所示:
```
import pandas as pd
# x_rows 是我们所使用的 8 个特征的列名
x_rows=['MDVP:Fo(Hz)','MDVP:Fhi(Hz)','MDVP:Flo(Hz)',
'MDVP:Jitter(%)','MDVP:Jitter(Abs)','MDVP:RAP','MDVP:PPQ','Jitter:DDP']
y_rows=['status'] # y_rows 是类别的列名,若患病,值为 1若不患病值为 0
# 训练
# 读取训练数据
train_data = pd.read_csv('parkinsons/Data_Parkinsons_TRAIN.csv')
train_x = train_data[x_rows]
train_y = train_data[y_rows]
print("train_x:\n", train_x)
print("train_y:\n", train_y)
# 导入 sklearn Gaussian Naive Bayes然后进行对训练数据进行拟合
from sklearn.naive_bayes import GaussianNB
gnb = GaussianNB()
gnb.fit(train_x, train_y)
# 对训练数据进行预测
predict_train = gnb.predict(train_x)
print('Prediction on train data:', predict_train)
# 在训练数据上的准确率
from sklearn.metrics import accuracy_score
accuracy_train = accuracy_score(train_y, predict_train)
print('Accuray score on train data:', accuracy_train)
# 测试
# 读取测试数据
test_data = pd.read_csv('parkinsons/Data_Parkinsons_TEST.csv')
test_x = test_data[x_rows]
test_y = test_data[y_rows]
# 对测试数据进行预测
predict_test = gnb.predict(test_x)
print('Prediction on test data:', predict_test)
# 在测试数据上的准确率
accuracy_test = accuracy_score(test_y, predict_test)
print('Accuray score on test data:', accuracy_train)
```
运行这个 Python 脚本:
```
$ python naive_bayes_parkinsons.py
train_x:
      MDVP:Fo(Hz)  MDVP:Fhi(Hz) ...  MDVP:RAP  MDVP:PPQ  Jitter:DDP
0        152.125       161.469  ...   0.00191   0.00226     0.00574
1        120.080       139.710  ...   0.00180   0.00220     0.00540
2        122.400       148.650  ...   0.00465   0.00696     0.01394
3        237.323       243.709  ...   0.00173   0.00159     0.00519
..           ...           ...           ...  ...       ...       ...        
155      138.190       203.522  ...   0.00406   0.00398     0.01218
[156 rows x 8 columns]
train_y:
      status
0         1
1         1
2         1
3         0
..      ...
155       1
[156 rows x 1 columns]
Prediction on train data: [1 1 1 0 ... 1]
Accuracy score on train data: 0.6666666666666666
Prediction on test data: [1 1 1 1 ... 1
 1 1]
Accuracy score on test data: 0.6666666666666666
```
在训练集和测试集上的准确率都是 67%。它的性能还可以进一步优化。你想尝试一下吗?你可以在下面的评论区给出你的方法。
### 背后原理
朴素贝叶斯分类器从贝叶斯定理发展来的。贝叶斯定理用于计算条件概率或者说贝叶斯定理用于计算当与当与一个事件相关联的其他事件发生时该事件发生的概率。简而言之它解决了这个问题_如果我们已经知道事件 x 发生在事件 y 之前的概率,那么当事件 x 再次发生时,事件 y 发生的概率是多少_ 贝叶斯定理用一个先验的预测值来逐渐逼近一个最终的 [后验概率][14]。贝叶斯定理有一个基本假设,就是所有的参数重要性相同 (即相互独立)。
贝叶斯计算主要包括以下步骤:
1. 计算总的先验概率:
$P(患病)$ 和 $P(不患病)$
2. 计算 8 种指标各自是某个值时的后验概率 (value1,...,value8 分别是 MDVP:Fo(Hz),...,Jitter:DDP 的取值)
$P(value1,\ldots,value8\ |\ 患病)$
$P(value1,\ldots,value8\ |\ 不患病)$
3. 将第 1 步和第 2 步的结果相乘,最终得到患病和不患病的后验概率:
$P(患病\ |\ value1,\ldots,value8) \propto P(患病) \times P(value1,\ldots,value8\ |\ 患病)$
$P(不患病\ |\ value1,\ldots,value8) \propto P(不患病) \times P(value1,\ldots,value8\ |\ 不患病)$
上面第 2 步的计算非常复杂,朴素贝叶斯将它作了简化:
1. 计算总的先验概率:
$P(患病)$ 和 $P(不患病)$
2. 对 8 种指标里的每个指标,计算其取某个值时的后验概率:
$P(value1\ |\ 患病),\ldots,P(value8\ |\ 患病)$
$P(value1\ |\ 不患病),\ldots,P(value8\ |\ 不患病)$
3. 将第 1 步和第 2 步的结果相乘,最终得到患病和不患病的后验概率:
$P(患病\ |\ value1,\ldots,value8) \propto P(患病) \times P(value1\ |\ 患病) \times \ldots \times P(value8\ |\ 患病)$
$P(不患病\ |\ value1,\ldots,value8) \propto P(不患病) \times P(value1\ |\ 不患病) \times \ldots \times P(value8\ |\ 不患病)$
这只是一个很初步的解释,还有很多其他因素需要考虑,比如数据类型的差异,如何解析数据,数据可能有缺失值等。
### 超参数
朴素贝叶斯作为一个简单直接的算法,不需要超参数。然而,有的版本的朴素贝叶斯实现可能提供一些高级特性 (比如超参数)。比如,[GaussianNB][13] 就有 2 个超参数:
* **priors:** 先验概率,可以事先指定,这样就不必让算法从数据中计算才能得出。
* **var_smoothing:** 考虑数据的分布情况,当数据不满足标准的高斯分布时,这个超参数会发挥作用。
### 损失函数
为了坚持简单的原则,朴素贝叶斯使用 [0-1 损失函数][15]。如果预测结果与期望的输出相匹配,损失值为 0否则为 1。
### 优缺点
**优点:** 朴素贝叶斯是最简单最快速的算法之一。
**优点:** 在数据量较少时,用朴素贝叶斯仍可作出可靠的预测。
**缺点:** 朴素贝叶斯的预测只是估计值,并不准确。它胜在速度而不是准确度。
**缺点:** 朴素贝叶斯有一个基本假设,就是所有特征相互独立,但现实情况并不总是如此。
从本质上说,朴素贝叶斯是贝叶斯定理的推广。它是最简单最快速的机器学习算法之一,用来进行简单和快速的训练和预测。朴素贝叶斯提供了足够好、比较准确的预测。朴素贝叶斯假设预测特征之间是相互独立的。已经有许多朴素贝叶斯的开源的实现,它们的特性甚至超过了贝叶斯算法的实现。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/1/machine-learning-python
作者:[Girish Managoli][a]
选题:[lujun9972][b]
译者:[tanloong](https://github.com/tanloong)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/gammay
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/fail_progress_cycle_momentum_arrow.png?itok=q-ZFa_Eh (arrows cycle symbol for failing faster)
[2]: https://en.wikipedia.org/wiki/Bayes%27_theorem
[3]: https://en.wikipedia.org/wiki/Thomas_Bayes
[4]: https://en.wikipedia.org/wiki/Parkinson%27s_disease
[5]: https://opensource.com/article/17/9/introduction-machine-learning
[6]: https://opensource.com/business/15/9/getting-started-open-source-machine-learning
[7]: https://en.wikipedia.org/wiki/Supervised_learning
[8]: https://en.wikipedia.org/wiki/Generative_model
[9]: https://en.wikipedia.org/wiki/Parametric_model
[10]: https://en.wikipedia.org/wiki/Probabilistic_classification
[11]: https://archive.ics.uci.edu/ml/datasets/parkinsons
[12]: https://github.com/gammay/Machine-learning-made-easy-Naive-Bayes/tree/main/parkinsons
[13]: https://scikit-learn.org/stable/modules/generated/sklearn.naive_bayes.GaussianNB.html
[14]: https://en.wikipedia.org/wiki/Posterior_probability
[15]: https://en.wikipedia.org/wiki/Loss_function#0-1_loss_function

View File

@ -1,193 +0,0 @@
[#]: subject: (Configuring Vim as a Writing Tool)
[#]: via: (https://news.itsfoss.com/configuring-vim-writing/)
[#]: author: (Theena https://news.itsfoss.com/author/theena/)
[#]: collector: (lujun9972)
[#]: translator: (piaoshi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
将 Vim 配置成一个写作工具
======
在我的第一个专栏中,我谈到了我为什么把 [我的写作工作迁移到了 Vim 上][1] -- 远离现代写作者们的标准工具如文字处理器MS Word 及它的开源替代方案)、文本编辑器(记事本,因为直到去年我一直是 Windows 用户)和云存储技术。如果你是一个写作者,在继续下面的内容前,我建议你先阅读一下 [那篇文章的第一部分][1] 。
基本上可以说,你使用的设备越多,你需要的写作工具就越多,最终你的工作流程就越复杂。这一点对我来说是很贴切的,因为我有四台设备,包括一部安卓手机,一台日常用的运行 Linux 的主力笔记本电脑,还有两台旧的笔记本电脑,其中一台是 Mac我去户外拍摄时会带着它。
Vim 对于我和我的工作方式来说是一个完美的解决方案;虽然我不会说我的新的工作流程是现代世界写作者工作的最佳方式,但我可以说的是,对于写作者来说,拥有一个能在我们所有设备上工作的工具非常重要的,并且这个工具要足够强大以满足我们写作者每天从事的不同类型的写作需求。
从这个角度来看Vim 的主要优势是它是跨平台的 -- 无论在什么设备上Vim 都能工作。在苹果生态系统中使用 Vim 的情况我就不细说了,但粗略地看一下 [这个应用程序][2] 的评论,我就会让知道,在某些地方有某些人需要 Vim不管他们使用的是什么设备。
现在我们假设你是一个想开始使用 Vim 的写作者。一旦你安装了它,你该从哪里开始呢?
我在这一部分给你的不是一个教程,而是一系列的建议,包含对一个用于诗歌写作的 .vimrc 配置文件的解读。只要有可能,我就会链接到我学习相应内容时用到的 YouTube 上的教程。
对于 Linux 用户来说,系统已经预装了 Vim -- 通过你喜欢的终端模拟器就可以启动它。对于 Windows 和 Mac 用户,你可以从 [Vim 官方网站][3] 下载它。
### 建议
**安装/启用 Vim 后**
* 通过终端打开 Vim Tutor。( Mac 用户可以用这种方式启动,而 Windows 用户也可以用这种方法启动。[译者注:原文这里本应该有链接,可能作者忘记添加了。无论如何,在终端中, Linux 中的命令是 vimtutorWindows 在安装目录下找到 vimtutor.bat 命令并运行Mac应该与 Linux 一样?我没 Mac 呀!])在这个阶段,你不会使用 Vim 进行任何写作 -- 相反你要每天花15分钟做 Vim 教程。不要多花一分钟或少花一分钟看看在规定的15分钟内你能在教程中取得多大的进展。你会发现每天你都会在教程中取得更大的进步。在一个月内你应该能够利用这些15分钟完成整个教程。
* 成为一个更好的打字员对 Vim 的使用来说有极大的好处。这不是必须的,但我正在重新学习打字,它的副作用是使 Vim 变得更加有用了。我每次都以花15分钟练习打字开始作为进入 Vim 教程前的热身。
在每一天的开始我分配了30分钟的时间做这两项练习进行热身而每天晚上睡觉前再分配30分钟进行练习以让我安定下来。这样的做法帮我快速从旧的工具包过渡到了 Vim但你的安排可能有所不同。
我再次强调, _**除了Vim Tutor之外**_ ,上述步骤都是可选的;这完全取决于你个人的动机水平。
现在我们来到了这篇文章的重点:如何配置 Vim ,使它对写作者友好?
### 如何配置用于写作的 .vimrc
_在开始之前我想在这里提醒各位读者我不是一个技术人员 -- 我是一个小说家 -- 你在下面看到的任何错误都是我自己的;我希望有经验的 Vim 用户能提供反馈告诉我如何进一步完善我的配置文件。_
下面是我的 .vimrc 文件。你可以从我的 [GitHub][4] 上下载,并进一步完善它。
```
syntax on
set noerrorbells "取消 Vim 的错误警告铃声,关闭它以免打扰到我们
set textwidth=100 "确保每一行不超过100字符
set tabstop=4 softtabstop=4
set shiftwidth=4
set expandtab
set smartindent
set linebreak
set number
set showmatch
set showbreak=+++
set smartcase
set noswapfile
set undodir=~/.vim/undodir
set undofile
set incsearch
set spell
set showmatch
set confirm
set ruler
set autochdir
set autowriteall
set undolevels=1000
set backspace=indent,eol,start
" 下面的设置确保按写作者而不是程序员喜欢的方式折行
set wrap
nnoremap <F5> :set linebreak<CR>
nnoremap <C-F5> :set nolinebreak<CR>
call plug#begin('~/.vim/plugged')
" 这是颜色风格插件
Plug 'colepeters/spacemacs-theme.vim'
Plug 'sainnhe/gruvbox-material'
Plug 'phanviet/vim-monokai-pro'
Plug 'flazz/vim-colorschemes'
Plug 'chriskempson/base16-vim'
Plug 'gruvbox-community/gruvbox'
" 这是为了更容易的诗歌写作选择的一些插件
Plug 'dpelle/vim-LanguageTool'
Plug 'ron89/thesaurus_query.vim'
Plug 'junegunn/goyo.vim'
Plug 'junegunn/limelight.vim'
Plug 'reedes/vim-pencil'
Plug 'reedes/vim-wordy'
" 这一部分是为了更容易地与机器集成,用了 vim-airline 这类插件
Plug 'vim-airline/vim-airline'
" 这一部分外理工作区和会话管理
Plug 'thaerkh/vim-workspace'
" 与上面插件相关, 下面的代码将你的所有的会话文件保存到一个你工作区之外的目录
let g:workspace_session_directory = $HOME . '/.vim/sessions/'
" 与上面插件相关,这是一个 Vim 活动的跟踪器
Plug 'wakatime/vim-wakatime'
" 一个干扰因素:我在这里使用了一些 Emacs 的功能,特别是 org-mode
Plug 'jceb/vim-orgmode'
" 这是文件格式相关插件
Plug 'plasticboy/vim-markdown'
call plug#end()
colorscheme pacific
set background=dark
if executable('rg')
let g:rg_derive_root='true'
endif
```
学习如何安装 Vim 插件时,这个教程帮助了我。我使用 Vim Plugged 插件管理器是因为在我看来它是最简单、最优雅的。
![][5]
#### 对于写作者的 .vimrc 的选项的整理
* `syntax on` : 这可以确保 Vim 知道我在使用什么语法。做笔记,写这种文章时我主要使用 Markdown ;而在写小说的时候,纯文本是我的首选格式。
* `set noerrorbells` : 为了你的精神状态,我强烈建议打开这个选项。
* `set textwidth=100` : 为了便于阅读,没有人愿意横向滚动一个文本文件。
* `set spell` : 提醒你,如果有拼写错误的话。
* `set wrap` : 确保文本以写作者而不是程序员的方式进行折行。
你会注意到,我没有花更多时间讨论其他一些基本配置选项,因为我并不觉得那些对写作者来说有多重要。因为我做一些业余的编码工作,所以我的 .vimrc 配置反映了这一点。如果你只想在 Vim 上写作,那么上述配置就应该能让你顺利开始。
从这点上来说,你的 .vimrc 是一个活的文档,它能生动地反映你想用 Vim 做什么,以及你希望 Vim 如何为你做这些事情。
#### 关于插件的说明
第43-98行之间是我对插件的配置。如果你已经学习了关于如何安装 Vim 插件的教程,我强烈推荐你从以下专为写作开发的 Vim 插件开始:
* `vim-LanguageTool`
* `thesaurus_query.vim`
* `vim-pencil`
* `vim-wordy`
* `vim-goyo`
* `vim-markdown`
#### 总结
在这篇文章中,我们简单地介绍了写作者可以怎样开始使用 Vim以及一个在写作工作中需要的 .vimrc 入门配置。除了我的 .vimrc 之外,我还将在这里链接到我在 GitHub 上发现的其他写作者的 .vimrc它们是我自己配置时的灵感来源。
![][6]
请劳记,这只是一个写作者的 .vimrc 的入门配置。你会发现随着你的需求的发展Vim 也可以随之发展。因此,投入一些时间学习配置你的 .vimrc 是值得的。
在下一篇文章中,我将会检视我在写作时的工作流程的具体细节,这个工作流程中我使用了 Vim 和 Git 及 GitHub。
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/configuring-vim-writing/
作者:[Theena][a]
选题:[lujun9972][b]
译者:[piaoshi](https://github.com/piaoshi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/theena/
[b]: https://github.com/lujun9972
[1]: https://news.itsfoss.com/how-i-started-loving-vim/
[2]: https://apps.apple.com/us/app/ivim/id1266544660
[3]: https://www.vim.org/
[4]: https://github.com/MiragianCycle/dotfiles
[5]: https://i1.wp.com/i.ytimg.com/vi/n9k9scbTuvQ/hqdefault.jpg?w=780&ssl=1
[6]: https://i2.wp.com/i.ytimg.com/vi/Pq3JMp3stxQ/hqdefault.jpg?w=780&ssl=1

View File

@ -0,0 +1,138 @@
[#]: subject: "What is XML?"
[#]: via: "https://opensource.com/article/21/7/what-xml"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lujun9972"
[#]: translator: "amwps290"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
什么是 XML?
======
什么是 XMLXML 是一种严格但灵活的标记语言,无论是在文档还是图像方面应用都十分广泛。
![Computer screen with files or windows open][1]
XML是一种层级标记语言。它使用开始和结束标签来定义数据它常用来存储和交换数据而且由于它极大的灵活性不论是[文档][2]还是[图像][3]都用的非常多。
这里是一个 XML 文档的例子:
```xml
<xml>
  <os>
   <linux>
    <distribution>
      <name>Fedora</name>
      <release>8</release>
      <codename>Werewolf</codename>
    </distribution>
    <distribution>
      <name>Slackware</name>
      <release>12.1</release>
      <mascot>
        <official>Tux</official>
        <unofficial>Bob Dobbs</unofficial>
      </mascot>
    </distribution>
   </linux>
  </os>    
</xml>
```
阅读这个示例 XML您可能会发现这个 XML 的格式具有直观的特性。 无论您是否熟悉这个文档的主题,您都可能理解本文档中的数据。 这部分是因为 XML 被认为是冗长的。 它使用了很多标签,标签可以有很长的描述性名称,并且数据以分层方式排序,这有助于解释数据之间的关系。 您可能从这个示例中了解到 Fedora 发行版和 Slackware 发行版是两个不同且不相关的 Linux 发行版,因为每个实例都“包含”在自己独立的 `<distribution>` 标签中。
XML 也非常灵活。 与 HTML 不同,没有预定义的标签列表。 您可以自由创建您需要表示任何数据结构的标签。
### XML 的组成
数据的存在为了读取,当计算机“读取”数据时,该过程称为 _解析_。 再次使用示例 XML 数据,这里是大多数 XML 解析器认为重要的术语。
* **文档** `<xml>` 标签标记文档的开始, `</xml>` 标签标记文档的结束。
* **节点**`<os>` ,`<distribution>`,`<mascot>` 这些都是节点,在解析术语中,节点是包含其他标签的标签。
* **元素**:像 `<name>Fedora</name>``<official>Tux</official>` 这些都是元素。从 第一个`<`开始,到最后一个 `>` 结束是一个元素。
* **内容**:在两个元素标签之间的数据被称之为内容,在第一个 `<name>` 标签中,`Fedora` 字符串就是一个内容。
### XML 模式
XML 文档中的标签和标签继承称为 _模式_
一些模式是随意组成的(例如,本文中的示例 XML 代码纯粹是即兴创作的),而其他模式则由标准组严格定义。 例如,可缩放矢量图形 (SVG) 模式 [由 W3C 定义][4],而 [DocBook 模式][5] 由 Norman Walsh 定义。
模式强制执行一致性。 最基本的模式通常也是最严格的。 在我的示例 XML 代码中,将发行版名称放在 `<mascot>` 节点中是没有意义的,因为文档的隐含模式清楚地表明 mascot 必须是发行版的“子”元素。
### 数据对象模型 (DOM)
如果您必须不断地描述标签和位置(例如,“系统部分中的 Linux 部分中第二个发行版标签的名称标签”),那么谈论 XML 会让人感到困惑,因此解析器使用文档对象模型 (DOM) 的概念来表示 XML 数据。 DOM 将 XML 数据放入一种“家谱”结构中,从根元素(在我的示例 XML 中,即`os` 标记)开始并包括路径上的每个标记。
![Document Object Model][6]
(Seth Kenlon, [CC BY-SA 4.0][7])
这种相同的 XML 数据结构可以表示为路径,就像 Linux 系统中的文件或 Internet 上网页的位置一样。 例如,`<mascot>` 标签的路径可以表示为 `//os/linux/distribution/slackware/mascot`
两个 `<distribution>` 标签可以被表示为 `//os/linux/distribution` ,因为这里有两个发行版的节点,因此一个解析器可以直接将两个节点的内容载入到一个数组中。
### 严格的 XML
XML 也以严格而著称。 这意味着大多数应用程序被设计为在遇到 XML 错误时就会失败。 这听起来可能有问题,但这是开发人员最欣赏 XML 的事情之一,因为当应用程序试图猜测如何解决错误时,可能会发生不可预测的事情。 例如,在 HTML 定义明确之前,大多数 Web 浏览器都包含“怪癖模式”,因此当人们试图查看糟糕的 HTML 代码时Web 浏览器却可以加载作者可能想要的内容。 结果非常难以预测,尤其是当一个浏览器的猜测与另一个浏览器不同时。
XML 通过在出现错误时失败而不允许这样做。 这让作者可以修复错误,直到它们生成有效的 XML。 因为 XML 是良好定义的,所以有许多应用程序的验证器插件以及像 `xmllint``xmlstarlet` 这样的独立命令来帮助您及早定位错误。
### 转换 XML
因为 XML 通常用作数据交换,所以将 XML 转换为其他数据格式或其他 XML 模式是很常见的。 经典示例包括 XSLTProc、xmlto 和 [pandoc][8],但从技术上讲,还有许多其他应用程序或者至少程序的一部分是为了转换 XML。
事实上LibreOffice 使用 XML 来布局其文字处理器和电子表格文档,因此无论何时您导出或 [从 LibreOffice 转换文件][9],您都在转换 XML。
[开源 EPUB 格式的电子书][10] 使用 XML因此无论何时您 [将文档转换为 EPUB][11] 或从 EPUB 转换,您都在转换 XML。
Inkscape 是基于矢量的插图应用程序,它将其文件保存在 SVG 中,这是一种专为图形设计的 XML 模式。 任何时候您将 Inkscape 中的图像导出为 PNG 文件时,您都在转换 XML。
名单还可以一直继续下去。 XML 是一种数据存储格式,旨在确保您的数据,无论是画布上的点和线、图表上的节点,还是文档中的文字,都可以轻松准确地提取、更新和转换。
### 学习 XML
编写 XML 很像编写 HTML。 感谢 Jay Nick 的辛勤工作,[在线提供免费且有趣的 XML 课程][3]可以教您如何使用 XML 创建图形。
通常,探索 XML 所需的特殊工具很少。 由于 HTML 和 XML 之间的密切关系,您可以[使用 Web 浏览器查看 XML][12]。 此外,[QXmlEdit][13]、[NetBeans][14] 和 [Kate][15] 等开源文本编辑器通过有用的提示、自动完成、语法验证等,使键入和阅读 XML 变得容易。
### Choose XML
### 选择 XML
XML 起初可能看起来有很多数据,但它与 HTML 并没有太大的不同实际上HTML 已经[以 XHTML 的形式重新实现为 XML][16])。 XML 有一个独特的好处,即构成其结构的标签也恰好是元数据,提供有关其存储内容的信息。 精心设计的 XML 模式包含并描述您的数据,使用户能够一目了然并快速解析它,并使开发人员能够使用一些库[快速解析][17]。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/what-xml
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[amwps290](https://github.com/amwps290)
校对:[校对者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/17/9/docbook
[3]: https://opensource.com/article/17/5/coding-scalable-vector-graphics-make-steam
[4]: https://www.w3.org/TR/SVG11/
[5]: http://docbook.org
[6]: https://opensource.com/sites/default/files/uploads/dom.jpg "Document Object Model"
[7]: https://creativecommons.org/licenses/by-sa/4.0/
[8]: https://opensource.com/article/20/5/pandoc-cheat-sheet
[9]: https://opensource.com/article/21/3/libreoffice-command-line
[10]: https://opensource.com/education/15/11/ebook-open-formats
[11]: https://opensource.com/life/13/8/how-create-ebook-open-source-way
[12]: https://opensource.com/article/18/12/xml-browser
[13]: https://opensource.com/article/17/7/7-ways-handle-xml-qxmledit
[14]: https://opensource.com/article/20/12/netbeans
[15]: https://opensource.com/article/20/12/kate-text-editor
[16]: https://www.w3.org/TR/xhtml1/
[17]: https://opensource.com/article/21/6/parsing-config-files-java

View File

@ -0,0 +1,118 @@
[#]: subject: (Run a Linux virtual machine in Podman)
[#]: via: (https://opensource.com/article/21/7/linux-podman)
[#]: author: (Sumantro Mukherjee https://opensource.com/users/sumantro)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
在 Podman 中运行一个 Linux 虚拟机
======
使用 Podman Machine 创建一个基本的 Fedora CoreOS 虚拟机来使用容器和容器化工作负载。
![woman on laptop sitting at the window][1]
Fedora CoreOS 是一个自动更新、基于最小 [rpm-ostree][2]的 操作系统,用于安全地、大规模地运行容器化工作负载。
[Podman][3] “是一个用于管理容器和镜像、挂载到这些容器中的卷,以及由这些容器组组成的 pod 的工具。Podman 基于 libpod它是一个容器生命周期管理库”。
当你使用 [Podman Machine][4] 时,神奇的事情发生了,它可以帮助你创建一个基本的 Fedora CoreOS 虚拟机VM来使用容器和容器化工作负载。
### 开始使用 Podman Machine
第一步是安装 Podman。如果你已经安装了最新版本的 Podman你可以跳过这个步骤。在我的 Fedora 34 机器上,我用以下方式安装 Podman
```
`$ sudo dnf install podman`
```
我使用的是 podman-3.2.2-1.fc34.x86_64。
### 初始化 Fedora CoreOS
Podman 安装完成后,用以下方法初始化它:
```
podman machine init vm2
Downloading VM image: fedora-coreos-34.20210626.1.0-qemu.x86_64.qcow2.xz: done
Extracting compressed file
```
这个命令创建了 `vm2`,并下载了 .xz 格式的 Fedora CoreOS 的 qcow2 文件并将其解压。
### 列出你的虚拟机
了解你的虚拟机和它们的状态是很重要的,`list` 命令可以帮助你做到这一点。下面的例子显示了我所有的虚拟机的名称,它们被创建的日期,以及它们最后一次启动的时间:
```
podman machine list
NAME VM TYPE CREATED LAST UP
podman-machine-default* qemu 6 days ago Currently running
vm2 qemu 11 minutes ago 11 minutes ago
```
### 启动一个虚拟机
要启动一个虚拟机,请运行:
```
podman machine start
Waiting for VM …
```
### SSH 到虚拟机
你可以使用 SSH 来访问你的虚拟机,并使用它来运行工作负载,而没有任何麻烦的设置:
```
podman machine ssh
Connecting to vm podman-machine-default. To close connection, use `~.` or `exit`
Fedora CoreOS 34.20210611.1.0
Tracker: <https://github.com/coreos/fedora-coreos-tracker>
Discuss: <https://discussion.fedoraproject.org/c/server/coreos/>
Last login: Wed Jun 23 13:23:36 2021 from 10.0.2.2
[core@localhost ~]$ uname -a
Linux localhost 5.12.9-300.fc34.x86_64 #1 SMP Thu Jun 3 13:51:40 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
[core@localhost ~]$
```
目前Podman 只支持一次运行一个虚拟机。
### 停止你的虚拟机
要停止运行中的虚拟机,请使用 `stop` 命令:
```
podman machine stop
[core@localhost ~]$ Connection to localhost closed by remote host.
Connection to localhost closed.
Error: exit status 255
```
我希望这能帮助你开始使用 Podman Machine。请试一试并在评论中告诉我们你的想法。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/linux-podman
作者:[Sumantro Mukherjee][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/sumantro
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop)
[2]: http://coreos.github.io/rpm-ostree/
[3]: https://github.com/containers/podman
[4]: http://docs.podman.io/en/latest/markdown/podman-machine.1.html