diff --git a/published/20180522 Advanced use of the less text file viewer in Linux.md b/published/20180522 Advanced use of the less text file viewer in Linux.md new file mode 100644 index 0000000000..399f0d05b8 --- /dev/null +++ b/published/20180522 Advanced use of the less text file viewer in Linux.md @@ -0,0 +1,109 @@ +你所不知道的用 less 查看文件的高级用法 +====== + +> 使用 less 文件查看器的一些技巧。 + +![](https://img.linux.net.cn/data/attachment/album/202003/16/152826assmtybsohopo4b7.png) + +最近,我正在拜读 Scott Nesbitt 的文章《[在 Linux 命令行中使用 less 来查看文本文件][1]》,并受到了一些启发,所以我想分享一些使用 `less` 命令的技巧。 + +### LESS 环境变量 + +如果你定义了环境变量 `LESS`(例如在 `.bashrc` 中),那么 `less` 会将其视为一个选项列表,就像在命令行中传递给它一样。 + +我这样定义: + +``` +LESS='-C -M -I -j 10 -# 4' +``` + +它的意思是: + +* `-C` – 通过不从底部滚动来加快全屏打印速度。 +* `-M` – 在最后一行(状态行)显示更多信息。你可以使用 `-PM` 来自定义显示的信息,但我通常只用 `-M`。 +* `-I` – 忽略搜索中的大小写。 +* `-j 10` – 在终端的第 10 行而不是第一行显示搜索结果。这样,每次按 `n` 或(`N`) 跳到下一个(或上一个)匹配项时,就会有 10 条上下文。 +* `-# 4` – 当按下向右或向左的箭头时,会向右或向左跳四个字符。默认情况时跳转半个屏幕,我觉得太多了。一般来说,`less` 似乎(至少部分)是按最初开发它时的环境优化的,那时使用慢速调制解调器和低带宽的互联网连接,所以跳过半个屏幕是有意义的。 + +### PAGER 环境变量 + +许多程序使用在 `PAGER` 环境变量中的命令来显示信息。因此,你可以在 `.bashrc` 中设置 `PAGER=less`,然后让程序运行 `less`。查看手册页(`man 7 environ`)中是否有其它此类变量。 + +### -S + +`-S` 告诉 `less` 将长行切断而不是将它们换行。除非我在(或我要)查看文件,否则我很少需要这样做。幸运的是,你可以在 `less` 中输入所有命令行选项,就像它们是键盘命令一样。因此,如果我想在文件已经打开的情况下隔断长行,我可以简单地输入 `-S`。(LCTT 译注:注意大写 `S` ,并按回车) + +这是我经常使用的一个例子: + +``` +su - postgres +export PAGER=less  # 因为我不用在所有的机器上编辑 postgres 的 .bashrc +psql +``` + +有时当我查看一个 `SELECT` 命令的输出非常宽时,我会输入 `-S` 以便将其格式化的漂亮一些。如果当我按下右箭头想查看更多内容时它跳得太远(因为我没有设置 `-#`),则可以输入 `-#8`,那么每次按下右箭头都会向右移动八个字符。 + +有时在多次输入 `-S` 之后,我会退出 psql 并设置环境变量后再次运行它: + +``` +export LESS=-S +``` + +### F + +命令 `F` 可以使 `less` 像 `tail -f` 一样工作,等待更多的数据被添加到文件后再显示它们。与 `tail -f` 相比,它的一个优点是,高亮显示搜索匹配仍然有效。因此,你可以输入 `less /var/log/logfile`,搜索某些内容时,它将高亮显示所有出现的内容(除非你使用了 `-g`),然后按下 `F` 键,当更多数据写入到日志时,`less` 将显示它并高亮新的匹配项。 + +按下 `F` 后,可以按 `Ctrl+C` 来停止其查找新数据(这不会干掉它),这样你可以返回文件查看旧内容,搜索其它内容等,然后再次按 `F` 键来查看更多新数据。 + +### 搜索 + +搜索使用系统的正则表达式库,这通常意味着你可以使用扩展正则表达式。特别是,搜索 `one|two|three` 可以找到并高亮所有的 one、two 或 three。 + +我经常使用的另一种模式是 `.*someting.*`,特别是对于一些很长的日志行(例如,跨越多个终端宽度的行),它会高亮整行。这种模式使查看一行的起始和结束位置变得更加容易。我还会结合其它内容,例如 `.*one thing.*|.*another thing.*`,或者使用 `key: .*|.*marker.*` 来查看 `key` 的内容。例如,一个日志文件中包含一些字典/哈希的转储。它会高亮相关的标记行,这样我就看到上下文了,甚至,如果我知道这个值被引号引起来的话,就可以: + +``` +key: '[^']*'|.*marker.* +``` + +`less` 会保留你的搜索项的历史纪录,并将其保存到磁盘中以备将来调用。当你按下 `/` 或 `?` 时,可以使用向上或向下箭头浏览历史记录(以及进行基本的行编辑)。 + +在撰写本文时,我无意间看了下 `less` 手册页,发现了一个非常有用的功能:使用 `&!pattern` 跳过无关的行。例如,当我在 `/var/log/messages` 中寻找内容时,经常会一个个迭代使用以下命令: + +``` +cat /var/log/messages | egrep -v 'systemd: Started Session' | less +cat /var/log/messages | egrep -v 'systemd: Started Session|systemd: Starting Session' | less +cat /var/log/messages | egrep -v 'systemd: Started Session|systemd: Starting Session|User Slice' | less +cat /var/log/messages | egrep -v 'systemd: Started Session|systemd: Starting Session|User Slice|dbus' | less +cat /var/log/messages | egrep -v 'systemd: Started Session|systemd: Starting Session|User Slice|dbus|PackageKit Daemon' | less +``` + +但是现在我知道如何在 `less` 中做同样的事情。例如,我可以输入 `&!systemd: Started Session`,然后想要隐藏 `systemd: Starting Session`,所以我输入 `&!`,并使用向上箭头从历史记录中获得上一次搜索的结果。然后我接着输入 `|systemd: Starting Session` 并按下回车,继续以相同的方式添加更多条目,直到我过滤掉足够多的条目,看到更有趣的内容。 + +### = + +命令 `=` 显示有关文件和位置的更多信息,甚至比 `-M` 更多。如果文件非常大,计算 `=` 花费的时间太长,可以按下 `Ctrl+C`,它将停止尝试计算。 + +如果你正在查看的内容来自管道而不是文件,则 `=`(和 `-M`)不会显示未知内容,包括文件中的行数和字节数。要查看这些数据,如果你知道管道命令将很快结束,则可以使用 `G` 跳到最后,然后 `less` 将开始显示这些信息。 + +如果按下 `G` 并且写入管道的命令花费的时间比预期的长,你可以按下 `Ctrl+C`,该命令将被终止。即使你没有按 `G`,`Ctrl+C` 键也会杀死它。因此,如果你不想终止命令,请不要意外按下 `Ctrl+C`。出于这个原因,如果命令执行了某些操作(不仅是显示信息),通常更安全的做法是将其输出写入文件并在单独的终端中查看文件,而不是使用管道。 + +### 为什么你需要 less + +`less` 是一个非常强大的程序,与该领域中较新的竞争者(例如 `most` 和 `moar`)不同,你可能会在几乎所有的系统上找到它,就像 `vi` 一样。因此,即使你使用 GUI 查看器或编辑器,花一些时间浏览 `less` 手册页也是值得的,至少可以了解一下它的用处。这样,当你需要做一些已有的功能可能提供的工作时,就会知道如何要搜索手册页或互联网来找到所需的内容。 + +有关更多信息,访问 [less 主页][2]。该网站有一个不错的常见问题解答,其中包含更多提示和技巧。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/5/advanced-use-less-text-file-viewer + +作者:[Yedidyah Bar David][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/didib +[1]:http://opensource.com/article/18/4/using-less-view-text-files-command-line +[2]:http://www.greenwoodsoftware.com/less/ diff --git a/published/20190124 ffsend - Easily And Securely Share Files From Linux Command Line Using Firefox Send Client.md b/published/20190124 ffsend - Easily And Securely Share Files From Linux Command Line Using Firefox Send Client.md new file mode 100644 index 0000000000..0663005ce5 --- /dev/null +++ b/published/20190124 ffsend - Easily And Securely Share Files From Linux Command Line Using Firefox Send Client.md @@ -0,0 +1,283 @@ +[#]: collector: "lujun9972" +[#]: translator: "FSSlc" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-12051-1.html" +[#]: subject: "ffsend – Easily And Securely Share Files From Linux Command Line Using Firefox Send Client" +[#]: via: "https://www.2daygeek.com/ffsend-securely-share-files-folders-from-linux-command-line-using-firefox-send-client/" +[#]: author: "Vinoth Kumar https://www.2daygeek.com/author/vinoth/" + +ffsend:在命令行中通过 FireFox Send 分享文件 +====== + +![](https://img.linux.net.cn/data/attachment/album/202003/29/202308w7ormrouomij2dzq.jpg) + +Linux 用户偏爱使用 `scp` 或 `rsync` 来进行文件或目录的复制拷贝。不过在 Linux 上正出现了许多新的可选方式,因为 Linux 是开源的,所以任何人都可以为 Linux 开发一个安全软件。 + +在过去我们已经写了多篇有关安全分享这个话题的文章,它们分别是 [OnionShare][1]、[Magic Wormhole][2]、[Transfer.sh][3] 和 [Dcp – Dat Copy][4]。 + +今天我们甚至还将继续讨论这个话题,我们将介绍名为 `ffsend` 的工具。 + +### ffsend 是什么? + +[ffsend][5] 是 Firefox Send 服务的一个命令行客户端,允许用户通过命令行来传递和接收文件或目录。 + +它允许我们通过一个安全、私密、加密的链接,使用一个简单的命令来轻易安全地分享文件和目录。 + +通过 Firefox 的 Send 服务共享的文件最大大小为 2GB(LCTT 译注:现在官网上写的是最大 1GB,登录后最大 2.5GB)。其他人可以通过这个工具或者网页浏览器来下载这些分享的文件。 + +所有的文件都是在客户端加密的,并且秘钥将不会被共享到远程主机。另外,你还可以为上传的文件额外设置一个密码。 + +上传的文件在下载(默认被下载 1 次,最多可被下载 10 次)后或者 24 小时后,就会自动删除。这将确保你的文件不会一直保留在网络上。 + +该工具当前处于 alpha 阶段,使用时请自担风险。而且,当前只有有限的安装方式可用。 + +### ffsend 的特点: + + * 全功能且使用友好的命令行工具 + * 可以安全地上传和下载文件与目录 + * 总是在客户端加密 + * 可用额外的密码进行保护、密码生成和可配置下载次数限制 + * 内置的文件或目录的打包和解压 + * 可以轻松地管理你的历史分享记录 + * 能够使用你自己的 Send 主机 + * 审查或者删除共享文件 + * 精准的错误报告 + * 低内存消耗,用于加密或上传下载 + * 无需交互,可以集成在脚本中 + +### 如何在 LInux 中安装 ffsend 呢? + +当前除了 Debian 和 Arch Linux 系统,其他发行版还没有相应的安装包(LCTT 译注:这个信息已过时,最新内容请看[这里](https://github.com/timvisee/ffsend#install))。然而,我们可以轻易地根据我们自己的操作系统和架构下载到相应的预编译二进制文件。 + +运行下面的命令来为你的操作系统下载 `ffsend` 最新可用的版本(LCTT 译注:当前最新版本为 v0.2.58): + +``` +$ wget https://github.com/timvisee/ffsend/releases/download/v0.1.2/ffsend-v0.1.2-linux-x64.tar.gz +``` + +然后使用下面的命令来解压 tar 包: + +``` +$ tar -xvf ffsend-v0.1.2-linux-x64.tar.gz +``` + +接着运行下面的命令来查看你的 `PATH` 环境变量: + +``` +$ echo $PATH +/home/daygeek/.cargo/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl +``` + +正如我先前告知的那样,下面我们要做的就是将这个可执行文件放置到 `PATH` 环境变量中的某个目录中: + +``` +$ sudo mv ffsend /usr/local/sbin +``` + +直接运行 `ffsend` 可以获取其基本使用信息: + +``` +$ ffsend +ffsend 0.1.2 +Usage: ffsend [FLAGS] ... + +Easily and securely share files from the command line. +A fully featured Firefox Send client. + +Missing subcommand. Here are the most used: + ffsend upload ... + ffsend download ... + +To show all subcommands, features and other help: + ffsend help [SUBCOMMAND] +``` + +对于使用基于 Arch Linux 系统的用户可以简单地借助 [AUR 助手][6]来安装它,因为这个包已经在 AUR 软件仓库中了。 + +``` +$ yay -S ffsend +``` + +对于使用 Debian/Ubuntu 系统的用户,使用 [DPKG 命令][7]来安装 `ffsend`。 + +``` +$ wget https://github.com/timvisee/ffsend/releases/download/v0.1.2/ffsend_0.1.2_amd64.deb +$ sudo dpkg -i ffsend_0.1.2_amd64.deb +``` + +### 如何使用 ffsend + +这并不复杂,我们可以简单地通过下面的语法来发送文件。 + +**语法:** + +``` +$ ffsend upload [/Path/to/the/file/name] +``` + +在下面的例子中,我们将上传一个名为 `passwd-up1.sh` 的文件,一旦你上传了该文件,你将得到一个唯一的 URL。 + +``` +$ ffsend upload passwd-up1.sh --copy +Upload complete +Share link: https://send.firefox.com/download/a4062553f4/#yy2_VyPaUMG5HwXZzYRmpQ +``` + +![][9] + +在任何远端的系统上,只需要使用上面那个唯一的 URL 就可以下载上传的文件了。 + +**语法:** + +``` +$ ffsend download [Generated URL] +``` + +命令的输出如下: + +``` +$ ffsend download https://send.firefox.com/download/a4062553f4/#yy2_VyPaUMG5HwXZzYRmpQ +Download complete +``` + +![][10] + +使用下面的语法来对目录进行上传: + +``` +$ ffsend upload [/Path/to/the/Directory] --copy +``` + +在下面的例子中,我们将上传一个名为 `2g` 的目录: + +``` +$ ffsend upload /home/daygeek/2g --copy +You've selected a directory, only a single file may be uploaded. +Archive the directory into a single file? [Y/n]: y +Archiving... +Upload complete +Share link: https://send.firefox.com/download/90aa5cfe67/#hrwu6oXZRG2DNh8vOc3BGg +``` + +在任意的远端系统中,只需要利用上面生成的唯一 URL 就可以获取到刚才上传的目录了。 + +``` +$ ffsend download https://send.firefox.com/download/90aa5cfe67/#hrwu6oXZRG2DNh8vOc3BGg +You're downloading an archive, extract it into the selected directory? [Y/n]: y +Extracting... +Download complete +``` + +上面已经通过安全、私密和加密过的链接来发送了文件。然而,如果你想在你的掌控范围内再添加额外的安全措施,你可以为文件添加密码。 + +``` +$ ffsend upload file-copy-rsync.sh --copy --password +Password: +Upload complete +Share link: https://send.firefox.com/download/0742d24515/#P7gcNiwZJ87vF8cumU71zA +``` + +当你在远端系统中尝试下载该文件时,它将要求你输入密码: + +``` +$ ffsend download https://send.firefox.com/download/0742d24515/#P7gcNiwZJ87vF8cumU71zA +This file is protected with a password. +Password: +Download complete +``` + +另外,你还可以在上传过程中提供下载次数限制来限制文件被下载的次数。 + +``` +$ ffsend upload file-copy-scp.sh --copy --downloads 10 +Upload complete +Share link: https://send.firefox.com/download/23cb923c4e/#LVg6K0CIb7Y9KfJRNZDQGw +``` + +然后你可以在任意的远程系统中使用上面的唯一 URL 来下载该文件: + +``` +ffsend download https://send.firefox.com/download/23cb923c4e/#LVg6K0CIb7Y9KfJRNZDQGw +Download complete +``` + +假如你想看这个链接的更多细节,你可以使用下面的命令来查看它的信息,它将为你展示文件名称、文件大小、被下载次数以及过期时间。 + +**语法:** + +``` +$ ffsend info [Generated URL] + +$ ffsend info https://send.firefox.com/download/23cb923c4e/#LVg6K0CIb7Y9KfJRNZDQGw +ID: 23cb923c4e +Name: file-copy-scp.sh +Size: 115 B +MIME: application/x-sh +Downloads: 3 of 10 +Expiry: 23h58m (86280s) +``` + +此外,你还可以使用下面的命令来查看你的传输历史: + +``` +$ ffsend history +# LINK EXPIRY +1 https://send.firefox.com/download/23cb923c4e/#LVg6K0CIb7Y9KfJRNZDQGw 23h57m +2 https://send.firefox.com/download/0742d24515/#P7gcNiwZJ87vF8cumU71zA 23h55m +3 https://send.firefox.com/download/90aa5cfe67/#hrwu6oXZRG2DNh8vOc3BGg 23h52m +4 https://send.firefox.com/download/a4062553f4/#yy2_VyPaUMG5HwXZzYRmpQ 23h46m +5 https://send.firefox.com/download/74ff30e43e/#NYfDOUp_Ai-RKg5g0fCZXw 23h44m +6 https://send.firefox.com/download/69afaab1f9/#5z51_94jtxcUCJNNvf6RcA 23h43m +``` + +假如你不想再分享某个链接,你可以使用下面的语法来删除它: + +**语法:** + +``` +$ ffsend delete [Generated URL] + +$ ffsend delete https://send.firefox.com/download/69afaab1f9/#5z51_94jtxcUCJNNvf6RcA +File deleted +``` + +### 如何在浏览器中使用 Send + +另外,你还可以通过使用 firefox 浏览器打开 https://send.firefox.com/ 来完成相应的分享。 + +只需要拖拽该文件就可以上传它: + +![][11] + +一旦该文件被下载,它将展示 100% 的下载状态。 + +![][12] + +想查看其他的可能选项,请浏览它对应的 man 信息或者帮助页。 + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/ffsend-securely-share-files-folders-from-linux-command-line-using-firefox-send-client/ + +作者:[Vinoth Kumar][a] +选题:[lujun9972][b] +译者:[FSSlc](https://github.com/FSSlc) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/vinoth/ +[b]: https://github.com/lujun9972 +[1]: https://linux.cn/article-9177-1.html +[2]: https://www.2daygeek.com/wormhole-securely-share-files-from-linux-command-line/ +[3]: https://www.2daygeek.com/transfer-sh-easy-fast-way-share-files-over-internet-from-command-line/ +[4]: https://linux.cn/article-10516-1.html +[5]: https://github.com/timvisee/ffsend +[6]: https://www.2daygeek.com/category/aur-helper/ +[7]: https://www.2daygeek.com/dpkg-command-to-manage-packages-on-debian-ubuntu-linux-mint-systems/ +[8]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[9]: https://www.2daygeek.com/wp-content/uploads/2019/01/ffsend-easily-and-securely-share-files-from-linux-command-line-using-firefox-send-client-1.png +[10]: https://www.2daygeek.com/wp-content/uploads/2019/01/ffsend-easily-and-securely-share-files-from-linux-command-line-using-firefox-send-client-2.png +[11]: https://www.2daygeek.com/wp-content/uploads/2019/01/ffsend-easily-and-securely-share-files-from-linux-command-line-using-firefox-send-client-3.png +[12]: https://www.2daygeek.com/wp-content/uploads/2019/01/ffsend-easily-and-securely-share-files-from-linux-command-line-using-firefox-send-client-4.png diff --git a/published/20190422 9 ways to save the planet.md b/published/20190422 9 ways to save the planet.md new file mode 100644 index 0000000000..28a8cf2c55 --- /dev/null +++ b/published/20190422 9 ways to save the planet.md @@ -0,0 +1,98 @@ +[#]: collector: (lujun9972) +[#]: translator: (MFGJT) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11978-1.html) +[#]: subject: (9 ways to save the planet) +[#]: via: (https://opensource.com/article/19/4/save-planet) +[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike/users/alanfdoss/users/jmpearce) + +九种用开源拯救地球的方法 +====== + +> 这些主意都用到了有关的开源技巧。 + +![](https://img.linux.net.cn/data/attachment/album/202003/10/004034vbl5qb5lbij66zil.jpg) + +人们可以做些什么来拯救地球?这个问题可能会让人感到压抑,因为有时我们感觉个人可以做的贡献太少了。但是作为地球公民,我们从来不是一个人。所以,我向我们的作家社区征集了一些开源软件或硬件可以帮助改变现状的方法。以下是他们的回复。 + +### 九种利用开源的方法来拯救地球的方式 + +#### 1、在你的终端禁用闪烁的光标 + +这听起来可能有点傻,但是那个无关紧要的闪烁的光标可能导致[每小时两瓦特的额外电力开销][2]。如果要禁用光标闪烁,可以通过更改终端设置:编辑Edit > 偏好设置Preferences > 光标Cursor > 光标闪烁Cursor blinking > 禁用Disabled。 + +*由 Mars Toktonaliev 推荐* + +#### 2、减少有关动物产品和加工食物的消费 + +这样做的一种方法是在你的手机中添加这些开源的 App:Daily Dozen、OpenFoodFacts、OpenVegeMap 和 Food Restrictions。这些 App 可以帮助你准备一份健康的素食饮食计划,为你找到素食主义者和严格素食主义者可以就餐的餐厅,还可以帮助你把你的饮食需求告诉别人,即使他们不和你讲同一种语言。如果想要了解更多有关这些的 App 的信息,你可以阅读《[4 款“吃草”的开源应用][3]》。 + +*由 Joshua Allen Holm 推荐* + +#### 3、让旧电脑重焕新生 + +怎么做?当然是用 Linux。通过给那些自己得不到新电脑的人创造一台新电脑来传递爱心,同时也可以避免让这台电脑进到垃圾填埋场。可以在 [The Asian Penguins][4] 看看我们是怎么做的。 + +*由 Stu Keroff 推荐* + +#### 4、在你不使用设备时关闭它们 + +你可以使用带有主插座和控制插座的“智能插座板”。把你的电脑连接到主插座上,这样的话当你打开电脑时所有你连接到控制插座上的设备如显示器,打印机等也都会打开。一个更简单的、技术含量更低的方法是使用一个带有计时器的插座板。我在家里就是用的这个。你可以用计时器上的开关设定一个定时开关电源的时间表。这样可以在没有人在家时自动关闭网络打印机。或者以我的用了六年的笔记本电脑为例,我通过一个交替使用外接电源(插座打开)和使用电脑电池(插座关闭)的电源计划延长了电脑电池的寿命。 + +*由 Jim Hall 推荐* + +#### 5、减少供暖通风系统(HVAC)的使用 + +在夏天,透过窗户的阳光可以为室内提供很多热量。使用 Home Assistant 可以[基于一天中的时间的][6],甚至是基于太阳高度角[自动调节][5]窗帘和遮阳棚。 + +*由 Michael Hrivnak 推荐* + +#### 6、出门就把恒温器关闭或调低 + +如果你的家用恒温器具有“离开”功能,你很容易忘记在出门时启用它。借助自动化,任何连接到网络的恒温器都可以在你不在家时自动节省能量。[Stataway][7] 就是一个这样项目。它通过调用你的手机的 GPS 坐标来决定是将你的恒温器设置为“在家”还是“离开”。 + +*由 Michael Hrivnak 推荐* + +#### 7、为未来储蓄算力 + +我有一个主意:创建一个可以读取可选的能量阵列(如风能或太阳能)的输出的脚本。这个脚本应该将计算集群中的服务器从睡眠模式更改为激活模式,直到过量的电能(超出可以储存的部分)被用尽。然后在高产能时段使用这些过量的电能来进行需要大量计算的项目,比如渲染。这个过程本质应该是免费的,因为使用的能量无法被储存起来挪作它用。我相信现有的监控、能量管理和服务器阵列工具一定可以实现这个功能。那么剩下的只是一些整合上的问题,就可以让整个系统工作起来。 + +*由 Terry Hancock 推荐* + +#### 8、关掉你的灯 + +根据[人工夜空亮度图集][8]World Atlas of Artificial Night Sky Brightness的说法,光污染影响了全世界超过 80% 的人口。这一结论在 2016 年(遵循 CC-NC 4.0 协议)发表在公开访问的期刊《科学进展Science Advances》上。关闭外部照明是一个可以使野生生物、人类健康受益并让我们享受夜晚的天空的快速途径,而且可以减少能量消耗。访问 [darksky.org][9] 来查看更多减少外部照明影响的方法。 + +*由 Michael Hrivnak 推荐* + +#### 9、减少你的 CPU 数量 + +就我个人而言,我记得我以前有很多在地下室运行的电脑作为我的 IT 游乐场/实验室。我现在对于能源消耗更加注意了,所以确实大大地减少了我的 CPU 数量。我现在更喜欢利用虚拟机、区域和容器等技术。另外,我很高兴有小型电脑和 SoC 电脑这种东西,比如树莓派,因为我可以用一台这样的电脑做很多事情,比如运行一个 DNS 或者 Web 服务器,而无需使整个屋子变热并积累昂贵的电费账单。 + +P.S. 这些电脑都运行于 Linux、FreeBSD,或者 Raspbian 系统! + +*由 Alan Formy-Duvall 推荐* + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/save-planet + +作者:[Jen Wike Huger][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://opensource.com/users/jen-wike/users/alanfdoss/users/jmpearce +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/pixelated-world.png?itok=fHjM6m53 +[2]: https://www.redhat.com/archives/fedora-devel-list/2009-January/msg02406.html +[3]: https://linux.cn/article-10926-1.html +[4]: https://opensource.com/article/19/2/asian-penguins-close-digital-divide +[5]: https://www.home-assistant.io/docs/automation/trigger/#sun-trigger +[6]: https://www.home-assistant.io/components/cover/ +[7]: https://github.com/mhrivnak/stataway +[8]: http://advances.sciencemag.org/content/2/6/e1600377 +[9]: http://darksky.org/ diff --git a/published/20190527 How To Enable Or Disable SSH Access For A Particular User Or Group In Linux.md b/published/20190527 How To Enable Or Disable SSH Access For A Particular User Or Group In Linux.md new file mode 100644 index 0000000000..0c0a600eeb --- /dev/null +++ b/published/20190527 How To Enable Or Disable SSH Access For A Particular User Or Group In Linux.md @@ -0,0 +1,288 @@ +[#]: collector: "lujun9972" +[#]: translator: "way-ww" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-12027-1.html" +[#]: subject: "How To Enable Or Disable SSH Access For A Particular User Or Group In Linux?" +[#]: via: "https://www.2daygeek.com/allow-deny-enable-disable-ssh-access-user-group-in-linux/" +[#]: author: "2daygeek http://www.2daygeek.com/author/2daygeek/" + +如何在 Linux 上为特定的用户或用户组启用或禁用 SSH? +====== + +![](https://img.linux.net.cn/data/attachment/album/202003/23/105915r1azn34i82sp48ca.jpg) + +由于你的公司标准规定,你可能只能允许部分人访问 Linux 系统。或者你可能只能够允许几个用户组中的用户访问 Linux 系统。那么如何实现这样的要求呢?最好的方法是什么呢?如何使用一个简单的方法去实现呢? + +是的,我们会有很多种方法去实现它。但是我们应该使用简单轻松的方法。为了简单轻松的完成目的,我们可以通过对 `/etc/ssh/sshd_config` 文件做必要的修改来实现。在这篇文章中我们将会向你展示实现要求的详细步骤。 + +为什么我们要这样做呢?是出于安全的原因。你可以访问[这个链接][1]来获取更多关于 openSSH 的使用方法。 + +### 什么是 SSH ? + +openssh 全称为 OpenBSD Secure Shell。Secure Shell(ssh)是一个自由开源的网络工具,它能让我们在一个不安全的网络中通过使用 Secure Shell(SSH)协议来安全访问远程主机。 + +它采用了客户端-服务器架构(C/S),拥有用户身份认证、加密、在计算机和隧道之间传输文件等功能。 + +我们也可以用 `telnet` 或 `rcp` 等传统工具来完成,但是这些工具都不安全,因为它们在执行任何动作时都会使用明文来传输密码。 + +### 如何在 Linux 中允许用户使用 SSH? + +通过以下内容,我们可以为指定的用户或用户列表启用 `ssh` 访问。如果你想要允许多个用户,那么你可以在添加用户时在同一行中用空格来隔开他们。 + +为了达到目的只需要将下面的值追加到 `/etc/ssh/sshd_config` 文件中去。 在这个例子中, 我们将会允许用户 `user3` 使用 ssh。 + +``` +# echo "AllowUsers user3" >> /etc/ssh/sshd_config +``` + +你可以运行下列命令再次检查是否添加成功。 + +``` +# cat /etc/ssh/sshd_config | grep -i allowusers +AllowUsers user3 +``` + +这样就行了, 现在只需要重启 `ssh` 服务和见证奇迹了。(下面这两条命令效果相同, 请根据你的服务管理方式选择一条执行即可) + +``` +# systemctl restart sshd +或 +# service restart sshd +``` + +接下来很简单,只需打开一个新的终端或者会话尝试用不同的用户身份访问 Linux 系统。是的,这里 `user2` 用户是不被允许使用 SSH 登录的并且会得到如下所示的错误信息。 + +``` +# ssh user2@192.168.1.4 +user2@192.168.1.4's password: +Permission denied, please try again. +``` + +输出: + +``` +Mar 29 02:00:35 CentOS7 sshd[4900]: User user2 from 192.168.1.6 not allowed because not listed in AllowUsers +Mar 29 02:00:35 CentOS7 sshd[4900]: input_userauth_request: invalid user user2 [preauth] +Mar 29 02:00:40 CentOS7 unix_chkpwd[4902]: password check failed for user (user2) +Mar 29 02:00:40 CentOS7 sshd[4900]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.1.6 user=user2 +Mar 29 02:00:43 CentOS7 sshd[4900]: Failed password for invalid user user2 from 192.168.1.6 port 42568 ssh2 +``` + +与此同时用户 `user3` 被允许登入系统因为他在被允许的用户列表中。 + +``` +# ssh user3@192.168.1.4 +user3@192.168.1.4's password: +[user3@CentOS7 ~]$ +``` + +输出: + +``` +Mar 29 02:01:13 CentOS7 sshd[4939]: Accepted password for user3 from 192.168.1.6 port 42590 ssh2 +Mar 29 02:01:13 CentOS7 sshd[4939]: pam_unix(sshd:session): session opened for user user3 by (uid=0) +``` + +### 如何在 Linux 中阻止用户使用 SSH ? + +通过以下内容,我们可以配置指定的用户或用户列表禁用 `ssh`。如果你想要禁用多个用户,那么你可以在添加用户时在同一行中用空格来隔开他们。 + +为了达到目的只需要将以下值追加到 `/etc/ssh/sshd_config` 文件中去。 在这个例子中, 我们将禁用用户 `user1` 使用 `ssh`。 + +``` +# echo "DenyUsers user1" >> /etc/ssh/sshd_config +``` + +你可以运行下列命令再次检查是否添加成功。 + +``` +# cat /etc/ssh/sshd_config | grep -i denyusers +DenyUsers user1 +``` + +这样就行了, 现在只需要重启 `ssh` 服务和见证奇迹了。 + +``` +# systemctl restart sshd +活 +# service restart sshd +``` + +接下来很简单,只需打开一个新的终端或者会话,尝试使用被禁用的用户身份被访问 Linux 系统。是的,这里 `user1` 用户在禁用名单中。所以,当你尝试登录时,你将会得到如下所示的错误信息。 + +``` +# ssh user1@192.168.1.4 +user1@192.168.1.4's password: +Permission denied, please try again. +``` + +输出: + +``` +Mar 29 01:53:42 CentOS7 sshd[4753]: User user1 from 192.168.1.6 not allowed because listed in DenyUsers +Mar 29 01:53:42 CentOS7 sshd[4753]: input_userauth_request: invalid user user1 [preauth] +Mar 29 01:53:46 CentOS7 unix_chkpwd[4755]: password check failed for user (user1) +Mar 29 01:53:46 CentOS7 sshd[4753]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.1.6 user=user1 +Mar 29 01:53:48 CentOS7 sshd[4753]: Failed password for invalid user user1 from 192.168.1.6 port 42522 ssh2 +``` + +### 如何在 Linux 中允许用户组使用 SSH? + +通过以下内容,我们可以允许一个指定的组或多个组使用 `ssh`。 + +如果你想要允许多个组使用 `ssh` 那么你在添加用户组时需要在同一行中使用空格来隔开他们。 + +为了达到目的只需将以下值追加到 `/etc/ssh/sshd_config` 文件中去。在这个例子中,我们将允许 `2g-admin` 组使用 ssh。 + +``` +# echo "AllowGroups 2g-admin" >> /etc/ssh/sshd_config +``` + +你可以运行下列命令再次检查是否添加成功。 + +``` +# cat /etc/ssh/sshd_config | grep -i allowgroups +AllowGroups 2g-admin +``` + +运行下列命令查看属于该用户组的用户有哪些。 + +``` +# getent group 2g-admin +2g-admin:x:1005:user1,user2,user3 +``` + +这样就行了, 现在只需要重启 `ssh` 服务和见证奇迹了。 + +``` +# systemctl restart sshd +或 +# service restart sshd +``` + +是的, `user1` 被允许登入系统因为用户 `user1` 属于 `2g-admin` 组。 + +``` +# ssh user1@192.168.1.4 +user1@192.168.1.4's password: +[user1@CentOS7 ~]$ +``` + +输出: + +``` +Mar 29 02:10:21 CentOS7 sshd[5165]: Accepted password for user1 from 192.168.1.6 port 42640 ssh2 +Mar 29 02:10:22 CentOS7 sshd[5165]: pam_unix(sshd:session): session opened for user user1 by (uid=0) +``` + +是的, `user2` 被允许登入系统因为用户 `user2` 同样属于 `2g-admin` 组。 + +``` +# ssh user2@192.168.1.4 +user2@192.168.1.4's password: +[user2@CentOS7 ~]$ +``` + +输出: + +``` +Mar 29 02:10:38 CentOS7 sshd[5225]: Accepted password for user2 from 192.168.1.6 port 42642 ssh2 +Mar 29 02:10:38 CentOS7 sshd[5225]: pam_unix(sshd:session): session opened for user user2 by (uid=0) +``` + +当你尝试使用其他不在被允许的组中的用户去登入系统时, 你将会得到如下所示的错误信息。 + +``` +# ssh ladmin@192.168.1.4 +ladmin@192.168.1.4's password: +Permission denied, please try again. +``` + +输出: + +``` +Mar 29 02:12:36 CentOS7 sshd[5306]: User ladmin from 192.168.1.6 not allowed because none of user's groups are listed in AllowGroups +Mar 29 02:12:36 CentOS7 sshd[5306]: input_userauth_request: invalid user ladmin [preauth] +Mar 29 02:12:56 CentOS7 unix_chkpwd[5310]: password check failed for user (ladmin) +Mar 29 02:12:56 CentOS7 sshd[5306]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.1.6 user=ladmin +Mar 29 02:12:58 CentOS7 sshd[5306]: Failed password for invalid user ladmin from 192.168.1.6 port 42674 ssh2 +``` + +### 如何在 Linux 中阻止用户组使用 SSH? + +通过以下内容,我们可以禁用指定的组或多个组使用 `ssh`。 + +如果你想要禁用多个用户组使用 `ssh`,那么你需要在添加用户组时在同一行中使用空格来隔开他们。 + +为了达到目的只需要将下面的值追加到 `/etc/ssh/sshd_config` 文件中去。 + +``` +# echo "DenyGroups 2g-admin" >> /etc/ssh/sshd_config +``` + +你可以运行下列命令再次检查是否添加成功。 + +``` +# # cat /etc/ssh/sshd_config | grep -i denygroups +DenyGroups 2g-admin + +# getent group 2g-admin +2g-admin:x:1005:user1,user2,user3 +``` + +这样就行了, 现在只需要重启 `ssh` 服务和见证奇迹了。 + +``` +# systemctl restart sshd +或 +# service restart sshd +``` + +是的 `user1` 不被允许登入系统,因为他是 `2g-admin` 用户组中的一员。他属于被禁用 `ssh` 的组中。 + +``` +# ssh user1@192.168.1.4 +user1@192.168.1.4's password: +Permission denied, please try again. +``` + +输出: + +``` +Mar 29 02:17:32 CentOS7 sshd[5400]: User user1 from 192.168.1.6 not allowed because a group is listed in DenyGroups +Mar 29 02:17:32 CentOS7 sshd[5400]: input_userauth_request: invalid user user1 [preauth] +Mar 29 02:17:38 CentOS7 unix_chkpwd[5402]: password check failed for user (user1) +Mar 29 02:17:38 CentOS7 sshd[5400]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.1.6 user=user1 +Mar 29 02:17:41 CentOS7 sshd[5400]: Failed password for invalid user user1 from 192.168.1.6 port 42710 ssh2 +``` + +除了 `2g-admin` 用户组之外的用户都可以使用 ssh 登入系统。 例如,`ladmin` 等用户就允许登入系统。 + +``` +# ssh ladmin@192.168.1.4 +ladmin@192.168.1.4's password: +[ladmin@CentOS7 ~]$ +``` + +输出: + +``` +Mar 29 02:19:13 CentOS7 sshd[5432]: Accepted password for ladmin from 192.168.1.6 port 42716 ssh2 +Mar 29 02:19:13 CentOS7 sshd[5432]: pam_unix(sshd:session): session opened for user ladmin by (uid=0) +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/allow-deny-enable-disable-ssh-access-user-group-in-linux/ + +作者:[2daygeek][a] +选题:[lujun9972][b] +译者:[way-ww](https://github.com/way-ww) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.2daygeek.com/author/2daygeek/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/category/ssh-tutorials/ diff --git a/published/20190731 How to structure a multi-file C program- Part 2.md b/published/20190731 How to structure a multi-file C program- Part 2.md new file mode 100644 index 0000000000..53dc8bb70e --- /dev/null +++ b/published/20190731 How to structure a multi-file C program- Part 2.md @@ -0,0 +1,224 @@ +[#]: collector: (lujun9972) +[#]: translator: (mengxinayan) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12000-1.html) +[#]: subject: (How to structure a multi-file C program: Part 2) +[#]: via: (https://opensource.com/article/19/7/structure-multi-file-c-part-2) +[#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjny) + +如何组织构建多文件 C 语言程序(二) +====== + +> 我将在本系列的第二篇中深入研究由多个文件组成的 C 程序的结构。 + +![](https://img.linux.net.cn/data/attachment/album/202003/16/122928i6qheufnh24jq2qf.jpg) + +在[第一篇][2]中,我设计了一个名为[喵呜喵呜][3]的多文件 C 程序,该程序实现了一个玩具[编解码器][4]。我也提到了程序设计中的 Unix 哲学,即在一开始创建多个空文件,并建立一个好的结构。最后,我创建了一个 `Makefile` 文件夹并阐述了它的作用。在本文中将另一个方向展开:现在我将介绍简单但具有指导性的喵呜喵呜编解码器的实现。 + +当读过我的《[如何写一个好的 C 语言 main 函数][5]》后,你会觉得喵呜喵呜编解码器的 `main.c` 文件的结构很熟悉,其主体结构如下: + +``` +/* main.c - 喵呜喵呜流式编解码器 */ + +/* 00 系统包含文件 */ +/* 01 项目包含文件 */ +/* 02 外部声明 */ +/* 03 定义 */ +/* 04 类型定义 */ +/* 05 全局变量声明(不要用)*/ +/* 06 附加的函数原型 */ +    +int main(int argc, char *argv[]) +{ +  /* 07 变量声明 */ +  /* 08 检查 argv[0] 以查看该程序是被如何调用的 */ +  /* 09 处理来自用户的命令行选项 */ +  /* 10 做点有用的事情 */ +} +    +/* 11 其它辅助函数 */ +``` + +### 包含项目头文件 + +位于第二部分中的 `/* 01 项目包含文件 */` 的源代码如下: + + +``` +/* main.c - 喵呜喵呜流式编解码器 */ +... +/* 01 项目包含文件 */ +#include "main.h" +#include "mmecode.h" +#include "mmdecode.h" +``` + +`#include` 是 C 语言的预处理命令,它会将该文件名的文件内容拷贝到当前文件中。如果程序员在头文件名称周围使用双引号(`""`),编译器将会在当前目录寻找该文件。如果文件被尖括号包围(`<>`),编译器将在一组预定义的目录中查找该文件。 + +[main.h][6] 文件中包含了 [main.c][7] 文件中用到的定义和类型定义。我喜欢尽可能多将声明放在头文件里,以便我在我的程序的其他位置使用这些定义。 + +头文件 [mmencode.h][8] 和 [mmdecode.h][9] 几乎相同,因此我以 `mmencode.h` 为例来分析。 + +``` +/* mmencode.h - 喵呜喵呜流编解码器 */ +   +#ifndef _MMENCODE_H +#define _MMENCODE_H + +#include + +int mm_encode(FILE *src, FILE *dst); + +#endif /* _MMENCODE_H */ +``` + +`#ifdef`、`#define`、`#endif` 指令统称为 “防护” 指令。其可以防止 C 编译器在一个文件中多次包含同一文件。如果编译器在一个文件中发现多个定义/原型/声明,它将会产生警告。因此这些防护措施是必要的。 + +在这些防护内部,只有两个东西:`#include` 指令和函数原型声明。我在这里包含了 `stdio.h` 头文件,以便于能在函数原型中使用 `FILE` 定义。函数原型也可以被包含在其他 C 文件中,以便于在文件的命名空间中创建它。你可以将每个文件视为一个独立的命名空间,其中的变量和函数不能被另一个文件中的函数或者变量使用。 + +编写头文件很复杂,并且在大型项目中很难管理它。不要忘记使用防护。 + +### 喵呜喵呜编码的最终实现 + +该程序的功能是按照字节进行 `MeowMeow` 字符串的编解码,事实上这是该项目中最简单的部分。截止目前我所做的工作便是支持允许在适当的位置调用此函数:解析命令行,确定要使用的操作,并打开将要操作的文件。下面的循环是编码的过程: + +``` +/* mmencode.c - 喵呜喵呜流式编解码器 */ +... + while (!feof(src)) { + + if (!fgets(buf, sizeof(buf), src)) + break; + + for(i=0; i> 4; + fputs(tbl[hi], dst); + fputs(tbl[lo], dst); + } + } +``` + +简单的说,当文件中还有数据块时( `feof(3)` ),该循环读取(`feof(3)` )文件中的一个数据块。然后将读入的内容的每个字节分成两个 `hi` 和 `lo` 的半字节nibble。半字节是半个字节,即 4 个位。这里的奥妙之处在于可以用 4 个位来编码 16 个值。我将 `hi` 和 `lo` 用作 16 个字符串查找表 `tbl` 的索引,表中包含了用半字节编码的 `MeowMeow` 字符串。这些字符串使用 `fputs(3)` 函数写入目标 `FILE` 流,然后我们继续处理缓存区的下一个字节。 + +该表使用 [table.h][14] 中的宏定义进行初始化,在没有特殊原因(比如:要展示包含了另一个项目的本地头文件)时,我喜欢使用宏来进行初始化。我将在未来的文章中进一步探讨原因。 + +### 喵呜喵呜解码的实现 + +我承认在开始工作前花了一些时间。解码的循环与编码类似:读取 `MeowMeow` 字符串到缓冲区,将编码从字符串转换为字节 + +``` + /* mmdecode.c - 喵呜喵呜流式编解码器 */ + ... + int mm_decode(FILE *src, FILE *dst) + { +   if (!src || !dst) { +     errno = EINVAL; +     return -1; +   } +   return stupid_decode(src, dst); + } +``` + +这不符合你的期望吗? + +在这里,我通过外部公开的 `mm_decode()` 函数公开了 `stupid_decode()` 函数细节。我上面所说的“外部”是指在这个文件之外。因为 `stupid_decode()` 函数不在该头文件中,因此无法在其他文件中调用它。 + +当我们想发布一个可靠的公共接口时,有时候会这样做,但是我们还没有完全使用函数解决问题。在本例中,我编写了一个 I/O 密集型函数,该函数每次从源中读取 8 个字节,然后解码获得 1 个字节写入目标流中。较好的实现是一次处理多于 8 个字节的缓冲区。更好的实现还可以通过缓冲区输出字节,进而减少目标流中单字节的写入次数。 + +``` +/* mmdecode.c - 喵呜喵呜流式编解码器 */ +... +int stupid_decode(FILE *src, FILE *dst) +{ + char buf[9]; + decoded_byte_t byte; + int i; + + while (!feof(src)) { + if (!fgets(buf, sizeof(buf), src)) + break; + byte.field.f0 = isupper(buf[0]); + byte.field.f1 = isupper(buf[1]); + byte.field.f2 = isupper(buf[2]); + byte.field.f3 = isupper(buf[3]); + byte.field.f4 = isupper(buf[4]); + byte.field.f5 = isupper(buf[5]); + byte.field.f6 = isupper(buf[6]); + byte.field.f7 = isupper(buf[7]); + + fputc(byte.value, dst); + } + return 0; +} +``` + +我并没有使用编码器中使用的位移方法,而是创建了一个名为 `decoded_byte_t` 的自定义数据结构。 + +``` +/* mmdecode.c - 喵呜喵呜流式编解码器 */ +... + +typedef struct { +  unsigned char f7:1; +  unsigned char f6:1; +  unsigned char f5:1; +  unsigned char f4:1; +  unsigned char f3:1; +  unsigned char f2:1; +  unsigned char f1:1; +  unsigned char f0:1; +} fields_t; +   +typedef union { +  fields_t      field; +  unsigned char value; +} decoded_byte_t; +``` + +初次看到代码时可能会感到有点儿复杂,但不要放弃。`decoded_byte_t` 被定义为 `fields_t` 和 `unsigned char` 的 **联合**。可以将联合中的命名成员看作同一内存区域的别名。在这种情况下,`value` 和 `field` 指向相同的 8 位内存区域。将 `field.f0` 设置为 `1` 也将会设置 `value` 中的最低有效位。 + +虽然 `unsigned char` 并不神秘,但是对 `fields_t` 的类型定义(`typedef`)也许看起来有些陌生。现代 C 编译器允许程序员在结构体中指定单个位字段的值。字段所在的类型是一个无符号整数类型,并在成员标识符后紧跟一个冒号和一个整数,该整数指定了位字段的长度。 + +这种数据结构使得按字段名称访问字节中的每个位变得简单,并可以通过联合中的 `value` 字段访问组合后的值。我们依赖编译器生成正确的移位指令来访问字段,这可以在调试时为你节省不少时间。 + +最后,因为 `stupid_decode()` 函数一次仅从源 `FILE` 流中读取 8 个字节,所以它效率并不高。通常我们尝试最小化读写次数,以提高性能和降低调用系统调用的开销。请记住:少量的读取/写入大的块比大量的读取/写入小的块好得多。 + +### 总结 + +用 C 语言编写一个多文件程序需要程序员要比只是是一个 `main.c` 做更多的规划。但是当你添加功能或者重构时,只需要多花费一点儿努力便可以节省大量时间以及避免让你头痛的问题。 + +回顾一下,我更喜欢这样做:多个文件,每个文件仅有简单功能;通过头文件公开那些文件中的小部分功能;把数字常量和字符串常量保存在头文件中;使用 `Makefile` 而不是 Bash 脚本来自动化处理事务;使用 `main()` 函数来处理命令行参数解析并作为程序主要功能的框架。 + +我知道我只是蜻蜓点水般介绍了这个简单的程序,并且我很高兴知道哪些事情对你有所帮助,以及哪些主题需要详细的解释。请在评论中分享你的想法,让我知道。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/7/structure-multi-file-c-part-2 + +作者:[Erik O'Shaughnessy][a] +选题:[lujun9972][b] +译者:[萌新阿岩](https://github.com/mengxinayan) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jnyjny +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/file_system.jpg?itok=pzCrX1Kc (4 manilla folders, yellow, green, purple, blue) +[2]: https://linux.cn/article-11935-1.html +[3]: https://github.com/jnyjny/MeowMeow.git +[4]: https://en.wikipedia.org/wiki/Codec +[5]: https://linux.cn/article-10949-1.html +[6]: https://github.com/JnyJny/meowmeow/blob/master/main.h +[7]: https://github.com/JnyJny/meowmeow/blob/master/main.c +[8]: https://github.com/JnyJny/meowmeow/blob/master/mmencode.h +[9]: https://github.com/JnyJny/meowmeow/blob/master/mmdecode.h +[10]: http://www.opengroup.org/onlinepubs/009695399/functions/feof.html +[11]: http://www.opengroup.org/onlinepubs/009695399/functions/fgets.html +[12]: http://www.opengroup.org/onlinepubs/009695399/functions/strlen.html +[13]: http://www.opengroup.org/onlinepubs/009695399/functions/fputs.html +[14]: https://github.com/JnyJny/meowmeow/blob/master/table.h +[15]: http://www.opengroup.org/onlinepubs/009695399/functions/isupper.html +[16]: http://www.opengroup.org/onlinepubs/009695399/functions/fputc.html diff --git a/translated/tech/20190813 Building a non-breaking breakpoint for Python debugging.md b/published/20190813 Building a non-breaking breakpoint for Python debugging.md similarity index 58% rename from translated/tech/20190813 Building a non-breaking breakpoint for Python debugging.md rename to published/20190813 Building a non-breaking breakpoint for Python debugging.md index ed94d222e6..0ad21ebeab 100644 --- a/translated/tech/20190813 Building a non-breaking breakpoint for Python debugging.md +++ b/published/20190813 Building a non-breaking breakpoint for Python debugging.md @@ -1,16 +1,18 @@ [#]: collector: (lujun9972) [#]: translator: (caiichenr) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11986-1.html) [#]: subject: (Building a non-breaking breakpoint for Python debugging) [#]: via: (https://opensource.com/article/19/8/debug-python) [#]: author: (Liran Haimovitch https://opensource.com/users/liranhaimovitch) 在 Python 调试过程中设置不中断的断点 ====== -你对如何让调试器变得更快产生过兴趣吗?本文将分享我们在为 Python 构建调试器时得到的一些经验。 -![Real python in the graphic jungle][1] + +> 你对如何让调试器变得更快产生过兴趣吗?本文将分享我们在为 Python 构建调试器时得到的一些经验。 + +![](https://img.linux.net.cn/data/attachment/album/202003/12/104433hq3qx2k81w1wamwm.jpg) 整段故事讲的是我们在 [Rookout][2] 公司的团队为 Python 调试器开发不中断断点的经历,以及开发过程中得到的经验。我将在本月于旧金山举办的 [PyBay 2019][3] 上介绍有关 Python 调试过程的更多细节,但现在就让我们立刻开始这段故事。 @@ -18,28 +20,23 @@ 在诸多可选的 Python 调试器中,使用最广泛的三个是: - * **pdb**,它是 Python 标准库的一部分 - * **PyDev**,它是内嵌在 Eclipse 和 Pycharm 等 IDE 中的调试器 - * **ipdb**,它是IPython的调试器 +* pdb,它是 Python 标准库的一部分 +* PyDev,它是内嵌在 Eclipse 和 Pycharm 等 IDE 中的调试器 +* ipdb,它是 IPython 的调试器 - - -Python 调试器的选择虽多,但它们几乎都基于同一个函数:**sys.set_trace**。 值得一提的是, **[sys.settrace][4]** 可能也是 Python 标准库中最复杂的函数。 +Python 调试器的选择虽多,但它们几乎都基于同一个函数:`sys.settrace`。 值得一提的是, [sys.settrace][4] 可能也是 Python 标准库中最复杂的函数。 ![set_trace Python 2 docs page][5] -简单来讲,**settrace** 的作用是为解释器注册一个跟踪函数,它在下列四种情形发生时被调用: - - * 函数调用 (Function call) - * 语句执行 (Line execution) - * 函数返回 (Function return) - * 异常抛出 (Exception raised) - +简单来讲,`settrace` 的作用是为解释器注册一个跟踪函数,它在下列四种情形发生时被调用: +* 函数调用 +* 语句执行 +* 函数返回 +* 异常抛出 一个简单的跟踪函数看上去大概是这样: - ``` def simple_tracer(frame, event, arg):   co = frame.f_code @@ -52,27 +49,22 @@ e=event, f=func_name, l=line_no)) 在分析函数时我们首先关注的是参数和返回值,该跟踪函数的参数分别是: - * **frame**,当前堆栈帧,它是包含当前函数执行时解释器里完整状态的对象 - * **event**,它是一个值可能为 **"call"**, **"line"**, **"return"**, 或 **"exception"** 的字符串 - * **arg**,它的取值基于 event 的类型,是一个可选项 - - +* `frame`,当前堆栈帧,它是包含当前函数执行时解释器里完整状态的对象 +* `event`,事件,它是一个值可能为 `call`、`line`、`return` 或 `exception` 的字符串 +* `arg`,参数,它的取值基于 `event` 的类型,是一个可选项 该跟踪函数的返回值是它自身,这是由于解释器需要持续跟踪两类跟踪函数: - * **全局跟踪函数(每线程):** 该跟踪函数由当前线程调用 **sys.settrace** 来设置,并在解释器创建一个新 **frame** 时被调用(即代码中发生函数调用时)。虽然没有现成的方式来为不同的线程设置跟踪函数,但你可以调用 **threading.settrace** 来为所有新创建的 **threading** 模块线程设置跟踪函数。 - * **局部跟踪函数(每一帧):** 解释器将该跟踪函数的值设置为全局跟踪函数创建帧时的返回值。同样也没有现成的方法能够在帧被创建时自动设置局部跟踪函数。 - - +* **全局跟踪函数(每线程)**:该跟踪函数由当前线程调用 `sys.settrace` 来设置,并在解释器创建一个新的堆栈帧时被调用(即代码中发生函数调用时)。虽然没有现成的方式来为不同的线程设置跟踪函数,但你可以调用 `threading.settrace` 来为所有新创建的 `threading` 模块线程设置跟踪函数。 +* **局部跟踪函数(每一帧)**:解释器将该跟踪函数的值设置为全局跟踪函数创建帧时的返回值。同样也没有现成的方法能够在帧被创建时自动设置局部跟踪函数。 该机制的目的是让调试器对被跟踪的帧有更精确的把握,以减少对性能的影响。 ### 简单三步构建调试器 (我们最初的设想) -仅仅依靠上文提到的内容,用自制的跟踪函数来构建一个真正的调试器似乎有些不切实际。幸运的是,Python 的标准调试器 **pdb** 是基于 **Bdb** 构建的,后者是 Python 标准库中专门用于构建调试器的基类。 - -基于 **Bdb** 的简易断点调试器看上去是这样的: +仅仅依靠上文提到的内容,用自制的跟踪函数来构建一个真正的调试器似乎有些不切实际。幸运的是,Python 的标准调试器 pdb 是基于 Bdb 构建的,后者是 Python 标准库中专门用于构建调试器的基类。 +基于 Bdb 的简易断点调试器看上去是这样的: ``` import bdb @@ -105,11 +97,9 @@ def user_line(self, frame): 这个调试器类的全部构成是: - 1. 继承 **Bdb**,定义一个简单的构造函数来初始化基类,并开始跟踪。 - 2. 添加 **set_breakpoint** 方法,它使用 **Bdb** 来设置断点,并跟踪这些断点。 - 3. 重载 **Bdb** 在当前用户行调用的 **user_line** 方法,该方法一定被一个断点调用,之后获取该断点的源位置,并调用已注册的断点。 - - +1. 继承 `Bdb`,定义一个简单的构造函数来初始化基类,并开始跟踪。 +2. 添加 `set_breakpoint` 方法,它使用 `Bdb` 来设置断点,并跟踪这些断点。 +3. 重载 `Bdb` 在当前用户行调用的 `user_line` 方法,该方法一定被一个断点调用,之后获取该断点的源位置,并调用已注册的断点。 ### 这个简易的 Bdb 调试器效率如何呢? @@ -117,7 +107,6 @@ Rookout 的目标是在生产级性能的使用场景下提供接近普通调试 为了衡量调试器的整体性能开销,我们使用如下两个简单的函数来进行测试,它们分别在不同的情景下执行了 1600 万次。请注意,在所有情景下断点都不会被执行。 - ``` def empty_method():    pass @@ -135,7 +124,7 @@ def simple_method():    j = 10 ``` -在使用调试器的情况下需要大量的时间才能完成测试。糟糕的结果指明了,这个简陋 **Bdb** 调试器的性能还远不足以在生产环境中使用。 +在使用调试器的情况下需要大量的时间才能完成测试。糟糕的结果指明了,这个简陋 `Bdb` 调试器的性能还远不足以在生产环境中使用。 ![First Bdb debugger results][6] @@ -143,13 +132,11 @@ def simple_method(): 降低调试器的额外开销主要有三种方法: - 1. **尽可能的限制局部跟踪:** 由于每一行代码都可能包含大量事务,局部跟踪比全局跟踪的开销要大得多。 - 2. **优化 "call" 事务并尽快将控制权还给解释器:** 在 **call** 事务发生时调试器的主要工作是判断是否需要对该事务进行跟踪。 - 3. **优化 "line" 事务并尽快将控制权还给解释器:** 在 **line** 事务发生时调试器的主要工作是判断我们在此处是否需要设置一个断点。 +1. **尽可能的限制局部跟踪**:由于每一行代码都可能包含大量事件,局部跟踪比全局跟踪的开销要大得多。 +2. **优化 `call` 事件并尽快将控制权还给解释器**:在 `call` 事件发生时调试器的主要工作是判断是否需要对该事件进行跟踪。 +3. **优化 `line` 事件并尽快将控制权还给解释器**:在 `line` 事件发生时调试器的主要工作是判断我们在此处是否需要设置一个断点。 - - -于是我们克隆了 **Bdb** 项目,精简特征,简化代码,针对使用场景进行优化。这些工作虽然得到了一些效果,但仍无法满足我们的需求。因此我们又继续进行了其它的尝试,将代码优化并迁移至 **.pyx** 使用 [Cython][7] 进行编译,可惜结果(如下图所示)依旧不够理想。最终,我们在深入了解 CPython 源码之后意识到,让跟踪过程快到满足生产需求是不可能的。 +于是我们复刻了 `Bdb` 项目,精简特征、简化代码,针对使用场景进行优化。这些工作虽然得到了一些效果,但仍无法满足我们的需求。因此我们又继续进行了其它的尝试,将代码优化并迁移至 `.pyx` 使用 [Cython][7] 进行编译,可惜结果(如下图所示)依旧不够理想。最终,我们在深入了解 CPython 源码之后意识到,让跟踪过程快到满足生产需求是不可能的。 ![Second Bdb debugger results][8] @@ -159,10 +146,8 @@ def simple_method(): Python 解释器的工作主要分为两个阶段: - 1. **将 Python 源码编译成 Python 字节码:** 这种不可读(对人类而言)的格式专为执行的效率而优化,它们通常缓存在我们熟知的 **.pyc** 文件当中。 - 2. **遍历 _interpreter loop_ 中的字节码:** 在这一步中解释器会逐条的执行指令 - - +1. **将 Python 源码编译成 Python 字节码**:这种(对人类而言)不可读的格式专为执行的效率而优化,它们通常缓存在我们熟知的 `.pyc` 文件当中。 +2. **遍历 解释器循环中的字节码**: 在这一步中解释器会逐条的执行指令。 我们选择的模式是:使用**字节码操作**来设置没有全局额外开销的**不中断断点**。这种方式的实现首先需要在内存中的字节码里找到我们感兴趣的部分,然后在该部分的相关机器指令前插入一个函数调用。如此一来,解释器无需任何额外的工作即可实现我们的不中断断点。 @@ -170,22 +155,19 @@ Python 解释器的工作主要分为两个阶段: 首先定义一个简单的函数: - ``` def multiply(a, b):    result = a * b    return result ``` -在 **[inspect][9]** 模块(其包含了许多实用的单元)的文档里,我们得知可以通过访问 **multiply.func_code.co_code** 来获取函数的字节码: - +在 [inspect][9] 模块(其包含了许多实用的单元)的文档里,我们得知可以通过访问 `multiply.func_code.co_code` 来获取函数的字节码: ``` -`'|\x00\x00|\x01\x00\x14}\x02\x00|\x02\x00S'` +'|\x00\x00|\x01\x00\x14}\x02\x00|\x02\x00S' ``` -使用 Python 标准库中的 **[dis][10]** 模块可以翻译这些不可读的字符串。调用 **dis.dis(multiply.func_code.co_code)** 之后,我们就可以得到: - +使用 Python 标准库中的 [dis][10] 模块可以翻译这些不可读的字符串。调用 `dis.dis(multiply.func_code.co_code)` 之后,我们就可以得到: ```   4          0 LOAD_FAST               0 (a) @@ -203,11 +185,7 @@ def multiply(a, b): 在构建一个新工具时,总会学到许多事情的工作原理。这种刨根问底的过程能够使你的思路跳出桎梏,从而得到意料之外的解决方案。 -在 Rookout 团队中构建不中断断点的这段时间里,我学到了许多有关编译器、调试器、服务器框架、并发模型等等领域的知识。如果你希望更深入的了解字节码操作,谷歌的开源项目 **[cloud-debug-python][11]** 为编辑字节码提供了一些工具。 - -* * * - -_Liran Haimovitch 将于 2019 年八月 17-18 日在旧金山举办的 [PyBay][3] 中发表题为 "[Understanding Python’s Debugging Internals][12]" 的演说,使用 [OpenSource35][13] 可以获得购票优惠,并使他们得知您是在我们的社区得知此事。_ +在 Rookout 团队中构建不中断断点的这段时间里,我学到了许多有关编译器、调试器、服务器框架、并发模型等等领域的知识。如果你希望更深入的了解字节码操作,谷歌的开源项目 [cloud-debug-python][11] 为编辑字节码提供了一些工具。 -------------------------------------------------------------------------------- @@ -216,7 +194,7 @@ via: https://opensource.com/article/19/8/debug-python 作者:[Liran Haimovitch][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/) 荣誉推出 diff --git a/published/20190925 Debugging in Emacs- The Grand Unified Debugger.md b/published/20190925 Debugging in Emacs- The Grand Unified Debugger.md new file mode 100644 index 0000000000..ef4b71f194 --- /dev/null +++ b/published/20190925 Debugging in Emacs- The Grand Unified Debugger.md @@ -0,0 +1,104 @@ +[#]: collector: (lujun9972) +[#]: translator: (cycoe) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11994-1.html) +[#]: subject: (Debugging in Emacs: The Grand Unified Debugger) +[#]: via: (https://opensourceforu.com/2019/09/debugging-in-emacs-the-grand-unified-debugger/) +[#]: author: (Vineeth Kartha https://opensourceforu.com/author/vineeth-kartha/) + +Emacs 调试秘籍之 GUD 调试器 +====== + +![][2] + +> 本文简短地对 Emacs 的调试工具 GUD 的特性进行了探索。 + +如果你是一个 C 或 C++ 开发者,你很可能已经使用过 GDB(GNU 调试器),毫无疑问,它是现今最强大、最无可匹敌的调试器之一。它唯一的缺点就是它基于命令行,虽然仍能提供许多强大的功能,但有时也会具有一些局限性。这也就是为什么聪明的人们开始追求整合了编辑器和调试器的图形化 GUI 集成开发环境Integrated Development Environment。仍有些开发者坚信使用鼠标会降低工作效率,在 GUI 上用鼠标点~点~点~是来自恶魔的诱惑。 + +因为 Emacs 是现今最酷的文本编辑器之一,我将为你展示如何在不碰鼠标且不离开 Emacs 的情况下,实现写代码、编译代码、调试代码的过程。 + +GUD(LCTT 译注:全称大统一调试器Grand Unified Debugger,鉴于其缩写形式更为人熟知,以下全文将使用缩写替代此全称)是 Emacs 下的一个模式mode,用于在 Emacs 中运行 GDB。它向 GDB 提供了 Emacs 的所有特性,使用户无需离开编辑器就可以对代码进行调试。 + +### 使用 GUD 的前期准备 + +如果你正在使用一个 Linux 机器,很可能你已经安装了 GDB 和 gcc,接下来就是要确保已经安装了 Emacs。以下的内容我将假设读者熟悉 GDB 并且至少用它做过基本的调试。如果你未曾接触过 GDB,你可以做个快速入门,这些资料在网上随处可得。 + +对于那些 Emacs 新手,我将向你介绍一些基本术语。纵览整篇文章,你将看到诸如 `C-c M-x` 等快捷键。此处 `C` 代表 `Ctrl` 键,`M` 代表 `Alt` 键。`C-c` 代表 `Ctrl` 键和 `c` 键被同时按下。如果你看到 `C-c c`,它代表同时按下 `Ctrl` 键和 `c` 键,释放后紧接着按下 `c` 键。在 Emacs 中,编辑文本的主要区域被称为主缓冲区main buffer,而在 Emacs 窗口下方用于输入命令的区域被称为迷你缓冲区mini buffer。 + +启动 Emacs,并按下 `C-x C-f` 来创建一个新文件。Emacs 将提示你输入一个文件名,此处让我们将文件命名为 `buggyFactorial.cpp`。一旦文件打开,输入如下代码: + +``` +#include +#include + +int factorial(int num) { + int product = 1; + while(num--) { + product *= num; + } + return product; +} +int main() { + int result = factorial(5); + assert(result == 120); +} +``` + +使用 `C-x C-s` 快捷键保存文件。文件保存完毕,是时候进行编译了。按下 `M-x`,在弹出的提示符prompt后输入 `compile` 并点击回车。然后在提示符后,将内容替换为 `g++ -g buggyFactorial.cpp` 并再次点击回车。 + +![图 1: Emacs 迷你缓冲区中编译命令][3] + +这将在 Emacs 中开启另一个缓冲区,显示编译的状态。如果你的代码输入没有错误,你将预期得到如图 2 所示的缓冲区。 + +![图 2: 编译状态][4] + +要想隐藏编译缓冲区,首先确保你的光标在编译缓冲区中(你可以不使用鼠标,而是通过 `C-x o` 快捷键将光标从一个缓冲区移动到另一个),然后按下 `C-x 0`。下一步就是运行代码,并观察是否运行良好。按下 `M-!` 快捷键并在迷你缓冲区的提示符后面输入 `./a.out`。 + +![图 3: 代码在迷你缓冲区中的输出][5] + +你可以看到迷你缓冲区中显示断言失败。很明显代码中有错误,因为 5 的阶乘是 120。那么让我们现在开始调试吧。 + +### 使用 GUD 调式代码 + +现在,我们的代码已经编译完成,是时候看看到底哪里出错了。按下 `M-x` 快捷键并在提示符后输入 `gdb`。在接下来的提示符后,输入 `gdb -i=mi a.out`。如果一切顺利,GDB 会在 Emacs 缓冲区中启动,你会看到如图 4 所示的窗口。 + +![图 4: Emacs 中的 GDB 缓冲区][6] + +在 `gdb` 提示符后,输入 `break main` 来设置断点,并输入 `r` 来运行程序。程序会开始运行并停在 `main()` 函数处。 + +一旦 GDB 到达了 `main` 处设置的断点,就会弹出一个新的缓冲区显示你正在调试的代码。注意左侧的红点,正是你设置断点的位置,同时会有一个小的标志提示你当前代码运行到了哪一行。当前,该标志就在断点处(如图 5)。 + +![图 5: GDB 与代码显示在两个分离的窗口][7] + +为了调试 `factorial` 函数,我们需要单步运行。想要达到此目的,你可以在 GBD 提示符使用 GDB 命令 `step`,或者使用 Emacs 快捷键 `C-c C-s`。还有其它一些快捷键,但我更喜欢 GDB 命令。因此我将在本文的后续部分使用它们。 + +单步运行时让我们注意一下局部变量中的阶乘值。参考图 6 来设置在 Emacs 帧中显示局部变量值。 + +![图 6: 在 Emacs 中使用独立帧显示局部变量][8] + +在 GDB 提示符中进行单步运行并观察局部变量值的变化。在循环的第一次迭代中,我们发现了一个问题。此处乘法的结果应该是 5 而不是 4。 + +本文到这里也差不多结束了,读者可以自行探索发现 GUD 模式这片新大陆。GDB 中的所有命令都可以在 GUD 模式中运行。我将此代码的修复留给读者作为一个练习。看看你在调试的过程中,可以做哪一些定制化,来使你的工作流更加简单和高效。 + +-------------------------------------------------------------------------------- + +via: https://opensourceforu.com/2019/09/debugging-in-emacs-the-grand-unified-debugger/ + +作者:[Vineeth Kartha][a] +选题:[lujun9972][b] +译者:[cycoe](https://github.com/cycoe) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensourceforu.com/author/vineeth-kartha/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Screenshot-from-2019-09-25-15-39-46.png?ssl=1 +[2]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Screenshot-from-2019-09-25-15-39-46.png?ssl=1 +[3]: https://i1.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure_1.png?ssl=1 +[4]: https://i2.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure_2.png?ssl=1 +[5]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure_3.png?ssl=1 +[6]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure_4.png?ssl=1 +[7]: https://i1.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure_5.png?ssl=1 +[8]: https://i1.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure_6.png?ssl=1 diff --git a/published/20191126 Calculator N- is an open source scientific calculator for your smartphone.md b/published/20191126 Calculator N- is an open source scientific calculator for your smartphone.md new file mode 100644 index 0000000000..3ba3711fe6 --- /dev/null +++ b/published/20191126 Calculator N- is an open source scientific calculator for your smartphone.md @@ -0,0 +1,60 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11981-1.html) +[#]: subject: (Calculator N+ is an open source scientific calculator for your smartphone) +[#]: via: (https://opensource.com/article/19/11/calculator-n-mobile) +[#]: author: (Ricardo Berlasso https://opensource.com/users/rgb-es) + +Calculator N+:一款智能手机上的开源科学计算器 +====== + +> 这个 Android 应用可在掌中计算许多高级数学函数。 + +![](https://img.linux.net.cn/data/attachment/album/202003/10/113543hlb5xu7b5e17ba90.jpg) + +移动电话每天都在变得越来越强大,因此毫不奇怪它们可以击败不太久前的大多数计算机。这也意味着移动手机上的工具每天都在变得越来越强大。 + +之前,我写过一篇 [两款 Linux 桌面端可用的科学计算器][2],我接着将介绍 [Calculator N+][3],这是一款很棒的适用于 Android 设备的计算机代数系统(CAS)应用,采用 GPL v3.0 许可证下。 + +Calculator N+ 被认为是“适用于 Android 的强大计算器”,但这是一个谦虚的说法。它不仅可以以任意精度工作,还可以显示根数和分数等*很多*功能。 + +寻找多项式根?可以。分解因数?可以。导数、积分和极限?可以。数论(模算术、组合学、素因数分解)?可以。 + +你还可以求解方程系统、简化表达式(包括三角函数)、转换单位,只要你想到的,它都能做! + +![Calculator N+ graphical interface][4] + +其结果以 LaTeX 输出。左上方的菜单提供了许多强大的功能,只需触摸一下即可使用。同样在该菜单中,你将找到该应用所有功能的帮助文件。在屏幕的右上角,你可以在精确表示法和十进制表示法之间切换。最后,点击屏幕底部的蓝色栏,即可访问应用中的所有函数库。不过要小心!如果你不是数学家、物理学家或工程师,那么这么长的列表会看上去很吓人。 + +所有这些功能都来自 [Symja 库][5],这是另一个出色的 GPL 3 项目。 + +这两个项目都处于积极开发中,并且每个版本都在不断完善。特别是,Calculator N+ 的 v3.4.6 在用户界面(UI)品质方面取得了重大飞跃。虽然还是存在一些不够好的地方,但是要在智能手机的小巧的用户界面中发挥如此强大的功能是一项艰巨的任务,我认为应用开发人员正在很好地解决其剩余的问题。对他们表示敬意! + +如果你是老师、学生或在理工科领域工作,请试试 Calculator N+。它是免费、无广告、开源的,并可以满足你所有的数学需求。(当然,除了数学考试期间,为防止作弊绝对不允许使用智能手机。) + +可以在 [Google Play 商店][6]找到 Calculator N+,也可以使用 GitHub 页面上的说明[从源代码构建][7]。 + +如果你知道用于科学或工程的其他有用的开源应用,请在评论中告知我们。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/11/calculator-n-mobile + +作者:[Ricardo Berlasso][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://opensource.com/users/rgb-es +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/calculator_money_currency_financial_tool.jpg?itok=2QMa1y8c (scientific calculator) +[2]: https://linux.cn/article-9643-1.html +[3]: https://github.com/tranleduy2000/ncalc +[4]: https://opensource.com/sites/default/files/uploads/calculatornplus_sqrt-frac.png (Calculator N+ graphical interface) +[5]: https://github.com/axkr/symja_android_library +[6]: https://play.google.com/store/apps/details?id=com.duy.calculator.free +[7]: https://github.com/tranleduy2000/ncalc/blob/master/README.md diff --git a/published/20191223 10 articles to learn Linux your way.md b/published/20191223 10 articles to learn Linux your way.md new file mode 100644 index 0000000000..a38a98dff2 --- /dev/null +++ b/published/20191223 10 articles to learn Linux your way.md @@ -0,0 +1,99 @@ +[#]: collector: "lujun9972" +[#]: translator: "messon007" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-12035-1.html" +[#]: subject: "10 articles to learn Linux your way" +[#]: via: "https://opensource.com/article/19/12/learn-linux" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" + +10 篇关于 Linux 的好文章 +======= + +> 2019 年对于 Linux 来说是个好年份,让我们一起来回顾一下这十篇关于 Linux 的好文章。 + +![](https://img.linux.net.cn/data/attachment/album/202003/25/115447rrjfuufccumf0oz6.jpg) + +2019 年对于 Linux 来说是个好年份,显然这里的 “Linux” 一词有更多含义: 内核? 桌面? 或是生态? 在此次回顾年度 Linux 好文中,我在选择十大好文时有意采取了更开放的视角。下面就是十大好文(无先后次序之分)。 + +### 《Linux 权限入门指南》 + +Bryant Son 的《[Linux 权限入门指南][2]》向新用户介绍了文件权限的概念,通过图形和图表的方式来说明每个要点。通常很难以视觉的方式来解释纯粹基于文本的概念,而本文则对可视方式学习的人非常友好。 Bryant 在讲述时也很专注主题。关于文件权限的任何阐述都可能引出几个相关主题(例如所有权和访问控制列表等),但是本文致力于解释一件事并很好地解释它。 + +### 《为什么我从 Mac 换到了 Linux》 + +Matthew Broberg 在《[为什么我从 Mac 换到了 Linux][3]》中清楚而客观的介绍了他从 MacOS 切换到 Linux 的经历。通常切换平台是很困难的,因此记录决定切换的背后考虑非常重要。我认为 Matt 的文章带有几个目的,但对我来说最重要的两个目的是:通过解答他的问题并提供潜在的解决方案,他请 Linux 社区的人们来支持他;这对于其他正在考虑采用 Linux 的人来说是一个很好的参考。 + +### 《在 Linux 上定位 WiFi 速度慢的问题》 + +《[在 Linux 上定位 WiFi 速度慢的问题][4]》这篇文章中,David Clinton 对每个人都可能遇到的问题进行了分析,并提供了怎么样一步步解决的思路。这是“偶然的 Linux”技巧的一个很好的例子,但它不仅可以帮助经常遇到问题的人,而且可以向非 Linux 用户展示如何在其他平台上进行问题定位。 + +### 《一个非技术人员对 GNOME 项目使用 GitLab 的感受》 + +Molly de Blanc 所写的《[一个非技术人员对 GNOME 项目使用 GitLab 的感受][5]》深层次地揭示了开源界的一个典范(GNOME 桌面)如何使用开源界的另一个典范(Git)进行开发。听到一个开放源代码项目对于任何需要做的事情默认为开放源代码解决方案,这总是让我感到振奋。无论如何,这种情况并不常见,然而对于 GNOME 来说,这是项目本身的重要且受欢迎的部分。 + +### 《详解 Linux 中的虚拟文件系统》 + +Alison Chaiken 在《[详解 Linux 中的虚拟文件系统][6]》中巧妙地解释了对许多用户来说都很难理解的东西。理解文件系统是什么、虚拟文件系统和真实的文件系统是一回事,但从定义上讲,*虚拟的*其实并不是真正的文件系统。Linux 以一种普通用户也能从中受益的方式提供了它们,Alison 的文章以一种易于理解的方式对其进行了阐述。另外,Alison 在文章的后半部分更深入地介绍了如何使用 `bcc` 脚本查看她刚刚讲的虚拟文件系统的相关内容。 + +### 《理解文件路径并学会使用它们》 + +我认为《[理解文件路径并学会使用它们][7]》很重要,因为这是大多数用户(在任何平台上)似乎都没有学过的概念。这是一个奇怪的现象,因为现在比以往任何时候,人们都越来越多地看到*文件路徑*:几乎所有的互联网网址都包含一个文件路径,该路径告诉你你在域中的确切位置。我常常在想为什么计算机教育不是从互联网开始的,互联网是目前最熟悉的应用程序,并且可以说是使用最频繁的超级计算机,完全可以用它来解释我们每天使用的设备。(我想如果这些设备运行 Linux 会有所帮助,但是我们正在努力。) + +### 《Linux 下的进程间通信:共享存储》 + +Marty Kalin 的《[Linux 下的进程间通信:共享存储][8]》从 Linux 的开发者视角解释了 IPC 以及如何在代码中使用它。虽然我只是列入了这篇文章,不过它实际上是一个三篇文章的系列,而它是同类文章中阐述的最好的。很少有文档能够解释 Linux 怎样处理 IPC,更不用说 IPC 是什么,为什么它很重要,或者在编程时该如何使用它。通常这是你在大学读书时关注的话题。现在,你可以在这里阅读所有内容。 + +### 《在 Linux 上用 strace 来理解系统调用》 + +Gaurav Kamathe 的《[在 Linux 上用 strace 来理解系统调用][9]》具有很强的技术性,我希望我所见过的有关 `strace` 的每次会议演讲都是如此。这是对一个复杂但非常有用的命令的清晰演示。令我惊讶的是,我读了本文才发现自己一直使用的命令不是这个命令,而是 `ltrace`(可以用来查看命令调用了哪些函数)。本文包含了丰富的信息,是开发人员和测试人员的快捷参考手册。 + +### 《Linux 桌面发展旅程》 + +Jim Hall 的《[Linux 桌面发展旅程][10]》是对 Linux 桌面历史的一次视觉之旅。从 [TWM][11] 开始,经历了 [FVWM][12]、[GNOME][13]、[KDE][14] 等薪火相传。如果你是 Linux 的新手,那么这将是一个出自那个年代的人的有趣的历史课(有截图可以证明这一点)。如果你已经使用 Linux 多年,那么这肯定会唤醒你的记忆。最后,可以肯定的是:仍然可以找到 20 年前屏幕快照的人都是神一样的数据档案管理员。 + +### 《用 Linux 创建你自己的视频流服务器》 + +Aaron J. Prisk 的 《[用 Linux 创建你自己的视频流服务器][15]》消除了大多数人对我们视为理所当然的服务的误解。由于 YouTube 和 Twitch 之类服务的存在,许多人认为这是向世界广播视频的唯一方式。当然,人们过去常常以为 Windows 和 Mac 是计算机的唯一入口,值得庆幸的是,最终证明这是严重的误解。在本文中,Aaron 建立了一个视频流服务器,甚至还顺便讨论了一下 [OBS][16],以便你可以创建视频。这是一个有趣的周末项目还是新职业的开始?你自己决定。 + +### 《塑造 Linux 历史的 10 个时刻》 + +Alan Formy-Duval 撰写的《[塑造 Linux 历史的 10 个时刻][17]》试图完成一项艰巨的任务,即从 Linux 的历史中选出 10 件有代表性的事情。当然,这是很难的,因为有如此多重要的时刻,所以我想看看 Alan 是如何通过自己的经历来选择它。例如,什么时候开始意识到 Linux 必然可以发展下去?—— 当 Alan 意识到他维护的所有系统都在运行 Linux 时。用这种方式来解释历史是很美的,因为每个人的重要时刻都会有所不同。 关于 Linux 没有权威性列表,关于 Linux 的文章也没有,关于开源也没有。你可以创建你自己的列表,也可以使你自己成为列表的一部分。 + +(LCTT 译注:这里推荐了 11 篇,我数了好几遍,没眼花……) + +### 你想从何学起? + +你还想知道 Linux 的什么内容?请在评论区告诉我们或来文讲述你的 Linux 经验。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/learn-linux + +作者:[Seth Kenlon][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://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_Penguin_Image_520x292_12324207_0714_mm_v1a.png?itok=p7cWyQv9 "Penguins gathered together in the Artic" +[2]: https://linux.cn/article-11056-1.html +[3]: https://linux.cn/article-11586-1.html +[4]: http://opensource.com/article/19/4/troubleshooting-wifi-linux +[5]: https://linux.cn/article-11806-1.html +[6]: https://linux.cn/article-10884-1.html +[7]: https://opensource.com/article/19/8/understanding-file-paths-linux +[8]: https://linux.cn/article-10826-1.html +[9]: https://linux.cn/article-11545-1.html +[10]: https://opensource.com/article/19/8/how-linux-desktop-grown +[11]: https://github.com/freedesktop/twm +[12]: http://www.fvwm.org/ +[13]: http://gnome.org +[14]: http://kde.org +[15]: https://opensource.com/article/19/1/basic-live-video-streaming-server +[16]: https://opensource.com/life/15/12/real-time-linux-video-editing-with-obs-studio +[17]: https://opensource.com/article/19/4/top-moments-linux-history +[18]: https://opensource.com/how-submit-article diff --git a/published/20191223 Prioritizing simplicity in your Python code.md b/published/20191223 Prioritizing simplicity in your Python code.md new file mode 100644 index 0000000000..e0760548c7 --- /dev/null +++ b/published/20191223 Prioritizing simplicity in your Python code.md @@ -0,0 +1,63 @@ +[#]: collector: (lujun9972) +[#]: translator: (caiichenr) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11999-1.html) +[#]: subject: (Prioritizing simplicity in your Python code) +[#]: via: (https://opensource.com/article/19/12/zen-python-simplicity-complexity) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +简单是 Python 编程的第一要则 +====== + +> 本文是 Python 之禅特别系列的第二篇,我们将要关注其中第三与第四条原则:简单与复杂。 + +![](https://img.linux.net.cn/data/attachment/album/202003/15/124150t4wf3wwgdrijx6xx.jpg) + +> "Il semble que la perfection soit atteinte non quand il n'y a plus rien à ajouter, mais quand il n'y plus rien à retrancher." +> +> "It seems that perfection is finally attained not when there is no longer anything to add, but when there is no longer anything to take away." +> +> “完美并非无可增,而是不可减。” +> +> —Antoine de Saint-Exupéry, [Terre des Hommes][2], 1939 + +编程时最常有的考量是与复杂性的斗争,只想写出让旁人无从下手的繁杂代码,对每个程序员来讲都算不上难事。倘若未能触及代码的简繁取舍,那么 《[Python 之禅][3]》 就有了一角残缺。 + +### 简单胜过复杂Simple is better than complex + +尚有选择余地时,应该选简单的方案。Python 少有*不可为*之事,这意味着设计出巴洛克风格(LCTT 译注:即夸张和不理性)的程序只为解决浅显的问题不仅有可能,甚至很简单。 + +正因如此,编程时应当谨记,代码的简单性是最易丢失,却最难复得的。 + +这意味着,在可以选用函数来表达时不要去引入额外的类;避免使用强力的第三方库往往有助于你针对迫切的问题场景设计更妥当的简短函数。不过其根本的意图,旨在让你减少对将来的盘算,而去着重解决手头的问题。 + +以简单和优美作为指导原则的代码相比那些想要囊括将来一切变数的,在日后要容易修改得多。 + +### 复杂胜过错综复杂Complex is better than complicated + +把握用词的精确含义对于理解这条令人费解的原则是至关重要的。形容某事复杂complex,是说它由许多部分组成,着重组成成分之多;而形容某事错综复杂complicated,则是指其包含着差异巨大、难以预料的行为,强调的是各组成部分之间的杂乱联系。 + +解决困难问题时,往往没有可行的简单方案。此时,最 Python 化的策略是“自底向上bottom-up”地构建出简单的工具,之后将其组合用以解决该问题。 + +这正是对象组合object composition这类技术的闪耀之处,它避免了错综复杂的继承体系,转而由独立的对象把一些方法调用传递给别的独立对象。这些对象都能独立地测试与部署,最终却可以组成一体。 + +“自底建造” 的另一例即是[单分派泛函数][4]singledispatch的使用,抛弃了错综复杂的对象之后,我们得到是简单、几乎无行为的对象以及独立的行为。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/zen-python-simplicity-complexity + +作者:[Moshe Zadka][a] +选题:[lujun9972][b] +译者:[caiichenr](https://github.com/caiichenr) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[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://en.wikipedia.org/wiki/Wind,_Sand_and_Stars +[3]: https://www.python.org/dev/peps/pep-0020/ +[4]: https://opensource.com/article/19/5/python-singledispatch diff --git a/published/20191226 10 Linux command tutorials for beginners and experts.md b/published/20191226 10 Linux command tutorials for beginners and experts.md new file mode 100644 index 0000000000..b9d216695c --- /dev/null +++ b/published/20191226 10 Linux command tutorials for beginners and experts.md @@ -0,0 +1,87 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12011-1.html) +[#]: subject: (10 Linux command tutorials for beginners and experts) +[#]: via: (https://opensource.com/article/19/12/linux-commands) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +10 篇对初学者和专家都有用的 Linux 命令教程 +====== + +> 在这有关 Linux 命令的十大文章中,了解如何使 Linux 发挥所需的作用。 + +![](https://img.linux.net.cn/data/attachment/album/202003/19/095932xc64xw7cwqlolale.jpg) + +**很好地**使用 Linux 意味着了解有哪些命令以及它们可以为你执行的功能。 + +### 《在 Linux 命令行下使用“原力”》 + +原力force有光明的一面和黑暗的一面。正确理解这个对于真正掌握它至关重要。Alan Formy-Duval 在他的文章《[在 Linux 命令行下使用“原力”][2]》中,解释了一些流行的、有时是危险的命令的 `-f` 选项(也称为 `--force`)。 + +### 《Linux useradd 命令介绍》 + +共享帐户是一个坏主意。相反,请使用典型的 `useradd` 命令为不同的人(甚至是不同的角色)分配单独的帐户。作为其经典的 Linux 管理基础系列的一部分,Alan Formy-Duval 提供了《[Linux useradd 命令介绍][3]》,并且像往常一样,他用**朴实明白的语言**对其进行了解释,以便新老管理员都可以理解。 + +### 《用 Linux 命令显示硬件信息》 + +机器**里面**是什么?有时不使用螺丝刀检查硬件很有用。无论是你正在使用的计算机,还是在商店购买前进行测试的计算机、或者是正在尝试维修的计算机,在《[用 Linux 命令显示硬件信息][4]》中,Howard Fosdick 提供了或流行或晦涩难懂的命令,以帮助你深入了解计算机的硬件信息。 + +### 《如何在 Linux 上使用 gocryptfs 加密文件》 + +从社会保险号到个人信件再到亲人,我们的文件中包含了许多私人数据。在《[如何在 Linux 上使用 gocryptfs 加密文件][5]》中,Brian "Bex" Exelbierd 解释了如何保持**隐私*的私密性。此外,他展示了一种加密文件的方式,这种方式对你现有的工作流程几乎没有影响。这不是复杂的 PGP 风格的密钥管理和后台密钥代理的难题,这是快速、无缝和安全的文件加密。 + +### 《如何使用 rsync 的高级用法进行大型备份》 + +在新的一年中,许多人会下定决心要更加努力地进行备份。Alan Formy-Duval 早在几年前就已经做出了解决方案,因为在《[如何使用 rsync 的高级用法进行大型备份][6]》中,他表现出对文件同步命令的极其熟悉。你可能不会马上记住所有语法,但其思路是读取和处理选项、构造备份命令,然后使其自动化。这是使用 `rsync` 的明智方法,也是可靠地执行备份的**唯一**方法。 + +### 《在 Linux 命令行使用 more 查看文本文件》 + +在 Scott Nesbitt 的文章《[在 Linux 命令行使用 more 查看文本文件][7]》中,古老而良好的默认分页器 `more` 引起了人们的关注。许多人安装和使用 `less`,因为它比 `more` 更灵活。但是,随着越来越多的系统在新出现的容器中实现,有时甚至不存在像 `less` 或 `most` 之类的新颖的豪华工具。了解和使用`more` 很简单,这是常见的默认设置,并且是生产系统最后的调试工具。 + +### 《关于 sudo 你可能不知道的》 + +`sudo` 命令因其过失而闻名。人们知道 `sudo` 一词,我们大多数人认为我们知道它的作用。我们的观点是正确的,但是正如 Peter Czanik 在他的文章《[关于 sudo 你可能不知道的][8]》中所揭示的那样,该命令所包含的不仅仅是“西蒙说的Simon says”(LCTT 译注:国外的一个儿童游戏)。就像这个经典的童年游戏一样,`sudo` 命令功能强大,也容易犯愚蠢的错误 —— 有更多的可能产生可怕都后果,而这是你绝不想遇上的事情! + +### 《怎样用 Bash 编程:语法和工具》 + +如果你是 Linux、BSD 或 Mac(以及近来的 Windows)用户,你也许使用过交互式 Bash shell。它是快速的、一次性命令的绝佳 shell,这就是为什么这么多 Linux 用户喜欢将其用作主要用户界面的原因。但是,Bash 不仅仅是个命令提示符。它也是一种编程语言,如果你已经在使用 Bash 命令,那么自动化的道路从未如此简单过。在 David Both 的出色作品《[怎样用 Bash 编程:语法和工具][9]》中对其进行全面了解。 + +### 《精通 Linux 的 ls 命令》 + +`ls` 命令是那些两个字母的命令之一。单字母命令是针对慢速终端的优化,因为慢速终端的输入的每个字母都会导致明显的延迟,而这对于懒惰的打字员来说也是不错的奖励。一如既往地,Seth Kenlon 清晰实用地解释了你可以怎样《[精通 Linux 的 ls 命令][10]》。最重要的是,在“一切都是文件”的系统中,列出文件至关重要。 + +### 《Linux cat 命令入门》 + +`cat` 命令(con*cat*enate 的缩写)看似简单。无论是使用它来快速查看文件的内容还是将内容通过管道传输到另一个命令,你都可能没有充分利用 `cat` 的功能。Alan Formy-Duval 的《[Linux cat 命令入门][11]》提供了一些新思路,可以使你没有打开文件的感觉就可以看到文件内容。另外,了解各种有关 `zcat` 的知识,这样你就可以无需解压缩就可以得到压缩文件的内容!这是一件小而简单的事情,但是**这**是使 Linux 很棒的原因。 + +### 继续旅程 + +不要让这些关于 Linux 命令的 10 篇最佳文章成为你的旅程终点。关于 Linux 及其多才多艺的提示符,还有更多值得去发现,因此,请继续关注以获取更多知识。而且,如果你想让我们介绍一个 Linux 命令,请在评论中告诉我们。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/linux-commands + +作者:[Moshe Zadka][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/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/car-penguin-drive-linux-yellow.png?itok=twWGlYAc (Penguin driving a car with a yellow background) +[2]: https://linux.cn/article-10881-1.html +[3]: https://linux.cn/article-11756-1.html +[4]: https://linux.cn/article-11422-1.html +[5]: https://opensource.com/article/19/8/how-encrypt-files-gocryptfs +[6]: https://linux.cn/article-10865-1.html +[7]: https://linux.cn/article-10531-1.html +[8]: https://linux.cn/article-11595-1.html +[9]: https://linux.cn/article-11552-1.html +[10]: https://linux.cn/article-11159-1.html +[11]: https://opensource.com/article/19/2/getting-started-cat-command +[12]: https://opensource.com/how-submit-article diff --git a/sources/tech/20200113 How to setup a DNS server with bind.md b/published/20200113 How to setup a DNS server with bind.md similarity index 56% rename from sources/tech/20200113 How to setup a DNS server with bind.md rename to published/20200113 How to setup a DNS server with bind.md index 897dc825a8..356ea4bf8c 100644 --- a/sources/tech/20200113 How to setup a DNS server with bind.md +++ b/published/20200113 How to setup a DNS server with bind.md @@ -1,103 +1,103 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11997-1.html) [#]: subject: (How to setup a DNS server with bind) [#]: via: (https://fedoramagazine.org/how-to-setup-a-dns-server-with-bind/) [#]: author: (Curt Warfield https://fedoramagazine.org/author/rcurtiswarfield/) -How to setup a DNS server with bind +简明指南:使用 bind 设置 DNS 服务器 ====== ![][1] -The Domain Name System, or DNS, as it’s more commonly known, translates or converts domain names into the IP addresses associated with that domain. DNS is the reason you are able to find your favorite website by name instead of typing an IP address into your browser. This guide shows you how to configure a Master DNS system and one client. +域名系统Domain Name System,我们更通常称为 DNS 的系统,可以将域名翻译或转换为与该域关联的 IP 地址。DNS 是能够让你通过名称找到自己喜欢的网站而不是在浏览器中输入 IP 地址的原因。本指南将向你展示如何配置一个主 DNS 系统以及客户端。 -Here are system details for the example used in this article: +以下是本文示例中使用的系统细节: ``` -dns01.fedora.local (192.168.1.160 ) - Master DNS server -client.fedora.local (192.168.1.136 ) - Client +dns01.fedora.local (192.168.1.160)- 主 DNS 服务器 +client.fedora.local (192.168.1.136)- 客户端 ``` -### DNS server configuration +### DNS 服务器配置 -Install the bind packages using sudo: +使用 `sudo` 安装 bind 包: ``` $ sudo dnf install bind bind-utils -y ``` -The _/etc/named.conf_ configuration file is provided by the _bind_ package to allow you to configure the DNS server. +bind 包提供了 `/etc/named.conf` 配置文件,来供你配置 DNS 服务器。 -Edit the _/etc/named.conf_ file: +编辑 `/etc/named.conf` 文件: ``` sudo vi /etc/named.conf ``` -Look for the following line: +查找以下行: ``` listen-on port 53 { 127.0.0.1; }; ``` -Add the IP address of your Master DNS server as follows: +添加主 DNS 服务器的 IP 地址,如下所示: ``` listen-on port 53 { 127.0.0.1; 192.168.1.160; }; ``` -Look for the next line: +查找以下行: ``` allow-query { localhost; }; ``` -Add your local network range. The example system uses IP addresses in the 192.168.1.X range. This is specified as follows: +添加本地网络范围。该示例系统使用的 IP 地址在 192.168.1.X 的范围内。指定如下: ``` allow-query { localhost; 192.168.1.0/24; }; ``` -Specify a forward and reverse zone. Zone files are simply text files that have the DNS information, such as IP addresses and host-names, on your system. The forward zone file makes it possible for the translation of a host-name to its IP address. The reverse zone file does the opposite. It allows a remote system to translate an IP address to the host name. +指定转发和反向区域。区域文件Zone file就是具有系统上 DNS 信息(例如 IP 地址和主机名)的文本文件。转发区域文件forward zone file使得将主机名转换为 IP 地址成为可能。反向区域文件reverse zone file则相反。它允许远程系统将 IP 地址转换为主机名。 -Look for the following line at the bottom of the /etc/named.conf file: +在 `/etc/named.conf` 文件的底部查找以下行: ``` include "/etc/named.rfc1912.zones"; ``` -Here, you’ll specify the zone file information _**directly above that line**_ as follows: +在此处,你将在**该行的正上方**指定区域文件信息,如下所示: ``` zone "dns01.fedora.local" IN { -type master; -file "forward.fedora.local"; -allow-update { none; }; + type master; + file "forward.fedora.local"; + allow-update { none; }; }; zone "1.168.192.in-addr.arpa" IN { -type master; -file "reverse.fedora.local"; -allow-update { none; }; + type master; + file "reverse.fedora.local"; + allow-update { none; }; }; ``` -The _forward.fedora.local_ and the file _reverse.fedora.local_ are just the names of the zone files you will be creating. They can be called anything you like. +`forward.fedora.local` 和 `reverse.fedora.local` 文件是要创建的区域文件的名称。它们可以是任意名字。 -Save and exit. +保存并退出。 -#### Create the zone files +#### 创建区域文件 -Create the forward and reverse zone files you specified in the /etc/named.conf file: +创建你在 `/etc/named.conf` 文件中指定的转发和反向区域文件: ``` $ sudo vi /var/named/forward.fedora.local ``` -Add the following lines: +添加以下行: ``` $TTL 86400 @@ -114,13 +114,13 @@ dns01 IN A 192.168.1.160 client IN A 192.168.1.136 ``` -Everything in _**bold**_ is specific to your environment. Save the file and exit. Next, edit the _reverse.fedora.local_ file: +所有**粗体**(LCTT 译注:本译文中无法呈现粗体)内容都特定于你的环境。保存文件并退出。接下来,编辑 `reverse.fedora.local` 文件: ``` $ sudo vi /var/named/reverse.fedora.local ``` -Add the following lines: +添加以下行: ``` $TTL 86400 @@ -139,9 +139,9 @@ client IN A 192.168.1.136 136 IN PTR client.fedora.local. ``` -Everything in _**bold**_ is also specific to your environment. Save the file and exit. +所有**粗体**(LCTT 译注:本译文中无法呈现粗体)内容都特定于你的环境。保存文件并退出。 -You’ll also need to configure SELinux and add the correct ownership for the configuration files. +你还需要配置 SELinux 并为配置文件添加正确的所有权。 ``` sudo chgrp named -R /var/named @@ -150,22 +150,22 @@ sudo restorecon -rv /var/named sudo restorecon /etc/named.conf ``` -Configure the firewall: +配置防火墙: ``` sudo firewall-cmd --add-service=dns --perm sudo firewall-cmd --reload ``` -#### Check the configuration for any syntax errors +#### 检查配置是否存在语法错误 ``` sudo named-checkconf /etc/named.conf ``` -Your configuration is valid if no output or errors are returned. +如果没有输出或返回错误,那么你的配置有效。 -Check the forward and reverse zone files. +检查转发和反向区域文件。 ``` $ sudo named-checkzone forward.fedora.local /var/named/forward.fedora.local @@ -173,7 +173,7 @@ $ sudo named-checkzone forward.fedora.local /var/named/forward.fedora.local $ sudo named-checkzone reverse.fedora.local /var/named/reverse.fedora.local ``` -You should see a response of OK: +你应该看到 “OK” 的响应: ``` zone forward.fedora.local/IN: loaded serial 2011071001 @@ -183,50 +183,50 @@ zone reverse.fedora.local/IN: loaded serial 2011071001 OK ``` -#### Enable and start the DNS service +#### 启用并启动 DNS 服务 ``` $ sudo systemctl enable named $ sudo systemctl start named ``` -#### Configuring the resolv.conf file +#### 配置 resolv.conf 文件 -Edit the _/etc/resolv.conf_ file: +编辑 `/etc/resolv.conf` 文件: ``` $ sudo vi /etc/resolv.conf ``` -Look for your current name server line or lines. On the example system, a cable modem/router is serving as the name server and so it currently looks like this: +查找你当前的 `nameserver` 行。在示例系统上,使用调制解调器/路由器充当名称服务器,因此当前看起来像这样: ``` nameserver 192.168.1.1 ``` -This needs to be changed to the IP address of the Master DNS server: +这需要更改为主 DNS 服务器的 IP 地址: ``` nameserver 192.168.1.160 ``` -Save your changes and exit. +保存更改并退出。 -Unfortunately there is one caveat to be aware of. NetworkManager overwrites the _/etc/resolv.conf_ file if the system is rebooted or networking gets restarted. This means you will lose all of the changes that you made. +不幸的是需要注意一点。如果系统重启或网络重启,那么 NetworkManager 会覆盖 `/etc/resolv.conf` 文件。这意味着你将丢失所做的所有更改。 -To prevent this from happening, make _/etc/resolv.conf_ immutable: +为了防止这种情况发生,请将 `/etc/resolv.conf` 设为不可变: ``` $ sudo chattr +i /etc/resolv.conf ``` -If you want to set it back and allow it to be overwritten again: +如果要重新设置,就需要允许其再次被覆盖: ``` $ sudo chattr -i /etc/resolv.conf ``` -#### Testing the DNS server +#### 测试 DNS 服务器 ``` $ dig fedoramagazine.org @@ -266,27 +266,27 @@ $ dig fedoramagazine.org ;; MSG SIZE rcvd: 266 ``` -There are a few things to look at to verify that the DNS server is working correctly. Obviously getting the results back are important, but that by itself doesn’t mean the DNS server is actually doing the work. +需要检查几件事以验证 DNS 服务器是否正常运行。显然,取得结果很重要,但这本身并不意味着 DNS 服务器实际上正常工作。 -The QUERY, ANSWER, and AUTHORITY fields at the top should show non-zero as it in does in our example: +顶部的 `QUERY`、`ANSWER` 和 `AUTHORITY` 字段应显示为非零,如我们的示例所示: ``` ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 6 ``` -And the SERVER field should have the IP address of your DNS server: +并且 `SERVER` 字段应有你的 DNS 服务器的 IP 地址: ``` ;; SERVER: 192.168.1.160#53(192.168.1.160) ``` -In case this is the first time you’ve run the _dig_ command, notice how it took 830 milliseconds for the query to complete: +如果这是你第一次运行 `dig` 命令,请注意完成查询要花费 830 毫秒的时间: ``` ;; Query time: 830 msec ``` -If you run it again, the query will run much quicker: +如果再次运行它,查询将会更快: ``` $ dig fedoramagazine.org @@ -297,37 +297,37 @@ $ dig fedoramagazine.org ;; SERVER: 192.168.1.160#53(192.168.1.160) ``` -### Client configuration +### 客户端配置 -The client configuration will be a lot simpler. +客户端配置将简单得多。 -Install the bind utilities: +安装 bind 程序: ``` $ sudo dnf install bind-utils -y ``` -Edit the /etc/resolv.conf file and configure the Master DNS as the only name server: +编辑 `/etc/resolv.conf` 文件,并将主 DNS 配置为唯一的名称服务器: ``` $ sudo vi /etc/resolv.conf ``` -This is how it should look: +它看起来像这样: ``` nameserver 192.168.1.160 ``` -Save your changes and exit. Then, make the _/etc/resolv.conf_ file immutable to prevent it from be overwritten and going back to its default settings: +保存更改并退出。然后,使 `/etc/resolv.conf` 文件不可变,防止其被覆盖并变回默认设置: ``` $ sudo chattr +i /etc/resolv.conf ``` -#### Testing the client +#### 测试客户端 -You should get the same results as you did from the DNS server: +你应该获得与 DNS 服务器相同的结果: ``` $ dig fedoramagazine.org @@ -367,9 +367,9 @@ $ dig fedoramagazine.org ;; MSG SIZE rcvd: 266 ``` -Make sure the SERVER output has the IP Address of your DNS server. +确保 `SERVER` 输出的是你 DNS 服务器的 IP 地址。 -Your DNS server is now ready to use and all requests from the client should be going through your DNS server now! +你的 DNS 服务器设置完成了,现在所有来自客户端的请求都会经过你的 DNS 服务器了! -------------------------------------------------------------------------------- @@ -377,8 +377,8 @@ via: https://fedoramagazine.org/how-to-setup-a-dns-server-with-bind/ 作者:[Curt Warfield][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/published/20200123 6 things you should be doing with Emacs.md b/published/20200123 6 things you should be doing with Emacs.md new file mode 100644 index 0000000000..27dfd5bb49 --- /dev/null +++ b/published/20200123 6 things you should be doing with Emacs.md @@ -0,0 +1,142 @@ +[#]: collector: (lujun9972) +[#]: translator: (lujun9972) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12004-1.html) +[#]: subject: (6 things you should be doing with Emacs) +[#]: via: (https://opensource.com/article/20/1/emacs-cheat-sheet) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +6 件你应该用 Emacs 做的事 +====== + +> 下面六件事情你可能都没有意识到可以在 Emacs 下完成。此外还有我们的新备忘单,拿去,充分利用 Emacs 的功能吧。 + +![](https://img.linux.net.cn/data/attachment/album/202003/17/133738wjj66p2safcpc50z.jpg) + +想象一下使用 Python 的 IDLE 界面来编辑文本。你可以将文件加载到内存中,编辑它们,并保存更改。但是你执行的每个操作都由 Python 函数定义。例如,调用 `upper()` 来让一个单词全部大写,调用 `open` 打开文件,等等。文本文档中的所有内容都是 Python 对象,可以进行相应的操作。从用户的角度来看,这与其他文本编辑器的体验一致。对于 Python 开发人员来说,这是一个丰富的 Python 环境,只需在配置文件中添加几个自定义函数就可以对其进行更改和开发。 + +这就是 [Emacs][2] 对 1958 年的编程语言 [Lisp][3] 所做的事情。在 Emacs 中,运行应用程序的 Lisp 引擎与输入文本之间无缝结合。对 Emacs 来说,一切都是 Lisp 数据,因此一切都可以通过编程进行分析和操作。 + +这造就了一个强大的用户界面(UI)。但是,如果你是 Emacs 的普通用户,你可能对它的能力知之甚少。下面是你可能没有意识到 Emacs 可以做的六件事。 + +### 使用 Tramp 模式进行云端编辑 + +Emacs 早在网络流行化之前就实现了透明的网络编辑能力了,而且时至今日,它仍然提供了最流畅的远程编辑体验。Emacs 中的 [Tramp 模式][4](以前称为 RPC 模式)代表着 “透明的远程(文件)访问,多协议Transparent Remote (file) Access,Multiple Protocol”,这准确说明了它提供的功能:通过最流行的网络协议轻松访问你希望编辑的远程文件。目前最流行、最安全的能用于远程编辑的协议是 [OpenSSH][5],因此 Tramp 使用它作为默认的协议。 + +在 Emacs 22.1 或更高版本中已经包含了 Tramp,因此要使用 Tramp,只需使用 Tramp 语法打开一个文件。在 Emacs 的 “File” 菜单中,选择 “Open File”。当在 Emacs 窗口底部的小缓冲区中出现提示时,使用以下语法输入文件名: + +``` +/ssh:user@example.com:/path/to/file +``` + +如果需要交互式登录,Tramp 会提示你输入密码。但是,Tramp 直接使用 OpenSSH,所以为了避免交互提示,你可以将主机名、用户名和 SSH 密钥路径添加到你的 `~/.ssh/config` 文件。与 Git 一样,Emacs 首先使用你的 SSH 配置,只有在出现错误时才会停下来询问更多信息。 + +Tramp 非常适合编辑并没有放在你的计算机上的文件,它的用户体验与编辑本地文件没有明显的区别。下次,当你 SSH 到服务器启动 Vim 或 Emacs 会话时,请尝试使用 Tramp。 + +### 日历 + +如果你喜欢文本多过图形界面,那么你一定会很高兴地知道,可以使用 Emacs 以纯文本的方式安排你的日程(或生活),而且你依然可以在移动设备上使用开源的 [Org 模式][6]查看器来获得华丽的通知。 + +这个过程需要一些配置,以创建一个方便的方式来与移动设备同步你的日程(我使用 Git,但你可以调用蓝牙、KDE Connect、Nextcloud,或其他文件同步工具),此外你必须在移动设备上安装一个 Org 模式查看器(如 [Orgzly][7])以及 Git 客户程序。但是,一旦你搭建好了这些基础,该流程就会与你常用的(或正在完善的,如果你是新用户)Emacs 工作流完美地集成在一起。你可以在 Emacs 中方便地查阅日程、更新日程,并专注于任务上。议程上的变化将会反映在移动设备上,因此即使在 Emacs 不可用的时候,你也可以保持井然有序。 + +![][8] + +感兴趣了?阅读我的关于[使用 Org mode 和 Git 进行日程安排][9]的逐步指南。 + +### 访问终端 + +有[许多终端模拟器][10]可用。尽管 Emacs 中的 Elisp 终端仿真器不是最强大的通用仿真器,但是它有两个显著的优点: + +1. **打开在 Emacs 缓冲区之中**:我使用 Emacs 的 Elisp shell,因为它在 Emacs 窗口中打开很方便,我经常全屏运行该窗口。这是一个小而重要的优势,只需要输入 `Ctrl+x+o`(或用 Emacs 符号来表示就是 `C-x o`)就能使用终端了,而且它还有一个特别好的地方在于当运行漫长的作业时能够一瞥它的状态报告。 +2. **在没有系统剪贴板的情况下复制和粘贴特别方便**:无论是因为懒惰不愿将手从键盘移动到鼠标,还是因为在远程控制台运行 Emacs 而无法使用鼠标,在 Emacs 中运行终端有时意味着可以从 Emacs 缓冲区中很快地传输数据到 Bash。 + +要尝试 Emacs 终端,输入 `Alt+x`(用 Emacs 符号表示就是 `M-x`),然后输入 `shell`,然后按回车。 + +### 使用 Racket 模式 + +[Racket][11] 是一种激动人心的新兴 Lisp 方言,拥有动态编程环境、GUI 工具包和充满激情的社区。学习 Racket 的默认编辑器是 DrRacket,它的顶部是定义面板,底部是交互面板。使用该设置,用户可以编写影响 Racket 运行时环境的定义。就像旧的 [Logo Turtle][12] 程序,但是有一个终端而不是仅仅一个海龟。 + +![Racket-mode][13] + +*由 PLT 提供的 LGPL 示例代码* + +基于 Lisp 的 Emacs 为资深 Racket 编程人员提供了一个很好的集成开发环境(IDE)。它尚未附带 [Racket 模式][14],但你可以使用 Emacs 包安装程序安装 Racket 模式和辅助扩展。要安装它,按下 `Alt+X`(用 Emacs 符号表示就是 `M-x`),键入 `package-install`,然后按回车。接着输入要安装的包 `racet-mode`,按回车。 + +使用 `M-x racket-mode` 进入 Racket 模式。如果你是 Racket 新手,而对 Lisp 或 Emacs 比较熟悉,可以从这份优秀的[图解 Racket][15] 入手。 + +## 脚本 + +你可能知道,Bash 脚本在自动化和增强 Linux 或 Unix 体验方面很流行。你可能听说过 Python 在这方面也做得很好。但是你知道 Lisp 脚本可以用同样的方式运行吗?有时人们会对 Lisp 到底有多有用感到困惑,因为许多人是通过 Emacs 来了解 Lisp 的,因此有一种潜在的印象,即在 21 世纪运行 Lisp 的惟一方法是在 Emacs 中运行。幸运的是,事实并非如此,Emacs 是一个很好的 IDE,它支持将 Lisp 脚本作为一般的系统可执行文件来运行。 + +除了 Elisp 之外,还有两种流行的现代 Lisp 可以很容易地用来作为独立脚本运行。 + +1. **Racket**:你可以通过在系统上运行 Racket 来提供运行 Racket 脚本所需的运行时支持,或者你可以使用 `raco exe` 产生一个可执行文件。`raco exe` 命令将代码和运行时支持文件一起打包,以创建可执行文件。然后,`raco distribution` 命令将可执行文件打包成可以在其他机器上工作的发行版。Emacs 有许多 Racket 工具,因此在 Emacs 中创建 Racket 文件既简单又有效。 +2. **GNU Guile**:[GNU Guile][16](GNU 通用智能语言扩展GNU Ubiquitous Intelligent Language for Extensions 的缩写)是 [Scheme][17] 编程语言的一个实现,它可以用于为桌面、互联网、终端等创建应用程序和游戏。Emacs 中的 Scheme 扩展众多,使用任何一个扩展来编写 Scheme 都很容易。例如,这里有一个用 Guile 编写的 “Hello world” 脚本: + +``` +#!/usr/bin/guile -s +!# + +(display "hello world") + (newline) +``` + +用 `guile` 编译并允许它: + +``` +$ guile ./hello.scheme +;;; compiling /home/seth/./hello.scheme +;;; compiled [...]/hello.scheme.go +hello world +$ guile ./hello.scheme +hello world +``` + +### 无需 Emacs 允许 Elisp + +Emacs 可以作为 Elisp 的运行环境,但是你无需按照传统印象中的必须打开 Emacs 来运行 Elisp。`--script` 选项可以让你使用 Emacs 作为引擎来执行 Elisp 脚本,而无需运行 Emacs 图形界面(甚至也无需使用终端)。下面这个例子中,`-Q` 选项让 Emacs 忽略 `.emacs` 文件,从而避免由于执行 Elisp 脚本时产生延迟(若你的脚本依赖于 Emacs 配置中的内容,那么请忽略该选项)。 + +``` +emacs -Q --script ~/path/to/script.el +``` + +### 下载 Emacs 备忘录 + +Emacs 许多重要功能都不是只能通过 Emacs 来实现的;Org 模式是 Emacs 扩展也是一种格式标准,流行的 Lisp 方言大多不依赖于具体的应用,我们甚至可以在没有可见或可交互式 Emacs 实例的情况下编写和运行 Elisp。然后若你对为什么模糊代码和数据之间的界限能够引发创新和效率感到好奇的话,那么 Emacs 是一个很棒的工具。 + +幸运的是,现在是 21 世纪,Emacs 有了带有传统菜单的图形界面以及大量的文档,因此学习曲线不再像以前那样。然而,要最大化 Emacs 对你的好处,你需要学习它的快捷键。由于 Emacs 支持的每个任务都是一个 Elisp 函数,Emacs 中的任何功能都可以对应一个快捷键,因此要描述所有这些快捷键是不可能完成的任务。你只要学习使用频率 10 倍于不常用功能的那些快捷键即可。 + +我们汇聚了最常用的 Emacs 快捷键成为一份 Emacs 备忘录以便你查询。将它挂在屏幕附近或办公室墙上,把它作为鼠标垫也行。让它触手可及经常翻阅一下。每次翻两下可以让你获得十倍的学习效率。而且一旦开始编写自己的函数,你一定不会后悔获取了这个免费的备忘录副本的! + +- [这里下载 Emacs 备忘录(需注册)](https://opensource.com/downloads/emacs-cheat-sheet) + +-------------------------------------------------------------------------------- +via: https://opensource.com/article/20/1/emacs-cheat-sheet + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[lujun9972](https://github.com/lujun9972) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_blue_text_editor_web.png +[2]: https://www.gnu.org/software/emacs/ +[3]: https://en.wikipedia.org/wiki/Lisp_(programming_language) +[4]: https://www.gnu.org/software/tramp/ +[5]: https://www.openssh.com/ +[6]: https://orgmode.org/ +[7]: https://f-droid.org/en/packages/com.orgzly/ +[8]: https://opensource.com/sites/default/files/uploads/orgzly-agenda.jpg +[9]: https://linux.cn/article-11320-1.html +[10]: https://linux.cn/article-11814-1.html +[11]: http://racket-lang.org/ +[12]: https://en.wikipedia.org/wiki/Logo_(programming_language)#Turtle_and_graphics +[13]: https://opensource.com/sites/default/files/racket-mode.jpg +[14]: https://www.racket-mode.com/ +[15]: https://docs.racket-lang.org/quick/index.html +[16]: https://www.gnu.org/software/guile/ +[17]: https://en.wikipedia.org/wiki/Scheme_(programming_language) diff --git a/published/20200204 DevOps vs Agile- What-s the difference.md b/published/20200204 DevOps vs Agile- What-s the difference.md new file mode 100644 index 0000000000..e221cbc775 --- /dev/null +++ b/published/20200204 DevOps vs Agile- What-s the difference.md @@ -0,0 +1,160 @@ +[#]: collector: "lujun9972" +[#]: translator: "messon007" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-12031-1.html" +[#]: subject: "DevOps vs Agile: What's the difference?" +[#]: via: "https://opensource.com/article/20/2/devops-vs-agile" +[#]: author: "Taz Brown https://opensource.com/users/heronthecli" + +DevOps 和敏捷:究竟有什么区别? +====== + +> 两者之间的区别在于开发完毕之后发生的事情。 + +![](https://img.linux.net.cn/data/attachment/album/202003/23/200609w2rlzrjjhpf2hzsq.jpg) + +早期,软件开发并没有特定的管理流程。随后出现了[瀑布开发流程][2]Waterfall,它提出软件开发活动可以用开发和构建应用所耗费的时间来定义。 + +那时候,由于在开发流程中没有审查环节和权衡考虑,常常需要花费很长的时间来开发、测试和部署软件。交付的软件也是带有缺陷和 Bug 的质量较差的软件,而且交付时间也不满足要求。那时候软件项目管理的重点是长期而拖沓的计划。 + +瀑布流程与[三重约束模型][3]triple constraint model相关,三重约束模型也称为项目管理三角形project management triangle。三角形的每一个边代表项目管理三要素的一个要素: **范围、时间和成本**。正如 [Angelo Baretta 写到][4],三重约束模型“认为成本是时间和范围的函数,这三个约束以一种确定的、可预测的方式相互作用。……如果我们想缩短时间表(时间),就必须增加成本。如果我们想增加范围,就必须增加成本或时间。” + +### 从瀑布流程过渡到敏捷开发 + +瀑布流程来源于生产和工程领域,这些领域适合线性化的流程:正如房屋封顶之前需要先盖好支撑墙。相似地,软件开发问题被认为可以通过提前做好计划来解决。从头到尾,开发流程均由路线图清晰地定义,沿着路线图就可以得到最终交付的产品。 + +最终,瀑布模型被认为对软件开发是不利的而且违反人的直觉,因为通常直到开发流程的最后才能体现出项目的价值,这导致许多项目最终都以失败告终。而且,在项目结束前客户看不到任何可以工作的软件。 + +敏捷Agile采用了一种不同的方法,它抛弃了规划整个项目,承诺估计的时间点,简单的遵循计划。与瀑布流程相反,它假设和拥抱不确定性。它的理念是以响应变化代替讨论过去,它认为变更是客户需求的一部分。 + +### 敏捷价值观 + +敏捷由敏捷宣言Agile Manifesto代言,敏捷宣言定义了 [12 条原则][5](LCTT 译注:此处没有采用本文原本的简略句式,而是摘录了来自敏捷软件开发宣言官方的[中文译本][14]): + +1. 我们最重要的目标,是通过持续不断地及早交付有价值的软件使客户满意。 +2. 欣然面对需求变化,即使在开发后期也一样。 +3. 经常交付可工作的软件,相隔几星期或一两个月,倾向于采取较短的周期。 +4. 业务人员和开发人员必须相互合作,项目中的每一天都不例外。 +5. 激发个体的斗志,以他们为核心搭建项目。提供所需的环境和支援,辅以信任,从而达成目标。 +6. 面对面沟通是传递信息的最佳的也是效率最高的方法。 +7. 可工作的软件是进度的首要度量标准。 +8. 敏捷流程倡导可持续的开发,责任人、开发人员和用户要能够共同维持其步调稳定延续。 +9. 坚持不懈地追求技术卓越和良好设计,敏捷能力由此增强。 +10. 以简洁为本,它是极力减少不必要工作量的艺术。 +11. 最好的架构,需求和设计出自自组织团队 +12. 团队定期地反思如何能提高成效,并依此调整自身的举止表现。 + +敏捷的四个[核心价值观][6]是(LCTT 译注:[此处译文][15]同样来自敏捷软件开发宣言官方): + +* **个体和互动** 高于流程和工具 +* **工作的软件** 高于详尽的文档 +* **客户合作** 高于合同谈判 +* **响应变化** 高于遵循计划 + +这与瀑布流程死板的计划风格相反。在敏捷流程中,客户是开发团队的一员,而不仅仅是在项目开始时参与项目需求的定义,在项目结束时验收最终的产品。客户帮忙团队完成[验收标准][7],并在整个过程中保持投入。另外,敏捷需要整个组织的变化和持续的改进。开发团队和其他团队一起合作,包括项目管理团队和测试团队。做什么和计划什么时候做由指定的角色领导,并由整个团队同意。 + +### 敏捷软件开发 + +敏捷软件开发需要自适应的规划、演进式的开发和交付。许多软件开发方法、框架和实践遵从敏捷的理念,包括: + +* Scrum +* 看板Kanban(可视化工作流) +* 极限编程Xtreme Programming(XP) +* 精益方法Lean +* DevOps +* 特性驱动开发Feature-Driven Development(FDD) +* 测试驱动开发Test-Driven Development(TDD) +* 水晶方法Crystal +* 动态系统开发方法Dynamic Systems Development Method(DSDM) +* 自适应软件开发Adaptive Software Development(ASD) + +所有这些已经被单独用于或一起用于开发和部署软件。最常用的是 [Scrum][8]、看板(或 Scrumban)和 DevOps。 + +[Scrum][9] 是一个框架,采用该框架的团队通常由一个 Scrum 教练、产品经理和开发人员组成,该团队以跨职能、自主的工作方式运作,能够加快软件交付速度从而给客户带来巨大的商业价值。其关注点是[较小增量][10]的快速迭代。 + +[看板][11] 是一个敏捷框架,有时也叫工作流管理系统,它能帮助团队可视化他们的工作从而最大化效率(因而变得敏捷)。看板通常由数字或物理展示板来呈现。团队的工作在展示板上随着进度而移动,例如从未启动到进行中,一直到测试中、已完成。看板使得每个团队成员可以随时查看到所有工作的状态。 + +### DevOps 价值观 + +DevOps 是一种文化,是一种思维状态,是一种软件开发的方式或者基础设施的方式,也是一种构建和部署软件和应用的方式。它假设开发和运维之间没有隔阂,他们一起合作,没有矛盾。 + +DevOps 基于其它两个领域的实践: 精益和敏捷。DevOps 不是一个公司内的岗位或角色;它是一个组织或团队对持续交付、持续部署和持续集成的坚持不懈的追求。[Gene Kim][12](Phoenix 项目和 Unicorn 项目的作者)认为,有三种方式定义 DevOps 的理念: + +* 第一种: 流程原则 +* 第二种: 反馈原则 +* 第三种: 持续学习原则 + +### DevOps 软件开发 + +DevOps 不会凭空产生;它是一种灵活的实践,它的本质是一种关于软件开发和 IT 或基础设施实施的共享文化和思维方式。 + +当你想到自动化、云、微服务时,你会想到 DevOps。在一次[访谈][13]中,《加速构建和扩张高性能技术组织》的作者 Nicol Forsgren、Jez Humble 和 Gene Kim 这样解释到: + +> * 软件交付能力很重要,它极大地影响到组织的成果,例如利润、市场份额、质量、客户满意度以及组织战略目标的达成。 +> * 优秀的团队能达到很高的交付量、稳定性和质量;他们并没有为了获得这些属性而进行取舍。 +> * 你可以通过实施精益、敏捷和 DevOps 中的实践来提升能力。 +> * 实施这些实践和能力也会影响你的组织文化,并且会进一步对你的软件交付能力和组织能力产生有益的提升。 +> * 懂得怎样改进能力需要做很多工作。 + +### DevOps 和敏捷的对比 + +DevOps 和敏捷有相似性,但是它们不完全相同,一些人认为 DevOps 比敏捷更好。为了避免造成混淆,深入地了解它们是很重要的。 + +#### 相似之处 + +* 毫无疑问,两者都是软件开发技术。 +* 敏捷已经存在了 20 多年,DevOps 是最近才出现的。 +* 两者都追求软件的快速开发,它们的理念都基于怎样在不伤害客户或运维利益的情况下快速开发出软件。 + +#### 不同之处 + +* 两者的差异在于软件开发完成后发生的事情。 + * 在 DevOps 和敏捷中,都有软件开发、测试和部署的阶段。然而,敏捷流程在这三个阶段之后会终止。相反,DevOps 包括后续持续的运维。因此,DevOps 会持续的监控软件运行情况和进行持续的开发。 +* 敏捷中,不同的人负责软件的开发、测试和部署。而 DevOps 工程角色负责所有活动,开发即运维,运维即开发。 +* DevOps 更关注于削减成本,而敏捷则是精益和减少浪费的代名词,侧重于像敏捷项目会计和最小可行产品的概念。 +* 敏捷专注于并体现了经验主义(适应、透明和检查),而不是预测性措施。 + +敏捷 | DevOps +--- | --- +从客户得到反馈 | 从自己得到反馈 +较小的发布周期 | 较小的发布周期,立即反馈 +聚焦于速度 | 聚焦于速度和自动化 +对业务不是最好 | 对业务最好 + +### 总结 + +敏捷和 DevOps 是截然不同的,尽管它们的相似之处使人们认为它们是相同的。这对敏捷和 DevOps 都是一种伤害。 + +根据我作为一名敏捷专家的经验,我发现对于组织和团队从高层次上了解敏捷和 DevOps 是什么,以及它们如何帮助团队更高效地工作,更快地交付高质量产品从而提高客户满意度非常有价值。 + +敏捷和 DevOps 绝不是对抗性的(或至少没有这个意图)。在敏捷革命中,它们更像是盟友而不是敌人。敏捷和 DevOps 可以相互协作一致对外,因此可以在相同的场合共存。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/devops-vs-agile + +作者:[Taz Brown][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://opensource.com/users/heronthecli +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/collab-team-pair-programming-code-keyboard.png?itok=kBeRTFL1 "Pair programming" +[2]: http://www.agilenutshell.com/agile_vs_waterfall +[3]: https://en.wikipedia.org/wiki/Project_management_triangle +[4]: https://www.pmi.org/learning/library/triple-constraint-erroneous-useless-value-8024 +[5]: http://agilemanifesto.org/principles.html +[6]: https://agilemanifesto.org/ +[7]: https://www.productplan.com/glossary/acceptance-criteria/ +[8]: https://opensource.com/article/19/8/scrum-vs-kanban +[9]: https://www.scrum.org/ +[10]: https://www.scrum.org/resources/what-is-an-increment +[11]: https://www.atlassian.com/agile/kanban +[12]: https://itrevolution.com/the-unicorn-project/ +[13]: https://www.infoq.com/articles/book-review-accelerate/ +[14]: http://agilemanifesto.org/iso/zhchs/principles.html +[15]: http://agilemanifesto.org/iso/zhchs/manifesto.html diff --git a/published/20200211 Basic kubectl and Helm commands for beginners.md b/published/20200211 Basic kubectl and Helm commands for beginners.md new file mode 100644 index 0000000000..5cb41e2c38 --- /dev/null +++ b/published/20200211 Basic kubectl and Helm commands for beginners.md @@ -0,0 +1,198 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12007-1.html) +[#]: subject: (Basic kubectl and Helm commands for beginners) +[#]: via: (https://opensource.com/article/20/2/kubectl-helm-commands) +[#]: author: (Jessica Cherry https://opensource.com/users/jrepka) + +适用于初学者的基本 kubectl 和 Helm 命令 +====== + +> 去杂货店“采购”这些命令,你需要用这些 Kubernetes 工具来入门。 + +![](https://img.linux.net.cn/data/attachment/album/202003/18/113120adp34myy90eb944b.jpg) + +最近,我丈夫告诉我他即将要去参加一个工作面试,面试时他需要在计算机上运行一些基本命令。他对这场面试感到焦虑,但是对于他来说,学习和记住事情的最好方法是将不了解的事物比喻为非常熟悉的事物。因为我们的谈话是在我逛杂货店试图决定当晚要烹饪的食物之后进行的,所以这启发我用一次去杂货店的行程来介绍 `kubectl` 和 `helm` 命令。 + +[Helm][2](“舵轮”)是在 Kubernetes(来自希腊语,意思是“舵手” 或 “领航员”)中管理应用程序的工具。你可以轻松地使用你的应用程序信息来部署“海图chart”,从而可以在你的 Kubernetes 环境中几分钟之内让它们就绪并预配置好。在学习新知识时,查看示例的“海图”以了解其用法总是很有帮助的,因此,如果有时间,请查看这些成型的“[海图][3]”。(LCTT 译注:Kubernetes 生态中大量使用了和航海有关的比喻,因此本文在翻译时也采用了这些比喻) + +[kubectl][4] 是与 Kubernetes 环境交互的命令行界面,允许你配置和管理集群。它需要一些配置才能在环境中工作,因此请仔细阅读其[文档][5]以了解你需要做什么。 + +我会在示例中使用命名空间,你可以在我的文章《[Kubernetes 命名空间入门][6]》中了解它。 + +现在我们已经准备好了,让我们开始 `kubectl`和 `helm` 基本命令的购物之旅! + +### 用 Helm 列出清单 + +你去商店之前要做的第一件事是什么?好吧,如果你做事有条理,会创建一个“清单”。同样,这是我将解释的第一个基本的 Helm 命令。 + +在一个用 Helm 部署的应用程序中,`list` 命令提供有关应用程序当前版本的详细信息。在此示例中,我有一个已部署的应用程序:Jenkins CI/CD 应用程序。运行基本的 `list` 命令总是会显示默认的命名空间。由于我没有在默认的命名空间中部署任何内容,因此不会显示任何内容: + +``` +$helm list +NAME    NAMESPACE    REVISION    UPDATED    STATUS    CHART    APP VERSION +``` + +但是,如果运行带有额外标志的命令,则会显示我的应用程序和信息: + +``` +$helm list --all-namespaces +NAME     NAMESPACE  REVISION  UPDATED                   STATUS      CHART           APP  VERSION +jenkins  jenkins        1         2020-01-18 16:18:07 EST   deployed    jenkins-1.9.4   lts +``` + +最后,我可以指示 `list` 命令只检查我想从中获取信息的命名空间: + +``` +$helm list --namespace jenkins +NAME     NAMESPACE  REVISION  UPDATED                   STATUS    CHART          APP VERSION +jenkins    jenkins      1              2020-01-18 16:18:07 EST  deployed  jenkins-1.9.4  lts     +``` + +现在我有了一个清单,并且知道该清单上有什么,我可以使用 `get` 命令来“获取”我的物品!我会从 Kubernetes 集群开始,看看我能从中获取到什么? + +### 用 Kubectl 获取物品 + +`kubectl get` 命令提供了有关 Kubernetes 中许多事物的信息,包括“吊舱Pod”、节点和命名空间。同样,如果没有指定命名空间标志,就会使用默认的命名空间。首先,我获取集群中的命名空间以查看正在运行的命名空间: + +``` +$kubectl get namespaces +NAME             STATUS   AGE +default          Active   53m +jenkins          Active   44m +kube-node-lease  Active   53m +kube-public      Active   53m +kube-system      Active   53m +``` + +现在我已经知道了在我的环境中运行的有哪些命名空间了,接下来获取节点并查看有多少个节点正在运行: + +``` +$kubectl get nodes +NAME       STATUS   ROLES       AGE   VERSION +minikube   Ready    master  55m   v1.16.2 +``` + +我有一个节点正在运行,这主要是因为我的 Minikube 运行在一台小型服务器上。要得到在我的这一个节点上运行的“吊舱”可以这样: + +``` +$kubectl get pods +No resources found in default namespace. +``` + +啊哦,它是空的。我将通过以下方式获取 Jenkins 命名空间中的内容: + +``` +$kubectl get pods --namespace jenkins +NAME                      READY  STATUS   RESTARTS  AGE +jenkins-7fc688c874-mh7gv  1/1    Running  0         40m +``` + +好消息!这里发现了一个“吊舱”,它还没有重新启动过,已运行了 40 分钟了。好的,如今我知道“吊舱”已经装好,所以我想看看用 Helm 命令可以得到什么。 + +### 用 Helm 获取信息 + +`helm get` 命令稍微复杂一点,因为这个“获取”命令所需要的不仅仅是一个应用程序名称,而且你可以从应用程序中请求多个内容。我会从获取用于制作该应用程序的值开始,然后展示“获取全部”的操作结果的片段,该操作将提供与该应用程序相关的所有数据。 + +``` +$helm get values jenkins -n jenkins +USER-SUPPLIED VALUES: +null +``` + +由于我只安装了最小限度的稳定版,因此配置没有更改。如果我运行“获取全部”命令,我将得到所有的“海图”: + +``` +$helm get all jenkins -n jenkins +``` + +![output from helm get all command][7] + +这会产生大量数据,因此我始终建议保留一份 Helm “海图”的副本,以便你可以查看“海图”中的模板。我还创建自己的值来了解自己所拥有的。 + +现在,我把所有的商品都放在购物车中了,我会检查一下“描述”它们包含什么的标签。这些示例仅与 `kubectl` 命令有关,它们描述了我通过 Helm 部署的内容。 + +### 用 kubectl 查看描述 + +正如我使用“获取”命令(该命令可以描述 Kubernetes 中的几乎所有内容)所做的那样,我将示例限定到命名空间、“吊舱”和节点上。由于我知道它们每一个是什么,因此这很容易。 + +``` +$kubectl describe ns jenkins +Name:           jenkins +Labels:         <none> +Annotations:  <none> +Status:         Active +No resource quota. +No resource limits. +``` + +我可以看到我的命名空间的名称,并且它是活动的,没有资源或限额限制。 + +`describe pods` 命令会产生大量信息,因此我这里提供的是一小段输出。如果你在不使用“吊舱”名称的情况下运行该命令,它将返回名称空间中所有“吊舱”的信息,这可能会很麻烦。因此,请确保在此命令中始终包含“吊舱”名称。例如: + +``` +$kubectl describe pods jenkins-7fc688c874-mh7gv --namespace jenkins +``` + +![output of kubectl-describe-pods][8] + +这会提供容器的状态、管理方式、标签以及“吊舱”中所使用的镜像(还有很多其它信息)。没有在这个简化过的输出中包括的数据有:在 Helm 配置值文件中应用的各种条件下的资源请求和限制、初始化容器和存储卷信息。如果你的应用程序由于资源不足而崩溃,或者是一个需要运行前置脚本进行配置的初始配置容器,或者生成不应该存储于纯文本 YAML 文件中的隐藏密码,则此数据很有用。 + +最后,我将使用 `describe node` 命令,当然,它是用来描述节点的。由于本示例只有一个名为 Minikube 的示例,因此我将使用这个名字。如果你的环境中有多个节点,则必须包含你想查找的的节点名称。 + +与“吊舱”一样,这个节点的命令会产生大量数据,因此我将仅包括输出片段。 + +``` +$kubectl describe node minikube +``` + +![output of kubectl describe node][9] + +注意,`describe node` 是更重要的基本命令之一。如此图所示,该命令返回统计信息,该信息指示节点何时资源用尽,并且该数据非常适合在需要扩展时(如果你的环境中没有自动扩展)向你发出警报。此输出片段中未包含的其它内容包括:对所有资源和限制的请求所占的百分比,以及资源的使用期限和分配(例如,对于我的应用程序而言)。 + +### 买单 + +使用这些命令,我完成了“购物”并得到了我想要的一切。希望这些基本命令也能在你使用 Kubernetes 的日常工作中提供帮助。 + +我鼓励你经常使用命令行并学习“帮助”部分中的速记标志,你可以通过运行以下命令来查看这些标志: + +``` +$helm --help +``` + +或 + +``` +$kubectl -h +``` + +### 花生酱和果冻 + +有些东西像花生酱和果冻一样混在一起。Helm 和 `kubectl` 就有点像那样交错在一起。 + +我经常在自己的环境中使用这些工具。因为它们在很多地方都有很多相似之处,所以在使用其中一个之后,我通常需要跟进另一个。例如,我可以进行 Helm 部署,并使用 `kubectl` 观察它是否失败。一起试试它们,看看它们能为你做什么。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/kubectl-helm-commands + +作者:[Jessica Cherry][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/jrepka +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003784_02_os.comcareers_os_rh2x.png?itok=jbRfXinl (A person working.) +[2]: https://helm.sh/ +[3]: https://github.com/helm/charts/tree/master/stable +[4]: https://kubernetes.io/docs/reference/kubectl/kubectl/ +[5]: https://kubernetes.io/docs/reference/kubectl/overview/ +[6]: https://linux.cn/article-11749-1.html +[7]: https://opensource.com/sites/default/files/uploads/helm-get-all.png (output from helm get all command) +[8]: https://opensource.com/sites/default/files/uploads/kubectl-describe-pods.png (output of kubectl-describe-pods) +[9]: https://opensource.com/sites/default/files/uploads/kubectl-describe-node.png (output of kubectl describe node) diff --git a/published/20200214 Linux is our love language.md b/published/20200214 Linux is our love language.md new file mode 100644 index 0000000000..293568e366 --- /dev/null +++ b/published/20200214 Linux is our love language.md @@ -0,0 +1,80 @@ +[#]: collector: (lujun9972) +[#]: translator: (sndnvaps) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12022-1.html) +[#]: subject: (Linux is our love language) +[#]: via: (https://opensource.com/article/20/2/linux-love-language) +[#]: author: (Christopher Cherry https://opensource.com/users/chcherry) + +学习 Linux 是我们的爱情语言 +====== + +> 当一个妻子教丈夫一些新技能的时候,他们都学到了比期待更多的东西。 + +![](https://img.linux.net.cn/data/attachment/album/202003/22/163819clzuy77dc4d7q8zu.jpg) + +2019 年是我们 Cherry 家学习的一年。我是一个喜欢学习新技术的高级软件工程师,并把学到的内容一起教给了我的丈夫 Chris。通过教给他一些我学到的东西,并让他全程经历我的技术演练文章,我帮助 Chris 学习到了新技术,使他能够将自己的职业生涯更深入地转向技术领域。而我学习到了新的方法,使我的演练和培训材料更易于让读者理解。 + +在这篇文章中,我们来讨论一下我们各自和彼此学习到了什么东西,然后探讨这对于我们的未来有何影响。 + +### 向学生的提问 + +**Jess:** Chris,是什么导致你想深入学习我的领域的技能呢? + +**Chris:** 主要目的是为了让我事业更进一步。作为一个网络工程师的经历告诉我,现在的网络专家已经不像以前一样有价值了,我必须掌握更多的知识。由于网络经常被认为是造成这些天程序中断或出错的原因,我想从开发人员的角度了解更多关于编写应用程序的知识,以便于了解它们如何依赖网络资源。 + +**Jess:** 我首先教你什么内容?你从中学到什么? + +**Chris:** 首先是从学习除此安装 Linux 系统开始的,之后又安装了 [Ansible][2]。只要硬件兼容,我用过的每一个 Linux 发行版都很容易安装,但可能会出现个别不兼容的情况。这就意味着我有时候第一手学习到的是如何解决系统安装过程的最初 5 分钟出现的问题了(这个我最喜欢了)。Ansible 给了一个我学习使用软件管理器来安装程序的理由。当程序安装完成后,通过查看 yum 安装的程序,我快速了解了程序管理器是如何处理程序的依赖项的,因此,用 Python 编写的 Ansible 能够在我的系统运行。自此之后,我开始使用 Ansible 来安装各种各样的程序。 + +**Jessica:** 你喜欢我这种教学方式不? + +**Chris:** 我们一开始有过争吵,直到我们弄清楚了我喜欢的学习方式,你也知道了应该怎样为我提供最好的学习方式。在一开始的时候,我很难跟上你讲的内容。例如,当你说“一个码头工人集装箱”的时候,我完全不知道你在讲什么。比较早的时候,我的回答就是“这是一个集装箱”,然而当时这对我来说,完全没有意义。当你对这些内容进行一些更深入的讲解后,才让学习更有趣。 + +**Jess:** 老实说,这对我来说也是一个重要的教训。在你之前,我从来没有教过在这个技术领域知识比我少的人,所以你帮助我认识到我需要解释更多细节。我也得说声谢谢。 + +当你通过这几个学习步骤的时候,你觉得我的这篇测试文章怎样呢? + +**Chris:** 就我个人而言,我认为这很容易,但我错了。在我主要学习的内容中,比如你[介绍的Vagrant][3],它在不同的 Linux 发行版间的变化比我想像的要多。操作系统的变化会影响设置的方式、运行都要求和特定的命令。这看起来比我用的网络设备变化更大。这让我花费更多的精力去查看这些说明是对应我的系统还是其它的系统(有时候很难知道)。在这学习路上,我似乎碰到很多问题。 + +**Jess:** 我每天都会遇到各种各样的问题,所以对我来说日常就是用各种方法解决各种问题。 + +### 向老师的提问 + +**Chris:** Jess,你将来教我的方式会有所改变吗? + +**Jess:** 我想让你像我一样读多一些书。通过翻阅书籍来学习新技术。每天起床后一小时和睡觉前一小时我都会看书,花费一个星期左右我就能看一到两本书。我也会创建为期两周的任务计划来实践我从书本中学习到的技能。这是除了我一天中第一个小时在喝大量咖啡时读到的科技文章之外的。当我考虑到你的职业发展目标的时候,我认为除了我们谈到的优秀博客文章和文章之外,书籍是一个重要的元素。我觉得我的阅读量使我保持进步,如果你也这么做了,你也会很快赶上我的。 + +**Chris:** 那么学生有没有教过老师呢? + +**Jess:** 我在你那里学习到耐心。举个例子,当你完成了安装 Ansible 的时候,我问你下一步要怎样操作的时候。你直接回复我,“不知道”,这不是我想让你学习到的内容。所以我改变了策略,现在在逐步安装任何组件之前,我们将详细讨论你想要实现的目标。当我们在写 Vagrant 文章的时候,我们一起进行相应的演示操作,我以创建它时就牢记目标,因此我们就有一些需要马上实现的目标。 + +这实际上对我在工作中的培训方式产生了巨大的改变。现在我在大家学习的过程中会问更多问题,并更多地进行手把手讲解。我更愿意坐下来仔细检查,确保有人明白我在说什么和我们在做什么。这是我之前从来没有做过的。 + +### 我们一起学到了什么 + +做为一对夫妇,在这一年的技术合作中我们的技术都有所增长。 + +**Chris:** 我对自己学到的东西感到震惊。通过一年课程学习,我认识了新操作系统、如何使用 API、使用 Ansible 部署 Web 应用和使用 Vagrant 启动虚拟机器。我还学习到了文档可以让生活变得更好,所以我也会尝试去写一写。然而,在这个工作领域,操作并不总是被记录在案,所以我学会了准备好处理棘手的问题,并记录如何解决它们。 + +**Jess:** 除了我在教你中学到的知识外,我还专注于学习 Kubernetes 在云环境中的应用知识。这包括部署策略、Kubernetes API 的复杂度、创建我自己的容器,并对环境进行加密处理。我还节省了探索的时间:研究了 serverless 的代码、AI 模型、Python 和以图形方式显示热图。对于我来说,这一年也很充足。 + +我们下一个目标是什么?现在还不知道,但我可以向你保证,我们将会继续进行分享它。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/linux-love-language + +作者:[Christopher Cherry][a] +选题:[lujun9972][b] +译者:[sndnvaps](https://github.com/sndnvaps) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/chcherry +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/red-love-heart-alone-stone-path.jpg?itok=O3q1nEVz (红心 "你不是孤单的") +[2]: https://opensource.com/resources/what-ansible +[3]: https://opensource.com/resources/vagrant diff --git a/published/20200219 Here Are The Most Beautiful Linux Distributions in 2020.md b/published/20200219 Here Are The Most Beautiful Linux Distributions in 2020.md new file mode 100644 index 0000000000..b4eafe90dd --- /dev/null +++ b/published/20200219 Here Are The Most Beautiful Linux Distributions in 2020.md @@ -0,0 +1,195 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12046-1.html) +[#]: subject: (Here Are The Most Beautiful Linux Distributions in 2020) +[#]: via: (https://itsfoss.com/beautiful-linux-distributions/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +我眼中的 2020 年最漂亮的 Linux 发行版 +====== + +![](https://img.linux.net.cn/data/attachment/album/202003/28/103619o7gog737dg7fi9ii.jpg) + +以我的观点,每个人都该有一个 Linux 发行版,不管他们喜欢的是哪种,或者想用来做什么。 + +要是你刚刚开始使用 Linux,你可以使用这些[最适合于初学者的 Linux 发行版][1];要是你是从 Windows 投奔过来的,你可以使用这些[看起来像 Windows 一样的 Linux 发行版][2];要是你有台旧电脑想让它发挥余热,你可以使用这些[轻量级 Linux 发行版][3]。当然,无论你是在[企业][36]还是 [SOHO][37],Linux 还可以用于[个人工作][38]、[开发][39],以及作为[服务器][40]或[嵌入式系统][41]的操作系统,它可以用于[各种用途][42]。 + +但在这个列表中,我们只关注最漂亮的 Linux 发行版。 + +### 7 款最漂亮的 Linux 发行版 + +![][4] + +等一下!Linux 发行版有漂亮这个分类吗?显然,你可以自己定制任何发行版的外观,并使用[主题][5]和[图标][6]之类的来使其看起来更漂亮。 + +你说得对。但是在这里,我所说的是指不需要用户进行任何调整和自定义工作就看起来很漂亮的发行版。这些发行版提供友好的顺滑、流畅、开箱即用的桌面体验。 + +**注意:** 以下列表排名不分前后,名单纯属个人喜好,请使劲喷你的观点。 + +#### 1、elementary OS + +![][7] + +首先踏上 T 台的 elementary OS 是最漂亮的 Linux 发行版(如果非得说的话,可以是“之一”)。它靠着一种类似 macOS 的外观,而为 Linux 用户提供了出色的体验。如果你已经适应了 macOS,那么你在使用 elementary OS 时就不会有任何不适感。 + +此外,elementary OS 是基于 Ubuntu 的,因此,你可以很容易地找到大量的可以满足你的需要的应用程序。 + +不仅仅是外观和感受,elementary OS 总是努力地引入一些重要的变化。因此,你可以期待用户体验会随着每次更新而获得提升。 + +- [elementary OS][8] + +#### 2、深度 Linux + +![][9] + +深度 Linux(或许现在该叫统信 UOS?)是另外一个漂亮的 Linux 发行版,它起源于 Debian 的稳定版分支。对于某些人来说,其动画效果(外观和感受)可能有点过度了,虽然它看起来很漂亮。 + +它有它自己特色的 Deepin 桌面环境(DDE),蕴藏了多种基本功能,从而提供尽可能好的用户体验。它可能不像其它发行版的用户界面,但你很容易就可以习惯。 + +我个人对深度中的控制中心和特色配色方案印象深刻。你可以自己尝试一下,我觉得值得一试。 + +- [深度][10] + +#### 3、Pop!_OS + +![][11] + +Pop!_OS 在提供了纯净的 [GNOME][12] 体验的同事,也成功地在 Ubuntu 之上打造出了一个出色的用户界面。 + +这正是我的最爱,我使用它作为我的主要桌面系统。Pop!_OS 既不浮华,也没有一些花哨的动画。然而,它通过图标和主题的完美组合做到了最好,同时从技术角度提升了用户体验。 + +我不想发起一场 [Ubuntu 和 Pop!\_OS][13] 之间的争论,但是如果你已经习惯了 Ubuntu,Pop!_OS 可能是一个可能更好的用户体验的绝佳选择。 + +- [Pop!_OS][14] + +#### 4、Manjaro Linux + +![][15] + +Manjaro Linux 是一个基于 [Arch][16] 的 Linux 发行版。虽然[安装 Arch Linux][17] 是一件稍微复杂的工作,而 Manjaro 则提供了一种更舒适、更流畅的 Arch 体验。 + +它提供各种各样的[桌面环境版本][18],在下载时可供选择。不管你选择哪一个,你都仍然有足够的选择权来自定义外观和感觉或布局。 + +对我来说,这样一个开箱即用的、基于 Arch 的发行版看起来棒极了,你值得拥有! + +- [Manjaro Linux][19] + +#### 5、KDE Neon + +![][20] + +[KDE Neon][21] 是为那些想要采用简化的设计方案而仍可以得到丰富体验的用户所准备的。 + +它是一个基于 Ubuntu 的轻量级 Linux 发行版。顾名思义,它采用 KDE Plasma 桌面,看起来精美绝伦。 + +KDE Neon 给予你最新的、最好的 KDE Plasma 桌面及 KDE 应用程序。不像 [Kubuntu][22] 或其它基于 KDE 的发行版,你不需要等待数月来获取新的 [KDE 软件][23]。 + +你可以在 KDE 桌面中获取很多内置的自定义选项,请按你的心意摆弄它! + +- [KDE Neon][24] + +#### 6、Zorin OS + +![][25] + +毫无疑问,Zorin OS 是一款令人印象深刻的 Linux 发行版,它努力提供了良好的用户体验,即便是它的精简版也是如此。 + +你可以尝试完整版或精简版(使用 [Xfce 桌面][26])。这个用户界面是专门为习惯于 Windows 和 macOS 的用户定制的。虽然它是基于 Ubuntu 的,但它仍然提供了出色的用户体验。 + +如果你开始喜欢上了它的用户界面,那你也可以尝试使用 [Zorin Grid][27] 来管理运行在工作区/家庭中的 Zorin OS 计算机。而使用其终极版,你还可以控制桌面布局(如上图所示)。 + +- [video](https://youtu.be/UsUm_ERVLpQ) + +- [Zorin OS][28] + +#### 7、Nitrux OS + +![][29] + +[Nitrux OS][30] 在 Linux 发行版里算是个另类,它某种程度上基于 Ubuntu,但是不完全基于 Ubuntu 。 + +对于那些正在寻找在 Linux 发行版上使用全新方式的独特设计语言的用户来说,它专注于为他们提供一种良好的用户体验。它使用基于 KDE 的 Nomad 桌面。 + +Nitrux 鼓励使用 [AppImage][31] 应用程序。但是在这个基于 Ubuntu 的 Nitrux 中你也可以使用 Arch Linux 的 pacman 软件包管理器。真令人惊叹! + +如果它不是你安装过(或尚未安装过)的完美的操作系统,但它确实看起来很漂亮,并且对大多数基本任务来说已经足够了。你可以阅读我们的 [Nitrux 创始人的采访][32],可以更多地了解它。 + +这是一个稍微过时的 Nitrux 视频,但是它仍然看起来很好: + +- [video](https://youtu.be/8p2BK0AwuV8) + +- [Nitrux OS][33] + +#### 赠品:eXtern OS (处于‘停滞’开发阶段) + +![][34] + +如果你想尝试一个实验性的 Linux 发行版,extern OS 是非常漂亮的。 + +它没有积极维护,因此不应该用于生产系统。但是,它提供独特的用户体验,尽管还不够完美无缺。 + +如果只是想尝试一个好看的 Linux 发行版,你可以试试。 + +- [eXtern OS][35] + +### 总结 + +俗话说,情人眼里出西施。所以这份来自我眼中的最漂亮 Linux 发行版列表。你可以随意提出不同的意见 (当然要礼貌一点),并提出你最喜欢的 Linux 发行版。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/beautiful-linux-distributions/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://linux.cn/article-11145-1.html +[2]: https://linux.cn/article-8311-1.html +[3]: https://linux.cn/article-11040-1.html +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/beautiful-linux-distros.png?ssl=1 +[5]: https://itsfoss.com/best-gtk-themes/ +[6]: https://itsfoss.com/best-icon-themes-ubuntu-16-04/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/elementary-os-hera.png?ssl=1 +[8]: https://elementary.io/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/deepin-screenshot.jpg?ssl=1 +[10]: https://www.deepin.org/en/ +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/pop-os-stock.jpg?ssl=1 +[12]: https://www.gnome.org/ +[13]: https://itsfoss.com/pop-os-vs-ubuntu/ +[14]: https://system76.com/pop +[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/manjaro_kde.jpg?ssl=1 +[16]: https://en.wikipedia.org/wiki/Arch +[17]: https://itsfoss.com/install-arch-linux/ +[18]: https://itsfoss.com/best-linux-desktop-environments/ +[19]: https://manjaro.org/download/ +[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/kde-neon-screenshot.jpg?ssl=1 +[21]: https://itsfoss.com/kde-neon-unveiled/ +[22]: https://kubuntu.org/ +[23]: https://kde.org/ +[24]: https://neon.kde.org/ +[25]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/11/zorin-lite-ultimate-appearance.jpg?ssl=1 +[26]: https://www.xfce.org/ +[27]: https://itsfoss.com/zorin-grid/ +[28]: https://zorinos.com/ +[29]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/nitrux-screenshot.jpg?ssl=1 +[30]: https://itsfoss.com/nitrux-linux-overview/ +[31]: https://itsfoss.com/use-appimage-linux/ +[32]: https://itsfoss.com/nitrux-linux/ +[33]: https://nxos.org/ +[34]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/extern-os.png?ssl=1 +[35]: https://externos.io/ +[36]: https://linux.cn/article-9553-1.html +[37]: https://linux.cn/article-10490-1.html +[38]: https://linux.cn/article-11028-1.html +[39]: https://linux.cn/article-10534-1.html +[40]: https://linux.cn/article-7813-1.html +[41]: https://linux.cn/article-9324-1.html +[42]: https://linux.cn/article-8628-1.html diff --git a/published/20200219 Try this Bash script for-large filesystems.md b/published/20200219 Try this Bash script for-large filesystems.md new file mode 100644 index 0000000000..8ebc16d6d3 --- /dev/null +++ b/published/20200219 Try this Bash script for-large filesystems.md @@ -0,0 +1,330 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12025-1.html) +[#]: subject: (Try this Bash script for large filesystems) +[#]: via: (https://opensource.com/article/20/2/script-large-files) +[#]: author: (Nick Clifton https://opensource.com/users/nickclifton) + +针对大型文件系统可以试试此 Bash 脚本 +====== + +> 一个可以列出文件、目录、可执行文件和链接的简单脚本。 + +![bash logo on green background][1] + +你是否曾经想列出目录中的所有文件,但仅列出文件,而不列出其它的。仅列出目录呢?如果有这种需求的话,那么下面的脚本可能正是你一直在寻找的,它在 GPLv3 下开源。 + +当然,你可以使用 `find` 命令: + +``` +find . -maxdepth 1 -type f -print +``` + +但这键入起来很麻烦,输出也不友好,并且缺少 `ls` 命令拥有的一些改进。你还可以结合使用 `ls` 和 `grep` 来达到相同的结果: + +``` +ls -F . | grep -v / +``` + +但是,这又有点笨拙。下面这个脚本提供了一种简单的替代方法。 + +### 用法 + +该脚本提供了四个主要功能,具体取决于你调用它的名称:`lsf` 列出文件,`lsd` 列出目录,`lsx` 列出可执行文件以及 `lsl` 列出链接。 + +通过符号链接无需安装该脚本的多个副本。这样可以节省空间并使脚本更新更容易。 + +该脚本通过使用 `find` 命令进行搜索,然后在找到的每个项目上运行 `ls`。这样做的好处是,任何给脚本的参数都将传递给 `ls` 命令。因此,例如,这可以列出所有文件,甚至包括以点开头的文件: + +``` +lsf -a +``` + +要以长格式列出目录,请使用 `lsd` 命令: + +``` +lsd -l +``` + +你可以提供多个参数,以及文件和目录路径。 + +下面提供了当前目录的父目录和 `/usr/bin` 目录中所有文件的长分类列表: + +``` +lsf -F -l .. /usr/bin +``` + +目前该脚本不处理递归,仅列出当前目录中的文件。 + +``` +lsf -R +``` + +该脚本不会深入子目录,这个不足有一天可能会进行修复。 + +### 内部 + +该脚本采用自上而下的方式编写,其初始化功能位于脚本的开头,而工作主体则接近结尾。脚本中只有两个真正重要的功能。函数 `parse_args()` 会仔细分析命令行,将选项与路径名分开,并处理脚本中的 `ls` 命令行选项中的特定选项。 + +`list_things_in_dir()` 函数以目录名作为参数并在其上运行 `find` 命令。找到的每个项目都传递给 `ls` 命令进行显示。 + +### 总结 + +这是一个可以完成简单功能的简单脚本。它节省了时间,并且在使用大型文件系统时可能会非常有用。 + +### 脚本 + +``` +#!/bin/bash + +# Script to list: +# directories (if called "lsd") +# files (if called "lsf") +# links (if called "lsl") +# or executables (if called "lsx") +# but not any other type of filesystem object. +# FIXME: add lsp (list pipes) +# +# Usage: +# [switches valid for ls command] [dirname...] +# +# Works with names that includes spaces and that start with a hyphen. +# +# Created by Nick Clifton. +# Version 1.4 +# Copyright (c) 2006, 2007 Red Hat. +# +# This 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, or (at your +# option) any later version. + +# It 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. + +# ToDo: +# Handle recursion, eg: lsl -R +# Handle switches that take arguments, eg --block-size +# Handle --almost-all, --ignore-backups, --format and --ignore + +main () +{ + init + + parse_args ${1+"$@"} + + list_objects + + exit 0 +} + +report () +{ + echo $prog": " ${1+"$@"} +} + +fail () +{ + report " Internal error: " ${1+"$@"} + exit 1 +} + +# Initialise global variables. +init () +{ + # Default to listing things in the current directory. + dirs[0]="."; + + # num_dirs is the number of directories to be listed minus one. + # This is because we are indexing the dirs[] array from zero. + num_dirs=0; + + # Default to ignoring things that start with a period. + no_dots=1 + + # Note - the global variables 'type' and 'opts' are initialised in + # parse_args function. +} + +# Parse our command line +parse_args () +{ + local no_more_args + + no_more_args=0 ; + + prog=`basename $0` ; + + # Decide if we are listing files or directories. + case $prog in + lsf | lsf.sh) + type=f + opts=""; + ;; + lsd | lsd.sh) + type=d + # The -d switch to "ls" is presumed when listing directories. + opts="-d"; + ;; + lsl | lsl.sh) + type=l + # Use -d to prevent the listed links from being followed. + opts="-d"; + ;; + lsx | lsx.sh) + type=f + find_extras="-perm /111" + ;; + *) + fail "Unrecognised program name: '$prog', expected either 'lsd', 'lsf', 'lsl' or 'lsx'" + ;; + esac + + # Locate any additional command line switches for ls and accumulate them. + # Likewise accumulate non-switches to the directories list. + while [ $# -gt 0 ] + do + case "$1" in + # FIXME: Handle switches that take arguments, eg --block-size + # FIXME: Properly handle --almost-all, --ignore-backups, --format + # FIXME: and --ignore + # FIXME: Properly handle --recursive + -a | -A | --all | --almost-all) + no_dots=0; + ;; + --version) + report "version 1.2" + exit 0 + ;; + --help) + case $type in + d) report "a version of 'ls' that lists only directories" ;; + l) report "a version of 'ls' that lists only links" ;; + f) if [ "x$find_extras" = "x" ] ; then + report "a version of 'ls' that lists only files" ; + else + report "a version of 'ls' that lists only executables"; + fi ;; + esac + exit 0 + ;; + --) + # A switch to say that all further items on the command line are + # arguments and not switches. + no_more_args=1 ; + ;; + -*) + if [ "x$no_more_args" = "x1" ] ; + then + dirs[$num_dirs]="$1"; + let "num_dirs++" + else + # Check for a switch that just uses a single dash, not a double + # dash. This could actually be multiple switches combined into + # one word, eg "lsd -alF". In this case, scan for the -a switch. + # XXX: FIXME: The use of =~ requires bash v3.0+. + if [[ "x${1:1:1}" != "x-" && "x$1" =~ "x-.*a.*" ]] ; + then + no_dots=0; + fi + opts="$opts $1"; + fi + ;; + *) + dirs[$num_dirs]="$1"; + let "num_dirs++" + ;; + esac + shift + done + + # Remember that we are counting from zero not one. + if [ $num_dirs -gt 0 ] ; + then + let "num_dirs--" + fi +} + +list_things_in_dir () +{ + local dir + + # Paranoia checks - the user should never encounter these. + if test "x$1" = "x" ; + then + fail "list_things_in_dir called without an argument" + fi + + if test "x$2" != "x" ; + then + fail "list_things_in_dir called with too many arguments" + fi + + # Use quotes when accessing $dir in order to preserve + # any spaces that might be in the directory name. + dir="${dirs[$1]}"; + + # Catch directory names that start with a dash - they + # confuse pushd. + if test "x${dir:0:1}" = "x-" ; + then + dir="./$dir" + fi + + if [ -d "$dir" ] + then + if [ $num_dirs -gt 0 ] + then + echo " $dir:" + fi + + # Use pushd rather passing the directory name to find so that the + # names that find passes on to xargs do not have any paths prepended. + pushd "$dir" > /dev/null + if [ $no_dots -ne 0 ] ; then + find . -maxdepth 1 -type $type $find_extras -not -name ".*" -printf "%f\000" \ + | xargs --null --no-run-if-empty ls $opts -- ; + else + find . -maxdepth 1 -type $type $find_extras -printf "%f\000" \ + | xargs --null --no-run-if-empty ls $opts -- ; + fi + popd > /dev/null + else + report "directory '$dir' could not be found" + fi +} + +list_objects () +{ + local i + + i=0; + while [ $i -le $num_dirs ] + do + list_things_in_dir i + let "i++" + done +} + +# Invoke main +main ${1+"$@"} +``` + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/script-large-files + +作者:[Nick Clifton][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/nickclifton +[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) diff --git a/published/20200219 Waterfox- Firefox Fork With Legacy Add-ons Options.md b/published/20200219 Waterfox- Firefox Fork With Legacy Add-ons Options.md new file mode 100644 index 0000000000..959c2b5f9e --- /dev/null +++ b/published/20200219 Waterfox- Firefox Fork With Legacy Add-ons Options.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12033-1.html) +[#]: subject: (Waterfox: Firefox Fork With Legacy Add-ons Options) +[#]: via: (https://itsfoss.com/waterfox-browser/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +水狐:一个支持旧版扩展的火狐复刻版 +====== + +> 在本周的开源软件推荐中,我们将介绍一个基于 Firefox 的浏览器,该浏览器支持 Firefox 如今已不再支持的旧版扩展,同时尽可能地提供了快速的用户体验。 + +在 Web 浏览器方面,虽然谷歌浏览器已经占据了最大的市场份额,但 [Mozilla Firefox 仍然是关切隐私的主流 Web 浏览器的一面大旗][1]。 + +Firefox 最近有了很多改进,这些改进的副作用之一是它删除了旧版扩展附件add-on的支持。如果你最喜欢的扩展附件在最近几个月/几年内消失了,那么你可以以 Witerfox 的形式再次拥有它们。 + +> 注意! +> +> 我们注意到,Waterfox 已被 System1 收购。该公司还收购了注重隐私的搜索引擎 Startpage。尽管 System1 声称他们提供注重隐私的产品,因为“这是刚需”,但我们不能对此担保。换句话说,这要取决于你是否信任 System1 和 Waterfox。 + +### Waterfox:一个基于 Firefox 的浏览器 + +![Waterfox Classic][2] + +[Waterfox][3] 是基于 Firefox 构建的一个好用的开源浏览器,它注重隐私并支持旧版扩展。它没有将自己定位为偏执于隐私的浏览器,但确实尊重这个基本的认知。 + +你可以得到两个单独的 Waterfox 浏览器版本。当前版旨在提供现代体验,而经典版则旨在支持 [NPAPI 插件][4] 和 [bootstrap 扩展][5]。 + +![Waterfox Classic][6] + +如果你不需要使用 bootstrap 扩展程序,而是需要 [WebExtensions][7],则应该选择 Waterfox 当前版。 + +而如果你需要设置一个需要大量 NPAPI 插件或 Bootstrap 扩展的浏览器,则 Waterfox 经典版将非常适合你。 + +因此,如果你喜欢 Firefox,但想在同一阵营内尝试一些不同的体验,那么这个 Firefox 替代选择就是为此而生的。 + +### Waterfox 的功能 + +![Waterfox Current][8] + +当然,从技术上讲,你应该能够做 Mozilla Firefox 支持的许多操作。 + +因此,我将在此处的列表中突出显示 Waterfox 的所有重要功能。 + +* 支持 NPAPI 插件 +* 支持 Bootstrap 扩展 +* 分别提供了支持旧版本扩展和现代的 WebExtension 两个版本。 +* 跨平台支持(Windows、Linux 和 macOS) +* 主题定制 +* 支持已经归档的扩展 + +### 在 Ubuntu/Linux 上安装 Waterfox + +与其他流行的浏览器不同,它没有可以安装的软件包。因此,你将必须从其[官方下载页面][9]下载归档包。 + +![][10] + +根据你想要的版本(当前版/经典版),只需下载该文件,它是以 .tar.bz2 为扩展名的文件。 + +下载后,只需解压缩文件即可。 + +接下来,转到解压缩的文件夹并查找 `Waterfox` 文件。你只需双击它即可运行以启动浏览器。 + +如果这不起作用,则可以使用终端并导航到提取的 `Waterfox` 文件夹。到达那里后,你只需使用一个命令即可运行它。看起来如下: + +``` +cd waterfox-classic +./waterfox +``` + +无论是哪种情况,你都可以访问其 [GitHub 页面][11]以了解将其安装在系统上的更多方式。 + +- [下载 Waterfox][3] + +### 总结 + +我在我的 Pop!_OS 19.10 系统中启动了它,在我这里工作的很好。尽管我不准备从 Firefox 切换到 Waterfox,因为我没有使用任何旧版扩展附件。但对于某些用户来说,它可能是一个重要选择。 + +你可以尝试一下,在下面的评论中让我知道你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/waterfox-browser/ + +作者:[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://itsfoss.com/why-firefox/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/waterfox-classic.png?fit=800%2C423&ssl=1 +[3]: https://www.waterfox.net/ +[4]: https://en.wikipedia.org/wiki/NPAPI +[5]: https://wiki.mozilla.org/Extension_Manager:Bootstrapped_Extensions +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/waterfox-classic-screenshot.jpg?ssl=1 +[7]: https://wiki.mozilla.org/WebExtensions +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/waterfox-screenshot.jpg?ssl=1 +[9]: https://www.waterfox.net/download/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/waterfox-download-page.jpg?ssl=1 +[11]: https://github.com/MrAlex94/Waterfox diff --git a/published/20200225 3 eBook readers for the Linux desktop.md b/published/20200225 3 eBook readers for the Linux desktop.md new file mode 100644 index 0000000000..07fbb8f09a --- /dev/null +++ b/published/20200225 3 eBook readers for the Linux desktop.md @@ -0,0 +1,113 @@ +[#]: collector: (lujun9972) +[#]: translator: (wenwensnow) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11990-1.html) +[#]: subject: (3 eBook readers for the Linux desktop) +[#]: via: (https://opensource.com/article/20/2/linux-ebook-readers) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +可在 Linux 桌面使用的 3 个电子书阅读器应用 +====== + +> 任意一个开源电子书应用都能使你在大屏设备上的阅读体验得到提升。 + +![电脑浏览器阅读书籍界面][1] + +我通常使用手机或 Kobo 阅读器阅读电子书,总是没有在大屏设备上阅读书籍那么爽。很多人经常在自己的笔记本或桌面电脑上阅读电子书,如果你有这种需求(或者你认为以后会遇到这种情况),我想向你介绍三种 Linux 桌面下的电子书阅读器。 + +### Bookworm(书虫) + +[Bookworm][2] 意在成为一个“简洁、专注的电子书阅读器”。事实证明它也确实做到了。Bookworm 内置一系列基础功能,有人抱怨它太过*简单*,缺少*功能性*(虽然这词显然有点指意不明)。Bookworm 起到了应有的作用而没有无关的花哨功能。 + +该应用的界面整洁干净。 + +![Bookworm 电子书应用][3] + +你可通过以下方式查看书籍: + +* 空格键前往下一页 +* 上下方向键按行移动 +* 左右方向键跳转至前后章节 + +你也可以通过添加注释或书签跳转至特定页面。 + +![Bookworm 注释][4] + +Bookworm 没有太多设置选项。你能调整书籍字体大小及间距,开启双页模式或夜间模式。在应用中添加新文件夹后,Bookworm 会自动扫描文件夹中的电子书。 + +![Bookworm 参数设置][5] + +Bookworm 支持常用的电子书格式:EPUB、PDF、MOBI、[FB2][6],你还能用它阅读 [CBR][7] 和 CBZ 格式的数字版漫画。我只在 Bookworm 上测试了前三种格式,PDF 倒是能打开,但加载速度很慢,格式也很难看。 + +### Foliate + +单从功能上来说,[Foliate][8] 确实比 Bookworm 强上一些。Foliate 不仅功能更强,它还有更多设置选项。这个功能多样、简单干净的应用满足了所有要求。 + +![Foliate 电子书应用][9] + +在 Foliate 中可以通过空格、方向键、向上或向下翻页键浏览电子书,这里没什么特别的。 + +你还可以在书籍中添加注释、查找以及翻译字句、查询字词含义。如果你电脑上安装了智能语音应用, Foliate 还能将文本朗读出来。 + +![在 Foliate 中的注释文本][10] + +Foliate 与 Bookworm 相比有更多自定义选项。你能在应用中修改字体类型及大小、行间距、电子书页边距,也可以调高或降低屏幕亮度,从应用内置的四个主题中选择一个等。 + +![Foliate 设置][11] + +你可以在 Foliate 上阅读 EPUB、MOBI、AZW、AZW3 格式的电子书。如果你不了解,我可以提前告诉你,后三种格式是亚马逊 Kindle 阅读器上架的书籍的闭源格式。 + +### Calibre 电子书阅读器 + +这个[电子书阅读器][12]是 [Calibre][13] 电子书管理工具的一个组件,就像它的前代一样,电子书阅读器这部分并不是软件整体最棒的部分。 + +![电子书阅读器应用][14] + +不过别被上面的话吓到,它也的确是个桌面电子书阅读器。 + +在 Calibre 电子书阅读器中,你可以通过方向键、向上/向下翻页键以及空格浏览书籍,还能在在线字典中查找词语含义,添加书签。这一阅读器没有注释功能,但内置的搜索引擎却很好用,你还能将书籍保存为 PDF 格式(虽然我不太明白你为什么要这么做)。 + +不过参数设置这里确是它出彩的地方,它的可选设置比 Bookworm 和 Foliate 加起来都多,从字体到文本布局,页面分割方式你都能改。除此之外,你还能自定义应用按键设置,将你喜欢的词典网站添加进来,方便阅读查找。 + +![电子书参数设置][15] + +Calibre 电子书阅读器一个很有用的功能,就是把自行设置的 CSS 配置文件效果应用到电子书上。赘言一句,CSS 是一种调整网页格式的方法(这类文件就是许多电子书的一个组成部分)。如果你是使用 CSS 的高手,你可以将自己的 CSS 文件复制粘贴到配置窗口的 “User stylesheet” 部分,这就是个性化的究极办法。 + +据开发者描述,这一电子书阅读器“能支持所有主流电子书格式”。如果你想知道具体支持格式是什么,[这是列表链接][16]。我测试了列表中的一小部分格式,没有发现问题。 + +### 留在最后的话 + +不管你只是单纯想找个电子书阅读器,还是有个更多复杂功能的应用,上文提到的三个选择都很不错,而且它们都能提升你在大屏设备上的阅读体验。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/linux-ebook-readers + +作者:[Scott Nesbitt][a] +选题:[lujun9972][b] +译者:[wenwensnow](https://github.com/wenwensnow) +校对:[wxy](https://github.com/wxy) + +本文由 [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/lead-images/computer_browser_program_books_read.jpg?itok=iNMWe8Bu (Computer browser with books on the screen) +[2]: https://babluboy.github.io/bookworm/ +[3]: https://opensource.com/sites/default/files/uploads/bookworm-reading.png (Bookworm e-book application) +[4]: https://opensource.com/sites/default/files/uploads/bookworm-annotations.png (Annotations in Bookworm) +[5]: https://opensource.com/sites/default/files/uploads/bookworm-preferences.png (Bookworm preferences) +[6]: https://en.wikipedia.org/wiki/FictionBook +[7]: https://en.wikipedia.org/wiki/Comic_book_archive +[8]: https://johnfactotum.github.io/foliate/ +[9]: https://opensource.com/sites/default/files/uploads/foliate-reading.png (Foliate e-book application) +[10]: https://opensource.com/sites/default/files/uploads/foliate-annotation_0.png +[11]: https://opensource.com/sites/default/files/uploads/foliate-settings.png (Foliate settings) +[12]: https://calibre-ebook.com/about +[13]: https://opensourcemusings.com/managing-your-ebooks-with-calibre +[14]: https://opensource.com/sites/default/files/uploads/e-book_viewer-reading.png (E-book Viewer application) +[15]: https://opensource.com/sites/default/files/uploads/ebook-viewer-preferences.png (E-book Viewer preferences) +[16]: https://manual.calibre-ebook.com/faq.html#what-formats-does-calibre-support-conversion-to-from +[17]: https://opensourcemusings.com/three-ebook-readers-for-the-linux-desktop +[18]: https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/published/20200225 7 tips for writing an effective technical resume.md b/published/20200225 7 tips for writing an effective technical resume.md new file mode 100644 index 0000000000..5748eea651 --- /dev/null +++ b/published/20200225 7 tips for writing an effective technical resume.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: (Morisun029) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12020-1.html) +[#]: subject: (7 tips for writing an effective technical resume) +[#]: via: (https://opensource.com/article/20/2/technical-resume-writing) +[#]: author: (Emily Brand https://opensource.com/users/emily-brand) + +撰写有效的技术简历的 7 个技巧 +====== + +> 遵循以下这些要点,把自己最好的一面呈现给潜在雇主。 + +![](https://img.linux.net.cn/data/attachment/album/202003/21/092248u2w2gz2aezre2ba2.jpg) + +如果你是一名软件工程师或技术领域的经理,那么创建或更新简历可能是一项艰巨的任务。要考虑的重点是什么?应该怎么把控格式、内容以及求职目标或摘要?哪些工作经验相关?如何确保自动化招聘工具不会过滤掉你的简历? + +在过去的七年中,作为一名招聘经理,我看到了各种各样的简历;尽管有些令人印象深刻,但还有很多人写的很糟糕。 + +在编写或更新简历时,请遵循以下七个简单原则。 + +### 1、概述 + +简历顶部的简短段落应简洁明了、目的明确,避免过度使用形容词和副词。诸如“令人印象深刻”、“广泛”和“卓越”之类的词,这些词不会增加你的招聘机会;相反,它们看起来和感觉上像是过度使用的填充词。 关于你的求职目标,问自己一个重要的问题:**它是否告诉招聘经理我正在寻找什么样的工作以及如何为他们提供价值?** 如果不是,请加强并简化它以回答该问题,或者将其完全排除在外。 + +### 2、工作经验 + +数字、数字、数字——重要的事情说三遍。用确凿的事实传达观点远比一般的陈述,例如“帮助构建、管理、交付许多对客户利润有贡献的项目”更能对你有帮助。你的表达中应包括统计数据,例如“直接影响了 5 个顶级银行的项目,这些项目将其上市时间缩短了 40%”,你提交了多少行代码或管理了几个团队。数据比修饰语更能有效地展示你的能力和价值。 + +如果你经验不足,没有什么工作经验可展示,那些无关的经验,如暑期兼职工作,就不要写了。相反,将相关经验的细节以及你所学到的知识的详细信息写进简历,这些可以使你成为一个更好的候选人。 + +### 3、搜索术语和行话 + +随着技术在招聘过程中发挥如此巨大的作用,确保简历被标记为正确的职位非常重要,但不要在简历上过分吹嘘自己。如果你提到敏捷技能但不知道看板是什么,请三思。如果你提到自己精通 Java,但是已经有五年都没有使用过 Java 了,请小心。如果存在你熟悉但不一定是当前在用的语言和框架,请创建其他类别或将你的经验分为“精通”和“熟悉”。 + +### 4、教育 + +如果你不是应届大学毕业生,那就没必要再写你的 GPA 或你参加过的俱乐部或兄弟会,除非你计划将它们用作谈话要点以在面试中赢得信任。确保将你发表的或获取过专利的东西包括在内,即使它与该工作无关。如果你没有大学学位,请添加一个证书部分代替教育背景部分。如果你是军人,请包括现役和预备役时间。 + +### 5、资质证书 + +除非你想重新进入之前离开的领域,否则不要写过期的证书,例如,如果你曾经是一名人事经理,而现在正寻求动手编程的工作。如果你拥有与该领域不再相关的认证,就不要写这些认证,因为这些可能会分散招聘者的注意力,使你的简历失去吸引力。利用你的 LinkedIn 个人资料为简历添加更多色彩,因为大多数人在面试之前都会阅读你的简历和 LinkedIn 个人资料。 + +### 6、拼写和语法 + +让其他人帮忙对你的简历校对一下。很多时候,我在简历中看到过拼写错误的单词,或者错误用词,如“他们的”、“他们是”、“那些”。这些可以避免和修复的错误会产生负面影响。理想情况下,你的简历应用主动语态,但是如果这样会使你感到不舒服,那么就用过去时书写 —— 最重要的是要始终保持一致。不正确的拼写和语法会传递你要么不是很在乎所申请的工作,要么没有足够注意细节。 + +### 7、格式 + +确保你的简历是最新的并且富有吸引力,这是留下良好第一印象的简便方法。确保格式一致,例如相同的页边距,相同的间距、大写字母和颜色(将调色板保持在最低限度,不要花花绿绿)是简历写作中最基本的部分,但有必要表明你对工作感到自豪,并重视自己的价值和未来的雇主。在适当的地方使用表格,以视觉吸引人的方式分配信息。如果支持的话,以 .pdf 和 .docx 格式上传简历,然后用 Google Docs 导出为 .odt 格式,这样可以在 LibreOffice 中轻松打开。这里有一个我推荐的简单的 Google 文档[简历模板][2]。 你还可以支付少量费用(不到 10 美元)从一些设计公司购买模板。 + +### 定期更新 + +如果你需要(或希望)申请一份工作,定期更新简历可以最大程度地减少压力,也可以帮助你创建和维护更准确的简历版本。撰写简历时,要有远见,确保至少让另外三个人对你的简历内容、拼写和语法进行检查。即使你是由公司招募或其他人推荐给公司的,面试官也可能只能通过简历来认识你,因此请确保它为你带来良好的第一印象。 + +你还有其他提示要添加吗? + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/technical-resume-writing + +作者:[Emily Brand][a] +选题:[lujun9972][b] +译者:[Morisun029](https://github.com/Morisun029) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/emily-brand +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/resume_career_document_general.png?itok=JEaFL2XI (Two hands holding a resume with computer, clock, and desk chair ) +[2]: https://docs.google.com/document/d/1ARVyybC5qQEiCzUOLElwAdPpKOK0Qf88srr682eHdCQ/edit diff --git a/published/20200228 Converting between uppercase and lowercase on the Linux command line.md b/published/20200228 Converting between uppercase and lowercase on the Linux command line.md new file mode 100644 index 0000000000..a90b4d411c --- /dev/null +++ b/published/20200228 Converting between uppercase and lowercase on the Linux command line.md @@ -0,0 +1,157 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11983-1.html) +[#]: subject: (Converting between uppercase and lowercase on the Linux command line) +[#]: via: (https://www.networkworld.com/article/3529409/converting-between-uppercase-and-lowercase-on-the-linux-command-line.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +在 Linux 命令行中转换大小写 +====== + +> 转换文本的大小写可能非常繁琐,尤其是当你要避免无意间的拼写错误时。幸运的是,Linux 提供了一些命令,可以使工作变得非常容易。 + +![](https://img.linux.net.cn/data/attachment/album/202003/11/095821df7u8nlyfyyydqvf.jpg) + +有很多方法可以在 Linux 命令行中将文本从小写更改为大写,反之亦然。实际上,有一组这样的命令可以选择。这篇文章检验了一些最佳的命令来完成这项工作,以及你该如何让它们正常工作。 + +### 使用 tr + +`tr`(translate)命令是在命令行或脚本中最容易使用的命令之一。如果你要确定要一串大写字符串,你只需将它传给 `tr`,如下所示: + +``` +$ echo Hello There | tr [:lower:] [:upper:] +HELLO THERE +``` + +下面是一个在脚本中使用这个命令的例子,当你要确保添加到文件中的所有文本都使用大写形式以保持一致性时(LCTT 译注:这里输入部门名称作为示例): + +``` +#!/bin/bash + +echo -n "Enter department name: " +read dept +echo $dept | tr [:lower:] [:upper:] >> depts +``` + +将顺序切换为 `[:upper:] [:lower:]` 会产生相反的效果,将所有大写的部门名称都转换为小写: + +``` +echo $dept | tr [:upper:] [:lower:] >> depts +``` + +同样,你可以使用 `sed` 命令的 `A-Z` 和 `a-z` 字符串完成相同的操作: + +``` +echo $dept | tr a-z A-Z >> depts +``` + +毫无疑问,反转 `a-z` 和 `A-Z` 字符串的顺序将产生相反的效果,将文本全部变为小写。 + +### 使用 awk + +`awk` 命令可让你使用它的 `toupper` 和 `tolower` 选项执行相同的操作。上例脚本中的命令可以用这种方式代替: + +``` +echo $dept | awk '{print toupper($0)}' >> depts +``` + +相反操作(切换为小写)如下所示: + +``` +echo $dept | awk '{print tolower($0)}' >> depts +``` + +### 使用 sed + +`sed`(stream editor)命令也可用于切换大小写。它与上面显示的两个命令中的第一个具有相同的效果。 + +``` +echo $dept | sed 's/[a-z]/\U&/g' >> depts +``` + +从大写字母切换到小写字母只需将行尾附近的 `U` 替换为 `L`。 + +``` +echo $dept | sed 's/[A-Z]/\L&/g' >> depts +``` + +### 操作文件中的文本 + +`awk` 和 `sed` 都能更改整个文件的文本大小写。因此,你发现你的老板需要所有部门名称的小写么?没问题。只需带上文件名运行以下命令: + +``` +$ awk '{print tolower($0)}' depts +finance +billing +bookkeeping +``` + +如果要覆盖 `depts` 文件,而不仅仅是以小写形式显示,则需要执行以下操作: + +``` +$ awk '{print tolower($0)}' depts > depts- +$ mv depts- depts +``` + +但是,使用 `sed` 进行更改,你可以避免最后一步,因为 `sed` 可以“原地”编辑文件,如下所示,文件完整,但文本全部小写: + +``` +$ sed 's/[A-Z]/\L&/g' depts +``` + +### 仅将首字母转换为大写 + +要仅将字符串中单词的首字母转换为大写,那么可以执行以下操作: + +``` +$ echo design \& engineering| sed -e "s/\b\(.\)/\u\1/g" +Design & Engineering +``` + +该命令将确保首字母大写,但不会更改其余字母。 + +### 确保只有首字母大写 + +当要更改文本以使只有首字母大写时,这更具挑战性。假设你正在处理一个工作人员姓名列表,并且希望以正常的“名 姓”方式对其格式化。 + +#### 使用 sed + +你可以使用更复杂的 `sed` 命令来确保以下结果: + +``` +$ echo design \& ENGINEERING | sed 's/\b\([[:alpha:]]\)\([[:alpha:]]*\)\b/\u\1\L\2/g' +Design & Engineering +``` + +#### 使用 Python + +如果你已安装 Python,你可以运行这样的命令,它还可以设置文本格式,以便每个单词只有首字母大写,并且它可能比上面显示的 `sed` 命令更易于解析: + +``` +$ echo -n "design & engineering" | python3 -c "import sys; print(sys.stdin.read().title())" +Design & Engineering +``` + +有多种方法可以在大小写之间更改文本格式。哪种方法效果最好取决于你要处理的是单个字符串还是整个文件,以及想要的最终结果。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3529409/converting-between-uppercase-and-lowercase-on-the-linux-command-line.html + +作者:[Sandra Henry-Stocker][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://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]:https://images.idgesg.net/images/article/2019/04/alphabetic_letters_characters_language_by_andybrandon50_cc_by-sa_2-0_1500x1000-100794409-large.jpg +[2]: https://creativecommons.org/licenses/by-sa/2.0/legalcode +[3]: https://www.networkworld.com/newsletters/signup.html +[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 diff --git a/translated/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md b/published/20200302 How to Add New Brushes in GIMP -Quick Tip.md similarity index 64% rename from translated/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md rename to published/20200302 How to Add New Brushes in GIMP -Quick Tip.md index 1e43b2bc71..4608cec762 100644 --- a/translated/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md +++ b/published/20200302 How to Add New Brushes in GIMP -Quick Tip.md @@ -1,16 +1,16 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11975-1.html) [#]: subject: (How to Add New Brushes in GIMP [Quick Tip]) [#]: via: (https://itsfoss.com/add-brushes-gimp/) [#]: author: (Community https://itsfoss.com/author/itsfoss/) -如何在 GIMP 中添加新画笔(快速技巧) +快速技巧:如何在 GIMP 中添加新画笔 ====== -[GIMP][1] 是最流行的免费和开源图像编辑器,它也许是 Linux 上最好的 [Adobe Photoshop 替代品][2]。 +[GIMP][1] 是最流行的自由开源的图像编辑器,它也许是 Linux 上最好的 [Adobe Photoshop 替代品][2]。 当你[在 Ubuntu 或其他任何操作系统上安装了 GIMP 后][3],你会发现已经安装了一些用于基本图像编辑的画笔。如果你需要更具体的画笔,你可以随时在 GIMP 中添加新画笔。 @@ -22,60 +22,59 @@ 在 GIMP 中安装新画笔需要三个步骤: - * 获取新画笔 - * 将其放入指定的文件夹中 - * 刷新 GIMP 中的画笔 - - +* 获取新画笔 +* 将其放入指定的文件夹中 +* 刷新 GIMP 中的画笔 #### 步骤 1:下载新的 GIMP 画笔 第一步是获取新的 GIMP 画笔。你从哪里获取?当然是从互联网上。 -你可以在 Google 或[隐私搜索引擎,如 Duck Duck Go][5] 种搜索 “GIMP画笔”,并从网站下载一个你喜欢的。 +你可以在 Google 或[如 Duck Duck Go 这种隐私搜索引擎][5]来搜索 “GIMP brushes”,并从网站下载一个你喜欢的。 GIMP 画笔通常以 .gbr 和 .gih 文件格式提供。.gbr 文件用于常规画笔,而 .gih 用于动画画笔。 -你知道吗? - -从 2.4 版本起,GIMP 使安装和使用 Photoshop 画笔(.abr 文件)非常简单。你只需将 Photoshop 画笔文件放在正确的文件夹中。 -请记住,最新的 Photoshop 画笔可能无法完美地在 GIMP 中使用。 +> 你知道吗? +> +> 从 2.4 版本起,GIMP 使安装和使用 Photoshop 画笔(.abr 文件)非常简单。你只需将 Photoshop 画笔文件放在正确的文件夹中。 +> +> 请记住,最新的 Photoshop 画笔可能无法完美地在 GIMP 中使用。 #### 步骤 2:将新画笔复制到它的位置 获取画笔文件后,下一步是复制该文件并将其粘贴到 GIMP 配置目录中所在的文件夹。 -在 **Windows** 上,你必须进入类似 “**C:\Documents and Settings\myusername.gimp-2.10\brushes**” 这样的文件夹。 +> 在微软 Windows 上,你必须进入类似 `C:\Documents and Settings\myusername.gimp-2.10\brushes` 这样的文件夹。 -我将展示 **Linux** 上的详细步骤,因为 It’s FOSS 是一个专注于 Linux 的网站。 +我将展示 Linux 上的详细步骤,因为我们是一个专注于 Linux 的网站。 -选择画笔文件后,在 **Home** 目录中按下 **Ctrl+h** [查看 Linux 中的隐藏文件][6]。 +选择画笔文件后,在家目录中按下 `Ctrl+h` [查看 Linux 中的隐藏文件][6]。 ![Press Ctrl+H to see hidden files in the home directory][7] -你应该进入 **.config/GIMP/2.10/brushes** 文件夹(如果你使用的是 GIMP 2.10)。如果使用其他版本,那么应在 .config/GIMP 下看到相应文件夹。 +你应该进入 `.config/GIMP/2.10/brushes` 文件夹(如果你使用的是 GIMP 2.10)。如果使用其他版本,那么应在 `.config/GIMP` 下看到相应文件夹。 ![Adding New Brushes in GIMP][8] -将画笔文件粘贴到此文件夹中。可选地,你可以通过再次按 **Ctrl+h** 来隐藏隐藏的文件。 +将画笔文件粘贴到此文件夹中。可选地,你可以通过再次按 `Ctrl+h` 来隐藏隐藏的文件。 #### 步骤 3:刷新画笔(避免重启 GIMP) GIMP 将在启动时自动加载画笔。如果已在运行,并且不想关闭它,你可以刷新画笔。 -在 GIMP 的主菜单中找到 **Windows**->**Dockable Dialogues**->**Brushes**。 +在 GIMP 的主菜单中找到 “Windows->Dockable Dialogues->Brushes”。 ![Refresh GIMP Brushes by going go to Windows->Dockable Dialogues-> Brushes][9] -在右侧栏的 **Brushes** 对话框中找到**刷新**图标。 +在右侧栏的 Brushes 对话框中找到“refresh”图标。 ![Refresh GIMP Brushes][10] 如果你的画笔没有出现,那么你可以试试重启 GIMP。 -额外的技巧! - -在 [GIMP 中添加新画笔还能让你轻松给图片添加水印][11]。只需将 logo 用作画笔,并点击一下就可添加到图片中。 +> 额外的技巧! +> +> 在 [GIMP 中添加新画笔还能让你轻松给图片添加水印][11]。只需将 logo 用作画笔,并点击一下就可添加到图片中。 我希望你喜欢这个快速 GIMP 技巧。敬请期待更多。 @@ -86,7 +85,7 @@ via: https://itsfoss.com/add-brushes-gimp/ 作者:[Community][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/) 荣誉推出 diff --git a/translated/tech/20200303 Getting started with the Rust package manager, Cargo.md b/published/20200303 Getting started with the Rust package manager, Cargo.md similarity index 91% rename from translated/tech/20200303 Getting started with the Rust package manager, Cargo.md rename to published/20200303 Getting started with the Rust package manager, Cargo.md index b289dd6f00..55f3f7491d 100644 --- a/translated/tech/20200303 Getting started with the Rust package manager, Cargo.md +++ b/published/20200303 Getting started with the Rust package manager, Cargo.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11977-1.html) [#]: subject: (Getting started with the Rust package manager, Cargo) [#]: via: (https://opensource.com/article/20/3/rust-cargo) [#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) @@ -12,7 +12,7 @@ Rust 包管理器 Cargo 入门 > 了解 Rust 的软件包管理器和构建工具。 -![Shipping containers stacked in a yard][1] +![](https://img.linux.net.cn/data/attachment/album/202003/09/104906tdl21k977t8999qt.jpg) [Rust][2] 是一种现代编程语言,可提供高性能、可靠性和生产力。几年来,它一直被 StackOverflow 调查评为[最受欢迎的语言][3]。 @@ -20,21 +20,21 @@ Rust 包管理器 Cargo 入门 ### 安装 Rust 和 Cargo -在开始之前,你需要安装 Rust 和 Cargo。Rust 项目提供了一个可下载的脚本来处理安装。要获取该脚本,请打开浏览器以访问 [https://sh.rustup.rs][4] 并保存该文件。阅读脚本以确保你对它的具体行为有所了解,然后运行它: +在开始之前,你需要安装 Rust 和 Cargo。Rust 项目提供了一个可下载的脚本来处理安装。要获取该脚本,请打开浏览器以访问 [https://sh.rustup.rs][4] 并保存该文件。阅读该脚本以确保你对它的具体行为有所了解,然后再运行它: ``` $ sh ./rustup.rs ``` -你也可以参考这个[安装 Rust][5]网页以获取更多信息。 +你也可以参考这个[安装 Rust][5] 的网页以获取更多信息。 -安装 Rust 和 Cargo 之后,你必须获取source `env` 文件: +安装 Rust 和 Cargo 之后,你必须获取source `env` 文件中的配置: ``` $ source $HOME/.cargo/env ``` -更好的是,将所需目录添加到 `PATH` 环境变量中: +更好的办法是,将所需目录添加到 `PATH` 环境变量中: ``` export PATH=$PATH:~/.cargo/bin @@ -91,11 +91,11 @@ $ ./hello Hello, world! ``` -这些步骤对于较小的程序或任何你想快速测试的东西就足够了。但是,在进行涉及多人的大型计划时,Cargo 是前进的最佳之路。 +这些步骤对于较小的程序或任何你想快速测试的东西就足够了。但是,在进行涉及到多人的大型程序时,Cargo 是前进的最佳之路。 ### 使用 Cargo 创建新包 -Cargo 是 Rust 的构建系统和包管理器。它可以帮助开发人员下载和管理依赖项,并帮助创建 Rust 包。在Rust 社区中,Rust 中的“包”通常被称为“crate”(板条箱),但是在本文中,这两个词是可以互换的。请参阅 Rust 社区提供的 Cargo [FAQ][6] 来区分。 +Cargo 是 Rust 的构建系统和包管理器。它可以帮助开发人员下载和管理依赖项,并帮助创建 Rust 包。在 Rust 社区中,Rust 中的“包”通常被称为“crate”(板条箱),但是在本文中,这两个词是可以互换的。请参阅 Rust 社区提供的 Cargo [FAQ][6] 来区分。 如果你需要有关 Cargo 命令行实用程序的任何帮助,请使用 `--help` 或 `-h` 命令行参数: @@ -134,7 +134,7 @@ fn main() { 下一个要处理的文件是 `Cargo.toml`,这是你的包的配置文件。它包含有关包的信息,例如其名称、版本、作者信息和 Rust 版本信息。 -程序通常依赖于外部库或依赖项来运行,这使你可以编写应用程序来执行不知道如何编码或不想花时间编码的任务。你所有的依赖项都将在此文件中列出。此时,对你的新程序你没有任何依赖关系。打开 `Cargo.toml` 文件并查看其内容: +程序通常依赖于外部库或依赖项来运行,这使你可以编写应用程序来执行不知道如何编码或不想花时间编码的任务。你所有的依赖项都将在此文件中列出。此时,你的新程序还没有任何依赖关系。打开 `Cargo.toml` 文件并查看其内容: ``` $ cat hello_opensource/Cargo.toml @@ -250,7 +250,7 @@ fn main() { } ``` -现在,构建程序并再次运行它。这次,你会在屏幕上看到 `Hello, Opensource world!`: +现在,构建该程序并再次运行它。这次,你会在屏幕上看到 `Hello, Opensource world!`: ``` $ cargo build @@ -293,9 +293,9 @@ $ cargo build     Finished dev [unoptimized + debuginfo] target(s) in 4.48s ``` -现在,Cargo 会联系 [Crates.io][9],这是 Rust 用于存储 crate(或包)的中央仓库,并下载和编译 `rand`。但是,等等 —— `libc` 包是怎么回事?你没有要要安装 libc 啊。是的,`rand` 包依赖于 `libc` 包;因此,Cargo 也会下载并编译 `libc`。 +现在,Cargo 会联系 [Crates.io][9](这是 Rust 用于存储 crate(或包)的中央仓库),并下载和编译 `rand`。但是,等等 —— `libc` 包是怎么回事?你没有要安装 libc 啊。是的,`rand` 包依赖于 `libc` 包;因此,Cargo 也会下载并编译 `libc`。 -库的新版本不断涌现,而 Cargo 提供了一种使用 `update` 命令更新其所有依赖关系的简便方法: +库的新版本会不断涌现,而 Cargo 提供了一种使用 `update` 命令更新其所有依赖关系的简便方法: ``` cargo update @@ -449,7 +449,7 @@ $ cargo build --release ### 使用 Cargo 创建库还是二进制文件 -任何软件程序都可以粗略地分类为独立二进制文件或库。一个独立二进制文件也许即使是当中外部库使用的,自身也是可以运行的。但是,作为一个库,是可以被另一个独立二进制文件所利用的。到目前为止,你在本教程中构建的所有程序都是独立二进制文件,因为这是 Cargo 的默认设置。 要创建一个**库**,请添加 `--lib` 选项: +任何软件程序都可以粗略地分类为独立二进制文件或库。一个独立二进制文件也许即使是当做外部库使用的,自身也是可以运行的。但是,作为一个库,是可以被另一个独立二进制文件所利用的。到目前为止,你在本教程中构建的所有程序都是独立二进制文件,因为这是 Cargo 的默认设置。 要创建一个**库**,请添加 `--lib` 选项: ``` $ cargo new --lib libhello @@ -514,7 +514,7 @@ test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out 这是使用 `-v` 选项运行 `build` 和 `clean` 的几个例子。 -在 `build` 命令中,你可以看到这些给定的命令行选项触发了底层的 `rustc`(Rust编译器): +在 `build` 命令中,你可以看到这些给定的命令行选项触发了底层的 `rustc`(Rust 编译器): ``` $ cargo build -v @@ -523,7 +523,7 @@ $ cargo build -v     Finished dev [unoptimized + debuginfo] target(s) in 0.36s ``` -而 `clean` 命令表明它只是删除包含中间文件和二进制文件的目录: +而 `clean` 命令表明它只是删除了包含中间文件和二进制文件的目录: ``` $ cargo clean -v @@ -534,7 +534,7 @@ $ cargo clean -v 要扩展你的技能,请尝试使用 Rust 和 Cargo 编写并运行一个稍微复杂的程序。很简单就可以做到:例如,尝试列出当前目录中的所有文件(可以用 9 行代码完成),或者尝试自己回显输入。小型的实践应用程序可帮助你熟悉语法以及编写和测试代码的过程。 -本文为刚起步的 Rust 程序员提供了大量信息,以使他们可以开始入门 Cargo。但是,当你开始处理更大、更复杂的程序时,你需要对 Cargo 有更深入的了解。当你准备好迎接更多内容时,请下载并阅读 Rust 团队编写的开源《[Cargo 手册][10]》,看看你可以创造什么! +本文为刚起步的 Rust 程序员提供了大量信息,以使他们可以开始入门 Cargo。但是,当你开始处理更大、更复杂的程序时,你需要对 Cargo 有更深入的了解。当你准备好迎接更多内容时,请下载并阅读 Rust 团队编写的开源的《[Cargo 手册][10]》,看看你可以创造什么! -------------------------------------------------------------------------------- @@ -543,7 +543,7 @@ via: https://opensource.com/article/20/3/rust-cargo 作者:[Gaurav Kamathe][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/) 荣誉推出 diff --git a/translated/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md b/published/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md similarity index 83% rename from translated/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md rename to published/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md index 3cb2f915c4..1d98fdf187 100644 --- a/translated/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md +++ b/published/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11982-1.html) [#]: subject: (Session: An Open Source Private Messenger That Doesn’t Need Your Phone Number) [#]: via: (https://itsfoss.com/session-messenger/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) @@ -18,7 +18,7 @@ Signal 作为一款私人通信应用,正在变得愈发流行。而我们下 对于私人通信服务来说,有没有既能保护通信安全性,又尊重用户跨平台隐私的集大成者呢?很多注重个人隐私的用户似乎都在寻找这个问题的答案。 -最近,我留意到 [Loki Foundation][3] 开发的一款叫做 [Session][2] 的开源通信应用。从技术上来说,Session 是另一款[开源、加密的通信应用 Signal][4] 的一个复刻。 +最近,我留意到 [Loki 基金会][3]开发的一款叫做 [Session][2] 的开源通信应用。从技术上来说,Session 是另一款[开源、加密的通信应用 Signal][4] 的一个复刻。 在本文中,我会讲述我自己使用 Session 的体验,以及 Session 的一些主要功能。 @@ -34,7 +34,7 @@ Session 在这个领域中算是一款比较新的应用了,因此我还会在 在 Signal 或者其它类似的通信应用中,用户都需要提供手机号码才得以成功注册。注重隐私的用户们都认为这样的做法会潜藏着巨大的安全隐患。 -而使用 Session 则简单得多。在 PC 或手机上安装应用之后,只需要点击“创建账号Create Account”,无须提供手机号码,它就会生成一个类似 **05652245af9a8bfee4f5a8138fd5c……..** 这样的随机且唯一的 Session ID。 +而使用 Session 则简单得多。在 PC 或手机上安装应用之后,只需要点击“创建账号Create Account”,无须提供手机号码,它就会生成一个类似 05652245af9a8bfee4f5a8138fd5c..... 这样的随机且唯一的 Session ID。 此后,把 Session ID 分享给想要添加的联系人就可以了。Session 还支持二维码,其他人可以通过扫描二维码添加你的 Session ID 为好友。 @@ -62,14 +62,12 @@ Session 在这个领域中算是一款比较新的应用了,因此我还会在 最基本的选项包括: - * **消息有效期**:你可以控制一条消息在接收者阅读前的保留时长 - * **已读回执**:消息发送者可以知晓你已经阅读该消息 - - +* **消息有效期**:你可以控制一条消息在接收者阅读前的保留时长 +* **已读回执**:消息发送者可以知晓你已经阅读该消息 #### Session 使用去中心化网络保护你的元数据 -尽管 Session 不使用端对端peer-to-peer技术,但它也不适用中心化的服务器。 +尽管 Session 不使用端对端peer-to-peer技术,但它也不使用中心化的服务器。 Session 采用了去中心化的架构实现消息的传输和路由。如果你不熟悉这方面的内容,可以关注 Session 的官方博客,尝试了解[中心化网络和去中心化网络的区别][11],以及它的实际工作原理。 @@ -85,11 +83,11 @@ Session 采用了去中心化的架构实现消息的传输和路由。如果你 另外,你也可以在它的 [Github 发布页面][14] 获取到对应的 .deb 安装文件。 -[下载 Session][12] +- [下载 Session][12] ### 我使用 Session 的体验 -我在各种平台上都试用过 Session,其中在 PC 上我使用了 Pop!_OS 19.10 的 .AppImage 文件运行这个应用。 +我在各种平台上都试用过 Session,其中在 PC 上我使用了 Pop!\_OS 19.10 的 .AppImage 文件运行这个应用。 总的来说,使用的体验很不错,用户界面也没有出现问题。 @@ -99,15 +97,13 @@ Session 采用了去中心化的架构实现消息的传输和路由。如果你 当然,我也发现了一些需要改进的地方: - * 在接受好友请求时会出现延迟 - * 设备间连接的方式不太直观 - * 当你在不同的设备上使用同一个 Session ID 向同一个人回复消息时,对方会收到两个不同的对话 - - +* 在接受好友请求时会出现延迟 +* 设备间连接的方式不太直观 +* 当你在不同的设备上使用同一个 Session ID 向同一个人回复消息时,对方会收到两个不同的对话 ### 总结 -当然,最完美的事物是不存在的。我也会一直使用 Session 并考虑它发展的方向,这是一个注重引得的用户应该做的事情。 +当然,最完美的事物是不存在的。我也会一直使用 Session 并考虑它发展的方向,这是一个注重隐私的用户应该做的事情。 欢迎在评论区发表你的看法。 @@ -119,7 +115,7 @@ via: https://itsfoss.com/session-messenger/ 作者:[Ankush Das][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/) 荣誉推出 @@ -128,7 +124,7 @@ via: https://itsfoss.com/session-messenger/ [1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-app.jpg?ssl=1 [2]: https://getsession.org/ [3]: https://loki.foundation/ -[4]: https://itsfoss.com/signal-messaging-app/ +[4]: https://linux.cn/article-11764-1.html [5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-create.jpg?ssl=1 [6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/session-application-id.jpg?ssl=1 [7]: https://en.wikipedia.org/wiki/Blockchain diff --git a/published/20200305 Install and Use Wireshark on Ubuntu Linux.md b/published/20200305 Install and Use Wireshark on Ubuntu Linux.md new file mode 100644 index 0000000000..ec70ef40a8 --- /dev/null +++ b/published/20200305 Install and Use Wireshark on Ubuntu Linux.md @@ -0,0 +1,216 @@ +[#]: collector: (lujun9972) +[#]: translator: (qianmingtian) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11987-1.html) +[#]: subject: (Install and Use Wireshark on Ubuntu Linux) +[#]: via: (https://itsfoss.com/install-wireshark-ubuntu/) +[#]: author: (Community https://itsfoss.com/author/itsfoss/) + +Ubuntu 上 Wireshark 的安装与使用 +====== + +> 在本教程中,你将学习如何在 Ubuntu 和其它基于 Ubuntu 的发行版上安装最新的 Wireshark。同时你也将学习如何在没有 sudo 的情况下来运行 Wireshark,以及如何设置它来进行数据包嗅探。 + +[Wireshark][1] 是一款自由开源的网络协议分析器,它在全球被广泛使用。 + +通过使用 Wireshark,你可以实时捕获网络的传入和传出数据包,并将其用于网络故障排除、数据包分析、软件和通信协议开发等。 + +它适用于所有主流的桌面操作系统,如 Windows、Linux、macOS、BSD 等。 + +在本教程中,我将指导你在 Ubuntu 和其他基于 Ubuntu 的发行版上安装 Wireshark 。我还将介绍如何设置和配置 Wireshark 来捕获数据包。 + +### 在基于 Ubuntu 的 Linux 发行版上安装 Wireshark + +![][2] + +Wireshark 适用于所有主流 Linux 发行版。你应该查看[官方安装说明][3]。因为在本教程中,我将着重在仅基于 Ubuntu 的发行版上安装最新版本的 Wireshark 。 + +Wireshark 可以在 Ubuntu 的 Universe 存储库中找到。你可以[启用 universe 存储库][4],然后按如下方式安装: + +``` +sudo add-apt-repository universe +sudo apt install wireshark +``` + +这种方法的一个小问题是,你可能并不总是得到最新版本的 Wireshark 。 + +例如,在 Ubuntu 18.04 中,如果你使用 [apt][5] 命令检查 Wireshark 的可用版本,可用版本会显示是 2.6 。 + +``` +abhishek@nuc:~$ apt show wireshark +Package: wireshark +Version: 2.6.10-1~ubuntu18.04.0 +Priority: optional +Section: universe/net +Origin: Ubuntu +Maintainer: Balint Reczey +``` + +然而, [Wireshark 3.2 稳定版][6]已经在几个月前发布了。当然,新版本拥有新的特性。 + +那么在这种情况下,你应该怎么办呢?谢天谢地, Wireshark 开发者提供了一种官方 PPA 方式,你可以使用它在 Ubuntu 和其它基于 Ubuntu 的发行版上安装最新稳定版本的 Wireshark. + +我希望你熟悉 PPA。如果没有,请[阅读我们关于 PPA 的优秀指南,以便完全理解它][7]。 + +打开终端并逐个使用以下命令: + +``` +sudo add-apt-repository ppa:wireshark-dev/stable +sudo apt update +sudo apt install wireshark +``` + +即使安装了旧版本的 Wireshark ,它也将更新为新版本。 + +安装时,系统将询问你是否允许非超级用户捕获数据包。选择“Yes”允许,选择“No”限制非超级用户捕获数据包,最后完成安装。 + +### 不使用 sudo 运行 Wireshark + +如果在上一次安装中选择了“No”,则以 root 用户身份运行以下命令: + +``` +sudo dpkg-reconfigure wireshark-common +``` + +然后按 `tab` 键并使用回车键选择“No”: + +![][8] + +由于你允许非超级用户捕获数据包,因此你必须将该用户添加到 `wireshark` 组。使用 [usermod][9] 命令将自己添加到 `wireshark` 组。 + +``` +sudo usermod -aG wireshark $(whoami) +``` + +最后,[重启你的 Ubuntu 系统][10]对你的系统进行必要的修改。 + +> 冷知识 +> +> Wireshark 于 1998 年首次发布,最初被称为 Ethereal 。2006 年,由于商标问题,开发商不得不将其名称改为 Wireshark 。 + +### 启动 Wireshark + +你可以从应用程序启动器或者命令行启动 Wireshark 应用。 + +如果从命令行启动,只需要在你的控制台中输入 `wireshark`: + +``` +wireshark +``` + +要是从**图形化界面**启动,需要在搜索栏搜索 Wireshark 应用,并按回车键。 + +![][11] + +现在,让我们来玩玩 Wireshark 吧。 + +### 使用 Wireshark 捕获数据包 + +当你启动 Wireshark 的时候,你会看到一个接口列表,你可以使用它来捕获这个接口接收和发送的数据包。 + +你可以使用 Wireshark 监视许多类型的接口,例如,有线、外部设备等。根据你的偏好,你可以从下图中的标记区域选择在欢迎屏幕中显示特定类型的接口。 + +![Select interface][12] + +例如,我只列出了**有线**网络接口。 + +![][13] + +接下来,要开始捕获数据包,你必须选择接口(在我的示例中是 `ens33` ),然后单击“Start capturing packets”图标,如下图所示。 + +![Start capturing packets with Wireshark][14] + +你还可以同时从多个接口捕获数据包。只需按住 `CTRL` 按钮,同时单击要捕获的接口,然后点击“Start capturing packets”图标,如下图所示。 + +![][15] + +接下来,我尝试在终端中使用 `ping google.com` 命令,如你所见,捕获了许多数据包。 + +![Captured packets][16] + +现在你可以选择任何数据包来检查该特定数据包。在点击一个特定的包之后,你可以看到与它相关的 TCP/IP 协议的不同层的信息。 + +![Packet info][17] + +你还可以在底部看到该特定数据包的原始数据,如下图所示。 + +![Check RAW data in the captured packets][18] + +> 这就是为什么端到端加密很重要。 +> +> 假设你正在登录一个不使用 HTTPS 的网站。与你在同一网络上的任何人都可以嗅探数据包,并在原始数据中看到用户名和密码。 +> +> 这就是为什么现在大多数聊天应用程序使用端到端加密,而大多数网站使用 https (而不是 http)。 + +#### 在 Wireshark 中停止数据包捕获 + +你可以点击如图所示的红色图标停止捕获数据包。 + +![Stop packet capture in Wireshark][19] + +#### 将捕获的数据包保存成文件 + +你可以单击下图中标记的图标,将捕获的数据包保存到文件中以备将来使用。 + +![Save captured packets by Wireshark][20] + + +**注意**:输出可以导出为 XML、PostScript、CSV 或纯文本。 + +接下来,选择一个目标文件夹,键入文件名并单击“Save”。 + +然后选择文件并单击“Open”。 + +![][21] + +现在你可以随时打开和分析保存的数据包。要打开文件,请按 `\+o`,或从 Wireshark 转到 “File > Open”。 + +捕获的数据包将从文件中加载。 + +![][22] + +### 结语 + +Wireshark 支持许多不同的通信协议。有许多选项和功能,使你能够以独特的方式捕获和分析网络数据包。你可以从 Wireshark 的[官方文档][23]了解更多关于 Wireshark 的信息。 + +我希望这个教程能帮助你在 Ubuntu 上安装 Wireshark 。请让我知道你的问题和建议。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-wireshark-ubuntu/ + +作者:[Kushal Rai][a] +选题:[lujun9972][b] +译者:[qianmingtian][c] +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/itsfoss/ +[b]: https://github.com/lujun9972 +[c]: https://github.com/qianmingtian +[1]: https://www.wireshark.org/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/wireshark_ubuntu.png?ssl=1 +[3]: https://www.wireshark.org/docs/wsug_html_chunked/ChBuildInstallUnixInstallBins.html +[4]: https://itsfoss.com/ubuntu-repositories/ +[5]: https://itsfoss.com/apt-command-guide/ +[6]: https://www.wireshark.org/news/20191218.html +[7]: https://itsfoss.com/ppa-guide/ +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/yes.png?ssl=1 +[9]: https://linuxhandbook.com/usermod-command/ +[10]: https://itsfoss.com/schedule-shutdown-ubuntu/ +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/wire.png?ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/interfaces.jpg?ssl=1 +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/intoption.jpg?ssl=1 +[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/singleinterface.jpg?ssl=1 +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/selint.jpg?ssl=1 +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/capture.jpg?ssl=1 +[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/packetinfo.png?ssl=1 +[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/raw.png?ssl=1 +[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/stopcapture.png?ssl=1 +[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/savepackets.jpg?ssl=1 +[21]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/savename.jpg?ssl=1 +[22]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/openpacket.png?ssl=1 +[23]: https://www.wireshark.org/docs/https://www.wireshark.org/docs/ +[24]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/kushal_rai.jpg?ssl=1 diff --git a/published/20200306 Communicating with other users on the Linux command line.md b/published/20200306 Communicating with other users on the Linux command line.md new file mode 100644 index 0000000000..b5af59b838 --- /dev/null +++ b/published/20200306 Communicating with other users on the Linux command line.md @@ -0,0 +1,143 @@ +[#]: collector: (lujun9972) +[#]: translator: (linusboyle) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12023-1.html) +[#]: subject: (Communicating with other users on the Linux command line) +[#]: via: (https://www.networkworld.com/article/3530343/communicating-with-other-users-on-the-linux-command-line.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +使用 Linux 命令行与其他用户进行通信 +====== + +![](https://img.linux.net.cn/data/attachment/album/202003/22/171055z3q772v2zq320zx3.jpg) + +使用 Linux 命令行向其他用户发送消息或许非常容易,这里有一些相关的命令你可以考虑使用。在这篇文章中,我们会考察 4 个这样的命令,看看它们是怎么工作的。 + +### wall + +`wall`(“Write ALL” 的简称)命令允许你向所有系统中已登录的用户发送一条信息。这里我们假设用户都使用命令行在同一台服务器上工作。虽然 `wall` 命令最常被系统管理员用于向用户发布公告和传递信息(比如说,服务器即将因维护而关闭),但它可以被任何用户使用。 + +系统管理员可能会用类似下面的方式发送信息: + +``` +$ wall The system will be going down in 15 minutes to address a serious problem +``` + +而所有登录的用户都将看到类似这样的信息: + +``` +Broadcast message from admin@dragonfly (pts/0) (Thu Mar 5 08:56:42 2020): +The system is going down in 15 minutes to address a serious problem +``` + +如果希望在消息中使用单引号,你可以像这样将信息用双引号括起来: + +``` +$ wall "Don't forget to save your work before logging off" +``` + +最外层的双引号不会出现在发出的消息中,但是如果没有它们,`wall` 会停下并等待输入一个配对的单引号。 + +### mesg + +如果出于某种理由你不想接收来自另一个用户的消息,你可以使用 `mesg` 命令来屏蔽这些消息。这个命令可以接受一个 `n` 作为参数来拒绝某用户的消息,或者接收一个 `y` 作为参数来接收用户发来的消息。 + +``` +$ mesg n doug +$ mesg y doug +``` + +被屏蔽的用户不会被告知这一事实。你也可以像这样使用 `mesg` 来屏蔽或者接收所有消息: + +``` +$ mesg y +$ mesg n +``` + +### write + +另一个在不使用电子邮件的情况下发送文本的命令是 `write`,这个命令可以用来和一个特定的用户通信。 + +``` +$ write nemo +Are you still at your desk? +I need to talk with you right away. +^C +``` + +输入你的信息后用 `ctrl-c` 退出,这样就完成了通信。这个命令允许你发送文本,但并不会建立一个双向的通话。它只是将文本发送过去而已。如果目标用户在多个终端上登录,你可以指定你想将消息发送到哪一个终端,否则系统会选择空闲时间最短的那个终端。 + +``` +$ write nemo#1 +``` + +如果你试图向一个将消息屏蔽了的用户发送信息,你应该会看到这样的输出: + +``` +$ write nemo +write: nemo has messages disabled +``` + +### talk/ytalk + +`talk` 和 `ytalk` 命令让你可以和一个或多个用户进行交互式的聊天。它们会展示一个有上下两个子窗口的界面,每个用户向显示在他们屏幕上方的窗口内输入内容,并在下方的窗口看到回复信息。要回复一个`talk` 请求,接收方可以输入 `talk`,在后面加上请求方的用户名。 + +``` +Message from Talk_Daemon@dragonfly at 10:10 ... +talk: connection requested by dory@127.0.0.1. +talk: respond with: talk dory@127.0.0.1 + +$ talk dory +``` + +如果使用的是 `ytalk`,那么窗口中可以包含多于两个参与者。正如下面的例子所展示的(这是上面 `talk dory` 命令的结果),`talk` 通常指向 `ytalk`。 + +``` +----------------------------= YTalk version 3.3.0 =-------------------------- +Is the report ready? + +-------------------------------= nemo@dragonfly =---------------------------- +Just finished it +``` + +如上所述,在通话的另一侧,`talk`会话界面的窗口是相反的: + +``` +----------------------------= YTalk version 3.3.0 =-------------------------- +Just finished it + +-------------------------------= dory@dragonfly =---------------------------- +Is the report ready? +``` + +同样的,使用 `ctrl-c` 来退出。 + +如果要和非本机的用户通讯,你需要加上 `-h` 选项和目标主机名或IP地址,就像这样: + +``` +$ talk -h 192.168.0.11 nemo +``` + +### 总结 + +Linux 上有若干基本的命令可以用来向其他登录的用户发送消息。如果你需要向所有用户快速发送信息或是需要便捷的电话替代品,又或是希望能简单地开始一个多用户快速通讯会话,这些命令会十分实用。 + +一些命令如 `wall` 允许广播消息但却不是交互式的。另外的一些命令如 `talk` 允许多用户进行长时间通讯,当你只需要非常快速地交换一些信息,它们可以你你避免建立一个电话会议。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3530343/communicating-with-other-users-on-the-linux-command-line.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[linusboyle](https://github.com/linusboyle) +校对:[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 +[1]: 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) +[2]: https://www.facebook.com/NetworkWorld/ +[3]: https://www.linkedin.com/company/network-world diff --git a/published/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md b/published/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md new file mode 100644 index 0000000000..f005d928fa --- /dev/null +++ b/published/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md @@ -0,0 +1,182 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11992-1.html) +[#]: subject: (Three Ways to Exclude/Hold/Prevent a Specific Package from an apt Upgrade) +[#]: via: (https://www.2daygeek.com/debian-ubuntu-exclude-hold-prevent-packages-from-apt-get-upgrade/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +从 apt 升级中排除/保留/阻止特定软件包的三种方法 +====== + +![](https://img.linux.net.cn/data/attachment/album/202003/13/103902tfyv8eeuo5jf9ifo.jpg) + +有时,由于某些应用依赖性,你可能会意外更新不想更新的软件包。这在全系统更新或自动包升级时经常会发生。如果发生这种情况,可能会破坏应用的功能。这会造成严重的问题,你需要花费大量时间来解决问题。 + +如何避免这种情况?如何从 `apt-get` 更新中排除软件包? + +> 如果你要[从 Yum Update 中排除特定软件包][1],请参考这篇。 + +是的,可以在 Debian 和 Ubuntu 系统上使用以下三种方法来完成。 + +* [apt-mark 命令][2] +* [dpkg 命令][3] +* aptitude 命令 + +我们将分别详细展示。 + +### 方法 1:如何使用 apt-mark 命令排除 Debian/Ubuntu 系统上的软件包更新 + +`apt-mark` 用于将软件包标记/取消标记为自动安装。 + +`hold` 选项用于将软件包标记为保留,以防止软件包被自动安装、升级或删除。 + +`unhold` 选项用于取消先前面的设置,以允许重复执行所有操作。 + +运行以下命令以使用 `apt-mark` 命令保留指定的软件包。 + +``` +$ sudo apt-mark hold nano +nano set on hold. +``` + +保留软件包后,请运行以下 `apt-mark` 命令查看它们。 + +``` +$ sudo apt-mark showhold +nano +``` + +这表明在执行完整的系统更新时,不会升级 nano 包。 + +``` +$ sudo apt update + +Reading package lists… Done +Building dependency tree +Reading state information… Done +Calculating upgrade… Done +The following packages have been kept back: + nano +0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. +``` + +运行以下命令,使用 `apt-mark` 命令取消保留 nano 包。 + +``` +$ sudo apt-mark unhold nano +Canceled hold on nano. +``` + +### 方法 2:如何使用 dpkg 命令在 Debian/Ubuntu 系统上排除软件包更新 + +`dpkg` 命令是一个 CLI 工具,用于安装、构建、删除和管理 Debian 软件包。`dpkg` 的主要且更用户友好的前端是 `aptitude`。 + +运行以下命令使用 `dpkg` 命令阻止给定的软件包。 + +语法: + +``` +$ echo "package_name hold" | sudo dpkg --set-selections +``` + +运行以下 `dpkg` 命令以保留 apache2 包。 + +``` +$ echo "apache2 hold" | sudo dpkg --set-selections +``` + +保留软件包后,请运行以下命令查看它们。 + +``` +$ sudo dpkg --get-selections | grep "hold" +apache2 hold +``` + +它会显示在执行完整的系统更新时,不会升级 apache2包。 + +``` +$ sudo apt update + +Reading package lists… Done +Building dependency tree +Reading state information… Done +Calculating upgrade… Done +The following packages have been kept back: + apache2 +0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. +``` + +运行以下命令,使用 `dpkg` 命令取消对指定软件包的保留。 + +语法: + +``` +$ echo "package_name install" | sudo dpkg --set-selections +``` + +运行以下命令,使用 `dpkg` 命令取消保留 apache2 包。 + +``` +$ echo "apache2 install" | sudo dpkg --set-selections +``` + +### 方法 3:如何使用 aptitude 命令排除 Debian/Ubuntu 系统上的软件包更新 + +`aptitude` 命令是 Debian 及其衍生版本的基于文​​本的软件包管理界面。 + +它允许用户查看软件包列表并执行软件包管理任务,例如安装、升级和删除软件包。它可以从可视界面或命令行执行操作。 + +运行以下命令,使用 `aptitude` 命令保留指定的软件包。 + +``` +$ sudo aptitude hold python3 +``` + +保留某些软件包后,请运行以下命令查看它们。 + +``` +$ sudo dpkg --get-selections | grep "hold" +或者 +$ sudo apt-mark showhold + +python3 +``` + +这表明在执行完整的系统更新时,不会升级 python3 软件包。 + +``` +$ sudo apt update + +Reading package lists… Done +Building dependency tree +Reading state information… Done +Calculating upgrade… Done +The following packages have been kept back: + python3 +0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. +``` + +使用 `aptitude ` 命令运行以下命令以解除对 python3 软件包的保留。 + +``` +$ sudo aptitude unhold python3 +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/debian-ubuntu-exclude-hold-prevent-packages-from-apt-get-upgrade/ + +作者:[Magesh Maruthamuthu][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://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/redhat-centos-yum-update-exclude-specific-packages/ +[2]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[3]: https://www.2daygeek.com/dpkg-command-to-manage-packages-on-debian-ubuntu-linux-mint-systems/ diff --git a/published/20200309 6 Raspberry Pi tutorials to try out.md b/published/20200309 6 Raspberry Pi tutorials to try out.md new file mode 100644 index 0000000000..a15b85f450 --- /dev/null +++ b/published/20200309 6 Raspberry Pi tutorials to try out.md @@ -0,0 +1,68 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12005-1.html) +[#]: subject: (6 Raspberry Pi tutorials to try out) +[#]: via: (https://opensource.com/article/20/3/raspberry-pi-tutorials) +[#]: author: (Lauren Pritchett https://opensource.com/users/lauren-pritchett) + +6 个可以尝试的树莓派教程 +====== + +> 这些树莓派项目均旨在简化你的生活并提高生产力。 + +![](https://img.linux.net.cn/data/attachment/album/202003/17/142619e7jbh7dj5448nf1i.jpg) + +没有什么比体验树莓派创作结果更令人兴奋了。经过数小时的编程、测试和徒手构建,你的项目终于开始成形,你不禁大喊 “哇哦!”树莓派可以带给日常生活的可能性让我着迷。无论你是想学习新知识、尝试提高效率还是只是乐在其中,本文总有一个树莓派项目适合你。 + +### 设置 VPN 服务器 + +本[教程][2]教你如何使用树莓派添加一个网络安全层。这个项目不仅有实际好处,而且还能为你带来很多乐趣。额外的安全性使你可以放心地做其它项目,例如下面列出的项目。 + +### 创建一个物体跟踪摄像机 + +树莓派之所以具有吸引力,是因为它提供了较低的入门门槛来学习机器学习等新技术。这份[分步指南][3]提供了详尽的说明,说明了如何构建一个全景摄像头,以便使用 TensorFlow 和树莓派跟踪运动。 + +### 使用照片幻灯片展示你最喜欢的回忆 + +你是否曾经问过自己:“我应该怎么处理这些数码照片?”。如果你像我一样这样想过,那么答案是“是”。在朋友和家人圈子中,我被公认为摄像爱好者。这就是为什么我喜欢这个树莓派项目。在[本教程][4]中,你将学习如何设置照片幻灯片,以便轻松地在家里展示自己喜欢的回忆,而无需打印机! + +### 玩复古电子游戏 + +如果你对复古游戏系统怀有怀旧之情,那么可以尝试[本教程][5]。了解包括树莓派在内的哪些设备可以运行 Amiga 模拟器。完成设置后,你将可在树莓派上玩自己喜欢的 Amiga 游戏。 + +### 为你的娱乐中心搭建时钟 + +在过去的十年中,家庭娱乐中心发生了很大的变化。我的家人完全依靠流媒体服务来观看节目和电影。我之所以爱它是因为我可以通过移动设备或语音助手控制电视。但是,当你不再能一眼看到时钟时,便会失去一定程度的便利!请遵循[这些步骤][6],使用树莓派从头开始搭建自己的时钟显示。 + +### 扩大自制啤酒的生产规模 + +在[本教程][7]中,经验丰富的家庭酿酒师分享了他建立电动啤酒酿造系统的经验。该项目需要在硬件和零件上进行更多的前期投资,但由此产生的效率和一致性让这些值得。为此祝贺! + +如果你是像我这样的树莓派新手,那么我建议你阅读我们这些可下载的树莓派指南。我们的[单页速查表][8]提供了入门指南。有关更多技巧和教程,我们的[综合指南][9]涵盖了一些主题,例如选择树莓派、保持更新、为社区做出贡献等。 + +你会尝试哪个树莓派项目?让我们在评论中知道。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/raspberry-pi-tutorials + +作者:[Lauren Pritchett][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://opensource.com/users/lauren-pritchett +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/raspberrypi_cartoon.png?itok=m3TcBONJ (Cartoon graphic of Raspberry Pi board) +[2]: https://opensource.com/article/19/6/raspberry-pi-vpn-server +[3]: https://opensource.com/article/20/1/object-tracking-camera-raspberry-pi +[4]: https://opensource.com/article/19/2/wifi-picture-frame-raspberry-pi +[5]: https://opensource.com/article/19/3/amiga-raspberry-pi +[6]: https://opensource.com/article/17/7/raspberry-pi-clock +[7]: https://opensource.com/article/17/7/brewing-beer-python-and-raspberry-pi +[8]: https://opensource.com/downloads/getting-started-raspberry-pi-cheat-sheet +[9]: https://opensource.com/downloads/raspberry-pi-guide diff --git a/published/20200310 2020 Will Be a Year of Hindsight for SD-WAN.md b/published/20200310 2020 Will Be a Year of Hindsight for SD-WAN.md new file mode 100644 index 0000000000..6b4c3c1886 --- /dev/null +++ b/published/20200310 2020 Will Be a Year of Hindsight for SD-WAN.md @@ -0,0 +1,61 @@ +[#]: collector: (lujun9972) +[#]: translator: (hkurj) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12034-1.html) +[#]: subject: (2020 Will Be a Year of Hindsight for SD-WAN) +[#]: via: (https://www.networkworld.com/article/3531315/2020-will-be-a-year-of-hindsight-for-sd-wan.html) +[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) + +2020 年将是 SD-WAN 的回顾之年 +====== + +![](https://images.idgesg.net/images/article/2020/03/istock-1127447341-100834720-large.jpg) + +对于软件定义的广域网(SD-WAN),“过去看起来困难的选择,知道了这些选择的结果后,现在看起来就很清晰了” 这一说法再合适不过了。总结过去的几年:云计算和数字化转型促使公司重新评估传统的 WAN 技术,该技术不再能够满足其不断增长的业务需求。从那时起,SD-WAN 成为一种有前途的新技术。 + +SD-WAN 旨在解决物理设备的流量管理问题,并支持从云进行基于软件的配置。许多最初的 SD-WAN 部署都因希望取代昂贵的多协议标签交换 (MPLS) 而得到推动。公司希望它可以神奇地解决他们所有的网络问题。但是在实践中,基本的 SD-WAN 解决方案远没有实现这一愿景。 + +快速发展到现在,围绕 SD-WAN 的炒作已经尘埃落定,并且早期的实施工作已经过去。现在是时候回顾一下我们在 2019 年学到的东西以及在 2020 年要改进的地方。所以,让我们开始吧。 + +### 1、这与节省成本无关 + +大多数公司选择 SD-WAN 作为 MPLS 的替代品,因为它可以降低 WAN 成本。但是,[节省的成本][1]会因 SD-WAN 的不同而异,因此不应将其用作部署该技术的主要驱动力。无论公司需要什么,公司都应该专注于提高网络敏捷性,例如实现更快的站点部署和减少配置时间。SD-WAN 的主要驱动力是使网络更高效。如果成功实现那么成本也会随之降低。 + +### 2、WAN 优化是必要的 + +说到效率,[WAN 优化][2]提高了应用程序和数据流量的性能。通过应用协议加速、重复数据消除、压缩和缓存等技术,WAN 优化可以增加带宽、减少延迟并减轻数据包丢失。最初的想法是 SD-WAN 可以完成对 WAN 优化的需求,但是我们现在知道某些应用程序需要更多的性能支持。这些技术相互补充,而不是相互替代。它们应该用来解决不同的问题。 + +### 3、安全性不应该事后考虑 + +SD-WAN 具有许多优点,其中之一就是使用宽带互联网快速发送企业应用程序流量。但是这种方法也带来了安全风险,因为它使用户及其本地网络暴露于不受信任的公共互联网中。从一开始,安全性就应该成为 SD-WAN 实施的一部分,而不是在事后。公司可以通过使用[安全的云托管][3]之类的服务,将安全性放在分支机构附近,从而实现所需的应用程序性能和保护。 + +### 4、可见性对于 SD-WAN 成功至关重要 + +在应用程序和数据流量中具有[可见性][4],这使网络管理不再需要猜测。最好的起点是部署前阶段,在此阶段,公司可以在实施 SD-WAN 之前评估其现有功能以及缺少的功能。可见性以日常监控和警报的形式在部署后继续发挥重要作用。了解网络中正在发生的情况的公司会更好地准备应对性能问题,并可以利用这些知识来避免将来出现问题。 + +### 5、无线广域网尚未准备就绪 + +SD-WAN 可通过包括宽带和 4G/LTE 无线在内的任何传输将用户连接到应用程序。这就是[移动互联][5]越来越多地集成到 SD-WAN 解决方案中的原因。尽管公司渴望将 4G 用作潜在的传输替代方案(尤其是在偏远地区),但由此带来的按使用付费 4G 服务成本却很高。此外,由于延迟和带宽限制,4G 可能会出现问题。最好的方法是等待服务提供商部署具有更好的价格选择的 5G。今年我们将看到 5G 的推出,并更加关注无线 SD-WAN。 + +请务必观看以下 SD-WAN 视频系列:[你应该知道的所有关于 SD-WAN 的知识][6]。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3531315/2020-will-be-a-year-of-hindsight-for-sd-wan.html + +作者:[Zeus Kerravala][a] +选题:[lujun9972][b] +译者:[hkurj](https://github.com/hkurj) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Zeus-Kerravala/ +[b]: https://github.com/lujun9972 +[1]: https://blog.silver-peak.com/to-maximize-the-value-of-sd-wan-look-past-hardware-savings +[2]: https://blog.silver-peak.com/sd-wan-vs-wan-optimization +[3]: https://blog.silver-peak.com/sd-wans-enable-scalable-local-internet-breakout-but-pose-security-risk +[4]: https://blog.silver-peak.com/know-the-true-business-drivers-for-sd-wan +[5]: https://blog.silver-peak.com/mobility-and-sd-wan-part-1-sd-wan-with-4g-lte-is-a-reality +[6]: https://www.silver-peak.com/everything-you-need-to-know-about-sd-wan diff --git a/published/20200310 Basilisk- A Firefox Fork For The Classic Looks and Classic Extensions.md b/published/20200310 Basilisk- A Firefox Fork For The Classic Looks and Classic Extensions.md new file mode 100644 index 0000000000..b15e81597e --- /dev/null +++ b/published/20200310 Basilisk- A Firefox Fork For The Classic Looks and Classic Extensions.md @@ -0,0 +1,103 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12001-1.html) +[#]: subject: (Basilisk: A Firefox Fork For The Classic Looks and Classic Extensions) +[#]: via: (https://itsfoss.com/basilisk-browser/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Basilisk:一个有着经典的外观和扩展的 Firefox 复刻 +====== + +> Basilisk 是一个 Firefox 复刻,它支持旧版的扩展等更多功能。在这里,我们看一下它的功能并尝试一下。 + +![](https://img.linux.net.cn/data/attachment/album/202003/16/130319lvls6fvsaslzllrv.jpg) + +### Basilisk:基于 XUL 的开源 Web 浏览器 + +尽管最好使用 Linux 上的常规浏览器(如 Firefox 或 Chromium),但了解其他浏览器也没坏处。最近,我偶然发现了一个 Firefox 复刻:[Basilisk][1] 浏览器,它有经典的 Firefox 用户界面以及对旧版扩展的支持(就像 [Waterfox][2] 一样)。 + +![itsfoss.com homepage on Basilisk][3] + +如果你迫切需要使用旧版扩展程序或怀念 Firefox 的经典外观,Basilisk 浏览器可以帮到你。这个浏览器是由 [Pale Moon][4] 浏览器背后的团队维护(这是我接下来要介绍的另一个 Firefox 复刻)。 + +如果你正在寻找开源 [Chrome 替代品][5],那么你可以快速了解一下 Basilisk 提供的功能。 + +**注意:**Basilisk 是开发中软件。即使我在使用时没有遇到重大的可用性问题,但你也不应依赖它作为唯一使用的浏览器。 + +### Basilisk 浏览器的特性 + +![][6] + +Basilisk 开箱即用。但是,在考虑使用之前,可能需要先看一下以下这些特性: + +* 基于 [XUL][7] 的 Web 浏览器 +* 它具有 “Australis” Firefox 界面,这在 v29–v56 的 Firefox 版本中非常流行。 +* 支持 [NPAPI][8] 插件(Flash、Unity、Java 等) +* 支持 XUL/Overlay Mozilla 形式的扩展。 +* 使用 [Goanna][9] 开源浏览器引擎,它是 Mozilla [Gecko][10] 的复刻 +* 不使用 Rust 或 Photon 用户界面 +* 仅支持 64 位系统 + +### 在 Linux 上安装 Basilisk + +你可能没有在软件中心中找到它。因此,你必须前往其官方[下载页面][11]获得 tarball(tar.xz)文件。 + +下载后,只需将其解压缩并进入文件夹。接下来,你将在其中找到一个 `Basilisk` 可执行文件。你只需双击或右键单击并选择 “运行” 即可运行它。 + +你可以查看它的 [GitHub 页面][12]获取更多信息。 + +![][13] + +你也可以按照下面的步骤使用终端进入下载的文件夹,并运行文件: + +``` +cd basilisk-latest.linux64 +cd basilisk +./basilisk +``` + +- [下载 Basilisk][1] + +### 使用 Basilisk 浏览器 + +![][14] + +如果你想要支持旧版扩展,Basilisk 是不错的 Firefox 复刻。它是由 Pale Moon 背后的团队积极开发的,对于希望获得 Mozilla Firefox(在 Quantum 更新之前)经典外观,且不包括现代 Web 支持的用户而言,它可能是一个不错的选择。 + +浏览网页没有任何问题。但是,我注意到 YouTube 将其检测为过时的浏览器,并警告说它将很快停止支持它。 + +**因此,我不确定 Basilisk 是否适合所有现有的 Web 服务 —— 但是,如果你确实需要使用 Firefox 较早版本中的扩展,那这是一个解决方案。** + +### 总结 + +你认为这个 Firefox 复刻值得尝试吗?你喜欢哪个?在下面的评论中分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/basilisk-browser/ + +作者:[Ankush Das][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/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://www.basilisk-browser.org/ +[2]: https://itsfoss.com/waterfox-browser/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/basilisk-itsfoss.jpg?ssl=1 +[4]: https://www.palemoon.org +[5]: https://itsfoss.com/open-source-browsers-linux/ +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/basilisk-options-1.jpg?ssl=1 +[7]: https://developer.mozilla.org/en-US/docs/Archive/Mozilla/XUL +[8]: https://wiki.mozilla.org/NPAPI +[9]: https://en.wikipedia.org/wiki/Goanna_(software) +[10]: https://developer.mozilla.org/en-US/docs/Mozilla/Gecko +[11]: https://www.basilisk-browser.org/download.shtml +[12]: https://github.com/MoonchildProductions/Basilisk +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/basilisk-folder-1.jpg?ssl=1 +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/basilisk-browser-1.jpg?ssl=1 diff --git a/published/20200310 Containers vs. VMs, Istio in production, and more industry news.md b/published/20200310 Containers vs. VMs, Istio in production, and more industry news.md new file mode 100644 index 0000000000..c897efde43 --- /dev/null +++ b/published/20200310 Containers vs. VMs, Istio in production, and more industry news.md @@ -0,0 +1,85 @@ +[#]: collector: "lujun9972" +[#]: translator: "messon007" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-12015-1.html" +[#]: subject: "Containers vs. VMs, Istio in production, and more industry news" +[#]: via: "https://opensource.com/article/20/3/survey-istio-industry-news" +[#]: author: "Tim Hildred https://opensource.com/users/thildred" + +每周开源点评:容器 vs 虚拟机、生产环境中的 Istio 等 +====== + +> 本文是最近一周开源社区的新闻和行业进展。 + +![Person standing in front of a giant computer screen with numbers, data][1] + +我在一家采用开源软件开发模型的企业软件公司任高级产品营销经理,我的一部分职责是为产品营销人员,经理和其他相关人定期发布有关开源社区,市场和业界发展趋势的更新。以下是该更新中我和他们最喜欢的五篇文章。 + +### 云原生应用采用的技术:容器等 + +- [文章链接][2] + +> * 在生产环境中采用容器的比例从 2018 年的 73% 上升到 2019 年的 84%。其中,运行了至少 250 个容器的比例从 2018 年的 46% 上升到 2019 年的 58%。2017 到 2019 年间, 环境中拥有 50 台以上计算机(物理或虚拟)的受访者人数从 2017 年的 77% 上升到 2019 年的 81%。 +> * 表明: 容器的引入似乎缓解了需要管理的 VM 的快速增长。但是,请警惕要管理的原始机器数量会减少的说法。 +> + +**分析**:从直觉上看,随着容器使用的增长,虚拟机的增长将放缓;有许多容器被部署在虚拟机内部,从而充分利用了两者的优势特性,而且许多应用不会很快被容器化(留意下你所在企业的传统单体式应用)。 + +### 在生产环境中运行Istio的经验 + +- [文章链接][3] + +> 在 HelloFresh,我们将团队分为小队和团伙。每个团伙都有自己的 Kubernetes 命名空间。如上所述,我们先按命名空间启用 sidecar 注入,然后再逐个对应用启用。在将应用添加到 Istio 之前,我们举办了研讨会,以使小队了解其应用发生的变化。由于我们采用“您构建,您维护”的模型,团队可以在故障定位时了解应用的进出流量。不仅如此,它还提升了公司内部的知识量。我们还创建了 Istio 相关的 [OKR][4] ,来跟踪我们的进度并达成我们引入Istio的目的。 + +**分析**:引入或是不引入技术,要由自己决定,同时要自行承担相应的后果。 + +### Aether: 首个开源的边缘云平台 + +- [文章链接][5] + +> ONF 的营销副主席 Sloane 这样解释 Aether: 它将多个正在自己的沙箱中开发和运行的项目聚集到一起,ONF 试图在该框架下将多种边缘服务在一个融合平台上支持起来。ONF 的各个项目将保持独立并可继续单独使用,但是 Aether 试图将多个能力绑定到一起来简化企业的私有边缘云运营。 +> +> 他说:“我们认为我们正在创造一个新的合作空间,工业界和社区可以携手帮助推动通用平台背后的整合和关键工作,然后可以帮助这些边缘云中的通用功能不断发展”。 + +**分析**:当今,使用技术解决的问题过于复杂,无法通过单一技术解决。比技术更重要的是要解决的业务问题需要聚焦于真正增值的部分。将两者结合起来,就是企业之间需要在他们共同的需求上找到合作的方法,并在它们特有的方面进行竞争。除了开源,你找不到比这更好的方法了。 + +### 与云相关职业的女性正在改变现状 + +- [文章链接][6] + +> Yordanova 说:“由于云是一种相对较新的技术,我的[成为一名“科技女性”][7]的经验可能并不典型,因为云行业极为多样化”。“实际上,我的团队中性别比例相当,成员由随着云技术而成长的不同个性、文化和优势的具体人员组成。“ + +**分析**:我想考虑的一件事就是跨越式的演进思路。你可能可以跳过演进过程中的某个步骤或阶段,因为原先导致其存在的条件已不再适用。云技术时代没有形成“谁发明的以及它是为谁而生”的固有说法,所以也许它所承载的某些前代的技术负担更少? + +### StarlingX 如何在中国开源项目的星空中闪耀 + +- [文章链接][8] + +> 我们的团队在中国,因此我们的任务之一是帮助中国的社区开发软件、贡献代码、文档等。大多数 StarlingX 项目会议是在中国的深夜举行,因此华人社区成员的出席和参与颇具挑战。为了克服这些障碍,我们与中国的其他社区成员(例如 99cloud 的朋友)一起采取了一些措施,例如和其他社区成员一起聚会,一起参加动手实践研讨会和中文的特设技术会议,将一些文档翻译成中文,并在微信小组中不断进行互动(就像每个人都可以享受的 24/7 通话服务一样) + +**分析**:随着中国对开源项目的贡献不断增长,这种情况似乎有可能逆转或至少相当。“学习英语”根本不是参与开源项目开发的先决条件。 + +希望你喜欢这个列表,下周再见。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/survey-istio-industry-news + +作者:[Tim Hildred][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://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://thenewstack.io/cncf-survey-snapshot-tech-adoption-in-the-cloud-native-world/ +[3]: https://engineering.hellofresh.com/everything-we-learned-running-istio-in-production-part-1-51efec69df65 +[4]: https://en.wikipedia.org/wiki/OKR +[5]: https://www.sdxcentral.com/articles/news/onf-projects-coalesce-for-enterprise-edge-cloud/2020/03/ +[6]: https://www.cloudpro.co.uk/leadership/cloud-essentials/8446/how-women-in-cloud-are-challenging-the-narrative +[7]: https://www.itpro.co.uk/business-strategy/33301/diversity-not-a-company-priority-claim-nearly-half-of-women-in-tech +[8]: https://superuser.openstack.org/articles/starlingx-community-interview-how-starlingx-shines-in-the-starry-sky-of-open-source-projects-in-china/ diff --git a/published/20200310 Run Kubernetes on a Raspberry Pi with k3s.md b/published/20200310 Run Kubernetes on a Raspberry Pi with k3s.md new file mode 100644 index 0000000000..79b42ade4d --- /dev/null +++ b/published/20200310 Run Kubernetes on a Raspberry Pi with k3s.md @@ -0,0 +1,187 @@ +[#]: collector: (lujun9972) +[#]: translator: (HankChow) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12049-1.html) +[#]: subject: (Run Kubernetes on a Raspberry Pi with k3s) +[#]: via: (https://opensource.com/article/20/3/kubernetes-raspberry-pi-k3s) +[#]: author: (Lee Carpenter https://opensource.com/users/carpie) + +使用 K3s 在树莓派上运行 Kubernetes 集群 +====== + +> 跟随接下来的介绍,自己搭建一个三节点的 Kubernetes 集群。 + +![](https://img.linux.net.cn/data/attachment/album/202003/29/121559p44e3dfrerf3zver.jpg) + +我对在树莓派上搭建 [Kubernetes][2] 集群已经感兴趣很长时间了,只要照着网上的教程,我可以在由三个树莓派组成的集群中搭建一套 Kubernetes 并正常运行。但在这种情况下,主节点上的内存和 CPU 资源捉襟见肘,执行 Kubernetes 任务的时候往往性能不佳,想要升级 Kubernetes 就更不可能了。 + +这个时候,我非常激动地发现了 [K3s][3] 这个项目。K3s 被誉为在可用于资源受限环境下的轻量级 Kubernetes,它还针对 ARM 处理器做出了优化,这让 Kubernetes 集群可以在树莓派上运行得更好。在下文中,我们将会使用 K3s 来创建一个 Kubernetes 集群。 + +- [video](https://youtu.be/6PqxJhV-t1s) + +### 准备 + +要按照本文介绍的方式创建 Kubernetes 集群,首先需要准备: + +* 至少一个树莓派(包括 SD 卡和电源) +* 网线 +* 将所有树莓派连接到一起的交换机或路由器 + +我们会通过在线安装的方式安装 K3s,因此还需要可以连接到互联网。 + +### 集群概览 + +在这个集群里,我们会使用三个树莓派。其中一个树莓派作为主节点,我们将它命名为 `kmaster`,并为其分配一个静态 IP `192.168.0.50`(注:假设使用的私有网段是 192.168.0.0/24),而另外两个树莓派作为工作节点,分别命名为 `knode1` 和 `knode2`,也分别分配 `192.168.0.51` 和 `192.168.0.52` 两个 IP 地址。 + +当然,如果你实际的网络布局和上面不同,只要将文中所提及到的 IP 替换成你实际可用的 IP 就可以了。 + +为了不需要通过 IP 来引用某一个节点,我们将每个节点的主机名记录到 PC 的 `/etc/hosts` 文件当中: + +``` +echo -e "192.168.0.50\tkmaster" | sudo tee -a /etc/hosts +echo -e "192.168.0.51\tknode1" | sudo tee -a /etc/hosts +echo -e "192.168.0.52\tknode2" | sudo tee -a /etc/hosts +``` + +### 部署主节点 + +我们首先部署主节点。最开始的步骤当然是使用镜像安装最新的 Raspbian,这个步骤可以参考我的[另一篇文章][4],在这里就不展开介绍了。在安装完成之后,启动 SSH 服务,将主机名设置为 `kmaster`,然后分配静态 IP `192.168.0.50`。 + +在主节点上安装 Raspbian 完成后,启动树莓派并通过 `ssh` 连接上去: + +``` +ssh pi@kmaster +``` + +在主节点上执行以下命令安装 K3s: + +``` +curl -sfL https://get.k3s.io | sh - +``` + +等到命令跑完以后,一个单节点集群就已经运行起来了。让我们检查一下,还在这个树莓派上执行: + +``` +sudo kubectl get nodes +``` + +就会看到这样的输出: + +``` +NAME STATUS ROLES AGE VERSION +kmaster Ready master 2m13s v1.14.3-k3s.1 +``` + +### 获取连接令牌join token + +之后我们需要部署工作节点。在工作节点上安装 K3s 的时候,会需要用到连接令牌,它放置在主节点的文件系统上。首先把连接令牌保存出来以便后续使用: + +``` +sudo cat /var/lib/rancher/k3s/server/node-token +``` + +### 部署工作节点 + +通过 SD 卡在每个作为工作节点的树莓派上安装 Raspbian。在这里,我们把其中一个树莓派的主机名设置为 `knode1`,为其分配 IP 地址 `192.168.0.51`,另一个树莓派的主机名设置为 `knode2`,分配 IP 地址 `192.168.0.52`。接下来就可以安装 K3s 了。 + +启动主机名为 `knode1` 的树莓派,通过 `ssh` 连接上去: + +``` +ssh pi@knode1 +``` + +在这个树莓派上,安装 K3s 的过程和之前差不多,但需要另外加上一些参数,表示它是一个工作节点,需要连接到一个已有的集群上: + +``` +curl -sfL http://get.k3s.io | K3S_URL=https://192.168.0.50:6443 \ +K3S_TOKEN=刚才保存下来的连接令牌 sh - +``` + +`K3S_TOKEN` 的值需要替换成刚才保存下来的实际的连接令牌。完成之后,在主机名为 `knode2` 的树莓派上重复这个安装过程。 + +### 通过 PC 访问集群 + +现在如果我们想要查看或者更改集群,都必须 `ssh` 到集群的主节点才能使用 `kubectl`,这是比较麻烦的。因此我们会将 `kubectl` 放到 PC 上使用。首先,在主节点上获取一些必要的配置信息,`ssh` 到 `kmaster` 上执行: + +``` +sudo cat /etc/rancher/k3s/k3s.yaml +``` + +复制上面命令的输出,然后在你的 PC 上创建一个目录用来放置配置文件: + +``` +mkdir ~/.kube +``` + +将复制好的内容写入到 `~/.kube/config` 文件中,然后编辑该文件,将 + +``` +server: https://localhost:6443 +``` + +改为 + +``` +server: https://kmaster:6443 +``` + +出于安全考虑,只对自己保留这个配置文件的读写权限: + +``` +chmod 600 ~/.kube/config +``` + +如果 PC 上还没有安装 `kubectl` 的话,就可以开始安装了。Kubernetes 官方网站上有各种平台安装 `kubectl` 的[方法说明][5],我使用的是 Ubuntu 的衍生版 Linux Mint,所以我的安装方法是这样的: + +``` +sudo apt update && sudo apt install -y apt-transport-https +curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - +echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list +sudo apt update && sudo apt install kubectl +``` + +上面几个命令的作用是添加了一个包含 Kubernetes 的 Debian 软件库,获取 GPG 密钥以确保安全,然后更新软件包列表并安装 `kubectl`。如果 `kubectl` 有更新,我们将会通过标准软件更新机制standard software update mechanism收到通知。 + +现在在 PC 上就可以查看 Kubernetes 集群了: + +``` +kubectl get nodes +``` + +输出大概会是这样: + +``` +NAME STATUS ROLES AGE VERSION +kmaster Ready master 12m v1.14.3-k3s.1 +knode1 Ready worker 103s v1.14.3-k3s.1 +knode1 Ready worker 103s v1.14.3-k3s.1 +``` + +至此,我们已经搭建了一个三节点的 Kubernetes 集群。 + +### K3s 的彩蛋 + +如果执行 `kubectl get pods --all-namespaces`,就会看到其它服务的一些 Pod,比如 [Traefik][6]。Traefik 在这里起到是反向代理和负载均衡器的作用,它可以让流量从单个入口进入集群后引导到集群中的各个服务。Kubernetes 支持这种机制,但 Kubernetes 本身不提供这个功能,因此 Traefik 是一个不错的选择,K3s 安装后立即可用的优点也得益于此。 + +在后续的文章中,我们会继续探讨 Traefik 在 Kubernetes ingress 中的应用,以及在集群中部署其它组件。敬请关注。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/kubernetes-raspberry-pi-k3s + +作者:[Lee Carpenter][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://opensource.com/users/carpie +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ship_wheel_gear_devops_kubernetes.png?itok=xm4a74Kv (A ship wheel with someone steering) +[2]: https://opensource.com/resources/what-is-kubernetes +[3]: https://k3s.io/ +[4]: https://carpie.net/articles/headless-pi-with-static-ip-wired-edition +[5]: https://kubernetes.io/docs/tasks/tools/install-kubectl/ +[6]: https://traefik.io/ diff --git a/published/20200311 How to install pip to manage PyPI packages easily.md b/published/20200311 How to install pip to manage PyPI packages easily.md new file mode 100644 index 0000000000..b6453085c1 --- /dev/null +++ b/published/20200311 How to install pip to manage PyPI packages easily.md @@ -0,0 +1,145 @@ +[#]: collector: (lujun9972) +[#]: translator: (HankChow) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11993-1.html) +[#]: subject: (How to install pip to manage PyPI packages easily) +[#]: via: (https://opensource.com/article/20/3/pip-linux-mac-windows) +[#]: author: (Vijay Singh Khatri https://opensource.com/users/vijaytechnicalauthor) + +安装 pip 轻松管理 PyPI 软件包 +====== + +> 在 Linux、Mac 或 Windows 上为旧版 Python 安装 pip。 + +![](https://img.linux.net.cn/data/attachment/album/202003/14/102539wq3a73opalpzoabb.jpg) + +Python 是一种功能强大、流行广泛的编程语言,在常规编程、数据科学等很多方面它都有丰富的软件包可供使用。但这些软件包通常都不会在 Python 安装时自动附带,而是需要由用户自行下载、安装和管理。所有的这些软件包(包括库和框架)都存放在一个名叫 [PyPI][2](也就是 Python 软件包索引 Python Package Index)的中央存储库当中,而 `pip`(也就是首选安装程序Preferred Installer Program)则是管理这个中央存储库的工具。 + +在安装 `pip` 之后,管理 PyPI 的软件包就变得很方便了。大部分的软件包都可以通过在终端或者命令行界面执行 `python -m pip install <软件包名>` 这样的命令来完成安装。 + +较新版本的 Python 3(3.4 或以上)和 Python 2(2.7.9 或以上)都已经预装了 `pip`,旧版本的 Python 没有自带 `pip`,但可以另外安装。 + +在这篇文章中,我将会介绍 `pip` 在 Linux、Mac 和 Windows 系统上的安装过程。想要了解更多详细信息,可以参考 [pip.pypa][3] 的文档。 + +### 首先需要安装 Python + +首先你的系统中需要安装好 Python,否则 `pip` 安装器无法理解任何相关的命令。你可以在命令行界面、Bash 或终端执行 `python` 命令确认系统中是否已经安装 Python,如果系统无法识别 `python` 命令,请先[下载 Python][4] 并安装。安装完成后,你就可以看到一些引导你安装 `pip` 的提示语了。 + +### 在 Linux 上安装 pip + +在不同发行版的 Linux 上,安装 `pip` 的命令也有所不同。 + +在 Fedora、RHEL 或 CentOS 上,执行以下命令安装: + +``` +$ sudo dnf install python3 +``` + +在 Debian 或 Ubuntu 上,使用 `apt` 包管理工具安装: + +``` +$ sudo apt install python3-pip +``` + +其它的发行版可能还会有不同的包管理工具,比如 Arch Linux 使用的是 `pacman`: + +``` +$ sudo pacman -S python-pip +``` + +执行 `pip --version` 命令就可以确认 `pip` 是否已经正确安装。 + +在 Linux 系统上安装 `pip` 就是这样简单,你可以直接跳到“使用 pip”部分继续阅读。 + +### 在 Mac 上安装 pip + +MacOS 已经预装了 Python,但 Python 版本一般是比较旧的。如果你要使用 Python 的话,建议[另外安装 Python 3][6]。 + +在 Mac 上可以使用 [homebrew][7] 安装 Python 3: + +``` +$ brew update && brew upgrade python +``` + +如果你安装的是以上提到的新版本 Python 3,它会自带 `pip` 工具。你可以使用以下命令验证: + +``` +$ python3 -m pip --version +``` + +如果你使用的是 Mac,安装过程也到此结束,可以从“使用 pip”部分继续阅读。 + +### 在 Windows 上安装 pip + +以下 `pip` 安装过程是针对 Windows 8 和 Windows 10 的。下面文章中的截图是 Windows 10 环境下的截图,但对 Windows 8 同样适用。 + +首先确认 [Python 已经安装完成][8]。 + +如果你想在 Windows 系统上像 Linux 一样使用包管理工具,[Chocolatey][9] 是一个不错的选择,它可以让 Python 的调用和更新变得更加方便。Chocolatey 在 PowerShell 中就可以运行,只需要简单的命令,Python 就可以顺利安装。 + +``` +PS> choco install python +``` + +接下来就可以使用 `pip` 安装所需的软件包了。 + +### 使用 pip + +在 Linux、BSD、Windows 和 Mac 上,`pip` 都是以同样的方式使用的。 + +例如安装某个库: + +``` +python3 -m pip install foo --user +``` + +卸载某个已安装的库: + +``` +python3 -m pip uninstall foo +``` + +按照名称查找软件包: + +``` +python3 -m pip search foo +``` + +将 `pip` 更新到一个新版本: + +``` +$ sudo pip install --upgrade pip +``` + +需要注意的是,在 Windows 系统中不需要在前面加上 `sudo` 命令,这是因为 Windows 通过独有的方式管理用户权限,对应的做法是[创建一个执行策略例外][10]。 + +``` +python -m pip install --upgrade pip +``` + +希望本文介绍的的方法能对你有所帮助,欢迎在评论区分享你的经验。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/pip-linux-mac-windows + +作者:[Vijay Singh Khatri][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://opensource.com/users/vijaytechnicalauthor +[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://pypi.org/ +[3]: https://pip.pypa.io/en/stable/installing/ +[4]: https://www.python.org/downloads/ +[5]: tmp.u1JOYd3gs9#usage +[6]: https://opensource.com/article/19/5/python-3-default-mac +[7]: https://brew.sh +[8]: https://opensource.com/article/19/8/how-install-python-windows +[9]: https://opensource.com/article/20/3/chocolatey +[10]: https://opensource.com/article/20/3/chocolatey#admin diff --git a/published/20200312 Amazon Has Launched Its Own Linux Distribution But It-s Not for Everyone.md b/published/20200312 Amazon Has Launched Its Own Linux Distribution But It-s Not for Everyone.md new file mode 100644 index 0000000000..49d54dbc48 --- /dev/null +++ b/published/20200312 Amazon Has Launched Its Own Linux Distribution But It-s Not for Everyone.md @@ -0,0 +1,87 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12018-1.html) +[#]: subject: (Amazon Has Launched Its Own Linux Distribution But It’s Not for Everyone) +[#]: via: (https://itsfoss.com/bottlerocket-linux/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Amazon 推出了自己的容器专用 Linux 发行版“瓶装火箭” +====== + +![](https://img.linux.net.cn/data/attachment/album/202003/21/074953h0a55lq72h0qlpzd.jpg) + +Amazon 已经[推出][1]了自己的基于 Linux 的开源操作系统 Bottlerocket(“瓶装火箭”)。但在你兴奋地想要尝试安装和运行它之前,我必须告诉你,它不是常规的如 Ubuntu、Fedora 或 Debian 这样的 Linux 发行版。那它是什么? + +### Bottlerocket:来自 Amazon 的 Linux 发行版,用于运行容器 + +![][2] + +如果你不了解 Linux 容器,建议你阅读 Red Hat 的[这篇文章][3]。 + +自从首次提出云计算一词以来,IT 行业发生了许多变化。得益于 Amazon AWS、Google、Linode、Digital Ocean 等云服务器提供商,部署 Linux 服务器(通常在虚拟机中运行)只需几秒钟。最重要的是,你可以借助 Docker 和 Kubernetes 之类的工具在这些服务器上以容器形式部署应用和服务。 + +问题是,当你唯一目的是在 Linux 系统上运行容器时,并不总是需要完整的 Linux 发行版。这就是为什么容器专用 Linux 仅提供必要软件包的原因。这将大大减少操作系统的大小,从而进一步减少部署时间。 + +[Bottlerocket][5] Linux 由 Amazon Web Services(AWS)专门构建,用于在虚拟机或裸机上运行容器。它支持 docker 镜像和其他遵循 [OCI 镜像][6]格式的镜像。 + +### Bottlerocket Linux 的特性 + +![][7] + +这是来自 Amazon 的新 Linux 发行版提供的特性: + +#### 没有逐包更新 + +传统的 Linux 发行版更新过程由更新单个软件包组成。Bottlerocket 改用基于镜像的更新。 + +由于采用了这种方法,可以避免冲突和破坏,并可以进行快速而完整的回滚(如有必要)。 + +#### 只读文件系统 + +Bottlerocket 还使用了只读主文件系统。在启动时通过 dm-verity 检查其完整性。在其他安全措施上,也不建议使用 SSH 访问,并且只能通过[管理容器][8](附加机制)使用。 + +AWS 已经统治了云世界。 + +#### 自动更新 + +你可以使用 Amazon EKS 之类的编排服务来自动执行 Bottlerocket 更新。 + +Amazon 还声称,与通用 Linux 发行版相比,仅包含运行容器的基本软件可以减少攻击面。 + +### 你怎么看? + +Amazon 并不是第一个创建“容器专用 Linux” 的公司。我认为 CoreOS 是最早的此类发行版之一。[CoreOS 被 Red Hat 收购][9],Red Hat 又被 [IBM 收购][10]。Red Hat 公司最近停用了 CoreOS,并用 [Fedora CoreOS][11] 代替了它。 + +云服务器是一个巨大的行业,它将继续发展壮大。像 Amazon 这样的巨头将竭尽所能与它竞争对手保持一致或领先。我认为,Bottlerocket 是对 IBM Fedora CoreOS(目前)的应答。 + +尽管 [Bottlerocket 仓库可在 GitHub 上找到][12],但我还没发现就绪的镜像(LCTT 译注:源代码已经提供)。在撰写本文时,它仅[可在 AWS 上预览][5]。 + +你对此有何看法?Amazon 会从 Bottlerocket 获得什么?如果你以前使用过 CoreOS 之类的软件,你会切换到 Bottlerocket 么? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/bottlerocket-linux/ + +作者:[Abhishek Prakash][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/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://aws.amazon.com/blogs/aws/bottlerocket-open-source-os-for-container-hosting/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/botlerocket-logo.png?ssl=1 +[3]: https://www.redhat.com/en/topics/containers/whats-a-linux-container +[4]: https://www.linode.com/ +[5]: https://aws.amazon.com/bottlerocket/ +[6]: https://www.opencontainers.org/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/BottleRocket.png?ssl=1 +[8]: https://github.com/bottlerocket-os/bottlerocket-admin-container +[9]: https://itsfoss.com/red-hat-acquires-coreos/ +[10]: https://itsfoss.com/ibm-red-hat-acquisition/ +[11]: https://getfedora.org/en/coreos/ +[12]: https://github.com/bottlerocket-os/bottlerocket diff --git a/published/20200313 6 Best AUR (Arch User Repository) Helpers for Arch Linux.md b/published/20200313 6 Best AUR (Arch User Repository) Helpers for Arch Linux.md new file mode 100644 index 0000000000..0a49142c98 --- /dev/null +++ b/published/20200313 6 Best AUR (Arch User Repository) Helpers for Arch Linux.md @@ -0,0 +1,215 @@ +[#]: collector: (lujun9972) +[#]: translator: (hkurj) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12019-1.html) +[#]: subject: (6 Best AUR (Arch User Repository) Helpers for Arch Linux) +[#]: via: (https://www.2daygeek.com/best-aur-arch-user-repository-helpers-arch-linux-manjaro/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +6 个用于 Arch Linux 的最佳 AUR 助手 +====== + +![](https://img.linux.net.cn/data/attachment/album/202003/21/082920kxdmlwkk7xx7llpw.jpeg) + +Arch Linux 是一款 Linux 发行版,主要由针对 x86-64 微处理器计算机的二进制软件包组成。Arch Linux 使用的是滚动发布模型,这种模式会频繁的给应用程序交付更新。它使用名为 [pacman][1] 的软件包管理器,可以用来安装、删除和更新软件包。 + +由于 Arch Linux 是为有经验的用户构建的,建议新手在使用过其他 Linux 后再来尝试。 + +### 什么是 AUR(Arch 用户软件仓库)? + +[Arch 用户软件仓库][2] 通常称为 AUR,是给 Arch 用户的基于社区的软件存储库。 + +根据软件包在 AUR 社区的流行程度,用户编译的软件包会进入到 Arch 的官方存储库。 + +### 什么是 AUR 助手? + +[AUR 助手][3]是一个包装程序,允许用户从 AUR 存储库安装软件包,而无需手动干预。 + +很多用例实现了自动化,比如包搜索、解决依赖关系、检索和构建 AUR 包、Web 内容检索和 AUR 包提交之类。 + +以下列出了 6 种最佳的 AUR 助手: + +* Yay(Yet another Yogurt) +* Pakku +* Pacaur +* Pikaur +* Trizen +* Aura + +### 1)Yay(Yet another Yogurt) + +[Yay][4] 是 Arch Linux 下基于 CLI 的最佳 AUR 助手,使用 Go 语言编写。Yay 是基于 yaourt、apacman 和 pacaur 设计的。 + +这是最合适推荐给新手的 AUR 助手。类似于 Pacman,其使用方法和 `pacman` 中的命令和选项很相似,可以让用户在搜索过程中找到匹配的软件包提供程序,并进行选择。 + +#### 如何安装 yay + +依次运行以下命令以在 Arch Linux 系统上安装。 + +``` +$ sudo pacman -S git go base-devel +$ git clone https://aur.archlinux.org/yay.git +$ cd yay +$ makepkg -si +``` + +#### 如何使用 yay + +`yay` 语法与 `pacman` 相同,使用以下命令安装软件包。 + +``` +$ yay -s arch-wiki-man +``` + +### 2)Pakku + +[Pakku][5] 可以被视为一个初始阶段的 Pacman。它是一个包装程序,可以让用户从 AUR 中搜索或安装软件包。 + +它在删除依赖项方面做得不错,并且还允许通过克隆 PKGBUILD 来安装软件包。 + +#### 如何安装 Pakku + +要在 Arch Linux 的系统上安装 Pakku,请依次运行以下命令。 + +``` +$ sudo pacman -S git base-devel +$ git clone https://aur.archlinux.org/pakku.git +$ cd pakku +$ makepkg -si +``` + +#### 如何使用 Pakku + +`pakku` 语法与 `pacman` 相同,使用以下命令安装软件包。 + +``` +$ pakku -s dropbox +``` + +### 3)Pacaur + +另一个基于 CLI 的 AUR 助手,可帮助减少用户与提示符的交互。 + +[Pacaur][6] 专为倾向于自动化重复任务的高级用户而设计。用户需要熟悉 `makepkg` 及其配置的 AUR 手动构建过程。 + +#### 如何安装 Pacaur + +要在 Arch Linux 的系统上安装 Pakku,请依次运行以下命令。 + +``` +$ sudo pacman -S git base-devel +$ git clone https://aur.archlinux.org/pacaur.git +$ cd pacaur +$ makepkg -si +``` + +#### 如何使用 Pacaur + +`pacaur` 语法与 `pacman` 相同,使用以下命令安装软件包。 + +``` +$ pacaur -s spotify +``` + +### 4)Pikaur + +[Pikaur][7] 是具有最小依赖性的 AUR 助手,可以一次查看所有 PKGBUILD,无需用户交互即可全部构建。 + +Pikaur 将通过控制 `pacman` 命令来告知 Pacman 要执行的下一个步骤。 + +#### 如何安装 Pikaur + +要在 Arch Linux 的系统上安装 Pakku,请依次运行以下命令。 + +``` +$ sudo pacman -S git base-devel +$ git clone https://aur.archlinux.org/pikaur.git +$ cd pikaur +$ makepkg -fsri +``` + +#### 如何使用 Pikaur + +`pikaur` 语法与 `pacman` 相同,使用以下命令安装软件包。 + +``` +$ pacaur -s spotify +``` + +### 5)Trizen + +[Trizen][8] 是用 Perl 编写的基于命令行的 AUR 轻量级包装器。这个面向速度的 AUR 助手,它允许用户搜索、安装软件包,还允许阅读 AUR 软件包注释。 + +支持编辑文本文件,并且输入/输出使用 UTF-8。内置与 `pacman` 的交互功能。 + +#### 如何安装 Trizen + +要在 Arch Linux 的系统上安装 Trizen,请依次运行以下命令。 + +``` +$ sudo pacman -S git base-devel +$ git clone https://aur.archlinux.org/trizen.git +$ cd trizen +$ makepkg -si +``` + +#### 如何使用 Trizen + +`trizen` 语法与 `pacman` 相同,使用以下命令安装软件包。 + +``` +$ pacaur -s google-chrome +``` + +### 6)Aura + +[Aura][9] 是用 Haskell 编写的,是用于 Arch Linux 和 AUR 的安全的多语言包管理器。它支持许多Pacman 操作和子选项,可轻松进行开发并编写精美的代码。 + +它可以自动从 AUR 安装软件包。使用 Aura 时,用户通常会在系统升级方面遇到一些困难。 + +#### 如何安装 Aura + +要在 Arch Linux 的系统上安装 Pakku,请依次运行以下命令。 + +``` +$ sudo pacman -S git base-devel +$ git clone https://aur.archlinux.org/aura.git +$ cd aura +$ makepkg -si +``` + +#### 如何使用 Aura + +`aura` 语法与 `pacman` 相同,使用以下命令安装软件包。 + +``` +$ pacaur -s android-sdk +``` + +### 结论 + +用户可以凭借这些分析在上述 6 个 AUR 助手中进行选择。 + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/best-aur-arch-user-repository-helpers-arch-linux-manjaro/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[hkurj](https://github.com/hkurj) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[2]: https://wiki.archlinux.org/index.php/Arch_User_Repository +[3]: https://wiki.archlinux.org/index.php/AUR_helpers +[4]: https://github.com/Jguer/yay +[5]: https://github.com/kitsunyan/pakku +[6]: https://github.com/E5ten/pacaur +[7]: https://github.com/actionless/pikaur +[8]: https://github.com/trizen/trizen +[9]: https://github.com/fosskers/aura diff --git a/published/20200313 GNOME 3.36 Released With Visual - Performance Improvements.md b/published/20200313 GNOME 3.36 Released With Visual - Performance Improvements.md new file mode 100644 index 0000000000..f193b4d245 --- /dev/null +++ b/published/20200313 GNOME 3.36 Released With Visual - Performance Improvements.md @@ -0,0 +1,114 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12030-1.html) +[#]: subject: (GNOME 3.36 Released With Visual & Performance Improvements) +[#]: via: (https://itsfoss.com/gnome-3-36-release/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +GNOME 3.36 发布,对视觉和性能进行了改进 +====== + +![](https://img.linux.net.cn/data/attachment/album/202003/23/151837oglshll1b7kjj8jg.jpg) + +在 [GNOME 3.34][1] 发布 6 个月后,最新版本的 GNOME 3.36 代号为 “Gresik” 也最终发布了。不仅是添加了功能,GNOME 3.36 还改进了许多我们需要的功能。 + +在本文中,我将重点介绍 GNOME 新版本的主要更改。 + +### GNOME 3.36 的关键改进 + +如果你想快速了解发生了什么变化,可以看以下官方视频: + +[视频][2] + +现在,让我分别重点介绍最新版本中的更改: + +#### GNOME Shell 扩展应用 + +你可以通过专门的“扩展”程序轻松管理 GNOME Shell 的扩展。 + +![][3] + +因此,你可以使用该程序更新、配置、删除或禁用现有扩展。 + +#### 切换到请勿打扰(DND) + +![][4] + +你可能已经在 Pop!\_OS 或其他 Linux 发行版中注意到了它。 + +但是,GNOME 3.36 现在在通知弹出区域中实现了 DND 切换。除非你将其关闭,否则不会收到任何通知。 + +#### 锁屏改进 + +![][5] + +在新版本中,锁定屏幕在输入凭据之前没有额外的动画。取而代之会在登录屏幕直接打招呼。 + +另外,为了提升一致性,锁屏背景将是墙纸的模糊版本。 + +总的来说,对锁屏的改进旨在使之更易于访问,同时改善其外观/感觉。 + +#### 视觉变化 + +![][6] + +包含了一些明显的新增,这些设计更改改善了 GNOME 3.36 的总体外观。 + +从图标的重新设计到文件夹和系统对话框,进行了许多小的改进以增强 GNOME 3.36 的用户体验。 + +此外,设置应用已进行了调整,通过微小的界面重新设计,使得选项访问更加容易。 + +#### 主要性能改进 + +GNOME 声称,此更新还提升了 GNOME 桌面的性能。 + +当使用装有 GNOME 3.36 的发行版时,你会注意到在性能上有明显的不同。无论是动画、重新设计还是微小的调整,对于 GNOME 3.36 所做的一切都会对用户的性能产生积极影响。 + +#### 其他更改 + +除了上述关键更改之外,还有很多其他改进,例如: + +* 时钟重新设计 +* 用户文档更新 +* GNOME 安装助手改进 + +还有许多其他更改。你可以查看[官方发布说明][7]了解更多信息。 + +### 如何获取 GNOME 3.36? + +即使 GNOME 3.36 已正式发布。Linux 发行版可能需要一段时间才能让你轻松升级 GNOME 体验。 + +[Ubuntu 20.04 LTS][8] 将提供最新版本 GNOME。你可以等待。 + +其他[流行的 Linux 发行版][9],如 Fedora、OpenSuse、Pop!\_OS,应该会很快包含 GNOME 3.36。[Arch Linux][10] 已升级到 GNOME 3.36。 + +我建议你耐心等待,直到获得发行版本的更新。不过,你可以查看[源代码][11]或尝试即将发布的流行发行版的开发版本,这些发行版可能有 GNOME 3.36。 + +你如何看待 GNOME 3.36?在下面的评论中让我知道你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/gnome-3-36-release/ + +作者:[Ankush Das][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/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/gnome-3-34-release/ +[2]: https://img.linux.net.cn/static/video/Introducing%20GNOME%203.36%20-%20%27Gresik%27-ae2D4aWTsXM.mp4 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/extensions-gnome.jpg?ssl=1 +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/dnd-gnome.jpg?ssl=1 +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/gnome-lockscreen.jpg?ssl=1 +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/gnome-settings.jpg?ssl=1 +[7]: https://help.gnome.org/misc/release-notes/3.36/ +[8]: https://itsfoss.com/ubuntu-20-04-release-features/ +[9]: https://itsfoss.com/best-linux-distributions/ +[10]: https://www.archlinux.org/ +[11]: https://gitlab.gnome.org/GNOME diff --git a/published/20200313 How to Change MAC Address in Linux.md b/published/20200313 How to Change MAC Address in Linux.md new file mode 100644 index 0000000000..5e8d12da57 --- /dev/null +++ b/published/20200313 How to Change MAC Address in Linux.md @@ -0,0 +1,173 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12008-1.html) +[#]: subject: (How to Change MAC Address in Linux) +[#]: via: (https://itsfoss.com/change-mac-address-linux/) +[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/itsfoss/) + +如何在 Linux 中更改 MAC 地址 +====== + +在向你展示如何在 Linux 中更改 MAC 地址之前,让我们首先讨论为什么要更改它。 + +可能有几个原因。也许你不希望在公共网络上公开你的实际 [MAC 地址][1](也称为物理地址)?还有可能是网络管理员可能已在路由器或防火墙中阻止了特定的 MAC 地址。 + +一个实用的“好处”是某些公共网络(例如机场 WiFi)允许在有限的时间内免费上网。如果你还想继续使用,那么伪造 Mac 地址可能会欺骗网络,让它认为是一台新设备。这也是一个有名的原因。 + +![](https://img.linux.net.cn/data/attachment/album/202003/18/120702qdjyb7hvyj7bsrj7.jpg) + +我将展示更改 MAC 地址(也称为欺骗/伪造 MAC 地址)的步骤。 + +### 在 Linux 中更改 MAC 地址 + +让我们一步步来: + +#### 查找你的 MAC 地址和网络接口 + +让我们找出一些[关于 Linux 中网卡的细节][3]。使用此命令获取网络接口详细信息: + +``` +ip link show +``` + +在输出中,你将看到一些详细信息以及 MAC 地址: + +``` +1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 +2: eno1: mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000 + link/ether 94:c6:f8:a7:d7:30 brd ff:ff:ff:ff:ff:ff +3: enp0s31f6: mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000 + link/ether 38:42:f8:8b:a7:68 brd ff:ff:ff:ff:ff:ff +4: docker0: mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default + link/ether 42:02:07:8f:a7:38 brd ff:ff:ff:ff:ff:ff +``` + +如你所见,在这里,我的网络接口称为 `enp0s31f6`,MAC 地址为 `38:42:f8:8b:a7:68`。 + +你可能需要在安全的地方记录下来,以便稍后还原到该原始 MAC 地址。 + +现在你可以继续更改 MAC 地址。 + +注意! + +如果在当前使用的网络接口上执行此操作,那么可能会中断你的网络连接。因此,请在其他网卡上尝试使用此方法,或者准备重启网络。 + +#### 方法 1:使用 Macchanger 更改 MAC 地址 + +![][4] + +[Macchanger][5] 是查看、修改和操作网卡 MAC 地址的简单程序。它几乎在所有 GNU/Linux 操作系统中都可用,你可以使用发行版的包安装程序进行安装。 + +在 Arch Linux 或 Manjaro 上: + +``` +sudo pacman -S macchanger +``` + +在 Fedora、CentOS 和 RHEL 上: + +``` +sudo dnf install macchanger +``` + +在 Debian、Ubuntu、Linux Mint、Kali Linux 上: + +``` +sudo apt install macchanger +``` + +**重要!**系统会要求你选择是否应将 `macchanger` 设置为在每次启动或关闭网络设备时自动运行。每当你接到网线或重启 WiFi 时,它都会提供一个新的 MAC 地址。 + +![Not a good idea to run it automatically][6] + +我建议不要自动运行它,除非你确实需要每次更改 MAC 地址。因此,选择“No”(按 `Tab` 键),然后按回车键继续。 + +**如何使用 Macchanger 更改 MAC 地址** + +你还记得网络接口名称吗?你在前面的步骤中获得了它。 + +现在,要将随机 MAC 地址分配给该网卡,请使用: + +``` +sudo macchanger -r enp0s31f6 +``` + +更改 MAC 后,使用以下命令进行验证: + +``` +ip addr +``` + +现在你将看到已经伪造 MAC。 + +要将 MAC 地址更改为特定值,请使用以下命令指定自定义 MAC 地址: + +``` +macchanger --mac=XX:XX:XX:XX:XX:XX +``` + +其中 XX:XX:XX:XX:XX:XX 是你要更改的新 MAC。 + +最后,要将 MAC 地址恢复为其原始硬件值,请运行以下命令: + +``` +macchanger -p enp0s31f6 +``` + +但是,你不必如此。重启系统后,更改将自动丢失,并且实际的 MAC 地址将再次恢复。 + +你可以随时查看手册页以获取更多详细信息。 + +#### 方法 2:使用 iproute2 更改 Mac 地址(中级知识) + +我建议你使用 macchanger,但如果你不想使用它,那么可以使用另一种方法在 Linux 中更改 MAC 地址。 + +首先,使用以下命令关闭网卡: + +``` +sudo ip link set dev enp0s31f6 down +``` + +接下来,使用以下命令设置新的 MAC: + +``` +sudo ip link set dev enp0s31f6 address XX:XX:XX:XX:XX:XX +``` + +最后,使用以下命令重新打开网络: + +``` +sudo ip link set dev enp0s31f6 up +``` + +现在,验证新的 MAC 地址: + +``` +ip link show enp0s31f6 +``` + +就是这些了。你已经成功地在 Linux 中修改了 MAC 地址。敬请期待 FOSS 更多有关 Linux 教程和技巧的文章。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/change-mac-address-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/itsfoss/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/MAC_address +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/airport_wifi_meme.jpg?ssl=1 +[3]: https://itsfoss.com/find-network-adapter-ubuntu-linux/ +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/Change_MAC_Address_Linux.jpg?ssl=1 +[5]: https://github.com/alobbs/macchanger +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/configuring_mcchanger.jpg?ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/Dimitrios.jpg?ssl=1 diff --git a/published/20200314 How to Install Netbeans on Ubuntu and Other Linux.md b/published/20200314 How to Install Netbeans on Ubuntu and Other Linux.md new file mode 100644 index 0000000000..95cd74089e --- /dev/null +++ b/published/20200314 How to Install Netbeans on Ubuntu and Other Linux.md @@ -0,0 +1,98 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12017-1.html) +[#]: subject: (How to Install Netbeans on Ubuntu and Other Linux) +[#]: via: (https://itsfoss.com/install-netbeans-ubuntu/) +[#]: author: (Community https://itsfoss.com/author/itsfoss/) + +如何在 Ubuntu 和其他 Linux 上安装 Netbeans +====== + +> 在本教程中,你将学习在 Ubuntu 和其他 Linux 发行版上安装 Netbeans IDE 的各种方法。 + +[NetBeans][1] 是一个开源集成开发环境,具有良好的跨平台支持。此工具已被 Java 和 C/C++ 开发社区广泛认可。 + +开发环境相当灵活。你可以配置它以支持各种开发。实际上,你可以用它来开发 Web、桌面和移动应用,而无需离开此平台。这太神奇了,不是吗?除此之外,用户可以添加许多已知语言,如 [PHP][2]、C、C++、HTML、[Ajax][3]、JavaScript、JSP、Ruby on Rails 等。 + +如果你正在了解如何在 Linux 上安装 Netbeans,那么有几种方法可以做到。我编写本教程主要是为了 Ubuntu,但一些安装方法也适用于其他发行版。 + +* [使用 apt 在 Ubuntu 上安装 Netbeans][4]:适用于 Ubuntu 和基于 Ubuntu 的发行版,但通常**它是旧版的 Netbeans** +* [使用 Snap 在 Ubuntu 上安装 Netbeans][5]:适用于已启用 Snap 包支持的任何 Linux 发行版 +* [使用 Flatpak 安装 Netbeans] [6]:适用于所有支持 Flatpak 包的 Linux 发行版 + +### 使用 Apt 包管理器在 Ubuntu 上安装 Netbeans IDE + +如果在 Ubuntu 软件中心搜索 Netbeans,你将找到两个版本的 Netbeans。Apache Netbeans 是 snap 版本,大小较大,但提供了最新的 Netbeans。 + +只需单击一下即可安装它。无需打开终端。是最简单的方法。 + +![Apache Netbeans in Ubuntu Software Center][7] + +你也可以选择使用 `apt` 命令,但使用 `apt` 时,你无法获得最新的 Netbeans。例如,在编写本教程时,Ubuntu 18.04 中 Apt 提供 Netbeans 10,而 Snap 有最新的 Netbeans 11。 + +如果你是 [apt 或 apt-get][8] 的粉丝,那么可以[启用 universe 仓库][9],并在终端中使用此命令安装 Netbeans: + +``` +sudo apt install netbeans +``` + +### 使用 Snap 在任何 Linux 发行版上安装 Netbeans IDE + +![][10] + +Snap 是一个通用包管理器,如果[发行版上启用了 Snap][11],那么可以使用以下命令安装它: + +``` +sudo snap install netbeans --classic +``` + +此过程可能需要一些时间才能完成,因为总下载大小约为 1 GB。完成后,你将在应用程序启动器中看到它。 + +你不仅可以通过 Snap 获取最新的 Netbeans,已安装的版本将自动更新到较新版本。 + +### 使用 Flatpak 安装 Netbeans + +[Flatpak][12] 是另一个类似 Snap 的包安装器。默认情况下,某些发行版支持 Flatpak,在其他发行版上你可以[启用 Flatpak 支持][13]。 + +发行版支持 Flatpak 后,你可以使用以下命令安装 Netbeans: + +``` +flatpak install flathub org.apache.netbeans +``` + +另外,你可以下载源码并自己编译。 + +- [下载 Netbeans][14] + +希望你使用了上面其中一个方法在你的 Ubuntu 上安装了 Netbeans。但你使用的是哪个方法?有遇到问题么?让我们知道。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-netbeans-ubuntu/ + +作者:[Srimanta Koley][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/itsfoss/ +[b]: https://github.com/lujun9972 +[1]: https://netbeans.org/ +[2]: https://www.php.net/ +[3]: https://en.wikipedia.org/wiki/Ajax_(programming) +[4]: tmp.ZNFNEC210y#apt +[5]: tmp.ZNFNEC210y#snap +[6]: tmp.ZNFNEC210y#flatpak +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/apache-netbeans-ubuntu-software-center.jpg?ssl=1 +[8]: https://itsfoss.com/apt-vs-apt-get-difference/ +[9]: https://itsfoss.com/ubuntu-repositories/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/Install_Netbeans_Linux.jpg?ssl=1 +[11]: https://itsfoss.com/install-snap-linux/ +[12]: https://flatpak.org/ +[13]: https://itsfoss.com/flatpak-guide/ +[14]: https://netbeans.apache.org/download/index.html +[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/srimanta.jpg?ssl=1 diff --git a/published/20200316 Connect your Google Drive to Fedora Workstation.md b/published/20200316 Connect your Google Drive to Fedora Workstation.md new file mode 100644 index 0000000000..134703d0dc --- /dev/null +++ b/published/20200316 Connect your Google Drive to Fedora Workstation.md @@ -0,0 +1,67 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12037-1.html) +[#]: subject: (Connect your Google Drive to Fedora Workstation) +[#]: via: (https://fedoramagazine.org/connect-your-google-drive-to-fedora-workstation/) +[#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/) + +将你的 Google Drive 连接到 Fedora 工作站 +====== + +![][1] + +有大量的云服务可用于存储重要文档。Google Drive 无疑是最受欢迎的之一。它提供了一组相应的应用程序,例如文档,表格和幻灯片来创建内容。但是,你也可以在 Google Drive 中存储任意内容。本文向你展示如何将其连接到 [Fedora 工作站][2]。 + +### 添加帐户 + +Fedora 工作站可在安装后首次启动或者之后的任何时候添加一个帐户。要在首次启动期间添加帐户,请按照提示进行操作。其中包括选择添加一个帐户: + +![][3] + +选择 Google,然后会出现一个登录提示,请使用你的 Google 帐户信息登录。 + +![][4] + +请注意,此信息仅传输给 Google,而不传输给 GNOME 项目。下一个页面要求你授予访问权限,这是必需的,以便系统桌面可以与 Google 进行交互。向下滚动查看访问请求,然后选择“允许”继续。 + +你会在移动设备和 Gmail 中收到有关新设备(系统)访问 Google 帐户的通知。这是正常现象。 + +![][5] + +如果你在初次启动时没有执行此操作,或者需要重新添加帐户,请打开“设置”,然后选择“在线账户”来添加帐户。可以通过顶部栏右侧的下拉菜单(“齿轮”图标)或打开“概览”并输入“settings”来使用它。接着和上面一样。 + +### 在 Google Drive 中使用“文件”应用 + +打开“文件”应用(以前称为 “nautilus”)。“文件”应用可以通过左侧栏访问。在列表中找到你的 Google 帐户。 + +当你选择帐户后,“文件”应用会显示你的 Google Drive 的内容。你可以使用 Fedora 工作站的本地应用打开某些文件,例如声音文件或 [LibreOffice][6] 兼容文件(包括 Microsoft Office 文档)。其他文件(例如 Google 文档、表格和幻灯片等 Google 应用文件)将使用浏览器和相应的应用打开。 + +请记住,如果文件很大,将需要一些时间才能通过网络接收文件,你才可以打开它。 + +你还可以复制粘贴 Google Drive 中的文件到连接到 Fedora 工作站的其他存储,或者反之。你还可以使用内置功能来重命名文件、创建文件夹并组织它们。对于共享和其他高级选项,请和平常一样在浏览器中使用 Google Drive。 + +请注意,“文件”应用程序不会实时刷新内容。如果你从其他连接 Google 的设备(例如手机或平板电脑)添加或删除文件,那么可能需要按 `Ctrl+R` 刷新“文件”应用。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/connect-your-google-drive-to-fedora-workstation/ + +作者:[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/gdrive-workstation-816x345.jpg +[2]: https://getfedora.org/workstation +[3]: https://fedoramagazine.org/wp-content/uploads/2020/03/firstboot-choices.jpg +[4]: https://fedoramagazine.org/wp-content/uploads/2020/03/firstboot-signin.jpg +[5]: https://fedoramagazine.org/wp-content/uploads/2020/03/firstboot-grantaccess.jpg +[6]: https://fedoramagazine.org/discover-hidden-gems-libreoffice/ +[7]: https://unsplash.com/@beatriz_perez?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[8]: https://unsplash.com/s/photos/office-files?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText diff --git a/published/20200317 Coronavirus challenges remote networking.md b/published/20200317 Coronavirus challenges remote networking.md new file mode 100644 index 0000000000..9467133c2d --- /dev/null +++ b/published/20200317 Coronavirus challenges remote networking.md @@ -0,0 +1,116 @@ +[#]: collector: (lujun9972) +[#]: translator: (HankChow) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12039-1.html) +[#]: subject: (Coronavirus challenges remote networking) +[#]: via: (https://www.networkworld.com/article/3532440/coronavirus-challenges-remote-networking.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +新型冠状病毒对远程网络的影响 +====== + +> 由于 COVID-19 的肆虐,IBM、谷歌、亚马逊、AT&T、思科、苹果等公司都争先恐后地为远程办公提供了技术上的支持,这为远程网络带来了不少的压力。 + +![](https://images.idgesg.net/images/article/2018/02/crisis_survival_strategy_disaster_preparedness_readiness_recovery_continuity_plan_thinkstock_600161484-100749343-large.jpg) + +在新型冠状病毒广泛传播的大环境下,很多公司都要求员工留在家中远程办公,远程网络技术因此承受了更大的压力,一些带宽和安全方面的问题也接踵而至。 + +在过去的几十年当中,由于企业的蓬勃发展,远程办公的人数估计增加了 400 多万。而当前疫情流行的背景下,远程办公的需求激增,有望达到一个新的高峰。 + +一家虚拟私有网络Virtual Private Network(缩写:???)提供商 [Atlas][1] 的一份研究表明,在今年 3 月 9 日到 3 月 15 日之间,美国的虚拟私有网络使用量增加了 53%,并且还会继续提高。而在意大利这个疫情爆发比美国早两周的国家,过去一周内的虚拟私有网络使用量甚至增加了 112%。Atlas 虚拟私有网络的首席执行官 Rachel Welch 在一份声明中称,美国的虚拟私有网络使用量在 3 月底预估会达到 150% 的增幅。 + +部分企业正在尝试通过一日测试one-day test来评估远程办公的可行性。据《[芝加哥论坛报][2]》的报道,摩根大通、晨星以及一家数据分析方面的初创公司 Arity 已经通过让员工在家办公一天来测试整个办公系统的稳定性。 + +在政府方面,[美国国家海洋与大气管理局][3]和 NASA 都已经进行或计划进行网络方面的压力测试,评估是否有足够的网络容量足以让上千名工作人员远程办公,以及远程办公可能造成的影响。而放眼整个美国,供职于美国政府部门的员工数量在 [200 万][4]左右。 + +为了避免蜂窝数据网络发生拥堵,美国[联邦通信委员会][5]已批准 T-mobile 临时访问已分配给其它运营商的 600MHz 频段,T-mobile 表示“将使用这个频段让美国人更方便地享受远程医疗、参与远程工作和学习,同时在保持‘物理距离’的情况下保持联系”。 + +- [video](https://youtu.be/-1-ugVx0hVc) + +但也有一些业内人士指出,在一些对蜂窝网络有较强依赖的的场景下,“最后一英里”的网络访问会变得非常拥堵。 + +网络情报公司 ThousandEyes 的主要产品是局域网和广域网性能分析的软件,该公司的产品经理 Alex Cruz Farmer 表示,网络瓶颈在于一些较为偏远的农村地区,因为那些地区的网络基础设施较为薄弱,主要通过微波或蜂窝网络来访问互联网。最大的挑战在于现有的解决方案所能提供的带宽远远不足。 + +Alex Cruz Farmer 还补充道,尽管持续时间不长,但现在的确已经出现一些由于运营商问题或网络负载增加导致的故障现象。 + +AT&T 表示目前已经留意到蜂窝网络使用量的变化,但网络容量并没有作出提高。 + +[AT&T 在一份声明中称][7],在新冠病毒传播最严重的城市中,由于越来越多的人留在了家中远程办公,减少了通勤和人群聚集,很多特定位置和特定时段的蜂窝网络使用量峰值都明显降低了。他们还使用了一些工具对网络带宽进行了统计和监控,通过这些工具,他们可以更直观地了解网络使用情况的趋势,同时获取网络性能和网络容量方面的报告,进而管理整个通信网络。 + +Verison 表示,自从新型冠状病毒疫情爆发以来,尽管在家办公的用户数量大增,但使用的数据量并没有明显的上升。他们在一份声明中称:“Verison 的网络是为满足未来的需求设计建造的,面对各种需求量的增加或使用方式的改变,我们都有充分的准备。虽然这是一次前所未有的社会事件,整个局面也在不断发生改变,但随着不断了解实际需求的变化情况,我们随时可以对网络资源作出调整”。 + +Verison 一直在关注受影响最严重的地区的网络使用情况,并承诺将会与医院、医护人员、政府机构合作,制定网络资源使用的优先级,以满足他们的需求。Verison 还宣布计划在 2020 年将支出在 170 亿至 180 亿美元的基础上再提高 5 亿美元,以实现“加快 Verison 向 5G 过渡并在困难时期帮助支撑经济”的目标。 + +### 企业虚拟私有网络安全问题 + +对于企业来说,数据中心与远程用户之间的网络和安全问题解决起来绝非易事,尤其是使用虚拟私有网络进行远程访问时,来自用户所在住宅网络的访问几乎无法由企业控制。CIMI 公司总裁 Tom Nolle 认为,IT 部门有必要验证这些连接是否符合企业的标准(关于 Tom Nolle 更多关于在家办公的看法,可以查阅[这里][8])。 + +Tom Nolle 认为像 ISP、DNS 和 Wi-Fi 这些常见的家用网络要素都应该作为适合远程办公网络业务认证的一部分。他发现 Google 的 DNS 服务比 ISP 提供的服务更能承受压力,OpenDNS 也是一个很好的选择,这说明用户可以考虑使用其中一种。 + +Tom Nolle 还说,家庭 Wi-Fi 网络的安全性也是一个问题,IT 部门应该要求远程办公的员工提交 Wi-Fi 配置的屏幕截图,以保证使用了正确的加密方式。之所以有这样的想法,是因为他觉得很多远程办公的员工都会绕过企业预设的一些安全措施。 + +DNS 软件公司 BlueCat 的首席战略官 Andrew Wertkin 表示,对一些刚刚开始在家远程办公的员工来说,适当提供相关指导是很有必要的。大部分员工从来没有尝试过在家远程办公,他们或许并不了解安全的重要性。如果员工访问公司网络的时候使用的是个人设备而不是公司设备,就更有可能出现问题。 + +而使用[虚拟私有网络][9]远程办公的人数激增也会为企业带来成本上的挑战。 + +“虚拟私有网络设备并不便宜,如果考虑到计算资源的成本和每个人的均摊成本,迁移到云上的虚拟环境会带来一笔不小的开支,这还不包括每个虚拟私有网络许可证价格的上升”,Alex Cruz Farmer 坦言。 + +在容量方面,随着远程访问量的增加,用于分配 IP 地址的 DHCP 服务也会承受巨大的压力。Andrew Wertkin 指出,如果进行远程连接的设备无法获取到网络地址,则是否具有足够的虚拟私有网络许可证并不重要。企业内部必须对这些风险进行测试,了解其中存在瓶颈的部分,并制定规避这些风险的策略。 + +按照这个思路,企业甚至需要验证数据中心可以用于公开的 SSL 套接字数量,否则也会面临数量不足的风险。 + +微软 Office 365 产品团队的高级程序经理 Paul Collinge 也表达了类似的担忧。他在一篇关于优化 Office 365 员工远程办公流量的[博客][10]中写道,当大量员工在同时接入企业网络时,会对诸如虚拟私有网络集中器、中央网络出口设备(例如代理、DLP)、中央互联网带宽、回程 MPLS 和 NAT 等网络要素产生巨大的压力。最终导致的结果是低下的性能、低下的生产力,以及员工们低下的使用体验。 + +Alex Cruz Farmer 提出,企业很可能需要增加网络上虚拟私有网络集中器的数量,这样就可以让远程用户分布在多个不同的虚拟私有网络端点上,避免产生拥堵。退而求其次,只能在防火墙上把某些端口放开,允许特定应用程序的公开访问,尽管这样有助于提高工作效率,但却降低了整体的安全性。 + +### 虚拟私有网络隧道分割技术有效吗? + +业内人士对隧道分割tunneling split有不同的看法。 + +BlueCat 的 Andrew Wertkin 认为,虚拟私有网络可以使用隧道分割技术,使得仅有需要访问企业内部网络的流量才通过虚拟私有网络隧道访问,其余流量则直接进入互联网。这意味着会有部分流量不受隧道和企业网络内部的安全控制,用户的计算机会暴露在互联网当中,进而导致企业的数据和网络面临安全风险。 + +尽管如此,微软在上周还是建议 IT 管理员使用隧道分割技术以缓解 Office 365 由于大量远程用户涌入导致的拥堵问题。微软在[建议][10]中提供了相关接入点的 URL 和 IP 地址列表,并引导 IT 人员如何按照这个方式将流量路由到 Office 365。 + +按照 Paul Collinge 的说法,虚拟私有网络客户端需要经过配置,才能将流量路由到已标识的 URL/IP/ 端口上,进而为全球的用户提供高性能的服务。 + +Alex Cruz Farmer 认为,在虚拟私有网络使用率上升之后,企业很有必要对网络安全进行一个全面的审查。对于仍然在使用传统网络安全架构的企业来说,应该开始考虑基于云端的网络安全方案了,这不仅可以提升远程办公的性能,还能减少企业对于广域网的使用量。 + +其它相关情况: + +* [FCC][11] 呼吁,宽带提供商应该适当放宽数据传输的限制,电话运营商应该适当免除用户的长途电话费,远程教育提供商应该合作为社会提供远程学习的机会,网络运营商应该优先考虑医院或医疗机构的网络连接需求。对此,AT&T 已经作出了相关的回应和行动。 +* [美国参议员 Mark R. Warner (D-VA)][12] 和其他 17 名参议员致信了 AT&T、CenturyLink、Charter Communications、Comcast、Cox Communications、Sprint、T-Mobile、Verizon 这八家主要 ISP 的首席执行官,呼吁这些公司应该采取措施应对远程办公、在线教育、远程医疗、远程支持服务等方面需求激增带来的压力。这些参议员在信中呼吁,各公司应该降低可能对远程服务产生影响的限制和费用,同时还应该为受到疫情影响的学生提供免费或收费的宽带服务,否则学生在疫情期间无法接入网络进行在线学习。 +* [思科][13]、微软、[谷歌][14]、[LogMeIn][15]、[Spectrum][16] 等供应商都提供了一些免费工具,帮助用户在疫情爆发期间正常进行安全通信。 + + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3532440/coronavirus-challenges-remote-networking.html + +作者:[Michael Cooney][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://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://atlasvpn.com/blog/vpn-usage-in-italy-rockets-by-112-and-53-in-the-us-amidst-coronavirus-outbreak/ +[2]: https://www.chicagotribune.com/coronavirus/ct-coronavirus-work-from-home-20200312-bscm4ifjvne7dlugjn34sksrz4-story.html +[3]: https://federalnewsnetwork.com/workforce/2020/03/agencies-ramp-up-coronavirus-preparations-as-noaa-plans-large-scale-telework-test/ +[4]: https://fas.org/sgp/crs/misc/R43590.pdf +[5]: https://www.fcc.gov/coronavirus +[6]: 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) +[7]: https://about.att.com/pages/COVID-19.html +[8]: https://blog.cimicorp.com/?p=4055 +[9]: https://www.networkworld.com/article/3268744/understanding-virtual-private-networks-and-why-vpns-are-important-to-sd-wan.html +[10]: https://techcommunity.microsoft.com/t5/office-365-blog/how-to-quickly-optimize-office-365-traffic-for-remote-staff-amp/ba-p/1214571 +[11]: https://www.fcc.gov/document/commissioner-starks-statement-fccs-response-covid-19 +[12]: https://www.warner.senate.gov/public/_cache/files/2/3/239084db-83bd-4641-bf59-371cb829937a/A99E41ACD1BA92FB37BDE54E14A97BFA.letter-to-isps-on-covid-19-final-v2.-signed.pdf +[13]: https://blogs.cisco.com/collaboration/cisco-announces-work-from-home-webex-contact-center-quick-deployment +[14]: https://cloud.google.com/blog/products/g-suite/helping-businesses-and-schools-stay-connected-in-response-to-coronavirus +[15]: https://www.gotomeeting.com/work-remote?clickid=RFlSQF3DBxyOTSr0MKVSfWfHUknShrScK0%3AhTY0&irgwc=1&cid=g2m_noam_ir_aff_cm_pl_ct +[16]: https://www.multichannel.com/news/charter-opening-wi-fi-hotspots-in-face-of-covid-19 +[17]: https://www.facebook.com/NetworkWorld/ +[18]: https://www.linkedin.com/company/network-world diff --git a/published/20200317 Viewing and configuring password aging on Linux.md b/published/20200317 Viewing and configuring password aging on Linux.md new file mode 100644 index 0000000000..a6699b8878 --- /dev/null +++ b/published/20200317 Viewing and configuring password aging on Linux.md @@ -0,0 +1,142 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12041-1.html) +[#]: subject: (Viewing and configuring password aging on Linux) +[#]: via: (https://www.networkworld.com/article/3532815/viewing-and-configuring-password-aging-on-linux.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +在 Linux 上查看和配置密码时效 +====== + +![](https://images.idgesg.net/images/article/2019/09/cso_nw_user_id_password_credentials_authentication_by_bluebay2014_gettyimages-924698706_2400x1600-100811223-large.jpg) + +> 使用正确的设置,可以强制 Linux 用户定期更改密码。以下是查看密码时效以及如何更改其中设置的方法。 + +可以将 Linux 系统上的用户密码配置为永久或设置过期时间,以让人们必须定期重置它们。出于安全原因,通常认为定期更改密码是一种好习惯,但默认并未配置。 + +要查看和修改密码时效,你需要熟悉几个重要的命令:`chage` 命令及其 `-l` 选项,以及 `passwd` 命令及其 `-S` 选项。本文会介绍这些命令,还有其他一些 `chage` 命令选项来配置密码时效。 + +### 查看密码时效设置 + +确定某个特定帐户是否已设置密码时效的方法是使用如下 `chage` 命令。请注意,除了你自己的帐户以外,其他任何帐户都需要 root 权限。请注意下面的密码到期日期。 + +``` +$ sudo chage -l dory +Last password change : Mar 15, 2020 +Password expires : Jun 13, 2020 <== +Password inactive : never +Account expires : never +Minimum number of days between password change : 10 +Maximum number of days between password change : 90 +Number of days of warning before password expires : 14 +``` + +如果未应用密码时效,那么帐户信息将如下所示: + +``` +$ sudo chage -l nemo +Last password change : Jan 14, 2019 +Password expires : never <== +Password inactive : never +Account expires : Mar 26, 2706989 +Minimum number of days between password change : 0 +Maximum number of days between password change : 99999 +Number of days of warning before password expires : 7 +``` + +你也可以使用 `passwd -S` 命令查看某些信息,但是你需要知道输出中的每个字段代表什么: + +``` +dory$ passwd -S +dory P 03/15/2020 10 90 14 -1 +``` + +这里的七个字段代表: + +* 1 – 用户名 +* 2 - 帐户状态(`L` = 锁定,`NP` = 无密码,`P` = 可用密码) +* 3 – 上次密码更改的日期 +* 4 – 可更改最低时效(如果没有这么多天,则不能更改密码) +* 5 – 最长时效(这些天后,密码必须更改) +* 6 – 密码过期前提前警告的天数 +* 7 – 密码过期后锁定之前的天数(设为无效) + +需要注意的一件事是,`chage` 命令不会显示帐户是否被锁定;它仅显示密码时效设置。另一方面,`passwd -S` 命令将告诉你密码被锁定的时间。在此例中,请注意帐户状态为 `L`: + +``` +$ sudo passwd -S dorothy +dorothy L 07/09/2019 0 99999 7 10 +``` + +通过将 `/etc/shadow` 文件中通常包含密码的“哈希”字段变为 `!`,从而达成锁定的效果。 + +``` +$ sudo grep dorothy /etc/shadow +dorothy:!:18086:0:99999:7:10:: <== +``` + +帐户被锁定的事实在 `chage` 输出中并不明显: + +``` +$ sudo chage -l dorothy +Last password change : Jul 09, 2019 +Password expires : never +Password inactive : never +Account expires : never +Minimum number of days between password change : 0 +Maximum number of days between password change : 99999 +Number of days of warning before password expires : 7 +``` + +### 密码时效的一些选项 + +最常用的设置是最短和最长的天数。它们经常结合使用。例如,你可以配置一个密码,使其最长不能使用超过 90 天(最大),然后添加一个有效期为一周或 10 天(最小)的密码。这样可以确保用户不会在需要更改密码后马上改回以前的密码。 + +``` +$ sudo chage -M 90 -m 10 shark +$ sudo chage -l shark +Last password change : Mar 16, 2020 +Password expires : Jun 14, 2020 +Password inactive : never +Account expires : never +Minimum number of days between password change : 10 <== +Maximum number of days between password change : 90 <== +Number of days of warning before password expires : 7 +``` + +你还可以使用 `-E` 选项为帐户设置特定的到期日期。 + +``` +$ sudo chage -E 2020-11-11 tadpole +$ sudo chage -l tadpole +Last password change : Oct 15, 2019 +Password expires : never +Password inactive : never +Account expires : Nov 11, 2020 <== +Minimum number of days between password change : 0 +Maximum number of days between password change : 99999 +Number of days of warning before password expires : 7 +``` + +密码时效可能是一个重要的选择,只要它不鼓励用户使用过于简单的密码或以不安全的方式写下来即可。有关控制密码字符(例如,大小写字母、数字等的组合)的更多信息,请参考这篇关于[密码复杂度][3]的文章。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3532815/viewing-and-configuring-password-aging-on-linux.html + +作者:[Sandra Henry-Stocker][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://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/newsletters/signup.html +[2]: 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) +[3]: https://www.networkworld.com/article/2726217/how-to-enforce-password-complexity-on-linux.html +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world diff --git a/published/20200318 Top 10 open source tools for working from home.md b/published/20200318 Top 10 open source tools for working from home.md new file mode 100644 index 0000000000..c8357aadc7 --- /dev/null +++ b/published/20200318 Top 10 open source tools for working from home.md @@ -0,0 +1,141 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12014-1.html) +[#]: subject: (Top 10 open source tools for working from home) +[#]: via: (https://opensource.com/article/20/3/open-source-working-home) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +在家工作的十大开源工具 +====== + +> 无论你是在家工作的资深人士还是远程工作的新手,这些工具都可以使交流和协作变得轻而易举。 + +![](https://img.linux.net.cn/data/attachment/album/202003/20/103814bwxxqxkxc9qqxkbb.jpg) + +如果你在家工作work from home(WFH),你就会知道拥有一系列实用的工具是很重要的,这些工具可以让你远离烦恼,专注于重要的事情。在工作期间工作越努力,工作日结束后,你就越容易放松。 + +我已经在家工作多年了,这是我精选的远程工作者必备的最佳开源工具。 + +### 视频会议:Jitsi + +![Jitsi screenshot][2] + +当你不在同事身边时,每周保持连接几次非常重要,甚至只是这样也可以保持人与人之间的联系,否则你就会变得孤独。市场上有很多视频会议系统,但以我的经验,最简单、最好的是开源的 [Jitsi][3]。 + +通过易于记忆的 URL([meet.jit.si][3])和按需会议室,Jitsi 使得召开即席会议非常简单。而且更好的是,无需注册。你只需进入 [meet.jit.si][3],找到一个带有友好的、随机生成的 URL(此处没有字母和数字的随机组合) 的会议室,你就可以立即开始聊天。如果你选择注册,那么还可以与几种日历进行集成。 + +在现实生活中,我参加了许多来自新西兰最偏远地区的会议,而 Jitsi 无疑是我迄今为止拥有的最好的视频聊天体验。不需要浪费一半的会议时间在迷宫般的虚拟会议室中寻找彼此,也不用在尴尬的滞后时间中坐着发呆,更不用努力地为聊天应用程序安装更新。使用开源和符合标准的 webRTC 协议的 Jitsi 可以让你有个愉悦的开会体验。 + +### 白板:Drawpile + +![Drawpile screenshot][4] + +有时,白板非常适合解释事情、跟踪想法或只是散布一下疯狂的想法。白板是办公室会议室的常见物品,但在数字世界中却很难获得。幸运的是,有了 [Drawpile][5],这是一个实时协作的绘图应用程序。你可以在自己的计算机上托管绘图会话并邀请其他用户,也可以在 Drawpile 的服务器上托管会话。 + +它易于使用,足够精简、直观而功能强大,当你的粗略想法开始逐渐成型时,它是使其成为可行的作品的应用程序。 + +### 看板:Taiga + +![Taiga screenshot][6] + +想要保持有序并与你的部门保持同步吗?你应该试试 [Taiga][7],这是一个虚拟的“便利贴”面板,可以帮助团队跟踪各个任务。这种组织和项目计划方法被称为看板kanban,在软件开发中很流行,而它也流行于从假期规划到家庭装修项目的所有计划之中。 + +Taiga 的优点是它是一个在线共享空间。与你进行协作或与之合作的任何人都可以把任务放到面板上,并且随着每个人的进展,他们将任务从左列(起点)移到右边(终点线)。Taiga 具有令人愉悦的图形化和交互性,没有什么比从一列移动到另一列的拖放任务令人感到舒适的了。 + +如果你的团队有 Taiga 无法满足的特定需求,那么你应该看看[我们挑选的最佳开源看板][8]。 + +### 个人笔记本:Joplin + +![Joplin][9] + +我在办公桌旁放着一个纸质笔记本,这样我就可以随时记下思考或想法了。想要捕捉这种简单动作的感受和便利是很棘手的,但 Joplin 却做的很好。 + +你可以在 Joplin 中创建虚拟笔记本,每个笔记本可以有任意数量的条目。这些条目可以是简单的文本,也可以是带有图形、任务列表、超链接等的复杂的动态文档。最重要的是,你可以将 Joplin 与所有的在线存储服务同步,包括开源的 Nextcloud 服务,这样你可以在任何计算机和任何设备上使用笔记本。这是使你的工作日井井有条、专心致志并保持活动顺畅的好方法。 + +如果 Joplin 不太满足你的要求,请查看一些我们最喜欢的[笔记本应用][10]。 + +### 群聊:Riot + +![Riot screenshot][11] + +并非所有内容都需要视频聊天或语音通话,但是有些事情比电子邮件更紧急。这就是团队聊天发挥作用的地方。一个好的群聊应用程序应该具有这些功能:即时消息传递、支持表情符号、支持 GIF 和图像,按需聊天室或“频道”、广泛的兼容性和隐私性。[Matrix][12] 是一个用于实时通信的开放标准和轻量级协议,如果你厌烦于键入大段消息,则可以使用相同的协议快速切换到 VOIP。你将获得世界上最好的群聊体验。 + +Matrix 是一种协议,并且有许多应用程序可以接驳到它(就像使用 Internet 协议一样,Firefox 是使人类可以访问的应用程序)。最受欢迎的客户端之一是 [Riot.im][13]。你可以为你的计算机和手机下载 Riot,并且只是短时间使用的话,可以通过 Web 浏览器连接到 Riot。你的团队总是会近在咫尺,但永远不会近到让你感到不舒服。 + +### 共享文档:Etherpad + +![Etherpad screenshot][14] + +如果你想与他人协作处理文档或与开会,则仅需 Etherpad 就行。Etherpad 是一个实时共享的文字处理器。可以邀请一个或多个人访问文档,并在每个人进行添加和编辑时进行观察。这是一种快速有效的方法,可将想法记入“纸上”并一起迭代修订。 + +有几种使用 Etherpad 的方法。如果你拥有良好的 IT 支持,则可以要求你的 IT 部门为你的组织托管一个 Etherpad 实例。否则,将有来自开源支持者的在线公共实例,例如 [Riseup][15] 和 [Etherpad][16] 本身所提供的。 + +### 共享电子表格:Ethercalc + +![Ethercalc screenshot][17] + +与 Etherpad 相似,在线 [Ethercalc][18] 编辑器允许多个用户同时在同一屏幕上远程地在电子表格上工作。Ethercalc 甚至可以从现有电子表格和定界文本文件中导入数据。你可能会也可能不会丢失大部分格式,具体取决于要导入的内容的复杂性,但是我从来没有弄坏过我的数据,因此导入文件总是一个好的开始。 下次需要复杂公式的帮助时,或者需要在最新预算中输入收据时,或者只是需要某人在格子上的输入时,请将其输入到 Ethercalc。 + +### 共享存储与日历:Nextcloud + +![Nextcloud screenshot][19] + +[Nextcloud][20] 是一个心存远志的应用程序。顾名思义,它是你自己的个人云。它最明显的切入点是在线共享存储,它可以与台式机和移动设备上的文件夹同步。将文件放入文件中,文件会上传到存储空间,然后当一切内容都同步后,它们会出现在所有设备上。为组织中的每个人提供一个帐户,你马上便拥有了共享的存储空间,可以通过单击鼠标单击以共享带有或不带有密码的文件和文件夹。 + +但是,除了充当共享数据的保管箱之外,Nextcloud 还有很多其他功能。由于其插件式结构,你可以将无数的 Web 应用程序安装到 Nextcloud 中,例如聊天客户端、电子邮件客户端、视频聊天等等。并非所有插件都是“官方的”,因此其支持服务各不相同,但是有几个非常好的官方插件。值得注意的是,有一个官方的日历应用程序,你和你的同事可以用它安排会议并跟踪即将发生的重要事件。该日历使用 CalDAV 协议,因此你所做的一切都可以与任何 CalDAV 客户端兼容。 + +### LibreOffice + +![LibreOffice screenshot][21] + +如果你习惯于每天一整天都在办公室里工作,那么你也可能习惯整天在办公套件里工作。包含所有常用功能的面面俱到的应用程序会令人感到某种程度的舒适,而在开源办公世界中的这样的应用程序就是 [LibreOffice][22]。它具有办公套件所应有的一切:文字处理器、电子表格和幻灯片演示。它还具有超出预期的功能,例如基于矢量的绘图应用程序,它还可以编辑 PDF 文件,还有一个带有图形界面构建器的关系型数据库。如果你正在寻找一个好的办公应用程序,那么 LibreOffice 是你应该首先看一看的,因为一旦你使用它,你就再也不用看别的了。 + +### Linux + +![][23] + +如果你不熟悉远程工作,而可能是由于某种原因而正在经历一场重大变革。对于某些人来说,变革的时光是一个极好的动力,它可以一劳永逸地改变一切。如果你是其中的一员,那么可能是时候更改一下整个操作系统了。Windows 和 Mac 可能在过去为你提供了很好的服务,但是如果你希望从非开源软件转向开源软件,为什么不换一下运行所有这些应用程序的平台呢? + +有许多出色的 Linux 发行版可以让你认真地工作、认真地自我管理和认真地进阶。获取一份 Linux 副本,不论是 [Fedora][24]、[Elementary][25] 还是 [Red Hat Enterprise Linux][26] 的长期支持订购,去尝试使用自由的开源操作系统吧。等你熟悉了远程人的生活时,你最终将成为一名 Linux 专家! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/open-source-working-home + +作者:[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/oatmeal-and-fedora.jpg?itok=NBFUH9eF (Oatmeal and a laptop.) +[2]: https://opensource.com/sites/default/files/uploads/jitsi_0.jpg (Jitsi screenshot) +[3]: http://meet.jit.si +[4]: https://opensource.com/sites/default/files/uploads/drawpile-whiteboard.jpg (Drawpile screenshot) +[5]: https://drawpile.net/ +[6]: https://opensource.com/sites/default/files/uploads/taiga_kanban_screen_0.jpg (Taiga screenshot) +[7]: http://taiga.io +[8]: https://opensource.com/alternatives/trello +[9]: https://opensource.com/sites/default/files/joplin_0.png (Joplin) +[10]: https://opensource.com/alternatives/evernote +[11]: https://opensource.com/sites/default/files/uploads/riot-matrix.jpg (Riot screenshot) +[12]: http://matrix.org +[13]: http://riot.im +[14]: https://opensource.com/sites/default/files/uploads/etherpad.jpg (Etherpad screenshot) +[15]: https://pad.riseup.net/ +[16]: https://beta.etherpad.org +[17]: https://opensource.com/sites/default/files/uploads/ethercalc.jpg (Ethercalc screenshot) +[18]: https://ethercalc.org +[19]: https://opensource.com/sites/default/files/uploads/nextcloud-calendar.jpg (Nextcloud screenshot) +[20]: http://nextcloud.com +[21]: https://opensource.com/sites/default/files/uploads/libreoffice.png (LibreOffice screenshot) +[22]: http://libreoffice.org +[23]: https://opensource.com/sites/default/files/uploads/advent-pantheon.jpg +[24]: https://getfedora.org/ +[25]: https://elementary.io +[26]: https://www.redhat.com/en/store/red-hat-enterprise-linux-workstation diff --git a/published/20200319 4 Markdown tools for the Linux command line.md b/published/20200319 4 Markdown tools for the Linux command line.md new file mode 100644 index 0000000000..0aa052696b --- /dev/null +++ b/published/20200319 4 Markdown tools for the Linux command line.md @@ -0,0 +1,111 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12048-1.html) +[#]: subject: (4 Markdown tools for the Linux command line) +[#]: via: (https://opensource.com/article/20/3/markdown-apps-linux-command-line) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +4 个 Linux 命令行下的 Markdown 工具 +====== + +> 命令行 Markdown 工具快速、强大、灵活。以下是 4 个值得试一下的工具。 + +![](https://img.linux.net.cn/data/attachment/album/202003/29/112110pbd22dku6b2g6ku6.jpg) + +(在 Linux 上)在处理 [Markdown][2] 格式的文件时,命令行工具会占据主导地位。它们轻巧、快速、强大、灵活,它们大多数都遵循 Unix 哲学只做好一件事。 + +看一下这四个程序,它们可以帮助你在命令行中更有效地处理 Markdown 文件。 + +### mdless + +如果你使用过一段时间的 Linux 命令行,那么你可能对名为 [less][3] 的文本查看器很熟悉。当然,你可以使用 `less` 查看 Markdown 文件,但结果有点枯燥。如何在终端中查看 Markdown 文件效果更好一点?来使用 [mdless][4]。 + +![mdless][5] + +你可以使用键盘上的箭头键四处移动,并且 `mdless` 提供了很好的搜索功能。 + +`mdless` 不仅会显示文本,而且还会渲染标题、粗体和斜体等格式。它还可以显示表格并语法高亮代码块。你还可以创建一个或多个主题文件来[定制][6] `mdless` 的外观。 + +### Markdown lint 工具 + +你在快速输入时会犯错误。如果你在使用 Markdown(或其他任何标记语言)时丢失了一些格式,那么在将文件转换为另一种格式时可能会有问题。 + +程序员通常使用名为 linter 的工具来检查语法是否正确。你可以使用 [Markdown lint 工具][7]对 Markdown 执行相同的操作。 + +在你对 Markdown 文件运行该工具时,它会根据[规则集][8]检查格式。这些规则控制着文档的结构,包括标题级别的顺序、不正确的缩进和间距、代码块问题、文件中存在 HTML 等等。 + +![Markdown lint tool][9] + +规则可能有点严格。但是,在将文件转换为其他格式之前对文件运行 Markdown lint 工具可以防止由于格式错误或不一致引起的麻烦。 + +### mdmerge + +合并任何类型的文件可能会很痛苦。例如,我在整理一本电子书。它是一篇文章集,最初发布在我的[每周邮件][10]中。这些文章都放在单独的文件中,作为受虐狂,我以凌乱、手动的方式将它们组合在一起。 + +我希望在开始这个项目之前就知道 [mdmerge][11]。这样我可以节省很多时间和精力。 + +`mdmerge`,你可能已经从名称中猜到了它的作用,它将两个或多个 Markdown 文件合并为一个文件。你无需在命令行中输入文件名。相反,你可以将它们添加到名为 `book.txt` 的文件中,并将其用作 `mdmerge` 的输入文件。 + +这并不是 `mdmerge` 能做的一切。你可以添加对另一个文档的引用(使用 Markdown 格式引用或一段源代码),然后将其放入主文档中。这样一来,你就可以创建针对特定受众定制的[主文档][12]。 + +`mdmerge` 不会是你经常使用的程序。但当你需要时,你会很高兴硬盘上有它。 + +### bashblog + +严格说 [bashblog][13] 并不是 Markdown 工具。它获取 Markdown 文件,并使用它们来构建简单的博客或网站。你可以将 bashblog 视为[静态站点生成器][14],但是它没有很多脆弱的依赖关系。一切几乎都在一个不到 50KB 的 shell 脚本中。 + +要使用 bashblog,只需在计算机上安装 Markdown 处理器即可。在此,你可以编辑 Shell 脚本添加有关博客的信息,例如标题、名字、社交媒体链接等。然后运行该脚本。之后会在默认文本编辑器中新建一篇文章。开始输入。 + +保存文章后,你可以发布它或将其另存为草稿。如果你选择发布文章,那么 bashblog 会将你的博客、文章和所有内容生成为一组 HTML 文件,你可以将它们上传到 Web 服务器。 + +它开箱即用,你的博客或许会平淡无奇,但可以使用。你可以根据自己喜好编辑站点的 CSS 文件来改变外观。 + +![bashblog][15] + +### Pandoc 如何? + +当然,Panddoc 是一个非常强大的工具,可以将 Markdown 文件转换为其他标记语言。但是,在命令行上使用 Markdown 要比 Pandoc 多。 + +如果你需要 Pandoc,请查看我们发布的文章: + +* [在命令行使用 Pandoc 进行文件转换][16] +* [使用 Pandoc 将你的书转换成网页和电子书][17] +* [用 Pandoc 生成一篇调研论文][18] +* [使用 pandoc 将 Markdown 转换为格式化文档][19] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/markdown-apps-linux-command-line + +作者:[Scott Nesbitt][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://opensource.com/users/scottnesbitt +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003784_02_os.comcareers_os_rh2x.png?itok=jbRfXinl (A person working.) +[2]: https://opensource.com/article/19/9/introduction-markdown +[3]: https://opensource.com/article/18/4/using-less-view-text-files-command-line +[4]: https://github.com/ttscoff/mdless +[5]: https://opensource.com/sites/default/files/uploads/mdless.png (mdless) +[6]: https://github.com/ttscoff/mdless#customization +[7]: https://github.com/markdownlint/markdownlint +[8]: https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md +[9]: https://opensource.com/sites/default/files/uploads/mdl.png (Markdown lint tool) +[10]: https://buttondown.email/weeklymusings +[11]: https://github.com/JeNeSuisPasDave/MarkdownTools +[12]: https://help.libreoffice.org/6.2/en-US/text/swriter/guide/globaldoc.html +[13]: https://github.com/cfenollosa/bashblog +[14]: https://en.wikipedia.org/wiki/Web_template_system#Static_site_generators +[15]: https://opensource.com/sites/default/files/uploads/bashblog.png (bashblog) +[16]: https://linux.cn/article-10228-1.html +[17]: https://linux.cn/article-10287-1.html +[18]: https://linux.cn/article-10179-1.html +[19]: https://linux.cn/article-11160-1.html diff --git a/published/20200319 7 open hardware projects working to solve COVID-19.md b/published/20200319 7 open hardware projects working to solve COVID-19.md new file mode 100644 index 0000000000..3b3f5cf23e --- /dev/null +++ b/published/20200319 7 open hardware projects working to solve COVID-19.md @@ -0,0 +1,208 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12047-1.html) +[#]: subject: (7 open hardware projects working to solve COVID-19) +[#]: via: (https://opensource.com/article/20/3/open-hardware-covid19) +[#]: author: (Harris Kenny https://opensource.com/users/harriskenny) + +应对新冠病毒的 7 个开源硬件项目 +====== + +> 开源硬件解决方案可以为抵御新型冠状病毒的传播和痛苦做出贡献。 + +![](https://img.linux.net.cn/data/attachment/album/202003/29/103909f50gm91z22twuv23.jpg) + +开源[硬件][2]运动长期以来一直主张维修权的重要性,完全拥有所购买的技术,并能够像音乐一样重新组合和复制部件。因此,在这个充满挑战的时期内,开源硬件为由冠状病毒大流行引起的一些问题提供了一些答案。 + +### 背景概述 + +首先,全球的硬件开发人员正在努力使用开源解决供应链中的弱点,在过去 30 年中,这种理念推动了新软件技术的大量涌现。过去在硬件运动方面的成功,如 [RepRap Project][3]、[Open Source Ecology][4] 和 [Open Source Beehives][5],证明了这一点是可以做到的。 + +对于使用 3D 打印和其他技术按需生产安全设备和按需制造它的替换零件,创客们的兴趣日益增加。例如,香港理工大学实验室为医院工作人员提供 [3D 打印面罩][6]。意大利初创公司 Isinnova 与米兰 FabLab 合作,为受重灾的意大利北部提供用于呼吸机的 [3D 打印替换阀][7]。公司们还发布了设计以适应我们的物理接触需求,例如 Materialise 的 [3D 打印免提开门器][8]。这些更换零件和解决问题的示例是一个很好的起点,为挽救生命做出了努力。 + +另一种传统的硬件技术正在加速发展:缝纫。法新社报道说,全球急需口罩,来自世界卫生组织的指导也指明了其重要性。随着一次性口罩要优先供给于医护人员,捷克共和国的人们[开始缝制自己的口罩][9]。(重复使用的口罩确实会带来细菌问题。)Facebook 小组“捷克缝制口罩”开始在他们的国家解决这个问题,成千上万的成员开始用起了他们的家用缝纫机。 + +开源硬件设备和机械项目也越来越受欢迎。首先,有一些测试性设备具备高精度且功能强大。其次,在没有其他选择方案的情况下,有一些医疗设备(顶多)可以归类为现场级。这些项目将在下面详细概述。 + +为了解更多信息,我与总部位于芝加哥的 [Tapster Robotics][10] 的创始人兼首席执行官 Jason Huggins 进行了交谈。Tapster Robotics 使用 3D 打印、计算机数控(CNC)加工和 [Arduino][11] 等开源电子产品设计和制造台式机器人。他兼具技术知识和工业能力,具有很高的影响力。他想投入自己公司的资源来帮助这场斗争。 + +“基本上,我们现在正处于第二次世界大战的动员时刻。即使我不是医生,我们仍然应该遵循希波克拉底誓言。无论我做什么,我都不想让问题变得更糟”,Huggins 解释,他认为:“作为对策,世卫组织执行主任 Michael Ryan 博士发表了这样的评论:‘速度胜过完美’。” + +> 哇! +> +> 这个人是疾病传播的全球权威。如果您是领导者(无论以何种身份),请注意。如果不是,也请注意。 +> +> [pic.twitter.com/bFogaekehM][12] +> +> — Jim RichardsSh🎙wgram(@JIMrichards1010)[2020 年 3 月 15 日][13] + +Huggins 在应需提供方面具有丰富的经验。他的努力有助于 [Healthcare.gov][14] 在挑战性的最初启动后得以扩展。他还创建了软件行业标准的测试框架 Selenium 和 Appium。有了这一经验,他的建议非常值得考虑。 + +我还与 [Tyson Law][15] 的西雅图律师 Mark Tyson 进行了交谈,他的合作对象是初创公司和小型企业。他在快速发展的行业中与敏捷公司合作有着直接的经验。在阐述整个问题时,Tyson 说到: + +> 《善良的撒玛利亚人法Good Samaritan law》保护志愿者(即“好撒玛利亚人”)免于因其在紧急情况下提供援助的决定而承担责任。尽管这些法律的具体内容因州而异,但它们具有共同的公共政策依据:即鼓励旁观者帮助遇到紧急情况的其他人。可以想象,除了传统的把车祸的受害者从伤害中拉出来之外,这种理论依据可以证明在不太传统的环境中应用这类法律的合理性。 + +对于这种特定情况,Tyson 指出: + +> “在采取行动之前,创客们明智的做法是与律师沟通一下,以针对特定的州进行风险评估。还应谨慎地要求大型机构(例如医院或保险公司)通过合同接受潜在的责任风险,例如,通过使用赔偿协议,使医院或其保险人同意赔偿创客们的责任。” + +Tyson 明白情况的紧迫性和严重性。使用合同的这种选择并不意味着障碍。相反,这可能是一种帮助其大规模采用的方法,以更快地产生更大的变化。这取决于你或你的机构。 + +综上所述,让我们探索正在使用或正在开发中的项目(可能很快就可以部署)。 + +### 7 个与新冠病毒对抗的开源硬件项目 + +#### Opentrons + +[Opentrons][16] 的开源实验室自动化平台由一套开源硬件、经过验证的实验室器具、消耗品、试剂和工作站组成。Opentrons 表示,其产品可以“在下订单后几天内每天自动进行多达 2400 个测试”的系统,可以极大地帮助提高[新冠病毒测试规模][17]。它计划在 7 月 1 日之前提升到多达 100 万个测试样本。 + +![Opentrons roadmap graphic][18] + +*来自 Opentrons [网站][17],版权所有* + +该公司已经在与联邦和地方政府机构合作,以确定其系统是否可以在[紧急使用授权][19]下用于临床诊断。 Opentrons 在 [Apache 2.0 许可证][20]下共享。我最初是从与该项目有联系的生物学家 Kristin Ellis 那里得知它的。 + +#### Chai 的 Open qPCR + +Chai 的 [Open qPCR][21] 设备使用[聚合酶链反应][22](PCR)快速检测物品表面(例如,门把手和电梯按钮)上的拭子,以查看是否存在新型冠状病毒。这种在 [Apache 2.0 许可证][23]下共享的开源硬件使用 [BeagleBone][24] 低功耗 Linux 计算机。Chai 的 Open qPCR 提供的数据可以使公共卫生、公民和企业领导者做出有关清洁、缓解、关闭设施、接触追踪和测试的更明智的决策。 + +#### OpenPCR + +[OpenPCR][25] 是 Chai Open qPCR 的创建者 Josh Perfetto 和 Jessie Ho 的 PCR 测试设备套件。与他们的前一个项目相比,这更像是一种 DIY 开源设备,但它具有相同的使用场景:使用环境测试来识别野外冠状病毒。正如该项目页面所指出的那样,“能够检测这些病原体的传统实时 PCR 设备通常花费超过 30,000 美元,而且不适合在现场使用。”由于 OpenPCR 是用户构建的工具包,并且在 [GPLv3.0 许可证][26]下共享,因此该设备旨在使分子诊断的访问大众化。 + +![OpenPCR][27] + +*来自 OpenPCR [网站][25],版权所有* + +而且,就像任何优秀的开源项目一样,它也有一个衍生产品!瑞士的 [Gaudi Labs][29] 推出的 [WildOpenPCR][28] 也以 [GPLv3.0 许可证][30]共享。 + +#### PocketPCR + +Gaudi Labs 的 [PocketPCR][31] 热循环仪可通过升高和降低小试管中液体的温度来激活生物反应。它可以通过简单的 USB 电源适配器供电,该适配器可以绑定到设备上,也可以单独使用,不使用计算机或智能手机时可使用预设参数。 + +![PocketPCR][32] + +*来自 PocketPCR [网站][31],版权所有* + +与本文所述的其他 PCR 产品一样,此设备可能有助于对冠状病毒进行环境测试,尽管其项目页面并未明确说明。PocketPCR 在 [GPLv3.0 许可证][33]下共享。 + +#### Open Lung 低资源呼吸机 + +[Open Lung 低资源呼吸机][34]是一种快速部署的呼吸机,它以[气囊阀罩][35](BVM)(也称为 Ambu 气囊)为核心组件。Ambu 气囊已批量生产,经过认证,体积小,机械简单,并且适用于侵入性导管和口罩。 Open Lung 呼吸机使用微电子技术来感测和控制气压和流量,以实现半自主运行。 + +![Open Lung ventilator][36] + +*Open Lung,[GitLab][37]* + +这个早期项目拥有一支由数百名贡献者组成的大型团队,领导者包括:Colin Keogh、David Pollard、Connall Laverty 和 Gui Calavanti。它是以 [GPLv3.0 许可证][38]共享的。 + +#### Pandemic 呼吸机 + +[Pandemic 呼吸机][39]是 DIY 呼吸机的原型。像 RepRap 项目一样,它在设计中使用了常用的硬件组件。该项目已由用户 Panvent 于 10 多年前上传到 Instructables,并且有六个主要的生产步骤。该项目是以 [CC BY-NC-SA 许可证][39]共享的。 + +#### Folding at Home + +[Folding at Home][40] 是一个分布式计算项目,用于模拟蛋白质动力学,包括蛋白质折叠的过程以及与多种疾病有关的蛋白质运动。这是一个面向公民科学家、研究人员和志愿者的行动呼吁,类似于退役的 [SETI@Home 项目][41]使用家中的计算机来运行解码计算。如果你是具备强大计算机硬件功能的技术人员,那么这个项目适合你。 + +![Markov state model][42] + +*Vincent Voelz,CC BY-SA 3.0* + +Folding at Home 项目使用马尔可夫状态模型(如上所示)来建模蛋白质可能采取的形状和折叠途径,以寻找新的治疗机会。你可以在华盛顿大学生物物理学家 Greg Bowman 的帖子《[它是如何运作的以及如何提供帮助][43]》中找到有关该项目的更多信息。 + +该项目涉及来自许多国家和地区(包括香港、克罗地亚、瑞典和美国)的财团的学术实验室、贡献者和公司赞助者。 在 [GitHub][45] 上,[在混合了 GPL 和专有许可证][44]下共享,并且可以在 Windows、macOS 和 GNU/Linux(例如 Debian、Ubuntu、Mint、RHEL、CentOS、Fedora)。 + +### 许多其他有趣的项目 + +这些项目只是在开源硬件领域中解决或治疗新冠病毒活动中的一小部分。在研究本文时,我发现了其他值得探索的项目,例如: + +* Coronavirus Tech Handbook 提供的[开源呼吸机、氧气浓缩器等][46] +* 来自 ProjectOpenAir 的 [有用的工程][47] +* Hackaday 上的[开源呼吸机黑客马拉松][48] +* 约翰·霍普金斯急诊医学住院医师 Julian Botta 的[简单开源机械呼吸机规范][49] +* [与冠状病毒有关的网络钓鱼、恶意软件和随机软件正在增加][50],作者:Shannon Morse +* [将低成本的 CPAP 鼓风机转换为基本呼吸机][51],作者: jcl5m1 +* [A.I.R.E. 论坛上关于开源呼吸器和风扇的讨论][52](西班牙语) +* [关于新冠病毒的开源医疗硬件的特殊问题][53],作者:Elsevier HardwareX + +这些项目遍布全球,而这种全球合作正是我们所需要的,因为病毒无视国界。新冠病毒大流行在不同时期以不同方式影响国家,因此我们需要一种分布式方法。 + +正如我和同事 Steven Abadie 在 [OSHdata 2020 报告][54]中所写的那样,开源硬件运动是全球性运动。参与该认证项目的个人和组织遍布全球 35 个国家地区和每个半球。 + +![Open source hardware map][55] + +*OSHdata,CC BY-SA 4.0 国际版* + +如果你有兴趣加入这场与全球开源硬件开发人员的对话,请加入[开源硬件峰会的 Discord][56] 服务器,并通过专用渠道进行有关新冠病毒的讨论。你在这里可以找到机器人专家、设计师、艺术家、固件和机械工程师、学生、研究人员以及其他共同为这场战争而战的人。希望可以看到你。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/open-hardware-covid19 + +作者:[Harris Kenny][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/harriskenny +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/health_heartbeat.png?itok=P-GXea-p (open on blue background with heartbeat symbol) +[2]: https://opensource.com/resources/what-open-hardware +[3]: https://reprap.org/wiki/RepRap +[4]: https://www.opensourceecology.org/ +[5]: https://www.osbeehives.com/ +[6]: https://www.scmp.com/news/hong-kong/health-environment/article/3052135/polytechnic-university-lab-3d-printing-face +[7]: https://www.3dprintingmedia.network/covid-19-3d-printed-valve-for-reanimation-device/ +[8]: https://www.3dprintingmedia.network/materialise-shows-3d-printed-door-opener-for-coronavirus-containment-efforts/ +[9]: https://news.yahoo.com/stitch-time-czechs-sew-combat-virus-mask-shortage-205213804.html +[10]: http://tapster.io/ +[11]: https://opensource.com/life/15/5/arduino-or-raspberry-pi +[12]: https://t.co/bFogaekehM +[13]: https://twitter.com/JIMrichards1010/status/1239140710558969857?ref_src=twsrc%5Etfw +[14]: http://Healthcare.gov +[15]: https://www.marktysonlaw.com/ +[16]: https://opentrons.com/ +[17]: https://blog.opentrons.com/testing-for-covid-19-with-opentrons/ +[18]: https://opensource.com/sites/default/files/uploads/opentrons.png (Opentrons roadmap graphic) +[19]: https://www.fda.gov/regulatory-information/search-fda-guidance-documents/policy-diagnostics-testing-laboratories-certified-perform-high-complexity-testing-under-clia-prior +[20]: https://github.com/Opentrons/opentrons/blob/edge/LICENSE +[21]: https://www.chaibio.com/openqpcr +[22]: https://en.wikipedia.org/wiki/Polymerase_chain_reaction +[23]: https://github.com/chaibio/chaipcr +[24]: https://beagleboard.org/bone +[25]: https://openpcr.org/ +[26]: https://github.com/jperfetto/OpenPCR/blob/master/license.txt +[27]: https://opensource.com/sites/default/files/uploads/openpcr.png (OpenPCR) +[28]: https://github.com/GenericLab/WildOpenPCR +[29]: http://www.gaudi.ch/GaudiLabs/?page_id=328 +[30]: https://github.com/GenericLab/WildOpenPCR/blob/master/license.txt +[31]: http://gaudi.ch/PocketPCR/ +[32]: https://opensource.com/sites/default/files/uploads/pocketpcr.png (PocketPCR) +[33]: https://github.com/GaudiLabs/PocketPCR/blob/master/LICENSE +[34]: https://gitlab.com/TrevorSmale/low-resource-ambu-bag-ventilor +[35]: https://en.wikipedia.org/wiki/Bag_valve_mask +[36]: https://opensource.com/sites/default/files/uploads/open-lung.png (Open Lung ventilator) +[37]: https://gitlab.com/TrevorSmale/low-resource-ambu-bag-ventilor/-/blob/master/images/CONCEPT_1_MECH.png +[38]: https://gitlab.com/TrevorSmale/low-resource-ambu-bag-ventilor/-/blob/master/LICENSE +[39]: https://www.instructables.com/id/The-Pandemic-Ventilator/ +[40]: https://foldingathome.org/ +[41]: https://setiathome.ssl.berkeley.edu/ +[42]: https://opensource.com/sites/default/files/uploads/foldingathome.png (Markov state model) +[43]: https://foldingathome.org/2020/03/15/coronavirus-what-were-doing-and-how-you-can-help-in-simple-terms/ +[44]: https://en.wikipedia.org/wiki/Folding@home +[45]: https://github.com/FoldingAtHome +[46]: https://coronavirustechhandbook.com/hardware +[47]: https://app.jogl.io/project/121#about +[48]: https://hackaday.com/2020/03/12/ultimate-medical-hackathon-how-fast-can-we-design-and-deploy-an-open-source-ventilator/ +[49]: https://docs.google.com/document/d/1FNPwrQjB1qW1330s5-S_-VB0vDHajMWKieJRjINCNeE/edit?fbclid=IwAR3ugu1SGMsacwKi6ycAKJFOMduInSO4WVM8rgmC4CgMJY6cKaGBNR14mpM +[50]: https://www.youtube.com/watch?v=dmQ1twpPpXA +[51]: https://github.com/jcl5m1/ventilator +[52]: https://foro.coronavirusmakers.org/ +[53]: https://www.journals.elsevier.com/hardwarex/call-for-papers/special-issue-on-open-source-covid19-medical-hardware +[54]: https://oshdata.com/2020-report +[55]: https://opensource.com/sites/default/files/uploads/oshdata-country.png (Open source hardware map) +[56]: https://discord.gg/duAtG5h diff --git a/published/20200319 Fedora 32 Release Date, New Features and Everything Else.md b/published/20200319 Fedora 32 Release Date, New Features and Everything Else.md new file mode 100644 index 0000000000..b47291dfe1 --- /dev/null +++ b/published/20200319 Fedora 32 Release Date, New Features and Everything Else.md @@ -0,0 +1,88 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12044-1.html) +[#]: subject: (Fedora 32 Release Date, New Features and Everything Else) +[#]: via: (https://itsfoss.com/fedora-32/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Fedora 32 发布日期、新功能和其它信息 +====== + +Fedora 32 应该和 [Ubuntu 20.04 LTS][1] 一样都在 4 月底发布。 + +由于我们详细介绍了 Ubuntu 20.04,因此我们考虑在这里为 Fedora 粉丝做同样的事情。 + +在本文中,我将重点介绍 Fedora 32 的新功能。随着开发的进行,我将对本文进行更新。 + +### Fedora 32 的新功能 + +![][2] + +#### 启用了 EarlyOOM + +在此版本中,默认启用 [EarlyOOM][3]。提供一下背景知识,EarlyOOM 可以让用户在大量进行[交换][4]时轻松地摆脱内存不足状况恢复其系统。 + +值得注意的是,它适用于 Fedora 32 Beta 工作站版本。 + +#### 添加了 GNOME 3.36 + +新的 Fedora 32 工作站版也包含了新的 [GNOME 3.36][5]。不仅限于 Fedora 32 Beta 工作站版,[Ubuntu 20.04 LTS][1] 的每日构建版中也添加了它。 + +当然,GNOME 3.36 中的改进也进入了 Fedora 的最新版本,总体上提供了更快,更好的体验。因此,你将获得新的锁定屏幕、请勿打扰功能以及 GNOME 3.36 附带的所有其他功能。 + +#### 软件包更新 + +Fedora 32 版本还更新了许多重要的软件包,包括 Ruby、Perl 和 Python。它还有 [GNU 编译器集合(GCC)][6]的最新版本 10。 + +#### 其他更改 + +除了主要亮点之外,还有很多更改、改进或修复。你可以详细查看它的[更新日志][7]来了解有关更多信息。 + +### 下载Fedora 32(开发版) + +Fedora 32 仍在开发中。Beta 版已经发布,你可以在空闲系统或虚拟机上对其进行测试。**我不建议你在最终版本之前在主系统上使用它**。当前版本有一个官方的[已知 bug 列表] [8],你也可以参考。 + +在[官方公告][9]中,他们提到了 **Fedora 32 beta 工作站版**和**服务器版**以及其他流行版本的可用性。 + +要获取工作站和服务器版本,你必须访问 [Fedora 工作站][10]和 [Fedora 服务器][11]的官方下载页面(取决于你的需求)。 + +![Fedora Download Beta][12] + +打开后,你只需查找如上图所示的标记为 “**Beta!**” 的发行版,然后开始下载。对于其他变体版本,请单击下面的链接以转到各自的下载页面: + +* [Fedora 32 Beta Spins][13] +* [Fedora 32 Beta Labs][14] +* [Fedora 32 Beta ARM][15] + +你是否注意到 Fedora 32 中的其他新功能?你想在这里看到哪些功能?请随时在下面发表评论。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/fedora-32/ + +作者:[Ankush Das][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/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/ubuntu-20-04-release-features/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/11/update_fedora.jpg?ssl=1 +[3]: https://fedoraproject.org/wiki/Changes/EnableEarlyoom#Enable_EarlyOOM +[4]: https://itsfoss.com/swap-size/ +[5]: https://itsfoss.com/gnome-3-36-release/ +[6]: https://gcc.gnu.org/ +[7]: https://fedoraproject.org/wiki/Releases/32/ChangeSet +[8]: https://fedoraproject.org/wiki/Common_F32_bugs +[9]: https://fedoramagazine.org/announcing-the-release-of-fedora-32-beta/ +[10]: https://getfedora.org/workstation/download/ +[11]: https://getfedora.org/server/download/ +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/fedora-download-beta.jpg?ssl=1 +[13]: https://spins.fedoraproject.org/prerelease +[14]: https://labs.fedoraproject.org/prerelease +[15]: https://arm.fedoraproject.org/prerelease diff --git a/published/20200319 Manually rotating log files on Linux.md b/published/20200319 Manually rotating log files on Linux.md new file mode 100644 index 0000000000..ae5f7294e3 --- /dev/null +++ b/published/20200319 Manually rotating log files on Linux.md @@ -0,0 +1,151 @@ +[#]: collector: (lujun9972) +[#]: translator: (HankChow) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12038-1.html) +[#]: subject: (Manually rotating log files on Linux) +[#]: via: (https://www.networkworld.com/article/3531969/manually-rotating-log-files-on-linux.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +在 Linux 系统中手动滚动日志 +====== + +![](https://img.linux.net.cn/data/attachment/album/202003/25/223932xqibwq5fafx5ao3f.jpg) + +日志滚动log rotation在 Linux 系统上是再常见不过的一个功能了,它为系统监控和故障排查保留必要的日志内容,同时又防止过多的日志造成单个日志文件太大。 + +日志滚动的过程是这样的:在一组日志文件之中,编号最大的(最旧的)一个日志文件会被删除,其余的日志文件编号则依次增大并取代较旧的日志文件,而较新的文件则取代它作为当前的日志文件。这一个过程很容易就可以实现自动化,在细节上还能按需作出微调。 + +使用 `logrotate` 命令可以手动执行日志滚动的操作。本文将要介绍的就是手动进行日志滚动的方法,以及预期产生的结果。 + +文中出现的示例适用于 Ubuntu 等 Linux 系统,对于其它类型的系统,日志文件和配置文件可能会有所不同,但日志滚动的过程是大同小异的。 + +### 为什么需要滚动日志 + +一般情况下,无需手动旋转日志文件。Linux 系统会每隔一天(或间隔更长的时间)或根据日志文件的大小自动进行一次日志滚动。如果你需要滚动日志以释放存储空间,又或者将某一部分日志从当前的活动中分割出来,这很容易做到,具体要取决于文件滚动规则。 + +### 一点背景介绍 + +在 Linux 系统安装完成后就已经有很多日志文件被纳入到日志滚动的范围内了。另外,一些应用程序在安装时也会为自己产生的日志文件设置滚动规则。一般来说,日志滚动的配置文件会放置在 `/etc/logrotate.d`。如果你想了解日志滚动的详细实现,可以参考[这篇以前的文章][4]。 + +在日志滚动的过程中,活动日志会以一个新名称命名,例如 `log.1`,之前被命名为 `log.1` 的文件则会被重命名为 `log.2`,依此类推。在这一组文件中,最旧的日志文件(假如名为 `log.7`)会从系统中删除。日志滚动时文件的命名方式、保留日志文件的数量等参数是由 `/etc/logrotate.d` 目录中的配置文件决定的,因此你可能会看到有些日志文件只保留少数几次滚动,而有些日志文件的滚动次数会到 7 次或更多。 + +例如 `syslog` 在经过日志滚动之后可能会如下所示(注意,行尾的注释部分只是说明滚动过程是如何对文件名产生影响的): + +``` +$ ls -l /var/log/syslog* +-rw-r----- 1 syslog adm 128674 Mar 10 08:00 /var/log/syslog <== 新文件 +-rw-r----- 1 syslog adm 2405968 Mar 9 16:09 /var/log/syslog.1 <== 之前的 syslog +-rw-r----- 1 syslog adm 206451 Mar 9 00:00 /var/log/syslog.2.gz <== 之前的 syslog.1 +-rw-r----- 1 syslog adm 216852 Mar 8 00:00 /var/log/syslog.3.gz <== 之前的 syslog.2.gz +-rw-r----- 1 syslog adm 212889 Mar 7 00:00 /var/log/syslog.4.gz <== 之前的 syslog.3.gz +-rw-r----- 1 syslog adm 219106 Mar 6 00:00 /var/log/syslog.5.gz <== 之前的 syslog.4.gz +-rw-r----- 1 syslog adm 218596 Mar 5 00:00 /var/log/syslog.6.gz <== 之前的 syslog.5.gz +-rw-r----- 1 syslog adm 211074 Mar 4 00:00 /var/log/syslog.7.gz <== 之前的 syslog.6.gz +``` + +你可能会发现,除了当前活动的日志和最新一次滚动的日志文件之外,其余的文件都已经被压缩以节省存储空间。这样设计的原因是大部分系统管理员都只需要查阅最新的日志文件,其余的日志文件压缩起来,需要的时候可以解压查阅,这是一个很好的折中方案。 + +### 手动日志滚动 + +你可以这样执行 `logrotate` 命令进行手动日志滚动: + +``` +$ sudo logrotate -f /etc/logrotate.d/rsyslog +``` + +值得一提的是,`logrotate` 命令使用 `/etc/logrotate.d/rsyslog` 这个配置文件,并通过了 `-f` 参数实行“强制滚动”。因此,整个过程将会是: + +- 删除 `syslog.7.gz`, +- 将原来的 `syslog.6.gz` 命名为 `syslog.7.gz`, +- 将原来的 `syslog.5.gz` 命名为 `syslog.6.gz`, +- 将原来的 `syslog.4.gz` 命名为 `syslog.5.gz`, +- 将原来的 `syslog.3.gz` 命名为 `syslog.4.gz`, +- 将原来的 `syslog.2.gz` 命名为 `syslog.3.gz`, +- 将原来的 `syslog.1.gz` 命名为 `syslog.2.gz`, +- 但新的 `syslog` 文件不一定必须创建。 + +你可以按照下面的几条命令执行操作,以确保文件的属主和权限正确: + +``` +$ sudo touch /var/log/syslog +$ sudo chown syslog:adm /var/log/syslog +$ sudo chmod 640 /var/log/syslog +``` + +你也可以把以下这一行内容添加到 `/etc/logrotate.d/rsyslog` 当中,由 `logrotate` 来帮你完成上面三条命令的操作: + +``` +create 0640 syslog adm +``` + +整个配置文件的内容是这样的: + +``` +/var/log/syslog +{ +rotate 7 +daily +missingok +notifempty +create 0640 syslog adm <== +delaycompress +compress +postrotate +/usr/lib/rsyslog/rsyslog-rotate +endscript +} +``` + +下面是手动滚动记录用户登录信息的 `wtmp` 日志的示例。由于 `/etc/logrotate.d/wtmp` 中有 `rotate 2` 的配置,因此系统中只保留了两份 `wtmp` 日志文件。 + +滚动前: + +``` +$ ls -l wtmp* +-rw-r----- 1 root utmp 1152 Mar 12 11:49 wtmp +-rw-r----- 1 root utmp 768 Mar 11 17:04 wtmp.1 +``` + +执行滚动命令: + +``` +$ sudo logrotate -f /etc/logrotate.d/wtmp +``` + +滚动后: + +``` +$ ls -l /var/log/wtmp* +-rw-r----- 1 root utmp 0 Mar 12 11:52 /var/log/wtmp +-rw-r----- 1 root utmp 1152 Mar 12 11:49 /var/log/wtmp.1 +-rw-r----- 1 root adm 99726 Feb 21 07:46 /var/log/wtmp.report +``` + +需要知道的是,无论发生的日志滚动是自动滚动还是手动滚动,最近一次的滚动时间都会记录在 `logrorate` 的状态文件中。 + +``` +$ grep wtmp /var/lib/logrotate/status +"/var/log/wtmp" 2020-3-12-11:52:57 +``` + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3531969/manually-rotating-log-files-on-linux.html + +作者:[Sandra Henry-Stocker][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://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://www.flickr.com/photos/klif/4244284159/in/photolist-7t44P6-oPFpsr-a8c5W-gWNZ6-32EEo4-cjdxqy-diHaq9-8DYZWf-gWNWM-bgLApc-hBt94C-cj71kY-PMESV-dZBcCU-pSqgNM-51eKHq-EecbfS-osGNau-KMUx-nFaWEL-cj71PE-HFVXn-gWNWs-85HueR-8QpDh8-kV1dEc-76qYSV-5YnxuS-gWNXr-dYoQ5w-dzj1j3-3AJyd-mHbaWF-q2fTri-e9bFa6-nJyvfR-4PnMyH-gWNZr-8VUtGS-gWNWZ-ajzUd4-2hAjMk-gWW3g-gWP11-dwYbH5-4XMew-cj71B1-ica9kJ-5RonM6-8z5tGL +[2]: https://creativecommons.org/licenses/by/2.0/legalcode +[3]: https://www.networkworld.com/newsletters/signup.html +[4]: https://www.networkworld.com/article/3218728/how-log-rotation-works-with-logrotate.html +[5]: 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) +[6]: https://www.facebook.com/NetworkWorld/ +[7]: https://www.linkedin.com/company/network-world diff --git a/published/20200322 Linus Torvalds- Advice on Working From Home during Coronavirus Lockdown.md b/published/20200322 Linus Torvalds- Advice on Working From Home during Coronavirus Lockdown.md new file mode 100644 index 0000000000..753398999f --- /dev/null +++ b/published/20200322 Linus Torvalds- Advice on Working From Home during Coronavirus Lockdown.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12029-1.html) +[#]: subject: (Linus Torvalds’ Advice on Working From Home during Coronavirus Lockdown) +[#]: via: (https://itsfoss.com/torvalds-remote-work-advice/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Linus Torvalds 关于在冠状病毒禁足期间在家工作的建议 +====== + +在冠状病毒爆发期间,我们中的许多人都在室内自我隔离。[ZDNet][1] 特此与 Linus Torvalds 进行了专题采访,讨论了他对冠状病毒禁足期间在家工作的看法或想法。 + +如果你还不知道(怎么可能不知道),[Linus Torvalds][2] 是 Linux 的创建者,也是 [Git][3] 的创建者,而所有这一切都是他在家里工作时做的。这是 2016 年的视频,Torvalds 展示了他的家庭办公室: + +- [video](https://img.linux.net.cn/static/video/Linus%20Torvalds%20Guided%20Tour%20of%20His%20Home%20Office-SOXeXauRAm0.mp4) + +因此,在本文中,我将分享我关注的一些主要要点,以及来自 Linus Torvalds 接受 ZDNet [Steven J. Vaughan-Nichols][4] 采访互动时的回应。 + +### 消除对人际交往缺失的恐惧 + +Linus 提到,几年前刚开始在家工作时,他担心过缺少人与人之间的互动,包括去办公室、与人互动或哪怕只是出去吃个午餐。 + +有趣的是,他似乎并没有错过任何东西,他更喜欢在家中没有人际交往的时间。 + +当然,将自己与人际互动隔离开并不是最好的事情 ,但在目前看来,这是一件好事。 + +### 利用在家工作的优势 + +![][5] + +就像我们是完全远程操作一样,你可以做很多事情,而无需实际在办公室。 + +不要忘记,你可以随心所欲地养猫,我有 6 只猫,我知道这很困难(*哈哈*)。 + +而且,正如 Linus 所提到的,远程工作的真正优势在于“灵活性”。你不一定需要朝九晚五甚至更长的时间坐在办公桌前。从技术上讲,你可以在工作中自由休息,并在家中做你想做的任何事情。 + +换句话说,Linus 建议**不要在你的家中重新搞一个办公室**,这比去办公室还差。 + +### 高效沟通是关键 + +![][6] + +虽然你可以在一天之中召开几次会议(视频会议或音频呼叫),但这真的有必要吗? + +对于某些人来说,这可能很重要,但是你应该通过简化和整理内容来尽量减少会议花费的时间。 + +或者,按照 Linus 的建议,最好有个电子邮件列表来记录事情,以确保一切各司其职,这就是 [Linux 内核][7] 的运行方式。 + +James Bottomley 是 [IBM 研究院][8]的杰出工程师,也是资深 Linux 内核开发人员,他也建议你重新阅读你的文字以确保发送的准确信息不会被人不小心跳过。 + +就个人而言,出于同样的原因,我更喜欢文本而不是语音。实际上,它可以节省你的时间。 + +但是,请记住,你需要只以适当的方式传达必要的信息,而不要使通过文本/电子邮件发送的信息过载。 + +### 追踪你的时间 + +灵活性并不一定意味着你可以减少工作量并泡在社交媒体平台上,除非那就是你的工作。 + +因此,你需要确保充分利用自己的时间。为此,你可以使用多种工具来跟踪你的时间用在什么地方,以及在计算机上花费的时间。 + +你甚至可以将其记录在便签上,以确保你可以将时间高效地分配于工作上。你可以选择使用 [RescueTime][9] 或 [ActivityWatch][10] 来跟踪你在计算机或智能手机上花费的时间。 + +### 和猫(宠物)一起玩 + +![][11] + +不歧视其他宠物,但这就是 Linus Torvalds 提到的。 + +正因为你在家中,你在安排工作或尝试有效利用时间时要做的事情有很多。 + +Linus 坚持认为,每当你感到无聊时,可以在必要时出门获取必需品,也可以与猫(或你的其它宠物)一起玩。 + +### 结语 + +虽然 Linus 还提到了当你在家时没人会评判你,但他的建议似乎是正确的,对于那些在家工作的人来说可能很有用。 + +不仅是因为冠状病毒的爆发,而且如果你打算一直在家工作,应该牢记这些。 + +你如何看待 Linus 的看法呢?你同意他的观点吗? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/torvalds-remote-work-advice/ + +作者:[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.zdnet.com/article/pet-the-cat-own-the-bathrobe-linus-torvalds-on-working-from-home/ +[2]: https://en.wikipedia.org/wiki/Linus_Torvalds +[3]: https://git-scm.com/ +[4]: https://twitter.com/sjvn +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/Work-from-Home-torvalds.jpg?ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/torvalds-home-office.jpg?ssl=1 +[7]: https://en.wikipedia.org/wiki/Linux_kernel +[8]: https://www.research.ibm.com/ +[9]: https://www.rescuetime.com/ +[10]: https://activitywatch.net/ +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/torvalds-penguins.jpeg?ssl=1 diff --git a/published/20200322 Purism Librem Mini- A Privacy-First Linux-Based Mini PC.md b/published/20200322 Purism Librem Mini- A Privacy-First Linux-Based Mini PC.md new file mode 100644 index 0000000000..3df6585958 --- /dev/null +++ b/published/20200322 Purism Librem Mini- A Privacy-First Linux-Based Mini PC.md @@ -0,0 +1,107 @@ +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-12042-1.html" +[#]: subject: "Purism Librem Mini: A Privacy-First Linux-Based Mini PC" +[#]: via: "https://itsfoss.com/purism-librem-mini/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" + +Purism Librem Mini:隐私为重的基于 Linux 的微型个人电脑 +====== + +> Purism 推出了一款外形小巧的微型个人电脑 “Librem Mini”,旨在提供隐私和安全性。让我们来看看它的细节。 + +[Purism][1] 以专注于增强用户的数字隐私和安全性的服务或产品而闻名。 + +Purism 自诩为“[社会目地公司][2]Social Purpose Company”,旨在为社会造福,并在这方面提供了多种服务和产品。 + +你可能听说过它的 Librem 系列 [Linux 笔记本电脑][3]、[Librem One][4](加密服务)、[PureOS Linux][5] 和 [Librem 5 Linux 智能手机][6]。现在,他们已经针对想要掌控自己的隐私和安全性的用户推出了小尺寸微型个人电脑。 + +### Librem Mini: Purism 的微型个人电脑 + +![Librem Mini PC][7] + +[Purism][1] 的 [Librem Mini][8] 旨在成为小型、轻便且功能强大的微型个人电脑。 + +当然,已经有很多[基于 Linux 的微型个人电脑][9]了,但是 Librem Mini 专门关注于其用户的隐私和安全性。它随附了 [PureOS][5]、[Pureboot][10] 和 [Librem Key][11] 支持。 + +基本配置将以 699 美元的价格提供。这比大多数其他微型个人电脑要贵。但是,与大多数其他产品不同,Librem Mini 并不是又一个 [Intel NUC][12]。 那么,它提供了什么呢? + +### Librem Mini 的规格 + +![][13] + +这是它的规格表: + + * Intel Core i7-8565U(Whiskey Lake),主动(风扇)冷却,4 核 8 线程最高频率 4.6GHz + * Intel UHD Graphics 620 + * RAM: 最多 64 GB DDR4 2400 MHz(2 个 SO-DIMM 插槽) + * 1 SATA III 6GB/s SSD/HDD(7mm) + * 1 M.2 SSD(SATA III/NVMe x4) + * 1 HDMI 2.0 4K @ 60Hz + * 1 DisplayPort 1.2 4K @ 60Hz + * 4 x USB 3.0 + * 2 x USB 2.0 + * 1 x Type-C 3.1 + * 3.5mm 音频插孔(麦克风输入和耳机插孔合一) + * 1 RJ45 Gigabit Ethernet LAN + * WiFi 802.11n(2.4/5.0 GHz),可选 Atheros ATH9k 模块 + * 包括在 WiFi 模块的蓝牙 4.0(可选) + * 重量:1 公斤(2.2 磅) + * 尺寸:12.8 厘米(5.0 英寸) x 12.8 厘米(5.0 英寸) x 3.8 厘米(1.5 英寸) + +我不知道他们为什么决定采用 Intel 的 8 代处理器,而市场上已经出现了 10 代处理器。也许是因为 Whiskey Lake 是第 8 代处理器的最新产品。 + +是的,他们已禁用并中止了 Intel 的管理引擎,所以仍然可以采用这个产品。 + +除此之外,你还应该记住,这款微型个人电脑在提供全盘加密的同时具有检测硬件和软件篡改的功能。 + +而且,当然,用的是 Linux。 + +### 价格和供应 + +![Librem Mini from the back][14] + +具有 8 Gigs RAM 和 256 GB SSD 的基本配置将需要花费 $699。而且,如果你想要最强大的配置,其价格轻松就升高到 $3000。 + +他们的预定销售额目标是 $50,000,并且他们计划在达到预定目标后一个月内开始发货。 + +因此,如果你要是现在[预订][15]的话,不要指望很快就会开始发货。因此,我建议你关注 [Librem Mini 产品页面][8]的预定目标。 + +### 总结 + +如果你正在寻找一台微型个人电脑(不是专门为隐私和安全而设计的),则可以看看我们的[基于 Linux 的最佳微型个人电脑][9]列表,以获取更多建议。 + +对于普通消费者而言,Librem Mini 绝对听起来很昂贵。对于隐私发烧友来说,它仍然是一个不错的选择。 + +你怎么看?让我知道你的想法! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/purism-librem-mini/ + +作者:[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://puri.sm/ +[2]: https://puri.sm/about/social-purpose/ +[3]: https://itsfoss.com/get-linux-laptops/ +[4]: https://itsfoss.com/librem-one/ +[5]: https://itsfoss.com/pureos-convergence/ +[6]: https://itsfoss.com/librem-linux-phone/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/librem-mini-pc.png?ssl=1 +[8]: https://puri.sm/products/librem-mini/ +[9]: https://itsfoss.com/linux-based-mini-pc/ +[10]: https://docs.puri.sm/PureBoot.html +[11]: https://puri.sm/products/librem-key/ +[12]: https://itsfoss.com/intel-nuc-essential-accessories/ +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/librem-mini-pc-1.png?ssl=1 +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/librem-mini-back.png?ssl=1 +[15]: https://shop.puri.sm/shop/librem-mini/ diff --git a/sources/news/20200314 Linux Foundation prepares for disaster, new anti-tracking data set, Mozilla goes back to mobile OSes, and more open source news.md b/sources/news/20200314 Linux Foundation prepares for disaster, new anti-tracking data set, Mozilla goes back to mobile OSes, and more open source news.md new file mode 100644 index 0000000000..0f3aa9a0a3 --- /dev/null +++ b/sources/news/20200314 Linux Foundation prepares for disaster, new anti-tracking data set, Mozilla goes back to mobile OSes, and more open source news.md @@ -0,0 +1,82 @@ +[#]: 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 hadn’t 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 diff --git a/sources/news/20200319 Tools for monitoring, introvert inclusion, and more industry trends.md b/sources/news/20200319 Tools for monitoring, introvert inclusion, and more industry trends.md new file mode 100644 index 0000000000..838a4e2c23 --- /dev/null +++ b/sources/news/20200319 Tools for monitoring, introvert inclusion, and more industry trends.md @@ -0,0 +1,60 @@ +[#]: 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. There’s 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 Agent’s 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/ diff --git a/sources/news/20200319 With npm Acquisition, Microsoft is Set to Own the Largest Software Registry in the World.md b/sources/news/20200319 With npm Acquisition, Microsoft is Set to Own the Largest Software Registry in the World.md new file mode 100644 index 0000000000..7e2d898bfe --- /dev/null +++ b/sources/news/20200319 With npm Acquisition, Microsoft is Set to Own the Largest Software Registry in the World.md @@ -0,0 +1,78 @@ +[#]: 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 [world’s 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. + +### Microsoft’s 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 Microsoft’s 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/ diff --git a/sources/news/20200322 OBS Studio 25.0 is Here With Vulkan-based Games Capture Feature and More.md b/sources/news/20200322 OBS Studio 25.0 is Here With Vulkan-based Games Capture Feature and More.md new file mode 100644 index 0000000000..afd9891678 --- /dev/null +++ b/sources/news/20200322 OBS Studio 25.0 is Here With Vulkan-based Games Capture Feature and More.md @@ -0,0 +1,98 @@ +[#]: 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. It’s 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 it’s latest version 25.0 with plenty of new features to make your recording and streaming experience better. Let’s 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 that’s 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 haven’t used OBS much though I have heard great stuff about it. I don’t live stream but I do record my desktop to create tutorial and information Linux videos on I[t’s FOSS YouTube channel][11] (you should subscribe to it if you haven’t 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/ diff --git a/sources/news/20200325 npm joins GitHub, building operators in Kubernetes, and more industry trends.md b/sources/news/20200325 npm joins GitHub, building operators in Kubernetes, and more industry trends.md new file mode 100644 index 0000000000..3a7671da2c --- /dev/null +++ b/sources/news/20200325 npm joins GitHub, building operators in Kubernetes, and more industry trends.md @@ -0,0 +1,70 @@ +[#]: 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, we’ll 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 GitHub’s 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 we’re 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 we’ve 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 won’t 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/ diff --git a/sources/talk/20190822 How the Linux desktop has grown.md b/sources/talk/20190822 How the Linux desktop has grown.md deleted file mode 100644 index e46b310502..0000000000 --- a/sources/talk/20190822 How the Linux desktop has grown.md +++ /dev/null @@ -1,201 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How the Linux desktop has grown) -[#]: via: (https://opensource.com/article/19/8/how-linux-desktop-grown) -[#]: author: (Jim Hall https://opensource.com/users/jim-hallhttps://opensource.com/users/jason-bakerhttps://opensource.com/users/jlacroixhttps://opensource.com/users/doni08521059https://opensource.com/users/etc-eterahttps://opensource.com/users/marcobravohttps://opensource.com/users/alanfdoss) - -How the Linux desktop has grown -====== -Since the early 1990s, the Linux desktop has matured from a simple -window manager to a full desktop. Join us on a journey through the -history of the Linux desktop. -![Person typing on a 1980's computer][1] - -I first installed Linux in 1993. At that time, you really didn't have many options for installing the operating system. In those early days, many people simply copied a running image from someone else. Then someone had the neat idea to create a "distribution" of Linux that let you customize what software you wanted to install. That was the Softlanding Linux System (SLS) and my first introduction to Linux. - -My '386 PC didn't have much memory, but it was enough. SLS 1.03 required 2MB of memory to run, or 4MB if you wanted to compile programs. If you wanted to run the X Window System, you needed a whopping 8MB of memory. And my PC had just enough memory to run X. - -As I'd grown up with the command line, a graphical user interface wasn't essential to me. But it sure was convenient. I could run applications in different windows and easily switch between tasks. - -From my first experiment with Linux, I was hooked. I've stuck with Linux on my desktop ever since. Like many people, I ran Linux in a dual-boot configuration for a while so I could jump back to MS-DOS and Windows to run certain programs. Until 1998, when I finally took the plunge and went all-in with Linux. - -Over the last 26 years, I have watched the Linux desktop mature. I've also tried an interesting combination of desktop environments over that time, which I'll share by taking a journey through the history of the Linux desktop. - -### X and window managers - -The first "desktops" on Linux weren't yet desktops. Instead, they were _window managers_ running on the X Window System. X provided the basic building blocks for a graphical user interface, such as creating windows on the screen and providing keyboard and mouse input. By itself, X didn't do much. To make the X graphical environment useful, you needed a way to manage all the windows in your session. That's where the _window manager_ came in. Running an X program like xterm or xclock opens that program in a window. The window manager keeps track of windows and does basic housekeeping, such as letting you move windows around and minimize them. The rest is up to you. You could launch programs when X started by listing them in the **~/.xinitrc** file, but usually, you'd run new programs from an xterm. - -The most common window manager in 1993 was TWM, which dates back to 1988. TWM was quite simple and provided only basic window management. - -![TWM on SLS 1.05][2] - -TWM on SLS 1.05 showing xterm, xclock, and the Emacs editor - -Yet another early window manager was the OpenLook Virtual Window Manager (OLVWM). OpenLook was a graphical user interface developed by Sun Microsystems in the 1980s and later ported to other Unix platforms. As a _virtual_ window manager, OLVWM supported multiple workspaces. - -![OLVWM on SLS 1.05][3] - -OLVWM on SLS 1.05 showing xterm and the Virtual Workspaces selector - -When Linux began to grow in popularity, it didn't take long for others to create new window managers with smoother performance and improved interfaces. The first of these new window managers was FVWM, a virtual window manager. FVWM sported a more modern look than TWM or OLVWM. But we didn't yet have a desktop. - -![FVWM on SLS 1.05][4] - -FVWM on SLS 1.05 showing xterm and a file manager - -To modern eyes, TWM and FVWM may look pretty plain. But it's important to remember what other graphical environments looked like at the time. The then-current version of Windows looked rather simple. Windows versions 1 through 3 used a plain launcher called the Program Manager. - -![Windows 3.11][5] - -Windows 3.11 showing the Program Manager and the Notepad editor - -In August 1995, Microsoft released Windows 95 and changed the modern PC desktop landscape. Certainly, I was impressed. I thought Windows 3.x was ungainly and ugly, but Windows 95 was smooth and pretty. More importantly, Windows 95 was what we now consider a _desktop_. The new desktop metaphor was a huge step forward. You could put icons on the desktop—and in fact, Windows 95 presented two default desktop icons, for My Computer (to open a file manager) and the Recycle Bin (where you put files to be deleted later). - -But more importantly, the Windows 95 desktop meant _integration_. The Program Manager was gone, replaced by a Taskbar at the bottom of the screen that let you launch new programs using a simpler Start menu. The Taskbar was multifunctional and also showed your running programs via a series of buttons and a dock showing the time, speaker volume, and other simple controls. You could right-click on any object on the new desktop, and Windows 95 would present you with a context-sensitive menu with actions you could perform. - -![Windows 95][6] - -Windows 95 showing the Notepad editor - -The Windows 95 interface was slick and much easier to use than previous versions of Windows—and even other Linux window managers. Not to be outdone, Linux developers created a new version of FVWM that mimicked the Windows 95 interface. Called FVWM95, the new window manager still wasn't a desktop, but it looked very nice. The new taskbar let you start new X programs using the Start menu. The taskbar also showed your running programs using buttons similar to Windows 95's. - -![FVWM95 on Red Hat Linux 5.2][7] - -FVWM95 on Red Hat Linux 5.2 showing xterm and a quick-access program launcher with icons for xterm, the file manager, and other programs - -While FVWM95 and other window managers were improving, the core problem remained: Linux didn't really have a desktop. It had a collection of window managers, and that was about it. Linux applications that used a graphical user interface (GUI, pretty much meaning they were X applications) all looked different and worked differently. You couldn't copy and paste from one application to another, except the simple text-only copy/paste provided by the X Window System. What Linux really needed was a complete redo in its GUI to create the first desktop. - -### The first Linux desktop - -In 1996, Matthias Ettrich was troubled by the inconsistency of Linux applications under X. He wanted to make the graphical environment easy to use. And more importantly, he wanted to make everything _integrated_—like an actual desktop. - -Matthias started work on the K Desktop Environment. That's K for "Kool." But the name KDE was also meant to be a play on the Common Desktop Environment (CDE) that was the standard in the "Big Unix" world. Although by 1996, CDE was looking pretty dated. CDE was based on the Motif widget set, which is the same design that FVWM mimicked. Finalized in July 1998, KDE 1.0 was a definite improvement over plain window managers like FVWM95. - -![KDE 1.0][8] - -K Desktop Environment (KDE) version 1.0 - -Image credit: Paul Brown / KDE - -KDE was a big step forward for Linux. Finally, Linux had a true desktop with application integration and more modern desktop icons. KDE's design was not dissimilar from Windows 95. You had a kind-of taskbar along the bottom of the screen that provided the equivalent of Windows 95's Start menu as well as several application shortcuts. KDE also supported virtual desktops, which were cleverly labeled One, Two, Three, and Four. Running applications were represented via buttons in a separate taskbar at the top of the screen. - -But not everyone was happy with KDE. To abstract the GUI from the system, KDE used Trolltech's Qt toolkit library. Unfortunately, Qt was not distributed under a free software license. Trolltech allowed Qt to be used at no charge in free software applications but charged a fee to use it in commercial or proprietary applications. And that dichotomy is not aligned with free software. This caused problems for Linux distributions: Should they include KDE? Or default to an older but free software graphical user interface like FVWM? - -In response, Miguel de Icaza and Federico Mena started work in 1997 on a new Linux desktop. The new project was dubbed GNOME, for GNU Network Object Model Environment. GNOME aimed to be completely free software and used a different toolkit, called GTK, from the GIMP image editor. GTK literally stood for GIMP Tool Kit. When GNOME 1.0 was finally released in 1999, Linux had another modern desktop environment. - -![GNOME 1.0][9] - -GNOME version 1.0 - -Image credit: GNOME Documentation Project - -While it was great to have two desktop environments for Linux, the "KDE versus GNOME" rivalry continued for some time. By 1999, Trolltech re-released the Qt library under a new public license, the Q Public License (QPL). But the new license carried its own baggage—the QPL only applied to Qt's use in open source software projects, not commercial projects. Thus the Free Software Foundation deemed the QPL [not compatible][10] with the GNU General Public License (GNU GPL). This licensing issue would remain until Trolltech re-re-released the Qt library under the GNU GPL version 2 in 2000. - -### Development over time - -The Linux desktop continued to mature. KDE and GNOME settled into a friendly competition that pushed both to add new features and to exchange ideas and concepts. By 2004, both GNOME and KDE had made significant strides, yet brought only incremental changes to the user interface. - -KDE 2 and 3 continued to rely on a taskbar concept at the bottom of the screen but incorporated the buttons for running applications. One of KDE's most visible changes was the addition of the Konqueror browser, which first appeared in KDE 2. - -![KDE 2.2.2 \(2001\) showing the Konqueror browser][11] - -KDE 2.2.2 (2001) showing the Konqueror browser - -Image credit: Paul Brown / KDE - -![KDE 3.2.2][12] - -KDE 3.2.2 (2004) on Fedora Core 2 showing the Konqueror file manager (using a Fedora Core 2 theme) - -GNOME 2 also used a taskbar concept but split the bar into two: a taskbar at the top of the screen to launch applications and respond to desktop alerts, and a taskbar at the bottom of the page to show running applications. On my own, I referred to the two taskbars as "things you can do" (top) and "things are you doing" (bottom). In addition to the streamlined user interface, GNOME also added an updated file manager called Nautilus, developed by Eazel. - -![GNOME 2.6.0][13] - -GNOME 2.6.0 (2004) on Fedora Core 2 showing the Nautilus file manager (using a Fedora Core 2 theme) - -Over time, KDE and GNOME have taken different paths. Both provide a feature-rich, robust, and modern desktop environment—but with different user interface goals. In 2011, there was a major deviation between how GNOME and KDE approached the desktop interface. KDE 4.6 (January 2011) and KDE 4.7 (July 2011) provided a more traditional desktop metaphor while continuing to rely on the taskbar concept familiar to many users. Of course, KDE saw lots of changes under the hood, but the familiar look and feel remained. - -![KDE 4.6][14] - -KDE 4.6 showing the Gwenview image viewer - -Image credit: KDE - -In 2011, GNOME completely changed gears with a new desktop concept. GNOME 3 aimed to create a simpler, more streamlined desktop experience, allowing users to focus on what they were working on. The taskbar disappeared, replaced by a black status bar at the top of the screen that included volume and network controls, displayed the time and battery status, and allowed users to launch new programs via a redesigned menu. - -The menu was the most dramatic change. Clicking the Activities menu or moving the mouse into the Activities "hot corner" showed all open applications as separate windows. Users could also click an Applications tab from the Overview to start a new program. The Overview also provided an integrated search function. - -![GNOME 3.0][15] - -GNOME 3.0 showing the GNOME Pictures application - -Image credit: GNOME - -![GNOME 3.0][16] - -GNOME 3.0 showing the Activities Overview - -Image credit: GNOME - -### Your choice of desktop - -Having two desktops for Linux means users have great choice. Some prefer KDE and others like GNOME. That's fine. Pick the desktop that best suits you. - -To be sure, both KDE and GNOME have fans and detractors. For example, GNOME received a fair bit of criticism for dropping the taskbar in favor of the Activities Overview. Perhaps the most well-known critic was Linus Torvalds, who [loudly denounced and abandoned][17] the new GNOME as an "unholy mess" in 2011—before [moving back][18] to GNOME two years later. - -Others have made similar criticisms of GNOME 3, to the point that some developers forked the GNOME 2 source code to create the MATE desktop. MATE (which stands for MATE Advanced Traditional Environment) continues the traditional taskbar interface from GNOME 2. - -Regardless, there's no doubt that the two most popular Linux desktops today are KDE and GNOME. Their current versions are both very mature and packed with features. Both KDE 5.16 (2019) and GNOME 3.32 (2019) try to simplify and streamline the Linux desktop experience—but in different ways. GNOME 3.32 continues to aim for a minimal appearance, removing all distracting user interface elements so users can focus on their applications and work. KDE 5.16 takes a more familiar approach with the taskbar but has added other visual improvements and flair, especially around improved widget handling and icons. - -![KDE 5.16 Plasma][19] - -KDE 5.16 Plasma - -Image credit: KDE - -![GNOME 3.32][20] - -GNOME 3.32 - -Image credit: GNOME - -At the same time, you don't completely lose out on compatibility. Every major Linux distribution provides compatibility libraries, so you can run applications from, say, KDE while running GNOME. This is immensely useful when an application you really want to use is written for the other desktop environment—not a problem; you can run KDE applications on GNOME and vice versa. - -I don't see this changing anytime soon. And I think that's a good thing. Healthy competition between KDE and GNOME has allowed developers in both camps to push the envelope. Whether you use KDE or GNOME, you have a modern desktop with great integration. And above all, this means Linux has the best feature in free software: choice. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/8/how-linux-desktop-grown - -作者:[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-hallhttps://opensource.com/users/jason-bakerhttps://opensource.com/users/jlacroixhttps://opensource.com/users/doni08521059https://opensource.com/users/etc-eterahttps://opensource.com/users/marcobravohttps://opensource.com/users/alanfdoss -[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://opensource.com/sites/default/files/uploads/twm-sls105.png (TWM on SLS 1.05) -[3]: https://opensource.com/sites/default/files/uploads/olvwm-sls105.png (OLVWM on SLS 1.05) -[4]: https://opensource.com/sites/default/files/uploads/fvwm-sls105.png (FVWM on SLS 1.05) -[5]: https://opensource.com/sites/default/files/uploads/win311.png (Windows 3.11) -[6]: https://opensource.com/sites/default/files/uploads/win95.png (Windows 95) -[7]: https://opensource.com/sites/default/files/uploads/fvwm95-rh52.png (FVWM95 on Red Hat Linux 5.2) -[8]: https://opensource.com/sites/default/files/uploads/kde1.png (KDE 1.0) -[9]: https://opensource.com/sites/default/files/uploads/gnome10.png (GNOME 1.0) -[10]: https://www.linuxtoday.com/developer/2000090500121OPLFKE -[11]: https://opensource.com/sites/default/files/uploads/kde_2.2.2.png (KDE 2.2.2 (2001) showing the Konqueror browser) -[12]: https://opensource.com/sites/default/files/uploads/kde322-fc2.png (KDE 3.2.2) -[13]: https://opensource.com/sites/default/files/uploads/gnome26-fc2.png (GNOME 2.6.0) -[14]: https://opensource.com/sites/default/files/uploads/kde46.png (KDE 4.6) -[15]: https://opensource.com/sites/default/files/uploads/gnome30.png (GNOME 3.0) -[16]: https://opensource.com/sites/default/files/uploads/gnome30-overview.png (GNOME 3.0) -[17]: https://www.theregister.co.uk/2011/08/05/linus_slams_gnome_three/ -[18]: https://www.phoronix.com/scan.php?page=news_item&px=MTMxNjc -[19]: https://opensource.com/sites/default/files/uploads/kde516.png (KDE 5.16 Plasma) -[20]: https://opensource.com/sites/default/files/uploads/gnome332.png (GNOME 3.32) diff --git a/sources/talk/20191031 A Bird-s Eye View of Big Data for Enterprises.md b/sources/talk/20191031 A Bird-s Eye View of Big Data for Enterprises.md index 23db96ce3d..c62169b830 100644 --- a/sources/talk/20191031 A Bird-s Eye View of Big Data for Enterprises.md +++ b/sources/talk/20191031 A Bird-s Eye View of Big Data for Enterprises.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (chai-yuan) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/talk/20200214 Linux is our love language.md b/sources/talk/20200214 Linux is our love language.md deleted file mode 100644 index 397ddee4d3..0000000000 --- a/sources/talk/20200214 Linux is our love language.md +++ /dev/null @@ -1,83 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Linux is our love language) -[#]: via: (https://opensource.com/article/20/2/linux-love-language) -[#]: author: (Christopher Cherry https://opensource.com/users/chcherry) - -Linux is our love language -====== -When a wife teaches a husband some new tech skills, they both learn a -lot more than they expect. -![Red heart with text "you are not alone"][1] - -2019 was a year of learning in the Cherry household. I am a senior software engineer who set out to learn new skills and, along the way, I taught my husband, Chris. By teaching him some of the things I learned and asking him to work through my technology walkthrough articles, I helped Chris learn new skills that enabled him to pivot his career deeper into the technology field. And I learned new ways to make my walkthroughs and training materials more accessible for readers to digest. - -In this article, we talk about what we learned individually and from each other, then we explore what it means for their future. - -### Questions for the student - -**Jess:** Chris, what made you want to learn more about my field? - -**Chris:** It was primarily to further my career. Being in network engineering has shown me that being an expert only on networks is not as valuable as it once was, and I have to know a little bit of everything. Since the network is often blamed for outages or application challenges these days, I wanted to understand more from a developer's perspective on writing applications so I could see how they depend on the network as a resource. - -**Jess:** What did I teach you first, and what did you learn from it? - -**Chris:** It all started with installing Linux for the first time, then adding [Ansible][2]. Each Linux distribution I worked with was easy enough to install, as long as the hardware was compatible, but compatibility wasn't always clear. That meant sometimes I learned first-hand how to troubleshoot Linux within the first five minutes of running an installation (and I liked it). Ansible gave me a reason to learn Linux package managers to install the software. Once it was installed, I quickly learned how package management handles dependencies as I looked at the files that yum installed, so Ansible, which is written in Python, can run on my system. From there, I started to install all kinds of applications with Ansible. - -**Jessica:** Do you like the way I taught you? - -**Chris:** We had our struggles at first, until we ironed out how I like to learn and how you should present the best way for me to learn. In the beginning, it was hard to follow what you meant. For instance, when you said things like "a Docker container," I had no reference to what you were talking about. Early on, the response was, "well, it's a container," which meant nothing to me at the time. Once I got you to explain it in more detail, it became a lot more fun to learn. - -**Jess:** To be fair, this was a big lesson for me as well. I hadn't trained anyone with less knowledge on this technology than me before you, so you helped me realize that I needed to be clearer with my explanations. Thanks for that. - -How did you feel about testing my articles, the ones where I had you run through the steps? - -**Chris:** Personally, I thought it would be easy, and boy, was I wrong. One of the main things I learned from these, like your [introduction to Vagrant][3], was how each Linux distribution varies more than I realized. The operating system (OS) changes how you set it up, the requirements to run, and the specific commands. It seems like a lot more variability than there is with the network gear I've worked on. So I started to pay a lot more attention to the instructions and whether they were written for my OS or another one (and how difficult it can be to know sometimes). I seemed to break a lot of things along the way. - -**Jess:** I break stuff all day, so different paths for different problems are daily occurrences for me. - -### Questions for the teacher - -**Chris:** Jess, would you change anything with the way you taught me so far? - -**Jess:** I'd have liked to make you read more, as I do. Learning new technology has me churning through books. I read a book and a half, if not two books, a week, and that's with spending one hour in the morning and one hour before bed every day. I also pick one project to run through for two weeks for about an hour a day to reinforce the book skills. And that's in addition to the tech articles I read for the first hour of my day while taking in an immense amount of coffee. When I think about your goal to grow your career, I think books are an important element alongside the great blog posts and articles we talk about. I feel my reading regiment has kept me up to speed, and if you did the same, you would catch up to me pretty quickly. - -**Chris:** So did the student teach the teacher in any way? - -**Jess:** I learned a great deal about being patient from you. For instance, after walking through an installation of Ansible, I asked what you wanted to do next. Your first answer was, "I don't know," which was hard for me because I want you to learn what you want to learn. So I changed my approach, and now we talk more about what you want to achieve before walking through installing anything. When we moved on to the Vagrant article we worked on together, I created it with an end goal in mind, so we had something to achieve right away. - -This actually made a massive change in how I do training at work. Now I ask more questions on how people learn and work hand-in-hand more often than I did before. I am more likely to sit and go through and make sure someone understands what I'm saying and what we're doing. I wasn't really before. - -### What we learned together - -As a couple, we both grew from collaborating on technology over the last year. - -**Chris:** I'm blown away at how much I learned. Over the course of a year, I understand new operating systems, how to use an API, web application deployment with Ansible, and standing up virtual machines with Vagrant. I also learned how documentation makes life better, so it's worth the time it takes to write some. In this field of work, however, behavior isn't always documented, so I've learned to be ready to work through tough issues and document how I fix them. - -**Jess:** Beyond what I learned from teaching you, I've focused on learning a good deal about Kubernetes in cloud environments. That includes deployment strategies, the complexity of the Kubernetes API, building my own containers, and securing these environments. I've also saved time to dabble: toying around with serverless code, AI models, Python, and graphically displaying heat maps. It's been a good year. - -What's next for us? It's yet to be seen, but I can assure you that we're going to share it here on Opensource.com. - -**Who did you mentor in 2019, or who are you mentoring in 2020? Tell us about it in the comments.** - -I can see the brightness of curiosity in my six year old niece Shuchi's eyes when she explores a... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/linux-love-language - -作者:[Christopher Cherry][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/chcherry -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/red-love-heart-alone-stone-path.jpg?itok=O3q1nEVz (Red heart with text "you are not alone") -[2]: https://opensource.com/resources/what-ansible -[3]: https://opensource.com/resources/vagrant diff --git a/sources/talk/20200306 How I learned about burnout the hard way.md b/sources/talk/20200306 How I learned about burnout the hard way.md index ce9af6fb52..cce3324e7e 100644 --- a/sources/talk/20200306 How I learned about burnout the hard way.md +++ b/sources/talk/20200306 How I learned about burnout the hard way.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (chuan-325) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/talk/20200311 Data-center power consumption holds steady.md b/sources/talk/20200311 Data-center power consumption holds steady.md new file mode 100644 index 0000000000..cfa6ba9fba --- /dev/null +++ b/sources/talk/20200311 Data-center power consumption holds steady.md @@ -0,0 +1,60 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Data-center power consumption holds steady) +[#]: via: (https://www.networkworld.com/article/3531316/data-center-power-consumption-holds-steady.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Data-center power consumption holds steady +====== +While computing capacity has exploded in recent years, power consumption is growing more slowly thanks to greater energy efficiency. +Google + +A predicted explosion in power consumption by data centers has not manifested thanks to advances in power efficiency and, ironically enough, the move to the cloud, according to a new report. + +The [study][1], published in the journal _Science_ last week, notes that while there has been an increase in global data-center energy consumption over the past decade, this growth is negligible compared with the rise of workloads and deployed hardware during that time. + +Data centers accounted for about 205 terawatt-hours of electricity usage in 2018, which is roughly 1% of all electricity consumption worldwide, according to the report. (That's well below the often-cited stat that data centers consume 2% of the world's electricity). The 205 terawatt-hours represent a 6% increase in total power consumption since 2010, but global data center compute instances rose by 550% over that same time period. + +**[ Now read: [What is quantum computing (and why enterprises should care)][2] ]** + +To drive that point home: Considerably more compute is being deployed, yet the amount of power consumed is holding steady. + +The paper cites a number of reasons for this. For starters, hardware power efficiency is vastly improved. The move to server virtualization has meant a six-fold increase in compute instances with only a 25% increase in server energy use. And a shift to faster and more energy-efficient port technologies has brought about a 10-fold increase in data center IP traffic with only a modest increase in the energy use of network devices. + +Even more interesting, the report claims the rise of and migration to hyperscalers has helped curtail power consumption.  + +Hyperscale data centers and cloud data centers are generally more energy efficient than company-owned data centers because there is greater incentive for energy efficiency. The less power Amazon, Microsoft, Google, etc., have to buy, the more their bottom line grows. And hyperscalers are big on cheap, renewable energy, such as hydro and wind. + +[][3] + +So if a company trades its own old, inefficient data center for AWS or Google Cloud, they're reducing the overall power draw of data centers as a whole. + +"Total power consumption held steady as computing output has risen because of improvement efficiency of both IT and infrastructure equipment, and a shift from corporate data centers to more efficient cloud data centers (especially hyper scale)," said Jonathan Koomey, a Stanford professor and one of the authors of the research, in an email to me. He has spent years researching data center power and is an authority on the subject. + +"As always, the IT equipment progresses most quickly. In this article, we show that the peak output efficiency of computing doubled every 2.6 years after 2000. This doesn’t include the reduced idle power factored into the changes for servers we document," he added. + +Koomey notes that there is additional room for efficiency improvements to cover the next doubling of computing output over the next few years but was reluctant to make projections out too far. "We avoid projecting the future of IT because it changes so fast, and we are skeptical of those who think they can project IT electricity use 10-15 years hence," he said. + +Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3531316/data-center-power-consumption-holds-steady.html + +作者:[Andy Patrizio][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/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://science.sciencemag.org/content/367/6481/984 +[2]: https://www.networkworld.com/article/3275367/what-s-quantum-computing-and-why-enterprises-need-to-care.html +[3]: 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) +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20200311 Setting yourself up for success while working remotely.md b/sources/talk/20200311 Setting yourself up for success while working remotely.md new file mode 100644 index 0000000000..bbe6b3f513 --- /dev/null +++ b/sources/talk/20200311 Setting yourself up for success while working remotely.md @@ -0,0 +1,61 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Setting yourself up for success while working remotely) +[#]: via: (https://opensource.com/article/20/3/remote-work) +[#]: author: (Dawn Parzych https://opensource.com/users/dawnparzych) + +Setting yourself up for success while working remotely +====== +Whether you are new to working remotely or are a seasoned veteran, here +are tips to improve the experience. +![Woman sitting in front of her computer][1] + +Remote work is not easy. While there are perks to being remote, it is a mind-shift and takes some getting used to. Talk to anybody that works remotely, and they will likely tell you some of the biggest challenges of remote work are _**feeling disconnected**_ and _**a loss of regime**_. Here are my tips gathered from 10 years as a remote worker on how to set yourself and your team up to work remotely successfully. + +### Environment and regime + + 1. **"Commute" to and from work**. I'm not saying go to the extremes in this [_Audible commercial_][2], but I suggest leaving your home to go for a walk or a bike ride before you begin working. Do the same at the end of the day. I take my dog, Barley (pictured here), for a walk at the start and end of most days.![Here's my dog, Barley, who gets regular walks during my morning "commute"][3] + 2. **Get dressed.** Don't be tempted to work in your PJs, because this blurs the line between work and home. People sometimes say that being able to work in your pajamas is a perk of remote work, but studies show this isn't great advice. You don't need to put on a suit and tie, but do change out of your pajamas; otherwise, before you know it, you will have gone three days without changing your clothes. For more reasons why check out this article from [_Fast Company_][4]. + 3. **Eat lunch away from your desk**. This is good advice even if you aren't working remotely. + 4. **Stick to a schedule**. It's easy to start working as soon as you wake up and continue late into the evening. Set a start time and an end time for your day and stick to it. When I stop work for the day, I try to close my office door. Configure your working hours in every app you use so others know when you are available. Don't use your work computer outside of working hours if you can. + 5. **Set up a dedicated work environment**, if possible. Try not to work from the kitchen table. This blurs the lines between home and work. My office (picture below) also has space for comfortable seating and desk seating to switch between the two. + 6. **Check-in with your team** or friends in the morning. Don't mistake this for a daily stand-up; this is more like saying _hi_ when you're getting coffee. + 7. **Sign-off at the end of the day**. This means both letting your team members know you are leaving and actually walking away from where you are working. Close the laptop. Turn off Slack notifications, etc. + 8. **Keep people posted** if you are leaving early or unavailable. It helps build trust. + 9. **Invest in a headset** if you will be doing a lot of calls. If there is more than one person in your household that is working remotely, they will thank you for this. It is no fun listening to somebody else's conference call. + 10. **Turn on your video** when on a video call to help you feel connected and stay engaged. When your video is disabled, it is easy to wander off and get distracted by Slack (or its [open source alternatives][5]), Twitter, or any other number of distractions. + 11. **Set up a weekly, casual remote chat**. At my company, we meet on Friday mornings via Zoom (or the open source alternative, [Jitsi][6]). This chat is open to remote and non-remote staff. It is an open call to talk about whatever is on our minds. Topics have ranged from music preferences to parenting challenges to what people are doing over the weekend. + 12. **Set-up chat-roulette **if one-on-one interaction is more your thing. There are applications on most chat platforms that randomly pairs two employees to chat and get to know one another. + 13. **Ask for help**. Chat with your colleagues if you're stuck, need encouragement, or need to vent. You are not alone. You are a member of a team. You can still grab a coffee or go for a walk with a teammate remotely. + + + +![Here’s my home office set up][7] + +Everybody is different. These tips work for me, I’d love to hear you share your advice below! + +Not all work-from-home gigs are created equal. There is a vast ocean between being a member of a... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/remote-work + +作者:[Dawn Parzych][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/dawnparzych +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_women_computing_2.png?itok=JPlR5aCA (Woman sitting in front of her computer) +[2]: https://www.youtube.com/watch?v=oVCJhZhrJ04 +[3]: https://opensource.com/sites/default/files/resize/pictures/barleywalking_0-300x379.png (Here's my dog, Barley, who gets regular walks during my morning "commute") +[4]: https://www.fastcompany.com/3064295/what-happened-when-i-dressed-up-to-work-from-home-for-a-week +[5]: https://opensource.com/alternatives/slack +[6]: https://meet.jit.si/ +[7]: https://opensource.com/sites/default/files/pictures/6151f75e-bbeb-4e64-a5ca-0bbe4e981054.jpeg (Here’s my home office set up) diff --git a/sources/talk/20200312 Next wave of digital transformation requires better security, automation.md b/sources/talk/20200312 Next wave of digital transformation requires better security, automation.md new file mode 100644 index 0000000000..d99b38c7b8 --- /dev/null +++ b/sources/talk/20200312 Next wave of digital transformation requires better security, automation.md @@ -0,0 +1,92 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Next wave of digital transformation requires better security, automation) +[#]: via: (https://www.networkworld.com/article/3531448/next-wave-of-digital-transformation-requires-better-security-automation.html) +[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) + +Next wave of digital transformation requires better security, automation +====== +F5 report highlights the challenges of digital initiatives, including a struggle to secure multi-cloud environments and a lack of IT skills required to extend automation efforts. +Loops7 / Getty Images + +Digital transformation is a top-of-mind priority for CIOs who want innovative ways to deploy applications and run IT operations. In today's digital economy, companies that don't depend on applications to support their business are rare. On the contrary, most companies have some kind of digital transformation initiative in place, which is driving the adoption of cloud-native architectures and application services. + +A new report from application delivery vendor F5 Networks finds businesses are entering the second phase of digital transformation by automating more parts of their networks. Based on a survey of nearly 2,600 senior leaders globally—from various industries, company sizes, and roles—the [_2020 State of Application Services Report_][1] uncovered five key trends shaping the application landscape. + +**READ MORE:** [Top 10 underused SD-WAN features][2] + +### 1\. Every company is undergoing a digital transformation + +Having conducted its annual survey for six years in a row, F5 consistently found IT optimization and business process optimization to be the top reported benefits for companies with digital transformation initiatives. At this point, most companies have mastered automation of individual tasks by digitizing IT and business processes—which the report classifies as phase one of digital transformation. + +Moving on to phase two, companies are shifting their focus to reducing complexity and supporting apps with a consistent set of services. External-facing apps make up a portion (45%) of an average company's portfolio and help generate revenue. Yet, the internal-facing ones—like productivity and operational apps—are vital to digitizing business processes. + +Modern, microservices/cloud-native apps now make up approximately 15% of a company's portfolio, compared to 11% for mainframe-hosted apps. This mix of new and older generation apps indicates that businesses are dealing with a diverse app portfolio. As more businesses adopt an application-centric mindset, they can start managing their app portfolio like a business asset. + +### 2\. Organizations struggle to secure multi-cloud environments + +Every company has different needs, which is why most choose the best cloud for their applications on a case-by-case basis, the report finds. Businesses are adopting cloud platforms at a high rate, with 27% planning to have more than half of their applications in the cloud by the end of 2020. + +For 87% of companies, multi-cloud is the preferred choice due to its flexibility. Multi-cloud typically includes a mix of infrastructure-as-a-service (IaaS) environments, so a company can choose to deploy multiple software-as-a-service (SaaS) or platform-as-a-service (PaaS) cloud services. + +[][3] + +However, multi-cloud environments pose challenges for businesses when it comes to maintaining security, policy, and compliance, according to the report's respondents. Companies are dealing with applications that reach hundreds to millions of end users—each one with its own security risk. Meanwhile, many don't have the expertise to protect the apps. + +A whopping 71% of companies surveyed by F5 reported a skills gap in security. Only 45% of companies are confident that they're able to secure apps in the public cloud, while 62% think they can protect apps in an on-premises data center. The most confident companies have consistency across multiple architectures and multiple infrastructures, ensuring security and performance of all apps in their portfolio. + +### 3\. Automation key to boosting efficiency + +Manual processes may have been the norm for legacy networks, but modern networks require automation. That's why most companies (73%) have embraced it. + +In this year's report, F5 observed more consistent use of automation in the deployment pipeline than in previous years. Automation of application infrastructure, network, application services, and security is nearly equal across the board at approximately 40% for survey respondents. (See also: [Enterprises being won over by speed, effectiveness of network automation][4]) + +Interestingly, more companies are choosing open source and continuous integration/continuous delivery (CI/CD) tools for automation over proprietary vendor solutions. The report found there is a need for open ecosystems with the increasing use of CI/CD tools, as businesses search for ways to address problems that slow down automation. Companies said their biggest struggles are with skill gaps in enterprise IT, integrating toolsets across vendors and devices, and the cost of new tools. + +### 4\. Security app services are most widely deployed + +Modern networks require application services—a pool of services necessary to deploy, run, and secure apps across on-premises or multi-cloud environments. Today, 69% of companies are using 10 or more application services, such as ingress control and service discovery. Ingress control is a relatively new application service that has become essential to companies with high API call volumes. It's one of many examples of the growing adoption of microservices-based apps. + +Security services remain as the most widely deployed, with these in particular dominating the top five: SSL VPN and firewall services (81%); IPS/IDS, antivirus, and spam mitigation (77%); load balancing and DNS (68%); web application firewalls (WAF) and DDoS protection (each at 67%). + +Over the next 12 months, the evolution of cloud and modern app architectures will continue to shape application services. At the top of the list (41%) is software-defined wide-area networking ([SD-WAN][5]). SD-WAN enables software-based provisioning from the cloud to meet modern application demands. Early SD-WAN deployments focused on replacing costly multi-protocol label switching (MPLS), but there is now greater emphasis on security as a core requirement for SD-WAN. + +### 5\. DevOps picks up responsibility for app services + +Although IT operations is still primarily responsible for deploying app services, the report revealed a shift taking place from single-function to ops-oriented team structures—such SecOps and DevOps. + +The responsibility for securing, optimizing, and managing apps by DevOps teams is growing, fueled by cloud and container-native applications. Compared to just a few years ago, businesses have developed a preference for containers over virtual appliances for app services. Container preference grew from just 6% in 2017 to 18% in 2020, surpassing virtual machines (15%) and hardware (15%). + +Regardless of preference, the challenges of modern app architectures call for collaboration between teams. IT operations and DevOps don't have to be mutually exclusive and can work together to address those challenges. + +### What's Next? + +Senior leaders surveyed in the report see big data analytics coming into play in the next two to five years. + +Companies today only use a small portion of their data and aren't taking full advantage of it. In the third phase of the digital transformation, businesses can begin leveraging data captured by apps via artificial intelligence (AI)-powered analytics. The harnessed data can provide valuable insights to improve business processes. + +Join the Network World communities on [Facebook][6] and [LinkedIn][7] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3531448/next-wave-of-digital-transformation-requires-better-security-automation.html + +作者:[Zeus Kerravala][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/Zeus-Kerravala/ +[b]: https://github.com/lujun9972 +[1]: https://www.f5.com/state-of-application-services-report +[2]: https://www.networkworld.com/article/3518992/top-10-underused-sd-wan-features.html +[3]: 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) +[4]: https://www.networkworld.com/article/3530275/enterprises-being-won-over-by-speed-effectiveness-of-network-automation.html +[5]: https://www.networkworld.com/article/3031279/sd-wan-what-it-is-and-why-you-ll-use-it-one-day.html +[6]: https://www.facebook.com/NetworkWorld/ +[7]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20200313 What is the internet backbone and how it works.md b/sources/talk/20200313 What is the internet backbone and how it works.md new file mode 100644 index 0000000000..7a163fce7f --- /dev/null +++ b/sources/talk/20200313 What is the internet backbone and how it works.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What is the internet backbone and how it works) +[#]: via: (https://www.networkworld.com/article/3532318/what-is-the-internet-backbone-and-how-it-works.html) +[#]: author: (Tim Greene https://www.networkworld.com/author/Tim-Greene/) + +What is the internet backbone and how it works +====== +Tier 1 internet service providers (ISP) mesh their high-speed fiber-optic networks together to create the internet backbone, which moves traffic efficiently among geographic regions. +[Gerd Altmann][1] [(CC0)][2] + +The internet generates massive amounts of computer-to-computer traffic, and insuring all that traffic can be delivered anywhere in the world requires the aggregation of a vast array of high-speed networks collectively known as the internet backbone, but how does that work? + +### What is the internet backbone? + +Like any other network, the internet consists of access links that move traffic to high-bandwidth routers that move traffic from its source over the best available path toward its destination. This core is made up of individual high-speed fiber-optic networks that peer with each other to create the internet backbone. + +The individual core networks are privately owned by Tier 1 internet service providers (ISP), giant carriers whose networks are tied together. These providers include AT&T, CenturyLink, Cogent Communications, Deutsche Telekom, Global Telecom and Technology (GTT), NTT Communications, Sprint, Tata Communications, Telecom Italia Sparkle, Telia Carrier, and Verizon. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][3] + +By joining these long-haul networks together, Tier 1 ISPs create a single worldwide network that gives all of them access to the entire internet routing table so they can efficiently deliver traffic to its destination through a hierarchy of progressively more local ISPs. + +In addition to being physically connected, these backbone providers are held together by a shared network protocol, TCP/IP. They are actually two protocols, transport control protocol and internet protocol that set up connections between computers, insuring that the connections are reliable and formating messages into packets. + +### Internet exchange points (IXP) tie the backbone together + +Backbone ISPs connect their networks at peering points, neutrally owned locations with high-speed switches and routers that move traffic among the peers. These are often owned by third parties, sometimes non-profits, that facilitate unifying the backbone. + +Participating Tier 1 ISPs help fund the IXPs, but don’t charge each other for transporting traffic from the other Tier 1 ISPs in a relationship known as settlement-free peering. Such agreements eliminate potential financial disputes that might have the result of slowing down internet performance. + +[][4] + +### How fast is the backbone? + +The internet backbone is made up of the fastest routers, which can deliver 100Gbps trunk speeds. These routers are made by vendors including Cisco, Extreme, Huawei, Juniper, and Nokia, and use the border gateway protocol (BGP) to route traffic among themselves. + +### How traffic gets on the backbone + +Below the Tier 1 ISPs are smaller Tier 2 and Tier 3 ISPs. + +Tier 3 providers provide businesses and consumers with access to the internet. These providers have no access of their own to the internet backbone, so on their own would not be able to connect their customers to all of the billions of internet-attached computers. + +Buying access to Tier 1 providers is expensive. So often Tier 3 ISPs contract with Tier 2 (regional) ISPs that have their own networks that can deliver traffic to a limited geographic area but not to all internet-attached devices. + +In order to do that, Tier 2 ISPs contract with Tier 1 ISPs for access to the global backbone, and in that way make the entire internet accesssible to their customers. + +This arrangment makes it possible for traffic from a computer on one side of the world to connect to one on the other side. That traffic goes from a source computer to a Tier 3 ISP that routes it to a Tier 2 ISP that routes it to a Tier 1 backbone provider that routes it to the appropriate Tier 2 ISP that routes it to a Tier 3 access provider that delivers it to the destination computer. + +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/3532318/what-is-the-internet-backbone-and-how-it-works.html + +作者:[Tim Greene][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/Tim-Greene/ +[b]: https://github.com/lujun9972 +[1]: https://pixabay.com/en/social-media-digitization-faces-3271592/ +[2]: https://creativecommons.org/publicdomain/zero/1.0/ +[3]: https://www.networkworld.com/newsletters/signup.html +[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 diff --git a/sources/talk/20200316 As the networks evolve enterprises need to rethink network security.md b/sources/talk/20200316 As the networks evolve enterprises need to rethink network security.md new file mode 100644 index 0000000000..4767aaafe1 --- /dev/null +++ b/sources/talk/20200316 As the networks evolve enterprises need to rethink network security.md @@ -0,0 +1,81 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (As the networks evolve enterprises need to rethink network security) +[#]: via: (https://www.networkworld.com/article/3531929/as-the-network-evolves-enterprises-need-to-rethink-security.html) +[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) + +As the networks evolve enterprises need to rethink network security +====== +Q&A: John Maddison, executive vice president of products for network security vendor Fortinet, discusses how to deal with network security in the digital era. +D3Damon / Getty Images + +_Digital innovation is disrupting businesses. Data and applications are at the hub of new business models, and data needs to travel across the extended network at increasingly high speeds without interruption. To make this possible, organizations are radically redesigning their networks by adopting multi-cloud environments, building hyperscale data centers, retooling their campuses, and designing new connectivity systems for their next-gen branch offices. Networks are faster than ever before, more agile and software-driven. They're also increasingly difficult to secure. To understand the challenges and how security needs to change, I recently talked with John Maddison, executive vice president of products for network security vendor Fortinet._ + +**ZK: As the speed and scale of data escalate, how do the challenges to secure it change?** + +JM: Security platforms were designed to provide things like enhanced visibility, control, and performance by monitoring and managing the perimeter. But the traditional perimeter has shifted from being a very closely monitored, single access point to a highly dynamic and flexible environment that has not only expanded outward but inward, into the core of the network as well. + +**[ Also see [What to consider when deploying a next generation firewall][1]. | Get regularly scheduled insights by [signing up for Network World newsletters][2]. ]** + +**READ MORE:** [The VPN is dying, long live zero trust][3] + +Today's perimeter not only includes multiple access points, the campus, the WAN, and the cloud, but also IoT, mobile, and virtual devices that are generating data, communicating with data centers and manufacturing floors, and literally creating thousands of new edges inside an organization. And with this expanded perimeter, there are a lot more places for attacks to get in. To address this new attack surface, security has to move from being a standalone perimeter solution to being fully integrated into the network. + +This convergence of security and networking needs to cover SD-WAN, VPN, Wi-Fi controllers, switching infrastructures, and data center environments – something we call security-driven networking. As we see it, security-driven networking is an essential approach for ensuring that security and networking are integrated together into a single system so that whenever the networking infrastructure evolves or expands, security automatically adapts as an integrated part of that environment. And it needs to do this by providing organizations with a new suite of security solutions, including network segmentation, dynamic multi-cloud controls, and [zero-trust network access][3]. And because of the speed of digital operations and the sophistication of today's attacks, this new network-centric security strategy also needs to be augmented with AI-driven security operations. + +The perimeter security devices that have been on the market weren't really built to run as part of the internal network, and when you put them there, they become bottlenecks. Customers don't put these traditional security devices in the middle of their networks because they just can't run fast enough. But the result is an open network environment that can become a playground for criminals that manage to breach perimeter defenses. It's why the dwell time for network malware is over six months. + +**[ [Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][4] ]** + +As you combine networking applications, networking functionality, and security applications together to address this challenge, you absolutely need a different performance architecture. This can't be achieved using the traditional hardware most security platforms rely on. + +**ZK: Why can't traditional security devices secure the internal network?** + +JM: They simply aren't fast enough. And the ones that come close are prohibitively expensive… For example, internal segmentation not only enables organizations to see and separate all of the devices on their network but also dynamically create horizontal segments that support and secure applications and automated workflows that need to travel across the extended network. Inside the network, you're running at 100 gigs, 400 gigs, that sort of thing. But the interface for a lot of security systems today is just 10 gigs. Even with multiple ports, the device can't handle much more than that without having to spend a fortune… In order to handle today's capacity and performance demands, security needs to be done at network speeds that most security solutions cannot support without specialized content processors. + +**ZK: Hyperscale data centers have been growing steadily. What sort of additional security challenges do these environments face?** + +JM: Hyperscale architectures are being used to move and process massive amounts of data. A lot of the times, research centers will need to send a payload of over 10 gigabytes – one packet that's 10 gigabytes – to support advanced rendering and modeling projects. Most firewalls today cannot process these large payloads, also known as elephant flows. Instead, they often compromise on their security to let them flow through. Other hyperscale environment examples include financial organizations that need to process transactions with sub-second latency or online gaming providers that need to support massive numbers of connections per second while maintaining high user experience. … [Traditional security platforms] will never be able to secure hyperscale environments, or even worse, the next generation of ultra-fast converged networks that rely on hyperscale and hyperconnectivity to run things like smart cities or smart infrastructures, until they fundamentally change their hardware. + +**ZK: Do these approaches introduce new risks or increase the existing risk for these organizations?** + +JM: They do both. As the attack surface expands, existing risks often get multiplied across the network. We actually see more exploits in the wild targeting older vulnerabilities than new ones. But cybercriminals are also building new tools designed to exploit cloud environments and modern data centers. They are targeting mobile devices and exploiting IoT vulnerabilities. Some of these attacks are simply revisions of older, tried and true exploits. But many are new and highly sophisticated. We are also seeing new attacks that use machine learning and rely on AI enhancements to better bypass security and evade detection. + +To address this challenge, security platforms need to be broad, integrated, and automated. + +Broad security platforms come in a variety of form factors so they can be deployed everywhere across the expanding network. Physical hardware enhancements, such as our [security processing units], enable security platforms to be effectively deployed inside high-performance networks, including hyperscale data centers and SD-WAN environments. And virtualized versions need to support private cloud environments as well as all major cloud providers through thorough cloud-native integration. + +Next, these security platforms need to be integrated. The security components built into a security platform need to work together as a single solution ­– not the sort of loose affiliation most platforms provide – to enable extremely fast threat intelligence collection, correlation, and response. That security platform also needs to support common standards and APIs so third-party tools can be added and supported. And finally, these platforms need to be able to work together, regardless of their location or form factor, to create a single, unified security fabric. It's important to note that many cloud providers have developed their own custom hardware, such as Google's TPU, Amazon's Inferentia, and Microsoft's Corsica, to accelerate cloud functions. As a result, hardware acceleration on physical security platforms is essential to ensure consistent performance for data moving between physical and cloud environments + +And finally, security platforms need to be automated. Support for automated workflows and AI-enhanced security operations can significantly accelerate the speed of threat detection, analysis, and response. But like other processing-intensive functions, such as decrypting traffic for deep inspection, these functions also need specialized and purpose-built processors or they will become innovation-killing bottlenecks. + +**ZK: What's next for network security?** + +JM: This is just the start. As networking functions begin to converge even further, creating the next generation of smart environments – smart buildings, smart cities, and smart critical infrastructures – the lack of viable security tools capable of inspecting and protecting these hyperfast, hyperconnected, and hyper-scalable environments will seriously impact our digital economy and way of life. + +Security vendors need to understand this challenge and begin investing now in developing advanced hardware and security-driven networking technologies. Organizations aren't waiting for vendors to catch up so they can secure their networks of tomorrow. Their networks are being left exposed right now because the software-based security solutions they have in place are just not adequate. And it's up to the security industry to step up and solve this challenge. + +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/3531929/as-the-network-evolves-enterprises-need-to-rethink-security.html + +作者:[Zeus Kerravala][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/Zeus-Kerravala/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3236448/lan-wan/what-to-consider-when-deploying-a-next-generation-firewall.html +[2]: https://www.networkworld.com/newsletters/signup.html +[3]: https://www.networkworld.com/article/3487720/the-vpn-is-dying-long-live-zero-trust.html +[4]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20200316 How to be the right person for DevOps.md b/sources/talk/20200316 How to be the right person for DevOps.md new file mode 100644 index 0000000000..02cdf8bedb --- /dev/null +++ b/sources/talk/20200316 How to be the right person for DevOps.md @@ -0,0 +1,108 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to be the right person for DevOps) +[#]: via: (https://opensource.com/article/20/3/devops-relationships) +[#]: author: (Josh Atwell https://opensource.com/users/joshatwell) + +How to be the right person for DevOps +====== +Creating healthy relationships is the essential ingredient in DevOps +success. +![Team meeting][1] + +In my kitchen, we have a sign that reads "Marriage is more than finding the right person. It is being the right person." It serves as a great reminder of the individual responsibility everyone has in any healthy relationship. As organizations adopt [DevOps][2] as a model of developing and delivering value to customers, the impact of healthy relationships is extremely important for success. + +![Marriage sign][3] + +Historically, the relationship between development and operations teams has been unhealthy. Poor communication, limited empathy, and a history of mistrust make merging these teams into a tighter operating model challenging, to say the least. This is not entirely unfair to either side. + +Developers have long been frustrated by lead times and processes put in place by the operations organization. They just want to work, and they often see operations as an anchor on the ship of progress. + +Operations professionals have long been frustrated by the impatience and lack of clear requirements that come from development teams. They are often confused about why those teams are not able to use the available services and processes. They see developers as a liability to their ability to maintain stable services for customers and the business. + +A lingering gap here is that each side has been focused on protecting its own perspective. They emphasize how the other team is not being what _they_ need, and they never question whether they, too, could be doing something different. + +In DevOps, all sides must frame their role in the organization based on how they add value to others. + +There are a few things that everyone, including managers and leaders, can do right away to become a better contributor and partner in their DevOps relationships. + +### Communicate + +Most professionals in an organization adopting DevOps find themselves needing to work closely with new people, ones they have had limited exposure to in the past. It is important for everyone to take time to get to know their new teammates and learn more about their concerns, their interests, and also their preferred communication style. + +Successful communication in new relationships is often built on simply listening more and talking less. Our natural tendency is to talk about ourselves. Most people love sharing what they know best. However, it is extremely important to make more room to listen. + +Hearing someone is not the same as listening to them. I'm confident that we have all been in the situation where someone expresses a concern that we do not entirely internalize. Also, merely hearing does not encourage people to share–or to share as completely as they should. + +![Stick figures hearing][4] + +It is important to listen actively. Repeat what you hear, and seek validation that what you repeat is what they wanted you to understand. Once you understand their concern, it is important to make your initial response a selfless one. Even if you can't completely solve the problem, demonstrate sympathy and help the person move towards a solution. + +![Stick figures listening][5] + +### Selflessness + +Another key relationship challenge as organizations adopt DevOps is developing a perspective of selflessness. In DevOps, most people are responsible for delivering value to a wide variety of other people. Each person should begin by considering how their actions and work impact other people. + +This service mindset carries forward when you become more sensitive to when others are in need and then dedicate time in your schedule specifically for the purpose of helping them. This can be as simple as creating a small improvement in a process or helping to troubleshoot an issue. A positive side effect is that this effort will provide you more opportunities to work with others and develop deeper trust. + +It is also important not to hoard knowledge—either technical or institutional—especially when people ask questions or seek help. Maintain the mindset that there are no stupid questions. + +![Stick figure apologizing][6] + +Finally, selflessness includes being trustworthy. It is difficult to maintain a healthy relationship when there is no trust. Be honest and transparent. In IT, this is often seen as a liability, but in DevOps it is a requirement for success. + +### Self-care + +In order to be a strong contributor to a relationship, it is necessary to maintain a sense of self. Our individuality provides the diversity a relationship needs to grow. Make sure you maintain and share your interests with others. Be more than just the work you do. Apply your interests to your work. + +You are no good to others if you are not good to yourself. Healthy relationships are stronger with healthy people. Make sure you take time to enjoy your interests and recharge. Take your vacation and leave work behind! + +![Stick figure relaxing][7] + +I am also a strong advocate for mental health days. Sometimes our mental health is not sufficient to work effectively. You're not as effective when you are physically ill, and you're not as effective when your head is not 100%. Work with your manager and your team to support each other to maintain good mental health. + +Mental health is improved by learning. Invest in yourself and expand your knowledge. DevOps ideally needs "t-shaped" people who have depth on a topic and also broader system knowledge. Work to increase your depth, but balance that by learning new things about your environment. This knowledge can come from your teammates and create operational sympathy. + +![Stick figure with open arms][8] + +Finally, healthy relationships are not all work and no play. Take time to acknowledge the successes of others. If you know your team, you likely know how individuals prefer to receive praise. Respect those preferences, but always strive to praise vocally where possible. + +![Stick figures celebrating][9] + +Make sure to celebrate these successes as a team. All work and no play makes everyone dull. Celebrate milestones together as a team, and then articulate and target the next objectives. + +### Be the right person + +DevOps requires more from every individual, and its success is directly tied to the health of relationships. Each member of the organization should apply these techniques to grow and improve themselves. A focus on being the right person for the team will build stronger bonds and make the organization better equipped to reach its goals. + +* * * + +_This article is based on [a talk][10] Josh Atwell gave at All Things Open 2019._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/devops-relationships + +作者:[Josh Atwell][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/joshatwell +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/meeting-team-listen-communicate.png?itok=KEBP6vZ_ (Team meeting) +[2]: https://opensource.com/tags/devops +[3]: https://opensource.com/sites/default/files/uploads/marriage.png (Marriage sign) +[4]: https://opensource.com/sites/default/files/uploads/hearing.png (Stick figures hearing) +[5]: https://opensource.com/sites/default/files/uploads/listening.png (Stick figures listening) +[6]: https://opensource.com/sites/default/files/uploads/apologize.png (Stick figure apologizing) +[7]: https://opensource.com/sites/default/files/uploads/relax.png (Stick figure relaxing) +[8]: https://opensource.com/sites/default/files/uploads/open_0.png (Stick figure with open arms) +[9]: https://opensource.com/sites/default/files/uploads/celebrate.png (Stick figures celebrating) +[10]: https://opensource.com/article/20/1/devops-empathy diff --git a/sources/talk/20200316 OpenStreetMap- A Community-Driven Google Maps Alternative.md b/sources/talk/20200316 OpenStreetMap- A Community-Driven Google Maps Alternative.md new file mode 100644 index 0000000000..123b5f003f --- /dev/null +++ b/sources/talk/20200316 OpenStreetMap- A Community-Driven Google Maps Alternative.md @@ -0,0 +1,93 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (OpenStreetMap: A Community-Driven Google Maps Alternative) +[#]: via: (https://itsfoss.com/openstreetmap/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +OpenStreetMap: A Community-Driven Google Maps Alternative +====== + +_**Brief: OpenStreetMap is a community-driven map – which is a potential alternative to Google Maps. Learn more about this open source project.**_ + +[OpenStreetMap][1] (OSM) is a free editable map of the world. Anyone can contribute, edit, and make changes to the OpenStreetMap to improve it. + +![][2] + +You need to sign up for an account first – in order to be able to edit or add information to the OpenStreetMap. To view the map, you wouldn’t need an account. + +Even though it’s a free-to-use map under an [open data license][3], you cannot use the map API to build another service on top of it for commercial purpose. + +So, you can download the map data to use it and host it yourself while mentioning the credits to OSM. You can learn more about its [API usage policy][4] and [copyright][5] information on its official website to learn more. + +In this article, we shall take a brief look at how it works and what kind of projects use OpenStreetMaps as the source of their map data. + +### OpenStreetMap: Overview + +![][6] + +OpenStreetMap is a good alternative to Google Maps. You might not get the same level of information as Google Maps- but for basic navigation and traveling, OpenStreetMap is sufficient. + +Just like any other map, you will be able to switch between multiple layers in the map, get to know your location, and easily search for places. + +You may not find all the latest information for the businesses, shops, and restaurants nearby. But, for basic navigation, it’s more than enough. + +OpenStreetMap can be usually accessed through a web browser on both desktop and mobile by visiting the [OpenStreetMap site][7]. It does not have an official Android/iOS app yet. + +However, there are a variety of applications available that utilize OpenStreetMap at its core. So, if you want to utilize OpenStreetMap on a smartphone, you can take a look at some of the popular open-source Google Maps alternatives: + + * [OsmAnd][8] + * [MAPS.ME][9] + + + +**MAPS.ME** and **OsmAnd** are two open-source applications for Android and iOS that utilize OpenStreetMap data to provide a rich user experience with a bunch of useful information and features added to it. + +You can also opt for other proprietary options if you wish, like [Magic Earth][10]. + +In either case, you can take a look at the extensive list of applications on their official wiki page for [Android][11] and [iOS][12]. + +### Using OpenStreetMap On Linux + +![][13] + +The easiest way to use OpenStreetMap on Linux is to use it in a web browser. If you use GNOME desktop environment, you can install GNOME Maps which is built on top of OpenStreetMap. + +There are also several software (that are mostly obsolete) that utilize OpenStreetMap on Linux for specific purposes. You can check out the list of available packages in their [official wiki list][14]. + +### Wrapping Up + +OpenStreetMap may not be the best source for navigation for end users but its open source model allows it to be used freely. This means that many services can be built using OpenStreetMap. For example, [ÖPNVKarte][15] uses OpenStreetMap to display worldwide public transport facilities on a uniform map so that you don’t have to browse individual operator’s websites. + +What do you think about OpenStreetMap? Can you use it as a Google Maps alternative? Feel free to share your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/openstreetmap/ + +作者:[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.openstreetmap.org/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/openstreetmap.jpg?ssl=1 +[3]: https://opendatacommons.org/licenses/odbl/ +[4]: https://operations.osmfoundation.org/policies/api/ +[5]: https://www.openstreetmap.org/copyright +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/open-street-map-2.jpg?ssl=1 +[7]: https://www.openstreetmap.org +[8]: https://play.google.com/store/apps/details?id=net.osmand +[9]: https://play.google.com/store/apps/details?id=com.mapswithme.maps.pro +[10]: https://www.magicearth.com/ +[11]: https://wiki.openstreetmap.org/wiki/Android#OpenStreetMap_applications +[12]: https://wiki.openstreetmap.org/wiki/Apple_iOS +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/open-street-map-1.jpg?ssl=1 +[14]: https://wiki.openstreetmap.org/wiki/Linux +[15]: http://xn--pnvkarte-m4a.de/ diff --git a/sources/talk/20200317 -AI everywhere- IoT chips coming from Arm.md b/sources/talk/20200317 -AI everywhere- IoT chips coming from Arm.md new file mode 100644 index 0000000000..a5e61bce6d --- /dev/null +++ b/sources/talk/20200317 -AI everywhere- IoT chips coming from Arm.md @@ -0,0 +1,61 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: ('AI everywhere' IoT chips coming from Arm) +[#]: via: (https://www.networkworld.com/article/3532094/ai-everywhere-iot-chips-coming-from-arm.html) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +'AI everywhere' IoT chips coming from Arm +====== +Two new microprocessors from Arm promise to miniaturize artificial intelligence. +Healthcare + +Silicon microchip maker Arm is working on a new semiconductor design that it says will enable machine learning, at scale, on small sensor devices. Arm has completed testing of the technology and expects to bring it to market next year. + +Artificial intelligence, implemented locally on "billions and ultimately trillions" of devices is coming, the company says in a [press release][1]. Arm Holdings, owned by Japanese conglomerate Softbank, says its partners have shipped more than 160 billion Arm-based chips to date, and that 45 million of its microprocessor designs are being placed within electronics every day. + +The new machine-learning silicon will include micro neural processing units (microNPU) that can be used to identify speech patterns and perform other AI tasks. Importantly, the processing is accomplished on-device and in smaller form factors than have so far been available. The chips don't need the cloud or any network. + +[RELATED: Auto parts supplier has big plans for its nascent IoT effort][2] + +Arm, which historically has been behind mobile smartphone microchips, is aiming this design – the Cortex M55 processor, paired with the Ethos-U55, Arm's first microNPU – at Internet of Things instead. + +"Enabling AI everywhere requires device makers and developers to deliver machine learning locally on billions, and ultimately trillions of devices," said Dipti Vachani, senior vice president and general manager of Arm's automotive and IoT areas, in a statement. "With these additions to our AI platform, no device is left behind as on-device ML on the tiniest devices will be the new normal, unleashing the potential of AI securely across a vast range of life-changing applications." + +Arm wants to take advantage of the autonomous nature of chip-based number crunching, as opposed to doing it in the cloud. Privacy-conscious (and regulated) healthcare is an example of a vertical that might like the idea of localized processing.  + +Functioning AI without cloud dependence isn't entirely new. Intel's [Neural Compute Stick 2][3], a $69 self-contained computer vision and deep learning development kit, doesn't need it, for example. + +**[ [Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][4] ]** + +Arm is also going for power savings with its new AI technology. Not requiring a data network can mean longer battery life for the sensor— only the calculated results need to be sent, rather than every bit. Much of the time, raw sensor data is irrelevant and can be discarded. Arm's new endpoint ML technologies are going to help microcontroller developers "accelerate edge inference in devices limited by size and power," said Geoff Lees, senior vice president of edge processing at IoT semiconductor company [NXP][5], in the announcement.  + +Enabling machine learning in power-constrained settings and eliminating the need for network connectivity mean the sensor can be placed where there isn't a hardy power supply. Latency advantages and cost advantages also can come into play. + +"These devices can run neural network models on batteries for years, and deliver low-latency inference directly on the device," said Ian Nappier, product manager of TensorFlow Lite for Microcontrollers at Google, in a statement to Arm. [TensorFlow][6] is an open-source machine learning platform that's been used for detecting respiratory diseases, among other things. + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3532094/ai-everywhere-iot-chips-coming-from-arm.html + +作者:[Patrick Nelson][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/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://www.arm.com/company/news/2020/02/new-ai-technology-from-arm +[2]: https://www.networkworld.com/article/3098084/internet-of-things/auto-parts-supplier-has-big-plans-for-its-nascent-iot-effort.html#tk.nww-fsb +[3]: https://store.intelrealsense.com/buy-intel-neural-compute-stick-2.html +[4]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 +[5]: https://www.nxp.com/company/our-company/about-nxp:ABOUT-NXP +[6]: https://www.tensorflow.org/ +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20200319 Electronics should sweat to cool down, say researchers.md b/sources/talk/20200319 Electronics should sweat to cool down, say researchers.md new file mode 100644 index 0000000000..ae2bce3e22 --- /dev/null +++ b/sources/talk/20200319 Electronics should sweat to cool down, say researchers.md @@ -0,0 +1,61 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Electronics should sweat to cool down, say researchers) +[#]: via: (https://www.networkworld.com/article/3532827/electronics-should-sweat-to-cool-down-say-researchers.html) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Electronics should sweat to cool down, say researchers +====== +Scientists think that in much the same way the human body releases perspiration to cool down, special materials might release water to draw heat from electronics. +rclassenlayouts / Aleksei Derin / Getty Images + +Computing devices should sweat when they get too hot, say scientists at Shanghai Jiao Tong University in China, where they have developed a materials application they claim will cool down devices more efficiently and in smaller form-factors than existing fans. + +It’s “a coating for electronics that releases water vapor to dissipate heat from running devices,” the team explain in a news release. “Mammals sweat to regulate body temperature,” so should electronics, they believe. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][1] + +The group’s focus has been on studying porous materials that can absorb moisture from the environment and then release water vapor when warmed. MIL-101(Cr) checks the boxes, they say. The material is a metal organic framework, or MOF, which is a sorbent, a material that stores large amounts of water. The higher the water capacity one has, the greater the dissipation of heat when it's warmed. + +MOF projects have been attempted before. “Researchers have tried to use MOFs to extract water from the desert air,” says refrigeration-engineering scientist Ruzhu Wang, who is senior author of a paper on the university’s work that has just been [published in Joule][2]. + +Their proof-of-concept test involved applying a micrometers-thin coating of MIL-101(Cr) to metallic substrates that resulted in temperature drops of up to 8.6 degrees Celsius for 25 minutes, according to the abstract for their paper. + +That’s “a significant improvement compared to that of traditional PCMs,” they say. Phase change materials (PCM) include waxes and fatty acids that are used in electronics and melt to absorb heat. They are used in smartphones, but the solid-to-liquid transition doesn’t exchange all that much energy. + +“In contrast, the liquid-vapor transition of water can exchange 10 times the energy compared to that of PCM solid-liquid transition.” Plus the material used recovers almost immediately to start sweating again, just like a mammal. + +[][3] + +Shanghai Jiao Tong University isn’t the only school looking into sweat for future tech. Cornell University says it wants to get robots to sweat to bring their temperature below ambient. Researchers there say they have built a 3D-printed, sweating robot muscle. It [manages its own temperature][4], and they think it will one day let robots run for extended periods without overheating. + +Soft robots, which are the kind preferred by many developers for their flexibility, hold more heat than metal ones. As in electronic devices such as smartphones and IoT sensors, fans aren’t ideal because they take up too much space. That’s why new materials applications are being studied. + +The Cornell robot group uses light to cure resin into shapes that control the flow of heat. A base layer “smart sponge” made of poly-N-isopropylacrylamide retains water and squeezes it through fabricated, dilated pores when heated. The pores then close automatically when cooled. + +“Just when it seemed like robots couldn’t get any cooler,” the group says. + +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/3532827/electronics-should-sweat-to-cool-down-say-researchers.html + +作者:[Patrick Nelson][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/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/newsletters/signup.html +[2]: https://www.cell.com/joule/fulltext/S2542-4351(19)30590-2 +[3]: 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) +[4]: https://news.cornell.edu/stories/2020/01/researchers-create-3d-printed-sweating-robot-muscle +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20200320 Cisco warns of five SD-WAN security weaknesses.md b/sources/talk/20200320 Cisco warns of five SD-WAN security weaknesses.md new file mode 100644 index 0000000000..6055b6c53b --- /dev/null +++ b/sources/talk/20200320 Cisco warns of five SD-WAN security weaknesses.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco warns of five SD-WAN security weaknesses) +[#]: via: (https://www.networkworld.com/article/3533550/cisco-warns-of-five-sd-wan-security-weaknesses.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco warns of five SD-WAN security weaknesses +====== +Cisco warnings include three high-impact SD-WAN vulnerabilities +[Jaredd Craig][1] [(CC0)][2] + +Cisco has issued five  warnings about security weaknesses in its [SD-WAN][3] offerings, three of them on the high-end of the vulnerability scale. + +The worst problem is with the command-line interface (CLI) of its [SD-WAN][4] Solution software where a weakness could let a local attacker inject arbitrary commands that are executed with root privileges, Cisco [wrote.][5] + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][6] + +An attacker could exploit this vulnerability – which has a 7.8 out if 10 on  the Common Vulnerability Scoring System – by authenticating to the device and submitting crafted input to the CLI utility. The attacker must be authenticated to access the CLI utility. The vulnerability is due to insufficient input validation, Cisco wrote. + +Another high warning problem lets an authenticated, local attacker elevate privileges to root on the underlying operating system.  An attacker could exploit this vulnerability by sending a crafted request to an affected system. A successful exploit could allow the attacker to gain root-level privileges, Cisco [wrote][7].  The vulnerability is due to insufficient input validation. + +The third high-level vulnerability in the SD-WAN Solution software could let an attacker cause a buffer overflow on an affected device. An attacker could exploit this vulnerability by sending crafted traffic to an affected device. A successful exploit could allow the attacker to gain access to information that they are not authorized to access and make changes to the system that they are not authorized to make, Cisco [wrote][8]. + +The vulnerabilities affect a number of Cisco products if they are running a Cisco SD-WAN Solution software release earlier than Release 19.2.2: vBond Orchestrator Software, vEdge 100-5000 Series Routers, vManage Network Management System and vSmart Controller Software. + +Cisco said there were no workarounds for any of the vulnerabilities and it suggested users accept automatic software updates to allay exploit risks. There are [software fixes for the problems][9] as well.  + +**[ [Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][10] ]** + +All three of the high-level warnings were reported to Cisco by the Orange Group, Cisco said. + +The other two SD-WAN Solution software warnings – with medium threat levels -- include a one that allows a cross-site scripting (XSS) attack against the web-based management interface of the vManage software and SQL injection threat. + +The [XXS vulnerability][11] is due to insufficient validation of user-supplied input by the web-based management interface. An attacker could exploit this vulnerability by persuading a user of the interface to click a crafted link. A successful exploit could allow the attacker to execute arbitrary script code in the context of the interface or to access sensitive, browser-based information. + +The SQL vulnerability exists because the web UI improperly validates SQL values. An attacker could exploit this vulnerability by authenticating to the application and sending malicious SQL queries to an affected system. A successful exploit could let the attacker  modify values on, or return values from, the underlying database as well as the operating system, Cisco [wrote][12]. + +Cisco recognized Julien Legras and Thomas Etrillard of Synacktiv for reporting the problems. + +The company said release 19.2.2 of the [Cisco SD-WAN Solution][13] contains fixes for all five vulnerabilities. + +Join the Network World communities on [Facebook][14] and [LinkedIn][15] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3533550/cisco-warns-of-five-sd-wan-security-weaknesses.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://unsplash.com/photos/T15gG5nA9Xk +[2]: https://creativecommons.org/publicdomain/zero/1.0/ +[3]: https://www.networkworld.com/article/3031279/sd-wan-what-it-is-and-why-you-ll-use-it-one-day.html +[4]: https://www.networkworld.com/article/3527194/multicloud-security-integration-drive-massive-sd-wan-adoption.html +[5]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-sdwclici-cvrQpH9v +[6]: https://www.networkworld.com/newsletters/signup.html +[7]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-sdwpresc-ySJGvE9 +[8]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-sdwanbo-QKcABnS2 +[9]: https://software.cisco.com/download/home +[10]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[11]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20200318-vmanage-xss +[12]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20200318-vmanage-cypher-inject +[13]: https://www.cisco.com/c/en/us/solutions/enterprise-networks/sd-wan/index.html#~benefits +[14]: https://www.facebook.com/NetworkWorld/ +[15]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20200320 How technical debt is risking your security.md b/sources/talk/20200320 How technical debt is risking your security.md new file mode 100644 index 0000000000..899696c7d3 --- /dev/null +++ b/sources/talk/20200320 How technical debt is risking your security.md @@ -0,0 +1,85 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How technical debt is risking your security) +[#]: via: (https://opensource.com/article/20/3/remove-security-debt) +[#]: author: (Sam Bocetta https://opensource.com/users/sambocetta) + +How technical debt is risking your security +====== +A few security fixes now will help lighten the load of future developers +using your software. +![A lock on the side of a building][1] + +Everyone knows they shouldn't take shortcuts, especially in their work, and yet everyone does. Sometimes it doesn't matter, but when it comes to code development, though, it definitely does. + +As any experienced programmer knows, building your code the quick and dirty way soon leads to problems down the line. These issues might not be disastrous, but they incur a small penalty every time you want to develop your code further. + +This is the basic idea behind [technical debt][2], a term first coined by well-known programmer Ward Cunningham. Technical debt is a metaphor that explains the long-term burden developers and software teams incur when taking shortcuts, and has become a popular way to think about the extra effort that we have to do in future development because of the quick and dirty design choice. + +"Security Debt" is an extension of this idea, and in this article, we'll take a look at what the term means, why it is a problem, and what you can do about it. + +### What is security debt? + +To get an idea of how security debt works, we have to consider the software development lifecycle. Today, it's very rare for developers to start with a blank page, even for a new piece of software. At the very least, most programmers will start a new project with open source code copied from online repositories. + +They will then adapt and change this code to make their project. While they are doing this, there will be many points where they notice a security vulnerability. Something as simple as an error establishing a database connection can be an indication that systems are not playing well together, and that someone has taken a fast and dirty approach. + +Then they have two options: they can either take an in-depth look at the code they are working with, and fix the issue at a fundamental level, or they can quickly paste extra code over the top that gets around the problem in a quick, inefficient way. + +Given the demands of today's development environment, most developers choose the second route, and we can't blame them. The problem is that the next person who looks at the code is going to have to spend longer working out how it operates. + +Time, as we all know, is money. Because of this, each time software needs to be changed, there will be a small cost to make it secure due to previous developers taking shortcuts. This is security debt. + +### How security debt threatens your software + +There was a time when security debt was not a huge problem, at least not in the open source community. A decade ago, open source components had lifetimes measured in years and were freely available to everyone. + +This meant that security issues in legacy code got fixed. Today, the increased speed of the development lifecycle and the increasingly censored internet means that developers can no longer trust third party code to the degree they used to. + +This has led to a considerable increase in security debt for developers using open source components. Veracode's latest [State of Software Security (SOSS)][3] report found that security issues in open source software take about a month longer to be fixed than those in software that is sourced internally. Insourced software recorded the highest fix rates, but even software sourced from external contractors gets fixed faster, by about two weeks, than open source software. + +The ultimate outcome of this – and one that the term "security debt" captures very well – is that most companies currently face security vulnerabilities throughout their entire software stack, and these are accumulating faster than they are fixed. In other words, developers have maxed out their security debt credit card, and are drowning in the debt they've incurred. This is particularly concerning when you consider that total household debt [reached nearly $14 trillion][4] in the United States alone in 2019. + +### How to avoid security debt + +Avoiding a build-up of security debt requires that developers take a different approach to security than the one that is prevalent in the industry at the moment. Proven methods such as zero-knowledge cloud encryption, VPNs to promote online anonymity, and network intrusion prevention software are great, but they may also not be enough. + +In fact, there might have been some developers who were scratching their heads during our definition of security debt above: how many of us think about the next poor soul who will have to check our code for security flaws? + +Changing that way of thinking is key to preventing a build-up of security debt. Developers should take the time to thoroughly [check their software for security vulnerabilities][5], not just during development, but after the release as well. Fix any errors now, rather than waiting for security holes to build up. + +If that instruction sounds familiar, then well done. A continuity approach to software development is a critical component of [layering security through DevOps][6], and one of the pillars of the emerging discipline of DevSecOps. Along with [chaos engineering][7], these approaches seek to integrate security into development, testing, and assessment processes, and thereby prevent a build-up of security debt. + +Just like a credit card, the key to avoiding security debt getting out of control is to avoid the temptation to take shortcuts in the first place. That's easier said than done, of course, but one of the key lessons from recent data breaches is that legacy systems that many developers assume are secure are just as full of shortcuts as recently written code. + +### Measure twice, cut once + +Since [security by default hasn't arrived yet][8], we must all try and do things properly in the future. Taking the fast, dirty approach might mean that you get to leave the office early, but ultimately that decision will come back to bite you. + +If you finish early anyway, well done: you can use the time to read [our best articles on security][9] and check whether your code is as secure as you think it is. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/remove-security-debt + +作者:[Sam Bocetta][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/sambocetta +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_3reasons.png?itok=k6F3-BqA (A lock on the side of a building) +[2]: https://opensource.com/article/17/10/why-i-love-technical-debt +[3]: https://www.veracode.com/state-of-software-security-report +[4]: https://thetokenist.io/financial-statistics/ +[5]: https://opensource.com/article/17/6/3-security-musts-software-developers +[6]: https://opensource.com/article/19/9/layered-security-devops +[7]: https://www.infoq.com/articles/chaos-engineering-security-networking/ +[8]: https://opensource.com/article/20/1/confidential-computing +[9]: https://opensource.com/article/19/12/security-resources diff --git a/sources/talk/20200321 3 metrics to measure your open source community health.md b/sources/talk/20200321 3 metrics to measure your open source community health.md new file mode 100644 index 0000000000..57e3f7ae5f --- /dev/null +++ b/sources/talk/20200321 3 metrics to measure your open source community health.md @@ -0,0 +1,110 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 metrics to measure your open source community health) +[#]: via: (https://opensource.com/article/20/3/community-metrics) +[#]: author: (Kevin Xu https://opensource.com/users/kevin-xu) + +3 metrics to measure your open source community health +====== +Community building is critical to the success of any open source +project. Here's how to evaluate your community's health and strengthen +it. +![Green graph of measurements][1] + +Community building is table stakes in the success of any open source project. Even outside of open source, community is considered a competitive advantage for businesses in many industries—from retail, to gaming, to fitness. (For a deeper dive, see "[When community becomes your competitive advantage][2]" in the _Harvard Business Review_.) + +However, open source community building—especially offline activities—is notoriously hard to measure, track, and analyze. While we've all been to our fair share of meetups, conferences, and "summits" (and probably hosted a few of them ourselves), were they worth it? Did the community meaningfully grow? Was printing all those stickers and swags worth the money? Did we collect and track the right numbers to measure progress? + +To develop a better framework for measuring community, we can look to a different industry for guidance and fresh ideas: political campaigns. + +### My metrics start with politics + +I started my career in political campaigns in the US as a field organizer (aka a low-level staffer) for then-candidate Senator Obama in 2008. Thinking back, a field organizer's job is basically community building in a specifically assigned geographical area that your campaign needs to win. My day consisted of calling supporters to do volunteer activities, hosting events to gather supporters, bringing in guest speakers (called "surrogates" in politics) to events, and selling the vision and plan of our candidate (essentially our "product"). + +Another big chunk of my day was doing data entry. We logged everything: interactions on phone conversations with voters, contact rates, event attendance, volunteer recruitment rates, volunteer show-up rates, and myriad other numbers to constantly measure our effectiveness. + +Regardless of your misgivings about politics in general or specific politicians, the winning campaigns that lead to political victories are all giant community-building exercises that are data-driven, meticulously measured, and constantly optimized. They are well-oiled community-building machines. + +When I entered the world of open source a few years ago, the community-building part felt familiar and natural. What surprised me was how little community building as an operation is quantified and measured—especially with offline activities. + +### Three metrics to track + +Taking a page from the best-run political campaigns I've seen, here are the three most important metrics for an open source community to track and optimize: + + * Number of **community ambassadors** + * Number of **return attendees** (people who attend your activities two times or more) + * Rate of **churned attendees** (the percentage of people who attend your activities only once or say they will come but don't show up) + + + +If you're curious, the corresponding terms on a political campaign for these three metrics are typically community captains, super volunteers, and flake rate. + +#### Community ambassadors + +A "community ambassador" is a user or enthusiast of your project who is willing to _consistently_ host local meetups or activities where she or he lives. Growing the number of community ambassadors and supporting them with resources and guidance are core to your community's strength and scale. You can probably hire for these if you have a lot of funding, but pure volunteers speak more to your project's allure. + +These ambassadors should be your best friends, where you understand inside and out why they are motivated to evangelize your project in front of both peers and strangers. Their feedback on your project is also valuable and should be a critical part of your development roadmap and process. You can strategically cultivate ambassadors in different tech hubs geographically around the world, so your project can count on someone with local knowledge to reach and serve users of different business cultures with different needs. The beauty of open source is that it's global by default; take advantage of it! + +Some cities are arguably more of a developer hub than others. Some to consider are Amsterdam, Austin, Bangalore, Beijing, Berlin, Hangzhou, Istanbul, London, NYC, Paris, Seattle, Seoul, Shenzhen, Singapore, São Paulo, San Francisco-Bay Area, Vancouver, Tel Aviv, Tokyo, and Toronto (listed alphabetically and based on feedback I got through social media. Please add a comment if I missed any!). An example of this is the [Cloud Native Ambassadors program][3] of the Cloud Native Computing Foundation. + +#### Return attendees + +The number of return attendees is crucial to measuring the usefulness or stickiness of your community activities. Tracking return attendees is how you can draw a meaningful line between "the curious" and "the serious." + +Trying to grow this number should be an obvious goal. However, that's not the only goal. This is the group whose motivation you want to understand the clearest. This is the group that reflects your project's user persona. This is the group that can probably give you the most valuable feedback. This is the group that will become your future community ambassadors. + +Putting it differently, this is your [1,000 true fans][4] (if you can keep them). + +Having hosted and attended my fair share of these community meetups, my observation is that most people attend to be educated on a technical topic, look for tools to solve problems at work, or network for their next job opportunity. What they are not looking for is being "marketed to." + +There is a growing trend of developer community events becoming marketing events, especially when companies are flush with funding or have a strong marketing department that wants to "control the message." I find this trend troubling because it undermines community building. + +Thus, be laser-focused on technical education. If a developer community gets taken over by marketing campaigns, your return-attendees metric won't be pretty. + +#### Churned attendees rate + +Tracking churned attendees is the flipside of the returned-attendees coin, so I won't belabor the point. These are the people that join once and then disappear or who show interest but don't show up. They are important because they tell you what isn't working and for whom, which is more actionable than just counting the people who show up. + +One note of caution: Be brutally honest when measuring this number, and don't fool yourself (or others). On its own, if someone signs up but doesn't show up, it doesn't mean much. Similarly, if someone shows up once and never comes back, it doesn't mean much. Routinely sit down and assess _why_ someone isn't showing up, so you can re-evaluate and refine your community program and activities. Don't build the wrong incentives into your community-building operation to reward the wrong metric. + +### Value of in-person connections + +I purposely focused this post on measuring offline community activities because online activities are inherently more trackable and intuitive to digital-native open source creators. + +Offline community activities are essential to any project's journey to reaching traction and prominence. I have yet to see a successful project that does not have a sizable offline presence, regardless of its online popularity. + +Why is this the case? Why can't an open source community, usually born online, just stay and grow online? + +Because technology choice is ultimately a human decision; therefore, face-to-face interaction is an irreplaceable element of new technology adoption. No one wants to be the guinea pig. No one wants to be the first. The most effective way to not feel like the first is to literally _see_ other human beings trying out or being interested in the same thing. + +Being in the same room as other developers, learning about the same project, and doing that regularly is the most effective way to build trust for a project. And with trust comes traction. + +### These three metrics work + +There are other things you _can_ track, but more data does not necessarily mean clearer insight. Focusing your energy on these three metrics will make the most impact on your community-building operation. An open source community where the _number of ambassadors and return attendees are trending up_ and the _churned attendees rate is trending down_ is one that's healthy and growing in the right way. + +* * * + +_This article originally appeared on_ _[COSS Media][5]_ _and is republished with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/community-metrics + +作者:[Kevin Xu][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/kevin-xu +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_lead-steps-measure.png?itok=DG7rFZPk (Green graph of measurements) +[2]: https://hbr.org/2020/01/when-community-becomes-your-competitive-advantage +[3]: https://www.cncf.io/people/ambassadors/ +[4]: https://kk.org/thetechnium/1000-true-fans/ +[5]: https://coss.media/how-to-measure-community-building/ diff --git a/sources/talk/20200321 Coronavirus challenges capacity, but core networks are holding up.md b/sources/talk/20200321 Coronavirus challenges capacity, but core networks are holding up.md new file mode 100644 index 0000000000..918ca93df3 --- /dev/null +++ b/sources/talk/20200321 Coronavirus challenges capacity, but core networks are holding up.md @@ -0,0 +1,107 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Coronavirus challenges capacity, but core networks are holding up) +[#]: via: (https://www.networkworld.com/article/3533438/coronavirus-challenges-capacity-but-core-networks-are-holding-up.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Coronavirus challenges capacity, but core networks are holding up +====== +COVID-19 has sent thousands of employees to work from home, placing untold stress on remote-access networks. +Cicilie Arcurs / Getty Images + +As the coronavirus continues to spread and more people work from home, the impact of the increased traffic on networks in the US so far seems to be minimal. + +No doubt that web, VPN and data usage is growing dramatically with the [influx of remote workers][1].  For example, Verizon said it has seen a 34% increase in VPN traffic from March 10 to 17.  It has also seen a 75% increase in gaming traffic, and web traffic increased by just under 20% in that time period, according to Verizon. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][2] + +Verizon said its fiber optic and wireless networks “have been able to meet the shifting demands of customers and continue to perform well. In small pockets where there has been a significant increase in usage, our engineers have quickly added capacity to meet customers’ demand.” + +“As we see more and more individuals work from home and students engage in online learning, it is a natural byproduct that we would see an increase in web traffic and access to VPN. And as more entertainment options are cancelled in communities across the US, an increase in video traffic and online gaming is not surprising,” said Kyle Malady, Chief Technology Officer for Verizon in a [statement][3]. “We expect these peak hour percentages to fluctuate, so our engineers are continuing to closely monitor network usage patterns 24x7 and stand ready to adjust resources as changing demands arise." + +As of March 16, AT&T said that its network continues to perform well. “In cities where the coronavirus has had the biggest impact, we are seeing fewer spikes in wireless usage around particular cell towers or particular times of day because more people are working from home rather than commuting to work and fewer people are gathering in large crowds at specific locations.” + +In Europe, Vodaphone say it has seen an 50% increase in data traffic in some markets. + +“COVID-19 is already having a significant impact on our services and placing a greater demand on our network,” the company said in a statement. “Our technology teams throughout Europe have been focusing on capacity across our networks to make sure they are resilient and can absorb any new usage patterns arising as more people start working from home.” + +[][4] + +In Europe there have also been indications of problems.  + +Ireland-based [Spearline][5], which monitors international phone numbers for connectivity and audio quality, said this week that Italy's landline connection rate continues to be volatile with as much as a 10% failure rate and audio quality is running approximately 4% below normal levels.  + +Other Spearline research says: + + * Spain saw a drop in connection rates to 98.5% on March 16, but it is improving again. + * France saw a dip in connection rates approaching 5% on March17. Good quality has been maintained overall, though periodic slippage has been observed. + * Germany saw a 1.7% connection-failure rate March 17.  Good quality has been maintained, though periodic slippage has been observed. + + + +Such problems are not showing up in the US at this point, Spearline said. + +“The US is Spearline's most tested market with test calls over three main sectors being enterprise, unified communications and carrier. To date, there has been no significant impact on either the connection rates or the audio quality on calls throughout the US,” said Matthew Lawlor, co-founder and chief technical officer at Spearline.  + +The future impact is the real unknown of course, Lawlor said. + +“There are many potential issues which have happened in other countries which may have a similar impact on US infrastructure. For example, in many countries there have been hardware issues where engineers are unable to get physical access to resolve the issue,” Lawlor said.   “While rerouting calls may help resolve issues it does put more pressure on other segments of your network.” + +On March 19, one week after the CDC declarated the virus as pandemic, data analytics and broadband vendor OpenVault wrote: + + * Subscribers’ average usage from 9 a.m. to 5 p.m. has risen to 6.3 GB, 41.4% higher than the January figure of 4.4 GB.  + * During the same period, peak-hour (6 p.m. to 11 p.m.) usage has risen 17.2% from 5.0 GB per subscriber in January to 5.87 GB in March.  + * Overall daily usage has grown from 12.19 GB to 15.46 GB, an increase of 26.8%. + + + +Based on the current rate of growth, OpenVault projected that consumption for March will reach nearly 400 GB per subscriber, an increase of almost 11% over the previous monthly record of 361 GB, established in January. In addition, OpenVault projects a new coronavirus-influenced run rate of 460 GB per subscriber per month going forward. OpenVault’s research is based on the usage of more than 1 million broadband subscribers through the United States, the company said. + +“Broadband clearly is keeping the hearts of business, education and entertainment beating during this crisis,” said Mark Trudeau, CEO and founder of OpenVault in a  [statement][6]. “Networks built for peak-hours consumption so far are easily handling the rise in nine-to-five business-hours usage. We’ve had concerns about peak hours consumption given the increase in streaming entertainment and the trend toward temporary cessation of bandwidth caps, but operator networks seem to be handling the additional traffic without impacting customer experiences.” + +Increased use of conferencing apps may affect their availability for reasons other than network capacity. For example,  according to Thousand Eyes, users around the globe were unable to connect to their Zoom meetings for approximately 20 minutes on Friday due to failed DNS resolution.  + +Others too are monitoring data traffic looking for warning signs of slowdowns.  “Traffic towards video conferencing, streaming services and news, e-commerce websites has surged. We've seen growth in traffic from residential broadband networks, and a slowing of traffic from businesses and universities," wrote Louis Poinsignon a network engineer with CloudFlare in a [blog][7] about Internet traffic patterns. He noted that on March 13 when the US announced a state of emergency, CloudFlare’s US data centers served 20% more traffic than usual. + +Poinsignon  noted that  [Internet Exchange Points][8], where Internet service providers and content providers can exchange data directly (rather than via a third party) have also seen spikes in traffic. For example, Amsterdam ([AMS-IX][9]), London ([LINX][10]) and Frankfurt ([DE-CIX][11]), a 10-20% increase was seen around March 9. + +“Even though from time to time individual services, such as a web site or an app, have outages, the core of the Internet is robust,” Poinsignon wrote.  “Traffic is shifting from corporate and university networks to residential broadband, but the Internet was designed for change.” + +In related news: + + * Netflix said it would reduce streaming quality in Europe for at least the next 30 days to prevent the internet collapsing under the strain of unprecedented usage due to the coronavirus pandemic. "We estimate that this will reduce Netflix traffic on European networks by around 25% while also ensuring a good quality service for our members," Netflix said. + * DISH announced that it is providing 20 MHz of AWS-4 (Band 66) and all of its 700 MHz spectrum to AT&T at no cost for 60 days. Last week, DISH began lending its complete 600 MHz portfolio of spectrum to T-Mobile. With these two agreements, DISH has activated most of its spectrum portfolio to enhance national wireless capacity as the nation confronts the COVID-19 crisis. + + + +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/3533438/coronavirus-challenges-capacity-but-core-networks-are-holding-up.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/3532440/coronavirus-challenges-remote-networking.html +[2]: https://www.networkworld.com/newsletters/signup.html +[3]: https://www.verizon.com/about/news/how-americans-are-spending-their-time-temporary-new-normal +[4]: 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) +[5]: https://www.spearline.com/ +[6]: http://openvault.com/covid-19-impact-driving-business-hours-broadband-consumption-up-41/ +[7]: https://blog.cloudflare.com/on-the-shoulders-of-giants-recent-changes-in-internet-traffic/ +[8]: https://en.wikipedia.org/wiki/Internet_exchange_point +[9]: https://www.ams-ix.net/ams/documentation/total-stats +[10]: https://portal.linx.net/stats/lans +[11]: https://www.de-cix.net/en/locations/germany/frankfurt/statistics +[12]: https://www.facebook.com/NetworkWorld/ +[13]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20200324 COVID-19- Weekly health check of ISPs, cloud providers and conferencing services.md b/sources/talk/20200324 COVID-19- Weekly health check of ISPs, cloud providers and conferencing services.md new file mode 100644 index 0000000000..a5540c4ce2 --- /dev/null +++ b/sources/talk/20200324 COVID-19- Weekly health check of ISPs, cloud providers and conferencing services.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (COVID-19: Weekly health check of ISPs, cloud providers and conferencing services) +[#]: via: (https://www.networkworld.com/article/3534130/covid-19-weekly-health-check-of-isps-cloud-providers-and-conferencing-services.html) +[#]: author: (Tim Greene https://www.networkworld.com/author/Tim-Greene/) + +COVID-19: Weekly health check of ISPs, cloud providers and conferencing services +====== +ThousandEyes, which tracks internet and cloud traffic, is providing Network World with weekly updates on the performance of three categories of service provider: ISP, cloud provider, UCaaS +[ThousandEyes][1] + +_As COVID-19 continues to spread, forcing employees to work from home, the services of ISPs, cloud providers and conferencing services a.k.a. unified communications as a service (UCaaS) providers are experiencing increased traffic._ + +_Thousand Eyes is monitoring how these increases affect outages and the performance these providers undergo. It will provide Network World a roundup of interesting events of  the week in the delivery of these services, and Network World will provide a summary here. Stop back next week for another update._ + +With the increased use of remote-access VPNs, major carriers are reporting dramatic increases in their network traffic – with Verizon reporting a 20% week-over-week increase, and Vodafone reporting an increase of 50%. + +[Read about IPv6 and cloud-access security brokers][2] + +While there has been no corresponding spike in outages in service provider networks, over the past six weeks there has been a steady increase in outages across multiple provider types both worldwide and in the U.S., all according to ThousandEyes, which keeps track of internet and cloud traffic. + +### IDG Special Report: + +Navigating the Pandemic + + * [Business continuity: Coronavirus crisis puts CIOs’ plans to the test][3] + * [Coronavirus challenges remote networking][4] + * [A security guide for pandemic planning: 7 key steps][5] + * [10 tips to set up your home office for videoconferencing][6] + * [How to survive and thrive while working from home][7] + * [WTH? OSS knows how to WFH IRL][8] + + + +This includes “a concerning upward trajectory” since the beginning of March of ISP outages worldwide that coincides with the spread of COVID-19, [according to a ThousandEyes blog][9] by Angelique Medina, the company’s director of product marketing. ISP outages worldwide hovered around 150 per week between Feb. 10 and March 19, but then increased to between just under 200 and about 225 during the following three weeks. + +In the U.S. those numbers were a little over 50 in the first time range and reaching about 100 during the first week of March. “That early March level has been mostly sustained over the last couple of weeks,” Medina writes. + +Cogent Communications was one ISP with nearly identical large scale outages on March 11 and March 18, with “disruptions for the fairly lengthy period (by Internet standards) of 30 minutes,” she wrote. + +[][10] + +Hurricane Electric suffered an outage March 20 that was less extensive and shorter than Cogent’s but included smaller disruptions that altogether affected hundreds of sites and services, she wrote. + +Public-cloud provider networks have withstood the effects of COVID-19 well, with slight increases in the number of outages in the U.S., but otherwise relatively level around the world. The possible reason: “Major public cloud providers, such as AWS, Microsoft Azure, and Google Cloud, have built massive global networks that are incredibly well-equipped to handle traffic surges,” Medina wrote. And when these networks do have major outages it’s due to routing or infrastructure state changes, not traffic congestion. + +Some providers of collaboration applications – the likes of Zoom, Webex, MSFT Teams, RingCentral – also experienced performance problems between March 9 and March 20. ThousandEyes doesn’t name them, but does list performance numbers for what it describes “the top three” UCaaS providers. One actually showed improvements in availability, latency, packet loss and jitter. The other two “showed minimal (in the grand scheme of things) degradations on all fronts — not surprising given the unprecedented strain they’ve been under,” according to the blog. + +Each provider showed spikes in traffic loss over the time period that ranged from less than 1% to more than 4% in one case. In the case of one provider, “outages within its own network spiked last week, meaning that the network issues impacting users were taking place on infrastructure managed by the provider versus an external ISP.” + +“Outage incidents within large UCaaS provider networks are fairly infrequent; however, the recent massive surge in usage is clearly stressing current design limits. Capacity is reportedly being added across the board to meet new service demands,” according to the blog. + +Meanwhile, ThousandEyes has introduced a new feature on its site a [Global Internet Outages Map][1] that is updated every few minutes. It shows recent and ongoing outages + +## Google outage unrelated to COVID-19 + +On March 26 Google suffered a 20 minute outage on the East Coast of the U.S., apparently from a router failure in Atlanta, ThousandEyes said, agreeing with a statement put out by Googe to that effect. + +That problem affected other regions of the U.S. as evidenced by Google sites such as google.com intermittently returning server errors."These 500 server errors are consistent with an inability to reach the backend systems necessary to correctly load various services," ThousandEyes said in a statement. "Any traffic traversing the affected region — connecting from Google’s front-end servers to backend services — may have been impacted and seen the resulting server errors." + +ThousandEyes posted interactive results of tests it ran about the outage [here][11] and [here][12]. + +. + +Join the Network World communities on [Facebook][13] and [LinkedIn][14] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3534130/covid-19-weekly-health-check-of-isps-cloud-providers-and-conferencing-services.html + +作者:[Tim Greene][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/Tim-Greene/ +[b]: https://github.com/lujun9972 +[1]: https://www.thousandeyes.com/outages +[2]: https://www.networkworld.com/article/3391380/does-your-cloud-access-security-broker-support-ipv6-it-should.html +[3]: https://www.cio.com/article/3532899/business-continuity-coronavirus-crisis-puts-cios-plans-to-the-test.html +[4]: https://www.networkworld.com/article/3532440/coronavirus-challenges-remote-networking.html +[5]: https://www.csoonline.com/article/3528878/a-security-guide-for-pandemic-planning-7-key-steps.html +[6]: https://www.computerworld.com/article/3250684/10-tips-to-set-up-your-home-office-for-videoconferencing.html +[7]: https://www.computerworld.com/article/3532283/how-to-survive-and-thrive-while-working-from-home.html +[8]: https://www.infoworld.com/article/3533050/wth-oss-knows-how-to-wfh-irl.html +[9]: https://blog.thousandeyes.com/internet-health-during-covid-19/ +[10]: 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) +[11]: https://agisi.share.thousandeyes.com/view/endpoint-agent/?roundId=1585237800&metric=loss&scenarioId=eyebrowNetwork&filters=%7B%22filters%22:%7B%22domain%22:%5B%22google.com%22%5D,%22geonameId%22:%5B4148757,4180439,4459467,4460243,4509177,4671240,4744709,4744870,4887398,4890864,4930956,5099836,5110266,5110302,5128581,5145476,5150529,5282804,5786882%5D%7D%7D&page=0,0&grouping=BY_NETWORK,BY_DOMAIN +[12]: https://ythkurgdz.share.thousandeyes.com/view/tests/?roundId=1585236900&metric=availability&scenarioId=httpServer&testId=1283781 +[13]: https://www.facebook.com/NetworkWorld/ +[14]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20200325 COVID-19 vs. Raspberry Pi- Researchers bring IoT technology to disease detection.md b/sources/talk/20200325 COVID-19 vs. Raspberry Pi- Researchers bring IoT technology to disease detection.md new file mode 100644 index 0000000000..cdcf720c0b --- /dev/null +++ b/sources/talk/20200325 COVID-19 vs. Raspberry Pi- Researchers bring IoT technology to disease detection.md @@ -0,0 +1,55 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (COVID-19 vs. Raspberry Pi: Researchers bring IoT technology to disease detection) +[#]: via: (https://www.networkworld.com/article/3534101/covid-19-vs-raspberry-pi-researchers-bring-iot-technology-to-disease-detection.html) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +COVID-19 vs. Raspberry Pi: Researchers bring IoT technology to disease detection +====== +Researchers from UMass say that a Raspberry Pi edge device can help identify flu-like symptoms in crowds, broadening the range of tools that can be used to track the spread of disease. +[Bill Oxford / Raspberry Pi / Modified by IDG Comm.][1] [(CC0)][2] + +An [IoT][3] device that tracks coughing and crowd size in real time could become a useful tool for identifying the presence of flu-like symptoms among large groups of people, according to a team of researchers at UMass Amherst. + +FluSense, as the researchers call it, is about the size of a dictionary. It contains a cheap microphone array, a thermal sensor, a Raspberry Pi and an Intel Movidius 2 neural computing engine. The idea is to use AI at the edge to classify audio samples and identify the number of people in a room at any given time. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][4] + +Since the system can distinguish coughing from other types of non-speech audio, correlating coughing with the size of a given crowd could give a useful index of how many people are likely to be experiencing flu-like symptoms. + +A test run between December 2018 and July 2019 saw FluSense installed in four waiting rooms at UMass’ University Health Services clinic, and the researchers said that they were able to “strongly” correlate the system’s results with clinical testing for influenza and other illnesses with similar symptoms. + +And bigger plans for FluSense are afoot, according to the paper’s lead author, Ph.D student Forsad Al Hossain and his co-author and adviser, assistant professor Tauhidur Rahman. + +“[C]urrently we are planning to deploy the FluSense system in several large public spaces (e.g., large cafeteria, classroom, dormitories, gymnasium, auditorium) to capture syndromic signals from a broad range of people who live in a certain town or city,” they said. “We are also looking for funding to run a large-scale multi-city trial. In the meantime, we are also diversifying our sensing capability by extending FluSense’s capability to capture more syndromic signals (e.g., recently we added sneeze sensing capability to FluSense). We definitely see a significant level of commercialization potential in this line of research.” + +FluSense is particularly interesting from a technical perspective because all of the meaningful processing work is done locally, via the Intel neural computing engine and Raspberry Pi. Symptom information is sent wirelessly to the lab for collation, of course, but the heavy lifting is accomplished at the edge. Al Hossain and Rahman were quick to emphasize that the device doesn’t collect personally identifiable information – the emphasis is on aggregating data in a given setting, rather than identifying sickness in any single patient – and everything it does collect is heavily encrypted, making it a minimal privacy concern. + +The key point of FluSense, according to the researchers, is to think of it as a health surveillance tool, rather than a piece of diagnostic equipment. Al Hossain and Rahman said that it has several important advantages over other health surveillance techniques, particularly those based on Internet tracking, like Google Flu Trend and Twitter. + +“FluSense is not easily influenced by public health campaigns or advertisements. Also, the contactless nature of this sensor is ideal to capture syndromic signals passively from different geographical locations and different socioeconomic groups (including underprivileged who may not have access to healthcare and may not go to a doctor/clinic,” they said. + +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/3534101/covid-19-vs-raspberry-pi-researchers-bring-iot-technology-to-disease-detection.html + +作者:[Jon Gold][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/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://unsplash.com/photos/tR0PPLuN6Pw +[2]: https://creativecommons.org/publicdomain/zero/1.0/ +[3]: https://www.networkworld.com/article/3207535/what-is-iot-the-internet-of-things-explained.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20200325 The coming together of SD-WAN and AIOps.md b/sources/talk/20200325 The coming together of SD-WAN and AIOps.md new file mode 100644 index 0000000000..690a27686d --- /dev/null +++ b/sources/talk/20200325 The coming together of SD-WAN and AIOps.md @@ -0,0 +1,104 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The coming together of SD-WAN and AIOps) +[#]: via: (https://www.networkworld.com/article/3533437/the-coming-together-of-aiops-and-sd-wan.html) +[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) + +The coming together of SD-WAN and AIOps +====== +SD-WAN delivers cost and resiliency benefits. Infusing AI into SD-WAN takes things further, enabling automated operations and business agility. +kohb / Getty Images + +Software-defined wide-area networking ([SD-WAN][1]) and AIOps are both red-hot technologies. SD-WANs increase application availability, reduce costs and in some cases improve performance. AIOps infuses machine learning into IT operations to increase the level of automation. This reduces errors and enables businesses to make changes at digital speeds. Most think of these as separate technologies, but the two are on a collision course and will give rise to what I'm calling the AI-WAN.  + +### SD-WAN not a panacea for all network woes + +SD-WAN is the biggest leap forward in networking since… well, the actual WAN. But many solutions still rely on manual configurations. SD-WANs certainly increase application resiliency, lower telecommunications costs, and often increase application performance, but they are more complicated than traditional WANs. Initial setup can be a challenge, but the bigger issue is ongoing operations. Manually tweaking and tuning the network to adapt to business changes can be time consuming and error-prone. A solution is needed to bring better automation to SD-WANs. + +**READ MORE:** [How AI can improve network capacity planning][2] + +Enter AI-WAN. Much like a self-driving car, an AI-WAN can make decisions based on different rules and adapt to changes faster than people can. Self-driving cars continually monitor road conditions, speed limits and other factors to determine what changes to make. Similarly, a self-driving network can monitor, correct, defend, and analyze with minimal to no human involvement. This is done through automation capabilities powered by AI, obviating the need for people to get involved. + +Make no mistake, manual operations will hold businesses back from reaching their full potential. An interesting data point from my research is that it takes enterprises an average of four months to make changes across a network. That's because maintaining legacy networks and fixing glitches takes too much time. One ZK Research study found 30% of engineers spend at least one day a week doing nothing but troubleshooting problems. SD-WANs can improve these metrics, but there's still a heavy people burden. + +With growing data challenges businesses face as they migrate to the cloud, they simply can't afford to wait that long. Instead of being afraid of AI taking over jobs, businesses should embrace it. AI can remove human error—which is the largest cause of unplanned network downtime—and help businesses focus on higher-level tasks instead. + +### AI-WAN will transform network operations + +So how will the evolution of SD-WAN into AI-WAN transform network management and operations? Administrators can use their time to focus on strategic initiatives instead of fixing problems. Another data point from ZK Research is that 90% of the time taken to fix a problem is spent identifying the source. Now that applications reside in the cloud and run on mobile devices, identifying the source of a problem has gotten harder. AI-WANs have the ability to spot even the smallest anomaly, even if it hasn't yet begun to impact business. + +SD-WANs are fundamentally designed so that all routing rules are managed centrally by administrators and can be transmitted across a network. AI-WAN takes it a step further and enables administrators to anticipate problems before they happen through fault prediction. It may even adjust network glitches on its own before users are affected, thus improving network performance. + +[][3] + +A self-driving car knows the rules of the road—where the blind spots are, how to synch with traffic signals, and which safety measures to take—using AI software, real-time data from IoT sensors, cameras, and much more. Similarly, a self-driving network knows the higher-level rules and can prevent administrators from making mistakes, such as allowing applications in countries where certain actions are banned.  + +Security is another concern. Everything from mobile devices to Internet of Things (IoT) to cloud computing is creating multiple new entry points and shifting resources to the network edge. This puts businesses at a security risk, as they struggle to respond to changes quickly. + +Businesses can miss security gaps created by users, with hundreds of software-as-a-service (SaaS) apps being used at the same time without IT's knowledge. Older networking technologies cannot support SaaS and cloud services, while SD-WANs can. But simply deploying an SD-WAN is not enough to protect a network. Security shouldn't be an afterthought in an SD-WAN deployment, but part of it from the get-go. + +Increasingly, vendors are bundling AI-based analytics with SD-WAN solutions to boost network security. Such solutions use AI to analyze how certain events impact the network, application performance, and security. Then, they create intelligent recommendations for any network changes, such as unauthorized use of SaaS apps. + +Going back to the autonomous car analogy, AI-WANs are designed to keep roads clear and accident-free. They enable smarter networks that can adapt quickly to changing conditions and self-heal if necessary. With the growing demands of cloud computing and SaaS apps, intelligent networks are the future and forward-thinking businesses are already in the driver’s seat. + +### AI-WAN exists today and will explode in the future + +AI-WAN may seem futuristic, but there are a number of vendors that are delivering it or in the process of bringing solutions to market. Managed service provider Masergy, for example, recently introduced [AIOps for SD-WAN][4] to deliver autonomous networking and has the most complete offering. + +Open System, another managed service provider, [snapped up cloud-based Sqooba][5] to add AIOps to its strong network and security services. Keeping with the M&A theme, VMware recently [acquired AIOps vendor Nyansa][6] and rolled it into its VeloCloud SD-WAN group. That move gives VMware similar capabilities to [Aruba Networks][7], which initially applied AI to WiFi troubleshooting but is now bringing it to its SD-Branch offering. [Cisco][8] is another networking vendor with an AIOps story, although it's trying to apply it network-wide, not just with the WAN.  + +Over time, I expect every SD-WAN or SASE vendor to bring AIOps into the fold, shifting the focus away from connectivity to automated operations. + +**Learn more about SD-WAN** + + * [Top 10 underused SD-WAN features][9] + * [SD-WAN: The inside scoop from real-world deployments][10] + * [5 reasons to choose a managed SD-WAN and 5 reasons to think twice][11] + * [10 essential SD-WAN considerations][12] + * [SD-WAN: What is it and why you’ll use it one day][13] + * [SD-WAN deployment options: DIY vs. cloud managed][14] + * [How SD-WAN can improve your security strategy][15] + * [10 hot SD-WAN startups to watch][16] + * [How SD-WAN saves $1.2M over 5 years for a radiology firm][17] + * [SD-WAN creates new security challenges][18] + + + +Join the Network World communities on [Facebook][19] and [LinkedIn][20] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3533437/the-coming-together-of-aiops-and-sd-wan.html + +作者:[Zeus Kerravala][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/Zeus-Kerravala/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3031279/sd-wan-what-it-is-and-why-you-ll-use-it-one-day.html +[2]: https://www.networkworld.com/article/3338100/using-ai-to-improve-network-capacity-planning-what-you-need-to-know.html +[3]: 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) +[4]: https://techcrunch.com/2020/03/19/nvidia-makes-its-gpu-powered-genome-sequencing-tool-available-free-to-those-studying-covid-19/?guccounter=1&guce_referrer=aHR0cHM6Ly93d3cuZ29vZ2xlLmNvbS8&guce_referrer_sig=AQAAAMI6we4H-fTz2mf5g-l6IP27C1O-V-u6EiQuJ5QzVnlrrPU04iS0fhyrZo5U8q5rAk5I9uVW5PQYKHX8ziMdWrFBxhBP7f__JshmAGevyu4Z5zm98nDnC6nEdIekjVX4RPPmF9Q_PImcQ0opZy6JukS-DZA62tHI9R7D1Q2JAog7 +[5]: https://open-systems.com/press-release/open-systems-acquires-sqooba +[6]: https://www.vmware.com/company/acquisitions/nyansa.html +[7]: https://blogs.arubanetworks.com/solutions/ai-doing-more-with-less-in-2020-and-beyond/ +[8]: https://www.cisco.com/c/en/us/products/cloud-systems-management/crosswork-network-automation/service-centric-approach-to-aiops.html#~overview +[9]: https://www.networkworld.com/article/3518992/top-10-underused-sd-wan-features.html +[10]: https://www.networkworld.com/article/3316568/sd-wan/sd-wan-the-inside-scoop-from-real-world-deployments.html +[11]: https://www.networkworld.com/article/3431080/5-reasons-to-choose-a-managed-sd-wan-and-5-reasons-to-think-twice.html +[12]: https://www.networkworld.com/article/3355138/sd-wan-10-essential-considerations.html +[13]: https://www.networkworld.com/article/3031279/sd-wan/sd-wan-what-it-is-and-why-you-ll-use-it-one-day.html +[14]: https://www.networkworld.com/article/3243701/wide-area-networking/sd-wan-deployment-options-diy-vs-cloud-managed.html +[15]: https://www.networkworld.com/article/3336483/how-sd-wan-can-improve-your-security-strategy.html +[16]: https://www.networkworld.com/article/3284367/sd-wan/10-hot-sd-wan-startups-to-watch.html +[17]: https://www.networkworld.com/article/3255291/lan-wan/sd-wan-helps-radiology-firm-cut-costs-scale-bandwidth.html +[18]: https://www.networkworld.com/article/3336155/sd-wan-creates-new-security-challenges.html +[19]: https://www.facebook.com/NetworkWorld/ +[20]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20200326 ROLLING UPDATE- The impact of COVID-19 on public networks and security.md b/sources/talk/20200326 ROLLING UPDATE- The impact of COVID-19 on public networks and security.md new file mode 100644 index 0000000000..7f8c0a2cd8 --- /dev/null +++ b/sources/talk/20200326 ROLLING UPDATE- The impact of COVID-19 on public networks and security.md @@ -0,0 +1,119 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (ROLLING UPDATE: The impact of COVID-19 on public networks and security) +[#]: via: (https://www.networkworld.com/article/3534037/rolling-update-the-impact-of-covid-19-on-public-networks-and-security.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +ROLLING UPDATE: The impact of COVID-19 on public networks and security +====== +Network World updates the latest coronavirus-related networking news +Ig0rZh / Getty Images + +_As the coronavirus spreads, public and private companies as well as government entities are requiring employees to work from home, putting unforeseen strain on all manner of networking technologies and causing bandwidth and security concerns.  What follows is a round-up of news and traffic updates that Network World will update as needed to help keep up with the ever-changing situation.  Check back frequently!_ + +**UPDATE 3.27** + +Broadband watchers at [BroadbandNow][1] say users in most of the cities it analyzed are experiencing normal network conditions, suggesting that ISP’s (and their networks) are holding up to the shifting demand. In a March 25 [post][2] the firm wrote: “Encouragingly, many of the areas hit hardest by the spread of the coronavirus are holding up to increased network demand. Cities like Los Angeles, Chicago, Brooklyn, and San Francisco have all experienced little or no disruption. New York City,  now the epicenter of the virus in the U.S., has seen a 24% dip out of its previous ten-week range. However, with a new median speed of nearly 52 Mbps, home connections still appear to be holding up overall.” + +**[ Also see [What to consider when deploying a next generation firewall][3]. | Get regularly scheduled insights by [signing up for Network World newsletters][4]. ]** + +Other BroadbandNow findings included: + + * Eighty eight (44%) of the 200 cities it analyzed experienced some degree of network degradation over the past week compared to the 10 weeks prior. However, only 27 (13.5%) cities experienced dips of 20% below range or greater. + * Seattle download speeds have continued to hold up over the past week, while New York City’s speeds have fallen out of range by 24%. Both cities are currently heavily affected by the coronavirus pandemic. + * Three cities – Austin, Texas, Winston Salem, N.C., and Oxnard, Calif. – have experienced significant degradations, falling out of their 10-week range by more than 40%. + + + +Cisco’s Talos threat-intelligence arm [wrote][5] on March 26 about the COVID security threat noting what it called three broad categories of attacks leveraging COVID with known advanced persistent threat participation in: [Malware and phishing campaigns][6] using COVID-themed lures; attacks against organizations that carry out research and other work related to COVID; and fraud and disinformation. From an enterprise security perspective, Talos recommended: + + * Remote access: Do not expose Remote Desktop Protocol (RDP) to the internet. Use secure VPN connections with multi-factor authentication schemes. Network access control packages can be used to ensure that systems attempting to remotely connect to the corporate environment meet a minimum set of security standards such as anti-malware protection, patch levels, etc,. prior to granting them access to corporate resources. Continually identify and remediate access-policy violations. + * Identity Management: Protect critical and public-facing applications with multi-factor authentication and supporting corporate policies. Verify that remote-account and access-termination capabilities work as intended in a remote environment. + * Endpoint Control: Because many people may be working from home networks, endpoint visibility, protection, and mitigation is now more important than ever. Consider whether remediation and reimaging capabilities will work as intended in a remote environment. Encrypt devices where possible, and add this check to your NAC solution as a gate for connectivity. Another simple method of protecting endpoints is via DNS, such as with [Cisco’s] Umbrella, by blocking the resolution of malicious domains before the host has a chance to make a connection. + + + +In an [FAQ][7] about the impact of COVID-19 on fulfilling customer hardware orders, VMware stated: “Some VMware SD-WAN hardware appliances are on backorder as a result of supply chain issues. As a result, we are extending the option to update existing orders with different appliances where inventory is more readily available. Customers may contact a special email hotline with questions related to backordered appliances. Please send an email to [sd-wan-hotline@vmware.com][8] with your questions and include the order number, urgent quantities, and contact information. We will do our best to respond within 48 hours.” + +Cisco said it has been analyzing traffic statistics with major carriers across Asia, Europe, and the Americas, and its data shows that typically, the most congested point in the network occurs at inter-provider peering points, Jonathan Davidson, senior vice president and general manager of Cisco's Mass-Scale Infrastructure Group wrote in a [blog][9] on March 26. “However, the traffic exchanged at these bottlenecks is only a part of the total internet traffic, meaning reports on traffic may be higher overall as private peering and local destinations also contribute to more traffic growth.” + +[][10] + +“Our analysis at these locations shows an increase in traffic of 10% to 33% over normal levels. In every country, traffic spiked with the decision to shut down non-essential businesses and keep people at home. Since then, traffic has remained stable or has experienced a slight uptick over the days that followed,” Davidson stated. + +He said that traffic during peak hours from 6 p.m. and 10 p.m. has increased slightly, but is not the primary driver for the overall inrease. Busy hours have extended to 9 a.m. 10 p.m., although the new busy-hour (9 a.m. to 6 p.m.) traffic is still below the traditional peak hours. "Service providers are certainly paying attention to these changes, but they are not yet a dire concern, as most networks are designed for growth. Current capacities are utilized more over the course of the entire day,” he wrote. + +Spanish multinational telecommunications company [Telefonica][11]’ said IP networks are experiencing traffic increases of close to 40% while mobile voice use is up about 50% and data is up 25%. In general, traffic through IP networks has experienced increases of nearly 40% while mobile use has increased by about 50% for voice and 25% for data. Likewise, traffic from instant-messaging tools such as Whatsapp has increased fivefold in recent days. + +**UPDATE: 3.26** + + * Week over week (ending March 23) [Ookla][12] says it has started to see a degradation of mobile and fixed-broadband performance worldwide. More detail on specific locations is available below. Comparing the week of March 16 to the week of March 9, mean download speed over mobile and fixed broadband decreased in Canada and the U.S. while both remained relatively flat in Mexico. + * What is the impact of the coronavirus on corporate network planning? Depends on how long the work-from-home mandate goes on really. Tom Nolle, president of CIMI Corp. [takes an interesting look at the situation][13] saying the shutdown “could eventually produce a major uptick for SD-WAN services, particularly in [managed service provider]    Businesses would be much more likely to embark on an SD-WAN VPN adventure that didn’t involve purchase/licensing, favoring a service approach in general, and in particular one with a fairly short contract period.” + * Statistics from VPN provider [NordVPN][14] show the growth of VPN usage across the globe.  For example, the company said the US has experienced a 65.93% growth in the use of business VPNs since March 11. It reported that mass remote working has contributed towards a rise in desktop (94.09%) and mobile app (0.39%) usage among Americans. Globally, NordVPN teams has seen a 165% spike in the use of business VPNs and business VPN usage in Netherlands (240.49%), Canada (206.29%) and Austria (207.86%) has skyrocketed beyond 200%. Italy has had the most modest growth in business VPN usage at just 10.57%. + + + +**UPDATE: 3. 25**: + + * According to [Atlas VPN][15] user data, VPN usage in the US increased by 124% during the last two weeks. VPN usage in the country increased by 71% between March 16 and 22 alone. Atlas said it measured how much traffic traveled through its servers during that period compared to March 9 to 15. The data came from the company's 53,000 weekly users. + * Verizon [reports][16] that voice usage, long declining in the age of texting, chat and social media, is up 25% in the last week. The network report shows the primary driver is accessing conference calls. In addition, people are talking longer on mobile devices with wireless voice usage notching a 10% increase and calls lasting 15% longer.  + * AT&T also [reported][17] increased calling, especially Wi-Fi calling, up 88% on March 22 versus a normal Sunday. It says that consumer home voice calls were up 74% more than an average Sunday; traffic from Netflix dipped after all-time highs on Friday and Saturday; and data traffic due to heavy video streaming between its network and peered networks tied record highs. AT&T said it has deployed portable cell nodes to bolster coverage supporting FirstNet customers in Indiana, Connecticut, New Jersey, California and New York. + * Microsoft this week advised users of Office 365 it was throttling back some services: + * **OneNote: ** OneNote in Teams will be read-only for commercial tenants, excluding EDU. Users can go to OneNote for the web for editing. Download size and sync frequency of file attachments has been changed. You can find details on these and other OneNote related updates as . + * **SharePoint:** We are rescheduling specific backend operations to regional evening and weekend business hours. Impacted capabilities include migration, DLP and delays in file management after uploading a new file, video or image. Reduced video resolution for playback videos. + * **Stream:** People timeline has been disabled for newly uploaded videos. Pre-existing videos will not be impacted. Meeting recording video resolution adjusted to 720p. + + + +**RELATED COVID-19 NEWS:** + + * Security vendor [Check Point’s Threat Intelligence][18] says that Since January 2020, there have been over 4,000 coronavirus-related domains registered globally. Out of these websites, 3% were found to be malicious and an additional 5% are suspicious. Coronavirus- related domains are 50% more likely to be malicious than other domains registered at the same period, and also higher than recent seasonal themes such as Valentine’s day. + * [Orange][19] an IT and communications **services** company aid that has increased its network capacity and upgraded its service platforms. These measures allow it to support the ongoing exponential increase in needs and uses. The number of users connecting to their company's network remotely has already increased by 700% among its customers. It has also doubled the capacity for simultaneous connections on its platforms. The use of remote collaboration solutions such as video conferencing has also risen massively with usage increasing by between 20% to 100%. + * Verizon said it has seen a 34% increase in VPN traffic from March 10 to 17. It has also seen a 75% increase in gaming traffic and web traffic increased by just under 20% in that time period according to Verizon. + * One week after the CDC declaration of the virus as a pandemic, data analytics and broadband vendor OpenVault wrote on March 19 that: + * Subscribers’ average usage during the 9 am-to-5 pm daypart has risen to 6.3 GB, 41.4% higher than the January figure of 4.4 GB.  + * During the same period, peak hours (6 pm–11 pm) usage has risen 17.2% from 5.0 GB per subscriber in January to 5.87 GB in March.  + * Overall daily usage has grown from 12.19 GB to 15.46 GB, an increase of 26.8%. + * Based on the current rate of growth, OpenVault projected that consumption for March will reach nearly 400 GB per subscriber, an increase of almost 11% over the previous monthly record of 361 GB, established in January of this year. In addition, OpenVault projects a new coronavirus-influenced run rate of 460 GB per subscriber per month going forward. + + + +Join the Network World communities on [Facebook][20] and [LinkedIn][21] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3534037/rolling-update-the-impact-of-covid-19-on-public-networks-and-security.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://broadbandnow.com/ +[2]: https://broadbandnow.com/report/internet-speed-analysis-march-15th-21st/ +[3]: https://www.networkworld.com/article/3236448/lan-wan/what-to-consider-when-deploying-a-next-generation-firewall.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://blog.talosintelligence.com/2020/03/covid-19-pandemic-threats.html +[6]: https://blog.talosintelligence.com/2020/02/coronavirus-themed-malware.html +[7]: https://www.vmware.com/company/news/updates/vmware-response-covid-19.html?mid=31381&eid=CVMW2000048242496 +[8]: mailto:sd-wan-hotline@vmware.com +[9]: https://blogs.cisco.com/news/global-traffic-spikes-no-panic-at-the-cisco +[10]: 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) +[11]: https://www.telefonica.com/en/web/press-office/-/telefonica-announces-measures-related-to-covid-19 +[12]: https://downdetector.com/?utm_campaign=Ookla%20Insights%20Blog%20Subscription&utm_source=hs_email&utm_medium=email&utm_content=85202785&_hsenc=p2ANqtz--Nj93d_eQyJpsqxrPJyNPtTiMBWBQU984psLyalw51K61e4d1WODareMF5NWFriHY2Uzw3WF7rF-2vSfH5cR53Jg3K5Q&_hsmi=85202785 +[13]: https://blog.cimicorp.com/?p=4068 +[14]: https://nordvpnteams.com/ +[15]: https://atlasvpn.com/blog/lockdowns-and-panic-leads-to-a-124-surge-in-vpn-usage-in-the-us/ +[16]: https://www.verizon.com/about/news/update-verizon-serve-customers-covid-19 +[17]: https://about.att.com/pages/COVID-19.html +[18]: https://blog.checkpoint.com/2020/03/05/update-coronavirus-themed-domains-50-more-likely-to-be-malicious-than-other-domains/ +[19]: https://www.orange.com/en/Press-Room/press-releases/press-releases-2020/Orange-is-mobilised-to-ensure-continuity-of-service-for-all-customers-in-France-and-around-the-world +[20]: https://www.facebook.com/NetworkWorld/ +[21]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20200327 6 tricks for developing a work from home schedule.md b/sources/talk/20200327 6 tricks for developing a work from home schedule.md new file mode 100644 index 0000000000..9253f824fd --- /dev/null +++ b/sources/talk/20200327 6 tricks for developing a work from home schedule.md @@ -0,0 +1,108 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (6 tricks for developing a work from home schedule) +[#]: via: (https://opensource.com/article/20/3/work-from-home) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +6 tricks for developing a work from home schedule +====== +Stay flexible, embrace change, and think of the transition to your home +office as an opportunity to create a healthier WFH experience. +![Working from home at a laptop][1] + +When you start working from home, one of the first things you might have noticed is that there almost no outside influences on your schedule. + +You probably have meetings—some over [team chat][2] and others over [video][3]— that you have to attend, but otherwise, there's nothing requiring you to do anything at any specific time. What you find out pretty quickly, though, is that there's an invisible influence that sneaks up on you: deadlines. + +This lack of structure fosters procrastination, sometimes willful and other times aimless, followed by frantic sprints to get something done. Learning to mitigate that, along with all the distractions working from home might offer, is often the hardest part of your home-based work. + +Here are a few ways to build in that structure for yourself do you don't end up feeling like you are falling behind. + +### You have always had your own schedule + +Everybody reacts to schedules differently. For some people, schedules offer guidance and comfort. For others, schedules are rigid and oppressive. + +An office space generally provides focus. There might be plenty of distractions at the office, but you usually find a good stretch of time at some point during your day when you can get a big chunk of work done. Even in an office, though, each person actually keeps their own schedule. Your colleague might arrive early in the day, happily completing a day's work in an empty office before anyone else arrives and then spending the rest of the day doing menial tasks and socializing. Another colleague might arrive late and leave early, maximizing time spent in the office for actual work. Still others follow a steady pace throughout the day. + +As you're settling into a WFH routine, take notes, either mentally or physically, on what seems to work well for you. If you like formalized systems, then build a schedule for yourself after a week or two, based on what you've been doing naturally. If there's something that isn't working for you, then drop it from your schedule. + +Once you've found a good rhythm for yourself, you can manage your day with a [to-do list][4] like [todo.txt][5], or if you prefer sledgehammers (or you actually manage a department), you can try a [project management][6] application. + +### Treat yourself as a new hire + +For the first week or two at home, you may find it helpful to treat yourself (and your remote team) as a new hire. Instead of trying to mimic or impose the same schedule you kept at the office or at school, take time to monitor your own activity. It takes time for your body and mind to establish new and comfortable habits, and if you're the kind of person who wanders into a routine, then you need to give yourself time to discover what those habits are. + +For instance, if you're consistently finding that you do your best work right after breakfast, then relegate menial tasks, like responding to email, reviewing tasks, or triaging bug reports, to the early morning, and make sure you have a big task set up for after breakfast. If you're having a hard time maintaining focus, then make time for morning tea so you can relax, reassess your workload, and plan your next step. Be curious about yourself like a manager would be for a brand new employee. Adjust accordingly. + +### There is no guilt to being interrupted at home + +Not everything on your schedule is under your control. If you have children too young for school, or if children are home from school, then their schedules take precedence. + +It's a perceived benefit of working from home that your schedule is more flexible than at an office, but with that assumption, there can sometimes come a little to a lot of guilt. You might feel you're not working "enough" because you have to stop to wake up and feed children, or because you want to take a few play breaks every now and again. + +That's mostly illusory, though, and here is how to think about it. If you swap out "children" for "manager," you might remember some times at the office where your "real" work was interrupted because you had to entertain upper management with sparkly presentations, or complete piles of paperwork for HR, or decompress by chatting with colleagues by the water cooler. + +Your work from home is really no different. There are plenty of distractions, and they're only a problem if you fail to acknowledge and work around them. + +### Making the choice to move beyond the 9-to-5 + +Unlike at the office, you're not forced into a rigid and dated 9-to-5 structure. If your day has to start at 7am, contains a lot of breaks, and doesn't end until 7pm, then that's alright. The essential part is to define that as your schedule for yourself (once you've established it as a schedule that works for you; remember to give yourself a few weeks to get a feel for what your schedule actually "wants" to be). Pick your start and end times, establish break times with your housemates, whether they're children, spouses, pets, or roommates/friends. Work when you're supposed to be working, and don't work when you're not scheduled to work. For most of us, colleagues don't need to know exactly when you are online as long as you're available when you're needed. In that case, your hours are your own. If the team is the kind that needs to know, run it by them. + +### Don't forget time for yourself + +It's important to at least establish times you stop thinking about work, no matter what. If you've got a very young child who's not given to staying on any schedule, then you might have to stay more flexible than most. Still, give yourself permission to actively be inactive. Do something you enjoy, even if it feels unproductive. It's normal to spend some idle time at the office to think or intentionally not think. Working from home deserves the same space. If anything, it's even more important as you establish working hours. The goal is to recognize when you're at home and when you're at work. + +Finding stuff to do at work is relatively easy, but sometimes finding things to do to relax can be hard. If you have children, you can collaborate with them using Scratch for [drawing beautiful art][7], [programming video games][8], or even [robotics][9]. For the times you're not necessarily looking to collaborate and need your little one to do some exploration of their own, there are some [great open source alternatives to Minecraft][10], too. If you're interested in getting away from the screen, though, you might try some [Arduino][11] or [Seeeduino][12] gardening projects. Start with some programming, and end up outside in the garden! + +### Choose to see change as exciting + +Some say humans don't generally love change and that we're primarily creatures of habit, so moving from an office into a home office can be upsetting. And yet, invariably, we've shown that change can be exciting and even good.  + +Use this thought experiment to remember how much you love change. Would you willingly revert to technology from even two years ago? How about five, or ten? + +If we can embrace change in technology and be uninterested in reverting back, why not embrace change elsewhere? + +When you work from home, you have the opportunity to be willing to explore change. If you find that a meeting time doesn't work for your schedule, mention it to your team. It may not work for them, either, and moving it to a different day could mean making room for a work sprint that knocks out a good chunk of your work for the week. If you find that a tool isn't working out for you, find a different one. + +In fact, some of the most productive people are constantly evaluating new applications and new methods of working. They're constantly learning new things, developing new skills. They don't do this because they need the new skill, at least not by the letter of their work contract, but learning new things often reveals a surprising applicability to something they do need. + +Need some examples? Tinkering with a Raspberry Pi for fun could result in a home server running [useful apps][13] to help you stay informed. [Learning][14] how to [write in Markdown][15] could introduce you to a new and more efficient workflow than you ever knew possible. Setting up a [computer with Linux][16] could reveal a new world of open source software that changes the way you approach problems, and improves the methods you use to solve them. The possibilities are limitless, but if you don't know where to start, you can browse through some of our articles or [cheat sheets][17] for ideas and tips. + +### Working from home is a new opportunity + +The habits we've built up around work aren't always healthy or efficient or fun. If you're starting to work from home, though, it's a chance to reinvent what work means for you. Keep the lines of [communication open][18] with your colleagues, embrace new ideas and the potential of change, and discover how you can be more productive by enjoying yourself and the place you call home (and **$HOME**). + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/work-from-home + +作者:[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/wfh_work_home_laptop_work.png?itok=VFwToeMy (Working from home at a laptop) +[2]: https://opensource.com/alternatives/slack +[3]: https://opensource.com/alternatives/skype +[4]: https://opensource.com/article/19/9/to-do-list-managers-linux +[5]: https://opensource.com/article/20/1/open-source-to-do-list +[6]: https://opensource.com/article/18/2/agile-project-management-tools +[7]: https://opensource.com/article/19/9/drawing-vectors-scratch-3 +[8]: https://opensource.com/article/18/4/designing-game-scratch-open-jam +[9]: https://opensource.com/education/13/8/student-programming-scratch-and-finch +[10]: https://opensource.com/alternatives/minecraft +[11]: https://opensource.com/article/17/3/arduino-garden-projects +[12]: https://opensource.com/article/19/12/seeeduino-nano-review +[13]: https://opensource.com/article/20/2/newsboat +[14]: https://opensource.com/article/19/9/introduction-markdown +[15]: https://opensource.com/article/18/11/markdown-editors +[16]: https://opensource.com/article/19/9/found-linux-video-gaming +[17]: https://opensource.com/article/20/1/cheat-sheets-guides +[18]: https://opensource.com/article/20/3/open-source-working-home diff --git a/sources/tech/20180522 Advanced use of the less text file viewer in Linux.md b/sources/tech/20180522 Advanced use of the less text file viewer in Linux.md deleted file mode 100644 index 9d8ea93869..0000000000 --- a/sources/tech/20180522 Advanced use of the less text file viewer in Linux.md +++ /dev/null @@ -1,119 +0,0 @@ -Translating by MjSeven - -Advanced use of the less text file viewer in Linux -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_terminals_0.png?itok=XwIRERsn) - -I recently read Scott Nesbitt's article "[Using less to view text files at the Linux command line][1]" and was inspired to share additional tips and tricks I use with `less`. - -### LESS env var - -If you have an environment variable `LESS` defined (e.g., in your `.bashrc`), `less` treats it as a list of options, as if passed on the command line. - -I use this: -``` -LESS='-C -M -I -j 10 -# 4' - -``` - -These mean: - - * `-C` – Make full-screen reprints faster by not scrolling from the bottom. - * `-M` – Show more information from the last (status) line. You can customize the information shown with `-PM`, but I usually do not bother. - * `-I` – Ignore letter case (upper/lower) in searches. - * `-j 10` – Show search results in line 10 of the terminal, instead of the first line. This way you have 10 lines of context each time you press `n` (or `N`) to jump to the next (or previous) match. - * `-# 4` – Jump four characters to the right or left when pressing the Right or Left arrow key. The default is to jump half of the screen, which I usually find to be too much. Generally speaking, `less` seems to be (at least partially) optimized to the environment it was initially developed in, with slow modems and low-bandwidth internet connections, when it made sense to jump half a screen. - - - -### PAGER env var - -Many programs show information using the command set in the `PAGER` environment variable (if it's set). So, you can set `PAGER=less` in your `.bashrc` and have your program run `less`. Check the man page environ(7) (`man 7 environ`) for other such variables. - -### -S - -`-S` tells `less` to chop long lines instead of wrapping them. I rarely find a need for this unless (and until) I've started viewing a file. Fortunately, you can type all command-line options inside `less` as if they were keyboard commands. So, if I want to chop long lines while I'm already in a file, I can simply type `-S`. - -The command-line optiontellsto chop long lines instead of wrapping them. I rarely find a need for this unless (and until) I've started viewing a file. Fortunately, you can type all command-line options insideas if they were keyboard commands. So, if I want to chop long lines while I'm already in a file, I can simply type - -Here's an example I use a lot: -``` -    su - postgres - -    export PAGER=less  # Because I didn't bother editing postgres' .bashrc on all the machines I use it on - -    psql - -``` - -Sometimes when I later view the output of a `SELECT` command with a very wide output, I type `-S` so it will be formatted nicely. If it jumps too far when I press the Right arrow to see more (because I didn't set `-#`), I can type `-#8`, then each Right arrow press will move eight characters to the right. - -Sometimes after typing `-S` too many times, I exit psql and run it again after entering: -``` -export LESS=-S - -``` - -### F - -The command `F` makes `less` work like `tail -f`—waiting until more data is added to the file before showing it. One advantage this has over `tail -f` is that highlighting search matches still works. So you can enter `less /var/log/logfile`, search for something—which will highlight all occurrences of it (unless you used `-g`)—and then press `F`. When more data is written to the log, `less` will show it and highlight the new matches. - -After you press `F`, you can press `Ctrl+C` to stop it from looking for new data (this will not kill it); go back into the file to see older stuff, search for other things, etc.; and then press `F` again to look at more new data. - -### Searching - -Searches use the system's regexp library, and this usually means you can use extended regular expressions. In particular, searching for `one|two|three` will find and highlight all occurrences of one, two, or three. - -Another pattern I use a lot, especially with wide log lines (e.g., ones that span more than one terminal line), is `.*something.*`, which highlights the entire line. This pattern makes it much easier to see where a line starts and finishes. I also combine these, such as: `.*one thing.*|.*another thing.*`, or `key: .*|.*marker.*` to see the contents of `key` (e.g., in a log file with a dump of some dictionary/hash) and highlight relevant marker lines (so I have a context), or even, if I know the value is surrounded by quotes: -``` -key: '[^']*'|.*marker.* - -``` - -`less` maintains a history of your search items and saves them to disk for future invocations. When you press `/` (or `?`), you can go through this history with the Up or Down arrow (as well as do basic line editing). - -I stumbled upon what seems to be a very useful feature when skimming through the `less` man page while writing this article: skipping uninteresting lines with `&!pattern`. For example, while looking for something in `/var/log/messages`, I used to iterate through this list of commands: -``` -    cat /var/log/messages | egrep -v 'systemd: Started Session' | less - -    cat /var/log/messages | egrep -v 'systemd: Started Session|systemd: Starting Session' | less - -    cat /var/log/messages | egrep -v 'systemd: Started Session|systemd: Starting Session|User Slice' | less - -    cat /var/log/messages | egrep -v 'systemd: Started Session|systemd: Starting Session|User Slice|dbus' | less - -    cat /var/log/messages | egrep -v 'systemd: Started Session|systemd: Starting Session|User Slice|dbus|PackageKit Daemon' | less - -``` - -But now I know how to do the same thing within `less`. For example, I can type `&!systemd: Started Session`, then decide I want to get rid of `systemd: Starting Session`, so I add it by typing `&!` and use the Up arrow to get the previous search from the history. Then I type `|systemd: Starting Session` and press `Enter`, continuing to add more items the same way until I filter out enough to see the more interesting stuff. - -### = - -The command `=` shows more information about the file and location, even more than `-M`. If the file is very long, and calculating `=` takes too long, you can press `Ctrl+C` and it will stop trying. - -If the content you're viewing is from a pipe rather than a file, `=` (and `-M`) will not show what it does not know, including the number of lines and bytes in the file. To see that data, if you know that `command` will finish quickly, you can jump to the end with `G`, and then `less` will start showing that information. - -If you press `G` and the command writing to the pipe takes longer than expected, you can press `Ctrl+C`, and the command will be killed. Pressing `Ctrl+C` will kill it even if you didn't press `G`, so be careful not to press `Ctrl+C` accidentally if you don't intend to kill it. For this reason, if the command does something (that is, it's not only showing information), it's usually safer to write its output to a file and view the file in a separate terminal, instead of using a pipe. - -### Why you need less - -`less` is a very powerful program, and contrary to newer contenders in this space, such as `most` and `moar`, you are likely to find it on almost all the systems you use, just like `vi`. So, even if you use GUI viewers or editors, it's worth investing some time going through the `less` man page, at least to get a feeling of what's available. This way, when you need to do something that might be covered by existing functionality, you'll know to search the manual page or the internet to find what you need. - -For more information, visit the [less home page][2]. The site has a nice FAQ with more tips and tricks. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/5/advanced-use-less-text-file-viewer - -作者:[Yedidyah Bar David][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者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/didib -[1]:http://opensource.com/article/18/4/using-less-view-text-files-command-line -[2]:http://www.greenwoodsoftware.com/less/ diff --git a/sources/tech/20190116 Best Audio Editors For Linux.md b/sources/tech/20190116 Best Audio Editors For Linux.md index d588c886e2..3b14f5b366 100644 --- a/sources/tech/20190116 Best Audio Editors For Linux.md +++ b/sources/tech/20190116 Best Audio Editors For Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MFGJT) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20190124 ffsend - Easily And Securely Share Files From Linux Command Line Using Firefox Send Client.md b/sources/tech/20190124 ffsend - Easily And Securely Share Files From Linux Command Line Using Firefox Send Client.md deleted file mode 100644 index fcbdd3c5c7..0000000000 --- a/sources/tech/20190124 ffsend - Easily And Securely Share Files From Linux Command Line Using Firefox Send Client.md +++ /dev/null @@ -1,330 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (ffsend – Easily And Securely Share Files From Linux Command Line Using Firefox Send Client) -[#]: via: (https://www.2daygeek.com/ffsend-securely-share-files-folders-from-linux-command-line-using-firefox-send-client/) -[#]: author: (Vinoth Kumar https://www.2daygeek.com/author/vinoth/) - -ffsend – Easily And Securely Share Files From Linux Command Line Using Firefox Send Client -====== - -Linux users were preferred to go with scp or rsync for files or folders copy. - -However, so many new options are coming to Linux because it’s a opensource. - -Anyone can develop a secure software for Linux. - -We had written multiple articles in our site in the past about this topic. - -Even, today we are going to discuss the same kind of topic called ffsend. - -Those are **[OnionShare][1]** , **[Magic Wormhole][2]** , **[Transfer.sh][3]** and **[Dcp – Dat Copy][4]**. - -### What’s ffsend? - -[ffsend][5] is a command line Firefox Send client that allow users to transfer and receive files and folders through command line. - -It allow us to easily and securely share files and directories from the command line through a safe, private and encrypted link using a single simple command. - -Files are shared using the Send service and the allowed file size is up to 2GB. - -Others are able to download these files with this tool, or through their web browser. - -All files are always encrypted on the client, and secrets are never shared with the remote host. - -Additionally you can add a password for the file upload. - -The uploaded files will be removed after the download (default count is 1 up to 10) or after 24 hours. This will make sure that your files does not remain online forever. - -This tool is currently in the alpha phase. Use at your own risk. Also, only limited installation options are available right now. - -### ffsend Features: - - * Fully featured and friendly command line tool - * Upload and download files and directories securely - * Always encrypted on the client - * Additional password protection, generation and configurable download limits - * Built-in file and directory archiving and extraction - * History tracking your files for easy management - * Ability to use your own Send host - * Inspect or delete shared files - * Accurate error reporting - * Low memory footprint, due to encryption and download/upload streaming - * Intended to be used in scripts without interaction - - - -### How To Install ffsend in Linux? - -There is no package for each distributions except Debian and Arch Linux systems. However, we can easily get this utility by downloading the prebuilt appropriate binaries file based on the operating system and architecture. - -Run the below command to download the latest available version for your operating system. - -``` -$ wget https://github.com/timvisee/ffsend/releases/download/v0.1.2/ffsend-v0.1.2-linux-x64.tar.gz -``` - -Extract the tar archive using the following command. - -``` -$ tar -xvf ffsend-v0.1.2-linux-x64.tar.gz -``` - -Run the following command to identify your path variable. - -``` -$ echo $PATH -/home/daygeek/.cargo/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl -``` - -As i told previously, just move the executable file to your path directory. - -``` -$ sudo mv ffsend /usr/local/sbin -``` - -Run the `ffsend` command alone to get the basic usage information. - -``` -$ ffsend -ffsend 0.1.2 -Usage: ffsend [FLAGS] ... - -Easily and securely share files from the command line. -A fully featured Firefox Send client. - -Missing subcommand. Here are the most used: - ffsend upload ... - ffsend download ... - -To show all subcommands, features and other help: - ffsend help [SUBCOMMAND] -``` - -For Arch Linux based users can easily install it with help of **[AUR Helper][6]** , as this package is available in AUR repository. - -``` -$ yay -S ffsend -``` - -For **`Debian/Ubuntu`** systems, use **[DPKG Command][7]** to install ffsend. - -``` -$ wget https://github.com/timvisee/ffsend/releases/download/v0.1.2/ffsend_0.1.2_amd64.deb -$ sudo dpkg -i ffsend_0.1.2_amd64.deb -``` - -### How To Send A File Using ffsend? - -It’s not complicated. We can easily send a file using simple syntax. - -**Syntax:** - -``` -$ ffsend upload [/Path/to/the/file/name] -``` - -In the following example, we are going to upload a file called `passwd-up1.sh`. Once you upload the file then you will be getting the unique URL. - -``` -$ ffsend upload passwd-up1.sh --copy -Upload complete -Share link: https://send.firefox.com/download/a4062553f4/#yy2_VyPaUMG5HwXZzYRmpQ -``` - -![][9] - -Just download the above unique URL to get the file in any remote system. - -**Syntax:** - -``` -$ ffsend download [Generated URL] -``` - -Output for the above command. - -``` -$ ffsend download https://send.firefox.com/download/a4062553f4/#yy2_VyPaUMG5HwXZzYRmpQ -Download complete -``` - -![][10] - -Use the following syntax format for directory upload. - -``` -$ ffsend upload [/Path/to/the/Directory] --copy -``` - -In this example, we are going to upload `2g` directory. - -``` -$ ffsend upload /home/daygeek/2g --copy -You've selected a directory, only a single file may be uploaded. -Archive the directory into a single file? [Y/n]: y -Archiving... -Upload complete -Share link: https://send.firefox.com/download/90aa5cfe67/#hrwu6oXZRG2DNh8vOc3BGg -``` - -Just download the above generated the unique URL to get a folder in any remote system. - -``` -$ ffsend download https://send.firefox.com/download/90aa5cfe67/#hrwu6oXZRG2DNh8vOc3BGg -You're downloading an archive, extract it into the selected directory? [Y/n]: y -Extracting... -Download complete -``` - -As this already send files through a safe, private, and encrypted link. However, if you would like to add a additional security at your level. Yes, you can add a password for a file. - -``` -$ ffsend upload file-copy-rsync.sh --copy --password -Password: -Upload complete -Share link: https://send.firefox.com/download/0742d24515/#P7gcNiwZJ87vF8cumU71zA -``` - -It will prompt you to update a password when you are trying to download a file in the remote system. - -``` -$ ffsend download https://send.firefox.com/download/0742d24515/#P7gcNiwZJ87vF8cumU71zA -This file is protected with a password. -Password: -Download complete -``` - -Alternatively you can limit a download speed by providing the download speed while uploading a file. - -``` -$ ffsend upload file-copy-scp.sh --copy --downloads 10 -Upload complete -Share link: https://send.firefox.com/download/23cb923c4e/#LVg6K0CIb7Y9KfJRNZDQGw -``` - -Just download the above unique URL to get a file in any remote system. - -``` -ffsend download https://send.firefox.com/download/23cb923c4e/#LVg6K0CIb7Y9KfJRNZDQGw -Download complete -``` - -If you want to see more details about the file, use the following format. It will shows you the file name, file size, Download counts and when it will going to expire. - -**Syntax:** - -``` -$ ffsend info [Generated URL] - -$ ffsend info https://send.firefox.com/download/23cb923c4e/#LVg6K0CIb7Y9KfJRNZDQGw -ID: 23cb923c4e -Name: file-copy-scp.sh -Size: 115 B -MIME: application/x-sh -Downloads: 3 of 10 -Expiry: 23h58m (86280s) -``` - -You can view your transaction history using the following format. - -``` -$ ffsend history -# LINK EXPIRY -1 https://send.firefox.com/download/23cb923c4e/#LVg6K0CIb7Y9KfJRNZDQGw 23h57m -2 https://send.firefox.com/download/0742d24515/#P7gcNiwZJ87vF8cumU71zA 23h55m -3 https://send.firefox.com/download/90aa5cfe67/#hrwu6oXZRG2DNh8vOc3BGg 23h52m -4 https://send.firefox.com/download/a4062553f4/#yy2_VyPaUMG5HwXZzYRmpQ 23h46m -5 https://send.firefox.com/download/74ff30e43e/#NYfDOUp_Ai-RKg5g0fCZXw 23h44m -6 https://send.firefox.com/download/69afaab1f9/#5z51_94jtxcUCJNNvf6RcA 23h43m -``` - -If you don’t want the link anymore then we can delete it. - -**Syntax:** - -``` -$ ffsend delete [Generated URL] - -$ ffsend delete https://send.firefox.com/download/69afaab1f9/#5z51_94jtxcUCJNNvf6RcA -File deleted -``` - -Alternatively this can be done using firefox browser by opening the page . - -Just drag and drop a file to upload it. -![][11] - -Once the file is downloaded, it will show you that 100% download completed. -![][12] - -To check other possible options, navigate to man page or help page. - -``` -$ ffsend --help -ffsend 0.1.2 -Tim Visee -Easily and securely share files from the command line. -A fully featured Firefox Send client. - -USAGE: - ffsend [FLAGS] [OPTIONS] [SUBCOMMAND] - -FLAGS: - -f, --force Force the action, ignore warnings - -h, --help Prints help information - -i, --incognito Don't update local history for actions - -I, --no-interact Not interactive, do not prompt - -q, --quiet Produce output suitable for logging and automation - -V, --version Prints version information - -v, --verbose Enable verbose information and logging - -y, --yes Assume yes for prompts - -OPTIONS: - -H, --history Use the specified history file [env: FFSEND_HISTORY] - -t, --timeout Request timeout (0 to disable) [env: FFSEND_TIMEOUT] - -T, --transfer-timeout Transfer timeout (0 to disable) [env: FFSEND_TRANSFER_TIMEOUT] - -SUBCOMMANDS: - upload Upload files [aliases: u, up] - download Download files [aliases: d, down] - debug View debug information [aliases: dbg] - delete Delete a shared file [aliases: del] - exists Check whether a remote file exists [aliases: e] - help Prints this message or the help of the given subcommand(s) - history View file history [aliases: h] - info Fetch info about a shared file [aliases: i] - parameters Change parameters of a shared file [aliases: params] - password Change the password of a shared file [aliases: pass, p] - -The public Send service that is used as default host is provided by Mozilla. -This application is not affiliated with Mozilla, Firefox or Firefox Send. -``` - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/ffsend-securely-share-files-folders-from-linux-command-line-using-firefox-send-client/ - -作者:[Vinoth Kumar][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.2daygeek.com/author/vinoth/ -[b]: https://github.com/lujun9972 -[1]: https://www.2daygeek.com/onionshare-secure-way-to-share-files-sharing-tool-linux/ -[2]: https://www.2daygeek.com/wormhole-securely-share-files-from-linux-command-line/ -[3]: https://www.2daygeek.com/transfer-sh-easy-fast-way-share-files-over-internet-from-command-line/ -[4]: https://www.2daygeek.com/dcp-dat-copy-secure-way-to-transfer-files-between-linux-systems/ -[5]: https://github.com/timvisee/ffsend -[6]: https://www.2daygeek.com/category/aur-helper/ -[7]: https://www.2daygeek.com/dpkg-command-to-manage-packages-on-debian-ubuntu-linux-mint-systems/ -[8]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 -[9]: https://www.2daygeek.com/wp-content/uploads/2019/01/ffsend-easily-and-securely-share-files-from-linux-command-line-using-firefox-send-client-1.png -[10]: https://www.2daygeek.com/wp-content/uploads/2019/01/ffsend-easily-and-securely-share-files-from-linux-command-line-using-firefox-send-client-2.png -[11]: https://www.2daygeek.com/wp-content/uploads/2019/01/ffsend-easily-and-securely-share-files-from-linux-command-line-using-firefox-send-client-3.png -[12]: https://www.2daygeek.com/wp-content/uploads/2019/01/ffsend-easily-and-securely-share-files-from-linux-command-line-using-firefox-send-client-4.png diff --git a/sources/tech/20190422 9 ways to save the planet.md b/sources/tech/20190422 9 ways to save the planet.md deleted file mode 100644 index a448fa7660..0000000000 --- a/sources/tech/20190422 9 ways to save the planet.md +++ /dev/null @@ -1,96 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MFGJT) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (9 ways to save the planet) -[#]: via: (https://opensource.com/article/19/4/save-planet) -[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike/users/alanfdoss/users/jmpearce) - -9 ways to save the planet -====== -These ideas have an open source twist. -![][1] - -What can be done to help save the planet? The question can seem depressing at a time when it feels like an individual's contribution isn't enough. But, who are we Earth dwellers if not for a collection of individuals? So, I asked our writer community to share ways that open source software or hardware can be used to make a difference. Here's what I heard back. - -### 9 ways to save the planet with an open source twist - -**1.** **Disable the blinking cursor in your terminal.** - -It might sound silly, but the trivial, blinking cursor can cause up to [2 watts per hour of extra power consumption][2]. To disable it, go to Terminal Settings: Edit > Preferences > Cursor > Cursor blinking > Disabled. - -_Recommended by Mars Toktonaliev_ - -**2\. Reduce your consumption of animal products and processed foods.** - -One way to do this is to add these open source apps to your phone: Daily Dozen, OpenFoodFacts, OpenVegeMap, and Food Restrictions. These apps will help you eat a healthy, plant-based diet, find vegan- and vegetarian-friendly restaurants, and communicate your dietary needs to others, even if they do not speak the same language. To learn more about these apps read [_4 open source apps to support eating a plant-based diet_][3]. - -_Recommendation by Joshua Allen Holm_ - -**3\. Recycle old computers.** - -How? With Linux, of course. Pay it forward by giving creating a new computer for someone who can't one and keep a computer out of the landfill. Here's how we do it at [The Asian Penguins][4]. - -_Recommendation by Stu Keroff_ - -**4\. Turn off devices when you're not using them.** - -Use "smart power strips" that have a "master" outlet and several "controlled" outlets. Plug your PC into the master outlet, and when you turn on the computer, your monitor, printer, and anything else plugged into the controlled outlets turns on too. A simpler, low-tech solution is a power strip with a timer. That's what I use at home. You can use switches on the timer to set a handy schedule to turn the power on and off at specific times. Automatically turn off your network printer when no one is at home. Or for my six-year-old laptop, extend the life of the battery with a schedule to alternate when it's running from wall power (outlet is on) and when it's running from the battery (outlet is off). - -_Recommended by Jim Hall_ - -**5\. Reduce the use of your HVAC system.** - -Sunlight shining through windows adds a lot of heat to your home during the summer. Use Home Assistant to [automatically adjust][5] window blinds and awnings [based on the time of day][6], or even based on the angle of the sun. - -_Recommended by Michael Hrivnak_ - -**6\. Turn your thermostat off or to a lower setting while you're away.** - -If your home thermostat has an "Away" feature, activating it on your way out the door is easy to forget. With a touch of automation, any connected thermostat can begin automatically saving energy while you're not home. [Stataway][7] is one such project that uses your phone's GPS coordinates to determine when it should set your thermostat to "Home" or "Away". - -_Recommended by Michael Hrivnak_ - -**7\. Save computing power for later.** - -I have an idea: Create a script that can read the power output from an alternative energy array (wind and solar) and begin turning on servers (taking them from a power-saving sleep mode to an active mode) in a computing cluster until the overload power is used (whatever excess is produced beyond what can be stored/buffered for later use). Then use the overload power during high-production times for compute-intensive projects like rendering. This process would be essentially free of cost because the power can't be buffered for other uses. I'm sure the monitoring, power management, and server array tools must exist to do this. Then, it's just an integration problem, making it all work together. - -_Recommended by Terry Hancock_ - -**8\. Turn off exterior lights.** - -Light pollution affects more than 80% of the world's population, according to the [World Atlas of Artificial Night Sky Brightness][8], published (Creative Commons Attribution-NonCommercial 4.0) in 2016 in the open access journal _Science Advances_. Turning off exterior lights is a quick way to benefit wildlife, human health, our ability to enjoy the night sky, and of course energy consumption. Visit [darksky.org][9] for more ideas on how to reduce the impact of your exterior lighting. - -_Recommended by Michael Hrivnak_ - -**9\. Reduce your CPU count.** - -For me, I remember I used to have a whole bunch of computers running in my basement as my IT playground/lab. I've become more conscious now of power consumption and so have really drastically reduced my CPU count. I like to take advantage of VMs, zones, containers... that type of technology a lot more these days. Also, I'm really glad that small form factor and SoC computers, such as the Raspberry Pi, exist because I can do a lot with one, such as run a DNS or Web server, without heating the room and running up my electricity bill. - -P.S. All of these computers are running Linux, FreeBSD, or Raspbian! - -_Recommended by Alan Formy-Duvall_ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/save-planet - -作者:[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/users/alanfdoss/users/jmpearce -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/pixelated-world.png?itok=fHjM6m53 -[2]: https://www.redhat.com/archives/fedora-devel-list/2009-January/msg02406.html -[3]: https://opensource.com/article/19/4/apps-plant-based-diets -[4]: https://opensource.com/article/19/2/asian-penguins-close-digital-divide -[5]: https://www.home-assistant.io/docs/automation/trigger/#sun-trigger -[6]: https://www.home-assistant.io/components/cover/ -[7]: https://github.com/mhrivnak/stataway -[8]: http://advances.sciencemag.org/content/2/6/e1600377 -[9]: http://darksky.org/ diff --git a/sources/tech/20190523 Run your blog on GitHub Pages with Python.md b/sources/tech/20190523 Run your blog on GitHub Pages with Python.md deleted file mode 100644 index 1e3634a327..0000000000 --- a/sources/tech/20190523 Run your blog on GitHub Pages with Python.md +++ /dev/null @@ -1,235 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Run your blog on GitHub Pages with Python) -[#]: via: (https://opensource.com/article/19/5/run-your-blog-github-pages-python) -[#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjny/users/jasperzanjani/users/jasperzanjani/users/jasperzanjani/users/jnyjny/users/jasperzanjani) - -Run your blog on GitHub Pages with Python -====== -Create a blog with Pelican, a Python-based blogging platform that works -well with GitHub. -![Raspberry Pi and Python][1] - -[GitHub][2] is a hugely popular web service for source code control that uses [Git][3] to synchronize local files with copies kept on GitHub's servers so you can easily share and back up your work. - -In addition to providing a user interface for code repositories, GitHub also enables users to [publish web pages][4] directly from a repository. The website generation package GitHub recommends is [Jekyll][5], written in Ruby. Since I'm a bigger fan of [Python][6], I prefer [Pelican][7], a Python-based blogging platform that works well with GitHub. - -Pelican and Jekyll both transform content written in [Markdown][8] or [reStructuredText][9] into HTML to generate static websites, and both generators support themes that allow unlimited customization. - -In this article, I'll describe how to install Pelican, set up your GitHub repository, run a quickstart helper, write some Markdown files, and publish your first page. I'll assume that you have a [GitHub account][10], are comfortable with [basic Git commands][11], and want to publish a blog using Pelican. - -### Install Pelican and create the repo - -First things first, Pelican (and **ghp-import** ) must be installed on your local machine. This is super easy with [pip][12], the Python package installation tool (you have pip right?): - - -``` -`$ pip install pelican ghp-import` -``` - -Next, open a browser and create a new repository on GitHub for your sweet new blog. Name it as follows (substituting your GitHub username for here and throughout this tutorial): - - -``` -`https://GitHub.com/username/username.github.io` -``` - -Leave it empty; we will fill it with compelling blog content in a moment. - -Using a command line (you command line right?), clone your empty Git repository to your local machine: - - -``` -$ git clone blog -$ cd blog -``` - -### That one weird trick… - -Here's a not-super-obvious trick about publishing web content on GitHub. For user pages (pages hosted in repos named _username.github.io_ ), the content is served from the **master** branch. - -I strongly prefer not to keep all the Pelican configuration files and raw Markdown files in **master** , rather just the web content. So I keep the Pelican configuration and the raw content in a separate branch I like to call **content**. (You can call it whatever you want, but the following instructions will call it **content**.) I like this structure since I can throw away all the files in **master** and re-populate it with the **content** branch. - - -``` -$ git checkout -b content -Switched to a new branch 'content' -``` - -### Configure Pelican - -Now it's time for content configuration. Pelican provides a great initialization tool called **pelican-quickstart** that will ask you a series of questions about your blog. - - -``` -$ pelican-quickstart -Welcome to pelican-quickstart v3.7.1. - -This script will help you create a new Pelican-based website. - -Please answer the following questions so this script can generate the files -needed by Pelican. - -> Where do you want to create your new web site? [.] -> What will be the title of this web site? Super blog -> Who will be the author of this web site? username -> What will be the default language of this web site? [en] -> Do you want to specify a URL prefix? e.g., (Y/n) n -> Do you want to enable article pagination? (Y/n) -> How many articles per page do you want? [10] -> What is your time zone? [Europe/Paris] US/Central -> Do you want to generate a Fabfile/Makefile to automate generation and publishing? (Y/n) y -> Do you want an auto-reload & simpleHTTP script to assist with theme and site development? (Y/n) y -> Do you want to upload your website using FTP? (y/N) n -> Do you want to upload your website using SSH? (y/N) n -> Do you want to upload your website using Dropbox? (y/N) n -> Do you want to upload your website using S3? (y/N) n -> Do you want to upload your website using Rackspace Cloud Files? (y/N) n -> Do you want to upload your website using GitHub Pages? (y/N) y -> Is this your personal page (username.github.io)? (y/N) y -Done. Your new project is available at /Users/username/blog -``` - -You can take the defaults on every question except: - - * Website title, which should be unique and special - * Website author, which can be a personal username or your full name - * Time zone, which may not be in Paris - * Upload to GitHub Pages, which is a "y" in our case - - - -After answering all the questions, Pelican leaves the following in the current directory: - - -``` -$ ls -Makefile content/ develop_server.sh* -fabfile.py output/ pelicanconf.py -publishconf.py -``` - -You can check out the [Pelican docs][13] to find out how to use those files, but we're all about getting things done _right now_. No, I haven't read the docs yet either. - -### Forge on - -Add all the Pelican-generated files to the **content** branch of the local Git repo, commit the changes, and push the local changes to the remote repo hosted on GitHub by entering: - - -``` -$ git add . -$ git commit -m 'initial pelican commit to content' -$ git push origin content -``` - -This isn't super exciting, but it will be handy if we need to revert edits to one of these files. - -### Finally getting somewhere - -OK, now you can get bloggy! All of your blog posts, photos, images, PDFs, etc., will live in the **content** directory, which is initially empty. To begin creating a first post and an About page with a photo, enter: - - -``` -$ cd content -$ mkdir pages images -$ cp /Users/username/SecretStash/HotPhotoOfMe.jpg images -$ touch first-post.md -$ touch pages/about.md -``` - -Next, open the empty file **first-post.md** in your favorite text editor and add the following: - - -``` -title: First Post on My Sweet New Blog -date: -author: Your Name Here - -# I am On My Way To Internet Fame and Fortune! - -This is my first post on my new blog. While not super informative it -should convey my sense of excitement and eagerness to engage with you, -the reader! -``` - -The first three lines contain metadata that Pelican uses to organize things. There are lots of different metadata you can put there; again, the docs are your best bet for learning more about the options. - -Now, open the empty file **pages/about.md** and add this text: - - -``` -title: About -date: - -![So Schmexy][my_sweet_photo] - -Hi, I am and I wrote this epic collection of Interweb -wisdom. In days of yore, much of this would have been deemed sorcery -and I would probably have been burned at the stake. - -😆 - -[my_sweet_photo]: {filename}/images/HotPhotoOfMe.jpg -``` - -You now have three new pieces of web content in your content directory. Of the content branch. That's a lot of content. - -### Publish - -Don't worry; the payoff is coming! - -All that's left to do is: - - * Run Pelican to generate the static HTML files in **output** : [code]`$ pelican content -o output -s publishconf.py` -``` -* Use **ghp-import** to add the contents of the **output** directory to the **master** branch: [code]`$ ghp-import -m "Generate Pelican site" --no-jekyll -b master output` -``` - * Push the local master branch to the remote repo: [code]`$ git push origin master` -``` - * Commit and push the new content to the **content** branch: [code] $ git add content -$ git commit -m 'added a first post, a photo and an about page' -$ git push origin content -``` - - - -### OMG, I did it! - -Now the exciting part is here, when you get to view what you've published for everyone to see! Open your browser and enter: - - -``` -`https://username.github.io` -``` - -Congratulations on your new blog, self-published on GitHub! You can follow this pattern whenever you want to add more pages or articles. Happy blogging. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/5/run-your-blog-github-pages-python - -作者:[Erik O'Shaughnessy][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/jnyjny/users/jasperzanjani/users/jasperzanjani/users/jasperzanjani/users/jnyjny/users/jasperzanjani -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/getting_started_with_python.png?itok=MFEKm3gl (Raspberry Pi and Python) -[2]: https://github.com/ -[3]: https://git-scm.com -[4]: https://help.github.com/en/categories/github-pages-basics -[5]: https://jekyllrb.com -[6]: https://python.org -[7]: https://blog.getpelican.com -[8]: https://guides.github.com/features/mastering-markdown -[9]: http://docutils.sourceforge.net/docs/user/rst/quickref.html -[10]: https://github.com/join?source=header-home -[11]: https://git-scm.com/docs -[12]: https://pip.pypa.io/en/stable/ -[13]: https://docs.getpelican.com diff --git a/sources/tech/20190527 How To Enable Or Disable SSH Access For A Particular User Or Group In Linux.md b/sources/tech/20190527 How To Enable Or Disable SSH Access For A Particular User Or Group In Linux.md deleted file mode 100644 index 07cb009634..0000000000 --- a/sources/tech/20190527 How To Enable Or Disable SSH Access For A Particular User Or Group In Linux.md +++ /dev/null @@ -1,300 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (way-ww) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How To Enable Or Disable SSH Access For A Particular User Or Group In Linux?) -[#]: via: (https://www.2daygeek.com/allow-deny-enable-disable-ssh-access-user-group-in-linux/) -[#]: author: (2daygeek http://www.2daygeek.com/author/2daygeek/) - -How To Enable Or Disable SSH Access For A Particular User Or Group In Linux? -====== - -As per your organization standard policy, you may need to allow only the list of users that are allowed to access the Linux system. - -Or you may need to allow only few groups, which are allowed to access the Linux system. - -How to achieve this? What is the best way? How to achieve this in a simple way? - -Yes, there are many ways are available to perform this. - -However, we need to go with simple and easy method. - -If so, it can be done by making the necessary changes in `/etc/ssh/sshd_config` file. - -In this article we will show you, how to perform this in details. - -Why are we doing this? due to security reason. Navigate to the following URL to know more about **[openSSH][1]** usage. - -### What Is SSH? - -openssh stands for OpenBSD Secure Shell. Secure Shell (ssh) is a free open source networking tool which allow us to access remote system over an unsecured network using Secure Shell (SSH) protocol. - -It’s a client-server architecture. It handles user authentication, encryption, transferring files between computers and tunneling. - -These can be accomplished via traditional tools such as telnet or rcp, these are insecure and use transfer password in cleartext format while performing any action. - -### How To Allow A User To Access SSH In Linux? - -We can allow/enable the ssh access for a particular user or list of the users using the following method. - -If you would like to allow more than one user then you have to add the users with space in the same line. - -To do so, just append the following value into `/etc/ssh/sshd_config` file. In this example, we are going to allow ssh access for `user3`. - -``` -# echo "AllowUsers user3" >> /etc/ssh/sshd_config -``` - -You can double check this by running the following command. - -``` -# cat /etc/ssh/sshd_config | grep -i allowusers -AllowUsers user3 -``` - -That’s it. Just bounce the ssh service and see the magic. - -``` -# systemctl restart sshd - -# service restart sshd -``` - -Simple open a new terminal or session and try to access the Linux system with different user. Yes, `user2` isn’t allowed for SSH login and will be getting an error message as shown below. - -``` -# ssh [email protected] -[email protected]'s password: -Permission denied, please try again. -``` - -Output: - -``` -Mar 29 02:00:35 CentOS7 sshd[4900]: User user2 from 192.168.1.6 not allowed because not listed in AllowUsers -Mar 29 02:00:35 CentOS7 sshd[4900]: input_userauth_request: invalid user user2 [preauth] -Mar 29 02:00:40 CentOS7 unix_chkpwd[4902]: password check failed for user (user2) -Mar 29 02:00:40 CentOS7 sshd[4900]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.1.6 user=user2 -Mar 29 02:00:43 CentOS7 sshd[4900]: Failed password for invalid user user2 from 192.168.1.6 port 42568 ssh2 -``` - -At the same time `user3` is allowed to login into the system because it’s in allowed users list. - -``` -# ssh [email protected] -[email protected]'s password: -[[email protected] ~]$ -``` - -Output: - -``` -Mar 29 02:01:13 CentOS7 sshd[4939]: Accepted password for user3 from 192.168.1.6 port 42590 ssh2 -Mar 29 02:01:13 CentOS7 sshd[4939]: pam_unix(sshd:session): session opened for user user3 by (uid=0) -``` - -### How To Deny Users To Access SSH In Linux? - -We can deny/disable the ssh access for a particular user or list of the users using the following method. - -If you would like to disable more than one user then you have to add the users with space in the same line. - -To do so, just append the following value into `/etc/ssh/sshd_config` file. In this example, we are going to disable ssh access for `user1`. - -``` -# echo "DenyUsers user1" >> /etc/ssh/sshd_config -``` - -You can double check this by running the following command. - -``` -# cat /etc/ssh/sshd_config | grep -i denyusers -DenyUsers user1 -``` - -That’s it. Just bounce the ssh service and see the magic. - -``` -# systemctl restart sshd - -# service restart sshd -``` - -Simple open a new terminal or session and try to access the Linux system with Deny user. Yes, `user1` is in denyusers list. So, you will be getting an error message as shown below when you are try to login. - -``` -# ssh [email protected] -[email protected]'s password: -Permission denied, please try again. -``` - -Output: - -``` -Mar 29 01:53:42 CentOS7 sshd[4753]: User user1 from 192.168.1.6 not allowed because listed in DenyUsers -Mar 29 01:53:42 CentOS7 sshd[4753]: input_userauth_request: invalid user user1 [preauth] -Mar 29 01:53:46 CentOS7 unix_chkpwd[4755]: password check failed for user (user1) -Mar 29 01:53:46 CentOS7 sshd[4753]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.1.6 user=user1 -Mar 29 01:53:48 CentOS7 sshd[4753]: Failed password for invalid user user1 from 192.168.1.6 port 42522 ssh2 -``` - -### How To Allow Groups To Access SSH In Linux? - -We can allow/enable the ssh access for a particular group or groups using the following method. - -If you would like to allow more than one group then you have to add the groups with space in the same line. - -To do so, just append the following value into `/etc/ssh/sshd_config` file. In this example, we are going to disable ssh access for `2g-admin` group. - -``` -# echo "AllowGroups 2g-admin" >> /etc/ssh/sshd_config -``` - -You can double check this by running the following command. - -``` -# cat /etc/ssh/sshd_config | grep -i allowgroups -AllowGroups 2g-admin -``` - -Run the following command to know the list of the users are belongs to this group. - -``` -# getent group 2g-admin -2g-admin:x:1005:user1,user2,user3 -``` - -That’s it. Just bounce the ssh service and see the magic. - -``` -# systemctl restart sshd - -# service restart sshd -``` - -Yes, `user3` is allowed to login into the system because user3 is belongs to `2g-admin` group. - -``` -# ssh [email protected] -[email protected]'s password: -[[email protected] ~]$ -``` - -Output: - -``` -Mar 29 02:10:21 CentOS7 sshd[5165]: Accepted password for user1 from 192.168.1.6 port 42640 ssh2 -Mar 29 02:10:22 CentOS7 sshd[5165]: pam_unix(sshd:session): session opened for user user1 by (uid=0) -``` - -Yes, `user2` is allowed to login into the system because user2 is belongs to `2g-admin` group. - -``` -# ssh [email protected] -[email protected]'s password: -[[email protected] ~]$ -``` - -Output: - -``` -Mar 29 02:10:38 CentOS7 sshd[5225]: Accepted password for user2 from 192.168.1.6 port 42642 ssh2 -Mar 29 02:10:38 CentOS7 sshd[5225]: pam_unix(sshd:session): session opened for user user2 by (uid=0) -``` - -When you are try to login into the system with other users which are not part of this group then you will be getting an error message as shown below. - -``` -# ssh [email protected] -[email protected]'s password: -Permission denied, please try again. -``` - -Output: - -``` -Mar 29 02:12:36 CentOS7 sshd[5306]: User ladmin from 192.168.1.6 not allowed because none of user's groups are listed in AllowGroups -Mar 29 02:12:36 CentOS7 sshd[5306]: input_userauth_request: invalid user ladmin [preauth] -Mar 29 02:12:56 CentOS7 unix_chkpwd[5310]: password check failed for user (ladmin) -Mar 29 02:12:56 CentOS7 sshd[5306]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.1.6 user=ladmin -Mar 29 02:12:58 CentOS7 sshd[5306]: Failed password for invalid user ladmin from 192.168.1.6 port 42674 ssh2 -``` - -### How To Deny Group To Access SSH In Linux? - -We can deny/disable the ssh access for a particular group or groups using the following method. - -If you would like to disable more than one group then you need to add the group with space in the same line. - -To do so, just append the following value into `/etc/ssh/sshd_config` file. - -``` -# echo "DenyGroups 2g-admin" >> /etc/ssh/sshd_config -``` - -You can double check this by running the following command. - -``` -# # cat /etc/ssh/sshd_config | grep -i denygroups -DenyGroups 2g-admin - -# getent group 2g-admin -2g-admin:x:1005:user1,user2,user3 -``` - -That’s it. Just bounce the ssh service and see the magic. - -``` -# systemctl restart sshd - -# service restart sshd -``` - -Yes `user3` isn’t allowed to login into the system because it’s not part of `2g-admin` group. It’s in Denygroups. - -``` -# ssh [email protected] -[email protected]'s password: -Permission denied, please try again. -``` - -Output: - -``` -Mar 29 02:17:32 CentOS7 sshd[5400]: User user1 from 192.168.1.6 not allowed because a group is listed in DenyGroups -Mar 29 02:17:32 CentOS7 sshd[5400]: input_userauth_request: invalid user user1 [preauth] -Mar 29 02:17:38 CentOS7 unix_chkpwd[5402]: password check failed for user (user1) -Mar 29 02:17:38 CentOS7 sshd[5400]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.1.6 user=user1 -Mar 29 02:17:41 CentOS7 sshd[5400]: Failed password for invalid user user1 from 192.168.1.6 port 42710 ssh2 -``` - -Anyone can login into the system except `2g-admin` group. Hence, `ladmin` user is allowed to login into the system. - -``` -# ssh [email protected] -[email protected]'s password: -[[email protected] ~]$ -``` - -Output: - -``` -Mar 29 02:19:13 CentOS7 sshd[5432]: Accepted password for ladmin from 192.168.1.6 port 42716 ssh2 -Mar 29 02:19:13 CentOS7 sshd[5432]: pam_unix(sshd:session): session opened for user ladmin by (uid=0) -``` - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/allow-deny-enable-disable-ssh-access-user-group-in-linux/ - -作者:[2daygeek][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.2daygeek.com/author/2daygeek/ -[b]: https://github.com/lujun9972 -[1]: https://www.2daygeek.com/category/ssh-tutorials/ diff --git a/sources/tech/20190730 Using Python to explore Google-s Natural Language API.md b/sources/tech/20190730 Using Python to explore Google-s Natural Language API.md index 304fd79e0a..b5f8611a1c 100644 --- a/sources/tech/20190730 Using Python to explore Google-s Natural Language API.md +++ b/sources/tech/20190730 Using Python to explore Google-s Natural Language API.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (zhangxiangping) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -264,7 +264,7 @@ via: https://opensource.com/article/19/7/python-google-natural-language-api 作者:[JR Oakes][a] 选题:[lujun9972][b] -译者:[zhangxiangping](https://github.com/zhangxiangping) +译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/sources/tech/20190925 Debugging in Emacs- The Grand Unified Debugger.md b/sources/tech/20190925 Debugging in Emacs- The Grand Unified Debugger.md deleted file mode 100644 index b82a27dadc..0000000000 --- a/sources/tech/20190925 Debugging in Emacs- The Grand Unified Debugger.md +++ /dev/null @@ -1,97 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (cycoe) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Debugging in Emacs: The Grand Unified Debugger) -[#]: via: (https://opensourceforu.com/2019/09/debugging-in-emacs-the-grand-unified-debugger/) -[#]: author: (Vineeth Kartha https://opensourceforu.com/author/vineeth-kartha/) - -Debugging in Emacs: The Grand Unified Debugger -====== - -[![][1]][2] - -_This article briefly explores the features of the Grand Unified Debugger, a debugging tool for Emacs._ - -If you are a C/C++ developer, it is highly likely that you have crossed paths with GDB (the GNU debugger) which is, without doubt, one of the most powerful and unrivalled debuggers out there. Its only drawback is that it is command line based, and though that offers a lot of power, it is sometimes a bit restrictive as well. This is why smart people started coming up with IDEs to integrate editors and debuggers, and give them a GUI. There are still developers who believe that using the mouse reduces productivity and that mouse-click based GUIs are temptations by the devil. -Since Emacs is one of the coolest text editors out there, I am going to show you how to write, compile and debug code without having to touch the mouse or move out of Emacs. - -![Figure 1: Compile command in Emacs’ mini buffer][3] - -![Figure 2: Compilation status][4] - -The Grand Unified Debugger, or GUD as it is commonly known, is an Emacs mode in which GDB can be run from within Emacs. This provides all the features of Emacs in GDB. The user does not have to move out of the editor to debug the code written. - -**Setting the stage for the Grand Unified Debugger** -If you are using a Linux machine, then it is likely you will have GDB and gcc already installed. The next step is to ensure that Emacs is also installed. I am assuming that the readers are familiar with GDB and have used it at least for basic debugging. If not, please do check out some quick introductions to GDB that are widely available on the Internet. - -For people who are new to Emacs, let me introduce you to some basic terminology. Throughout this article, you will see shortcut commands such as C-c, M-x, etc. C means the Ctrl key and M means the Alt key. C-c means the Ctrl + c keys are pressed. If you see C-c c, it means Ctrl + c is pressed followed by c. Also, in Emacs, the main area where you edit the text is called the main buffer, and the area at the bottom of the Emacs window, where commands are entered, is called the mini buffer. -Start Emacs and to create a new file, press _C-x C-f_. This will prompt you to enter a file name. Let us call our file ‘buggyFactorial.cpp’. Once the file is open, type in the code shown below: - -``` -#include -#include -int factorial(int num) { -int product = 1; -while(num--) { -product *= num; -} -return product; -} -int main() { -int result = factorial(5); -assert(result == 120); -} -``` - -Save the file with _C-x C-s_. Once the file is saved, it’s time to compile the code. Press _M-x_ and in the prompt that comes up, type in compile and hit Enter. Then, in the prompt, replace whatever is there with _g++ -g buggyFactorial.cpp_ and again hit _Enter_. - -This will open up another buffer in Emacs that will show the status of the compile and, hopefully, if the code typed in is correct, you will get a buffer like the one shown in Figure 2. - -To hide this compilation status buffer, make sure your cursor is in the compilation buffer (you can do this without the mouse using _C-x o_-this is used to move the cursor from one open buffer to the other), and then press _C-x 0_. The next step is to run the code and see if it works fine. Press M-! and in the mini buffer prompt, type _./a.out._ - -See the mini buffer that says the assertion is failed. Clearly, something is wrong with the code, because the factorial (5) is 120. So let’s debug the code now. - -![Figure 3: Output of the code in the mini buffer][5] - -![Figure 4: The GDB buffer in Emacs][6] - -**Debugging the code using GUD** -Now, since we have the code compiled, it’s time to see what is wrong with it. Press M-x and in the prompt, enter _gdb._ In the next prompt that appears, write _gdb -i=mi a.out_, which will start GDB in the Emacs buffer and if everything goes well, you should get the window that’s shown in Figure 4. -At the gdb prompt, type break main and then r to run the program. This should start running the program and should break at the _main()_. - -As soon as GDB hits the break point at main, a new buffer will open up showing the code that you are debugging. Notice the red dot on the left side, which is where your breakpoint was set. There will be a small indicator that shows which line of the code you are on. Currently, this will be the same as the break point itself (Figure 5). - -![Figure 5: GDB and the code in split windows][7] - -![Figure 6: Show the local variables in a separate frame in Emacs][8] - -To debug the factorial function, we need to step into it. For this, you can either use the _gdb_ prompt and the gdb command step, or you can use the Emacs shortcut _C-c C-s_. There are other similar shortcuts, but I prefer using the GDB commands. So I will use them in the rest of this article. -Let us keep an eye on the local variables while stepping through the factorial number. Check out Figure 6 for how to get an Emacs frame to show the local variables. - -Step through the code in the GDB prompt and watch the value of the local variable change. In the first iteration of the loop itself, we see a problem. The value of the product should have been 5 and not 4. - -This is where I leave you and now it’s up to the readers to explore and discover the magic land called GUD mode. Every gdb command works in the GUD mode as well. I leave the fix to this code as an exercise to readers. Explore and see how you can customise things to make your workflow simpler and become more productive while debugging. - --------------------------------------------------------------------------------- - -via: https://opensourceforu.com/2019/09/debugging-in-emacs-the-grand-unified-debugger/ - -作者:[Vineeth Kartha][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://opensourceforu.com/author/vineeth-kartha/ -[b]: https://github.com/lujun9972 -[1]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Screenshot-from-2019-09-25-15-39-46.png?resize=696%2C440&ssl=1 (Screenshot from 2019-09-25 15-39-46) -[2]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Screenshot-from-2019-09-25-15-39-46.png?fit=800%2C506&ssl=1 -[3]: https://i1.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure_1.png?resize=350%2C228&ssl=1 -[4]: https://i2.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure_2.png?resize=350%2C228&ssl=1 -[5]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure_3.png?resize=350%2C228&ssl=1 -[6]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure_4.png?resize=350%2C227&ssl=1 -[7]: https://i1.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure_5.png?resize=350%2C200&ssl=1 -[8]: https://i1.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure_6.png?resize=350%2C286&ssl=1 diff --git a/sources/tech/20191126 Calculator N- is an open source scientific calculator for your smartphone.md b/sources/tech/20191126 Calculator N- is an open source scientific calculator for your smartphone.md deleted file mode 100644 index b69120beaa..0000000000 --- a/sources/tech/20191126 Calculator N- is an open source scientific calculator for your smartphone.md +++ /dev/null @@ -1,61 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Calculator N+ is an open source scientific calculator for your smartphone) -[#]: via: (https://opensource.com/article/19/11/calculator-n-mobile) -[#]: author: (Ricardo Berlasso https://opensource.com/users/rgb-es) - -Calculator N+ is an open source scientific calculator for your smartphone -====== -The Android app does a wide range of advanced mathematical functions in -the palm of your hand. -![scientific calculator][1] - -Mobile phones are becoming more powerful every day, so it is no surprise that they can beat most computers from the not-so-distant past. This also means the tools available on them are getting more powerful every day. - -Previously, I wrote about [scientific calculators for the Linux desktop][2], and I'm following that up here with information about [Calculator N+][3], an awesome GPL v3.0-licensed computer algebra system (CAS) app for Android devices. - -Calculator N+ is presented as a "powerful calculator for Android," but that's a humble statement; the app not only works with arbitrary precision, displaying results with roots and fractions in all their glory, it does a _lot_ more. - -Finding polynomial roots? Check. Factorization? Check. Symbolic derivatives, integrals, and limits? Check. Number theory (modular arithmetic, combinatorics, prime factorization)? Check. - -You can also solve systems of equations, simplify expressions (including trigonometric ones), convert units… you name it! - -![Calculator N+ graphical interface][4] - -Results are output in LaTeX. The menu in the top-left provides many powerful functions ready to use with a simple touch. Also in that menu, you'll find Help files for all of the app's functions. At the top-right of the screen, you can toggle between exact and decimal representation. Finally, tapping the blue bar at the bottom of the screen gives you access to the whole library of functions available in the app. But be careful! If you are not a mathematician, physicist, or engineer, such a long list may seem overwhelming. - -All of this power comes from the [Symja library][5], another great GPL 3 project. - -Both projects are under active development, and they are getting better with each version. In particular, version 3.4.6 of Calculator N+ gets a major leap in user interface (UI) quality. And yes, there are still some rough corners here and there, but taming this much power in the tiny UI of a smartphone is a difficult task, and I think the app developers are solving its remaining issues quite well. Kudos to them! - -If you are a teacher, a student, or work on a STEM field, check out Calculator N+. It's free, no ads, open source, and covers all your math needs. (Except, of course, during math exams, where smartphones should never be allowed to prevent cheating.) - -Calculator N+ is available in the [Google Play Store][6], or you can [build it from source code][7] using the instructions on the GitHub page. - -If you know any other useful open source apps for science or engineering, let us know in the comments. - -The app makes use of the sensors on your phone and offers a digital science notebook to record your... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/11/calculator-n-mobile - -作者:[Ricardo Berlasso][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/rgb-es -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/calculator_money_currency_financial_tool.jpg?itok=2QMa1y8c (scientific calculator) -[2]: https://opensource.com/article/18/1/scientific-calculators-linux -[3]: https://github.com/tranleduy2000/ncalc -[4]: https://opensource.com/sites/default/files/uploads/calculatornplus_sqrt-frac.png (Calculator N+ graphical interface) -[5]: https://github.com/axkr/symja_android_library -[6]: https://play.google.com/store/apps/details?id=com.duy.calculator.free -[7]: https://github.com/tranleduy2000/ncalc/blob/master/README.md diff --git a/sources/tech/20191223 10 articles to learn Linux your way.md b/sources/tech/20191223 10 articles to learn Linux your way.md deleted file mode 100644 index 0ef668ad28..0000000000 --- a/sources/tech/20191223 10 articles to learn Linux your way.md +++ /dev/null @@ -1,96 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (10 articles to learn Linux your way) -[#]: via: (https://opensource.com/article/19/12/learn-linux) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -10 articles to learn Linux your way -====== -It's been a good year for Linux, so take a look back at the top 10 Linux -articles on Opensource.com from 2019. -![Penguins gathered together in the Artic][1] - -The year 2019 has been good for Linux with Opensource.com readers. Obviously, the term "Linux" itself is weighted: Does it refer to the kernel or the desktop or the ecosystem? In this look back at the top Linux articles of the year, I've intentionally taken a broad view in defining the top 10 Linux articles (for some definition of "top" and some definition of "Linux"). Here they are, offered in no particular order. - -### A beginner's guide to Linux permissions - -[_A beginner's guide to Linux permissions_][2] by Bryant Son introduces new users to the concept of file permissions with graphics and charts to illustrate each point. It can be hard to come up with visuals for concepts that are, at their core, purely text-based, and this article is friendly for the visual learners out there. I also like how Bryant stays focused. Any discussion of file permissions can lead to several related topics (like ownership and access control lists and so on), but this article is dedicated to explaining one thing and explaining it well. - -### Why I made the switch from Mac to Linux - -Matthew Broberg offers an insightful and honest look at his migration to Linux from MacOS in [_Why I made the switch from Mac to Linux_][3]. Changing platforms is always tough, and it's important to record what's behind the decision to switch. Matt's article, I think, serves several purposes, but the two most important for me: it's an invitation for the Linux community to support him by answering questions and offering potential solutions, and it's a good data point for others who are considering Linux adoption. - -### Troubleshooting slow WiFi on Linux - -In [_Troubleshooting slow WiFi on Linux_][4], David Clinton provides a useful analysis of a problem everyone has on every platform—and has tips on how to solve it. It's a good example of an "incidentally Linux" tip that not only helps everyday people with everyday problems but also shows non-Linux users how approachable troubleshooting (on any platform) is. - -### How GNOME uses Git - -[_How GNOME uses Git_][5] by Molly de Blanc takes a look behind the scenes, revealing how one of the paragons of open source software (the GNOME desktop) uses one of the other paragons of open source (Git) for development. It's always heartening to me to hear about an open source project that defaults to an open source solution for whatever needs to be done. Believe it or not, this isn't always the case, but for GNOME, it's an important and welcoming part of the project's identity. - -### Virtual filesystems in Linux: Why we need them and how they work - -Alison Chaiken masterfully explains what is considered incomprehensible to many users in [_Virtual filesystems in Linux: Why we need them and how they work_][6]. Understanding what a filesystem is and what it does is one thing, but _virtual_ ones aren't even, by definition, real. And yet Linux delivers them in a way that even casual users can benefit from, and Alison's article explains it in a way that anyone can understand. As a bonus, Alison goes even deeper in the second half of the article and demonstrates how to use bcc scripts to monitor everything she just taught you. - -### Understanding file paths and how to use them - -I thought [_Understanding file paths and how to use them_][7] was important to write about because it's a concept most users (on any platform) don't seem to be taught. It's a strange phenomenon, because now, more than ever, the _file path_ is something people see literally on a daily basis: Nearly all internet URLs contain a file path telling you exactly where within the domain you are. I often wonder why computer education doesn't start with the internet, the most familiar app of all and arguably the most heavily used supercomputer in existence, and use it to explain the appliances we interface with each day. (I guess it would help if those appliances were running Linux, but we're working on that.) - -### Inter-process communication in Linux - -[_Inter-process communication in Linux: Shared storage_][8] by Marty Kalin delves into the developer side of Linux, explaining IPC and how to interact with it in your code. I'm cheating by including this article because it's actually a three-part series, but it's the best explanation of its kind. There is very little documentation that manages to explain how Linux handles IPC, much less what IPC is, why it's important, or how to take advantage of it when programming. It's normally a topic you work your way up to in university. Now you can read all about it here instead. - -### Understanding system calls on Linux with strace - -[_Understanding system calls on Linux with strace_][9] by Gaurav Kamathe is highly technical in ways I wish that every conference talk I've ever seen about **strace** was. This is a clear and helpful demonstration of a complex but amazingly useful command. To my surprise, the command I've found myself using since this article isn't the titular command, but **ltrace** (to see which functions are called by a command). Obviously, this article's packed with information and is a handy reference for developers and QA testers. - -### How the Linux desktop has grown - -[_How the Linux desktop has grown_][10] by Jim Hall is a visual journey through the history of the Linux desktop. It starts with [TWM][11] and passes by [FVWM][12], [GNOME][13], [KDE][14], and others. If you're new to Linux, this is a fascinating history lesson from someone who was there (and has the screenshots to prove it). If you've been with Linux for many years, then this will definitely bring back memories. In the end, though, one thing is certain: Anyone who can still locate screenshots from 20 years ago is a superhuman data archivist. - -### Create your own video streaming server with Linux - -[_Create your own video streaming server with Linux_][15] by Aaron J. Prisk breaks down more than just a few preconceptions most of us have about the services we take for granted. Because services like YouTube and Twitch exist, many people assume that those are the only gateways to broadcasting video to the world. Of course, people used to think that Windows and Mac were the only gateways into computing, and that, thankfully, turned out to be a gross miscalculation. In this article, Aaron sets up a video-streaming server and even manages to find space to talk about [OBS][16] in so you can create videos to stream. Is it a fun weekend project or the start of a new career? You decide. - -### 10 moments that shaped Linux history - -[_10 moments that shaped Linux history_][17] by Alan Formy-Duval attempts the formidable task of choosing just 10 things to highlight in the history of Linux. It's an exercise in futility, of course, because there have been so many important moments, so I love how Alan filters it through his own experience. For example, when was it obvious that Linux was going to last? When Alan realized that all the systems he maintained at work were running Linux. There's a beauty to interpreting history this way because the moments of importance will differ for each person. There's no definitive list for Linux, or articles about Linux, or for open source. You make your own list, and you make yourself a part of it. - -### What do you want to learn? - -What else do you want to know about Linux? Please tell us about it in the comments, or [write an article][18] for Opensource.com about your experience with Linux. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/learn-linux - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_Penguin_Image_520x292_12324207_0714_mm_v1a.png?itok=p7cWyQv9 (Penguins gathered together in the Artic) -[2]: https://opensource.com/article/19/6/understanding-linux-permissions -[3]: https://opensource.com/article/19/10/why-switch-mac-linux -[4]: http://opensource.com/article/19/4/troubleshooting-wifi-linux -[5]: https://opensource.com/article/19/10/how-gnome-uses-git -[6]: https://opensource.com/article/19/3/virtual-filesystems-linux -[7]: https://opensource.com/article/19/8/understanding-file-paths-linux -[8]: https://opensource.com/article/19/4/interprocess-communication-linux-storage -[9]: https://opensource.com/article/19/2/linux-backup-solutions -[10]: https://opensource.com/article/19/8/how-linux-desktop-grown -[11]: https://github.com/freedesktop/twm -[12]: http://www.fvwm.org/ -[13]: http://gnome.org -[14]: http://kde.org -[15]: https://opensource.com/article/19/1/basic-live-video-streaming-server -[16]: https://opensource.com/life/15/12/real-time-linux-video-editing-with-obs-studio -[17]: https://opensource.com/article/19/4/top-moments-linux-history -[18]: https://opensource.com/how-submit-article diff --git a/sources/tech/20191223 Prioritizing simplicity in your Python code.md b/sources/tech/20191223 Prioritizing simplicity in your Python code.md deleted file mode 100644 index 53662a8f1c..0000000000 --- a/sources/tech/20191223 Prioritizing simplicity in your Python code.md +++ /dev/null @@ -1,59 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Prioritizing simplicity in your Python code) -[#]: via: (https://opensource.com/article/19/12/zen-python-simplicity-complexity) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) - -Prioritizing simplicity in your Python code -====== -This is the second part of a special series about the Zen of Python -focusing on the third and fourth principles: simplicity and complexity. -![Person reading a book and digital copy][1] - -> "Il semble que la perfection soit atteinte non quand il n'y a plus rien à ajouter, mais quand il n'y plus rien à retrancher." -> -> "It seems that perfection is finally attained not when there is no longer anything to add, but when there is no longer anything to take away." -> —Antoine de Saint-Exupéry, _[Terre des Hommes][2]_, 1939 - -A common concern in programming is the struggle with complexity. It is easy for any programmer to make a program so complicated no expert can debug it or modify it. The [Zen of Python][3] would not be complete if it did not touch on this. - -### Simple is better than complex. - -When it is possible to choose at all, choose the simple solution. Python is rarely in the business of _disallowing_ things. This means it is possible, and even straightforward, to design baroque programs to solve straightforward problems. - -It is worthwhile to remember at each point that simplicity is one of the easiest things to lose and the hardest to regain when writing code. - -This can mean choosing to write something as a function, rather than introducing an extraneous class. This can mean avoiding a robust third-party library in favor of writing a two-line function that is perfect for the immediate use-case. Most often, it means avoiding predicting the future in favor of solving the problem at hand. - -It is much easier to change the program later, especially if simplicity and beauty were among its guiding principles than to load the code down with all possible future variations. - -### Complex is better than complicated. - -This is possibly the most misunderstood principle because understanding the precise meanings of the words is crucial. Something is _complex_ when it is composed of multiple parts. Something is _complicated_ when it has a lot of different, often hard to predict, behaviors. - -When solving a hard problem, it is often the case that no simple solution will do. In that case, the most Pythonic strategy is to go "bottom-up." Build simple tools and combine them to solve the problem. - -This is where techniques like _object composition_ shine. Instead of having a complicated inheritance hierarchy, have objects that forward some method calls to a separate object. Each of those can be tested and developed separately and then finally put together. - -Another example of "building up" is using [singledispatch][4], so that instead of one complicated object, we have a simple, mostly behavior-less object and separate behaviors. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/zen-python-simplicity-complexity - -作者:[Moshe Zadka][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/moshez -[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://en.wikipedia.org/wiki/Wind,_Sand_and_Stars -[3]: https://www.python.org/dev/peps/pep-0020/ -[4]: https://opensource.com/article/19/5/python-singledispatch diff --git a/sources/tech/20191224 Why your Python code should be flat and sparse.md b/sources/tech/20191224 Why your Python code should be flat and sparse.md deleted file mode 100644 index 0e447c5d8e..0000000000 --- a/sources/tech/20191224 Why your Python code should be flat and sparse.md +++ /dev/null @@ -1,87 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: 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) - -Why your Python code should be flat and sparse -====== -This is part of a special series about the Zen of Python focusing on the -fifth and sixth principles: flatness and sparseness. -![Digital creative of a browser on the internet][1] - -The [Zen of Python][2] is called that for a reason. It was never supposed to provide easy-to-follow guidelines for programming. The rules are specified tersely and are designed to engage the reader in deep thought. - -In order to properly appreciate the Zen of Python, you must read it and then meditate upon the meanings. If the Zen was designed to be a set of clear rules, it would be a fault that it has rules that contradict each other. However, as a tool to help you meditate on the best solution, contradictions are powerful. - -### Flat is better than nested. - -Nowhere is the pressure to be "flat" more obvious than in Python's strong insistence on indentation. Other languages will often introduce an implementation that "cheats" on the nested structure by reducing indentation requirements. To appreciate this point, let's take a look at JavaScript. - -JavaScript is natively async, which means that programmers write code in JavaScript using a lot of callbacks. - - -``` -a(function(resultsFromA) { -  b(resultsFromA, function(resultsfromB) { -    c(resultsFromC, function(resultsFromC) { -      console.log(resultsFromC) -   } -  } -} -``` - -Ignoring the code, observe the pattern and the way indentation leads to a right-most point. This distinctive "arrow" shape is tough on the eye to quickly walk through the code, so it's seen as undesirable and even nicknamed "callback hell." However, in JavaScript, it is possible to "cheat" and not have indentation reflect nesting. - - -``` -a(function(resultsFromA) { -b(resultsFromA, -  function(resultsfromB) { -c(resultsFromC, -  function(resultsFromC) { -    console.log(resultsFromC) -}}} -``` - -Python affords no such options to cheat: every nesting level in the program must be reflected in the indentation level. So deep nesting in Python _looks_ deeply nested. That makes "callback hell" was a worse problem in Python than in JavaScript: nesting callbacks mean indenting with no options to "cheat" with braces. - -This challenge, in combination with the Zen principle, has led to an elegant solution by a library I worked on. In the [Twisted][3] framework, we came up with the _deferred_ abstraction, which would later inspire the popular JavaScript _promise_ abstraction. In this way, Python's unwavering commitment to clear code forces Python developers to discover new, powerful abstractions. - - -``` -future_value = future_result() -future_value.addCallback(a) -future_value.addCallback(b) -future_value.addCallback(c) -``` - -(This might look familiar to modern JavaScript programmers: Promises were heavily influenced by Twisted's deferreds.) - -### Sparse is better than dense. - -The easiest way to make something less dense is to introduce nesting. This habit is why the principle of sparseness follows the previous one: after we have reduced nesting as much as possible, we are often left with _dense_ code or data structures. Density, in this sense, is jamming too much information into a small amount of code, making it difficult to decipher when something goes wrong. - -Reducing that denseness requires creative thinking, and there are no simple solutions. The Zen of Python does not offer simple solutions. All it offers are ways to find what can be improved in the code, without always giving guidance for "how." - -Take a walk. Take a shower. Smell the flowers. Sit in a lotus position and think hard, until finally, inspiration strikes. When you are finally enlightened, it is time to write the code. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/zen-python-flat-sparse - -作者:[Moshe Zadka][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/moshez -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) -[2]: https://www.python.org/dev/peps/pep-0020/ -[3]: https://twistedmatrix.com/trac/ diff --git a/sources/tech/20191226 10 Linux command tutorials for beginners and experts.md b/sources/tech/20191226 10 Linux command tutorials for beginners and experts.md deleted file mode 100644 index 3172f26ea1..0000000000 --- a/sources/tech/20191226 10 Linux command tutorials for beginners and experts.md +++ /dev/null @@ -1,86 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (10 Linux command tutorials for beginners and experts) -[#]: via: (https://opensource.com/article/19/12/linux-commands) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) - -10 Linux command tutorials for beginners and experts -====== -Learn how to make Linux do what you need it to do in Opensource.com's -top 10 articles about Linux commands from 2019. -![Penguin driving a car with a yellow background][1] - -Using Linux _well_ means understanding what commands are available and what they're capable of doing for you. We have covered a lot of them on Opensource.com during 2019, and here are 10 favorites from the bunch. - -### Using the force at the Linux command line - -The Force has a light side and a dark side. Properly understanding that is crucial to true mastery. In his article [_Using the force at the Linux command line_][2], Alan Formy-Duval explains the **-f** option (also known as **\--force**) for several popular and sometimes dangerous commands. - -### Intro to the Linux useradd command - -Sharing accounts is a bad idea. Instead, give separate accounts to different people (and even different roles) with the quintessential **useradd** command. Part of his venerable series on basic Linux administration, Alan Formy-Duval provides an [_Intro to the Linux useradd command_][3], and, as usual, he explains it in _plain English_ so that both new and experienced admins can understand it. - -### Linux commands to display your hardware information - -What's _inside_ the box? Sometimes it's useful to inspect your hardware without using a screwdriver. In [_Linux commands to display your hardware information_][4], Howard Fosdick provides both popular and obscure commands to help you dig deep into the computer you're using, the computer you're testing at the store before buying, or the computer you're trying to repair. - -### How to encrypt files with gocryptfs on Linux - -Our files hold lots of private data, from social security numbers to personal letters to loved ones. In [_How to encrypt files with gocryptfs on Linux_][5], Brian "Bex" Exelbierd explains how to keep *private *what's meant to be private. As a bonus, he demonstrates encrypting files in a way that has little to no impact on your existing workflow. This isn't a complex PGP-style puzzle of key management and background key agents; this is quick, seamless, and secure file encryption. - -### How to use advanced rsync for large Linux backups - -In the New Year, many people will resolve to be more diligent about making backups. Alan Formy-Duval must have made that resolution years ago, because in [_How to use advanced rsync for large Linux backups_][6], he displays remarkable familiarity with the file synchronization command. You might not remember all the syntax right away, but the idea is to read and process the options, construct your backup command, and then automate it. That's the smart way to use **rsync**, and it's the _only_ way to do backups reliably. - -### Using more to view text files at the Linux command line - -In Scott Nesbitt's article [_Using more to view text files at the Linux command line_][7], the good old default pager **more** finally gets the spotlight. Many people install and use **less**, because it's more flexible than **more**. However, with more and more systems being implemented in the sparsest of containers, the luxury of fancy new tools like **less** or **most** sometimes just doesn't exist. Knowing and using **more** is simple, it's a common default, and it's the production system's debugging tool of last resort. - -### What you probably didn't know about sudo - -The **sudo** command is famous to a fault. People know the **sudo** term, and most of us believe we know what it does. And we're a little bit correct, but as Peter Czanik reveals in his article [_What you probably didn't know about sudo_][8], there's a lot more to the command than just "Simon says." Like that classic childhood game, the **sudo** command is powerful and also prone to silly mistakes—only with greater potential for horrible consequences. This is one game you do not want to lose! - -### How to program with Bash: Syntax and tools - -If you're a Linux, BSD, or Mac (and lately, Windows) user, you may have used the Bash shell interactively. It's a great shell for quick, one-off commands, which is why so many Linux users love to use it as their primary user interface. However, Bash is much more than just a command prompt. It's also a programming language, and if you're already using Bash commands, then the path to automation has never been more straightforward. Learn all about it in David Both's excellent [_How to program with Bash: Syntax and tools_][9]. - -### Master the Linux ls command - -The **ls** command is one of those commands that merits a two-letter name; one-letter commands are an optimization for slow terminals where each letter causes a significant delay and also a nice bonus for lazy typists. Seth Kenlon explains how you can [_Master the Linux ls command_][10] and he does so with his usual clarity and pragmatism. Most significantly, in a system where "everything is a file," being able to list the files is crucial. - -### Getting started with the Linux cat command - -The **cat** command (short for con_cat_enate) is deceptively simple. Whether you use it to quickly see the contents of a file or to pipe the contents to another command, you may not be using **cat** to its full potential. Alan Formy-Duval's elucidating [_Getting started with the Linux cat command_][11] offers new ideas to take advantage of a command that lets you open a file without feeling like you've opened it. As a bonus, learn all about **zcat** so you can decompress files without all the trouble of decompression! It's a small and simple thing, but _this_ is what makes Linux great. - -### Continue the journey - -Don't let Opensource.com's 10 best articles about Linux commands of 2019 be the end of your journey. There's much more to discover about Linux and its versatile prompt, so stay tuned in 2020 for more insights. And, if there's a Linux command you want us to know about, please tell us about it in the comments, or share your knowledge with Opensource.com readers by [submitting an article][12] about your favorite Linux command. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/linux-commands - -作者:[Moshe Zadka][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/moshez -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/car-penguin-drive-linux-yellow.png?itok=twWGlYAc (Penguin driving a car with a yellow background) -[2]: https://opensource.com/article/19/5/may-the-force-linux -[3]: https://opensource.com/article/19/10/linux-useradd-command -[4]: https://opensource.com/article/19/9/linux-commands-hardware-information -[5]: https://opensource.com/article/19/8/how-encrypt-files-gocryptfs -[6]: https://opensource.com/article/19/5/advanced-rsync -[7]: https://opensource.com/article/19/1/more-text-files-linux -[8]: https://opensource.com/article/19/10/know-about-sudo -[9]: https://opensource.com/article/19/10/programming-bash-syntax-tools -[10]: https://opensource.com/article/19/7/master-ls-command -[11]: https://opensource.com/article/19/2/getting-started-cat-command -[12]: https://opensource.com/how-submit-article diff --git a/sources/tech/20200204 DevOps vs Agile- What-s the difference.md b/sources/tech/20200204 DevOps vs Agile- What-s the difference.md deleted file mode 100644 index d83e9c17f7..0000000000 --- a/sources/tech/20200204 DevOps vs Agile- What-s the difference.md +++ /dev/null @@ -1,170 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (messon007) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (DevOps vs Agile: What's the difference?) -[#]: via: (https://opensource.com/article/20/2/devops-vs-agile) -[#]: author: (Taz Brown https://opensource.com/users/heronthecli) - -DevOps vs Agile: What's the difference? -====== -The difference between the two is what happens after development. -![Pair programming][1] - -Early on, software development didn't really fit under a particular management umbrella. Then along came [waterfall][2], which spoke to the idea that software development could be defined by the length of time an application took to create or build. - -Back then, it often took long periods of time to create, test, and deploy software because there were no checks and balances during the development process. The results were poor software quality with defects and bugs and unmet timelines. The focus was on long, drawn-out plans for software projects. - -Waterfall projects have been associated with the [triple constraint][3] model, which is also called the project management triangle. Each side of the triangle represents a component of the triple constraints of project management: **scope**, **time**, and **cost**. As [Angelo Baretta writes][4], the triple constraint model "says that cost is a function of time and scope, that these three factors are related in a defined and predictable way… [I]f we want to shorten the schedule (time), we must increase cost. It says that if we want to increase scope, we must increase cost or schedule." - -### Transitioning from waterfall to agile - -Waterfall came from manufacturing and engineering, where a linear process makes sense; you build the wall before you build the roof. Similarly, software development problems were viewed as something that could be solved with planning. From beginning to end, the development process was clearly defined by a roadmap that would lead to the final delivery of a product. - -Eventually, waterfall was recognized as detrimental and counterintuitive to software development because, often, the value could not be determined until the very end of the project cycle, and in many cases, the projects failed. Also, the customer didn't get to see any working software until the end of the project. - -Agile takes a different approach that moves away from planning the entire project, committing to estimated dates, and being accountable to a plan. Rather, agile assumes and embraces uncertainty. It is built around the idea of responding to change instead of charging past it or ignoring the need for it. Instead, change is considered as a way to fulfill the needs of the customer. - -### Agile values - -Agile is governed by the Agile Manifesto, which defines [12 principles][5]: - - 1. Satisfying the customer is the top priority - 2. Welcome changing requirements, even late in development - 3. Deliver working software frequently - 4. Development and business must work together - 5. Build projects around motivated people - 6. Face-to-face communication is the most efficient and effective method of conveying information - 7. The primary measure of success is working software - 8. Agile processes promote sustainable development - 9. Maintain continuous attention to technical excellence and good design - 10. Simplicity is essential - 11. The best architectures, requirements, and designs emerge from self-organizing teams - 12. Regularly reflect on work, then tune and adjust behavior - - - -Agile's four [core values][6] are: - - * **Individuals and interactions** over processes and tools - * **Working software** over comprehensive documentation - * **Customer collaboration** over contract negotiation - * **Responding to change** over following a plan - - - -This contrasts with waterfall's rigid planning style. In agile, the customer is a member of the development team rather than engaging only at the beginning, when setting business requirements, and at the end, when reviewing the final product (as in waterfall). The customer helps the team write the [acceptance criteria][7] and remains engaged throughout the process. In addition, agile requires changes and continuous improvement throughout the organization. The development team works with other teams, including the project management office and the testers. What gets done and when are led by a designated role and agreed to by the team as a whole. - -### Agile software development - -Agile software development requires adaptive planning, evolutionary development, and delivery. Many software development methodologies, frameworks, and practices fall under the umbrella of being agile, including: - - * Scrum - * Kanban (visual workflow) - * XP (eXtreme Programming) - * Lean - * DevOps - * Feature-driven development (FDD) - * Test-driven development (TDD) - * Crystal - * Dynamic systems development method (DSDM) - * Adaptive software development (ASD) - - - -All of these have been used on their own or in combination for developing and deploying software. The most common are [scrum, kanban][8] (or the combination called scrumban), and DevOps. - -[Scrum][9] is a framework under which a team, generally consisting of a scrum master, product owner, and developers, operates cross-functionally and in a self-directed manner to increase the speed of software delivery and - -to bring greater business value to the customer. The focus is on faster iterations with smaller [increments][10]. - -[Kanban][11] is an agile framework, sometimes called a workflow management system, that helps teams visualize their work and maximize efficiency (thus being agile). Kanban is usually represented by a digital or physical board. A team's work moves across the board, for example, from not started, to in progress, testing, and finished, as it progresses. Kanban allows each team member to see the state of all work at any time. - -### DevOps values - -DevOps is a culture, a state of mind, a way that software development or infrastructure is, and a way that software and applications are built and deployed. There is no wall between development and operations; they work simultaneously and without silos. - -DevOps is based on two other practice areas: lean and agile. DevOps is not a title or role within a company; it's really a commitment that an organization or team makes to continuous delivery, deployment, and integration. According to [Gene Kim][12], author of _The Phoenix Project_ and _The Unicorn Project_, there are three "ways" that define the principles of DevOps: - - * The First Way: Principles of flow - * The Second Way: Principles of feedback - * The Third Way: Principles of continuous learning - - - -### DevOps software development - -DevOps does not happen in a vacuum; it is a flexible practice that, in its truest form, is a shared culture and mindset around software development and IT or infrastructure implementation. - -When you think of automation, cloud, microservices, you think of DevOps. In an [interview][13], _Accelerate: Building and Scaling High Performing Technology Organizations_ authors Nicole Forsgren, Jez Humble, and Gene Kim explained: - -> * Software delivery performance matters, and it has a significant impact on organizational outcomes such as profitability, market share, quality, customer satisfaction, and achieving organizational and mission goals. -> * High performers achieve levels of throughput, stability, and quality; they're not trading off to achieve these attributes. -> * You can improve your performance by implementing practices from the lean, agile, and DevOps playbooks. -> * Implementing these practices and capabilities also has an impact on your organizational culture, which in turn has an impact on both your software delivery performance and organizational performance. -> * There's still lots of work to do to understand how to improve performance. -> - - -### DevOps vs. agile - -Despite their similarities, DevOps and agile are not the same, and some argue that DevOps is better than agile. To eliminate the confusion, it's important to get down to the nuts and bolts. - -#### Similarities - - * Both are software development methodologies; there is no disputing this. - * Agile has been around for over 20 years, and DevOps came into the picture fairly recently. - * Both believe in fast software development, and their principles are based on how fast software can be developed without causing harm to the customer or operations. - - - -#### Differences - - * **The difference between the two** is what happens after development. - * Software development, testing, and deployment happen in both DevOps and agile. However, pure agile tends to stop after these three stages. In contrast, DevOps includes operations, which happen continually. Therefore, monitoring and software development are also continuous. - * In agile, separate people are responsible for developing, testing, and deploying the software. In DevOps, the DevOps engineering role is are responsible for everything; development is operations, and operations is development. - * DevOps is more associated with cost-cutting, and agile is more synonymous with lean and reducing waste, and concepts like agile project accounting and minimum viable product (MVP) are relevant. - * Agile focuses on and embodies empiricism (**adaptation**, **transparency**, and **inspection**) instead of predictive measures. - -Agile | DevOps ----|--- -Feedback from customer | Feedback from self -Smaller release cycles | Smaller release cycles, immediate feedback -Focus on speed | Focus on speed and automation -Not the best for business | Best for business - -### Wrapping up - -Agile and DevOps are distinct, although their similarities lead people to think they are one and the same. This does both agile and DevOps a disservice. - -In my experience as an agilist, I have found it valuable for organizations and teams to understand—from a high level—what agile and DevOps are and how they aid teams in working faster and more efficiently, delivering quality faster, and improving customer satisfaction. - -Agile and DevOps are not adversarial in any way (or at least the intent is not there). They are more allies than enemies in the agile revolution. Agile and DevOps can operate exclusively and inclusively, which allows both to exist in the same space. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/devops-vs-agile - -作者:[Taz Brown][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/heronthecli -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/collab-team-pair-programming-code-keyboard.png?itok=kBeRTFL1 (Pair programming) -[2]: http://www.agilenutshell.com/agile_vs_waterfall -[3]: https://en.wikipedia.org/wiki/Project_management_triangle -[4]: https://www.pmi.org/learning/library/triple-constraint-erroneous-useless-value-8024 -[5]: https://agilemanifesto.org/principles.html -[6]: https://agilemanifesto.org/ -[7]: https://www.productplan.com/glossary/acceptance-criteria/ -[8]: https://opensource.com/article/19/8/scrum-vs-kanban -[9]: https://www.scrum.org/ -[10]: https://www.scrum.org/resources/what-is-an-increment -[11]: https://www.atlassian.com/agile/kanban -[12]: https://itrevolution.com/the-unicorn-project/ -[13]: https://www.infoq.com/articles/book-review-accelerate/ diff --git a/sources/tech/20200211 Basic kubectl and Helm commands for beginners.md b/sources/tech/20200211 Basic kubectl and Helm commands for beginners.md deleted file mode 100644 index 318fd943f8..0000000000 --- a/sources/tech/20200211 Basic kubectl and Helm commands for beginners.md +++ /dev/null @@ -1,211 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Basic kubectl and Helm commands for beginners) -[#]: via: (https://opensource.com/article/20/2/kubectl-helm-commands) -[#]: author: (Jessica Cherry https://opensource.com/users/jrepka) - -Basic kubectl and Helm commands for beginners -====== -Take a trip to the grocery store to shop for the commands you'll need to -get started with these Kubernetes tools. -![A person working.][1] - -Recently, my husband was telling me about an upcoming job interview where he would have to run through some basic commands on a computer. He was anxious about the interview, but the best way for him to learn and remember things has always been to equate the thing he doesn't know to something very familiar to him. Because our conversation happened right after I was roaming the grocery store trying to decide what to cook that evening, it inspired me to write about kubectl and Helm commands by equating them to an ordinary trip to the grocer. - -[Helm][2] is a tool to manage applications within Kubernetes. You can easily deploy charts with your application information, allowing them to be up and preconfigured in minutes within your Kubernetes environment. When you're learning something new, it's always helpful to look at chart examples to see how they are used, so if you have time, take a look at these stable [charts][3]. - -[Kubectl][4] is a command line that interfaces with Kubernetes environments, allowing you to configure and manage your cluster. It does require some configuration to work within environments, so take a look through the [documentation][5] to see what you need to do. - -I'll use namespaces in the examples, which you can learn about in my article [_Kubernetes namespaces for beginners_][6]. - -Now that we have that settled, let's start shopping for basic kubectl and Helm commands! - -### Helm list - -What is the first thing you do before you go to the store? Well, if you're organized, you make a **list**. LIkewise, this is the first basic Helm command I will explain. - -In a Helm-deployed application, **list** provides details about an application's current release. In this example, I have one deployed application—the Jenkins CI/CD application. Running the basic **list** command always brings up the default namespace. Since I don't have anything deployed in the default namespace, nothing shows up: - - -``` -$helm list -NAME    NAMESPACE    REVISION    UPDATED    STATUS    CHART    APP VERSION -``` - -However, if I run the command with an extra flag, my application and information appear: - - -``` -$helm list --all-namespaces -NAME     NAMESPACE  REVISION  UPDATED                   STATUS      CHART           APP  VERSION -jenkins  jenkins        1         2020-01-18 16:18:07 EST   deployed    jenkins-1.9.4   lts -``` - -Finally, I can direct the **list** command to check only the namespace I want information from: - - -``` -$helm list --namespace jenkins -NAME     NAMESPACE  REVISION  UPDATED                   STATUS    CHART          APP VERSION -jenkins    jenkins      1              2020-01-18 16:18:07 EST  deployed  jenkins-1.9.4  lts     -``` - -Now that I have a list and know what is on it, I can go and get my items with **get** commands! I'll start with the Kubernetes cluster; what can I get from it? - -### Kubectl get - -The **kubectl get** command gives information about many things in Kubernetes, including pods, nodes, and namespaces. Again, without a namespace flag, you'll always land in the default. First, I'll get the namespaces in the cluster to see what's running: - - -``` -$kubectl get namespaces -NAME             STATUS   AGE -default          Active   53m -jenkins          Active   44m -kube-node-lease  Active   53m -kube-public      Active   53m -kube-system      Active   53m -``` - -Now that I have the namespaces running in my environment, I'll get the nodes and see how many are running: - - -``` -$kubectl get nodes -NAME       STATUS   ROLES       AGE   VERSION -minikube   Ready    master  55m   v1.16.2 -``` - -I have one node up and running, mainly because my Minikube is running on one small server. To get the pods running on my one node: - - -``` -$kubectl get pods -No resources found in default namespace. -``` - -Oops, it's empty. I'll get what's in my Jenkins namespace with: - - -``` -$kubectl get pods --namespace jenkins -NAME                      READY  STATUS   RESTARTS  AGE -jenkins-7fc688c874-mh7gv  1/1    Running  0         40m -``` - -Good news! There's one pod, it hasn't restarted, and it has been running for 40 minutes. Well, since I know the pod is up, I want to see what I can get from Helm. - -### Helm get - -**Helm get** is a little more complicated because this **get** command requires more than an application name, and you can request multiple things from applications. I'll begin by getting the values used to make the application, and then I'll show a snip of the **get all** action, which provides all the data related to the application. - - -``` -$helm get values jenkins -n jenkins -USER-SUPPLIED VALUES: -null -``` - -Since I did a very minimal stable-only install, the configuration didn't change. If I run the **all** command, I get everything out of the chart: - - -``` -`$helm get all jenkins -n jenkins` -``` - -![output from helm get all command][7] - -This produces a ton of data, so I always recommend keeping a copy of a Helm chart so you can look over the templates in the chart. I also create my own values to see what I have in place. - -Now that I have all my goodies in my shopping cart, I'll check the labels that **describe** what's in them. These examples pertain only to kubectl, and they describe what I've deployed through Helm. - -### Kubectl describe - -As I did with the **get** command, which can describe just about anything in Kubernetes, I'll limit my examples to namespaces, pods, and nodes. Since I know I'm working with one of each, this will be easy. - - -``` -$kubectl describe ns jenkins -Name:           jenkins -Labels:         <none> -Annotations:  <none> -Status:         Active -No resource quota. -No resource limits. -``` - -I can see my namespace's name and that it is active and has no resource nor quote limits. - -The **describe pods** command produces a large amount of information, so I'll provide a small snip of the output. If you run the command without the pod name, it will return information for all of the pods in the namespace, which can be overwhelming. So, be sure you always include the pod name with this command. For example: - - -``` -`$kubectl describe pods jenkins-7fc688c874-mh7gv --namespace jenkins` -``` - -![output of kubectl-describe-pods][8] - -This provides (among many other things) the status of the container, how the container is managed, the label, and the image used in the pod. The data not in this abbreviated output includes resource requests and limits along with any conditions, init containers, and storage volume information applied in a Helm values file. This data is useful if your application is crashing due to inadequate resources, a configured init container that runs a prescript for configuration, or generated hidden passwords that shouldn't be in a plain text YAML file. - -Finally, I'll use **describe node**, which (of course) describes the node. Since this example has just one, named Minikube, that is what I'll use; if you have multiple nodes in your environment, you must include the node name of interest. - -As with pods, the node command produces an abundance of data, so I'll include just a snip of the output. - - -``` -`$kubectl describe node minikube` -``` - -![output of kubectl describe node][9] - -Note that **describe node** is one of the more important basic commands. As this image shows, the command returns statistics that indicate when the node is running out of resources, and this data is excellent for alerting you when you need to scale up (if you do not have autoscaling in your environment). Other things not in this snippet of output include the percentages of requests made for all resources and limits, as well as the age and allocation of resources (e.g., for my application). - -### Checking out - -With these commands, I've finished my shopping and gotten everything I was looking for. Hopefully, these basic commands can help you, too, in your day-to-day with Kubernetes. - -I urge you to work with the command line often and learn the shorthand flags available in the Help sections, which you can access by running these commands: - - -``` -`$helm --help` -``` - -and - - -``` -`$kubectl -h` -``` - -### Peanut butter and jelly - -Some things just go together like peanut butter and jelly. Helm and kubectl are a little like that. - -I often use these tools in my environment. Because they have many similarities in a ton of places, after using one, I usually need to follow up with the other. For example, I can do a Helm deployment and watch it fail using kubectl. Try them together, and see what they can do for you. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/kubectl-helm-commands - -作者:[Jessica Cherry][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jrepka -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003784_02_os.comcareers_os_rh2x.png?itok=jbRfXinl (A person working.) -[2]: https://helm.sh/ -[3]: https://github.com/helm/charts/tree/master/stable -[4]: https://kubernetes.io/docs/reference/kubectl/kubectl/ -[5]: https://kubernetes.io/docs/reference/kubectl/overview/ -[6]: https://opensource.com/article/19/12/kubernetes-namespaces -[7]: https://opensource.com/sites/default/files/uploads/helm-get-all.png (output from helm get all command) -[8]: https://opensource.com/sites/default/files/uploads/kubectl-describe-pods.png (output of kubectl-describe-pods) -[9]: https://opensource.com/sites/default/files/uploads/kubectl-describe-node.png (output of kubectl describe node) diff --git a/sources/tech/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md b/sources/tech/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md index 657fb6a93b..6b959364b7 100644 --- a/sources/tech/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md +++ b/sources/tech/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (mengxinayan) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -157,7 +157,7 @@ via: https://www.2daygeek.com/basic-vim-commands-cheat-sheet-quick-start-guide/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[萌新阿岩](https://github.com/mengxinayan) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/sources/tech/20200219 Here Are The Most Beautiful Linux Distributions in 2020.md b/sources/tech/20200219 Here Are The Most Beautiful Linux Distributions in 2020.md deleted file mode 100644 index 3188c97fa7..0000000000 --- a/sources/tech/20200219 Here Are The Most Beautiful Linux Distributions in 2020.md +++ /dev/null @@ -1,182 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Here Are The Most Beautiful Linux Distributions in 2020) -[#]: via: (https://itsfoss.com/beautiful-linux-distributions/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Here Are The Most Beautiful Linux Distributions in 2020 -====== - -It’s a no-brainer that there’s a Linux distribution for every user – no matter what they prefer or what they want to do. - -Starting out with Linux? You can go with the [Linux distributions for beginners][1]. Switching from Windows? You have [Windows-like Linux distributions][2]. Have an old computer? You can [use lightweight Linux distros][3]. - -In this list, I’m going to focus only on the most beautiful Linux distros out there. - -### Top 7 Most Beautiful Linux Distributions - -![][4] - -Wait! Is there a thing called a beautiful Linux distribution? Is it not redundant considering the fact that you can customize the looks of any distribution and make it look better with [themes][5] and [icons][6]? - -You are right about that. But here, I am talking about the distributions that look great without any tweaks and customization effort from the user’s end. These distros provide a seamless, pleasant desktop experience right out of the box. - -**Note:** _The list is in no particular order of ranking._ - -#### 1\. elementary OS - -![][7] - -elementary OS is one of the most beautiful Linux distros out there. It leans on a macOS-ish look while providing a great user experience for Linux users. If you’re already comfortable macOS – you will have no problem using the elementary OS. - -Also, elementary OS is based on Ubuntu – so you can easily find plenty of applications to get things done. - -Not just limited to the look and feel – but the elementary OS is always hard at work to introduce meaningful changes. So, you can expect the user experience to improve with every update you get. - -[elementary OS][8] - -#### 2\. Deepin - -![][9] - -Deepin is yet another beautiful Linux distro originally based on Debian’s stable branch. The animations (look and feel) could be too overwhelming for some – but it looks pretty. - -It features its own Deepin Desktop Environment that involves a mix of essential features for the best user experience possible. It may not exactly resemble the UI of any other distribution but it’s quite easy to get used to. - -My personal attention would go to the control center and the color scheme featured in Deepin OS. You can give it a try – it’s worth taking a look. - -[Deepin][10] - -#### 3\. Pop!_OS - -![][11] - -Pop!_OS manages to offer a great UI on top of Ubuntu while offering a pure [GNOME][12] experience. - -It also happens to be my personal favorite which I utilize as my primary desktop OS. Pop!_OS isn’t flashy – nor involves any fancy animations. However, they’ve managed to get things right by having a perfect combo of icon/themes – while polishing the user experience from a technical point of view. - -I don’t want to initiate a [Ubuntu vs Pop OS][13] debate but if you’re used to Ubuntu, Pop!_OS can be a great alternative for potentially better user experience. - -[Pop!_OS][14] - -#### 4\. Manjaro Linux - -![][15] - -Manjaro Linux is an [Arch][16]-based Linux distribution. While [installing Arch Linux][17] is a slightly complicated job, Manjaro provides an easier and smoother Arch experience. - -It offers a variety of [desktop environment editions][18] to choose from while downloading. No matter what you choose, you still get enough options to customize the look and feel or the layout. - -To me, it looks quite fantastic for an Arch-based distribution that works out of the box – you can give it a try! - -[Manjaro Linux][19] - -#### 5\. KDE Neon - -![][20] - -[KDE Neon][21] is for the users who want a simplified approach to the design language but still get a great user experience. - -It is a lightweight Linux distro which is based on Ubuntu. As the name suggests, it features the KDE Plasma desktop and looks absolutely beautiful. - -KDE Neon gives you the latest and greatest KDE Plasma desktop and KDE applications. Unlike [Kubuntu][22] or other KDE-based distributions, you don’t have to wait for months to get the new [KDE software][23]. - -You get a lot of customization options built-in with the KDE desktop – so feel free to try it out! - -[KDE Neon][24] - -#### 6\. Zorin OS - -![][25] - -Without a doubt, Zorin OS is an impressive Linux distro that manages to provide a good user experience – even with its lite edition. - -You can try either the full version or the lite edition (with [Xfce desktop][26]). The UI is tailored for Windows and macOS users to get used to. While based on Ubuntu, it provides a great user experience with what it has to offer. - -If you start like its user interface – you can also try [Zorin Grid][27] to manage multiple computers running Zorin OS at your workplace/home. With the ultimate edition, you can also control the layout of your desktop (as shown in the image above). - -[Zorin OS][28] - -#### 7\. Nitrux OS - -![][29] - -[Nitrux OS][30] is a unique take on a Linux distribution which is somewhat based on Ubuntu – but not completely. - -It focuses on providing a good user experience to the users who are looking for a unique design language with a fresh take on a Linux distro. It uses Nomad desktop which is based on KDE. - -Nitrux encourages to use of [AppImage][31] for applications. But you can also use Arch Linux’s pacman package manager in Nitrux which is based on Ubuntu. Awesome, isn’t it? - -Even if it’s not the perfect OS to have installed (yet), it sure looks pretty and good enough for most of the basic tasks. You can also know more about it when you read our [interview with Nitrux’s founder][32]. - -Here’s a slightly old video of Nitrux but it still looks good: - -[Nitrux OS][33] - -#### Bonus: eXtern OS (in ‘stagnated’ development) - -![][34] - -If you want to try an experimental Linux distro, extern OS is going to be beautiful. - -It isn’t actively maintained and should not be used for production systems. Yet, it provides unique user experience (thought not polished enough). - -Just for the sake of trying a good-looking Linux distro, you can give it a try to experience it. - -[eXtern OS][35] - -**Wrapping Up** - -Now, as the saying goes, beauty lies in the eyes of the beholder. So this list of beautiful Linux distributions is from my point of view. Feel free to disagree (politely of course) and mention your favorites. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/beautiful-linux-distributions/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/best-linux-beginners/ -[2]: https://itsfoss.com/windows-like-linux-distributions/ -[3]: https://itsfoss.com/lightweight-linux-beginners/ -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/beautiful-linux-distros.png?ssl=1 -[5]: https://itsfoss.com/best-gtk-themes/ -[6]: https://itsfoss.com/best-icon-themes-ubuntu-16-04/ -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/elementary-os-hera.png?ssl=1 -[8]: https://elementary.io/ -[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/deepin-screenshot.jpg?ssl=1 -[10]: https://www.deepin.org/en/ -[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/pop-os-stock.jpg?ssl=1 -[12]: https://www.gnome.org/ -[13]: https://itsfoss.com/pop-os-vs-ubuntu/ -[14]: https://system76.com/pop -[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/manjaro_kde.jpg?ssl=1 -[16]: https://en.wikipedia.org/wiki/Arch -[17]: https://itsfoss.com/install-arch-linux/ -[18]: https://itsfoss.com/best-linux-desktop-environments/ -[19]: https://manjaro.org/download/ -[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/kde-neon-screenshot.jpg?ssl=1 -[21]: https://itsfoss.com/kde-neon-unveiled/ -[22]: https://kubuntu.org/ -[23]: https://kde.org/ -[24]: https://neon.kde.org/ -[25]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/11/zorin-lite-ultimate-appearance.jpg?ssl=1 -[26]: https://www.xfce.org/ -[27]: https://itsfoss.com/zorin-grid/ -[28]: https://zorinos.com/ -[29]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/nitrux-screenshot.jpg?ssl=1 -[30]: https://itsfoss.com/nitrux-linux-overview/ -[31]: https://itsfoss.com/use-appimage-linux/ -[32]: https://itsfoss.com/nitrux-linux/ -[33]: https://nxos.org/ -[34]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/extern-os.png?ssl=1 -[35]: https://externos.io/ diff --git a/sources/tech/20200219 Try this Bash script for-large filesystems.md b/sources/tech/20200219 Try this Bash script for-large filesystems.md deleted file mode 100644 index f0f0a88f2f..0000000000 --- a/sources/tech/20200219 Try this Bash script for-large filesystems.md +++ /dev/null @@ -1,335 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Try this Bash script for large filesystems) -[#]: via: (https://opensource.com/article/20/2/script-large-files) -[#]: author: (Nick Clifton https://opensource.com/users/nickclifton) - -Try this Bash script for large filesystems -====== -A simple script to list files, directories, executables, and links. -![bash logo on green background][1] - -Have you ever wanted to list all the files in a directory, but just the files, nothing else? How about just the directories? If you have, then the following script, which is open source under GPLv3, could be what you have been looking for. - -Of course, you could use the **find** command: - - -``` -`find . -maxdepth 1 -type f -print` -``` - -But this is cumbersome to type, produces unfriendly output, and lacks some of the refinement of the **ls** command. You could also combine **ls** and **grep** to achieve the same result: - - -``` -`ls -F . | grep -v /` -``` - -But again, this is clunky. This script provides a simple alternative. - -### Usage - -The script provides four main functions, which depend upon which name you call: **lsf** lists files, **lsd** lists directories, **lsx** lists executables, and **lsl** lists links. - -There is no need to install multiple copies of the script, as symbolic links work. This saves space and makes updating the script easier. - -The script works by using the **find** command to do the searching, and then it runs **ls** on each item it finds. The nice thing about this is that any arguments given to the script are passed to the **ls** command. So, for example, this lists all files, even those that start with a dot: - - -``` -`lsf -a` -``` - -To list directories in long format, use the **lsd** command: - - -``` -`lsd -l` -``` - -You can provide multiple arguments, and also file and directory paths. - -This provides a long classified listing of all of files in the current directory's parent directory, and in the **/usr/bin** directory: - - -``` -`lsf -F -l .. /usr/bin` -``` - -One thing that the script does not currently handle, however, is recursion. This command lists only the files in the current directory. - - -``` -`lsf -R` -``` - -The script does not descend into any subdirectories. This is something that may be fixed one day. - -### Internals - -The script is written in a top-down fashion with the initial functions at the start of the script and the body of the work performed near the end. There are only two functions that really matter in the script. The **parse_args()** function peruses the command line, separates options from pathnames, and scripts specific options from the **ls** command-line options. - -The **list_things_in_dir()** function  takes a directory name as an argument and runs the **find** command on it. Each item found is passed to the **ls** command for display. - -### Conclusion - -This is a simple script to accomplish a simple function. It is a time saver and can be surprisingly useful when working with large filesystems. - -### The script - - -``` -#!/bin/bash - -# Script to list: -#      directories (if called "lsd") -#      files       (if called "lsf") -#      links       (if called "lsl") -#  or  executables (if called "lsx") -# but not any other type of filesystem object. -# FIXME: add lsp   (list pipes) -# -# Usage: -#   <command_name> [switches valid for ls command] [dirname...] -# -# Works with names that includes spaces and that start with a hyphen. -# -# Created by Nick Clifton. -# Version 1.4 -# Copyright (c) 2006, 2007 Red Hat. -# -# This 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, or (at your -# option) any later version. - -# It 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. - -# ToDo: -#  Handle recursion, eg:  lsl -R -#  Handle switches that take arguments, eg --block-size -#  Handle --almost-all, --ignore-backups, --format and --ignore - -main () -{ -  init -  -  parse_args ${1+"$@"} - -  list_objects - -  exit 0 -} - -report () -{ -  echo $prog": " ${1+"$@"} -} - -fail () -{ -  report " Internal error: " ${1+"$@"} -  exit 1 -} - -# Initialise global variables. -init () -{ -  # Default to listing things in the current directory. -  dirs[0]="."; -  -  # num_dirs is the number of directories to be listed minus one. -  # This is because we are indexing the dirs[] array from zero. -  num_dirs=0; -  -  # Default to ignoring things that start with a period. -  no_dots=1 -  -  # Note - the global variables 'type' and 'opts' are initialised in -  # parse_args function. -} - -# Parse our command line -parse_args () -{ -  local no_more_args - -  no_more_args=0 ; - -  prog=`basename $0` ; - -  # Decide if we are listing files or directories. -  case $prog in -    lsf | lsf.sh) -      type=f -      opts=""; -      ;; -    lsd | lsd.sh) -      type=d -      # The -d switch to "ls" is presumed when listing directories. -      opts="-d"; -      ;; -    lsl | lsl.sh) -      type=l -      # Use -d to prevent the listed links from being followed. -      opts="-d"; -      ;; -    lsx | lsx.sh) -      type=f -      find_extras="-perm /111" -      ;;     -    *) -      fail "Unrecognised program name: '$prog', expected either 'lsd', 'lsf', 'lsl' or 'lsx'" -      ;; -  esac - -  # Locate any additional command line switches for ls and accumulate them. -  # Likewise accumulate non-switches to the directories list. -  while [ $# -gt 0 ] -  do -    case "$1" in -      # FIXME: Handle switches that take arguments, eg --block-size -      # FIXME: Properly handle --almost-all, --ignore-backups, --format -      # FIXME:   and --ignore -      # FIXME: Properly handle --recursive -      -a | -A | --all | --almost-all) -        no_dots=0; -        ;; -      --version) -        report "version 1.2" -        exit 0 -        ;; -      --help) -        case $type in -          d) report "a version of 'ls' that lists only directories" ;; -          l) report "a version of 'ls' that lists only links" ;; -          f) if [ "x$find_extras" = "x" ] ; then -               report "a version of 'ls' that lists only files" ; -             else -              report "a version of 'ls' that lists only executables"; -             fi ;; -        esac -        exit 0 -        ;; -      --) -        # A switch to say that all further items on the command line are -        # arguments and not switches. -        no_more_args=1 ; -        ;; -      -*) -        if [ "x$no_more_args" = "x1" ] ; -        then -          dirs[$num_dirs]="$1"; -          let "num_dirs++" -        else -          # Check for a switch that just uses a single dash, not a double -          # dash.  This could actually be multiple switches combined into -          # one word, eg "lsd -alF".  In this case, scan for the -a switch. -          # XXX: FIXME: The use of =~ requires bash v3.0+. -          if [[ "x${1:1:1}" != "x-" && "x$1" =~ "x-.*a.*" ]] ; -          then -            no_dots=0; -          fi -          opts="$opts $1"; -        fi -        ;; -      *) -        dirs[$num_dirs]="$1"; -        let "num_dirs++" -        ;; -    esac -    shift -  done - -  # Remember that we are counting from zero not one. -  if [ $num_dirs -gt 0 ] ; -  then -    let "num_dirs--" -  fi -} - -list_things_in_dir () -{ -  local dir - -  # Paranoia checks - the user should never encounter these. -  if test "x$1" = "x" ; -  then -    fail "list_things_in_dir called without an argument" -  fi - -  if test "x$2" != "x" ; -  then -    fail "list_things_in_dir called with too many arguments" -  fi - -  # Use quotes when accessing $dir in order to preserve -  # any spaces that might be in the directory name. -  dir="${dirs[$1]}"; - -  # Catch directory names that start with a dash - they -  # confuse pushd. -  if test "x${dir:0:1}" = "x-" ; -  then -    dir="./$dir" -  fi -  -  if [ -d "$dir" ] -  then -    if [ $num_dirs -gt 0 ] -    then -      echo "  $dir:" -    fi - -    # Use pushd rather passing the directory name to find so that the -    # names that find passes on to xargs do not have any paths prepended. -    pushd "$dir" > /dev/null -    if [ $no_dots -ne 0 ] ; then -      find . -maxdepth 1 -type $type $find_extras -not -name ".*" -printf "%f\000" \ -        | xargs --null --no-run-if-empty ls $opts -- ; -    else -      find . -maxdepth 1 -type $type $find_extras -printf "%f\000" \ -        | xargs --null --no-run-if-empty ls $opts -- ; -    fi -    popd > /dev/null -  else -    report "directory '$dir' could not be found" -  fi -} - -list_objects () -{ -  local i - -  i=0; -  while [ $i -le $num_dirs ] -  do -    list_things_in_dir i -    let "i++" -  done -} - -# Invoke main -main ${1+"$@"} -``` - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/script-large-files - -作者:[Nick Clifton][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/nickclifton -[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) diff --git a/sources/tech/20200219 Waterfox- Firefox Fork With Legacy Add-ons Options.md b/sources/tech/20200219 Waterfox- Firefox Fork With Legacy Add-ons Options.md deleted file mode 100644 index 8593b5a981..0000000000 --- a/sources/tech/20200219 Waterfox- Firefox Fork With Legacy Add-ons Options.md +++ /dev/null @@ -1,110 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Waterfox: Firefox Fork With Legacy Add-ons Options) -[#]: via: (https://itsfoss.com/waterfox-browser/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Waterfox: Firefox Fork With Legacy Add-ons Options -====== - -_**Brief: In this week’s open source software highlight, we take a look at a Firefox-based browser that supports legacy extensions that Firefox no longer supports while potentially providing fast user experience.**_ - -When it comes to web browsers, Google Chrome leads the market share. [Mozilla Firefox is there still providing hopes for a mainstream web browser that respects your privacy][1]. - -Firefox has improved a lot lately and one of the side-effects of the improvements is removal of add-ons. If your favorite add-on disappeared in last few months/years, you have a good new in the form of Witerfox. - -Attention! - -It’s been brought to our notice that Waterfox has been acquired by System1. This company also acquired privacy focused search engine Startpage. -While System1 claims that they are providing privacy focused products because ‘there is a demand’, we cannot vouch for their claim. -In other words, it’s up to you to trust System1 and Waterfox. - -### Waterfox: A Firefox-based Browser - -![Waterfox Classic][2] - -[Waterfox][3] is a useful open-source browser built on top of Firefox that focuses on privacy and supports legacy extensions. It doesn’t pitch itself as a privacy-paranoid browser but it does respect the basics. - -You get two separate Waterfox browser versions. The current edition aims to provide a modern experience and the classic version focuses to support [NPAPI plugins][4] and [bootstrap extensions][5]. - -![Waterfox Classic][6] - -If you do not need to utilize bootstrap extensions but rely on [WebExtensions][7], Waterfox Current is the one you should go for. - -And, if you need to set up a browser that needs NPAPI plugins or bootstrap extensions extensively, Waterfox Classic version will be suitable for you. - -So, if you like Firefox, but want to try something different on the same line, this is a Firefox alternative for the job. - -### Features of Waterfox - -![Waterfox Current][8] - -Of course, technically, you should be able to do a lot of things that Mozilla Firefox supports. - -So, I’ll just highlight all the important features of Waterfox in a list here. - - * Supports NPAPI Plugins - * Supports Bootstrap Extensions - * Offers separate editions for legacy extension support and modern WebExtension support. - * Cross-platform support (Windows, Linux, and macOS) - * Theme customization - * Archived Add-ons supported - - - -### Installing Waterfox on Ubuntu/Linux - -Unlike other popular browsers, you don’t get a package to install. So, you will have to download the archived package from its [official download page][9]. - -![][10] - -Depending on what edition (Current/Classic) you want – just download the file, which will be **.tar.bz2** extension file. - -Once downloaded, simply extract the file. - -Next, head on to the extracted folder and look for the “**Waterfox**” file. You can simply double-click on it to run start up the browser. - -If that doesn’t work, you can utilize the terminal and navigate to the extracted **Waterfox** folder. Once there, you can simply run it with a single command. Here’s how it looks like: - -``` -cd waterfox-classic -./waterfox -``` - -In either case, you can also head to its [GitHub page][11] and explore more options to get it installed on your system. - -[Download Waterfox][3] - -**Wrapping up** - -I fired it up on my Pop!_OS 19.10 installation and it worked really well for me. Though I don’t think I could switch from Firefox to Waterfox because I am not using any legacy add-on. It could still be an impressive option for certain users. - -You could give it a try and let me know your thoughts in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/waterfox-browser/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/why-firefox/ -[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/waterfox-classic.png?fit=800%2C423&ssl=1 -[3]: https://www.waterfox.net/ -[4]: https://en.wikipedia.org/wiki/NPAPI -[5]: https://wiki.mozilla.org/Extension_Manager:Bootstrapped_Extensions -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/waterfox-classic-screenshot.jpg?ssl=1 -[7]: https://wiki.mozilla.org/WebExtensions -[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/waterfox-screenshot.jpg?ssl=1 -[9]: https://www.waterfox.net/download/ -[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/waterfox-download-page.jpg?ssl=1 -[11]: https://github.com/MrAlex94/Waterfox diff --git a/sources/tech/20200225 3 eBook readers for the Linux desktop.md b/sources/tech/20200225 3 eBook readers for the Linux desktop.md deleted file mode 100644 index 700f56aeed..0000000000 --- a/sources/tech/20200225 3 eBook readers for the Linux desktop.md +++ /dev/null @@ -1,118 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wenwensnow) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (3 eBook readers for the Linux desktop) -[#]: via: (https://opensource.com/article/20/2/linux-ebook-readers) -[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) - -3 eBook readers for the Linux desktop 针对Linux桌面版的3个电子书阅读器 -====== -Any of these open source eBook applications will make it easy to read -your books on a larger screen. 任意一个开源电子书应用都能使你在更大屏幕上的阅读体验得到提升。 -![Computer browser with books on the screen][1] - -I usually read eBooks on my phone or with my Kobo eReader. I've never been comfortable reading books on larger screens. However, many people regularly read books on their laptops or desktops. If you are one of them (or think you might be), I'd like to introduce you to three eBook readers for the Linux desktop. - -### Bookworm - -[Bookworm][2] is billed as a "simple, focused eBook reader." And it is. Bookworm has a basic set of features, which some people will complain about being _too basic_ or lacking _functionality_ (whatever that word means). Bookworm does one thing and does it well without unnecessary frills. - -The application's interface is very clean and uncluttered. - -![Bookworm e-book application][3] - -You navigate through a book by pressing: - - * The space bar to move down a page - * The Down and Up arrow keys to move down and up a single line - * The Right and Left arrow keys to jump to the next or previous chapter - - - -You can also annotate portions of a book and insert bookmarks to jump back to a page. - -![Annotations in Bookworm][4] - -Bookworm doesn't have many configuration options. You can change the size and spacing of a book's font, enable a two-page reading view or dark mode, and add folders that Bookworm will scan to find new eBooks. - -![Bookworm preferences][5] - -Bookworm supports the most widely used eBook formats: EPUB, PDF, MOBI, and [FB2][6]. You can also use Bookworm to read popular digital comic book formats [CBR][7] and CBZ. I've tested Bookworm with only the first three formats. PDF files are readable, but they load slowly and the formatting can be rather ugly. - -### Foliate - -As far as features go, [Foliate][8] is a step or two above Bookworm. Not only does it have several more features, but it also has more configuration options. You get all of that in a zippy, clean, and uncluttered package. - -![Foliate e-book application][9] - -You can navigate through an eBook in Foliate using the space bar, arrow keys, or PgUp and PgDn keys. There's nothing unique there. - -You can also annotate text, look up and translate words and phrases, and look up the meanings of words. If you have a text-to-speech application installed on your computer, Foliate can use it to read books aloud. - -![Annotating a book in Foliate][10] - -Foliate has a few more customization options than Bookworm. You can change a book's font and its size, the spacing of lines, and the size of a book's margins. You can also increase or decrease the brightness and select one of four built-in themes. - -![Foliate settings][11] - -You can read books in the EPUB, MOBI, AZW, and AZW3 formats using Foliate. In case you're wondering, the latter three are closed formats used with books published for Amazon's Kindle eReader - -### Calibre's eBook viewer - -[eBook viewer][12] is a component of the [Calibre][13] eBook management tool. Like its parent, the eBook viewer feature isn't the prettiest piece of software out there. - -![E-book Viewer application][14] - -Don't let that put you off, though. It's a solid desktop eBook reader. - -You navigate through an eBook in Calibre's e-book viewer using the arrow and PgUp/PgDn keys or by pressing the space bar. You can also look up words in an online dictionary and add bookmarks throughout a book. E-book viewer lacks an annotation function, but its built-in search engine is solid, and you can save books as PDFs (though I'm not sure why you'd want to). - -Configuration options are an area where this eBook viewer shines. It has far more of them than both Bookworm and Foliate combined. You can change everything from fonts to the layout of text to how text is broken up into pages. On top of that, you can customize the keyboard shortcuts for using the application and add your favorite dictionary website or sites to help you look up words in a book you're reading. - -![E-book Viewer preferences][15] - -One useful feature of Calibre's eBook viewer is the ability to apply your own CSS file to your e-books. CSS, in case you're wondering, is a way to format web pages (which is what many e-books are made of). If you're a master with CSS, you can copy and paste your CSS file into the **User stylesheet** tab in eBook viewer's Preferences window. That's the ultimate in customization. - -eBook viewer, according to its developer, "can display all the major e-book formats." If you're wondering what those formats are, [here's a list][16]. I've tested it with just a few of those formats and have had no problems with them. - -### Final thought - -Whether you're looking for a simple eBook reader or one with bells and whistles and whatever else, the three applications in this article are good choices. Any of them can make reading an eBook on a larger screen easier. - -* * * - -_This article is based on an article published on [Open Source Musings][17] and appears here via a [CC BY-SA 4.0][18] license._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/linux-ebook-readers - -作者:[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/lead-images/computer_browser_program_books_read.jpg?itok=iNMWe8Bu (Computer browser with books on the screen) -[2]: https://babluboy.github.io/bookworm/ -[3]: https://opensource.com/sites/default/files/uploads/bookworm-reading.png (Bookworm e-book application) -[4]: https://opensource.com/sites/default/files/uploads/bookworm-annotations.png (Annotations in Bookworm) -[5]: https://opensource.com/sites/default/files/uploads/bookworm-preferences.png (Bookworm preferences) -[6]: https://en.wikipedia.org/wiki/FictionBook -[7]: https://en.wikipedia.org/wiki/Comic_book_archive -[8]: https://johnfactotum.github.io/foliate/ -[9]: https://opensource.com/sites/default/files/uploads/foliate-reading.png (Foliate e-book application) -[10]: https://opensource.com/sites/default/files/uploads/foliate-annotation_0.png -[11]: https://opensource.com/sites/default/files/uploads/foliate-settings.png (Foliate settings) -[12]: https://calibre-ebook.com/about -[13]: https://opensourcemusings.com/managing-your-ebooks-with-calibre -[14]: https://opensource.com/sites/default/files/uploads/e-book_viewer-reading.png (E-book Viewer application) -[15]: https://opensource.com/sites/default/files/uploads/ebook-viewer-preferences.png (E-book Viewer preferences) -[16]: https://manual.calibre-ebook.com/faq.html#what-formats-does-calibre-support-conversion-to-from -[17]: https://opensourcemusings.com/three-ebook-readers-for-the-linux-desktop -[18]: https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/sources/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md b/sources/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md deleted file mode 100644 index b830a88c9d..0000000000 --- a/sources/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md +++ /dev/null @@ -1,161 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Converting between uppercase and lowercase on the Linux command line) -[#]: via: (https://www.networkworld.com/article/3529409/converting-between-uppercase-and-lowercase-on-the-linux-command-line.html) -[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) - -Converting between uppercase and lowercase on the Linux command line -====== -Converting text between uppercase and lowercase can be very tedious, especially when you want to avoid inadvertent misspellings. Fortunately, Linux provides a handful of commands that can make the job very easy. -[andy.brandon50][1] [(CC BY-SA 2.0)][2] - -There are many ways to change text on the Linux command line from lowercase to uppercase and vice versa. In fact, you have an impressive set of commands to choose from. This post examines some of the best commands for the job and how you can get them to do just what you want. - -### Using tr - -The **tr** (translate) command is one of the easiest to use on the command line or within a script. If you have a string that you want to be sure is in uppercase, you just pass it through a **tr** command like this: - -``` -$ echo Hello There | tr [:lower:] [:upper:] -HELLO THERE -``` - -[[Get regularly scheduled insights by signing up for Network World newsletters.]][3] - -Below is an example of using this kind of command in a script when you want to be sure that all of the text that is added to a file is in uppercase for consistency: - -``` -#!/bin/bash - -echo -n "Enter department name: " -read dept -echo $dept | tr [:lower:] [:upper:] >> depts -``` - -Switching the order to [:upper:] [:lower:] would have the opposite effect, putting all the department names in lowercase: - -``` -echo $dept | tr [:upper:] [:lower:] >> depts -``` - -Similarly, you could use the **sed** command's **A-Z** and **a-z** strings to accomplish the same thing: - -``` -echo $dept | tr a-z A-Z >> depts -``` - -As you undoubtedly suspect, reversing the order of the a-z and A-Z strings will have the opposite effect, turning the text to all lowercase. - -### Using awk - -The **awk** command lets you do the same thing with its **toupper** and **tolower** options. The command in the script shown in the previous example could be done this way instead: - -[][4] - -``` -echo $dept | awk '{print toupper($0)}' >> depts -``` - -The reverse (switching to lowercase) would look like this: - -``` -echo $dept | awk '{print tolower($0)}' >> depts -``` - -### Using sed - -The **sed** (stream editor) command also does a great job of switching between upper- and lowercase. This command would have the same effect as the first of the two shown above. - -``` -echo $dept | sed 's/[a-z]/\U&/g' >> depts -``` - -Switching from uppercase to lowercase would simply involve replacing the **U** near the end of the line with an **L**. - -``` -echo $dept | sed 's/[A-Z]/\L&/g' >> depts -``` - -### Manipulating text in a file - -Both **awk** and **sed** also allow you to change the case of text for entire files. So, you just found out your boss wanted those department names in all lowercase? No problem. Just run a command like this with the file name provided: - -``` -$ awk '{print tolower($0)}' depts -finance -billing -bookkeeping -``` - -If you want to overwrite the **depts** file, instead of just displaying its contents in lowercase, you would need to do something like this: - -``` -$ awk '{print tolower($0)}' depts > depts- -$ mv depts- depts -``` - -Making the change with **sed**, however, you can avoid that last step because **sed** can edit a file "in place" as shown here, leaving the file intact, but the text in all lowercase: - -``` -$ sed 's/[A-Z]/\L&/g' depts -``` - -### Capitalizing first letters only - -To capitalize only the first letters of words in a string, you can do something like this: - -``` -$ echo design \& engineering| sed -e "s/\b\(.\)/\u\1/g" -Design & Engineering -``` - -That command will ensure that first letters are capitalized, but won't change the rest of the letters. - -### Making sure only first letters are uppercase - -It's a little more challenging when you want to change text so that only first letters are in uppercase. Say you're manipulating a list of staff members' names and you want them to be formatted in the normal Firstname Lastname manner. - -##### with sed - -You could use a considerably more complex **sed** command to ensure this result: - -``` -$ echo design \& ENGINEERING | sed 's/\b\([[:alpha:]]\)\([[:alpha:]]*\)\b/\u\1\L\2/g' -Design & Engineering -``` - -##### with python - -If you have python loaded, you can run a command like this that also formats text so that only the first letters of each word are capitalized and the command may be a little easier to parse than the **sed** command shown above: - -``` -$ echo -n "design & engineering" | python3 -c "import sys; print(sys.stdin.read().title())" -Design & Engineering -``` - -There are many ways to change the formatting of text between upper- and lowercase. Which works best depends in part of whether you're manipulating a single string or an entire file and how you want the end result to look. - -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/3529409/converting-between-uppercase-and-lowercase-on-the-linux-command-line.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://www.flickr.com/photos/54027476@N07/4999959929 -[2]: https://creativecommons.org/licenses/by-sa/2.0/legalcode -[3]: https://www.networkworld.com/newsletters/signup.html -[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 diff --git a/sources/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md b/sources/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md deleted file mode 100644 index b1f3b76e2b..0000000000 --- a/sources/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md +++ /dev/null @@ -1,219 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (qianmingtian) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Install and Use Wireshark on Ubuntu Linux) -[#]: via: (https://itsfoss.com/install-wireshark-ubuntu/) -[#]: author: (Community https://itsfoss.com/author/itsfoss/) - -Install and Use Wireshark on Ubuntu Linux -====== - -_**Brief: You’ll learn to install the latest Wireshark on Ubuntu and other Ubuntu-based distribution in this tutorial. You’ll also learn how to run Wireshark without sudo and how to set it up for packet sniffing.**_ - -[Wireshark][1] is a free and open-source network protocol analyzer widely used around the globe. - -With Wireshark, you can capture incoming and outgoing packets of a network in real-time and use it for network troubleshooting, packet analysis, software and communication protocol development, and many more. - -It is available on all major desktop operating systems like Windows, Linux, macOS, BSD and more. - -In this tutorial, I will guide you to install Wireshark on Ubuntu and other Ubuntu-based distributions. I’ll also show a little about setting up and configuring Wireshark to capture packets. - -### Installing Wireshark on Ubuntu based Linux distributions - -![][2] - -Wireshark is available on all major Linux distributions. You should check out the [official installation instructions][3]. because in this tutorial, I’ll focus on installing the latest Wireshark version on Ubuntu-based distributions only. - -Wireshark is available in the Universe repository of Ubuntu. You can [enable universe repository][4] and then install it like this: - -``` -sudo add-apt-repository universe -sudo apt install wireshark -``` - -One slight problem in this approach is that you might not always get the latest version of Wireshark. - -For example, in Ubuntu 18.04, if you [use the apt command][5] to check the available version of Wireshark, it is 2.6. - -``` -[email protected]:~$ apt show wireshark -Package: wireshark -Version: 2.6.10-1~ubuntu18.04.0 -Priority: optional -Section: universe/net -Origin: Ubuntu -Maintainer: Balint Reczey <[email protected]> -``` - -However, [Wireshark 3.2 stable version][6] has been released months ago. New release brings new features, of course. - -So, what do you do in such case? Thankfully, Wiresshark developers provide an official PPA that you can use to install the latest stable version of Wireshark on Ubuntu and other Ubuntu-based distributions. - -I hope you are acquainted with PPA. If not, please [read our excellent guide on PPA to understand it completely][7]. - -Open a terminal and use the following commands one by one: - -``` -sudo add-apt-repository ppa:wireshark-dev/stable -sudo apt update -sudo apt install wireshark -``` - -Even if you have an older version of Wireshark installed, it will be updated to the newer version. - -While installing, you will be asked whether to allow non-superusers to capture packets. Select Yes to allow and No to restrict non-superusers to capture packets & finish the installation. - -### Running Wireshark without sudo - -If you have selected **No** in the previous installation, then run the following command as root: - -``` -sudo dpkg-reconfigure wireshark-common -``` - -And select **Yes** by pressing the tab key and then using enter key: - -![][8] - -Since you have allowed the non-superuser to capture packets, you have to add the user to wireshark group. Use the [usermod command][9] to add yourself to the wireshark group. - -``` -sudo usermod -aG wireshark $(whoami) -``` - -Finally, [restart your Ubuntu system][10] to make the necessary changes to your system. - -Trivia - -First released in 1998, Wireshark was initially known as Ethereal. Developers had to change its name to Wireshark in 2006 due to trademark issues. - -### Starting Wireshark - -Launching Wireshark application can be done from the application launcher or the CLI. - -To start from CLI, just type **wireshark** on your console: - -``` -wireshark -``` - -From **GUI**, search for Wireshark application on the search bar and hit enter. - -![][11] - -Now let’s play with Wireshark. - -### Capturing packets using Wireshark - -When you start Wireshark, you will see a list of interfaces that you can use to capture packets to and from. - -There are many types of interfaces available which you can monitor using Wireshark such as, Wired, External devices, etc. According to your preference, you can choose to show specific types of interfaces in the welcome screen from the marked area in the given image below. - -![Select interface][12] - -For instance, I listed only the **Wired** network interfaces. - -![][13] - -Next, to start capturing packets, you have to select the interface (which in my case is ens33) and click on the **Start capturing packets** icon as marked in the image below. - -![Start capturing packets with Wireshark][14] - -You can also capture packets to and from multiple interfaces at the same time. Just press and hold the **CTRL** button while clicking on the interfaces that you want to capture to and from and then hit the **Start capturing packets** icon as marked in the image below. - -![][15] - -Next, I tried using **ping google.com** command in the terminal and as you can see, many packets were captured. - -![Captured packets][16] - -Now you can select on any packet to check that particular packet. After clicking on a particular packet you can see the information about different layers of TCP/IP Protocol associated with it. - -![Packet info][17] - -You can also see the RAW data of that particular packet at the bottom as shown in the image below. - -![Check RAW data in the captured packets][18] - -This is why end-to-end encryption is important - -Imagine you are logging into a website that doesn’t use HTTPS. Anyone on the same network as you can sniff the packets and see the user name and password in the RAW data. -This is why most chat applications use end to end encryption and most websites these days use https (instead of http). - -#### Stopping packet capture in Wireshark - -You can click on the red icon as marked in the given image to stop capturing Wireshark packets. - -![Stop packet capture in Wireshark][19] - -#### Save captured packets to a file - -You can click on the marked icon in the image below to save captured packets to a file for future use. - -![Save captured packets by Wireshark][20] - -**Note**: _Output can be exported to XML, PostScript®, CSV, or plain text._ - -Next, select a destination folder, and type the file name and click on **Save**. -Then select the file and click on **Open**. - -![][21] - -Now you can open and analyze the saved packets anytime. To open the file, press **\ + o** -or go to **File > Open** from Wireshark. - -The captured packets should be loaded from the file. - -![][22] - -### Conclusion - -Wireshark supports many different communication protocols. There are many options and features that provide you the power to capture and analyze the network packets in a unique way. You can learn more about Wireshark from their [official documentation][23]. - -I hope this detailed helped you to install Wireshark on Ubuntu. Please let me know your questions and suggestions. - -![][24] - -### Kushal Rai - -A computer science student & Linux and open source lover. He likes sharing knowledge for he believes technology shapes the perception of modern world. Kushal also loves music and photography. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/install-wireshark-ubuntu/ - -作者:[Community][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/itsfoss/ -[b]: https://github.com/lujun9972 -[1]: https://www.wireshark.org/ -[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/wireshark_ubuntu.png?ssl=1 -[3]: https://www.wireshark.org/docs/wsug_html_chunked/ChBuildInstallUnixInstallBins.html -[4]: https://itsfoss.com/ubuntu-repositories/ -[5]: https://itsfoss.com/apt-command-guide/ -[6]: https://www.wireshark.org/news/20191218.html -[7]: https://itsfoss.com/ppa-guide/ -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/yes.png?ssl=1 -[9]: https://linuxhandbook.com/usermod-command/ -[10]: https://itsfoss.com/schedule-shutdown-ubuntu/ -[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/wire.png?ssl=1 -[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/interfaces.jpg?ssl=1 -[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/intoption.jpg?ssl=1 -[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/singleinterface.jpg?ssl=1 -[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/selint.jpg?ssl=1 -[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/capture.jpg?ssl=1 -[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/packetinfo.png?ssl=1 -[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/raw.png?ssl=1 -[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/stopcapture.png?ssl=1 -[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/savepackets.jpg?ssl=1 -[21]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/savename.jpg?ssl=1 -[22]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/openpacket.png?ssl=1 -[23]: https://www.wireshark.org/docs/https://www.wireshark.org/docs/ -[24]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/kushal_rai.jpg?ssl=1 diff --git a/sources/tech/20200306 Communicating with other users on the Linux command line.md b/sources/tech/20200306 Communicating with other users on the Linux command line.md deleted file mode 100644 index 838c022976..0000000000 --- a/sources/tech/20200306 Communicating with other users on the Linux command line.md +++ /dev/null @@ -1,148 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Communicating with other users on the Linux command line) -[#]: via: (https://www.networkworld.com/article/3530343/communicating-with-other-users-on-the-linux-command-line.html) -[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) - -Communicating with other users on the Linux command line -====== - -Thinkstock / Linux - -Sending messages to other users on the Linux command line can be very easy, but there are a number of commands that you might want to consider. In this post, we’ll look at four commands and see how each of them works. - -### wall - -The **wall** command (as in "write all") allows you to send a message to all users who are currently logged into the system. This implies that the system is likely a server and that users are working on the command line. While the wall command is generally used by sysadmins to send out notices to users to let send out information (e.g., that the server is going down for maintenance), it can be used by any user. - -A sysadmin might send out a message like this: - -``` -$ wall The system will be going down in 15 minutes to address a serious problem -``` - -Everyone logged into the system will see something like this: - -``` -Broadcast message from admin@dragonfly (pts/0) (Thu Mar 5 08:56:42 2020): - -The system is going down in 15 minutes to address a serious problem -``` - -If you want to use single quote marks in your message, enclose the message in double quote marks like this: - -``` -$ wall “Don’t forget to save your work before logging off” -``` - -The outside quote marks will not show up in the transmitted message, but, without them, the command sits and waits for a closing single quote. - -### mesg - -If, for some reason, you don’t want to accept messages from another user, you can stop them from arriving with the **mesg** command. This command can be used with a “n” argument to refuse mail from the user or a “y” argument to allow the messages to arrive. - -[][1] - -``` -$ mesg n doug -$ mesg y doug -``` - -The blocked user will not be notified that their messages have been blocked. You can also block or allow all messages with a **mesg** command like one of these: - -``` -$ mesg y -$ mesg n -``` - -### write - -Another command for sending text without reverting to email is **write**. This command can be used to communicate with a specific user. - -``` -$ write nemo -Are you still at your desk? -I need to talk with you right away. -^C -``` - -Enter your text and use **^C** to exit when you’re done. The command allows you to send text, but doesn’t start a two-way conversation. It just sends the text. If the user is logged in on more than one terminal, you can specify which terminal you want to send the message to or you can rely on the system to choose the one with the shortest idle time. - -``` -$ write nemo#1 -``` - -If the user you are trying to write to has messages blocked, you should see something like this: - -``` -$ write nemo -write: nemo has messages disabled -``` - -### talk/ytalk - -The **talk** or **ytalk** command gives you a chance to have an interactive chat with one or more other users. The command will bring up a double-pane (top and bottom) window. Each individual will type into the top portion of the display on their screen and see the responses in the bottom section(s). The respondents can respond to a talk request by typing "talk" followed by the username of the person addressing them. - -``` -Message from Talk_Daemon@dragonfly at 10:10 ... -talk: connection requested by dory@127.0.0.1. -talk: respond with: talk dory@127.0.0.1 - -$ talk dory -``` - -The window can involve more than two participants if **ytalk** is used. As you can see in the example below (the result of the "talk dory" command shown above), talk is often ytalk. - -``` -----------------------------= YTalk version 3.3.0 =-------------------------- -Is the report ready? - --------------------------------= nemo@dragonfly =---------------------------- -Just finished it -``` - -As explained above, on the other side of the conversation, the talk session window panes are reversed: - -``` -----------------------------= YTalk version 3.3.0 =-------------------------- -Just finished it - --------------------------------= dory@dragonfly =---------------------------- -Is the report ready? -``` - -Again, use **^C** to exit. - -To talk with someone on another system, you just need to add a **-h** option and the hostname or IP address with a command like this: - -``` -$ talk -h 192.168.0.11 nemo -``` - -### Wrap-Up - -There are a number of basic commands for sending messages to other logged-in users on Linux systems, and they can be especially useful when you need to send out a quick message to all of the users, prefer a quick exchange to a phone call or want to easily involve more than two people in a quick messaging session. - -Some commands, like **wall**, allow a message to be broadcast, but are not interactive. Others, like **talk**, allow both lengthy and multi-user chats, avoiding the need to set up a conference call when a fairly quick exchange of information is all that's required. - -Join the Network World communities on [Facebook][2] and [LinkedIn][3] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3530343/communicating-with-other-users-on-the-linux-command-line.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://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) -[2]: https://www.facebook.com/NetworkWorld/ -[3]: https://www.linkedin.com/company/network-world diff --git a/sources/tech/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md b/sources/tech/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md deleted file mode 100644 index b4e47fcc36..0000000000 --- a/sources/tech/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md +++ /dev/null @@ -1,190 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Three Ways to Exclude/Hold/Prevent a Specific Package from an apt Upgrade) -[#]: via: (https://www.2daygeek.com/debian-ubuntu-exclude-hold-prevent-packages-from-apt-get-upgrade/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) - -Three Ways to Exclude/Hold/Prevent a Specific Package from an apt Upgrade -====== - -Sometimes you may accidentally update packages that are not updated due to some application dependency. - -This is always the case during the entire system update or automatic package upgrade process. - -If this happens, it may break the application function. - -This creates a serious problem and you need to spend a lot of time fixing the problem. - -See the following article if you want to **[Exclude Specific Packages from Yum Update][1]** - -How to avoid this kind of situation? - -How do I exclude packages from apt-get update? - -Yes, it can be done using the following three methods on Debian and Ubuntu systems. - - * **[apt-mark Command][2]** - * **[dpkg Command][3]** - * aptitude Command - - - -We will show in detail each. - -### Method-1: How to Exclude Packages Update on Debian/Ubuntu System Using the apt-mark Command - -The apt-mark is used to mark/unmark a package as being automatically installed. - -The Hold option is used to mark a package as blocked, which prevents the package from being automatically installed, upgraded, or removed. - -The unhold option is used to cancel a previously set hold on a package to allow all actions to be repeated. - -Run the following command to hold the given package using the **apt-mark** command. - -``` -$ sudo apt-mark hold nano -nano set on hold. -``` - -Once you have hold some packages, run the following apt-mark command to view them. - -``` -$ sudo apt-mark showhold -nano -``` - -This will show that the **“nano”** package will not be upgraded when you perform a full system update. - -``` -$ sudo apt update - -Reading package lists… Done -Building dependency tree -Reading state information… Done -Calculating upgrade… Done -The following packages have been kept back: - nano -0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. -``` - -Run the following command to unhold the “nano” package using the apt-mark command. - -``` -$ sudo apt-mark unhold nano -Canceled hold on nano. -``` - -### Method-2: How to Exclude Packages Update on Debian/Ubuntu System Using the dpkg Command - -The dpkg command is a CLI tool to install, build, remove and manage Debian packages. The primary and more user-friendly front-end for dpkg is aptitude. - -Run the following command to block a given package using the dpkg command. - -**Syntax:** - -``` -$ echo "package_name hold" | sudo dpkg --set-selections -``` - -Run the below dpkg command to hold the **“apache2”** package. - -``` -$ echo "apache2 hold" | sudo dpkg --set-selections -``` - -Once you have hold some packages, run the following command to view them. - -``` -$ sudo dpkg --get-selections | grep "hold" -apache2 hold -``` - -It will show that the **“apache2”** package will not be upgraded when you perform a full system update. - -``` -$ sudo apt update - -Reading package lists… Done -Building dependency tree -Reading state information… Done -Calculating upgrade… Done -The following packages have been kept back: - apache2 -0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. -``` - -Run the following command to unhold the given package using the dpkg command. - -**Syntax:** - -``` -$ echo "package_name install" | sudo dpkg --set-selections -``` - -Run the following command to unhold the “apache2” package using the dpkg command. - -``` -$ echo "apache2 install" | sudo dpkg --set-selections -``` - -### Method-3: How to Exclude Packages Update on Debian/Ubuntu System Using the aptitude Command - -The aptitude command is a text-based package management interface to the Debian and it’s derivative. - -It allows the user to view a list of packages and to perform package management tasks such as installing, upgrading, and removing packages. Actions may be performed from a visual interface or from the command-line. - -Run the following command to hold the given package using the aptitude command. - -``` -$ sudo aptitude hold python3 -``` - -Once you have hold some packages, run the following aptitude command to view them. - -``` -$ sudo dpkg --get-selections | grep "hold" -or -$ sudo apt-mark showhold - -python3 -``` - -This will show that the **“python3”** package will not be upgraded when you perform a full system update. - -``` -$ sudo apt update - -Reading package lists… Done -Building dependency tree -Reading state information… Done -Calculating upgrade… Done -The following packages have been kept back: - python3 -0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. -``` - -Run the following command to unhold the **“python3”** package using the apt-mark command. - -``` -$ sudo aptitude unhold python3 -``` - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/debian-ubuntu-exclude-hold-prevent-packages-from-apt-get-upgrade/ - -作者:[Magesh Maruthamuthu][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.2daygeek.com/author/magesh/ -[b]: https://github.com/lujun9972 -[1]: https://www.2daygeek.com/redhat-centos-yum-update-exclude-specific-packages/ -[2]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ -[3]: https://www.2daygeek.com/dpkg-command-to-manage-packages-on-debian-ubuntu-linux-mint-systems/ diff --git a/sources/tech/20200309 Fish - A Friendly Interactive Shell.md b/sources/tech/20200309 Fish - A Friendly Interactive Shell.md new file mode 100644 index 0000000000..b091fea171 --- /dev/null +++ b/sources/tech/20200309 Fish - A Friendly Interactive Shell.md @@ -0,0 +1,194 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fish – A Friendly Interactive Shell) +[#]: via: (https://fedoramagazine.org/fish-a-friendly-interactive-shell/) +[#]: author: (Michal Konečný https://fedoramagazine.org/author/zlopez/) + +Fish – A Friendly Interactive Shell +====== + +![Fish — A Friendly Interactive Shell][1] + +Are you looking for an alternative to bash? Are you looking for something more user-friendly? Then look no further because you just found the golden fish! + +Fish (friendly interactive shell) is a smart and user-friendly command line shell that works on Linux, MacOS, and other operating systems. Use it for everyday work in your terminal and for scripting. Scripts written in fish are less cryptic than their equivalent bash versions. + +### Fish’s user-friendly features + + * **Suggestions** +Fish will suggest commands that you have written before. This boosts productivity when typing same commands often. + * **Sane scripting** +Fish avoids using cryptic characters. This provides a clearer and friendlier syntax. + * **Completion based on man pages** +Fish will autocomplete parameters based on the the command’s man page. + * **Syntax highlighting** +Fish will highlight command syntax to make it visually friendly. + + + +### Installation + +#### Fedora Workstation + +Use the _dnf_ command to install fish: + +``` +$ sudo dnf install fish +``` + +Make fish your default shell by installing the _util-linux-user_ package and then running the _chsh_ (change shell) command with the appropriate parameters: + +``` +$ sudo dnf install util-linux-user +$ chsh -s /usr/bin/fish +``` + +You will need to log out and back in for this change to take effect. + +#### Fedora Silverblue + +Because this is not GUI application, you will need to layer it using _rpm-ostree_. Use the following command to install fish on Fedora Silverblue: + +``` +$ rpm-ostree install fish +``` + +On Fedora Silverblue you will need to reboot your PC to switch to the new ostree image. + +If you want to make fish your main shell on Fedora Silverblue, the easiest way is to update the _/etc/passwd_ file. Find your user and change _/bin/bash_ to _/usr/bin/fish_. + +You will need [root privileges][2] to edit the _/etc/passwd_ file. Also you will need to log out and back in for this change to take effect. + +### Configuration + +The per-user configuration file for fish is _~/.config/fish/config.fish_. To make configuration changes for all users, edit _/etc/fish/config.fish_ instead. + +The per-user configuration file must be created manually. The installation scripts will not create _~/.config/fish/config.fish_. + +Here are a couple configuration examples shown alongside their bash equivalents to get you started: + +#### Creating aliases + + * _~/.bashrc_: alias ll='ls -lh' + * _~/.config/fish/config.fish_: alias ll='ls -lh' + + + +#### Setting environment variables + + * _~/.bashrc_: export PATH=$PATH:~/bin + * _~/.config/fish/config.fish_: set -gx PATH $PATH ~/bin + + + +### Working with fish + +When fish is configured as your default shell, the command prompt will look similar to what is shown in the below image. If you haven’t configured fish to be your default shell, just run the _fish_ command to start it in your current terminal session. + +![][3] + +As you start typing commands, you will notice the syntax highlighting: + +![][4] + +Cool, isn’t it? 🙂 + +You will also see commands being suggested as you type. For example, start typing the previous command a second time: + +![][5] + +Notice the gray text that appears as you type. The gray text is fish suggesting the command you wrote before. To autocomplete it, just press **CTRL+F**. + +Get argument suggestions based on the preceding command’s man page by typing a dash (**–**) and then the **TAB** key: + +![][6] + +If you press **TAB** once, it will show you the first few suggestions (or every suggestion, if there are only a few arguments available). If you press **TAB** a second time, it will show you all suggestions. If you press **TAB** three times consecutively, it will switch to interactive mode and you can select an argument using the arrow keys. + +Otherwise, fish works similar to most other shells. The remaining differences are well documented. So it shouldn’t be difficult to find other features that you may be interested in. + +### Make fish even more powerful + +Make the fish even more powerful with [powerline][7]. Powerline adds command execution time, colored git status, current git branch and much more to fish’s interface. + +Before installing powerline for fish, you must install [Oh My Fish][8]. Oh My Fish extends fish’s core infrastructure to enable the installation of additional plugins. The easiest way to install Oh My Fish is to use the _curl_ command: + +``` +> curl -L https://get.oh-my.fish | fish +``` + +If you don’t want to pipe the installation commands directly to _curl_, see the installation section of Oh My Fish’s [README][9] for alternative installation methods. + +Fish’s powerline plugin is [bobthefish][7]. Bobthefish requires the _powerline-fonts_ package. + +**On Fedora Workstation**: + +``` +> sudo dnf install powerline-fonts +``` + +**On Fedora Silverblue**: + +``` +> rpm-ostree install powerline-fonts +``` + +On Fedora Silverblue you will have to reboot to complete the installation of the fonts. + +After you have installed the _powerline-fonts_ package, install _bobthefish_: + +``` +> omf install bobthefish +``` + +Now you can experience the full awesomeness of fish with powerline: + +![][10] + +### Additional resources + +Check out these web pages to learn even more about fish: + + * [Official page][11] + * [Documentation][12] + * [Tutorial][13] + * [FAQ][14] + * [Web playground][15] + * [Mailing lists][16] + * [GitHub][17] + + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/fish-a-friendly-interactive-shell/ + +作者:[Michal Konečný][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/zlopez/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/03/fish-816x345.jpg +[2]: https://fedoramagazine.org/howto-use-sudo/ +[3]: https://fedoramagazine.org/wp-content/uploads/2020/03/Screenshot-from-2020-03-03-14-00-35.png +[4]: https://fedoramagazine.org/wp-content/uploads/2020/03/Screenshot-from-2020-03-03-14-19-24.png +[5]: https://fedoramagazine.org/wp-content/uploads/2020/03/Screenshot-from-2020-03-03-14-25-31.png +[6]: https://fedoramagazine.org/wp-content/uploads/2020/03/Screenshot-from-2020-03-03-14-58-07.png +[7]: https://github.com/oh-my-fish/theme-bobthefish +[8]: https://github.com/oh-my-fish/oh-my-fish +[9]: https://github.com/oh-my-fish/oh-my-fish/blob/master/README.md#installation +[10]: https://fedoramagazine.org/wp-content/uploads/2020/03/Screenshot-from-2020-03-03-15-38-07.png +[11]: https://fishshell.com/ +[12]: https://fishshell.com/docs/current/index.html +[13]: https://fishshell.com/docs/current/tutorial.html +[14]: https://fishshell.com/docs/current/faq.html +[15]: https://rootnroll.com/d/fish-shell/ +[16]: https://sourceforge.net/projects/fish/lists/fish-users +[17]: https://github.com/fish-shell/fish-shell/ diff --git a/sources/tech/20200309 Level up your use of Helm on Kubernetes with Charts.md b/sources/tech/20200309 Level up your use of Helm on Kubernetes with Charts.md new file mode 100644 index 0000000000..9a08bdb973 --- /dev/null +++ b/sources/tech/20200309 Level up your use of Helm on Kubernetes with Charts.md @@ -0,0 +1,288 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Level up your use of Helm on Kubernetes with Charts) +[#]: via: (https://opensource.com/article/20/3/helm-kubernetes-charts) +[#]: author: (Jessica Cherry https://opensource.com/users/jrepka) + +Level up your use of Helm on Kubernetes with Charts +====== +Configuring known apps using the Helm package manager. +![Ships at sea on the web][1] + +Applications are complex collections of code and configuration that have a lot of nuance to how they are installed. Like all open source software, they can be installed from source code, but most of the time users want to install something simply and consistently. That’s why package managers exist in nearly every operating system, which manages the installation process. + +Similarly, Kubernetes depends on package management to simplify the installation process. In this article, we’ll be using the Helm package manager and its concept of stable charts to create a small application. + +### What is Helm package manager? + +[Helm][2] is a package manager for applications to be deployed to and run on Kubernetes. It is maintained by the [Cloud Native Computing Foundation][3] (CNCF) with collaboration with the largest companies using Kubernetes. Helm can be used as a command-line utility, which [I cover how to use here][4]. + +#### Installing Helm + +Installing Helm is quick and easy for Linux and macOS. There are two ways to do this, you can go to the release [page][5], download your preferred version, untar the file, and move the Helm executable to your** /usr/local/bin** or your **/usr/bin** whichever you are using. + +Alternatively, you can use your operating system package manage (**dnf**, **snap**, **brew**, or otherwise) to install it. There are instructions on how to install on each OS on this [GitHub page][6]. + +### What are Helm Charts? + +We want to be able to repeatably install applications, but also to customize them to our environment. That’s where Helm Charts comes into play. Helm coordinates the deployment of applications using standardized templates called Charts. Charts are used to define, install, and upgrade your applications at any level of complexity. + +> A _Chart_ is a Helm package. It contains all of the resource definitions necessary to run an application, tool, or service inside of a Kubernetes cluster. Think of it like the Kubernetes equivalent of a Homebrew formula, an Apt dpkg, or a Yum RPM file. +> +> [Using Helm][7] + +Charts are quick to create, and I find them straightforward to maintain. If you have one that is accessible from a public version control site, you can publish it to the [stable repository][8] to give it greater visibility. In order for a Chart to be added to stable, it must meet a number of [technical requirements][9]. In the end, if it is considered properly maintained by the Helm maintain, it can then be published to [Helm Hub][10]. + +Since we want to use the community-curated stable charts, we will make that easier by adding a shortcut:  + + +``` +$ helm repo add stable +"stable" has been added to your repositories +``` + +### Running our first Helm Chart + +Since I’ve already covered the basic Helm usage in [this article][11], I’ll focus on how to edit and use charts in this article. To follow along, you’ll need Helm installed and access to some Kubernetes environment, like minikube (which you can walk through [here][12] or [here][13]). + +Starting I will be picking one chart. Usually, in my article I use Jenkins as my example, and I would gladly do this if the chart wasn’t really complex. This time I’ll be using a basic chart and will be creating a small wiki, using [mediawiki and its chart][14].   + +So how do I get this chart? Helm makes that as easy as a pull. + +By default, charts are compressed in a .tgz file, but we can unpack that file to customize our wiki by using the **\--untar** flag. + + +``` +$ helm pull stable/mediawiki --untar +$ ls +mediawiki/ +$ cd mediawiki/ +$ ls +Chart.yaml         README.md          requirements.lock  templates/ +OWNERS             charts/            requirements.yaml  values.yaml +``` + +Now that we have this we can begin customizing the chart. + +### Editing your Helm Chart + +When the file was untared there was a massive amount of files that came out. While it does look frightening, there really is only one file we should be working with and that's the **values.yaml** file. + +Everything that was unpacked was a list of template files that has all the information for the basic application configurations. All the template files actually depend on what is configured in the values.yaml file. Most of these templates and chart files actually are for creating service accounts in the cluster and the various sets of required application configurations that would usually be put together if you were to build this application on a regular server. + +But on to the values.yaml file and what we should be changing in it. Open it in your favorite text editor or IDE. We see a [YAML][15] file with a ton of configuration. If we zoom in just on the container image file, we see its repository, registry, and tags amongst other details. + + +``` +## Bitnami DokuWiki image version +## ref: +## +image: +  registry: docker.io +  repository: bitnami/mediawiki +  tag: 1.34.0-debian-10-r31 +  ## Specify a imagePullPolicy +  ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' +  ## ref: +  ## +  pullPolicy: IfNotPresent +  ## Optionally specify an array of imagePullSecrets. +  ## Secrets must be manually created in the namespace. +  ## ref: +  ## +  # pullSecrets: +  #   - myRegistryKeySecretName +``` + +As you can see in the file each configuration for the values is well-defined. Our pull policy is set to **IfNotPresent**. This means if I run a **helm pull** command, it will not overwrite my existing version. If it’s set to always, the image will default to the latest version of the image on every pull. I’ll be using the default in this case, as in the past I have run into images being broken if it goes to the latest version without me expecting it (remember to version control your software, folks). + +### Customizing our Helm Chart + +So let’s configure this values file with some basic changes and make it our own. I’ll be changing some naming conventions, the wiki username, and the mediawiki site name. _Note: This is another snippet from values.yaml. All of this customization happens in that one file._ + + +``` +## User of the application +## ref: +## +mediawikiUser: cherrybomb + +## Application password +## Defaults to a random 10-character alphanumeric string if not set +## ref: +## +# mediawikiPassword: + +## Admin email +## ref: +## +mediawikiEmail: [root@example.com][16] + +## Name for the wiki +## ref: +## +mediawikiName: Jess's Home of Helm +``` + +After this, I’ll make some small modifications to our database name and user account. I changed the defaults to "jess" so you can see where changes were made. + + +``` +externalDatabase: + ## Database host +  host: + +  ## Database port +  port: 3306 + +  ## Database user +  user: jess_mediawiki + +  ## Database password +  password: + +  ## Database name +  database: jess_mediawiki + +## +## MariaDB chart configuration +## +## +## +mariadb: + ## Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database set this to false and configure the externalDatabase parameters +  enabled: true +  ## Disable MariaDB replication +  replication: +    enabled: false + +  ## Create a database and a database user +  ## ref: +  ## +  db: +    name: jess_mediawiki +    user: jess_mediawiki +``` + +And finally, I’ll be adding some ports in our load balancer to allow traffic from the local host. I'm running on minikube and find the **LoadBalancer** option works well. + + +``` +service: + ## Kubernetes svc type +  ## For minikube, set this to NodePort, elsewhere use LoadBalancer +  ## +  type: LoadBalancer +  ## Use serviceLoadBalancerIP to request a specific static IP, +  ## otherwise leave blank +  ## +  # loadBalancerIP: +  # HTTP Port +  port: 80 +  # HTTPS Port +  ## Set this to any value (recommended: 443) to enable the https service port +  # httpsPort: 443 +  ## Use nodePorts to requets some specific ports when usin NodePort +  ## nodePorts: +  ##   http: <to set explicitly, choose port between 30000-32767> +  ##   https: <to set explicitly, choose port between 30000-32767> +  ## +  # nodePorts: +  #  http: "30000" +  #  https: "30001" +  ## Enable client source IP preservation +  ## ref +  ## +  externalTrafficPolicy: Cluster +``` + +Now that we have made the configurations to allow traffic and create the database, we know that we can go ahead and deploy our chart. + +### Deploy and enjoy! + +Now that we have our custom version of the wiki, it's time to create a deployment. Before we get into that, let’s first confirm that nothing else is installed with Helm, to make sure my cluster has available resources to run our wiki. + + +``` +$ helm ls +NAME    NAMESPACE       REVISION        UPDATED STATUS  CHART   APP VERSION +``` + +There are no other deployments through Helm right now, so let's proceed with ours.  + + +``` +$ helm install jesswiki -f values.yaml stable/mediawiki +NAME: jesswiki +LAST DEPLOYED: Thu Mar  5 12:35:31 2020 +NAMESPACE: default +STATUS: deployed +REVISION: 2 +NOTES: +1\. Get the MediaWiki URL by running: + +  NOTE: It may take a few minutes for the LoadBalancer IP to be available. +        Watch the status with: 'kubectl get svc --namespace default -w jesswiki-mediawiki' + +  export SERVICE_IP=$(kubectl get svc --namespace default jesswiki-mediawiki --template "{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}") +  echo "Mediawiki URL: http://$SERVICE_IP/" + +2\. Get your MediaWiki login credentials by running: + +    echo Username: user +    echo Password: $(kubectl get secret --namespace default jesswiki-mediawiki -o jsonpath="{.data.mediawiki-password}" | base64 --decode) +$ +``` + +Perfect! Now we will navigate to the wiki, which is accessible at the cluster IP address. To confirm that address: + + +``` +kubectl get svc --namespace default -w jesswiki-mediawiki +NAME                 TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)        AGE +jesswiki-mediawiki   LoadBalancer   10.103.180.70   <pending>     80:30220/TCP   17s +``` + +Now that we have the IP, we go ahead and check to see if it’s up:  + +![A working wiki installed through helm charts][17] + +Now we have our new wiki up and running, and we can enjoy our new application with our personal edits. Use the command from the output above to get the password and start to fill in your wiki. + +### Conclusion + +Helm is a powerful package manager that makes installing and uninstalling applications on top of Kubernetes as simple as a single command. Charts add to the experience by giving us curated and tested templates to install applications with our unique customizations. Keep exploring what Helm and Charts have to offer and let me know what you do with them in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/helm-kubernetes-charts + +作者:[Jessica Cherry][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jrepka +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/kubernetes_containers_ship_lead.png?itok=9EUnSwci (Ships at sea on the web) +[2]: https://www.google.com/url?q=https://helm.sh/&sa=D&ust=1583425787800000 +[3]: https://www.google.com/url?q=https://www.cncf.io/&sa=D&ust=1583425787800000 +[4]: https://www.google.com/url?q=https://opensource.com/article/20/2/kubectl-helm-commands&sa=D&ust=1583425787801000 +[5]: https://www.google.com/url?q=https://github.com/helm/helm/releases/tag/v3.1.1&sa=D&ust=1583425787801000 +[6]: https://www.google.com/url?q=https://github.com/helm/helm&sa=D&ust=1583425787802000 +[7]: https://helm.sh/docs/intro/using_helm/ +[8]: https://www.google.com/url?q=https://github.com/helm/charts&sa=D&ust=1583425787803000 +[9]: https://github.com/helm/charts/blob/master/CONTRIBUTING.md#technical-requirements +[10]: https://www.google.com/url?q=https://hub.helm.sh/&sa=D&ust=1583425787803000 +[11]: https://www.google.com/url?q=https://opensource.com/article/20/2/kubectl-helm-commands&sa=D&ust=1583425787803000 +[12]: https://www.google.com/url?q=https://opensource.com/article/18/10/getting-started-minikube&sa=D&ust=1583425787804000 +[13]: https://www.google.com/url?q=https://opensource.com/article/19/7/security-scanning-your-devops-pipeline&sa=D&ust=1583425787804000 +[14]: https://www.google.com/url?q=https://github.com/helm/charts/tree/master/stable/mediawiki&sa=D&ust=1583425787805000 +[15]: https://en.wikipedia.org/wiki/YAML +[16]: mailto:root@example.com +[17]: https://opensource.com/sites/default/files/uploads/lookitworked.png (A working wiki installed through helm charts) diff --git a/sources/tech/20200310 Getting started with Emacs.md b/sources/tech/20200310 Getting started with Emacs.md new file mode 100644 index 0000000000..bb5ceffb86 --- /dev/null +++ b/sources/tech/20200310 Getting started with Emacs.md @@ -0,0 +1,181 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with Emacs) +[#]: via: (https://opensource.com/article/20/3/getting-started-emacs) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Getting started with Emacs +====== +10 tips for diving into the world of this useful group of open source +text editors. +![Computer keyboard typing][1] + +Many people say they want to learn [Emacs][2], but many of them shy away after the briefest encounter. It's not because Emacs is bad or even that complex. The problem, I believe, is that people don't actually want to learn Emacs; they want to be comfortable with Emacs traditions. They want to understand the arcane keyboard shortcuts and unfamiliar terminology. They want to use Emacs as they believe it's "meant to be used." + +I sympathize with this because that's how I felt about Emacs. I thought that all true Emacs users only ran it inside a terminal, and never used arrow keys or menus, much less a mouse. That's a great way to discourage yourself from getting started with Emacs. There are enough unique .emacs config files out there to prove that if there's one common strain among Emacs users, it's that everyone uses Emacs differently. + +Learning Emacs is easy. It's loving Emacs that's hard. To love Emacs, you have to discover the features it has that you've been looking for, sometimes without knowing you've been missing them. And that takes experience. + +The only way to get that experience is to start at the beginning—by actively using Emacs. Here are ten tips to help you figure out what works best for you. + +### Start with the GUI + +One of the greatest things about Emacs (and its friendly competitor, [Vim][3], too) is that it can be run in a terminal, which is useful when you SSH into a server, but not very significant on computers built within the last 15 years or so. The GUI version of Emacs can be run on extremely [low-powered devices][4], and it has lots of pragmatic features that both novice and experienced users can appreciate. + +For example, if you don't know how to copy a word with just keyboard shortcuts in Emacs, the Edit menu's Copy, Cut, and Paste selections provide the path of least resistance. There's no reason to punish yourself for choosing Emacs. Use its menus, use your mouse to select regions and click in-buffer buttons, and don't let unfamiliarity stand in your way of being productive. + +![Emacs slackware][5] + +These features are built into Emacs because users use them. You should use them when you need them and work your way up to the obscure commands you think you might need when you eventually use Emacs over SSH on a VT100 terminal with no Alt or arrow keys. + +### Get used to the terminology + +Emacs has special terms for its UI elements. The evolution of personal computing didn't build upon the same terms, so many are relatively foreign to the modern computer user, and others are the same but have different meanings. Here are some of the most common terms: + + * Frame: In Emacs, the frame is what modern computing calls a "window." + * Buffer: A buffer is a communication channel for Emacs. It may serve as a command-line for an Emacs process, or a shell, or just the contents of a file. + * Window: A window is your view into a buffer. + * Mini-buffer: The primary command-line, located at the bottom of the Emacs window. + + + +![Emacs tutorial map][6] + +### Making sense of Emacs modifier keys + +On a PC keyboard, the Ctrl key is referred to as C, and the Alt key is referred to as M. These aren't the C and M keys, and because they're always paired with an accompanying letter or symbol key, they're easy to recognize in the documentation. + +For example, C-x means Ctrl+X in modern keyboard notation, and M-x is Alt+X. You press the keys together just as you do when you're cutting text from any application. + +There's another level of keyboard shortcuts, though, quite unlike anything on modern computers. Sometimes, a keyboard shortcut isn't just one key combo and instead consists of a series of key presses. + +For instance, C-x C-f means to press Ctrl+X as usual, and then Ctrl+C as usual. + +Sometimes, a keyboard shortcut has a mixture of key types. The combo C-x 3 means to press Ctrl+X as usual, and then the number 3 key. + +The way Emacs can do these fancy power combos is because certain keys put Emacs into a special command mode. If you press C-X (that's Ctrl+X), you're telling Emacs to enter an idle state, waiting for a second key or keyboard shortcut. + +Emacs documentation, both official and unofficial, is full of keyboard shortcuts. Practice mentally translating C to Ctrl and M to Alt, and all those docs will make a lot more sense to you. + +### Alternate shortcuts for cut, copy, and paste + +Canonically, copying text is performed with a series of keyboard shortcuts that depend on how you want to copy or cut. + +For instance, you can cut a whole word with M-d (Emacs lingo for Alt+d), or a whole line with C-k (Ctrl+K), or a highlighted region with M-m (Alt+M). You can get used to that if you want, but if you like Ctrl+C and Ctrl+X and Ctrl-V, then you can use those instead. + +Enabling modern cut-copy-paste requires activating a feature called CUA (Common User Access). To activate CUA, click on the Options menu and select Use CUA Keys. With this enabled, C-c copies highlighted text, C-x cuts highlighted text, and C-v pastes text. This mode is only actually active when you've selected text, so you can still learn the usual C-x and C-c bindings that Emacs normally uses. + +### It's OK to share + +Emacs is an application and has no awareness of your feelings or loyalty towards it. If you want to use Emacs only for tasks that "feel" right for Emacs, and different editor (like Vim) for other tasks, you can do that. + +Your interactions with an application influence how you work, so if the pattern of keypresses required in Emacs doesn't agree with a specific task, then don't force yourself to use Emacs for that task. Emacs is just one of many open source tools available to you, and there's no reason to limit yourself to just one tool. + +### Explore new functions + +Most of what Emacs does is an elisp function that can be invoked from a menu selection, keyboard shortcut, or in some cases, a specific event. All functions can be executed from the mini-buffer (the command-line at the bottom of the Emacs frame). You could, in theory, even navigate your cursor by typing in functions like **forward-word** and **backward-word** and **next-line** and **previous-line**, and so on. It would be unbearably inefficient, but that's the kind of direct access to the code you're running. In a way, Emacs is its own API. + +You can find out about new functions by reading about Emacs on community blogs, or you can take a more direct approach and use the describe-function function. To get help on any function, press M-x (that's Alt+X) and then type describe-function, and then press Return or Enter. You are prompted for a function name, and then shown a description of that function. + +You can get a list of all available functions by typing M-x (Alt+X), followed by ?. + +You can also get pop-up descriptions of functions as you type them by pressing M-x and then typing **auto-complete-mode**, and then pressing Return or Enter. With this mode active, as you type any Emacs function into your document, you're offered auto-completion options, along with a description of the function. + +![Emacs function][7] + +When you find a useful function and use it, Emacs tells you the keyboard binding for it, if one is set. If one doesn't exist, you can assign one yourself by opening your $HOME/.emacs configuration file and entering a keyboard shortcut assignment. The syntax is global-set-key, followed by the keyboard shortcut you want to use, followed by the function you want to invoke. + +For example, to assign the screenwriter-slugline function to a keyboard binding: + + +``` +`(global-set-key (kbd “C-c s”) 'screenwriter-slugline)` +``` + +Reload your configuration file, and the keyboard shortcut is available to you: + + +``` +`M-x load-file ~/.emacs` +``` + +### Panic button + +As you use Emacs and try new functions, you're bound to start invoking something you didn't mean to invoke. The universal panic button in Emacs is C-g (that's Ctrl+G). +I remember this by associating G with GNU, and I imagine I'm calling upon GNU to rescue me from a poor decision, but feel free to make up your own mnemonic. + +If you press C-g a few times, the Emacs mini-buffer returns to a latent state, pop-up windows are hidden, and you're back to the safety of a plain old boring text editor. + +### Ignore the keyboard shortcuts + +There are too many potential keyboard shortcuts to summarize them all here, much less for you ever to hope to memorize. That's by design. Emacs is meant to be customized, and when people write plugins for Emacs, they get to define their own special keyboard shortcuts. + +The idea isn't to memorize all shortcuts right away. Your goal, instead, is to get comfortable using Emacs. The more comfortable you become in Emacs, the more you'll get tired of resorting to the menu bar all the time, and you'll start to memorize the combos important to you. + +Everyone has their own favorite shortcuts based on what they typically do in Emacs. Someone who spends all day writing code in Emacs may know all the keyboard shortcuts for running a debugger or for launching language-specific modes, but know nothing about Org-mode or Artist-mode. It's natural, and it's fine. + +### Practice Emacs when you use Bash + +One advantage to knowing Emacs keyboard shortcuts is that many of them also apply in Bash: + + * C-a—go to the beginning of a line + * C-e—go to the end of a line + * C-k—cut the whole line + * M-f—go forward a word + * M-b—go back a word + * M-d—cut a word + * C-y—yank back (paste) the most recently cut content + * M-Shift-U—capitalize a word + * C-t—swap two characters (for example, sl becomes ls) + + + +There are many more examples, and it an make your interactions with your Bash terminal faster than you ever imagined. + +### Packages + +Emacs has a built-in package manager to help you discover new plugins. Its package manager contains modes to help you edit specific types of text (for instance, if you edit JSON files frequently, you might try ejson-mode), embedded applications, themes, spellchecking options, linters, and more. This is where Emacs has the potential to become crucial to your daily computing; once you find a great Emacs package, you may not be able to live without it. + +![Emacs emoji][8] + +You can browse packages by pressing M-x (that's Alt+X) and then typing **package-list-packages** command and then pressing Return or Enter. The package manager updates its cache each time you launch it, so be patient the first time you use it while it downloads a list of available packages. Once loaded, you can navigate with your keyboard or mouse (remember, Emacs is a GUI application). Each package name is a button, so either move your cursor over it and press Return or just click it with your mouse. You can read about the package in the new window that appears in your Emacs frame, and then install it with the Install button. + +Some packages need special configuration, which is sometimes listed in its description, but other times require you to visit the package's home page to read more about it. For example, the auto-complete package ac-emoji installs easily but requires you to have a symbol font defined. It works either way, but you only see the corresponding emoji if you have the font installed, and you might not know that unless you visit its homepage. + +### Tetris + +Emacs has games, believe it or not. There's Sudoku, quizzes, minesweeper, a just-for-fun psychotherapist, and even Tetris. These aren't particularly useful, but interacting with Emacs on any level is great practice, and games are a great way to maximize your time spent in Emacs. + +![Emacs tetris][9] + +Tetris is also how I was introduced to Emacs in the first place, so of all versions of the game, it's the Emacs version that's truly my favorite. + +### Using Emacs + +GNU Emacs is popular because it's impossibly flexible and highly extensible. People get so accustomed to Emacs keyboard shortcuts that they habitually try to use them in all other applications, and they build applications into Emacs, so they never have to leave in the first place. If you want Emacs to play an important role in your computing life, the ultimate key is to embrace the unknown and start using Emacs. Stumble through it until you've discovered how to make it work for you, and then settle in for 40 years of comfort. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/getting-started-emacs + +作者:[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/keyboaord_enter_writing_documentation.jpg?itok=kKrnXc5h (Computer keyboard typing) +[2]: https://opensource.com/downloads/emacs-cheat-sheet +[3]: https://opensource.com/downloads/cheat-sheet-vim +[4]: https://opensource.com/article/17/2/pocketchip-or-pi +[5]: https://opensource.com/sites/default/files/uploads/emacs-slackware.jpg (Emacs slackware) +[6]: https://opensource.com/sites/default/files/uploads/emacs-tutorial-map.png (Emacs tutorial map) +[7]: https://opensource.com/sites/default/files/uploads/emacs-function.jpg (Emacs function) +[8]: https://opensource.com/sites/default/files/uploads/emacs-emoji_0.jpg (Emacs emoji) +[9]: https://opensource.com/sites/default/files/uploads/emacs-tetris.jpg (Emacs tetris) diff --git a/sources/tech/20200311 Directing Kubernetes traffic with Traefik.md b/sources/tech/20200311 Directing Kubernetes traffic with Traefik.md new file mode 100644 index 0000000000..76a457be59 --- /dev/null +++ b/sources/tech/20200311 Directing Kubernetes traffic with Traefik.md @@ -0,0 +1,394 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Directing Kubernetes traffic with Traefik) +[#]: via: (https://opensource.com/article/20/3/kubernetes-traefik) +[#]: author: (Lee Carpenter https://opensource.com/users/carpie) + +Directing Kubernetes traffic with Traefik +====== +A step-by-step walkthrough on ingressing traffic into a +Kubernetes-Raspberry Pi cluster. +![Digital creative of a browser on the internet][1] + +In this article, we will deploy a couple of simple websites and learn how to ingress traffic from the outside world into our cluster using Traefik. After that, we will learn how to remove Kubernetes resources as well. Let’s get started! + +### Materials needed + +To follow along with the article, you only need [the k3s Raspberry Pi cluster][2] we built in a previous article. Since your cluster will be pulling images from the web, the cluster will need to be able to access the internet. + +Some configuration files and sample HTML files will be shown in this article for explanation purposes. All sample files can be downloaded [here][3]. + +### Deploying a simple website + +Previously, we did a direct deploy with **kubectl**. This is not the typical way to deploy things, however. Generally, YAML configuration files are used, and that is what we will use in this article. We will start at the top and create our configuration files in a top-down approach. + +### Deployment configuration + +First up is the deployment configuration. The configuration is shown below, and the explanation follows. I typically use the samples from the [Kubernetes documentation][4] as a starting point and then modify them to suit my needs. For example, the configuration below was modified after copying the sample from the [deployment docs][5]. + +Create a file, **mysite.yaml**, with the following contents: + + +``` +apiVersion: apps/v1 +kind: Deployment +metadata: +  name: mysite-nginx +  labels: +    app: mysite-nginx +spec: +  replicas: 1 +  selector: +    matchLabels: +      app: mysite-nginx +  template: +    metadata: +      labels: +        app: mysite-nginx +    spec: +      containers: +      - name: nginx +        image: nginx +        ports: +        - containerPort: 80 +``` + +Most of this is boilerplate. The important parts, we have named our deployment **mysite-nginx** with an **app** label of **mysite-nginx **as well. We have specified that we want one **replica** which means there will only be one pod created. We also specified **one container**, which we named **nginx**. We specified the **image** to be **nginx**. This means, on deployment, k3s will download the **nginx** image from DockerHub and create a pod from it. Finally, we specified a **containerPort** of **80**, which just means that inside the container the pod will listen on port **80**. + +I emphasized "inside the container" above because it is an important distinction. As we have the container configured, it is only accessible inside the container, and it is further restricted to an internal network. This is necessary to allow multiple containers to listen on the same container ports. In other words, with this configuration, some other pod could listen on its container port 80 as well and not conflict with this one. To provide formal access to this pod, we need a **service** configuration. + +### Service configuration + +In Kubernetes, a **service** is an abstraction. It provides a means to access a pod or set of pods. One connects to the service and the service routes to a single pod or load balances to multiple pods if multiple pod replicas are defined. + +The service can be specified in the same configuration file, and that is what we will do here. Separate configuration areas with **`---`**. Add the following to **mysite.yaml**: + + +``` +\--- +apiVersion: v1 +kind: Service +metadata: +  name: mysite-nginx-service +spec: +  selector: +    app: mysite-nginx +  ports: +    - protocol: TCP +      port: 80 +``` + +In this configuration, we have named our service **mysite-nginx-service**. We provided a `selector` of **app: mysite-nginx**. This is how the service chooses the application containers it routes to. Remember, we provided an **app** label for our container as **mysite-nginx**. This is what the service will use to find our container. Finally, we specified that the service protocol is **TCP** and the service listens on port **80**. + +### Ingress configuration + +The ingress configuration specifies how to get traffic from outside our cluster to services inside our cluster. Remember, k3s comes pre-configured with Traefik as an ingress controller. Therefore, we will write our ingress configuration specific to Traefik. Add the following to **mysite.yaml **( and don’t forget to separate with **`---`**): + + +``` +\--- +apiVersion: networking.k8s.io/v1beta1 +kind: Ingress +metadata: +  name: mysite-nginx-ingress +  annotations: +    kubernetes.io/ingress.class: "traefik" +spec: +  rules: +  - http: +      paths: +      - path: / +        backend: +          serviceName: mysite-nginx-service +          servicePort: 80 +``` + +In this configuration, we have named the ingress record **mysite-nginx-ingress**. And we told Kubernetes that we expect **traefik** to be our ingress controller with the **kubernetes.io/ingress.class** annotation. + +In the **rules** section, we are basically saying, when **http** traffic comes in, and the **path** matches **`/`** (or anything below that), route it to the **backend** service specified by the **serviceName mysite-nginx-service**, and route it to **servicePort 80**. This connects incoming HTTP traffic to the service we defined earlier. + +### Something to deploy + +That is really it as far as configuration goes. If we deployed now, we would get the default **nginx** page, but that is not what we want. Let’s create something simple but custom to deploy. Create the file **index.html** with the following contents: + + +``` +<html> +<head><title>K3S!</title> +  <style> +    html { +      font-size: 62.5%; +    } +    body { +      font-family: sans-serif; +      background-color: midnightblue; +      color: white; +      display: flex; +      flex-direction: column; +      justify-content: center; +      height: 100vh; +    } +    div { +      text-align: center; +      font-size: 8rem; +      text-shadow: 3px 3px 4px dimgrey; +    } +  </style> +</head> +<body> +  <div>Hello from K3S!</div> +</body> +</html> +``` + +We have not yet covered storage mechanisms in Kubernetes, so we are going to cheat a bit and just store this file in a Kubernetes config map. This is not the recommended way to deploy a website, but it will work for our purposes. Run the following: + + +``` +`kubectl create configmap mysite-html --from-file index.html` +``` + +This command creates a `configmap` resource named **mysite-html** from the local file **index.html**. This essentially stores a file (or set of files) inside a Kubernetes resource that we can call out in configuration. It is typically used to store configuration files (hence the name), so we are abusing it a bit here. In a later article, we will discuss proper storage solutions in Kubernetes. + +With the config map created, let’s mount it inside our **nginx** container. We do this in two steps. First, we need to specify a **volume**, calling out the config map. Then we need to mount the volume into the **nginx** container. Complete the first step by adding the following under the **spec** label, just after **containers** in **mysite.yaml**: + + +``` +      volumes: +      - name: html-volume +        configMap: +          name: mysite-html +``` + +This tells Kubernetes that we want to define a **volume**, with the name **html-volume** and that volume should contain the contents of the **configMap** named **html-volume** (which we created in the previous step). + +Next, in the **nginx** container specification, just under **ports**, add the following: + + +``` +        volumeMounts: +        - name: html-volume +          mountPath: /usr/share/nginx/html +``` + +This tells Kubernetes, for the **nginx** container, we want to mount a **volume** named **html-volume** at the path (in the container) **/usr/share/nginx/html**. Why **/usr/share/nginx/html**? That is where the **nginx** image serves HTML from. By mounting our volume at that path, we have replaced the default contents with our volume contents. + +For reference, the **deployment** section of the configuration file should now look like this: + + +``` +apiVersion: apps/v1 +kind: Deployment +metadata: +  name: mysite-nginx +  labels: +    app: mysite-nginx +spec: +  replicas: 1 +  selector: +    matchLabels: +      app: mysite-nginx +  template: +    metadata: +      labels: +        app: mysite-nginx +    spec: +      containers: +      - name: nginx +        image: nginx +        ports: +        - containerPort: 80 +        volumeMounts: +        - name: html-volume +          mountPath: /usr/share/nginx/html +      volumes: +      - name: html-volume +        configMap: +          name: mysite-html +``` + +### Deploy it! + +Now we are ready to deploy! We can do that with: + + +``` +`kubectl apply -f mysite.yaml` +``` + +You should see something similar to the following: + + +``` +deployment.apps/mysite-nginx created +service/mysite-nginx-service created +ingress.networking.k8s.io/mysite-nginx-ingress created +``` + +This means that Kubernetes created resources for each of the three configurations we specified. Check on the status of the pods with: + + +``` +`kubectl get pods` +``` + +If you see a status of **ContainerCreating**, give it some time and run **kubectl get pods** again. Typically, the first time, it will take a while because k3s has to download the **nginx** image to create the pod. After a while, you should get a status of **Running**. + +### Try it! + +Once the pod is running, it is time to try it. Open up a browser and type **kmaster** into the address bar. + +![][6] + +Congratulations! You’ve deployed a website on your k3s cluster! + +### Another one + +So now we have a whole k3s cluster running a single website. But we can do more! What if we have another website we want to serve on the same cluster? Let’s see how to do that. + +Again, we need something to deploy. It just so happens that my dog has a message she has wanted the world to know for some time. So, I crafted some HTML just for her (available from the samples zip file). Again, we will use the config map trick to host our HTML. This time we are going to poke a whole directory (the **html** directory) into a config map, but the invocation is the same. + + +``` +`kubectl create configmap mydog-html --from-file html` +``` + +Now we need to create a configuration file for this site. It is almost exactly the same as the one for **mysite.yaml**, so start by copying **mysite.yaml** to **mydog.yaml**. Now edit **mydog.yaml** to be: + + +``` +apiVersion: apps/v1 +kind: Deployment +metadata: +  name: mydog-nginx +  labels: +    app: mydog-nginx +spec: +  replicas: 1 +  selector: +    matchLabels: +      app: mydog-nginx +  template: +    metadata: +      labels: +        app: mydog-nginx +    spec: +      containers: +      - name: nginx +        image: nginx +        ports: +        - containerPort: 80 +        volumeMounts: +        - name: html-volume +          mountPath: /usr/share/nginx/html +      volumes: +      - name: html-volume +        configMap: +          name: mydog-html +\--- +apiVersion: v1 +kind: Service +metadata: +  name: mydog-nginx-service +spec: +  selector: +    app: mydog-nginx +  ports: +    - protocol: TCP +      port: 80 +\--- +apiVersion: networking.k8s.io/v1beta1 +kind: Ingress +metadata: +  name: mydog-nginx-ingress +  annotations: +    kubernetes.io/ingress.class: "traefik" +    traefik.frontend.rule.type: PathPrefixStrip +spec: +  rules: +  - http: +      paths: +      - path: /mydog +        backend: +          serviceName: mydog-nginx-service +          servicePort: 80 +``` + +We can do most of the edits by simply doing a search and replace of **mysite** to **mydog**. The two other edits are in the ingress section. We changed **path** to **/mydog **and we added an annotation, **traefik.frontend.rule.type: PathPrefixStrip**. + +The specification of the path **/mydog** instructs Traefik to route any incoming request that requests a path starting with **/mydog** to the **mydog-nginx-service**. Any other path will continue to be routed to **mysite-nginx-service.** + +The new annotation, **PathPrefixStrip**, tells Traefik to strip off the prefix **/mydog** before sending the request to **mydog-nginx-service**. We did this because the **mydog-nginx** application doesn’t expect a prefix. This means we could change where the service was mounted simply by changing the prefix in the ingress record. + +Now we can deploy like we did before: + + +``` +`kubectl apply -f mydog.yaml` +``` + +And now, my dog’s message should be available at . + +![][7] + +Phew! The message is out! Maybe we can all get some sleep tonight. + +So now, we have a k3s cluster hosting two websites with Traefik making decisions, based on path names, as to which service to pass the request to! We are not limited to path-based routing, however. We could use hostname based routing as well, which we will explore in a future article. + +Also, the websites we just hosted are standard unencrypted HTML sites. Everything these days is encrypted with SSL/TLS. In our next article, we will add support to our k3s cluster to host SSL/TLS HTTPS sites as well! + +### Cleaning up + +Before you go, since this article mostly dealt with sample sites, I would like to show you how to delete things in case you don’t want the samples hanging around on your cluster. + +For most configurations, you can undo the configuration simply by running the **delete** command with the same configuration file you deployed with. So let’s clean up both **mysite** and **mydog**. + + +``` +kubectl delete -f mysite.yaml +kubectl delete -f mydog.yaml +``` + +Since we manually created the config maps, we’ll need to delete those manually as well. + + +``` +kubectl delete configmap mysite-html +kubectl delete configmap mydog-html +``` + +Now if we do a **kubectl get pods**, we should see that our nginx pods are no longer around. + + +``` +$ kubectl get pods +No resources found in default namespace. +``` + +Everything is cleaned up. + +Tell me what thoughts you have on this project in the comments below. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/kubernetes-traefik + +作者:[Lee Carpenter][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/carpie +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) +[2]: https://opensource.com/article/20/3/kubernetes-raspberry-pi +[3]: https://gitlab.com/carpie/ingressing_with_k3s/-/archive/master/ingressing_with_k3s-master.zip +[4]: https://kubernetes.io/docs/ +[5]: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#creating-a-deployment +[6]: https://opensource.com/sites/default/files/uploads/mysite.jpg +[7]: https://opensource.com/sites/default/files/uploads/mydog.jpg diff --git a/sources/tech/20200311 Using the Quarkus Framework on Fedora Silverblue - Just a Quick Look.md b/sources/tech/20200311 Using the Quarkus Framework on Fedora Silverblue - Just a Quick Look.md new file mode 100644 index 0000000000..1d72cd1d03 --- /dev/null +++ b/sources/tech/20200311 Using the Quarkus Framework on Fedora Silverblue - Just a Quick Look.md @@ -0,0 +1,209 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using the Quarkus Framework on Fedora Silverblue – Just a Quick Look) +[#]: via: (https://fedoramagazine.org/using-the-quarkus-framework-on-fedora-silverblue-just-a-quick-look/) +[#]: author: (Stephen Snow https://fedoramagazine.org/author/jakfrost/) + +Using the Quarkus Framework on Fedora Silverblue – Just a Quick Look +====== + +![Using the Quarkus Framework on Fedora Silverblue – Just a Quick Look][1] + +[Quarkus][2] is a framework for Java development that is described on their web site as: + +> A Kubernetes Native Java stack tailored for OpenJDK HotSpot and GraalVM, crafted from the best of breed Java libraries and standards +> +> – Feb. 5, 2020 + +Silverblue — a Fedora Workstation variant with a container based workflow central to its functionality — should be an ideal host system for the Quarkus framework. + +There are currently two ways to use Quarkus with Silverblue. It can be run in a pet container such as Toolbox/Coretoolbox. Or it can be run directly in a terminal emulator. This article will focus on the latter method. + +### Why Quarkus + +[According to Quarkus.io][3]: “Quarkus has been designed around a containers first philosophy. What this means in real terms is that Quarkus is optimized for low memory usage and fast startup times.” To achieve this, they employ first class support for Graal/Substrate VM, build time Metadata processing, reduction in reflection usage, and native image preboot. For details about why this matters, read [Container First][3] at Quarkus. + +### Prerequisites + +A few prerequisites will need to configured before you can start using Quarkus. First, you need an IDE of your choice. Any of the popular ones will do. VIM or Emacs will work as well. The Quarkus site provides full details on how to set up the three major Java IDE’s (Eclipse, Intellij Idea, and Apache Netbeans). You will need a version of JDK installed. JDK 8, JDK 11 or any distribution of OpenJDK is fine. GrallVM 19.2.1 or 19.3.1 is needed for compiling down to native. You will also need Apache Maven 3.53+ or Gradle. This article will use Maven because that is what the author is more familiar with. Use the following command to layer Java 11 OpenJDK and Maven onto Silverblue: + +``` +$ rpm-ostree install java-11-openjdk* maven +``` + +Alternatively, you can download your favorite version of Java and install it directly in your home directory. + +After rebooting, configure your _JAVA_HOME_ and _PATH_ environment variables to reference the new applications. Next, go to the [GraalVM download page][4], and get GraalVM version 19.2.1 or version 19.3.1 for Java 11 OpenJDK. Install Graal as per the instructions provided. Basically, copy and decompress the archive into a directory under your home directory, then modify the _PATH_ environment variable to include Graal. You use it as you would any JDK. So you can set it up as a platform in the IDE of your choice. Now is the time to setup the native image if you are going to use one. For more details on setting up your system to use Quarkus and the Quarkus native image, check out their [Getting Started tutorial][5]. With these parts installed and the environment setup, you can now try out Quarkus. + +### Bootstrapping + +Quarkus recommends you create a project using the bootstrapping method. Below are some example commands entered into a terminal emulator in the Gnome shell on Silverblue. + +``` +$ mvn io.quarkus:quarkus-maven-plugin:1.2.1.Final:create \ + -DprojectGroupId=org.jakfrost \ + -DprojectArtifactId=silverblue-logo \ + -DclassName="org.jakfrost.quickstart.GreetingResource" \ + -Dpath="/hello" +$ cd silverblue-logo +``` + +The bootstrapping process shown above will create a project under the current directory with the name _silverblue-logo_. After this completes, start the application in development mode: + +``` +$ ./mvnw compile quarkus:dev +``` + +With the application running, check whether it responds as expected by issuing the following command: + +``` +$ curl -w '\n' http://localhost:8080/hello +``` + +The above command should print _hello_ on the next line. Alternatively, test the application by browsing to __ with your web browser. You should see the same lonely _hello_ on an otherwise empty page. Leave the application running for the next section. + +### Injection + +Open the project in your favorite IDE. If you are using Netbeans, simply open the project directory where the _pom.xml_ file resides. Now would be a good time to have a look at the _pom.xml_ file. + +Quarkus uses ArC for its dependency injection. ArC is a dependency of quarkus-resteasy, so it is already part of the core Quarkus installation. Add a companion bean to the project by creating a java class in your IDE called _GreetingService.java_. Then put the following code into it: + +``` +import javax.enterprise.context.ApplicationScoped; + +@ApplicationScoped +public class GreetingService { + + public String greeting(String name) { + return "hello " + name; + } + +} +``` + +The above code is a verbatim copy of what is used in the injection example in the Quarkus Getting Started tutorial. Modify _GreetingResource.java_ by adding the following lines of code: + +``` +import javax.inject.Inject; +import org.jboss.resteasy.annotations.jaxrs.PathParam; + +@Inject + GreetingService service;//inject the service + + @GET //add a getter to use the injected service + @Produces(MediaType.TEXT_PLAIN) + @Path("/greeting/{name}") + public String greeting(@PathParam String name) { + return service.greeting(name); + } +``` + +If you haven’t stopped the application, it will be easy to see the effect of your changes. Just enter the following _curl_ command: + +``` +$ curl -w '\n' http://localhost:8080/hello/greeting/Silverblue +``` + +The above command should print _hello Silverblue_ on the following line. The URL should work similarly in a web browser. There are two important things to note: + + 1. The application was running and Quarkus detected the file changes on the fly. + 2. The injection of code into the app was very easy to perform. + + + +### The native image + +Next, package your application as a native image that will work in a _podman_ container. Exit the application by pressing **CTRL-C**. Then use the following command to package it: + +``` +$ ./mvnw package -Pnative -Dquarkus.native.container-runtime=podman +``` + +Now, build the container: + +``` +$ podman build -f src/main/docker/Dockerfile.native -t silverblue-logo/silverblue-logo +``` + +Now run it with the following: + +``` +$ podman run -i --rm -p 8080:8080 localhost/silverblue-logo/silverblue-logo +``` + +To get the container build to successfully complete, it was necessary to copy the _/target_ directory and contents into the _src/main/docker/_ directory. Investigation as to the reason why is still required, and though the solution used was quick and easy, it is not an acceptable way to solve the problem. + +Now that you have the container running with the application inside, you can use the same methods as before to verify that it is working. + +Point your browser to the URL and you should get a _index.html_ that is automatically generated by Quarkus every time you create or modify an application. It resides in the _src/main/resources/META-INF/resources/_ directory. Drop other HTML files in this _resources_ directory to have Quarkus serve them on request. + +For example, create a file named _logo.html_ in the _resources_ directory containing the below markup: + +``` + + + + + Silverblue + + + + +
+ Fedora Silverblue +
+ + +``` + +Next, save the below image alongside the _logo.html_ file with the name _fedora-silverblue-logo.png_: + +![][6] + +Now view the results at . + +#### Testing your application + +Quarkus supports junit 5 tests. Look at your project’s _pom.xml_ file. In it you should see two test dependencies. The generated project will contain a simple test, named _GreetingResourceTest.java_. Testing for the native file is only supported in _prod_ mode. However, you can test the _jar_ file in _dev_ mode. These tests are RestAssured, but you can use whatever test library you wish with Quarkus. Use Maven to run the tests: + +``` +$ ./mvnw test +``` + +More details can be found in the Quarkus [Getting Started][7] tutorial. + +#### Further reading and tutorials + +Quarkus has an extensive collection of [tutorials and guides][8]. They are well worth the time to delve into the breadth of this microservices framework. + +Quarkus also maintains a [publications][9] page that lists some very interesting articles on actual use cases of Quarkus. This article has only just scratched the surface of the topic. If what was presented here has piqued your interest, then follow the above links for more information. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/using-the-quarkus-framework-on-fedora-silverblue-just-a-quick-look/ + +作者:[Stephen Snow][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/jakfrost/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/02/quarkus-816x345.jpg +[2]: https://quarkus.io/ +[3]: https://quarkus.io/vision/container-first +[4]: https://www.graalvm.org/downloads/ +[5]: https://quarkus.io/get-started/ +[6]: https://fedoramagazine.org/wp-content/uploads/2020/02/fedora-silverblue-logo.png +[7]: https://quarkus.io/guides/getting-started +[8]: https://quarkus.io/guides/ +[9]: https://quarkus.io/publications/ diff --git a/sources/tech/20200311 What you need to know about variables in Emacs.md b/sources/tech/20200311 What you need to know about variables in Emacs.md new file mode 100644 index 0000000000..d66ba374f4 --- /dev/null +++ b/sources/tech/20200311 What you need to know about variables in Emacs.md @@ -0,0 +1,243 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What you need to know about variables in Emacs) +[#]: via: (https://opensource.com/article/20/3/variables-emacs) +[#]: author: (Clemens Radermacher https://opensource.com/users/clemera) + +What you need to know about variables in Emacs +====== +Learn how Elisp deals with variables and to use them in your scripts and +configurations. +![Programming keyboard.][1] + +GNU Emacs is written in C and Emacs Lisp (Elisp), a dialect of the Lisp programming language. Because it's a text editor that happens to be an Elisp sandbox, it is helpful to understand how basic programming concepts work in Elisp. + +If you're new to [Emacs][2], visit Sacha Chua's excellent list of [resources for Emacs beginners][3]. This article assumes you're familiar with common Emacs terminology and that you know how to read and evaluate basic snippets of Elisp code. Ideally, you should also have heard of variable scope and how it works in another programming language. The examples also assume you use a fairly recent Emacs version ([v.25 or later][4]). + +The [Elisp manual][5] includes everything there is to know, but it is written for people who already know what they are looking for (and it is really great for that). But many people want resources that explain Elisp concepts at a higher level and reduce the amount of information to the most useful bits. This article is my attempt to respond to that—to give readers a good grasp of the basics so they can use them for their configuration and make it easier for people to look up some detail in the manual. + +### Global variables + +User options defined with **defcustom** and variables defined with **defvar** or **defconst** are global. One important aspect of variables declared by **defcustom** or **defvar** is that reevaluating them won't reset a variable if it is already bound. For example, if you establish a binding for **my-var** in your init file like this: + + +``` +`(setq my-var nil)` +``` + +evaluating the following form won't reset the variable to **t**: + + +``` +`(defvar my-var t)` +``` + +Note that there is _one exception_: If you evaluate the declaration above with **C-M-x** that calls **eval-defun**, the value will be reset to **t**. This way, you can enforce setting the value if you need to. This behavior is intentional: As you might know, many features in Emacs load only on demand (i.e., they are autoloaded). If the declarations in those files reset variables to their default value, this would override any settings in your init. + +### User options + +A user option is simply a global variable that is declared with **defcustom**. Unlike variables declared with **defvar**, such a variable is configurable with the  **M-x customize** interface. As far as I know, most people don't use it much because it feels clunky. Once you know how to set variables in your init file, there's no compelling reason to use it. One detail many users aren't aware of is that setting user options with **customize** might execute code, and this is sometimes used to run additional setup instructions: + + +``` +(defcustom my-option t +  "My user option." +  :set (lambda (sym val) +         (set-default sym val) +         (message "Set %s to %s" sym val))) +``` + +If you evaluate this code and change the value using the **customize** interface with **M-x customize-option RET my-option RET **the lambda will be called, and the message in the echo area will tell you the symbol and value of the option. + +If you use **setq** in your init file, to change the value of such an option, the setter function will _not_ run. To set such an option correctly with Elisp, you need to use the function **customize-set-variable**. Alternatively, people use various versions of **csetq** macros in their configs to automatically take care of this (you can use GitHub code search to discover more sophisticated variants if you like): + + +``` +(defmacro csetq (sym val) +  `(funcall (or (get ',sym 'custom-set) 'set-default) ',sym ,val)) +``` + +If you are using the [use-package][6] macro, the **:custom** keyword will handle this for you. + +After putting the code above into your init file, you can use **csetq** to set variables in a way that respects any existing setter functions. You can prove this by watching the message in the echo area when using this macro to change the option defined above: + + +``` +`(csetq my-option nil)` +``` + +### Dynamic binding and lexical binding + +If you use other programming languages, you may not be aware of the differences between dynamic and lexical binding. Most programming languages today use lexical binding, and there is no need to know the difference when you learn about variable scope/lookup. + +Emacs Lisp is special in this regard because dynamic binding is the default, and lexical binding must be enabled explicitly. There are historical reasons for this, and in practice, you should _always_ enable lexical binding because it is faster and less error-prone. To enable it, simply put the following comment line as the first line in your Emacs Lisp file: + + +``` +`;;; -*- lexical-binding: t; -*-` +``` + +Alternatively, you can call M-x **add-file-local-variable-prop-line**, which will insert the comment line above when you choose the variable **lexical-binding** with value **t**. + +When a file with such a specially formatted line is loaded, Emacs sets the variable accordingly, which means the code in that buffer is loaded with lexical binding enabled. Interactively, you can use **M-x eval-buffer**, which takes the lexical binding setting into account. + +Now that you know how to enable lexical binding, it's smart to learn what the terms mean. With dynamic binding, the last binding established during program execution is used for variable lookup. You can test this by putting the following code in an empty buffer and executing **M-x eval-buffer**: + + +``` +(defun a-exists-only-in-my-body (a) +  (other-function)) + +(defun other-function () +  (message "I see `a', its value is %s" a)) + +(a-exists-only-in-my-body t) +``` + +You may be surprised to see that the lookup of variable **a** in the **other-function** is successful. + +If you retry the preceding example with the special lexical-binding comment at the top, the code will throw a "variable is void" error because **other-function** does not know about the **a** variable. If you're coming from another programming language, this is the behavior you would expect. + +With lexical binding, the scope is defined by the surrounding source code. This is not only for performance reasons—experience and time have shown that this behavior is preferred. + +### Special variables and dynamic binding + +As you may know, **let** is used to temporary establish local bindings: + + +``` +(let ((a "I'm a") +      (b "I'm b")) +  (message "Hello, %s. Hello %s" a b)) +``` + +Here is the thing: Variables declared with **defcustom**, **defvar**, or **defconst** are called _special variables_, and they continue to use dynamic binding regardless of whether lexical binding is enabled: + + +``` +;;; -*- lexical-binding: t; -*- + +(defun some-other-function () +  (message "I see `c', its value is: %s" c)) + +(defvar c t) + +(let ((a "I'm lexically bound") +      (c "I'm special and therefore dynamically bound")) +  (some-other-function) +  (message "I see `a', its values is: %s" a)) +``` + +To see both messages in the example above, switch to the ***Messages*** buffer using **C-h e**. + +Local variables bound with **let** or function arguments follow the lookup rules defined by the **lexical-binding** variable, but global variables defined with **defvar**, **defconst**, or **defcustom** can be changed deep down in the call stack for the duration of the **let** body. + +This behavior allows for convenient ad-hoc customizations and is often used in Emacs, which isn't surprising given that Emacs Lisp started out with dynamic binding being the only option. Here is a common example showing how you can temporarily write to a read-only buffer: + + +``` +(let ((inhibit-read-only t)) +  (insert ...)) +``` + +Here is another often-seen example for performing case-sensitive searches: + + +``` +(let ((case-fold-search nil)) +  (some-function-which-uses-search ...)) +``` + +Dynamic binding allows you to change the behavior of functions in ways the authors of those functions may have never anticipated. It's a powerful tool and a great feature for a program that is designed and used like Emacs. + +There is one caveat to be aware of: You might accidentally use a local variable name that is declared as a special variable elsewhere. One trick to prevent such conflicts is to avoid dashes in local variables' names. In my current Emacs session, this leaves only a handful of potential conflicting candidates: + + +``` +(let ((vars ())) +  (mapatoms +   (lambda (cand) +     (when (and (boundp cand) +                (not (keywordp cand)) +                (special-variable-p cand) +                (not (string-match "-" +                                   (symbol-name cand)))) +       (push cand vars)))) +  vars) ;; => (t obarray noninteractive debugger nil) +``` + +### Buffer-local variables + +Each buffer can have a local binding for a variable. This means any variable lookup made while this buffer is current will reveal the buffer's local value of that variable instead of the default value. Local variables are an important feature in Emacs; for example, they are used by major modes to establish their buffer-local behavior and settings. + +You have already seen a buffer-local variable in this article: the special comment line for **lexical-binding** that binds the buffer locally to **t**. In Emacs, such buffer-local variables defined in special comment lines are also called _file-local variables_. + +Any global variable can be shadowed by a buffer-local variable. Take, for example, the **my-var** variable defined above, which you can set locally like this: + + +``` +(setq-local my-var t) +;; or (set (make-local-variable 'my-var) t) +``` + +**my-var** is local to the buffer, which is current when you evaluate the code above. If you call **describe-variable** on it, the documentation tells you both the local value and the global one. Programmatically, you can check the local value using **buffer-local-value** and the default value with **default-value**. To remove the local version, you could invoke  **M-x kill-local-variable**. + +Another important property to be aware of is that once a variable is buffer-local, any further use of **setq** (while this buffer is current) will continue to set the local value. To set the default value, you would need to use **setq-default**. + +Because local variables are meant for buffer customization, they're used most often in mode hooks. A typical example would be something like this: + + +``` +(add-hook 'go-mode-hook +          (defun go-setup+ () +            (setq-local compile-command +              (if (string-suffix-p "_test.go" buffer-file-name) +                  "go test -v" +                (format "go run %s" +                        (shell-quote-argument +                         (file-name-nondirectory buffer-file-name))))))) +``` + +This sets the compile command used by **M-x compile** for go-mode buffers. + +Another important aspect is that some variables are _automatically_ buffer-local. This means as soon as you **setq** such a variable, it sets a local binding for the current buffer. This feature shouldn't be used often (because this implicit behavior isn't nice), but if you want, you can create such automatically local variables like this: + + +``` +(defvar-local my-automatical-local-var t) +;; or (make-variable-buffer-local 'my-automatical-local-var) +``` + +The variable **indent-tabs-mode** is a built-in example of this. If you use **setq** in your init file to change the value of this variable, it won't affect the default value at all. Only the value for the buffer that is current while loading your init file will be changed. Therefore, you need to use **setq-default** to change the default value of **indent-tabs-mode**. + +### Closing words + +Emacs is a powerful editor, and it only gets more powerful the more you change it to suit your needs. Now you know how Elisp deals with variables and how you can use them in your own scripts and configurations. + +* * * + +_This previously appeared on [With-Emacs][7] under a CC BY-NC-SA 4.0 license and has been adapted (with a merge request) and republished with the author's permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/variables-emacs + +作者:[Clemens Radermacher][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/clemera +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_keyboard_coding.png?itok=E0Vvam7A (Programming keyboard.) +[2]: https://www.gnu.org/software/emacs/ +[3]: http://sachachua.com/blog/p/27144 +[4]: https://www.gnu.org/software/emacs/download.html +[5]: https://www.gnu.org/software/emacs/manual/html_node/elisp/ +[6]: https://github.com/jwiegley/use-package#customizing-variables +[7]: https://with-emacs.com/posts/tutorials/almost-all-you-need-to-know-about-variables/ diff --git a/sources/tech/20200313 How to set up the Raspberry Pi Zero for travel.md b/sources/tech/20200313 How to set up the Raspberry Pi Zero for travel.md new file mode 100644 index 0000000000..5b6ca689d7 --- /dev/null +++ b/sources/tech/20200313 How to set up the Raspberry Pi Zero for travel.md @@ -0,0 +1,472 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to set up the Raspberry Pi Zero for travel) +[#]: via: (https://opensource.com/article/20/3/raspberry-pi-zero) +[#]: author: (Peter Garner https://opensource.com/users/petergarner) + +How to set up the Raspberry Pi Zero for travel +====== +You don't have to invest large amounts of money to build a relatively +powerful system that can be taken on the road and used productively. +![Airplane flying with a globe background][1] + +For some time now, I've been a huge fan of the [Raspberry Pi][2] computer in all of its various forms. I have a number of them, and each has a server role to play. Most of the time, they work extremely well, and I'm safe in the knowledge that the small amount of power they consume is keeping the bills down. + +If you've read my blog before, you may have read my account of how I [migrated my desktop computing][3] to a Pi 3. This worked well for quite a while, but I finally had to accept that editing large graphics and multimedia files was a problem, so I replaced it with an [Intel NUC][4]. My hankering for Pi experimentation was still there, though, and I decided to do a "what-if" exercise and see if it could survive on the road. And that's when I dragged my Pi Zero out of retirement from my spares box. + +### Why travel with a Raspberry Pi + +_"Why would I want to do this? Surely the trend is to travel with as powerful a device as possible?"_ + +Well, it's like this. Last year, my employer issued a decree that in order to conform to its security policy, we would no longer be able to check laptops in as luggage, and not long after, the US government decided to summarily ban carrying laptops in hand baggage to and from certain countries, y'know, for security. So how do we get around that one? The sensible option would be to not travel with a laptop and use a hot-desk style spare at the destination. After all, everything is in the cloud now, right? Or, you could carry your important, commercially sensitive data on a CD/DVD or memory stick, but only if it's encrypted to a standard and your employer's data handling policy allows that. + +The problem is multi-faceted though: What if your role is such that you need to be able to fix software/systems on-the-go and you don't always have access to a "spare" laptop? On the occasions when I travel (by train), I have to lug my laptop with me, and it's a pain over the course of a day. Then there's the loss/theft/damage problem. Laptops can be easy targets, they can get left on trains, or you could be mugged. Or there's the "[evil maid][5]" scenario, in which someone interferes with your device without your knowledge. The list goes on. + +So, here's what you can get with a Pi Zero portable computer: + + * It's small enough to fit in hand baggage or your pocket. + * It's cheap enough at $8 to buy another if yours gets lost/stolen/damaged. + * The entire OS and data are held on a "disk" that is as small as a fingernail, is cheap, and is easily bought in a wide variety of retail outlets. If need be, you can create a new one from a borrowed card from a phone. + * A full development environment with the ability to work offline or online. It can also act as an SSH server so that more than one person can use it at once. + * Safe storage: If you are paranoid or traveling on certain airlines, you can remove the "disk" and store it in your wallet or on your person. If your computer is stolen in transit, go and buy another one off the shelf: you're already set up with the OS. + * Network-tolerant: Around the world, there are country-specific WiFi frequencies, and a simple text-file change enables you to be compliant within minutes. + * Keyboard independent: You can use a compliant Bluetooth keyboard, but when you need to do something more demanding, you can just plug any USB keyboard into the spare USB connector using an On-The-Go cable. + * Power supply tolerant: My 3300mAh power bank can run the Pi Zero for about eight hours, but if all else fails, you can use a TV's USB connector to power it. Generally speaking, if a TV has HDMI, it will also have a USB socket, and the Zero only draws about 120mA. Or use someone's phone charger! + * Finally, if you're unfortunate enough to lose/damage your "disk," you can easily create another by downloading your 2GB image from a secure location in the cloud and burning it to a new card. Try doing _that_ with a normal laptop. + + + +That's motivation enough for me! + +Here is my finished product, with a beer coaster for scale. + +![Pi Zero W setup][6] + +### How I set up the Pi Zero for travel + +The cheap-as-chips Pi Zero has always been a bit of an odd beast, in my opinion. It features a single-core CPU and has a frugal 512MB of memory, some of which it has to share with the onboard video. The Raspbian OS currently based on Debian Stretch is touted as being suitable for the Zero with the LXDE-based "Pixel" GUI desktop, and indeed it can be loaded and started—but in reality, the poor thing really struggles to manage a GUI _and_ run useful software. + +Nevertheless, I was determined to give it a good try and set it up with the apps that have the smallest memory footprint. I'd already been around this loop with the Pi 3, so it was more of the same—only even more so! Bearing in mind this was to be a road warrior's computer, here's what I wanted to have on it: + +Web browser | Lightweight but with privacy in mind +---|--- +Email | IMAP-capable and seamlessly supporting GPG +XMPP/Jabber client | No-nonsense messaging +VPN client | I'm on the road, remember +Tor client | Always useful... +Music | I carry a few MP3s, but internet radio is cool, too +Multiple desktops | Useful with a small screen +Editor/IDE | Hey, it's a working computer! +FTP/SFTP client | Hey, it's a working computer! + +All in all, it's a very useful bundle for my purposes, and if I achieve a balanced environment, it could actually work. + +### Hardware + +The hardware was a bit of a challenge. The battery was not a problem, as I have a variety of rechargeable power packs with varying capacity, so it is really just a question of picking a suitable one for the day. The only prerequisite was that the battery should be able to take a charge while being used, and all my Jackery brand batteries do this. + +For my "disk," I opted for my in-house standard 32GB SanDisk Extreme microSDHC. They're very reliable, and the size is big enough to hold a lot of software and data while still remaining affordable. + +The video output would, I anticipated, be HDMI-out using the Zero's mini-HDMI connector. This suited my purposes well, as the majority of hotel TVs use this interface. Audio would also go via HDMI. + +That left the human interface devices (HID), and this, predictably, caused the most consternation. I hate Bluetooth with a passion, and with the Zero's limited connectors, I'd have to bite the bullet and use a Bluetooth keyboard and mouse, preferably a combined one—and small. There's no point in having a tiny computer if you have lug a great honking keyboard around as well, so my unhappy quest began. + +### Bluetooth woes + +The Zero has a limited number of USB connectors on board—just one, if you allow for the power connector, which obviously means you have limited connection options. You could always use a USB extender hub, but then that's more to carry—including another power supply. That basically leaves you trying to connect a keyboard and mouse via Bluetooth. I don't believe the hype about how it can "_easily connect a wide variety of devices together,_" and I wrestle with a variety of allegedly standard devices trying to get the bloody things to play nicely together. Part of the problem with the Pi (I think) is that there's some unintended interaction between WiFi and Bluetooth that causes weird stuff to happen. My problem was that I was able to connect to the Pi using a keyboard _or_ a mouse, but not both reliably at the same time. And yes, I have a variety of allegedly standards-following Bluetooth devices, none of which decided to work together properly. + +At this point, I was wondering if there was a Bluetooth Samaritan's Helpline, but there wasn't, so what the heck was I going to do?! Temporarily, I resorted to using an Apple USB keyboard with two USB sockets; this was useful for setup but not for being on the road. In the end, I spent hours browsing eBay and Amazon, and then I found it: a "_3- in-1 Mini Wireless Bluetooth Keyboard Mouse Touchpad For Windows iOS Android UK - Backlit, Ultra-thin, Built-in Rechargeable Battery, QWERTY_." Perfect on paper, but would it work? I sent off the money, and four days later, a slim package arrived from China. And it bloody well worked!! First time, every time, it got on with the Pi like pie and chips. I promptly ordered another one—accidents happen, and I wouldn't want to be left in the lurch. + +So, with my hardware lineup complete, I could settle down to setting up the Pi proper. + +### The GUI and the Pi + +Going back to my software requirements, I thought long and hard about the smallest desktop environment and went with the supplied LXDE desktop, which I'd used several times on other projects. Although the Pi struggled a bit with screen handling, it generally performed well, and I started setting up my software.  + +Web browser 1 + +Midori: a good compromise between size and modernity. Supports private browsing and is bundled with the Pi + +Web browser 2 + +Links2 in graphic mode: lightweight, fast, secure, works with proxies + +Email + +Sylpheed: small, light, and works well with GPG + +XMPP/Jabber client + +Profanity. It's great! + +VPN client + +OpenVPN + +Tor client + +Ha! Links2 again + +Music + +SMPlayer: the GUI for MPlayer + +Editor/IDE + +Geany: small and light but powerful + +Image viewer/editor + +Pinta + +FTP/SFTP client + +Filezilla + +**Other stuff:** + +Midnight Commander + +Not just a file manager (more later) + +Tor proxy server + +Always on, so I can use Tor as needed + +Nmap + +I sometimes need to test stuff + +vnStat + +Monitor data usage on the wlan0 interface + +SSH/SFTP server + +Standard issue on this distro + +UFW + +Firewall; can't be too careful! + +Gopher client + +Gopherspace! It's still out there, and I use the _original_ Gopher client! + +All of the above are tried, tested, and very stable packages. The web browser decision was a calculated one: the Zero doesn't _really_ have what it takes to negotiate a modern ~~bloated, ad-ridden~~ website, and honestly, I have a phone that can handle that sort of thing. Likewise, the decision to run a Tor proxy: it's very handy to be able to access Marianas Web, and using Links2 as a browser means that the risk is minimal. + +Sylpheed is a mature package that I believe has largely been replaced by Claws but is actually less demanding of resources. GPG integrated seamlessly with it, and I was able to exchange signed/encrypted messages with ease. It renders both plain-text and HTML messages well, and the interface is uncluttered. + +I needed a _simple_ XMPP/Jabber client. The problem I've found with many apps of this type is that they try to incorporate multiple messaging standards when I only really need XMPP. Profanity is ideal as it does one job and does it very well. + +### System setup + +I spent a considerable amount of time setting up the OS for the best performance; a task made easier because I have set up numerous Raspberry Pis before. In such a small (as in memory) system, the decision to use a swap file was not taken lightly, and unfortunately, using a GUI desktop meant that the swap is in frequent use. The alternative is to not have one and hope that the system doesn't freeze up too much. I went with the suggested default of 100MB. + +I then looked at logging. As this was supposed to be a small, portable system, I didn't see much point in having extensive logging, especially as it would have a negative effect on the SDHC card in the long term. One solution was a combination of disabling logging in apps wherever possible and sacrificing a little memory to create a tmpfs in-memory filesystem. This would have the added advantage that it would be recreated on each boot. So, I worked out that 8MB could be used for this and duly updated **/etc/fstab**. This works extremely well. + + +``` +`tmpfs /var/log tmpfs defaults,noatime,nosuid,mode=0755,size=8m 0 0` +``` + +I also had to update **/etc/rc.local** to provide some essential directories on startup; this kept the rsyslog and Tor daemons happy. + + +``` +mkdir -p /var/log/rsyslog +mkdir -p /var/log/tor/ +mkdir -p /var/log/vnstat/ +chown vnstat.root /var/log/vnstat/ +chown debian-tor /var/log/tor/ +``` + +With all that in place, the little computer was almost ready for Prime Time. But there was a problem. I've already mentioned the frugal amount of memory on the Zero, and even with the GUI and apps pared down to the bone, I was regularly using swap space. To make matters worse, much worse, my carefully set up desktop menus were having problems. + +The Pi desktop comes with an _incredible_ amount of software installed, mainly to satisfy its original purpose as an educational machine. I decided early on to edit the menus to remove a lot of the "junk" and replace it with my list of apps, so I fired up the Main Menu Editor app. Normally this is quite responsive, but on the resource-challenged Zero, it had worrying lags and pauses as I made changes. Ultimately, it meant that my ad-hoc menus were corrupted, and worse still, the default Pi menus had been reinstated. Searching for help with this problem revealed that the menu system is convoluted, and if an update is not saved properly, the defaults will be substituted. + +I looked at the structure of the menus as best I could and decided that trying to pick the frigging things apart was more trouble than it was worth. So, I ditched LXDE/Pixel and installed XFCE (and its even lighter-weight GUI) in its place. This time, the menu editor seemed more stable, but as I made the changes, I realized that yes, it was happening again. At that point, I had a tantrum and threw my toys out of the pram. I'd reached a crossroads in my road-warrior setup: it worked very well apart from the menus, and I felt I couldn't go back after all that work, so, with a heavy heart, I had a drastic rethink. It was supposed to be a hacker's machine, right? It was Linux and, to many like-minded people, that meant a text-based interface, right? + +So I did what I had to do: I ditched the accursed GUI! Yes, go back to the '90s, maybe even earlier, and Run it Like a Boss.™ The main problem I had in my mind was that I'd no longer have nice, safe, icon-driven apps and multiple desktops to work with. My WiFi/network switcher would be no more, and worse still, I'd have to try and manage Bluetooth from the command line. That was going to be a major challenge, but I decided to proceed anyway, and I had a cloned copy of my microSDHC just in case I lost my nerve. + +### Set it up again + +Incidentally, if I were using a full-spec Raspberry Pi 3, I wouldn't have been in this situation. But it was my choice, so… This exercise started out well. I was already rebooting into the terminal login prompt, and the Bluetooth keyboard was working, so I was able to log in (previously, I'd run **startx** to get to the desktop). Since I no longer had the desktop bloat to worry about, my memory usage was a mere 78MB and no swap usage; I felt better already. But what about the apps that make life easy? I did more hunting around, and here's what I came up with. + +Web browser + +Links2 _not_ in graphic mode: lightweight, fast, secure, works with proxies + +Email + +(Neo)Mutt: powerful, extensible and works well with GPG + +XMPP/Jabber client + +Profanity. It's great! + +VPN client + +OpenVPN + +Tor client + +Ha! Links2 again + +Music + +Midnight Commander + mpg123 + +Editor/IDE + +Nano: I'm using it to write this + +FTP/SFTP client + +Midnight Commander + +File manager + +Midnight Commander + +**Other stuff** + +Tor proxy server + +Always on, so I can use Tor as needed + +Nmap + +I sometimes need to test stuff + +vnStat + +Monitor data usage on the wlan0 interface + +SSH/SFTP server + +Standard issue on this distro + +Gopher client + +Gopherspace! It's still out there, and I use the _original_ Gopher client! + +**Graphics workarounds** + +fbcat + +Takes a screenshot using the framebuffer device + +fbi + +Linux framebuffer imageviewer: displays images in a terminal + +fbgs + +Displays PostScript/PDF files using the Linux framebuffer device on a terminal + +pnmtopng + +Converts a PPM into a PNG file + +You'll notice that there's not too much change there, with a few notable exceptions to display graphical content. + +### Do it again, and do it properly + +Things looked good, but I still had some issues to solve. + +#### Desktops + +"But what about the multiple desktops?!" I hear you asking, "How will you view images or connect to WiFi networks?" I needed to find a solution, and fast. For the multiple desktop thing, I decided to install tmux, the Linux Terminal Multiplexer. There are so many good reasons to run tmux on a Linux system, but my key reasons are that it makes multi-screen working possible, and it uses very little memory. It also enables me to connect to the Pi via SSH and take over the session, as you can see below. + +![tmux running on Raspberry Pi][7] + +#### Music + +I must say that it's very important to me to be able to listen to music while I'm working or relaxing, so the loss of (S)MPlayer was a major blow. I was able to listen to single MP3s or complete playlists. I was able to stream internet radio. Sigh. Midnight Commander came to the rescue with its ability to handle various file types. The secret is in the Extension File menu, which looks like this for me: + + +``` +shell/i/.mp3 +    Open=/usr/lib/mc/ext.d/sound.sh open mp3 +regex/i/\\.(m3u|pls)$ +        Open=/usr/lib/mc/ext.d/sound.sh open playlist +``` + +And my sound.sh looks like this: + + +``` +#!/bin/bash +do_open_action() { +    filetype=$1 +    case "${filetype}" in +    playlist) +        mpg123 -C -@ "${MC_EXT_FILENAME}" +        ;; +    m3u) +        mpg123 -C -@ "${MC_EXT_FILENAME}" +        ;; +    mp3) +        mpg123 -C "${MC_EXT_FILENAME}" +        ;; +    *) +        ;; +    esac +        } +case "${action}" in +open) +    ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev/null 2>&1) || \ +        do_open_action "${filetype}" +    ;; +*) +    ;; +esac +``` + +Tapping Enter on an MP3 will play the file, or tapping on an M3U playlist will play whatever's in the playlist. I used the **-C** option so that I could have access to mpg123's controls. Sorted! + +#### SFTP/FTP clients + +Midnight Commander again! You can set up a client connection entry with the built-in menu and use **CTL+\** to select it from a drop-down. The FTP site is rendered in one of the panels as a directory structure, and you can just treat it as you would a local filesystem. SFTP is a bit harder, as you have to set it up as an SSH connection and then copy as required; it's OK if you have password authentication, but for public key authentication, I found it less involved to use SFTP from the command line. For reference, this is the syntax: + + +``` +sftp://[user@]machine:[port]/[remote-dir] + +The user, port and remote-dir elements are optional. +``` + +![MC FTP client example][8] + +#### WiFi selector + +In the GUI world, I had had a nice, icon-based WiFi network manager app that I could use to switch between networks. The text-mode alternative is the bizarrely named wicd-curses*.* It's an app that communicates with wicd (wireless control daemon) using cursor keys, and it works very well. I had to disable the dhcpcd service using systemctl to get it to work, but at least it lets me select the appropriate network, including my home network or my phone's wireless hotspot when I'm out on the road. Here's [how to do it][9]. + +![wicd-curses WiFi app][10] + +#### Email and web browsing + +For email and web browsing, I use Mutt (Neomutt) and Links2, respectively, and they just work. + +#### Gopher + +Trust me; you're not old enough to remember Gopher, the text mode forerunner of the WWW. Strictly speaking, it was before my time as well, but I run a thriving Gopher server, so I need a client. Here's what a Gopher server looks like running on a Raspberry Pi. + + +``` +                gopher://gopher.petergarner.net:70 + +__/\\\\\\\\\\\\\\\\\\_______/\\\\\\\\\\\\\\\\\\\\\\\\\\__________________/\\\\\\____ +_/\\\\\///////\\\\\\____\/\\\\\/////////\\\\\\______________/\\\\\\\\\\____ +_\/\\\\\\_____\/\\\\\\___\/\\\\\\_______\/\\\\\\__/\\\\\\_______/\\\\\/\\\\\\____ +_\/\\\\\\\\\\\\\\\\\\\\\/____\/\\\\\\\\\\\\\\\\\\\\\\\\\/___\///______/\\\\\/\/\\\\\\____ +_\/\\\\\//////\\\\\\____\/\\\\\/////////_____/\\\\\\_____/\\\\\/__\/\\\\\\____ +_\/\\\\\\____\//\\\\\\___\/\\\\\\_____________\/\\\\\\____/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_ +_\/\\\\\\_____\//\\\\\\__\/\\\\\\_____________\/\\\\\\\\__///////////\\\\\//__ +_\/\\\\\\______\//\\\\\\_\/\\\\\\_____________\/\\\\\\_______________\/\\\\\\___ +_\///________\///__\///______________\///_________________\///___ + +               Welcome to... "The Rpi4 Gopher" +               ... your source for local information, and beyond! + + -->  [14] About this server (and legal)/ + +           -- Content + +      [18] Tech-related/ +      [19] Politics and Propaganda (from all sides)/ +      [20] Cyber and Internet related/ +      [21] Stuff (filed under "miscellany")/ +..... +``` + +### Performance + +Overall, I'm pleased to say that my switch to text mode has been very beneficial with userland tasks handled responsively. As you can see from a typical **top** display, there's plenty of available and cached memory remaining from the original 512MB. Right now, I'm listening to a playlist, writing this article in an SSH-connected tmux session, running top**,** and Mutt is handling emails. + +On a regular basis, that's all I'll probably need to do, but it's great to have the option to develop and test software on the go, if I need to. Here's a simple Python script to get the Pi's CPU serial number (type): + + +``` +>>> #!/usr/bin/env python +... +>>> import subprocess +>>> +>>> def GetCPUserial(): +...     cpuinfo = subprocess.check_output(["/bin/cat", "/proc/cpuinfo"]) +...     cpuinfo = cpuinfo.replace("\t","") +...     cpuinfo = cpuinfo.split("\n") +...     [ legend, cpuserial ] = cpuinfo[11].split(' ') +...     return cpuserial +... +>>> print GetCPUserial() +9000c1 +>>> + +[/code] [code] + +top - 15:55:47 up  5:49,  6 users,  load average: 0.21, 0.25, 0.34 +Tasks: 112 total,   1 running, 110 sleeping,   1 stopped,   0 zombie +%Cpu(s): 3.9 us, 5.8 sy, 0.0 ni, 90.3 id, 0.0 wa, 0.0 hi, 0.0 si,   + +KiB Mem :   493252 total, 37984 free,  73248 used, 382020 buff/cache +KiB Swap:   102396 total, 102392 free,     4 used. 367336 avail Mem +``` + +I take regular backups, of course, using the indispensable [rpi-clone][11]. The beauty of this app is that I can copy the entire microSDHC card to another while the Pi is running. It also has the advantage that if I use a smaller capacity card, it will automatically and safely take this into account. I use a 32GB card, but I can dump it to an 8GB card because I'm only using about 4GB. The converse is true for a larger destination card. If you add only one utility to your Pi, this should be it—it's saved me more grief than _anything_ I've ever used! You can also use it to create distribution copies of your system. + +#### Battery life + +I can only describe the battery life as "impressive." Once the Zero is booted up, it takes an average 0.15A / 0.65W with the following running: + + * System + * Bluetooth + * WiFi + * Audio (HDMI) subsystem + * Video (HDMI) subsystem + + + +I've measured 20 hours of mixed usage from my 6000mAh Jackery Jetpack power bank, and if I disable WiFi and just use it in "local" mode, possibly more. It's certainly practical to use it with my smaller, 3300mAh Anker battery, which unfortunately isn't rechargeable while in use. I also have a 20,000mAh battery for long trips: I have yet to try that out. + +### Taking it on the road + +In terms of computing as a challenge, setting up the Zero has been a really valuable exercise. It's taught me to become acquainted with the operating system and app software at a low level in order to squeeze the maximum amount of memory from the system. It's also taught me that I don't have to invest large amounts of money to build a relatively powerful system that can be taken on the road and used productively. + +Now that I've almost finished setting it up, it's time to actually _take_ it on the road and see how it runs in the field. Hey, maybe I'll actually take into a field and see if I can do some work and listen to music. + +* * * + +_This was originally published on [Peter Garner's blog][12] under a CC BY-NC-ND 4.0 license and is reused here with the author's permission._ + +Having recently co-authored a book about building things with the Raspberry Pi ( Raspberry Pi Hacks... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/raspberry-pi-zero + +作者:[Peter Garner][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/petergarner +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/plane_travel_world_international.png?itok=jG3sYPty (Airplane flying with a globe background) +[2]: https://opensource.com/resources/raspberry-pi +[3]: https://www.petergarner.net/projects/Mac_Mini_to_rpi-part_1.pdf +[4]: https://en.wikipedia.org/wiki/Next_Unit_of_Computing +[5]: http://threatbrief.com/evil-maid-attack/ +[6]: https://opensource.com/sites/default/files/uploads/pi-zero-on-the-road.jpg (Pi Zero W setup) +[7]: https://opensource.com/sites/default/files/uploads/tmux-on-pi.png (tmux running on Raspberry Pi) +[8]: https://opensource.com/sites/default/files/uploads/ftp-client-mc.png (MC FTP client example) +[9]: https://www.raspberrypi.org/forums/viewtopic.php?t=150124#p987430 +[10]: https://opensource.com/sites/default/files/uploads/wifi-selector.png (wicd-curses WiFi app) +[11]: https://github.com/billw2/rpi-clone +[12]: https://petergarner.net/notes/index.php?thisnote=20180202-Travels%20with%20a%20Pi diff --git a/sources/tech/20200313 How to whiteboard collaboratively with Drawpile.md b/sources/tech/20200313 How to whiteboard collaboratively with Drawpile.md new file mode 100644 index 0000000000..dba4bce1f8 --- /dev/null +++ b/sources/tech/20200313 How to whiteboard collaboratively with Drawpile.md @@ -0,0 +1,118 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to whiteboard collaboratively with Drawpile) +[#]: via: (https://opensource.com/article/20/3/drawpile) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +How to whiteboard collaboratively with Drawpile +====== +Need to whiteboard or draw something with others? Give Drawpile a try. +![markers for a whiteboard][1] + +Thanks to applications like [Krita][2] and [MyPaint][3], open source software users have all the tools they need to create stunning digital paintings. They are so good that you can see [art created with Krita][4] in some of your [favorite RPG books][5]. And it's getting better all the time; for example, [GIMP][6] 2.10 adopted MyPaint's brush engine, so users can benefit from MyPaint without even installing the whole application. + +But what about collaborative illustration? What do two or more artists do when they want to work together on one piece? What does your work team use when you need to whiteboard during a business meeting? Those are the questions, and the answer is [Drawpile][7]. + +![Drawpile's UI][8] + +Nyarlathotep by Sophia Eberhard + +Drawpile is a drawing application for Linux, Windows, and macOS. It's got a respectable brush engine and all the basic editorial tools (selection tools, flips and flops, mirror, and so on) to make it a good freehand digital paint application. But its most powerful feature is its easy multi-user mode. If you have Drawpile installed, you can host a drawing session from your computer or on a Drawpile server, allowing other users to join you in your virtual studio. This goes well beyond a screen-share session, which would just allow other users to _view_ your painting, and it's not a remote desktop with just one cursor. Drawpile enables several users, each with their own brush, to work on the same canvas at the same time over a network that can span the globe. + +### Installing Drawpile + +If you're using Linux, Drawpile is available as a [Flatpak][9] from [Flathub.org][10]. + +On Windows and macOS, download and install Drawpile from [Drawpile's download page][11]. When you first launch it on macOS, you must right-click on its icon and select **Open** to accept that it hasn't been signed by a registered Apple developer. + +### Drawing with Drawpile + +The Drawpile interface is simple and minimal. Along the right side of the application window are docked palettes, and along the top is a toolbar. Most of the tools available to you are visible: paint brushes, paint buckets, lines, Bézier curves, and so on. + +For quick access to brushes, Drawpile allows you to assign a unique brush, along with all of its settings (including color), to the number keys **1** through **5** on your keyboard. It's an efficient and easy way to quickly move between drawing tools. The **6** key holds an eraser. + +Drawpile also has layers, so you can keep different parts of your painting separate until you combine them for your final render. If you're an animator, you can even use Drawpile's onion skin and flipbook features (both available in the **Layer** menu) to do rudimentary frame-by-frame animation. Unlike Krita, Drawpile doesn't feature an [animation timeline][12], but it's enough for quick and fun animations. + +### Custom brushes + +Drawpile isn't Krita or MyPaint, so its brush engine is simple in comparison. The preset brushes have the usual properties, though, including: + + * **Opacity** adjusts how your strokes blend with existing paint + * **Hardness** defines the edges of your stroke + * **Smudging** allows existing strokes to be affected by your brush + * **Color pickup** allows your paint to pick up color from existing strokes + * **Spacing** controls how often the full brush cursor is sampled during a stroke + + + +Most of these are pressure-sensitive, so if you're using a drawing tablet (Wacom, for instance), then your brush strokes are dynamic depending upon pen pressure. The tablet support is borrowed from Krita, and it makes a big difference (although it's probably overkill for mock-ups or whiteboarding sessions). + +When you find a brush setting you like, you can add it to your brush set so you can use it again later. To add a brush, click the **Menu** button in the top-right corner of the docked **Brushes** palette and select **Add brush**. + +![Adding a brush in Drawpile][13] + +If the **Brushes** palette isn't visible, go to the **View** menu in the top menu bar and select **Brushes** from the **Docks** submenu. + +### Collaborative drawing + +To participate in a shared drawing session, go to the **Session** menu and click either **Host** to host a session or **Join** to join in on an existing one. + +#### Hosting a session + +If you're hosting a session, give your session a title and an optional password (or leave it blank to allow anyone in). In the **Server** section, set whether you're hosting the session from your computer or from someone else's server. You can host sessions on **pub.drawpile.net** for free, but all of your data will be sent out to the internet, which could affect performance. If you have a good internet connection, the lag is negligible, but if you're not confident in your internet speed or there's no reason to go out to the internet because your collaborators are in the same building as you, then you can host your session locally. + +![Settings for hosting a session][14] + +If you host locally, you must provide your IP address or computer name (ending in **.local**) to your collaborators so their Drawpile apps can find your computer. You can find your computer name in the **Sharing** preferences of the GNOME desktop if you're on Linux: + +![Sharing Drawpile in GNOME][15] + +You must enable Remote Login, and possibly adjust your [firewall settings][16] to allow other users to get through. + +On macOS and Windows, you may be running a firewall, and you may need to provide additional sharing permissions in your control panel or system settings. + +#### Joining a session + +If you're joining a session, you need to know either the URL or the IP address of the session you're trying to join. A URL is like a website address, such as syntheticdreams.net/listing. An IP address is the numerical version of a URL, such as 93.184.216.34. Some IP addresses are internal to your building, while others exist out on the internet. If you haven't been invited to a drawing session, you might be able to find a public group on Drawpile's [Communities][17] page. + +### Drawing with friends + +Open source has always been about sharing. Drawpile is not only software you can share with your friends and colleagues; it's software that allows you to work with them in a fun and creative way. Try Drawpile for your next project or boardroom meeting! + +Nick Hamilton talks about what he loves about the open source digital painting tool, Krita, prior... + +Akkana Peck shares three of her favorite GIMP tools. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/drawpile + +作者:[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/markers_whiteboard_draw.png?itok=hp6v1gHC (markers for a whiteboard) +[2]: https://krita.org/en/ +[3]: http://mypaint.org +[4]: https://krita.org/en/item/interview-with-alexandru-sabo/ +[5]: https://paizo.com/products/btpy9g9x?Pathfinder-Roleplaying-Game-Bestiary-5 +[6]: https://www.gimp.org/ +[7]: https://drawpile.net +[8]: https://opensource.com/sites/default/files/uploads/drawpile-ui.jpg (Drawpile's UI) +[9]: https://opensource.com/article/19/10/how-build-flatpak-packaging +[10]: https://flathub.org/apps/details/net.drawpile.drawpile +[11]: https://drawpile.net/download/ +[12]: https://opensource.com/life/16/10/animation-krita +[13]: https://opensource.com/sites/default/files/uploads/drawpile-brush-add.jpg (Adding a brush in Drawpile) +[14]: https://opensource.com/sites/default/files/uploads/drawpile-session-host.png (Settings for hosting a session) +[15]: https://opensource.com/sites/default/files/uploads/gnome-sharing.png (Sharing Drawpile in GNOME) +[16]: https://opensource.com/article/19/7/make-linux-stronger-firewalls +[17]: https://drawpile.net/communities diff --git a/sources/tech/20200313 Open source alternative for multi-factor authentication- privacyIDEA.md b/sources/tech/20200313 Open source alternative for multi-factor authentication- privacyIDEA.md new file mode 100644 index 0000000000..382aa368e5 --- /dev/null +++ b/sources/tech/20200313 Open source alternative for multi-factor authentication- privacyIDEA.md @@ -0,0 +1,85 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Open source alternative for multi-factor authentication: privacyIDEA) +[#]: via: (https://opensource.com/article/20/3/open-source-multi-factor-authentication) +[#]: author: (Cornelius Kölbel https://opensource.com/users/cornelius-k%C3%B6lbel) + +Open source alternative for multi-factor authentication: privacyIDEA +====== +As technology changes, so too will our need to adapt our authentication +mechanisms. +![Three closed doors][1] + +Two-factor authentication, or multi-factor authentication, is not a topic only for nerds anymore. Many services on the internet provide it, and many end-users demand it. While the average end-user might only realize that his preferred web site either offers MFA or it does not, there is more to it behind the scene. + +The two-factor market is changing, and changing rapidly. New authentication methods arise, classical vendors are merging, and products have disappeared. + +The end-user might not be bothered at all, but organizations and companies who want to require multi-factor authentication for their users may wonder where to turn to and which horse to bet on. + +Companies like Secure Computing, Aladdin, SafeNet, Cryptocard, Gemalto, and Thales have been providing authentication solutions for organizations for some decades and have been involved in a round dance of [mergers and acquisitions][2] during the last ten years. And the user was the one who suffered. While the IT department thought it was rolling out a reliable software of a successful vendor, a few years later, they were confronted with the product being end-of-life. + +### How the cloud changes things + +In 1986, RSA released RSA SecurID, a physical hardware token displaying magic numbers based on an unknown, proprietary algorithm. But, almost 20 years later, thanks to the Open Authentication Initiative, HOTP (RFC4226) and TOTP (RFC6238) were specified—originally for OTP hardware tokens. + +SMS Passcode, which specialized in authenticating by sending text messages, was founded in 2005; no hardware token required. While other on-premises solutions kept the authentication server and the enrollment in a confined environment, with SMS Passcode, the authentication information (a secret text message) was transported via the mobile network to the user. + +The iPhone 1 was released in 2007, and the Android phone quickly followed. DUO Security was founded in 2009 as a specific cloud MFA provider, with the smartphone acting as a second factor. Both vendors concentrated on a new second factor—the phone with a text message or the smartphone with an app—and they offered and used infrastructure that was not part of the company's network anymore. + +Classical on-premises vendors started to move to the cloud, either by offering their new services or acquiring smaller vendors with cloud solutions, such as SafeNet's [acquisition of Cryptocard in 2012][3]. It seemed tempting for classical vendors to offer cloud services—no software updates on-premises, no support cases, unlimited scaling, and unlimited revenue. + +Even the old top dog, RSA, now offers a "Cloud Authentication Service." And doesn't it make sense to put authentication services in the cloud? The data is hosted at cloud services like Azure, the identities are hosted in the cloud at Azure AD, so why not put authentication there with Azure MFA? This approach might make sense for companies with a complete cloud-centric approach, but it also probably locks you into one specific vendor. + +Cloud seems a big topic also for multi-factor authentication. But what if you want to stay on-prem? + +### The state of multi-factor authentication technology + +Multi-factor authentication has also come a long way since 1986, when RSA introduced its first OTP tokens. A few decades ago, well-paid consultants made a living by rolling PKI concepts, since smartcard authentication needed a working certificate infrastructure. + +After having OTP keyfob tokens and smartphones with HOTP and TOTP apps and even push notification, the current state-of-the-art authentication seems to be FIDO2/WebAuthn. While U2F was specified by the FIDO Alliance alone, WebAuthn was specified by no one else than W3C, and the good news is, the base requirements have been integrated into all browsers except Internet Explorer. + +However, applications still need to add a lot of code when supporting Webauthn. But WebAuthn allows for new authentication devices like TPM chips in tablets, computers, and smartphones or cheap and small hardware devices. But U2F also looked good back then, and even it did not make the breakthrough. Will WebAuthn do it? + +So these are challenging times since currently, you probably cannot use WebAuthn, but in two years, you'll probably want to. Thus, you need a system that allows you to adapt your authentication mechanisms. + +### Getting actual requirements + +This is one of the first requirements when you are about to choose a flexible multi-factor authentication solution. It will not work out to solely rely on text messages, or on one single smartphone app or only WebAuthn tokens. The smartphone app may vanish; the WebAuthn devices might not be applicable in all situations. + +When looking at the mergers and acquisitions, we learned that it did happen and can happen again; that the software goes end-of-life, or the vendors cease their cloud services. And sometimes it is only the last few months that hurt, when the end of sales means that you cannot buy any new user licenses or onboard any new users! To get a lasting solution, you need to be independent on cloud services and vendor decisions. The safest way to do so is to go for an open source solution. + +But when going for an open source solution, you want to get a reliable system, reliable meaning that you can be sure to get updates that do not break and that bugs will be fixed, and there are people to be asked. + +### An open source alternative: privacyIDEA + +Concentrated experiences in the two-factor market since 2004 have been incorporated into the open source software alternative: [privacyIDEA][4]. + +privacyIDEA is an open source solution providing a wide variety of different authentication technologies. It started with HOTP and TOTP tokens, but it also supports SMS, email, push notifications, SSH keys, X.509 certificates, Yubikeys, Nitrokeys, U2F, and a lot more. Currently, the support for WebAuthn is added. + +The modular structure of the token types (being Python classes) allows new types to be added quickly, making it the most flexible in regards to authentication methods. It runs on-premises at a central location in your network. This way, you stay flexible, have control over your network, and keep pace with the latest developments. + +privacyIDEA comes with a mighty and flexible policy framework that allows you to adapt privacyIDEA to your needs. The unique event handler modules enable you to fit privacyIDEA into your existing workflows or create new workflows that work the best for your scenario. It is also plays nice with the others and integrates with identity and authentication solutions like FreeRADIUS, simpleSAMLphp, Keycloak, or Shibboleth. This flexibility may be the reason organizations like the World Wide Web Consortium and companies like Axiad are using privacyIDEA. + +privacyIDEA is developed [on GitHub][5] and backed by a Germany-based company providing services and support worldwide. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/open-source-multi-factor-authentication + +作者:[Cornelius Kölbel][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/cornelius-k%C3%B6lbel +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDU_UnspokenBlockers_1110_A.png?itok=x8A9mqVA (Three closed doors) +[2]: https://netknights.it/en/consolidation-of-the-market-and-migrations/ +[3]: https://www.infosecurity-magazine.com/news/safenet-acquires-cryptocard/ +[4]: https://privacyidea.org +[5]: https://github.com/privacyidea/privacyidea diff --git a/sources/tech/20200314 Adding a display to a travel-ready Raspberry Pi Zero.md b/sources/tech/20200314 Adding a display to a travel-ready Raspberry Pi Zero.md new file mode 100644 index 0000000000..f8dcb26208 --- /dev/null +++ b/sources/tech/20200314 Adding a display to a travel-ready Raspberry Pi Zero.md @@ -0,0 +1,281 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Adding a display to a travel-ready Raspberry Pi Zero) +[#]: via: (https://opensource.com/article/20/3/pi-zero-display) +[#]: author: (Peter Garner https://opensource.com/users/petergarner) + +Adding a display to a travel-ready Raspberry Pi Zero +====== +A small eInk display turns a Raspberry Pi into a self-contained, +pocket-sized travel computer. +![Pi Zero][1] + +In my earlier article, I explained how I [transformed a Raspberry Pi Zero][2] into a minimal, portable, go-anywhere computer system that, although small, can actually achieve useful things. I've since made iterations that have proved interesting and made the little Pi even more useful. Read on to learn what I've done. + +### After the road trip + +My initial Pi Zero setup [proved its worth][3] on a road trip to Whitby, but afterward, it was largely consigned to the "pending" shelf, waiting for another assignment. It was powered up weekly to apply updates, but other than that, it was idle. Then one day, as I was flicking through emails from various Pi suppliers, I came across a (slightly) reduced e-Ink display offer: hmmm… and there was a version for the Pi Zero as well. What could I do with one? + +ModMyPi was selling a rather neat [display and driver board combination][4] and a [small case][5] with a transparent window on top. I read the usual reviews, and apart from one comment about the _boards being a very tight fit_, it sounded positive. I ordered it, and it turned up a few days later. I had noted from the product description that the display board didn't have GPIO headers installed, so I ordered a Pi Zero WH (wireless + headers pre-installed) to save me the bother of soldering one on. + +### Some assembly required + +As with most of these things, some self-assembly was required, so I carefully opened the boxes and laid out the parts on the desk. The case was nicely made apart from ridiculous slots for a watch strap (?!) and some strange holes in the side to allow tiny fingers to press the five I/O buttons on the display. "_Could I get a top without holes?"_ I inquired on the review page. "_No."_ Okay then. + +With the case unpacked, it was time to open the display box. A nicely designed board was first out, and there were clear instructions on the Pi-Supply website. The display was so thin (0.95mm) that I nearly threw it out with the bubble wrap. + +The first job was to mount the display board on the Pi Zero. I checked to make sure I could attach the display cable to the driver board when it was joined to the Pi and decided that, with my sausage fingers, I'd attach the display first and leave it flapping in the breeze while I attached the driver board to the Pi. I carefully got the boards lined up on the GPIO pins, and, with those in place, I folded over the display "screen" to sit on top of the board. With the piggy-backed boards in place, I then _verrrry_ carefully shoe-horned the assembly into place in the case. Tight fit? Yeah, you're not kidding, but I got it all safely in place and snapped the top on, and nothing appeared to be broken. Phew! + +### How to set up your display + +I'm going to skip a chunk of messing about here and refer you to the maker's [instructions][6] instead. Suffice to say that after a few installs, reboots, and coffees, I managed to get a working e-Ink display! Now all I had to do was figure out what to do with it. + +One of the main challenges of working with a small device like [my "TravelPi"][2] is that you don't have access to as much screen real estate as you would on a larger machine. I like the size and power of the device though, so it's really a compromise as to what you get out of it. For example, there's a single screen accessible via the HDMI port, and I've used tmux to split that into four separate, usable panes. If I really need to view something else urgently, I could always **Ctrl+Z** into another prompt and do the necessary configs, but that's messy. + +I wanted to see various settings and maybe look at some system settings, and the e-Ink display enabled me to do all that! As you can see from the image below, I ended up with a very usable info panel that is updated by a simple(-ish) Python script (**qv**) either manually or by a crontab entry every 10 minutes. The manufacturer states that the update frequency should be "no more than 1Hz if you want your display to last for a long time." Ten minutes is fine, thank you. + +Here's what I wanted to be able to see at a glance: + +Hostname | And device serial number +---|--- +IP address | Current internal IP address +VPN status | Inactive/country/IP address +Tor status | Inactive/IP address +"Usage" | Percentage disk space and memory used +Uptime | So satisfying to see those long uptimes + +And here it is: a display that's the same size as the Pi Zero and 1" deep. + +![PiZero Display][7] + +### How to populate the display + +Now I needed to populate the display. As seems to be the norm these days, the e-Ink support software is in Python, which, of course, is installed as standard with most Linux distros. _Disclaimer:_ Python is not my first (dev) language, but the code below works for me. It'll probably work for you, too. + + +``` +#!/usr/bin/env python + +import os +import sys +import time +import datetime +import socket +import netifaces as ni +import psutil +import subprocess + +from netifaces import AF_INET, AF_INET6, AF_LINK, AF_PACKET +from papirus import PapirusText, PapirusTextPos, Papirus +from subprocess import check_output +from datetime import timedelta + +rot     = 0 +screen  = Papirus(rotation = rot) +fbold   = '/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf' +fnorm   = '/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf' +text    = PapirusTextPos(rotation = rot) + +def GetBootTime(): +        return datetime.datetime.fromtimestamp(psutil.boot_time()) + +def GetUptime(): +     with open('/proc/uptime','r') as f: +       uptime_seconds = float(f.readline().split()[0]) +     u = str(timedelta(seconds = uptime_seconds)) +     duration,junk = u.split(".") +     hr,mi,sc = duration.split(":") +     return "%sh %sm %ss" % ( hr,mi,sc ) + +def getHostname(): +        hostname = socket.gethostname() +        return hostname + +def getWiFiIPaddress(): +        try: +                ni.interfaces() +                [ 'wlan0', ] +                return ni.ifaddresses('wlan0')[AF_INET][0]['addr'] +        except: +                return 'inactive' + +def getVPNIPaddress(): +        try: +                ni.interfaces() +                [ 'tun0', ] +                return ni.ifaddresses('tun0')[AF_INET][0]['addr'] +        except: +                return 'inactive' + +def GetTmuxEnv(): +        if 'TMUX_PANE' in os.environ: +                return ' (t)' +        return ' ' + +def GetCPUserial(): +        cpuinfo = subprocess.check_output(["/bin/cat", "/proc/cpuinfo"]) +        cpuinfo = cpuinfo.replace("\t","") +        cpuinfo = cpuinfo.split("\n") +        [ legend, cpuserial ] = cpuinfo[12].split(' ') +        cpuserial = cpuserial.lstrip("0") +        return cpuserial + +def GetMemUsed(): +        memUsed = psutil.virtual_memory()[2] +        return memUsed + +def GetDiskUsed(): +        diskUsed = psutil.disk_usage('/')[3] +        return diskUsed + +def CheckTor(): +        try: +                TS = "active: pid %s" %check_output(['pidof','tor'])    +        except: +                TS = 'inactive' +        return TS       + +def CheckVPN(): +        return VPNlo +# --------------------------------------------------------------------------- +def main(): +        pass + +if __name__ == '__main__': +        main() + +VPNlo = 'inactive' + +if (len(sys.argv) == 2): +        try: +                VPNlo = sys.argv[1] +        except: +                VPNlo = 'inactive' + +text = PapirusTextPos(False,rotation=rot) +text.AddText("%s %s %s"% (getHostname(),GetCPUserial(),GetTmuxEnv()),x=1,y=0,size=12,invert=True,fontPath=fbold) +text.AddText("IP  %s" % getWiFiIPaddress(),x=1,y=16,size=12,fontPath=fnorm) +if ( getVPNIPaddress() == 'inactive' ): +        text.AddText("VPN %s" % CheckVPN(),x=1,y=30,size=12,fontPath=fnorm) +else: +        text.AddText("VPN %s" % getVPNIPaddress(),x=1,y=30,size=12,fontPath=fnorm) +text.AddText("TOR %s" % CheckTor(),x=1,y=44,size=12,fontPath=fnorm) +text.AddText("MEM %s% DISK %s% used" % (GetMemUsed(),GetDiskUsed()),x=1,y=58,size=12,fontPath=fnorm,maxLines=1) +text.AddText("UPTIME %s" % GetUptime(),x=1,y=72,size=12,fontPath=fnorm) +text.WriteAll() + +sys.exit(0) +``` + +Normally, the script runs without any arguments and is called by a series of Bash scripts that I've written to start up various subsystems; these are, in turn, called from a menu system written in Whiptail, which is pretty versatile. In the case of the VPN system, I have a list of access points to choose from and that update the location on the display. Initially, I call the display updater with the location name (e.g., Honolulu), but at that point, I can't display the VPN IP address because I don't know it: + + +``` +   dispupdate.py ${accesspoint} +   openvpn --config $PATH/Privacy-${accesspoint}.conf --auth-user-pass credfile +``` + +When the display updater runs again (outside the VPN startup script), the IP address is readable from the **tun0** interface and the display is updated with the IP address. I may change this later, but it works fine now. I use the **PapirusTextPos** function (rather than **PapirusText**), as this allows multiple lines to be written before the display is updated, leading to a much faster write. The **text.WriteAll()** function does the actual update. + +### Adding more software + +I was very pleased with my initial choice of applications, but since I'd managed to slim the whole installation down to 1.7GB, I had plenty of available space. So, I decided to see if there was anything else that could be useful. Here's what I added: + +Irssi | IRC client +---|--- +FreeBSD games | There are still many text-mode games to enjoy +nmon | A _very_ comprehensive top-alike utility for all aspects of the system +Newsbeuter | Text-mode Atom/RSS feed reader + +And I still have about 300MB free space to take me up to 2GB, so I may add more. + +### We keed to talk about ~~Kevin~~ Bluetooth + +Observant readers will remember my hatred for Bluetooth and trying to pair terminal-based software with a Bluetooth device. When I bought a new Pi, I realized that I had to pair the damn thing up with the keyboards again. Oh, woe is me! But a search-engine session and a calming coffee enabled me to actually do it! It goes something like this: + + +``` +sudo su +bluetoothctl {enter} + +[bluetooth]# + +[bluetooth]# scan on +Discovery started +[CHG] Controller B8:27:EB:XX:XX:XX Discovering: yes + +[bluetooth]# agent on +Agent registered +[NEW] Device B2:2B:XX:XX:XX:XX Bluetooth Keyboard +Attempting to pair with B2:2B:XX:XX:XX:XX +[CHG] Device B2:2B:XX:XX:XX:XX Connected: yes +[agent] PIN code: 834652 +[CHG] Device B2:2B:XX:XX:XX:XX Modalias: usb:v05ACp0220d0001 +[CHG] Device B2:2B:XX:XX:XX:XX UUIDs: zzzzz +[CHG] Device B2:2B:XX:XX:XX:XX UUIDs: yyyyy +[CHG] Device B2:2B:XX:XX:XX:XX ServicesResolved: yes +[CHG] Device B2:2B:XX:XX:XX:XX Paired: yes +Pairing successful +[CHG] Device B2:2B:XX:XX:XX:XX ServicesResolved: no +[CHG] Device B2:2B:XX:XX:XX:XX Connected: no + +[bluetooth]# trust B2:2B:XX:XX:XX:XX +[CHG] Device B2:2B:XX:XX:XX:XX Trusted: yes +Changing B2:2B:XX:XX:XX:XX trust succeeded +[CHG] Device B2:2B:XX:XX:XX:XX RSSI: -53 + +[bluetooth]# scan off +[CHG] Device B2:2B:XX:XX:XX:XX RSSI is nil +Discovery stopped +[CHG] Controller B8:27:EB:XX:XX:XX Discovering: no + +[bluetooth]# exit +Agent unregistered + +$ +``` + +I was gobsmacked! No, really. I paired my other keyboard and am now considering pairing a speaker, but we'll see. I had a beer that night to celebrate my new-found "l33t" tech skills! Here is an [excellent guide][8] on how to do it. + +### One more hardware mod + +Until recently, I've been using as large a good-quality microSDHC card as I could afford, and in case of problems, I created a backup copy using the rsync-based rpi-clone. However, after reading various articles on the 'net where people complain about corrupted cards due to power problems, unclean shutdowns, and other mishaps, I decided to invest in a higher-quality card that hopefully will survive all this and more. This is important if you're traveling long distances and _really_ need your software to work at the destination. + +After a long search, I found the [ATP Industrial-Grade MicroSD/MicroSDHC][9] cards, which are rated military-spec for demanding applications. That sounded perfect. However, with quality comes a cost, as well as (in this case) limited capacity. In order to keep my wallet happy, I limited myself to an 8GB card, which may not sound like a lot for a working computer, but bearing in mind I have a genuine 5.3GB of that 8GB free, it works just fine. I also have a level of reassurance that bigger but lower-quality cards can't give me, and I can create an ISO of that card that's small enough to email if need be. Result! + +### What's next? + +The Zero goes from strength to strength, only needing to go out more. I've gone technically about as far as I can for now, and any other changes will be small and incremental. + +* * * + +_This was originally published on [Peter Garner's blog][10] under a CC BY-NC-ND 4.0 and is reused here with the author's permission._ + +The new issue of the official Raspberry Pi magazine, The MagPi, comes with a free computer stuck to... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/pi-zero-display + +作者:[Peter Garner][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/petergarner +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/zero-osdc-lead.png?itok=bK70ON2W (Pi Zero) +[2]: https://opensource.com/article/20/3/raspberry-pi-zero-w-road +[3]: https://petergarner.net/notes/index.php?thisnote=20180511-Travels+with+a+Pi+%282%29 +[4]: https://www.modmypi.com/raspberry-pi/screens-and-displays/epaper/papirus-zero-epaper--eink-screen-phat-for-pi-zero-medium +[5]: https://www.modmypi.com/raspberry-pi/cases-183/accessories-1125/watch-straps/pi-supply-papirus-zero-case +[6]: https://github.com/PiSupply/PaPiRus +[7]: https://opensource.com/sites/default/files/uploads/pizerodisplay.jpg (PiZero Display) +[8]: https://www.sigmdel.ca/michel/ha/rpi/bluetooth_01_en.html +[9]: https://www.digikey.com/en/product-highlight/a/atp/industrial-grade-microsd-microsdhc-cards +[10]: https://petergarner.net/notes/index.php?thisnote=20190205-Travels+with+a+Pi+%283%29 diff --git a/sources/tech/20200315 Getting started with shaders- signed distance functions.md b/sources/tech/20200315 Getting started with shaders- signed distance functions.md new file mode 100644 index 0000000000..acba8687fd --- /dev/null +++ b/sources/tech/20200315 Getting started with shaders- signed distance functions.md @@ -0,0 +1,243 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with shaders: signed distance functions!) +[#]: via: (https://jvns.ca/blog/2020/03/15/writing-shaders-with-signed-distance-functions/) +[#]: author: (Julia Evans https://jvns.ca/) + +Getting started with shaders: signed distance functions! +====== + +Hello! A while back I learned how to make fun shiny spinny things like this using shaders: + +![][1] + +My shader skills are still extremely basic, but this fun spinning thing turned out to be a lot easier to make than I thought it would be to make (with a lot of copying of code snippets from other people!). + +The big idea I learned when doing this was something called “signed distance functions”, which I learned about from a very fun tutorial called [Signed Distance Function tutorial: box & balloon][2]. + +In this post I’ll go through the steps I used to learn to write a simple shader and try to convince you that shaders are not that hard to get started with! + +### examples of more advanced shaders + +If you haven’t seen people do really fancy things with shaders, here are a couple: + + 1. this very complicated shader that is like a realistic video of a river: + 2. a more abstract (and shorter!) fun shader with a lot of glowing circles: + + + +### step 1: my first shader + +I knew that you could make shaders on shadertoy, and so I went to . They give you a default shader to start with that looks like this: + +![][3] + +Here’s the code: + +``` +void mainImage( out vec4 fragColor, in vec2 fragCoord ) +{ + // Normalized pixel coordinates (from 0 to 1) + vec2 uv = fragCoord/iResolution.xy; + + // Time varying pixel color + vec3 col = 0.5 + 0.5*cos(iTime+uv.xyx+vec3(0,2,4)); + + // Output to screen + fragColor = vec4(col,1.0); +} +``` + +This doesn’t do anythign that exciting, but it already taught me the basic structure of a shader program! + +### the idea: map a pair of coordinates (and time) to a colour + +The idea here is that you get a pair of coordinates as an input (`fragCoord`) and you need to output a RGBA vector with the colour of that. The function can also use the current time (`iTime`), which is how the picture changes over time. + +The neat thing about this programming model (where you map a pair of coordinates and the time to) is that it’s extremely trivially parallelizable. I don’t understand a lot about GPUs but my understanding is that this kind of task (where you have 10000 trivially parallelizable calculations to do at once) is exactly the kind of thing GPUs are good at. + +### step 2: iterate faster with `shadertoy-render` + +After a while of playing with shadertoy, I got tired of having to click “recompile” on the Shadertoy website every time I saved my shader. + +I found a command line tool that will watch a file and update the animation in real time every time I save called [shadertoy-render][4]. So now I can just run: + +``` +shadertoy-render.py circle.glsl +``` + +and iterate way faster! + +### step 3: draw a circle + +Next I thought – I’m good at math! I can use some basic trigonometry to draw a bouncing rainbow circle! + +I know the equation for a circle (`x**2 + y**2 = whatever`!), so I wrote some code to do that: + +![][5] + +Here’s the code: (which you can also [see on shadertoy][6]) + +``` +void mainImage( out vec4 fragColor, in vec2 fragCoord ) +{ + // Normalized pixel coordinates (from 0 to 1) + vec2 uv = fragCoord/iResolution.xy; + // Draw a circle whose center depends on what time it is + vec2 shifted = uv - vec2((sin(iGlobalTime) + 1)/2, (1 + cos(iGlobalTime)) / 2); + if (dot(shifted, shifted) < 0.03) { + // Varying pixel colour + vec3 col = 0.5 + 0.5*cos(iGlobalTime+uv.xyx+vec3(0,2,4)); + fragColor = vec4(col,1.0); + } else { + // make everything outside the circle black + fragColor = vec4(0,0,0,1.0); + } +} +``` + +This takes the dot product of the coordinate vector `fragCoord` with itself, which is the same as calculating `x^2 + y^2`. I played with the center of the circle a little bit in this one too – I made the center `vec2((sin(iGlobalTime) + 1)/2, (1 + cos(faster)) / 2)`, which means that the center of the circle also goes in a circle depending on what time it is. + +### shaders are a fun way to play with math! + +One thing I think is fun about this already (even though we haven’t done anything super advanced!) is that these shaders give us a fun visual way to play with math – I used `sin` and `cos` to make something go in a circle, and if you want to get some better intuition about how trigonometric work, maybe writing shaders would be a fun way to do that! + +I love that you get instant visual feedback about your math code – if you multiply something by 2, things get bigger! or smaller! or faster! or slower! or more red! + +### but how do we do something really fancy? + +This bouncing circle is nice but it’s really far from the super fancy things I’ve seen other people do with shaders. So what’s the next step? + +### idea: instead of using if statements, use signed distance functions! + +In my circle code above, I basically wrote: + +``` +if (dot(uv, uv) < 0.03) { + // code for inside the circle +} else { + // code for outside the circle +} +``` + +But the problem with this (and the reason I was feeling stuck) is that it’s not clear how it generalizes to more complicated shapes! Writing a bajillion if statements doesn’t seem like it would work well. And how do people render those 3d shapes anyway? + +So! **Signed distance functions** are a different way to define a shape. Instead of using a hardcoded if statement, instead you define a **function** that tells you, for any point in the world, how far away that point is from your shape. For example, here’s a signed distance function for a sphere. + +``` +float sdSphere( vec3 p, float center ) +{ + return length(p)-center; +} +``` + +Signed distance functions are awesome because they’re: + + * simple to define! + * easy to compose! You can take a union / intersection / difference with some simple math if you want a sphere with a chunk taken out of it. + * easy to rotate / stretch / bend! + + + +### the steps to making a spinning top + +When I started out I didn’t understand what code I needed to write to make a shiny spinning thing. It turns out that these are the basic steps: + + 1. Make a signed distance function for the shape I want (in my case an octahedron) + 2. Raytrace the signed distance function so you can display it in a 2D picture (or raymarch? The tutorial I used called it raytracing and I don’t understand the difference between raytracing and raymarching yet) + 3. Write some code to texture the surface of your shape and make it shiny + + + +I’m not going to explain signed distance functions or raytracing in detail in this post because I found this [AMAZING tutorial on signed distance functions][2] that is very friendly and honestly it does a way better job than I could do. It explains how to do the 3 steps above and the code has a ton of comments and it’s great. + + * The tutorial is called “SDF Tutorial: box & balloon” and it’s here: + * Here are tons of signed distance functions that you can copy and paste into your code (and ways to compose them to make other shapes) + + + +### step 4: copy the tutorial code and start changing things + +Here I used the time honoured programming practice here of “copy the code and change things in a chaotic way until I get the result I want”. + +My final shader of a bunch of shiny spinny things is here: + +The animation comes out looking like this: + +![][7] + +Basically to make this I just copied the tutorial on signed distance functions that renders the shape based on the signed distance function and: + + * changed `sdfBalloon` to `sdfOctahedron` and made the octahedron spin instead of staying still in my signed distance function + * changed the `doBalloonColor` colouring function to make it shiny + * made there be lots of octahedrons instead of just one + + + +### making the octahedron spin! + +Here’s some the I used to make the octahedron spin! This turned out to be really simple: first copied an octahedron signed distance function from [this page][8] and then added a `rotate` to make it rotate based on time and then suddenly it’s spinning! + +``` +vec2 sdfOctahedron( vec3 currentRayPosition, vec3 offset ){ + vec3 p = rotate((currentRayPosition), offset.xy, iTime * 3.0) - offset; + float s = 0.1; // what is s? + p = abs(p); + float distance = (p.x+p.y+p.z-s)*0.57735027; + float id = 1.0; + return vec2( distance, id ); +} +``` + +### making it shiny with some noise + +The other thing I wanted to do was to make my shape look sparkly/shiny. I used a noise funciton that I found in [this github gist][9] to make the surface look textured. + +Here’s how I used the noise function. Basically I just changed parameters to the noise function mostly at random (multiply by 2? 3? 1800? who knows!) until I got an effect I liked. + +``` +float x = noise(rotate(positionOfHit, vec2(0, 0), iGlobalTime * 3.0).xy * 1800.0); +float x2 = noise(lightDirection.xy * 400.0); +float y = min(max(x, 0.0), 1.0); +float y2 = min(max(x2, 0.0), 1.0) ; +vec3 balloonColor = vec3(y , y + y2, y + y2); +``` + +### writing shaders is fun! + +That’s all! I had a lot of fun making this thing spin and be shiny. If you also want to make fun animations with shaders, I hope this helps you make your cool thing! + +As usual with subjects I don’t know tha well, I’ve probably said at least one wrong thing about shaders in this post, let me know what it is! + +Again, here are the 2 resources I used: + + 1. “SDF Tutorial: box & balloon”: (which is really fun to modify and play around with) + 2. Tons of signed distance functions that you can copy and paste into your code + + + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2020/03/15/writing-shaders-with-signed-distance-functions/ + +作者:[Julia Evans][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://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://jvns.ca/images/spinny.gif +[2]: https://www.shadertoy.com/view/Xl2XWt +[3]: https://jvns.ca/images/colour.gif +[4]: https://github.com/alexjc/shadertoy-render +[5]: https://jvns.ca/images/circle.gif +[6]: https://www.shadertoy.com/view/tsscR4 +[7]: https://jvns.ca/images/octahedron2.gif +[8]: http://www.iquilezles.org/www/articles/distfunctions/distfunctions.htm +[9]: https://gist.github.com/patriciogonzalezvivo/670c22f3966e662d2f83 diff --git a/sources/tech/20200315 How I migrated from a Mac Mini to a Raspberry Pi.md b/sources/tech/20200315 How I migrated from a Mac Mini to a Raspberry Pi.md new file mode 100644 index 0000000000..0e1c7196fa --- /dev/null +++ b/sources/tech/20200315 How I migrated from a Mac Mini to a Raspberry Pi.md @@ -0,0 +1,184 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How I migrated from a Mac Mini to a Raspberry Pi) +[#]: via: (https://opensource.com/article/20/3/mac-raspberry-pi) +[#]: author: (Peter Garner https://opensource.com/users/petergarner) + +How I migrated from a Mac Mini to a Raspberry Pi +====== +Learn more about Linux by turning a Raspberry Pi Model 2 into a workable +desktop computer. +![Vector, generic Raspberry Pi board][1] + +Some time ago, I decided to move my computing environment from a Mac Mini PowerPC to a Raspberry Pi Model 2. This article describes my reasons for doing so and how I did it. While it is quite technical in places, if you're considering switching from an existing system to something decidedly lean and mean, there are things that you need to know before making that leap. There are lots of links to click as well, which will lead you to the software and apps that I mention. + +Enjoy! + +## Saying goodbye to the Mac + +I have to admit, I've never really been an Apple fanboi, especially following a short (and ultimately unsatisfactory) fling with a plastic polycarbonate MacBook back in 2006. Although it was beautifully designed, and the software "Just Worked," I was understandably upset when it decided to expire shortly after the warranty period expired (design faults, apparently). Ah well. + +I swore never to "invest" in an Apple machine again—until I discovered a used Mac Mini PowerPC on eBay that could be had for around $100 in 2012. It was new back in 2005 but had apparently been refurbished. "What have I got to lose, especially at that price?" I asked myself. Nobody answered, so I placed a last-minute bid, won it, and invested about the same sum of money again in bumping the memory up to 1GB and buying the OS on DVD. The OS X version was 10.4.7 Tiger, and the architecture was Power PC. It was sedate but reliable, and I was happy. It didn't take a lot of power either; some 60 watts at full load, so that was a bonus. I spent many happy hours tinkering with it and trying to find software that was supported on a device that old. + +Predictably though, as my computing requirements grew and the Mac got older, it started to get noticeably slower, and I was aware that even simple tasks—such as asking it to run a web browser and display an HTTPS page—were causing it problems. When I finally managed to find antivirus software for it, I became aware of just how noisy the Mini's cooling fan was as the CPU struggled with the extra load. + +A quick check of the performance monitors revealed thousands of memory-paging faults, and I realized that my old friend was soon destined for the knackers yard. Of course, that meant searching for a replacement, and that's when the fun started. + +## A(nother) small computer + +My main problem was that I didn't have a big budget. I looked at eBay again and found a number of Mac Minis for sale, all around the $500 mark, and many of those were early basic-spec Intel units that, like my old Mac, people had simply grown out of. Essentially, I wanted something like the old Mini, ideally with similar power consumption. A new one was out of the question, obviously. + +Let me state that my computer requirements are pretty undemanding, and for photo/graphics work, I have another computer that consumes power like there's no tomorrow and gives off enough heat to keep me warm in winter. And then I got to thinking about the [Raspberry Pi Model 2][2]. Now before you laugh, I have around six of the things running various servers, and they do just fine. One runs a small web server, another runs a mail server, and so on. Each one costs around $30, and most use a cheap microSDHC card, so if one fails, I can easily swap it out for another, and I can usually buy a suitable card at a local supermarket—try doing that when your laptop drive fails! I also have a Netgear ReadyNAS 102 with a couple of 2TB hard drives to act as my bulk storage. + +Suddenly, my plan looked as though it might be viable after all! + +## Spec'ing it out + +The specification was a bit of a no-brainer: The Model 2 Pi comes with 1GB of memory standard, the Ethernet runs at 100Mbps maximum, the clock speed is 900MHz, there are four USB ports, and that's yer lot, mate. You can overclock it, but I've never wanted to try this for various reasons. + +I had a Pi in my spares drawer, so no problem there. I ordered a posh aluminum case made by [Flirc][3] that was on offer for $20 and duly slotted in the Pi. The power supply unit (PSU) had to be a genuine two-amp device, and again, I had a spare lying around. If you take your Pi ownership seriously, I recommend the [Anker 40W][4] five-port desktop charger: it has intelligent power management, and I'm running five Pis from one unit. Incidentally, if you inadvertently use a PSU that can't deliver the required current, you'll keep seeing a square, multi-colored icon in the top-right corner of your screen, so be warned. + +The microSDHC "disk" was more of an issue, though. I always use SanDisk, and this time I wanted something fast, especially as this was to be a "desktop" machine. In the end, I went for a [SanDisk 8GB Extreme Pro UHS-1][5] card that promised up to 90 to 95 Mbps write/read performance. "8GB? That's not a lot of space," I hear you Windows users cry, and because this is Linux, there doesn't need to be. + +The way I envisioned it, I'd set up the Pi normally and use it primarily as a boot disk. I'd host all my documents and media files on the network-attached storage (NAS) box, and all would be well. The NAS shares would be accessed via network filesystem (NFS), and I'd just mount them as directories on the Pi. + +Quite early on, I elected to move my entire home directory onto the NAS, and this has worked well, with some quirks. The problem I faced was a Pi quirk, and although I was sure there was a fix, I wanted to get it up and running before the Mac finally crapped out. When the Pi boots, it seems to enable the networking part quite late in the sequence, and I found that I couldn't do my NFS mounts because the networking interface hadn't come up yet. Rather than hack around with tricky scripts, I decided to simply mount the NFS shares by hand after I'd logged in after a successful boot. This seemed to work, and it's the solution I'm using now. Now that I had a basic strategy, it was time to implement it on the "live" machine. + +That's the beauty of working with the Raspberry Pi—you can quickly hack together a testbed and have a system up and running in under 30 minutes. + +Regarding video, I bought an HDMI-to-DVI cable to use with my Dell monitor, and in GUI desktop mode, this comes up as 1280x1024—plenty good enough for my use. If you have a monster flat-screen TV, you can always use that instead. + +## My software environment + +### Operating system + +I ultimately decided on [Arch Linux for ARM][6] 7H as the operating system. I'm a [Raspbian][7] veteran, but I didn't need the educational software that comes with it (I have other Pis for that). Arch provides a minimal environment but is full-featured, well-supported, and powerful; it also has bucket-loads of software available. After its initial installation, I'd used just over 1.2GB of space, and even now, with all my software on the microSDHC, I'm only using 2.8GB of my 8GB card. Please note that the Pi 2 is officially Arch Linux ARM 7, not 6. + +### Desktop + +I wanted a graphical desktop environment (even though I'm a command-line sorta guy), but it needed to be in keeping with the lean and mean ethos. I'd used [LXDE][8] before and was happy with it, so I installed it; GNOME and KDE were just too big. + +### Web browser + +The web browser was a bit of a problem, but after trying the default Midori, Epiphany, and a couple of others, I decided on [Firefox][9]. It's a bit flabby, but it follows standards well, and if you're going to digitally sign LibreOffice ODT documents, you'll need it anyway. One problem on a machine of this power is the tremendous toll that web-based ads place on the overall memory usage. In fact, a badly ad'ed page can make the browser stop completely, so I had to make those ads disappear. One way would be to install an ad-blocker plugin, but that's another hit on available memory, so a simpler method was called for. + +As this is a Linux box, I simply downloaded an [ad-blocking hosts file][10]. This is an amazing piece of community work that consists of over 15,000 hostnames for basically any server that spits out ads. All the entries point to an IP address of 0.0.0.0, so there's no time wasted and your bandwidth's your own again. It's a free download and can be added to the end of an existing hosts file. Of course, the major value, as far as I'm concerned, is that page load times are much quicker. + +The screen capture below shows an ad-free Firefox overlaid with the same page in [ELinks][11]. + +![Firefox and eLinks browsers on Raspberry Pi][12] + +No ads in either, but if you don't need all the eye candy rendered by Firefox, ELinks will provide a super-clean experience. (Normally, all that whitespace in the Firefox image is filled with ads.) The ELinks browser is an interesting hybrid browser that is primarily text-based and is similar to the classic pure-text Lynx browser. + +### Messaging + +It would be overkill, and undesirable from a security point of view, to have Microsoft Skype on the Pi, so I decided on a Jabber/XMPP client, [Psi][13]. Psi has the advantage of not having a multitude of dependencies, and it also works really well. It's easy to take part in multi-user chats, and I have another Pi hosting a Jabber server to test it on. There's no character-mode version, unfortunately, and most of the text-based clients I tried had problems, so it's a GUI-only situation at the moment. No matter; it works well and doesn't use a lot of resources. + +### Email + +I also tried a number of email applications: this was easily the most important application. Eventually, I chose [Claws Mail][14]. Sadly, it doesn't do HTML mail, but it's rock-solid reliable. I have to say that I can't get the GNU Privacy Guard (GPG) plugin working properly yet due to some unresolved version issues, but I can always encrypt messages in a terminal, if need be. + +### Audio + +Music is important to me, and I chose [SMPlayer][15] as my media player. It supports many options, including playlists for local and networked files and internet radio streaming. It does the job well. + +### Video + +I'll not go into the video player in any great detail. Bearing in mind the hardware specs of the Pi, reliably playing back a video stream, even on the same network, was problematic. I decided that if I wanted to watch videos, I had other devices more suited to it. I did try and experiment with the **gpu_mem** setting in the **[/boot/config.txt][16]**, switching it from the default 64MB to 96MB. I was prepared to borrow a bit of application memory for the video player, but even that didn't seem to make it work well. In the end, I kept that setting so that the desktop environment would run more smoothly, and so far, I haven't had problems. The irony of this is that I have another Pi that has a [DLNA][17] server installed, and this can stream video exceedingly well—not just to one client, but several. In its defense, though, it doesn't have a desktop environment to contend with. So, for now, I don't bother trying to play video. + +### Image processing + +I need to do simple, lightweight photo and image editing, and I knew from prior experience that GIMP and similar packages would bring the Pi to its knees. I found an app called [Pinta][18], which resembles an enhanced Microsoft Paint, but with more cojones. As someone with a large image collection, I also needed a slideshow application. After much evaluation, I decided on [feh][19]. Normally run from a terminal within the GUI desktop, it has an incredible array of options that can help you produce an image slideshow, and again, it has low memory requirements. + +### Office suite + +And then there was an office suite. On the old Mac Mini, I was happily (and legally) running a copy of Microsoft Mac Office 2004, and I was truly sorry to lose that. I just needed a Microsoft Word and Excel equivalent, but I had to bear in mind the Pi's limitations. Sure, there are standalone versions of word-processor and spreadsheet applications, but there was nothing that really gave me confidence that I could edit a full-featured document. + +I already knew of [LibreOffice][20], but I had my doubts about it because of its Java Runtime Environment (JRE) requirement, or so I thought. Thankfully, JRE was optional, and as long as I didn't want to use (database) connection pooling of macros, there was no need to enable it. I also used as many built-in options as possible, rejecting skins and themes; this brought the overall memory footprint down to a reasonable level, and hey, I'm writing this on LibreOffice Writer now! I adopted the attitude that if it has a built-in theme, use it! + +Here's the current [memory overview][21] (in MB) from within the GUI desktop: + +![Raspberry Pi GUI memory usage][22] + +### Miscellaneous + +Other desktop software I've installed (not much as I wanted in order to keep this a minimal installation) is: + + * [FileZilla][23]: SFTP/FTP client + * [PuTTY][24]: SSH/telnet terminal frontend + * [Mousepad][25]: A versatile plain-text editor, similar to Wordpad or Notepad, but much more powerful **[Note: this link was broken. Is this ok?]** + + + +Overall, the entire setup works as intended. I've found that it performs well, if a little slow sometimes, but this is to be expected, as it's running on a Raspberry Pi with a 900MHz clock speed and 1GB of memory. As long you're aware of and prepared to accept the limitations, you can have a cheap, very functional system that doesn't take up all your desk space. + +## Lacking in characters + +Life with a Pi desktop is not all about the GUI; it's a very competent command-line environment too, should you need one. As a Linux developer and geek, I am very comfortable in a character-mode environment, and this is where the Pi really comes into its own. The performance you can expect in the command-line environment, at least in my configuration, is dependent on a number of factors. I'm limited to a certain extent by the Pi's network-interface speed and the overall performance of my Netgear ReadyNAS 102, another slightly underpowered, consumer-grade ARM box. The one thing that did please me, though, was the noticeable increase in speed over the Mac Mini! + +Running in a native terminal environment, this is the typical memory usage (in MB) you might expect: + +![Raspberry Pi terminal memory usage][26] + +One thing to note is the lack of a swap partition. It's generally accepted that any type of swap system on a Raspberry Pi is a Very Bad Thing™ and will wear out your SD card in no time. I considered setting up a swap partition on the NAS box, but I ruled this out early on, as it would very negatively impact the network as a whole, and as with the NFS mount issue, the swap partition would need to be mounted before the network came up. So no go. + +Having lived with Raspberry Pis for some time now, let's just say that one has to learn to set things up carefully in the first place to avoid the need, and ultimately, it can teach you to manage computers better. + +As part of my efforts to make the Pi as useful as possible, I had to envision a scenario where whatever I was working on was either so resource-hungry that I couldn't run a GUI desktop or the GUI was just not required. That meant reproducing as many of the desktop-only apps in a character-mode environment. In fact, this was easier than finding the equivalent desktop apps. + +Here is my current lineup: + + * **File manager:** [Midnight Commander][27]; if you're old enough to remember Norton Commander, you'll know what it looks like. + * **File transfer:** SSH/SFTP; normally handled by PuTTY and FileZilla on the desktop, you just use these two commands as provided. + * **Web browser:** Lynx or Links are classic character-mode browsers that significantly speed up the internet experience. + * **Music player:** Yes, you can play music in a character-mode terminal! [Mpg123][28] is the name of the app, and when it's run as **mpg123 -C**, it allows full keyboard control of all playback functions. If you want to be really cool, you can alter the way Midnight Commander handles MP3 files by editing **/etc/mc/mc.ext** and adding the code snippet below. This allows you to browse and play your music collection with ease. [code] shell/i/.mp3 +      Open=/usr/bin/mpg123 -C %f +      View=%view{ascii} /usr/lib/mc/ext.d/sound.sh view mp3 +``` + * **Office:** Don't be silly! Oh wait, though; I installed the character-mode spreadsheet app called **sc** (Supercalc?), and there's always Vi if you want to edit a text document, but don't expect to able to edit any Microsoft files. If your need is truly great, you can install a supplementary application called Antiword, which will let you view a .doc file. + * **Email:** A bit of a problem, as the Claws Mail mailbox format is not directly compatible with my character-mode app of choice, Mutt. There's a workaround, but I'm only going to do it if I get some spare time. For sending quick emails, I installed ssmtp, which is described as "a send-only sendmail emulator for machines which normally pick their mail up from a centralized mail hub." The setup is minimal, and overhead is practically nil, as normally it's invoked only when mail is being sent. So, you can do things like typing **echo "The donuts are on my desk" | mail -s"Important News" [everybody@myoffice.com][29]** from the command line without firing up a GUI mail app. + + + +For everything else, it's just a question of flipping back to the GUI desktop. Speaking of which… + +![Raspberry Pi GUI desktop environment][30] + +Quite a busy screen, but the Raspberry Pi handles it well. Here, I'm using LibreOffice to write this article, there's a network status box, Firefox is on the mpg123 website, and there's a terminal running top showing how much memory (isn't) being used. The drop-down menu on the left shows the office suite apps. + +## Other scenarios and thoughts + +### What's where + +With any hybrid system like this, it's important to remember what is located where so that, in the event of any problems, recovery will be easier. In my current configuration, the microSDHC card contains only the operating system, and as much as possible, any system-configuration files are also on there. Your own userland data will be on the NAS in your home directory. Ideally, you should be to replace or update the software on the microSDHC without having any adverse effects on your computing environment as a whole, but in IT, it's never that straightforward. + +In the X11 GUI desktop system, although there is a default config file in **/etc/X11**, you will invariably have a customized version containing your own preferences. (This is by design.) Your own file on the NAS, however, will reference files on the microSDHC: + +![Location of files][31] + +The overall effect is that if you change one environment for another, you will invariably experience a change (or loss) in functionality. Hopefully, the changes will be minor, but you do need to be aware of the sometimes ambiguous links. + +Please remember that the **root** user will _always_ be on the microSDHC, and if your NAS box fails for any reason, you'll still be able to boot your system and at least do some recovery work. + +### NAS alternatives + +While I'm in my home office, I have full access to my NAS box, which represents what (in today's terminology) would be a personal cloud. I much prefer this solution to a commercial cloud that is invariably managed by a company of unknown origin, location, security, and motives. For those reasons, I will always host my data where I can see it and physically get to it as required. Having said that, you may not be as paranoid as I am and will want to hook up your Pi desktop to an external cloud share. + +In that case, using an NFS mount as a basis for your home directory should mean that it's simply a matter of editing your **/etc/fstab** to point the NFS client at a different location. In my setup, the NAS box is called, er, NASBOX, and the local NFS share mountpoint is called **/NASmount**. When you create your non-root user, you'll simply move their home directory to an existing directory called **/NASmount**: +``` + + +NASBOX:/data/yourshare /NASmount nfs +nfsvers=3,rsize=8192,wsize=8192,timeo=60,intr,auto 0 0 + +mount -t nfs -v NASBOX:/data/yourshare /NASmount + +``` +and then your directory tree could look like this: +``` +`/NASmount/home/user` +``` +So, by simply changing the **/etc/fstab** entry, you could quickly be hooked up to someone else's cloud. This, as they say, is left as an exercise for the re \ No newline at end of file diff --git a/sources/tech/20200316 How to test failed authentication attempts with test-driven development.md b/sources/tech/20200316 How to test failed authentication attempts with test-driven development.md new file mode 100644 index 0000000000..abe34d97e2 --- /dev/null +++ b/sources/tech/20200316 How to test failed authentication attempts with test-driven development.md @@ -0,0 +1,288 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to test failed authentication attempts with test-driven development) +[#]: via: (https://opensource.com/article/20/3/failed-authentication-attempts-tdd) +[#]: author: (Alex Bunardzic https://opensource.com/users/alex-bunardzic) + +How to test failed authentication attempts with test-driven development +====== +Mountebank makes it easier to test the "less happy path" in your code. +![Programming keyboard.][1] + +Testing often begins with what we hope happens. In my [previous article][2], I demonstrated how to virtualize a service you depend on when processing the "happy path" scenario (that is, testing the outcome of a successful login attempt). But we all know that software fails in spectacular and unexpected ways. Now's the time to take a closer look into how to process the "less happy paths": what happens when someone tries to log in with the wrong credentials? + +In the first article linked above, I walked through building a user authentication module. (Now is a good time to review that code and get it up and running.) This module does not do all the heavy lifting; it mostly relies on another service to do those tougher tasks—enable user registration, store the user accounts, and authenticate the users. The module will only be sending HTTP POST requests to this additional service's endpoint; in this case, **/api/v1/users/login**. + +What do you do if the service you're dependent on hasn't been built yet? This scenario creates a blockage. In the previous post, I explored how to remove that blockage by using service virtualization enabled by [mountebank][3], a powerful test environment. + +This article walks through the steps required to enable the processing of user authentication in cases when a user repeatedly attempts to log in. The third-party authentication service allows only three attempts to log in, after which it ceases to service the HTTP request arriving from the offending domain. + +### How to simulate repeat requests + +Mountebank makes it very easy to simulate a service that listens on a network port, matches the method and the path defined in the request, then handles it by sending back an HTTP response. To follow along, be sure to get mountebank running as we [did in the previous article][2]. As I explained there, these values are declared as JSONs that are posted to ****, mountebank's endpoint for processing authentication requests. + +But the challenge now is how to simulate the scenario when the HTTP request keeps hitting the same endpoint from the same domain. This is necessary to simulate a user who submits invalid credentials (username and password), is informed they are invalid, tries different credentials, and is repeatedly rejected (or foolishly attempts to log in with the same credentials that failed on previous attempts). Eventually (in this case, after a third failed attempt), the user is barred from additional tries. + +Writing executable code to simulate such a scenario would have to model very elaborate processing. However, when using mountebank, this type of simulated processing is extremely simple to accomplish. It is done by creating a rolling buffer of responses, and mountebank responds in the order the buffer was created. Here is an example of one way to simulate repeat requests in mountebank: + + +``` +{ +    "port": 3001, +    "protocol": "http", +    "name": "authentication imposter", +    "stubs": [ +        { +            "predicates": [ +                { +                    "equals": { +                        "method": "post", +                        "path": "/api/v1/users/login" +                    } +                } +            ], +            "responses": [ +                { +                    "is": { +                        "statusCode": 200, +                        "body": "Successfully logged in." +                    } +                }, +                { +                    "is": { +                        "statusCode": 400, +                        "body": "Incorrect login. You have 2 more attempts left." +                    } +                }, +                { +                    "is": { +                        "statusCode": 400, +                        "body": "Incorrect login. You have 1 more attempt left." +                    } +                }, +                { +                    "is": { +                        "statusCode": 400, +                        "body": "Incorrect login. You have no more attempts left." +                    } +                } +            ] +        } +    ] +} +``` + +The rolling buffer is simply an unlimited collection of JSON responses where each response is represented with two key-value pairs: **statusCode** and **body**. In this case, four responses are defined. The first response is the happy path (i.e., user successfully logged in), and the remaining three responses represent failed use cases (i.e., wrong credentials result in status code 400 and corresponding error messages). + +### How to test repeat requests + +Modify the tests as follows: + + +``` +using System; +using Xunit; +using app; +namespace tests +{ +    public class UnitTest1 +    { +        Authenticate auth = [new][4] Authenticate(); +        [Fact] +        public void SuccessfulLogin() +        { +            var given = "valid credentials"; +            var expected = " Successfully logged in."; +            var actual= auth.Login(given); +            Assert.Equal(expected, actual); +        } +        [Fact] +        public void FirstFailedLogin() +        { +            var given = "invalid credentials"; +            var expected = "Incorrect login. You have 2 more attempts left."; +            var actual = auth.Login(given); +            Assert.Equal(expected, actual); +        } +        [Fact] +        public void SecondFailedLogin() +        { +            var given = “invalid credentials"; +            var expected = "Incorrect login. You have 1 more attempt left."; +            var actual = auth.Login(given); +            Assert.Equal(expected, actual); +        } +        [Fact] +        public void ThirdFailedLogin() +        { +            var given = " invalid credentials"; +            var expected = "Incorrect login. You have no more attempts left."; +            var actual = auth.Login(given); +            Assert.Equal(expected, actual); +        } +    } +} +``` + +Now, run the tests to confirm that your code still works: + +![Failed test][5] + +Whoa! The tests now all fail. Why? + +If you take a closer look, you'll see a revealing pattern: + +![Reason for failed test][6] + +Notice that ThirdFailedLogin is executed first, followed by the SuccessfulLogin, followed by FirstFailedLogin, followed by SecondFailedLogin. What's going on here? Why is the third test running before the first test? + +The testing framework ([xUnit][7]) is executing all tests in parallel, and the sequence of execution is unpredictable. You need tests to run in order, which means you cannot test these scenarios using the vanilla xUnit toolkit. + +### How to run tests in the right sequence + +To force your tests to run in a certain sequence that you define (instead of running in an unpredictable order), you need to extend the vanilla xUnit toolkit with the NuGet [Xunit.Extensions.Ordering][8] package. Install the package on the command line with: + + +``` +`$ dotnet add package Xunit.Extensions.Ordering --version 1.4.5` +``` + +or add it to your **tests.csproj** config file: + + +``` +`` +``` + +Once that's taken care of, make some modifications to your **./tests/UnitTests1.cs** file. Add these four lines at the beginning of your **UnitTests1.cs **file: + + +``` +using Xunit.Extensions.Ordering; +[assembly: CollectionBehavior(DisableTestParallelization = true)] +[assembly: TestCaseOrderer("Xunit.Extensions.Ordering.TestCaseOrderer", "Xunit.Extensions.Ordering")] +[assembly: TestCollectionOrderer("Xunit.Extensions.Ordering.CollectionOrderer", "Xunit.Extensions.Ordering")] +``` + +Now you can specify the order you want your tests to run. Initially, simulate the happy path (i.e., the **SuccessfulLogin()**) by annotating the test with: + + +``` +[Fact, Order(1)] +public void SuccessfulLogin() { +``` + +After you test a successful login, test the first failed login: + + +``` +[Fact, Order(2)] +public void FirstFailedLogin() +``` + +And so on. You can add the order of the test runs by simply adding the **Order(x)** (where **x** denotes the order you want the test to run) annotation to your Fact. + +This annotation guarantees that your tests will run in the exact order you want them to run, and now you can (finally!) completely test your integration scenario. + +The final version of your test is: + + +``` +using System; +using Xunit; +using app; +using Xunit.Extensions.Ordering; +[assembly: CollectionBehavior(DisableTestParallelization = true)] +[assembly: TestCaseOrderer("Xunit.Extensions.Ordering.TestCaseOrderer", "Xunit.Extensions.Ordering")] +[assembly: TestCollectionOrderer("Xunit.Extensions.Ordering.CollectionOrderer", "Xunit.Extensions.Ordering")] +namespace tests +{ +    public class UnitTest1 +    { +        Authenticate auth = [new][4] Authenticate(); +        [Fact, Order(1)] +        public void SuccessfulLogin() +        { +            var given = "[elon_musk@tesla.com][9]"; +            var expected = "Successfully logged in."; +            var actual= auth.Login(given); +            Assert.Equal(expected, actual); +        } +        [Fact, Order(2)] +        public void FirstFailedLogin() +        { +            var given = "[mickey@tesla.com][10]"; +            var expected = "Incorrect login. You have 2 more attempts left."; +            var actual = auth.Login(given); +            Assert.Equal(expected, actual); +        } +        [Fact, Order(3)] +        public void SecondFailedLogin() +        { +            var given = "[mickey@tesla.com][10]"; +            var expected = "Incorrect login. You have 1 more attempt left."; +            var actual = auth.Login(given); +            Assert.Equal(expected, actual); +        } +        [Fact, Order(4)] +        public void ThirdFailedLogin() +        { +            var given = "[mickey@tesla.com][10]"; +            var expected = "Incorrect login. You have no more attempts left."; +            var actual = auth.Login(given); +            Assert.Equal(expected, actual); +        } +    } +} +``` + +Run the test again—everything passes! + +![Passing test][11] + +### What are you testing exactly? + +This article has focused on test-driven development (TDD), but let's review it from another methodology, Extreme Programming (XP). XP defines two types of tests: + + 1. Programmer tests + 2. Customer tests + + + +So far, in this series of articles on TDD, I have focused on the first type of tests (i.e., programmer tests). In this and the previous article, I switched my lenses to examine the most efficient ways of doing customer tests. + +The important point is that programmer (or producer) tests are focused on precision work. We often refer to these precision tests as "micro tests," while others may call them "unit tests." Customer tests, on the other hand, are more focused on a bigger picture; we sometimes refer to them as "approximation tests" or "end-to-end tests." + +### Conclusion + +This article demonstrated how to write a suite of approximation tests that integrate several discrete steps and ensure that the code can handle all edge cases, including simulating the customer experience when repeatedly attempting to log in and failing to obtain the necessary clearance. This combination of TDD and tools like xUnit and mountebank can lead to well-tested and thus more reliable application development. + +In future articles, I'll look into other usages of mountebank for writing customer (or approximation) tests. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/failed-authentication-attempts-tdd + +作者:[Alex Bunardzic][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/alex-bunardzic +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_keyboard_coding.png?itok=E0Vvam7A (Programming keyboard.) +[2]: https://opensource.com/article/20/3/service-virtualization-test-driven-development +[3]: http://www.mbtest.org/ +[4]: http://www.google.com/search?q=new+msdn.microsoft.com +[5]: https://opensource.com/sites/default/files/uploads/testfails_0.png (Failed test) +[6]: https://opensource.com/sites/default/files/uploads/failurepattern.png (Reason for failed test) +[7]: https://xunit.net/ +[8]: https://www.nuget.org/packages/Xunit.Extensions.Ordering/# +[9]: mailto:elon_musk@tesla.com +[10]: mailto:mickey@tesla.com +[11]: https://opensource.com/sites/default/files/uploads/testpasses.png (Passing test) diff --git a/sources/tech/20200316 How to upload an OpenStack disk image to Glance.md b/sources/tech/20200316 How to upload an OpenStack disk image to Glance.md new file mode 100644 index 0000000000..82fb71244b --- /dev/null +++ b/sources/tech/20200316 How to upload an OpenStack disk image to Glance.md @@ -0,0 +1,848 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to upload an OpenStack disk image to Glance) +[#]: via: (https://opensource.com/article/20/3/glance) +[#]: author: (Jair Patete https://opensource.com/users/jpatete) + +How to upload an OpenStack disk image to Glance +====== +Make images available to your private cloud, and more. +![blank background that says your image here][1] + +[Glance][2] is an image service that allows you to discover, provide, register, or even delete disk and/or server images. It is a fundamental part of managing images on [OpenStack][3] and [TripleO][4] (which stands for "OpenStack-On-OpenStack"). + +If you have used a recent version of the OpenStack platform, you may already have launched your first Overcloud using TripleO, as you interact with Glance when uploading the Overcloud disk images inside the Undercloud's OpenStack (i.e., the node inside your cloud that is used to install the Overcloud, add/delete nodes, and do some other handy things). + +In this article, I'll explain how to upload an image to Glance. Uploading an image to the service makes it available for the instances in your private cloud. Also, when you're deploying an Overcloud, it makes the image(s) available so the bare-metal nodes can be deployed using them. + +In an Undercloud, execute the following command: + + +``` +`$ openstack overcloud image upload --image-path /home/stack/images/` +``` + +This uploads the following Overcloud images to Glance: + + 1. overcloud-full + 2. overcloud-full-initrd + 3. overcloud-full-vmlinuz + + + +After some seconds, the images will upload successfully. Check the result by running: + + +``` +(undercloud) [stack@undercloud ~]$ openstack image list ++--------------------------------------+------------------------+--------+ +| ID                                   | Name                   | Status | ++--------------------------------------+------------------------+--------+ +| 09ca88ea-2771-459d-94a2-9f87c9c393f0 | overcloud-full         | active | +| 806b6c35-2dd5-478d-a384-217173a6e032 | overcloud-full-initrd  | active | +| b2c96922-161a-4171-829f-be73482549d5 | overcloud-full-vmlinuz | active | ++--------------------------------------+------------------------+--------+ +``` + +This is a mandatory and easy step in the process of deploying an Overcloud, and it happens within seconds, which makes it hard to see what's under the hood. But what if you want to know what is going on? + +One thing to keep in mind: Glance works using client-server communication carried through REST APIs. Therefore, you can see what is going on by using [tcpdump][5] to take some TCP packets. + +Another thing that is important: There is a database (there's always a database, right?) that is shared among all the OpenStack platform components, and it contains all the information that Glance (and other components) needs to operate. (In my case, MariaDB is the backend.) I won't get into how to access the SQL database, as I don't recommend playing around with it, but I will show what the database looks like during the upload process. (This is an entirely-for-test OpenStack installation, so there's no need to play with the database in this example.) + +### The database + +The basic flow of this example exercise is: + +_Image Created -> Image Queued -> Image Saved -> Image Active_ + +You need permission to go through this flow, so first, you must ask OpenStack's identity service, [Keystone][6], for authorization. My Keystone catalog entry looks like this; as I'm in the Undercloud, I'll hit the public endpoint: + + +``` +| keystone  | identity       | regionOne                           | +|           |                |   public: | +|           |                | regionOne                           | +|           |                |   internal: | +|           |                | regionOne                           | +|           |                |   admin:   | +``` + +And for Glance: + + +``` +| glance    | image    | regionOne                              | +|           |          |   public:    | +|           |          | regionOne                              | +|           |          |   internal:    | +|           |          | regionOne                              | +|           |          |   admin:       | +``` + +I'll hit those ports and TCP port 3306 in the capture; the latter is so I can capture what's going on with the SQL database. To capture the packets, use the tcpdump command: + + +``` +`$ tcpdump -nvs0 -i ens3 host 172.16.0.20 and port 13000 or port 3306 or port 13292` +``` + +Under the hood, this looks like: + +Authentication: + +**Initial request (discovery of API Version Information):** + + +``` +`https://172.16.0.20:13000 "GET / HTTP/1.1"` +``` + +**Response:** + + +``` +Content-Length: 268 Content-Type: application/json Date: Tue, 18 Feb 2020 04:49:55 GMT Location: Server: Apache Vary: X-Auth-Token x-openstack-request-id: req-6edc6642-3945-4fd0-a0f7-125744fb23ec + +{ +   "versions":{ +      "values":[ +         { +            "id":"v3.13", +            "status":"stable", +            "updated":"2019-07-19T00:00:00Z", +            "links":[ +               { +                  "rel":"self", +                  "href":"" +               } +            ], +            "media-types":[ +               { +                  "base":"application/json", +                  "type":"application/vnd.openstack.identity-v3+json" +               } +            ] +         } +      ] +   } +} +``` + +**Authentication request** + + +``` +`https://172.16.0.20:13000 "POST /v3/auth/tokens HTTP/1.1"` +``` + +After this step, a token is assigned for the admin user to use the services. (The token cannot be displayed for security reasons.) The token tells the other services something like: "I've already logged in with the proper credentials against Keystone; please let me go straight to the service and ask no more questions about who I am." + +At this point, the command: + + +``` +`$ openstack overcloud image upload --image-path /home/stack/images/` +``` + +executes, and it is authorized to upload the image to the Glance service. + +The current status is: + +_**Image Created**_ _-> Image Queued -> Image Saved -> Image Active_ + +The service checks whether this image already exists: + + +``` +`https://172.16.0.20:13292 "GET /v2/images/overcloud-full-vmlinuz HTTP/1.1"` +``` + +From the client's point of view, the request looks like: + + +``` +`curl -g -i -X GET -H 'b'Content-Type': b'application/octet-stream'' -H 'b'X-Auth-Token': b'gAAAAABeS2zzWzAZBqF-whE7SmJt_Atx7tiLZhcL8mf6wJPrO3RBdv4SdnWImxbeSQSqEQdZJnwBT79SWhrtt7QDn-2o6dsAtpUb1Rb7w6xe7Qg_AHQfD5P1rU7tXXtKu2DyYFhtPg2TRQS5viV128FyItyt49Yn_ho3lWfIXaR3TuZzyIz38NU'' -H 'User-Agent: python-glanceclient' -H 'Accept-Encoding: gzip, deflate' -H 'Accept: */*' -H 'Connection: keep-alive'  --cacert /etc/pki/ca-trust/source/anchors/cm-local-ca.pem  --cert None --key None https://172.16.0.20:13292/v2/images/overcloud-full-vmlinuz` +``` + +Here, you can see the fernet token, the user-agent indicating Glance is speaking, and the TLS certificate; this is why you don't see anything in your tcpdump. + +Since the image does not exist, it is OK to get a 404 ERROR for this request. + +Next, the current images are consulted: + + +``` +`https://172.16.0.20:13292 "GET /v2/images?limit=20 HTTP/1.1" 200 78` +``` + +and retrieved from the service: + + +``` +HTTP/1.1 200 OK +Content-Length: 78 +Content-Type: application/json +X-Openstack-Request-Id: req-0f117984-f427-4d35-bec3-956432865dd1 +Date: Tue, 18 Feb 2020 04:49:55 GMT + +{ +   "images":[ + +   ], +   "first":"/v2/images?limit=20", +   "schema":"/v2/schemas/images" +} +``` + +Yes, it is still empty. + +Meanwhile, the same check has been done on the database, where a huge query has been triggered with the same results. (To sync on the timestamp, I checked on the tcpdump after the connection and queries were finished, and then compared them with the API calls' timestamp.) + +To identify where the Glance-DB calls started, I did a full-packet search with the word "glance" inside the tcpdump file. This saves a lot of time vs. searching through all the other database calls, so this is my starting point to check each database call. + +![Searching "glance" inside tcpdump][7] + +The first query returns nothing in the fields, as the image still does not exist: + + +``` +SELECT images.created_at AS images_created_at, images.updated_at AS images_updated_at, images.deleted_at AS images_deleted_at, images.deleted AS images_deleted, images.id AS images_id, images.name AS images_name, images.disk_format AS images_disk_format, images.container_format AS images_container_format, images.size AS images_size, images.virtual_size AS images_virtual_size, images.status AS images_status, images.visibility AS images_visibility, images.checksum AS images_checksum, images.os_hash_algo AS images_os_hash_algo, images.os_hash_value AS images_os_hash_value, images.min_disk AS images_min_disk, images.min_ram AS images_min_ram, images.owner AS images_owner, images.protected AS images_protected, images.os_hidden AS images_os_hidden, image_properties_1.created_at AS image_properties_1_created_at, image_properties_1.updated_at AS image_properties_1_updated_at, image_properties_1.deleted_at AS image_properties_1_deleted_at, image_properties_1.deleted AS image_properties_1_deleted, image_properties_1.id AS image_properties_1_id, image_properties_1.image_id AS image_properties_1_image_id, image_properties_1.name AS image_properties_1_name, image_properties_1.value AS image_properties_1_value, image_locations_1.created_at AS image_locations_1_created_at, image_locations_1.updated_at AS image_locations_1_updated_at, image_locations_1.deleted_at AS image_locations_1_deleted_at, image_locations_1.deleted AS image_locations_1_deleted, image_locations_1.id AS image_locations_1_id, image_locations_1.image_id AS image_locations_1_image_id, image_locations_1.value AS image_locations_1_value, image_locations_1.meta_data AS image_locations_1_meta_data, image_locations_1.status AS image_locations_1_status +FROM images LEFT OUTER JOIN image_properties AS image_properties_1 ON images.id = image_properties_1.image_id LEFT OUTER JOIN image_locations AS image_locations_1 ON images.id = image_locations_1.image_id +WHERE images.id = 'overcloud-full-vmlinuz' +``` + +Next, the image will start uploading, so an API call and a write to the database are expected. + +On the API side, the image scheme is retrieved by consulting the service in: + + +``` +`https://172.16.0.20:13292 "GET /v2/schemas/image HTTP/1.1"` +``` + +Then, some of the fields are populated with image information. This is what the scheme looks like: + + +``` +{ +   "name":"image", +   "properties":{ +      "id":{ +         "type":"string", +         "description":"An identifier for the image", +         "pattern":"^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$" +      }, +      "name":{ +         "type":[ +            "null", +            "string" +         ], +         "description":"Descriptive name for the image", +         "maxLength":255 +      }, +      "status":{ +         "type":"string", +         "readOnly":true, +         "description":"Status of the image", +         "enum":[ +            "queued", +            "saving", +            "active", +            "killed", +            "deleted", +            "uploading", +            "importing", +            "pending_delete", +            "deactivated" +         ] +      }, +      "visibility":{ +         "type":"string", +         "description":"Scope of image accessibility", +         "enum":[ +            "community", +            "public", +            "private", +            "shared" +         ] +      }, +      "protected":{ +         "type":"boolean", +         "description":"If true, image will not be deletable." +      }, +      "os_hidden":{ +         "type":"boolean", +         "description":"If true, image will not appear in default image list response." +      }, +      "checksum":{ +         "type":[ +            "null", +            "string" +         ], +         "readOnly":true, +         "description":"md5 hash of image contents.", +         "maxLength":32 +      }, +      "os_hash_algo":{ +         "type":[ +            "null", +            "string" +         ], +         "readOnly":true, +         "description":"Algorithm to calculate the os_hash_value", +         "maxLength":64 +      }, +      "os_hash_value":{ +         "type":[ +            "null", +            "string" +         ], +         "readOnly":true, +         "description":"Hexdigest of the image contents using the algorithm specified by the os_hash_algo", +         "maxLength":128 +      }, +      "owner":{ +         "type":[ +            "null", +            "string" +         ], +         "description":"Owner of the image", +         "maxLength":255 +      }, +      "size":{ +         "type":[ +            "null", +            "integer" +         ], +         "readOnly":true, +         "description":"Size of image file in bytes" +      }, +      "virtual_size":{ +         "type":[ +            "null", +            "integer" +         ], +         "readOnly":true, +         "description":"Virtual size of image in bytes" +      }, +      "container_format":{ +         "type":[ +            "null", +            "string" +         ], +         "description":"Format of the container", +         "enum":[ +            null, +            "ami", +            "ari", +            "aki", +            "bare", +            "ovf", +            "ova", +            "docker", +            "compressed" +         ] +      }, +      "disk_format":{ +         "type":[ +            "null", +            "string" +         ], +         "description":"Format of the disk", +         "enum":[ +            null, +            "ami", +            "ari", +            "aki", +            "vhd", +            "vhdx", +            "vmdk", +            "raw", +            "qcow2", +            "vdi", +            "iso", +            "ploop" +         ] +      }, +      "created_at":{ +         "type":"string", +         "readOnly":true, +         "description":"Date and time of image registration" +      }, +      "updated_at":{ +         "type":"string", +         "readOnly":true, +         "description":"Date and time of the last image modification" +      }, +      "tags":{ +         "type":"array", +         "description":"List of strings related to the image", +         "items":{ +            "type":"string", +            "maxLength":255 +         } +      }, +      "direct_url":{ +         "type":"string", +         "readOnly":true, +         "description":"URL to access the image file kept in external store" +      }, +      "min_ram":{ +         "type":"integer", +         "description":"Amount of ram (in MB) required to boot image." +      }, +      "min_disk":{ +         "type":"integer", +         "description":"Amount of disk space (in GB) required to boot image." +      }, +      "self":{ +         "type":"string", +         "readOnly":true, +         "description":"An image self url" +      }, +      "file":{ +         "type":"string", +         "readOnly":true, +         "description":"An image file url" +      }, +      "stores":{ +         "type":"string", +         "readOnly":true, +         "description":"Store in which image data resides.  Only present when the operator has enabled multiple stores.  May be a comma-separated list of store identifiers." +      }, +      "schema":{ +         "type":"string", +         "readOnly":true, +         "description":"An image schema url" +      }, +      "locations":{ +         "type":"array", +         "items":{ +            "type":"object", +            "properties":{ +               "url":{ +                  "type":"string", +                  "maxLength":255 +               }, +               "metadata":{ +                  "type":"object" +               }, +               "validation_data":{ +                  "description":"Values to be used to populate the corresponding image properties. If the image status is not 'queued', values must exactly match those already contained in the image properties.", +                  "type":"object", +                  "writeOnly":true, +                  "additionalProperties":false, +                  "properties":{ +                     "checksum":{ +                        "type":"string", +                        "minLength":32, +                        "maxLength":32 +                     }, +                     "os_hash_algo":{ +                        "type":"string", +                        "maxLength":64 +                     }, +                     "os_hash_value":{ +                        "type":"string", +                        "maxLength":128 +                     } +                  }, +                  "required":[ +                     "os_hash_algo", +                     "os_hash_value" +                  ] +               } +            }, +            "required":[ +               "url", +               "metadata" +            ] +         }, +         "description":"A set of URLs to access the image file kept in external store" +      }, +      "kernel_id":{ +         "type":[ +            "null", +            "string" +         ], +         "pattern":"^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$", +         "description":"ID of image stored in Glance that should be used as the kernel when booting an AMI-style image.", +         "is_base":false +      }, +      "ramdisk_id":{ +         "type":[ +            "null", +            "string" +         ], +         "pattern":"^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$", +         "description":"ID of image stored in Glance that should be used as the ramdisk when booting an AMI-style image.", +         "is_base":false +      }, +      "instance_uuid":{ +         "type":"string", +         "description":"Metadata which can be used to record which instance this image is associated with. (Informational only, does not create an instance snapshot.)", +         "is_base":false +      }, +      "architecture":{ +         "description":"Operating system architecture as specified in ", +         "type":"string", +         "is_base":false +      }, +      "os_distro":{ +         "description":"Common name of operating system distribution as specified in ", +         "type":"string", +         "is_base":false +      }, +      "os_version":{ +         "description":"Operating system version as specified by the distributor.", +         "type":"string", +         "is_base":false +      }, +      "description":{ +         "description":"A human-readable string describing this image.", +         "type":"string", +         "is_base":false +      }, +      "cinder_encryption_key_id":{ +         "description":"Identifier in the OpenStack Key Management Service for the encryption key for the Block Storage Service to use when mounting a volume created from this image", +         "type":"string", +         "is_base":false +      }, +      "cinder_encryption_key_deletion_policy":{ +         "description":"States the condition under which the Image Service will delete the object associated with the 'cinder_encryption_key_id' image property.  If this property is missing, the Image Service will take no action", +         "type":"string", +         "enum":[ +            "on_image_deletion", +            "do_not_delete" +         ], +         "is_base":false +      } +   }, +   "additionalProperties":{ +      "type":"string" +   }, +   "links":[ +      { +         "rel":"self", +         "href":"{self}" +      }, +      { +         "rel":"enclosure", +         "href":"{file}" +      }, +      { +         "rel":"describedby", +         "href":"{schema}" +      } +   ] +} +``` + +That's a long scheme! + +Here is the API call to start uploading the image information, and it will now move to the "queue" state: + + +``` +`curl -g -i -X POST -H 'b'Content-Type': b'application/json'' -H 'b'X-Auth-Token': b'gAAAAABeS2zzWzAZBqF-whE7SmJt_Atx7tiLZhcL8mf6wJPrO3RBdv4SdnWImxbeSQSqEQdZJnwBT79SWhrtt7QDn-2o6dsAtpUb1Rb7w6xe7Qg_AHQfD5P1rU7tXXtKu2DyYFhtPg2TRQS5viV128FyItyt49Yn_ho3lWfIXaR3TuZzyIz38NU'' -H 'User-Agent: python-glanceclient' -H 'Accept-Encoding: gzip, deflate' -H 'Accept: */*' -H 'Connection: keep-alive'  --cacert /etc/pki/ca-trust/source/anchors/cm-local-ca.pem  --cert None --key None -d '{"name": "overcloud-full-vmlinuz", "disk_format": "aki", "visibility": "public", "container_format": "bare"}' https://172.16.0.20:13292/v2/images` +``` + +Here is the API response: + + +``` +HTTP/1.1 201 Created +Content-Length: 629 +Content-Type: application/json +Location: +Openstack-Image-Import-Methods: web-download +X-Openstack-Request-Id: req-bd5194f0-b1c2-40d3-a646-8a24ed0a1b1b +Date: Tue, 18 Feb 2020 04:49:56 GMT + +{ +   "name":"overcloud-full-vmlinuz", +   "disk_format":"aki", +   "container_format":"bare", +   "visibility":"public", +   "size":null, +   "virtual_size":null, +   "status":"queued", +   "checksum":null, +   "protected":false, +   "min_ram":0, +   "min_disk":0, +   "owner":"c0a46a106d3341649a25b10f2770aff8", +   "os_hidden":false, +   "os_hash_algo":null, +   "os_hash_value":null, +   "id":"13892850-6add-4c28-87cd-6da62e6f8a3c", +   "created_at":"2020-02-18T04:49:55Z", +   "updated_at":"2020-02-18T04:49:55Z", +   "tags":[ + +   ], +   "self":"/v2/images/13892850-6add-4c28-87cd-6da62e6f8a3c", +   "file":"/v2/images/13892850-6add-4c28-87cd-6da62e6f8a3c/file", +   "schema":"/v2/schemas/image" +} +``` + +and the SQL call to store the information in the Glance-DB: + + +``` +`INSERT INTO images (created_at, updated_at, deleted_at, deleted, id, name, disk_format, container_format, SIZE, virtual_size, STATUS, visibility, checksum, os_hash_algo, os_hash_value, min_disk, min_ram, owner, protected, os_hidden) VALUES ('2020-02-18 04:49:55.993652', '2020-02-18 04:49:55.993652', NULL, 0, '13892850-6add-4c28-87cd-6da62e6f8a3c', 'overcloud-full-vmlinuz', 'aki', 'bare', NULL, NULL, 'queued', 'public', NULL, NULL, NULL, 0, 0, 'c0a46a106d3341649a25b10f2770aff8', 0, 0)` +``` + +Current status: + +_Image Created ->_ _**Image Queued**_ _-> Image Saved -> Image Active_ + +In the Glance architecture, the images are "physically" stored in the specified backend (Swift in this case), so traffic will also hit the Swift endpoint at port 8080. Capturing this traffic will make the .pcap file as large as the images being uploaded (2GB in my case).[*][8]   + +![Glance architecture][9] + + +``` +SELECT image_properties.created_at AS image_properties_created_at, image_properties.updated_at AS image_properties_updated_at, image_properties.deleted_at AS image_properties_deleted_at, image_properties.deleted AS image_properties_deleted, image_properties.id AS image_properties_id, image_properties.image_id AS image_properties_image_id, image_properties.name AS image_properties_name, image_properties.value AS image_properties_value +FROM image_properties +WHERE '13892850-6add-4c28-87cd-6da62e6f8a3c' = image_properties.image_id +``` + +You can see some validations happening within the database. At this point, the flow status is "queued" (as shown above), and you can check it here: + +![Checking the Glance image status][10] + +You can also check it with the following queries, where the **updated_at** field and the flow status are modified accordingly (i.e., queued to saving): + +Current status: + +_Image Created -> Image Queued ->_ _**Image Saved**_ _-> Image Active_ + + +``` +SELECT images.id AS images_id +FROM images +WHERE images.id = '13892850-6add-4c28-87cd-6da62e6f8a3c' AND images.status = 'queued' +UPDATE images SET updated_at='2020-02-18 04:49:56.046542', id='13892850-6add-4c28-87cd-6da62e6f8a3c', name='overcloud-full-vmlinuz', disk_format='aki', container_format='bare', SIZE=NULL, virtual_size=NULL, STATUS='saving', visibility='public', checksum=NULL, os_hash_algo=NULL, os_hash_value=NULL, min_disk=0, min_ram=0, owner='c0a46a106d3341649a25b10f2770aff8', protected=0, os_hidden=0 WHERE images.id = '13892850-6add-4c28-87cd-6da62e6f8a3c' AND images.status = 'queued' +``` + +This is validated during the process with the following query: + + +``` +SELECT images.created_at AS images_created_at, images.updated_at AS images_updated_at, images.deleted_at AS images_deleted_at, images.deleted AS images_deleted, images.id AS images_id, images.name AS images_name, images.disk_format AS images_disk_format, images.container_format AS images_container_format, images.size AS images_size, images.virtual_size AS images_virtual_size, images.status AS images_status, images.visibility AS images_visibility, images.checksum AS images_checksum, images.os_hash_algo AS images_os_hash_algo, images.os_hash_value AS images_os_hash_value, images.min_disk AS images_min_disk, images.min_ram AS images_min_ram, images.owner AS images_owner, images.protected AS images_protected, images.os_hidden AS images_os_hidden, image_properties_1.created_at AS image_properties_1_created_at, image_properties_1.updated_at AS image_properties_1_updated_at, image_properties_1.deleted_at AS image_properties_1_deleted_at, image_properties_1.deleted AS image_properties_1_deleted, image_properties_1.id AS image_properties_1_id, image_properties_1.image_id AS image_properties_1_image_id, image_properties_1.name AS image_properties_1_name, image_properties_1.value AS image_properties_1_value, image_locations_1.created_at AS image_locations_1_created_at, image_locations_1.updated_at AS image_locations_1_updated_at, image_locations_1.deleted_at AS image_locations_1_deleted_at, image_locations_1.deleted AS image_locations_1_deleted, image_locations_1.id AS image_locations_1_id, image_locations_1.image_id AS image_locations_1_image_id, image_locations_1.value AS image_locations_1_value, image_locations_1.meta_data AS image_locations_1_meta_data, image_locations_1.status AS image_locations_1_status +FROM images LEFT OUTER JOIN image_properties AS image_properties_1 ON images.id = image_properties_1.image_id LEFT OUTER JOIN image_locations AS image_locations_1 ON images.id = image_locations_1.image_id +WHERE images.id = '13892850-6add-4c28-87cd-6da62e6f8a3c' +``` + +And you can see its response in the Wireshark capture: + +![Wireshark capture][11] + +After the image is completely uploaded, its status will change to "active," which means the image is available in the service and ready to use. + + +``` + "GET /v2/images/13892850-6add-4c28-87cd-6da62e6f8a3c HTTP/1.1" 200 + +{ +   "name":"overcloud-full-vmlinuz", +   "disk_format":"aki", +   "container_format":"bare", +   "visibility":"public", +   "size":8106848, +   "virtual_size":null, +   "status":"active", +   "checksum":"5d31ee013d06b83d02c106ea07f20265", +   "protected":false, +   "min_ram":0, +   "min_disk":0, +   "owner":"c0a46a106d3341649a25b10f2770aff8", +   "os_hidden":false, +   "os_hash_algo":"sha512", +   "os_hash_value":"9f59d36dec7b30f69b696003e7e3726bbbb27a36211a0b31278318c2af0b969ffb279b0991474c18c9faef8b9e96cf372ce4087ca13f5f05338a36f57c281499", +   "id":"13892850-6add-4c28-87cd-6da62e6f8a3c", +   "created_at":"2020-02-18T04:49:55Z", +   "updated_at":"2020-02-18T04:49:56Z", +   "direct_url":"swift+config://ref1/glance/13892850-6add-4c28-87cd-6da62e6f8a3c", +   "tags":[ + +   ], +   "self":"/v2/images/13892850-6add-4c28-87cd-6da62e6f8a3c", +   "file":"/v2/images/13892850-6add-4c28-87cd-6da62e6f8a3c/file", +   "schema":"/v2/schemas/image" +} +``` + +You can also see the database call that updates the current status: + + +``` +`UPDATE images SET updated_at='2020-02-18 04:49:56.571879', id='13892850-6add-4c28-87cd-6da62e6f8a3c', name='overcloud-full-vmlinuz', disk_format='aki', container_format='bare', SIZE=8106848, virtual_size=NULL, STATUS='active', visibility='public', checksum='5d31ee013d06b83d02c106ea07f20265', os_hash_algo='sha512', os_hash_value='9f59d36dec7b30f69b696003e7e3726bbbb27a36211a0b31278318c2af0b969ffb279b0991474c18c9faef8b9e96cf372ce4087ca13f5f05338a36f57c281499', min_disk=0, min_ram=0, owner='c0a46a106d3341649a25b10f2770aff8', protected=0, os_hidden=0 WHERE images.id = '13892850-6add-4c28-87cd-6da62e6f8a3c' AND images.status = 'saving'` +``` + +Current status: + +_Image Created -> Image Queued -> Image Saved ->_ _**Image Active**_ + +One interesting thing is that a property in the image is added after the image is uploaded using a PATCH. This property is **hw_architecture** and it is set to **x86_64**: + + +``` + "PATCH /v2/images/13892850-6add-4c28-87cd-6da62e6f8a3c HTTP/1.1" + +curl -g -i -X PATCH -H 'b'Content-Type': b'application/openstack-images-v2.1-json-patch'' -H 'b'X-Auth-Token': b'gAAAAABeS2zzWzAZBqF-whE7SmJt_Atx7tiLZhcL8mf6wJPrO3RBdv4SdnWImxbeSQSqEQdZJnwBT79SWhrtt7QDn-2o6dsAtpUb1Rb7w6xe7Qg_AHQfD5P1rU7tXXtKu2DyYFhtPg2TRQS5viV128FyItyt49Yn_ho3lWfIXaR3TuZzyIz38NU'' -H 'User-Agent: python-glanceclient' -H 'Accept-Encoding: gzip, deflate' -H 'Accept: */*' -H 'Connection: keep-alive'  --cacert /etc/pki/ca-trust/source/anchors/cm-local-ca.pem  --cert None --key None -d '[{"op": "add", "path": "/hw_architecture", "value": "x86_64"}]' + +Response: + +{ +   "hw_architecture":"x86_64", +   "name":"overcloud-full-vmlinuz", +   "disk_format":"aki", +   "container_format":"bare", +   "visibility":"public", +   "size":8106848, +   "virtual_size":null, +   "status":"active", +   "checksum":"5d31ee013d06b83d02c106ea07f20265", +   "protected":false, +   "min_ram":0, +   "min_disk":0, +   "owner":"c0a46a106d3341649a25b10f2770aff8", +   "os_hidden":false, +   "os_hash_algo":"sha512", +   "os_hash_value":"9f59d36dec7b30f69b696003e7e3726bbbb27a36211a0b31278318c2af0b969ffb279b0991474c18c9faef8b9e96cf372ce4087ca13f5f05338a36f57c281499", +   "id":"13892850-6add-4c28-87cd-6da62e6f8a3c", +   "created_at":"2020-02-18T04:49:55Z", +   "updated_at":"2020-02-18T04:49:56Z", +   "direct_url":"swift+config://ref1/glance/13892850-6add-4c28-87cd-6da62e6f8a3c", +   "tags":[ + +   ], +   "self":"/v2/images/13892850-6add-4c28-87cd-6da62e6f8a3c", +   "file":"/v2/images/13892850-6add-4c28-87cd-6da62e6f8a3c/file", +   "schema":"/v2/schemas/image" +} +``` + +This is also updated in the MySQL database: + + +``` +`INSERT INTO image_properties (created_at, updated_at, deleted_at, deleted, image_id, name, VALUE) VALUES ('2020-02-18 04:49:56.655780', '2020-02-18 04:49:56.655783', NULL, 0, '13892850-6add-4c28-87cd-6da62e6f8a3c', 'hw_architecture', 'x86_64')` +``` + +This is pretty much what happens when you upload an image to Glance. Here's what it looks like if you check on the database: + + +``` +MariaDB [glance]> SELECT images.created_at AS images_created_at, images.updated_at AS images_updated_at, images.deleted_at AS images_deleted_at, images.deleted AS images_deleted, images.id AS images_id, images.name AS images_name, images.disk_format AS images_disk_format, images.container_format AS images_container_format, images.size AS images_size, images.virtual_size AS images_virtual_size, images.status AS images_status, images.visibility AS images_visibility, images.checksum AS images_checksum, images.os_hash_algo AS images_os_hash_algo, images.os_hash_value AS images_os_hash_value, images.min_disk AS images_min_disk, images.min_ram AS images_min_ram, images.owner AS images_owner, images.protected AS images_protected, images.os_hidden AS images_os_hidden, image_properties_1.created_at AS image_properties_1_created_at, image_properties_1.updated_at AS image_properties_1_updated_at, image_properties_1.deleted_at AS image_properties_1_deleted_at, image_properties_1.deleted AS image_properties_1_deleted, image_properties_1.id AS image_properties_1_id, image_properties_1.image_id AS image_properties_1_image_id, image_properties_1.name AS image_properties_1_name, image_properties_1.value AS image_properties_1_value, image_locations_1.created_at AS image_locations_1_created_at, image_locations_1.updated_at AS image_locations_1_updated_at, image_locations_1.deleted_at AS image_locations_1_deleted_at, image_locations_1.deleted AS image_locations_1_deleted, image_locations_1.id AS image_locations_1_id, image_locations_1.image_id AS image_locations_1_image_id, image_locations_1.value AS image_locations_1_value, image_locations_1.meta_data AS image_locations_1_meta_data, image_locations_1.status AS image_locations_1_status  FROM images LEFT OUTER JOIN image_properties AS image_properties_1 ON images.id = image_properties_1.image_id LEFT OUTER JOIN image_locations AS image_locations_1 ON images.id = image_locations_1.image_id  WHERE images.id = '13892850-6add-4c28-87cd-6da62e6f8a3c'\G; +*************************** 1. row *************************** +            images_created_at: 2020-02-18 04:49:55 +            images_updated_at: 2020-02-18 04:49:56 +            images_deleted_at: NULL +               images_deleted: 0 +                    images_id: 13892850-6add-4c28-87cd-6da62e6f8a3c +                  images_name: overcloud-full-vmlinuz +           images_disk_format: aki +      images_container_format: bare +                  images_size: 8106848 +          images_virtual_size: NULL +                images_status: active +            images_visibility: public +              images_checksum: 5d31ee013d06b83d02c106ea07f20265 +          images_os_hash_algo: sha512 +         images_os_hash_value: 9f59d36dec7b30f69b696003e7e3726bbbb27a36211a0b31278318c2af0b969ffb279b0991474c18c9faef8b9e96cf372ce4087ca13f5f05338a36f57c281499 +              images_min_disk: 0 +               images_min_ram: 0 +                 images_owner: c0a46a106d3341649a25b10f2770aff8 +             images_protected: 0 +             images_os_hidden: 0 +image_properties_1_created_at: 2020-02-18 04:49:56 +image_properties_1_updated_at: 2020-02-18 04:49:56 +image_properties_1_deleted_at: NULL +   image_properties_1_deleted: 0 +        image_properties_1_id: 11 +  image_properties_1_image_id: 13892850-6add-4c28-87cd-6da62e6f8a3c +      image_properties_1_name: hw_architecture +     image_properties_1_value: x86_64 + image_locations_1_created_at: 2020-02-18 04:49:56 + image_locations_1_updated_at: 2020-02-18 04:49:56 + image_locations_1_deleted_at: NULL +    image_locations_1_deleted: 0 +         image_locations_1_id: 7 +   image_locations_1_image_id: 13892850-6add-4c28-87cd-6da62e6f8a3c +      image_locations_1_value: swift+config://ref1/glance/13892850-6add-4c28-87cd-6da62e6f8a3c +  image_locations_1_meta_data: {} +     image_locations_1_status: active +1 row in set (0.00 sec) +``` + +The final result is: + + +``` +(undercloud) [stack@undercloud ~]$ openstack image list ++--------------------------------------+------------------------+--------+ +| ID                                   | Name                   | Status | ++--------------------------------------+------------------------+--------+ +| 9a26b9da-3783-4223-bdd7-c553aa194e30 | overcloud-full         | active | +| a2914297-c70f-4021-bc3e-8ec2123f6ea6 | overcloud-full-initrd  | active | +| 13892850-6add-4c28-87cd-6da62e6f8a3c | overcloud-full-vmlinuz | active | ++--------------------------------------+------------------------+--------+ +(undercloud) [stack@undercloud ~]$ +``` + +Some other minor things are happening during this process, but overall, this is how it looks. + +### Conclusion + +Understanding the flow of the most common actions in the OpenStack platform will enable you to enhance your troubleshooting skills when facing some issues at work. You can check the status of an image in Glance; know whether an image is in a "queued," "saving," or "active" state; and do some captures in your environment to see what is going on by checking the endpoints you need to check. + +I enjoy debugging. I consider this is an important skill for any role—whether you are working in a support, consulting, developer (of course!), or architect role. I hope this article gave you some basic guidelines to start debugging things. + +* * * + +* In case you're wondering how to open a 2GB .pcap file without problems, here is one way to do it: + + +``` +`$ editcap -c 5000 image-upload.pcap upload-overcloud-image.pcap` +``` + +This splits your huge capture in smaller captures of 5,000 packets each. + +* * * + +_This article was [originally posted][12] on LinkedIn and is reprinted with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/glance + +作者:[Jair Patete][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/jpatete +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/yourimagehere_520x292.png?itok=V-xhX7KL (blank background that says your image here) +[2]: https://www.openstack.org/software/releases/ocata/components/glance +[3]: https://www.openstack.org/ +[4]: https://wiki.openstack.org/wiki/TripleO +[5]: https://www.tcpdump.org/ +[6]: https://docs.openstack.org/keystone/latest/ +[7]: https://opensource.com/sites/default/files/uploads/glance-db-calls.png (Searching "glance" inside tcpdump) +[8]: tmp.qBKg0ttLIJ#* +[9]: https://opensource.com/sites/default/files/uploads/glance-architecture.png (Glance architecture) +[10]: https://opensource.com/sites/default/files/uploads/check-flow-status.png (Checking the Glance image status) +[11]: https://opensource.com/sites/default/files/uploads/wireshark-capture.png (Wireshark capture) +[12]: https://www.linkedin.com/pulse/what-happens-behind-doors-when-we-upload-image-glance-patete-garc%25C3%25ADa/?trackingId=czWiFC4dRfOsSZJ%2BXdzQfg%3D%3D diff --git a/sources/tech/20200317 Create Stunning Pixel Art With Free and Open Source Editor Pixelorama.md b/sources/tech/20200317 Create Stunning Pixel Art With Free and Open Source Editor Pixelorama.md new file mode 100644 index 0000000000..fc3c4b7bab --- /dev/null +++ b/sources/tech/20200317 Create Stunning Pixel Art With Free and Open Source Editor Pixelorama.md @@ -0,0 +1,108 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Create Stunning Pixel Art With Free and Open Source Editor Pixelorama) +[#]: via: (https://itsfoss.com/pixelorama/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Create Stunning Pixel Art With Free and Open Source Editor Pixelorama +====== + +_**Brief: Pixelorama is a cross-platform, free and open source 2D sprite editor. It provides all the necessary tools to create pixel art in a neat user interface.**_ + +### Pixelorama: open source sprite editor + +[Pixelorama][1] is a tool created by young game developers at [Orama Interactive][2]. They have developed a few 2D games and a couple of them use pixel art. + +While Orama is primarily into game development, the developers are also creating utility tools that help them (and others) create those games. + +The free and open source sprite editor, Pixelorama is such a utility tool. It’s built on top of [Godot Engine][3] and is perfect for creating pixel art. + +![Pixelorama screenshot][4] + +You see the pixel art in the screenshot above? It’s been created using Pixelorama. This video shows a timelapse video of creating the above image. + +### Features of Pixelorama + +Here are the main features Pixelorama provides: + + * Multiple tools like penicl, erase, fill bucket color picker etc + * Multiple layer system that allows you to add, remove, move up and down, clone and merge as many layers as you like + * Support for spritesheets + * Import images and edit them inside Pixelorama + * Animation timeline with [Onion Skinning][5] + * Custom brushes + * Save and open your projects in Pixelorama’s custom file format, .pxo + * Horizontal & vertical mirrored drawing + * Tile Mode for pattern creation + * Split screen mode and mini canvas preview + * Zoom with mouse scroll wheel + * Unlimited undo and redo + * Scale, crop, flip, rotate, color invert and desaturate your images + * Keyboard shortcuts + * Available in several languages + * Supports Linux, Windows and macOS + + + +### Installing Pixelorama on Linux + +Pixelorama is available as a Snap application and if you are using Ubuntu, you can find it in the software center itself. + +![Pixelorama is available in Ubuntu Software Center][6] + +Alternatively, if you have [Snap support enabled on your Linux distribution][7], you can install it using this command: + +``` +sudo snap install pixelorama +``` + +If you don’t want to use Snap, no worries. You can download the latest release of Pixelorama from [their GitHub repository][8], [extract the zip file][9] and you’ll see an executable file. Give this file execute permission and double click on it to run the application. + +[Download Pixelorama][10] + +**Conclusion** + +![Pixelorama Welcome Screen][11] + +In the Pixeloaram features, it says that you can import images and edit them. I guess that’s only true for certain kind of files because when I tried to import PNG or JPEG files, the application crashed. + +However, I could easily doodle like a 3 year old and make random pixel art. I am not that into arts but I think this is a [useful tool for digital artists on Linux][12]. + +I liked the idea that despite being game developers, they are creating tools that could help other game developers and artists. That’s the spirit of open source. + +If you like the project and will be using it, consider supporting them by a donation. [It’s FOSS has made a humble donation][13] of $25 to thank their effort. + +[Donate to Pixelorama (personal Paypal account of the lead developer)][14] + +Do you like Pixelorama? Do you use some other open source sprite editor? Feel free to share your views in the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/pixelorama/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://www.orama-interactive.com/pixelorama +[2]: https://www.orama-interactive.com/ +[3]: https://godotengine.org/ +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/pixelorama-v6.jpg?ssl=1 +[5]: https://en.wikipedia.org/wiki/Onion_skinning +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/pixelorama-ubuntu-software-center.jpg?ssl=1 +[7]: https://itsfoss.com/install-snap-linux/ +[8]: https://github.com/Orama-Interactive/Pixelorama +[9]: https://itsfoss.com/unzip-linux/ +[10]: https://github.com/Orama-Interactive/Pixelorama/releases +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/pixelorama.jpg?ssl=1 +[12]: https://itsfoss.com/best-linux-graphic-design-software/ +[13]: https://itsfoss.com/donations-foss/ +[14]: https://www.paypal.me/erevos diff --git a/sources/tech/20200318 Share data between C and Python with this messaging library.md b/sources/tech/20200318 Share data between C and Python with this messaging library.md new file mode 100644 index 0000000000..cda6e54e33 --- /dev/null +++ b/sources/tech/20200318 Share data between C and Python with this messaging library.md @@ -0,0 +1,663 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Share data between C and Python with this messaging library) +[#]: via: (https://opensource.com/article/20/3/zeromq-c-python) +[#]: author: (Cristiano L. Fontana https://opensource.com/users/cristianofontana) + +Share data between C and Python with this messaging library +====== +ZeroMQ makes for a fast and resilient messaging library to gather data +and share between multiple languages. +![Chat via email][1] + +I've had moments as a software engineer when I'm asked to do a task that sends shivers down my spine. One such moment was when I had to write an interface between some new hardware infrastructure that requires C and a cloud infrastructure, which is primarily Python. + +One strategy could be to [write an extension in C][2], which Python supports by design. A quick glance at the documentation shows this would mean writing a good amount of C. That can be good in some cases, but it's not what I prefer to do. Another strategy is to put the two tasks in separate processes and exchange messages between the two with the [ZeroMQ messaging library][3]. + +When I experienced this type of scenario before discovering ZeroMQ, I went through the extension-writing path. It was not that bad, but it is very time-consuming and convoluted. Nowadays, to avoid that, I subdivide a system into independent processes that exchange information through messages sent over [communication sockets][4]. With this approach, several programming languages can coexist, and each process is simpler and thus easier to debug. + +ZeroMQ provides an even easier process: + + 1. Write a small shim in C that reads data from the hardware and sends whatever it finds as a message. + 2. Write a Python interface between the new and existing infrastructure. + + + +One of ZeroMQ's project's founders is [Pieter Hintjens][5], a remarkable person with [interesting views and writings][6]. + +### Prerequisites + +For this tutorial, you will need: + + * A C compiler (e.g., [GCC][7] or [Clang][8]) + * The [**libzmq** library][9] + * [Python 3][10] + * [ZeroMQ bindings][11] for python + + + +Install them on Fedora with: + + +``` +`$ dnf install clang zeromq zeromq-devel python3 python3-zmq` +``` + +For Debian or Ubuntu: + + +``` +`$ apt-get install clang libzmq5 libzmq3-dev python3 python3-zmq` +``` + +If you run into any issues, refer to each project's installation instructions (which are linked above). + +### Writing the hardware-interfacing library + +Since this is a hypothetical scenario, this tutorial will write a fictitious library with two functions: + + * **fancyhw_init()** to initiate the (hypothetical) hardware + * **fancyhw_read_val()** to return a value read from the hardware + + + +Save the library's full source code to a file named **libfancyhw.h**: + + +``` +#ifndef LIBFANCYHW_H +#define LIBFANCYHW_H + +#include <stdlib.h> +#include <stdint.h> + +// This is the fictitious hardware interfacing library + +void fancyhw_init(unsigned int init_param) +{ +    [srand][12](init_param); +} + +int16_t fancyhw_read_val(void) +{ +    return (int16_t)[rand][13](); +} + +#endif +``` + +This library can simulate the data you want to pass between languages, thanks to the random number generator. + +### Designing a C interface + +The following will go step-by-step through writing the C interface—from including the libraries to managing the data transfer. + +#### Libraries + +Begin by loading the necessary libraries (the purpose of each library is in a comment in the code): + + +``` +// For printf() +#include <stdio.h> +// For EXIT_* +#include <stdlib.h> +// For memcpy() +#include <string.h> +// For sleep() +#include <unistd.h> + +#include <zmq.h> + +#include "libfancyhw.h" +``` + +#### Significant parameters + +Define the **main** function and the significant parameters needed for the rest of the program: + + +``` +int main(void) +{ +    const unsigned int INIT_PARAM = 12345; +    const unsigned int REPETITIONS = 10; +    const unsigned int PACKET_SIZE = 16; +    const char *TOPIC = "fancyhw_data"; + +    ... +``` + +#### Initialization + +Both libraries need some initialization. The fictitious one needs just one parameter: + + +``` +`fancyhw_init(INIT_PARAM);` +``` + +The ZeroMQ library needs some real initialization. First, define a **context**—an object that manages all the sockets: + + +``` +void *context = zmq_ctx_new(); + +if (!context) +{ +    [printf][14]("ERROR: ZeroMQ error occurred during zmq_ctx_new(): %s\n", zmq_strerror(errno)); + +    return EXIT_FAILURE; +} +``` + +Then define the socket used to deliver data. ZeroMQ supports several types of sockets, each with its application. Use a **publish** socket (also known as **PUB** socket), which can deliver copies of a message to multiple receivers. This approach enables you to attach several receivers that will all get the same messages. If there are no receivers, the messages will be discarded (i.e., they will not be queued). Do this with: + + +``` +`void *data_socket = zmq_socket(context, ZMQ_PUB);` +``` + +The socket must be bound to an address so that the clients know where to connect. In this case, use the [TCP transport layer][15] (there are [other options][16], but TCP is a good default choice): + + +``` +const int rb = zmq_bind(data_socket, "tcp://*:5555"); + +if (rb != 0) +{ +    [printf][14]("ERROR: ZeroMQ error occurred during zmq_ctx_new(): %s\n", zmq_strerror(errno)); + +    return EXIT_FAILURE; +} +``` + +Next, calculate some useful values that you will need later. Note **TOPIC** in the code below; **PUB** sockets need a topic to be associated with the messages they send. Topics can be used by the receivers to filter messages: + + +``` +const size_t topic_size = [strlen][17](TOPIC); +const size_t envelope_size = topic_size + 1 + PACKET_SIZE * sizeof(int16_t); + +[printf][14]("Topic: %s; topic size: %zu; Envelope size: %zu\n", TOPIC, topic_size, envelope_size); +``` + +#### Sending messages + +Start a loop that sends **REPETITIONS** messages: + + +``` +for (unsigned int i = 0; i < REPETITIONS; i++) +{ +    ... +``` + +Before sending a message, fill a buffer of **PACKET_SIZE** values. The library provides signed integers of 16 bits. Since the dimension of an **int** in C is not defined, use an **int** with a specific width: + + +``` +int16_t buffer[PACKET_SIZE]; + +for (unsigned int j = 0; j < PACKET_SIZE; j++) +{ +    buffer[j] = fancyhw_read_val(); +} + +[printf][14]("Read %u data values\n", PACKET_SIZE); +``` + +The first step in message preparation and delivery is creating a ZeroMQ message and allocating the memory necessary for your message. This empty message is an envelope to store the data you will ship: + + +``` +zmq_msg_t envelope; + +const int rmi = zmq_msg_init_size(&envelope, envelope_size); +if (rmi != 0) +{ +    [printf][14]("ERROR: ZeroMQ error occurred during zmq_msg_init_size(): %s\n", zmq_strerror(errno)); + +    zmq_msg_close(&envelope); + +    break; +} +``` + +Now that the memory is allocated, store the data in the ZeroMQ message "envelope." The **zmq_msg_data()** function returns a pointer to the beginning of the buffer in the envelope. The first part is the topic, followed by a space, then the binary data. Add whitespace as a separator between the topic and the data. To move along the buffer, you have to play with casts and [pointer arithmetic][18]. (Thank you, C, for making things straightforward.) Do this with: + + +``` +[memcpy][19](zmq_msg_data(&envelope), TOPIC, topic_size); +[memcpy][19]((void*)((char*)zmq_msg_data(&envelope) + topic_size), " ", 1); +[memcpy][19]((void*)((char*)zmq_msg_data(&envelope) + 1 + topic_size), buffer, PACKET_SIZE * sizeof(int16_t)); +``` + +Send the message through the **data_socket**: + + +``` +const size_t rs = zmq_msg_send(&envelope, data_socket, 0); +if (rs != envelope_size) +{ +    [printf][14]("ERROR: ZeroMQ error occurred during zmq_msg_send(): %s\n", zmq_strerror(errno)); + +    zmq_msg_close(&envelope); + +    break; +} +``` + +Make sure to dispose of the envelope after you use it: + + +``` +zmq_msg_close(&envelope); + +[printf][14]("Message sent; i: %u, topic: %s\n", i, TOPIC); +``` + +#### Clean it up + +Because C does not provide [garbage collection][20], you have to tidy up. After you are done sending your messages, close the program with the clean-up needed to release the used memory: + + +``` +const int rc = zmq_close(data_socket); + +if (rc != 0) +{ +    [printf][14]("ERROR: ZeroMQ error occurred during zmq_close(): %s\n", zmq_strerror(errno)); + +    return EXIT_FAILURE; +} + +const int rd = zmq_ctx_destroy(context); + +if (rd != 0) +{ +    [printf][14]("Error occurred during zmq_ctx_destroy(): %s\n", zmq_strerror(errno)); + +    return EXIT_FAILURE; +} + +return EXIT_SUCCESS; +``` + +#### The entire C program + +Save the full interface library below to a local file called **hw_interface.c**: + + +``` +// For printf() +#include <stdio.h> +// For EXIT_* +#include <stdlib.h> +// For memcpy() +#include <string.h> +// For sleep() +#include <unistd.h> + +#include <zmq.h> + +#include "libfancyhw.h" + +int main(void) +{ +    const unsigned int INIT_PARAM = 12345; +    const unsigned int REPETITIONS = 10; +    const unsigned int PACKET_SIZE = 16; +    const char *TOPIC = "fancyhw_data"; + +    fancyhw_init(INIT_PARAM); + +    void *context = zmq_ctx_new(); + +    if (!context) +    { +        [printf][14]("ERROR: ZeroMQ error occurred during zmq_ctx_new(): %s\n", zmq_strerror(errno)); + +        return EXIT_FAILURE; +    } + +    void *data_socket = zmq_socket(context, ZMQ_PUB); + +    const int rb = zmq_bind(data_socket, "tcp://*:5555"); + +    if (rb != 0) +    { +        [printf][14]("ERROR: ZeroMQ error occurred during zmq_ctx_new(): %s\n", zmq_strerror(errno)); + +        return EXIT_FAILURE; +    } + +    const size_t topic_size = [strlen][17](TOPIC); +    const size_t envelope_size = topic_size + 1 + PACKET_SIZE * sizeof(int16_t); + +    [printf][14]("Topic: %s; topic size: %zu; Envelope size: %zu\n", TOPIC, topic_size, envelope_size); + +    for (unsigned int i = 0; i < REPETITIONS; i++) +    { +        int16_t buffer[PACKET_SIZE]; + +        for (unsigned int j = 0; j < PACKET_SIZE; j++) +        { +            buffer[j] = fancyhw_read_val(); +        } + +        [printf][14]("Read %u data values\n", PACKET_SIZE); + +        zmq_msg_t envelope; +    +        const int rmi = zmq_msg_init_size(&envelope, envelope_size); +        if (rmi != 0) +        { +            [printf][14]("ERROR: ZeroMQ error occurred during zmq_msg_init_size(): %s\n", zmq_strerror(errno)); +    +            zmq_msg_close(&envelope); +    +            break; +        } +        +        [memcpy][19](zmq_msg_data(&envelope), TOPIC, topic_size); + +        [memcpy][19]((void*)((char*)zmq_msg_data(&envelope) + topic_size), " ", 1); + +        [memcpy][19]((void*)((char*)zmq_msg_data(&envelope) + 1 + topic_size), buffer, PACKET_SIZE * sizeof(int16_t)); +    +        const size_t rs = zmq_msg_send(&envelope, data_socket, 0); +        if (rs != envelope_size) +        { +            [printf][14]("ERROR: ZeroMQ error occurred during zmq_msg_send(): %s\n", zmq_strerror(errno)); +    +            zmq_msg_close(&envelope); +    +            break; +        } +    +        zmq_msg_close(&envelope); + +        [printf][14]("Message sent; i: %u, topic: %s\n", i, TOPIC); + +        sleep(1); +    } + +    const int rc = zmq_close(data_socket); + +    if (rc != 0) +    { +        [printf][14]("ERROR: ZeroMQ error occurred during zmq_close(): %s\n", zmq_strerror(errno)); + +        return EXIT_FAILURE; +    } + +    const int rd = zmq_ctx_destroy(context); + +    if (rd != 0) +    { +        [printf][14]("Error occurred during zmq_ctx_destroy(): %s\n", zmq_strerror(errno)); + +        return EXIT_FAILURE; +    } + +    return EXIT_SUCCESS; +} +``` + +Compile using the command: + + +``` +`$ clang -std=c99 -I. hw_interface.c -lzmq -o hw_interface` +``` + +If there are no compilation errors, you can run the interface. What's great is that ZeroMQ **PUB** sockets can run without any applications sending or retrieving data. That reduces complexity because there is no obligation in terms of which process needs to start first. + +Run the interface: + + +``` +$ ./hw_interface +Topic: fancyhw_data; topic size: 12; Envelope size: 45 +Read 16 data values +Message sent; i: 0, topic: fancyhw_data +Read 16 data values +Message sent; i: 1, topic: fancyhw_data +Read 16 data values +... +... +``` + +The output shows the data being sent through ZeroMQ. Now you need an application to read the data. + +### Write a Python data processor + +You are now ready to pass the data from C to a Python application. + +#### Libraries + +You need two libraries to help transfer data. First, you need ZeroMQ bindings in Python: + + +``` +`$ python3 -m pip install zmq` +``` + +The other is the [**struct** library][21], which decodes binary data. It's commonly available with the Python standard library, so there's no need to **pip install** it. + +The first part of the Python program imports both of these libraries: + + +``` +import zmq +import struct +``` + +#### Significant parameters + +To use ZeroMQ, you must subscribe to the same topic used in the constant **TOPIC** above: + + +``` +topic = "fancyhw_data".encode('ascii') + +print("Reading messages with topic: {}".format(topic)) +``` + +#### Initialization + +Next, initialize the context and the socket. Use a **subscribe** socket (also known as a **SUB** socket), which is the natural partner of the **PUB** socket. The socket also needs to subscribe to the right topic: + + +``` +with zmq.Context() as context: +    socket = context.socket(zmq.SUB) + +    socket.connect("tcp://127.0.0.1:5555") +    socket.setsockopt(zmq.SUBSCRIBE, topic) + +    i = 0 + +    ... +``` + +#### Receiving messages + +Start an infinite loop that waits for new messages to be delivered to the SUB socket. The loop will be closed if you press **Ctrl+C** or if an error occurs: + + +``` +    try: +        while True: + +            ... # we will fill this in next + +    except KeyboardInterrupt: +        socket.close() +    except Exception as error: +        print("ERROR: {}".format(error)) +        socket.close() +``` + +The loop waits for new messages to arrive with the **recv()** method. Then it splits whatever is received at the first space to separate the topic from the content: + + +``` +`binary_topic, data_buffer = socket.recv().split(b' ', 1)` +``` + +#### Decoding messages + +Python does yet not know that the topic is a string, so decode it using the standard ASCII encoding: + + +``` +topic = binary_topic.decode(encoding = 'ascii') + +print("Message {:d}:".format(i)) +print("\ttopic: '{}'".format(topic)) +``` + +The next step is to read the binary data using the **struct** library, which can convert shapeless binary blobs to significant values. First, calculate the number of values stored in the packet. This example uses 16-bit signed integers that correspond to an "h" in the **struct** [format][22]: + + +``` +packet_size = len(data_buffer) // struct.calcsize("h") + +print("\tpacket size: {:d}".format(packet_size)) +``` + +By knowing how many values are in the packet, you can define the format by preparing a string with the number of values and their types (e.g., "**16h**"): + + +``` +`struct_format = "{:d}h".format(packet_size)` +``` + +Convert that binary blob to a series of numbers that you can immediately print: + + +``` +data = struct.unpack(struct_format, data_buffer) + +print("\tdata: {}".format(data)) +``` + +#### The full Python program + +Here is the complete data receiver in Python: + + +``` +#! /usr/bin/env python3 + +import zmq +import struct + +topic = "fancyhw_data".encode('ascii') + +print("Reading messages with topic: {}".format(topic)) + +with zmq.Context() as context: +    socket = context.socket(zmq.SUB) + +    socket.connect("tcp://127.0.0.1:5555") +    socket.setsockopt(zmq.SUBSCRIBE, topic) + +    i = 0 + +    try: +        while True: +            binary_topic, data_buffer = socket.recv().split(b' ', 1) + +            topic = binary_topic.decode(encoding = 'ascii') + +            print("Message {:d}:".format(i)) +            print("\ttopic: '{}'".format(topic)) + +            packet_size = len(data_buffer) // struct.calcsize("h") + +            print("\tpacket size: {:d}".format(packet_size)) + +            struct_format = "{:d}h".format(packet_size) + +            data = struct.unpack(struct_format, data_buffer) + +            print("\tdata: {}".format(data)) + +            i += 1 + +    except KeyboardInterrupt: +        socket.close() +    except Exception as error: +        print("ERROR: {}".format(error)) +        socket.close() +``` + +Save it to a file called **online_analysis.py**. Python does not need to be compiled, so you can run the program immediately. + +Here is the output: + + +``` +$ ./online_analysis.py +Reading messages with topic: b'fancyhw_data' +Message 0: +        topic: 'fancyhw_data' +        packet size: 16 +        data: (20946, -23616, 9865, 31416, -15911, -10845, -5332, 25662, 10955, -32501, -18717, -24490, -16511, -28861, 24205, 26568) +Message 1: +        topic: 'fancyhw_data' +        packet size: 16 +        data: (12505, 31355, 14083, -19654, -9141, 14532, -25591, 31203, 10428, -25564, -732, -7979, 9529, -27982, 29610, 30475) +... +... +``` + +### Conclusion + +This tutorial describes an alternative way of gathering data from C-based hardware interfaces and providing it to Python-based infrastructures. You can take this data and analyze it or pass it off in any number of directions. It employs a messaging library to deliver data between a "gatherer" and an "analyzer" instead of having a monolithic piece of software that does everything. + +This tutorial also increases what I call "software granularity." In other words, it subdivides the software into smaller units. One of the benefits of this strategy is the possibility of using different programming languages at the same time with minimal interfaces acting as shims between them. + +In practice, this design allows software engineers to work both more collaboratively and independently. Different teams may work on different steps of the analysis, choosing the tool they prefer. Another benefit is the parallelism that comes for free since all the processes can run in parallel. The [ZeroMQ messaging library][3] is a remarkable piece of software that makes all of this much easier. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/zeromq-c-python + +作者:[Cristiano L. Fontana][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/cristianofontana +[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://docs.python.org/3/extending/extending.html +[3]: https://zeromq.org/ +[4]: https://en.wikipedia.org/wiki/Network_socket +[5]: https://en.wikipedia.org/wiki/Pieter_Hintjens +[6]: http://hintjens.com/ +[7]: https://gcc.gnu.org/ +[8]: https://clang.llvm.org/ +[9]: https://github.com/zeromq/libzmq#installation-of-binary-packages- +[10]: https://www.python.org/downloads/ +[11]: https://zeromq.org/languages/python/ +[12]: http://www.opengroup.org/onlinepubs/009695399/functions/srand.html +[13]: http://www.opengroup.org/onlinepubs/009695399/functions/rand.html +[14]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html +[15]: https://en.wikipedia.org/wiki/Transmission_Control_Protocol +[16]: http://zguide.zeromq.org/page:all#Plugging-Sockets-into-the-Topology +[17]: http://www.opengroup.org/onlinepubs/009695399/functions/strlen.html +[18]: https://en.wikipedia.org/wiki/Pointer_%28computer_programming%29%23C_and_C++ +[19]: http://www.opengroup.org/onlinepubs/009695399/functions/memcpy.html +[20]: https://en.wikipedia.org/wiki/Garbage_collection_(computer_science) +[21]: https://docs.python.org/3/library/struct.html +[22]: https://docs.python.org/3/library/struct.html#format-characters diff --git a/sources/tech/20200320 Build a private social network with a Raspberry Pi.md b/sources/tech/20200320 Build a private social network with a Raspberry Pi.md new file mode 100644 index 0000000000..7917add925 --- /dev/null +++ b/sources/tech/20200320 Build a private social network with a Raspberry Pi.md @@ -0,0 +1,373 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Build a private social network with a Raspberry Pi) +[#]: via: (https://opensource.com/article/20/3/raspberry-pi-open-source-social) +[#]: author: (Giuseppe Cassibba https://opensource.com/users/peppe8o) + +Build a private social network with a Raspberry Pi +====== +Step-by-step instructions on how to create your own social network with +low-cost hardware and simple setup. +![Team of people around the world][1] + +Social networks have revolutionized people's lives in the last several years. People use social channels every day to stay connected with friends and family. But a common question remains regarding privacy and data security. Even if social networks have created complex privacy policies to protect users, maintaining your data in your own server is always the best option if you don't want to make them available to the public. + +Again, a Raspberry Pi—Raspbian Lite version can be very versatile to help you put a number of useful home services (see also my [Raspberry Pi projects][2] article) in place. Some addictive features can be achieved by searching for open source software and testing it with this fantastic device. An interesting example to try is installing OpenSource Social Network in your Raspberry Pi. + +### What Is OpenSource Social Network? + +[OpenSource Social Network][3] (OSSN) is a rapid-development social networking software written in PHP, that essentially allows you to make a social networking website. OSSN can be used to build different types of social apps, such as: + + * Private Intranets + * Public/Open Networks + * Community + + + +OSSN supports features like: + + * Photos + * Profile + * Friends + * Smileys + * Search + * Chat + + + +OSSN runs on a LAMP server. It has very poor hardware requirements, but an amazing user interface, which is also mobile-friendly. + +### What we need + +This project is very simple and, because we're installing only remote web services, we only need a few cheap parts. I'm going to use a Raspberry Pi 3 model B+, but it should also work with Raspberry Pi 3 model A+ or newer boards. + +Hardware: + + * Raspberry Pi 3 model B+ with its power supply + * a micro SD card (better if it is a performing card, at least 16GB) + * a Desktop PC with an SFTP software (for example, the free [Filezilla][4]) to transfer installation packages into your RPI. + + + +### Step-by-step procedure + +We'll start by setting up a classic LAMP server. We'll then set up database users and install OpenSource Social Network. + +#### 1\. Install Raspbian Buster Lite OS + +For this step, you can simply follow my [Install Raspbian Buster Lite in your Raspberry Pi][5] article. + +Make sure that your system is up to date. Connect via ssh terminal and type following commands: + + +``` +sudo apt-get update +sudo apt-get upgrade +``` + +2\. Install LAMP server + +LAMP (Linux–Apache–Mysql–Php) servers usually come with the MySQL database. In our project, we'll use MariaDB instead, because it is lighter and works with Raspberry Pi.  + +#### 3\. Install Apache server: + + +``` +`sudo apt-get install apache2 -y` +``` + +You should now be able to check that Apache installation has gone correctly by browsing http://<<YouRpiIPAddress>>: + +![][6] + +#### 4\. Install PHP: + + +``` +`sudo apt-get install php -y` +``` + +5\. Install MariaDB server and PHP connector: + + +``` +`sudo apt-get install mariadb-server php-mysql -y` +``` + +6\. Install PhpMyAdmin: + +PhpMyAdmin is not mandatory in OpenSource Social Network, but I suggest that you install it because it simplifies database management. + + +``` +`sudo apt-get install phpmyadmin` +``` + +In the phpMyAdmin setup screen, take the following steps: + + * Select apache (mandatory) with space and press OK. + * Select Yes to configure the database for phpMyAdmin with dbconfig-common. + * Enter your favorite phpMyAdmin password and press OK. + * Enter your phpMyAdmin password again to confirm and press OK + + + +#### 7\. Grant phpMyAdmin user DB privileges to manage DBs: + +We'll connect to MariaDB with root user (default password is empty) to grant permissions. Remember to use semicolons at the end of each command row as shown below: + + +``` +sudo mysql -uroot -p +grant all privileges on *.* to 'phpmyadmin'@'localhost'; +flush privileges; +quit +``` + +8\. Finally, restart Apache service: + + +``` +`sudo systemctl restart apache2.service` +``` + +And check that phpMyAdmin is working by browsing http://<<YouRpiIPAddress>>/phpmyadmin/.  + +![][7] + +Default phpMyAdmin login credentials are: + + * user: phpmyadmin + * password: the one you set up in the phpMyAdmin installation step + + + +### Installing other open source social network-required packages and setting up PHP + +We need to prepare our system for OpenSource Social Network's first setup wizard. Required packages are: + + * PHP version any of 5.6, 7.0, 7.1 + * MYSQL 5 OR > + * APACHE + * MOD_REWRITE + * PHP Extensions cURL & Mcrypt should be enabled + * PHP GD Extension + * PHP ZIP Extension + * PHP settings allow_url_fopen enabled + * PHP JSON Support + * PHP XML Support + * PHP OpenSSL + + + +So we'll install them with following terminal commands: + + +``` +`sudo apt-get install php7.3-curl php7.3-gd php7.3-zip php7.3-json php7.3-xml` +``` + +#### 1\. Enable MOD_REWRITE: + + +``` +`sudo a2enmod rewrite` +``` + +2\. Edit default Apache config to use mod_rewrite: + + +``` +`sudo nano /etc/apache2/sites-available/000-default.conf` +``` + +3\. Add the section so that your **000-default.conf** file appears like the following (excluding comments): + + +``` +<VirtualHost *:80> +    ServerAdmin webmaster@localhost +    DocumentRoot /var/www/html +    ErrorLog ${APACHE_LOG_DIR}/error.log +    CustomLog ${APACHE_LOG_DIR}/access.log combined +    # SECTION TO ADD -------------------------------- +        <Directory /var/www/html> +            Options Indexes FollowSymLinks MultiViews +            AllowOverride All +            Require all granted +        </Directory> +    # END SECTION TO ADD -------------------------------- +</VirtualHost> +``` + +4\. Install Mcrypt: + + +``` +sudo apt install php-dev libmcrypt-dev php-pear +sudo pecl channel-update pecl.php.net +sudo pecl install mcrypt-1.0.2 +``` + +5\. Enable Mcrypt module by adding (or uncommenting) “extension=mcrypt.so" in "/etc/php/7.3/apache2/php.ini": + + +``` +`sudo nano /etc/php/7.3/apache2/php.ini` +``` + +**allow_url_fopen** should be already enabled in "/etc/php/7.3/apache2/php.ini". OpenSSL should be already installed in php7.3. + +#### 6\. Another setting that I suggest is editing the PHP max upload file size up to 16 MB: + + +``` +`sudo nano /etc/php/7.3/apache2/php.ini` +``` + +7\. Look for the row with the **upload_max_filesize** parameter and set it as the following: + + +``` +`upload_max_filesize = 16M` +``` + +8\. Save and exit. Restart Apache: + + +``` +`sudo systemctl restart apache2.service` +``` + +### Install OSSN + +#### 1\. Create DB and set up user: + +Go back to phpmyadmin web page (browse "http://<<YourRpiIPAddress>>/phpmyadmin/") and login: + +User: phpmyadmin + +Password: the one set up in phpmyadmin installation step + +Click on database tab: + +![][8] + +Create a database and take note of the database name, as you will be required to enter it later in the installation process. + +![][9] + +It's time to create a database user for OSSN. In this example, I'll use the following credentials: + +User: ossn_db_user + +Password: ossn_db_password + +So, terminal commands will be (root password is still empty, if not changed by you before): + + +``` +sudo mysql -uroot -p +CREATE USER 'ossn_db_user'@'localhost' IDENTIFIED BY 'ossn_db_password'; +GRANT ALL PRIVILEGES ON ossn_db.* TO 'ossn_db_user'@'localhost'; +flush privileges; +quit +``` + +2\. Install OSSN software: + +Download the OSSN installation zip file from the [OSSN download page][10] on your local PC. At the time of this writing, this file is named "ossn-v5.2-1577836800.zip." + +Using your favorite SFTP software, transfer the entire zip file via SFTP to a new folder in the path "/home/pi/download" on your Raspberry Pi. Common (default) SFP connection parameters are: + + * Host: your Raspberry Pi IP address + * User: pi + * Password: raspberry (if you didn't change the pi default password) + * Port: 22 + + + +Back to terminal: + + +``` +cd /home/pi/download/ #Enter directory where OSSN installation files have been transferred +unzip ossn-v5.2-1577836800.zip #Extracts all files from zip +cd /var/www/html/ #Enter Apache web directory +sudo rm index.html #Removes Apache default page - we'll use OSSN one +sudo cp -R /home/pi/download/ossn-v5.2-1577836800/* ./ #Copy installation files to web directory +sudo chown -R www-data:www-data ./ +``` + +Create a data folder:OSSN requires a folder to store data. OSSN suggests, for security reasons, to create this folder outside of the published document root. So, we'll create this opt-in folder and give grants: + + +``` +sudo mkdir /opt/ossn_data +sudo chown -R www-data:www-data /opt/ossn_data/ +``` + +Browse http://<<YourRpiIPAddress>> to start the installation wizard: + +![][11] + +All checks should be fine. Click the Next button at the end of the page. + +![][12] + +Read the license validation and click the Next button at the end of the page to accept. + +![][13] + +Enter the database user, password, and the DB name you chose. Remember also to enter the OSSN data folder. Press Install. + +![][14] + +Enter your admin account information and press the Create button. + +![][15] + +Everything should be fine now. Press Finish to access the administration dashboard. + +![][16] + +So, administration panel can be reached with URL "http://<<YourRpiIPAddress>>/administrator" while user link will be "http://<<YourRpiIPAddress>>". + +![][17] + +_This article was originally published at [peppe8o.com][18]. Reposted with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/raspberry-pi-open-source-social + +作者:[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/team_global_people_gis_location.png?itok=Rl2IKo12 (Team of people around the world) +[2]: https://peppe8o.com/2019/04/best-raspberry-pi-projects-with-open-source-software/ +[3]: https://www.opensource-socialnetwork.org/ +[4]: https://filezilla-project.org/ +[5]: https://peppe8o.com/2019/07/install-raspbian-buster-lite-in-your-raspberry-pi/ +[6]: https://opensource.com/sites/default/files/uploads/ossn_1_0.jpg +[7]: https://opensource.com/sites/default/files/uploads/ossn_2.jpg +[8]: https://opensource.com/sites/default/files/uploads/ossn_3.jpg +[9]: https://opensource.com/sites/default/files/uploads/ossn_4.jpg +[10]: https://www.opensource-socialnetwork.org/download +[11]: https://opensource.com/sites/default/files/uploads/ossn_5.jpg +[12]: https://opensource.com/sites/default/files/uploads/ossn_6.jpg +[13]: https://opensource.com/sites/default/files/uploads/ossn_7.jpg +[14]: https://opensource.com/sites/default/files/uploads/ossn_8.jpg +[15]: https://opensource.com/sites/default/files/uploads/ossn_9.jpg +[16]: https://opensource.com/sites/default/files/uploads/ossn_10.jpg +[17]: https://opensource.com/sites/default/files/uploads/ossn_11.jpg +[18]: https://peppe8o.com/private-social-network-with-raspberry-pi-and-opensource-social-network/ diff --git a/sources/tech/20200320 Control the firewall at the command line.md b/sources/tech/20200320 Control the firewall at the command line.md new file mode 100644 index 0000000000..fb49292d28 --- /dev/null +++ b/sources/tech/20200320 Control the firewall at the command line.md @@ -0,0 +1,138 @@ +[#]: 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 you’re running a laptop at school or in a coffee shop, you probably don’t want strangers poking around on it. + +Every Fedora system has a firewall built in. It’s 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 can’t 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 it’s 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 you’re 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 you’re using the host via the network, you may break your connection — meaning you’ll have to go to that box physically to make further changes!)_ + +``` +$ sudo firewall-cmd --change-interface= --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 project’s [home page][8] that’s 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 diff --git a/sources/tech/20200320 Run a command on binary files with this script.md b/sources/tech/20200320 Run a command on binary files with this script.md new file mode 100644 index 0000000000..2d6f0b6f26 --- /dev/null +++ b/sources/tech/20200320 Run a command on binary files with this script.md @@ -0,0 +1,772 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Run a command on binary files with this script) +[#]: via: (https://opensource.com/article/20/3/run-binaries-script) +[#]: author: (Nick Clifton https://opensource.com/users/nickclifton) + +Run a command on binary files with this script +====== +Try this simple script to easily run a command on binary files +regardless of their packaging. +![Binary code on a computer screen][1] + +Examining files from the command-line is generally an easy thing to do. You just run the command you want, followed by a list of files to be examined. Dealing with binary files, however, is more complicated. These files are often packaged up into archives, tarballs, or other packaging formats. The run-on-binaries script provides a convenient way to run a command on a collection of files, regardless of how they are packaged. + +The invocation of the script is quite simple: + + +``` +`run-on-binaries ` +``` + +So, for example: + + +``` +`run-on-binaries /usr/bin/ls foo.rpm` +``` + +will list all of the files inside the **foo.rpm** file, while: + + +``` +`run-on-binaries /usr/bin/readelf -a libc.a` +``` + +will run the **readelf** program, with the **-a** command-line option, on all of the object files inside the **libc.a library**. + +If necessary, the script can be passed a file containing a list of other files to be processed, rather than specifying them on the command line—like this: + + +``` +`run-on-binaries --files-from=foo.lst /usr/bin/ps2ascii` +``` + +This will run the **ps2ascii** script on all of the files listed in **foo.lst**. (The files just need to be separated by white space. There can be multiple files on a single line if desired). + +Also, a skip list can be provided to stop the script from processing specified files: + + +``` +`run-on-binaries --skip-list=skip.lst /usr/bin/wc *` +``` + +This will run the **wc** program on all of the files in the current directory, except for those specified in **skip.lst**. + +The script does not recurse into directories, but this can be handled by combining it with the **find** command, like this: + + +``` +`find . -type f -exec run-on-binaries @ ;` +``` + +or + + +``` +`find . -type d -exec run-on-binaries @/* ;` +``` + +The only difference between these two invocations is that the second one only runs the target program once per directory, but gives it a long command-line of all of the files in the directory. + +Though convenient, the script is lacking in several areas. Right now, it does not examine the PATH environment variable to find the command that it is asked to run, so a full path must be provided. Also, the script ought to be able to handle recursion on its own, without needing help from the find command. + +The run-on-binaries script is part of the annobin package, which is available on Fedora. The sources for annobin can also be obtained from the git repository at . + +### The script + + +``` +#!/bin/bash + +# Script to run another script/program on the executables inside a given file. +# +# Created by Nick Clifton.  <[nickc@redhat.com][2]> +# Copyright (c) 2018 Red Hat. +# +# This 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, or (at your +# option) any later version. + +# It 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. +# +# Usage: +#   run-on-binaries-in [options] program [options-for-the-program] file(s) +# +# This script does not handle directories.  This is deliberate. +# It is intended that if recursion is needed then it will be +# invoked from find, like this: +# +#   find . -name "*.rpm" -exec run-on-binaries-in <script-to-run> {} \; + +version=1.0 + +help () +{ +  # The following exec goop is so that we don't have to manually +  # redirect every message to stderr in this function. +  exec 4>&1    # save stdout fd to fd #4 +  exec 1>&2    # redirect stdout to stderr + +  cat <<__EOM__ + +This is a shell script to run another script/program on one or more binary +files.  If the file(s) specified are archives of some kind (including rpms) +then the script/program is run on the binary executables inside the archive. + +Usage: $prog {options} program {options-for-the-program} files(s) + +  {options} are: +  -h         --help               Display this information and then exit. +  -v         --version            Report the version number of this script. +  -V         --verbose            Report on progress. +  -q         --quiet              Do not include the script name in the output. +  -i         --ignore             Silently ignore files that are not executables or archives. +  -p=<TEXT>  --prefix=<TEXT>      Prefix normal output with this string. +  -t=<DIR>   --tmpdir=<DIR>       Temporary directory to use when opening archives. +  -f=<FILE>  --files-from=<FILE>  Process files listed in <FILE>. +  -s=<FILE>  --skip-list=<FILE>   Skip any file listed in <FILE>. +  --                              Stop accumulating options. + +Examples: + +  $prog hardened foo.rpm +                              Runs the hardened script on the executable +                              files inside foo.rpm. + +  $prog check-abi -v fred.tar.xz +                              Runs the check-abi script on the decompressed +                              contents of the fred.tar.xz archive, passing the +                              -v option to check-abi as it does so.       + +  $prog -V -f=list.txt readelf -a +                              Runs the readelf program, with the -a option on +                              every file listed in the list.txt.  Describes +                              what is being done as it works. + +  $prog -v -- -fred -a jim -b bert -- -c harry +                              Runs the script "-fred" on the files jim, bert, +                              "-c" and harry.  Passes the options "-a" and +                              "-b" to the script (even when run on jim). +                              Reports the version of this script as well. + +__EOM__ +  exec 1>&4   # Copy stdout fd back from temporary save fd, #4 +} + +main () +{ +    init +    +    parse_args ${1+"$@"} + +    if [ $failed -eq 0 ]; +    then +        run_script_on_files +    fi + +    if [ $failed -ne 0 ]; +    then +        exit 1 +    else +        exit 0 +    fi +} + +report () +{ +    if [ $quiet -eq 0 ]; +    then +        echo -n $prog": " +    fi +    +    echo ${1+"$@"} +} + +ice () +{ +    report "Internal error: " ${1+"$@"} +    exit 1 +} + +fail () +{ +    report "Failure:" ${1+"$@"} +    failed=1 +} + +verbose () +{ +    if [ $verbose -ne 0 ] +    then +        report ${1+"$@"} +    fi +} + +# Initialise global variables. +init () +{ +    files[0]="";   +    # num_files is the number of files to be scanned. +    # files[0] is the script to run on the files. +    num_files=0; + +    script="" +    script_opts=""; + +    prog_opts="-i" + +    tmpdir=/dev/shm +    prefix=""     +    files_from="" +    skip_list="" + +    failed=0 +    verbose=0 +    ignore=0 +    quiet=0 +} + +# Parse our command line +parse_args () +{ +    abs_prog=$0; +    prog=`basename $abs_prog`; + +    # Locate any additional command line switches +    # Likewise accumulate non-switches to the files list. +    while [ $# -gt 0 ] +    do +        optname="`echo $1 | sed 's,=.*,,'`" +        optarg="`echo $1 | sed 's,^[^=]*=,,'`" +        case "$optname" in +            -v | --version) +                report "version: $version" +                ;; +            -h | --help) +                help +                exit 0 +                ;; +            -q | --quiet) +                quiet=1; +                prog_opts="$prog_opts -q" +                ;; +            -V | --verbose) +                if [ $verbose -eq 1 ]; +                then +                    # This has the effect of cancelling out the prog_opts="-i" +                    # in the init function, so that recursive invocations of this +                    # script will complain about unrecognised file types. +                    if [ $quiet -eq 0 ]; +                    then +                        prog_opts="-V -V" +                    else +                        prog_opts="-V -V -q" +                    fi +                else +                    verbose=1; +                    prog_opts="$prog_opts -V" +                fi +                ;; +            -i | --ignore) +                ignore=1 +                ;; +            -t | --tmpdir) +                if test "x$optarg" = "x$optname" ; +                then +                    shift +                    if [ $# -eq 0 ] +                    then +                        fail "$optname needs a directory name" +                    else +                        tmpdir=$1 +                    fi +                else +                    tmpdir="$optarg" +                fi +                ;; +            -p | --prefix) +                if test "x$optarg" = "x$optname" ; +                then +                    shift +                    if [ $# -eq 0 ] +                    then +                        fail "$optname needs a string argument" +                    else +                        prefix=$1 +                    fi +                else +                    prefix="$optarg" +                fi +                ;; +            -f | --files_from) +                if test "x$optarg" = "x$optname" ; +                then +                    shift +                    if [ $# -eq 0 ] +                    then +                        fail "$optname needs a file name" +                    else +                        files_from=$1 +                    fi +                else +                    files_from="$optarg" +                fi +                ;; +            +            -s | --skip-list) +                if test "x$optarg" = "x$optname" ; +                then +                    shift +                    if [ $# -eq 0 ] +                    then +                        fail "$optname needs a file name" +                    else +                        skip_list=$1 +                    fi +                else +                    skip_list="$optarg" +                fi +                ;; +            +            --) +                shift +                break; +                ;; +            --*) +                fail "unrecognised option: $1" +                help +                ;; +            *) +                script="$1"; +                if ! [ -a "$script" ] +                then +                    fail "$script: program/script not found" +                elif  ! [ -x "$script" ] +                then +                    fail "$script: program/script not executable" +                fi +                # After we have seen the first non-option we stop +                # accumulating options for this script and instead +                # start accumulating options for the script to be +                # run. +                shift +                break; +                ;; +        esac +        shift +    done + +    # Read in the contents of the --file-from list, if specified. +    if test "x$files_from" != "x" ; +    then +        if ! [ -a "$files_from" ] +        then +            fail "$files_from: file not found" +        elif ! [ -r "$files_from" ] +        then +            fail "$files_from: file not readable" +        else +            eval 'files=($(cat $files_from))' +            num_files=${#files[*]} +        fi +    fi +    skip_files[foo]=bar + +    # Check that the skip list exists, if specified. +    if test "x$skip_list" != "x" ; +    then +        if ! [ -a "$skip_list" ] +        then +            fail "$skip_list: file not found" +        elif ! [ -r "$skip_list" ] +        then +            fail "$files_from: file not readable" +        fi +    fi + +    # Accumulate any remaining arguments separating out the arguments +    # for the script from the names of the files to scan. +    while [ $# -gt 0 ] +    do +        optname="`echo $1 | sed 's,=.*,,'`" +        optarg="`echo $1 | sed 's,^[^=]*=,,'`" +        case "$optname" in +            --) +                shift +                break; +                ;; +            -*) +                script_opts="$script_opts $1" +                ;; +            *) +                files[$num_files]="$1"; +                let "num_files++" +                ;; +        esac +        shift +    done + +    # Accumulate any remaining arguments without processing them. +    while [ $# -gt 0 ] +    do +        files[$num_files]="$1"; +        let "num_files++"; +        shift +    done + +    if [ $num_files -gt 0 ]; +    then +        # Remember that we are counting from zero not one. +        let "num_files--" +    else +        fail "Must specify a program/script and at least one file to scan." +    fi +} + +run_script_on_files () +{ +    local i + +    i=0; +    while [ $i -le $num_files ] +    do +        run_on_file i +        let "i++" +    done +} + +# syntax: run <command> [<args>] +#  If being verbose report the command being run, and +#   the directory in which it is run. +run () +{ +  local where + +  if test "x$1" = "x" ; +  then +    fail "run() called without an argument." +  fi + +  verbose "  Running: ${1+$@}" + +  ${1+$@} +} + +decompress () +{ +    local abs_file decompressor decomp_args orig_file base_file + +    # Paranoia checks - the user should never encounter these. +    if test "x$4" = "x" ; +    then +        ice "decompress called with too few arguments" +    fi +    if test "x$5" != "x" ; +    then +        ice "decompress called with too many arguments" +    fi + +    abs_file=$1 +    decompressor=$2 +    decomp_args=$3 +    orig_file=$4 + +    base_file=`basename $abs_file` + +    run cp $abs_file $base_file +    run $decompressor $decomp_args $base_file +    if [ $? != 0 ]; +    then +        fail "$orig_file: Unable to decompress" +    fi + +    rm -f $base_file +} + +run_on_file () +{ +    local file + +    # Paranoia checks - the user should never encounter these. +    if test "x$1" = "x" ; +    then +        ice "scan_file called without an argument" +    fi +    if test "x$2" != "x" ; +    then +        ice "scan_file called with too many arguments" +    fi + +    # Use quotes when accessing files in order to preserve +    # any spaces that might be in the directory name. +    file="${files[$1]}"; + +    # Catch names that start with a dash - they might confuse readelf +    if test "x${file:0:1}" = "x-" ; +    then +        file="./$file" +    fi + +    # See if we should skip this file. +    if test "x$skip_list" != "x" ; +    then +        # This regexp looks for $file being the first text on a line, either +        # on its own, or with additional text separated from it by at least +        # one space character.  So searching for "fred" in the following gives: +        #  fr         <\- no match +        #  fred       <\- match +        #  fredjim    <\- no match +        #  fred bert  <\- match +        regexp="^$file[^[:graph:]]*" +        grep --silent --regexp="$regexp" $skip_list +        if [ $? = 0 ]; +        then +            verbose "$file: skipping" +            return +        fi +    fi + +    # Check the file. +    if ! [ -a "$file" ] +    then +        fail "$file: file not found" +        return +    elif ! [ -r "$file" ] +    then +        if [ $ignore -eq 0 ]; +        then +            fail "$file: not readable" +        fi +        return +    elif [ -d "$file" ] +    then +        if [ $ignore -eq 0 ]; +        then +            if [ $num_files -gt 1 ]; +            then +                verbose "$file: skipping - it is a directory" +            else +                report "$file: skipping - it is a directory" +            fi +        fi +        return +    elif ! [ -f "$file" ] +    then +        if [ $ignore -eq 0 ]; +        then +            fail "$file: not an ordinary file" +        fi +        return +    fi + +    file_type=`file -b $file` +    case "$file_type" in +        *"ELF "*) +            verbose "$file: ELF format - running script/program" +            if test "x$prefix" != "x" ; +            then +                report "$prefix:" +            fi +            run $script $script_opts $file +            return +            ;; +        "RPM "*) +            verbose "$file: RPM format." +            ;; +        *" cpio "*) +            verbose "$file: CPIO format." +            ;; +        *"tar "*) +            verbose "$file: TAR archive." +            ;; +        *"Zip archive"*) +            verbose "$file: ZIP archive." +            ;; +        *"ar archive"*) +            verbose "$file: AR archive." +            ;; +        *"bzip2 compressed data"*) +            verbose "$file: contains bzip2 compressed data" +            ;; +        *"gzip compressed data"*) +            verbose "$file: contains gzip compressed data" +            ;; +        *"lzip compressed data"*) +            verbose "$file: contains lzip compressed data" +            ;; +        *"XZ compressed data"*) +            verbose "$file: contains xz compressed data" +            ;; +        *"shell script"* | *"ASCII text"*) +            if [ $ignore -eq 0 ]; +            then +                fail "$file: test/scripts cannot be scanned." +            fi +            return +            ;; +        *"symbolic link"*) +            if [ $ignore -eq 0 ]; +            then +                # FIXME: We ought to be able to follow symbolic links +                fail "$file: symbolic links are not followed." +            fi +            return +            ;; +        *) +            if [ $ignore -eq 0 ]; +            then +                fail "$file: Unsupported file type: $file_type" +            fi +            return +            ;; +    esac +    +    # We now know that we will need a temporary directory +    # so create one, and create paths to the file and scripts. +    if test "x${file:0:1}" = "x/" ; +    then +        abs_file=$file +    else +        abs_file="$PWD/$file" +    fi +    +    if test "x${abs_prog:0:1}" != "x/" ; +    then +        abs_prog="$PWD/$abs_prog" +    fi + +    if test "x${script:0:1}" = "x/" ; +    then +        abs_script=$script +    else +        abs_script="$PWD/$script" +    fi +    +    tmp_root=$tmpdir/delme.run.on.binary +    run mkdir -p "$tmp_root/$file" + +    verbose "  Changing to directory: $tmp_root/$file" +    pushd "$tmp_root/$file" > /dev/null +    if [ $? != 0 ]; +    then +        fail "Unable to change to temporary directory: $tmp_root/$file" +        return +    fi +                          +    # Run the file type switch again, although this time we do not need to +    # check for unrecognised types.  (But we do, just in case...) +    # Note since are transforming the file we re-invoke the run-on-binaries +    # script on the decoded contents.  This allows for archives that contain +    # other archives, and so on.  We normally pass the -i option to the +    # invoked script so that it will not complain about unrecognised files in +    # the decoded archive, although we do not do this when running in very +    # verbose mode.  We also pass an extended -t option to ensure that any +    # sub-archives are extracted into a unique directory tree. + +    case "$file_type" in +        "RPM "*) +            # The output redirect confuses the run function... +            verbose "  Running: rpm2cpio $abs_file > delme.cpio" +            rpm2cpio $abs_file > delme.cpio +            if [ $? != 0 ]; +            then +                fail "$file: Unable to extract from rpm archive" +            else +                # Save time - run cpio now. +                run cpio --quiet --extract --make-directories --file delme.cpio +                if [ $? != 0 ]; +                then +                    fail "$file: Unable to extract files from cpio archive" +                fi +                run rm -f delme.cpio +            fi +            ;; + +        *" cpio "*) +            run cpio --quiet --extract --make-directories --file=$abs_file +            if [ $? != 0 ]; +            then +                fail "$file: Unable to extract files from cpio archive" +            fi +            ;; + +        *"tar "*) +            run tar --extract --file=$abs_file +            if [ $? != 0 ]; +            then +                fail "$file: Unable to extract files from tarball" +            fi +            ;; + +        *"ar archive"*) +            run ar x $abs_file +            if [ $? != 0 ]; +            then +                fail "$file: Unable to extract files from ar archive" +            fi +            ;; + +        *"Zip archive"*) +            decompress $abs_file unzip "-q" $file +            ;; +        *"bzip2 compressed data"*) +            decompress $abs_file bzip2 "--quiet --decompress" $file +            ;; +        *"gzip compressed data"*) +            decompress $abs_file gzip "--quiet --decompress" $file +            ;; +        *"lzip compressed data"*) +            decompress $abs_file lzip "--quiet --decompress" $file +            ;; +        *"XZ compressed data"*) +            decompress $abs_file xz "--quiet --decompress" $file +            ;; +        *) +            ice "unhandled file type: $file_type" +            ;; +     esac + +    if [ $failed -eq 0 ]; +    then +        # Now scan the file(s) created in the previous step. +        run find . -type f -execdir $abs_prog $prog_opts -t=$tmp_root/$file -p=$file $abs_script $script_opts {} + +    fi + +    verbose "  Deleting temporary directory: $tmp_root" +    rm -fr $tmp_root + +    verbose "  Return to previous directory" +    popd > /dev/null +} + +# Invoke main +main ${1+"$@"} +``` + +  + +Git has extensions for handling binary blobs such as multimedia files, so today we will learn how... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/run-binaries-script + +作者:[Nick Clifton][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/nickclifton +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/binary_code_computer_screen.png?itok=7IzHK1nn (Binary code on a computer screen) +[2]: mailto:nickc@redhat.com diff --git a/sources/tech/20200322 Meet DebianDog - Puppy sized Debian Linux.md b/sources/tech/20200322 Meet DebianDog - Puppy sized Debian Linux.md new file mode 100644 index 0000000000..ea2b2d1f7c --- /dev/null +++ b/sources/tech/20200322 Meet DebianDog - Puppy sized Debian Linux.md @@ -0,0 +1,120 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Meet DebianDog – Puppy sized Debian Linux) +[#]: via: (https://itsfoss.com/debiandog/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +Meet DebianDog – Puppy sized Debian Linux +====== + +Recently I stumbled upon an intriguing Linux project. This project aims to create small live CDs for Debian and Debian-based systems, similar to the [Puppy Linux project][1]. Let’s take a look at DebianDog. + +### What is DebianDog? + +As it says on the tin, [DebianDog][2] “is a small Debian Live CD shaped to look like Puppy and act like Puppy. Debian structure and Debian behaviour are untouched and Debian documentation is 100% valid for DebianDog. You have access to all Debian repositories using apt-get or synaptic.” + +![DebianDog Jessie][3] + +For those of you who are not familiar with [Puppy Linux][1], the project is “a collection of multiple Linux distributions, built on the same shared principles”. Those principles are to be fast, small (300 MB or less), and easy to use. There are versions of Puppy Linux built to support Ubuntu, Slackware, and Raspbian packages. + +The major difference between DebianDog and Puppy Linux is that Puppy Linux has its own package manager [the [Puppy Package Manager][4]]. As stated above, DebianDog using the Debian package manager and packages. Even the DebianDog website tries to make that clear: “It is not Puppy Linux and it has nothing to do with Puppy based on Debian.” + +### Why should anyone use DebianDog? + +The main reason to install DebianDog (or any of its derivatives) would be to restore an older system to operability. Every entry on DebianDog has a 32-bit option. They also have lighter desktop environments/window managers, such as [Openbox][5] or the [Trinity Desktop][6] environment. Most of those also have an alternative to systemd. They also come with lighter applications installed, such as [PCManFM][7]. + +### What versions of DebianDog are available? + +Though DebianDog was the first in the series, the project is called ‘Dog Linux’ and provides various ‘Dog variants’ on popular distributions based on Debian and Ubuntu. + +#### DebianDog Jessie + +The first (and original) version of DebianDog is DebianDog Jessie. There are two [32-bit versions][8] of it. One uses [Joe’s Window Manager (JWM)][9] as default and the other uses XFCE. Both systemd and sysvinit are available. There is also a [64-bit version][10]. DebianDog Jessie is based on Debian 8.0 (codename Jessie). Support for Debian 8.0 ends on June 30th, 2020, so install with caution. + +![TrinityDog][11] + +#### StretchDog + +[Stret][12][c][12][hDog][12] is based on Debian 9.0 (codename Stretch). It is available in 32 and 64-bit. Openbox is the default window manager, but we can also switch to JWM. Support for Debian 9.0 ends on June 30th, 2022. + +#### BusterDog + +[BusterDog][13] is interesting. It is based on [Debian 10][14] (codename Buster). It does not use systemd, instead, it uses [elogind][15] just like [AntiX][16]. Support for Debian 10.0 ends on June 2024. + +#### MintPup + +[MintPup][17] is based on [Linux Mint][18] 17.1. This LiveCD is 32-bit only. You can also access all of the “Ubuntu/Mint repositories using apt-get or synaptic”. Considering that Mint 17 has reached end of life, this version must be avoided. + +#### XenialDog + +There are both [32-bit][19] and [64-bit versions][20] of this spin based on the Ubuntu 16.04 LTS. Both versions come with Openbox as default with JWM as an option. Support for Ubuntu 16.04 LTS ends in April of 2021, so install with caution. + +#### TrinityDog + +There are two versions of the [TrintyDog][21] spin. One is based on Debian 8 and the other is based on Debian 9. Both are 32-bit and both use the [Trinity Desktop Environment][6], thus the name. + +![BionicDog][22] + +#### BionicDog + +As you should be able to guess by the name. [BionicDog][23] is based on [Ubuntu 18.04 LTS][24]. The main version of this spin has both 32 and 64-bit with Openbox as the default window manager. There is also a version that uses the [Cinnamon desktop][25] and is only 64-bit. + +### Final Thoughts + +I like any [Linux project that wants to make older systems usable][26]. However, most of the operating systems available through DebianDog are no longer supported or nearing the end of their life span. This makes it less than useful for the long run. + +**I wouldn’t really advise to use it on your main computer.** Try it in live USB or on a spare system. Also, [you can create][27] your own LiveCD spin if you want to take advantage of a newer base system. + +Somehow I keep on stumbling across obscure Linux distributions like [FatDog64][28], [4M Linux][29] and [Vipper Linux][30]. Even though I may not always recommend them to use, it’s still good to know about the existence of such projects. + +What are your thoughts on the DebianDog? What is your favorite Puppy-syle OS? Please let us know in the comments below. + +If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][31]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/debiandog/ + +作者:[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]: http://puppylinux.com/ +[2]: https://debiandog.github.io/doglinux/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/DebianDog-Jessie.jpg?fit=800%2C600&ssl=1 +[4]: http://wikka.puppylinux.com/PPM?redirect=no +[5]: http://openbox.org/wiki/Main_Page +[6]: https://www.trinitydesktop.org/ +[7]: https://wiki.lxde.org/en/PCManFM +[8]: https://debiandog.github.io/doglinux/zz01debiandogjessie.html +[9]: https://en.wikipedia.org/wiki/JWM +[10]: https://debiandog.github.io/doglinux/zz02debiandog64.html +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/TrinityDog.jpg?ssl=1 +[12]: https://debiandog.github.io/doglinux/zz02stretchdog.html +[13]: https://debiandog.github.io/doglinux/zz03busterdog.html +[14]: https://itsfoss.com/debian-10-buster/ +[15]: https://github.com/elogind/elogind +[16]: https://antixlinux.com/ +[17]: https://debiandog.github.io/doglinux/zz04mintpup.html +[18]: https://linuxmint.com/ +[19]: https://debiandog.github.io/doglinux/zz05xenialdog.html +[20]: https://debiandog.github.io/doglinux/zz05zxenialdog.html +[21]: https://debiandog.github.io/doglinux/zz06-trinitydog.html +[22]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/BionicDog.jpg?ssl=1 +[23]: https://debiandog.github.io/doglinux/zz06-zbionicdog.html +[24]: https://itsfoss.com/ubuntu-18-04-released/ +[25]: https://en.wikipedia.org/wiki/Cinnamon_(desktop_environment) +[26]: https://itsfoss.com/lightweight-linux-beginners/ +[27]: https://github.com/DebianDog/MakeLive +[28]: https://itsfoss.com/fatdog64-linux-review/ +[29]: https://itsfoss.com/4mlinux-review/ +[30]: https://itsfoss.com/viperr-linux-review/ +[31]: https://reddit.com/r/linuxusersgroup diff --git a/sources/tech/20200323 5 Python scripts for automating basic community management tasks.md b/sources/tech/20200323 5 Python scripts for automating basic community management tasks.md new file mode 100644 index 0000000000..3f8dd00aa1 --- /dev/null +++ b/sources/tech/20200323 5 Python scripts for automating basic community management tasks.md @@ -0,0 +1,114 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 Python scripts for automating basic community management tasks) +[#]: via: (https://opensource.com/article/20/3/automating-community-management-python) +[#]: author: (Rich Bowen https://opensource.com/users/rbowen) + +5 Python scripts for automating basic community management tasks +====== +If you have to do something three times, try to automate it. +![shapes of people symbols][1] + +I've [written before about what a community manager does][2], and if you ask ten community managers, you'll get 12 different answers. Mostly, though, you do what the community needs for you to do at any given moment. And a lot of it can be repetitive. + +Back when I was a sysadmin, I had a rule: if I had to do something three times, I'd try to automate it. And, of course, these days, with awesome tools like Ansible, there's a whole science to that. + +Some of what I do on a daily or weekly basis involves looking something up in a few places and then generating some digest or report of that information to publish elsewhere. A task like that is a perfect candidate for automation. None of this is [rocket surgery][3], but when I've shared some of these scripts with colleagues, invariably, at least one of them turns out to be useful. + +[On GitHub][4], I have several scripts that I use every week. None of them are complicated, but they save me a few minutes every time. Some of them are in Perl because I'm almost 50. Some of them are in Python because a few years ago, I decided I needed to learn Python. Here's an overview: + +### **[tshirts.py][5]** + +This simple script takes a number of Tshirts that you're going to order for an event and tells you what the size distribution should be. It spreads them on a normal curve (also called a bell curve), and, in my experience, this coincides pretty well with what you'll actually need for a normal conference audience. You might want to adjust the script to slightly larger if you're using it in the USA, slightly smaller if you're using it in Europe. YMMV. + +Usage: + + +``` +[rbowen@sasha:community-tools/scripts]$ ./tshirts.py                                                                                                                                                           +How many shirts? 300 +For a total of 300 shirts, order: + +30.0 small +72.0 medium +96.0 large +72.0 xl +30.0 2xl +``` + +### **[followers.py][6]** + +This script provides me with the follower count for Twitter handles I care about. + +This script is only 14 lines long and isn't exciting, but it saves me perhaps ten minutes of loading web pages and looking for a number. + +You'll need to edit the feeds array to add the accounts you care about: + + +``` +feeds = [ +        'centosproject', +        'centos' +        ]; +``` + +NB: It probably won't work if you're running it outside of English-speaking countries, because it's just a simple screen-scraping script that reads HTML and looks for particular information buried within it. So when the output is in a different language, the regular expressions won't match. + +Usage: + + +``` +[rbowen@sasha:community-tools/scripts]$ ./followers.py                                                                                                                                                                           +centosproject: 11,479 Followers +centos: 18,155 Followers +``` + +### **[get_meetups][7]** + +This script fits into another category—API scripts. This particular script uses the [meetup.com][8] API to look for meetups on a particular topic in a particular area and time range so that I can report them to my community. Many of the services you rely on provide an API so that your scripts can look up information without having to manually look through web pages. Learning how to use those APIs can be frustrating and time-consuming, but you'll end up with skills that will save you a LOT of time. + +_Disclaimer: [meetup.com][8] changed their API in August of 2019, and I have not yet updated this script to the new API, so it doesn't actually work right now. Watch this repo for a fixed version in the coming weeks._ + +### **[centos-announcements.pl][9]** + +This script is considerably more complicated and extremely specific to my use case, but you probably have a similar situation. This script looks at a mailing list archive—in this case, the centos-announce mailing list—and finds messages that are in a particular format, then builds a report of those messages. Reports come in a couple of different formats—one for my monthly newsletter and one for scheduling messages (via Hootsuite) for Twitter. + +I use Hootsuite to schedule content for Twitter, and they have a convenient CSV (comma-separated value) format that lets you bulk-schedule a whole week of tweets in one go. Auto-generating that CSV from various data sources (i.e., mailing lists, blogs, other web pages) can save you a lot of time. Do note, however, that this should probably only be used for a first draft, which you then examine and edit yourself so that you don't end up auto-tweeting something you didn't intend to. + +### **[reporting.pl][10]** + +This script is also fairly specific to my particular needs, but the concept itself is universal. I send out a monthly mailing to the [CentOS SIGs][11] (Special Interest Groups), which are scheduled to report in that given month. This script simply tells me which SIGs those are this month, and writes the email that needs to go to them. + +It does not actually send that email, however, for a couple of reasons. One, I may wish to edit those messages before they go out. Two, while scripts sending email worked great in the old days, these days, they're likely to result in getting spam-filtered. + +### In conclusion + +There are some other scripts in that repo that are more or less specific to my particular needs, but I hope at least one of them is useful to you, and that the variety of what's there inspires you to automate something of your own. I'd love to see your handy automation script repos, too; link to them in the comments! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/automating-community-management-python + +作者:[Rich Bowen][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/rbowen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/Open%20Pharma.png?itok=GP7zqNZE (shapes of people symbols) +[2]: http://drbacchus.com/what-does-a-community-manager-do/ +[3]: https://6dollarshirts.com/rocket-surgery +[4]: https://github.com/rbowen/centos-community-tools/tree/master/scripts +[5]: https://github.com/rbowen/centos-community-tools/blob/master/scripts/tshirts.py +[6]: https://github.com/rbowen/centos-community-tools/blob/master/scripts/followers.py +[7]: https://github.com/rbowen/centos-community-tools/blob/master/scripts/get_meetups +[8]: http://meetup.com +[9]: https://github.com/rbowen/centos-community-tools/blob/master/scripts/centos-announcements.pl +[10]: https://github.com/rbowen/centos-community-tools/blob/master/scripts/sig_reporting/reporting.pl +[11]: https://wiki.centos.org/SpecialInterestGroup diff --git a/sources/tech/20200323 Don-t love diff- Use Meld instead.md b/sources/tech/20200323 Don-t love diff- Use Meld instead.md new file mode 100644 index 0000000000..e5049454e2 --- /dev/null +++ b/sources/tech/20200323 Don-t love diff- Use Meld instead.md @@ -0,0 +1,131 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Don't love diff? Use Meld instead) +[#]: via: (https://opensource.com/article/20/3/meld) +[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) + +Don't love diff? Use Meld instead +====== +Meld is a visual diff tool that makes it easier to compare and merge +changes in files, directories, Git repos, and more. +![Person drinking a hat drink at the computer][1] + +Meld is one of my essential tools for working with code and data files. It's a graphical diff tool, so if you've ever used the **diff** command and struggled to make sense of the output, [Meld][2] is here to help. + +Here is a brilliant description from the project's website: + +> "Meld is a visual diff and merge tool targeted at developers. Meld helps you compare files, directories, and version controlled projects. It provides two- and three-way comparison of both files and directories, and has support for many popular version control systems. +> +> "Meld helps you review code changes and understand patches. It might even help you to figure out what is going on in that merge you keep avoiding." + +You can install Meld on Debian/Ubuntu systems (including Raspbian) with: + + +``` +`$ sudo apt install meld` +``` + +On Fedora or similar, it's: + + +``` +`$ sudo dnf install meld` +``` + +Meld is cross-platform—there's a [Windows install][3] using the [Chocolately][4] package manager. While it's not officially supported on macOS, there are [builds available for Mac][5], and you can install it on Homebrew with: + + +``` +`$ brew cask install meld` +``` + +See Meld's homepage for [additional options][2]. + +### Meld vs. the diff command + +If you have two similar files (perhaps one is a modified version of the other) and want to see the changes between them, you could run the **diff** command to see their differences in the terminal: + +![diff output][6] + +This example shows the differences between **conway1.py** and **conway2.py**. It's showing that I: + + * Removed the [shebang][7] and second line + * Removed **(object)** from the class declaration + * Added a docstring to the class + * Swapped the order of **alive** and **neighbours == 2** in a method + + + +Here's the same example using the **meld** command. You can run the same comparison from the command line with: + + +``` +`$ meld conway1.py conway2.py` +``` + +![Meld output][8] + +Much clearer! + +You can easily see changes and merge changes between files by clicking the arrows (they work both ways). You can even edit the files live (Meld doubles up as a simple text editor with live comparisons as you type)—just be sure to save before you close the window. + +You can even compare and edit three different files: + +![Comparing three files in Meld][9] + +### Meld's Git-awareness + +Hopefully, you're using a version control system like [Git][10]. If so, your comparison isn't between two different files but to find differences between the current working file and the one Git knows. Meld understands this, so if you run **meld conway.py**, where **conway.py** is known by Git, it'll show you any changes made since the last Git commit: + +![Comparing Git files in Meld][11] + +You can see changes made in the current version (on the right) and the repository version (on the left). You can see I deleted a method and added a parameter and a loop since the last commit. + +If you run **meld .**, you'll see all the changes in the current directory (or the whole repository, if you're in its root): + +![Meld . output][12] + +You can see a single file is modified, another file is unversioned (meaning it's new to Git, so I need to **git add** the file before comparing it), and lots of other unmodified files. Various display options are provided by icons along the top. + +You can also compare two directories, which is sometimes handy: + +![Comparing directories in Meld][13] + +### Conclusion + +Even regular users can find comparisons with diff difficult to decipher. I find the visualizations Meld provides make a big difference in troubleshooting what's changed between files. On top of that, Meld comes with some helpful awareness of version control and helps you compare across Git commits without thinking much about it. Give Meld a go, and make troubleshooting a little easier on the eyes. + +* * * + +_This was originally published on Ben Nuttall's [Tooling blog][14] and is reused with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/meld + +作者:[Ben Nuttall][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/bennuttall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr (Person drinking a hat drink at the computer) +[2]: https://meldmerge.org/ +[3]: https://chocolatey.org/packages/meld +[4]: https://opensource.com/article/20/3/chocolatey +[5]: https://yousseb.github.io/meld/ +[6]: https://opensource.com/sites/default/files/uploads/diff-output.png (diff output) +[7]: https://en.wikipedia.org/wiki/Shebang_(Unix) +[8]: https://opensource.com/sites/default/files/uploads/meld-output.png (Meld output) +[9]: https://opensource.com/sites/default/files/uploads/meld-3-files.png (Comparing three files in Meld) +[10]: https://opensource.com/resources/what-is-git +[11]: https://opensource.com/sites/default/files/uploads/meld-git.png (Comparing Git files in Meld) +[12]: https://opensource.com/sites/default/files/uploads/meld-directory-changes.png (Meld . output) +[13]: https://opensource.com/sites/default/files/uploads/meld-directory-compare.png (Comparing directories in Meld) +[14]: https://tooling.bennuttall.com/meld/ diff --git a/sources/tech/20200323 How to create a personal file server with SSH on Linux.md b/sources/tech/20200323 How to create a personal file server with SSH on Linux.md new file mode 100644 index 0000000000..f758123bb1 --- /dev/null +++ b/sources/tech/20200323 How to create a personal file server with SSH on Linux.md @@ -0,0 +1,137 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to create a personal file server with SSH on Linux) +[#]: via: (https://opensource.com/article/20/3/personal-file-server-ssh) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) + +How to create a personal file server with SSH on Linux +====== +Connecting to a remote Linux system over SSH is just plain easy. Here's +how to do it. +![Hand putting a Linux file folder into a drawer][1] + +The Raspberry Pi makes for a useful and inexpensive home server for lots of things. I most often use the [Raspberry Pi as a print server][2] to share a laser printer with other devices in our home or as a personal file server to store copies of projects and other data. + +I use this file server in various ways. Let's say I'm working on a project, such as a new book, and I want to make a snapshot copy of my work and all my associated files. In that case, I simply copy my **BookProject** folder to a **BookBackup** folder on the file server. + +Or if I'm cleaning up my local files, and I discover some files that I don't really need but I'm not yet ready to delete, I'll copy them to a **KeepForLater** folder on the file server. That's a convenient way to remove clutter from my everyday Linux system and offload infrequently used files to my personal file server. + +Setting up a Raspberry Pi—or any Linux system—as a personal file server doesn't require configuring Network File System (NFS) or Common Internet File System (CIFS) or tinkering with other file-sharing systems such as WebDAV. You can easily set up a remote file server using SSH. And here's how. + +### Set up SSHD on the remote system + +Your Linux system probably has the SSH daemon (sshd) installed. It may even be running by default. If not, you can easily set up SSH through whatever control panel you prefer on your Linux distribution. I run [Fedora ARM][3] on my Raspberry Pi, and I can access the control panel remotely by pointing my Pi's web browser to port 9090. (On my home network, the Raspberry Pi's IP address is **10.0.0.11**, so I connect to **10.0.0.11:9090**.) If the SSH daemon isn't running by default, you can set it to start automatically in Services in the control panel. + +![sshd in the list of system services][4] + +You can find sshd in the list of system services. + +![slider to activate sshd][5] + +Click the slider to activate **sshd** if it isn't already. + +### Do you have an account? + +Make sure you have an account on the remote system. It might be the same as the username you use on your local system, or it could be something different. + +On the popular Raspbian distribution, the default account username is **pi**. But other Linux distributions may require you to set up a unique new user when you install it. If you don't know your username, you can use your distribution's control panel to create one. On my Raspberry Pi, I set up a **jhall** account that matches the username on my everyday Linux desktop machine. + +![Set up a new account on Fedora Server][6] + +If you use Fedora Server, click the **Create New Account** button to set up a new account. + +![Set password or SSH key][7] + +Don't forget to set a password or add a public SSH key. + +### Optional: Share your SSH public key + +If you exchange your public SSH key with the remote Linux system, you can log in without having to enter a password. This step is optional; you can use a password if you prefer. + +You can learn more about SSH keys in these Opensource.com articles: + + * [Tools for SSH key management][8] + * [Graphically manage SSH keys with Seahorse][9] + * [How to manage multiple SSH keys][10] + * [How to enable SSH access using a GPG key for authentication][11] + + + +### Make a file manager shortcut + +Since you've started the SSH daemon on the remote system and set up your account username and password, all that's left is to map a shortcut to the other Linux system from your file manager. I use GNOME as my desktop, but the steps are basically the same for any Linux desktop. + +#### Make the initial connection + +In the GNOME file manager, look for the **+Other Locations** button in the left-hand navigation. Click that to open a **Connect to Server** prompt. Enter the address of the remote Linux server here, starting with the SSH connection protocol. + +![Creating a shortcut in GNOME file manager][12] + +The GNOME file manager supports a variety of connection protocols. To make a connection over SSH, start your server address with **sftp://** or **ssh://**. + +If your username is the same on your local Linux system and your remote Linux system, you can just enter the server's address and the folder location. To make my connection to the **/home/jhall** directory on my Raspberry Pi, I use: + + +``` +`sftp://10.0.0.11/home/jhall` +``` + +![GNOME file manager Connect to Server][13] + +If your username is different, you can specify your remote system's username with an **@** sign before the remote system's address. To connect to a Raspbian system on the other end, you might use: + + +``` +`sftp://pi@10.0.0.11/home/pi` +``` + +![GNOME file manager Connect to Server][14] + +If you didn't share your public SSH key, you may need to enter a password. Otherwise, the GNOME file manager should automatically open the folder on the remote system and let you navigate. + +![GNOME file manager connection][15] + +#### Create a shortcut so you can easily connect to the server later + +This is easy in the GNOME file manager. Right-click on the remote system's name in the navigation list, and select **Add Bookmark**. This creates a shortcut to the remote location. + +![GNOME file manager - adding bookmark][16] + +If you want to give the bookmark a more memorable name, you can right-click on the shortcut and choose **Rename**. + +### That's it! + +Connecting to a remote Linux system over SSH is just plain easy. And you can use the same method to connect to systems other than home file servers. I also have a shortcut that allows me to instantly access files on my provider's web server and another that lets me open a folder on my project server. SSH makes it a secure connection; all of my traffic is encrypted. Once I've opened the remote system over SSH, I can use the GNOME file manager to manage my remote files as easily as I'd manage my local folders. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/personal-file-server-ssh + +作者:[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/yearbook-haff-rx-linux-file-lead_0.png?itok=-i0NNfDC (Hand putting a Linux file folder into a drawer) +[2]: https://opensource.com/article/18/3/print-server-raspberry-pi +[3]: https://arm.fedoraproject.org/ +[4]: https://opensource.com/sites/default/files/uploads/fedora-server-control-panel-sshd.png (sshd in the list of system services) +[5]: https://opensource.com/sites/default/files/uploads/fedora-server-control-panel-sshd-service.png (slider to activate sshd) +[6]: https://opensource.com/sites/default/files/uploads/fedora-server-control-panel-accounts_create-user.png (Set up a new account on Fedora Server) +[7]: https://opensource.com/sites/default/files/uploads/fedora-server-control-panel-accounts.png (Set password or SSH key) +[8]: https://opensource.com/article/20/2/ssh-tools +[9]: https://opensource.com/article/19/4/ssh-keys-seahorse +[10]: https://opensource.com/article/19/4/gpg-subkeys-ssh-manage +[11]: https://opensource.com/article/19/4/gpg-subkeys-ssh +[12]: https://opensource.com/sites/default/files/uploads/gnome-file-manager-other-locations.png (Creating a shortcut in GNOME file manager) +[13]: https://opensource.com/sites/default/files/uploads/gnome-file-manager-other-sftp.png (GNOME file manager Connect to Server) +[14]: https://opensource.com/sites/default/files/uploads/gnome-file-manager-other-sftp-username.png (GNOME file manager Connect to Server) +[15]: https://opensource.com/sites/default/files/uploads/gnome-file-manager-remote-jhall.png (GNOME file manager connection) +[16]: https://opensource.com/sites/default/files/uploads/gnome-file-manager-remote-jhall-add-bookmark.png (GNOME file manager - adding bookmark) diff --git a/sources/tech/20200324 Audacious 4.0 Released With Qt 5- Here-s How to Install it on Ubuntu.md b/sources/tech/20200324 Audacious 4.0 Released With Qt 5- Here-s How to Install it on Ubuntu.md new file mode 100644 index 0000000000..53e7ea3fa6 --- /dev/null +++ b/sources/tech/20200324 Audacious 4.0 Released With Qt 5- Here-s How to Install it on Ubuntu.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Audacious 4.0 Released With Qt 5: Here’s How to Install it on Ubuntu) +[#]: via: (https://itsfoss.com/audacious-4-release/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Audacious 4.0 Released With Qt 5: Here’s How to Install it on Ubuntu +====== + +[Audacious][1] is an open-source audio player available for multiple platforms that include Linux. Almost after 2 years of its last major release, Audacious 4.0 has arrived with some big changes. + +The latest release Audacious 4.0 comes with [Qt 5][2] UI by default. You can still go for the old GTK2 UI from the source – however, the new features will be added to the Qt UI only. + +Let’s take a look at what has changed and how to install the latest Audacious on your Linux system. + +### Audacious 4.0 Key Changes & Features + +![Audacious 4 Release][3] + +Of course, the major change would be the use of Qt 5 UI as the default. In addition to that, there are a lot of improvements and feature additions mentioned in their [official announcement post][4], here they are: + + * Clicking on playlist column headers sorts the playlist + * Dragging playlist column headers changes the column order + * Application-wide settings for volume and time step sizes + * New option to hide playlist tabs + * Sorting playlist by path now sorts folders after files + * Implemented additional MPRIS calls for compatibility with KDE 5.16+ + * New OpenMPT-based tracker module plugin + * New VU Meter visualization plugin + * Added option to use a SOCKS network proxy + * The Song Change plugin now works on Windows + * New “Next Album” and “Previous Album” commands + * The tag editor in Qt UI can now edit multiple files at once + * Implemented equalizer presets window for Qt UI + * Lyrics plugin gained the ability to save and load lyrics locally + * Blur Scope and Spectrum Analyzer visualizations ported to Qt + * MIDI plugin SoundFont selection ported to Qt + * JACK output plugin gained some new options + * Added option to endlessly loop PSF files + + + +If you didn’t know about it previously, you can easily get it installed and use the equalizer coupled with [LADSP][5] effects to tweak your music experience. + +![Audacious Winamp Classic Interface][6] + +### How to Install Audacious 4.0 on Ubuntu + +It is worth noting that the [unofficial PPA][7] is made available by [UbuntuHandbook][8]. You can simply follow the instructions below to install it on Ubuntu 16.04, 18.04, 19.10, and 20.04. + +1\. First, you have to add the PPA to your system by typing in the following command in the terminal: + +``` +sudo add-apt-repository ppa:ubuntuhandbook1/apps +``` + +3\. Next, you need to update/refresh the package information from the repositories/sources you have and proceed to install the app. Here’s how to do that: + +``` +sudo apt update +sudo apt install audacious audacious-plugins +``` + +That’s it. You don’t have to do anything else. In either case, if you want to [remove the PPA and the software][9], just type in the following commands in order: + +``` +sudo add-apt-repository --remove ppa:ubuntuhandbook1/apps +sudo apt remove --autoremove audacious audacious-plugins +``` + +You can also check out their GitHub page for more information on the source and potentially install it on other Linux distros as well, if that’s what you’re looking for. + +[Audacious Source Code][10] + +### Wrapping Up + +The new features and the Qt 5 UI switch should be a good thing to improve the user experience and the functionality of the audio player. If you’re a fan of the classic Winamp interface, it works just fine as well – but missing a few features as mentioned in their announcement post. + +You can try it out and let me know your thoughts in the comments below! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/audacious-4-release/ + +作者:[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://audacious-media-player.org +[2]: https://doc.qt.io/qt-5/qt5-intro.html +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/audacious-4-release.jpg?ssl=1 +[4]: https://audacious-media-player.org/news/45-audacious-4-0-released +[5]: https://www.ladspa.org/ +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/audacious-winamp.jpg?ssl=1 +[7]: https://itsfoss.com/ppa-guide/ +[8]: http://ubuntuhandbook.org/index.php/2020/03/audacious-4-0-released-qt5-ui/ +[9]: https://itsfoss.com/how-to-remove-or-delete-ppas-quick-tip/ +[10]: https://github.com/audacious-media-player/audacious diff --git a/sources/tech/20200325 Linux firewall basics with ufw.md b/sources/tech/20200325 Linux firewall basics with ufw.md new file mode 100644 index 0000000000..78bb763b3b --- /dev/null +++ b/sources/tech/20200325 Linux firewall basics with ufw.md @@ -0,0 +1,215 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Linux firewall basics with ufw) +[#]: via: (https://www.networkworld.com/article/3533551/linux-firewall-basics-with-ufw.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Linux firewall basics with ufw +====== +We take a look at ufw - the uncomplicated firewall - on Linux, providing some insights and commands for making changes. +Vertigo3D / Getty Images + +The **ufw** (uncomplicated firewall) represents a serious simplification to [iptables][1] and, in the years that it’s been available, has become the default firewall on systems such as Ubuntu and Debian. And, yes, **ufw** is surprisingly uncomplicated – a boon for newer admins who might otherwise have to invest a lot of time to get up to speed on firewall management. + +GUIs are available for **ufw** (like **gufw**), but **ufw** commands are generally issued on the command line. This post examines some commands for using **ufw** and looks into how it works. + +First, one quick way to see how **ufw** is configured is to look at its configuration file – **/etc/default/ufw**. In the command below, we display the settings, using **grep** to suppress the display of both blank lines and comments (line starting with #). + +[RELATED: Linux hardening: a 15-step checklist for a secure Linux server][2] + +``` +$ grep -v '^#\|^$' /etc/default/ufw +IPV6=yes +DEFAULT_INPUT_POLICY="DROP" +DEFAULT_OUTPUT_POLICY="ACCEPT" +DEFAULT_FORWARD_POLICY="DROP" +DEFAULT_APPLICATION_POLICY="SKIP" +MANAGE_BUILTINS=no +IPT_SYSCTL=/etc/ufw/sysctl.conf +IPT_MODULES="nf_conntrack_ftp nf_nat_ftp nf_conntrack_netbios_ns" +``` + +As you can see, the default policy is to drop input and allow output. Additional rules that allow the connections that you specifically want to be accept are configured separately. + +The basic syntax for ufw commands might look like thee below, though this synopsis is not meant to imply that typing only “ufw” will get you further than a quick error telling you that arguments are required. + +``` +ufw [--dry-run] [options] [rule syntax] +``` + +The **\--dry-run** option means that **ufw** won’t run the command you specify, but will show you the results that you would see if it did. It will, however, display the entire set of rules as they would exist if the change were made, so be prepared for more than a few lines of output. + +To check the status of **ufw**, run a command like the following. Note that even this command requires use of **sudo** or use of the root account. + +[][3] + +``` +$ sudo ufw status +Status: active + +To Action From +-- ------ ---- +22 ALLOW 192.168.0.0/24 +9090 ALLOW Anywhere +9090 (v6) ALLOW Anywhere (v6) +``` + +Otherwise, you will see something like this: + +``` +$ ufw status +ERROR: You need to be root to run this script +``` + +Adding "verbose" provides a few additional details: + +``` +$ sudo ufw status verbose +Status: active +Logging: on (low) +Default: deny (incoming), allow (outgoing), disabled (routed) +New profiles: skip + +To Action From +-- ------ ---- +22 ALLOW IN 192.168.0.0/24 +9090 ALLOW IN Anywhere +9090 (v6) ALLOW IN Anywhere (v6) +``` + +You can easily allow and deny connections by port number with commands like these: + +``` +$ sudo ufw allow 80 <== allow http access +$ sudo ufw deny 25 <== deny smtp access +``` + +You can check out the **/etc/services** file to find the connections between port numbers and service names. + +``` +$ grep 80/ /etc/services +http 80/tcp www # WorldWideWeb HTTP +socks 1080/tcp # socks proxy server +socks 1080/udp +http-alt 8080/tcp webcache # WWW caching service +http-alt 8080/udp +amanda 10080/tcp # amanda backup services +amanda 10080/udp +canna 5680/tcp # cannaserver +``` + +Alternately, you can use service names like in these commands. + +``` +$ sudo ufw allow http +Rule added +Rule added (v6) +$ sudo ufw allow https +Rule added +Rule added (v6) +``` + +After making changes, you should check the status again to see that those changes have been made: + +``` +$ sudo ufw status +Status: active + +To Action From +-- ------ ---- +22 ALLOW 192.168.0.0/24 +9090 ALLOW Anywhere +80/tcp ALLOW Anywhere <== +443/tcp ALLOW Anywhere <== +9090 (v6) ALLOW Anywhere (v6) +80/tcp (v6) ALLOW Anywhere (v6) <== +443/tcp (v6) ALLOW Anywhere (v6) <== +``` + +The rules that **ufw** follows are stored in the **/etc/ufw** directory. Note that you need root access to view these files and that each contains a large number of rules. + +``` +$ ls -ltr /etc/ufw +total 48 +-rw-r--r-- 1 root root 1391 Aug 15 2017 sysctl.conf +-rw-r----- 1 root root 1004 Aug 17 2017 after.rules +-rw-r----- 1 root root 915 Aug 17 2017 after6.rules +-rw-r----- 1 root root 1130 Jan 5 2018 before.init +-rw-r----- 1 root root 1126 Jan 5 2018 after.init +-rw-r----- 1 root root 2537 Mar 25 2019 before.rules +-rw-r----- 1 root root 6700 Mar 25 2019 before6.rules +drwxr-xr-x 3 root root 4096 Nov 12 08:21 applications.d +-rw-r--r-- 1 root root 313 Mar 18 17:30 ufw.conf +-rw-r----- 1 root root 1711 Mar 19 10:42 user.rules +-rw-r----- 1 root root 1530 Mar 19 10:42 user6.rules +``` + +The changes made earlier in this post (the addition of port **80** for **http** access and **443** for **https** (encrypted http) access will look like this in the **user.rules** and **user6.rules** files: + +``` +# grep " 80 " user*.rules +user6.rules:### tuple ### allow tcp 80 ::/0 any ::/0 in +user6.rules:-A ufw6-user-input -p tcp --dport 80 -j ACCEPT +user.rules:### tuple ### allow tcp 80 0.0.0.0/0 any 0.0.0.0/0 in +user.rules:-A ufw-user-input -p tcp --dport 80 -j ACCEPT +You have new mail in /var/mail/root +# grep 443 user*.rules +user6.rules:### tuple ### allow tcp 443 ::/0 any ::/0 in +user6.rules:-A ufw6-user-input -p tcp --dport 443 -j ACCEPT +user.rules:### tuple ### allow tcp 443 0.0.0.0/0 any 0.0.0.0/0 in +user.rules:-A ufw-user-input -p tcp --dport 443 -j ACCEPT +``` + +With **ufw**, you can also easily block connections from a system using a command like this: + +``` +$ sudo ufw deny from 208.176.0.50 +Rule added +``` + +The status command will show the change: + +``` +$ sudo ufw status verbose +Status: active +Logging: on (low) +Default: deny (incoming), allow (outgoing), disabled (routed) +New profiles: skip + +To Action From +-- ------ ---- +22 ALLOW IN 192.168.0.0/24 +9090 ALLOW IN Anywhere +80/tcp ALLOW IN Anywhere +443/tcp ALLOW IN Anywhere +Anywhere DENY IN 208.176.0.50 <== new +9090 (v6) ALLOW IN Anywhere (v6) +80/tcp (v6) ALLOW IN Anywhere (v6) +443/tcp (v6) ALLOW IN Anywhere (v6) +``` + +All in all, **ufw** is both easy to configure and easy to understand. + +Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3533551/linux-firewall-basics-with-ufw.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://www.networkworld.com/article/2716098/working-with-iptables.html +[2]: https://www.networkworld.com/article/3143050/linux/linux-hardening-a-15-step-checklist-for-a-secure-linux-server.html#tk.nww-fsb +[3]: 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) +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world diff --git a/sources/tech/20200326 3 open source tools for sticking to a budget.md b/sources/tech/20200326 3 open source tools for sticking to a budget.md new file mode 100644 index 0000000000..2c3ca5bc2e --- /dev/null +++ b/sources/tech/20200326 3 open source tools for sticking to a budget.md @@ -0,0 +1,56 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 open source tools for sticking to a budget) +[#]: via: (https://opensource.com/article/20/3/open-source-budget) +[#]: author: (Lauren Pritchett https://opensource.com/users/lauren-pritchett) + +3 open source tools for sticking to a budget +====== +Find the right solution for you in this roundup of open source budgeting +tools. Plus, learn about an open source tax preparation software. +![A dollar sign in a network][1] + +In light of changing economical times in many countries around the world right now, you may find yourself wanting to revamp or improve your financial situation and your understanding of it. Or, perhaps one of your New Year's resolutions was to start budgeting? You are not alone. + +The best way to stick to that resolution is to keep track of the money you are spending and making on a regular basis. The problem is, many popular personal finance apps out there are proprietary. Are you looking for an open source alternative to Quicken, Mint, or You Need a Budget? Whether you are new to open source software or new to budgeting in general, one of these tools will suit your needs and comfort level.  + +### LibreOffice Calc + +I recommend using LibreOffice Calc to any open source newcomer who wants to start budgeting. If you've used proprietary spreadsheets like Google Sheets or Microsoft Excel, the LibreOffice Calc template will be very familiar. In this [budgeting tutorial][2], author Jess Weichler has done a lot of the work for you by including a handy, downloadable template. The template already has expense categories like utility bills, groceries, dining out, and more, but you have the freedom to customize it to your lifestyle. In a second article, she shows you how to [create your own templates][3].  + +### HomeBank + +HomeBank is another great option for open source users of all levels. HomeBank is free, yet it has plenty of analysis and transaction features like its proprietary counterparts. In fact, you can export and import Quicken files to HomeBank, which makes transitioning to this open source app a breeze. Finally, you can use a tool to help you make wise decisions about your money without spending more money. Learn how to get started in Jessica Cherry's [tutorial][4].  + +### GnuCash + +Like the other budgeting tools mentioned here, GnuCash can be used on Windows, macOS, and Linux. There is a slew of documentation available, but our very own Don Watkins guides you through the steps of setting up GnuCash on Linux in [this tutorial][5]. Not only is GnuCash a great option for taking control of your personal finances, but it also has features like invoicing to help you manage your small business.  + +### Bonus: OpenTaxSolver + +The dreaded tax season can be a stressful time for many Americans. Many folks purchase TurboTax or use an accountant or tax service to do their taxes. Contrary to popular belief, open source tax preparation software exists! Author Jessica Cherry did the belaboring research and introduces our readers to OpenTaxSolver in [this article][6]. To use OpenTaxSolver successfully, you'll need keen attention to detail, but you won't have to worry about doing the complicated math.  + +Which open source budgeting app will you try? Do you have a favorite tool that I didn't mention in this list? Share your thoughts in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/open-source-budget + +作者:[Lauren Pritchett][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/lauren-pritchett +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_whitehurst_money.png?itok=ls-SOzM0 (A dollar sign in a network) +[2]: https://opensource.com/article/20/3/libreoffice-open-source-budget +[3]: https://opensource.com/article/20/3/libreoffice-templates +[4]: https://opensource.com/article/20/2/open-source-homebank +[5]: https://opensource.com/article/20/2/gnucash +[6]: https://opensource.com/article/20/2/open-source-taxes diff --git a/sources/tech/20200326 How to detect outdated Kubernetes APIs.md b/sources/tech/20200326 How to detect outdated Kubernetes APIs.md new file mode 100644 index 0000000000..a45a9b2add --- /dev/null +++ b/sources/tech/20200326 How to detect outdated Kubernetes APIs.md @@ -0,0 +1,234 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to detect outdated Kubernetes APIs) +[#]: via: (https://opensource.com/article/20/3/deprek8) +[#]: author: (Tyler Auerbeck https://opensource.com/users/tylerauerbeck) + +How to detect outdated Kubernetes APIs +====== +Deprek8 and Conftest alert you about deprecated APIs that threaten to +slip into your codebase. +![Ship captain sailing the Kubernetes seas][1] + +Recently, deprecated APIs have been wreaking havoc on everyone's [Kubernetes][2] manifests. Why is this happening?!? It's because the objects that we've come to know and love are moving on to their new homes. And it's not like this happened overnight. Deprecation warnings have been in place for quite a few releases now. We've all just been lazy and thought the day would never come. Well, _it's here_! + +So, maybe it caught up to us this time. But we'll be prepared next time, right?!? Yeah, that's what we said last time. But what if we could put something in place that makes sure that this doesn't happen? + +### What is Deprek8? + +[Deprek8][3] is a set of [Open Policy Agent][4] (OPA) policies that allow you to check your repository for deprecated API versions. These policies offer a way to provide warnings and errors when something is in the process of being or has already been deprecated. But **Deprek8** is just a set of policies that define what to watch for. How do you actually actively use these policies in order to monitor for deprecations? + +There are a number of ways and tools that can do this; one way is to use the OPA Deprek8 policy. + +### What is the OPA Deprek8 policy? + +OPA is "an open source, general-purpose policy engine that enables unified, context-aware policy enforcement." In other words, OPA provides a means of establishing and enforcing a set of policies based upon a policy file. The policies are defined in a file (or set of files) using the [Rego query language][5]. This use case won't necessarily rely on the OPA application, but more specifically, it uses this query language to do the heavy lifting. By using Rego, you can check whether various manifests match certain criteria and then either warn or error them out based on your definition. For example, in Kubernetes 1.16, the Deployment object can no longer be served from the **extensions/v1beta1 apiVersion**. So in your .rego file, you could have something like: + + +``` +_deny = msg { +  resources := ["Deployment"] +  input.apiVersion == "extensions/v1beta1" +  input.kind == resources[_] +  msg := sprintf("%s/%s: API extensions/v1beta1 for %s is no longer served by default, use apps/v1 instead.", [input.kind, input.metadata.name, input.kind]) +} +``` + +This would alert that you have a deprecated manifest and print a message like: + +> Deployment/myDeployment: API extensions/v1beta1 for Deployment is no longer served by default, use apps/v1 instead. + +That's great! This is exactly what you need in order to avoid having old manifests lying around. But these are just the policies; you need something that will check these policies and put them into action. + +### Conftest + +This is where [Conftest][6] comes in. Conftest is a utility that allows you to put Rego policies into action against any number of configuration files. According to the repo, Conftest currently supports: + + +``` + - YAML + - JSON + - INI + - TOML + - HOCON + - HCL + - CUE + - Dockerfile + - HCL2 (Experimental) + - EDN + - VCL + - XML +``` + +It has some fairly strict defaults (i.e., expecting policy files to be in certain locations), but they can be overridden with the appropriate flags if you have a layout that you prefer. If you want to know more about those specifics, please consult the [documentation][7] in the repository. + +For example, you can run any policy file on Conftest with a command like: + + +``` +`helm template --set podSecurityPolicy.enabled=true --set server.ingress.enabled=true . | conftest -p mypolicy.rego -` +``` + +This would generate the appropriate output from a Helm template and pipe it directly to the Conftest utility. Conftest inspects that output against any policies defined in the **mypolicy.rego** file and then gives any appropriate warnings or errors for objects that match against those policies. You can, of course, swap out any templating tooling of your choice, or you can feed specific files directly to the Conftest tool. + +So now you have the tools to set your policies and enforce them against your configuration files. But how do you tie these two things together? Better yet: How do you automate this process to continuously monitor the codebase to make sure you never fall behind the deprecation line again? + +### Using Git to run checks + +There are many methods and tools to run checks against code. By adding similar steps to your continuous integration (CI) tooling (e.g., Jenkins, Tekton, etc.), you can accomplish the same goal. In this very basic use case, I used [GitHub Actions][8], a new feature of GitHub repositories. + +GitHub Actions allows you to automate your entire workflow, so you don't have to sit in front of your keyboard and hack all of this together. With Actions, you can string together any number of steps into a workflow (or multiple workflows) by either rolling your own Actions if you're doing something custom or, in most cases, using something that already exists in the [Marketplace][9]. Luckily, others have provided Actions to do the things you need to do for this example, so you can lean on the community's expertise to pull your workflow together. + +As described in the steps above, the workflow looks something like: + + 1. Retrieve the Deprek8 policy you need and store it somewhere for later use. + 2. Run Conftest against the appropriate files/charts with the policy file you grabbed in step 1. + + + +What does this boil down to? Well, all you really need to do is to use curl to pull your policy file and then run it through Conftest after pointing to your code, using the [curl][10] and [Conftest][11] Actions. Since these Actions already exist, you don't need to write any custom code! And as I'm sure you can tell by the names, they allow you to run the associated commands without having to do any custom work to pre-process anything or pull down any binaries. + +Now that you have the Actions you need to use, how do you pull them together? This is where your workflow comes into play. While Actions are the pieces of code that get things done, they're useless without a way to string them together so that they can be triggered by some event. A GitHub Action workflow will look something like this: + + +``` +name: Some Awesome Workflow Name +on: An Event That Triggers Our Workflow +jobs: +  awesome-job-name: +    runs-on: ubuntu-latest +    steps: +      - uses: actions/checkout@master +      - name: awesome-step-name +        uses: someorg/someaction@version +        with: +          args: some args that I might pass to someaction +``` + +Now you have a workflow that has multiple steps, can be triggered by a specific GitHub event, and can be passed a set of parameters (if that is applicable to that specific Action). This example is _extremely basic_. But luckily, the workflow you're trying to put together is equally simple. This shouldn't be taken as a comprehensive example of a GitHub Action, as there are many more complicated (and elegant) things you can do. If you're interested in learning more, take a look at the [GitHub Actions documentation][12]. + +Now that you have an idea of what a workflow looks like and know what Actions you're interested in using, take a run at plugging the two together. For this example, you want to make sure that whenever your code is updated, it's checked to make sure it's not using any deprecated APIs. + +First, rig up your workflow with some names and the events that you want to trigger off of. Give your workflow and job a useful name that will help you identify it (and what it does). + + +``` +name: API Deprecation Check +on: pull_request, push +jobs: + deprecation-check: +``` + +Next, you need to tell your workflow that you want to trigger these Actions based on any **pull_request** or **push** that happens to this repository because these are the two main events that get new code into a repository. You can do this by utilizing the **on** keyword. + + +``` +name: API Deprecation Check +on: pull_request, push +jobs: +  deprecation-check: +    runs-on: ubuntu-latest +    steps: +      - uses: actions/checkout@master +``` + +Then, add where you want these Actions to run and how the Action can get the code. You can tell the Action where to run by using the **runs-on** keyword. You have a few options here: Windows, Mac, or Ubuntu. In most cases, using Ubuntu is fine, as you'll frequently rely on Actions that run inside their own container (versus running on the base OS that you define here). It's also very important to understand that an Action does not check out code by default. When you need to do something that interacts with your code, make sure to use the Action **actions/checkout**. When this is included, your code will be available within your Action, and you can pass that through to the next step in your workflow. + + +``` +name: API Deprecation Check +on: pull_request, push +name: API Deprecation Check +jobs: +  deprecation-check: +    runs-on: ubuntu-latest +    steps: +      - uses: actions/checkout@master +      - name: curl +        uses: wei/curl@master +        with: +          args: > /github/home/deprek8.rego +``` + +Now that your code is checked out, you can start preparing to do something with it. As mentioned, before you can check code for deprecations, you first need the file that contains the policies that you want to check for, so just retrieve the file using the **curl** Action. This is a fairly straightforward Action, in that it accepts whatever parameters you would normally pass into the curl command. If you were doing something more complicated, this is where you could pass in things like specific HTTP Actions, headers, etc. However, in this case, you're just trying to retrieve a file, so the only thing you need to pass to your Action is the URL you want to retrieve (in this case, the one that contains your raw policy file) and then tell it where you want to write that file. In this case, you're going to have it write to **/github/home**. Why? It's because this filesystem persists between steps and will allow you to use the policy file within this next step. + + +``` +name: API Deprecation Check +on: pull_request, push +jobs: +  deprecation-check: +    runs-on: ubuntu-latest +    steps: +      - uses: actions/checkout@master +      - name: curl +        uses: wei/curl@master +        with: +          args: > /github/home/deprek8.rego +      - name: Check helm chart for deprecation +        uses: instrumenta/conftest-action/helm@master +        with: +          chart: nginx-test +          policy: /github/home/deprek8.rego +``` + +Now that you have your policy file, it's just a matter of running it against the code via **conftest**. Similar to the **curl** Action, the **conftest** Action just expects a series of parameters to understand how it should run against the code. In the example above, it runs against a Helm chart, but it can run against a specific file (or set of files) by changing the **uses** value to **instrumenta/[conftest-action@master][13]**. Just point to the path where your chart sits in the repository and then provide the path to your policy file (specified in the previous step). Once you have all of this together, you have a complete workflow. But what does this look like (assuming there's some bad code in your Helm chart)? To find out, take a look at the [example repository][14]. + +In the Nginx Helm chart, you'll notice that one of the templates is a [statefulset][15]. You may also notice that the apiVersion the StatefulSet is using is **apps/v1beta1**. This API was deprecated in Kubernetes 1.16 and is now hosted in **apps/v1**. So when your GitHub Actions workflow runs, it should detect this issue and serve an error like: + + +``` +FAIL - StatefulSetf/web: API apps/v1beta1 is no longer served by default, use apps/v1 instead. +Error: plugin "conftest" exited with error +##[error]Docker run failed with exit code 1 +``` + +The Action indicates there is something wrong and then fails the rest of the Action. You can see the [full workflow][16] if you are interested. + +### Wrapping up + +This workflow will save some future heartache by alerting you to any deprecated APIs that slip into your codebase. To be clear, this is an _alerting_ mechanism. This won't prevent you from merging bad code into your codebase. But, as long as you pay attention, you should be completely aware prior to (or just after) merging problematic code. + +Where do you go from here? Well, there are a few things to keep in mind. Currently, Deprek8 is up to date as of Kubernetes 1.16. If you're interested in more recent versions, I'm sure Deprek8 would be happy to accept your [pull request][3]. + +The other shortcoming of this method is that the **conftest** and GitHub Actions are a bit limited in that they only allow you to point at specific files or a single chart at a time. What if you want to point at multiple directories of manifests or have multiple charts inside your repository? Currently, the only way to get around that is to either list out every single file you're interested in (in the case of having multiple charts) or have multiple steps inside your workflow. Other scenarios could become problematic, like other templating engines that require some custom logic to pair the parameters and template files together. But a simple workaround for that could be to have a step in your workflow that pulls down Conftest along with a tiny inline script to loop through some of this. I'm sure there are more elegant solutions (and if you come up with one, I'm sure these projects would be more than happy to take a look at your PR). + +Regardless, you now have a mechanism that should allow you to sleep a bit easier when checking in your code! And hopefully, this method will help you build even more robust workflows to protect your code. + +* * * + +_This was originally published in [Tyler Auerbeck's GitHub repository][17] and is reposted, with edits, with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/deprek8 + +作者:[Tyler Auerbeck][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/tylerauerbeck +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ship_captain_devops_kubernetes_steer.png?itok=LAHfIpek (Ship captain sailing the Kubernetes seas) +[2]: https://opensource.com/resources/what-is-kubernetes +[3]: https://github.com/naquada/deprek8 +[4]: https://github.com/open-policy-agent/opa +[5]: https://blog.openpolicyagent.org/opas-full-stack-policy-language-caeaadb1e077 +[6]: https://github.com/instrumenta/conftest +[7]: https://github.com/instrumenta/conftest/tree/master/docs +[8]: https://github.com/features/actions +[9]: https://github.com/marketplace?type=actions +[10]: https://github.com/marketplace/actions/github-action-for-curl +[11]: https://github.com/instrumenta/conftest-action +[12]: https://help.github.com/en/actions +[13]: mailto:conftest-action@master +[14]: https://github.com/tylerauerbeck/deprek8-example +[15]: https://raw.githubusercontent.com/tylerauerbeck/deprek8-example/master/nginx-test/templates/statefulset.yaml +[16]: https://github.com/tylerauerbeck/deprek8-example/runs/426774566?check_suite_focus=true +[17]: https://github.com/tylerauerbeck/writing/blob/master/opa/deprek8.md diff --git a/sources/tech/20200326 Tricks for getting around your Linux file system.md b/sources/tech/20200326 Tricks for getting around your Linux file system.md new file mode 100644 index 0000000000..e8ed2b3869 --- /dev/null +++ b/sources/tech/20200326 Tricks for getting around your Linux file system.md @@ -0,0 +1,146 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Tricks for getting around your Linux file system) +[#]: via: (https://www.networkworld.com/article/3533421/tricks-for-getting-around-your-linux-file-system.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Tricks for getting around your Linux file system +====== +The cd command is probably one of the first 10 that any Linux user learns, but it's not the only way to navigate the Linux file system.Here are some other ways. +Thinkstock + +Whether you're moving around the file system, looking for files or trying to move into important directories, Linux can provide a lot of help. In this post, we'll look at a number of tricks to make moving around the file system and both finding and using commands that you need a little easier. + +### Adding to your $PATH + +One of the easiest and most useful ways to ensure that you don't have to invest a lot of time into finding commands on a Linux system is to add the proper directories to your $PATH variable. The order of directories that you add to your $PATH variable is, however, very important. They determine the order in which the system will look through the directories to find the command to run -- stopping when it finds the first match. + +You might, for example, want to put your home directory first so that, if you create a script that has the same name as some other executable, it will be the one that you end up running whenever you type its name. + +[RELATED: Linux hardening: a 15-step checklist for a secure Linux server][1] + +To add your home directory to your $PATH variable, you could do this: + +``` +$ export PATH=~:$PATH +``` + +The **~** character represents your home directory. + +If you keep your scripts in your bin directory, this would work for you: + +``` +$ export PATH=~/bin:$PATH +``` + +You can then run a script located in your home directory like this: + +[][2] + +``` +$ myscript +Good morning, you just ran /home/myacct/bin/myscript +``` + +**IMPORTANT:** The commands shown above _add_ to your search path because $PATH (the current path) is included. They don't override it. Your search path should be configured in your **.bashrc** file, and any changes you intend to be permanent should be added there as well. + +### Using symbolic links + +Symbolic links provide an easy and obvious way to record the location of directories that you might need to use often. If you manage content for a web site, for example, you might want to get your account to "remember" where the web files are located by creating a link like this: + +``` +ln -s /var/www/html www +``` + +The order of the arguments is critical. The first (/var/www/html) is the target and the second is the name of the link that you will be creating. If you're not currently located in your home directory, the following command would do the same thing: + +``` +ln -s /var/www/html ~/www +``` + +After setting this up, you can use "cd www" to get to **/var/www/html**. + +### Using shopt + +The **shopt** command also provides a way to make moving to a different directory a bit easier. When you employ **shopt'**s **autocd** option, you can go to a directory simply by typing its name. For example: + +``` +$ shopt -s autocd +$ www +cd -- www +/home/myacct/www +$ pwd -P +/var/www/html + +$ ~/bin +cd -- /home/myacct/bin +$ pwd +/home/myacct/bin +``` + +In the first set of commands above, the **shopt** command's **autocd** option is enabled. Typing **www** then invokes a "cd www" command. Because this symbolic link was created in one of the **ln** command examples above, this moves us to **/var/www/html**. The **pwd -P** command displays the actual location. + +In the second set, typing **~/bin** invokes a **cd** into the **bin** directory in the user's home. + +Note that the **autocd** behavior will _not_ kick in when what you type is a command –  even if it's also the name of a directory. + +The **shopt** command is a bash builtin and has a lot of options. This one just means that you don't have to type "cd" before the name of each directory you want to move into. + +To see **shopt**'s other options, just type "shopt". + +### Using $CDPATH + +Probably one of the most useful tricks for moving into particular directories is adding the paths that you want to be able to move into easily to your **$CDPATH**. This creates a list of directories that will be moved into by typing only a portion of the full path names. + +There is one aspect of this that may be just a little tricky. Your **$CDPATH** needs to include the directories that _contain_ the directories that you want to move into, not the directories themselves. + +For example, say that you want to be able to move into the **/var/www/html** directory simply by typing "cd html" and into subdirectories in /var/log using only "cd" and the simple directory names. In this case, this **$CDPATH** would work: + +``` +$ CDPATH=.:/var/log:/var/www +``` + +Here's what you would see: + +``` +$ cd journal +/var/log/journal +$ cd html +/var/www/html +``` + +Your **$CDPATH** kicks in when what you type is _not_ a full path. Then it looks down its list of directories in order to see if the directory you identified exists in one of them. Once it finds a match, it takes you there. + +Keeping the "." at the beginning of your **$CDPATH** means that you can move into local directories without having to have them defined in the **$CDPATH**. + +``` +$ export CDPATH=".:$CDPATH" +$ Videos +cd -- Videos +/home/myacct/Videos +``` + +It's not hard to move around the Linux file system, but you can save a few brain cells if you use some handy tricks for getting to various locations easily. + +Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3533421/tricks-for-getting-around-your-linux-file-system.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://www.networkworld.com/article/3143050/linux/linux-hardening-a-15-step-checklist-for-a-secure-linux-server.html#tk.nww-fsb +[2]: 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) +[3]: https://www.facebook.com/NetworkWorld/ +[4]: https://www.linkedin.com/company/network-world diff --git a/sources/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md b/sources/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md new file mode 100644 index 0000000000..26e823de79 --- /dev/null +++ b/sources/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md @@ -0,0 +1,102 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: 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, I’m 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. + +We’ll 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]. + +We’ll 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://<<YOUR_RPI_IP_ADDRESS>>: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/ diff --git a/sources/tech/20200327 KubeCF Is What DevOps Wanted- Marrying Cloud Foundry with Kubernetes.md b/sources/tech/20200327 KubeCF Is What DevOps Wanted- Marrying Cloud Foundry with Kubernetes.md new file mode 100644 index 0000000000..f306d94bc7 --- /dev/null +++ b/sources/tech/20200327 KubeCF Is What DevOps Wanted- Marrying Cloud Foundry with Kubernetes.md @@ -0,0 +1,79 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (KubeCF Is What DevOps Wanted: Marrying Cloud Foundry with Kubernetes ) +[#]: via: (https://www.linux.com/articles/kubecf-is-what-devops-wanted-marrying-cloud-foundry-with-kubernetes/) +[#]: author: (Swapnil Bhartiya https://www.linux.com/author/swapnil/) + +KubeCF Is What DevOps Wanted: Marrying Cloud Foundry with Kubernetes  +====== + +[![][1]][2] + +There are times when solutions that  seem to compete against each other turn out to be complementary. [This is exactly what happened with Cloud Foundry and Kubernetes. ][3] + +“Enterprises have moved on from the debate around Cloud Foundry Application Runtime or PaaS experience versus Kubernetes-based experience, and have opted to adopt both. The PaaS experience that Cloud Foundry offers is about optimizing developer time by allowing them to focus on business problems. Let them focus on the app they’re trying to build, not on the plumbing underneath it,” says Chip Childers, CTO at Cloud Foundry ​Foundation. + +“There are plenty of use cases that don’t fit into a PaaS-style architecture. If you look at the breadth of architectures that a typical enterprise deals with, there are tons of applications that you need to just wrap the thing in a container and operate it that way,” he says. + +**Integrating Cloud Foundry and Kubernetes ** + +To incorporate Kubernetes into the Cloud Foundry architecture so Cloud Foundry users can use Kubernetes as an alternative to Diego/Garden to orchestrate application container instances, Cloud Foundry Foundation kickstarted an initiative called [Project Eirini][4]. + +Similarly, [Project Quarks][5] is another incubating effort within the Cloud Foundry Foundation that is focused on packaging the Cloud Foundry Application Runtime as a set of containers instead of virtual machines, enabling easier deployment to Kubernetes. + +“Project Quarks took some code from SUSE called Fizzle. It would take the type of release artifact that our project teams were generally releasing for their component of the system, and work it into a usable Docker image. Then they would use Helm and some scripts to deploy that into Kubernetes,” said Childers. + +There was, however, one crucial piece of the jigsaw missing. + +“There was this code that SUSE had been working on. It was the basis of the SUSE product called SCF (SUSE Cloud Foundry). SCF became [KubeCF][6]. It creates a Kubernetes native distribution of Cloud Foundry,” reveals Childers. + +KubeCF recently hit its 1.0 release. So, where does KubeCF go from here? + +“Presenty, we can look at it as the easiest path to a Kubernetes-native Cloud Foundry for pure open search users. There are some other efforts that are happening in parallel that are taking a look at each component of the Cloud Foundry architecture. Project architects are working towards allowing people to take KubeCF, deploy the whole system to Kubernetes, and take advantage of the simplicity that gets enabled as code gets modified,” says Childers. + +**Developers First: Ensuring Seamless UX** + +One of the strengths of the Cloud Foundry community is that it has always offered a distribution. There is still a distribution called CF deployment, which is based on a VM-centric architecture that uses the Cloud Foundry BOSH platform to orchestrate infrastructures and service environments (or virtualized environments like V-sphere) to deploy VMs and then run the system on top of it. + +However, distribution also entails members of the ecosystem packaging it or dictating with their own offerings. In such a scenario, how can developers expect consistency across the distros? + +“The commonality between both upstream releases — the CF deployment and KubeCF — lies in the components that they sew together to create the Cloud Foundry platform. The Cloud Foundry Platform certification continues to be based on the idea that a certified distribution uses those components in an unmodified way, and integrates them to create that developer experience,” Childers explains. + +“So, regardless of whether you’re deploying to Kubernetes or you’re deploying to virtual machines, regardless of the certified vendor that you use, or if you use upstream distributions, you should have that same developer experience. That’s what Platform Certification ensures,” he says. + +Operational consistency is less a concern for the ecosystem and the community because many of these providers are offering it as a service. “Those that do it as subscription-based software delivery have a lot of tooling around operations that’s specific to them plus all of the other values that they bring together,” Childers avers. + +**Evolution Unabated** + +The KubeCF distribution has finally put the debate of ‘Do I use Kubernetes or do I use Cloud Foundry?’ to rest. + +“The answer should’ve always been ‘You use both.’ The architecture fits one on top of the other very nicely, and overcomes the concerns of dual stacks,” says Childers. + +With the ‘either-or’ debate over, Chip intends to further evolve this architecture, thereby offering an enormous amount of value to enterprises trying to deal with container-centric infrastructure management and developer productivity. + +“We’ve completely re-converged as an ecosystem around embracing the Kubernetes-based infrastructure as being the most popular and rising approach. We’ve been evolving this architecture as a community for years now,” he says. + +“There are huge engineering and commercial teams supporting Kubernetes. VMware has an enormous investment in Kubernetes, and it continues to increase that investment. With the acquisition of Pivotal, VMware also has a huge amount of investment in Cloud Foundry. It’s working aggressively on the mission of bringing the two together. We see the same traction with SAP, IBM, and SUSE, which presents a lot of opportunities for everybody,” adds Childers. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/articles/kubecf-is-what-devops-wanted-marrying-cloud-foundry-with-kubernetes/ + +作者:[Swapnil Bhartiya][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.linux.com/author/swapnil/ +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/wp-content/uploads/2020/03/color-3580779_1920-1068x667.jpg (color-3580779_1920) +[2]: https://www.linux.com/wp-content/uploads/2020/03/color-3580779_1920.jpg +[3]: https://www.tfir.io/kubecf-a-kubernetes-native-distribution-of-cloud-foundry-chip-childers-cto-cloud-foundry-%e2%80%8bfoundation/ +[4]: https://www.cloudfoundry.org/project-eirini/ +[5]: https://www.cloudfoundry.org/project-quarks/ +[6]: https://github.com/cloudfoundry-incubator/kubecf diff --git a/sources/tech/20200328 Open source fights against COVID-19, Google-s new security tool written in Python, and more open source news.md b/sources/tech/20200328 Open source fights against COVID-19, Google-s new security tool written in Python, and more open source news.md new file mode 100644 index 0000000000..dce9c83a0e --- /dev/null +++ b/sources/tech/20200328 Open source fights against COVID-19, Google-s new security tool written in Python, and more open source news.md @@ -0,0 +1,82 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Open source fights against COVID-19, Google's new security tool written in Python, and more open source news) +[#]: via: (https://opensource.com/article/20/3/news-march-28) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +Open source fights against COVID-19, Google's new security tool written in Python, 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 open source solutions for COVID-19, Google's new security tool, code cleanup software from Uber, and more! + +### Using open source in the fight against COVID-19 + +When COVID-19 started its march around the world, open source [stepped up][2] to try to help stop it. That includes using open data to [create tracking dashboards and apps][3], designing ventilators, and developing protective gear. + +Scientists at the University of Waterloo in Canada have teamed with artificial intelligence firm DarwinAI to create an open source tool "[to identify signs of Covid-19 in chest x-rays][4]." Called COVID-Net, it's neural network "that is particularly good at recognizing images." The dataset the researchers are using is [available on GitHub][5], which includes a link the software. + +Additionally, many [open source hardware projects][6] are underway to expedite the search for a cure.  + +### Google releases tool to fight USB keystroke injection attacks + +One of the sneakiest and potentially most malicious ways to hack a computer is a USB keystroke injection attack. Using a compromised USB device connected to a computer, a hacker can run commands without you even noticing. Google's making it easier for Linux users to fight back against these kinds of attacks by releasing [an open source detection tool][7]. + +Called USB Keystroke Injection Protection, the tool detects "if the keystrokes have been made without human involvement". It does that by measuring "the timing of keystrokes coming from connected USB devices." Sebastian Neuner of Google's Information Security Engineering Team said that while the USB Keystroke Injection Protection tool isn't the last word in defense against these kinds of attacks, but offers "another layer of protection and to defend a user sitting in front of their unlocked machine by them seeing the attack happening." + +You can find the Python source code for the tool [on GitHub][8]. + +### Uber makes code deletion tool open source + +As applications get bigger, they often contain code that's either no longer used or which is obsolete. That added code make software more difficult to maintain. To help solve the problem of quickly finding that redundant code, Uber recently [open sourced a tool called Pirhana][9]. + +Pirhana scans code for [feature flags][10], looking for ones that are no longer used. The software then deletes the unused flags from the code. At the moment, Pirhana works with software written in the Objective-C, Swift, and Java languages. Uber's developers hope the number of supported languages will increase "now that outside developers have an opportunity to contribute to the project." + +You can grab [Pirhana's source code][11] from its repository on GitHub + +#### In other news + + * [Singapore government to open source contact-tracing protocol][12] + * [European Commission to use open source messaging service Signal][13] + * [Spanish software to computerize healthcare in Cameroon and India][14] + * [ING Open-Sources Lion, Its White-Label Web Component Library][15] + * [Open Source Goes Mainstream – How Sharing Is Shaping The Future Of Music][16] + + + +Thanks, as always, to Opensource.com staff members and [Correspondents][17] for their help this week. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/news-march-28 + +作者:[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://jaxenter.com/covid-19-open-source-170237.html +[3]: https://opensource.com/article/20/3/open-source-software-covid19 +[4]: https://www.technologyreview.com/s/615399/coronavirus-neural-network-can-help-spot-covid-19-in-chest-x-ray-pneumonia/ +[5]: https://github.com/lindawangg/COVID-Net +[6]: https://opensource.com/article/20/3/open-hardware-covid19 +[7]: https://www.zdnet.com/article/google-linux-systems-can-use-this-new-tool-against-usb-keystroke-injection-attacks/ +[8]: https://github.com/google/ukip +[9]: https://siliconangle.com/2020/03/17/ubers-open-source-piranha-tool-hunts-redundant-application-code/ +[10]: https://en.wikipedia.org/wiki/Feature_toggle +[11]: https://github.com/uber/piranha +[12]: https://www.computerweekly.com/news/252480501/Singapore-government-to-open-source-contact-tracing-protocol +[13]: https://joinup.ec.europa.eu/collection/open-source-observatory-osor/news/signal-messaging-service +[14]: https://intallaght.ie/spanish-software-to-computerize-healthcare-in-cameroon-and-india/ +[15]: https://www.infoq.com/articles/ing-open-sources-lion-web-component/ +[16]: https://www.forbes.com/sites/andreazarczynski/2020/03/19/open-source-goes-mainstream--how-sharing-is-shaping-the-future-of-music/#9e1ca1290013 +[17]: https://opensource.com/correspondent-program diff --git a/sources/tech/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md b/sources/tech/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md new file mode 100644 index 0000000000..e502219448 --- /dev/null +++ b/sources/tech/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md @@ -0,0 +1,114 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to install Microsoft TrueType Fonts on Ubuntu-based Distributions) +[#]: via: (https://itsfoss.com/install-microsoft-fonts-ubuntu/) +[#]: author: (Community https://itsfoss.com/author/itsfoss/) + +How to install Microsoft TrueType Fonts on Ubuntu-based Distributions +====== + +If you open some Microsoft documents in LibreOffice on Linux, you’ll notice that the fonts look a bit different. You’ll also notice that you cannot find common fonts like [Times New Roman][1], Arial etc. + +Don’t worry. I’ll show you how to install these fonts in Ubuntu and other Ubuntu-based Linux distributions. But before that, let me tell you why these fonts are not available by default. + +### Why Microsoft fonts are not installed by default in Linux? + +![][2] + +Times New Roman, Arial and other such fonts are owned by Microsoft and they are not open source. Many Linux distributions don’t provide proprietary software by default to avoid licensing issue. + +This is why Ubuntu and other Linux distributions use an open source fonts “Liberation fonts” to substitute Microsoft fonts by default. The [Liberation Fonts][3] were created by [Red Hat][4] to substitute Arial, Arial Narrow, Times New Roman and Courier New as their width is the same. When you open a document written in Times New Roman, the equivalent Liberation Font will be used to keep the document uninterrupted. + +However Liberation fonts are not identical to Microsoft’s fonts and in some cases you may need to use Arial or Times New Roman. A very common scenario is that Microsoft’s fonts are the only option is in schools, universities and other public and private organizations. They require you to submit the documents in one of those fonts. + +Good thing is that you can install the Microsoft fonts on Ubuntu and other distributions easily. This way, you will be able to increase compatibility of LibreOffice and have the freedom to choose an open source office software. + +### Installing Microsoft fonts on Ubuntu-based Linux distributions + +You can [install new fonts in Ubuntu][5] by downloading them on your own. But since Microsoft fonts are very popular (and is provided free of cost), Ubuntu provides an easy way of installing it. + +Be aware that despite Microsoft has released its core fonts for free of charge, the usage of the fonts is restricted in other operating systems. You’ll have to read and accept EULA (End User License Agreement) before installing Microsoft fonts in Ubuntu. + +These fonts are [available in the multiverse repositories so make sure to enable it][6] first: + +``` +sudo add-apt-repository multiverse +``` + +After that, you can update your Ubuntu repository cache and install the Microsoft fonts like this: + +``` +sudo apt update && sudo apt install ttf-mscorefonts-installer +``` + +Press tab to select **OK** and the press enter when the Microsoft’s End user agreement appears. + +![Press tab to highlight the selection][7] + +Click **Yes** to accept the Microsoft’s agreement: + +![Use tab key to make a selection and then press enter][8] + +When the installation is done, you should update the font cache using the command below: + +``` +sudo fc-cache -f -v +``` + +![][9] + +If you open the LibreOffice now, you’ll see the Microsoft [TrueType fonts][10]. + +![][11] + +In case that you accidentally reject the license agreement, you can reinstall the installer with this command: + +``` +sudo apt install –reinstall ttf-mscorefonts-installer +``` + +Microsoft TrueType fonts are also available via the [Ubuntu Restricted Extras package][12] that contains other proprietary media codecs to play files like MP3 etc. + +Don’t underestimate proprietary fonts + +You may think what’s the big deal with fonts? After all, it’s just a font, not a crucial piece of software, right? +But did you know that for years, [Netflix paid millions of dollars for the proprietary font][13] it used? At the end, they created their own custom fonts and that saved them a considerable amount of money. + +I hope you find this quick tutorial useful. More productivity tutorials are down the line, leave your comments below and subscribe to our social media for more! + +![][14] + +### Dimitrios Savvopoulos + +Dimitrios is an MSc Mechanical Engineer but a Linux enthusiast in heart. He is well settled in Solus OS but curiosity drives him to constantly test other distros. Challenge is part of his personality and his hobby is to compete from 5k to the marathon distance. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-microsoft-fonts-ubuntu/ + +作者:[Community][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/itsfoss/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Times_New_Roman +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/microsoft-fonts-ubuntu.png?ssl=1 +[3]: https://en.wikipedia.org/wiki/Liberation_fonts +[4]: https://en.wikipedia.org/wiki/Red_Hat +[5]: https://itsfoss.com/install-fonts-ubuntu/ +[6]: https://itsfoss.com/ubuntu-repositories/ +[7]: https://i1.wp.com/i.imgur.com/JoEJp5w.png?ssl=1 +[8]: https://i0.wp.com/i.imgur.com/M8zTc7f.png?ssl=1 +[9]: https://i0.wp.com/i.imgur.com/Cshle6S.png?ssl=1 +[10]: https://en.wikipedia.org/wiki/TrueType +[11]: https://i1.wp.com/i.imgur.com/9oIu3oj.png?ssl=1 +[12]: https://itsfoss.com/install-media-codecs-ubuntu/ +[13]: https://thehustle.co/nextflix-sans-custom-font/ +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/Dimitrios.jpg?ssl=1 diff --git a/sources/tech/20200329 Nextcloud- The Swiss Army Knife of Remote Working Tools.md b/sources/tech/20200329 Nextcloud- The Swiss Army Knife of Remote Working Tools.md new file mode 100644 index 0000000000..82d84f984b --- /dev/null +++ b/sources/tech/20200329 Nextcloud- The Swiss Army Knife of Remote Working Tools.md @@ -0,0 +1,154 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Nextcloud: The Swiss Army Knife of Remote Working Tools) +[#]: via: (https://itsfoss.com/nextcloud/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Nextcloud: The Swiss Army Knife of Remote Working Tools +====== + +Remote working culture has been booming for past few years in coding, graphics and other IT related fields. But the recent [Coronavirus pandemic][1] has made it mandatory for the companies to work from home if it’s possible for them. + +While there are tons of tools to help you and your organization in working from home, let me share one open source software that has the features of several such tools combined into one. + +### Nextcloud Hub: A Suite of Essential Tools for Remote Collaboration + +[Nextcloud][2] is an open source software that can be used to store files, photos and videos for personal usage like Dropbox. But it’s more than just a private [cloud service][3]. + +You can add more than one users in Nextcloud and turn it into a collaboration platform for editing files in real time, chat with users, manage calendars, assign and manage tasks and more. + +This video gives a good overview of its main features: + +[Subscribe to our YouTube channel for more Linux videos][4] + +### Main Features of Nextcloud + +Let me highlight the main features of Nextcloud: + +#### Sync files and share + +![Nextcloud Files][5] + +You can create workspaces based on user groups and share files in those folders. Users can create private files and folders and share them with selected users internally or externally (if they are allowed to). You can lock files in read only mode as well. + +It also has a very powerful search feature that lets you search files from their name or tags. You can comment on files to provide feedback. + +Text files can be edited in real time thanks to its builtin markdown editor. You can use OnlyOffice or Collabora to allow editing of docs, spreadsheet and presentations in real time. + +It also has version control for the files so that you can revert changes easily. + +#### Text Chat, Audio Chat, Video Chat and Web Meetings + +![Nextcloud Video Call][6] + +With NextCloud Talk, you can interact with other users by text messaging, audio calls, video calls and group calls for web meetings. You can also take meeting minutes during the video calls and share your screen for presentations. There is also a mobile app to stay connected all the time. + +You can also create Slack like channels (known as circles) to communicate between members concerned with a specific topic. + +#### Calendar, Contacts & Mail + +![Calendar Nextcloud][7] + +You can manage all of your organization’s contact, divide them into groups based on departments. + +With the calendar, you can see when someone is free or what meetings are taking place, like you do on Outlook. + +You can also use the Mail feature and import the emails from other providers to use them inside Nextcloud interface. + +#### Kanban project management with Deck + +![][8] + +Like Trello and Jira, you can create boards for various projects. You can create cards for each tasks, assign them to users and they can move it between the list based on the status of the task. It’s really up to you how you create boards to manage your projects in Kanban style. + +#### Plenty of add-ons to get more out of Nextcloud + +![Password Manager][9] + +Nextcloud also has several add-ons (called apps). Some are developed by Nextcloud teams while some are from third-party developers. You may use them to extend the capability of Nextcloud. + +For example, you can add a [Feedly style feed reader][10] and read news from various sources. Similarly, the [Paswords addon][11] lets you use Netxcloud as a password manager. You can even share common passwords with other Nextcloud users. + +You can explore [all the apps on its website][12]. You’ll also notice the ratings of apps that will help you decide if you should use an app or not. + +#### Many more features + +Let me summarize all the features here: + + * Open source software that lets you own your data on your own servers + * Seamlessly edit office documents together with others + * Communicate with other members of your organization and do audio and video calls and held web meetings + * Calendar lets you book meetings, brings busy view for meetings and resource booking and more + * Manage users locally or authenticate through LDAP / Active Directory, Kerberos and Shibboleth / SAML 2.0 and more + * Secure data with powerful file access control, multi-layer encryption, machine-learning based authentication protection and advanced ransomware recovery capabilities + * Access existing storage silos like FTP, Windows Network Drives, SharePoint, Object Storage and Samba shares seamlessly through Nextcloud. + * Automation: Automatically turn documents in PDFs, send messages to chat rooms and more! + * Built in ONLYOFFICE makes collaborative editing of Microsoft Office documents accessible to everyone + * Users can install desktop and mobile apps or simply use it in web browser + + + +### How to get Nextcloud + +![][13] + +NextCloud is free and open source software. You can download it and install it on your own server. + +You can use cloud server providers like [Linode][14] or [DigitalOcean][15] that allow you to deploy a brand new Linux server within minutes. And then you can use Docker to install NextCloud. At It’s FOSS, we use [Linode][14] for our NextCloud instance. + +If you don’t want to do that, you can [signup with one of the Nextcloud partners][16] that provide you with configured Nextcloud instance. Some providers also provide a few GB of free data to try it. + +Nextcloud also has an [enterprise plan][17] where Nextcloud team itself handles everything for the users and provide premium support. You can check their pricing [here][18]. + +If you decide to use Nextcloud, you should refer to its documentation or community forum to explore all its features. + +### Conclusion + +At It’s FOSS, our entire team works remote. We have no centralized office anywhere and all of us work from our home. Initially we relied on non-open source tools like Slack, Google Drive etc but lately we are migrating to their open source alternatives. + +Nextcloud is one of the first software we tried internally. It has features of Dropbox, Google Docs, [Slack][19], [Trello][20], Google Hangout all combined in one software. + +NextCloud works for most part but we found it struggling with the video calls. I think that has to do with the fact that we have it installed on a server with 1 GB of RAM that also runs some other web services like [Ghost CMS][21]. We plan to move it to a server with better specs. We’ll see if that should address these issues. + +Since the entire world is struggling with the Coronavirus pandemic, using a solution like Nextcloud could be helpful for you and your organization in working from home. + +How are you coping during the Coronavirus lockdown? Like [Linus Torvalds’ advice on remote working][22], do you also have some suggestion to share with the rest of us? Please feel free to use the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/nextcloud/ + +作者:[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/2019%E2%80%9320_coronavirus_pandemic +[2]: https://nextcloud.com/ +[3]: https://itsfoss.com/cloud-services-linux/ +[4]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/nextcloud_files.png?ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/nextcloud_video_call.jpg?ssl=1 +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/calendar_nextcloud.jpeg?ssl=1 +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/nextcloud_kanban_project_management_app.jpeg?ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/passman.png?fit=800%2C389&ssl=1 +[10]: https://apps.nextcloud.com/apps/news +[11]: https://apps.nextcloud.com/apps/passwords +[12]: https://apps.nextcloud.com/ +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/nextcloud-feature.jpg?ssl=1 +[14]: https://www.linode.com/?r=19db9d1ce8c1c91023c7afef87a28ce8c8c067bd +[15]: https://m.do.co/c/d58840562553 +[16]: https://nextcloud.com/signup/ +[17]: https://nextcloud.com/enterprise/ +[18]: https://nextcloud.com/pricing/ +[19]: https://slack.com/ +[20]: https://trello.com/ +[21]: https://itsfoss.com/ghost-3-release/ +[22]: https://itsfoss.com/torvalds-remote-work-advice/ diff --git a/sources/tech/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md b/sources/tech/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md new file mode 100644 index 0000000000..17a04e4f91 --- /dev/null +++ b/sources/tech/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md @@ -0,0 +1,82 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Oracle Announces Java 14! How to Install it on Ubuntu Linux) +[#]: via: (https://itsfoss.com/java-14-ubuntu/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Oracle Announces Java 14! How to Install it on Ubuntu Linux +====== + +Recently, Oracle announced the general availability of Java 14 (or the Oracle JDK 14). If you are someone who wants to have the latest and greatest to experiment and develop stuff – you can try installing Java 14 on your Linux system. + +Oracle JDK 14 (or simply Java 14) [release][1] includes a couple of new features if you’re interested to preview them. I’ve linked them below: + + * [Pattern matching for instanceof][2] + * [Records][3] + * [Text Blocks][4] + + + +In addition to the preview features, it packs in several improvements and additions. Quoting the press release, they mentioned the additional improvements as well: + +> Additionally, the latest Java release adds Java language support for switch expressions, exposes new APIs for continuous monitoring of JDK Flight Recorder data, extends the availability of the low-latency Z Garbage Collector to macOS and Windows, and adds, in incubator modules, the packaging of self-contained Java applications and a new Foreign memory access API for safe, efficient access to memory outside of the Java heap. + +Of course, if you want to dive into the exact details, you should check the [official announcement][1]. + +In this tutorial, I’ll show you the easy way to get Java 14 installed on your Ubuntu system. Read on. + +**Note:** If you opt for Oracle Java 11 or above, you should learn about the new [Oracle Technology Network License Agreement][5] to know how it affects personal users, developers, and commercial organizations. Usually, these are free to use for development and testing – but not for production. + +### How To Install Java 14 on Ubuntu Linux? + +![][6] + +For reference, I’ve successfully tried it on **Pop!_OS 19.10** where I had the **OpenJDK 11** installed as the default. + +Here, we are going to use the Java 14 installer (originally based on WebUpd8 Java Package) by [Linux Uprising][7]. + +Simply enter the commands below in the terminal to get it installed: + +``` +sudo add-apt-repository ppa:linuxuprising/java +sudo apt update +sudo apt install oracle-java14-installer +``` + +This should do the job. And, when it’s done, if you want to make it the default, you can type in the following command to do it: + +``` +sudo apt install oracle-java14-set-default +``` + +It is worth noting that this is only for Ubuntu-based distributions. If you want to install it on Debian and other Linux distributions, you can follow [Linux Uprising’s detailed guide][7] on installing Java 14 as well. + +### Wrapping Up + +Of course, while this is about the bleeding edge features – if you do not want to break things, you might want to hold on to Java 11. If you want to experiment while knowing the risks, go ahead and give it a try! + +Feel free to let me know your thoughts on Java 14 in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/java-14-ubuntu/ + +作者:[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.oracle.com/corporate/pressrelease/oracle-announces-java14-031720.html +[2]: https://openjdk.java.net/jeps/305 +[3]: https://openjdk.java.net/jeps/359 +[4]: https://openjdk.java.net/jeps/368 +[5]: https://www.oracle.com/technetwork/java/javase/overview/oracle-jdk-faqs.html +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/install-java-14-ubuntu.png?ssl=1 +[7]: https://www.linuxuprising.com/2020/03/how-to-install-oracle-java-14-jdk14-on.html diff --git a/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md b/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md new file mode 100644 index 0000000000..e5eec51802 --- /dev/null +++ b/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md @@ -0,0 +1,183 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: 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/) + +The Keyring Concept in Ubuntu: What is It and How to Use it? +====== + +If you use [automatic login in Ubuntu][1] or other Linux distributions, you might have come across a pop-up message of this sort: + +**Enter password to unlock your login keyring +The login keyring did not get unlocked when you logged into your computer.** + +![Enter Password To Unlock Your Login Keyring Ubuntu][2] + +It keeps on popping up several times before disappearing if you keep on clicking cancel. You may wonder why do you keep seeing this keyring message all the time? + +Let me tell you something. It’s not an error. It’s a security feature. + +Surprised? Let me explain the keyring concept in Linux. + +### What is keyring in Linux and why is it used? + +![][3] + +Why do you use a keyring (also called [keychain][4]) in the real life? You use it to keep one or more keys grouped together so that they are easy to find and carry. + +It’s the same concept in Linux. The keyring feature allows your system to group various passwords together and keep it one place. + +Most desktop environments like GNOME, KDE, Xfce etc use an implementation of [gnome-keyring][5] to provide this keyring feature in Linux. + +This keyring keeps your ssh keys, GPG keys and keys from applications that use this feature, like Chromium browser. By default, the **keyring is locked with a master password** which is often the login password of the account. + +Every user on your system has its own keyring with (usually) the same password as that of the user account itself. When you login to your system with your password, your keyring is unlocked automatically with your account’s password. + +The problem comes when you [switch to auto-login in Ubuntu][1]. This means that you login to the system without entering the password. In such case, your keyring is not unlocked automatically. + +#### Keyring is a security feature + +Remember I told you that the keyring was a security feature? Now imagine that on your Linux desktop, you are using auto-login. Anyone with access to your desktop can enter the system without password but you have no issues with that perhaps because you use it to browse internet only. + +But if you use a browser like Chromium or [Google Chrome in Ubuntu][6], and use it to save your login-password for various websites, you have an issue on your hand. Anyone can use the browser and login to the websites for which you have saved password in your browser. That’s risky, isn’t it? + +This is why when you try to use Chrome, it will ask you to unlock the keyring repeatedly. This ensures that only the person who knows the keyring’s password (i.e. the account password) can use the saved password in browser for logging in to their respective websites. + +If you keep on cancelling the prompt for keyring unlock, it will eventually go away and let you use the browser. However, the saved password won’t be unlocked and you’ll see ‘sync paused’ in Chromium/Chrome browsers. + +![Sync paused in Google Chrome][7] + +#### If this keyring always exited, why you never saw it? + +That’s a valid question if you have never seen this keyring thing in your Linux system. + +If you never used automatic login (or changed your account’s password), you might not even have realized that this feature exists. + +This is because when you login to your system with your password, your keyring is unlocked automatically with your account’s password. + +Ubuntu (and other distributions) asks for password for common admin tasks like modifying users, installing new software etc irrespective of whether you auto login or not. But for regular tasks like using a browser, it doesn’t ask for password because keyring is already unlocked. + +When you switch to automatic login, you don’t enter the password for login anymore. This means that the keyring is not unlocked and hence when you try to use a browser which uses the keyring feature, it will ask to unlock the keyring. + +#### You can easily manage the keyring and passwords + +Where is this keyring located? At the core, it’s a daemon (a program that runs automatically in the background). + +Don’t worry. You don’t have to ‘fight the daemon’ in the terminal. Most desktop environments come with a graphical application that interacts with this daemon. On KDE, there is KDE Wallet, on GNOME and others, it’s called Password and Keys (originally known as [Seahorse][8]). + +![Password And Keys App in Ubuntu][9] + +You can use this GUI application to see what application use the keyring to manage/lock passwords. + +As you can see, my system has the login keyring which is automatically created. There is also a keyrings for storing GPG and SSH keys. The [Certificates][10] is for keeping the certificates (like HTTPS certificates) issued by a certificate authority. + +![Password and Keys application in Ubuntu][11] + +You can also use this application to manually store passwords for website. For example, I created a new password-protected keyring called ‘Test’ and stored a password in this keyring manually. + +This is slightly better than keeping a list of passwords in a text file. At least in this case your passwords can be viewed only when you unlock the keyring with password. + +![Saving New Password Seahorse][12] + +One potential problem here is that if you format your system, the manually saved passwords are definitely lost. Normally, you make backup of personal files, not of all the user specific data such as keyring files. + +There is way to handle that. The keyring data is usually stored in ~/.local/share/keyrings directory. You can see all the keyrings here but you cannot see its content directly. If you remove the password of the keyring (I’ll show the steps in later section of this article), you can read the content of the keyring like a regular text file. You can copy this unlocked keyring file entirely and import it in the Password and Keys application on some other Linux computer (running this application). + +So, let me summarize what you have learned so far: + + * Most Linux has this ‘keyring feature’ installed and activated by default + * Each user on a system has its own keyring + * The keyring is normally locked with the account’s password + * Keyring is unlocked automatically when you login with your password + * For auto-login, the keyring is not unlocked and hence you are asked to unlock it when you try to use an application that uses keyring + * Not all browsers or application use the keyring feature + * There is a GUI application installed to interact with keyring + * You can use the keyring to manually store passwords in encrypted format + * You can change the keyring password on your own + * You can export (by unlocking the keyring first) and import it on some other computer to get your manually saved passwords + + + +### Change keyring password + +Suppose you changed your account password. Now when you login, your system tries to unlock the keyring automatically using the new login password. But the keyring still uses the old login password. + +In such a case, you can change the keyring password to the new login password so that the keyring gets unlocked automatically as soon as you login to your system. + +Open the Password and Keys application from the menu: + +![Look for Password and Keys app in the menu][9] + +Now, right click on the Login keyring and click on Change Password: + +![Change Keyring Password][13] + +What if you don’t remember the old login password? + +You probably know that it is [easy to reset forgotten password in Ubuntu][14]. The problem comes with the keyring in such cases. You changed the account password but you don’t remember the old account password that is still used by the keyring. + +Now you cannot change it because you don’t know the old password. What to do now? + +In such a case, you’ll have to remove the entire keyring itself. You can do that from the Passwords and Keys application: + +![Delete Keyring Ubuntu][15] + +It will ask for your confirmation: + +![Delete Keyring][16] + +Alternatively, you may also manually delete the keyring files in ~/.local/share/keyrings directory. + +When the old keyring is removed and you try to use Chrome/Chromium, it will ask you to create new keyring. + +![New Keyring Password][17] + +You can use the new login password so that the keyring gets unlocked automatically. + +### Disable keyring password + +In cases where you want to use automatic login but don’t want to unlockk keyring manually, you may choose to disable the keyring with a workaround. Keep in mind that you are disabling a security feature so think twice before doing so. + +The process is similar to changing keyring password. Open Password and Keys application and go on to change the keyring password. + +The trick is that when it asks to change the password, don’t enter a new password and hit Continue instead. This will remove any password from the keyring. + +![Disable Keyring password by not setting any password at all][18] + +This way, the keyring will have no password and it remains unlocked all the time. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-keyring/ + +作者:[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/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 diff --git a/sources/tech/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md b/sources/tech/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md new file mode 100644 index 0000000000..3db70ec4e1 --- /dev/null +++ b/sources/tech/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen) +[#]: via: (https://itsfoss.com/kde-plasma-bigscreen/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen +====== + +_**Brief: KDE’s upcoming Plasma Bigscreen project lets you use open source technologies to turn your regular TV into a smart one.**_ + +Smart TVs are the new normal these days. Mostly based on Android, these smart TVs let you play YouTube, Netflix, Spotify and other streaming services. You can even use voice commands to control your smart TV. + +One major problem with these so-called [smart TVs are that they probably are spying on you][1]. Your data is being collected with or without your knowledge. + +This is the problem KDE’s [Plasma Bigscreen project][2] is aiming to solve. + +### Plasma Bigscreen: Make your TV smart with open source technologies + +![][3] + +You probably already know about the [KDE][4] project. It started as a Linux desktop environment project more than 20 years ago. The KDE project grew bigger and this is why they created Plasma desktop environment to make it clear that KDE is no more just “K Desktop Environment”. + +The Plasma project itself is quite versatile. You can of course use it on your desktop Linux computer. [Plasma also has a mobile version][5] that you can run on Linux-based smartphones like [Librem5][6] and [PinePhone][7]. + +The Plasma Bigscreen is a new project from KDE that aims to provide interface and features similar to what Smart TVs provide. + +All you need is a [single board computer like Raspberry Pi][8] and a TV with HDMI port. Install Plasma Bigscreen on your device and connect it to your TV. + +### Plasma Bigscreen features: More than just a media server + +![YouTube In Plasma Bigscreen][9] + +Though it may look like one at the first glance, but Plasma Bigscreen is not like Kodi and other [media servers for Linux][10]. It’s more than that. + +#### Control with your regular remote + +You don’t need a new specialized remote control. Thanks to [CEC][11], you can use your regular TV remote control. + +#### Voice control with open source Mycroft AI + +Plasma Bigscreen takes advantage of the open source Mycroft AI project. With Mycroft built in to Bigscreen, you can use voice command to play content, check weather and control other aspects of your smart TV. You can further train this AI by teaching it new skills. + +#### Traditional desktop applications + +Plasma Bigscreen delivers not only media-rich applications, but also traditional desktop applications redesigned to fit the Bigscreen experience. + +#### Free and open source software + +The most important feature is that it is an open source project and it uses other open source technologies to give you the complete control over your data and your smart TV. + +Since it is open source, I believe once it is released, there will be a few vendors providing it as a plug and play device. + +### How to get Plasma Bigscreen? + +Plasma Bigscreen is still in beta phase and there is no definite timeline for the stable release. + +However, the beta version is also working good on devices like Raspberry Pi 4. Here’s a video by one of the developers working on this project. + +[Subscribe to our YouTube channel for more Linux videos][12] + +If you have a Raspberry Pi 4, you can [download Plasma Bigscreen][13] beta version from its official download page and follow the steps [here][14] to install it. + +Personally, I am really excited about it. I am going to take out some time and try it on my [Raspberry Pi 4][15]. What about you? Do you think the project has potential? Will you give it a try? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/kde-plasma-bigscreen/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://www.zdnet.com/article/fbi-warns-about-snoopy-smart-tvs-spying-on-you/ +[2]: https://plasma-bigscreen.org/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/plasma-bigscreen-menu.jpg?ssl=1 +[4]: https://kde.org/ +[5]: https://itsfoss.com/kde-announces-plasma-mobile/ +[6]: https://itsfoss.com/librem-linux-phone/ +[7]: https://itsfoss.com/pinephone/ +[8]: https://itsfoss.com/raspberry-pi-alternatives/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/youtube-in-plasma-bigscreen.jpg?ssl=1 +[10]: https://itsfoss.com/best-linux-media-server/ +[11]: http://libcec.pulse-eight.com/ +[12]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[13]: https://plasma-bigscreen.org/#download-jumpto +[14]: https://plasma-bigscreen.org/manual/ +[15]: https://itsfoss.com/raspberry-pi-4/ diff --git a/translated/talk/20190822 How the Linux desktop has grown.md b/translated/talk/20190822 How the Linux desktop has grown.md new file mode 100644 index 0000000000..faa1bbac3e --- /dev/null +++ b/translated/talk/20190822 How the Linux desktop has grown.md @@ -0,0 +1,184 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How the Linux desktop has grown) +[#]: via: (https://opensource.com/article/19/8/how-linux-desktop-grown) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) + +Linux 桌面史话 +====== +> 自 1990 年代初以来,Linux 桌面已从简单的窗口管理器发展为完整的桌面。与我们一起来探索 Linux 桌面的历史。 + +![Person typing on a 1980's computer][1] + +我首次安装 Linux 是 1993 年。那时,安装这种操作系统没有太多的选择。早期,许多人只是从别人那里复制一个正在运行的镜像。然后有人想到了一个精巧的主意,创建一个 Linux 的“发行版”,使你可以自定义要安装的软件。那就是 Softlanding Linux 系统(SLS),也是我首次见到了 Linux。 + +我的 386 PC 虽然内存不多,但也足够了。SLS 1.03 需要 2MB 的内存才能运行,如果要编译程序,则需要 4MB 的内存。如果要运行 X Window 系统,则需要多达 8MB 的内存!而我的电脑正好有足够的内存来运行 X Window 系统。 + +因为我是在命令行中成长的,图形用户界面对我来说并不是必不可少的。但它确实很方便。我可以在不同的窗口中运行应用程序,并轻松地在任务之间切换。 + +从我首次体验 Linux 开始,我就迷上了它。从那以后,我一直在台式机上使用 Linux。和许多人一样,我在双引导配置下运行 Linux 已有一段时间,因此我可以跳回到 MS-DOS 和 Windows 来运行某些程序。直到 1998 年,我终于冒了个险,全面投身于 Linux 之中。 + +在过去的 26 年中,我目睹了 Linux 桌面的成熟。在那段时间里,我还尝试了一种有趣的桌面环境组合,我会在下面通过 Linux 桌面的历史之旅分享它。 + +### X 和窗口管理器 + +Linux 上的第一个“桌面”其实不是桌面。相反,它们是运行在 X Window 系统上的“窗口管理器window manager”(WM)。X 提供了图形用户界面的基本组件,如在屏幕上创建窗口以及提供键盘和鼠标输入。就其本身而言,X 并没有做太多事情。为了使 X 图形环境能够用起来,你需要一种方法来管理会话中的所有窗口。这就出现了窗口管理器window manager。运行 xterm 或 xclock 之类的 X 程序会在一个窗口中打开该程序。窗口管理器会跟踪窗口并进行基本的内部管理,例如让你可以来回移动窗口并将其最小化。其余的事情取决于你自己。你可以通过将程序名列在 `~/ .xinitrc` 文件中以在 X 开始时启动这些程序,但是通常,你会从 xterm 中运行新程序。 + +在 1993 年,最常见的窗口管理器是 TWM,它的历史可以追溯到 1988 年。TWM 极其简单,仅仅提供了基本的窗口管理功能。 + +![TWM on SLS 1.05][2] + +*SLS 1.05 上的 TWM,显示了 xterm、xclock 和 Emacs 编辑器* + +另一个早期的窗口管理器是 OpenLook 虚拟窗口管理器(OLVWM)。OpenLook 是 Sun 微系统公司在 1980 年代开发的图形用户界面,后来又移植到其他 Unix 平台。作为一个*虚拟*窗口管理器,OLVWM 支持多个工作区。 + +![OLVWM on SLS 1.05][3] + +*SLS 1.05 上的 OLVWM,显示了 xterm 和虚拟工作区选择器* + +当 Linux 开始流行时,没多久就有人创建出具有更流畅性能和改进界面的新的窗口管理器。这些新的窗口管理器中首先出现的是虚拟窗口管理器 FVWM。FVWM 比 TWM 或 OLVWM 更具现代感。但是,我们仍然没有桌面。 + +![FVWM on SLS 1.05][4] + +*SLS 1.05 上的 FVWM,显示了 xterm 和文件管理器* + +以现代的眼光来看,TWM 和 FVWM 可能看起来很普通。但重要的是要想想当时其它图形环境的外观。 Windows 当时的版本看起来也相当简单。Windows 版本 1 到版本 3 使用了一个称为“程序管理器”的普通启动器。 + +![Windows 3.11][5] + +*Windows 3.11,显示程序管理器和记事本编辑器* + +1995 年 8 月,微软发布了 Windows 95,改变了现代 PC 桌面的格局。当然,我对此印象深刻。我觉得 Windows 3.x 笨拙而丑陋,但 Windows 95 却流畅而漂亮。更重要的是,我们现在将 Windows 95 视为“ **桌面**”。新的“桌面”隐喻是向前迈出的一大步。你可以在桌面上放置图标——实际上,Windows 95 提供了两个默认的桌面图标,分别是“我的电脑”(用于打开文件管理器)和“回收站”(用于放置以后要删除的文件)。 + +但是,更重要的是,Windows 95 桌面的意味着*集成*。程序管理器不见了,取而代之的是屏幕底部的任务栏,可让你使用更简单的“开始”菜单启动新程序。任务栏是多功能的,还通过一系列的按钮显示了你正在运行的程序,而托盘显示了时间、扬声器音量和其它简单的控件。你可以在这个新桌面上右键单击任何对象, Windows 95 会为你提供一个上下文相关的菜单,其中包含你可以执行的操作。 + +![Windows 95][6] + +*Windows 95,显示了记事本编辑器* + +与以前版本的 Windows 甚至其它 Linux 窗口管理器相比,Windows 95 的界面更加流畅并且易于使用。值得一提的是,Linux 开发人员创建了一个模仿 Windows 95 界面的 FVWM 的新版本。名为 FVWM95 的新窗口管理器仍然不是桌面,但看起来非常漂亮。新的任务栏使你可以使用“开始”菜单启动新的 X 程序。任务栏还使用类似于 Windows 95 的按钮显示了正在运行的程序。 + +![FVWM95 on Red Hat Linux 5.2][7] + +*在 Red Hat Linux 5.2 上的 FVWM95,显示了 xterm 和一个带有 xterm 图标、文件管理器和其他程序的快速访问程序启动器* + +在 FVWM95 和其他窗口管理器还在改进的同时,核心问题仍然存在:Linux 并没有真正的桌面。它具有一堆窗口管理器,仅此而已。使用图形用户界面的 Linux 应用程序(基本上意味着它们是 X 应用程序)看起来形态各异且工作方式也不同。除了 X Window 系统提供的简单的纯文本复制/粘贴功能外,你无法从一个应用程序复制和粘贴到另一个应用程序里。Linux 真正需要的是在其图形用户界面中完全重新打造以创建它的第一个桌面。 + +### Linux 桌面之初啼 + +在 1996 年,Matthias Ettrich 感于 X 之下 Linux 应用程序体验不一致的困扰。他想使找个图形环境更易于使用,而且更重要的是,他想使所有东西都像实际的桌面一样“集成”在一起。 + +Matthias 开始研究K 桌面环境K Desktop Environment(KDE)。那个 K 代表着 “Kool”(LCTT 译注:即 Cool)。但是 KDE 这个名字也意味着可以在通用桌面环境Common Desktop Environment(CDE)上发挥作用,而通用桌面环境是“大 Unix”世界的标准。尽管到了 1996 年,CDE 看起来已经有点过时了。CDE 基于 Motif 部件集,这与 FVWM 模仿的设计相同。KDE 1.0 于 1998 年 7 月完成,是对 FVWM95 等普通窗口管理器的绝对改进。 + +![KDE 1.0][8] + +*K 桌面环境(KDE)版本 1.0。图片来源:Paul Brown / KDE* + +KDE 是 Linux 向前迈出的一大步。最终,Linux 有了一个具有应用程序集成和更现代的桌面图标的真正的桌面。KDE 的设计与 Windows 95 并无不同。屏幕底部有一个任务栏,它提供与 Windows 95 的“开始”菜单等效的功能以及一些应用程序快捷方式。KDE 还支持虚拟桌面,它们被巧妙地标记为 “One”、“ Two”、“Three” 和 “Four”。而正在运行的应用程序则通过屏幕顶部单独的任务栏中的按钮表示。 + +但是并不是每个人都对 KDE 感到满意。为了从系统中抽象出 GUI 来,KDE 使用了 Trolltech 的 Qt 工具套件库。不幸的是,Qt 并不是以自由软件的许可证进行分发的。Trolltech 允许 Qt 免费在自由软件应用程序中使用,但在商业或专有应用程序中要收取使用费。而且这种二分法与自由软件不符。这给 Linux 发行版带来了问题:它们应该包括 KDE 吗?还是默认使用较旧而属于自由软件的图形用户界面(例如 FVWM)? + +面对这种情况,Miguel de Icaza 和 Federico Mena 于 1997 年开始开发新的 Linux 桌面上。这个新项目被称为 GNOME,即GNU 网络对象模型环境GNU Network Object Model Environment的缩写。GNOME 旨在成为完全自由的软件,并使用了来自 GIMP 图像编辑器中的另一种工具套件(称为 GTK)。 GTK 从字面上代表 GIMP 工具套件GIMP Tool Kit。当 GNOME 1.0 最终于 1999 年发布时,Linux 有了另一个现代化的桌面环境。 + +![GNOME 1.0][9] + +*GNOME 1.0 版。图片来源:GNOME 文档项目* + +有两个 Linux 桌面环境固然很棒,但“KDE 与 GNOME”之争仍持续了一段时间。到 1999 年,Trolltech 以新的公共许可证 Q 公共许可证Q Public License(QPL)重新发布了 Qt 库。但是,新许可证有其自己的包袱—-QPL 仅适用于 Qt 在开源软件项目中的使用,而不适用于商业项目。因此,自由软件基金会Free Software Foundation(FSF)认为 QPL 与 GNU 通用公共许可证GNU General Public License(GNU GPL)[不兼容][10]。在 Trolltech 在 2000 年根据 GNU GPL v2 重新发布 Qt 库之前,这个许可证问题一直存在。 + +### 随着时间的发展 + +Linux 桌面继续成熟。KDE 和 GNOME 进行了一场友好的竞争,不仅增加了新功能,还互相交流了思想和观念。到 2004 年,GNOME 和 KDE 都取得了长足的进步,但用户界面只是在原有基础上添加了一些变化。 + +KDE 2 和 3 继续依赖屏幕底部的任务栏概念,但并入了用于运行应用程序的按钮。KDE 最明显的变化之一是添加了 Konqueror 浏览器,该浏览器首次出现在 KDE 2 中。 + +![KDE 2.2.2 \(2001\) showing the Konqueror browser][11] + +*KDE 2.2.2(2001),显示了 Konqueror 浏览器。图片来源:Paul Brown / KDE* + +![KDE 3.2.2][12] + +*Fedora Core 2 上的 KDE 3.2.2(2004),显示了 Konqueror 文件管理器(使用 Fedora Core 2 主题)* + +GNOME 2 还使用了任务栏概念,但将其分为两个部分:位于屏幕顶部的任务栏以启动应用程序并响应桌面警报,以及位于页面底部的任务栏以显示正在运行的应用程序。我自己将这两个任务栏称之为“你可以做的事情”(顶部)和“你正在做的事情”(底部)。除了精简的用户界面外,GNOME 还添加了由 Eazel 开发的名为 Nautilus 的更新文件管理器。 + +![GNOME 2.6.0][13] + +*Fedora Core 2 上的 GNOME 2.6.0(2004),显示了 Nautilus 文件管理器(使用 Fedora Core 2 主题)* + +随着时间的流逝,KDE 和 GNOME 走了不同的路径。两者都提供了功能丰富、健壮且现代化的桌面环境,但是却具有不同的用户界面目标。2011 年,GNOME 和 KDE 处理桌面界面的方式之间存在重大偏差。KDE 4.6(2011 年 1 月)和 KDE 4.7(2011 年 7 月)提供了更传统的桌面感受,同时继续根植于许多用户熟悉的任务栏概念。当然,可以看到 KDE 发生很多变化,但是它仍然保留了熟悉的外观。 + +![KDE 4.6][14] + +*KDE 4.6,显示 Gwenview 图像查看器。图片来源:KDE* + +2011 年,GNOME 通过新的桌面概念彻底改变了走向。GNOME 3 旨在创建一个更简单、更精简的桌面体验,使用户可以专注于自己的工作。任务栏消失了,取而代之的是屏幕顶部的黑色状态栏,其中包括音量和网络控件,显示了时间和电池状态,并允许用户通过重新设计过的菜单启动新程序。 + +菜单的变化最具最戏剧性。单击“活动”菜单或将鼠标移到“活动”的“热角”,会将所有打开的应用程序显示为单独的窗口。用户还可以从概述中单击“应用程序”选项卡以启动新程序。“概述”还提供了内部集成的搜索功能。 + +![GNOME 3.0][15] + +*GNOME 3.0,显示 GNOME 图片应用程序。图片来源:GNOME* + +![GNOME 3.0][16] + +*GNOME 3.0,显示活动概述。图片来源:GNOME* + +### 你的桌面之选 + +拥有两个 Linux 桌面意味着用户有很多选择。有些人喜欢 KDE,而另一些人喜欢 GNOME。没关系,选择最适合你的桌面就行。 + +可以肯定的是,KDE 和 GNOME 都有拥护者和批评者。例如,GNOME 放弃任务栏以支持“活动概述”而受到了很多批评。也许最著名的批评家是 Linus Torvalds,他在 2011 年[大声斥责并抛弃了][17]新的 GNOME,将其视为“邪恶的烂摊子”,然后在两年后[回到了][18] GNOME。 + +其他人也对 GNOME 3 提出了类似的批评,以至于一些开发人员复刻 GNOME 2 的源代码来创建 MATE 桌面。MATE(是MATE 高级传统环境MATE Advanced Traditional Environment的递归缩写)延续了 GNOME 2 的传统任务栏界面。 + +无论如何,毫无疑问当今两个最受欢迎的 Linux 桌面是 KDE 和 GNOME。它们的当前版本非常成熟,并且具有很多功能。 KDE 5.16(2019)和 GNOME 3.32(2019)都试图简化和精简 Linux 桌面体验,但是方式有所不同。GNOME 3.32 继续致力于极简外观,删除所有分散用户注意力的用户界面元素,以便用户可以专注于其应用程序和工作。 KDE 5.16 在任务栏上采用了更为熟悉的方法,但是增加了其他视觉上的改进和特质,尤其是围绕改进的小部件处理和图标。 + +![KDE 5.16 Plasma][19] + +*KDE 5.16 Plasma。图片来源:KDE* + +![GNOME 3.32][20] + +*GNOME 3.32。图片来源:GNOME* + +同时,你也不会完全失去它们之间的兼容性。每个主要的 Linux 发行版都提供兼容性库,因此你可以在运行 GNOME 时从 KDE 运行应用程序。在当你实际要使用的应用程序是为其他桌面环境编写的时候,这非常有用。 你可以在 GNOME 上运行 KDE 应用程序,反之亦然。 + +我认为这种态势不会很快改变,这是一件好事。KDE 和 GNOME 之间的良性竞争使这两个阵营的开发人员都可以避免故步自封。无论你使用 KDE 还是 GNOME,你都将拥有一个集成度很高的现代化桌面。最重要的是,这意味着 Linux 拥有自由软件的最佳特性:选择。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/8/how-linux-desktop-grown + +作者:[Jim Hall][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/jim-hallhttps://opensource.com/users/jason-bakerhttps://opensource.com/users/jlacroixhttps://opensource.com/users/doni08521059https://opensource.com/users/etc-eterahttps://opensource.com/users/marcobravohttps://opensource.com/users/alanfdoss +[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://opensource.com/sites/default/files/uploads/twm-sls105.png (TWM on SLS 1.05) +[3]: https://opensource.com/sites/default/files/uploads/olvwm-sls105.png (OLVWM on SLS 1.05) +[4]: https://opensource.com/sites/default/files/uploads/fvwm-sls105.png (FVWM on SLS 1.05) +[5]: https://opensource.com/sites/default/files/uploads/win311.png (Windows 3.11) +[6]: https://opensource.com/sites/default/files/uploads/win95.png (Windows 95) +[7]: https://opensource.com/sites/default/files/uploads/fvwm95-rh52.png (FVWM95 on Red Hat Linux 5.2) +[8]: https://opensource.com/sites/default/files/uploads/kde1.png (KDE 1.0) +[9]: https://opensource.com/sites/default/files/uploads/gnome10.png (GNOME 1.0) +[10]: https://www.linuxtoday.com/developer/2000090500121OPLFKE +[11]: https://opensource.com/sites/default/files/uploads/kde_2.2.2.png (KDE 2.2.2 (2001) showing the Konqueror browser) +[12]: https://opensource.com/sites/default/files/uploads/kde322-fc2.png (KDE 3.2.2) +[13]: https://opensource.com/sites/default/files/uploads/gnome26-fc2.png (GNOME 2.6.0) +[14]: https://opensource.com/sites/default/files/uploads/kde46.png (KDE 4.6) +[15]: https://opensource.com/sites/default/files/uploads/gnome30.png (GNOME 3.0) +[16]: https://opensource.com/sites/default/files/uploads/gnome30-overview.png (GNOME 3.0) +[17]: https://www.theregister.co.uk/2011/08/05/linus_slams_gnome_three/ +[18]: https://www.phoronix.com/scan.php?page=news_item&px=MTMxNjc +[19]: https://opensource.com/sites/default/files/uploads/kde516.png (KDE 5.16 Plasma) +[20]: https://opensource.com/sites/default/files/uploads/gnome332.png (GNOME 3.32) diff --git a/translated/talk/20200225 7 tips for writing an effective technical resume.md b/translated/talk/20200225 7 tips for writing an effective technical resume.md deleted file mode 100644 index 20f7edf8f1..0000000000 --- a/translated/talk/20200225 7 tips for writing an effective technical resume.md +++ /dev/null @@ -1,71 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Morisun029) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (7 tips for writing an effective technical resume) -[#]: via: (https://opensource.com/article/20/2/technical-resume-writing) -[#]: author: (Emily Brand https://opensource.com/users/emily-brand) - -撰写有效技术简历的7个技巧 -====== -遵循以下这些要点,把自己最好的一面呈现给潜在雇主。 -![Two hands holding a resume with computer, clock, and desk chair ][1] - -如果你是一名软件工程师或技术领域的经理,那么创建或更新简历可能是一项艰巨的任务。 要考虑的重点是什么? 应该怎么处理格式,内容以及目标或摘要? 哪些工作经验相关? 如何确保自动招聘工具不会过滤掉你的简历? - -在过去的七年中,作为一名招聘经理,我看到了各种各样的简历; 尽管有些令人印象深刻,但还有很多人写的很糟糕。 - -在编写或更新简历时,请遵循以下七个简单原则。 - -### 1\. 概述 - -简历顶部的简短段落应简洁明了,目的明确,避免过多使用形容词和副词。 诸如“令人印象深刻”,“广泛”和“优秀”之类的词,这些词不会增加你的招聘机会; 相反,它们看起来和感觉上像是过度使用的填充词。 关于你的目标,问自己一个重要的问题: **它是否告诉招聘经理我正在寻找什么样的工作以及如何为他们提供价值?** 如果不是,请加强并简化它以回答该问题,或者将其完全排除在外。 - -### 2\. 工作经验 - -数字,数字,数字。 用事实传达观点远比一般的陈述,例如“帮助构建,管理,交付许多对客户利润有贡献的项目” 更能对你有帮助。 你的表达中应包括统计数据,例如“直接影响了五个顶级银行的项目,这些项目将其上市时间缩短了40%”,你提交了多少行代码或管理了几个团队。 数据比修饰语更能有效地展示你的能力和价值。 - -如果你经验不足,没有什么工作经验可展示,那无关的经验,如暑期兼职工作,就不要写了。 相反,将相关经验的细节以及你所学到的知识的详细信息写进简历,这些可以使你成为一个更好的候选人。 - -### 3\. 搜索术语和行话 - -随着技术在招聘过程中发挥如此巨大的作用,确保简历被标记为正确的职位非常重要,但不要在简历上过分吹嘘自己。 如果你提到敏捷技能但不知道看板是什么,请三思。 如果你提到自己精通Java,但是已经有五年都没有使用过Java了,请小心。 如果存在你熟悉但不一定是最新的语言和框架,请创建其他类别或将你的经验分为“精通”和“熟悉”。 - -### 4\. 教育 - -如果你不是应届大学毕业生,那就没必要再写你的GPA或你参加过的俱乐部或兄弟会,除非你计划将它们用作谈话要点以在面试中赢得信任。 确保你发表的或获取过专利的东西包括在内,即使与你的工作无关。 如果你没有大学学位,请添加一个证书部分代替教育背景部分。 如果你是军人,请包括现役和预备时间。 - -### 5\. 资质证书 - -除非你想重新进入之前离开的领域,否则不要写过期的证书,例如,如果你曾经是一名人事经理,而现在正寻求动手编程的工作。 如果你拥有与该领域不再相关的认证,就不要写这些认证,因为这些可能会分散招聘者的注意力,使你的简历失去吸引力。 利用你的 LinkedIn 个人资料为简历添加更多色彩,因为大多数人在面试之前都会阅读你的简历和 LinkedIn 个人资料。 - -### 6\. 拼写和语法 - - -让其他人对你的简历进行校对。 很多时候,我在简历中看到拼写错误的单词,或者错误用词,如“他们的”、“他们是”、“那些”。 这些可以避免和修复的错误会产生负面影响。 理想情况下,你的简历应用主动语态,但是如果这样会使你感到不舒服,那么就用过去时书写-最重要的是要始终保持一致。 不正确的拼写和语法会传递你要么不是很在乎所申请的工作,要么没有足够注意细节。 - -### 7\. 格式 - -确保你的简历是最新的并且富有吸引力,这是留下良好第一印象的简便方法。 确保格式一致,例如相同的页边距,相同的间距,大写字母和颜色(将调色板保持在最低水平)是简历写作中最基本的部分,但有必要表明你对工作感到豪感,并重视自己的价值和未来的雇主。 在适当的地方使用表格,以视觉吸引人的方式分配信息。 如果有给定模板,以 .pdf 和 .docx 格式上传简历,然后用 Google Docs 导出为 .odt 格式,这样可以在 LibreOffice 中轻松打开。 这是我推荐的简单的 Google 文档简历模板。 你还可以支付少量费用(不到10美元)从一些设计公司购买。 - -### 定期更新 - -如果你被要求(或希望)申请一份工作,定期更新简历可以最大程度地减少压力,也可以帮助你创建和维护更准确的简历版本。 撰写简历时,要有远见,确保至少让其他三个人对你的简历内容,拼写和语法进行检查。 即使你是由公司招募或其他人推荐给公司的,面试官也可能仅通过简历认识你,因此请确保它为你带来良好的第一印象。 - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/technical-resume-writing - -作者:[Emily Brand][a] -选题:[lujun9972][b] -译者:[Morisun029](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/emily-brand -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/resume_career_document_general.png?itok=JEaFL2XI (Two hands holding a resume with computer, clock, and desk chair ) -[2]: https://docs.google.com/document/d/1ARVyybC5qQEiCzUOLElwAdPpKOK0Qf88srr682eHdCQ/edit diff --git a/sources/tech/20180708 Building a Messenger App- Conversations.md b/translated/tech/20180708 Building a Messenger App- Conversations.md similarity index 62% rename from sources/tech/20180708 Building a Messenger App- Conversations.md rename to translated/tech/20180708 Building a Messenger App- Conversations.md index 1a5c7d251a..8ab0e2c083 100644 --- a/sources/tech/20180708 Building a Messenger App- Conversations.md +++ b/translated/tech/20180708 Building a Messenger App- Conversations.md @@ -7,35 +7,33 @@ [#]: via: (https://nicolasparada.netlify.com/posts/go-messenger-conversations/) [#]: author: (Nicolás Parada https://nicolasparada.netlify.com/) -Building a Messenger App: Conversations +构建一个即时消息应用(三):对话 ====== -This post is the 3rd in a series: +本文是该系列的第三篇。 - * [Part 1: Schema][1] - * [Part 2: OAuth][2] +* [第一篇:模式][1] +* [第二篇:OAuth][2] +在我们的即时消息应用中,消息表现为两个参与者对话的堆叠。如果你想要开始异常对话,就应该向应用提供你想要交谈的用户,而当对话创建后(如果该对话此前并不存在),就可以向该对话发送消息。 +就前端而言,我们可能想要显示一份近期对话列表。并在此处显示对话的最后一条消息以及另一个参与者的姓名和头像。 -In our messenger app, messages are stacked by conversations between two participants. You start a conversation providing the user you want to chat with, the conversations is created (if not exists already) and you can start sending messages to that conversations. +在这篇帖子中,我们将会编写一些端点(endpoints)来完成像「创建对话」、「获取对话列表」以及「找到单个对话」这样的任务。 -On the front-end we’re interested in showing a list of the lastest conversations. There we’ll show the last message of it and the name and avatar of the other participant. +首先,要在主函数 `main()` 中添加下面的路由。 -In this post, we’ll code the endpoints to start a conversation, list the latest and find a single one. - -Inside the `main()` function add this routes. - -``` +```go router.HandleFunc("POST", "/api/conversations", requireJSON(guard(createConversation))) router.HandleFunc("GET", "/api/conversations", guard(getConversations)) router.HandleFunc("GET", "/api/conversations/:conversationID", guard(getConversation)) ``` -These three endpoints require authentication so we use the `guard()` middleware. There is a new middleware that checks for the request content type JSON. +这三个端点都需要进行身份验证,所以我们将会使用 `guard()` 中间件。我们也会构建一个新的中间件,用于检查请求内容是否为 JSON 格式。 -### Require JSON Middleware +### JSON 请求检查中间件 -``` +```go func requireJSON(handler http.HandlerFunc) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { if ct := r.Header.Get("Content-Type"); !strings.HasPrefix(ct, "application/json") { @@ -47,11 +45,11 @@ func requireJSON(handler http.HandlerFunc) http.HandlerFunc { } ``` -If the request isn’t JSON, it responds with a `415 Unsupported Media Type` error. +如果请求(request)不是 JSON 格式,那么它会返回 `415 Unsupported Media Type`(不支持的媒体类型)错误。 -### Create Conversation +### 创建对话 -``` +```go type Conversation struct { ID string `json:"id"` OtherParticipant *User `json:"otherParticipant"` @@ -60,9 +58,9 @@ type Conversation struct { } ``` -So, a conversation holds a reference to the other participant and the last message. Also has a bool field to tell if it has unread messages. +就像上面的代码那样,对话中保持对另一个参与者和最后一条消息的引用,还有一个 bool 类型的字段,用来告知是否有未读消息。 -``` +```go type Message struct { ID string `json:"id"` Content string `json:"content"` @@ -74,11 +72,11 @@ type Message struct { } ``` -Messages are for the next post, but I define the struct now since we are using it. Most of the fields are the same as the database table. We have `Mine` to tell if the message is owned by the current authenticated user and `ReceiverID` will be used to filter messanges once we add realtime capabilities. +我们会在下一篇文章介绍与消息相关的内容,但由于我们这里也需要用到它,所以先定义了 `Message` 结构体。其中大多数字段与数据库表一致。我们需要使用 `Mine` 来断定消息是否属于当前已验证用户所有。一旦加入实时功能,`ReceiverID` 可以帮助我们过滤消息。 -Lets write the HTTP handler then. It’s quite long but don’t be scared. +接下来让我们编写 HTTP 处理程序。尽管它有些长,但也没什么好怕的。 -``` +```go func createConversation(w http.ResponseWriter, r *http.Request) { var input struct { Username string `json:"username"` @@ -170,19 +168,19 @@ func createConversation(w http.ResponseWriter, r *http.Request) { } ``` -For this endpoint you do a POST request to `/api/conversations` with a JSON body containing the username of the user you want to chat with. +在此端点,你会向 `/api/conversations` 发送 POST 请求,请求的 JSON 主体中包含要对话的用户的用户名。 -So first it decodes the request body into an struct with the username. Then it validates that the username is not empty. +因此,首先需要将请求主体解析成包含用户名的结构。然后,校验用户名不能为空。 -``` +```go type Errors struct { Errors map[string]string `json:"errors"` } ``` -This is the `Errors` struct. It’s just a map. If you enter an empty username you get this JSON with a `422 Unprocessable Entity` error. +这是错误消息的结构体 `Errors`,它仅仅是一个映射。如果输入空用户名,你就会得到一段带有 `422 Unprocessable Entity`(无法处理的实体)错误消息的 JSON 。 -``` +```json { "errors": { "username": "Username required" @@ -190,17 +188,17 @@ This is the `Errors` struct. It’s just a map. If you enter an empty username y } ``` -Then, we begin an SQL transaction. We only received an username, but we need the actual user ID. So the first part of the transaction is to query for the id and avatar of that user (the other participant). If the user is not found, we respond with a `404 Not Found` error. Also, if the user happens to be the same as the current authenticated user, we respond with `403 Forbidden`. There should be two different users, not the same. +然后,我们开始执行 SQL 事务。收到的仅仅是用户名,但事实上,我们需要知道实际的用户 ID 。因此,事务的第一项内容是查询另一个参与者的 ID 和头像。如果找不到该用户,我们将会返回 `404 Not Found`(未找到) 错误。另外,如果找到的用户恰好和「当前已验证用户」相同,我们应该返回 `403 Forbidden`(拒绝处理)错误。这是由于对话只应当在两个不同的用户之间发起,而不能是同一个。 -Then, we try to find a conversation those two users have in common. We use `INTERSECT` for that. If there is one, we redirect to that conversation `/api/conversations/{conversationID}` and return there. +然后,我们试图找到这两个用户所共有的对话,所以需要使用 `INTERSECT` 语句。如果存在,只需要通过 `/api/conversations/{conversationID}` 重定向到该对话并将其返回。 -If no common conversation was found, we continue by creating a new one and adding the two participants. Finally, we `COMMIT` the transaction and respond with the newly created conversation. +如果未找到共有的对话,我们需要创建一个新的对话并添加指定的两个参与者。最后,我们 `COMMIT` 该事务并使用新创建的对话进行响应。 -### Get Conversations +### 获取对话列表 -This endpoint `/api/conversations` is to get all the conversations of the current authenticated user. +端点 `/api/conversations` 将获取当前已验证用户的所有对话。 -``` +```go func getConversations(w http.ResponseWriter, r *http.Request) { ctx := r.Context() authUserID := ctx.Value(keyAuthUserID).(string) @@ -267,17 +265,17 @@ func getConversations(w http.ResponseWriter, r *http.Request) { } ``` -This handler just does a query to the database. It queries to the conversations table with some joins… First, to the messages table to get the last message. Then to the participants, but it adds a condition to a participant whose ID is not the one of the current authenticated user; this is the other participant. Then it joins to the users table to get his username and avatar. And finally joins with the participants again but with the contrary condition, so this participant is the current authenticated user. We compare `messages_read_at` with the message `created_at` to know whether the conversation has unread messages. And we use the message `user_id` to check if it’s “mine” or not. +该处理程序仅对数据库进行查询。它通过一些联接来查询对话表……首先,从消息表中获取最后一条消息。然后依据「ID 与当前已验证用户不同」的条件,从参与者表找到对话的另一个参与者。然后联接到用户表以获取该用户的用户名和头像。最后,再次联接参与者表,并以相反的条件从该表中找出参与对话的另一个用户,其实就是当前已验证用户。我们会对比消息中的 `messages_read_at` 和 `created_at` 两个字段,以确定对话中是否存在未读消息。然后,我们通过 `user_id` 字段来判定该消息是否属于「我」(指当前已验证用户)。 -Note that this query assumes that a conversation has just two users. It only works for that scenario. Also, if you want to show a count of the unread messages, this design isn’t good. I think you could add a `unread_messages_count` `INT` field on the `participants` table and increment it each time a new message is created and reset it when the user read them. +注意,此查询过程假定对话中只有两个用户参与,它也仅仅适用于这种情况。另外,该设计也不很适用于需要显示未读消息数量的情况。如果需要显示未读消息的数量,我认为可以在 `participants` 表上添加一个`unread_messages_count` `INT` 字段,并在每次创建新消息的时候递增它,如果用户已读则重置该字段。 -Then it iterates over the rows, scan each one to make an slice of conversations and respond with those at the end. +接下来需要遍历每一条记录,通过扫描每一个存在的对话来建立一个对话切片(an slice of conversations)并在最后进行响应。 -### Get Conversation +### 找到单个对话 -This endpoint `/api/conversations/{conversationID}` respond with a single conversation by its ID. +端点 `/api/conversations/{conversationID}` 会根据 ID 对单个对话进行响应。 -``` +```go func getConversation(w http.ResponseWriter, r *http.Request) { ctx := r.Context() authUserID := ctx.Value(keyAuthUserID).(string) @@ -321,15 +319,15 @@ func getConversation(w http.ResponseWriter, r *http.Request) { } ``` -The query is quite similar. We’re not interested in showing the last message, so we omit those fields, but we need the message to know whether the conversation has unread messages. This time we do a `LEFT JOIN` instead of an `INNER JOIN` because the `last_message_id` is `NULLABLE`; in other case we won’t get any rows. We use an `IFNULL` in the `has_unread_messages` comparison for that reason too. Lastly, we filter by ID. +这里的查询与之前有点类似。尽管我们并不关心最后一条消息的显示问题,并因此忽略了与之相关的一些字段,但是我们需要根据这条消息来判断对话中是否存在未读消息。此时,我们使用 `LEFT JOIN` 来代替 `INNER JOIN`,因为 `last_message_id` 字段是 `NULLABLE`(可以为空)的;而其他情况下,我们无法得到任何记录。基于同样的理由,我们在 `has_unread_messages` 的比较中使用了 `IFNULL` 语句。最后,我们按 ID 进行过滤。 -If the query returns no rows, we respond with a `404 Not Found` error, otherwise `200 OK` with the found conversation. +如果查询没有返回任何记录,我们的响应会返回 `404 Not Found` 错误,否则响应将会返回 `200 OK` 以及找到的对话。 * * * -Yeah, that concludes with the conversation endpoints. +本篇帖子以创建了一些对话端点结束。 -Wait for the next post to create and list messages 👋 +在下一篇帖子中,我们将会看到如何创建并列出消息。 [Souce Code][3] @@ -346,6 +344,6 @@ via: https://nicolasparada.netlify.com/posts/go-messenger-conversations/ [a]: https://nicolasparada.netlify.com/ [b]: https://github.com/lujun9972 -[1]: https://nicolasparada.netlify.com/posts/go-messenger-schema/ -[2]: https://nicolasparada.netlify.com/posts/go-messenger-oauth/ +[1]: https://linux.cn/article-11396-1.html +[2]: https://linux.cn/article-11510-1.html [3]: https://github.com/nicolasparada/go-messenger-demo diff --git a/translated/tech/20190523 Run your blog on GitHub Pages with Python.md b/translated/tech/20190523 Run your blog on GitHub Pages with Python.md new file mode 100644 index 0000000000..47134718ee --- /dev/null +++ b/translated/tech/20190523 Run your blog on GitHub Pages with Python.md @@ -0,0 +1,232 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Run your blog on GitHub Pages with Python) +[#]: via: (https://opensource.com/article/19/5/run-your-blog-github-pages-python) +[#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjny/users/jasperzanjani/users/jasperzanjani/users/jasperzanjani/users/jnyjny/users/jasperzanjani) + +在 GitHub 上使用 Python 运行你的博客 +====== +使用 Pelican(一个基于 Python 的平台)在 GitHub 上创建博客,看起来很不错。 + +![Raspberry Pi and Python][1] + +[GitHub][2] 是一个非常流行的用于源代码控制的 Web 服务,它使用 [Git][3] 同步本地文件和 GitHub 服务器上保留的副本,这样你就可以轻松地共享和备份你的工作。 + +除了为代码仓库提供用户界面之外,GitHub 还运允许用户直接从仓库[发布网页][4]。GitHub 推荐的网站生成软件包是 [Jekll][5],使用 Ruby 编写。因为我是 [Python][6] 的忠实粉丝,所以我更喜欢 [Pelican][7],这是一个基于 Python 的博客平台,可与 GitHub 很好地协同工作。 + +Pelican 和 Jekll 都可以将 [Markdown][8] 或 [reStructuredText][9] 中编写的内容转换为 HTML 以生成静态网站,并且两个生成器都支持定制的主题。 + +在本文中,我将介绍如何安装 Pelican、设置 GitHub 仓库、运行快速入门帮助、编写一些 Markdown 文件以及发布第一篇博客。我假设你有一个 [GitHub 账户][10],熟悉[基础的 Git 命令][11],并且想使用 Pelican 发布博客。 + +### 安装 Pelican 并创建仓库 + +首先,你必须在本地计算机上安装 Pelican 和 **ghp-import**。使用 Python 软件包安装工具 [pip][12](你有,对吧?),这非常容易: + +``` +$ pip install pelican ghp-import Markdown +``` + +然后,打开浏览器并在 GitHub 上为你的新博客创建一个新的仓库,命名如下(在此处以及整个教程中,用 GitHub 用户名替换 ): + +``` +https://GitHub.com/username/username.github.io +``` + +让它保持空白,稍后我们用引人注目的博客内容来填充它。 + +使用命令行(确保正确),将空的 Git 仓库克隆到本地计算机: + +``` +$ git clone blog +$ cd blog +``` + +### 奇怪的把戏... + +在 GitHub 上发布 Web 内容有一个不太明显的技巧,对于用户页面(托管在名为 _username.github.io_ 的仓库的页面上),其内容来自 **master** 分支。 + +我强烈建议不要将所有 Pelican 配置文件和原始 Markdown 文件都保留在 **master** 中,**master** 中只保留 Web 内容中。因此,我将 Pelican 配置和原始内容保留在一个我喜欢称为 **content** 的单独分支中。(你可以随意创建一个分支,但以下内容沿用 **content**。)我喜欢这种结构,因为我可以放弃掉 **master** 中的所有文件,然后用 **content** 分支重新填充它。 + +``` +$ git checkout -b content +Switched to a new branch 'content' +``` + +### 配置 Pelican + +现在该进行内容配置了。Pelican 提供了一个很棒的初始化工具 **pelican-quickstart**,它会询问你有关博客的一系列问题。 + +``` +$ pelican-quickstart +Welcome to pelican-quickstart v3.7.1. + +This script will help you create a new Pelican-based website. + +Please answer the following questions so this script can generate the files +needed by Pelican. + +> Where do you want to create your new web site? [.] +> What will be the title of this web site? Super blog +> Who will be the author of this web site? username +> What will be the default language of this web site? [en] +> Do you want to specify a URL prefix? e.g., (Y/n) n +> Do you want to enable article pagination? (Y/n) +> How many articles per page do you want? [10] +> What is your time zone? [Europe/Paris] US/Central +> Do you want to generate a Fabfile/Makefile to automate generation and publishing? (Y/n) y +> Do you want an auto-reload & simpleHTTP script to assist with theme and site development? (Y/n) y +> Do you want to upload your website using FTP? (y/N) n +> Do you want to upload your website using SSH? (y/N) n +> Do you want to upload your website using Dropbox? (y/N) n +> Do you want to upload your website using S3? (y/N) n +> Do you want to upload your website using Rackspace Cloud Files? (y/N) n +> Do you want to upload your website using GitHub Pages? (y/N) y +> Is this your personal page (username.github.io)? (y/N) y +Done. Your new project is available at /Users/username/blog +``` + +你可以对每个问题都采用默认值,但除了以下这些问题: + + * 网站标题,应该唯一且特殊 + * 网站作者,可以是个人用户名或你的全名 + * 时区,可能你不在巴黎 + * 上传到 GitHub 页面,我们选择 "y" + + +回答完所有问题后,Pelican 会在当前目录中保留以下内容: + +``` +$ ls +Makefile content/ develop_server.sh* +fabfile.py output/ pelicanconf.py +publishconf.py +``` + +你可以查看 [Pelican 文档][13]来了解如何使用这些文件,但 _现在_ 我们要做的是完成手头的工作。说实话,我也没有阅读文档。 + +### 继续 + +将所有 Pelican 生成的文件添加到本地 Git 仓库的 **content** 分支,提交更改,然后将本地更改推送到 Github 上托管的远程仓库: + +``` +$ git add . +$ git commit -m 'initial pelican commit to content' +$ git push origin content +``` + +这件事情并不是特别令人兴奋,但是如果我们需要将内容恢复到这些文件的时候,这将非常方便。 + +### 终于 + +终于,现在你得到一个博客了!你所有的博客文章、照片、图像、PDF 等都将位于 **content** 目录中,它最初是空的。要开始创建第一篇博客和关于页面,输入: + +``` +$ cd content +$ mkdir pages images +$ cp /Users/username/SecretStash/HotPhotoOfMe.jpg images +$ touch first-post.md +$ touch pages/about.md +``` + +接下来,在你喜欢的文本编辑器中打开 **first-post.md**,并添加以下内容: + +``` +title: First Post on My Sweet New Blog +date: +author: Your Name Here + +# I am On My Way To Internet Fame and Fortune! + +This is my first post on my new blog. While not super informative it +should convey my sense of excitement and eagerness to engage with you, +the reader! +``` + +前三行是 Pelican 用于组织内容的元数据。有很多不同的元数据可供你选择。再说一次,文档是你了解更多选项的最佳选择。 + +现在,打开空白文件 **pages/about.md** 并添加以下文本: + +``` +title: About +date: + +![So Schmexy][my_sweet_photo] + +Hi, I am and I wrote this epic collection of Interweb +wisdom. In days of yore, much of this would have been deemed sorcery +and I would probably have been burned at the stake. + +😆 + +[my_sweet_photo]: {static}/images/HotPhotoOfMe.jpg +``` + +现在,content 目录中将包含三个新的 Web 内容,在 content 分支中还有很多内容。 + +### 发布 + +不要急,马上要见到成果了! + +剩下要做的就是: + + * 运行 Pelican 以在 **output** 中生成静态 HTML 文件: + ``` + `$ pelican content -o output -s publishconf.py` + ``` + + * 使用 **ghp-import** 将 **output** 目录的内容添加到 **master** 分支中: + ``` + $ ghp-import -m "Generate Pelican site" --no-jekyll -b master output` + ``` + + * 将本地 master 分支推送到远程仓库: + ``` + $ git push origin master + ``` + + * 提交新内容并将其推送到 **content** 分支 + ``` + $ git add content + $ git commit -m 'added a first post, a photo and an about page' + $ git push origin content + ``` + +### OMG,我成功了 + +现在最激动的时候到了,当你想要看到你发布给大家的博客内容时,打开浏览器输入: + +``` +https://username.github.io +``` + +恭喜你可以在 GitHub 上发布自己的博客了!当你想添加更多页面或文章时,都可以按照上面的步骤来。希望你可以愉快地发布博客。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/run-your-blog-github-pages-python + +作者:[Erik O'Shaughnessy][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://opensource.com/users/jnyjny/users/jasperzanjani/users/jasperzanjani/users/jasperzanjani/users/jnyjny/users/jasperzanjani +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/getting_started_with_python.png?itok=MFEKm3gl (Raspberry Pi and Python) +[2]: https://github.com/ +[3]: https://git-scm.com +[4]: https://help.github.com/en/categories/github-pages-basics +[5]: https://jekyllrb.com +[6]: https://python.org +[7]: https://blog.getpelican.com +[8]: https://guides.github.com/features/mastering-markdown +[9]: http://docutils.sourceforge.net/docs/user/rst/quickref.html +[10]: https://github.com/join?source=header-home +[11]: https://git-scm.com/docs +[12]: https://pip.pypa.io/en/stable/ +[13]: https://docs.getpelican.com diff --git a/translated/tech/20190731 How to structure a multi-file C program- Part 2.md b/translated/tech/20190731 How to structure a multi-file C program- Part 2.md deleted file mode 100644 index 85499e4362..0000000000 --- a/translated/tech/20190731 How to structure a multi-file C program- Part 2.md +++ /dev/null @@ -1,226 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (mengxinayan) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to structure a multi-file C program: Part 2) -[#]: via: (https://opensource.com/article/19/7/structure-multi-file-c-part-2) -[#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjny) - -如何组织构建多文件 C 语言程序(二) -====== -我将在本系列的第二篇中深入研究由多个文件组成的C程序的结构。 -![4 个 manilla 文件,黄色,绿色,紫色,蓝色][1] - -在 [(第一篇)][2] 中,我设计了一个名为 [MeowMeow][3] 的多文件 C 程序,该程序实现了一个玩具——[codec][4]。我提到了程序设计中的 Unix 哲学,即在一开始创建多个空文件,并建立一个好的结构。最后,我创建了一个 Makefile 文件夹并阐述了它的作用。在本文中将另一个方向展开:现在我将介绍简单但具有指导性的 MeowMeow 编/解码器的实现。 - -当读过我的 "[如何写一个好的 C 语言 main 函数][5]." 后,你便会知道 `main.c` 文件中 `meow` 和 `unmeow` 的结构,其主体结构如下: - -``` -/* main.c - MeowMeow 流编码器和解码器 */ - -/* 00 system includes */ -/* 01 project includes */ -/* 02 externs */ -/* 03 defines */ -/* 04 typedefs */ -/* 05 globals (but don't)*/ -/* 06 ancillary function prototypes if any */ -    -int main(int argc, char *argv[]) -{ -  /* 07 variable declarations */ -  /* 08 check argv[0] to see how the program was invoked */ -  /* 09 process the command line options from the user */ -  /* 10 do the needful */ -} -    -/* 11 ancillary functions if any */ -``` - -### 包含项目头文件 - -位于第二部分中的 `/* 01 project includes */` 的源代码如下: - - -``` -/* main.c - MeowMeow 流编码器和解码器 */ -... -/* 01 project includes */ -#include "main.h" -#include "mmecode.h" -#include "mmdecode.h" -``` - -`#include` 是 C 语言的预处理命令,它会将其后面的文件内容拷贝到当前文件中。如果程序员在头文件名称周围使用双引号,编译器将会在当前目录寻找该文件。如果文件被尖括号包围,编译器将在一组预定义的目录中查找该文件。 - -[main.h][6] 文件中包含了 [main.c][7] 文件中用到的定义和别名。我喜欢在头文件里尽可能多的声明,以便我想在我的程序的其他位置使用这些定义。 - -头文件 [mmencode.h][8] 和 [mmdecode.h][9] 几乎相同,因此我以 `mmencode.h` 为例来分析。 - - -``` - /* mmencode.h - MeowMeow 流编码器和解码器 */ -    - #ifndef _MMENCODE_H - #define _MMENCODE_H -    - #include <stdio.h> -    - int mm_encode(FILE *src, FILE *dst); -    - #endif /* _MMENCODE_H */ -``` - -`#ifdef`,`#define`,`#endif` 指令统称为 “防护” 指令。其可以防止 C 编译器在一个文件中多次包含同一文件。如果编译器在一个文件中发现多个定义/原型/声明,它将会产生警告。因此这些防护措施是必要的。 - -在防护内部,它只做两件事:`#include` 指令和函数原型声明。我将包含 `stdio.h` 头文件,以便于能在函数原型中使用 `FILE` 流。函数原型也可以被包含在其他 C 文件中,以便于在文件的命名空间中创建它。你可以将每个文件视为一个命名空间,其中的变量和函数不能被另一个文件中的函数或者变量使用。 - -编写头文件很复杂,并且在大型项目中很难管理它。不要忘记使用防护。 - -### MeowMeow 编码的实现 - -该程序的功能是按照字节进行 `MeowMeow` 字符串的编解码,事实上这是该项目中最简单的部分。截止目前我所做的工作便是支持允许在适当的位置调用此函数:解析命令行,确定要使用的操作,并打开将要操作的文件。下面的循环是编码的过程: - - -``` - /* mmencode.c - MeowMeow 流编码器 */ - ... -     while (![feof][10](src)) { -    -       if (![fgets][11](buf, sizeof(buf), src)) -         break; -              -       for(i=0; i<[strlen][12](buf); i++) { -         lo = (buf[i] & 0x000f); -         hi = (buf[i] & 0x00f0) >> 4; -         [fputs][13](tbl[hi], dst); -         [fputs][13](tbl[lo], dst); -       } -            } -``` - -简单的说,上面代码循环读取文件的一部分,剩下的内容通过 `feof(3)` 函数和 `fgets(3)` 函数读取。然后将读入的内容的每个字节分成 `hi` 和 `lo` 半个字节。半个字节是 4 个比特。这里的奥妙之处在于可以用 4 个比特来编码16个值。我将字符串 `hi` 和 `lo` 用作 16 字符串查找表 `tbl` 的索引,表中包含了对每半个字节编码后的 `MeowMeow` 字符串。这些字符串使用 `fputs(3)` 函数写入目标 `FILE` 流,然后移动到缓存区的下一个字节。 - -该表使用 [table.h][14] 中的宏定义进行初始化,在没有特殊原因(比如:要展示包含了另一个项目的本地头文件)时,我喜欢使用宏来进行初始化。我将在未来的文章中进一步探讨原因。 - -### MeowMeow 解码的实现 - -我承认在开始工作前花了一些时间。解码的循环与编码类似:读取 `MeowMeow` 字符串到缓冲区,将编码从字符串转换为字节 - - -``` - /* mmdecode.c - MeowMeow 流解码器 */ - ... - int mm_decode(FILE *src, FILE *dst) - { -   if (!src || !dst) { -     errno = EINVAL; -     return -1; -   } -   return stupid_decode(src, dst); - } -``` - -这不是所期望的吗? - -在这里,我通过外部公开的 `mm_decode()` 函数公开了 `stupid_decode()` 函数细节。我上面所说的“外部”是指在这个文件之外。因为 `stupid_decode()` 函数不在头文件中,因此无法在其他文件中调用它。 - -当我们想发布一个可靠的公共接口时,有时候会这样做,但是我们还没有完全使用函数解决问题。在本例中,我编写了一个 I/O 密集型函数,该函数每次从源中读取 8 个字节,然后解码获得 1 个字节写入目标流中。较好的实现是一次处理多于 8 个字节的缓冲区。更好的实现还可以通过缓冲区输出字节,进而减少目标流中单字节的写入次数。 - - -``` - /* mmdecode.c - MeowMeow 流解码器 */ - ... - int stupid_decode(FILE *src, FILE *dst) - { -   char           buf[9]; -   decoded_byte_t byte; -   int            i; -      -   while (![feof][10](src)) { -     if (![fgets][11](buf, sizeof(buf), src)) -       break; -     byte.field.f0 = [isupper][15](buf[0]); -     byte.field.f1 = [isupper][15](buf[1]); -     byte.field.f2 = [isupper][15](buf[2]); -     byte.field.f3 = [isupper][15](buf[3]); -     byte.field.f4 = [isupper][15](buf[4]); -     byte.field.f5 = [isupper][15](buf[5]); -     byte.field.f6 = [isupper][15](buf[6]); -     byte.field.f7 = [isupper][15](buf[7]); -        -     [fputc][16](byte.value, dst); -   } -   return 0; - } -``` - -我并没有使用编码器中使用的位移方法,而是创建了一个名为 `decoded_byte_t` 的自定义数据结构。 - -``` - /* mmdecode.c - MeowMeow 流解码器 */ - ... - - typedef struct { -   unsigned char f7:1; -   unsigned char f6:1; -   unsigned char f5:1; -   unsigned char f4:1; -   unsigned char f3:1; -   unsigned char f2:1; -   unsigned char f1:1; -   unsigned char f0:1; - } fields_t; -    - typedef union { -   fields_t      field; -   unsigned char value; - } decoded_byte_t; -``` - -初次看到代码时可能会感到有点儿复杂,但不要放弃。`decoded_byte_t` 被定义为 `fields_t` 和 `unsigned char` 的 **联合体** 。可以将联合中的命名成员看作同一内存区域的别名。在这种情况下,`value` 和 `field` 指向相同的 8 比特内存区域。将 `field.f0` 设置为 1 也将设置 `value` 中的最低有效位。 - -虽然 `unsigned char` 并不神秘,但是对 `fields_t` 的 别名(`typedef`) 也许看起来有些陌生。现代 C 编译器允许程序员在结构体中指定单个 bit 的值。`field` 成员是一个无符号整数类型,可以在成员标识符后紧跟一个冒号和一个整数,该整数指定了比特字段的长度。 - -这种数据结构使得按 `field` 名称访问每个比特变得简单。我们依赖编译器生成正确的移位指令来访问 `field`,这可以在调试时为你节省不少时间。 - -最后,因为`stupid_decode()` 函数一次仅从源 `FILE` 流中读取 8 个字节,所以它效率并不高。通常我们尝试最小化读写次数,以提高性能和降低调用系统调用的开销。请记住:少次数的读取/写入大的块比多次数的读取/写入小的块好得多。 - -### 总结 - -用 C 语言编写一个多文件程序需要程序员做更多计划,而不仅仅是一个 `main.c`。但是当你添加功能或者重构时,只需要多花费一点儿努力便可以节省大量时间以及避免让你头痛的问题。 - -回顾一下,我更喜欢这样做:多个文件,每个文件仅有简单功能;通过头文件公开那些文件中的小部分功能;把数字常量和字符串常量保存在头文件中;使用 `Makefile` 而不是 Bash 脚本来自动化处理事务;使用 `main()` 函数来处理和解析命令行参数并作为程序主要功能的框架。 - -我知道我只是涉及了这个简单程序中发生的事情,并且我很高兴知道哪些事情对您有所帮助以及哪些主题需要详细的解释。在评论中分享您的想法,让我知道。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/7/structure-multi-file-c-part-2 - -作者:[Erik O'Shaughnessy][a] -选题:[lujun9972][b] -译者:[萌新阿岩](https://github.com/mengxinayan) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jnyjny -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/file_system.jpg?itok=pzCrX1Kc (4 manilla folders, yellow, green, purple, blue) -[2]: https://opensource.com/article/19/7/how-structure-multi-file-c-program-part-1 -[3]: https://github.com/jnyjny/MeowMeow.git -[4]: https://en.wikipedia.org/wiki/Codec -[5]: https://opensource.com/article/19/5/how-write-good-c-main-function -[6]: https://github.com/JnyJny/meowmeow/blob/master/main.h -[7]: https://github.com/JnyJny/meowmeow/blob/master/main.c -[8]: https://github.com/JnyJny/meowmeow/blob/master/mmencode.h -[9]: https://github.com/JnyJny/meowmeow/blob/master/mmdecode.h -[10]: http://www.opengroup.org/onlinepubs/009695399/functions/feof.html -[11]: http://www.opengroup.org/onlinepubs/009695399/functions/fgets.html -[12]: http://www.opengroup.org/onlinepubs/009695399/functions/strlen.html -[13]: http://www.opengroup.org/onlinepubs/009695399/functions/fputs.html -[14]: https://github.com/JnyJny/meowmeow/blob/master/table.h -[15]: http://www.opengroup.org/onlinepubs/009695399/functions/isupper.html -[16]: http://www.opengroup.org/onlinepubs/009695399/functions/fputc.html diff --git a/translated/tech/20191224 Why your Python code should be flat and sparse.md b/translated/tech/20191224 Why your Python code should be flat and sparse.md new file mode 100644 index 0000000000..d1d59b5fc6 --- /dev/null +++ b/translated/tech/20191224 Why your Python code should be flat and sparse.md @@ -0,0 +1,86 @@ +[#]: collector: (lujun9972) +[#]: translator: (caiichenr) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: 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 之禅仅仅罗列出一组清晰的法则,那法则之间的矛盾只能算作一种错误。然而用作引导读者去为最优方案沉思的工具,矛盾却是绝佳的。 + +### 扁平胜过嵌套 Flat is better than nested. + +迫于对缩进的强硬要求,Python 对“扁平化”的需求显然远超它者。其余编程语言为了缓解对缩进的需求,通常会在嵌套结构里加入一种“欺诈”的手段。用以说明此点,不妨一同看看JavaScript。 + +JavaScript 是原生异步的,这意味着程序员用 JavaScript 写的代码会用到大量的回调函数。 + + +``` +a(function(resultsFromA) { +  b(resultsFromA, function(resultsfromB) { +    c(resultsFromC, function(resultsFromC) { +      console.log(resultsFromC) +   } +  } +} +``` + +忽略这段代码的具体内容,只去观察这段代码的形状与缩进带来极右点的方式。这种独特的“箭头”图形在我们扫看代码时格外扎眼,这种写法也因此被视作不可取,甚至得到了“回调地狱”的绰号。不过,在 JavaScript 中,这种反映嵌套关系的缩进可以通过“欺诈”来回避。 + + +``` +a(function(resultsFromA) { +b(resultsFromA, +  function(resultsfromB) { +c(resultsFromC, +  function(resultsFromC) { +    console.log(resultsFromC) +}}} +``` + +Python 并没有提供这种欺诈手段:每一级嵌套在代码中都如实的对应着一层缩进。因此,Python 深层的嵌套关系在_视觉_上也一定是深层嵌套的。这使得“回调地狱”的问题对于 Python 而言要比在 JavaScript 中严重得多:嵌套的回调函数必定带来缩进,而绝无使用花括号来“欺诈”的可能。 + +这项挑战与 Python 之禅的指导原则相结合后,在我参与的库中催生出了一个优雅的解决方案。我们在 [Twisted][3] 框架里提出了 _deferred_ 抽象,日后 JavaScript 中流行的 _promise_ 抽象亦是受其启发而生。正是由于 Python 对整洁代码的坚守,方能推动 Python 开发者去发掘新的,强力的抽象。 + + +``` +future_value = future_result() +future_value.addCallback(a) +future_value.addCallback(b) +future_value.addCallback(c) +``` + +(现代 JavaScript 程序员也许会觉得这段代码十分眼熟:Promises 着实受到了 Twisted 里 deferreds 抽象的深远影响。) + +### 稀疏胜过密集 Sparse is better than dense. + +最易降低代码密集程度的方法是引入嵌套。这种习惯也正是有关稀疏的原则要随着前一条提出的原因:在竭尽所能地降低代码密集性之后,我们往往会遗留下_密集_的代码或数据结构。此处的密集,是指塞进过量信息的小段代码,它们会导致错误发生后的解析变得困难。 + +这种密集性唯有通过创造性的思考方可改善,此外别无捷径。Python 之禅并不为我们提供简单的解决方案,它只会指明改善代码的方向,而非提供“如何”去做的向导。 + +起身走走,泡个热水澡,抑或是闻闻花香。盘坐冥思,直至灵感袭来。当你终于得到启发,便是动身写代码之时。 + +-------------------------------------------------------------------------------- + +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) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) +[2]: https://www.python.org/dev/peps/pep-0020/ +[3]: https://twistedmatrix.com/trac/ diff --git a/translated/tech/20200123 6 things you should be doing with Emacs.md b/translated/tech/20200123 6 things you should be doing with Emacs.md deleted file mode 100644 index 62ad555cd3..0000000000 --- a/translated/tech/20200123 6 things you should be doing with Emacs.md +++ /dev/null @@ -1,102 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (lujun9972) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (6 things you should be doing with Emacs) -[#]: via: (https://opensource.com/article/20/1/emacs-cheat-sheet) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -6 件你应该用 Emacs 做的事 -====== -下面六件事情你可能都没有意识到可以在 Emacs 下完成。此外,使用我们的新备忘单来充分利用 Emacs 的功能吧。 -![浏览器上给蓝色编辑器 ][1] - -想象一下使用 Python 的 IDLE 界面来编辑文本。你可以将文件加载到内存中,编辑它们,并保存更改。但是你执行的每个操作都由 Python 函数定义。例如,调用 **upper()** 来让一个单词全部大写,调用 **open** 打开文件,等等。文本文档中的所有内容都是 Python 对象,可以进行相应的操作。从用户的角度来看,这与其他文本编辑器的体验一致。对于 Python 开发人员来说,这是一个丰富的 Python 环境,只需在配置文件中添加几个自定义函数就可以对其进行更改和开发。 - -这就是 [Emacs][2] 使用 1958 年的编程语言 [Lisp][3] 所做的事情。在 Emacs 中,运行应用程序的 Lisp 引擎与输入文本之间无缝结合。对 Emacs 来说,一切都是 Lisp 数据,因此一切都可以通过编程进行分析和操作。 - -这就形成了一个强大的用户界面 (UI)。但是,如果您是 Emacs 的普通用户,您可能对它的能力知之甚少。下面是你可能没有意识到 Emacs 可以做的六件事。 - -## 使用 Tramp mode 进行云端编辑 - -Emacs 早在网络流行话之前就实现了透明的网络编辑能力了,而且时至今日,它仍然提供了最流畅的远程编辑体验。Emacs 中的 [Tramp mode][4]( 以前称为 RPC mode) 代表着 “Transparent Remote (file) Access,Multiple Protocol( 透明的远程(文件)访问,多协议)”,这详细描述了它提供的功能:通过最流行的网络协议轻松访问您希望编辑的远程文件。目前最流行、最安全的远程编辑协议是 [OpenSSH][5],因此 Tramp 使用它作为默认的协议。 - -在 Emacs 22.1 或更高版本中已经包含了 Tramp,因此要使用 Tramp,只需使用 Tramp 语法打开一个文件。在 Emacs 的 **File** 菜单中,选择 **Open File**。当在 Emacs 窗口底部的小缓冲区中出现提示时,使用以下语法输入文件名: - -``` -`/ssh:user@example.com:/path/to/file` -``` - -如果需要交互式登录,Tramp 会提示输入密码。但是,Tramp 直接使用 OpenSSH,所以为了避免交互提示,你可以将主机名、用户名和 SSH 密钥路径添加到您的 `~/.ssh/config` 文件。与 Git 一样,Emacs 首先使用 SSH 配置,只有在出现错误时才会停下来询问更多信息。 - -Tramp 非常适合编辑计算机上不存在的文件,它的用户体验与编辑本地文件没有明显的区别。下次,当你 SSH 到服务器启动 Vim 或 Emacs 会话时,请尝试使用 Tramp。 - -## 日历 - -如果你喜欢文本多过图形界面,那么你一定会很高兴地知道,可以使用 Emacs 以纯文本的方式安排你的日程(或生活)。而且你依然可以在移动设备上使用开放源码的 [Org mode][6] 查看器来获得华丽的通知。 - -这个过程需要一些配置来创建一个方便的方式来与移动设备同步你的日程(我使用 Git,但你可以调用蓝牙,KDE Connect,Nextcloud,或其他文件同步工具),此外你必须安装一个 Org mode 查看器(如 [Orgzly][7]) 以及移动设备上的 Git 客户程序。但是,一旦你搭建好了这些基础,该流程就会与您常用的(或正在完善的,如果您是新用户 )Emacs 工作流完美地集成在一起。你可以在 Emacs 中方便地查阅日程,更新日程,并专注于任务上。议程上的变化将会反映在移动设备上,因此即使在 Emacs 不可用的时候,你也可以保持条理性。 - -![][8] - -感兴趣了?阅读我的关于[使用 Org mode 和 Git 进行日程安排 ][9] 的逐步指南。 - -## 访问终端 - -有[许多终端模拟器 ][10] 可用。尽管 Emacs 中的 Elisp 终端仿真器不是最强大的通用仿真器,但是它有两个显著的优点。 - -1。**在 Emacs 缓冲区中打开:**我使用 Emacs 的 Elisp shell,因为它在 Emacs 窗口中打开很方便,我经常全屏运行该窗口。这是一个小而重要的优势,只需要输入 `Ctrl+x+o`( 或用 Emacs 符号来表示就是 C-x) 就能使用终端了,而且它还有一个特别好的地方在于当运行漫长的作业时能够一瞥它的状态报告。 -2。**在没有系统剪贴板的情况下复制和粘贴特别方便:** 无论是因为懒惰不愿将手从键盘移动到鼠标,还是因为在远程控制台运行 Emacs 而无法使用鼠标,在 Emacs 中运行终端有时意味着可以快从 Emacs 缓冲区中传输数据到 Bash。 - - - -要尝试 Emacs 终端,输入 `Alt+x (用 Emacs 符号表示就是 M-x)`,然后输入 **shell**,然后按 **Return**。 - -## 使用 Racket mode - -[Racket][11] 是一种激动人心的新兴 Lisp 方言,拥有动态编程环境 、GUI 工具包和热情的社区。学习 Racket 的默认编辑器是 DrRacket,它的顶部是定义面板,底部是交互面板。使用该设置,用户可以编写影响 Racket 运行时的定义。就像旧的 [Logo Turtle][12] 程序,但是有一个终端而不是仅仅一个海龟。 - -![Racket-mode][13] - -由 PLT 提供的 LGPL 示例代码 - -基于 Lisp 的 Emacs 为资深 Racket 编程人员提供了一个很好的集成开发环境 (IDE)。它还没有自带 [Racket mode][14],但你可以使用 Emacs 包安装程序安装 Racket 模式和辅助扩展。 -要安装它,按下 `Alt+X` (用 Emacs 符号表示就是 **M-x**),键入 **package-install**,然后按 **Return**。然后输入要安装的包 (**racet-mode**),按 **Return**。 - -使用 **M-x racket-mode** 进入 Racket mode。如果你是 Racket 新手,但不是对 Lisp 或 Emacs 比较熟悉,可以从优秀[图解 Racket][15] 入手。 - -## 脚本 - -您可能知道,Bash 脚本在自动化和增强 Linux 或 Unix 体验方面很流行。你可能听说过 Python 在这方面也做得很好。但是你知道 Lisp 脚本可以用同样的方式运行吗?有时人们会对 Lisp 到底有多有用感到困惑,因为许多人是通过 Emacs 来了解 Lisp 的,因此有一种潜在的印象,即在 21 世纪运行 Lisp 的惟一方法是在 Emacs 中运行。幸运的是,事实并非如此,Emacs 是一个很好的 IDE,它支持将 Lisp 脚本作为一般的系统可执行文件来运行。 - -除了 Elisp 之外,还有两种流行的现代 lisp 可以很容易地用来作为独立脚本运行。 - -1。**Racket:** 你可以通过在系统上运行 Racket 来提供运行 Racket 脚本所需的运行时支持,或者你可以使用 **raco exe** 产生一个可执行文件。**raco exe** 命令将代码和运行时支持文件一起打包,以创建可执行文件。然后,**raco distribution** 命令将可执行文件打包成可以在其他机器上工作的发行版。Emacs 有许多 Racket 工具,因此在 Emacs 中创建 Racket 文件既简单又有效。 - -2。**GNU Guile:** [GNU Guile][16](“GNU Ubiquitous Intelligent Language for Extensions”--GNU 通用智能语言扩展的缩写)是 [Scheme][17] 编程语言的一个实现,它用于为桌面 、internet、 终端等创建应用程序和游戏。使用 Emacs 中的 Scheme 扩展众多,使用任何一个扩展来编写 Scheme 都很容易。例如,这里有一个用 Guile 编写的 “Hello world” 脚本: -``` -#!/usr/bin/guile - s - -(display "hello world") -     (newline) [/code] Compile and run it with the **guile** command: [code] $ guile ./hello.scheme -;;; compiling /home/seth/./hello.scheme -;;; compiled [...]/hello.scheme.go -hello world -$ guile ./hello.scheme -hello world -``` -## Run Elisp without Emacs -Emacs 可以作为 Elisp 的运行环境,但是你无需按照传统印象中的必须打开 Emacs 来运行 Elisp。`--script` 选项可以让你使用 Emacs 作为引擎来执行 Elisp 脚本而无需运行 Emacs 图形界面(甚至也无需使用终端界面)。下面这个例子中,`-Q` 选项让 Emacs 忽略 `.emacs` 文件从而避免由于执行 Elisp 脚本时产生延迟(若你的脚本依赖于 Emacs 配置中的内容那么请忽略该选项)。 - -``` -emacs -Q --script ~/path/to/script.el -``` -## 下载 Emacs 备忘录 -Emacs 许多重要功能都不是只能通过 Emacs 来实现的; Org mode 是 Emacs 扩展也是一种格式标准,流行的 Lisp 方言大多不依赖于具体的实现,我们甚至可以在没有可见或可交互式 Emacs 实例的情况下编写和运行 Elisp。然后若你对为什么模糊代码和数据之间的界限能够引发创新和效率感到好奇的话,那么 Emacs 是一个很棒的工具。 - -幸运的是,现在是 21 世纪,Emacs 有了带有传统菜单的图形界面以及大量的文档,因此学习曲线不再像以前那样。然而,要最大化 Emacs 对你的好处,你需要学习它的快捷键。由于 Emacs 支持的每个任务都是一个 Elisp 函数,Emacs 中的任何功能都可以对应一个快捷键,因此要描述所有这些快捷键是不可能完成的任务。你只要学习使用频率 10 倍于不常用功能的那些快捷键即可。 - -我们汇聚了最常用的 Emacs 快捷键成为一份 Emacs 备忘录以便你查询。将它挂在屏幕附近或办公室墙上,把它作为鼠标垫也行。让它触手可及经常翻阅一下。每次翻两下可以让你获得十倍的学习效率。而且一旦开始编写自己的函数,你一定不会后悔获取了这个免费的备忘录副本的! - -[这里下载 Emacs 备忘录 ](https://opensource.com/downloads/emacs-cheat-sheet) diff --git a/translated/tech/20200312 How to write effective documentation for your open source project.md b/translated/tech/20200312 How to write effective documentation for your open source project.md new file mode 100644 index 0000000000..51cd81bacd --- /dev/null +++ b/translated/tech/20200312 How to write effective documentation for your open source project.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: (HankChow) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to write effective documentation for your open source project) +[#]: via: (https://opensource.com/article/20/3/documentation) +[#]: author: (Kevin Xu https://opensource.com/users/kevin-xu) + +如何为你的开源项目编写实用的文档 +====== +一份优质的文档可以让很多用户对你的项目路人转粉。 + +![A pink typewriter][1] + +好的代码很多时候并不代表一切。或许你能用最精巧的代码解决了世界上最迫切需要解决的问题,但如果你作为一个开源开发者,没能用准确的语言将你的作品公之于世,你的代码也只能成为沧海遗珠。因此,技术写作和文档编写是很重要的技能。 + +一般来说,项目中的文档是最受人关注的部分,很多用户会通过文档来决定自己是否应该对某个项目开始学习或研究。所以,我们不能忽视技术写作和文档编写的工作,尤其要重点关注其中的“入门”部分,这会对你项目的发展起到关键性的作用。 + +对于很多人来说,写作是一件令人厌烦甚至恐惧的事情。我们这些工程师出身的人,学习“写代码”比学习“为代码写文档”明显更多。不少人会把英语作为自己的第二语言或者第三语言,他们可能会对英语写作感到不安全甚至害怕(我的母语是汉语,英语是作为我的第二语言学习的,所以我也能感受到这种痛苦)。 + +但如果你希望自己的项目能在全球范围内产生一定的影响力,英语就是你必须使用的语言,这是一个无法避免的现实。但不必害怕,我在写这篇文章的时候就考虑到了这些可能带来的挑战,并给出了我的一些建议。 + +### 五条有用的写作建议 + +这五条建议你马上就可以用起来,尽管看起来似乎有些浅显,但在技术写作时却经常被忽视。 + + 1. 使用[主动语态][2]:感受一下主动语态下的“你可以这样更改配置(You can change these configurations by…)”和被动语态下的“配置可以这样更改(These configurations can be changed by…)”有什么不同之处。 + 2. 使用简洁明了的句子:可以借助 [Hemingway App][3] 或者 [Grammarly][4] 这样的工具,尽管它们并不开源。 + 3. 保持条理性:你可以在文档中通过写标题、划重点、引链接等方式,把各类信息划分为不同的部分,避免将所有内容都杂糅在一大段冗长的文字当中。 + 4. 提高可读性:除了单纯的文字之外,运用图表也是从多种角度表达的手段之一。 + 5. 注意拼写和语法:必须记得检查文档中是否有拼写错误或者语法错误。 + +只要在文档的写作和编辑过程中应用到这些技巧,你就能够和读者建立起沟通和信任。 + + * 高效沟通:对于工程师们来说,阅读长篇大论的冗长文字,还不如去看小说。在阅读技术文档时,他们总是希望能够从中快速准确地获取到有用的信息。因此,技术文档的最佳风格应该是精简而有效的,不过这并不代表文档中不能出现类似幽默、emoji 甚至段子这些东西,这些元素可以当你的文档更有个性、更使人印象深刻。当然,具体的实现方式就因人而异了 + * 建立信任:你需要取得文档读者们的信任,这在一个项目的前期尤为重要。读者对你的信任除了来源于你代码的质量,还跟你文档编写的质量有关。所以你不仅要打磨代码,还要润色好相关的文档,这也是上面第 5 点建议拼写和语法检查的原因。 + +### 如何开始编写文档 + +现在,最需要花费功夫的应该就是“入门”部分了,这是一篇技术文档最重要的部分,[二八定律][5]在这里得到了充分体现:访问一个项目的大部分流量都会落在项目文档上,而访问项目文档的大部分流量则会落在文档的“入门”部分中。因此,如果文档的“入门”部分写得足够好,项目就会吸引到很多用户,反之,用户会对你的项目敬而远之。 + +那么如何写好“入门”部分呢?我建议按照以下三步走: + + 1. 任务化:入门指南应该以任务为导向。这里的任务指的是对于开发者来说可以完成的离散的小项目,而不应该包含太多涉及到体系结构、核心概念等的抽象信息,因此在“入门”部分只需要提供一个简单明了的概述就可以了。也不要在“入门”部分大谈这个项目如何优秀地解决了问题,这个话题可以放在文档中别的部分进行说明。总而言之,“入门”部分最好是给出一些主要的操作步骤,这样显得开门见山。 + 2. 30 分钟内能够完成:这一点的核心是耗时尽可能短,不宜超过 30 分钟,这个时间上限是考虑到用户可能对你的项目并不了解。这一点很重要,大部分愿意浏览文档的人都是有技术基础的,但对你的项目也仅仅是一知半解。首先让这些读者尝试进行一些相关操作,在收到一定效果后,他们才会愿意花更多时间深入研究整个项目。因此,你可以从耗时这个角度来评估你的文档“入门”部分有没有需要改进之处。 + 3. 有意义的任务:这里“有意义”的含义取决于你的开源项目。最重要的是认真思考并将“入门”部分严格定义为一项任务,然后交给你的读者去完成。这个项目的价值应该在这项有意义的任务中有所体现,不然读者可能会感觉这是一个浪费时间的行为。 + +提示:假如你的项目是一个分布式数据库,那么达到“整个集群在某些节点故障的情况下可以不中断地保持可用”的目标就可以认为是“有意义”的;加入你的项目是一个数据分析工具或者是商业智能工具,“有意义”的目标也可以是“加载数据后能快速生成多种可视化效果的仪表板”。总之,无论你的项目需要达到什么“有意义”的目标,都应该能在笔记本电脑上本地快速实现。 + +[Linkerd 入门][6]就是一个很好的例子。Linkerd 是 Kubernetes 的开源服务网格Service Mesh,当时我对 Kubernetes 了解并不多,也不熟悉服务网格。但我在自己的笔记本电脑上很轻松地就完成了其中的任务,同时也加深了对服务网格的理解。 + +上面提到的三步过程是一个很有用的框架,对一篇文档“入门”部分的设计和量化评估很有帮助。今后你如果想将你的[开源项目产品化][7],这个框架还可能对实现价值的时间time-to-value产生影响。 + +### 其它核心部分 + +认真写好“入门”部分之后,你的文档中还需要有这五个部分:架构设计、生产环境使用指导、使用案例、参考资料以及未来展望,这五个部分在一份完整的文档中是必不可少的。 + + * 架构设计:这一部分需要深入探讨整个项目架构设计的依据,“入门”部分中一笔带过的那些关键细节就应该在这里体现。在产品化过程中,这个部分将会是[产品推广计划][8]的核心,因此通常会包含一些可视化呈现的内容,期望的效果是让更多用户长期参与到项目中来。 + * 生产环境使用指导:对于同一个项目,在生产环境中部署比在笔记本电脑上部署要复杂得多。因此,指导用户认真使用就尤为重要。同时,有些用户可能对项目很感兴趣,但对生产环境下的使用有所顾虑,而指导和展示的过程则正好能够吸引到这类潜在的用户。 + * 使用案例:社会认同social proof的力量是有目共睹的,所以很有必要列出正在生产环境使用这个项目的其他用户,并把这些信息摆放在显眼的位置。这个部分的浏览量甚至仅次于“入门”部分。 + * 参考资料:这个部分是对项目的一些详细说明,让用户得以进行详细的研究以及查阅相关信息。一些开源作者会在这个部分事无巨细地列出项目中的每一个细节和边缘情况edge case,这种做法可以理解,但不推荐在项目初期就在这个部分花费过多的时间。你可以采取更折中的方式,在质量和效率之间取得平衡,例如提供一些相关社区的链接、Stack Overflow 上的标签或单独的 FAQ 页面。 + * 未来展望:你需要制定一个简略的时间表,规划这个项目的未来发展方向,这会让用户长期保持兴趣。尽管项目在当下可能并不完美,但要让用户知道你仍然有完善这个项目的计划。这个部分也能让整个社区构建一个强大的生态,因此还要向用户提供表达他们对未来展望的看法的交流区。 + +以上这几个部分或许还没有在你的文档中出现,甚至可能会在后期才能出现,尤其是“使用案例”部分。尽管如此,还是应该在文档中逐渐加入这些部分。如果用户对“入门”部分已经感觉良好,那以上这几个部分将会提起用户更大的兴趣。 + +最后,请在“入门”部分、README 文件或其它显眼的位置注明整个项目所使用的许可证。这个细节会让你的项目更容易通过终端用户的审核。 + +### 花 20% 的时间写作 + +一般情况下,我建议把整个项目 10% 到 20% 的时间用在文档写作上。也就是说,如果你是全职进行某一个项目的,文档写作需要在其中占半天到一天。 + +再细致一点,应该将写作纳入到常规的工作流程中,这样它就不再是一件孤立的琐事,而是日常的事务。文档写作应该随着工作进度同步进行,切忌将所有写作任务都堆积起来最后完成,这样才可以帮助你的项目达到最终目标:吸引用户、获得信任。 + +* * * + +_特别鸣谢云原生计算基金会的布道师 [Luc Perkins][9] 给出的宝贵意见。_ + +_本文首发于_ _[COSS Media][10]_ _并经许可发布。_ + +Nigel Babu 提供了 10 条帮助编写项目文档的有用技巧。 + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/documentation + +作者:[Kevin Xu][a] +选题:[lujun9972][b] +译者:[HankChow](https://github.com/HankChow) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/kevin-xu +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-docdish-typewriter-pink.png?itok=OXJBtyYf (A pink typewriter) +[2]: https://www.grammar-monster.com/glossary/active_voice.htm +[3]: http://www.hemingwayapp.com/ +[4]: https://www.grammarly.com/ +[5]: https://en.wikipedia.org/wiki/Pareto_principle +[6]: https://linkerd.io/2/getting-started/ +[7]: https://opensource.com/article/19/11/products-open-source-projects +[8]: https://opensource.com/article/20/2/product-marketing-open-source-project +[9]: https://twitter.com/lucperkins +[10]: https://coss.media/open-source-documentation-technical-writing-101/ diff --git a/translated/tech/20200312 Make SSL certs easy with k3s.md b/translated/tech/20200312 Make SSL certs easy with k3s.md new file mode 100644 index 0000000000..241f8891f5 --- /dev/null +++ b/translated/tech/20200312 Make SSL certs easy with k3s.md @@ -0,0 +1,333 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: 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) + +用 k3s 轻松管理 SSL 证书 +====== + +> 如何在树莓派上使用 k3s 和 Let's Encrypt 来加密你的网站。 + +![Files in a folder][1] + +在[上一篇文章][2]中,我们在 k3s 集群上部署了几个简单的网站。那些是未加密的网站。很好,它们可以工作,但是未加密的网站有点太过时了!如今,大多数网站都是加密的。在本文中,我们将安装 [cert-manager][3] 并将其用于在集群上以部署采用 TLS 加密的网站。这些网站不仅会被加密,而且还会使用有效的公共证书,这些证书会从 [Let's Encrypt][4] 自动获取和更新!让我们开始吧! + +### 所需材料 + +要继续阅读本文,你将需要我们在上一篇文章中构建的 [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 的 “机密信息secrets” 中。我认为,“机密信息”可以简单地按名称引用,因此更易于使用。这就是我们在本文中使用 cert-manager 的主要原因。 + +### 安装 cert-manager + +通常,我们只是遵循 cert-manager 的[文档][8]在 Kubernetes 上进行安装。但是,由于我们使用的是 ARM 体系结构,因此我们需要进行一些更改,以便我们可以完成这个操作。 + +第一步是创建 cert-manager 命名空间。命名空间有助于将 cert-manager 的吊舱Pod排除在我们的默认命名空间之外,因此当我们使用自己的“吊舱”执行 `kubectl get pods` 之类的操作时,我们不必看到它们。创建名称空间很简单: + +``` +kubectl create namespace cert-manager +``` + +这份安装说明会告诉你下载 cert-manager 的 YAML 配置文件并将其一步全部应用到你的集群。我们需要将其分为两个步骤,以便为基于 ARM 的树莓派修改文件。我们将下载文件并一步一步进行转换: + +``` +curl -sL \ +https://github.com/jetstack/cert-manager/releases/download/v0.11.0/cert-manager.yaml |\ +sed -r 's/(image:.*):(v.*)$/\1-arm:\2/g' > cert-manager-arm.yaml +``` + +这会下载配置文件,并将所有包含的 docker 镜像更新为 ARM 版本。来检查一下它做了什么: + + +``` +$ grep image: cert-manager-arm.yaml +          image: "quay.io/jetstack/cert-manager-cainjector-arm:v0.11.0" +          image: "quay.io/jetstack/cert-manager-controller-arm:v0.11.0" +          image: "quay.io/jetstack/cert-manager-webhook-arm:v0.11.0" +``` + +如我们所见,三个镜像现在在镜像名称上添加了 `-arm`。现在我们有了正确的文件,我们只需将其应用于集群: + +``` +kubectl apply -f cert-manager-arm.yaml +``` + +这将安装所有的 cert-manager。我们可以通过 `kubectl --namespace cert-manager get pods` 来检查安装何时完成,直到所有“吊舱”都处于 `Running` 状态。 + +这实际上就完成了 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 会自动为我们更新证书。 + +在本文中,我们将使用 HTTP 验证方法,因为它更易于设置并且适用于大多数情况。以下是幕后将发生的基本过程。cert-manager 将向 Let's Encrypt 发出证书请求。作为回应,Let's Encrypt 将发出所有权验证的质询challenges。这个质询是将一个 HTTP 资源放在请求证书的域名下的一个特定 URL 上。从理论上讲,如果我们可以将该资源放在该 URL 上,并且让 Let's Encrypt 可以远程获取它,那么我们实际上必须是该域的所有者。否则,要么我们无法将资源放置在正确的位置,要么我们无法操纵 DNS 以使 Let's Encrypt 访问它。在这种情况下,cert-manager 会将资源放在正确的位置,并自动创建一个临时的 `Ingress` 记录,以将流量路由到正确的位置。如果 Let's Encrypt 可以读到该质询要求的资源并正确无误,它将把证书发回给 cert-manager。然后,cert-manager 将证书存储为“机密信息”,然后我们的网站(或其他任何网站)将使用这些证书通过 TLS 保护我们的流量。 + +### 为该质询设置网络 + +我假设你要在家庭网络上进行设置,并拥有一个以某种方式连接到更广泛的互联网的路由器/接入点。如果不是这种情况,则可能不需要以下过程。 + +为了使质询过程正常运行,我们需要一个我们要申请证书的域名,以将其路由到端口 80 上的 k3s 集群。为此,我们需要告诉世界上的 DNS 系统它的位置。因此,我们需要将域名映射到我们的公共 IP 地址。如果你不知道你的公共 IP 地址是什么,可以访问 [WhatsMyIP][9] 之类的地方,它会告诉你。接下来,我们需要输入 DNS 的 A 记录,该记录将我们的域名映射到我们的公共 IP 地址。为了使此功能可靠地工作,你需要一个静态的公共 IP 地址,或者你可以使用动态 DNS 提供商。一些动态 DNS 提供商会向你颁发一个域名,你可以按照以下说明使用它。我没有尝试过,所以不能肯定地说它适用于所有提供商。 + +对于本文,我们将假设有一个静态公共 IP 并使用 CloudFlare 来设置 DNS 的 A 记录。如果愿意,可以使用自己的 DNS 提供程序。重要的是你可以设置 A 记录。 + +在本文的其余部分中,我将使用 [k3s.carpie.net][10] 作为示例域,因为这是我拥有的域。你显然会用自己拥有的任何域替换它。 + +为示例起见,假设我们的公共 IP 地址是 198.51.100.42。我们将转到我们的 DNS 提供商的 DNS 记录部分,并添加一个名为 [k3s.carpie.net][10] 的类型为 `A` 的记录(CloudFlare 已经假定了域的部分,因此我们只需输入 `k3s`),然后输入 `198.51.100.42` 作为 IPv4 地址。 + +![][11] + +请注意,有时 DNS 更新要传播一段时间。你可能需要几个小时才能解析该名称。在继续之前该名称必须可以解析。否则,我们所有的证书请求都将失败。 + +我们可以使用 `dig` 命令检查名称是否解析: + +``` +$ dig +short k3s.carpie.net +198.51.100.42 +``` + +继续运行以上命令,直到可以返回 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 来进行访问。因此,现在进行映射很方便。我们保存并应用更改,应该一切顺利! + +### 配置 cert-manager 来使用 Let's Encrypt(暂存环境) + +现在,我们需要配置 cert-manager 来通过 Let's Encrypt 颁发证书。Let's Encrypt 为我们提供了一个暂存(例如用于测试)环境,以便审视我们的配置。这样它更能容忍错误和请求的频率。如果我们对生产环境做了错误的操作,我们很快就好发现自己被暂时禁止访问了!因此,我们将使用暂存环境手动测试请求。 + +创建一个文件 `letsencrypt-issuer-staging.yaml`,内容如下: + +``` +apiVersion: cert-manager.io/v1alpha2 +kind: ClusterIssuer +metadata: + name: letsencrypt-staging +spec: + acme: + # The ACME server URL + server: https://acme-staging-v02.api.letsencrypt.org/directory + # Email address used for ACME registration + email: @example.com + # Name of a secret used to store the ACME account private key + privateKeySecretRef: + name: letsencrypt-staging + # Enable the HTTP-01 challenge provider + solvers: + - http01: + ingress: + class: traefik +``` + +请确保将电子邮件地址更新为你的地址。如果出现问题或我们弄坏了一些东西,这就是 Let's Encrypt 与我们联系的方式! + +现在,我们使用以下方法创建发行者: + +``` +kubectl apply -f letsencrypt-issuer-staging.yaml +``` + +我们可以使用以下方法检查发行者是否已成功创建: + +``` +kubectl get clusterissuers +``` + +`clusterissuers` 是由 cert-manager 创建的一种新的 Kubernetes 资源类型。 + +现在让我们手动请求一个测试证书。对于我们的网站,我们不需要这样做;我们只是在测试这个过程,以确保我们的配置正确。 + +创建一个包含以下内容的证书请求文件 `le-test-certificate.yaml`: + + +``` +apiVersion: cert-manager.io/v1alpha2 +kind: Certificate +metadata: + name: k3s-carpie-net + namespace: default +spec: + secretName: k3s-carpie-net-tls + issuerRef: + name: letsencrypt-staging + kind: ClusterIssuer + commonName: k3s.carpie.net + dnsNames: + - k3s.carpie.net +``` + +该记录仅表示我们要使用名为 `letsencrypt-staging`(我们在上一步中创建的)的 `ClusterIssuer` 来请求域 [k3s.carpie.net][10] 的证书,并在 Kubernetes 的机密信息中名为 `k3s-carpie-net-tls` 文件中存储该证书。 + +像平常一样应用它: + +``` +kubectl apply -f le-test-certificate.yaml +``` + +我们可以通过以下方式查看状态: + +``` +kubectl get certificates +``` + +如果我们看到类似以下内容: + +``` +NAME                    READY   SECRET                  AGE +k3s-carpie-net          True    k3s-carpie-net-tls      30s +``` + +我们走在幸福之路!(这里的关键是`READY` 是 `True`)。 + +### 解决证书颁发问题 + +上面是幸福的道路。如果 `READY` 为 `False`,我们可以等等它,然后再次花点时间检查状态。如果它一直是 `False`,那么我们就有一个需要解决的问题。此时,我们可以遍历 Kubernetes 资源链,直到找到一条告诉我们问题的状态消息。 + +假设我们执行了上面的请求,而 `READY` 为 `False`。我们可以从以下方面开始故障排除: + +``` +kubectl describe certificates k3s-carpie-net +``` + +这将返回很多信息。通常,有用的内容位于 `Events:` 部分,该部分通常位于底部。假设最后一个事件是 `Created new CertificateRequest resource "k3s-carpie-net-1256631848`。然后我们描述 describe一些该请求: + +``` +kubectl describe certificaterequest k3s-carpie-net-1256631848 +``` + +现在比如说最后一个事件是 `Waiting on certificate issuance from order 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"`。让我们描述一下该质询: + +``` +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,并进行所需的任何更改。 + +### 清理我们的测试证书 + +我们实际上想要使用的是域名的真实证书,所以让我们继续清理证书和我们刚刚创建的机密信息: + +``` +kubectl delete certificates k3s-carpie-net +kubectl delete secrets k3s-carpie-net-tls +``` + +### 配置 cert-manager 以使用 Let's Encrypt(生产环境) + +现在我们已经有了测试证书,是时候移动到生产环境了。就像我们在 Let's Encrypt 暂存环境中配置 cert-manager 一样,我们现在也需要对生产环境进行同样的操作。创建一个名为 `letsencrypt-issuer-production.yaml` 的文件(如果需要,可以复制和修改暂存环境的文件),其内容如下: + +``` +apiVersion: cert-manager.io/v1alpha2 +kind: ClusterIssuer +metadata: +name: letsencrypt-prod +spec: +acme: + # The ACME server URL + server: https://acme-v02.api.letsencrypt.org/directory + # Email address used for ACME registration + email: @example.com + # Name of a secret used to store the ACME account private key + privateKeySecretRef: + name: letsencrypt-prod + # Enable the HTTP-01 challenge provider + solvers: + - http01: + ingress: + class: traefik +``` + +(如果要从暂存环境进行复制,则唯一的更改是 `server:` URL。也请不要忘记修改电子邮件!) + +应用它: + +``` +kubectl apply -f letsencrypt-issuer-production.yaml +``` + +### 申请我们网站的证书 + +重要的是要注意,我们到目前为止完成的所有步骤都是一次性设置的!对于将来的任何其他申请,我们可以从这个说明开始! + +让我们部署在[上一篇文章][13]中部署的同样站点。(如果仍然可用,则可以修改 YAML 文件。如果没有,则可能需要重新创建并重新部署它)。 + +我们只需要将 `mysite.yaml` 的 `Ingress` 部分修改为: + +``` +--- +apiVersion: networking.k8s.io/v1beta1 +kind: Ingress +metadata: + name: mysite-nginx-ingress + annotations: + kubernetes.io/ingress.class: "traefik" + cert-manager.io/cluster-issuer: letsencrypt-prod +spec: + rules: + - host: k3s.carpie.net + http: + paths: + - path: / + backend: + serviceName: mysite-nginx-service + servicePort: 80 + tls: + - hosts: + - k3s.carpie.net + 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` 中。 + +请记住,我们没有创建这些证书!(好吧,我们创建了名称相似的测试证书,但我们删除了这些证书。)Traefik 将读取这些配置并继续寻找机密信息。当找不到时,它会看到注释说我们想使用 `letsencrypt-prod` 发行者来获取它。由此,它将提出请求并为我们安装证书到机密信息之中! + +大功告成! 让我们尝试一下。 + +它现在具有了加密 TLS 所有优点!恭喜你! + +-------------------------------------------------------------------------------- + +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) + +本文由 [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 +[3]: https://cert-manager.io/ +[4]: https://letsencrypt.org/ +[5]: https://opensource.com/article/20/3/kubernetes-raspberry-pi-k3s +[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/ +[9]: https://whatsmyip.org/ +[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 +[14]: http://cert-manager.io/cluster-issuer diff --git a/translated/tech/20200320 How to Check Password Expiration Date for All Users on Linux.md b/translated/tech/20200320 How to Check Password Expiration Date for All Users on Linux.md new file mode 100644 index 0000000000..0991e386b8 --- /dev/null +++ b/translated/tech/20200320 How to Check Password Expiration Date for All Users on Linux.md @@ -0,0 +1,124 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Check Password Expiration Date for All Users on Linux) +[#]: via: (https://www.2daygeek.com/linux-check-user-password-expiration-date/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +如何在 Linux 上检查所有用户密码到期日期 +====== + +如果你在 **[Linux 上启用了密码策略][1]**。 + +密码必须在到期前进行更改,并且登录到系统时会收到通知。 + +如果你很少使用自己的帐户,那么可能由于密码过期而被锁定。 + +在许多情况下,这可能会在[无需密码登录][2]的服务帐户中发生,因为没人会注意到它。 + +这将导致停止服务器上配置的 **[cronjob/crontab][3]**。 + +如果如此,该如何缓解这种情况。 + +你可以写一个 **[shell 脚本][4]**来获得有关它的通知,我们前一段时间为此写了一篇文章。 + + * **[发送 “X” 日内到期的用户帐户列表邮件的 Bash 脚本][5]** + + + +它将给出天数,但是本文旨在在终端中给你实际日期。 + +这可以使用 chage 命令来实现。 + +### 什么是 chage 命令? + +chage 代表更改时效 (change age)。它更改用户密码到期信息。 + +chage 命令更改两次密码更改之间的天数,以及最后一次更改密码的日期。 + +系统使用此信息来确定用户何时应更改密码。 + +它允许用户执行其他功能,例如设置帐户到期日期、在到期后将密码设置为无效、显示帐户时效信息、设置密码更改之前的最小和最大天数以及设置到期警告天数。 + +### 1)如何在 Linux 上检查特定用户的密码到期日期 + +如果要检查 Linux 上特定用户的密码到期日期,请使用以下命令。 + +``` +# chage -l daygeek + +Last password change : Feb 13, 2020 +Password expires : May 13, 2020 +Password inactive : never +Account expires : never +Minimum number of days between password change : 7 +Maximum number of days between password change : 90 +Number of days of warning before password expires : 7 +``` + +### 2)如何在 Linux 上检查所有用户的密码到期日期 + +You can use the chage command directly for a single user, which may not work as expected for many users, but you can use it. +你可以直接对单个用户使用 chage 命令,这对你可以使用的多个用户可能无效。 + +为此,你需要编写一个小的 shell 脚本。下面的 shell 脚本可以列出添加到系统中的所有用户,包括系统用户。 + +``` +# for user in $(cat /etc/passwd |cut -d: -f1); do echo $user; chage -l $user | grep "Password expires"; done | paste -d " " - - | sed 's/Password expires//g' +``` + +你将得到类似以下的输出,但是用户名可能不同。 + +``` +root : never +bin : never +daemon : never +adm : never +lp : never +sync : never +shutdown : never +u1 : Nov 12, 2018 +u2 : Jun 17, 2019 +u3 : Jun 17, 2019 +u4 : Jun 17, 2019 +u5 : Jun 17, 2019 +``` + +### 3)如何检查 Linux 上除系统用户外的所有用户的密码有效期 + +下面的 shell 脚本将显示有到期日期的用户列表。 + +``` +# for user in $(cat /etc/passwd |cut -d: -f1); do echo $user; chage -l $user | grep "Password expires"; done | paste -d " " - - | sed 's/Password expires//g' | grep -v "never" +``` + +你将得到类似以下的输出,但是用户名可能不同。 + +``` +u1 : Nov 12, 2018 +u2 : Jun 17, 2019 +u3 : Jun 17, 2019 +u4 : Jun 17, 2019 +u5 : Jun 17, 2019 +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/linux-check-user-password-expiration-date/ + +作者:[Magesh Maruthamuthu][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://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/how-to-set-password-complexity-policy-on-linux/ +[2]: https://www.2daygeek.com/configure-setup-passwordless-ssh-key-based-authentication-linux/ +[3]: https://www.2daygeek.com/linux-crontab-cron-job-to-schedule-jobs-task/ +[4]: https://www.2daygeek.com/category/shell-script/ +[5]: https://www.2daygeek.com/bash-script-to-check-user-account-password-expiry-linux/ diff --git a/translated/tech/20200327 How open source software is fighting COVID-19.md b/translated/tech/20200327 How open source software is fighting COVID-19.md new file mode 100644 index 0000000000..dae4f55de7 --- /dev/null +++ b/translated/tech/20200327 How open source software is fighting COVID-19.md @@ -0,0 +1,107 @@ +[#]: collector: (lujun9972) +[#]: translator: (HankChow) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How open source software is fighting COVID-19) +[#]: via: (https://opensource.com/article/20/3/open-source-software-covid19) +[#]: author: (Jeff Stern https://opensource.com/users/jeffstern) + +开源软件在应对 COVID-19 中的贡献 +====== +> 在新冠疫情爆发之际,涌现了数以千计的开源项目,今天我们来了解其中四个。 + +![symbols showing healthcare][1] + +在当前紧张的疫情环境下,保持专注和积极性是一个很大的挑战。而研究开源社区如何应对这一次疫情爆发,对于我来说却成为了一种宣泄。 + +从今年一月底开始,整个开源社区已经贡献了数以千计关于冠状病毒或 COVID-19 的[开源软件库][2],其中涉及的内容包括但不限于数据集、模型、可视化、Web 应用、移动应用,且大多数都使用了 JavaScript 和 Python 编写。 + +之前我们分享过一些关于开源硬件厂商在帮助遏制冠状病毒传播方面做的[贡献][3],现在将继续分享四个由开源社区作出的应对冠状病毒和 COVID-19 的项目,这体现了开发者们和整个开源社区在当下对整个世界的影响力。 + +### 1. PennSignals:CHIME + +![CHIME by PennSignals][4] + +COVID-19 流行病医院影响模型COVID-19 Hospital Impact Model for Epidemics([CHIME][5])是由宾夕法尼亚大学 Penn Medicine 机构的数据科学家们建立的开源在线应用,它可以让医院更好地了解本次新型冠状病毒对医院需求的影响。 + +医院的管理人员可以通过 CHIME 来大致预测未来几天和几周内将会有多少患者需要住院治疗,并推算 ICU 和呼吸机的需求量。只需要输入当前住院患者数以及一些相关的变量,就可以看到未来几天内需求的变化情况。 + +CHIME 主要使用 Python 开发,并通过 [pandas][6] 这个开源库实现了大部分的数据转换和数值计算,最终得出相关的估计值。pandas 的背后有一个强大的团队进行支持,因此它是在数据分析方面被广泛使用的 Python 库之一。和很多其它的开源项目一样,pandas 团队的收入大部分来源于[用户的资金支持][7]。 + +### 2. Locale.ai:Real-time COVID-19 visualization + +![Locale.ai COVID-19 visualization][8] + +实时显示世界各地病例数量分布的地图可以让我们直观了解 COVID-19 的规模和扩散程度。Locale.ai 就开发了这样一个开源、可交互的 [COVID-19 已知病例可视化分布图][9],这个图会根据最新的可靠数据实时进行更新。 + +这个项目有趣的地方在于,它的数据是是通过 GitHub 用户 ExpDev07 创建的[开源 API][10] 进行检索的,这个 API 的数据来源是[约翰·霍普金斯大学的开源数据集][11],而约翰·霍普金斯大学这份聚合了多个来源的数据集则是 GitHub 上 COVID-19 相关的最受欢迎的项目。这就是开源项领域中分支带来的一大好处。 + +Locale.ai 的这个图表通过 [Vue.js][11] 开发。Vue.js 是一个在 Web 应用开发方面非常流行的框架,它是由[尤雨溪][12]创造并维护的。值得一提的是,尤雨溪是全职参与开源项目维护的少数人之一。 + +### 3. BlankerL:DXY-COVID-19-Crawler + +![BlankerL DXY-COVID-19-Crawler][13] + +[DXY-COVID-19-Crawler][14] 建立于今年 1 月份,是开源社区对 COVID-19 最早发起响应的项目之一。当时 COVID-19 主要在中国范围内传播,中国医学界通过[丁香园][15]网站来进行病例的报告和跟踪。为了使这些疫情信息具有更高的可读性和易用性,GitHub 用户 BlankerL 开发了一个爬虫,系统地从丁香园网站获取数据,并通过 API 和数据仓库的方式对外公开。这些数据也被学术研究人员用于研究病毒传播趋势和制作相关的可视化图表。到目前为止,DXY-COVID-19-Crawler 这个项目已经获得了超过 1300 个星标和近 300 次的复刻。 + +BlankerL 使用 Python 和 [Beautiful Soup][16] 库开发了这个爬虫。Beautiful Soup 是 Python 开发者用于从页面 HTML DOM 中提取信息的库,它由 Leonard Richardson 维护,这位作者i你另外还全职担任软件架构师。 + +### 4. 东京 COVID-19 工作组网站 + +![City of Tokyo's COVID-19 Task Force site][17] + +世界各地很多城市都在网络上持续更新当地的 COVID-19 信息。东京都政府则为此创建了一个[综合性的网站][18],让东京当地居民、在东京设有办事处的公司以及到东京的游客了解最新情况,并采取相应的预防措施。 + +这个网站的不同之处在于它是由东京都政府[开源][19]的。这个项目受到了来自 180 多名用户的贡献,日本的[长野市、千叶市、福冈市][20]还对这个网站进行了改造。这个项目是城市公共建设更好地服务大众的有力示范。 + +这个开源网站也使用了很多开源技术。通过 [Tidelift][21],我留意到项目中存在了 1365 个依赖项,其中 38 个是由开发者直接使用的依赖项。也就是说,超过一千多个开源项目(包括 [Nuxt.js][22]、[Prettier][23]、[Babel][24]、[Ajv][25] 等等)都为东京向市民共享信息提供了帮助。 + +![Dependencies in Tokyo's COVID-19 Task Force site][26] + +### 其它项目 + +除此以外,还有很多[响应 COVID-19 的重要项目][27]正在公开进行当中。在这次研究中,开源社区应对流行病以及利用开源技术开展工作的方式让我深受启发。接下来的一段时间都是应对疫情的关键时期,我们也可以继续在开源社区中寻找到更大的动力。 + +如果你也参与到了 COVID-19 相关的开源项目当中,欢迎在评论区分享。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/open-source-software-covid19 + +作者:[Jeff Stern][a] +选题:[lujun9972][b] +译者:[HankChow](https://github.com/HankChow) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jeffstern +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/Medical%20costs.jpg?itok=ke57j6cs (symbols showing healthcare) +[2]: https://github.com/search?q=coronavirus+OR+covid19 +[3]: https://opensource.com/article/20/3/open-hardware-covid19 +[4]: https://opensource.com/sites/default/files/uploads/chime_pennsignals.png (CHIME by PennSignals) +[5]: http://penn-chime.phl.io/ +[6]: https://tidelift.com/subscription/pkg/pypi-pandas +[7]: https://pandas.pydata.org/about/sponsors.html +[8]: https://opensource.com/sites/default/files/uploads/locale-ai-visualization.png (Locale.ai COVID-19 visualization) +[9]: https://github.com/localeai/covid19-live-visualization +[10]: https://github.com/CSSEGISandData/COVID-19 +[11]: https://tidelift.com/subscription/pkg/npm-vue +[12]: https://blog.tidelift.com/vuejs-evan-you-javascript-framework +[13]: https://opensource.com/sites/default/files/uploads/dxy-covid-19-crawler.png (BlankerL DXY-COVID-19-Crawler) +[14]: https://github.com/BlankerL/DXY-COVID-19-Crawler +[15]: https://dxy.cn +[16]: https://blog.tidelift.com/beautiful-soup-is-now-part-of-the-tidelift-subscription +[17]: https://opensource.com/sites/default/files/uploads/tokyo-covid19-task-force.png (City of Tokyo's COVID-19 Task Force site) +[18]: https://stopcovid19.metro.tokyo.lg.jp/en/ +[19]: https://github.com/tokyo-metropolitan-gov/covid19 +[20]: https://github.com/tokyo-metropolitan-gov/covid19/issues/1802 +[21]: https://tidelift.com/ +[22]: https://tidelift.com/subscription/pkg/npm-nuxt +[23]: https://blog.tidelift.com/prettier-is-now-part-of-the-tidelift-subscriptions +[24]: https://tidelift.com/subscription/pkg/npm-babel +[25]: https://blog.tidelift.com/ajv-is-now-part-of-the-tidelift-subscription +[26]: https://opensource.com/sites/default/files/uploads/tokyo-dependencies.png (Dependencies in Tokyo's COVID-19 Task Force site) +[27]: https://github.com/soroushchehresa/awesome-coronavirus