Merge pull request #1 from LCTT/master

Update from LCTT
This commit is contained in:
bingzxy 2020-04-13 20:51:24 +08:00 committed by GitHub
commit fb036c0f1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
57 changed files with 4233 additions and 2430 deletions

View File

@ -0,0 +1,142 @@
[#]: collector: (lujun9972)
[#]: translator: (MFGJT)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12095-1.html)
[#]: subject: (Best Audio Editors For Linux)
[#]: via: (https://itsfoss.com/best-audio-editors-linux)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
Linux 上的最佳音频编辑工具推荐
======
在 Linux 上,有很多种音频编辑器可供你选用。不论你是一个专业的音乐制作人,还是只想学学怎么做出超棒的音乐的爱好者,这些强大的音频编辑器都是很有用的工具。
对于专业级的使用,我总是建议使用 [DAW][1](数码音频工作站)。但并不是每个人都需要全部的功能,所以你也应该了解一些最简单的音频编辑器。
在本文中,我们将讨论几款 DAW 和基础的音频编辑器,而且它们都是在 Linux 和(可能)其它操作系统上可以使用的**自由开源**的解决方案。
### Linux 上的最佳音频编辑器
![Best audio editors and DAW for Linux][2]
我们不会关注 DAW 提供的所有功能,而只是关注基本的音频编辑功能。不过,你仍然可以把以下内容看作是 Linux 的最佳 DAW 名单。
**安装说明:**你可以在 AppCenter 或软件中心中找到所有提到的音频编辑器或 DAW。如果你在这两个地方没有找到它们请前往它们的官方网站获取更多信息。
#### 1、Audacity
![Audacity audio editor][3]
[Audacity](https://www.audacityteam.org/) 是 Linux 中最基本音频编辑器之一,但是它也很强大。它是一个自由开源的跨平台工具。肯定已经有很多人了解这个软件了。
现在的它相比它最初流行的时候有了很大的改进。我记得我以前试着通过从音频中去除人声来制作卡拉 OK 伴奏。现在有些时候,你仍然可以这么做。
**特性:**
它还支持包含 VST 效果的插件。当然,你不应该期望它支持 VST 乐器。
* 通过麦克风或混音器进行现场录制
* 支持同时从多种音频格式的多个文件中批量导出/导入内容
* 支持 LADSPA、LV2、Nyquist、VST 和 Audio Unit 的效果插件
* 使用简单,带有剪切、粘贴、删除和拷贝的功能
* 可观测声音频率的频谱模式
#### 2、LMMS
![LMMS audio editor][4]
[LMMS](https://lmms.io/) 是一个自由开源的(跨平台)数码音频工作站。它包括所有基本的音频编辑功能以及许多高级功能。
你可以混音、组合音频,或使用 VST 设备创造音频。LMMS 支持这些功能。此外它还自带一些样本音频、预设、VST 设备和特效来帮助你起步。此外,你还可以得到一个频谱分析仪,以便进行高级的音频编辑工作。
**特性:**
* 基于 MIDI 的音符回放
* 支持 VST 设备
* 原生支持多采样
* 内置压缩器、限制器、延迟功能、混响功能、失真功能和低音增强器
#### 3、Ardour
![Ardour audio editor][5]
[Ardour](https://ardour.org/) 是另一个自由开源的数码音频工作站。只要你有音频接口Ardour 就支持它的使用。当然,你也可以无限地添加多声道音轨。这些多声道音轨也可以被指派到不同的混音带,以方便编辑和录音。
你也可以导入一个视频,编辑其中的音频,然后导出新的视频。它提供了许多内置插件,并且支持 VST 插件。
**特性:**
* 非线性编辑
* 垂直窗口堆叠,便于导航
* <ruby>静默消除功能<rt>strip silence</rt></ruby><ruby>推拉修剪功能<rt>push-pull trimming</rt></ruby>,和用以短暂片段或基于基于音符开始的编辑的 Rhythm Ferret。
#### 4、Cecilia
![Cecilia audio editor][6]
[Cecilia](http://ajaxsoundstudio.com/software/cecilia/) 不是一个普通的音频编辑器。它的使用者一般是音效设计师或者正在努力成为音效设计师的人。 Cecilia 实际上是一个音频信号处理环境。它可以让你的作品余音绕梁。
你还可以得到内置的音效与合成模组和插件。Cecilia 为一个明确的目的而生:如果你正在找音效设计工具,这是你的不二之选!
**特性:**
* 利用模块来完成更多工作UltimateGrainer —— 最先进的颗粒化处理工具RandomAccumulator —— 记录变量速度的累加器UpDistoRes——通过上采样和谐振低通滤波器创造失真效果的工具
* 自动保存调制设定
#### 5、Mixxx
![Mixxx audio DJ][7]
如果你想要在混合和录制一些东西的同时能够有一个虚拟的 DJ 工具,[Mixxx](https://www.mixxx.org/) 将是完美的工具。你可以用到 BPM、音调并使用主同步功能来匹配歌曲的节奏和节拍。另外不要忘记它也是一个 Linux 的自由开源的软件。
它还支持自定义 DJ 设备。所以,如果你有 DJ 设备或者 MIDI你可以用这个工具录制你的现场混音。
**特性:**
* 播送和录制你的歌曲的 DJ 混音
* 可以连接到你的设备并且现场演奏
* 音调检测和 BPM 检测
#### 6、Rosegarden
![Rosegarden audio editor][9]
[Rosegarden](https://www.rosegardenmusic.com/) 是另一个令人赞叹的 Linux 的自由开源的音频编辑器。它既不是一个功能齐全的 DAW也不是一个基本的音频编辑工具。它是两者的混合体并带有一些缩减的功能。
我不会向专业人士推荐这款软件,但如果你经营家庭音乐工作室或只是想体验一下,这将是 Linux 上可以安装的最好的音频编辑器之一。
**特性:**
* 乐谱编辑
* 录音、混音以及采样
### 小结
这些是你可以找到的 Linux 上的最棒的一些音频编辑器了。不论你是需要 DAW一个剪切/粘贴的编辑工具,或者仅仅想要一个拥有基础的混音和录音功能的音频编辑工具,上述软件都能够满足你的需求。
如果在这篇文章中我们遗漏了你最喜欢的一些音频工具,可以在原文下方评论中回复告诉我们。
--------------------------------------------------------------------------------
via: https://itsfoss.com/best-audio-editors-linux
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[MFGJT](https://github.com/MFGJT)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://en.wikipedia.org/wiki/Digital_audio_workstation
[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/01/linux-audio-editors-800x450.jpeg?resize=800%2C450&ssl=1
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/audacity-audio-editor.jpg?fit=800%2C591&ssl=1
[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/lmms-daw.jpg?fit=800%2C472&ssl=1
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/ardour-audio-editor.jpg?fit=800%2C639&ssl=1
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/01/cecilia.jpg?fit=800%2C510&ssl=1
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/01/mixxx.jpg?fit=800%2C486&ssl=1
[8]: https://itsfoss.com/dj-mixxx-2/
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/rosegarden.jpg?fit=800%2C391&ssl=1
[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/linux-audio-editors.jpeg?fit=800%2C450&ssl=1

View File

@ -0,0 +1,262 @@
[#]: collector: "lujun9972"
[#]: translator: "chunibyo-wly"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-12088-1.html"
[#]: subject: "How to write a loop in Bash"
[#]: via: "https://opensource.com/article/19/6/how-write-loop-bash"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
如何在 Bash 中使用循环
======
> 使用循环和查找命令批量自动对多个文件进行一系列的操作。
![](https://img.linux.net.cn/data/attachment/album/202004/08/225655by8i8k7uyppp18ph.jpg)
人们希望学习批处理命令的一个普遍原因是要得到批处理强大的功能。如果你希望批量的对文件执行一些指令,构造一个可以重复运行在那些文件上的命令就是一种方法。在编程术语中,这被称作*执行控制*`for` 循环就是其中最常见的一种。
`for` 循环可以详细描述你希望计算机对你指定的每个数据对象(比如说文件)所进行的操作。
### 一般的循环
使用循环的一个简单例子是对一组文件进行分析。这个循环可能没什么用,但是这是一个安全的证明自己有能力独立处理文件夹里每一个文件的方法。首先,创建一个文件夹然后拷贝一些文件(例如 JPEG、PNG 等类似的文件)至文件夹中生成一个测试环境。你可以通过文件管理器或者终端来完成创建文件夹和拷贝文件的操作:
```bash
$ mkdir example
$ cp ~/Pictures/vacation/*.{png,jpg} example
```
切换到你刚创建的那个新文件夹,然后列出文件并确认这个测试环境是你需要的:
```
$ cd example
$ ls -1
cat.jpg
design_maori.png
otago.jpg
waterfall.png
```
在循环中逐一遍历文件的语法是:首先声明一个变量(例如使用 `f` 代表文件),然后定义一个你希望用变量循环的数据集。在这种情况下,使用 `*` 通配符来遍历当前文件夹下的所有文件(通配符 `*` 匹配*所有文件*)。然后使用一个分号(`;`)来结束这个语句。
```
$ for f in * ;
```
取决于你个人的喜好你可以选择在这里按下回车键。在语法完成前shell 是不会尝试执行这个循环的。
接下来,定义你想在每次循环中进行的操作。简单起见,使用 `file` 命令来得到 `f` 变量(使用 `$` 告诉 shell 使用这个变量的值,无论这个变量现在存储着什么)所存储着的文件的各种信息:
```
do file $f ;
```
使用另一个分号结束这一行,然后关闭这个循环:
```
done
```
按下回车键启动 shell 对当前文件夹下*所有东西*的遍历。`for` 循环将会一个一个的将文件分配给变量 `f` 并且执行你的命令:
```
$ for f in * ; do
> file $f ;
> done
cat.jpg: JPEG image data, EXIF standard 2.2
design_maori.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced
otago.jpg: JPEG image data, EXIF standard 2.2
waterfall.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced
```
你也可以用这种形式书写命令:
```
$ for f in *; do file $f; done
cat.jpg: JPEG image data, EXIF standard 2.2
design_maori.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced
otago.jpg: JPEG image data, EXIF standard 2.2
waterfall.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced
```
对你的 shell 来说,多行和单行的格式没有什么区别,并且会输出完全一样的结果。
### 一个实用的例子
下面是一个循环在日常使用中的实用案例。假如你拥有一堆假期拍的照片想要发给你的朋友。但你的照片太大了,无法通过电子邮件发送,上传到[图片分享服务][2]也不方便。因此你想为你的照片创建小型的 web 版本,但是你不希望花费太多时间在一个一个的压缩图片体积上。
首先,在你的 Linux、BSD 或者 Mac 上使用包管理器安装 ImageMagick 命令。例如,在 Fedora 和 RHEL 上:
```
$ sudo dnf install ImageMagick
```
在 Ubuntu 和 Debian 上:
```
$ sudo apt install ImageMagick
```
在 BSD 上,使用 `ports` 或者 [pkgsrc][3] 安装。在 Mac 上,使用 [Homebrew][4] 或者 [MacPorts][5] 安装。
在你安装了 ImageMagick 之后,你就拥有一系列可以用来操作图片的新命令了。
为你将要创建的文件建立一个目标文件夹:
```
$ mkdir tmp
```
使用下面的循环可以将每张图片减小至原来大小的 33%。
```
$ for f in * ; do convert $f -scale 33% tmp/$f ; done
```
然后就可以在 `tmp` 文件夹中看到已经缩小了的照片了。
你可以在循环体中使用任意数量的命令,因此如果你需要对一批文件进行复杂的操作,可以将你的命令放在一个 `for` 循环的 `do``done` 语句之间。例如,假设你希望将所有处理过的图片拷贝至你的网站所托管的图片文件夹并且在本地系统移除这些文件:
```
$ for f in * ; do
convert $f -scale 33% tmp/$f
scp -i seth_web tmp/$f seth@example.com:~/public_html
trash tmp/$f ;
done
```
你的计算机会对 `for` 循环中处理的每一个文件自动的执行 3 条命令。这意味着假如你仅仅处理 10 张图片,也会省下输入 30 条指令和更多的时间。
### 限制你的循环
一个循环常常不需要处理所有文件。在示例文件夹中,你可能需要处理的只是 JPEG 文件:
```
$ for f in *.jpg ; do convert $f -scale 33% tmp/$f ; done
$ ls -m tmp
cat.jpg, otago.jpg
```
或者,你希望重复特定次数的某个操作而不仅仅只处理文件。`for` 循环的变量的值是被你赋给它的(不管何种类型的)数据所决定的,所以你可以创建一个循环遍历数字而不只是文件:
```
$ for n in {0..4}; do echo $n ; done
0
1
2
3
4
```
### 更多循环
现在你了解的知识已经足够用来创建自己的循环体了。直到你对循环非常熟悉之前,尽可能的在需要处理的文件的*副本*上进行操作。使用内置的保护措施可以预防损坏自己的数据和制造不可复现的错误,例如偶然将一个文件夹下的所有文件重命名为同一个名字,就可能会导致他们的相互覆盖。
更进一步的 `for` 循环话题,请继续阅读。
### 不是所有的 shell 都是 Bash
关键字 `for` 是内置在 Bash shell 中的。许多类似的 shell 会使用和 Bash 同样的关键字和语法,但是也有某些 shell ,比如 [tcsh][7],使用不同的关键字,例如 `foreach`
tcsh 的语法与 Bash 类似,但是它更为严格。例如在下面的例子中,不要在你的终端的第 2、3 行键入 `foreach?` 。它只是提示你仍处在构建循环的过程中。
```
$ foreach f (*)
foreach? file $f
foreach? end
cat.jpg: JPEG image data, EXIF standard 2.2
design_maori.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced
otago.jpg: JPEG image data, EXIF standard 2.2
waterfall.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced
```
在 tcsh 中,`foreach` 和 `end` 都必须单独的在一行中出现。因此你不能像 Bash 或者其他类似的 shell 一样只使用一行命令创建一个 `for` 循环。
### for 循环与 find 命令
理论上,你可能会用到不支持 `for` 循环的 shell或者你只是更想使用其他命令的一些特性来完成和循环一样的工作。
使用 `find` 命令是另一个实现 `for` 循环功能的途径。这个命令提供了多种方法来定义循环中包含哪些文件的范围以及[并行][8]处理的选项。
`find` 命令顾名思义就是帮助你查询存储在硬盘里的文件。它的用法很简单:提供一个你希望它查询的位置的路径,接着 `find` 就会查询这个路径下面的所有文件和文件夹。
```
$ find .
.
./cat.jpg
./design_maori.png
./otago.jpg
./waterfall.png
```
你可以通过添加名称的某些部分来过滤搜索结果:
```
$ find . -name "*jpg"
./cat.jpg
./otago.jpg
```
`find` 命令非常好的地方在于你可以通过 `-exec` 参数标志将它查询到的每一个文件放入循环中。例如,只对存放在你的 `example` 文件夹下的 PNG 图片进行体积压缩操作:
```
$ find . -name "*png" -exec convert {} -scale 33% tmp/{} \;
$ ls -m tmp
design_maori.png, waterfall.png
```
`-exec` 短语中,括号 `{}` 表示的是 `find` 正在处理的条目(换句话说,每一个被找到的以 PNG 结尾的文件)。`-exec` 短语必须使用分号结尾,但是 Bash 中常常也会使用分号。为了解决这个二义性问题,你的 `结束符` 可以使用反斜杠加上一个分号(`\;`),使得 `find` 命令可以知道这个结束符是用来标识自己结束使用的。
`find` 命令的操作非常棒,某些情况下它甚至可以表现得更棒。比如说,在一个新的进程中使用同一条命令查找 PNG 文件,你可能就会得到一些错误信息:
```
$ find . -name "*png" -exec convert {} -flip -flop tmp/{} \;
convert: unable to open image `tmp/./tmp/design_maori.png':
No such file or directory @ error/blob.c/OpenBlob/2643.
...
```
看起来 `find` 不只是定位了当前文件夹(`.`)下的所有 PNG 文件,还包括已经处理并且存储到了 `tmp` 下的文件。在一些情况下,你可能希望 `find` 查询当前文件夹下再加上其子文件夹下的所有文件。`find` 命令是一个功能强大的递归工具,特别体现在处理一些文件结构复杂的情境下(比如用来放置存满了音乐人音乐专辑的文件夹),同时你也可以使用 `-maxdepth` 选项来限制最大的递归深度。
只在当前文件夹下查找 PNG 文件(不包括子文件夹):
```
$ find . -maxdepth 1 -name "*png"
```
上一条命令的最大深度再加 1 就可以查找和处理当前文件夹及下一级子文件夹下面的文件:
```
$ find . -maxdepth 2 -name "*png"
```
`find` 命令默认是查找每一级文件夹。
### 循环的乐趣与收益
你使用的循环越多,你就可以越多的省下时间和力气,并且可以应对庞大的任务。虽然你只是一个用户,但是通过使用循环,可以使你的计算机完成困难的任务。
你可以并且应该就像使用其他的命令一样使用循环。在你需要重复处理单个或多个文件时,尽可能的使用这个命令。无论如何,这也算是一项需要被严肃对待的编程活动,因此如果你需要在一些文件上完成复杂的任务,你应该多花点时间在规划自己的工作流上面。如果你可以在一份文件上完成你的工作,接下来将操作包装进 `for` 循环里就相对简单了,这里面唯一的“编程”的需要只是理解变量是如何工作的并且进行充分的规划工作将已处理过的文件和未处理过的文件分开。经过一段时间的练习,你就可以从一名 Linux 用户升级成一位知道如何使用循环的 Linux 用户,所以开始让计算机为你工作吧!
---
via: https://opensource.com/article/19/6/how-write-loop-bash
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[chunibyo-wly](https://github.com/chunibyo-wly)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux 中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth/users/goncasousa/users/howtopamm/users/howtopamm/users/seth/users/wavesailor/users/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bash_command_line.png?itok=k4z94W2U "bash logo on green background"
[2]: http://nextcloud.com
[3]: http://pkgsrc.org
[4]: http://brew.sh
[5]: https://www.macports.org
[6]: mailto:seth@example.com
[7]: https://en.wikipedia.org/wiki/Tcsh
[8]: https://opensource.com/article/18/5/gnu-parallel

View File

@ -1,27 +1,28 @@
[#]: collector: (lujun9972)
[#]: translator: (caiichenr)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12087-1.html)
[#]: subject: (Why your Python code should be flat and sparse)
[#]: via: (https://opensource.com/article/19/12/zen-python-flat-sparse)
[#]: author: (Moshe Zadka https://opensource.com/users/moshez)
为何你的 Python 代码应是扁平与稀疏的
======
本文是 Python 之禅特别系列当中的一篇,此篇着眼于其中第五与第六条原则:扁平与稀疏。
![Digital creative of a browser on the internet][1]
[Python之禅][2] 得名如此,正是由于它那简明扼要的规则被设计出的意图在于让读者进行深入地思考,而绝不单是为编程提供一份易于遵守的指南
> 本文是 Python 之禅特别系列的第三篇,此篇着眼于其中第五与第六条原则:扁平与稀疏。
读后不去三思其意,断然难以体会 Python 之禅的妙处。倘若 Python 之禅仅仅罗列出一组清晰的法则,那法则之间的矛盾只能算作一种错误。然而用作引导读者去为最优方案沉思的工具,矛盾却是绝佳的。
![](https://img.linux.net.cn/data/attachment/album/202004/08/191645uiniiy56keig95gi.jpg)
### 扁平胜过嵌套 Flat is better than nested.
[Python 之禅][2] 之所以得名,正是由于它那简明扼要的规则被设计出的意图在于让读者进行深入地思考,而绝不单是为编程提供一份易于遵守的指南。
迫于对缩进的强硬要求Python 对“扁平化”的需求显然远超它者。其余编程语言为了缓解对缩进的需求通常会在嵌套结构里加入一种“欺诈”的手段。用以说明此点不妨一同看看JavaScript
读后不去三思其意,断然难以体会 Python 之禅的妙处。倘若 Python 之禅仅仅罗列出一组清晰的法则,那法则之间的矛盾是一种缺憾,然而作为引导读者沉思最优方案沉思的工具,矛盾却是绝佳的
JavaScript 是原生异步的,这意味着程序员用 JavaScript 写的代码会用到大量的回调函数。
### <ruby>扁平胜过嵌套<rt>Flat is better than nested</rt></ruby>
迫于对缩进的强硬要求Python 对“扁平化”的需求显然远超它者。其余编程语言为了缓解对缩进的需求,通常会在嵌套结构里加入一种“作弊”的手段。为了理解这一点,不妨一同来看看 JavaScript。
JavaScript 本质上是异步的,这意味着程序员用 JavaScript 写的代码会用到大量的回调函数。
```
a(function(resultsFromA) {
@ -33,8 +34,7 @@ a(function(resultsFromA) {
}
```
忽略这段代码的具体内容,只去观察这段代码的形状与缩进带来极右点的方式。这种独特的“箭头”图形在我们扫看代码时格外扎眼,这种写法也因此被视作不可取,甚至得到了“回调地狱”的绰号。不过,在 JavaScript 中,这种反映嵌套关系的缩进可以通过“欺诈”来回避。
忽略这段代码的具体内容,只去观察这段代码的形状与缩进带来一个最右边的点的方式。这种独特的“箭头”图形在我们扫看代码时格外扎眼,这种写法也因此被视作不可取,甚至得到了“回调地狱”的绰号。不过,在 JavaScript 中,这种反映嵌套关系的缩进可以通过“作弊”来回避。
```
a(function(resultsFromA) {
@ -46,10 +46,9 @@ c(resultsFromC,
}}}
```
Python 并没有提供这种欺诈手段每一级嵌套在代码中都如实的对应着一层缩进。因此Python 深层的嵌套关系在_视觉_上也一定是深层嵌套的。这使得“回调地狱”的问题对于 Python 而言要比在 JavaScript 中严重得多:嵌套的回调函数必定带来缩进,而绝无使用花括号来“欺诈”的可能。
这项挑战与 Python 之禅的指导原则相结合后,在我参与的库中催生出了一个优雅的解决方案。我们在 [Twisted][3] 框架里提出了 _deferred_ 抽象,日后 JavaScript 中流行的 _promise_ 抽象亦是受其启发而生。正是由于 Python 对整洁代码的坚守,方能推动 Python 开发者去发掘新的,强力的抽象。
Python 并没有提供这种作弊手段每一级嵌套在代码中都如实的对应着一层缩进。因此Python 深层的嵌套关系在*视觉*上也一定是深层嵌套的。这使得“回调地狱”的问题对于 Python 而言要比在 JavaScript 中严重得多:嵌套的回调函数必定带来缩进,而绝无使用花括号来“作弊”的可能。
这项挑战与 Python 之禅的指导原则相结合后,在我参与的库中催生出了一个优雅的解决方案。我们在 [Twisted][3] 框架里提出了 deferred 抽象,日后 JavaScript 中流行的 promise 抽象亦是受其启发而生。正是由于 Python 对整洁代码的坚守,方能推动 Python 开发者去发掘新的、强力的抽象。
```
future_value = future_result()
@ -58,11 +57,11 @@ future_value.addCallback(b)
future_value.addCallback(c)
```
(现代 JavaScript 程序员也许会觉得这段代码十分眼熟:Promises 着实受到了 Twisted 里 deferreds 抽象的深远影响。)
(现代 JavaScript 程序员也许会觉得这段代码十分眼熟:promise 着实受到了 Twisted 里 deferred 抽象的深远影响。)
### 稀疏胜过密集 Sparse is better than dense.
### <ruby>稀疏胜过密集<rt>Sparse is better than dense</rt></ruby>
最易降低代码密集程度的方法是引入嵌套。这种习惯也正是有关稀疏的原则要随着前一条提出的原因:在竭尽所能地降低代码密集性之后我们往往会遗留下_密集_的代码或数据结构。此处的密集,是指塞进过量信息的小段代码,它们会导致错误发生后的解析变得困难。
最易降低代码密集程度的方法是引入嵌套。这种习惯也正是有关稀疏的原则要随着前一条提出的原因:在竭尽所能地减少嵌套之后,我们往往会遗留下*密集的*代码或数据结构。此处的密集,是指塞进过量信息的小段代码,它们会导致错误发生后的解析变得困难。
这种密集性唯有通过创造性的思考方可改善此外别无捷径。Python 之禅并不为我们提供简单的解决方案,它只会指明改善代码的方向,而非提供“如何”去做的向导。
@ -75,7 +74,7 @@ via: https://opensource.com/article/19/12/zen-python-flat-sparse
作者:[Moshe Zadka][a]
选题:[lujun9972][b]
译者:[caiichenr](https://github.com/caiichenr)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,8 +1,8 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12106-1.html)
[#]: subject: (Make SSL certs easy with k3s)
[#]: via: (https://opensource.com/article/20/3/ssl-letsencrypt-k3s)
[#]: author: (Lee Carpenter https://opensource.com/users/carpie)
@ -12,31 +12,31 @@
> 如何在树莓派上使用 k3s 和 Let's Encrypt 来加密你的网站。
![Files in a folder][1]
![](https://img.linux.net.cn/data/attachment/album/202004/13/153032ncp8q55pjwdj8ppj.jpg)
在[上一篇文章][2]中,我们在 k3s 集群上部署了几个简单的网站。那些是未加密的网站。很好,它们可以工作,但是未加密的网站有点太过时了!如今,大多数网站都是加密的。在本文中,我们将安装 [cert-manager][3] 并将其用于在集群上以部署采用 TLS 加密的网站。这些网站不仅会被加密,而且还会使用有效的公共证书,这些证书会从 [Let's Encrypt][4] 自动获取和更新!让我们开始吧!
在[上一篇文章][2]中,我们在 k3s 集群上部署了几个简单的网站。那些是未加密的网站。不错,它们可以工作,但是未加密的网站有点太过时了!如今,大多数网站都是加密的。在本文中,我们将安装 [cert-manager][3] 并将其用于在集群上以部署采用 TLS 加密的网站。这些网站不仅会被加密,而且还会使用有效的公共证书,这些证书会从 [Let's Encrypt][4] 自动获取和更新!让我们开始吧!
### 所需材料
### 准备
要继续阅读本文,你将需要我们在上一篇文章中构建的 [k3s 树莓派集群][5]。另外,你需要拥有一个公用静态 IP 地址,并有一个可以为其创建 DNS 记录的域名。如果你有一个动态 DNS 提供程序为你提供域名,可能也行。但是,在本文中,我们使用静态 IP 和 [CloudFlare][6] 来手动创建 DNS 的 A 记录。
要继续阅读本文,你将需要我们在上一篇文章中构建的 [k3s 树莓派集群][5]。另外,你需要拥有一个公用静态 IP 地址,并有一个可以为其创建 DNS 记录的域名。如果你有一个动态 DNS 提供程序为你提供域名,可能也行。但是,在本文中,我们使用静态 IP 和 [CloudFlare][6] 来手动创建 DNS 的 A 记录。
我们在本文中创建配置文件时,如果你不想键入它们,则可以在[此处][7]进行下载。
### 我们为什么使用 cert-manager
Traefik预先捆绑了 k3s)实际上具有内置的 Let's Encrypt 支持因此你可能想知道为什么我们要安装第三方软件包来做同样的事情。在撰写本文时Traefik 中的 Let's Encrypt 支持检索证书并将其存储在文件中。cert-manager 会检索证书并将其存储在 Kubernetes 的 “<ruby>机密信息<rt>secrets</rt></ruby>” 中。我认为,“机密信息”可以简单地按名称引用,因此更易于使用。这就是我们在本文中使用 cert-manager 的主要原因。
Traefik在 k3s 预先捆绑了)实际上具有内置的 Let's Encrypt 支持因此你可能想知道为什么我们要安装第三方软件包来做同样的事情。在撰写本文时Traefik 中的 Let's Encrypt 支持检索证书并将其存储在文件中。cert-manager 会检索证书并将其存储在 Kubernetes 的 “<ruby>机密信息<rt>secret</rt></ruby>” 中。我认为,“机密信息”可以简单地按名称引用,因此更易于使用。这就是我们在本文中使用 cert-manager 的主要原因。
### 安装 cert-manager
通常,我们只是遵循 cert-manager 的[文档][8]在 Kubernetes 上进行安装。但是,由于我们使用的是 ARM 体系结构,因此我们需要进行一些更改,以便我们可以完成这个操作。
第一步是创建 cert-manager 命名空间。命名空间有助于将 cert-manager 的<ruby>吊舱<rt>Pod</rt></ruby>排除在我们的默认命名空间之外,因此当我们使用自己的“吊舱”执行 `kubectl get pods` 之类的操作时,我们不必看到它们。创建名称空间很简单:
第一步是创建 cert-manager 命名空间。命名空间有助于将 cert-manager 的 Pod 排除在我们的默认命名空间之外,因此当我们使用自己的 Pod 执行 `kubectl get pods` 之类的操作时,我们不必看到它们。创建名称空间很简单:
```
kubectl create namespace cert-manager
```
这份安装说明会告诉你下载 cert-manager 的 YAML 配置文件并将其一步全部应用到你的集群。我们需要将其分为两个步骤,以便为基于 ARM 的树莓派修改文件。我们将下载文件并一步一步进行转换:
安装说明会让你下载 cert-manager 的 YAML 配置文件并将其一步全部应用到你的集群。我们需要将其分为两个步骤,以便为基于 ARM 的树莓派修改文件。我们将下载文件并一步一步进行转换:
```
curl -sL \
@ -44,8 +44,7 @@ https://github.com/jetstack/cert-manager/releases/download/v0.11.0/cert-manager.
sed -r 's/(image:.*):(v.*)$/\1-arm:\2/g' > cert-manager-arm.yaml
```
这会下载配置文件,并将所有包含的 docker 镜像更新为 ARM 版本。来检查一下它做了什么:
这会下载配置文件,并将包含的所有 docker 镜像更新为 ARM 版本。来检查一下它做了什么:
```
$ grep image: cert-manager-arm.yaml
@ -54,23 +53,23 @@ $ grep image: cert-manager-arm.yaml
          image: "quay.io/jetstack/cert-manager-webhook-arm:v0.11.0"
```
如我们所见,三个镜像现在在镜像名称上添加了 `-arm`。现在我们有了正确的文件,我们只需将其应用于集群:
如我们所见,三个镜像现在在镜像名称上添加了 `-arm`。现在我们有了正确的文件,我们只需将其应用于集群:
```
kubectl apply -f cert-manager-arm.yaml
```
这将安装所有的 cert-manager。我们可以通过 `kubectl --namespace cert-manager get pods` 来检查安装何时完成,直到所有“吊舱”都处于 `Running` 状态。
这将安装 cert-manager 的全部。我们可以通过 `kubectl --namespace cert-manager get pods` 来检查安装何时完成,直到所有 Pod 都处于 `Running` 状态。
实际上就完成了 cert-manager 的安装!
这就完成了 cert-manager 的安装!
### Let's Encrypt 概述
Let's Encrypt 的好处是,它免费为我们提供了经过公共验证的 TLS 证书!这意味着我们可以拥有一个完全有效的、可供任何人访问的 TLS 加密网站,这些家庭或业余的爱好活动挣不到钱,也无需自己掏腰包购买 TLS 证书!以及,当通过 cert-manager 使用 Let's Encrypt 的证书时,获得证书的整个过程是自动化的,证书的续订也是自动的!
Let's Encrypt 的好处是,它免费为我们提供了经过公共验证的 TLS 证书!这意味着我们可以拥有一个完全有效的、可供任何人访问的 TLS 加密网站,这些家庭或业余的爱好活动挣不到钱,也无需自己掏腰包购买 TLS 证书!以及,当通过 cert-manager 使用 Let's Encrypt 的证书时,获得证书的整个过程是自动化的,证书的续订也是自动的!
但它是如何工作的?下面是该过程的简化说明。我们(或代表我们的 cert-manager向 Let's Encrypt 发出我们拥有的域名的证书请求。Let's Encrypt 通过使用 ACME DNS 或 HTTP 验证机制来验证我们是否拥有该域。如果验证成功,则 Let's Encrypt 将向我们提供证书,这些证书将由 cert-manager 安装在我们的网站(或其他 TLS 加密的终结点)中。在需要重复此过程之前,这些证书可以使用 90 天。但是cert-manager 会自动为我们更新证书。
但它是如何工作的?下面是该过程的简化说明。我们(或代表我们的 cert-manager向 Let's Encrypt 发出我们拥有的域名的证书请求。Let's Encrypt 通过使用 ACME DNS 或 HTTP 验证机制来验证我们是否拥有该域。如果验证成功,则 Let's Encrypt 将向我们提供证书,这些证书将由 cert-manager 安装在我们的网站(或其他 TLS 加密的点)中。在需要重复此过程之前,这些证书可以使用 90 天。但是cert-manager 会自动为我们更新证书。
在本文中,我们将使用 HTTP 验证方法,因为它更易于设置并且适用于大多数情况。以下是幕后发生的基本过程。cert-manager 向 Let's Encrypt 发出证书请求。作为回应Let's Encrypt 发出所有权验证的<ruby>质询<rt>challenges</rt></ruby>。这个质询是将一个 HTTP 资源放在请求证书的域名下的一个特定 URL 上。从理论上讲,如果我们可以将该资源放在该 URL 上,并且让 Let's Encrypt 可以远程获取它,那么我们实际上必须是该域的所有者。否则,要么我们无法将资源放置在正确的位置,要么我们无法操纵 DNS 以使 Let's Encrypt 访问它。在这种情况下cert-manager 会将资源放在正确的位置,并自动创建一个临时的 `Ingress` 记录,以将流量路由到正确的位置。如果 Let's Encrypt 可以读到该质询要求的资源并正确无误,它将把证书发回给 cert-manager。然后,cert-manager 将证书存储为“机密信息”,然后我们的网站(或其他任何网站)将使用这些证书通过 TLS 保护我们的流量。
在本文中,我们将使用 HTTP 验证方法因为它更易于设置并且适用于大多数情况。以下是幕后发生的基本过程。cert-manager 向 Let's Encrypt 发出证书请求。作为回应Let's Encrypt 发出所有权验证的<ruby>质询<rt>challenges</rt></ruby>。这个质询是将一个 HTTP 资源放在请求证书的域名下的一个特定 URL 上。从理论上讲,如果我们可以将该资源放在该 URL 上,并且让 Let's Encrypt 可以远程获取它,那么我们实际上必须是该域的所有者。否则,要么我们无法将资源放置在正确的位置,要么我们无法操纵 DNS 以使 Let's Encrypt 访问它。在这种情况下cert-manager 会将资源放在正确的位置,并自动创建一个临时的 `Ingress` 记录,以将流量路由到正确的位置。如果 Let's Encrypt 可以读到该质询要求的资源并正确无误,它将把证书发回给 cert-manager。cert-manager 将证书存储为“机密信息”,然后我们的网站(或其他任何网站)将使用这些证书通过 TLS 保护我们的流量。
### 为该质询设置网络
@ -78,11 +77,11 @@ Let's Encrypt 的好处是,它们免费为我们提供了经过公共验证的
为了使质询过程正常运行,我们需要一个我们要申请证书的域名,以将其路由到端口 80 上的 k3s 集群。为此,我们需要告诉世界上的 DNS 系统它的位置。因此,我们需要将域名映射到我们的公共 IP 地址。如果你不知道你的公共 IP 地址是什么,可以访问 [WhatsMyIP][9] 之类的地方,它会告诉你。接下来,我们需要输入 DNS 的 A 记录,该记录将我们的域名映射到我们的公共 IP 地址。为了使此功能可靠地工作,你需要一个静态的公共 IP 地址,或者你可以使用动态 DNS 提供商。一些动态 DNS 提供商会向你颁发一个域名,你可以按照以下说明使用它。我没有尝试过,所以不能肯定地说它适用于所有提供商。
对于本文,我们将假设有一个静态公共 IP 并使用 CloudFlare 来设置 DNS 的 A 记录。如果愿意,可以使用自己的 DNS 提供程序。重要的是你可以设置 A 记录。
对于本文,我们假设有一个静态公共 IP并使用 CloudFlare 来设置 DNS 的 A 记录。如果愿意,可以使用自己的 DNS 服务器。重要的是你可以设置 A 记录。
在本文的其余部分中,我将使用 [k3s.carpie.net][10] 作为示例域,因为这是我拥有的域。你显然会用自己拥有的任何域替换它。
在本文的其余部分中,我将使用 [k3s.carpie.net][10] 作为示例域,因为这是我拥有的域。你显然会用自己拥有的任何域替换它。
为示例起见,假设我们的公共 IP 地址是 198.51.100.42。我们转到我们的 DNS 提供商的 DNS 记录部分,并添加一个名为 [k3s.carpie.net][10] 的类型为 `A` 的记录CloudFlare 已经假定了域的部分,因此我们只需输入 `k3s`),然后输入 `198.51.100.42` 作为 IPv4 地址。
为示例起见,假设我们的公共 IP 地址是 198.51.100.42。我们转到我们的 DNS 提供商的 DNS 记录部分,并添加一个名为 [k3s.carpie.net][10] 的类型为 `A` 的记录CloudFlare 已经假定了域的部分,因此我们只需输入 `k3s`),然后输入 `198.51.100.42` 作为 IPv4 地址。
![][11]
@ -95,17 +94,17 @@ $ dig +short k3s.carpie.net
198.51.100.42
```
继续运行以上命令,直到可以返回 IP 才行。关于 CloudFlare 有个小注释ClouldFlare 提供了通过代理流量来隐藏你的实际 IP 的服务。在这种情况下,我们取回的是 CloudFlare 的 IP而不是我们的 IP。 但对于我们的目的,这应该可以正常工作。
继续运行以上命令,直到可以返回 IP 才行。关于 CloudFlare 有个小注释ClouldFlare 提供了通过代理流量来隐藏你的实际 IP 的服务。在这种情况下,我们取回的是 CloudFlare 的 IP而不是我们的 IP。但对于我们的目的这应该可以正常工作。
网络配置的最后一步是配置路由器,以将端口 80 和 443 上的传入流量路由到我们的 k3s 集群。可悲的是,路由器配置页面的差异很大,因此我无法确切地说明你的外观是什么样子。大多数时候,我们需要的管理页面位于“端口转发”或类似内容下。我甚至看到过它列在“游戏”之下(显然是端口转发主要用于的游戏)!让我们看看我的路由器的配置如何。
![][12]
如果你和我的设置一样,则转到 192.168.0.1 登录到路由器管理应用程序。对于此路由器,它位于 “ NAT / QoS” -> “端口转发”。在这里,我们将端口 80/TCP 协议设置为转发到 192.168.0.50(主节点 `kmaster` 的 IP的端口 80。我们还将端口 443 设置为也映射到 `kmaster`。从技术上讲,这对于质询来说并不是必需的,但是在本文的结尾,我们将部署一个启用 TLS 的网站,并且需要映射 443 来进行访问。因此,现在进行映射很方便。我们保存并应用更改,应该一切顺利!
如果你和我的环境一样,则转到 192.168.0.1 登录到路由器管理应用程序。对于此路由器,它位于 “ NAT/QoS” -> “端口转发”。在这里,我们将端口 80/TCP 协议设置为转发到 192.168.0.50(主节点 `kmaster` 的 IP的端口 80。我们还设置端口 443 也映射到 `kmaster`。从技术上讲,这对于质询来说并不是必需的,但是在本文的结尾,我们将部署一个启用 TLS 的网站,并且需要映射 443 来进行访问。因此,现在进行映射很方便。我们保存并应用更改,应该一切顺利!
### 配置 cert-manager 来使用 Let's Encrypt暂存环境
现在,我们需要配置 cert-manager 来通过 Let's Encrypt 颁发证书。Let's Encrypt 为我们提供了一个暂存(例如用于测试)环境,以便审视我们的配置。这样它更能容忍错误和请求的频率。如果我们对生产环境做了错误的操作,我们很快就发现自己被暂时禁止访问了!因此,我们将使用暂存环境手动测试请求。
现在,我们需要配置 cert-manager 来通过 Let's Encrypt 颁发证书。Let's Encrypt 为我们提供了一个暂存(例如用于测试)环境,以便审视我们的配置。这样它更能容忍错误和请求的频率。如果我们对生产环境做了错误的操作,我们很快就发现自己被暂时禁止访问了!因此,我们将使用暂存环境手动测试请求。
创建一个文件 `letsencrypt-issuer-staging.yaml`,内容如下:
@ -132,7 +131,7 @@ spec:
请确保将电子邮件地址更新为你的地址。如果出现问题或我们弄坏了一些东西,这就是 Let's Encrypt 与我们联系的方式!
现在,我们使用以下方法创建发行者:
现在,我们使用以下方法创建<ruby>发行者<rt>issuer</rt></ruby>
```
kubectl apply -f letsencrypt-issuer-staging.yaml
@ -150,7 +149,6 @@ kubectl get clusterissuers
创建一个包含以下内容的证书请求文件 `le-test-certificate.yaml`
```
apiVersion: cert-manager.io/v1alpha2
kind: Certificate
@ -167,7 +165,7 @@ spec:
- k3s.carpie.net
```
该记录仅表示我们要使用名为 `letsencrypt-staging`(我们在上一步中创建的)的 `ClusterIssuer` 来请求域 [k3s.carpie.net][10] 的证书,并在 Kubernetes 的机密信息中名为 `k3s-carpie-net-tls` 文件中存储该证书。
该记录仅表示我们要使用名为 `letsencrypt-staging`(我们在上一步中创建的)的 `ClusterIssuer` 来请求域 [k3s.carpie.net][10] 的证书,并在 Kubernetes 的机密信息中名为 `k3s-carpie-net-tls` 文件中存储该证书。
像平常一样应用它:
@ -188,11 +186,11 @@ NAME                    READY   SECRET                  AGE
k3s-carpie-net          True    k3s-carpie-net-tls      30s
```
我们走在幸福之路!(这里的关键是`READY` 是 `True`)。
我们走在幸福之路!(这里的关键是 `READY` 应该`True`)。
### 解决证书颁发问题
上面是幸福的道路。如果 `READY``False`,我们可以等等它,然后再次花点时间检查状态。如果它一直是 `False`,那么我们就有一个需要解决的问题。此时,我们可以遍历 Kubernetes 资源链,直到找到一条告诉我们问题的状态消息。
上面是幸福的道路。如果 `READY``False`,我们可以等等它,然后再次花点时间检查状态。如果它一直是 `False`,那么我们就有需要解决的问题。此时,我们可以遍历 Kubernetes 资源链,直到找到一条告诉我们问题的状态消息。
假设我们执行了上面的请求,而 `READY``False`。我们可以从以下方面开始故障排除:
@ -200,7 +198,7 @@ k3s-carpie-net          True    k3s-carpie-net-tls      30s
kubectl describe certificates k3s-carpie-net
```
这将返回很多信息。通常,有用的内容位于 `Events:` 部分,该部分通常位于底部。假设最后一个事件是 `Created new CertificateRequest resource "k3s-carpie-net-1256631848`。然后我们<ruby>描述<rt> describe</rt></ruby>该请求:
这将返回很多信息。通常,有用的内容位于 `Events:` 部分,该部分通常位于底部。假设最后一个事件是 `Created new CertificateRequest resource "k3s-carpie-net-1256631848`。然后我们<ruby>描述<rt>describe</rt></ruby>该请求:
```
kubectl describe certificaterequest k3s-carpie-net-1256631848
@ -211,7 +209,7 @@ kubectl describe certificaterequest k3s-carpie-net-1256631848
那么,我们可以描述该顺序:
```
`kubectl describe orders default/k3s-carpie-net-1256631848-2342473830`
kubectl describe orders default/k3s-carpie-net-1256631848-2342473830
```
假设有一个事件,事件为 `Created Challenge resource "k3s-carpie-net-1256631848-2342473830-1892150396" for domain "k3s.carpie.net"`。让我们描述一下该质询:
@ -220,7 +218,7 @@ kubectl describe certificaterequest k3s-carpie-net-1256631848
kubectl describe challenges k3s-carpie-net-1256631848-2342473830-1892150396
```
从这里返回的最后一个事件是 `Presented challenge using http-01 challenge mechanism`。看起来没问题,因此我们浏览一下描述的输出,并看到一条消息 `Waiting for http-01 challenge propagation: failed to perform self check GET request no such host`。终于!我们发现了问题!在这种情况下,`no such host` 意味着 DNS 查找失败,因此我们需要返回并手动检查我们的 DNS 设置,正确解析域的 DNS并进行所需的任何更改。
从这里返回的最后一个事件是 `Presented challenge using http-01 challenge mechanism`。看起来没问题,因此我们浏览一下描述的输出,并看到一条消息 `Waiting for http-01 challenge propagation: failed to perform self check GET request ... no such host`。终于!我们发现了问题!在这种情况下,`no such host` 意味着 DNS 查找失败,因此我们需要返回并手动检查我们的 DNS 设置,正确解析域的 DNS并进行所需的任何更改。
### 清理我们的测试证书
@ -231,9 +229,9 @@ kubectl delete certificates k3s-carpie-net
kubectl delete secrets k3s-carpie-net-tls
```
### 配置 cert-manager 以使用 Let's Encrypt生产环境
### 配置 cert-manager 以使用 Let's Encrypt生产环境
现在我们已经有了测试证书,是时候移动到生产环境了。就像我们在 Let's Encrypt 暂存环境中配置 cert-manager 一样,我们现在也需要对生产环境进行同样的操作。创建一个名为 `letsencrypt-issuer-production.yaml` 的文件(如果需要,可以复制和修改暂存环境的文件),其内容如下:
现在我们已经有了测试证书,是时候移动到生产环境了。就像我们在 Let's Encrypt 暂存环境中配置 cert-manager 一样,我们现在也需要对生产环境进行同样的操作。创建一个名为 `letsencrypt-issuer-production.yaml` 的文件(如果需要,可以复制和修改暂存环境的文件),其内容如下:
```
apiVersion: cert-manager.io/v1alpha2
@ -266,7 +264,7 @@ kubectl apply -f letsencrypt-issuer-production.yaml
### 申请我们网站的证书
重要的是要注意,我们到目前为止完成的所有步骤都是一次性设置的!对于将来的任何其他申请,我们可以从这个说明开始!
重要的是要注意,我们到目前为止完成的所有步骤都只需要进行一次!而对于将来的任何其他申请,我们可以从这个说明开始!
让我们部署在[上一篇文章][13]中部署的同样站点。(如果仍然可用,则可以修改 YAML 文件。如果没有,则可能需要重新创建并重新部署它)。
@ -296,7 +294,7 @@ spec:
secretName: k3s-carpie-net-tls
```
请注意,上面仅显示了 `mysite.yaml``Ingress` 部分。所做的更改是添加了注 `cert-manager.io/cluster-issuer: letsencrypt-prod`。这告诉 traefik 创建证书时使用哪个发行者。 唯一的其他增加是 `tls:` 块。这告诉 traefik 我们希望在主机 [k3s.carpie.net][10] 上具有 TLS 功能,并且我们希望 TLS 证书文件存储在机密信息 `k3s-carpie-net-tls` 中。
请注意,上面仅显示了 `mysite.yaml``Ingress` 部分。所做的更改是添加了注 `cert-manager.io/cluster-issuer: letsencrypt-prod`。这告诉 traefik 创建证书时使用哪个发行者。 其他唯一增加`tls:` 块。这告诉 traefik 我们希望在主机 [k3s.carpie.net][10] 上具有 TLS 功能,并且我们希望 TLS 证书文件存储在机密信息 `k3s-carpie-net-tls` 中。
请记住我们没有创建这些证书好吧我们创建了名称相似的测试证书但我们删除了这些证书。Traefik 将读取这些配置并继续寻找机密信息。当找不到时,它会看到注释说我们想使用 `letsencrypt-prod` 发行者来获取它。由此,它将提出请求并为我们安装证书到机密信息之中!
@ -311,17 +309,17 @@ via: https://opensource.com/article/20/3/ssl-letsencrypt-k3s
作者:[Lee Carpenter][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/carpie
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/files_documents_paper_folder.png?itok=eIJWac15 (Files in a folder)
[2]: https://carpie.net/articles/ingressing-with-k3s
[2]: https://linux.cn/article-12081-1.html
[3]: https://cert-manager.io/
[4]: https://letsencrypt.org/
[5]: https://opensource.com/article/20/3/kubernetes-raspberry-pi-k3s
[5]: https://linux.cn/article-12049-1.html
[6]: https://cloudflare.com/
[7]: https://gitlab.com/carpie/k3s_using_certmanager/-/archive/master/k3s_using_certmanager-master.zip
[8]: https://cert-manager.io/docs/installation/kubernetes/
@ -329,5 +327,5 @@ via: https://opensource.com/article/20/3/ssl-letsencrypt-k3s
[10]: http://k3s.carpie.net
[11]: https://opensource.com/sites/default/files/uploads/ep011_dns_example.png
[12]: https://opensource.com/sites/default/files/uploads/ep011_router.png
[13]: https://carpie.net/articles/ingressing-with-k3s#deploying-a-simple-website
[13]:https://linux.cn/article-12081-1.html
[14]: http://cert-manager.io/cluster-issuer

View File

@ -0,0 +1,134 @@
[#]: collector: "lujun9972"
[#]: translator: "tinyeyeser"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-12103-1.html"
[#]: subject: "Control the firewall at the command line"
[#]: via: "https://fedoramagazine.org/control-the-firewall-at-the-command-line/"
[#]: author: "Paul W. Frields https://fedoramagazine.org/author/pfrields/"
在 Fedora 命令行下玩转防火墙
======
![](https://img.linux.net.cn/data/attachment/album/202004/12/123040ghxuicphyhsoppch.jpg)
网络防火墙,顾名思义:为了阻止不需要的网络连接而设置的防护性屏障。在与外界建立连接或是提供网络服务时常常会用到。例如,在学校或是咖啡厅里使用笔记本电脑时,你一定不想某个陌生人窥探你的电脑。
每个 Fedora 系统都内置了一款防火墙。这是 Linux 内核网络功能的一部分。本文介绍如何通过 `firewall-cmd` 命令修改防火墙的配置。
### 网络基础
本文并不教授计算机网络的[所有知识][2],但还是会简单介绍一些网络基础。
网络中的所有计算机都有一个 *IP 地址*,可以把它想象成一个邮箱地址,有了邮箱地址,邮件才知道发往何处。每台计算机还会拥有一组*端口*,端口号范围从 0 到 65535。同样的你可以把这些端口想象成用来连接邮箱地址的连接点。
通常情况下,端口会是一个标准端口号或是根据应用程序的应答要求选定的一个端口范围。例如,一台 Web 服务器通常会保留 80 端口用于 HTTP 通信443 端口用于 HTTPS。小于 1024 的端口主要用于系统或常见用途1024-49151 端口是已经注册的49152 及以上端口多为临时使用(只限短时间使用)。
互联网传输中最常见的两个协议,[TCP][4] 和 [UDP][5]。当要传输的数据很重要,不能有丢包时,就使用 TCP 协议如果数据包没有按顺序到达还需要重组为正确的顺序。UDP 协议则更多用于对时间敏感的服务,为了保证时效性,有时允许丢失部分数据。
系统中运行的应用,例如 Web 服务器,会保留一些端口(例如上文提到的 80 和 443。在网络传输过程中主机会为传输的两端建立一个链接一端是源地址和源端口另一端是目的地址和目的端口。
网络防火墙就是基于地址、端口及其他标准的一组规则集,来对网络数据的传输进行屏蔽或阻断的。通过 `firewall-cmd` 命令,我们就可以查看或修改防火墙的工作配置。
### 防火墙域zone
为了验证防火墙是否开启,使用 `firewall-cmd` 命令,输入时要加上 [sudo](https://fedoramagazine.org/howto-use-sudo/)。(通常,在运行了 [PolicyKit](https://en.wikipedia.org/wiki/Polkit) 的环境中,你也可以不加 `sudo`
```
$ sudo firewall-cmd --state
running
```
firewalld 服务支持任意数量的域。每个域都可以拥有独立的配置和防护规则。一台 Fedora 工作站的外部接口(例如 WIFI 或有线网卡)其默认域为 `FedoraWorkstation`
要看有哪些域是激活状态,可以使用 `-get-active-zones` 选项。在本示例中,有两个网卡,有线以太网卡 `wlp2s0` 和虚拟libvirt桥接网卡 `virbr0`
```
$ sudo firewall-cmd --get-active-zones
FedoraWorkstation
interfaces: wlp2s0
libvirt
interfaces: virbr0
```
如果想看看默认域是什么,或是直接查询所有域:
```
$ sudo firewall-cmd --get-default-zone
FedoraWorkstation
$ sudo firewall-cmd --get-zones
FedoraServer FedoraWorkstation block dmz drop external home internal libvirt public trusted work
```
查询默认域中防火墙放行了哪些系统,使用 `-list-services` 选项。下例给出了一个定制系统的查询结果,你可以看到与常见的结果有些不同。
```
$ sudo firewall-cmd --list-services
dhcpv6-client mdns samba-client ssh
```
该系统对外开启了四个服务。每个服务都对应一个常见端口。例如 `ssh` 服务对应 22 端口。
如果要查看当前域中防火墙还开启了哪些端口,可以使用 `--list-ports` 选项。当然,你也可以随时对其他域进行查询:
```
$ sudo firewall-cmd --list-ports --zone=FedoraWorkstation
1025-65535/udp 1025-65535/tcp
```
结果表明,从 1025 到 65535 端口(包含 UDP 和 TCP默认都是开启的。
### 修改域、端口及服务
以上的配置都是预先设计好的防火墙策略。是为了确保新手用户安装的应用都能够正常访问网络。如果你确定自己心里有数,想要一个保护性更强的策略,可以将接口放入 `FedoraServer` 域,明确禁止所有端口的访问。(**警告**:如果你的服务器之前是联网状态,这么做可能会导致连接中断,那你就得到机房里去修改更多的配置项!)
```
$ sudo firewall-cmd --change-interface=<ifname> --zone=FedoraServer
success
```
**本文并不讨论如何制定防火墙策略Fedora 社区里已经有很多讨论了。你大可以按照自身需要来修改配置。**
如果你想要开放某个服务的常见端口,可以将该服务加入默认域(或使用 `--zone` 指定一个不同的域)。还可以一次性将其加入多个域。下例开放了 HTTP 和 HTTPS 的常见端口 80、443
```
$ sudo firewall-cmd --add-service=http --add-service=https
success
```
并非所有的服务都有默认端口,不过大部分都是有的。使用 `-get-services` 选项可以查看完整列表。
如果你想指定某个特定端口号,可以直接用数字和协议进行配置。(多数情况下,`-add-service` 和 `-add-port` 这两个选项是合在一起使用的)下例开启的是 UDP 协议的网络启动服务:
```
$ sudo firewall-cmd --add-port=67/udp
success
```
**重要**:如果想要在系统重启或是 firewalld 服务重启后,配置仍然生效,**必须**在命令中加上 `-permanent` 选项。本文中的例子只是临时修改了配置,下次遇到系统重启或是 firewalld 服务重启,这些配置就失效了。
以上只是 `firewall-cmd` 和 firewalld 服务诸多功能中的一小部分。firewalld 项目的[主页][8]还有更多信息值得你去探索和尝试。
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/control-the-firewall-at-the-command-line/
作者:[Paul W. Frields][a]
选题:[lujun9972][b]
译者:[tinyeyeser](https://github.com/tinyeyeser)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://fedoramagazine.org/author/pfrields/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2020/03/firewall-cmd-816x345.jpg
[2]: https://en.wikipedia.org/wiki/Portal:Internet
[3]: https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers
[4]: https://en.wikipedia.org/wiki/Transmission_Control_Protocol
[5]: https://en.wikipedia.org/wiki/User_Datagram_Protocol
[6]: https://fedoramagazine.org/howto-use-sudo/
[7]: https://en.wikipedia.org/wiki/Polkit
[8]: https://firewalld.org/
[9]: https://unsplash.com/@jakobustrop?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[10]: https://unsplash.com/s/photos/brick-wall?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText

View File

@ -0,0 +1,182 @@
[#]: collector: (lujun9972)
[#]: translator: (messon007)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12093-1.html)
[#]: subject: (The Keyring Concept in Ubuntu: What is It and How to Use it?)
[#]: via: (https://itsfoss.com/ubuntu-keyring/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
解读 Ubuntu 里的密钥环概念
======
![][3]
如果你用过 Ubuntu 或者其他的 Linux 发行版里的[自动登录功能][1], 你可能遇到过这种弹出消息:
> 请输入密码以解锁你的登录密钥环
>
> 登录密钥环在你登录系统时未解锁。
![Enter Password To Unlock Your Login Keyring Ubuntu][2]
如果你一直点击取消,它会不断弹出几次才会消失。你可能想知道,为什么你会一直看到这个密钥环信息呢?
让我来告诉你吧。它其实不是错误,而是一个安全特性。
奇怪吗?下面就让我来解释下 Linux 里的密钥环概念。
### Linux 里的密钥环是什么。为什么需要它?
在现实生活中你为什么要用钥匙环(也叫[钥匙链][4])?你用它把一把或多把钥匙串到一起, 以便于携带和查找。
Linux 里也是类似的。密钥环特性使你的系统可以将各种密码放在一起,并将其保存在一个地方。
大多数 Linux 桌面环境,如 GNOME、KDE、Xfce 等采用 [GNOME 密钥环][5]来提供这个功能。
该密钥环保存了 ssh 密钥、GPG 密钥以及使用此功能的应用程序(例如 Chromium 浏览器)的密钥。默认情况下,**“密钥环”通过主密码来保护**,该密码通常是帐户的登录密码。
系统上的每个用户都有自己的密钥环,(通常)密码与用户帐户本身的密码相同。当你使用密码登录系统时,你的密匙环将使用你帐户的密码自动解锁。
当你[启用 Ubuntu 中的自动登录功能时][1]时,就有问题了。这意味着你无需输入密码即可登录系统。在这种情况下,你的密钥环不会自动解锁。
#### 密钥环是一个安全特性
记得我说过密钥环是一个安全特性吗?现在想象一下你在 Linux 电脑上开启了自动登录功能。有权访问你电脑的任何人无需密码就能进入你的系统。但是你可能不会在意,因为你只是用它来访问互联网。
但是,如果你在 Ubuntu 中使用 Chromium 或 [Google Chrome][6] 之类的浏览器,并使用它来保存各种网站的登录密码,那么你将遇到麻烦。任何人都可以使用浏览器并利用你在浏览器中保存的密码登录网站。这不很危险吗?
这就是为什么当你使用 Chrome 时,它将反复地提示你先解锁密钥环。这确保了只有知道密钥环密码(即账户密码)的人才能使用在浏览器中保存的密码来登录它们相关的网站。
如果你反复取消解锁密钥环的提示,它最终将消失,并允许你使用浏览器。但是,保存的密码将不会被解锁,你在 Chromium/Chome 浏览器上将会看到“同步暂停”的提示。
![Sync paused in Google Chrome][7]
#### 如果密钥环一直存在,为什么你从来没有见过它呢?
如果你在你的 Linux 系统上从没见过它的话,这个问题就很有道理。
如果你从没有用过自动登录功能(或者修改你的账户密码),你可能都没有意识到这个特性的存在。
这是因为当你通过你的密码登录系统时,你的密钥环被你的账户密码自动解锁了。
Ubuntu和其他发行版在执行普通的管理任务如修改用户、安装新软件等需要输入密码无论你是否是自动登录的。但是对于日常任务像使用浏览器它不需要输入密码因为密钥环已经被解锁了。
当你切换到自动登录时,你不再需要输入登录密码。这意味着密钥环没有被自动解锁,因此当你使用利用了密钥环特性的浏览器时,它将提示你来解锁密钥环。
#### 你可以轻松地管理密钥环和密码
这个密钥环放在哪里?它的核心是一个守护任务(一个后台自动运行的程序)。
别担心。你不必通过终端来操作守护任务。大多数桌面环境都自带一个可以和这个守护进程进行交互的图形化应用程序。KDE 上有 KDE 钱包GNOME 和其他桌面上叫做“密码和密钥”(之前叫 [Seahorse][8])。
![Password And Keys App in Ubuntu][9]
你可以用这个 GUI 程序来查看哪些应用程序在用密钥环来管理/保护密码。
你可以看到,我的系统有自动创建的登录密钥环。也有一个存储 GPG 和 SSH 密钥的密钥环。那个[证书][10]用来保存证书机构颁发的证书(如 HTTPS 证书)。
![Password and Keys application in Ubuntu][11]
你也可以使用这个应用程序来手动保存网站的密码。例如我创建了一个新的叫做“Test”的被密码保护的密钥环并手动存储了一个密码。
这比在一个文本文件中保存一批密码要好一些。至少在这种情况下,你的密码只有在你通过密码解锁了密钥环时才允许被看到。
![Saving New Password Seahorse][12]
这里有一个潜在的问题,如果你格式化你的系统,手动保存的密码必然会丢失。通常,你会备份你的个人文件,但并不是所有的用户特定数据,如密钥环文件。
有一种办法能解决它。密钥环数据通常保存在 `~/.local/share/keyrings` 目录。在这里你可以看到所有的密钥环,但是你不能直接看到它们的内容。如果你移除密钥环的密码(我会在这篇文章的后面描述操作步骤),你可以像一个普通的文本文件一样读取密钥环的内容。你可以将这个解锁后的密钥环文件完整地复制下来,并在其他的 Linux 机器上运行“密码和密钥”应用程序导入到其中。
总结一下目前为止所学的内容:
* 大多数 Linux 系统缺省已经安装并激活了密钥环特性
* 系统上的每个用户都拥有他自己的密钥环
* 密钥环通常是用账户密码锁定的(保护)
* 当你通过密码登录时密钥环会被自动解锁
* 对于自动登录,密钥环不会自动解锁,因此当你试图使用依赖密钥环的应用程序时会被提示先解锁它
* 并不是所有的浏览器或应用程序利用了密钥环特性
* Linux 上)安装一个 GUI 程序可以和密钥环交互
* 你可以用密钥环来手动存储加密格式的密码
* 你可以自己修改密钥环密码
* 你可以通过导出(需要先解锁密钥环)并导入到其他计算机上的方式来获取手工保存的密码。
### 修改密钥环密码
假设你修改了你的账户密码。当你登录时,你的系统试图通过新的登录密码来自动解锁密钥环。但是密钥环还在使用老的登录密码。
这种情况下,你可以修改密钥环密码为新的登录密码,这样密码环才能在你登录系统时自动解锁。
从菜单中打开“密码和密钥”应用程序:
![Look for Password and Keys app in the menu][9]
在“Login”密钥环上右击并点击“修改密码”
![Change Keyring Password][13]
#### 如果你不记得老的登录密码怎么办?
你可能知道在 [Ubuntu 上重置忘记的密码很容易][14]。但是密钥环在这种场景下还是有问题。你修改了账户密码,但是你不记得仍然被密钥环使用的老的账户密码。
你不能修改它因为你不知道老的密码。怎么办?
这种情况下,你将不得不移除整个密钥环。你可以通过“密码和密钥”应用程序来操作:
![Delete Keyring Ubuntu][15]
它会提示你进行确认:
![Delete Keyring][16]
另外,你也可以手动删除 `~/.local/share/keyrings` 目录下的密钥环文件。
老的密钥环文件被移除后,你再打开 Chrome/Chromium 时,它会提示你创建一个新的密钥环。
![New Keyring Password][17]
你可以用新的登录密码,密钥环就会被自动解锁了。
### 禁用密钥环密码
在你想用自动登录但又不想手动解锁密钥环时,你可以把禁用密钥环密码作为一个规避方法。记住你正在禁用一个安全特性,因此请三思。
操作步骤和修改密钥环相似。打开“密码和密钥”应用程序,然后修改密钥环密码。
技巧在于当它提示修改密码时,不要输入新密码,而是点击“继续”按钮。这将移除密钥环的密码。
![Disable Keyring password by not setting any password at all][18]
这种方法,密钥环没有密码保护,并将一直处于解锁状态。
--------------------------------------------------------------------------------
via: https://itsfoss.com/ubuntu-keyring/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[messon007](https://github.com/messon007)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/ubuntu-automatic-logon/
[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/enter-password-to-unlock-your-login-keyring-ubuntu.jpg?ssl=1
[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/keyring-concept-ubuntu-1.png?ssl=1
[4]: https://en.wikipedia.org/wiki/Keychain
[5]: https://wiki.archlinux.org/index.php/GNOME/Keyring
[6]: https://itsfoss.com/install-chrome-ubuntu/
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/sync-paused-keyring-ubuntu.jpg?ssl=1
[8]: https://wiki.debian.org/Seahorse
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/password-and-keys-app-ubuntu.jpg?ssl=1
[10]: https://help.ubuntu.com/lts/serverguide/certificates-and-security.html
[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/keyring-pasword-ubuntu.png?ssl=1
[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/saving-new-password-seahorse.png?ssl=1
[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/change-keyring-password.png?ssl=1
[14]: https://itsfoss.com/how-to-hack-ubuntu-password/
[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/delete-keyring-ubuntu.jpg?ssl=1
[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/delete-keyring.jpg?ssl=1
[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/new-keyring-password.jpg?ssl=1
[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/disable-keyring-password-ubuntu.png?ssl=1

View File

@ -0,0 +1,115 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12099-1.html)
[#]: subject: (Using data from spreadsheets in Fedora with Python)
[#]: via: (https://fedoramagazine.org/using-data-from-spreadsheets-in-fedora-with-python/)
[#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/)
使用 Python 读取电子表格中的数据
======
![][1]
[Python][2] 是最流行、功能最强大的编程语言之一。由于它是自由开源的,因此每个人都可以使用。大多数 Fedora 系统都已安装了该语言。Python 可用于多种任务其中包括处理逗号分隔值CSV数据。CSV文件一开始往往是以表格或电子表格的形式出现。本文介绍了如何在 Python 3 中处理 CSV 数据。
CSV 数据正如其名。CSV 文件按行放置数据,数值之间用逗号分隔。每行由相同的*字段*定义。简短的 CSV 文件通常易于阅读和理解。但是较长的数据文件或具有更多字段的数据文件可能很难用肉眼解析,因此在这种情况下计算机做得更好。
这是一个简单的示例,其中的字段是 `Name`、`Email` 和 `Country`。在此例中CSV 数据将字段定义作为第一行,尽管并非总是如此。
```
Name,Email,Country
John Q. Smith,jqsmith@example.com,USA
Petr Novak,pnovak@example.com,CZ
Bernard Jones,bjones@example.com,UK
```
### 从电子表格读取 CSV
Python 包含了一个 `csv` 模块,它可读取和写入 CSV 数据。大多数电子表格应用,无论是原生(例如 Excel 或 Numbers还是基于 Web 的(例如 Google Sheet都可以导出 CSV 数据。实际上,许多其他可发布表格报告的服务也可以导出为 CSV例如PayPal
Python `csv` 模块有一个名为 `DictReader` 的内置读取器方法,它可以将每个数据行作为有序字典 `OrderedDict` 处理。它需要一个文件对象访问 CSV 数据。因此,如果上面的文件在当前目录中为 `example.csv`,那么以下代码段是获取此数据的一种方法:
```
f = open('example.csv', 'r')
from csv import DictReader
d = DictReader(f)
data = []
for row in d:
data.append(row)
```
现在,内存中的 `data` 对象是 `OrderedDict` 对象的列表:
```
[OrderedDict([('Name', 'John Q. Smith'),
('Email', 'jqsmith@example.com'),
('Country', 'USA')]),
OrderedDict([('Name', 'Petr Novak'),
('Email', 'pnovak@example.com'),
('Country', 'CZ')]),
OrderedDict([('Name', 'Bernard Jones'),
('Email', 'bjones@example.com'),
('Country', 'UK')])]
```
引用这些对象很容易:
```
>>> print(data[0]['Country'])
USA
>>> print(data[2]['Email'])
bjones@example.com
```
顺便说一句,如果你需要处理没有字段名标题行的 CSV 文件,那么 `DictReader` 类可以让你定义它们。在上面的示例中,添加 `fieldnames` 参数并传递一系列名称:
```
d = DictReader(f, fieldnames=['Name', 'Email', 'Country'])
```
### 真实例子
我最近想从一长串人员名单中随机选择一个中奖者。我从电子表格中提取的 CSV 数据是一个简单的名字和邮件地址列表。
幸运的是Python 有一个有用的 `random` 模块,可以很好地生成随机值。该模块 `Random` 类中的 `randrange` 函数正是我需要的。你可以给它一个常规的数字范围(例如整数),以及它们之间的步长值。然后,该函数会生成一个随机结果,这意味着我可以在数据的总行数范围内获得一个随机整数(或者说是行号)。
这个小程序运行良好:
```
from csv import DictReader
from random import Random
d = DictReader(open('mydata.csv'))
data = []
for row in d:
data.append(row)
r = Random()
winner = data[r.randrange(0, len(data), 1)]
print('The winner is:', winner['Name'])
print('Email address:', winner['Email'])
```
显然这个例子非常简单。电子表格本身包含了复杂的分析数据的方法。但是如果你想在电子表格应用之外做某事Python 或许是一种技巧!
题图由 [Isaac Smith][3] 拍摄,发表于 [Unsplash][4]。
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/using-data-from-spreadsheets-in-fedora-with-python/
作者:[Paul W. Frields][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://fedoramagazine.org/author/pfrields/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2020/03/spreadsheets-python-816x345.jpg
[2]: https://python.org
[3]: https://unsplash.com/@isaacmsmith?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[4]: https://unsplash.com/s/photos/spreadsheets?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText

View File

@ -1,16 +1,16 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12086-1.html)
[#]: subject: (How to Find Which Graphics Card do You Have in Linux?)
[#]: via: (https://itsfoss.com/check-graphics-card-linux/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
如何找出 Linux 中的显卡?
如何知道你的 Linux 用的哪种显卡?
======
无论是 [Nvidia][1] 还是 [Radeon][2] 或者 Intel它们都可能在 Linux 中有问题。当你要对图形问题进行故障排除时,首先要了解系统中装有哪种显卡。
无论是 [Nvidia][1] 还是 [Radeon][2] 或者 Intel它们的显卡都可能在 Linux 中有问题。当你要对图形问题进行故障排除时,首先要了解系统中装有哪种显卡。
Linux 有几个命令可以检查硬件信息。你可以使用它们来检查你有哪些显卡(也称为视频卡)。让我向你展示一些命令来获取 Linux 中的 GPU 信息。
@ -20,9 +20,9 @@ Linux 有几个命令可以检查硬件信息。你可以使用它们来检查
#### 使用 lspci 命令查找显卡
lspci 命令显示通过 [PCI][4](外设组件互连)总线连接的设备的信息。基本上,此命令提供有关系统所有外设的详细信息,从键盘和鼠标到声卡、网卡和显卡。
`lspci` 命令显示通过 [PCI][4]<ruby>外设组件互连<rt>Peripheral Component Interconnect</rt></ruby>)总线连接的设备的信息。基本上,此命令提供有关系统从键盘和鼠标到声卡、网卡和显卡的所有外设的详细信息
默认情况下,你会有大量的此类外设列表。这就是为什么你需要用 grep 命令过滤显卡的原因:
默认情况下,你会有大量的此类外设列表。这就是为什么你需要用 `grep` 命令过滤显卡的原因:
```
lspci | grep VGA
@ -31,7 +31,7 @@ lspci | grep VGA
这应该会显示一行有关你显卡的信息:
```
[email protected]:~$ lspci | grep VGA
abhishek@itsfoss:~$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 620 (rev 02)
```
@ -39,7 +39,7 @@ lspci | grep VGA
#### 在 Linux 中使用 lshw 命令获取显卡详细信息
lspci 命令足以查看你的显卡,但是并不能告诉你很多信息。你可以使用 lshw 命令获取有关它的更多信息。
`lspci` 命令足以查看你的显卡,但是并不能告诉你很多信息。你可以使用 `lshw` 命令获取有关它的更多信息。
此命令要求你有 root 用户权限。你需要以这种方式查找视频卡(显卡)信息:
@ -50,7 +50,7 @@ sudo lshw -C video
正如你在下面的输出中看到的那样,此命令提供了有关显卡的更多信息,例如时钟频率、位宽、驱动等。
```
[email protected]:~$ sudo lshw -C video
abhishek@itsfoss:~$ sudo lshw -C video
[sudo] password for abhishek:
*-display
description: VGA compatible controller
@ -66,7 +66,7 @@ sudo lshw -C video
resources: irq:139 memory:db000000-dbffffff memory:90000000-9fffffff ioport:f000(size=64) memory:c0000-dffff
```
#### 额外的技巧:以图形方式检查显卡详细信息
#### 附赠技巧:以图形方式检查显卡详细信息
并非必须使用命令行在 Linux 中查找显卡详细信息。大多数 Linux 发行版(或者应该说是桌面环境)在设置中提供了必要的详细信息。
@ -85,7 +85,7 @@ via: https://itsfoss.com/check-graphics-card-linux/
作者:[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

@ -0,0 +1,93 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12096-1.html)
[#]: subject: (IEEE Standards Association Launches an Open Source Collaboration Platform)
[#]: via: (https://itsfoss.com/ieee-open-source-collaboration-platform/)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
IEEE 标准协会推出开源协作平台
======
> IEEE 标准协会宣布了一个基于 GitLab 的开源协作平台。
![](https://img.linux.net.cn/data/attachment/album/202004/10/222910vjpiqd6lqqm6riqp.jpg)
[IEEE][1] 是世界上最大的技术专业组织,致力于推动技术的发展。<ruby>IEEE 标准协会<rt>the IEEE Standards Association</rt></ruby>IEEE SA是 IEEE 内部的一个组织,负责制定全球各行业的标准。
IEEE 标准协会SA提出了一个开源协作平台即 [IEEE SA Open][2]。
技术上来说,它是一个自托管的 GitLab 实例,结合了 [Mattermost][3](一个 [Slack 的替代品][4])和 [GitLab Pages][5]。[其官方博文][6]对此进一步解释道:
> 该平台使独立软件开发者、初创企业、业界、学术机构等能够在一个协作、安全、负责任的环境中创建、测试、管理和部署创新项目。
### 它有什么不同或有用的地方?
这个平台最主要的吸引力应该是 IEEE 的会员网络、技术专长和资源。
IEEE 主席 [Robert Fish][7],也曾(在接受 Radio Kan 的采访时)简单地提到它有什么不同之处,以及为什么 IEEE 想要使用它。
> 如今,世界上大部分的基础设施都是由软件运行的,而这些软件需要符合通信网络、电网、农业等方面的标准。
这是有道理的 —— 如果我们想提高标准化技术,这在很大程度上取决于软件。所以,这听起来肯定是要对创新的开源项目进行标准化,让它们也能为潜在的资本机会做好准备。
IEEE 还澄清说:
> 随着软件在当今世界越来越普遍道德规范、可靠性、透明度和民主治理成为必须具备的条件。IEEE 在赋予开源项目这些属性方面有着得天独厚的优势。
虽然听起来很好,但 IEEE 的开源平台究竟能提供什么?让我们一起来看看这个问题。
### IEEE SA Open 概览
![][8]
首先,它对所有人开放并且完全免费使用。你只需要创建一个 [IEEE 帐户][9],然后[登录到这个开源平台][10]就可以开始。
除了与 IEEE 广泛的会员网络相关的好处之外,你还可以期望其开源社区经理或社区成员提供指导性支持。
![Ieee Gitlab][11]
该平台提供了标准和非标准项目的用例,你可以尝试一下。
因为选择将 GitLab 与 Mattermost 和 Pages 结合起来,你可以获得一些有用的功能,它们是:
* 项目规划和管理功能
* 源代码管理
* 测试、代码质量和持续集成功能
* Docker 容器注册库和 Kubernetes 集成
* 应用程序的发布和交付功能
* 集成了 Mattermost 聊天论坛的斜线命令(完全支持 Android 和 iPhone 应用程序)
* 能够弥合标准制定和开源社区之间的差距,以便以更快的速度推进灵活和创造性的技术解决方案
* 安全的开放空间,并有严格的行为准则。
### 小结
显然,有更多的平台来潜在地放大开源项目的曝光率是一件好事 —— 因此IEEE 的举措听起来很有希望。
你对此有何看法?让我知道你的想法吧!
--------------------------------------------------------------------------------
via: https://itsfoss.com/ieee-open-source-collaboration-platform/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://www.ieee.org/about/index.html
[2]: https://standards.ieee.org/content/ieee-standards/en/initiatives/opensource/
[3]: https://mattermost.com/
[4]: https://itsfoss.com/open-source-slack-alternative/
[5]: https://docs.gitlab.com/ee/user/project/pages/
[6]: https://spectrum.ieee.org/the-institute/ieee-products-services/ieee-standards-association-launches-a-platform-for-open-source-collaboration
[7]: https://www.linkedin.com/in/robertsfish/
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/ieee-opensource.jpg?ssl=1
[9]: https://www.ieee.org/profile/public/createwebaccount/showRegister.html
[10]: https://opensource.ieee.org/
[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/ieee-gitlab.jpg?ssl=1

View File

@ -1,26 +1,30 @@
[#]: collector: (lujun9972)
[#]: translator: (HankChow)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12085-1.html)
[#]: subject: (How to Upgrade to Ubuntu 20.04 Beta from 18.04 & 19.10)
[#]: via: (https://itsfoss.com/upgrade-ubuntu-beta/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
如何将 Ubuntu 18.04/19.10 升级到 Ubuntu 20.04 beta
如何将 Ubuntu 18.04 LTS/19.10 升级到 Ubuntu 20.04 beta
======
![](https://img.linux.net.cn/data/attachment/album/202004/08/125043m1qyy7gzvkjazx41.jpg)
[Ubuntu 20.04 LTS 版本][1]还有不到一个月就发布了Ubuntu 在这一个版本中对视觉效果作出了大变动,同时在性能方面也有所提高。
如果你还在使用 Ubuntu 18.04 LTS 版本,你会发现 Ubuntu 20.04 配合深色 Yaru 主题非常惊艳,看过 [Ubuntu 20.04 的展示视频][2]你就知道了。
[订阅我们的 YouTube 频道观看更多 Linux 视频][3]
- [video](https://img.linux.net.cn/static/video/Ubuntu%2020.04%20Desktop%20Tour%20-%20Check%20Out%20New%20Features-9u5B0njRgOw.mp4)
感觉确实不错。如果你想在 4 月 23 日最终稳定版正式发布前率先使用 Ubuntu 20.04,也可以在官方网站上下载 beta 版本。尽管如此,它的稳定性并不差,同时你也可以在使用这个版本的过程中帮助 Ubuntu 团队进行测试。
感觉确实不错。如果你想在 4 月 23 日最终稳定版正式发布前率先使用 Ubuntu 20.04,也可以在官方网站上下载 beta 版本。尽管是测试版本,但它的稳定性并不差,同时你也可以在使用这个版本的过程中帮助 Ubuntu 团队进行测试。
你可以下载<ruby>每日构建<rt>daily build</rt></ruby>版并进行重新安装,如果你正在使用的是 Ubuntu 18.04 或 Ubuntu 19.10,也可以在现有系统的基础上直接升级到 Ubuntu 20.04 beta 版本。
如果你需要确认正在使用的 Ubuntu 版本,可以参考[这篇文章][4]。
从现有系统中升级是很方便的,因为你不会丢失系统设置和其他文件。与重新安装不同的是,你不需要从头开始重新安装所有的软件。当你切换到新版本时,你的主目录、应用程序(大部分)、文件都会保持原样。
> 如果你需要确认正在使用的 Ubuntu 版本,可以参考[这篇文章][4]。
在本文中,我将会介绍如何升级到 Ubuntu 20.04 beta 版本。
@ -31,9 +35,9 @@
在你阅读后面的内容之前,我首先说明一些关于升级到 Ubuntu beta 版本的常见问题。
* 版本升级的过程并不复杂,但在整个过程中需要有良好的网络连接,以便下载高达好几 GB 的数据。
* 版本升级的过程中,第三方存储库(比如你自行添加的 [PPA][6])会被禁用,有些 PPA 可能也和新版本不兼容,在版本升级完毕后,你可以手动启用 PPA。
* 版本升级的过程中,第三方存储库(比如你自行添加的 [PPA][6])会被禁用,有些 PPA 可能也和新版本不兼容,在版本升级完毕后,你可以手动启用这些 PPA。
* 强烈建议将重要数据备份到外部的 USB 硬盘上。你只需要将各个目录下的重要文件直接复制到外部 USB 硬盘上保存即可。
* 升级到新版本之后,就无法再回滚到之前的旧版本了,只能重新安装旧版本系统
* 升级到新版本之后,就无法再回滚到之前的旧版本了,如果需要旧版本的系统,只能重新安装。
* 如果你选择升级到 Ubuntu 20.04 beta 版本,那么在 Ubuntu 20.04 最终稳定版发布之后,你也不需要重新安装。只需要保持定期更新 Ubuntu 系统,届时你就可以直接用上最终稳定版了。
* Ubuntu 16.04/17/18/19.04 都无法直接升级到 Ubuntu 20.04。
@ -83,7 +87,7 @@ update-manager -d
#### 步骤 4开始升级到 Ubuntu 20.04 beta
接下来只要等待下载更新就可以了,遇到对话框直接点击 OK 即可。
接下来只要等待下载更新就可以了,遇到对话框直接点击 OK 即可。
![][13]
@ -99,6 +103,8 @@ update-manager -d
下面的视频展示了所有相关步骤。
- [video](https://img.linux.net.cn/static/video/How%20to%20Upgrade%20to%20Ubuntu%2020.04%20Beta%20from%2018.04%20&%2019.10%20Right%20Now-RkxxEtaTVkA.mp4)
由此可见,这个升级流程并不复杂。欢迎体验 Ubuntu 20.04 带来的新特性。
如果你有疑问或建议,欢迎在评论区留言。
@ -111,7 +117,7 @@ via: https://itsfoss.com/upgrade-ubuntu-beta/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[HankChow](https://github.com/HankChow)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
@ -120,7 +126,7 @@ via: https://itsfoss.com/upgrade-ubuntu-beta/
[1]: https://itsfoss.com/ubuntu-20-04-release-features/
[2]: https://www.youtube.com/watch?v=9u5B0njRgOw
[3]: https://www.youtube.com/c/itsfoss?sub_confirmation=1
[4]: https://itsfoss.com/how-to-know-ubuntu-unity-version/
[4]: https://linux.cn/article-9872-1.html
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04-beta.jpg?ssl=1
[6]: https://itsfoss.com/ppa-guide/
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/software-updates-app-ubuntu.jpg?ssl=1

View File

@ -0,0 +1,161 @@
[#]: collector: (lujun9972)
[#]: translator: (MjSeven)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12092-1.html)
[#]: subject: (Scheduling tasks on Linux using the at command)
[#]: via: (https://www.networkworld.com/article/3535808/scheduling-tasks-on-linux-using-the-at-command.html)
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
使用 at 命令在 Linux 上安排任务
======
> at 命令可以很容易地安排 Linux 任务在你选择的任何时间或日期运行,让我们来看看它能为你做什么。
![][0]
当你希望命令或脚本在某个特定时间运行时,你不需要将手指放在键盘上盘旋等待按下回车键,或者是在特定时间坐在办公桌前。相反,你可以通过 `at` 命令来设置任务。在本文中,我们将研究如何使用 `at` 来安排任务,如何精确地选择任务希望运行的时间,以及如何使用 `at` 来查看安排运行的任务。
### at vs cron
对于那些使用 cron 在 Linux 系统上安排任务的人来说,`at` 命令类似于 cron因为你可以在选定的时间调度任务但是 cron 用于定期运行的作业 —— 甚至是每年仅一次。大多数 cron 作业的频率都设置为每天、每周或每月运行一次,不过你可以控制运行的频率和时间。
另一方面,`at` 命令用于仅运行一次的任务。想在午夜重启系统?没问题,只要你有适当的权限,`at` 可以为你完成此操作。如果你希望系统在每个星期六凌晨 2 点重启,那么改用 cron。
### 使用 at
`at` 命令很容易使用,只需记住几件事。一个简单使用 `at` 的例子类似于这样:
```
$ at 5:00PM
at> date >> thisfile
at> <EOT>
```
在输入 `at` 和应该运行命令的时间,`at` 会提示你在设定时间会运行该命令(此例中是 `date` 命令)。输入 `^D``Ctrl + d`)来完成请求。
假设我们在下午 5 点之前设置这个 `at` 命令,那么这个日期和时间将在当天下午 5 点添加到名为 `thisfile` 文件的末尾。否则,该命令将在第二天下午 5 点运行。
`at` 命令进行交互时,可以输入多个命令。如果你要同时运行多个命令,只需输入多个命令行即可:
```
$ at 6:22
warning: commands will be executed using /bin/sh
at> echo first >> thisfile
at> echo second >> thisfile
at> <EOT>
```
在上面的命令中,我们使用了一个普通的用户账户,将一些简单的文本添加到该用户主目录的文件中。如果在上午 6:22 之后运行这些命令,那么命令会在第二天运行,因为 6:22 表示上午 6:22。如果你想在下午 6:22 运行,使用 `6:22 PM` 或者 `18:22`。`6:22 PM` 这样也是可以工作的。
你也可以通过使用 `at` 来安排命令在指定的日期或时间运行,例如 `10:00AM April 15 2021``noon + 5 days`(从今天起 5 天内的中午运行),以下是一些例子:
```
at 6PM tomorrow
at noon April 15 2021
at noon + 5 days
at 9:15 + 1000 days
```
在指定要运行的命令并按下 `^D` 后,你会注意到 `at` 命令为每个请求分配了一个作业编号,这个数字将显示在 `at` 命令的作业队列中。
```
$ at noon + 1000 days
warning: commands will be executed using /bin/sh
at> date >> thisfile
at> <EOT>
job 36 at Tue Dec 27 12:00:00 2022 <== job # is 36
```
### 检查队列
你可以使用 `atq`at queue命令来查看 `at` 作业队列:
```
$ atq
32 Thu Apr 2 03:06:00 2020 a shs
35 Mon Apr 6 12:00:00 2020 a shs
36 Tue Dec 27 12:00:00 2022 a shs
34 Thu Apr 2 18:00:00 2020 a shs
```
如果你需要取消队列中的一个作业,使用 `atrm`at remove命令和作业编号
```
$ atrm 32
$ atq
35 Mon Apr 6 12:00:00 2020 a shs
36 Tue Dec 27 12:00:00 2022 a shs
34 Thu Apr 2 18:00:00 2020 a shs
```
你可以使用 `at -c` 命令来查看安排任务的详细信息,其它详细信息(活动的搜索路径等)也可以看到,但是输出的最后一行将显示计划运行的命令。
```
$ at -c 36 | tail -6
cd /home/shs || {
echo 'Execution directory inaccessible' >&2
exit 1
}
date >> thisfile
```
注意,该命令显示首先会测试是否可以通过 `cd` 命令进入用户目录。如果不可以,作业将退出并显示错误。如果可以,则运行在 `at` 中指定的命令。它将命令视为 “进入 `/home/shs` 或退出并显示错误”。
### 以 root 身份运行作业
要以 root 身份运行 `at` 作业,只需将 `sudo` 与你的 `at` 命令一起使用,如下所示:
```
$ sudo at 8PM
[sudo] password for shs:
warning: commands will be executed using /bin/sh
at> reboot now
at> <EOT>
job 37 at Wed Apr 1 16:00:00 2020
```
注意root 的任务以 `root` 作为执行者显示在队列中。
```
35 Mon Apr 6 12:00:00 2020 a shs
36 Tue Dec 27 12:00:00 2022 a shs
37 Wed Apr 1 20:00:00 2020 a root <==
```
### 运行脚本
你还可以使用 `at` 命令来运行脚本,这里有一个例子:
```
$ at 4:30PM
warning: commands will be executed using /bin/sh
at> bin/tryme
at> <EOT>
```
### 禁止使用 at 命令
`/etc/at.deny` 文件提供了一种禁止用户使用 `at` 命令的方法。默认情况下,它可能会包含一个不允许的账户列表,例如 `ftp``nobody`。可以使用 `/etc/at.allow` 文件执行相反的操作,但是通常只配置 `at.deny` 文件。
### 总结
当你要安排一项一次性任务时,无论你是希望在今天下午或几年后运行,`at` 命令都是通用且易于使用的。
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3535808/scheduling-tasks-on-linux-using-the-at-command.html
作者:[Sandra Henry-Stocker][a]
选题:[lujun9972][b]
译者:[MjSeven](https://github.com/MjSeven)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/
[b]: https://github.com/lujun9972
[0]: https://images.idgesg.net/images/article/2019/08/gettyimages-140389307-100808283-large.jpg
[1]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy)
[2]: https://www.facebook.com/NetworkWorld/
[3]: https://www.linkedin.com/company/network-world

View File

@ -0,0 +1,140 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12107-1.html)
[#]: subject: (What is Arch User Repository (AUR)? How to Use AUR on Arch and Manjaro Linux?)
[#]: via: (https://itsfoss.com/aur-arch-linux/)
[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/)
什么是 Arch 用户仓库AUR以及如何使用
======
如果你一直在使用 [Arch Linux][1] 或其他基于 Arch 的发行版,如 Manjaro那么可能会遇到 AUR。你尝试安装新软件有人建议从 AUR 中安装它。这让你感到困惑。
什么是 AUR为什么使用它如何使用 AUR我将在本文中回答这些问题。
### 什么是 AUR
![][2]
AUR 表示<ruby>Arch 用户仓库<rt>Arch User Repository</rt></ruby>。它是针对基于 Arch 的 Linux 发行版用户的社区驱动的仓库。它包含名为 [PKGBUILD][3] 的包描述,它可让你使用 [makepkg][4] 从源代码编译软件包,然后通过 [pacman][5]Arch Linux 中的软件包管理器)安装。
创建 AUR 的目的是组织和共享社区中的新软件包,并帮助加速将流行的软件包纳入[社区仓库][6]。
进入官方仓库的大量新软件包都从 AUR 开始。在 AUR 中用户可以贡献自己的软件包构建PKGBUILD 和相关文件)。
AUR 社区可以对 AUR 中的软件包进行投票。如果一个软件包变得足够流行(假设它具有兼容的许可证和良好的打包技术),那么可以将其加入 `pacman` 直接访问的社区仓库中。
> 简而言之AUR 是开发人员在 Arch 仓库中正式包含新软件之前向 Arch Linux 用户提供新软件的一种方式。
### 你应该使用 AUR 吗?有什么风险?
使用 AUR 就像过马路一样。如果你谨慎操作,应该就没问题。
如果你刚接触 Linux建议你在建立有关 Arch/Manjaro 和 Linux 的基础知识之前不要使用 AUR。
的确,任何人都可以将软件包上传到 AUR但[受信任用户][7]TU负责监视上传的内容。尽管 TU 对上传的软件包执行质量控制,但不能保证 AUR 中的软件包格式正确或没有恶意。
在实践中AUR 似乎很安全,但理论上讲它可以造成一定程度的损害,但前提是你不小心。从 AUR 构建软件包时,聪明的 Arch 用户**总是**检查 `PKGBUILD``*.install` 文件。
此外TU受信任用户还会删除 AUR 中包含在 core/extra/community 中的软件包因此它们之间不应存在命名冲突。AUR 通常会包含软件包的开发版本cvs/svn/git 等),但它们的名称会被修改,例如 foo-git。
对于 AUR 软件包,`pacman` 会处理依赖关系并检测文件冲突,因此,除非你默认使用 `force` 选项,否则你不必担心用另一个包中的文件会覆盖另一个包的文件。如果这么做了,你可能会遇到比文件冲突更严重的问题。
### 如何使用 AUR
使用 AUR 的最简单方法是通过 AUR 助手。 [AUR 助手][8] 是一个命令行工具(有些还有 GUI可让你搜索在 AUR 上发布的软件包并安装。
#### 在 Arch Linux 上安装 AUR 助手
假设你要使用 [Yay AUR 助手][9]。确保在 Linux 上安装了 git。然后克隆仓库进入目录并构建软件包。
依次使用以下命令:
```
sudo pacman -S git
sudo git clone https://aur.archlinux.org/yay-git.git
cd yay
makepkg -si
```
安装后,你可以使用 `yay` 命令来安装软件包:
```
yay -S package_name
```
并非必须使用 AUR 助手来从 AUR 安装软件包。从以下文章解如何在没有 AUR 助手的情况下使用 AUR。
#### 不使用 AUR 助手安装 AUR 软件包
如果你不想使用 AUR 助手,那么也可以自行从 AUR 安装软件包。
在 [AUR 页面][10]上找到要安装的软件包后,建议确认“许可证”、“流行程度”、“最新更新”、“依赖项”等,作为额外的质量控制步骤。
```
git clone [package URL]
cd [package name]
makepkg -si
```
例如。假设你要安装 [telegram 桌面包][11]
```
git clone https://aur.archlinux.org/telegram-desktop-git.git
cd telegram-desktop-git
makepkg -si
```
#### 在 Manjaro Linux 中启用 AUR 支持
它默认情况下未启用 AUR你必须通过 `pamac` 启用它。我的笔记本电脑运行 [Manjaro][12] Cinnamon但是所有 Manjaro 变种的步骤都相同。
打开 Pamac显示为 “Add/Remove Software”
![][13]
进入 Pamac 后,请进入如下所示的<ruby>首选项<rt>preferences</rt></ruby>
![][14]
在首选项对话框中,进入 “AUR” 选项卡,启用 AUR 支持,启用检查更新,并关闭对话框。
![][15]
现在,你可以搜索软件包,并且可以通过软件包描述下的标签来识别属于 AUR 的软件包。
![][16]
希望本文对你有用,并关注社交媒体上即将出现的与 Arch 相关的主题。
--------------------------------------------------------------------------------
via: https://itsfoss.com/aur-arch-linux/
作者:[Dimitrios Savvopoulos][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/dimitrios/
[b]: https://github.com/lujun9972
[1]: https://www.archlinux.org/
[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/what-is-aur.png?ssl=1
[3]: https://wiki.archlinux.org/index.php/PKGBUILD
[4]: https://wiki.archlinux.org/index.php/Makepkg
[5]: https://wiki.archlinux.org/index.php/Pacman#Additional_commands
[6]: https://wiki.archlinux.org/index.php/Community_repository
[7]: https://wiki.archlinux.org/index.php/Trusted_Users
[8]: https://itsfoss.com/best-aur-helpers/
[9]: https://github.com/Jguer/yay
[10]: https://aur.archlinux.org/
[11]: https://aur.archlinux.org/packages/telegram-desktop-git
[12]: https://manjaro.org/
[13]: https://i1.wp.com/i.imgur.com/kFF6HtW.png?ssl=1
[14]: https://i0.wp.com/i.imgur.com/47r963A.png?ssl=1
[15]: https://i1.wp.com/i.imgur.com/UThiDHO.png?ssl=1
[16]: https://i2.wp.com/i.imgur.com/RM5BKi2.png?ssl=1

View File

@ -0,0 +1,75 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12104-1.html)
[#]: subject: (15 years of Git: How to get started or learn something new)
[#]: via: (https://opensource.com/article/20/4/get-started-git)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
Git 都 15 岁了,如何入门或学习点新东西
======
> 在 Git 15 周年之际,了解为什么 Git 是保持软件行业运行的重要组成部分。
![](https://img.linux.net.cn/data/attachment/album/202004/13/091410k80er3mttrznc22e.jpg)
如果说过去二十年来有什么东西改变了软件,那么 [Git][2] 肯定位列榜首。
如果你没有亲自使用过 Git你可能会认为它只是一种技术时尚只是因为它是由 [Linux][3] 项目的创始人创建的,所以在开发者中只是一个偶然的宠儿。这或许有一定的道理,但 Git 确实取得了一些其他行业所没有的成就。有了 Git分布在世界各地的开发者们可以在同一时间对同一段代码进行工作并记录下每一次修改的历史然后将所有的工作合并到一起形成一个成品。由于这件事情非常复杂所以这个工具本身也会变得很复杂但归根结底它是维持软件行业运行的重要组成部分。
无论你是否了解 Git如果你足够深入的研究开源软件或者进入计算机科学领域都有可能遇到它。无论你使用 Git 只是为了下载一个安装包,还是每天与它交互来管理代码,了解更多关于它的知识,都会对你有很大的启发和帮助。
### Git 术语
与任何专业工具一样Git 中也有很多行话。像“<ruby>克隆<rt>clone</rt></ruby>”、“<ruby>合并<rt>merge</rt></ruby>”和“<ruby>变基<rt>rebase</rt></ruby>”这样的术语,最起码也是神秘的,而更糟的情况下会令人感到排斥。试图理解这些术语的含义可能会让人不知所措,但如果你从 Matthew Broberg 的优秀文章《[Git 术语基础][4]》中得到一点指导,就不会这样了。只需快速阅读一下,你就能真正理解地听懂关于 Git 的对话。
### Git 入门
如果你需要知道如何使用 Git那么我自己的[关于使用 Git 的入门文章系列][5]是一个很好的开始。这些文章已经有几年的历史了,但就像许多 Linux 和 UNIX 技术一样,它的界面并没有发生很大的变化,所以这些文章和我写这些文章那时一样,在今天还是很有意义的。这一系列文章向你介绍了 Git 最基本的概念,并带领你完成创建仓库、提交文件、恢复文件、合并分支等过程。
### 常见的 Git 服务
Git 最常见的用途之一是公共的 Git 托管服务,比如 GitLab 和 GitHub。Kedar Vijay Kulkarni 在他的《[如何在 Git 中克隆、修改、添加和删除文件][6]》一文中,演示了大多数开发者使用 Git 执行的日常任务。这不是非开发者的必读书目,但对于任何想在公共 Git 托管服务上为项目做贡献的人来说,这篇文章是必读的。这篇文章专门针对的是 Github因为它是当今最常见的平台之一但其原理也适用于任何 Git 服务的 Web 前端,包括 [GitLab][7]、[Gogs][8] 和 [Gitea][9] 等流行的开源框架。
### 试试这个 Git 演练
与其漫无目的的探索,你是不是更喜欢在导游的带领下学习?有时候,学习一件事最简单的方法就是模仿别人的准确步骤。你知道最终的结果是肯定成功的,所以你在进行练习的时候会有信心,而你的大脑和手指也会得到重复的好处,从而建立起记忆。如果这是你的学习风格,那就跟着 Alan Formy-Duvall 的《[Git 的实用学习练习][10]》,找出成功的 Git 课程的感觉。
### Git 应用程序
信不信由你Git 的界面比你在终端输入的文字更多。显然,在线托管的 Git 有 Web 界面,但是你也可以在计算机上使用 Git 客户端。如果想获得更多的帮助,请阅读 Jesse Duffield 关于 [Lazygit][11] 的文章或 Olaf Anders 关于 [Tig][12] 的文章。要获得完整的图形应用程序体验,请阅读我有关 [Git-cola][13]、[Sparkleshare][14] 以及[其它应用][15]的文章。是的,甚至还有[用于你的移动设备的界面][16]
### 了解更多关于 Git 的信息
知识就是力量,所以不要让 Git 对你来说像个谜。无论你是直接使用它,还是只知道它的名字,或者你以前从未听说过它,现在都是了解 Git 的好时机。这里有很多资源可以帮助你了解它的工作原理、工作原理以及人们为什么这么喜欢它。潜入其中,按照自己的节奏来学习,并学会爱上 Git 吧!
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/get-started-git
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[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/document_free_access_cut_security.png?itok=ocvCv8G2 (Scissors cutting open access to files)
[2]: https://en.wikipedia.org/wiki/Git
[3]: https://opensource.com/resources/linux
[4]: https://opensource.com/article/19/2/git-terminology
[5]: https://opensource.com/life/16/7/stumbling-git
[6]: https://opensource.com/article/18/2/how-clone-modify-add-delete-git-files
[7]: https://about.gitlab.com/install/
[8]: https://gogs.io/
[9]: https://gitea.io/en-us/
[10]: https://opensource.com/article/19/5/practical-learning-exercise-git
[11]: https://opensource.com/article/20/3/lazygit
[12]: https://opensource.com/article/19/6/what-tig
[13]: https://opensource.com/article/20/3/git-cola
[14]: https://opensource.com/article/19/4/file-sharing-git
[15]: https://opensource.com/life/16/8/graphical-tools-git
[16]: https://opensource.com/article/19/4/calendar-git#mobile

View File

@ -0,0 +1,112 @@
[#]: collector: (lujun9972)
[#]: translator: (HankChow)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12098-1.html)
[#]: subject: (How to Go Full Dark Mode in Ubuntu 20.04)
[#]: via: (https://itsfoss.com/dark-mode-ubuntu/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
在 Ubuntu 20.04 中完全进入深色模式
======
> 深色模式是 Ubuntu 20.04 最受瞩目的[新功能][1]之一了。任何版本的 Ubuntu 都可以通过[安装深色主题][2]让用户界面拥有一个深色的外观,但在 Ubuntu 20.04 中,这个过程变得更简单。
![](https://img.linux.net.cn/data/attachment/album/202004/11/200841gvvaja25jaz5z7hv.jpg)
在 Ubuntu 20.04 中,无需额外安装主题,默认主题(称为 Yaru本身就带有三种模式其中就包括深色模式。
下面我会展示如何将 Ubuntu 系统完全设置为深色模式。
### 在 Ubuntu 20.04 打开深色模式
- [video](https://player.vimeo.com/video/405726943)
这个步骤是在 GNOME 桌面上进行的,如果你[使用的是其它桌面][4],你看到的可能会和下面的截图不一样。
按下 super 键(或 Windows 键),然后输入 “settings”就可以找到系统设置。
![Search for Settings][5]
在系统设置中,进入“<ruby>外观<rt>Appearance</rt></ruby>”部分,就可以看到<ruby>浅色<rt>light</rt></ruby><ruby>标准<rt>standard</rt></ruby><ruby>深色<rt>dark</rt></ruby>三个选项。既然要使用深色模式,那自然而然要选择“深色”这个选项了。
![Enable Dark Theme in Ubuntu][6]
完成设置以后,使用了 GTK3 的应用程序都可以跟随深色模式。因此你会看到系统中包括文本编辑器、终端、LibreOffice 等在内的大多数应用程序都已经切换成深色了。但未使用 GTK3 的应用程序可能并没有跟随进入深色模式,下面我会展示如何更完整地进入深色模式。
### 继续调整,进入完整深色模式
这个时候你会发现shell 主题、屏幕顶部面板中的消息托盘和系统托盘还仍然保持在原有的模式当中。
![No Dark Shell by default in Ubuntu][7]
现在就需要使用 [GNOME 扩展][8]安装 Yaru 深色 shell 主题了。[在 Ubuntu 中通过 Ctrl+Alt+T 打开终端][9],然后执行以下这个命令安装浏览器扩展:
```
sudo apt install chrome-gnome-shell
```
进入[扩展页面][10]启用这个扩展:
![Enable User Themes GNOME Extension][11]
执行以下命令安装 [GNOME 调整工具][12]
```
sudo apt install gnome-tweaks
```
打开 GNOME 调整工具,进入“<ruby>外观<rt>Appearance</rt></ruby>”部分,就可以看到 shell 主题的选项,现在只需要把它启用就可以了。
![Enable Yaru Dark Shell Theme in Ubuntu][13]
设置完之后再观察一下,桌面通知、消息托盘、系统托盘等等都已经进入深色模式了。
![Yaru Dark Shell Theme in Ubuntu][14]
现在感觉好多了。但你可能还会注意到,在使用浏览器访问网站的时候,很多网站都使用了白色的背景色。如果期望网站方提供深色模式,那是很不现实的,但我们可以自己实现这一件事。
你需要用到的东西就是诸如 [Dark Reader][15] 这样的浏览器扩展。《[在 Firefox 中启用深色模式][16]》这篇文章中也有讨论过这个浏览器扩展,它的使用过程并不复杂,如果你使用的浏览器是 Firefox、Chrome 或 [Ubuntu 下的 Chromium][17],就可以直接安装[其官方网站][15]上列出的扩展。
Dark Reader 安装完成后,就会以深色模式打开网站了。
![Its FOSS Homepage in Dark Mode with Dark Reader][18]
当然,有些外部的第三方应用程序可能仍然是浅色状态。如果它们自己附带了深色模式的选项,就需要手动启用它们的深色模式。
如今,深色模式在非开发者人群中也越来越流行了。按照以上的步骤,你就可以轻松进入深色模式。
请享受深色模式。
--------------------------------------------------------------------------------
via: https://itsfoss.com/dark-mode-ubuntu/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[HankChow](https://github.com/HankChow)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/ubuntu-20-04-release-features/
[2]: https://itsfoss.com/install-themes-ubuntu/
[3]: https://www.youtube.com/c/itsfoss?sub_confirmation=1
[4]: https://itsfoss.com/find-desktop-environment/
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/settings-search-ubuntu-20-04.jpg?ssl=1
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/enable-dark-theme-ubuntu.png?ssl=1
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/no-dark-shell-ubuntu.jpg?ssl=1
[8]: https://itsfoss.com/gnome-shell-extensions/
[9]: https://itsfoss.com/ubuntu-shortcuts/
[10]: https://extensions.gnome.org/extension/19/user-themes/
[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/enable-user-themes-gnome.jpg?ssl=1
[12]: https://itsfoss.com/gnome-tweak-tool/
[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-yaru-dark-shell-theme.jpeg?ssl=1
[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/yaru-dark-shell-theme-ubuntu.jpg?ssl=1
[15]: https://darkreader.org/
[16]: https://itsfoss.com/firefox-dark-mode/
[17]: https://itsfoss.com/install-chromium-ubuntu/
[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/itsfoss_dark_mode.jpg?ssl=1

View File

@ -1,91 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Remember Unity8 from Ubuntu? UBports is Renaming it to Lomiri)
[#]: via: (https://itsfoss.com/unity8-lomiri/)
[#]: author: (John Paul https://itsfoss.com/author/john/)
Remember Unity8 from Ubuntu? UBports is Renaming it to Lomiri
======
Ever since Ubuntu abandoned the Unity project, UBports continued the maintenance and development of Unity. On February 27th 2020, [UBports][1] announced that they are giving Unity8 a new branding in the form of Lomiri.
### Unity8 is now Lomiri
![Unity8 in action | Image Credit: UBports][2]
[UBports announced][3] that the Unity8 desktop environment would be renamed as Lomiri. They gave three reasons for this fairly drastic announcement.
First, they want to avoid confusion with the [Unity game engine][4]. Quite a few people confused the two. UBports noted that they are frequently receiving questions regarding “how to import 3D models and meshes into our shell”. When you search “Unity” in your favorite search engine, most of the top links are for the game engine.
The second reason for the name change has to do with the new effort to package Unity8 for Debian. Unfortunately, many of the Unity8s dependencies have Ubuntu in the name, for example, _**ubuntu-ui-toolkit**_. Debian packagers warned that packages that have Ubuntu in the name may not be accepted into [Debian][5].
Finally, UBports said the name change would improve verbal communications. Saying Unity8 repeatedly can be a mouthful. People would not have to worry about confusing “users of Ubuntu Unity and Unity (the game engine)”.
UBports went on to stress that the name change was not “triggered by any action from Canonical or the Ubuntu community, legal or otherwise”.
They noted that this name change was the perfect time for them to switch to [GitHub alternative GitLab][6] for their development.
Interestingly, the announcement did not explain how they picked Lomiri as the new name. All they said is that “We went through many different names before settling on Lomiri. All of them had problems with pronunciation, availability, or other related issues.”
UBports noted that most Ubuntu Touch users would be unaffected by the name change. Developers and power users might notice some changes, but UBports “will strive to maintain backwards compatibility within Ubuntu Touch for the foreseeable future”.
### What Exactly is Being Renamed?
![][7]
According to the announcement, packages that have either Ubuntu or Unity in the title will be affected. For example,
* **unity8**, containing the shell, will become **lomiri**
* **ubuntu-ui-toolkit** will become **lomiri-ui-toolkit**
* **ubuntu-download-manager** will become **lomiri-download-manager**
On top of this, interfaces call will change, as well. “For example, the **Ubuntu.Components** QML import will change to **Lomiri.Components**.” For the sake of backwards compatibility, Ubuntu Touch images will not change too much. “Developers will only need to update to the new API when theyd like to package their apps for other distributions.”
### What Will Stay the Same?
Since renaming packages can cause quite a few cascading problems, UBports wants to limit the number of packages they change. They dont expect the following things to change.
* Packages that dont use the “Ubuntu” or “Unity” names
* Ubuntu Touch will remain the same
* Any components which are already used by other projects and accepted into other distributions
### Final Thoughts
![][8]
Overall, I think this change will be good for Ubuntu Touch in the long run. I understand why [Canonical][9] picked the Unity name for their convergence desktop, but I think the desktop environment was overshadowed by the game engine from the beginning. This will give them room to breathe and also free up valuable coding time. The less time spent replying to questions about 3D models the more time that can be spent creating a convergent desktop.
If you have any further questions or concerns about the name change, you visit the [UBports forms][10]. They have set up a thread specifically for this topic.
Dont hesitate to share our views on it in the comment section.
--------------------------------------------------------------------------------
via: https://itsfoss.com/unity8-lomiri/
作者:[John Paul][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/john/
[b]: https://github.com/lujun9972
[1]: https://ubports.com/
[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/unity8_ubports.png?ssl=1
[3]: https://ubports.com/blog/ubports-blog-1/post/lomiri-new-name-same-great-unity8-265
[4]: https://en.wikipedia.org/wiki/Unity_(game_engine)
[5]: https://www.debian.org/
[6]: https://itsfoss.com/github-alternatives/
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/Unity8-lomiri.png?ssl=1
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/ubports.jpeg?ssl=1
[9]: https://canonical.com/
[10]: https://forums.ubports.com/topic/3874/unity8-is-now-lomiri

View File

@ -1,82 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Linux Foundation prepares for disaster, new anti-tracking data set, Mozilla goes back to mobile OSes, and more open source news)
[#]: via: (https://opensource.com/article/20/3/news-march-14)
[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt)
Linux Foundation prepares for disaster, new anti-tracking data set, Mozilla goes back to mobile OSes, and more open source news
======
Catch up on the biggest open source headlines from the past two weeks.
![][1]
In this edition of our open source news roundup, we take a look at the Linux Foundation's disaster relief project, DuckDuckGo's anti-tracking tool, open textbooks, and more!
### Linux Foundation unveils Project OWL
When a disaster happens, it's vital to keep communications links up and running. One way to do that is with [mesh networks][2]. The Linux Foundation [has unveiled][3] Project OWL to "help build mesh network nodes for global emergency communications networks."
Short for _Organisation, Whereabouts, and Logistics_, OWL is firmware for Internet of Things (IoT) devices that "can quickly turn a cheap wireless device into a DuckLink, a mesh network node". Those devices can connect to other, similar devices around them. OWL also provides an analytics tool that responders can use for "coordinating resources, learning about weather patterns, and communicating with civilians who would otherwise be cut off."
### New open source tool to block web trackers
It's no secret that sites all over the web track their visitors. Often, it's shocking how much of that goes on and what a threat to your privacy that is. To help web browser developers better protect their users, the team behind search engine DuckDuckGo is "[sharing data it's collected about online trackers with other companies so they can also protect your privacy][4]."
That dataset is called Tracker Radar and it "details 5,326 internet domains used by 1,727 companies and organizations that track you online". Browser Radar is different from other tracker databases in that it "annotates data with other information, like whether blocking a tracker is likely to break a website, so anyone using it can pick the best balance of privacy and convenience."
Tracker Radar's dataset is [available on GitHub][5]. The repository also links to the code for the [crawler][6] and [detector][7] that work with the data.
### Oregon Tech embracing open textbooks
With the cost of textbooks taking an increasingly large bite out of the budgets of university students, more and more schools are turning to open textbooks to cut those costs. By embracing open textbooks, the Oregon Institute of Technology has [save students $400,000][8] over the last two years.
The school offers open textbooks for 26 courses, ranging "from chemistry and biology, to respiratory care, sociology and engineering." Although the textbooks are free, university librarian John Schoppert points out that the materials are of a high quality and that faculty members have been "developing lab manuals and open-licensed textbooks where they hadnt existed before and improved on others materials."
### Mozilla to help update feature phone OS
A few years ago, Mozilla tried to break into the world of mobile operating systems with Firefox OS. While that effort didn't pan out, Firefox OS found new life powering low-cost feature phones under the name KaiOS. Mozilla's [jumping back into the game][9] by helping "modernize the browser engine that's core to the software."
KaiOS is built upon a four-year-old version of Mozilla's Gecko browser engine. Updating Gecko will "improve security, make apps run faster and more smoothly, and open [KaiOS to] more-sophisticated apps and WebGL 2.0 for better games graphics." Mozilla said its collaboration will include "Mozilla's help with test engineering and adding new low-level Gecko abilities."
#### In other news
* [CERN adopts Mattermost, an open source messaging app][10]
* [Open-source software analyzes economics of biofuels, bioproducts][11]
* [Netflix releases Dispatch for crisis management orchestration][12]
* [FreeNAS and TrueNAS are merging][13]
* [Smithsonian 3D Scans NASA Space Shuttle Discovery And Makes It Open Source][14]
Thanks, as always, to Opensource.com staff members and [Correspondents][15] for their help this week.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/3/news-march-14
作者:[Scott Nesbitt][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/scottnesbitt
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/weekly_news_roundup_tv.png?itok=tibLvjBd
[2]: https://en.wikipedia.org/wiki/Mesh_networking
[3]: https://www.smartcitiesworld.net/news/news/linux-announces-open-source-project-to-aid-disaster-relief-5102
[4]: https://www.cnet.com/news/privacy-focused-duckduckgo-launches-new-effort-to-block-online-tracking/
[5]: https://github.com/duckduckgo/tracker-radar
[6]: https://github.com/duckduckgo/tracker-radar-collector
[7]: https://github.com/duckduckgo/tracker-radar-detector
[8]: https://www.heraldandnews.com/news/local_news/oregon-tech-turns-to-open-source-materials-to-save-students/article_ba641e79-3034-5b9a-a8f7-b5872ddc998e.html
[9]: https://www.cnet.com/news/mozilla-helps-modernize-feature-phones-powered-by-firefox-tech/
[10]: https://joinup.ec.europa.eu/collection/open-source-observatory-osor/news/cern-uses-mattermost
[11]: http://www.biomassmagazine.com/articles/16848/open-source-software-analyzes-economics-of-biofuels-bioproducts
[12]: https://jaxenter.com/netflix-dispatch-crisis-management-orchestration-169381.html
[13]: https://liliputing.com/2020/03/freenas-and-turenas-are-merging-open-source-operating-systems-for-network-attached-storage.html
[14]: https://www.forbes.com/sites/tjmccue/2020/03/04/smithsonian-3d-scans-the-nasa-space-shuttle-discovery-and-makes-it-open-source/#39aa0f243ecd
[15]: https://opensource.com/correspondent-program

View File

@ -1,60 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Tools for monitoring, introvert inclusion, and more industry trends)
[#]: via: (https://opensource.com/article/20/3/monitoring-introvert-industry-trends)
[#]: author: (Tim Hildred https://opensource.com/users/thildred)
Tools for monitoring, introvert inclusion, and more industry trends
======
A weekly look at open source community and industry trends.
![Person standing in front of a giant computer screen with numbers, data][1]
As part of my role as a senior product marketing manager at an enterprise software company with an open source development model, I publish a regular update about open source community, market, and industry trends for product marketers, managers, and other influencers. Here are five of my and their favorite articles from that update.
## [Top six open source tools for monitoring][2]
> These tools are widely used in the tech industry, and they all have their benefits. Most of these solutions, however, require skilled implementation and ongoing manual maintenance that can be a burden for DevOps teams and a distraction from the business. Theres no one solution that can cater to all of your requirements, since each tool focuses on one or two specific aspects of observability and analysis. By mixing these tools together, you can derive a unique solution for your individual business needs. 
**The impact**: If a container falls over in the cluster and there is no open source monitoring tool to see it, did it really happen?
## [Introvert environment: What can we do?][3]
> An example is its inclusive team dynamics programme, which consists of both information and guidance on everyday practices. Each team is required to appoint an inclusion champion, who ensures all members are given the space to contribute to discussions. Leaders are also encouraged not to speak first during meetings.
**The impact**: If it is hard for you not to speak for a while in a meeting, that probably indicates you should be doing it more often. Will new WFH policies make this harder, or easier? Only time will tell.
## [The difference between API Gateways and service mesh][4]
> The service connectivity capabilities that service mesh provides are conflicting with the API connectivity features that an API gateway provides. However, because the ones provided by service mesh are more inclusive (L4 + L7, all TCP traffic, not just HTTP and not just limited to APIs but to every service), they are in a way more complete. But as we can see from the diagram above, there are also use cases that service mesh does not provide, and that is the “API as a product” use case as well as the full API management lifecycle, which still belong to the API gateway pattern.
**The impact**: Another way of saying this is you can't make money from your service mesh directly, unlike your APIs.
## [Open Policy Agents mission to secure the cloud][5]
> While the cost of implementing OPA is a little high today, the technology pays for itself by providing more control and helping to secure systems. As OPA continues to be refined, we can expect implementation costs to fall, making an investment in OPA easier to justify.
**The impact**: Compliance is expensive; large investments in it only make sense if non-compliance is even more so.
_I hope you enjoyed this list and come back next week for more open source community, market, and industry trends._
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/3/monitoring-introvert-industry-trends
作者:[Tim Hildred][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/thildred
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data)
[2]: https://devops.com/top-six-open-source-tools-for-monitoring-kubernetes-and-docker/
[3]: https://www.raconteur.net/hr/introverts-workplace
[4]: https://www.cncf.io/blog/2020/03/06/the-difference-between-api-gateways-and-service-mesh/
[5]: https://thenewstack.io/open-policy-agents-mission-to-secure-the-cloud/

View File

@ -1,78 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (With npm Acquisition, Microsoft is Set to Own the Largest Software Registry in the World)
[#]: via: (https://itsfoss.com/microsoft-npm-acquisition/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
With npm Acquisition, Microsoft is Set to Own the Largest Software Registry in the World
======
Microsoft has been betting big on open source for past few years. Apart from open sourcing a few things here and there, Microsoft is contributing a lot to Linux kernel (for its Azure cloud platform).
To further strengthen its position in the open source world, [Microsoft acquired the popular open source code hosting platform GitHub for $7.5 billion][1].
Now Microsoft owned GitHub [has acquired][2] [npm][3] ( short for Node Package Manager). npm is the [worlds largest software registry][4] with [more than 1.3 million packages that have 75 billion downloads a month][5].
![][6]
If you are not familiar, npm is a package manager for JavaScript programming language, primarily the hugely popular open source [Node.js][7].
Though npm has scope of private repository for enterprises, most of the 1.3 million packages are open source and/or used in various open source projects.
Both node.js and npm are used by big software and IT companies like IBM, Yahoo and big corporations like Netflix and PayPal.
In case you are wondering, the acquisition amount has not been disclosed by either party.
### Microsofts proposed plan for npm
![][8]
GitHub CEO Nat Friedman assured that Microsoft intends to keep the npm registry available as open-source and free to developers.
Once the acquisition is complete, Microsoft is going to invest in the registry infrastructure and platform. It plans to improve the core experience of npm by adding new features like Workspaces, as well as bringing improvements to publishing and multi-factor authentication.
Microsoft also intends to integrate GitHub and npm so that developers could trace a change from a GitHub pull request to the npm package version that fixed it.
### Part of a larger plan
First, [Microsoft bought GitHub][1], the platform that had the largest open source repositories and now npm, the largest software registry. Clearly, Microsoft is tightening its grip around open source projects. This could allow Microsoft to dictate the policies around these open source projects in future.
When Microsoft acquired GitHub, several open source developers moved to [alternate platforms like GitLab][9] but GitHub remained the first choice for the developers. Microsoft did introduce some innovative features like security advisories, [package registry][10], [sponsorship][11] etc. Microsoft is expanding GitHub by forming communities around it specially in developing countries. Recently, [GitHub announced its Indian subsidiary][12] to specially attract young developers to its platform.
So now Microsoft owns the professional social network [LinkedIn][13], developer oriented GitHub and npm. This indicates that Microsoft will continue its shopping spree and will acquire more open source related projects that have substantial developer population.
What could be next then? WordPress because it is the [most popular open source CMS][14] and [runs 33% of the websites][15] on the internet?
While we wait and watch for Microsofts next move, why not share your views on this development? Comment section is all yours.
--------------------------------------------------------------------------------
via: https://itsfoss.com/microsoft-npm-acquisition/
作者:[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://itsfoss.com/microsoft-github/
[2]: https://github.blog/2020-03-16-npm-is-joining-github/
[3]: https://www.npmjs.com/
[4]: https://www.linux.com/news/state-union-npm/
[5]: https://www.zdnet.com/article/microsoft-buys-javascript-developer-platform-npm-plans-to-integrate-it-with-github/
[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/microsoft-github-npm.jpg?ssl=1
[7]: https://nodejs.org/en/
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/github-npm.jpg?ssl=1
[9]: https://itsfoss.com/github-alternatives/
[10]: https://github.blog/2019-05-10-introducing-github-package-registry/
[11]: https://itsfoss.com/github-sponsors-program/
[12]: https://github.blog/2020-02-12-announcing-github-india/
[13]: https://www.linkedin.com/
[14]: https://itsfoss.com/open-source-cms/
[15]: https://wordpress.org/news/2019/03/one-third-of-the-web/

View File

@ -1,98 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (OBS Studio 25.0 is Here With Vulkan-based Games Capture Feature and More)
[#]: via: (https://itsfoss.com/obs-studio-25-release/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
OBS Studio 25.0 is Here With Vulkan-based Games Capture Feature and More
======
_**Brief: Open source screen recording and streaming software OBS Studio 25.0 has just been released and it brings the ability to capture Vulkan-based games with game capture among other new features.**_
![][1]
If you are into recording your desktop or streaming it, you might have heard of [OBS][2] (Open Broadcaster Software) Studio. Its one of the [best screen recorder tools on Linux][3] and other operating systems.
But OBS is more than just a simple screen recorder. It also provides all the stuff you need for streaming your recordings.
### New features in OBS Studio 25.0
![OBS 25.0][4]
OBS Studio has released its latest version 25.0 with plenty of new features to make your recording and streaming experience better. Lets take a look at some of the main new features:
* Capture Vulkan-based games with game capture
* New capture method to window capture which allows capturing browsers, browser-based windows, and UWP programs
* Advanced scene collection importing allows you to import from other common streaming programs
* Media source hotkeys to allow control of playback
* Ability to drag and drop URLs to create browser sources
* Support for the [SRT protocol][5]
* Ability to lock volume values of audio sources in the mixer
* Support for certain devices that can automatically rotate their camera output such as the Logitech StreamCam
* System tray icon to show when the recording is paused
* Help icons when an property has a tooltip associated with it
Apart from there, there are plenty of bug features and minor changes that you may follow in the [release notes][6].
### Install OBS Studio 25.0 on Linux
OBS Studio is a cross-platform software and is also available for Windows and macOS in addition to Linux. You can download it from its official website.
[Download OBS Studio 25.0][7]
For Linux, you can grab the source code and build it your self. I know thats not very convenient for everyone. The good news is that you can install the latest OBS version using Snap or Flatpak packages.
On Ubuntu or any other [Linux distribution with Snap support][8], you can use the following command:
```
sudo snap install obs-studio
```
If your distribution supports Fltapak packages, you can get it from Flathub website:
[OBS Studio on Flathub][9]
For Ubuntu users, there is also the official PPA for easily installing it. In a terminal, you can enter the following command one by one:
```
sudo add-apt-repository ppa:obsproject/obs-studio
sudo apt update
sudo apt install obs-studio
```
You can [learn about deleting PPA here][10].
Personally, I havent used OBS much though I have heard great stuff about it. I dont live stream but I do record my desktop to create tutorial and information Linux videos on I[ts FOSS YouTube channel][11] (you should subscribe to it if you havent already). For that, I [use Kazam][12] which I find simpler to use.
Do you use OBS Studio? Which features you like the most? Do share your views.
--------------------------------------------------------------------------------
via: https://itsfoss.com/obs-studio-25-release/
作者:[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://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/obs_logo_icon_small.png?resize=150%2C150&ssl=1
[2]: https://obsproject.com/
[3]: https://itsfoss.com/best-linux-screen-recorders/
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/obs-25-ubuntu.png?ssl=1
[5]: https://en.wikipedia.org/wiki/Secure_Reliable_Transport
[6]: https://github.com/obsproject/obs-studio/releases/tag/25.0.0
[7]: https://obsproject.com/download
[8]: https://itsfoss.com/install-snap-linux/
[9]: https://flathub.org/apps/details/com.obsproject.Studio
[10]: https://itsfoss.com/how-to-remove-or-delete-ppas-quick-tip/
[11]: https://www.youtube.com/channel/UCEU9D6KIShdLeTRyH3IdSvw
[12]: https://itsfoss.com/kazam-screen-recorder/

View File

@ -1,70 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (npm joins GitHub, building operators in Kubernetes, and more industry trends)
[#]: via: (https://opensource.com/article/20/3/npm-github-operators-kubernetes-industry-trends)
[#]: author: (Tim Hildred https://opensource.com/users/thildred)
npm joins GitHub, building operators in Kubernetes, and more industry trends
======
A weekly look at open source community and industry trends.
![Person standing in front of a giant computer screen with numbers, data][1]
As part of my role as a senior product marketing manager at an enterprise software company with an open source development model, I publish a regular update about open source community, market, and industry trends for product marketers, managers, and other influencers. Here are five of my and their favorite articles from that update.
## [npm is joining GitHub][2]
> Looking further ahead, well integrate GitHub and npm to improve the security of the open source software supply chain, and enable you to trace a change from a GitHub pull request to the npm package version that fixed it. Open source security is an important global issue, and with the recent launch of the [GitHub Security Lab][3] and GitHubs built-in [security advisories][4], we are well-positioned to make a difference. In addition, [GitHub Sponsors][5] has already paid out millions of dollars to open source contributors, and were excited to explore tasteful ways to extend it to the npm ecosystem.
**The impact**: Open source supply chain security is a big problem that probably needs a lot more resources thrown at it.
## [Why and how to build operators in Kubernetes][6]
> For cluster administrators managing large clusters, this proliferation of development methodologies and management interfaces can be problematic. The class of applications that Operators were developed to manage are almost always part of a larger application stack, with dependencies between them. If we have a lot of Operators written in different ways running on our clusters, how can we ensure they will interoperate with each other, and how do we validate and test them?
**The impact**: This illustrates two cool things about open source. First, the alternating waves of innovation and consolidation. Second, the empowering of affected parties to address their own challenges.
## [Automation for improved security frameworks][7]
> In recent years weve seen the posts of CIO and CTO elevated to boardroom level, with senior figures in IT now influencing corporate strategy. Due to a heightened awareness of cybersecurity, it wont be long before the board looks to CSO and CISO executives for strategic direction.
**The impact**: This statement has gotten truer over the last several weeks. More activity is being pushed online than ever before; keeping that activity secure is integral to making it all profitable. Security people need to be able to say "no" at the highest possible level.
## [Interoperability of open source tools: The emergence of interfaces][8]
> Being non-opinionated about the adoption of specific technologies and the methodologies of distributing its primitive resources, were the main axes of Kubernetes evolution. Additionally, the proliferation of solutions from multiple vendors played an instrumental role in the emergence of interfaces and it served as the engine for further development and innovation.
**The impact**: Kubernetes may be the only large-scale open source project where competition is hot. Even still, competitors need to be able to work together and interfaces are the points that separate collaboration and competition.
## [Do you operate OpenStack? Take this survey.][9]
> Direct feedback from the individuals and organizations operating OpenStack helps the upstream development community know what features to prioritize and which bugs to fix first, among other important learnings on how the software is being used. Each of the official project teams has the opportunity to add a question to the survey as well as review anonymized data and trends to further influence their roadmaps.
**The impact**: Not every community participant can or will provide feedback on bug reports or feature requests. In that case, it is important to provide multiple ways to get feedback and meet users where they are.
_I hope you enjoyed this list and come back next week for more open source community, market, and industry trends._
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/3/npm-github-operators-kubernetes-industry-trends
作者:[Tim Hildred][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/thildred
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data)
[2]: https://github.blog/2020-03-16-npm-is-joining-github/
[3]: https://securitylab.github.com
[4]: https://help.github.com/en/github/managing-security-vulnerabilities/creating-a-security-advisory
[5]: https://github.com/sponsors
[6]: https://devops.com/day-2-for-the-operator-ecosystem/
[7]: https://www.infosecurity-magazine.com/opinions/automation-governance-culture/
[8]: https://medium.com/@kgamanji/interoperability-of-open-source-tools-the-emergence-of-interfaces-f3b7a90891e4
[9]: https://superuser.openstack.org/articles/operate-openstack-take-the-survey-heres-why-it-matters/

View File

@ -1,93 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (IEEE Standards Association Launches an Open Source Collaboration Platform)
[#]: via: (https://itsfoss.com/ieee-open-source-collaboration-platform/)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
IEEE Standards Association Launches an Open Source Collaboration Platform
======
_**Brief: IEEE Standards Association has announced a GitLab-based open source collaboration platform. Read how is it different and what advantages it has.**_
[IEEE][1] is the worlds largest technical professional organization dedicated to advancing technology. The IEEE Standards Association (IEEE SA) is an organization within IEEE that develops global standards in a broad range of industries.
The IEEE Standards Association (SA) has come up with an open-source collaboration platform i.e [IEEE SA Open][2].
It is technically a self-hosted GitLab instance combined with [Mattermost][3] (a [slack alternative][4]) and [GitLab Pages][5]. To describe it further, the [official blog post][6] mentioned:
> The platform enables independent software developers, startups, industry, academic institutions, and others to create, test, manage, and deploy innovative projects in a collaborative, safe, and responsible environment.
### How is it different or useful?
The main key attraction for this platform would be IEEEs members network, technical expertise, and resources.
IEEE President, [Robert Fish][7], also mentions in brief (during an interview with Radio Kan) how its different and why IEEE wanted to go with it:
> Today, much of the worlds infrastructure is run by software, and that software needs to comply with standards in communications networking, electrical grids, agriculture, and the like.
It makes sense if we want to improve standardizing technologies, it highly depends on the software. So, this definitely sounds like something to standardize innovative open-source projects to gear them up for potential capital opportunities as well.
IEEE also clarified that:
> As software becomes increasingly prevalent in the world today, ethical alignment, reliability, transparency, and democratic governance become must-haves. IEEE is uniquely positioned to endow open-source projects with these attributes.
While this sounds good, what exactly the open-source platform by the IEEE offer? Lets take a look at that:
### IEEE SA Open: Quick overview
![][8]
To start with, it is open to all and completely free to use. You just need to create an [IEEE account][9] and then [sign in to the open-source platform][10] to get started.
Along with the benefits associated with IEEEs extensive network of Members, you can also expect guidance support from their open-source community managers or community members.
![Ieee Gitlab][11]
The platform presents use cases for both standard and non-standard projects, so you can give it a try.
For its choice to go with GitLab combined with Mattermost and Pages, you get a couple of useful features, they are:
* Project planning and management features
* Source code management
* Testing, code quality, and continuous integration features
* Docker container registry and Kubernetes integration
* Application release and delivery features
* Integrated Mattermost chat forum w/slash commands; (Android and iPhone apps are fully supported)
* Capable of bridging the gap between Standards development and open source communities to allow for the advancement of nimble and creative technical solutions at a faster pace
* A safe open space with an enforced code of conduct
### Wrapping Up
Its obviously a good thing to have more platforms to potentially amplify the exposure of open-source projects hence, IEEEs initiative sounds promising to start with.
What do you think about it? Let me know your thoughts!
--------------------------------------------------------------------------------
via: https://itsfoss.com/ieee-open-source-collaboration-platform/
作者:[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://www.ieee.org/about/index.html
[2]: https://standards.ieee.org/content/ieee-standards/en/initiatives/opensource/
[3]: https://mattermost.com/
[4]: https://itsfoss.com/open-source-slack-alternative/
[5]: https://docs.gitlab.com/ee/user/project/pages/
[6]: https://spectrum.ieee.org/the-institute/ieee-products-services/ieee-standards-association-launches-a-platform-for-open-source-collaboration
[7]: https://www.linkedin.com/in/robertsfish/
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/ieee-opensource.jpg?ssl=1
[9]: https://www.ieee.org/profile/public/createwebaccount/showRegister.html
[10]: https://opensource.ieee.org/
[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/ieee-gitlab.jpg?ssl=1

View File

@ -0,0 +1,74 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (IBM taps new leaders for hybrid cloud battles ahead)
[#]: via: (https://www.networkworld.com/article/3536654/ibm-taps-new-leaders-for-hybrid-cloud-battles-ahead.html)
[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/)
IBM taps new leaders for hybrid cloud battles ahead
======
IBM installs Arvind Krishna as CEO, and appoints Red Hat execs to round out new cloud-oriented team
Stephen Lawson/IDG
Amid the business chaos COVID-19 is causing, IBM has set its course by [installing][1] Arvind Krishna as CEO and Red Hat CEO Jim Whitehurst as IBM president.  The company also named Red Hat veteran Paul Cormier as CEO of Red Hat.
Krishna replaces long-time CEO Virginia Rometty, who will  retire at the end of the year, and the package of executive moves solidifies the team that will lead Big Blue into to [hybrid-cloud][2] world where it will battle Amazon, Google and Microsoft.
[[Get regularly scheduled insights by signing up for Network World newsletters.]][3]
Right now, though, that team must also compete in the face the COVID-19 pandemic, an issue [Krishna][4] mentioned in a [letter he posted on LinkedIn][5] on his first day on the job, April 6.
“During this challenging time, we all need to have empathy, solidarity, and understanding for each other…If theres one thing that this public health crisis has brought to light it is the ever essential role of IBM in the world. We are the backbone of some of the most critical systems of the world. Our technologies and services help banks run credit-card transactions, businesses run supply chains, telcos connect customers, healthcare providers improve patient care, and companies and cities tackle cyberthreats,” Krishna wrote.
IBM has been part of the technology community that is helping address COVID-19.  For example, [IBM Research][6] has been developing cloud and AI-powered technologies that can help researchers battle against coronavirus, in part by accelerating COVID-19 drug discovery. 
IBM is also leading the [COVID-19 High Performance Computing Consortium][7] with AWS, Google, HPE, and Microsoft as well as US National Labs, NASA, and others to bring [high-performance computing][8] systems together to help researchers run massive modeling calculations.
While COVID-19 is a focus for now, the long term-goal is developing cloud technologies.
[][9]
“I believe we can make IBM the most trusted technology partner of the 21st century. For this to happen, we have to ensure that IBM continues to innovate and lead in the transformational journeys our clients are on. Hybrid cloud and AI are two dominant forces driving change for our clients and must have the maniacal focus of the entire company,” he stated.
### Linux, Kubernetes and containers
Krishna also wrote about IBMs strategic cloud directions going forward. “First, we have to deepen our understanding of IBMs two strategic battles: the journey to hybrid cloud and AI. We all need to understand and leverage IBMs sources of competitive advantage. Namely, our open source and security leadership, our deep expertise and trust, and the fact that we enable clients to build mission-critical applications once and run them anywhere,” Krishna stated.
IBM also has to win the battle for architecting the cloud. “Theres a unique window of opportunity for IBM and Red Hat to establish [Linux][10], containers and Kubernetes as the new standard. We can make Red Hat OpenShift the default choice for hybrid cloud in the same way that Red Hat Enterprise Linux is the default choice for the operating system,” Krishna stated.
When IBM closed its [acquisition][11] of Red Hat last July for $34 billion it was clear it would take on the hybrid-cloud market and now, especially with the current executive team in place, that path is set more solidly.
Krishna, 57, was a principal architect of IBMs $34 billion acquisition of Red Hat last year and was IBMs senior vice president of Cloud and Cognitive Software. Red Hat said Cormier drove more than 25 acquisitions at Red Hat and is credited with pioneering the subscription model that transformed Red Hat from an open-source disruptor to an enterprise-technology mainstay.
Also as part of the new team, IBM said it tapped Bank of America telecom and cloud-technology executive Howard Boville as senior vice president of cloud platform, overseeing the IBM Cloud.
Join the Network World communities on [Facebook][12] and [LinkedIn][13] to comment on topics that are top of mind.
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3536654/ibm-taps-new-leaders-for-hybrid-cloud-battles-ahead.html
作者:[Michael Cooney][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.networkworld.com/author/Michael-Cooney/
[b]: https://github.com/lujun9972
[1]: https://www.networkworld.com/article/3518795/ibms-ceo-virginia-rometty-to-be-replaced-by-its-cloud-red-hat-chiefs.html
[2]: https://www.networkworld.com/article/3233132/what-is-hybrid-cloud-computing.html
[3]: https://www.networkworld.com/newsletters/signup.html
[4]: https://www.cnbc.com/video/2020/04/06/watch-cnbcs-full-interview-with-new-ibm-ceo-arvind-krishna.html?linkId=85936703
[5]: https://www.linkedin.com/pulse/my-first-day-ceo-our-journey-together-arvind-krishna/?trackingId=SRWcJy7mSzagoHDTJX%2Br2Q%3D%3D
[6]: https://www.ibm.com/thought-leadership/covid19/
[7]: https://www.networkworld.com/article/3533426/covid-19-tech-giants-government-agencies-add-supercomputing-to-the-fight.html
[8]: https://www.networkworld.com/article/3534725/the-ins-and-outs-of-high-performance-computing-as-a-service.html
[9]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy)
[10]: https://www.networkworld.com/article/3215226/what-is-linux-uses-featres-products-operating-systems.html
[11]: https://www.networkworld.com/article/3317517/the-ibm-red-hat-deal-what-it-means-for-enterprises.html
[12]: https://www.facebook.com/NetworkWorld/
[13]: https://www.linkedin.com/company/network-world

View File

@ -0,0 +1,73 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (New Linux integrity checker from Microsoft, Raspberry Pi smart TV replacement from KDE, and more open source news)
[#]: via: (https://opensource.com/article/20/4/news-april-11)
[#]: author: (Ben Cotton https://opensource.com/users/bcotton)
New Linux integrity checker from Microsoft, Raspberry Pi smart TV replacement from KDE, and more open source news
======
Catch up on the biggest open source headlines from the past two weeks.
![][1]
In this edition of our open source news roundup, we take a look at GNOME Foundation's new contributor program, a new Linux integrity checker from Microsoft, a free software alternative to smart TVs, and more!
### GNOME Foundation launches a new contributor program
A key part of keeping open source communities vibrant and healthy is bringing in new contributors. To help promote this, the GNOME Foundation and Endless teamed up to launch the inaugural [Community Engagement Challenge][2]. Phase one launched this week by opening the call for submitting project applications. Candidate projects should be aimed at bringing beginners into open source and encouraging ongoing participation in open source communities. Projects dont have to be coding, they can also be games, videos, written materials, and so on.
A panel of judges will select 20 projects to participate in phase two, where ideas will be turned into proofs of concept. At each phase, cash prizes will be awarded. [Proposals][3] are due July 1, 2020.
### Microsoft announces code integrity checker for Linux
When you run a program, you want it to be the one you think youre running. This week, Microsoft announced [Integrity Policy Enforcement][4] (IPE), a Linux Security Model released under the GPLv2.
IPE is targeted toward specific-purpose devices like network firewalls, not for general-purpose computing. It provides runtime verification that the code being executed matches the desired version. This allows administrators to detect and block altered binaries.
IPE is currently in the Request for Comments stage on the [linux-security-module][5] mailing list.
### KDE announces Plasma Bigscreen
I recently bought a new TV and, if you havent been in the market lately, its hard to find “dumb” televisions. I didnt want a smart TV because I worry about the manufacturer abandoning the software and what the device might do with my data. So KDEs recent [Plasma Bigscreen][6] announcement caught my eye.
Plasma Bigscreen takes the KDE Plasma interface I use every day and combines it with [Mycroft AI][7] to turn single-board computers into a smart TV. The beta, released last month, includes support for the Raspberry Pi 4 (Model B).
### In other news
* [IVPN for Android is now available on F-Droid][8]
* [IBM gives Outreachy $50,000 grant][9]
* [Warren For President Tech Team open source many of their projects][10]
* [Firefox 75.0 is released with a redesigned address bar and distribution via Flatpak][11]
* [LineageOS releases version 17.1 based on Android 10][12]
* [Linux kernel 5.6 released][13]
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/news-april-11
作者:[Ben Cotton][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/bcotton
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/weekly_news_roundup_tv.png?itok=tibLvjBd
[2]: https://www.gnome.org/challenge
[3]: https://surveys.gnome.org/index.php/986379?lang=en
[4]: https://microsoft.github.io/ipe/
[5]: https://lore.kernel.org/linux-security-module/20200406181045.1024164-1-deven.desai@linux.microsoft.com/T/#m297116cd00666428c2ae3e627ff39653ebb691fb
[6]: https://dot.kde.org/2020/03/26/plasma-tv-presenting-plasma-bigscreen
[7]: https://mycroft.ai/
[8]: https://www.ivpn.net/blog/ivpn-for-android-is-now-available-on-f-droid
[9]: https://developer.ibm.com/blogs/ibm-second-open-source-community-grant-outreachy/
[10]: https://medium.com/@teamwarren/open-source-tools-from-the-warren-for-president-tech-team-f1f27d2c7551
[11]: https://www.mozilla.org/en-US/firefox/75.0/releasenotes/
[12]: https://lineageos.org/Changelog-24/
[13]: https://lore.kernel.org/lkml/CAHk-=wi9ZT7Stg-uSpX0UWQzam6OP9Jzz6Xu1CkYu1cicpD5OA@mail.gmail.com/

View File

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

View File

@ -0,0 +1,99 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (5 open source activities while you work from home)
[#]: via: (https://opensource.com/article/20/4/open-source-activities)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
5 open source activities while you work from home
======
Work-life balance is important whether you're working from home
temporarily or it's your usual mode of earning a living.
![Person in a field of dandelions][1]
The mythos of the remote home office or the exciting archetype of the digital nomad are as appealing as they are dangerous. It's great to be able to avoid a commute, to be able to stay comfortable at home while getting lots of work done, and to be master of your own schedule. But along with those liberties, you inherit the responsibility of remembering to be a normal, functioning human being. Believe it or not, the two aren't mutually exclusive. You can do both, but you have to work at it. Here are some ideas on how.
### Plant something
![Seeeduino in the garden][2]
You may have an abundance of little ones to care for during the day, and if you do, you should read our [article][3] about fun open source projects for kids and parents. If you don't, or if you're just keen to try caring for something that's quiet, then you might find it satisfying to plant something.
I used to think gardening was something you did as a way to establish a routine: each morning, you wake up and tend to your plants before you start your day, each evening you might pull weeds, and so on. Now that I have a garden, I realize that it's more like a low-stress puzzle. Learning to tend to plants is a little like learning to program. You learn the basics first, you learn to debug (literally, in the case of aphids), and then you learn how to optimize growth and maybe even [how to automate plant care][4].
If you're not attracted to gardening, there are plenty of other [outdoor projects][5] that are useful in getting you outdoors with a purpose and encouraging you to go back out for more.
### Go for a walk
![Walking][6]
The phrases "go for a walk" or "get some fresh air" are so common that they seem trite, but that doesn't make the result any less valid. Getting outside your usual workspace is vital for clarity and drive, but sometimes going outside feels a little pointless. You can only walk around the block so many times before the journey loses excitement.
If you need a goal for ambling around your neighborhood, you can download a handy app called [StreetComplete][7]. It's a quest-based app that presents you with points of interest in your area with incomplete [Open Street Map][8] data. You can help crowdsource better open source maps by verifying and providing information through the app. Suddenly, that aimless meandering you don't really want to do is a fun quest for you and your family.
### Diversify
![Mini stapler][9]
Being in an office can present exciting challenges, whether it's because you're in a dynamic industry or in a petty fight with a colleague over ownership of a stapler. When you work from home, your daily routine can get pretty, well, routine. If that's the case, it might be time to diversify.
If you've been meaning to [get involved with open source][10], now's a great time for it.
If you suspect you might be artistic (or even if you're convinced you're not, but you have something you want to express), then maybe it's time to finally learn how to create some [digital imagery][11].
Or maybe you're curious about programming. It might be easier than you think and given enough free time, you might even end up with [your own game written in Python][12].
### Make some music
![Music keyboardas][13]
Artistic expression is important, whether you're working from home or living with someone who's bored at home. The great thing about music is that you don't need to be _musical_ to [make some really cool noise][14]. In fact, you can make some [wild sounds on a Raspberry Pi][15], if you have one lying around.
If you happen to be musical, though, you can have a go at a digital audio workstation like [Qtractor][16] or [Rosegarden][17]. For inspiration, read about a [professional composer][18] and the music festival he created.
### Refurbish
![Old computers][19]
I don't like it when good things go to waste, especially computers. Read about [refurbishing old computers][20] and [really old computers][21], and then rummage around in your attic to find one for your own experiments.
### Meet the challenge
Being stuck at home for long periods of time, whether it's for a few weeks or the better part of your career, can be challenging. However, open source is a vast landscape of opportunity. Explore and find the parts of it that appeal to you. You can build a hobby, and maybe even a career, out of all the fun things you can do with other people's toys.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/open-source-activities
作者:[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_dandelion_520x292.png?itok=-xhFQvUj (Person in a field of dandelions)
[2]: https://opensource.com/sites/default/files/uploads/diversions_seeeduino.jpg (Seeeduino in the garden)
[3]: https://opensource.com/article/19/12/kids-students-education
[4]: https://opensource.com/article/17/3/arduino-garden-projects
[5]: https://opensource.com/article/19/5/hardware-outdoors
[6]: https://opensource.com/sites/default/files/uploads/diversions_walk.jpg (Walking)
[7]: https://opensource.com/article/20/1/streetcomplete-crowdsource-maps
[8]: https://opensource.com/article/17/8/openstreetmap
[9]: https://opensource.com/sites/default/files/uploads/diversions_stapler.jpg (Mini stapler)
[10]: https://opensource.com/article/17/10/open-source-cats
[11]: https://opensource.com/life/12/6/design-without-debt-five-tools-for-designers
[12]: https://opensource.com/article/17/10/python-101
[13]: https://opensource.com/sites/default/files/uploads/diversions_keyboards.jpg (Music keyboards)
[14]: https://opensource.com/life/16/2/linux-multimedia-studio
[15]: https://opensource.com/article/20/3/sonic-pi
[16]: https://opensource.com/article/17/6/qtractor-audio
[17]: https://opensource.com/article/18/3/make-sweet-music-digital-audio-workstation-rosegarden
[18]: https://opensource.com/article/20/2/linux-open-source-music
[19]: https://opensource.com/sites/default/files/uploads/diversions_old-computers.jpg (Old computers)
[20]: https://opensource.com/article/19/7/how-make-old-computer-useful-again
[21]: https://opensource.com/article/20/2/restore-old-computer-linux

View File

@ -1,232 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Different Ways To Update Linux Kernel For Ubuntu)
[#]: via: (https://www.ostechnix.com/different-ways-to-update-linux-kernel-for-ubuntu/)
[#]: author: (SK https://www.ostechnix.com/author/sk/)
Different Ways To Update Linux Kernel For Ubuntu
======
![](https://www.ostechnix.com/wp-content/uploads/2019/01/ubuntu-linux-kernel-720x340.png)
In this guide, we have given 7 different ways to update Linux kernel for Ubuntu. Among the 7 methods, five methods requires system reboot to apply the new Kernel and two methods dont. Before updating Linux Kernel, it is **highly recommended to backup your important data!** All methods mentioned here are tested on Ubuntu OS only. We are not sure if they will work on other Ubuntu flavors (Eg. Xubuntu) and Ubuntu derivatives (Eg. Linux Mint).
### Part A Kernel Updates with reboot
The following methods requires you to reboot your system to apply the new Linux Kernel. All of the following methods are recommended for personal or testing systems. Again, please backup your important data, configuration files and any other important stuff from your Ubuntu system.
#### Method 1 Update the Linux Kernel with dpkg (The manual way)
This method helps you to manually download and install the latest available Linux kernel from **[kernel.ubuntu.com][1]** website. If you want to install most recent version (either stable or release candidate), this method will help. Download the Linux kernel version from the above link. As of writing this guide, the latest available version was **5.0-rc1** and latest stable version was **v4.20**.
![][3]
Click on the Linux Kernel version link of your choice and find the section for your architecture (Build for XXX). In that section, download the two files with these patterns (where X.Y.Z is the highest version):
1. linux-image-*X.Y.Z*-generic-*.deb
2. linux-modules-X.Y.Z*-generic-*.deb
In a terminal, change directory to where the files are and run this command to manually install the kernel:
```
$ sudo dpkg --install *.deb
```
Reboot to use the new kernel:
```
$ sudo reboot
```
Check the kernel is as expected:
```
$ uname -r
```
For step by step instructions, please check the section titled under “Install Linux Kernel 4.15 LTS On DEB based systems” in the following guide.
+ [Install Linux Kernel 4.15 In RPM And DEB Based Systems](https://www.ostechnix.com/install-linux-kernel-4-15-rpm-deb-based-systems/)
The above guide is specifically written for 4.15 version. However, all the steps are same for installing latest versions too.
**Pros:** No internet needed (You can download the Linux Kernel from any system).
**Cons:** Manual update. Reboot necessary.
#### Method 2 Update the Linux Kernel with apt-get (The recommended method)
This is the recommended way to install latest Linux kernel on Ubuntu-like systems. Unlike the previous method, this method will download and install latest Kernel version from Ubuntu official repositories instead of **kernel.ubuntu.com** website..
To update the whole system including the Kernel, just do:
```
$ sudo apt-get update
$ sudo apt-get upgrade
```
If you want to update the Kernel only, run:
```
$ sudo apt-get upgrade linux-image-generic
```
**Pros:** Simple. Recommended method.
**Cons:** Internet necessary. Reboot necessary.
Updating Kernel from official repositories will mostly work out of the box without any problems. If it is the production system, this is the recommended way to update the Kernel.
Method 1 and 2 requires user intervention to update Linux Kernels. The following methods (3, 4 & 5) are mostly automated.
#### Method 3 Update the Linux Kernel with Ukuu
**Ukuu** is a Gtk GUI and command line tool that downloads the latest main line Linux kernel from **kernel.ubuntu.com** , and install it automatically in your Ubuntu desktop and server editions. Ukku is not only simplifies the process of manually downloading and installing new Kernels, but also helps you to safely remove the old and unnecessary Kernels. For more details, refer the following guide.
+ [Ukuu An Easy Way To Install And Upgrade Linux Kernel In Ubuntu-based Systems](https://www.ostechnix.com/ukuu-an-easy-way-to-install-and-upgrade-linux-kernel-in-ubuntu-based-systems/)
**Pros:** Easy to install and use. Automatically installs main line Kernel.
**Cons:** Internet necessary. Reboot necessary.
#### Method 4 Update the Linux Kernel with UKTools
Just like Ukuu, the **UKTools** also fetches the latest stable Kernel from from **kernel.ubuntu.com** site and installs it automatically on Ubuntu and its derivatives like Linux Mint. More details about UKTools can be found in the link given below.
+ [UKTools Upgrade Latest Linux Kernel In Ubuntu And Derivatives](https://www.ostechnix.com/uktools-upgrade-latest-linux-kernel-in-ubuntu-and-derivatives/)
**Pros:** Simple. Automated.
**Cons:** Internet necessary. Reboot necessary.
#### Method 5 Update the Linux Kernel with Linux Kernel Utilities
**Linux Kernel Utilities** is yet another program that makes the process of updating Linux kernel easy in Ubuntu-like systems. It is actually a set of BASH shell scripts used to compile and/or update latest Linux kernels for Debian and derivatives. It consists of three utilities, one for manually compiling and installing Kernel from source from [**http://www.kernel.org**][4] website, another for downloading and installing pre-compiled Kernels from from **<https://kernel.ubuntu.com>** website. and third script is for removing the old kernels. For more details, please have a look at the following link.
+ [Linux Kernel Utilities Scripts To Compile And Update Latest Linux Kernel For Debian And Derivatives](https://www.ostechnix.com/linux-kernel-utilities-scripts-compile-update-latest-linux-kernel-debian-derivatives/)
**Pros:** Simple. Automated.
**Cons:** Internet necessary. Reboot necessary.
### Part B Kernel Updates without reboot
As I already said, all of above methods need you to reboot the server before the new kernel is active. If they are personal systems or testing machines, you could simply reboot and start using the new Kernel. But, what if they are production systems that requires zero downtime? No problem. This is where **Livepatching** comes in handy!
The **livepatching** (or hot patching) allows you to install Linux updates or patches without rebooting, keeping your server at the latest security level, without any downtime. This is attractive for always-on servers, such as web hosts, gaming servers, in fact, any situation where the server needs to stay on all the time. Linux vendors maintain patches only for security fixes, so this approach is best when security is your main concern.
The following two methods doesnt require system reboot and useful for updating Linux Kernel on production and mission-critical Ubuntu servers.
#### Method 6 Update the Linux Kernel Canonical Livepatch Service
![][5]
[**Canonical Livepatch Service**][6] applies Kernel updates, patches and security hotfixes automatically without rebooting the Ubuntu systems. It reduces the Ubuntu systems downtime and keep them secure. Canonical Livepatch Service can be set up either during or after installation. If you are using desktop Ubuntu, the Software Updater will automatically check for kernel patches and notify you. In a console-based system, it is up to you to run apt-get update regularly. It will install kernel security patches only when you run the command “apt-get upgrade”, hence is semi-automatic.
Livepatch is free for three systems. If you have more than three, you need to upgrade to enterprise support solution named **Ubuntu Advantage** suite. This suite includes **Kernel Livepatching** and other services such as,
* Extended Security Maintenance critical security updates after Ubuntu end-of-life.
* Landscape the systems management tool for using Ubuntu at scale.
* Knowledge Base A private collection of articles and tutorials written by Ubuntu experts.
* Phone and web-based support.
**Cost**
Ubuntu Advantage includes three paid plans namely, Essential, Standard and Advanced. The basic plan (Essential plan) starts from **225 USD per year for one physical node** and **75 USD per year for one VPS**. It seems there is no monthly subscription for Ubuntu servers and desktops. You can view detailed information on all plans [**here**][7].
**Pros:** Simple. Semi-automatic. No reboot necessary. Free for 3 systems.
**Cons:** Expensive for 4 or more hosts. No patch rollback.
**Enable Canonical Livepatch Service**
If you want to setup Livepatch service after installation, just do the following steps.
Get a key at [**https://auth.livepatch.canonical.com/**][8].
```
$ sudo snap install canonical-livepatch
$ sudo canonical-livepatch enable your-key
```
#### Method 7 Update the Linux Kernel with KernelCare
![][9]
[**KernelCare**][10] is the newest of all the live patching solutions. It is the product of [CloudLinux][11]. KernelCare runs on Ubuntu and other flavors of Linux. It checks for patch releases every 4 hours and will install them without confirmation. Patches can be rolled back if there are problems.
**Cost**
Fees, per server: **4 USD per month** , **45 USD per year**.
Compared to Ubuntu Livepatch, kernelCare seems very cheap and affordable. Good thing is **monthly subscriptions are also available**. Another notable feature is it supports other Linux distributions, such as Red Hat, CentOS, Debian, Oracle Linux, Amazon Linux and virtualization platforms like OpenVZ, Proxmox etc.
You can read all the features and benefits of KernelCare [**here**][12] and check all available plan details [**here**][13].
**Pros:** Simple. Fully automated. Wide OS coverage. Patch rollback. No reboot necessary. Free license for non-profit organizations. Low cost.
**Cons:** Not free (except for 30 day trial).
**Enable KernelCare Service**
Get a 30-day trial key at [**https://cloudlinux.com/kernelcare-free-trial5**][14].
Run the following commands to enable KernelCare and register the key.
```
$ sudo wget -qq -O - https://repo.cloudlinux.com/kernelcare/kernelcare_install.sh | bash
$ sudo /usr/bin/kcarectl --register KEY
```
If youre looking for an affordable and reliable commercial service to keep the Linux Kernel updated on your Linux servers, KernelCare is good to go.
*with inputs from **Paul A. Jacobs** , a Technical Evangelist and Content Writer from Cloud Linux.*
**Suggested read:**
And, thats all for now. Hope this was useful. If you believe any other tools/methods should include in this list, feel free to let us know in the comment section below. I will check and update this guide accordingly.
More good stuffs to come. Stay tuned!
Cheers!
--------------------------------------------------------------------------------
via: https://www.ostechnix.com/different-ways-to-update-linux-kernel-for-ubuntu/
作者:[SK][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.ostechnix.com/author/sk/
[b]: https://github.com/lujun9972
[1]: http://kernel.ubuntu.com/~kernel-ppa/mainline/
[2]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
[3]: http://www.ostechnix.com/wp-content/uploads/2019/01/Ubuntu-mainline-kernel.png
[4]: http://www.kernel.org
[5]: http://www.ostechnix.com/wp-content/uploads/2019/01/Livepatch.png
[6]: https://www.ubuntu.com/livepatch
[7]: https://www.ubuntu.com/support/plans-and-pricing
[8]: https://auth.livepatch.canonical.com/
[9]: http://www.ostechnix.com/wp-content/uploads/2019/01/KernelCare.png
[10]: https://www.kernelcare.com/
[11]: https://www.cloudlinux.com/
[12]: https://www.kernelcare.com/update-kernel-linux/
[13]: https://www.kernelcare.com/pricing/
[14]: https://cloudlinux.com/kernelcare-free-trial5

View File

@ -1,156 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (MFGJT)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Best Audio Editors For Linux)
[#]: via: (https://itsfoss.com/best-audio-editors-linux)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
Best Audio Editors For Linux
======
Youve got a lot of choices when it comes to audio editors for Linux. No matter whether you are a professional music producer or just learning to create awesome music, the audio editors will always come in handy.
Well, for professional-grade usage, a [DAW][1] (Digital Audio Workstation) is always recommended. However, not everyone needs all the functionalities, so you should know about some of the most simple audio editors as well.
In this article, we will talk about a couple of DAWs and basic audio editors which are available as **free and open source** solutions for Linux and (probably) for other operating systems.
### Top Audio Editors for Linux
![Best audio editors and DAW for Linux][2]
We will not be focusing on all the functionalities that DAWs offer but the basic audio editing capabilities. You may still consider this as the list of best DAW for Linux.
**Installation instruction:** You will find all the mentioned audio editors or DAWs in your AppCenter or Software center. In case, you do not find them listed, please head to their official website for more information.
#### 1\. Audacity
![audacity audio editor][3]
Audacity is one of the most basic yet a capable audio editor available for Linux. It is a free and open-source cross-platform tool. A lot of you must be already knowing about it.
It has improved a lot when compared to the time when it started trending. I do recall that I utilized it to “try” making karaokes by removing the voice from an audio file. Well, you can still do it but it depends.
**Features:**
It also supports plug-ins that include VST effects. Of course, you should not expect it to support VST Instruments.
* Live audio recording through a microphone or a mixer
* Export/Import capability supporting multiple formats and multiple files at the same time
* Plugin support: LADSPA, LV2, Nyquist, VST and Audio Unit effect plug-ins
* Easy editing with cut, paste, delete and copy functions.
* Spectogram view mode for analyzing frequencies
#### 2\. LMMS
![][4]
LMMS is a free and open source (cross-platform) digital audio workstation. It includes all the basic audio editing functionalities along with a lot of advanced features.
You can mix sounds, arrange them, or create them using VST instruments. It does support them. Also, it comes baked in with some samples, presets, VST Instruments, and effects to get started. In addition, you also get a spectrum analyzer for some advanced audio editing.
**Features:**
* Note playback via MIDI
* VST Instrument support
* Native multi-sample support
* Built-in compressor, limiter, delay, reverb, distortion and bass enhancer
#### 3\. Ardour
![Ardour audio editor][5]
Ardour is yet another free and open source digital audio workstation. If you have an audio interface, Ardour will support it. Of course, you can add unlimited multichannel tracks. The multichannel tracks can also be routed to different mixer tapes for the ease of editing and recording.
You can also import a video to it and edit the audio to export the whole thing. It comes with a lot of built-in plugins and supports VST plugins as well.
**Features:**
* Non-linear editing
* Vertical window stacking for easy navigation
* Strip silence, push-pull trimming, Rhythm Ferret for transient and note onset-based editing
#### 4\. Cecilia
![cecilia audio editor][6]
Cecilia is not an ordinary audio editor application. It is meant to be used by sound designers or if you are just in the process of becoming one. It is technically an audio signal processing environment. It lets you create ear-bending sound out of them.
You get in-build modules and plugins for sound effects and synthesis. It is tailored for a specific use if that is what you were looking for look no further!
**Features:**
* Modules to achieve more (UltimateGrainer A state-of-the-art granulation processing, RandomAccumulator Variable speed recording accumulator,
UpDistoRes Distortion with upsampling and resonant lowpass filter)
* Automatic Saving of modulations
#### 5\. Mixxx
![Mixxx audio DJ ][7]
If you want to mix and record something while being able to have a virtual DJ tool, [Mixxx][8] would be a perfect tool. You get to know the BPM, key, and utilize the master sync feature to match the tempo and beats of a song. Also, do not forget that it is yet another free and open source application for Linux!
It supports custom DJ equipment as well. So, if you have one or a MIDI you can record your live mixes using this tool.
**Features**
* Broadcast and record DJ Mixes of your song
* Ability to connect your equipment and perform live
* Key detection and BPM detection
#### 6\. Rosegarden
![rosegarden audio editor][9]
Rosegarden is yet another impressive audio editor for Linux which is free and open source. It is neither a fully featured DAW nor a basic audio editing tool. It is a mixture of both with some scaled down functionalities.
I wouldnt recommend this for professionals but if you have a home studio or just want to experiment, this would be one of the best audio editors for Linux to have installed.
**Features:**
* Music notation editing
* Recording, Mixing, and samples
### Wrapping Up
These are some of the best audio editors you could find out there for Linux. No matter whether you need a DAW, a cut-paste editing tool, or a basic mixing/recording audio editor, the above-mentioned tools should help you out.
Did we miss any of your favorite? Let us know about it in the comments below.
--------------------------------------------------------------------------------
via: https://itsfoss.com/best-audio-editors-linux
作者:[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://en.wikipedia.org/wiki/Digital_audio_workstation
[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/01/linux-audio-editors-800x450.jpeg?resize=800%2C450&ssl=1
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/audacity-audio-editor.jpg?fit=800%2C591&ssl=1
[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/lmms-daw.jpg?fit=800%2C472&ssl=1
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/ardour-audio-editor.jpg?fit=800%2C639&ssl=1
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/01/cecilia.jpg?fit=800%2C510&ssl=1
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/01/mixxx.jpg?fit=800%2C486&ssl=1
[8]: https://itsfoss.com/dj-mixxx-2/
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/rosegarden.jpg?fit=800%2C391&ssl=1
[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/linux-audio-editors.jpeg?fit=800%2C450&ssl=1

View File

@ -1,179 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Navigating man pages in Linux)
[#]: via: (https://www.networkworld.com/article/3519853/navigating-man-pages-in-linux.html)
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
Navigating man pages in Linux
======
The man pages on a Linux system can do more than provide information on particular commands. They can help discover commands you didn't realize were available.
[Hello I'm Nik][1] [(CC0)][2]
Man pages provide essential information on Linux commands and many users refer to them often, but theres a lot more to the man pages than many of us realize.
You can always type a command like “man who” and get a nice description of how the man command works, but exploring commands that you might not know could be even more illuminating. For example, you can use the man command to help identify commands to handle some unusually challenging task or to show options that can help you use a command you already know in new and better ways.
Lets navigate through some options and see where we end up.
[MORE ON NETWORK WORLD: Linux: Best desktop distros for newbies][3]
### Using man to identify commands
The man command can help you find commands by topic. If youre looking for a command to count the lines in a file, for example, you can provide a keyword. In the example below, weve put the keyword in quotes and added blanks so that we dont get commands that deal with “accounts” or “accounting” along with those that do some counting for us.
```
$ man -k ' count '
anvil (8postfix) - Postfix session count and request rate control
cksum (1) - checksum and count the bytes in a file
sum (1) - checksum and count the blocks in a file
timer_getoverrun (2) - get overrun count for a POSIX per-process timer
```
To show commands that relate to new user accounts, we might try a command like this:
```
$ man -k "new user"
newusers (8) - update and create new users in batch
useradd (8) - create a new user or update default new user information
zshroadmap (1) - informal introduction to the zsh manual The Zsh Manual, …
```
Just to be clear, the third item in the list above makes a reference to “new users” liking the material and is not a command for setting up, removing or configuring user accounts. The man command is simply matching words in the command description, acting very much like the apropos command. Notice the numbers in parentheses after each command listed above. These relate to the man page sections that contain the commands.
### Identifying the manual sections
The man command sections divide the commands into categories. To list these categories, type “man man” and look for descriptions like those below. You very likely wont have Section 9 commands on your system.
[][4]
```
1 Executable programs or shell commands
2 System calls (functions provided by the kernel)
3 Library calls (functions within program libraries)
4 Special files (usually found in /dev)
5 File formats and conventions eg /etc/passwd
6 Games
7 Miscellaneous (including macro packages and conventions), e.g.
man(7), groff(7)
8 System administration commands (usually only for root)
9 Kernel routines [Non standard]
```
Man pages cover more than what we typically think of as “commands”. As you can see from the above descriptions, they cover system calls, library calls, special files and more.
The listing below shows where man pages are actually stored on Linux systems. The dates on these directories will vary because, with updates, some of these sections will get new content while others will not.
```
$ ls -ld /usr/share/man/man?
drwxr-xr-x 2 root root 98304 Feb 5 16:27 /usr/share/man/man1
drwxr-xr-x 2 root root 65536 Oct 23 17:39 /usr/share/man/man2
drwxr-xr-x 2 root root 270336 Nov 15 06:28 /usr/share/man/man3
drwxr-xr-x 2 root root 4096 Feb 4 10:16 /usr/share/man/man4
drwxr-xr-x 2 root root 28672 Feb 5 16:25 /usr/share/man/man5
drwxr-xr-x 2 root root 4096 Oct 23 17:40 /usr/share/man/man6
drwxr-xr-x 2 root root 20480 Feb 5 16:25 /usr/share/man/man7
drwxr-xr-x 2 root root 57344 Feb 5 16:25 /usr/share/man/man8
```
Note that the man page files are generally **gzipped** to save space. The man command unzips them as needed whenever you use the man command.
```
$ ls -l /usr/share/man/man1 | head -10
total 12632
lrwxrwxrwx 1 root root 9 Sep 5 06:38 [.1.gz -> test.1.gz
-rw-r--r-- 1 root root 563 Nov 7 05:07 2to3-2.7.1.gz
-rw-r--r-- 1 root root 592 Apr 23 2016 411toppm.1.gz
-rw-r--r-- 1 root root 2866 Aug 14 10:36 a2query.1.gz
-rw-r--r-- 1 root root 2361 Sep 9 15:13 aa-enabled.1.gz
-rw-r--r-- 1 root root 2675 Sep 9 15:13 aa-exec.1.gz
-rw-r--r-- 1 root root 1142 Apr 3 2018 aaflip.1.gz
-rw-r--r-- 1 root root 3847 Aug 14 10:36 ab.1.gz
-rw-r--r-- 1 root root 2378 Aug 23 2018 ac.1.gz
```
### Listing man pages by section
Even just looking at the first 10 man pages in Section 1 (as shown above), you are likely to see some commands that are new to you maybe **a2query** or **aaflip** (shown above).
An even better strategy for exploring commands is to list commands by section without looking at the files themselves but, instead, using a man command that shows you the commands and provides a brief description of each.
In the command below, the **-s 1** instructs man to display information on commands in section 1. The **-k .** makes the command work for all commands rather than specifying a particular keyword; without this, the man command would come back and ask “What manual page do you want?” So, use a keyword to select a group of related commands or a dot to show all commands in a section.
```
$ man -s 1 -k .
2to3-2.7 (1) - Python2 to Python3 converter
411toppm (1) - convert Sony Mavica .411 image to ppm
as (1) - the portable GNU assembler.
baobab (1) - A graphical tool to analyze disk usage
busybox (1) - The Swiss Army Knife of Embedded Linux
cmatrix (1) - simulates the display from "The Matrix"
expect_dislocate (1) - disconnect and reconnect processes
red (1) - line-oriented text editor
enchant (1) - a spellchecker
```
### How many man pages are there?
If youre curious about how many man pages there are in each section, you can count them by section with a command like this:
```
$ for num in {1..8}
> do
> man -s $num -k . | wc -l
> done
2382
493
2935
53
441
11
245
919
```
The exact number may vary, but most Linux systems will have a similar number of commands. If we use a command that adds these numbers together, we can see that the system that this command is running on has nearly 7,500 man pages. Thats a lot of commands, system calls, etc.
```
$ for num in {1..8}
> do
> num=`man -s $num -k . | wc -l`
> tot=`expr $num + $tot`
> echo $tot
> done
2382
2875
5810
5863
6304
6315
6560
7479 <=== total
```
Theres a lot you can learn by reading man pages, but exploring them in other ways can help you become aware of commands you may not have known were available on your system.
Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind.
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3519853/navigating-man-pages-in-linux.html
作者:[Sandra Henry-Stocker][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.networkworld.com/author/Sandra-Henry_Stocker/
[b]: https://github.com/lujun9972
[1]: https://unsplash.com/photos/YiRQIglwYig
[2]: https://creativecommons.org/publicdomain/zero/1.0/
[3]: https://www.networkworld.com/slideshow/153439/linux-best-desktop-distros-for-newbies.html#tk.nww-infsb
[4]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage)
[5]: https://www.facebook.com/NetworkWorld/
[6]: https://www.linkedin.com/company/network-world

View File

@ -1,138 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (tinyeyeser )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Control the firewall at the command line)
[#]: via: (https://fedoramagazine.org/control-the-firewall-at-the-command-line/)
[#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/)
Control the firewall at the command line
======
![][1]
A network _firewall_ is more or less what it sounds like: a protective barrier that prevents unwanted network transmissions. They are most frequently used to prevent outsiders from contacting or using network services on a system. For instance, if youre running a laptop at school or in a coffee shop, you probably dont want strangers poking around on it.
Every Fedora system has a firewall built in. Its part of the network functions in the Linux kernel inside. This article shows you how to change its settings using _firewall-cmd_.
### Network basics
This article cant teach you [everything][2] about computer networks. But a few basics suffice to get you started.
Any computer on a network has an _IP address_. Think of this just like a mailing address that allows correct routing of data. Each computer also has a set of _ports_, numbered 0-65535. These are not physical ports; instead, you can think of them as a set of connection points at the address.
In many cases, the port is a [standard number][3] or range depending on the application expected to answer. For instance, a web server typically reserves port 80 for non-secure HTTP communications, and/or 443 for secure HTTPS. The port numbers under 1024 are reserved for system and well-known purposes, ports 1024-49151 are registered, and ports 49152 and above are usually ephemeral (used only for a short time).
Each of the two most common protocols for Internet data transfer, [TCP][4] and [UDP][5], have this set of ports. TCP is used when its important that all data be received and, if it arrives out of order, reassembled in the right order. UDP is used for more time-sensitive services that can withstand losing some data.
An application running on the system, such as a web server, reserves one or more ports (as seen above, 80 and 443 for example). Then during network communication, a host establishes a connection between a source address and port, and the destination address and port.
A network firewall can block or permit transmissions of network data based on rules like address, port, or other criteria. The _firewall-cmd_ utility lets you interact with the rule set to view or change how the firewall works.
### Firewall zones
To verify the firewall is running, use this command with [sudo][6]. (In fairness, you can run _firewall-cmd_ without the _sudo_ command in environments where [PolicyKit][7] is running.)
```
$ sudo firewall-cmd --state
running
```
The firewalld service supports any number of _zones_. Each zone can have its own settings and rules for protection. In addition, each network interface can be placed in any zone individually The default zone for an external facing interface (like the wifi or wired network card) on a Fedora Workstation is the _FedoraWorkstation_ zone.
To see what zones are active, use the _get-active-zones_ flag. On this system, there are two network interfaces, a wired Ethernet card _wlp2s0_ and a virtualization (libvirt) bridge interface _virbr0_:
```
$ sudo firewall-cmd --get-active-zones
FedoraWorkstation
interfaces: wlp2s0
libvirt
interfaces: virbr0
```
To see the default zone, or all the defined zones:
```
$ sudo firewall-cmd --get-default-zone
FedoraWorkstation
$ sudo firewall-cmd --get-zones
FedoraServer FedoraWorkstation block dmz drop external home internal libvirt public trusted work
```
To see the services the firewall is allowing other systems to access in the default zone, use the _list-services_ flag. Here is an example from a customized system; you may see something different.
```
$ sudo firewall-cmd --list-services
dhcpv6-client mdns samba-client ssh
```
This system has four services exposed. Each of these has a well-known port number. The firewall recognizes them by name. For instance, the _ssh_ service is associated with port 22.
To see other port settings for the firewall in the current zone, use the _list-ports_ flag. By the way, you can always declare the zone you want to check:
```
$ sudo firewall-cmd --list-ports --zone=FedoraWorkstation
1025-65535/udp 1025-65535/tcp
```
This shows that ports 1025 and above (both UDP and TCP) are open by default.
### Changing zones, ports, and services
The above setting is a design decision.* It ensures novice users can use network facing applications they install. If you know what youre doing and want a more protective default, you can move the interface to the _FedoraServer_ zone, which prohibits any ports not explicitly allowed. _(**Warning:** if youre using the host via the network, you may break your connection — meaning youll have to go to that box physically to make further changes!)_
```
$ sudo firewall-cmd --change-interface=<ifname> --zone=FedoraServer
success
```
* _This article is not the place to discuss that decision, which went through many rounds of review and debate in the Fedora community. You are welcome to change settings as needed._
If you want to open a well-known port that belongs to a service, you can add that service to the default zone (or use _zone_ to adjust a different zone). You can add more than one at once. This example opens up the well-known ports for your web server for both HTTP and HTTPS traffic, on ports 80 and 443:
```
$ sudo firewall-cmd --add-service=http --add-service=https
success
```
Not all services are defined, but many are. To see the whole list, use the _get-services_ flag.
If you want to add specific ports, you can do that by number and protocol as well. (You can also combine _add-service_ and _add-port_ flags, as many as necessary.) This example opens up the UDP service for a network boot service:
```
$ sudo firewall-cmd --add-port=67/udp
success
```
**Important:** If you want your changes to be effective after you reboot your system or restart the firewalld service, you **must** add the _permanent_ flag to your commands. The examples here only change the firewall until one of those events next happens.
These are just some of the many functions of the _firewall-cmd_ utility and the firewalld service. There is much more information on firewalld at the projects [home page][8] thats worth reading and trying out.
* * *
_Photo by [Jakob Braun][9] on [Unsplash][10]._
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/control-the-firewall-at-the-command-line/
作者:[Paul W. Frields][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/pfrields/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2020/03/firewall-cmd-816x345.jpg
[2]: https://en.wikipedia.org/wiki/Portal:Internet
[3]: https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers
[4]: https://en.wikipedia.org/wiki/Transmission_Control_Protocol
[5]: https://en.wikipedia.org/wiki/User_Datagram_Protocol
[6]: https://fedoramagazine.org/howto-use-sudo/
[7]: https://en.wikipedia.org/wiki/Polkit
[8]: https://firewalld.org/
[9]: https://unsplash.com/@jakobustrop?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[10]: https://unsplash.com/s/photos/brick-wall?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText

View File

@ -1,102 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Build a private chat server with a Raspberry Pi and Rocket.Chat)
[#]: via: (https://opensource.com/article/20/3/raspberry-pi-rocketchat)
[#]: author: (Giuseppe Cassibba https://opensource.com/users/peppe8o)
Build a private chat server with a Raspberry Pi and Rocket.Chat
======
Create your own truly private chat and messaging solution with these
simple, cost-effective open source tools.
![Chat via email][1]
The internet offers plenty of free messaging services. Applications like WhatsApp and Viber are part of our daily life and are the most common way we communicate with relatives and friends. But security awareness is increasing the demand for a truly private chat solution. Furthermore, messaging apps take up a lot of space in our devices, so an alternative chat channel could be useful to share media, info, and contacts with our friends.
Today we are going to see how to install a private chat and messaging server with a [Raspberry Pi][2] and Rocket.Chat.
### What is Rocket.Chat?
[Rocket.Chat][3] is an open source solution that provides an enhanced chat service. It includes collaboration tools like media sharing, screen sharing, and video/audio calling support.
It can be used both via browser or from apps available in all the main app stores (Google Play, App Store, etc.).
In addition to the community version, Rocket.Chat also offers Enterprise and Professional versions, including support and additional features.
### What we need
For this project, Im going to use a cheaper Raspberry Pi 3 model A+. RPI 3 models B and B+, and RPI 4 model B should also work in the same way.
I also suggest a performing SD card, because Rocket.Chat can put a heavy workload on our Raspberry Pi. As discussed in other articles, a performing SD card strongly improves Raspbian OS performance.
Well use a lite version of Raspbian with pre-configured WiFi access and SSH service, so ![][4] there will no need for keyboards or HDMI cables.
### Step-by-step procedure
Start by [installing the last version of Raspbian Buster Lite][5].
Well simplify Rocket.Chat installation by using [Snap][6]. Login via SSH and type from the terminal:
```
sudo apt-get update
sudo apt-get upgrade
```
Install Snap:
```
`sudo apt-get install snapd`
```
For Snap installation, we need a system reboot to make it work:
```
`sudo reboot`
```
Login again via SSH and install the Rocket.Chat server with the simple command:
```
`sudo snap install rocketchat-server`
```
After installing from the terminal, please wait a while for Rocket.Chat to initialize its database and services. Have a cup of tea, and after a few minutes you should be able to reach with your browser the address http://&lt;&lt;YOUR_RPI_IP_ADDRESS&gt;&gt;:3000 and you should see the following:
![Rocket Chat setup wizard][7]
Complete the required forms, and everything should go fine. After four simple setup windows, you should reach the Rocket.Chat home page:
![Rocket Chat home page][8]
Enjoy!
_This article originally posted on [peppe8o.com][9], reposted with permission._
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/3/raspberry-pi-rocketchat
作者:[Giuseppe Cassibba][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/peppe8o
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/email_chat_communication_message.png?itok=LKjiLnQu (Chat via email)
[2]: https://opensource.com/resources/raspberry-pi
[3]: https://rocket.chat/
[4]: https://ir-na.amazon-adsystem.com/e/ir?t=peppe8o0b-20&l=am2&o=1&a=B07KKBCXLY
[5]: https://peppe8o.com/2019/07/install-raspbian-buster-lite-in-your-raspberry-pi/
[6]: https://snapcraft.io/
[7]: https://opensource.com/sites/default/files/uploads/rocket-chat-setup-wizard.jpg (Rocket Chat setup wizard)
[8]: https://opensource.com/sites/default/files/uploads/rocket-chat-home.jpg (Rocket Chat home page)
[9]: https://peppe8o.com/private-chat-and-messaging-server-with-raspberry-pi-and-rocket-chat/

View File

@ -1,117 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Using data from spreadsheets in Fedora with Python)
[#]: via: (https://fedoramagazine.org/using-data-from-spreadsheets-in-fedora-with-python/)
[#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/)
Using data from spreadsheets in Fedora with Python
======
![][1]
[Python][2] is one of the most popular and powerful programming languages available. Because its free and open source, its available to everyone — and most Fedora systems come with the language already installed. Python is useful for a wide variety of tasks, but among them is processing comma-separated value (**CSV**) data. CSV files often start off life as tables or spreadsheets. This article shows how to get started working with CSV data in Python 3.
CSV data is precisely what it sounds like. A CSV file includes one row of data at a time, with data values separated by commas. Each row is defined by the same _fields_. Short CSV files are often easily read and understood. But longer data files, or those with more fields, may be harder to parse with the naked eye, so computers work better in those cases.
Heres a simple example where the fields are _Name_, _Email_, and _Country_. In this example, the CSV data includes a field definition as the first row, although that is not always the case.
```
Name,Email,Country
John Q. Smith,jqsmith@example.com,USA
Petr Novak,pnovak@example.com,CZ
Bernard Jones,bjones@example.com,UK
```
### Reading CSV from spreadsheets
Python helpfully includes a _csv_ module that has functions for reading and writing CSV data. Most spreadsheet applications, both native like Excel or Numbers, and web-based such as Google Sheets, can export CSV data. In fact, many other services that can publish tabular reports will also export as CSV (PayPal for instance).
The Python _csv_ module has a built in reader method called _DictReader_ that can deal with each data row as an ordered dictionary (OrderedDict). It expects a file object to access the CSV data. So if our file above is called _example.csv_ in the current directory, this code snippet is one way to get at this data:
```
f = open('example.csv', 'r')
from csv import DictReader
d = DictReader(f)
data = []
for row in d:
data.append(row)
```
Now the _data_ object in memory is a list of OrderedDict objects :
```
[OrderedDict([('Name', 'John Q. Smith'),
('Email', 'jqsmith@example.com'),
('Country', 'USA')]),
OrderedDict([('Name', 'Petr Novak'),
('Email', 'pnovak@example.com'),
('Country', 'CZ')]),
OrderedDict([('Name', 'Bernard Jones'),
('Email', 'bjones@example.com'),
('Country', 'UK')])]
```
Referencing each of these objects is easy:
```
>>> print(data[0]['Country'])
USA
>>> print(data[2]['Email'])
bjones@example.com
```
By the way, if you have to deal with a CSV file with no header row of field names, the _DictReader_ class lets you define them. In the example above, add the _fieldnames_ argument and pass a sequence of the names:
```
d = DictReader(f, fieldnames=['Name', 'Email', 'Country'])
```
### A real world example
I recently wanted to pick a random winner from a long list of individuals. The CSV data I pulled from spreadsheets was a simple list of names and email addresses.
Fortunately, Python also has a helpful _random_ module good for generating random values. The _randrange_ function in the _Random_ class from that module was just what I needed. You can give it a regular range of numbers — like integers — and a step value between them. The function then generates a random result, meaning I could get a random integer (or row number!) back within the total number of rows in my data.
So this small program worked well:
```
from csv import DictReader
from random import Random
d = DictReader(open('mydata.csv'))
data = []
for row in d:
data.append(row)
r = Random()
winner = data[r.randrange(0, len(data), 1)]
print('The winner is:', winner['Name'])
print('Email address:', winner['Email'])
```
Obviously this example is extremely simple. Spreadsheets themselves include sophisticated ways to analyze data. However, if you want to do something outside the realm of your spreadsheet app, Python may be just the trick!
* * *
_Photo by [Isaac Smith][3] on [Unsplash][4]._
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/using-data-from-spreadsheets-in-fedora-with-python/
作者:[Paul W. Frields][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/pfrields/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2020/03/spreadsheets-python-816x345.jpg
[2]: https://python.org
[3]: https://unsplash.com/@isaacmsmith?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[4]: https://unsplash.com/s/photos/spreadsheets?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText

View File

@ -1,140 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (What is Arch User Repository (AUR)? How to Use AUR on Arch and Manjaro Linux?)
[#]: via: (https://itsfoss.com/aur-arch-linux/)
[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/)
What is Arch User Repository (AUR)? How to Use AUR on Arch and Manjaro Linux?
======
If you have been using [Arch Linux][1] or other distribution based on Arch such as Manjaro, you might have comes across the term AUR. You try to install a new software and someone suggests to install it from AUR. This leaves you confused.
What is this AUR? Why is it used? How to use AUR? Ill answer these questions in this article.
### What is AUR?
![][2]
AUR stands for Arch User Repository. It is a community-driven repository for Arch-based Linux distributions users. It contains package descriptions named [PKGBUILDs][3] that allow you to compile a package from source with [makepkg][4] and then install it via [pacman][5] (package manager in Arch Linux).
The AUR was created to organize and share new packages from the community and to help accelerate popular packages inclusion into the [community repository][6].
A good number of new packages that enter the official repositories start in the AUR. In the AUR, users are able to contribute their own package builds (PKGBUILD and related files).
The AUR community has the ability to vote for packages in the AUR. If a package becomes popular enough — provided it has a compatible license and good packaging technique — it may be entered into the community repository directly accessible by pacman.
In short, AUR is the way for developers to make new software available to Arch Linux users before the software is officially included in Arch repositories.
### Should you use AUR? Whats the risk involved?
Using the AUR is like crossing the street. If you proceed with caution you should be fine.
If you are new to Linux it is advised to not to use the AUR until you build a foundation knowledge about Arch/Manjaro and Linux in general.
It is true that anyone can upload packages to the AUR but the [Trusted Users][7] (TUs) are charged with keeping an eye on what gets uploaded. Although TUs perform quality control to the uploaded packages, there is in no guarantee that packages in the AUR are well formed or not malicious.
In practice the AUR seems to be quite safe but in theory it can do some damage, but only if you are not careful. A smart Arch user, **always** inspects PKGBUILDs and *.install files when building packages from the AUR.
Additionally TUs (Trusted Users) also remove packages in the AUR that are included in core/extra/community so there should be no naming conflicts between them. The AUR will often contain developmental versions of packages (cvs/svn/git/etc) but they will have modified names such as foo-git.
As for the AUR packages, pacman handles dependency resolution and detects file conflicts so you never have to worry about overwriting files in one package with files from another package unless you use the “force” option by default. If you do that, you probably have more serious problems than file conflicts.
### How to use AUR?
The simplest way to use AUR is through a AUR helper. An [AUR helper][8] is a command line tool (some has GUI as well) that lets you search for packages published on the AUR and install them.
##### Installing an AUR helper on Arch Linux
Lets say you want to use [Yay AUR helper][9]. Make sure that you have git installed on Linux. And then clone the repository, go to the directory and build the package.
Use these commands one by one for that:
```
sudo pacman -S git
sudo git clone https://aur.archlinux.org/yay-git.git
cd yay
makepkg -si
```
Once installed, you can use yay command like this to install a package:
```
yay -S package_name
```
Its not that you must use AUR helper for installing packages from AUR. Expand the next section to see how to use AUR without AUR helper.
##### Installing AUR packages without AUR helpers
If you dont want to use AUR helper, you can install packages from AUR on your own as well.
As soon as you find the package you want to install on [AUR page][10] it is advised to confirm “Licence”, “Popularity”, “Last Updated”, “Dependencies” and so on as an extra quality control step.
```
git clone [package URL]
cd [package name]
makepkg -si
```
For example. lets say you want to install [telegram desktop package][11]:
```
git clone https://aur.archlinux.org/telegram-desktop-git.git
cd telegram-desktop-git
makepkg -si
```
#### Enabling AUR support in Manjaro Linux
AUR isnt enabled by default and you have to enable it through pamac. My laptop runs [Manjaro][12] Cinnamon but the steps are same for all Manjaro flavors.
Open Pamac (listed as Add/Remove Software):
![][13]
Once you are in pamac go to preferences like shown below.
![][14]
In preferences dialog box go to AUR tab, enable the AUR support, enable check for updates and close the dialog box.
![][15]
You can now search for packages and those which belong to AUR can be identified by the tag under the package descriptions.
![][16]
I hope you find this article useful and keep an eye on social media for upcoming Arch related topics.
--------------------------------------------------------------------------------
via: https://itsfoss.com/aur-arch-linux/
作者:[Dimitrios Savvopoulos][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/dimitrios/
[b]: https://github.com/lujun9972
[1]: https://www.archlinux.org/
[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/what-is-aur.png?ssl=1
[3]: https://wiki.archlinux.org/index.php/PKGBUILD
[4]: https://wiki.archlinux.org/index.php/Makepkg
[5]: https://wiki.archlinux.org/index.php/Pacman#Additional_commands
[6]: https://wiki.archlinux.org/index.php/Community_repository
[7]: https://wiki.archlinux.org/index.php/Trusted_Users
[8]: https://itsfoss.com/best-aur-helpers/
[9]: https://github.com/Jguer/yay
[10]: https://aur.archlinux.org/
[11]: https://aur.archlinux.org/packages/telegram-desktop-git
[12]: https://manjaro.org/
[13]: https://i1.wp.com/i.imgur.com/kFF6HtW.png?ssl=1
[14]: https://i0.wp.com/i.imgur.com/47r963A.png?ssl=1
[15]: https://i1.wp.com/i.imgur.com/UThiDHO.png?ssl=1
[16]: https://i2.wp.com/i.imgur.com/RM5BKi2.png?ssl=1

View File

@ -1,114 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Bitwarden: A Free & Open Source Password Manager)
[#]: via: (https://itsfoss.com/bitwarden/)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
Bitwarden: A Free & Open Source Password Manager
======
_**Brief:** Bitwarden is a popular open-source password manager. Here, we take a look at what it has to offer._
![][1]
[Bitwarden][2] is a free and open-source password manager. You might remember that earlier we listed it as one of the [best password managers available for Linux][3].
Personally, Ive been using Bitwarden as my password manager across multiple devices for several months now. So, in this article, Ill be mentioning the features it offers along with my experience with it.
**Note:** _In case you have questions about how secure the service is, check out their official security [FAQ page][4] to explore about it._
### Features of Bitwarden password manager
![][5]
[Bitwarden][2] is an impressive alternative to a lot of other convenient password managers out there.
Heres a breakdown of the features:
* Free &amp; Paid options available
* Available for Teams (Enterprise) and Individuals
* Open source
* Self-hosting support
* Ability to use it as an authenticator app (like Google Authenticator)
* Cross-platform support (Android, iOS, Linux, Windows, &amp; macOS)
* Browser extensions available (Firefox, Chrome, Opera, Edge, Safari)
* Offers command-line tools
* Offers a Web Vault
* Ability to Import/Export Passwords
* [Password Generator][6]
* Auto-fill password
* Two-step authentication
Technically, Bitwarden is completely free to use however, it also offers some paid plans (Personal pricing plans &amp; Business plans).
With the premium plans, you get the ability to share the passwords with more users, get API access (business use), and more such premium perks.
Heres how the pricing looks like (at the time of writing this article):
![][7]
For most individuals, the premium personal plan of **$10/year** shouldnt be an issue considering the fact that you will be supporting an open-source project. Of course, you can also choose to use it for free with no essential restrictions.
### Installing Bitwarden on Linux
![][8]
Its quite easy to get Bitwarden installed on your Linux system because it offers an .**AppImage** file. You can refer to our guide on [how to use AppImage][9] files, if you didnt know it already.
If you dont prefer using AppImage you can opt for the [snap package][10] or simply download the **.deb** or **.rpm** file available on their [official download page][11]. You can also check out their [GitHub page][12] for more information.
[Download Bitwarden][2]
You can also utilize the browser extensions if youre not interested in using the desktop app.
### My experience with Bitwarden
Before Bitwarden, I was using [LastPass][13] as my password manager. Even though thats not a bad option its not an open-source software.
So, I decided to switch to Bitwarden as soon as I found out about it.
To start with, I simply exported my data from LastPass and imported it to Bitwarden without any hiccups. I didnt lose any data in the process.
In addition to the desktop app, Ive been using Bitwarden the Firefox add-on, and the Android app. I havent had any issues with it after over six months of usage. So, Id definitely give it thumbs up from my side if youre willing to try it out!
### Wrapping Up
Id say that Bitwarden is a complete solution for Linux users who want a password manager that works everywhere and syncs easily across multiple devices.
You can get started for free but if you can, please go for the premium plan of **$10/year** to support this open-source project.
You may also check our list of [top 5 password managers for Linux][3] should come in handy if youre looking for more options.
Have you tried Bitwarden yet? If not, give it a try! Also, what is your favorite password manager? Let me know in the comments below!
--------------------------------------------------------------------------------
via: https://itsfoss.com/bitwarden/
作者:[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://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/bitwarden-screenshot.jpg?ssl=1
[2]: https://bitwarden.com/
[3]: https://itsfoss.com/password-managers-linux/
[4]: https://help.bitwarden.com/security/
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/bitwarden-dark-mode.jpg?ssl=1
[6]: https://itsfoss.com/password-generators-linux/
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/bitwarden-pricing.jpg?ssl=1
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/bitwarden-settings.png?ssl=1
[9]: https://itsfoss.com/use-appimage-linux/
[10]: https://snapcraft.io/bitwarden
[11]: https://bitwarden.com/#download
[12]: https://github.com/bitwarden
[13]: https://www.lastpass.com/

View File

@ -0,0 +1,94 @@
[#]: collector: (lujun9972)
[#]: translator: (tinyeyeser )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to avoid man-in-the-middle cyber attacks)
[#]: via: (https://opensource.com/article/20/4/mitm-attacks)
[#]: author: (Jackie Lam https://opensource.com/users/beenverified)
How to avoid man-in-the-middle cyber attacks
======
Understanding MITM attacks is the first step in not being a victim of
this high-tech style of eavesdropping.
![Security monster][1]
Whether you're sending data on your computer or talking to someone online, you want to assume some level of security and privacy.
But what if a third party is eavesdropping online, unbeknownst to you? And worse, what if they're impersonating someone from a business you trust in order to gain damaging information? This could put your personal data into the hands of dangerous, would-be thieves.
Welcome to what's called a man-in-the-middle (MITM) attack.
### What are man-in-the-middle attacks?
A man-in-the-middle attack occurs when a cybercriminal inserts themselves into communications between you, the targeted victim, and a device in order to steal sensitive information that can be used for a variety of criminal purposes—most notably identity theft, says Steve J. J. Weisman, founder of Scamicide.
"A man-in-the-middle-attack can also occur when the victim believes he or she is communicating with a legitimate app or website," says Weisman, "when the truth is that the victim is communicating with a phony website or app and thereby providing sensitive information to the criminal."
One of the oldest forms of cyberattacks, MITM attacks have been around since the 1980s. What's more, they're quite common. As Weisman explains, there are a handful of ways a MITM attack can happen:
* **Attacking a WiFi router that is not properly secured:** This typically occurs when someone is using public WiFi. "While home routers might be vulnerable, it's more common for criminals to attack public WiFi networks," says Weisman. The goal is to spy on unsuspecting people who are handling sensitive information, such as their online bank accounts, he adds.
* **Hacking email accounts of banks, financial advisers, and other companies:** "Once [the criminals] have hacked these email systems, they send out emails that appear to come from the legitimate bank or other company," Weisman says. "[They ask] for personal information, such as usernames and passwords, under the guise of an emergency. The targeted victim is lured into providing that information."
* **Sending phishing emails:** Thieves might also send emails pretending to be legitimate companies that the targeted victim does business with, asking the recipient for their personal information. "In many instances, the spear-phishing emails will direct the victim to a counterfeit website that appears to be that of a legitimate company with which the victim does business," says Weisman.
* **Using malicious code in legitimate websites:** Attackers can also place malicious code—usually JavaScript—into a legitimate website by way of a web application. "When the victim loads the legitimate page, the malicious code just sits in the background until the user enters sensitive information, such as account login or credit card details, which the malicious code then copies and sends to the attackers' servers," says Nicholas McBride, a cybersecurity consultant.
### What is an example of an MITM attack?
The Lenovo case is a well-known example of an MITM attack. In 2014 and 2015, the major computer manufacturer sold consumer laptops with preinstalled software that meddled with how a user's browser communicated with websites. Whenever the user's cursor hovered over a product, this software, called VisualDiscovery, sent pop-up ads from retail partners that sold similar products.
Here's the kicker: This MITM attack allowed VisualDiscovery to access all of the user's personal data, including social security numbers, info about financial transactions, medical info, and logins and passwords. All without the user knowing or granting permission beforehand. The FTC deemed this a deceptive and unfair online scam. Lenovo agreed to pay $8.3 million in a class-action settlement in 2019.
### How can I protect myself from an online attack?
* **Avoid using public WiFi:** Weisman recommends never using public WiFi for financial transactions unless you've installed a reliable virtual private network (VPN) client on your device and have a VPN host you can use and trust. Over a VPN connection, your communications are encrypted, so your information can't be stolen.
* **Be on the lookout:** Be wary of emails or text messages that ask you to update your password or provide your username or personal information. These methods can be used to steal your identity.
If you are unsure of the actual identity of the party sending you the email, you can use tools such as a reverse phone or email search. With a reverse phone number lookup, you may be able to find out more about the identity of an unknown texter. And with a reverse email lookup, you can try to determine who might have sent you a message.
Generally, if something's actually a problem, you'll hear from someone you know and trust within your company, or from someone you can also go and meet, in person, at your bank or school or other organization. Important account information is never the purview of an unknown technician.
* **Don't click on links contained in emails:** If someone sends you an email telling you that you need to sign into an account, don't click on the link provided in the email. Instead, navigate to the site yourself, log in as you normally would, and look for an alert there. If you don't see an alert message in your account settings, contact a representative by phone using contact information on the site and _not_ from the email.
* **Install reliable security software:** If you're on Windows, install good open source antivirus like [ClamAV][2]. On all platforms, keep your software up to date with the latest security patches.
* **Take alerts seriously:** If you're visiting a site that starts with HTTPS, your browser might alert you to an issue, says McBride. For instance, if the domain name on the site's certificate doesn't match the one you're trying to visit. Don't ignore the alert. Heed it and navigate away from the site for now. Verify that you haven't [mistyped it][3], and if the problem persists, contact the site owner if you can.
* **Use an ad blocker:** Pop-up ads (also known as _adware attacks_) can be used to intercept your personal information, so use an ad blocker. "The truth is, as an individual user, it's hard to protect against a MITM attack," says McBride, "as it is designed to leave the victim in the dark and to prevent them from noticing that there is anything wrong."
A good open source ad blocker (or "wide-spectrum blocker," in the developer's words) is [uBlock origin][4]. It's available for both Firefox and Chromium (and all Chromium-based browsers, such as Chrome, Brave, Vivaldi, Edge, and so on), and even Safari.
### Stay alert
Remember, you don't have to click anything online right away, and you don't have to follow random people's instructions, no matter how urgent they may seem. The internet will still be there after you step away from the computer and verify the identity of a person or site demanding your attention.
While MITM attacks can happen to anyone, understanding what they are, knowing how they happen, and actively taking steps to prevent them can safeguard you from being a victim.
* * *
_This article was originally published on [BeenVerified.com][5] under a [CC BY-SA 2.0][6] license._
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/mitm-attacks
作者:[Jackie Lam][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/beenverified
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/security_password_chaos_engineer_monster.png?itok=J31aRccu (Security monster)
[2]: https://www.clamav.net
[3]: https://opensource.com/article/20/1/stop-typosquatting-attacks
[4]: https://github.com/gorhill/uBlock
[5]: https://www.beenverified.com/crime/what-is-a-man-in-the-middle-attack/
[6]: https://creativecommons.org/licenses/by-sa/2.0/

View File

@ -0,0 +1,186 @@
[#]: collector: (lujun9972)
[#]: translator: (MjSeven)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to use pyenv to run multiple versions of Python on a Mac)
[#]: via: (https://opensource.com/article/20/4/pyenv)
[#]: author: (Matthew Broberg https://opensource.com/users/mbbroberg)
How to use pyenv to run multiple versions of Python on a Mac
======
If you need to run a project that uses a Python version you don't have
installed on macOS, try pyenv.
![Searching for code][1]
Managing a local Python development environment continues to be a challenge, even for experienced developers. While there are well-documented [strategies for package management][2], there is another step necessary to ensure you are running the version of Python you need when you need it.
### Why does the version of Python matter?
It's a strange concept at first, but programming languages change like any other software. They have bugs, fixes, and updates like any of your favorite [APIs][3] and any other software. Similarly again, different releases are identified by a three-digit number known as a [semantic version][4].
> 😭😭😭 [pic.twitter.com/yt1Z2439W8][5]
>
> — Denny Perez (@dennyperez18) [May 28, 2019][6]
For many years, Python 2 was the commonly used major version of the programming language. In January 2020, Python 2 [reached end of life][7], and only Python 3 will be supported by the language's core maintainers from then forward. Python 3 is developing steadily, and releasing new updates regularly. That makes it important for me to regularly get those updates.
Recently, I tried to run a project on macOS that depended on Python 3.5.9, a version that I did not have installed on my system. It might seem logical to think the Python package manager **pip** could install it*, but that wasn't the case:
```
$ pip install python3.5.9
Collecting python3.5.9
  ERROR: Could not find a version that satisfies the requirement python3.5.9 (from versions: none)
ERROR: No matching distribution found for python3.5.9
```
Alternatively, I could have downloaded that version from the official Python website, but how would I run it in on my Mac alongside my existing version of Python? Specifying the version of Python I intend to use every time I run the interpreter (python3.7 or python3.5 for example) seems error-prone at best. There has to be a better way.
_(A note on the above: I know this makes no sense to seasoned Python developer, but it made sense to me at the time. I would happily talk about why I still think it should.)_
### Installing and setting up pyenv
Thankfully, **pyenv** exists to work around this series of complexities. To start, I needed to install pyenv. I could clone and compile it myself [from source][8], but I prefer to manage packages like this through the Homebrew package manager:
```
`$ brew install pyenv`
```
In order to use the version of Python through pyenv, it's essential to understand the shell's PATH variable. PATH determines where the shell searches for files by the name of the command. You must ensure the shell will find the version of Python run by pyenv, not the one installed by default (which is often called the _system version_). If you don't change the path, here is the result:
```
$ which python
/usr/bin/python
```
That's the system version of Python.
To set up pyenv correctly, you can run the following in Bash or zsh:
```
`$ PATH=$(pyenv root)/shims:$PATH`
```
Now, if you check the version of Python, you'll see it is the one managed by pyenv:
```
$ which python
/Users/my_username/.pyenv/shims/python
```
That export statement (PATH=) will only change for this shell instance, so make it a permanent change, you need to add it to your dotfiles. Since zsh is officially macOS's default shell, I'll focus on it. Append that same syntax to the **~/.zshrc** file:
```
`$ echo 'PATH=$(pyenv root)/shims:$PATH' >> ~/.zshrc`
```
Now every time we run a command in zsh, it will use the pyenv version of Python. Note that I used single quotes with **echo** so it does not evaluate and expand the commands.
The .zshrc file only manages zsh instances, so be sure to check what your shell is and edit the associated dotfiles. If you need to double-check what your default shell is, you can run **echo $SHELL**. If it's zsh, use the command above. If you use Bash, change **~/.zshrc** to **~/.bashrc**. You can dive deep into [path setting][9] in pyenv's README if you would like to learn more.
### Using pyenv to manage Python versions
Now that pyenv is in control, we can see it only has the system Python available to it:
```
$ pyenv versions
system
```
As mentioned above, you absolutely do not want to use this version ([read more on why][10]). Now that pyenv is set up correctly, I want it to have a few different versions of Python that I regularly use.
There is a way to see all Python versions available from all the different repositories pyenv has access to by running **pyenv install --list**. It's a long, overwhelming list that may be helpful to review in the future. For now, I stick with the latest of each dot-release (3.5.x or 3.6.x where x is the latest) found on the [Python download page][11]. With that in mind, I'll install 3.5.9 and 3.8.0:
```
$ pyenv install 3.5.9
$ pyenv install 3.8.0
```
This will take a while, so get some tea (or read one of the links above). It's interesting to note that the output walks through the download and building of that version of Python. For example, the output shows that the file comes directly from [Python.org][12].
Once everything is installed, you can set up your defaults. I like to live at the cutting edge, so I set my global default Python version to the latest:
```
`$ pyenv global 3.8.0`
```
And that version is immediately set in my shell. To confirm:
```
$ python -V
Python 3.8.0
```
The project I want to run works only with Python 3.5, so I'll set the version locally and confirm it's in use:
```
$ pyenv local 3.5.9
$ python -V
Python 3.5.9
```
Because I used the **local** option with pyenv, it added a file to my current directory to track that information. 
```
$ cat .python-version
3.5.9
```
Now, I can finally set up a virtual environment for the project I want and be sure I'm running the right version of Python.
```
$ python -m venv venv
$ source ./venv/bin/activate
(venv) $ which python
/Users/mbbroberg/Develop/my_project/venv/bin/python
```
To learn more, check out this tutorial about [managing virtual environments on a Mac][13].
### Wrapping up
By default, running multiple Python versions can be a challenge. I find starting with pyenv ensures I have the versions of Python I need set up to run when I need them.
Do you have other beginner or intermediate Python questions? Leave a comment, and we will consider them for a future article.
Newcomers to python-ideas occasionally make reference to the idea of "Python 4000" when proposing...
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/pyenv
作者:[Matthew Broberg][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/mbbroberg
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/search_find_code_python_programming.png?itok=ynSL8XRV (Searching for code)
[2]: https://opensource.com/article/19/4/managing-python-packages
[3]: https://opensource.com/article/19/5/api-evolution-right-way
[4]: https://semver.org/
[5]: https://t.co/yt1Z2439W8
[6]: https://twitter.com/dennyperez18/status/1133505310516232203?ref_src=twsrc%5Etfw
[7]: https://opensource.com/article/19/11/end-of-life-python-2
[8]: https://github.com/pyenv/pyenv
[9]: https://github.com/pyenv/pyenv#understanding-path
[10]: https://opensource.com/article/19/5/python-3-default-mac
[11]: https://www.python.org/downloads/
[12]: http://python.org
[13]: https://opensource.com/article/19/6/python-virtual-environments-mac

View File

@ -0,0 +1,92 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Love or hate chat? 4 best practices for remote teams)
[#]: via: (https://opensource.com/article/20/4/chat-tools-best-practices)
[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike)
Love or hate chat? 4 best practices for remote teams
======
Plus, learn about a few open source alternatives for chat.
![Chat via email][1]
Chat is a part of most people's daily lives, especially if you work in tech, and especially if you work with teammates located in different parts of the world. It can be a great way to achieve these goals:
* **to connect**; to share with teammates on a personal level
* **to get work done**; to communicate with teammates about work in progress
* **to share**; to give notes and feedback from experiences, meetings, and interactions outside of the group that may be relevant to your work or interests
I encourage you to explore [open source alternatives to chat][2] like [Mattermost][3], [Rocket.Chat][4], and [Riot][5].
### To chat or not to chat, that is the question
First, it's important to make time to have a discussion with each member of your team focused on answering whether they are comfortable with using a chat platform to keep in touch throughout the workday. Some people enjoy chat and see it as a vital part of their workday, getting things done and communicating with teammates who they rely on to get that work done and move forward with projects. Others struggle with chat as a way of getting work done and prefer to use it when they feel like having more casual conversations with teammates on topics less focused on work and more on social interaction and personal sharing. Some people wish chat would burn in a fire.
Gather these opinions and talk through these feelings with each person. You can do this as a group or one-on-one if that feels more appropriate.
Why? Because communication is important and always will be, and your team will find a way to chat no matter what you do. We're human, and need various levels and types of interaction with each other throughout our days and lives. And when it comes to our work colleagues, it's helpful to put some structure in place to guide your team.
### Best practices for team chat
If you have decided to use chat in some form, the next step is to place structure around when and how to use it and **not** use it. These best practices work well for teams who are working remotely and at home, as well as in the office.
**1\. Create rooms and threads to focus your conversations.**
My team has a room for each of our sub-teams who work on a particular project together. We also have an at-large room for all of us to banter and share.
Additionally, we use threads to focus on one topic at a time which is helpful when you have several to dozens of teammates in one room together. It helps conversations to continue and not stop prematurely because they were lost in the mix of other conversations.
**2\. Decide when your team will be signed in and available to talk.**
Is it throughout the workday (whatever hours those are for you), during a set timeframe, or as desired?
My team has set the expectation that they will be signed in and available to chat at some point during the workday **about work-related topics**, and that at that time they will check for and respond to messages that were sent to them while they were away. So, we are using it as an asynchronous way to communicate about work.
For us, asynchronous chat helps us plan and schedule each day how we see fit with the goal of being productive and serving our project in the best we can _that day_.
If a teammate does **not** plan on signing in and responding to messages one day, that is OK, and we set the expectation that they will send a message to let the team know. For my team, almost no communication is wrong (see guideline #4), but it should be communicated. We also review our schedules for the following week in a team meeting the week before so we know when someone will be away from their desk, not working, or blocking out a chunk of time for a project.
**3\. Decide when your teammates are responsible for responding (and when they are not).**
Use @ mentions if you want someone to see and respond to your question or comment in chat. Don't expect them to be watching every thread and conversation. 
And I would recommend that you take it a step further and define when teammates should be responsible for responding and when they should not. This type of decision is meant to free you and your teammates, not hold you down. The more you understand the expectations, the freer you are to operate within the same understood universe. When you are unsure of the rules, you may act and make decisions in fear or trepidation instead, like staying signed in to chat all day when you really just need to block it out to get something done.
Our team has decided that it's nice if you can respond in chat when you are mentioned, but if you don't that is OK. Perhaps you were AFK during that time and lost track of the notification. For us, if you definitely want a response to something from someone, send them an email. 
**4\. Communicate clearly and with kindness.**
The way we interpret messages when we are chatting via text is different than when we are chatting verbally, in-person or over video.
My team uses a lot of humor, emojis, and clear, concise messages to chat with each other.
We also hold weekly in-person or video conference meetings so that we can get to know each other better. The more you trust someone, the easier it is to give them the benefit of the doubt when you're confused by a message and the better you are at understanding what they are saying and what their intention is behind the text coming through to you.
### Signing off
What best practices does your team use? Do you love or hate chat, and why? 
For all kinds of teams today, chat is a special part of how we stay connected, working, and sharing with each other. Finding ways to do that in a healthy and committed way is part of everyone's responsibility.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/chat-tools-best-practices
作者:[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/email_chat_communication_message.png?itok=LKjiLnQu (Chat via email)
[2]: https://opensource.com/alternatives/slack
[3]: https://mattermost.com/
[4]: https://rocket.chat/
[5]: https://riot.im/app/

View File

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

View File

@ -0,0 +1,89 @@
[#]: collector: (lujun9972)
[#]: translator: (qfzy1233 )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to Create Templates in LibreOffice to Save Time and Increase Productivity)
[#]: via: (https://itsfoss.com/create-templates-libreoffice/)
[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/)
How to Create Templates in LibreOffice to Save Time and Increase Productivity
======
Creating a template in [LibreOffice][1] can save you some time for the documents that you use often. It can be a letter, a financial spreadsheet or even a presentation.
Time is one factor that a template can save and on the other hand it provides consistency where a group of people in an organization work together at the same project.
For example, if you are a small organization that has to often issue certificates of experience, instead of copy-pasting from a saved document somewhere, you can create a template. When you need to issue a new certificate of experience, you create a new one from the template, edit it slightly and you are good to go.
LibreOffice comes with a few templates by default but you are not restricted to use just them. You are free to create your own as per your requirements.
I think templates are one of the [essential LibreOffice tips][2] that every user should know. Let me show you how to do it.
### How to create a template in LibreOffice
First, create the document that you want to reuse with minimal editing. It could be a document, spreadsheet or presentation. I am using a word document in the example but the steps are the same for all of them.
Now go to file and select Save as Template. You will be prompted to give a name and a category from the menu, the press save.
![Creating a new template in LibreOffice][3]
This file will be saved in the LibreOffice template folder in .ots format. You can use these .ots files on other systems that have LibreOffice installed and use the same templates on those systems as well.
### How to use templates in LibreOffice
To use a template, select File and then Templates.
Dont worry! Opening a template LibreOffice creates a copy without affecting the original template. You can edit the document without worrying about your template getting changed.
![Using templates][4]
Once you choose your template, click open. You can edit it as you like.
### How to change a template in LibreOffice
Needs may change from time to time and adjustments to your templates can be necessary.
To edit an existing template go to File -&gt; Templates and then right click on the desired template and click edit.
![edit Template][5]
When you finish editing the template, click on save to make the changes permanent.
**Recommended Read:**
![][6]
#### [7 LibreOffice Tips To Get More Out of It][2]
LibreOffice is an excellent office suite. These LibreOffice tips will enable you to use it more effectively.
All in all templates are great not only at reducing the workload on repetitive tasks but also for user mistake proofing. You can take advantage of your computers ability to handle a repetitive task but with flexibility. It increases your efficiency.
Bonus Tip!
You can find tons of additional templates on the [LibreOffice website][7]. You can search for the ones you need, download them and use them. Be advised that these are from third-party, unverified users. So use them at your risk.
Ill keep on sharing more such tips in future. Meanwhile, you may also learn about creating templates to [add the “create new document” option in the right click menu context in GNOME][8].
--------------------------------------------------------------------------------
via: https://itsfoss.com/create-templates-libreoffice/
作者:[Dimitrios Savvopoulos][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/dimitrios/
[b]: https://github.com/lujun9972
[1]: https://www.libreoffice.org/
[2]: https://itsfoss.com/libreoffice-tips/
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/1.Template-save-as.png?resize=800%2C567&ssl=1
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/2.Use-a-template.png?ssl=1
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/3.edit-template.png?ssl=1
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2017/12/LibreOffice-logo.jpeg?fit=800%2C450&ssl=1
[7]: https://extensions.libreoffice.org/templates
[8]: https://itsfoss.com/add-new-document-option/

View File

@ -0,0 +1,77 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (My Linux Story: From 8-bit enthusiast to Unix sysadmin)
[#]: via: (https://opensource.com/article/20/4/linux-story)
[#]: author: (James Farrell https://opensource.com/users/jamesf)
My Linux Story: From 8-bit enthusiast to Unix sysadmin
======
How my early interest in computers got me hooked on a career as a
sysadmin and Linux fan.
![Person typing on a 1980's computer][1]
It all started in the mid-1980s with an [Apple ][c][2] that my parents purchased for our family. Although I enjoyed playing games, I quickly became fascinated with BASIC programming and how useful it could be for work and fun. This was an era when computers were viewed as little more than typewriters, so people with "advanced computer skills" could easily use them to their advantage.
One example was using BASIC and a dot matrix printer to auto-generate punishment assignments. When I was assigned to write out 200 times some apologetic statements, I asked my teacher if it could be typed out. On confirmation, I wrote a 5 line BASIC program to generate it for me. Another example of subtle trickery was using non-WYSIWYG word processors, such as AppleWorks for micro-manipulation of fonts, line spacing, and margins to "stretch" term papers out to the required length.
My obsession with computers quickly lead to an Apple ][gs with a RAM drive card and an x86 PC co-processor card. Modems and BBSs were getting hot, and having a dual-hardware system like this gave me all sorts of options for software. However, modem speeds of 2400bps put a real damper on getting anything more than a few KBs of fun downloads per day. I stuck with Apple as a hobby for some time, but that was soon to change.
### Venturing into Unix
My undergraduate program was BS in Computer Information Systems (CIS) and my graduate degree was MS in Computer Science. My undergraduate education program put me mostly into PCs and a little into timeshare mainframes. The real fun began in my graduate programs, where dial-in access to Unix machines with internet connections opened a whole new world of exploration. Although I still used my dual-processor ][gs for modem work and writing and printing papers, Unix systems really grabbed my attention with their general-access Telnet-based games, FTP archives, online email, and C programming. Gopher was popular and growing with people like me who were bound to plain terminal interfaces.
My graduate program took a fateful turn for the better when I was assigned to the academic computing department, which was charged with running computer services for the school. The students had access to [Ultrix][3]-based systems with X Window terminals. Most were grayscale, as color processing was then a CPU intensive task and really affected system performance. The few color systems were nice, but those machines just dragged.
This was a really fun time for me, as I was given root access to systems and assigned to system and network maintenance. I had some excellent mentors, and this strongly influenced my decision to get into system administration rather than programming (although I still really love programming to this day).
### From Unix to Linux
Scarcity is the mother of invention, and we students often got creative when we had to share the scant resources of the school's computer systems. We had three to five times more students than we had Ultrix workstations, so finding resources (especially at project delivery time) was often a challenge. There was a bank of 56k [PPP][4] modems available for remote system access when graphical displays were not needed. However, finding a machine with spare resources and sharing the system for source compilation often resulted in slow progress. Like most, I found working at night often helped, but I needed something else to let me iterate more quickly.
Then one of the school's sysadmins suggested I check out a Unix system that was freely available. This was Linux, made available as 3.5" floppy images. Given our school's blazing fast T1 line, it was easy for me to search newsgroups and other sources to learn how to download it. It was all 32-bit Intel PC-based, a class of equipment that I did not own.
Luckily, my work at the school gave me access to junk piles of old computers, so the wheels started turning.
I found enough discarded PCs to build a solid 80386 PC with some decent RAM (I am sure well under 1GB), a workable graphic display, a thin-net (coax) Ethernet card, and a hard disk. The images I had were Linux kernel 0.98, and I don't recall it being part of an official distribution (it might have been SLS). What I do remember is that it came on a series of floppy images—the first booted the kernel and a minimal installer, next it formatted the drive, and then it asked for each successive floppy image to install the core GNU utilities. After the core was installed and the system bootable, you would download and install other package images, like compilers and such.
This was a serious boon to me in my academic career. With no X Window server display running, this PC seriously outperformed the Ultrix workstations I had access to at school. I was allowed to connect this machine to the academic network, mount the school's student Network File System (NFS) shares, and access the internet directly. Since my graduate program used [GCC][5] (and sometimes Perl 4) for most student work, I could do my development work locally. This gave me exclusive access to a key resource that enabled me to iterate more quickly on my projects.
All was not perfect, however. The hardware was a tiny bit unstable (likely why it was discarded), but I could deal with that. What really got me was how much Linux and Ultrix differed at the OS and system library level. I began to appreciate what it meant to port software to other platforms; I was free to develop wherever I wanted, but I had to deliver my projects as Ultrix compiled binaries. The C code that ran perfectly on one platform would crash on the other. This was very frustrating, but probably my rudest awakening was early Linux's handling of null-pointer dereferencing. Linux seemed happy to pass over these as a virtual no-op, but Ultrix promptly dumped core on [SIGSEGV][6]. This was quite a thing to find out when my first port to the target platform happened days before my project was due! This also made my exploration of C++ quite challenging, as my careless use of malloc()/free() along with automatic [constructor and destructor][7] processing peppered my projects with null pointer bombs all over the place.
Toward the end of my graduate program, I upgraded to a complete beast of a workstation—an Intel 486DX2 66MHz with SCSI hard drives, a CD-ROM drive, a 1024x768 RGB monitor, and a 16550 UART serial card perfectly matched to my new US Robotics V.Everything modem. It could dual-boot Windows and Linux, but more importantly, the graphics card and processor allowed a much more pleasant (and faster) development environment. The old 386 was still in service back at the school, but most of my heavy work and hacking now happened at home.
Similar to [Mike Harris' story][8] about Linux in the '90s, I really got into those CD bundles that were popular at the time. There was a new Micro Center computer store close to where I lived, and it was a goldmine of hobby PC parts, phenomenal technical books, and every conceivable Linux (and free Unix) CD archive. I remember [Yggdrasil][9] and [Slackware][10] being some of my favorite distributions. What was really incredible was the enormous size of CD storage—650MB! This was an essential resource for getting access to software. Yes, you could download the bits at 56k, but that was quite limiting. Not to mention the fact that most people could not afford to archive that much idle data for later perusal.
### And on to today
This is what kicked off my more than 25 years of system administration and open source software fun. Linux has been an important part of both my career and personal development. Nowadays, I am still heavily into Linux (mostly CentOS, RedHat, and Ubuntu), but often have fun with the likes of [FreeBSD][11] and other cool open source offerings.
My forays into Linux led me to Opensource.com, where I hope to give back a little and help bootstrap new generations of hands-on computer fun.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/linux-story
作者:[James Farrell][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/jamesf
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/1980s-computer-yearbook.png?itok=eGOYEKK- (Person typing on a 1980's computer)
[2]: https://en.wikipedia.org/wiki/Apple_IIc
[3]: https://en.wikipedia.org/wiki/Ultrix
[4]: https://en.wikipedia.org/wiki/Point-to-Point_Protocol
[5]: https://en.wikipedia.org/wiki/GNU_Compiler_Collection
[6]: https://en.wikipedia.org/wiki/Segmentation_fault
[7]: https://www.tutorialspoint.com/cplusplus/cpp_constructor_destructor.htm
[8]: https://opensource.com/article/19/11/learning-linux-90s
[9]: https://en.wikipedia.org/wiki/Yggdrasil_Linux/GNU/X
[10]: http://slackware.com
[11]: https://www.freebsd.org/

View File

@ -0,0 +1,84 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (GNOME Announces Community Engagement Challenge Offering up to $65,000 in Rewards)
[#]: via: (https://itsfoss.com/gnome-community-engagement-challenge/)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
GNOME Announces Community Engagement Challenge Offering up to $65,000 in Rewards
======
Its always good to see several competitions or challenges trying to promote Free and Open-Source Software (FOSS) more than ever.
In a recent effort by GNOME with the help of [Endless][1], they announced the inaugural GNOME Community Engagement Challenge.
This Community Challenge is a part of their original announcement of [coding education challenge for which GNOME was granted $500,000 funding by Endless][2] last year.
The three-phase challenge aims to attract new developers to engage with FOSS and potentially create new/unique solutions that would gain more traction from the next-gen coders.
The challenge will involve up to $65,000 in cash prizes. Sounds exciting, right? Lets take a look at some of the details involved in the challenge.
![][3]
### Why The GNOME Community Engagement Challenge?
In their official [press release][4], they mentioned their primary motive for the challenge:
> “Through the Challenge we hope to reach a diverse audience, to encourage beginning coders to get involved with the FOSS community to help ensure that free software is available long into the future,” said Neil McGovern, GNOME Foundation Executive Director. “What better way to do that than to reach out to the community itself to come up with creative ways to inspire the next generation?”
As Neil mentioned above, its definitely a good idea to reach out to more people (community) to look for creative ways to promote and work on FOSS projects that will leave a significant impact on the open-source community.
And, rewarding for the ideas in the form of a challenge will easily get the attention needed.
### Heres How The Community Challenge Works
To quote the official announcement:
> The Challenge will ask entrants to devise creative ways to promote open-source software to coders typically in high school and college. How a submission will achieve this goal has deliberately been left open-ended to encourage unique, novel approaches.
So, theres no particular constraint for the type of ideas or projects you can propose and submit. But, it would be wise to read the usual [terms and conditions][5] to know about the submission rules, eligibility, requirements, prize details, and more.
Here are the key information about the three phases of the challenge as per the announcement:
* The **first phase** of the Challenge asks entrants to submit a written proposal for their concept no later than **July 1, 2020**. Twenty entries will be chosen to move to the next round and receive **$1000 each**.
* The **second phase** of the Challenge will require proof of concept, with four entries receiving **$5000** and moving onto the final round.
* The final round will call for a deliverable end product, with the winner receiving **$15,000** and the second place finisher receiving **$10,000**.
They plan to announce the winner of the challenge in the spring of 2021.
You can take a look at their [challenge FAQ][6] and the [official webpage][7] for more details before starting to submit your entry on **April 9th**. The last date of submission is **July 1, 2020**.
Head to their website to get started and explore more about the challenge.
[GNOME Community Engagement Challenge][7]
### Wrapping Up
I think this is a perfect opportunity for developers to get started with FOSS projects that will end up rewarding them with a good amount of money and help the community at the same time.
What do you think about the community engagement challenge by GNOME? Feel free to let me know your thoughts in the comments below.
--------------------------------------------------------------------------------
via: https://itsfoss.com/gnome-community-engagement-challenge/
作者:[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://www.endlessnetwork.com/
[2]: https://itsfoss.com/endless-gnome-coding-education-challenge/
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/gnome-community-challenge.png?ssl=1
[4]: https://www.gnome.org/news/2020/04/gnome-foundation-and-endless-launch-inaugural-community-engagement-challenge/
[5]: https://www.gnome.org/challenge/terms/
[6]: https://www.gnome.org/challenge/faq/
[7]: https://www.gnome.org/challenge/

View File

@ -0,0 +1,111 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Heres How to Find Out Which Desktop Environment You are Using)
[#]: via: (https://itsfoss.com/find-desktop-environment/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
Heres How to Find Out Which Desktop Environment You are Using
======
If you are a new Linux user and seeking help in one of the Linux forums, you may be asked this question:
_**“Which desktop environment are you using?”**_
You have an idea about what a desktop environment is but how do you know which one are you using? Ill tell you how to find it out. Ill show the command line method first because that is applicable to [all kind of Linux distributions][1]. Ill also show the graphical way of getting this information.
### Check which desktop environment you are using
![][2]
You can [use the echo command in Linux][3] to display the value of XDG_CURRENT_DESKTOP variable in the terminal.
Open the terminal and copy paste this command:
```
echo $XDG_CURRENT_DESKTOP
```
For example, it shows that I am using [GNOME desktop][4] in [Ubuntu 20.04][5]:
```
[email protected]:~$ echo $XDG_CURRENT_DESKTOP
ubuntu:GNOME
```
While this command quickly tells you which desktop environment is being used, it doesnt give any other information.
Knowing the version of desktop environment (also called DE) could be important in some cases. Each new version of a software brings new features or removes some. [GNOME 3.36][6] introduces a Do Not Disturb option to toggle off all the desktop notifications.
Suppose you read about this new Do Not Disturb feature. You verify that you are using GNOME and yet you dont see this option in your GNOME desktop. If you could check the GNOME desktop version you have installed on your system, that could make things clear for you.
Ill show you the commands to check the desktop environments version first because you can use it in any Linux, running desktop environment.
### How to get desktop environment version
Unlike getting the name of desktop environment. getting its version number is not straightforward because there is no standard command or environment variable that could give this information.
One way to get the desktop environment information in Linux is by using a tool like [Screenfetch][7]. This [command line tool displays the logo of your Linux distribution in ascii format][8] along with a few basic system information. Desktop environment version is one of them.
In Ubuntu based distributions, you can install Screenfetch by [enabling Universe repository][9] and then using this command:
```
sudo apt install screenfetch
```
For other Linux distributions, please use your systems package manager to install this program.
Once installed, simply type screenfetch in the terminal and it should show the desktop environment version along with other system information.
![Check Desktop Environment Version][10]
As you can see in the above image, my system is using GNOME 3.36.1 (basically GNOME 3.36). You can also [check the Linux kernel version][11] and other details here.
Please keep in mind that it is not necessary that Screenfetch will display the desktop environment version. I checked its source code and it has lots of if-else code to get the version information from a number of sources and parameters in various desktop environments. If it can find nothing on version, it just displays the DE name.
### Using GUI to check desktop environment version
Almost all desktop environments provide basic system details in their Settings-About section.
The one major problem is that most DEs look different and thus I cannot show the exact steps for each of them. I am going to show it for GNOME and I let you discover it in your desktop.
So, search for Settings in the menu (press Windows key and search):
![Search for Settings application][12]
In here, go to the bottom to find the About section. Click on it and you should have the desktop environment along with its version.
![Check Desktop Environment in Ubuntu][13]
As you can see, it shows that my system is using GNOME 3.36.
I hope you find this quick beginner tip useful. If you have questions or suggestions, please leave a comment below.
--------------------------------------------------------------------------------
via: https://itsfoss.com/find-desktop-environment/
作者:[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://itsfoss.com/what-is-linux/
[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/check-desktop-environment.jpg?ssl=1
[3]: https://linuxhandbook.com/echo-command/
[4]: https://www.gnome.org/
[5]: https://itsfoss.com/ubuntu-20-04-release-features/
[6]: https://itsfoss.com/gnome-3-36-release/
[7]: https://github.com/KittyKatt/screenFetch
[8]: https://itsfoss.com/display-linux-logo-in-ascii/
[9]: https://itsfoss.com/ubuntu-repositories/
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/check-desktop-environment-version.jpg?ssl=1
[11]: https://itsfoss.com/find-which-kernel-version-is-running-in-ubuntu/
[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/applications_menu_settings.jpg?ssl=1
[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/check-desktop-environment-ubuntu.jpg?ssl=1

View File

@ -0,0 +1,75 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to set up a remote school environment for kids with Linux)
[#]: via: (https://opensource.com/article/20/4/school-home-linux)
[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss)
How to set up a remote school environment for kids with Linux
======
Repurpose an old computer to support the new home-schooler in your life.
![Image by Alan Formy-Duvall][1]
COVID-19 has suddenly thrown all of us into a new and challenging situation. Many of us are now working full-time from home, and for a lot of us (especially people who aren't used to working remotely), this is taking some getting used to.
Another group that is similarly challenged is our kids. They can't go to school or participate in their regular after-school activities. My daughter's elementary school closed its classrooms and is teaching through an online, web-based learning portal instead. And one of her favorite extracurricular activities—a coding school where she has been learning Scratch and just recently "graduated" to WoofJShas also gone to an online-only format.
We are fortunate that so many of our children's activities can be done online now, as this is the only way they will be able to learn, share, and socialize for at least the next several months.
### Setting up a temporary homeschool environment
When our daughter's school went to an online-only format, we realized she needed a place and some tools to do her work. So we cleaned off her desk and cleared the toys from the floor around it to make an "office" for her. We also realized she would need a computer. While I could have shopped online and ordered a new computer (and spent at least several hundred dollars—if not more than $1,000—in the process), I chose an alternative and put an old, unused laptop back to work.
If you have an unused computer sitting around and are willing to do a bit of tech work, you, too, can set something up to get your kids online. Here's how I did it.
### The hardware
While my daughter already has her own small IT department (as I like to say), it consists of some gaming systems, a tablet, and a Chromebook. Even her Chromebook has just an 11.6" screen and a small keyboard, so none of her devices are really quite adequate for full-time school duty.
So we found ourselves in a pinch. She really needed a desktop-capable computer system with a decent-sized screen, a full keyboard, a good-quality microphone, a set of speakers, and a headphone jack. And having an external video connector helps if you decide one screen isn't enough.
I didn't have a spare desktop, but I did have a laptop: a Lenovo G550 with a Pentium Dual-Core T4500 2.3GHz processor and 4GB RAM. I replaced its aging 5400RPM spindle hard drive with a 240GB solid-state drive. The laptop has a 15.6" screen, which is much easier to view than the small screens on her other devices, and a comfortable, full-size keyboard. Its CPU scores a bit better in PassMark's benchmarks (913 vs. 674) than the 1.6GHz Intel Celeron N3060 Dual-Core in the Chromebook.
However, it is 10 years old, certainly on the edge of usability by today's standards. But, thanks to the efficiency of the Linux operating system, it gets the job done. I installed the latest version (v31) of [Fedora Workstation][2], but many other distributions will work just fine. If you really want to eke out every drop of performance, you could use one of the [lightweight Linux distributions][3]. The only area that required a little extra effort with Fedora was the wireless; I had to install the driver for the Broadcom WiFi hardware. But really, this was only a few extra steps and a restart, and it was good to go.
Linux supports all of the other hardware in the laptop. My daughter prefers a full-sized mouse over the touchpad, so I attached one. She likes the keyboard on this laptop, but if she wants an external keyboard, there are enough USB ports to hook one up.
It has a traditional 3.5mm audio jack, so she can use headphones. I recommend giving children decibel-limited headphones to protect their hearing.
Even though this laptop has a 15.6" widescreen display, I think having a second monitor gives the best experience. I have a spare that I might hook up to the external VGA connector.
### The software
My daughter's school set up an online learning portal. The benefit is that students just need a supported web browser to log on and get to work, and I thank the school for its efforts and choice of a vendor-agnostic solution. Most Linux distributions include the Mozilla Firefox web browser installed by default, and Linux provides a full operating system, so I can install any applications she might need. Fedora is also updated regularly (unlike the old Windows Vista that came with the laptop and is no longer supported).
![][4]
Scratch running on Fedora
Her extracurricular coding school is using the Zoom client. I'm happy to report that it was an easy [install with RPM][5] and works great on Fedora 31.
### Success!
My daughter has no trouble using her new laptop. She likes the [GNOME desktop][6], particularly the fact that it "Looks like Dad's!" This is turning out to be a great experiment in practical (and under-pressure) use of a Linux desktop.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/school-home-linux
作者:[Alan Formy-Duval][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/alanfdoss
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/homeschool.jpg?itok=vYEd9NON (Image by Alan Formy-Duvall)
[2]: https://getfedora.org/en/workstation/
[3]: https://opensource.com/article/19/6/linux-distros-to-try
[4]: https://opensource.com/sites/default/files/scratch.jpg
[5]: https://zoom.us/download?os=linux
[6]: https://www.gnome.org/

View File

@ -0,0 +1,152 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Print double-sided documents at home with this simple Bash script)
[#]: via: (https://opensource.com/article/20/4/print-duplex-bash-script)
[#]: author: (Jim Hall https://opensource.com/users/jim-hall)
Print double-sided documents at home with this simple Bash script
======
Use this script and save yourself the hassle and wasted paper of trying
to manually load and print double-sided documents.
![bash logo on green background][1]
We have a laser printer at home. This Hewlett Packard LaserJet Pro CP1525nw Color Printer is an older model, but it has been a great workhorse that prints reliably and in color. I [put it on our home network][2] a few years ago using our [Raspberry Pi][3] as a print server.
The LaserJet has been a great addition to my home office. Since [I launched my company][4] last year, I have relied on this little laser printer to print handouts and other materials for client meetings, workshops, and training sessions.
My only gripe with this printer is that it prints single-sided only. If you want to print double-sided, you need to set up a custom print job to do it yourself. That's inconvenient and requires manual steps. In LibreOffice, I need to specifically set up the print job to print the odd-numbered pages first, then reload the paper before printing the even-numbered pages on the other side—but in reverse order.
![LibreOffice print dialog][5]
If I need to print a PDF that someone has sent me, the process is the same. For a four-page document, I first need to print pages 1 and 3, then reload the paper and print pages 2 and 4 in reverse order. In the GNOME print dialog, you need to select "Page Setup" to print odd pages or even pages.
![Gnome print dialog][6]
![Gnome page setup][7]
Regardless of how I print, the overall process is to print the odd-numbered pages, reload the stack of printed pages into the paper tray, then print the even-numbered pages in reverse order. If I'm printing a four-page document, printing the even-numbered pages in reverse order means page 4 prints on the back of page 3 and page 2 prints on the back of page 1. Imagine my frustration in those few instances when I forgot to select the option to print in reverse order when printing the even-numbered pages and ruined a long print job.
Similarly, it's easy to forget how to deal with documents that have an odd number of pages. In a five-page document, you first print pages 1, 3, and 5. But when you reload the printed pages into the printer, you don't want page 5. Instead, you only want to load pages 1 and 3. Otherwise, page 4 will print on the back of page 5, page 2 will print on the back of page 3, and nothing gets printed on the back of page 1.
To make things easier and more reliable, I wrote a simple Bash script that automates printing duplex. This is basically a wrapper to print odd-numbered pages, remind me to reload the pages (and remove the last page if needed), then print the even-numbered pages.
Whenever I need to print a document as duplex, I first convert the document to PDF. This is very easy to do. In LibreOffice, there's a toolbar icon to export directly as PDF. You can also navigate under **File— Export As—Export as PDF** to do the same. Or in any other application, there's usually a **Save to PDF** feature. When in doubt, GNOME supports printing to a PDF file instead of a printer.
![Libre Office toolbar][8]
![Export as PDF][9]
### How it works
Once I've saved to PDF, I let my Bash script do the rest. This really just automates the **lpr** commands to make printing easier. It prints odd pages first, prompts me to reload the paper, then prints the even pages. If the document has an odd number of pages, it also reminds me to remove the last page when I reload the printed pages. It's pretty simple.
The only "programming" part of the script is determining the page count, and figuring out if that's an even or odd number. Both of those are easy to do.
To determine the page count, I use the **pdfinfo** command. This generates useful info about a PDF document. Here's some sample output:
```
$ pdfinfo All\ training\ -\ catalog.pdf
Creator:        Writer
Producer:       LibreOffice 6.3
CreationDate:   Fri Oct 18 16:06:07 2019 CDT
Tagged:         no
UserProperties: no
Suspects:       no
Form:           none
JavaScript:     no
Pages:          11
Encrypted:      no
Page size:      612 x 792 pts (letter)
Page rot:       0
File size:      65623 bytes
Optimized:      no
PDF version:    1.5
```
That output is very easy to parse. To get the page count, I use an AWK one-line script to look for **Pages:** and print the second field.
```
`pages=$( pdfinfo "$1" | awk '/^Pages:/ {print $2}' )`
```
To figure out if this is an odd or even number, I use the modulo (**%**) arithmetic operator to divide by two and tell me the remainder. The modulo of two will always be zero for an even number, and one for an odd number. I use this simple test to determine if the document has an odd number of pages, so I'll need to remove the last page before printing the rest of the document:
```
`if [ $(( $pages % 2 )) -ne 0 ] ; then`
```
With that, writing the **print-duplex.sh** Bash script is a simple matter of calling **lpr** with the correct options to send output to my printer (**lpr -P "HP_LaserJet_CP1525nw"**), to print odd-numbered pages (**-o page-set=odd**) or even-numbered pages (**-o page-set=even**), and to print in reverse order (**-o outputorder=reverse**).
### Bash script
```
#!/bin/sh
# print-duplex.sh
# simple wrapper to print duplex
cat&lt;&lt;EOF
$1 ($pages pages)
\-------------------------------------------------------------------------------
Printing odd pages first
Please wait for job to finish printing...
\-------------------------------------------------------------------------------
EOF
lpr -P "HP_LaserJet_CP1525nw" -o page-set=odd "$1"
sleep $pages
cat&lt;&lt;EOF
===============================================================================
Put paper back into the printer in EXACT OUTPUT ORDER (face down in tray)
then press ENTER
===============================================================================
EOF
pages=$( pdfinfo "$1" | awk '/^Pages:/ {print $2}' )
if [ $(( $pages % 2 )) -ne 0 ] ; then
  echo '!! Remove the last page - this document has an odd number of pages'
fi
echo -n '&gt;'
read x
cat&lt;&lt;EOF
\-------------------------------------------------------------------------------
Printing even pages
Please wait for job to finish printing...
\-------------------------------------------------------------------------------
EOF
lpr -P "HP_LaserJet_CP1525nw" -o page-set=even -o outputorder=reverse "$1"
```
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/print-duplex-bash-script
作者:[Jim Hall][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/jim-hall
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bash_command_line.png?itok=k4z94W2U (bash logo on green background)
[2]: https://opensource.com/article/18/3/print-server-raspberry-pi
[3]: https://opensource.com/resources/raspberry-pi
[4]: https://opensource.com/article/19/9/business-creators-open-source-tools
[5]: https://opensource.com/sites/default/files/uploads/print_dialog_-_libreoffice_0.png (LibreOffice print dialog)
[6]: https://opensource.com/sites/default/files/uploads/print_dialog_-_gnome_0.png (Gnome print dialog)
[7]: https://opensource.com/sites/default/files/uploads/print_dialog_-_gnome_-_page_setup.png (Gnome page setup)
[8]: https://opensource.com/sites/default/files/uploads/toolbar_-_export_as_pdf_-_libreoffice.png (Libre Office toolbar)
[9]: https://opensource.com/sites/default/files/uploads/file_-_export_as_pdf_-_libreoffice.png (Export as PDF)

View File

@ -0,0 +1,142 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Use Emacs Org mode to easily create LaTeX documents)
[#]: via: (https://opensource.com/article/20/4/emacs-org-mode)
[#]: author: (Peter Prevos https://opensource.com/users/danderzei)
Use Emacs Org mode to easily create LaTeX documents
======
You can use LaTeX for scientific and technical documents without all of
the confusing commands and syntax you would normally need.
![Filing cabinet for organization][1]
LaTeX is a powerful system, especially for writing scientific and technical documents. But writing documents in LaTeX can be confusing because you need to know a lot of commands, and your text is littered with backslashes, curly braces, and other syntax distractions. But being productive as a writer requires that you focus on the text's content instead of how it looks. Fortunately, the [GNU Emacs][2] Org mode extension makes it easy to write plain-text documents and seamlessly export them to LaTeX and PDF.
[Org mode][3] is a built-in Emacs extension that helps you keep notes, maintain to-do lists, manage projects, and author documents with a fast and effective plain-text system. Emacs also comes with [AUCTeX][4], an extensible package for writing TeX files in Emacs. AUCTeX has a preview module that shows the results of what you type, but I find it distracting because it draws my attention away from the document's content to its design. Writing text in Org mode is my preferred option because the source remains a plain-text file with minimal typesetting elements. The text is independent of its result because Org mode can export it to multiple formats, including LaTeX and PDF.
Emacs is known for being difficult to use with a steep learning curve. But Emacs is only difficult when you want to fine-tune the default settings. By following a minimalist approach to using the vanilla GNU Emacs, this article will get you quickly and easily on your way to writing beautiful documents without any complex configuration.
### First steps
Before you begin, [install Emacs][5] and a fully functioning version of [LaTeX][6] on your computer.
Next, you need to learn some conventions. In Emacs lingo, the abbreviation **C-c** means to enter **Ctrl+C** on your keyboard. The abbreviation **M-x** means **Alt+X**. The M stands for the mod key, which no longer exists in modern systems. The **S** prefix indicates the **Shift** key.
The **find-file** function, which you start with the **C-x C-f** keystroke combination, creates a new document or opens an existing document. Entering this function opens a dialog in the mini-buffer at the bottom of the screen, which is where Emacs communicates with the user. Type the name of the file you want to create or open into the mini-buffer. Emacs is sensitive to file extensions, so make sure that the name of your document ends in **.org**.
In Emacs speak, opening or creating a file is called ["visiting" a file][7]. Visiting a file means reading its contents into an Emacs buffer so that it is available for editing. Emacs generates a new buffer for each file you visit.
### Writing prose with Org mode
Once you're visiting a file, you can start typing your text the same way you would in any text editor or word processor. Some conventions: Begin the file with **#+TITLE:** to denote the title of the document and **#+AUTHOR** for your name. These options are used when exporting the file. Org mode recognizes a range of [export settings][8] to configure the output. For example, to suppress the table of contents, enter **#+OPTIONS: toc:nil**.
Org mode has its own Markdown-like conventions to format your document. [Headlines][9] start with one or more asterisks. Org mode can [collapse a headline][10] to render parts of it invisible with the **TAB** or **S-TAB** keys. You can make words ***bold***, **/italic/**, **_underlined_**, or **=verbatim=**. The Org manual describes the many options for [rich text][11].
One minor issue with plain-vanilla Emacs that you will quickly notice is it does not wrap lines at the end of the visible screen. Emacs has several line-wrapping functions, and [Visual Line mode][12] is the most useful for writing long-form text. To activate this mode, use **M-x** and enter **visual-line-mode** in the mini-buffer at the bottom of the screen. The **M-x** keyboard shortcut enables executing functions for which there is no direct keyboard shortcut.
Adding [images][13] is as easy as adding a link to the image file within double square brackets:
```
`[[file:path_to_image.png]]`
```
Org has a great system for [formatting tables][14] in plain ASCII. Any line with **|** is considered part of a table. The vertical line is also the column separator. A line starting with **|-** is rendered as a horizontal rule, and rows before the first horizontal rule are header lines. A table might look like this in the source file:
```
| Name  |   id | Age |
|-------+------+-----|
| Peter | 1234 |  50 |
| Sue   | 4321 |  54 |
```
Both images and tables are preceded with **#+CAPTION:** to add a [caption][15]. Advanced options are also available to control float placement and size of figures.
Emacs has extensive [editing functions][16] to make you more efficient when typing text. Spell checking, thesaurus, auto-completion, and an undo tree are just some of the tools that help you write efficiently.
### Adding LaTeX snippets to Org
In addition to the text itself, Org mode-text can include simple LaTeX commands, such as **\newpage**, within the text. Equations in standard LaTeX syntax are placed between dollar signs **$e^{i\pi} + 1 = 0$**. The **org-latex-preview** function (**C-c C-x C-l**) shows a [preview][17] of any LaTeX equations within the text buffer. Last, you can also add complete LaTeX snippets to insert complex content. The code has to be placed in an export block:
```
#+BEGIN_EXPORT latex
\setlength{\unitlength}{1cm}
\thicklines
\begin{picture}(10,6)
\put(2,2.2){\line(1,0){6}}
\put(2,2.2){\circle{2}}
\put(6,2.2){\oval(4,2)[r]}
\end{picture}
#+END_EXPORT
```
### Exporting to LaTeX
Org mode includes a powerful export module to convert your files to many formats using the powerful [Pandoc][18] software. Start the export module with the **org-export-dispatch** function, which you can run with the **C-c C-e** keyboard shortcut. The dispatch will split your screen and provide a range of options.
First, Pandoc converts the Org mode file to a LaTeX file. Then you can choose to open the LaTeX file in a new buffer or save it as a file. Org mode can also directly render a PDF file, which you can view within Emacs or save to disk.
![Emacs with Org mode source and PDF preview][19]
### Advanced use
This article provides a first taste of writing prose in Org mode and LaTeX. Org mode has numerous configuration options to fine-tune your document or to change default settings.
By default, Org mode uses the article style to export documents, but you can change this with export settings. These settings can also be used to add commands to the document header, for example:
```
#+LATEX_CLASS: report
#+LATEX_CLASS_OPTIONS: [a4paper]
#+LATEX_HEADER: \usepackage{times}
```
If you write scientific documents, the [org-ref][20] package by John Kitchin provides Org-mode modules for citations, cross-references, and bibliographies in Org mode and useful BibTeX tools to go with it.
The Org mode manual's [LaTex export][21] section provides a detailed discussion of the functionality available.
### Conclusion
Org mode is a perfect editor for writing LaTeX. The main advantage is that you lose the clutter of LaTeX syntax and can focus on the text. This comes at no cost because you can still add LaTeX code as much as you need, and you get access to the powerful editing functions in Emacs.
Using Org to write books and articles allows you to focus on the text as you combine two of the oldest and most powerful pieces of open source software.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/emacs-org-mode
作者:[Peter Prevos][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/danderzei
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/files_documents_organize_letter.png?itok=GTtiiabr (Filing cabinet for organization)
[2]: https://opensource.com/article/20/3/getting-started-emacs
[3]: https://orgmode.org
[4]: https://www.gnu.org/software/auctex/
[5]: https://www.gnu.org/software/emacs/
[6]: https://www.latex-project.org/get/
[7]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Visiting.html
[8]: https://orgmode.org/manual/Export-Settings.html
[9]: https://orgmode.org/manual/Headlines.html#Headlines
[10]: https://orgmode.org/manual/Global-and-local-cycling.html#Global-and-local-cycling
[11]: https://orgmode.org/manual/Markup-for-Rich-Contents.html#Markup-for-Rich-Contents
[12]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Visual-Line-Mode.html
[13]: https://orgmode.org/manual/Images.html
[14]: https://orgmode.org/manual/Built_002din-Table-Editor.html#Built_002din-Table-Editor
[15]: https://orgmode.org/manual/Captions.html#Captions
[16]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Basic.html#Basic
[17]: https://orgmode.org/manual/Previewing-LaTeX-fragments.html
[18]: https://pandoc.org/
[19]: https://opensource.com/sites/default/files/uploads/org-mode-latex-screenshot.png (Emacs with Org mode source and PDF preview.)
[20]: https://github.com/jkitchin/org-ref
[21]: https://orgmode.org/manual/LaTeX-Export.html#LaTeX-Export

View File

@ -0,0 +1,157 @@
[#]: collector: (lujun9972)
[#]: translator: (mr-ping)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Get started with Bash programming)
[#]: via: (https://opensource.com/article/20/4/bash-programming-guide)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
Get started with Bash programming
======
Learn how to write custom programs in Bash to automate your repetitive
tasks. Download our new eBook to get started.
![Command line prompt][1]
One of the original hopes for Unix was that it would empower everyday computer users to fine-tune their computers to match their unique working style. The expectations around computer customization have diminished over the decades, and many users consider their collection of apps and websites to be their "custom environment." One reason for that is that the components of many operating systems are not open, so their source code isn't available to normal users.
But for Linux users, custom programs are within reach because the entire system is based around commands available through the terminal. The terminal isn't just an interface for quick commands or in-depth troubleshooting; it's a scripting environment that can reduce your workload by taking care of mundane tasks for you.
### How to learn programming
If you've never done any programming before, it might help to think of it in terms of two different challenges: one is to understand how code is written, and the other is to understand what code to write. You can learn _syntax_—but you won't get far without knowing what words are available to you in the _language_. In practice, you start learning both concepts all at once because you can't learn syntax without words to arrange, so initially, you write simple tasks using basic commands and basic programming structures. Once you feel comfortable with the basics, you can explore more of the language so you can make your programs do more and more significant things.
In [Bash][2], most of the _words_ you use are Linux commands. The _syntax_ is Bash. If you already use Bash on a frequent basis, then the transition to Bash programming is relatively easy. But if you don't use Bash, you'll be pleased to learn that it's a simple language built for clarity and simplicity.
### Interactive design
Sometimes, the hardest thing to figure out when learning to program is what a computer can do for you. Obviously, if a computer on its own could do everything you do with it, then you wouldn't have to ever touch a computer again. But the reality is that humans are important. The key to finding something your computer can help you with is to take notice of tasks you repeatedly do throughout the week. Computers handle repetition particularly well.
But for you to be able to tell your computer to do something, you must know how to do it. This is an area Bash excels in: interactive programming. As you perform an action in the terminal, you are also learning how to script it.
For instance, I was once tasked with converting a large number of PDF books to versions that would be low-ink and printer-friendly. One way to do this is to open the PDF in a PDF editor, select each one of the hundreds of images—page backgrounds and textures counted as images—delete them, and then save it to a new PDF. Just one book would take half a day this way.
My first thought was to learn how to script a PDF editor, but after days of research, I could not find a PDF editing application that could be scripted (outside of very ugly mouse-automation hacks). So I turned my attention to finding out to accomplish the task from within a terminal. This resulted in several new discoveries, including GhostScript, the open source version of PostScript (the printer language PDF is based on). By using GhostScript for the task for a few days, I confirmed that it was the solution to my problem.
Formulating a basic script to run the command was merely a matter of copying the command and options I used to remove images from a PDF and pasting them into a text file. Running the file as a script would, presumably, produce the same results.
### Passing arguments to a Bash script
The difference between running a command in a terminal and running a command in a shell script is that the former is interactive. In a terminal, you can adjust things as you go. For instance, if I just processed **example_1.pdf** and am ready to process the next document, to adapt my command, I only need to change the filename.
A shell script isn't interactive, though. In fact, the only reason a shell _script_ exists is so that you don't have to attend to it. This is why commands (and the shell scripts that run them) accept arguments.
In a shell script, there are a few predefined variables that reflect how a script starts. The initial variable is **$0**, and it represents the command issued to start the script. The next variable is **$1**, which represents the first "argument" passed to the shell script. For example, in the command **echo hello**, the command **echo** is **$0,** and the word **hello** is **$1**. In the command **echo hello world**, the command **echo** is **$0**, **hello** is **$1**, and **world** is **$2**.
In an interactive shell:
```
$ echo hello world
hello world
```
In a non-interactive shell script, you _could_ do the same thing in a very literal way. Type this text into a text file and save it as **hello.sh**:
```
`echo hello world`
```
Now run the script:
```
$ bash hello.sh
hello world
```
That works, but it doesn't take advantage of the fact that a script can take input. Change **hello.sh** to this:
```
`echo $1`
```
Run the script with two arguments grouped together as one with quotation marks:
```
$ bash hello.sh "hello bash"
hello bash
```
For my PDF reduction project, I had a real need for this kind of non-interactivity, because each PDF took several minutes to condense. But by creating a script that accepted input from me, I could feed the script several PDF files all at once. The script processed each one sequentially, which could take half an hour or more, but it was a half-hour I could use for other tasks.
### Flow control
It's perfectly acceptable to create Bash scripts that are, essentially, transcripts of the exact process you took to achieve the task you need to be repeated. However, scripts can be made more powerful by controlling how information flows through them. Common methods of managing a script's response to data are:
* if/then
* for loops
* while loops
* case statements
Computers aren't intelligent, but they are good at comparing and parsing data. Scripts can feel a lot more intelligent if you build some data analysis into them. For example, the basic **hello.sh** script runs whether or not there's anything to echo:
```
$ bash hello.sh foo
foo
$ bash hello.sh
$
```
It would be more user-friendly if it provided a help message when it receives no input. That's an if/then statement, and if you're using Bash in a basic way, you probably wouldn't know that such a statement existed in Bash. But part of programming is learning the language, and with a little research you'd learn about if/then statements:
```
if [ "$1" = "" ]; then
        echo "syntax: $0 WORD"
        echo "If you provide more than one word, enclose them in quotes."
else
        echo "$1"
fi
```
Running this new version of **hello.sh** results in:
```
$ bash hello.sh
syntax: hello.sh WORD
If you provide more than one word, enclose them in quotes.
$ bash hello.sh "hello world"
hello world
```
### Working your way through a script
Whether you're looking for something to remove images from PDF files, or something to manage your cluttered Downloads folder, or something to create and provision Kubernetes images, learning to script Bash is a matter of using Bash and then learning ways to take those scripts from just a list of commands to something that responds to input. It's usually a process of discovery: you're bound to find new Linux commands that perform tasks you never imagined could be performed with text commands, and you'll find new functions of Bash to make your scripts adaptable to all the different ways you want them to run.
One way to learn these tricks is to read other people's scripts. Get a feel for how people are automating rote commands on their systems. See what looks familiar to you, and look for more information about the things that are unfamiliar.
Another way is to download our [introduction to programming with Bash][3] eBook. It introduces you to programming concepts specific to Bash, and with the constructs you learn, you can start to build your own commands. And of course, it's free to download and licensed under a [Creative Commons][4] license, so grab your copy today.
### [Download our introduction to programming with Bash eBook!][3]
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/bash-programming-guide
作者:[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/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt)
[2]: https://opensource.com/resources/what-bash
[3]: https://opensource.com/downloads/bash-programming-guide
[4]: https://opensource.com/article/20/1/what-creative-commons

View File

@ -0,0 +1,136 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How I'm using AI to translate 'wash your hands' in 500 languages)
[#]: via: (https://opensource.com/article/20/4/ai-translation)
[#]: author: (Daniel Whitenack https://opensource.com/users/datadan)
How I'm using AI to translate 'wash your hands' in 500 languages
======
By using both human and machine-generated translations, key health
phrases can be translated into local languages spoken all over the
world.
![Two diverse hands holding a globe][1]
You might not know, but there are currently [7,117 languages spoken in the world][2]. Not dialects, but living languages! However, much of the world's digital media is available in only a couple dozen languages, and translation platforms like Google Translate only support around 100 languages. This reality means that there are billions of people around the world that are marginalized due to a lack of timely access to information. The current coronavirus (COVID-19) pandemic has made this painfully clear, and it has stressed the need for immediate, rapid translation of health-related phrases (like "wash your hands" or "keep your distance") into the long tail of languages.
To this end, I applied state-of-the-art AI techniques to construct something close to the phrase "wash your hands" in 544 languages and counting (my GPUs are still running). Multilingual Unsupervised and Supervised Embeddings (MUSE) methods are used to train cross-lingual word embeddings between each of 544 languages and English. These embeddings then allow for the extraction of a phrase similar to the target phrase from existing documents.
I performed this work in collaboration with my colleagues at SIL International, who have gathered even more human translations of the phrase. The combination of these human translations and some of my machine translations can be searched on [this Ethnologue guide page][3] (machine-generated phrases are indicated with a little robot icon), and more translations will be added as they are generated/gathered.
### Leveraging existing corpora
SIL International has done linguistic work in over 2000 languages and is currently managing over 1600 language projects. Thus, as I approached this particular problem, I knew that we had likely already translated the phrase "wash your hands" and/or similar phrases many times into hundreds of languages, and that guess paid off in spades. I was able to quickly gather documents (mostly completed shell book templates, educational materials, and Bibles) from our archives in over 900 languages. Each of these documents has an English parallel, which necessarily includes the phrase "wash your hands" and/or similar phrases like "wash your face." Moreover, each of these documents is very high quality and translated and checked in cooperation with the local language communities.
That is quite the multilingual data set. However, there are two problems to overcome. First, this data included thousands of samples for most languages, which is in contrast to the millions used to train machine translation models. Second, even if the documents include the phrase "wash your hands" in the target language, we don't know the exact location of the phrase within the surrounding text.
We could certainly exploit some of the latest tricks in [machine translation for low resource languages][4], but it would take some time to tune automated methods for rapidly adapting translation models in each language pair. Moreover, many of the languages we are targeting have no existing baseline with which we could compare evaluation metrics, e.g., [BLEU score][5]. Given the pressing concerns about the Coronavirus pandemic, we wanted to move a bit faster than that (although we plan to return to this problem in the future).
I opted to try and construct the phrase "wash your hands" by finding the phrase itself or components of the phrase (like "wash your" or "your hands") in existing documents. To find these, I trained cross-lingual embedding for each {English, Target Language} pair using [Multilingual Unsupervised and Supervised Embedding (MUSE)][6] from Facebook Research. MUSE takes monolingual word embeddings as input (I used [_fasttext_][7] to generate these) and learns a mapping from the English to the target embedding space using adversarial methods. The output of this process is cross-lingual word embeddings.
![Using fasttext along with MUSE to perform cross-language embedding][8]
Once the cross-lingual embeddings are generated, we can get to finding the phrase components in the target language documents. As it turns out, the phrase "wash your face" was most clearly used throughout the documents along with instances of "hands," "wash your," etc. in isolation. For each of the languages, I search through n-grams in areas where I expected the phrase to appear (based on its usage in the English parallel). N-grams were vectorized using the cross-lingual embedding and compared with vectorized versions of the English phrases using various distance metrics. The n-grams that were "closest" to the English phrases in the embedding space were determined to be the target language matches.
Finally, component phrases matching their English counterparts were combined to generate the phrase "wash your hands" in the target language. This combination utilizes the cross-lingual embedding again to make sure that the components are combined in an appropriate manner. For example, if we matched the phrase "wash your feet" in the target language, the n-gram corresponding to "feet" must be replaced with the n-gram corresponding to "hands." Here's an example for Belize Kriol English:
![][9]
There were, of course, some assumptions that were made during this matching process, and it is entirely possible that this procedure does not produce grammatically correct predictions. For example, I assumed that in most languages, the word for "hands" and the word for "feet" are both one token long (with tokens being separated by spaces and punctuation). This is certainly not always the case. This could create a bad word salad something like "and wash the and hand you" or similar. Hopefully, we can overcome some of these limitations and extend the system in the future, but, for now, we chose to reinforce the idea with graphics.
We adapted the World Health Organization's hand washing instructions into a template PNG image. We then took our translated and generated phrases and rendered them into the hand washing image using a combination of Bash and Go scripts. In this way, the idea of proper hand washing is emphasized in both text and imagery (just in case our generated translations are awkward).
![][10]
### Results
Thus far, I've been able to train cross-lingual embeddings for 544 languages. I used the above-discussed method to try and construct "wash your hands" for all of these languages. Because I don't have aligned data for many of the language pairs, I used separate holdout documents also containing components of "wash your hands" to help validate the tokens in the constructed phrase. This gives us some confidence in the translations that we publicly release (at least that they contain information indicating washing and/or hands). In addition, I compared the method with language pairs that are also supported by Google Translate and/or have available human translations. Here's a sample of the translations with language stats from [the Ethnologue][11]:
#### Language: Italian [ita]
Location: Italy
Population: 68,000,000
Our system: "làvati la mani"
Google Translate: "Lavati le mani"
#### Language: Bulgarian [bul]
Location: Bulgaria
Population: 8,000,000
Our system: "умий ръцете"
Google Translate: "Измий си ръцете"
#### Language: Dutch [nld]
Location: Netherlands
Population: 24,000,000
Our system: "wast uw handen"
Google Translate: "Was je handen"
#### Language: Pijin [pis]
Location: Solomon Islands
Population: 550,000
Our system: "wasim han"
Google Translate: Not supported
#### Language: Tikar [tik]
Location: Cameroon
Population: 110,000
Our system: "ɓɔsi fyàʼ"
Google Translate: Not supported
#### Language: Waffa [waj]
Location: Papua New Guinea
Population: 1,300
Our system: "yaakuuvaitana nnikiiyauvaa fini"
Google Translate: Not supported
The constructed phrases are similar to reference translations or appear to be alternative ways of saying "wash your hands." For example, in Bulgarian, I predict "умий ръцете," and Google Translate predicts "Измий си ръцете." However, if I back-translate my prediction using Google Translate, I still get "wash your hands." There is some uncertainty where I can't compare to reference translations (e.g., Pijin [pis] from the Solomon Islands) or human-annotated spans, but I can still validate that the word for wash (wasim) and the word for hands (han) are used in other reference documents that are necessarily talking about washing, or hands, respectively. About 15% of the translations could be validated using this method, and I hope to validate more as I gather reference dictionaries.
Note, I used at most about 7,000 sentences in each language to get the above translations, even for high-resource languages like Italian. I also did not rely on aligned sentences between the language pairs. Despite this very data-scarce, unsupervised scenario, I was still able to obtain phrases similar to that of Google Translate for languages supported by both systems. This demonstrates the potential utility of this sort of "hybrid" approach (unsupervised alignment of word embeddings + rule-based matching) for translating short phrases into languages where very little data exists.
Note—I'm definitely not saying that this is a solution to the problem of information spread about Coronavirus and other health-related issues. There are still a lot of things to explore and formally evaluate here, and we are working on that. In many cases, this approach won't be able to help construct important informational material in hundreds of languages. However, I think that we should all be trying to develop creative solutions to problems related to the current crisis. Maybe this is one piece of a very large puzzle.
You can view the complete list of validated translations plus human translations on [this Ethnologue guide page][3]. In addition, a more thorough description and analysis of the system in paper form is forthcoming. We welcome feedback from the public on the translations to help fine-tune the system and, most of all, to make sure that health information gets out to marginalized language communities around the world.
### Create your own hand washing posters
We have open sourced [the code used to render complex scripts and generate the hand washing posters][12]. This methodology should be able to handle almost all languages and scripts. You can add your own translation of "wash your hands" to a poster to help spread the word or tailor the translations for your own local context. Be sure to share your generated posters on social media with the hashtag #WashYourHands.
### Develop your AI skills
There are so many exciting AI problems out there that can make a huge impact in the world. If you want to solve problems like the one above with AI or if you think your business might need to start leveraging AI for other things (supply chain optimization, recommendation, customer service automation, etc.), don't miss the [_AI Classroom_ training event this May][13]. _AI Classroom_ is an immersive, three-day virtual training event for anyone with at least some programming experience and foundational understanding of mathematics. The training provides a practical baseline for realistic AI development using Python and open source frameworks like TensorFlow and PyTorch. After completing the course, participants will have the confidence to start developing and deploying their own AI solutions.
_This article was republished with permission from <https://datadan.io/blog/wash-your-hands>_
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/ai-translation
作者:[Daniel Whitenack][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/datadan
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/world_hands_diversity.png?itok=zm4EDxgE (Two diverse hands holding a globe)
[2]: https://www.ethnologue.com/guides/how-many-languages
[3]: https://www.ethnologue.com/guides/health
[4]: https://datadan.io/blog/resources-for-low-resource-machine-translation
[5]: https://en.wikipedia.org/wiki/BLEU
[6]: https://github.com/facebookresearch/MUSE
[7]: https://fasttext.cc/
[8]: https://opensource.com/sites/default/files/uploads/ai-language-translation-wash-your-hands-opensourcedotcom.gif (Using fasttext along with MUSE to perform cross-language embedding)
[9]: https://opensource.com/sites/default/files/uploads/ai-language-translation-wash-your-hands-opensourcedotcom2.gif
[10]: https://opensource.com/sites/default/files/uploads/ai-language-translation-wash-your-hands-opensourcedotcom3.gif
[11]: https://www.ethnologue.com/
[12]: https://github.com/sil-ai/wash-your-hands
[13]: https://datadan.io/

View File

@ -0,0 +1,55 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How Kubernetes saved my desktop application)
[#]: via: (https://opensource.com/article/20/4/kubernetes-desktop-application)
[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen)
How Kubernetes saved my desktop application
======
Keep this fix in mind if you have a broken Java desktop application but
aren't a crypto expert.
![Puzzle pieces coming together to form a computer screen][1]
Recently, fellow Opensource.com scribe James Farrell wrote a wonderful article entitled _[How Ansible brought peace to my home][2]_. In addition to the great article, I really liked the title, one of those unexpected phrases that Im sure brought a smile to many faces.
I recently had a weird but positive experience of my own that begs a similar sort of unexpected label. Ive been grappling with a difficult problem that arose when upgrading some server and networking infrastructure that broke a Java application Ive been supporting since the early 2000s. Strangely enough, I found the solution in what appears to be a very informative and excellent article on Kubernetes, of all things.
Without further ado, here is my problem:
![][3]
Im guessing that most readers will look at that message and think things like, "I hope theres more info in the log file," or "Im really glad Ive never received a message like that."
Unfortunately, there isnt a lot of info in the log file, just the same message, in fact. In an effort to debug this, I did three things:
1. I searched online for the message. Interestingly, or perhaps ominously, there were only 200 or so hits on this string, [one of which suggested][4] [turn][4][ing][4] [on more debugging output][4], which involved adding the setting
```
**-Djavax.net.debug=ssl:handshake:verbose**[/code] to the **java** command running the application.
2. I tried that suggestion, which resulted in a lot of output (good), most of which only vaguely made sense to me as Im no kind of expert in the underlying bits of stuff like SSL. But one thing I did notice is that there was no information regarding a response from the server in the midst of all of that output;
3. So I searched some more.
Another interesting part of this problem is that the code ran fine when executed by the Java command bundled in the OpenJDK, but failed with this error when using a customized runtime [created from the same OpenJDK in this way][5]. So the relatively modest number of apparently similar problems turned up from search #1 above were actually not all that relevant since they all seemed to be dealing mostly with bad SSL certificates on the server in conjunction with the PostgreSQL JDBCs ability to check the servers credentials.
I should also mention that it took me quite some time to realize that the problem was introduced by using the custom Java runtime, as I managed to check many other possibilities along the way (and indeed, I did fix a few minor bugs while I was at it). My efforts included things like getting the latest OpenJDK, checking and re-checking all the URLs in case one had a typo, and so forth.
As often happens, after putting the problem aside for a few hours, an idea occurred to me—perhaps I was missing some module in the customized Java runtime. While I didnt receive any errors directly suggesting that problem, the observable fact that the standard OpenJDK environment worked while the custom one failed seemed to hint at that possibility. I took a quick look in the **jmods/** folder in the OpenJDK installation, but there are some 70 modules there and nothing jumped out at me.
But again, what seemed odd was, with debugging turned on (see #1 above), there was no indication of what the server would accept, just what the client mostly couldnt offer, many lines like this:
```
`Ignoring unavailable cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA`
```
So I was at least thinking by this time that maybe what was missing was the module that offered those kinds of cipher suites. So I started searching with strings like "jdbc crypto," and in the midst of that, the most unlikely article showed up: [Optimizing Kubernetes Services—Part 2: Spring Web][6], written by [Juan Medina][7]. Midway down the article, I spotted the following:
![][8]
Huh! Imagine that, his script is creating a custom Java runtime, just like mine. But he says he needs to add in manually the module **jdk.crypto.ec** in order t

View File

@ -0,0 +1,121 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Use this helpful Bash script when stargazing)
[#]: via: (https://opensource.com/article/20/4/linux-astronomy)
[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss)
Use this helpful Bash script when stargazing
======
Keep your eyes on the stars by putting your Linux machine in night
vision mode with xcalib.
![Computer laptop in space][1]
We often talk about [Linux][2] being used on servers and by developers, but it is used in many other fields too, including astronomy. There are a lot of astronomy tools available for Linux, such as sky maps, star charts, and interfaces to telescope drive systems for controlling your telescope. But one challenge for astronomers is using a computer while keeping their eyes working in the dark.
When working out in the field at night, astronomers need to preserve their night vision. It can take up to 30 minutes for the human eye to fully dilate and adjust to low light levels, and doing things like checking a phone or laptop at the regular color and brightness levels can cause the eyes to lose their adjustment. This reduces the ability to see in the dark. An example anyone can understand: if you're reading something on your phone in bed at night and get up to go to the bathroom, you know how difficult it can be to see any obstacles that might be in your way.
### A solution
I'd like to present a nifty little script to help the astronomer in your family keep "their eyes" in the dark. It relies on a utility called [xcalib][3], a "tiny monitor calibration loader for X.org." It can be installed easily using your Linux package manager.
On Fedora, for example:
```
$ sudo dnf info xcalib
$ sudo dnf install xcalib
```
Or Ubuntu:
```
`$ sudo apt-get install xcalib`
```
The xcalib application works only with X11, so it is not functional on Wayland systems. But Wayland has this functionality built-in, so you can get the same results through GNOME Settings. If you're using X11, xcalib is an easy way to change the color temperature of your display.
### The script
I discovered [Redscreen][4], a night vision filter script written by Jeff Jahr in 2014. The original script is written for the C shell, but Bash is the common default these days. In fact, the C shell is not installed by default on my current Fedora Linux workstation. So, I decided to write an updated version of the Redscreen script aimed at the newest Bash syntax, but I made one major change: utilizing a case statement.
```
#!/usr/bin/bash
# redscreen.sh Fri Feb 28 11:36 EST 2020 Alan Formy-Duval
# Turn screen red - Useful to Astronomers
# Inspired by redscreen.csh created by Jeff Jahr 2014
# (<http://www.jeffrika.com/\~malakai/redscreen/index.html>)
# This program is free software: you can redistribute it
# and/or modify it under the terms of the GNU General
# Public License as published by the Free Software Foundation,
# either version 3 of the License, or (at your option) any
# later version.
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE.  See the GNU General Public License for
# more details.
# You should have received a copy of the GNU General Public
# License along with this program.  
# If not, see &lt;[http://www.gnu.org/licenses/\&gt;][5].
case $1 in
            on)
            # adjust color, gamma, brightness, contrast
            xcalib -green .1 0 1 -blue .1 0 1 -red 0.5 1 40 -alter
            exit 1
        ;;
        off)
                xcalib -clear
            exit 1
            ;;
        inv)
            # Invert screen
                xcalib -i -a
                    exit 1
        ;;
        dim)
            # Make the screen darker
                xcalib -clear
            xcalib -co 30 -alter
            exit 1      
        ;;
        *)
                echo "$0 [on | dim | inv | off]"
                    exit 1
        ;;
esac
```
![Skychart for Linux Version 4.2.1 on Fedora workstation][6]
A lot of astronomy programs include a "night-mode" function, but not all do. Also, this script provides a way to affect the entire screen, not just a specific application. This allows you to use your Linux system out in the field at night for other things than just stargazing—such as checking email or reading Opensource.com—without ruining your night vision.
Whether you are an astronomer or just an amateur stargazer, you can spend all night admiring the heavens using Linux and open source!
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/linux-astronomy
作者:[Alan Formy-Duval][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/alanfdoss
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_space_graphic_cosmic.png?itok=wu493YbB (Computer laptop in space)
[2]: https://opensource.com/resources/linux
[3]: http://xcalib.sourceforge.net/
[4]: http://www.jeffrika.com/~malakai/redscreen/index.html
[5]: http://www.gnu.org/licenses/\>
[6]: https://opensource.com/sites/default/files/uploads/starchart_in_red.png (A star chart displayed in red screen mode)

View File

@ -0,0 +1,92 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to Add Multiple Time Zones in Ubuntu)
[#]: via: (https://itsfoss.com/add-multiple-time-zones-ubuntu/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
How to Add Multiple Time Zones in Ubuntu
======
_**This quick tutorial shows the steps for adding additional clocks for multiple time zones in Ubuntu and other distributions using GNOME desktop environment.**_
If you have family members or colleagues in another country or if you live in a country with multiple time zones, keeping a track of the time difference becomes important. After all, you dont want to disturb someone by calling at 4o clock in the morning.
Some Linux users also keep a tab on the [UTC time][1] because an overwhelming majority of servers use UTC.
Situations like these can be managed better if you have multiple clocks. You can set one clock to your local time and sync other clock(s) to other time zone(s). It makes keep an eye on the different times easier.
In this quick tutorial, Ill show you how to add additional clocks in Ubuntu and other Linux distributions that use GNOME desktop environment.
### Adding multiple time zone clocks in Ubuntu (and other Linux using GNOME)
Please [check which desktop environment you are using][2]. This tutorial is suitable for GNOME desktop only.
To add additional clocks, you can use a nifty little app unsurprisingly called [GNOME Clocks][3].
GNOME Clocks is a simple application that shows the time and date in multiple locations. You can also use it to set alarms or timers. Stopwatch feature is also included.
GNOME Clocks is available in the universe repository in Ubuntu. So please make sure to [enable universe repository][4] first.
You can search for GNOME Clocks in Software Center and install it from there.
![Gnome Clocks Ubuntu Software Center][5]
Alternatively, you can open a terminal and use the following command to install GNOME Clocks:
```
sudo apt install gnome-clocks
```
If you are using some other Linux distribution, please use your distributions software center or package manager to install this application.
Once you have installed it, search for it by pressing the super key (Windows key) and typing clocks:
![Gnome Clocks App Search Ubuntu][6]
Start the application and you should see an interface that provides you a few options like adding world clock, setting alarms, use stopwatch and timer.
Click on the + sign in the top left corner it will give you an option to search for a geographical location. Search it, select it and add it.
![Adding additional clocks][7]
Once you have added the required time zone(s) via its geographical location, you can see that this new clock is now added in the message try. It also shows the time difference between your local time and other time zones.
![Multiple clocks for multiple time zones][8]
You can use Super + M keys to quickly open the message tray. There are some more [useful Ubuntu shortcuts][9] you may master and save your time.
If you want to remove the additional clocks, you can do that from the GNOME Clocks application interface:
![Remove Additional Clocks][10]
You cannot delete your current time zone and set it to something else. There are other ways [to change your current time zone in Linux][11].
I hope you liked this quick tip. Questions and suggestions are always welcome.
--------------------------------------------------------------------------------
via: https://itsfoss.com/add-multiple-time-zones-ubuntu/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://en.wikipedia.org/wiki/Coordinated_Universal_Time
[2]: https://itsfoss.com/find-desktop-environment/
[3]: https://wiki.gnome.org/Apps/Clocks
[4]: https://itsfoss.com/ubuntu-repositories/
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/gnome-clocks-ubuntu-software-center.jpg?ssl=1
[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/gnome-clocks-app-search-ubuntu.jpg?ssl=1
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/add-multiple-time-zones-gnome.jpg?ssl=1
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/multiple-clocks-ubuntu.jpg?ssl=1
[9]: https://itsfoss.com/ubuntu-shortcuts/
[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/remove-additional-clocks-ubuntu.jpg?ssl=1
[11]: https://itsfoss.com/change-timezone-ubuntu/

View File

@ -0,0 +1,229 @@
[#]: collector: "lujun9972"
[#]: translator: "mr-ping"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: subject: "Different Ways To Update Linux Kernel For Ubuntu"
[#]: via: "https://www.ostechnix.com/different-ways-to-update-linux-kernel-for-ubuntu/"
[#]: author: "SK https://www.ostechnix.com/author/sk/"
升级Ubuntu Linux核心的几种不同方法
======
![](https://www.ostechnix.com/wp-content/uploads/2019/01/ubuntu-linux-kernel-720x340.png)
这个指南里介绍了7种为Ubuntu升级Linux核心的不同方法。这7种方法里有5种需要重启系统来使新核心生效其他两种则不用。升级之前**强烈建议您将重要数据进行备份!** 这里提到的所有方法只在Ubuntu中测试过。我们并不确定这些方法是不是也能适用于其他Ubuntu的特色发行版Xubuntu和衍生发行版Linux Mint
### 第一部分: 需要重启的核心升级
以下方法需要您重启系统以便新的核心生效。所有方法都建议在个人系统或测试系统中进行。重要的事儿再说一遍请备份好您Ubuntu中的重要数据、配置文件和其他重要的东西。
### 方法  使用dpkg升级Linux核心(手动方式)
这个方法里会帮助你手动从**[kernel.ubuntu.com][1]**网站下载可用的最新Linux核心。如果你打算安装最新版而不是稳定版或者正式发布版那这种方法对你会很有用。从以上链接下载Linux核心版本。编写这个指南的时候最新的可用版本是**5.0-rc1**,最新的稳定版是**v4.20**.
![][3]
基于你的选择点击相应的Linux核心版本链接找到你对应的架构Build for XXX的那部分。然后下载符合以下格式的两个文件(其中 X.Y.Z 是最高版本号)
1. linux-image-*X.Y.Z*-generic-*.deb
2. linux-modules-X.Y.Z*-generic-*.deb
在终端中修改文件所在的目录,然后执行命令,手动安装核心:
```
$ sudo dpkg --install *.deb
```
重启系统,使用新核心:
```
$ sudo reboot
```
检查是否如你所愿:
```
$ uname -r
```
对于分步的说明请查看以下名为“Install Linux Kernel 4.15 LTS On DEB based systems”的文章。
+ [Install Linux Kernel 4.15 In RPM And DEB Based Systems](https://www.ostechnix.com/install-linux-kernel-4-15-rpm-deb-based-systems/)
以上的指南是针对的是4.15版本,不过安装最新版本的所有的步骤都是一样的。
**优势:** 不必联网你可以从任何系统中下载Linux核心来使用
**缺点:** 手动更新,需要重启系统。
#### 方法2 - 用apt-get来升级Linux核心推荐方法
这是在类Ubuntu系统中升级Linux核心的推荐方法。不同于上一个方法这种方法会从Ubuntu官方仓库下载、安装核心版本而不是从 **kernel.ubuntu.com**网站。
要升级包括核心的整个系统,只需要执行:
```
$ sudo apt-get update
$ sudo apt-get upgrade
```
如果只希望升级核心,运行:
```
$ sudo apt-get upgrade linux-image-generic
```
**优势:** 简单。推荐方法。
**缺点:** 需要联网,需要重启。
从官方库中升级核心是最接近开箱即用的方法并且不会出什么问题。如果是生产环境的系统这是最为推荐的升级Linux核心的方法。
方法1和方法2都需要用户去介入到升级Linux核心的过程中。而下边的方法3、 4、 5则几乎是全自动的。
#### 方法3 - 使用Ukuu升级Linux核心
**Ukuu**是一个用于从**kernel.ubuntu.com**下载Linux核心并且将其自动安装到Ubuntu桌面系统和服务器系统中的Gtk图形化界面和命令行工具。Ukku并不是单单简化了手动下载、安装新核心的过程同时也会帮助你移除旧的和不再需要的核心。更多细节可以参照以下指南。
+ [Ukuu An Easy Way To Install And Upgrade Linux Kernel In Ubuntu-based Systems](https://www.ostechnix.com/ukuu-an-easy-way-to-install-and-upgrade-linux-kernel-in-ubuntu-based-systems/)
**优势:** 易于安装使用。自动安装主线核心。
**缺点:** 需要联网,需要重启。
#### 方法4 - 使用UKTools升级Linux核心
跟Ukuu差不多**UKTools**也会从**kernel.ubuntu.com**网站获取最新的核心并且自动安装到Ubuntu以及类似于Linux Mint的延伸发行版中。
+ [UKTools Upgrade Latest Linux Kernel In Ubuntu And Derivatives](https://www.ostechnix.com/uktools-upgrade-latest-linux-kernel-in-ubuntu-and-derivatives/)
**优势:** 简单,自动
**缺点:** 需要联网,需要重启。
#### 方法5 - 使用Linux核心工具集(Linux Kernel Utilities)安装Linux核心
**Linux Kernel Utilities**是目前另一个用于升级类Ubuntu系统Linux核心的程序。实质上它是一个由一系列Bash脚本构成的合集用于编译并且可以选择性地为Debian译者注Ubuntu的上游发行版及其衍生发行版升级核心。它包含三个工具集一个用于手动编译、安装来自于 [**http://www.kernel.org**][4] 网站的源码核心,另一个用于安装来自**<https://kernel.ubuntu.com>**网站的事先编译好的核心,第三个脚本用于移除旧核心。更多细节请浏览以下链接。
+ [Linux Kernel Utilities Scripts To Compile And Update Latest Linux Kernel For Debian And Derivatives](https://www.ostechnix.com/linux-kernel-utilities-scripts-compile-update-latest-linux-kernel-debian-derivatives/)
**优势:** 简单,自动
**缺点:** 需要联网,需要重启。
### 第二部分 Kernel Updates without reboot
我之前说过,上边所有的方法都需要你去重启服务器(译者注:也可以是桌面版)来启用新核心。如果是个人系统或者测试系统,可以这么办。但对于无法停机的生产环境系统该怎么办呢?一点问题没有,这时候**实时补丁(livepatching)**就派上用场了。
**实时补丁**(或者叫热补丁)允许你在不需要重启的情况下安装Linux升级或补丁来保证你的服务器处于最新的安全等级之下。这对web主机、游戏服务器这类需要不间断在线的服务器来说是很有价值的。事实上任何情况下服务器都应该保持在不间断运行的状态下。由于Linux供应商只会在出于修复安全漏洞的目的下维护补丁所以如果安全性是你的点这种方式再适合不过了。
以下两种方法可以在不需要重启的情况下为生产环境和执行关键任务的Ubuntu服务器更新Linux核心。
#### 方法6 使用Canonical实时补丁服务Canonical Livepatch Service来更新Linux核心
![][5]
[**Canonical Livepatch Service**][6] 可以在不需要重启Ubuntu系统的情况下执行核心升级、补丁和安全的热修复等操作在减少服务器宕机的情况下保障其安全。Canonical Livepatch Service 可以在安装过程当中或安装之后尽心设置. 如果你使用的是Ubuntu桌面版软件更新器会自动检查核心补丁的更新并且通知你。在基于控制台的系统中则需要你主动运行apt-get update命令来进行升级。由于需要你手动运行“apt-get upgrade”命令它才会安装核心的安全补丁所以算是半自动的。
Livepatch对三个及以下系统免费如果多于三个你需要升级成名为**Ubuntu Advantage**的企业支持方案套件。这个套件包括**Kernel Livepatching**及以下服务:
* Extended Security Maintenance Ubuntu生命周期后的重要安全更新
* Landscape 针对大规模使用Ubuntu的系统管理工具
* Knowledge Base 由Ubuntu专家撰写的私人文章和教程
* 电话和网站支持
**价格**
Ubuntu Advantage包含三种付费计划 必备Essential, 标准Standard 高级Advanced.最基础的计划Essential 计划)从 **单物理节点 225 美元/年**和**单VPS 75美元/年**开始计价。看上去应该不支持针对Ubuntu服务器版和桌面版的按月订阅。你可以在 [**此处**][7]浏览所有计划的细节信息。
**优势:** 简单。半自动化。无需重启。支持三个免费系统。
**缺点:** 4个以上主机的话非常昂贵. 没有补丁回滚。
**开启 Canonical Livepatch Service**
如果你想在安装后设置实时补丁服务,依照以下方法逐步执行:
从 [**https://auth.livepatch.canonical.com/**][8] 获取一个秘钥.
```
$ sudo snap install canonical-livepatch
$ sudo canonical-livepatch enable your-key
```
#### 方法 使用KernelCare升级Linux内核
![][9]
[**KernelCare**][10] 是所有实时补丁方案中最新的一个. 它是 [CloudLinux][11]推出的产品. KernelCare 可以运行在Ubuntu和其他的Linux特殊发行版中. 它每四个小时检查一遍补丁的发布,并在无需确认的情况下安装它们. 如果更新后存在问题,可以将补丁进行回滚。
**价格**
费用,每台服务器:**4 美元/月** , **45 美元/年**.
跟Ubuntu Livepatch相比kernelCare看起来非常便宜、实惠。好的方面在于**也可以按月订阅**。另一个前者不具备的功能是支持如Red Hat, CentOS, Debian, Oracle Linux, Amazon Linux 以及 OpenVZ, Proxmox 这种虚拟平台等等的其他Linux发行版。
你可以在 [**此处**][12] 了解KernelCare的所有特性和简介以及所有的付费计划的细节。
**优势:** 简单。全自动化。范围更广的操作系统覆盖。补丁回滚。无需重启。对非盈利组织提供免费许可。价格低廉。
**缺点:** 除了30天试用外无免费计划。
**开启 KernelCare Service**
此处 [**https://cloudlinux.com/kernelcare-free-trial5**][14] 获取30天免费试用秘钥。
执行以下命令开启KernelCare并注册秘钥。
```
$ sudo wget -qq -O - https://repo.cloudlinux.com/kernelcare/kernelcare_install.sh | bash
$ sudo /usr/bin/kcarectl --register KEY
```
如果你的目标是价格实惠并且通过可靠的社区服务来保障你的Linux服务器核心的更新那KernelCare是个不错的选择。
*由来自Cloud Linux的技术撰稿人和内容作者**Paul A. Jacobs**撰写。*
**推荐阅读:**
到此,希望这边文章能对你有所帮助。如果你觉得还有其他的工具和方法需要列在这里,可以在留言区给我们留言。我会根据反馈检查和更新这篇指南的。
接下来会有更多好东西给大家呈现,敬请期待。
Cheers!
--------------------------------------------------------------------------------
via: https://www.ostechnix.com/different-ways-to-update-linux-kernel-for-ubuntu/
作者:[SK][a]
选题:[lujun9972][b]
译者:[mr-ping](https://github.com/mr-ping)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.ostechnix.com/author/sk/
[b]: https://github.com/lujun9972
[1]: http://kernel.ubuntu.com/~kernel-ppa/mainline/
[2]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
[3]: http://www.ostechnix.com/wp-content/uploads/2019/01/Ubuntu-mainline-kernel.png
[4]: http://www.kernel.org
[5]: http://www.ostechnix.com/wp-content/uploads/2019/01/Livepatch.png
[6]: https://www.ubuntu.com/livepatch
[7]: https://www.ubuntu.com/support/plans-and-pricing
[8]: https://auth.livepatch.canonical.com/
[9]: http://www.ostechnix.com/wp-content/uploads/2019/01/KernelCare.png
[10]: https://www.kernelcare.com/
[11]: https://www.cloudlinux.com/
[12]: https://www.kernelcare.com/update-kernel-linux/
[13]: https://www.kernelcare.com/pricing/
[14]: https://cloudlinux.com/kernelcare-free-trial5

View File

@ -1,260 +0,0 @@
[#]: collector: "lujun9972"
[#]: translator: "chunibyo-wly"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: subject: "How to write a loop in Bash"
[#]: via: "https://opensource.com/article/19/6/how-write-loop-bash"
[#]: author: "Seth Kenlon https://opensource.com/users/seth/users/goncasousa/users/howtopamm/users/howtopamm/users/seth/users/wavesailor/users/seth"
# 如何在 Bash 中使用循环
使用循环和查找命令批量自动处理文件。
![bash logo on green background][1]
人们希望学习批处理命令的一个普遍原因是批处理具有强大的功能。如果你希望批量的对文件执行指令,制作一个可以重复运行在那些文件上的命令就是一种方法。在编程术语中,这被称作 _execution control_ **for** 循环就是其中最常见的一种。
**for** 循环可以详细描述你希望你的计算机对 _for_ 遍历的数据对象(比如说文件)所进行的操作。
### 一般循环
使用循环的一个简单例子是对一组文件进行分析。这个循环可能没什么用,但是这是一个安全的证明自己有能力独立处理文件夹里每一个文件的方法。首先,创建一个文件夹然后拷贝一些文件(例如 JPEGPNG 等类似的文件)至文件夹中生成一个测试环境。你可以通过文件管理器或者终端来完成创建文件夹和拷贝文件的操作:
```bash
$ mkdir example
$ cp ~/Pictures/vacation/*.{png,jpg} example
```
切换到你刚创建的那个文件夹,然后列出文件并确认这个测试环境是你需要的:
```
$ cd example
$ ls -1
cat.jpg
design_maori.png
otago.jpg
waterfall.png
```
在循环中逐一遍历文件的语法是:首先声明一个变量(例如使用 **f** 代表文件),然后定义一个你希望用变量循环的数据集。在这种情况下,使用 **\*** 通配符来遍历当前文件夹下的所有文件(通配符 **\*** 匹配 _一切_)。然后使用一个分号(**;**)来结束这个语句。
```
`$ for f in * ;`
```
取决于你个人的喜好,你可以选择在这里按下 **Return**。在语法完成前shell 是不会尝试执行这个循环的。
接下来,定义在每次循环中你想要进行的操作。简单起见,使用 **file** 命令来得到 **f** 变量(使用 **\$** 告诉 shell 使用这个变量的值,无论这个变量现在存储着什么)所存储着的文件的信息:
```
`do file $f ;`
```
使用另一个引号结束这一行,然后关闭这个循环:
```
`done`
```
按下 **Return** 启动 shell 对当前文件夹下 _所有东西_ 的遍历。**for** 循环将会一个一个的将文件分配给变量 **f** 并且执行你的命令:
```
$ for f in * ; do
> file $f ;
> done
cat.jpg: JPEG image data, EXIF standard 2.2
design_maori.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced
otago.jpg: JPEG image data, EXIF standard 2.2
waterfall.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced
```
你也可以用这种形式书写命令:
```
$ for f in *; do file $f; done
cat.jpg: JPEG image data, EXIF standard 2.2
design_maori.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced
otago.jpg: JPEG image data, EXIF standard 2.2
waterfall.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced
```
对你的 shell 来说,多行和单行的格式没有什么区别,并且会输出完全一样的结果。
### 一个实用的例子
下面是一个循环在日常使用中的实用案例。假如你拥有一堆假期拍的照片想要发给你的朋友。它们对于 email 来说太大了,上传到 [photo-sharing service][2] 也不方便。因此你希望创建小型的 web 版本的照片,但是你不希望花费太多时间在一个一个的压缩图片体积上。
首先,在你的 LinuxBSD 或者 Mac 上使用包管理器安装 **ImageMagick** 命令。例如,在 Fedora 和 RHEL 上:
```
`$ sudo dnf install ImageMagick`
```
在 Ubuntu 和 Debian 上:
```
`$ sudo apt install ImageMagick`
```
在 BSD 上,使用 **ports** 或者 [pkgsrc][3]。在 Mac 上,使用 [Homebrew][4] 或者 [MacPorts][5]。
在你安装了 ImageMagick 之后,你就拥有一系列命令可以用来操作图片了。
为你将要创建的文件建立一个目标文件夹:
```
`$ mkdir tmp`
```
使用下面的循环可以将每张图片减小至原来大小的 33%。
```
`$ for f in * ; do convert $f -scale 33% tmp/$f ; done`
```
然后就可以在 **tmp** 文件夹中看到已经缩小了的照片了。
你可以在循环体中使用任意数量的命令,因此如果你需要对一批文件进行复杂的操作,可以将你的命令放在一个 **for** 循环的 **do****done** 声明之间。例如,假设你希望将所有处理过的图片拷贝至你的网站所托管的图片文件夹并且在本地系统移除这些文件:
```
$ for f in * ; do
convert $f -scale 33% tmp/$f
scp -i seth_web tmp/$f [seth@example.com][6]:~/public_html
trash tmp/$f ;
done
```
你的计算机会对 **for** 循环中处理的每一个文件自动的执行 3 条命令。这意味着假如你仅仅处理 10 张图片,也会省下 30 条指令和更多的时间。
### 限制你的循环
一个循环常常不需要处理所有文件。在示例文件夹中,你可能需要处理的只是 JPEG 文件:
```
$ for f in *.jpg ; do convert $f -scale 33% tmp/$f ; done
$ ls -m tmp
cat.jpg, otago.jpg
```
或者,你希望重复特定次数的某个操作而不仅仅只处理文件。**for** 循环的变量的值是被你赋给它的不管何种类型的数据所决定的,所以你可以创建一个循环遍历数字而不只是文件:
```
$ for n in {0..4}; do echo $n ; done
0
1
2
3
4
```
### 更多循环
现在你了解的知识已经足够用来创建自己的循环体了。直到你对循环非常熟悉之前,尽可能的在需要处理的文件的 _复制_ 上进行操作。使用固有的保护措施可以预防损坏自己的数据和制造不可复现的错误,例如偶然将一个文件夹下的所有文件重命名为同一个名字,就可能会导致他们的相互覆盖。
更多的 **for** 循环话题,请继续阅读。
### Not all shells are Bash 不是所有的 shell 都是 Bash
关键字 **for** 是内置在 Bash shell 中的。许多类似的 shell 会使用和 Bash 同样的关键字和语法,但是也有某些 shell ,比如 [tcsh][7],使用不同的关键字,例如 **foreach**
tcsh 的语法与 Bash 类似,但是它更为严格。例如在下面的例子中,不要在你的终端的第 23 行键入 **foreach?** 。它只是提示你仍处在构建循环的过程中。
```
$ foreach f (*)
foreach? file $f
foreach? end
cat.jpg: JPEG image data, EXIF standard 2.2
design_maori.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced
otago.jpg: JPEG image data, EXIF standard 2.2
waterfall.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced
```
在 tcsh 中,**foreach** 和 **end** 都必须单独的在一行中出现。因此你不能像 Bash 或者其他类似的 shell 一样只使用一行命令创建一个 **for** 循环。
### for 循环与 find 命令
理论上,你可能会用到不支持 **for** 循环的 shell或者你只是更想使用其他命令的一些特性来完成和循环一样的工作。
使用**find** 命令是另一个实现 **for** 循环功能的途径。这个命令通过 [Parallel][8] 提供了几种方法来定义你的循环中需要包括的文件的范围。
**find** 命令顾名思义就是帮助你查询存储在硬盘里的文件。他的用法很简单:提供一个你希望它查询的位置的路径,接着 **find** 就会查询这个路径下面的所有文件和文件夹。
```
$ find .
.
./cat.jpg
./design_maori.png
./otago.jpg
./waterfall.png
```
你可以通过添加名称的某些部分用于过滤搜索结果:
```
$ find . -name "*jpg"
./cat.jpg
./otago.jpg
```
**find** 命令非常好的地方在于你可以通过 **-exec** 参数标志将它查询到的每一个文件放入循环中。例如,只对存放在你的 example 文件夹下的 PNG 图片进行体积压缩操作:
```
$ find . -name "*png" -exec convert {} -scale 33% tmp/{} \;
$ ls -m tmp
design_maori.png, waterfall.png
```
**-exec** 短语中,括号 **{}** 表示的是 **find** 正在处理的条目(换句话说,每一个被找到的以 PNG 结尾的文件)。**-exec** 短语必须使用分号结尾,但是 Bash 中常常也会使用分号。为了解决这个二义性问题,你的 **结束符** 可以使用反斜杠加上一个分号(**\;**),使得 **find** 命令可以知道这个结束符是用来标识自己结束使用的。
**find** 命令的操作非常棒,某些情况下它甚至可以表现得更棒。比如说,在一个新的进程中使用同一条命令查找 PNG 文件,你可能就会得到一些错误信息:
```
$ find . -name "*png" -exec convert {} -flip -flop tmp/{} \;
convert: unable to open image `tmp/./tmp/design_maori.png':
No such file or directory @ error/blob.c/OpenBlob/2643.
...
```
看起来 **find** 不只是定位了当前文件夹(**.**)下的所有 PNG 文件,还包括已经处理并且存储到了 **tmp** 下的文件。在一些情况下,你可能希望 **find** 查询当前文件夹下再加上其子文件夹下的所有文件。**find** 命令是一个功能强大的递归工具,特别体现在处理一些文件结构复杂的情境下(比如用来放置存满了音乐人音乐专辑的文件夹),同时你也可以使用 **-maxdepth** 选项来限制最大的递归深度。
只在当前文件夹下查找 PNG 文件(不包括子文件夹)
```
`$ find . -maxdepth 1 -name "*png"`
```
上一条命令的最大深度再加 1 就可以查找和处理当前文件夹及下一级子文件夹下面的文件
```
`$ find . -maxdepth 2 -name "*png"`
```
**find** 命令默认是查找每一级文件夹。
### 循环的乐趣与收益
你使用的循环越多,你就可以越多的省下时间和力气,并且可以应对庞大的任务。虽然你只是一个用户,但是通过使用循环,可以使你的计算机完成困难的任务。
你可以并且应该使用循环就像使用其他的命令一样。在你需要重复的处理单个或多个文件时,尽可能的使用这个命令。无论如何,这也算是一项需要被严肃对待的编程活动,因此如果你需要在一些文件上完成复杂的任务,你应该多花点时间在计划自己的工作流上面。如果你可以在一份文件上完成你的工作,接下来将操作包装进 **for** 循环里就相对简单了,这里面唯一的“编程”的需要只是理解变量是如何工作的并且进行充分的规划工作将已处理过的文件和未处理过的文件分开。经过一段时间的练习,你就可以从一名 Linux 用户升级成一位知道如何使用循环的 Linux 用户,所以开始让计算机为你工作吧!
---
via: https://opensource.com/article/19/6/how-write-loop-bash
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[chunibyo-wly](https://github.com/chunibyo-wly)
校对:[校对者 ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux 中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth/users/goncasousa/users/howtopamm/users/howtopamm/users/seth/users/wavesailor/users/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bash_command_line.png?itok=k4z94W2U "bash logo on green background"
[2]: http://nextcloud.com
[3]: http://pkgsrc.org
[4]: http://brew.sh
[5]: https://www.macports.org
[6]: mailto:seth@example.com
[7]: https://en.wikipedia.org/wiki/Tcsh
[8]: https://opensource.com/article/18/5/gnu-parallel

View File

@ -0,0 +1,172 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Navigating man pages in Linux)
[#]: via: (https://www.networkworld.com/article/3519853/navigating-man-pages-in-linux.html)
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
在 Linux 中遨游手册页的海洋
======
> Linux 系统上的手册页可以做的不仅仅是提供特定命令的信息。它们可以帮助你发现你没有意识到的命令。
[Hello I'm Nik][1] [(CC0)][2]
手册页提供了关于 Linux 命令的基本信息,很多用户经常参考它,但手册页的内容比我们很多人意识到的要多得多。
你总是可以输入一个像 `man who` 这样的命令,然后得到 `who` 命令的工作原理的漂亮描述,但是探索你可能不知道的命令可能会更有启发。例如,你可以使用 `man` 命令来帮助确定处理一些非常具有挑战性的任务的命令,或者显示一些选项,这些选项可以帮助你以新的更好的方式使用你已经知道的命令。
让我们来浏览一些选项,看看最终的结果是什么。
### 用 man 去识别命令
`man` 命令可以帮助你按主题查找命令。例如,如果你要找一个计算文件中的行数的命令,你可以提供一个关键字。在下面的例子中,我们把关键字 “count” 放在了引号中,并添加了空格,这样我们就不会得到与 “accounts” 或 “accounting” 相关的命令,而是得到那些可以为我们做一些计算的命令。
```
$ man -k ' count '
anvil (8postfix) - Postfix session count and request rate control
cksum (1) - checksum and count the bytes in a file
sum (1) - checksum and count the blocks in a file
timer_getoverrun (2) - get overrun count for a POSIX per-process timer
```
为了显示与新用户账户相关的命令,我们可以尝试使用这样的命令。
```
$ man -k "new user"
newusers (8) - update and create new users in batch
useradd (8) - create a new user or update default new user information
zshroadmap (1) - informal introduction to the zsh manual The Zsh Manual, …
```
需要说明的是,上面的第三项只是提到 “new users” 类似的内容,并不是设置、删除或配置用户账号的命令。`man` 命令只是在命令描述中匹配了一些词,作用很像 `apropos` 命令。注意上面列出的每个命令后面的括号中的数字。这些数字与包含这些命令的手册页的部分有关。
### 确定手册页的部分
`man` 命令部分将命令划分为不同的类别。要列出这些类别,请键入 `man man`,并查看类似下面的描述。你的系统中很可能没有第 9 部分的命令。
- `1`:可执行程序或 shell 命令
- `2`:系统调用(内核提供的函数)
- `3`:库调用(程序库内的函数)
- `4`:特殊文件(通常在可以 `/dev` 中找到)
- `5`:文件格式和惯例,例如 `/etc/passwd`
- `6`:游戏
- `7`:杂项(包括宏包和约定),例如 `man`(7)、`groff`(7)
- `8`:系统管理命令(通常只由 root 用户使用)
- `9`:内核例程(非标准)
手册页涵盖了比我们通常认为的“命令”更多的内容。从上面的描述中可以看到,它们涵盖了系统调用、库调用、特殊文件等等。
下面的列表显示了 Linux 系统中的手册页的实际存储位置。这些目录上的日期会有所不同,因为随着更新,其中一些部分会有新的内容,而另一些则不会。
```
$ ls -ld /usr/share/man/man?
drwxr-xr-x 2 root root 98304 Feb 5 16:27 /usr/share/man/man1
drwxr-xr-x 2 root root 65536 Oct 23 17:39 /usr/share/man/man2
drwxr-xr-x 2 root root 270336 Nov 15 06:28 /usr/share/man/man3
drwxr-xr-x 2 root root 4096 Feb 4 10:16 /usr/share/man/man4
drwxr-xr-x 2 root root 28672 Feb 5 16:25 /usr/share/man/man5
drwxr-xr-x 2 root root 4096 Oct 23 17:40 /usr/share/man/man6
drwxr-xr-x 2 root root 20480 Feb 5 16:25 /usr/share/man/man7
drwxr-xr-x 2 root root 57344 Feb 5 16:25 /usr/share/man/man8
```
注意,为了节省空间,手册页文件一般都是 gzip 压缩的。每当你使用 `man` 命令时,`man` 命令会根据需要解压。
```
$ ls -l /usr/share/man/man1 | head -10
total 12632
lrwxrwxrwx 1 root root 9 Sep 5 06:38 [.1.gz -> test.1.gz
-rw-r--r-- 1 root root 563 Nov 7 05:07 2to3-2.7.1.gz
-rw-r--r-- 1 root root 592 Apr 23 2016 411toppm.1.gz
-rw-r--r-- 1 root root 2866 Aug 14 10:36 a2query.1.gz
-rw-r--r-- 1 root root 2361 Sep 9 15:13 aa-enabled.1.gz
-rw-r--r-- 1 root root 2675 Sep 9 15:13 aa-exec.1.gz
-rw-r--r-- 1 root root 1142 Apr 3 2018 aaflip.1.gz
-rw-r--r-- 1 root root 3847 Aug 14 10:36 ab.1.gz
-rw-r--r-- 1 root root 2378 Aug 23 2018 ac.1.gz
```
### 按部分列出的手册页
即使只看第 1 部分的前 10 个手册页(如上所示),你也可能会看到一些新的命令 —— 也许是 `a2query``aaflip`(如上所示)。
探索命令的更好策略是按节列出命令,不查看文件本身,而是使用 `man` 命令向你显示命令并提供每个命令的简要说明。
在下面的命令中,`-s 1` 指示 `man` 显示第 1 部分中的命令信息。`-k .` 使该命令对所有命令都有效,而不是指定一个特定的关键字;如果没有这个,`man` 命令就会回过头来问:“你想要什么手册页?”所以,使用关键字来选择一组相关的命令,或者使用点来显示一个部分中的所有命令。
```
$ man -s 1 -k .
2to3-2.7 (1) - Python2 to Python3 converter
411toppm (1) - convert Sony Mavica .411 image to ppm
as (1) - the portable GNU assembler.
baobab (1) - A graphical tool to analyze disk usage
busybox (1) - The Swiss Army Knife of Embedded Linux
cmatrix (1) - simulates the display from "The Matrix"
expect_dislocate (1) - disconnect and reconnect processes
red (1) - line-oriented text editor
enchant (1) - a spellchecker
```
### 有几本手册页?
如果你对每个部分中有多少手册页感到好奇,可以使用以下命令按部分对它们进行计数:
```
$ for num in {1..8}
> do
> man -s $num -k . | wc -l
> done
2382
493
2935
53
441
11
245
919
```
确切的数量可能有所不同,但是大多数 Linux 系统的命令数量差不多。如果我们使用命令将这些数字加在一起,我们可以看到运行该命令的系统上有将近 7500 个手册页。有很多命令,系统调用等。
```
$ for num in {1..8}
> do
> num=`man -s $num -k . | wc -l`
> tot=`expr $num + $tot`
> echo $tot
> done
2382
2875
5810
5863
6304
6315
6560
7479 <=== total
```
阅读手册页可以学到很多东西,但是以其他方式浏览手册页可以帮助你了解系统上可能不知道的命令。
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3519853/navigating-man-pages-in-linux.html
作者:[Sandra Henry-Stocker][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/
[b]: https://github.com/lujun9972
[1]: https://unsplash.com/photos/YiRQIglwYig
[2]: https://creativecommons.org/publicdomain/zero/1.0/
[3]: https://www.networkworld.com/slideshow/153439/linux-best-desktop-distros-for-newbies.html#tk.nww-infsb
[4]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage)
[5]: https://www.facebook.com/NetworkWorld/
[6]: https://www.linkedin.com/company/network-world

View File

@ -0,0 +1,100 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Build a private chat server with a Raspberry Pi and Rocket.Chat)
[#]: via: (https://opensource.com/article/20/3/raspberry-pi-rocketchat)
[#]: author: (Giuseppe Cassibba https://opensource.com/users/peppe8o)
使用树莓派和 Rocket.Chat 构建一个私人聊天服务器
======
使用这些简单、经济高效的开源工具创建你自己的真正私人聊天和消息解决方案。
![Chat via email][1]
互联网提供大量免费的消息服务。WhatsApp 和 Viber 等应用是我们日常生活的一部分,也是我们与亲朋好友沟通的最常见方式。但是,安全意识正在增加对真正私人聊天解决方案的需求。此外,消息应用在我们的设备中占用了大量空间,因此备用聊天渠道可用于与朋友共享媒体、信息和联系人。
今天,我们将了解如何使用[树莓派][2]和 Rocket.Chat 安装一个私人聊天和消息服务器。
### 什么是 Rocket.Chat
[Rocket.Chat][3] 是一个开源解决方案,它提供增强的聊天服务。它包括媒体共享、屏幕共享和视频/音频呼叫支持等协作工具。
它可以通过浏览器或从所有主要应用商店Google Play、App Store 等)下载使用。
除了社区版本外Rocket.Chat 还提供企业版和专业版,包括支持和其他功能。
### 我们需要什么
对于这个项目,我将使用更便宜的树莓派 3 model A+。树莓派 3 model B 和 B+ 以及树莓派 4 model B 工作应该一样。
我也建议使用高性能 SD 卡,因为 Rocket.Chat 会给树莓派大量的负载。如其他文章中所述,高性能 SD 卡可显著提高 Raspbian 操作系统的性能。
我们将使用 Raspbian 的精简版本,拥有预配置的 WiFi 访问和 SSH 服务,因此不需要键盘或 HDMI 线缆。
### 分步过程
从[安装最新版本的 Raspbian Buster Lite][5] 开始
我们将使用 [Snap][6] 简化 Rocket.Chat 安装。通过 SSH 登录并从终端输入:
```
sudo apt-get update
sudo apt-get upgrade
```
安装 Snap
```
`sudo apt-get install snapd`
```
安装 Snap 后,我们需要重启系统使其正常工作:
```
`sudo reboot`
```
再次通过 SSH 登录,并用以下简单的命令安装 Rocket.Chat
```
`sudo snap install rocketchat-server`
```
从终端安装后,请等待一段时间,等待 Rocket.Chat 初始化数据库和服务。休息一下,几分钟后,你应该能够在浏览器中访问 http://&lt;&lt;YOUR_RPI_IP_ADDRESS&gt;&gt;:3000你应该看到以下内容
![Rocket Chat setup wizard][7]
填写所需的表格就可以了。四个简单的设置窗口后,你应该会进入 Rocket.Chat 主页:
![Rocket Chat home page][8]
享受吧!
_本文最初发表在 [peppe8o.com][9]并获许重新发布。_
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/3/raspberry-pi-rocketchat
作者:[Giuseppe Cassibba][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/peppe8o
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/email_chat_communication_message.png?itok=LKjiLnQu (Chat via email)
[2]: https://opensource.com/resources/raspberry-pi
[3]: https://rocket.chat/
[5]: https://peppe8o.com/2019/07/install-raspbian-buster-lite-in-your-raspberry-pi/
[6]: https://snapcraft.io/
[7]: https://opensource.com/sites/default/files/uploads/rocket-chat-setup-wizard.jpg (Rocket Chat setup wizard)
[8]: https://opensource.com/sites/default/files/uploads/rocket-chat-home.jpg (Rocket Chat home page)
[9]: https://peppe8o.com/private-chat-and-messaging-server-with-raspberry-pi-and-rocket-chat/

View File

@ -1,182 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (messon007)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (The Keyring Concept in Ubuntu: What is It and How to Use it?)
[#]: via: (https://itsfoss.com/ubuntu-keyring/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
解读Ubuntu里的密钥环概念
======
如果您用过[ubuntu里的自动登录功能][1]或者其他的Linux发行版, 您可能遇到过这种弹出消息:
**请输入密码以解锁您的登录密钥环
登录密钥环在您登录系统时未解锁**
![Enter Password To Unlock Your Login Keyring Ubuntu][2]
你需要点击多次取消才能让它消失。你可能想知道为什么系统会多次反复提示这个密钥环消息?
让我来告诉你答案。它其实并没有出错,它只是一个安全特性。
奇怪吗下面就让我来解释下Linux里的密钥环概念。
### Linux里的密钥环是什么以及为什么需要它?
![][3]
在现实生活中您为什么要用钥匙环(也叫[钥匙链][4])? 您用它把一把或多把钥匙串到一起, 以便于携带和查找。
Linux里也是类似的。密钥环特性使您的系统可以将各种密码放在一起并将其保存在一个地方。
大多数Linux桌面环境像GNOME, KDE, Xfce等采用[gnome的密钥环][5]实现来提供这个功能。
该密钥环保存了ssh密钥GPG密钥以及使用此功能的应用程序例如Chromium浏览器的密钥。 默认情况下,**“密钥环”通过主密码来保护**,该密码通常是帐户的登录密码。
系统上的每个用户都有自己的密钥环,(通常)密码与用户帐户本身的密码相同。 当您使用密码登录系统时,您的密匙环将使用您帐户的密码自动解锁。
当您[启用Ubuntu中的自动登录功能时][1]时,就有问题了。这意味着您无需输入密码即可登录系统。 在这种情况下,您的密钥环不会自动解锁。
#### 密钥环是一个安全特性
记得我说过密钥环是一个安全特性吗现在想象一下您在您的Linux电脑上开启了自动登录功能。有权访问您电脑的任何人无需密码就能进入您的系统。但是您可能不会在意因为您只是用它来访问互联网。
但是如果您使用Chromium或[Ubuntu中的Google Chrome][6]之类的浏览器,并使用它来保存各种网站的登录密码,那么您将遇到麻烦。任何人都可以使用浏览器并利用您在浏览器中保存的密码登录网站。那不就是风险吗?
这就是为什么当您使用Chrome时它将反复地提示您先解锁密钥环。这确保了只有知道密钥环密码的人才能使用在浏览器中保存的密码来登录它们相关的网站。
如果您反复取消解锁密钥环的提示它最终将消失并允许您使用浏览器。但是保存的密码将不会被解锁您在Chromium/Chome浏览器上将会看到'同步暂停'的提示。
![Sync paused in Google Chrome][7]
#### 如果密钥环总是存在的,为什么您从来没有见过它呢?
如果您在您的Linux系统上从没见过它的话这就是一个有效的问题。
如果您从没有用过自动登录功能(或者修改您的账户密码),您可能都没有意识到这个特性的存在。
这是因为当您通过您的密码登录系统时,您的密钥环被您的账户密码自动解锁了。
Ubuntu(和其他发行版)对于通用的管理任务像修改用户, 安装新软件等需要输入密码,无论您是否是自动登录的。但是对于日常任务像使用浏览器,它不需要输入密码因为密钥环已经被解锁了。
当您切换到自动登录时,您不再需要输入登录密码。这意味着密钥环没有被自动解锁,因此当您使用利用了密钥环特性的浏览器时,它将提示您来解锁密钥环。
#### 您可以容易地管理密钥环和密码
这个密钥环放在哪里?它的核心是一个守护任务(一个后台自动运行的程序)。
别担心。您不必通过终端来操作守护任务。大多数桌面环境都自带有图形化的应用程序可以和守护进程进行交互。KDE上有KDE钱包GNOME和其他桌面上叫做密码和密钥(原来叫[海马][8])。
![Password And Keys App in Ubuntu][9]
您可以用这个GUI程序来查看什么应用程序在用密钥环来管理/保护密码。
您可以看到我的系统有自动创建的登录密钥环。也有一个存储GPG和SSH密钥的密钥环。那个[证书][10]是用来保存证书机构颁发的证书(像HTTPS证书)的。
![Password and Keys application in Ubuntu][11]
您也可以使用这个应用程序来手动保存网站的密码。例如,我创建了一个新的叫做'Test'的被密码保护的密钥环,并手动存储了一个密码。
这比保存一批密码在一个文本文件中要好一些。至少在这种情况下,您的密码只有在您通过密码解锁了密钥环时才允许被看到。
![Saving New Password Seahorse][12]
一个潜在的问题是如果您格式化您的系统,手动保存的密码必然会丢失。通常,您会备份您的个人文件,但并不是所有的用户特定数据如密钥环文件。
有一种办法能解决它。密钥环数据通常保存在~/.local/share/keyrings目录。在这里您可以看到所有的密钥环但是您不能直接看到它们的内容。如果您移除密钥环的密码(我会在这篇文章的后面描述操作步骤)您可以像一个普通的文本文件一样读取密钥环的内容。您可以完整地拷贝这个解锁后的密钥环文件并在其他的Linux机器(安装了密码和密钥应用)上导入到密码和密钥应用程序。
总结一下目前为止所学的内容:
* 大多数Linux缺省已经安装并激活了密钥环特性
* 系统上的每个用户都拥有他自己的密钥环
* 密钥环通常被账户密码锁定(保护)
* 当您通过密码登录时密钥环会被自动解锁
* 对于自动登录,密钥环不会自动解锁,因此当您试图使用依赖密钥环的应用程序时会被提示先解锁它
* 并不是所有的浏览器或应用程序利用了密钥环特性
* (Linux上)安装了一个GUI程序可以和密钥环交互
* 您可以用密钥环来手动以加密格式来存储密码
* 您可以自己修改密钥环密码
* 您可以通过导出(需要先解锁密钥环)并导入(到其他计算机上)的方式来获取手工保存的密码。
### 修改密钥环密码
假设您修改了您的账户密码。当您登录时,您的系统试图通过新的登录密码来自动解锁密钥环。但是密钥环还在使用老的登录密码。
这种情况下,您可以修改密钥环密码为新的登录密码,这样密码环才能在您登录系统时自动解锁。
从菜单中打开密码和密钥应用程序:
![Look for Password and Keys app in the menu][9]
在登录密钥环上右击并点击修改密码:
![Change Keyring Password][13]
如果您不记得老的登录密码怎么办?
您可能知道[Ubuntu上复位忘记的密码是很容易的][14]。但是密钥环在这种场景下还是有问题。您修改了账户密码但是您不记得仍然被密钥环使用的老的账户密码。
您不能修改它因为您不知道老的密码。怎么办?
这种情况下,您将不得不移除整个密钥环。您可以通过密码和密钥应用程序来操作:
![Delete Keyring Ubuntu][15]
它会提示您进行确认:
![Delete Keyring][16]
另外,您也可以手动删除~/.local/share/keyrings目录下的密钥环文件。
老的密钥环文件被移除后您再打开Chrome/Chromium时它会提示您创建一个新的密钥环。
![New Keyring Password][17]
您可以用新的登录密码,密钥环就会被自动解锁了。
### 禁用密钥环密码
在您想用自动登录但又不想手动解锁密钥环时,您可以把禁用密钥环密码作为一个规避方法。记住您正在禁用一个安全特性,因此请三思。
操作步骤和修改密钥环相似。打开密码和密钥应用程序,然后修改密钥环密码。
技巧在于当它提示修改密码时,不要输入新密码,而是点击继续按钮。这将移除密钥环的密码。
![Disable Keyring password by not setting any password at all][18]
这种方法,密钥环没有密码保护并将一直处于解锁状态。
--------------------------------------------------------------------------------
via: https://itsfoss.com/ubuntu-keyring/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[messon007](https://github.com/messon007)
校对:[校对者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://itsfoss.com/ubuntu-automatic-logon/
[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/enter-password-to-unlock-your-login-keyring-ubuntu.jpg?ssl=1
[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/keyring-concept-ubuntu-1.png?ssl=1
[4]: https://en.wikipedia.org/wiki/Keychain
[5]: https://wiki.archlinux.org/index.php/GNOME/Keyring
[6]: https://itsfoss.com/install-chrome-ubuntu/
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/sync-paused-keyring-ubuntu.jpg?ssl=1
[8]: https://wiki.debian.org/Seahorse
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/password-and-keys-app-ubuntu.jpg?ssl=1
[10]: https://help.ubuntu.com/lts/serverguide/certificates-and-security.html
[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/keyring-pasword-ubuntu.png?ssl=1
[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/saving-new-password-seahorse.png?ssl=1
[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/change-keyring-password.png?ssl=1
[14]: https://itsfoss.com/how-to-hack-ubuntu-password/
[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/delete-keyring-ubuntu.jpg?ssl=1
[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/delete-keyring.jpg?ssl=1
[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/new-keyring-password.jpg?ssl=1
[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/disable-keyring-password-ubuntu.png?ssl=1

View File

@ -1,153 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (MjSeven)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Scheduling tasks on Linux using the at command)
[#]: via: (https://www.networkworld.com/article/3535808/scheduling-tasks-on-linux-using-the-at-command.html)
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
使用 at 命令在 Linu 上安排任务
======
at 命令可以很容易地安排 Linux 任务在你选择的任何时间或日期运行,让我们来看看它能为你做什么。
![][0]
romkaz / Getty Images
当你希望命令或脚本在某个特定时间运行时,你不需要将手指放在键盘上盘旋等待按下回车键,或者是在特定时间坐在办公桌前。相反,你可以通过 **at** 命令来设置任务。在本文中,我们将研究如何使用 **at** 来安排任务,如何精确地选择任务希望运行的时间以及如何使用 **at** 来查看安排运行的任务。
### at vs cron
对于那些使用 **cron** 在 Linux 系统上安排任务的人来说,**at** 命令类似于 **cron**,因为你可以在选定的时间调度任务,但是 **cron** 用于定期运行的作业 - 甚至是每年仅一次。大多数 **cron** 作业的频率都设置为每天、每周或每月运行一次,不过你可以控制运行的频率和时间。
另一方面,**at** 命令用于仅运行一次的任务。想在午夜重启系统?没问题,假设你有适当的权限,**at** 可以为你完成此操作。如果你希望系统在每个星期六凌晨 2 点重启,那么改用 **cron**
### 使用 at
**at** 命令很容易使用,只需记住几件事。一个简单使用 **at** 的例子类似于这样:
```
$ at 5:00PM
at> date >> thisfile
at> <EOT>
```
在输入 "at" 和应该运行命令的时间,**at** 会提示你在设定时间会运行该命令(此例中是 **`date`** 命令)。输入 **^D**(Ctrl + d) 来完成请求。
假设我们在下午 5 点之前设置这个 **at** 命令,那么日期和时间将在当天下午 5 点添加到名为 "thisfile" 文件的末尾。否则,该命令将在第二天下午 5 点运行。
**at** 命令进行交互时,可以输入多个命令。如果你要同时运行多个命令,只需输入多个命令行即可:
[][1]
```
$ at 6:22
warning: commands will be executed using /bin/sh
at> echo first >> thisfile
at> echo second >> thisfile
at> <EOT>
```
在上面的命令中,我们使用了一个普通的用户账户,将一些简单的文本添加到该用户主目录的文件中。如果在上午 6:22 之后运行这些命令,那么命令会在第二天运行,因为 6:22 表示上午 6:22。如果你想在下午 6:22 运行,使用 6:22 PM 或者 18:22"6:22 PM" 也可以。
你也可以通过使用 **at** 来安排命令在指定的日期或时间运行,例如 "10:00AM April 15 2021" 或 "noon + 5 days"(从今天起 5 天内的中午运行),以下是一些例子:
```
at 6PM tomorrow
at noon April 15 2021
at noon + 5 days
at 9:15 + 1000 days
```
在指定要运行的命令并按下 **^D** 后,你会注意到 **at** 命令为每个请求分配了一个作业编号,这个数字将显示在 **at** 命令的作业队列中。
```
$ at noon + 1000 days
warning: commands will be executed using /bin/sh
at> date >> thisfile
at> <EOT>
job 36 at Tue Dec 27 12:00:00 2022 <== job # is 36
```
### 检查队列
你可以使用 **atq**(at queue) 命令来查看 **at** 作业队列:
```
$ atq
32 Thu Apr 2 03:06:00 2020 a shs
35 Mon Apr 6 12:00:00 2020 a shs
36 Tue Dec 27 12:00:00 2022 a shs
34 Thu Apr 2 18:00:00 2020 a shs
```
如果你需要取消队列中的一个作业,使用 **atrm**(at remote) 命令和作业编号:
```
$ atrm 32
$ atq
35 Mon Apr 6 12:00:00 2020 a shs
36 Tue Dec 27 12:00:00 2022 a shs
34 Thu Apr 2 18:00:00 2020 a shs
```
你可以使用 **at -c** 命令来查看安排任务的详细信息,其它详细信息(活动的搜索路径等)也可以,但是输出的最后一行将显示计划运行的命令。
```
$ at -c 36 | tail -6
cd /home/shs || {
echo 'Execution directory inaccessible' >&2
exit 1
}
date >> thisfile
```
注意,命令首先会测试是否可以通过 **cd** 命令进入用户目录。如果不可以,作业将退出并显示错误。如果可以,则运行在 **at** 中指定的命令。它将命令视为 “进入 /home/shs 或退出并显示错误”。
### 以 root 身份运行作业
要以 root 身份运行 **at** 作业,只需将 **sudo** 与你的 **at** 命令一起使用,如下所示:
```
$ sudo at 8PM
[sudo] password for shs:
warning: commands will be executed using /bin/sh
at> reboot now
at> <EOT>
job 37 at Wed Apr 1 16:00:00 2020
```
注意root 的任务以 **root** 作为执行者显示在队列中。
```
35 Mon Apr 6 12:00:00 2020 a shs
36 Tue Dec 27 12:00:00 2022 a shs
37 Wed Apr 1 20:00:00 2020 a root <==
```
### 运行脚本
你还可以使用 **at** 命令来运行脚本,这里有一个例子:
```
$ at 4:30PM
warning: commands will be executed using /bin/sh
at> bin/tryme
at> <EOT>
```
### 禁止使用 at 命令
**/etc/at.deny** 文件提供了一种禁止用户使用 **at** 命令的方法。默认情况下,它可能会包含一个不允许的账户列表,例如 **ftp****nobody**。可以使用 **/etc/at.allow** 文件执行相反的操作,但是通常只配置 **at.deny** 文件。
**总结**
当你要安排一项一次性任务时,无论你是希望在今天下午或几年后运行,**at** 命令都是通用且易于使用的。
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3535808/scheduling-tasks-on-linux-using-the-at-command.html
作者:[Sandra Henry-Stocker][a]
选题:[lujun9972][b]
译者:[MjSeven](https://github.com/MjSeven)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/
[b]: https://github.com/lujun9972
[0]: https://images.idgesg.net/images/article/2019/08/gettyimages-140389307-100808283-large.jpg
[1]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy)
[2]: https://www.facebook.com/NetworkWorld/
[3]: https://www.linkedin.com/company/network-world

View File

@ -0,0 +1,115 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Bitwarden: A Free & Open Source Password Manager)
[#]: via: (https://itsfoss.com/bitwarden/)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
Bitwarden一个免费的开源密码管理器
======
_ **简述:** Bitwarden 是流行的开源密码管理器。 在这里,我们来看看它提供了什么。
![][1]
[Bitwarden][2] 是一个免费的开源密码管理器。 你可能还记得,我们之前将它列为 [Linux 中的最佳密码管理器][3]之一。
就个人而言,几个月来我一直在多个设备上使用 Bitwarden 作为我的密码管理器。 因此,在本文中,我将说明它提供的功能以及我的使用经验。
**注意:** _ 如果你对服务的安全性有疑问,请查看其官方安全性[常见问题页面][4]。
### Bitwarden 密码管理器的特性
![][5]
[Bitwarden][2] 是许多其他方便的密码管理器的不错替代品。
以下是它的特性:
* 提供免费和付费选择
* 适用于团队(企业)和个人
* 开源
* 支持自托管
* 能够作为身份验证器应用(像 Google 身份验证器)
* 跨平台支持安卓、iOS、Linux、Windows 和 macOS
* 提供浏览器扩展Firefox,、Chrome、Opera、Edge、Safari
* 提供命令行工具
* 提供网页保管库
* 能够导入/导出密码
* [密码生成器][6]
* 自动填充密码
* 两步身份验证
从技术上讲Bitwarden 使用完全免费。然而,它也提供了一些付费计划(个人付费和商务付费计划)。
通过高级计划,你可以与更多用户共享密码、获取 API 访问权限(业务使用)以及更多此类高级功能。
以下是定价(在编写本文时):
![][7]
对于大多数个人来说考虑到支持开源项目10 美元/年的高级个人计划不应成为问题。当然,你也可以选择没有限制地免费使用。
### 在 Linux 上安装 Bitwarden
![][8]
很容易将 Bitwarden 安装到你的 Linux 系统上,因为它提供了一个 .**AppImage** 文件。如果你还不知道[如何使用 AppImage][9] 文件,你可以参考我们的指南。
如果你不喜欢使用 AppImage 你可以选择 [snap 包][10]或在其[官方下载页面][11]上下载 **.deb** 或者 **.rpm** 文件。你还可以查看其 [GitHub 页面][12]了解更多信息。
[Download Bitwarden][2]
如果你对使用桌面应用不感兴趣,也可以使用浏览器扩展。
### 我使用 Bitwarden 的体验
在 Bitwarden 之前,我使用 [LastPass][13] 作为密码管理器。尽管这不是一个糟糕的选择,但它不是开源软件。
所以,在我发现 Bitwarden 后就决定使用它。
首先,我从 LastPass 导出我的数据,并导入到 Bitwarden 没有困难。在此过程中我没有丢失任何数据。
除了桌面应用,我一直在使用 Bitwarden 的火狐插件,和 Android 应用。使用六个多月后,我没有遇到任何问题。所以,如果你愿意试试看,我一定会给它好评!
### 总结
我想说对于那些想要一个可以到处工作并且跨设备轻松同步的密码管理器的用户而言Bitwarden 是一个完整的解决方案。
你可以免费入门,但如果可以,请购买 **10 美元/年**的高级计划来支持这个开源项目。
如果你正在寻找更多选择,你也可以查看我们的 [Linux 中 5 个最佳密码管理器][5]。
你试过 Bitwarden 了吗?如果没有,请试试看!此外,你最喜欢的密码管理器是什么?让我在下面的评论中知道!
--------------------------------------------------------------------------------
via: https://itsfoss.com/bitwarden/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/bitwarden-screenshot.jpg?ssl=1
[2]: https://bitwarden.com/
[3]: https://itsfoss.com/password-managers-linux/
[4]: https://help.bitwarden.com/security/
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/bitwarden-dark-mode.jpg?ssl=1
[6]: https://itsfoss.com/password-generators-linux/
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/bitwarden-pricing.jpg?ssl=1
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/bitwarden-settings.png?ssl=1
[9]: https://itsfoss.com/use-appimage-linux/
[10]: https://snapcraft.io/bitwarden
[11]: https://bitwarden.com/#download
[12]: https://github.com/bitwarden
[13]: https://www.lastpass.com/

View File

@ -0,0 +1,204 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Create web tutorials with Reveal.js and Git)
[#]: via: (https://opensource.com/article/20/4/create-web-tutorial-git)
[#]: author: (Eric D. Schabell https://opensource.com/users/eschabell)
使用 Reveal.js 和 Git 创建网页教程
======
> 通过这个简单的工作流程创建的研讨会幻灯片,可以在任何浏览器、设备和平台上一致地查看。
![Person reading a book and digital copy][1]
无论你是学习者还是教师,你可能都会认识到采用幻灯片放映来传播知识的在线<ruby>研讨会<rt>workshop</rt></ruby>的价值。如果你曾经偶然看到过这样一个逐页、逐章设置的井井有条的教程,你可能会想知道创建这样的一个网站有多难。
好吧,让我在这里向你展示,使用全自动化的流程来生成这样的教程是多么容易。
### 介绍
当我开始将学习内容放到网上置时,体验并不是很好。我想要的是一种可重复的、一致的、易于维护的东西,因为我的内容会随着我的教学技术而进步。
我尝试了许多交付模型,从 [Asciidoctor][2] 这样的低级代码生成器到在单个 PDF 文件中放置教程。全都不能让我满意。当我举办现场的在座研讨会时,我喜欢使用幻灯片放映,因此我想知道我是否可以为自己的在线的,自定进度的研讨会体验做同样的事情。
经过一番挖掘我为创建无痛的研讨会网站打下了基础。当时我已经在使用一个演示文稿生成框架这对我来说是很有帮助的因为这个框架可以产生对网站友好的格式HTML
### 设置
这里是这个项目所需要的基本组件。
* 研讨会的想法(这是你的问题,我帮不了你)
* 用于研讨会幻灯片的 Reveal.js
* GitLab 项目仓库
* 你最喜欢的 HTML 代码编辑器
* Web 浏览器
* 在你的机器上安装好 Git
如果这个列表看起来令人望而生畏,那么有一个快速入门的方法,不需要把所有的东西一个个都拉到一起。你可以用我的模板项目来给你提供幻灯片和项目设置的入门教程。
本文假设你熟悉 Git 和托管在 Git 平台(如 GitLab上的项目。如果你需要指导或教程请查看我们的[Git 入门系列][3]。
首先,将模板项目克隆到本地机器上。
```
$ git clone https://gitlab.com/eschabell/beginners-guide-automated-workshops.git
```
为此设置一个新的 GitLab 项目,导入模板项目作为初始导入。
研讨会网站有一些重要的文件。在**根目录**下,你会发现一个名为 `.gitlab-ci.yml` 的文件,当你向主分支提交修改时(即合并拉取请求到 `master` 分支),这个文件会作为触发器。它可以触发将 `slides` 目录的全部内容复制到 GitLab 项目的 `website` 文件夹中。
我把它托管在我的 GitLab 账户中,名为 `beginners-guide-automated-workshops`。当它部署完毕后,你可以在浏览器中通过导航到下列地址查看 `slides` 目录的内容:
```
https://eschabell.gitlab.io/beginners-guide-automated-workshops
```
对于你的用户帐户和项目URL 如下所示:
```
https://[YOUR_USERNAME].gitlab.io/[YOUR_PROJECT_NAME]
```
这些是你开始创建网站内容所需要的基本素材。当你推送修改后,它们会自动生成更新过的研讨会网站。请注意,默认模板包含了几个示例幻灯片,这将是你完成对存储库的完整签入后的第一个研讨会网站。
研讨会模板生成的结果是一个 [receive.js][4] 幻灯片,可以在任何浏览器中运行,并可以自动调整大小,几乎可以让任何人在任何地方、任何设备上观看。
这样创建一个方便、易访问的研讨会怎么样?
### 它是如何工作的
有了这些背景信息,你就可以开始探索研讨会的这些素材,并开始把你的内容放在一起了。你需要的一切都可以在项目的 `slides` 目录中找到;这里是使用 reveal.js 在浏览器中创建研讨会幻灯片的地方。
你将用来制作研讨会的文件和目录是:
* `default.css`文件
* `images` 目录
* `index.html`文件
在你喜欢的 HTML/CSS 编辑器中打开每一个文件,然后进行下面描述的修改。你用哪个编辑器并不重要,我更喜欢 [RubyMine IDE][5],因为它能在本地浏览器中提供页面预览。这对我在将内容推送到研讨会网站之前测试内容时很有帮助。
#### default.css 文件
文件 `css/theme/default.css` 是一个基础文件,你将在这里为你的研讨会幻灯片设置重要的全局设置。其中值得注意的两个主要的项目是所有幻灯片的默认字体和背景图片。
`default.css` 中,看一下标有 `GLOBAL STYLES` 的部分。当前的默认字体在这一行中列出了。
```
font-family: "Red Hat Display", "Overpass", san-serif;
```
如果你使用的是非标准字体类型,则必须在以下行中将其导入(与 Overpass 字体类型相同):
```
@import url('SOME_URL');
```
`background` 是你创建的每张幻灯片的默认图像。它存储在 `images` 目录下(见下面),并在下面这一行中设置(重点是图像路径)。
```
background: url("…/…/images/backgrounds/basic.png")
```
要设置一个默认背景,只需将这一行指向你要使用的图片。
#### images 目录
顾名思义,`images` 目录是用来存储你想在研讨会幻灯片上使用的图片。例如,我通常会把展示研讨会主题进展的截图放在我的个人幻灯片上。
现在,你只需要知道你需要将背景图片存储在一个子目录(`backgrounds`)中,并将你计划在幻灯片中使用的图片存储在 `images` 目录中。
#### index.html 文件
现在你已经把这两个文件整理好了,剩下的时间你就可以在 HTML 文件中创建幻灯片了,从 `index.html` 开始。为了让你的研讨会网站开始成形,请注意这个文件中的以下三个部分。
* `head `部分,在这里你可以设置标题、作者和描述。
* `body` 部分,你可以在这里找到要设计的单个幻灯片。
* 你可以在每个 `section` 中定义各个幻灯片的内容。
`head` 部分开始,因为它在顶部。模板项目有三个占位符行供你更新。
```
<title>INSERT-YOUR-TITLE-HERE</title>
<meta name="description" content="YOUR DESCIPTION HERE.">
<meta name="author" content="YOUR NAME">
```
`title` 标签包含文件打开时显示在浏览器选项卡中的文字。请将其改为与你的研讨会的标题相关的内容(或研讨会的某个部分),但记得要简短,因为标签页的标题空间有限。`description` 元标签包含了对你的工作坊的简短描述,而 `author` 元标签是你应该把你的名字(如果你是为别人写的,则是工作坊创建者的名字)。
现在继续到 `body` 部分。你会注意到它被分成了许多 `section` 标签。`body` 的开头包含了一个注释,说明你正在为每个标有 `section` 的打开和关闭的标签创建幻灯片。
```
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
```
接下来,创建你的各个幻灯片,每张幻灯片都用 `section` 标签封装起来。这个模板包括了一些幻灯片来帮助你开始制作。例如,这里是第一张幻灯片。
```
<section>
<div style="width: 1056px; height: 300px">
<h1>Beginners guide</h1>
<h2>to automated workshops</h2>
</div>
<div style="width: 1056px; height: 200px; text-align: left">
Brought to you by,<br/>
YOUR-NAME<br/>
</div>
<aside class="notes">Here are notes: Welcome to the workshop!</aside>
</section>
```
这张幻灯片有两个区域,用 `div` 标签划分。用空格隔开了标题和作者。
如果你有一定的 HTML 使用知识,可以尝试各种东西来开发你的研讨会。你使用浏览器预览结果的时候真的很方便。有些 IDE 提供了本地查看修改,但你也可以打开 `index.html` 文件查看你的修改,然后再推送到资源库中。
一旦你对你的研讨会感到满意,推送你的修改,然后等待它们通过持续集成管道。它们将像模板项目一样被托管在 <https://eschabell.gitlab.io/beginners-guide-automated-workshops>
### 了解更多
要了解更多关于这个工作流程可以做什么,请查看下面的示例研讨会和托管了研讨会集合的网站。所有这些都是基于本文中描述的工作流程。
研讨会的例子:
* [Red Hat Process Automation Manage workshop][6]
* [JBoss Travel Agency BPM Suite online workshop][7]
研讨会集合:
* [Rule the world: Practical decisions & process automation development workshops][8]
* [Application development in the cloud workshop][9]
* [Portfolio architecture: Workshops for creating impactful architectural diagrams][10]
我希望这本新手指南和模板研讨会项目能让你看到,在开发和维护工作室网站的过程中,可以轻松、无痛地完成。我也希望这个工作流程能让你的研讨会受众几乎在任何设备上都能完全访问你的内容,这样他们就能从你分享的知识中学习到你的知识。
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/create-web-tutorial-git
作者:[Eric D. Schabell][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/eschabell
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/read_book_guide_tutorial_teacher_student_apaper.png?itok=_GOufk6N (Person reading a book and digital copy)
[2]: https://asciidoctor.org/
[3]: https://opensource.com/resources/what-is-git
[4]: https://revealjs.com/#/
[5]: https://www.jetbrains.com/ruby/
[6]: https://gitlab.com/bpmworkshop/rhpam-devops-workshop
[7]: https://gitlab.com/bpmworkshop/presentation-bpmworkshop-travel-agency
[8]: https://bpmworkshop.gitlab.io/
[9]: https://appdevcloudworkshop.gitlab.io/
[10]: https://redhatdemocentral.gitlab.io/portfolio-architecture-workshops