mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-02-03 23:40:14 +08:00
commit
c0e14c0d78
1208
published/20180629 100 Best Ubuntu Apps.md
Normal file
1208
published/20180629 100 Best Ubuntu Apps.md
Normal file
File diff suppressed because it is too large
Load Diff
117
published/20190320 4 cool terminal multiplexers.md
Normal file
117
published/20190320 4 cool terminal multiplexers.md
Normal file
@ -0,0 +1,117 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11054-1.html)
|
||||
[#]: subject: (4 cool terminal multiplexers)
|
||||
[#]: via: (https://fedoramagazine.org/4-cool-terminal-multiplexers/)
|
||||
[#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/)
|
||||
|
||||
4 款很酷的终端复用器
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
Fedora 系统对很多用户来说都很舒适。它有一个令人惊叹的桌面,可以轻松地完成日常任务。而在这光鲜的表面之下是由 Linux 系统提供的支持,而终端是高级用户使用这些底层能力的最简单方法。默认的终端简单且功能有限。但是,*终端复用器*能让你的终端变得非常强大。本文展示了一些流行的终端多路复用器以及如何安装它们。
|
||||
|
||||
为什么要用它?嗯,首先,它可以让你注销你的系统,而同时*让你的终端会话不受干扰*。退出你的控制台,这样安全,在其他地方旅行时通过远程登录 SSH 继续之前的操作是非常有用的。这里有一些工具可以看下。
|
||||
|
||||
最古老和最知名的终端多路复用器之一是 `screen`。但是,由于其代码不再维护,本文将重点介绍最近的应用。 (“最近的”是相对而言的,其中一些已存在多年!)
|
||||
|
||||
### Tmux
|
||||
|
||||
`tmux` 是 `screen` 最广泛使用的替代品之一。它有高度可配置的接口。你可以根据需要对 `tmux` 进行编程以启动特定类型的会话。在前面发表的这篇文章中你会发现更多关于 tmux 的信息:
|
||||
|
||||
- [使用 tmux 实现更强大的终端][2]
|
||||
|
||||
已经是 `tmux` 用户?你可能会喜欢[这篇使你的 tmux 会话更有效的文章][3]。
|
||||
|
||||
要安装 `tmux`,由于你可能已经在终端中,请带上 `sudo` 使用 `dnf`:
|
||||
|
||||
```
|
||||
$ sudo dnf install tmux
|
||||
```
|
||||
|
||||
要开始学习,请运行 `tmux` 命令。单窗格窗口以你的默认 shell 启动。tmux 使用*修饰键*来表示接下来会发出命令。默认情况下,此键为 `Ctrl+B`。如果输入 `Ctrl+B, C`,你将创建一个带有 shell 的新窗口。
|
||||
|
||||
提示:使用 `Ctrl+B, ?` 进入帮助模式,会列出你可以使用的所有键。为了简单起见,你先查看 `bind-key -T prefix` 开头的行。这些是你可以在修饰键之后立即使用的键,可以用来配置你的 `tmux` 会话。你可以按 `Ctrl+C` 退出帮助模式回 `tmux`。
|
||||
|
||||
要完全退出 `tmux`,请使用标准 `exit` 命令或 `Ctrl+D` 退出所有 shell。
|
||||
|
||||
### Dvtm
|
||||
|
||||
你可能最近在 Fedroa Magzine 上看到过一篇 [dwm,一个动态窗口管理器][4]的文章。像 `dwm` 一样,`dvtm` 用于平铺窗口管理,但是是用在终端中。它的设计坚持 UNIX 的“做好一件事”的理念,在这里是管理终端中的窗口。
|
||||
|
||||
安装 `dvtm` 也很简单。但是,如果你想要前面提到的注销功能,你还需要 `abduco` 包来处理 dvtm 的会话管理。
|
||||
|
||||
```
|
||||
$ sudo dnf install dvtm abduco
|
||||
```
|
||||
|
||||
`dvtm` 已经映射了许多管理终端窗口的按键。默认情况下,它使用 `Ctrl+G` 作为其修饰键。这个按键告诉 `dvtm` 接下来的字符将成为它应该处理的命令。例如, `Ctrl+G, C` 创建一个新窗口,`Ctrl+G, X` 将其关闭。
|
||||
|
||||
有关使用 `dvtm` 的更多信息,请查看 `dvtm` 的[主页][5],其中包含大量提示和入门信息。
|
||||
|
||||
### Byobu
|
||||
|
||||
虽然 `byobu` 本身并不是真正的多路复用器 —— 它封装了 `tmux` 甚至更老的 `screen` 来添加功能,但它也值得在这里一提。通过帮助菜单和窗口选项卡,以便更加容易地找到那些功能,`byobu` 使终端复用器更适合初学者。
|
||||
|
||||
当然它也可以在 Fedora 仓库中找到。要安装它,请使用以下命令:
|
||||
|
||||
```
|
||||
$ sudo dnf install byobu
|
||||
```
|
||||
|
||||
默认情况下,`byobu` 会在内部运行 `screen`,因此你可能希望运行 `byobu-tmux` 来封装 `tmux`。你可以使用 `F9` 键打开帮助菜单以获取更多信息,来帮助你入门。
|
||||
|
||||
### Mtm
|
||||
|
||||
`mtm` 是你可以找到的最小的复用器之一。事实上,它只有大约 1000 行代码!如果你处于受限的环境(例如旧硬件、最小容器等)中,你可能会发现它很有用。要开始使用,你需要安装一些包。
|
||||
|
||||
```
|
||||
$ sudo dnf install git ncurses-devel make gcc
|
||||
```
|
||||
|
||||
然后克隆 `mtm` 所在的仓库:
|
||||
|
||||
```
|
||||
$ git clone https://github.com/deadpixi/mtm.git
|
||||
```
|
||||
|
||||
进入 `mtm` 文件夹并构建程序:
|
||||
|
||||
```
|
||||
$ make
|
||||
```
|
||||
|
||||
你可能会收到一些警告,但完成后,你将会有一个非常小的 `mtm` 程序。使用以下命令运行它:
|
||||
|
||||
```
|
||||
$ ./mtm
|
||||
```
|
||||
|
||||
你可以在 [GitHub 页面][6]上找到该程序的所有文档。
|
||||
|
||||
这里只是一些终端复用器。你有想推荐的么?请在下面留下你的评论,享受在终端中创建窗口吧!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/4-cool-terminal-multiplexers/
|
||||
|
||||
作者:[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/2018/08/tmuxers-4-816x345.jpg
|
||||
[2]: https://fedoramagazine.org/use-tmux-more-powerful-terminal/
|
||||
[3]: https://fedoramagazine.org/4-tips-better-tmux-sessions/
|
||||
[4]: https://fedoramagazine.org/lets-try-dwm-dynamic-window-manger/
|
||||
[5]: http://www.brain-dump.org/projects/dvtm/#why
|
||||
[6]: https://github.com/deadpixi/mtm
|
||||
[7]: https://unsplash.com/photos/48yI_ZyzuLo?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
|
||||
[8]: https://unsplash.com/search/photos/windows?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
|
@ -1,34 +1,30 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (robsean)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11051-1.html)
|
||||
[#]: subject: (5 Easy Ways To Free Up Space (Remove Unwanted or Junk Files) on Ubuntu)
|
||||
[#]: via: (https://www.2daygeek.com/linux-remove-delete-unwanted-junk-files-free-up-space-ubuntu-mint-debian/)
|
||||
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||
|
||||
5种简单的方法来在 Ubuntu 上释放空间(移除不想要的或没有用的文件)
|
||||
5 种在 Ubuntu 上释放空间的简单方法
|
||||
======
|
||||
|
||||
我们中的大多数人可能在系统磁盘存储不足的情况下执行这个操作。
|
||||
![](https://img.linux.net.cn/data/attachment/album/201907/03/165641h0xy91x9109wz19w.jpg)
|
||||
|
||||
我们中的大多数人可能在 Linux 系统磁盘存储不足的情况下执行这个操作。
|
||||
大多数人可能在系统磁盘存储不足的情况下执行释放空间这个操作,也可能在 Linux 系统磁盘存储满了的情况下执行这个操作。
|
||||
|
||||
它应该被经常执行,来为安装一个新的应用程序和处理其它文件弥补磁盘存储空间。
|
||||
|
||||
内务处理是 Linux 管理员的一个日常任务,管理员允许内务处理在阈值下维持磁盘利用率。
|
||||
它应该被经常执行,来为安装一个新的应用程序和处理其它文件弥补磁盘存储空间。保持可用空间是 Linux 管理员的一个日常任务,以允许磁盘利用率维持在阈值之下。
|
||||
|
||||
这里有一些我们可以清理我们系统空间的方法。
|
||||
|
||||
当你有 TB 级存储容量时,不需要清理你的系统。
|
||||
|
||||
但是,如果你空间有限,那么释放磁盘空间,变的不可避免。
|
||||
当你有 TB 级存储容量时,可能不需要清理你的系统。但是,如果你空间有限,那么释放磁盘空间就变的不可避免。
|
||||
|
||||
在这篇文章中,我将向你展示一些最容易的或简单的方法来清理你的 Ubuntu 系统,获得更多空间。
|
||||
|
||||
### 在 Ubuntu 系统上如何检查可用的空间?
|
||||
|
||||
在你的系统上使用 **[df 命令][1]** 来检查当前磁盘利用率。
|
||||
在你的系统上使用 [df 命令][1] 来检查当前磁盘利用率。
|
||||
|
||||
```
|
||||
$ df -h
|
||||
@ -42,17 +38,12 @@ tmpfs 997M 0 997M 0% /sys/fs/cgroup
|
||||
```
|
||||
|
||||
图形界面用户可以使用“磁盘利用率分析器工具”来查看当前利用率。
|
||||
[![][2]![][2]][3]
|
||||
|
||||
### 1) 移除不再需要的软件包
|
||||
![][3]
|
||||
|
||||
下面的命令移除系统不再需要依赖的库和软件包。
|
||||
#### 1) 移除不再需要的软件包
|
||||
|
||||
这些软件包自动地安装来使一个被安装软件包满足的依赖关系。
|
||||
|
||||
同样,它移除安装在系统中的旧的 Linux 内核。
|
||||
|
||||
它移除不再被系统需要的孤立的软件包,但是不清除它们。
|
||||
下面的命令移除系统不再需要的依赖库和软件包。这些软件包是自动安装的,以使一个安装的软件包满足依赖关系。同样,它也会移除安装在系统中的 Linux 旧内核。它会移除不再被系统需要的孤儿软件包,但是不会清除它们。
|
||||
|
||||
```
|
||||
$ sudo apt-get autoremove
|
||||
@ -71,7 +62,7 @@ After this operation, 189 MB disk space will be freed.
|
||||
Do you want to continue? [Y/n]
|
||||
```
|
||||
|
||||
为清除它们,与命令一起使用 `--purge` 选项。
|
||||
为清除它们,可以与命令一起使用 `--purge` 选项。
|
||||
|
||||
```
|
||||
$ sudo apt-get autoremove --purge
|
||||
@ -90,26 +81,21 @@ After this operation, 189 MB disk space will be freed.
|
||||
Do you want to continue? [Y/n]
|
||||
```
|
||||
|
||||
### 2) 清空回收站
|
||||
#### 2) 清空回收站
|
||||
|
||||
这可能有风险,你可能有大量的无用数据存在于你的回收站中。
|
||||
|
||||
它占用你的系统空间。这是最好的一个方法来在你的系统上清理这些无用的数据,并获取一些可用的空间。
|
||||
有可能你的回收站里面有大量的无用数据。它会占用你的系统空间。最好解决方法之一是在你的系统上清理这些无用的数据,以获取一些可用的空间。
|
||||
|
||||
为清理这些,简单地使用文件管理器来清空你的回收站。
|
||||
[![][2]![][2]][4]
|
||||
|
||||
### 3) 清理 APT 缓存文件
|
||||
![][4]
|
||||
|
||||
Ubuntu 使用 **[APT 命令][5]** (高级软件包工具)用于软件包管理,像:安装,移除,搜索等等。
|
||||
#### 3) 清理 APT 缓存文件
|
||||
|
||||
默认情况下,每个 Linux 操作系统在它们各自的命令保留下载和安装的软件包的缓冲。
|
||||
Ubuntu 使用 [APT 命令][5](高级软件包工具)用于软件包管理,如:安装、移除、搜索等等。
|
||||
|
||||
Ubuntu 也做相同的事,它以缓冲的形式在你的磁盘上保留它下载和安装的每次更新。
|
||||
一般 Linux 操作系统会在各自的目录下保留下载和安装的软件包的缓冲文件。
|
||||
|
||||
Ubuntu 在 /var/cache/apt/archives 目录中保留 DEB 软件包的缓冲文件。
|
||||
|
||||
随着时间推移,这些缓存可能快速增长,并在你的系统上占有很多空间。
|
||||
Ubuntu 也一样,它在你的磁盘上以缓冲的形式保留它下载和安装的每次更新。Ubuntu 在 `/var/cache/apt/archives` 目录中保留 DEB 软件包的缓冲文件。随着时间推移,这些缓存可能快速增长,并在你的系统上占有很多空间。
|
||||
|
||||
运行下面的命令来检查当前 APT 缓存文件的使用率。
|
||||
|
||||
@ -118,30 +104,29 @@ $ sudo du -sh /var/cache/apt
|
||||
147M /var/cache/apt
|
||||
```
|
||||
|
||||
它清理过时的 deb 软件包。我想说,一点都清理不干净。
|
||||
下面的命令会清理过时的 deb 软件包。我想说,一点都清理不干净。
|
||||
|
||||
```
|
||||
$ sudo apt-get autoclean
|
||||
```
|
||||
|
||||
它移除所有在 apt 缓存中的软件包。
|
||||
下面的命令会移除所有在 apt 缓存中的软件包。
|
||||
|
||||
```
|
||||
$ sudo apt-get clean
|
||||
```
|
||||
|
||||
### 4) 卸载不使用的应用程序
|
||||
#### 4) 卸载不使用的应用程序
|
||||
|
||||
我可能要求你来检查在你的系统上安装的软件包和游戏,,删除它们,如果你很少使用。
|
||||
这需要你来检查在你的系统上安装的软件包和游戏,删除它们,如果你很少使用的话。
|
||||
|
||||
这可以简单地完成,通过 “Ubuntu 软件中心”。
|
||||
[![][2]![][2]][6]
|
||||
这可以通过 “Ubuntu 软件中心” 简单地做到。
|
||||
|
||||
### 5) 清理缩略图缓存
|
||||
![][6]
|
||||
|
||||
缓存文件夹是程序存储它们可能再次需要的数据的地方,它是为速度保留的,而不是必需保留的。它可以被再次生成或再次下载。
|
||||
#### 5) 清理缩略图缓存
|
||||
|
||||
假如它真的填满你的硬盘,那么你可以删除一些东西而不用担心。
|
||||
缓存文件夹是程序存储它们可能再次需要的数据的地方,它是为速度保留的,而不是必需保留的。它可以被再次生成或再次下载。假如它真的填满了你的硬盘,那么你可以删除一些东西而不用担心。
|
||||
|
||||
运行下面的命令来检查当前 APT 缓存的利用率。
|
||||
|
||||
@ -163,7 +148,7 @@ via: https://www.2daygeek.com/linux-remove-delete-unwanted-junk-files-free-up-sp
|
||||
作者:[Magesh Maruthamuthu][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[robsean](https://github.com/robsean)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -1,8 +1,8 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11050-1.html)
|
||||
[#]: subject: (BitTorrent Client Deluge 2.0 Released: Here’s What’s New)
|
||||
[#]: via: (https://itsfoss.com/deluge-2-release/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
@ -12,33 +12,27 @@ BitTorrent 客户端 Deluge 2.0 发布:新功能介绍
|
||||
|
||||
你可能已经知道 [Deluge][1] 是[最适合 Linux 用户的 Torrent 客户端][2]之一。然而,最近的稳定版本差不多是两年前的了。
|
||||
|
||||
尽管它在积极开发中,但直到最近才出了一个主要的稳定版本。我们写这篇文章时,最新版本恰好是 2.0.2。所以,如果你还没有下载最新的稳定版本,请尝试一下。
|
||||
尽管它仍在积极开发中,但直到最近才出了一个主要的稳定版本。我们写这篇文章时,最新版本恰好是 2.0.2。所以,如果你还没有下载最新的稳定版本,请尝试一下。
|
||||
|
||||
不管如何,如果你好奇的话,让我们谈下有哪些新的功能。
|
||||
|
||||
![Deluge][3]
|
||||
不管如何,如果你感兴趣的话,让我们看看有哪些新的功能。
|
||||
|
||||
### Deluge 2.0 的主要改进
|
||||
|
||||
新版本引入了多用户支持,这是一个非常需要的功能。
|
||||
|
||||
除此之外,还有一些性能改进可以更快地加载更多的种子。
|
||||
新版本引入了多用户支持,这是一个非常需要的功能。除此之外,还有一些性能改进可以更快地加载更多的种子。
|
||||
|
||||
此外,在 2.0 版本中,Deluge 使用了 Python 3,对 Python 2.7 提供最低支持。即使是用户界面,他们也从 GTK UI 迁移到了 GTK3。
|
||||
|
||||
根据发行说明,还有一些更重要的补充/改进,包括:
|
||||
|
||||
* 多用户支持。
|
||||
* 性能提升,可以更快地加载数千个种子。
|
||||
* 一个模拟 GTK/Web UI 的新控制台 UI。
|
||||
* GTK UI 迁移到 GTK3,并伴随 UI 改进和补充。
|
||||
* 磁链预获取功能以便在添加种子时选择文件。
|
||||
* 完全支持 libtorrent 1.2。
|
||||
* 语言切换支持。
|
||||
* 改进了在 ReadTheDocs 托管的文档。
|
||||
* AutoAdd 插件取代了内置功能。
|
||||
|
||||
|
||||
* 多用户支持。
|
||||
* 性能提升,可以更快地加载数千个种子。
|
||||
* 一个模拟 GTK/Web UI 的新控制台 UI。
|
||||
* GTK UI 迁移到 GTK3,并带有 UI 改进和补充。
|
||||
* 磁链预获取功能可以在添加种子时选择文件。
|
||||
* 完全支持 libtorrent 1.2。
|
||||
* 语言切换支持。
|
||||
* 改进了在 ReadTheDocs 托管的文档。
|
||||
* AutoAdd 插件取代了内置功能。
|
||||
|
||||
### 如何安装或升级到 Deluge 2.0
|
||||
|
||||
@ -46,17 +40,15 @@ BitTorrent 客户端 Deluge 2.0 发布:新功能介绍
|
||||
|
||||
对于任何 Linux 发行版,你都应该遵循官方[安装指南][5](使用 PPA 或 PyPi)。但是,如果你要升级,你应该留意发行说明中提到的:
|
||||
|
||||
“_Deluge 2.0与 Deluge 1.x 客户端或守护进程不兼容,因此这些也需要升级。如果第三方脚本直接连接到 Deluge 客户端,那么可能也不兼容且需要迁移。_”
|
||||
> “_Deluge 2.0 与 Deluge 1.x 客户端或守护进程不兼容,因此这些也需要升级。如果第三方脚本直接连接到 Deluge 客户端,那么可能也不兼容且需要迁移。_”
|
||||
|
||||
因此,坚持在升级主版本之前备份你的[配置][6]以免数据丢失。
|
||||
|
||||
而且,如果你是插件作者,那么需要升级它以使其与新版本兼容。
|
||||
因此,坚持在升级主版本之前备份你的[配置][6]以免数据丢失。而且,如果你是插件作者,那么需要升级它以使其与新版本兼容。
|
||||
|
||||
直接下载的安装包尚不包含 Windows 和 Mac OS。但是,说明中提到他们正在进行中。
|
||||
|
||||
除此之外,你可以按照更新后的官方文档中的[安装指南][5]来手动安装它们。
|
||||
|
||||
**总结**
|
||||
### 总结
|
||||
|
||||
你如何看待最新的稳定版本?你是否将 Deluge 用作 BitTorrent 客户端?或者你是否找到了其他更好的选择?
|
||||
|
||||
@ -69,7 +61,7 @@ via: https://itsfoss.com/deluge-2-release/
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -1,22 +1,24 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (qfzy1233)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11056-1.html)
|
||||
[#]: subject: (A beginner's guide to Linux permissions)
|
||||
[#]: via: (https://opensource.com/article/19/6/understanding-linux-permissions)
|
||||
[#]: author: (Bryant Son https://opensource.com/users/brson/users/greg-p/users/tj)
|
||||
|
||||
Linux 权限入门指南
|
||||
======
|
||||
Linux安全权限能够指定谁可以对文件或目录执行什么操作。
|
||||
![Hand putting a Linux file folder into a drawer][1]
|
||||
|
||||
与其他系统相比而言 Linux 系统的众多优点中最为主要一个便是Linux 系统有着更少的安全漏洞和被攻击的隐患。Linux无疑为用户提供了更为灵活和精细化的文件系统安全权限控制。这可能意味着Linux用户理解安全权限是至关重要的。虽然这并不一定是必要的,但是对于初学者来说,理解Linux权限的基本知识仍是一个明智之选。
|
||||
> Linux 安全权限能够指定谁可以对文件或目录执行什么操作。
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/201907/04/133751argz0pp7hy5gvv7q.jpg)
|
||||
|
||||
与其他系统相比而言 Linux 系统的众多优点中最为主要一个便是 Linux 系统有着更少的安全漏洞和被攻击的隐患。Linux 无疑为用户提供了更为灵活和精细化的文件系统安全权限控制。这可能意味着 Linux 用户理解安全权限是至关重要的。虽然这并不一定是必要的,但是对于初学者来说,理解 Linux 权限的基本知识仍是一个明智之选。
|
||||
|
||||
### 查看 Linux 安全权限
|
||||
|
||||
在开始 Linux 权限的相关学习之前,假设我们新建了一个名为 **PermissionDemo**的目录。使用 **cd** 命令进入这个目录,然后使用 **ls -l** 命令查看 Linux 安全管理权限信息。如果你想以时间为序排列,加上 **-t** 选项
|
||||
在开始 Linux 权限的相关学习之前,假设我们新建了一个名为 `PermissionDemo` 的目录。使用 `cd` 命令进入这个目录,然后使用 `ls -l` 命令查看 Linux 安全管理权限信息。如果你想以时间为序排列,加上 `-t` 选项
|
||||
|
||||
|
||||
```
|
||||
@ -27,11 +29,11 @@ Linux安全权限能够指定谁可以对文件或目录执行什么操作。
|
||||
|
||||
![No output from ls -l command][2]
|
||||
|
||||
要了解关于 **ls** 命令的更多信息,请通过在命令行中输入 **man ls** 来查看命令手册。
|
||||
要了解关于 `ls` 命令的更多信息,请通过在命令行中输入 `man ls` 来查看命令手册。
|
||||
|
||||
![ls man page][3]
|
||||
|
||||
现在,让我们创建两个名为 **cat.txt** 和 **dog.txt** 的空白文件;这一步使用 **touch** 命令将更为简便。然后继续使用 **mkdir** 命令创建一个名为 **Pets** 的空目录。我们可以再次使用**ls -l**命令查看这些新文件的权限。
|
||||
现在,让我们创建两个名为 `cat.txt` 和 `dog.txt` 的空白文件;这一步使用 `touch` 命令将更为简便。然后继续使用 `mkdir` 命令创建一个名为 `Pets` 的空目录。我们可以再次使用`ls -l`命令查看这些新文件的权限。
|
||||
|
||||
![Creating new files and directory][4]
|
||||
|
||||
@ -39,42 +41,43 @@ Linux安全权限能够指定谁可以对文件或目录执行什么操作。
|
||||
|
||||
### 谁拥有权限?
|
||||
|
||||
首先要注意的是 _who_ 具有访问文件/目录的权限。请注意下面红色框中突出显示的部分。第一列是指具有访问权限的 _user(用户)_ ,而第二列是指具有访问权限的 _group(组)_ 。
|
||||
首先要注意的是*谁*具有访问文件/目录的权限。请注意下面红色框中突出显示的部分。第一列是指具有访问权限的*用户*,而第二列是指具有访问权限的*组*。
|
||||
|
||||
![Output from -ls command][5]
|
||||
|
||||
用户的类型主要有三种:**user**、**group**;和**other**(本质上既不是用户也不是组)。还有一个**all**,意思是几乎所有人。
|
||||
用户的类型主要有三种:用户、组和其他人(本质上既不是用户也不是组)。还有一个*全部*,意思是几乎所有人。
|
||||
|
||||
![User types][6]
|
||||
|
||||
由于我们使用 **root** 作为当前用户,所以我们可以访问任何文件或目录,因为 **root** 是超级用户。然而,通常情况并非如此,您可能会被限定使用您的普通用户登录。所有的用户都存储在 **/etc/passwd** 文件中。
|
||||
由于我们使用 `root` 作为当前用户,所以我们可以访问任何文件或目录,因为 `root` 是超级用户。然而,通常情况并非如此,你可能会被限定使用你的普通用户登录。所有的用户都存储在 `/etc/passwd` 文件中。
|
||||
|
||||
![/etc/passwd file][7]
|
||||
|
||||
“组“的相关信息保存在 **/etc/group** 文件中。
|
||||
“组“的相关信息保存在 `/etc/group` 文件中。
|
||||
|
||||
![/etc/passwd file][8]
|
||||
|
||||
### 他们有什么权限?
|
||||
|
||||
我们需要注意的是 **ls -l** 命令输出结果的另一部分与执行权限有关。以上,我们查看了创建的dog.txt 和 cat.txt文件以及Pets目录的所有者和组权限都属于 **root** 用户。我们可以通过这一信息了解到不同用户组所拥有的相应权限,如下面的红色框中的标示。
|
||||
我们需要注意的是 `ls -l` 命令输出结果的另一部分与执行权限有关。以上,我们查看了创建的 `dog.txt` 和 `cat.txt` 文件以及 `Pets` 目录的所有者和组权限都属于 `root` 用户。我们可以通过这一信息了解到不同用户组所拥有的相应权限,如下面的红色框中的标示。
|
||||
|
||||
![Enforcing permissions for different user ownership types][9]
|
||||
|
||||
我们可以把每一行分解成五部分。第一部分标志着它是文件还是目录;文件用 **-** (连字符)标记,目录用 **d** 来标记。接下来的三个部分分别是**user**、**group**和**other**的对应权限。最后一部分是[**access-control list**][10] (ACL)(访问控制列表)的标志,是记录着特定用户或者用户组对该文件的操作权限的列表。
|
||||
我们可以把每一行分解成五部分。第一部分标志着它是文件还是目录:文件用 `-`(连字符)标记,目录用 `d` 来标记。接下来的三个部分分别是用户、组和其他人的对应权限。最后一部分是[访问控制列表][10] (ACL)的标志,是记录着特定用户或者用户组对该文件的操作权限的列表。
|
||||
|
||||
![Different Linux permissions][11]
|
||||
|
||||
Linux 的权限级别可以用字母或数字标识。有三种权限类型:
|
||||
|
||||
* **read(读):** r or 4
|
||||
* **write(写):** w or 2
|
||||
* **executable(可执行):** x or 1
|
||||
(LCTT译注:原文此处对应的字母标示 **x** 误写为 **e** 已更正)
|
||||
* 可读取:`r` 或 `4`
|
||||
* 可写入:`w` 或 `2`
|
||||
* 可执行:`x` 或 `1`
|
||||
|
||||
(LCTT 译注:原文此处对应的字母标示 `x` 误写为 `e`,已更正)
|
||||
|
||||
![Privilege types][12]
|
||||
|
||||
每个字母符号(**r**、**w**或**x**)表示有该项权限,而 **-** 表示无该项权限。在下面的示例中,文件的所有者可读可写,用户组成员仅可读,其他人可读可执行。转换成数字表示法,对应的是645(如何计算,请参见下图的图示)。
|
||||
每个字母符号(`r`、`w` 或 `x`)表示有该项权限,而 `-` 表示无该项权限。在下面的示例中,文件的所有者可读可写,用户组成员仅可读,其他人可读可执行。转换成数字表示法,对应的是 `645`(如何计算,请参见下图的图示)。
|
||||
|
||||
![Permission type example][13]
|
||||
|
||||
@ -93,7 +96,7 @@ via: https://opensource.com/article/19/6/understanding-linux-permissions
|
||||
作者:[Bryant Son][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[qfzy1233](https://github.com/qfzy1233)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -1,43 +1,44 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (chen-ni)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11049-1.html)
|
||||
[#]: subject: (Leading in the Python community)
|
||||
[#]: via: (https://opensource.com/article/19/6/naomi-ceder-python-software-foundation)
|
||||
[#]: author: (Don Watkins https://opensource.com/users/don-watkins)
|
||||
|
||||
Python 社区的领袖
|
||||
领导 Python 社区
|
||||
======
|
||||
对话现任 Python 软件基金会董事会主席 Naomi Ceder
|
||||
|
||||
![Hands together around the word trust][1]
|
||||
> 对话现任 Python 软件基金会董事会主席 Naomi Ceder。
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/201907/03/155715vrhkvapiiia9i3zp.jpg)
|
||||
|
||||
和开源软件世界的很多其他领袖一样,[Python 软件基金会][3](PSF)的董事会主席 [Naomi Ceder][2] 通过一种不同寻常的方式走进了 Python 世界。正如她在 2017 年 PyCon España 大会上的 [keynote][4] 的标题所说,她是因为这个编程语言而来,因为这个社区而留下的。在我们和她的一次近期的交流中,她分享了自己成为 Python 社区领袖的历程,并且就“是什么让 Python 如此特别”这个问题提供了一些独到的见解。
|
||||
|
||||
### 从授课到编程
|
||||
|
||||
Naomi 的职业生涯是从古典文学开始的。她取得了拉丁文和古希腊文的博士学位,并且辅修了印欧语言学。在一家私立学校教授拉丁语的同时,她开始接触了计算机,学习如何编程、如何拆机进行升级或者维修。1995 年,她开始在 [Yggdrasil Linux][5] 系统上开发开源软件,并且帮助建立了印第安纳州韦恩堡的 [Linux 用户小组][6]
|
||||
Naomi 的职业生涯是从古典文学开始的。她取得了拉丁文和古希腊文的博士学位,并且辅修了印欧语言学。在一家私立学校教授拉丁语的同时,她开始接触了计算机,学习如何编程、如何拆机进行升级或者维修。1995 年,她开始在 [Yggdrasil Linux][5] 系统上开发开源软件,并且帮助建立了印第安纳州韦恩堡的 [Linux 用户小组][6]。
|
||||
|
||||
作为一名教师,Naomi 相信在中学教授编程课程是非常重要的,因为等到大多数人上大学的时候,他们已经认为编程和科技相关的职业已经不是自己可以从事的了。她表示,更早地教授相关课程有助于增加科技人才的供给,提高人才的多元化和经验的广度,从而更好地满足行业需求。
|
||||
|
||||
大约在 2001 年前后,她决定从学习人类语言转向研究计算机语言,并同时教授计算机课程和管理学校的 IT 系统。在 2001 年的 Linux World 大会上听了一整天 PSF 主席 Guido Van Rossum 关于 Python 的演讲之后,她对 Python 的热情被点燃了。在那个时候,Python 还只是一门晦涩难懂的语言,但是她是如此喜欢 Python,以至于在她的学校开始使用 Python 记录学生信息、进行系统管理。
|
||||
大约在 2001 年前后,她决定从学习人类语言转向研究计算机语言,并同时教授计算机课程和管理学校的 IT 系统。在 2001 年的 Linux World 大会上听了一整天时任 PSF 主席 Guido Van Rossum (LCTT 译注:也是 Python 创始人)关于 Python 的演讲之后,她对 Python 的热情被点燃了。在那个时候,Python 还只是一门晦涩难懂的语言,但是她是如此喜欢 Python,以至于在她的学校开始使用 Python 记录学生信息、进行系统管理。
|
||||
|
||||
### 领导 Python 社区
|
||||
|
||||
Naomi 表示,“社区是 Python 成功背后的关键因素。开源软件的核心思想是分享,很少有人真的喜欢一个人坐在那儿盯着屏幕写代码。真正的满足来源于和别人交流想法,并且共同创造一些东西。”
|
||||
|
||||
她在第一届 [PyCon][7] 大会上发表了演讲,并且从此之后一直是一名参与者和领导者。她组织了一些 birds-of-a-feather 讨论会(LCTT 译注:一种在大会参与者之间进行的基于兴趣的小规模讨论活动)、PyCon 和 PyCon UK 大会的海报展示会、教育峰会,以及 PyCon 大会的西班牙语频道。
|
||||
她在第一届 [PyCon][7] 大会上发表了演讲,并且从此之后一直是一名参与者和领导者。她组织了一些 <ruby>趣味相投<rt>birds-of-a-feather<rt></ruby> 讨论会(LCTT 译注:birds-of-a-feather,一种在大会参与者之间进行的基于兴趣的非正式小规模讨论活动)、PyCon 和 PyCon UK 大会的海报展示会、教育峰会,以及 PyCon 大会的西班牙语频道。
|
||||
|
||||
她同时是 *[The Quick Python Book][9]* 一书的作者,并且联合创立了 [Trans\*Code][10],“英国唯一一个专注于变性者的问题和机遇的黑客节”(LCTT 译注:黑客节是一种让软件开发、设计、项目管理等相关人员相聚在一起,针对软件项目进行高强度合作的活动)。Naomi 表示,“随着科技能够提供越来越多的机遇,确保传统意义上的边缘化群体能够同等地享受到这些机遇成为了一件更为重要的事情。”
|
||||
她同时是 《[The Quick Python Book][9]》一书的作者,并且联合创立了 [Trans*Code][10],“英国唯一一个专注于变性者的问题和机遇的黑客节”(LCTT 译注:<ruby>黑客节<rt>hack event</rt></ruby>是一种让软件开发、设计、项目管理等相关人员相聚在一起,针对软件项目进行高强度合作的活动)。Naomi 表示,“随着科技能够提供越来越多的机遇,确保传统意义上的边缘化群体能够同等地享受到这些机遇成为了一件更为重要的事情。”
|
||||
|
||||
### 通过 PSF 进行贡献
|
||||
|
||||
作为 PSF 的董事会主席,Naomi 积极地参与着该组织对 Python 语言和其使用者的支持工作。除了赞助 PyCon 大会的举办之外,PSF 基金会还为世界各地的小型聚会、大型会议和研习会提供资助。2018 年,该组织发放的资助接近 335000 美元,其中大多数款项的金额都在 500 美元到 5000 美元之间。
|
||||
|
||||
PSF 的短期目标是成为一个由专业员工维护的可持续的、稳定的、成熟的非盈利机构。它的长期目标包括发展可以提供对 Python 开发工作有效支持的各种资源,以及扩展该组织对全世界范围内 Python 教育工作的支持。
|
||||
PSF 的短期目标是成为一个由专业人员维护的可持续的、稳定的、成熟的非盈利机构。它的长期目标包括发展可以提供对 Python 开发工作有效支持的各种资源,以及扩展该组织对全世界范围内 Python 教育工作的支持。
|
||||
|
||||
这些工作都需要来自社区的经济上的支持。Naomi 表示,PSF “最大的资金来源是 PyCon 大会。为了确保 PSF 的可持续性,我们同事也关注使用 Python 的企业的赞助,这是我们增长最快的部分。”会员价格是每年 99 美元,并且 [捐款和募捐人][12] 同样也在帮助维持该组织的工作。
|
||||
这些工作都需要来自社区的经济上的支持。Naomi 表示,PSF “最大的资金来源是 PyCon 大会。为了确保 PSF 的可持续性,我们同时也关注使用 Python 的企业的赞助,这是我们增长最快的部分。”会员费是每年 99 美元,并且 [捐款和募捐人][12] 同样也在帮助维持该组织的工作。
|
||||
|
||||
你可以在 PSF 的 [年度报告][13] 中了解该组织的更多工作情况。
|
||||
|
||||
@ -48,7 +49,7 @@ via: https://opensource.com/article/19/6/naomi-ceder-python-software-foundation
|
||||
作者:[Don Watkins][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[chen-ni](https://github.com/chen-ni)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -1,85 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Free and Open Source Trello Alternative OpenProject 9 Released)
|
||||
[#]: via: (https://itsfoss.com/openproject-9-release/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
Free and Open Source Trello Alternative OpenProject 9 Released
|
||||
======
|
||||
|
||||
[OpenProject][1] is a collaborative open source project management software. It’s an alternative to proprietary solutions like [Trello][2] and [Jira][3].
|
||||
|
||||
You can use it for free if it’s for personal use and you set it up (and host it) on your own server. This way, you control your data.
|
||||
|
||||
Of course, you get access to premium features and priority help if you are a [Cloud or Enterprise edition user][4].
|
||||
|
||||
The OpenProject 9 release emphasizes on new board views, package list view, and work templates.
|
||||
|
||||
If you didn’t know about this, you can give it a try. But, if you are an existing user – you should know what’s new before migrating to OpenProject 9.
|
||||
|
||||
### What’s New in OpenProject 9?
|
||||
|
||||
Here are some of the major changes in the latest release of OpenProject.
|
||||
|
||||
#### Scrum & Agile Boards
|
||||
|
||||
![][5]
|
||||
|
||||
For Cloud and Enterprise editions, there’s a new [scrum][6] and [agile][7] board view. You also get to showcase your work in a [kanban-style][8] fashion, making it easier to support your agile and scrum teams.
|
||||
|
||||
The new board view makes it easy to know who’s assigned for the task and update the status in a jiffy. You also get different board view options like basic board, status board, and version boards.
|
||||
|
||||
#### Work Package templates
|
||||
|
||||
![Work Package Template][9]
|
||||
|
||||
You don’t have to create everything from scratch for every unique work package. So, instead, you just keep a template – so that you can use it whenever you need to create a new work package. It will save a lot of time.
|
||||
|
||||
#### New Work Package list view
|
||||
|
||||
![Work Package View][10]
|
||||
|
||||
In the work package list, there’s a subtle new addition that lets you view the avatars of the assigned people for a specific work.
|
||||
|
||||
#### Customizable work package view for my page
|
||||
|
||||
Your own page to display what you are working on (and the progress) shouldn’t be always boring. So, now you get the ability to customize it and even add a Gantt chart to visualize your work.
|
||||
|
||||
[][11]
|
||||
|
||||
Suggested read Ubuntu 12.04 Has Reached End of Life
|
||||
|
||||
**Wrapping Up**
|
||||
|
||||
For detailed instructions on migrating and installation, you should follow the [official announcement post][12] covering all the essential details for the users.
|
||||
|
||||
Also, we would love to know about your experience with OpenProject 9, let us know about it in the comments section below! If you use some other project management software, feel free to suggest it to us and rest of your fellow It’s FOSS readers.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/openproject-9-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://www.openproject.org/
|
||||
[2]: https://trello.com/
|
||||
[3]: https://www.atlassian.com/software/jira
|
||||
[4]: https://www.openproject.org/pricing/
|
||||
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/open-project-9-scrum-agile.jpeg?fit=800%2C517&ssl=1
|
||||
[6]: https://en.wikipedia.org/wiki/Scrum_(software_development)
|
||||
[7]: https://en.wikipedia.org/wiki/Agile_software_development
|
||||
[8]: https://en.wikipedia.org/wiki/Kanban
|
||||
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/work-package-template.jpg?ssl=1
|
||||
[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/work-package-view.jpg?fit=800%2C454&ssl=1
|
||||
[11]: https://itsfoss.com/ubuntu-12-04-end-of-life/
|
||||
[12]: https://www.openproject.org/openproject-9-new-scrum-agile-board-view/
|
@ -0,0 +1,55 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Undo releases Live Recorder 5.0 for Linux debugging)
|
||||
[#]: via: (https://www.networkworld.com/article/3405584/undo-releases-live-recorder-5-0-for-linux-debugging.html)
|
||||
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
|
||||
|
||||
Undo releases Live Recorder 5.0 for Linux debugging
|
||||
======
|
||||
|
||||
![André Gustavo Stumpf \(CC BY 2.0\)][1]
|
||||
|
||||
Linux debugging has taken a giant step forward with the release of Live Recorder 5.0 from Undo. Just released on Wednesday, this product makes debugging on multi-process systems significantly easier. Based on flight recorder technology, it delves more deeply into processes to provide insight into what’s going on within each process. This includes memory, threads, program flow, service calls and more. To make this possible, Live Recorder 5.0's record, replay and debugging capabilities have been enhanced with the ability to:
|
||||
|
||||
* Record the exact order in which processes altered shared memory variables. It is even possible to zero in on specific variables and skip backward to the last line of code in any process that altered the variable.
|
||||
* Expose potential defects by randomizing thread execution to help reveal race conditions, crashes and other multi-threading defects.
|
||||
* Record and replay the execution of individual Kubernetes and Docker containers to help resolve defects faster in microservices environments
|
||||
|
||||
|
||||
|
||||
The Undo Live Recorder enables engineering teams to record and replay the execution of any software program -- no matter how complex -- and to diagnose and fix the root cause of any issue in test or production.
|
||||
|
||||
Depending on your license, Live Recorder can be used on the command line with the **live-record** command that is somewhat similar to strace though, instead of printing system calls and signals, it creates an "Undo recording". Captured failings in recordings can then be debugged (far more effective than grappling with core dumps!). These recordings can also be can be shared with other members of the staff and can be replayed with the reversible debugger to further investigate the cause of the crash or other problem.
|
||||
|
||||
The Undo Engine is supported on the following Linux distributions:
|
||||
|
||||
* Red Hat Enterprise Linux 6.8, 6.9, 6.10, 7.4, 7.5, 7.6 and 8.0
|
||||
* Fedora 28, 29 and 30
|
||||
* SuSE Linux Enterprise Server 12.3, 12.4 and 15
|
||||
* Ubuntu 16.04 LTS, 18.04 LTS, 18.10 and 19.04
|
||||
|
||||
|
||||
|
||||
Undo is a fast-growing, venture-backed technology start-up based in San Francisco and Cambridge, UK. They claim that the Live Recorder provides 100% certainty about the factors that led to any software failure -- even in the most complex software environments.
|
||||
|
||||
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/3405584/undo-releases-live-recorder-5-0-for-linux-debugging.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://images.idgesg.net/images/article/2019/06/flight_data_recorder-100800552-large.jpg
|
||||
[2]: https://www.facebook.com/NetworkWorld/
|
||||
[3]: https://www.linkedin.com/company/network-world
|
@ -0,0 +1,49 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (SD-WAN Buyers Should Think Application Performance as well as Resiliency)
|
||||
[#]: via: (https://www.networkworld.com/article/3406456/sd-wan-buyers-should-think-application-performance-as-well-as-resiliency.html)
|
||||
[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/)
|
||||
|
||||
SD-WAN Buyers Should Think Application Performance as well as Resiliency
|
||||
======
|
||||
|
||||
![istock][1]
|
||||
|
||||
As an industry analyst, not since the days of WAN Optimization have I seen a technology gain as much interest as I am seeing with [SD-WANs][2] today. Although full deployments are still limited, nearly every network manager, and often many IT leaders I talk to, are interested in it. The reason for this is two-fold – the WAN has grown in importance for cloud-first enterprises and is badly in need of an overhaul. This hasn’t gone unnoticed by the vendor community as there has been an explosion of companies bringing a broad range of SD-WAN offerings to market. The great news for buyers is that there is no shortage of choices. The bad news is there are too many choices and making the right decision difficult.
|
||||
|
||||
One area of differentiation for SD-WAN vendors is how they handle application performance. I think of the SD-WAN market as being split into two categories – basic and advanced SD-WANs. A good analogy is to think of the virtualization market. There are many vendors that offer hypervisors – in fact there are a number of free ones. So why do companies pay a premium for VMware? It’s because VMware offers many advanced features and capabilities that make its solution do more than just virtualize servers.
|
||||
|
||||
Similarly, basic SD-WAN solutions do a great job of helping to lower costs and to increase application resiliency through path selection capabilities but do nothing to improve application performance. One myth that needs busting is that all SD-WANs make your applications perform better. That’s simply not true as application availability and performance are two different things. It’s possible to have great performance and poor availability or high availability with lackluster performance.
|
||||
|
||||
Consider the case where a business runs a hybrid WAN and voice and video traffic is sent over the MPLS connection and broadband is used for other traffic. If the MPLS link becomes congested, but doesn’t go down, most SD-WAN solutions will continue to send video and voice over it, which obviously degrades the performance. If multiple broadband connections are used, the chances of congestion related issues are even more likely.
|
||||
|
||||
This is an important point for IT professionals to understand. The business justification for SD-WAN was initially built around saving money but if application performance suffers, the entire return on investment (ROI) for the project might as well be tossed out the window. For many companies, the network is the business, so a poor performing network means equally poor performing applications which results lost productivity, lower revenues and possibly brand damage from customer experience issues.
|
||||
|
||||
I’ve talked to many organizations that had digital initiatives fail because the network wasn’t transformed. For example, a luxury retailer implemented a tablet program for in store personnel to be able to show merchandise to customers. High end retail is almost wholly impulse purchases so the more inventory that can be shown to a customer, the larger the resulting sales. The WAN that was in place was causing the mobile application to perform poorly causing the digital initiative to have a negative effect. Instead of driving sales, the mobile initiative was chasing customers from the store. The idea was right but the poor performing WAN caused the project to fail.
|
||||
|
||||
SD-WAN decision makers need to look to suppliers that have specific technologies integrated into it that can act when congestion occurs. A great example of this is the Silver Peak [Unity EdgeConnect™][3] SD-WAN edge platform with [path conditioning][4], [traffic shaping][5] and sub-second link failover. This ensures the best possible quality for all critical applications, even when an underlying link experiences congestion or an outage, even for [voice and video over broadband][6]. This is a foundational component of advanced SD-WAN providers as they offer the same resiliency and cost benefits as a basic SD-WAN but also ensure application performance remains high.
|
||||
|
||||
The SD-WAN era is here, and organizations should be aggressive with deployments as it will transform the WAN and make it a digital transformation enabler. Decision makers should choose their provider carefully and ensure the vendor also improves application performance. Without it, the digital initiatives will likely fail and negate any ROI the company was hoping to realize.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3406456/sd-wan-buyers-should-think-application-performance-as-well-as-resiliency.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://images.idgesg.net/images/article/2019/07/istock-157647179-100800860-large.jpg
|
||||
[2]: https://www.silver-peak.com/sd-wan/sd-wan-explained
|
||||
[3]: https://www.silver-peak.com/products/unity-edge-connect
|
||||
[4]: https://www.silver-peak.com/products/unity-edge-connect/path-conditioning
|
||||
[5]: https://www.silver-peak.com/products-solutions/unity/traffic-shaping
|
||||
[6]: https://www.silver-peak.com/sd-wan/voice-video-over-broadband
|
@ -0,0 +1,92 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (An eco-friendly internet of disposable things is coming)
|
||||
[#]: via: (https://www.networkworld.com/article/3406462/an-eco-friendly-internet-of-disposable-things-is-coming.html)
|
||||
[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/)
|
||||
|
||||
An eco-friendly internet of disposable things is coming
|
||||
======
|
||||
Researchers are creating a non-hazardous, bacteria-powered miniature battery that can be implanted into shipping labels and packaging to monitor temperature and track packages in real time.
|
||||
![Thinkstock][1]
|
||||
|
||||
Get ready for a future of disposable of internet of things (IoT) devices, one that will mean everything is connected to networks. It will be particularly useful in logistics, being used in single-use plastics in retail packaging and throw-away shippers’ carboard boxes.
|
||||
|
||||
How it will happen? The answer is when non-hazardous, disposable bio-batteries make it possible. And that moment might be approaching. Researchers say they’re closer to commercializing a bacteria-powered miniature battery that they say will propel the IoDT.
|
||||
|
||||
**[ Learn more: [Download a PDF bundle of five essential articles about IoT in the enterprise][2] ]**
|
||||
|
||||
The “internet of disposable things is a new paradigm for the rapid evolution of wireless sensor networks,” says Seokheun Choi, an associate professor at Binghamton University, [in an article on the school’s website][3].
|
||||
|
||||
“Current IoDTs are mostly powered by expensive and environmentally hazardous batteries,” he says. Those costs can be significant in any kind of large-scale deployment, he says. And furthermore, with exponential growth, the environmental concerns would escalate rapidly.
|
||||
|
||||
The miniaturized battery that Choi’s team has come up with is uniquely charged through power created by bacteria. It doesn’t have metals and acids in it. And it’s designed specifically to provide energy to sensors and radios in single-use IoT devices. Those could be the kinds of sensors ideal for supply-chain logistics where the container is ultimately going to end up in a landfill, creating a hazard.
|
||||
|
||||
Another use case is real-time analysis of packaged food, with sensors monitoring temperature and location, preventing spoilage and providing safer food handling. For example, a farm product could be tracked for on-time delivery, as well as have its temperature measured, all within the packaging, as it moves from packaging facility to consumer. In the event of a food-borne illness outbreak, say, one can quickly find out where the product originated—which apparently is hard to do now.
|
||||
|
||||
Other use cases could be battery-impregnated shipping labels that send real-time data to the internet. Importantly, in both use cases, packaging can be discarded without added environmental concerns.
|
||||
|
||||
### How the bacteria-powered batteries work
|
||||
|
||||
A slow release of nutrients provide the energy to the bacteria-powered batteries, which the researchers say can last up to eight days. “Slow and continuous reactions” convert the microbial nutrients into “long standing power,” they say in [their paper's abstract][4].
|
||||
|
||||
“Our biobattery is low-cost, disposable, and environmentally-friendly,” Choi says.
|
||||
|
||||
Origami, the Japanese paper-folding skill used to create objects, was an inspiration for a similar microbial-based battery project the group wrote about last year in a paper. This one is liquid-based and not as long lasting. A bacteria-containing liquid was absorbed along the porous creases in folded paper, creating the paper-delivered power source, perhaps to be used in a shipping label.
|
||||
|
||||
“Low-cost microbial fuel cells (MFCs) can be done efficiently by using a paper substrate and origami techniques,” [the group wrote then][5].
|
||||
|
||||
Scientists, too, envisage electronics now printed on circuit boards (PCBs) and can be toxic on disposal being printed entirely on eco-friendly paper. Product cycles, such as those found now in mobile devices and likely in future IoT devices, are continually getting tighter—thus PCBs are increasingly being disposed. Solutions are needed, experts say.
|
||||
|
||||
Put the battery in the paper, too, is the argument here. And while you’re at it, get the biodegradation of the used-up biobattery to help break-down the organic-matter paper.
|
||||
|
||||
Ultimately, Choi believes that the power-creating bacteria could even be introduced naturally by the environment—right now it’s added on by the scientists.
|
||||
|
||||
**More on IoT:**
|
||||
|
||||
* [What is the IoT? How the internet of things works][6]
|
||||
* [What is edge computing and how it’s changing the network][7]
|
||||
* [Most powerful Internet of Things companies][8]
|
||||
* [10 Hot IoT startups to watch][9]
|
||||
* [The 6 ways to make money in IoT][10]
|
||||
* [What is digital twin technology? [and why it matters]][11]
|
||||
* [Blockchain, service-centric networking key to IoT success][12]
|
||||
* [Getting grounded in IoT networking and security][2]
|
||||
* [Building IoT-ready networks must become a priority][13]
|
||||
* [What is the Industrial IoT? [And why the stakes are so high]][14]
|
||||
|
||||
|
||||
|
||||
Join the Network World communities on [Facebook][15] and [LinkedIn][16] to comment on topics that are top of mind.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3406462/an-eco-friendly-internet-of-disposable-things-is-coming.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://images.techhive.com/images/article/2017/04/green-data-center-intro-100719502-large.jpg
|
||||
[2]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html
|
||||
[3]: https://www.binghamton.edu/news/story/1867/everything-will-connect-to-the-internet-someday-and-this-biobattery-could-h
|
||||
[4]: https://www.sciencedirect.com/science/article/abs/pii/S0378775319305580
|
||||
[5]: https://www.sciencedirect.com/science/article/pii/S0960148117311606
|
||||
[6]: https://www.networkworld.com/article/3207535/internet-of-things/what-is-the-iot-how-the-internet-of-things-works.html
|
||||
[7]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html
|
||||
[8]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html
|
||||
[9]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html
|
||||
[10]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html
|
||||
[11]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html
|
||||
[12]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html
|
||||
[13]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html
|
||||
[14]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html
|
||||
[15]: https://www.facebook.com/NetworkWorld/
|
||||
[16]: https://www.linkedin.com/company/network-world
|
@ -1,85 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (What is DevSecOps?)
|
||||
[#]: via: (https://opensource.com/article/19/1/what-devsecops)
|
||||
[#]: author: (Brett Hunoldt https://opensource.com/users/bretthunoldtcom)
|
||||
|
||||
What is DevSecOps?
|
||||
======
|
||||
The journey to DevSecOps begins with empowerment, enablement, and education. Here's how to get started.
|
||||
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/devop.png?itok=Yicb2nnZ)
|
||||
|
||||
> “DevSecOps enables organizations to deliver inherently secure software at DevOps speed.” -Stefan Streichsbier
|
||||
|
||||
DevSecOps as a practice or an art form is an evolution on the concept of DevOps. To better understand DevSecOps, you should first have an understanding of what DevOps means.
|
||||
|
||||
DevOps was born from merging the practices of development and operations, removing the silos, aligning the focus, and improving efficiency and performance of both the teams and the product. A new synergy was formed, with DevOps focused on building products and services that are easy to maintain and that automate typical operations functions.
|
||||
|
||||
Security is a common silo in many organizations. Security’s core focus is protecting the organization, and sometimes this means creating barriers or policies that slow down the execution of new services or products to ensure that everything is well understood and done safely and that nothing introduces unnecessary risk to the organization.
|
||||
|
||||
**[[Download the Getting started with DevSecOps guide]][1]**
|
||||
|
||||
Because of the distinct nature of the security silo and the friction it can introduce, development and operations sometimes bypass or work around security to meet their objectives. At some firms, the silo creates an expectation that security is entirely the responsibility of the security team and it is up to them to figure out what security defects or issues may be introduced as a result of a product.
|
||||
|
||||
DevSecOps looks at merging the security discipline within DevOps. By enhancing or building security into the developer and/or operational role, or including a security role within the product engineering team, security naturally finds itself in the product by design.
|
||||
|
||||
This allows companies to release new products and updates more quickly and with full confidence that security is embedded into the product.
|
||||
|
||||
### Where does rugged software fit into DevSecOps?
|
||||
|
||||
Building rugged software is more an aspect of the DevOps culture than a distinct practice, and it complements and enhances a DevSecOps practice. Think of a rugged product as something that has been battle-hardened through experimentation or experience.
|
||||
|
||||
It’s important to note that rugged software is not necessarily 100% secure (although it may have been at some point in time). However, it has been designed to handle most of what is thrown at it.
|
||||
|
||||
The key tenets of a rugged software practice are fostering competition, experimentation, controlled failure, and cooperation.
|
||||
|
||||
### How do you get started in DevSecOps?
|
||||
|
||||
Gettings started with DevSecOps involves shifting security requirements and execution to the earliest possible stage in the development process. It ultimately creates a shift in culture where security becomes everyone’s responsibility, not only the security team’s.
|
||||
|
||||
You may have heard teams talking about a "shift left." If you flatten the development pipeline into a horizontal line to include the key stages of the product evolution—from initiation to design, building, testing, and finally to operating—the goal of a security is to be involved as early as possible. This allows the risks to be better evaluated, socialized, and mitigated by design. The "shift-left" mentality is about moving this engagement far left in this pipeline.
|
||||
|
||||
This journey begins with three key elements:
|
||||
|
||||
* empowerment
|
||||
* enablement
|
||||
* education
|
||||
|
||||
|
||||
|
||||
Empowerment, in my view, is about releasing control and allowing teams to make independent decisions without fear of failure or repercussion (within reason). The only caveat in this process is that information is critical to making informed decisions (more on that below).
|
||||
|
||||
To achieve empowerment, business and executive support (which can be created through internal sales, presentations, and establishing metrics to show the return on this investment) is critical to break down the historic barriers and siloed teams. Integrating security into the development and operations teams and increasing both communication and transparency can help you begin the journey to DevSecOps.
|
||||
|
||||
This integration and mobilization allows teams to focus on a single outcome: Building a product for which they share responsibility and collaborate on development and security in a reliable way. This will take you most of the way towards empowerment. It places the shared responsibility for the product with the teams building it and ensures that any part of the product can be taken apart and maintain its security.
|
||||
|
||||
Enablement involves placing the right tools and resources in the hands of the teams. It’s about creating a culture of knowledge-sharing through forums, wikis, and informal gatherings.
|
||||
|
||||
Creating a culture that focuses on automation and the concept that repetitive tasks should be coded will likely reduce operational overhead and strengthen security. This scenario is about more than providing knowledge; it is about making this knowledge highly accessible through multiple channels and mediums (which are enabled through tools) so that it can be consumed and shared in whatever way teams or individuals prefer. One medium might work best when team members are coding and another when they are on the road. Make the tools accessible and simple and let the team play with them.
|
||||
|
||||
Different DevSecOp teams will have different preferences, so allow them to be independent whenever possible. This is a delicate balancing exercise because you do want economies of scale and the ability to share among products. Collaboration and involvement in the selection and renewal of these tools will help lower the barriers of adoption.
|
||||
|
||||
Finally, and perhaps most importantly, DevSecOps is about training and awareness building. Meetups, social gatherings, or formal presentations within the organization are great ways for peers to teach and share their learnings. Sometimes these highlight shared challenges, concerns, or risks others may not have considered. Sharing and teaching are also effective ways to learn and to mentor teams.
|
||||
|
||||
In my experience, each organization's culture is unique, so you can’t take a “one-size-fits-all” approach. Reach out to your teams and find out what tools they want to use. Test different forums and gatherings and see what works best for your culture. Seek feedback and ask the teams what is working, what they like, and why. Adapt and learn, be positive, and never stop trying, and you’ll almost always succeed.
|
||||
|
||||
[Download the Getting started with DevSecOps guide][1]
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/1/what-devsecops
|
||||
|
||||
作者:[Brett Hunoldt][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/bretthunoldtcom
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/downloads/devsecops
|
@ -1,210 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How To Find The Port Number Of A Service In Linux)
|
||||
[#]: via: (https://www.ostechnix.com/how-to-find-the-port-number-of-a-service-in-linux/)
|
||||
[#]: author: (sk https://www.ostechnix.com/author/sk/)
|
||||
|
||||
How To Find The Port Number Of A Service In Linux
|
||||
======
|
||||
|
||||
![Find The Port Number Of A Service In Linux OS][1]
|
||||
|
||||
You might often need to find the port names and numbers for some reasons. If so, you’re in luck. Today, in this brief tutorial, we are going to see the easiest and quickest ways to find the port number of a service in Linux operating system. There could be many methods to do it, but I am aware of the following three methods only at present. Read on.
|
||||
|
||||
### Find The Port Number Of A Service In Linux
|
||||
|
||||
**Method 1 – Using[Grep][2] command:**
|
||||
|
||||
To find the default port number of a given service in Linux using grep command, just run:
|
||||
|
||||
```
|
||||
$ grep <port> /etc/services
|
||||
```
|
||||
|
||||
For example, to find the default port of a SSH service, simply run:
|
||||
|
||||
```
|
||||
$ grep ssh /etc/services
|
||||
```
|
||||
|
||||
It’s that simple. This command should work on most Linux distributions. Here is the sample output from my Arch Linux test box:
|
||||
|
||||
```
|
||||
ssh 22/tcp
|
||||
ssh 22/udp
|
||||
ssh 22/sctp
|
||||
sshell 614/tcp
|
||||
sshell 614/udp
|
||||
netconf-ssh 830/tcp
|
||||
netconf-ssh 830/udp
|
||||
sdo-ssh 3897/tcp
|
||||
sdo-ssh 3897/udp
|
||||
netconf-ch-ssh 4334/tcp
|
||||
snmpssh 5161/tcp
|
||||
snmpssh-trap 5162/tcp
|
||||
tl1-ssh 6252/tcp
|
||||
tl1-ssh 6252/udp
|
||||
ssh-mgmt 17235/tcp
|
||||
ssh-mgmt 17235/udp
|
||||
```
|
||||
|
||||
As you can see in the above output, the default port number of SSH service is 22.
|
||||
|
||||
Let us find the port number of Apache web server. To do so, the command would be:
|
||||
|
||||
```
|
||||
$ grep http /etc/services
|
||||
# http://www.iana.org/assignments/port-numbers
|
||||
http 80/tcp www www-http # WorldWideWeb HTTP
|
||||
http 80/udp www www-http # HyperText Transfer Protocol
|
||||
http 80/sctp # HyperText Transfer Protocol
|
||||
https 443/tcp # http protocol over TLS/SSL
|
||||
https 443/udp # http protocol over TLS/SSL
|
||||
https 443/sctp # http protocol over TLS/SSL
|
||||
gss-http 488/tcp
|
||||
gss-http 488/udp
|
||||
webcache 8080/tcp http-alt # WWW caching service
|
||||
webcache 8080/udp http-alt # WWW caching service
|
||||
[...]
|
||||
```
|
||||
|
||||
How about FTP port number? That’s easy!
|
||||
|
||||
```
|
||||
$ grep ftp /etc/services
|
||||
ftp-data 20/tcp
|
||||
ftp-data 20/udp
|
||||
# 21 is registered to ftp, but also used by fsp
|
||||
ftp 21/tcp
|
||||
ftp 21/udp fsp fspd
|
||||
tftp 69/tcp
|
||||
[...]
|
||||
```
|
||||
|
||||
**Method 2 – Using getent command**
|
||||
|
||||
As you can see, the above commands shows all port names and numbers for the given search term “ssh”, “http” and “ftp”. That means, you will get a quite long output of all port names that matches with the given search term.
|
||||
|
||||
You can, however, narrow down the result to exact output using “getent” command like below:
|
||||
|
||||
```
|
||||
$ getent services ssh
|
||||
ssh 22/tcp
|
||||
|
||||
$ getent services http
|
||||
http 80/tcp www www-http
|
||||
|
||||
$ getent services ftp
|
||||
ftp 21/tcp
|
||||
```
|
||||
|
||||
If you don’t know the port name but the port number, simply replace the port name with number like below:
|
||||
|
||||
```
|
||||
$ getent services 80
|
||||
http 80/tcp
|
||||
```
|
||||
|
||||
To display all port names and numbers, simply run:
|
||||
|
||||
```
|
||||
$ getent services
|
||||
```
|
||||
|
||||
* * *
|
||||
|
||||
**Suggested read:**
|
||||
|
||||
* [**How To Change Apache Default Port To A Custom Port**][3]
|
||||
* [**How To Change FTP Default Port To A Custom Port**][4]
|
||||
* [**How To Change SSH Default Port To A Custom Port**][5]
|
||||
|
||||
|
||||
|
||||
* * *
|
||||
|
||||
**Method 3 – Using Whatportis Utility**
|
||||
|
||||
The **Whatportis** is a simple python script used to find port names and numbers. Unlike the above commands, this utility displays the output in a nice tabular column format.
|
||||
|
||||
Make sure you have installed PIP package manager. If not, refer the following link.
|
||||
|
||||
* [**How To Manage Python Packages Using Pip**][6]
|
||||
|
||||
|
||||
|
||||
Once installed PIP, run the following command to install Whatportis utility.
|
||||
|
||||
```
|
||||
$ pip install whatportis
|
||||
```
|
||||
|
||||
Now, you can find what port is associated with a service as shown below.
|
||||
|
||||
```
|
||||
$ whatportis ssh
|
||||
|
||||
$ whatportis ftp
|
||||
|
||||
$ whatportis http
|
||||
```
|
||||
|
||||
Sample output from my CentOS 7 server:
|
||||
|
||||
![][7]
|
||||
|
||||
Find The Port Number Of A Service In Linux
|
||||
|
||||
If you don’t know the exact name of a service, use **–like** flag to display the relevant results.
|
||||
|
||||
```
|
||||
$ whatportis mysql --like
|
||||
```
|
||||
|
||||
The above commands helped you to find what port is associated with a service. You can also find what service is associated with a port number like below.
|
||||
|
||||
```
|
||||
$ whatportis 993
|
||||
```
|
||||
|
||||
You can even display the results in **JSON** format.
|
||||
|
||||
```
|
||||
$ whatportis 993 --json
|
||||
```
|
||||
|
||||
![][8]
|
||||
|
||||
For more details, refer the GitHub repository.
|
||||
|
||||
* [**Whatportis GitHub Repository**][9]
|
||||
|
||||
|
||||
|
||||
And, that’s all for now. You know now how to find the port names and numbers in Linux using three simple methods. If you know any other methods/commands, let me know in the comment section below. I will check and update this guide accordingly.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.ostechnix.com/how-to-find-the-port-number-of-a-service-in-linux/
|
||||
|
||||
作者:[sk][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.ostechnix.com/author/sk/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.ostechnix.com/wp-content/uploads/2018/06/Find-The-Port-Number-720x340.png
|
||||
[2]: https://www.ostechnix.com/the-grep-command-tutorial-with-examples-for-beginners/
|
||||
[3]: https://www.ostechnix.com/how-to-change-apache-ftp-and-ssh-default-port-to-a-custom-port-part-1/
|
||||
[4]: https://www.ostechnix.com/how-to-change-apache-ftp-and-ssh-default-port-to-a-custom-port-part-2/
|
||||
[5]: https://www.ostechnix.com/how-to-change-apache-ftp-and-ssh-default-port-to-a-custom-port-part-3/
|
||||
[6]: https://www.ostechnix.com/manage-python-packages-using-pip/
|
||||
[7]: https://www.ostechnix.com/wp-content/uploads/2018/06/whatportis.png
|
||||
[8]: https://www.ostechnix.com/wp-content/uploads/2018/06/whatportis-1.png
|
||||
[9]: https://github.com/ncrocfer/whatportis
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (QiaoN)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
@ -213,7 +213,7 @@ via: https://opensource.com/article/19/5/run-your-blog-github-pages-python
|
||||
|
||||
作者:[Erik O'Shaughnessy][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[QiaoN](https://github.com/QiaoN)
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -1,216 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to use Tig to browse Git logs)
|
||||
[#]: via: (https://opensource.com/article/19/6/what-tig)
|
||||
[#]: author: (Olaf Alders https://opensource.com/users/oalders/users/mbbroberg/users/marcobravo)
|
||||
|
||||
How to use Tig to browse Git logs
|
||||
======
|
||||
Tig is more than just a text-mode interface for Git. Here's how it can
|
||||
enhance your daily workflow.
|
||||
![A person programming][1]
|
||||
|
||||
If you work with Git as your version control system, you've likely already resigned yourself to the fact that Git is a complicated beast. It is a fantastic tool, but it can be cumbersome to navigate Git repositories. That's where a tool like [Tig][2] comes in.
|
||||
|
||||
From the [Tig man page][3]:
|
||||
|
||||
> Tig is an ncurses-based text-mode interface for git(1). It functions mainly as a Git repository browser, but can also assist in staging changes for commit at chunk level and act as a pager for output from various Git commands.
|
||||
|
||||
This basically means that Tig provides a text-based user interface you can run in your terminal. Tig makes it easy to browse your Git logs, but it can do much more than just bounce you around from your last commit to a previous one.
|
||||
|
||||
![Tig screenshot][4]
|
||||
|
||||
Many of the examples in this quick introduction to Tig have been poached directly from its excellent man page. I highly recommend reading it to learn more.
|
||||
|
||||
### Install Tig
|
||||
|
||||
* Fedora and RHEL: **sudo dnf install tig**
|
||||
* Ubuntu and Debian: **sudo apt install tig**
|
||||
* MacOS: **brew install tig**
|
||||
|
||||
|
||||
|
||||
See the official [installation instructions][5] for even more options.
|
||||
|
||||
### Browse commits in your current branch
|
||||
|
||||
If you want to browse the latest commits in your branch, enter:
|
||||
|
||||
|
||||
```
|
||||
`tig`
|
||||
```
|
||||
|
||||
That's it. This three-character command will launch a browser where you can navigate the commits in your current branch. You can think of it as a wrapper around **git log**.
|
||||
|
||||
To navigate the output, you can use the Up and Down arrow keys to move from one commit to another. Pressing the Return/Enter key will open a vertical split with the contents of the chosen commit on the right-hand side. You can continue to browse up and down in your commit history on the left-hand side, and your changes will appear on the right. Use **k** and **j** to navigate up and down by line and **-** and the Space Bar to page up and down on the right-hand side. Use **q** to exit the right-hand pane.
|
||||
|
||||
Searching on **tig** output is simple as well. Use **/** to search forward and **?** to search backward on both the left and right panes.
|
||||
|
||||
![Searching Tig][6]
|
||||
|
||||
That's enough to get you started navigating your commits. There are too many key bindings to cover here, but clicking **h** will display a Help menu where you can discover its navigation and command options. You can also use **/** and **?** to search the Help menu. Use **q** to exit Help.
|
||||
|
||||
![Tig Help][7]
|
||||
|
||||
### Browse revisions for a single file
|
||||
|
||||
Since Tig is a wrapper around **git log**, it conveniently accepts the same arguments that can be passed to **git log**. For instance, to browse the commit history for a single file, enter:
|
||||
|
||||
|
||||
```
|
||||
`tig README.md`
|
||||
```
|
||||
|
||||
Compare this with the output of the Git command being wrapped to get a clearer view of how Tig enhances the output.
|
||||
|
||||
|
||||
```
|
||||
`git log README.md`
|
||||
```
|
||||
|
||||
To include the patches in the raw Git output, you can add a **-p** option:
|
||||
|
||||
|
||||
```
|
||||
`git log -p README.md`
|
||||
```
|
||||
|
||||
If you want to narrow the commits down to a specific date range, try something like this:
|
||||
|
||||
|
||||
```
|
||||
`tig --after="2017-01-01" --before="2018-05-16" -- README.md`
|
||||
```
|
||||
|
||||
Again, you can compare this with the raw Git version:
|
||||
|
||||
|
||||
```
|
||||
`git log --after="2017-01-01" --before="2018-05-16" -- README.md`
|
||||
```
|
||||
|
||||
### Browse who changed a file
|
||||
|
||||
Sometimes you want to find out who made a change to a file and why. The command:
|
||||
|
||||
|
||||
```
|
||||
`tig blame README.md`
|
||||
```
|
||||
|
||||
is essentially a wrapper around **git blame**. As you would expect, it allows you to see who the last person was to edit a given line, and it also allows you to navigate to the commit that introduced the line. This is somewhat like the **:Gblame** command Vim's **vim-fugitive** plugin provides.
|
||||
|
||||
### Browse your stash
|
||||
|
||||
If you're like me, you may have a pile of edits in your stash. It's easy to lose track of them. You can view the latest item in your stash via:
|
||||
|
||||
|
||||
```
|
||||
`git stash show -p stash@{0}`
|
||||
```
|
||||
|
||||
You can find the second most recent item via:
|
||||
|
||||
|
||||
```
|
||||
`git stash show -p stash@{1}`
|
||||
```
|
||||
|
||||
and so on. If you can recall these commands whenever you need them, you have a much sharper memory than I do.
|
||||
|
||||
As with the Git commands above, Tig makes it easy to enhance your Git output with a simple invocation:
|
||||
|
||||
|
||||
```
|
||||
`tig stash`
|
||||
```
|
||||
|
||||
Try issuing this command in a repository with a populated stash. You'll be able to browse _and search_ your stash items, giving you a quick overview of everything you saved for a rainy day.
|
||||
|
||||
### Browse your refs
|
||||
|
||||
A Git ref is the hash of something you have committed. This includes files as well as branches. Using the **tig refs** command allows you to browse all of your refs and drill down to specific commits.
|
||||
|
||||
|
||||
```
|
||||
`tig refs`
|
||||
```
|
||||
|
||||
When you're finished, use **q** to return to a previous menu.
|
||||
|
||||
### Browse git status
|
||||
|
||||
If you want to view which files have been staged and which are untracked, use **tig status**, a wrapper around **git status**.
|
||||
|
||||
![Tig status][8]
|
||||
|
||||
### Browse git grep
|
||||
|
||||
You can use the **grep** command to search for expressions in text files. The command **tig grep** allows you to navigate the output of **git grep**. For example:
|
||||
|
||||
|
||||
```
|
||||
`tig grep -i foo lib/Bar`
|
||||
```
|
||||
|
||||
will navigate the output of a case-insensitive search for **foo** in the **lib/Bar** directory.
|
||||
|
||||
### Pipe output to Tig via STDIN
|
||||
|
||||
If you are piping a list of commit IDs to Tig, you must use the **\--stdin** flag so that **tig show** reads from stdin. Otherwise, **tig show** launches without input (rendering an empty screen).
|
||||
|
||||
|
||||
```
|
||||
`git rev-list --author=olaf HEAD | tig show --stdin`
|
||||
```
|
||||
|
||||
### Add custom bindings
|
||||
|
||||
You can customize Tig with an [rc][9] file. Here's how you can configure Tig to your liking, using the example of adding some helpful custom key bindings.
|
||||
|
||||
Create a file in your home directory called **.tigrc**. Open **~/.tigrc** in your favorite editor and add:
|
||||
|
||||
|
||||
```
|
||||
# Apply the selected stash
|
||||
bind stash a !?git stash apply %(stash)
|
||||
|
||||
# Drop the selected stash item
|
||||
bind stash x !?git stash drop %(stash)
|
||||
```
|
||||
|
||||
Run **tig stash** to browse your stash, as above. However, with these bindings in place, you can press **a** to apply an item from the stash to your repository and **x** to drop an item from the stash. Keep in mind that you'll need to perform these commands when browsing the stash _list_. If you're browsing a stash _item_, enter **q** to exit that view and press **a** or **x** to get the effect you want.
|
||||
|
||||
For more information, you can read more about [Tig key bindings][10].
|
||||
|
||||
### Wrapping up
|
||||
|
||||
I hope this has been a helpful demonstration of how Tig can enhance your daily workflow. Tig can do even more powerful things (such as staging lines of code), but that's outside the scope of this introductory article. There's enough information here to make you dangerous, but there's still more to explore.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/6/what-tig
|
||||
|
||||
作者:[Olaf Alders][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/oalders/users/mbbroberg/users/marcobravo
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_keyboard_laptop_development_code_woman.png?itok=vbYz6jjb (A person programming)
|
||||
[2]: https://jonas.github.io/tig/
|
||||
[3]: http://manpages.ubuntu.com/manpages/bionic/man1/tig.1.html
|
||||
[4]: https://opensource.com/sites/default/files/uploads/tig.jpg (Tig screenshot)
|
||||
[5]: https://jonas.github.io/tig/INSTALL.html
|
||||
[6]: https://opensource.com/sites/default/files/uploads/tig-search.png (Searching Tig)
|
||||
[7]: https://opensource.com/sites/default/files/uploads/tig-help.png (Tig Help)
|
||||
[8]: https://opensource.com/sites/default/files/uploads/tig-status.png (Tig status)
|
||||
[9]: https://en.wikipedia.org/wiki/Run_commands
|
||||
[10]: https://github.com/jonas/tig/wiki/Bindings
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (guevaraya)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -1,190 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (chen-ni)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Ubuntu or Fedora: Which One Should You Use and Why)
|
||||
[#]: via: (https://itsfoss.com/ubuntu-vs-fedora/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
|
||||
Ubuntu or Fedora: Which One Should You Use and Why
|
||||
======
|
||||
|
||||
_**Brief: Ubuntu or Fedora? What’s the difference? Which is better? Which one should you use? Read this comparison of Ubuntu and Fedora.**_
|
||||
|
||||
[Ubuntu][1] and [Fedora][2] are one of the most popular Linux distributions out there. Making a decision to choose between using Ubuntu and Fedora is not an easy one. I’ll try to help you in making your decision by comparing various features of Ubuntu and Fedora.
|
||||
|
||||
Do note that this comparison is primarily from the desktop point of view. I am not going to focus on the container specific versions of Fedora or Ubuntu.
|
||||
|
||||
### Ubuntu vs Fedora: Which one is better?
|
||||
|
||||
![Ubuntu Vs Fedora][3]
|
||||
|
||||
Almost all Linux distributions differ from one another primarily on these points:
|
||||
|
||||
* Base distribution (Debian, Red Hat, Arch or from scratch)
|
||||
* Installation
|
||||
* Supported desktop environments
|
||||
* Package management, software support and updates
|
||||
* Hardware support
|
||||
* Development team (backed by corporate or created by hobbyists)
|
||||
* Release cycle
|
||||
* Community and support
|
||||
|
||||
|
||||
|
||||
Let’s see how similar or how different are Ubuntu and Fedora from each other. Once you know that, it should be perhaps easier for you to make a choice.
|
||||
|
||||
#### Installation
|
||||
|
||||
Ubuntu’s Ubiquity installer is one of easiest installers out there. I believe that it played an important role in Ubuntu’s popularity because when Ubuntu was just created in 2004, installing Linux itself was considered a huge task.
|
||||
|
||||
The Ubuntu installer allows you to install Ubuntu in around 10 minutes. In most cases, it can identify Windows installed on your system and allows you to dual boot Ubuntu and Windows in a matter of clicks.
|
||||
|
||||
You can also install updates and third-party codecs while installing Ubuntu. That’s an added advantage.
|
||||
|
||||
![Ubuntu Installer][4]
|
||||
|
||||
Fedora uses Anaconda installer. This too simplifies the installation process with the easy to use interface.
|
||||
|
||||
![Fedora Installer | Image Credit Fedora Magazine][5]
|
||||
|
||||
Fedora also provides a media writer tool for downloading and creating the live USB of Fedora on Windows operating system. When I last tried to use it around two years ago, it didn’t work and I had to use the regular live USB creating software.
|
||||
|
||||
In my experience, installing Ubuntu is easier than installing Fedora. That doesn’t mean installing Fedora is a complex process. Just that Ubuntu is simpler.
|
||||
|
||||
#### Desktop environments
|
||||
|
||||
Both Ubuntu and Fedora use GNOME desktop environment by default.
|
||||
|
||||
![GNOME Desktop in Fedora][6]
|
||||
|
||||
While Fedora uses the stock GNOME desktop, Ubuntu has customized it to look and behave like its previous Unity desktop.
|
||||
|
||||
![GNOME desktop customized by Ubuntu][7]
|
||||
|
||||
Apart from GNOME, both Ubuntu and Fedora offer several other desktop variants.
|
||||
|
||||
Ubuntu has Kubuntu, Xubuntu, Lubuntu etc., offering various desktop flavors. While they are the official flavor of Ubuntu, they are not directly developed by Ubuntu team from Canonical. The teams are separate.
|
||||
|
||||
Fedora offers various desktop choices in the form of [Fedora Spins][8]. Unlike Kubuntu, Lubuntu etc,. they are not created and maintained by separate team. They are from core Fedora team.
|
||||
|
||||
#### Package management and software availability
|
||||
|
||||
Ubuntu uses APT package manager to provide and manage software (applications, libraries and other required codes) while Fedora uses DNF package manager.
|
||||
|
||||
[][9]
|
||||
|
||||
Suggested read System76 Galago Pro: Specs, Price And Release Date
|
||||
|
||||
[Ubuntu has vast software repositories][10] allowing you to easily install thousands of programs, both FOSS and non-FOSS, easily. Fedora on the other hand focuses on providing only open source software. This is changing in the new versions but Fedora’s repositories are still not as big as that of Ubuntu.
|
||||
|
||||
Some third party software developer also provide click-to-install, .exe like packages for Linux. In Ubuntu, these packages are in .deb format and while Fedora supports .rpm packages.
|
||||
|
||||
Most software vendors provide both DEB and RPM files for Linux users but I have experienced that sometimes software vendor only provide DEB file. For example, SEO tool [Screaming Frog][11] has only DEB packages. It’s extremely rare that a software is available in RPM but not in DEB format.
|
||||
|
||||
#### Hardware support
|
||||
|
||||
Linux in general has its fair share of trouble with some WiFi adapters and graphics cards. Both Ubuntu and Fedora are impacted from that. Take the example of Nvidia. It’s [open source Nouveau driver often results in troubles like system hanging at boot][12].
|
||||
|
||||
Ubuntu provides an easy way of installing additional proprietary drivers. This results in better hardware support in many cases.
|
||||
|
||||
![Installing proprietary driver is easier in Ubuntu][13]
|
||||
|
||||
Fedora, on the other hand, sticks to open source software and thus installing proprietary drivers on Fedora becomes a difficult task.
|
||||
|
||||
#### Support and userbase
|
||||
|
||||
Both Ubuntu and Fedora provide support through community forums. Ubuntu has two main forums: [UbuntuForums][14] and [Ask Ubuntu][15]. Fedora has one main forum [Ask Fedora][16].
|
||||
|
||||
In terms of userbase, Fedora has a large following. However, Ubuntu is more popular and has a larger following than Fedora.
|
||||
|
||||
The popularity of Ubuntu has prompted a number of websites and blogs focused primarily on Ubuntu. This way, you get more troubleshooting tips and learning material on Ubuntu than Fedora.
|
||||
|
||||
#### Release cycle
|
||||
|
||||
A new Fedora version is released every six months and each Fedora release is supported for nine months only. Which means that between six to nine months, you must perform an upgrade. Upgrading Fedora version is simple but it does require a good internet connection. Not everyone can be happy with 1.5 GB of version upgrades every nine months.
|
||||
|
||||
Ubuntu has two versions: regular release and the long term support (LTS) release. Regular release is similar to Fedora. It’s released at the interval of six months and is supported for nine months.
|
||||
|
||||
The LTS release comes at an interval of two years and is supported for five years. Regular releases bring new features, new software versions while the LTS release holds on to the older versions. This makes it a great choice for people who don’t like frequent changes and prefer stability.
|
||||
|
||||
#### Solid base distributions
|
||||
|
||||
Ubuntu is based on [Debian][17]. Debian is one of the biggest community project and one of the most respected project in the [free software][18] world.
|
||||
|
||||
Fedora is a community project from Red Hat. Red Hat is an enterprise focused Linux distribution. Fedora works as a ‘testing ground’ ([upstream][19] in technical term) for new features before those features are included in Red Hat Enterprise Linux.
|
||||
|
||||
[][20]
|
||||
|
||||
Suggested read How To Manage StartUp Applications In Ubuntu
|
||||
|
||||
#### Backed by enterprises
|
||||
|
||||
Both Ubuntu and Fedora are backed by their parent corporations. Ubuntu is from [Canonical][21] while Fedora is from [Red Hat][22] (now [part of IBM][23]). Enterprise backing is important because it ensures that the Linux distribution is well-maintained.
|
||||
|
||||
Hobbyists distributions created by a group of individuals often crumble under workload. You might have seen reasonably popular distribution projects being shutdown for this sole reason. [Antergos][24], Korora are just some of the many such examples where distributions were discontinued because the developers couldn’t get enough free time to work on the project.
|
||||
|
||||
The fact that both Ubuntu and Fedora are supported by a two Linux-based enterprises makes them a viable choice over other independent distributions.
|
||||
|
||||
#### Ubuntu vs Fedora as server
|
||||
|
||||
The comparison between Ubuntu and Fedora was primarily aimed at desktop users so far. But a discussion about Linux is not complete until you include servers.
|
||||
|
||||
![Ubuntu Server][25]
|
||||
|
||||
Ubuntu is not only popular on desktop, it also has a good presence on the server side. If you are familiar with Ubuntu as desktop, you might not feel uncomfortable with Ubuntu server edition. I started with Ubuntu desktop and now my websites are hosted on Linux servers running Ubuntu.
|
||||
|
||||
Fedora too has server edition and some people use it as well. But most sysadmins won’t prefer a server that has to be upgraded and rebooted every nine months.
|
||||
|
||||
Knowing Fedora helps you in using Red Hat Enterprise Linux (RHEL). RHEL is a paid product and you’ll have to purchase a subscription. If you want an operating system for running server that is close to Fedora/Red Hat, I advise using CentOS. [CentOS][26] is also a community project affiliated with Red Hat but this one is focused on servers.
|
||||
|
||||
#### Conclusion
|
||||
|
||||
As you can see, both Ubuntu and Fedora are similar to each other on several points. Ubuntu does take lead when it comes to software availability, driver installation and online support. And _**these are the points that make Ubuntu a better choice, specially for inexperienced Linux users.**_
|
||||
|
||||
If you want to get familiar with Red Hat, Fedora is a good starting point. If you have some experience with Linux or if you want to use only open source software, Fedora is an excellent choice.
|
||||
|
||||
In the end, it is really up to you to decide if you want to use Fedora or Ubuntu. I would suggest creating live USB of both distributions or try them out in virtual machine.
|
||||
|
||||
What’s your opinion on Ubuntu vs Fedora? Which distribution do you prefer and why? Do share your views in the comment section.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/ubuntu-vs-fedora/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://ubuntu.com/
|
||||
[2]: https://getfedora.org/
|
||||
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/07/ubuntu-vs-fedora.png?resize=800%2C450&ssl=1
|
||||
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/03/install-linux-inside-windows-10.jpg?resize=800%2C479&ssl=1
|
||||
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/07/fedora-installer.png?resize=800%2C598&ssl=1
|
||||
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/07/gnome-desktop-fedora.png?resize=800%2C450&ssl=1
|
||||
[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/applications_menu.jpg?resize=800%2C450&ssl=1
|
||||
[8]: https://spins.fedoraproject.org/
|
||||
[9]: https://itsfoss.com/system-76-galago-pro/
|
||||
[10]: https://itsfoss.com/ubuntu-repositories/
|
||||
[11]: https://www.screamingfrog.co.uk/seo-spider/#download
|
||||
[12]: https://itsfoss.com/fix-ubuntu-freezing/
|
||||
[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/software_updates_additional_drivers_nvidia.png?resize=800%2C523&ssl=1
|
||||
[14]: https://ubuntuforums.org/
|
||||
[15]: https://askubuntu.com/
|
||||
[16]: https://ask.fedoraproject.org/
|
||||
[17]: https://www.debian.org/
|
||||
[18]: https://www.fsf.org/
|
||||
[19]: https://en.wikipedia.org/wiki/Upstream_(software_development)
|
||||
[20]: https://itsfoss.com/manage-startup-applications-ubuntu/
|
||||
[21]: https://canonical.com/
|
||||
[22]: https://www.redhat.com/en
|
||||
[23]: https://itsfoss.com/ibm-red-hat-acquisition/
|
||||
[24]: https://itsfoss.com/antergos-linux-discontinued/
|
||||
[25]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/07/ubuntu-server.png?resize=800%2C232&ssl=1
|
||||
[26]: https://centos.org/
|
276
sources/tech/20190702 Make Linux stronger with firewalls.md
Normal file
276
sources/tech/20190702 Make Linux stronger with firewalls.md
Normal file
@ -0,0 +1,276 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (chen-ni)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Make Linux stronger with firewalls)
|
||||
[#]: via: (https://opensource.com/article/19/7/make-linux-stronger-firewalls)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
Make Linux stronger with firewalls
|
||||
======
|
||||
Learn how firewalls work and which settings to tweak for better Linux
|
||||
security.
|
||||
![People working together to build ][1]
|
||||
|
||||
Everyone's heard of firewalls, even if only as a plot device in a TV cybercrime drama. Many people also know that their computer is (likely) running a firewall, but fewer people understand how to take control of their firewall when necessary.
|
||||
|
||||
Firewalls block unwanted network traffic, but different networks have different threat levels. For instance, if you're at home, you probably trust the other computers and devices on your network a lot more than when you're out at the local café using public WiFi. You can hope your computer differentiates between a trusted network and an untrusted one, or you can learn to manage, or at least verify, your security settings yourself.
|
||||
|
||||
### How firewalls work
|
||||
|
||||
Communication between devices on a network happens through gateways called _ports_. Port, in this context, doesn't mean a physical connection like a USB port or an HDMI port. In network lingo, a port is an entirely virtual concept representing pathways for a specific type of data to either arrive at or depart from a computer. This system could have been called anything, like "connections" or "doorways," but they were named ports at least [as early as 1981][2], and that's the name in use today. The point is, there's nothing special about any port; they're just a way to designate an address where data transference may happen.
|
||||
|
||||
Back in 1972, [a list of port numbers][3] (then called "sockets") was published, and this has since evolved into a set of well-known standard port numbers that help manage specific kinds of traffic. For instance, you access ports 80 and 443 on a daily basis when you visit a website, because most everyone on the internet has agreed, implicitly or explicitly, that data is transferred from web servers over those ports. You can test this theory by opening a web browser and navigating to a website with a nonstandard port appended to the URL. For instance, if you navigate to **example.com:42**, your request is denied because example.com does not serve a website at port 42.
|
||||
|
||||
![Navigating to a nonstandard port produces an error][4]
|
||||
|
||||
If you revisit the same website at port 80, you get a website, as expected. You can specify port 80 with **:80** at the end of the URL, but because port 80 is the standard port for HTTP traffic, your web browser assumes port 80 by default.
|
||||
|
||||
When a computer, like a web server, expects traffic at a specific port, it's acceptable (and necessary) to have the port open for traffic. The danger is leaving ports open that you have no reason to expect traffic on, and that's exactly what a firewall is for.
|
||||
|
||||
### Install firewalld
|
||||
|
||||
There are many interfaces for firewall configuration. This article covers [**firewalld**][5], which integrates with Network Manager on the desktop and **firewall-cmd** in the terminal. Many Linux distributions ship with these tools installed. If yours doesn't, you can either take this article as general advice for firewall management and apply it to what you use, or you can install **firewalld**.
|
||||
|
||||
On Ubuntu, for instance, you must enable the **universe** repository, deactivate the default **ufw** firewall, and then install **firewalld**:
|
||||
|
||||
|
||||
```
|
||||
$ sudo systemctl disable ufw
|
||||
$ sudo add-apt-repository universe
|
||||
$ sudo apt install firewalld
|
||||
```
|
||||
|
||||
Fedora, CentOS, RHEL, OpenSUSE, and many others include **firewalld** by default.
|
||||
|
||||
Regardless of your distribution, for a firewall to be effective, it must be active and set to be loaded at boot. The less you have to think about firewall maintenance, the better.
|
||||
|
||||
|
||||
```
|
||||
`$ sudo systemctl enable --now firewalld`
|
||||
```
|
||||
|
||||
### Choose your zone with Network Manager
|
||||
|
||||
You probably connect to many different networks every day. You're on one network at work, another at the café, and yet another at home. Your computer can detect which network you use more frequently than others, but it doesn't know which you trust.
|
||||
|
||||
A firewall _zone_ contains presets deciding what ports to open and close. Using zones, you can choose a policy that makes the most sense for the network you're currently on.
|
||||
|
||||
To see a list of available zones, open the Network Manager Connection Editor, found in your Applications menu, or with the **nm-connection-editor &** command.
|
||||
|
||||
![Network Manager Connection Editor][6]
|
||||
|
||||
From the list of network connections, double-click on your current network.
|
||||
|
||||
In the network configuration window that appears, click the General tab.
|
||||
|
||||
In the General panel, click the drop-down menu next to Firewall Zone for a list of all available zones.
|
||||
|
||||
![Firewall zones][7]
|
||||
|
||||
You can get this same list with this terminal command:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo firewall-cmd --get-zones`
|
||||
```
|
||||
|
||||
The zone titles indicate what their designers had in mind when creating them, but you can get the specifics of any zone with this terminal command:
|
||||
|
||||
|
||||
```
|
||||
$ sudo firewall-cmd --zone work --list-all
|
||||
work
|
||||
target: default
|
||||
icmp-block-inversion: no
|
||||
interfaces:
|
||||
sources:
|
||||
services: ssh dhcpv6-client
|
||||
ports:
|
||||
protocols:
|
||||
[...]
|
||||
```
|
||||
|
||||
In this example, the **work** zone is configured to permit SSH and DHCPv6-client incoming traffic but drops any other incoming traffic not explicitly requested by the user. (In other words, the **work** zone doesn't block HTTP response traffic when you visit a website, but it _does_ deny an HTTP request on your port 80.)
|
||||
|
||||
View each zone to get familiar with the traffic each one allows. The most common ones are:
|
||||
|
||||
* **Work:** Use this one when on a network you mostly trust. SSH, DHCPv6, and mDNS are permitted, and you can add more as needed. This zone is meant to be a starting point for a custom work environment based on your daily office requirements.
|
||||
* **Public:** For networks you do not trust. This zone is the same as the work zone, but presumably, you would not add the same exceptions as your work zone.
|
||||
* **Drop:** All incoming connections are dropped with no response given. This is as close to a stealth mode as you can get without shutting off networking entirely because only outgoing network connections are possible (even a casual port scanner could detect your computer from outgoing traffic, though, so don't mistake this zone for a cloaking device). This is arguably the safest zone when on public WiFi, and definitely the best when you have reason to believe a network is hostile.
|
||||
* **Block:** All incoming connections are rejected with a message declaring that the requested port is prohibited. Only network connections you initiate are possible. This is a "friendly" version of the drop zone because, even though no port is open for incoming traffic, a port verbosely declines an uninitiated connection.
|
||||
* **Home:** Use this when you trust other computers on the network. Only selected incoming connections are accepted, and you can add more as needed.
|
||||
* **Internal:** Similar to the work zone, this is intended for internal networks where you mostly trust the other computers. You can open more ports and services as needed but still maintain a different rule set than you have on your work zone.
|
||||
* **Trusted:** All network connections are accepted. Good for troubleshooting or on networks you absolutely trust.
|
||||
|
||||
|
||||
|
||||
### Assigning a zone to a network
|
||||
|
||||
You can assign a zone to any network connection you make. Furthermore, you can assign a different zone to each network interface (Ethernet cable, WiFi, and so on) that attaches to each network.
|
||||
|
||||
Select the zone you want and click the Save button to commit the change.
|
||||
|
||||
![Setting a new zone][8]
|
||||
|
||||
The easiest way to get into the habit of assigning a zone to a network interface is to tend to the networks you use most often. Assign the home zone to your home network, the work zone to your work network, and the public network to your favorite library or café network.
|
||||
|
||||
Once you have assigned a zone to all your usual networks, make an effort to assign a zone to the next new network you join, whether it's a new café or your mate's home network. Assigning zones is the best way to reinforce your own awareness that networks are not all equal and that you're not any more secure than anybody else just because you run Linux.
|
||||
|
||||
### Default zone
|
||||
|
||||
Rather than prompting you for a zone every time you join a new network, firewalld assigns any unknown network a default zone. Open a terminal and type this command to get your default zone:
|
||||
|
||||
|
||||
```
|
||||
$ sudo firewall-cmd --get-default
|
||||
public
|
||||
```
|
||||
|
||||
In this example, the public zone is the default. It's expected that you will keep the public zone highly restrictive, so it's a pretty safe zone to assign unknown networks. However, you can set your own default instead.
|
||||
|
||||
For instance, if you're more paranoid than most, or if you know that you frequent networks you have reason to distrust, you can assign a highly restrictive zone as default:
|
||||
|
||||
|
||||
```
|
||||
$ sudo firewall-cmd --set-default-zone drop
|
||||
success
|
||||
$ sudo firewall-cmd --get-default
|
||||
drop
|
||||
```
|
||||
|
||||
Now any new network you join will be subject to the drop zone rules unless you manually change it to something less restrictive.
|
||||
|
||||
### Customizing zones by opening ports and services
|
||||
|
||||
Firewalld's developers don't intend for their zone definitions to satisfy the needs of all the different networks and levels of trust in existence. They're just starting points for you to use and customize.
|
||||
|
||||
You don't have to know much about firewalls to be able to open and close ports based on the kinds of network activity you know you generate.
|
||||
|
||||
#### Predefined services
|
||||
|
||||
The simplest way to add permissions to your firewall is to add a predefined service. Strictly speaking, there's no such thing as a "service" as far as your firewall knows, because firewalls understand port numbers and protocol types. However, firewalld provides collections of ports and protocols based on standards and conventions.
|
||||
|
||||
For example, if you're a web developer and want to open your computer up on your local network so your colleagues can see the website you're building, you would add the **http** and **https** services. If you're a gamer and you're running the open source [murmur][9] voice-chat server for your guild, then you'd add the **murmur** service. There are many other services available, which you can view with this command:
|
||||
|
||||
|
||||
```
|
||||
$ sudo firewall-cmd --get-services
|
||||
amanda-client amanda-k5-client bacula bacula-client \
|
||||
bgp bitcoin bitcoin-rpc ceph cfengine condor-collector \
|
||||
ctdb dhcp dhcpv6 dhcpv6-client dns elasticsearch \
|
||||
freeipa-ldap freeipa-ldaps ftp [...]
|
||||
```
|
||||
|
||||
If you see a service you need, add it to your current firewall configuration, for example:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo firewall-cmd --add-service murmur`
|
||||
```
|
||||
|
||||
This command opens all the ports and protocols needed for a particular service _within your default zone_, but only until you reboot your computer or restart your firewall. To make your changes permanent, use the **\--permanent** flag:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo firewall-cmd --add-service murmur --permanent`
|
||||
```
|
||||
|
||||
You can also issue the command for a zone other than your default:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo firewall-cmd --add-service murmur --permanent --zone home`
|
||||
```
|
||||
|
||||
#### Ports
|
||||
|
||||
Sometimes you want to allow traffic for something that just isn't defined by firewalld's services. Maybe you're setting up a nonstandard port for a common service or you need to open an arbitrary port.
|
||||
|
||||
For example, maybe you're running the open source [virtual tabletop][10] software [MapTool][11]. Since you're running the MapTool server and there's no industry standard governing which port MapTool runs on, you can decide what port it uses and then "poke a hole" in your firewall to allow traffic on that port.
|
||||
|
||||
The process is basically the same as for services:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo firewall-cmd --add-port 51234/tcp`
|
||||
```
|
||||
|
||||
This command opens port 51234 to incoming TCP connections _in your default zone_, but only until you reboot your computer or restart your firewall. To make your changes permanent, use the **\--permanent** flag:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo firewall-cmd --add-port 51234/tcp --permanent`
|
||||
```
|
||||
|
||||
You can also issue the command for a zone other than your default:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo firewall-cmd --add-port 51234/tcp --permanent --zone home`
|
||||
```
|
||||
|
||||
Allowing traffic through your computer is different from letting traffic through your router"s firewall. Your router probably has a different interface for its own embeded firewall (though the principle is the same), which is outside the scope of this article.
|
||||
|
||||
### Removing ports and services
|
||||
|
||||
If you decide a service or a port is no longer needed, you can restart your firewall to clear your changes, unless you use the **\--permanent** flag.
|
||||
|
||||
If you made your changes permanent, use the **\--remove-port** or **\--remove-service** flag:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo firewall-cmd --remove-port 51234/tcp --permanent`
|
||||
```
|
||||
|
||||
You can remove ports and services from a zone other than your default zone by specifying a zone in your command:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo firewall-cmd --remove-service murmur --permanent --zone home`
|
||||
```
|
||||
|
||||
### Custom zones
|
||||
|
||||
You can use and abuse the default zones provided by firewalld, but you also have the freedom to create your own. For instance, if it makes sense for you to have a zone specific to gaming, then you can create one and switch over to it only while gaming.
|
||||
|
||||
To create a new, empty zone, create a new zone called **game** and reload the firewall rules so that your new zone becomes active:
|
||||
|
||||
|
||||
```
|
||||
$ sudo firewall-cmd --new-zone game --permanent
|
||||
success
|
||||
$ sudo firewall-cmd --reload
|
||||
```
|
||||
|
||||
Once it's created and active, you can customize it with all the services and ports you need to have open for game night.
|
||||
|
||||
### Diligence
|
||||
|
||||
Start thinking about your firewall strategy today. Start slow, and build up some sane defaults that make sense for you. It may take time before you make it a habit to think about your firewall and understand which network services you use, but with a little exploration, you can strengthen your Linux workstation no matter what your environment.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/7/make-linux-stronger-firewalls
|
||||
|
||||
作者:[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/BUSINESS_buildtogether.png?itok=9Tvz64K5 (People working together to build )
|
||||
[2]: https://tools.ietf.org/html/rfc793
|
||||
[3]: https://tools.ietf.org/html/rfc433
|
||||
[4]: https://opensource.com/sites/default/files/uploads/web-port-nonstandard.png (Navigating to a nonstandard port produces an error)
|
||||
[5]: https://firewalld.org/
|
||||
[6]: https://opensource.com/sites/default/files/uploads/nm-connection-editor.png (Network Manager Connection Editor)
|
||||
[7]: https://opensource.com/sites/default/files/uploads/nm-zone.png (Firewall zones)
|
||||
[8]: https://opensource.com/sites/default/files/uploads/nm-set.png (Setting a new zone)
|
||||
[9]: https://www.mumble.com/
|
||||
[10]: https://opensource.com/article/18/5/maptool
|
||||
[11]: https://github.com/RPTools
|
@ -0,0 +1,136 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (One CI/CD pipeline per product to rule them all)
|
||||
[#]: via: (https://opensource.com/article/19/7/cicd-pipeline-rule-them-all)
|
||||
[#]: author: (Willy-Peter Schaub https://opensource.com/users/wpschaub/users/bclaster/users/matt-micene/users/barkerd427)
|
||||
|
||||
One CI/CD pipeline per product to rule them all
|
||||
======
|
||||
Is the idea of a unified continuous integration and delivery pipeline a
|
||||
pipe dream?
|
||||
![An intersection of pipes.][1]
|
||||
|
||||
When I joined the cloud ops team, responsible for cloud operations and engineering process streamlining, at WorkSafeBC, I shared my dream for one instrumented pipeline, with one continuous integration build and continuous deliveries for every product.
|
||||
|
||||
According to Lukas Klose, [flow][2] (within the context of software engineering) is "the state of when a system produces value at a steady and predictable rate." I think it is one of the greatest challenges and opportunities, especially in the complex domain of emergent solutions. Strive towards a continuous and incremental delivery model with consistent, efficient, and quality solutions, building the right things and delighting our users. Find ways to break down our systems into smaller pieces that are valuable on their own, enabling teams to deliver value incrementally. This requires a change of mindset for both business and engineering.
|
||||
|
||||
### Continuous integration and delivery (CI/CD) pipeline
|
||||
|
||||
The CI/CD pipeline is a DevOps practice for delivering code changes more often, consistently, and reliably. It enables agile teams to increase _deployment frequency_ and decrease _lead time for change_, _change-failure rate_, and _mean time to recovery_ key performance indicators (KPIs), thereby improving _quality_ and delivering _value_ faster. The only prerequisites are a solid development process, a mindset for quality and accountability for features from ideation to deprecation, and a comprehensive pipeline (as illustrated below).
|
||||
|
||||
![Prerequisites for a solid development process][3]
|
||||
|
||||
It streamlines the engineering process and products to stabilize infrastructure environments; optimize flow; and create consistent, repeatable, and automated tasks. This enables us to turn complex tasks into complicated tasks, as outlined by Dave Snowden's [Cynefin Sensemaking][4] model, reducing maintenance costs and increasing quality and reliability.
|
||||
|
||||
Part of streamlining our flow is to minimize waste for the [wasteful practice types][5] Muri (overloaded), Mura (variation), and Muda (waste).
|
||||
|
||||
* **Muri:** avoid over-engineering, features that do not link to business value, and excessive documentation
|
||||
* **Mura:** improve approval and validation processes (e.g., security signoffs); drive the [shift-left][6] initiative to push unit testing, security vulnerability scanning, and code quality inspection; and improve risk assessment
|
||||
* **Muda:** avoid waste such as technical debt, bugs, and upfront, detailed documentation
|
||||
|
||||
|
||||
|
||||
It appears that 80% of the focus and intention is on products that provide an integrated and collaborative engineering system that can take an idea and plan, develop, test, and monitor your solutions. However, a successful transformation and engineering system is only 5% about products, 15% about process, and 80% about people.
|
||||
|
||||
There are many products at our disposal. For example, Azure DevOps offers rich support for continuous integration (CI), continuous delivery (CD), extensibility, and integration with open source and commercial off-the-shelve (COTS) software as a service (SaaS) solutions such as Stryker, SonarQube, WhiteSource, Jenkins, and Octopus. For engineers, it is always a temptation to focus on products, but remember that they are only 5% of our journey.
|
||||
|
||||
![5% about products, 15% about process, 80% about people][7]
|
||||
|
||||
The biggest challenge is breaking down a process based on decades of rules, regulations, and frustrating areas of comfort: "_It is how we have always done it; why change?_"
|
||||
|
||||
The friction between people in development and operation results in a variety of fragmented, duplicated, and incessant integration and delivery pipelines. Development wants access to everything, to iterate continuously, to enable users, and to release continuously and fast. Operations wants to lock down everything to protect the business and users and drive quality. This inadvertently and often entails processes and governance that are hard to automate, which results in slower-than-expected release cycles.
|
||||
|
||||
Let us explore the pipeline with snippets from a recent whiteboard discussion.
|
||||
|
||||
The variation of pipelines is difficult and costly to support; the inconsistency of versioning and traceability complicates live site incidents, and continuous streamlining of the development process and pipelines is a challenge.
|
||||
|
||||
![Improving quality and visibility of pipelines][8]
|
||||
|
||||
I advocate a few principles that enable one universal pipeline per product:
|
||||
|
||||
* Automate everything automatable
|
||||
* Build once
|
||||
* Maintain continuous integration and delivery
|
||||
* Maintain continuous streamlining and improvement
|
||||
* Maintain one build definition
|
||||
* Maintain one release pipeline definition
|
||||
* Scan for vulnerabilities early and often, and _fail fast_
|
||||
* Test early and often, and _fail fast_
|
||||
* Maintain traceability and observability of releases
|
||||
|
||||
|
||||
|
||||
If I poke the hornet's nest, however, the most important principle is to _keep it simple_. If you cannot explain the reason (_what_, _why_) and the process (_how_) of your pipelines, you do not understand your engineering process. Most of us are not looking for the best, ultramodern, and revolutionary pipeline—we need one that is functional, valuable, and an enabler for engineering. Tackle the 80%—the culture, people, and their mindset—first. Ask your CI/CD knights in shining armor, with their TLA (two/three-lettered acronym) symbols on their shield, to join the might of practical and empirical engineering.
|
||||
|
||||
### Unified pipeline
|
||||
|
||||
Let us walk through one of our design practice whiteboard sessions.
|
||||
|
||||
![CI build/CD release pipeline][9]
|
||||
|
||||
Define one CI/CD pipeline with one build definition per application that is used to trigger _pull-request pre-merge validation_ and _continuous integration_ builds. Generate a _release_ build with debug information and upload to the [Symbol Server][10]. ****This enables developers to debug locally and remotely in production without having to worry which build and symbols they need to load—the symbol server performs that magic for us.
|
||||
|
||||
![Breaking down the CI build pipeline][11]
|
||||
|
||||
Perform as many validations as possible in the build—_shift left_—allowing feature teams to fail fast, continuously raise the overall product quality, and include invaluable evidence for the reviewers with every pull request. Do you prefer a pull request with a gazillion commits? Or a pull request with a couple of commits and supporting evidence such as security vulnerabilities, test coverage, code quality, and [Stryker][12] mutant remnants? Personally, I vote for the latter.
|
||||
|
||||
![Breaking down the CD release pipeline][13]
|
||||
|
||||
Do not use build transformation to generate multiple, environment-specific builds. Create one build and perform release-time _transformation_, _tokenization_, and/or XML/JSON _value replacement_. In other words, _shift-right_ the environment-specific configuration.
|
||||
|
||||
![Shift-right the environment-specific configuration][14]
|
||||
|
||||
Securely store release configuration data and make it available to both Dev and Ops teams based on the level of _trust_ and _sensitivity_ of the data. Use the open source Key Manager, Azure Key Vault, AWS Key Management Service, or one of many other products—remember, there are many hammers in your toolkit!
|
||||
|
||||
![Dev-QA-production pipeline][15]
|
||||
|
||||
Use _groups_ instead of _users_ to move approver management from multiple stages across multiple pipelines to simple group membership.
|
||||
|
||||
![Move approver management to simple group membership][16]
|
||||
|
||||
Instead of duplicating pipelines to give teams access to their _areas of interest_, create one pipeline and grant access to _specific stages_ of the delivery environments.
|
||||
|
||||
![Pipeline with access to specific delivery stages][17]
|
||||
|
||||
Last, but not least, embrace pull requests to help raise insight and transparency into your codebase, improve the overall quality, collaborate, and release pre-validation builds into selected environments; e.g., the Dev environment.
|
||||
|
||||
Here is a more formal view of the whole whiteboard sketch.
|
||||
|
||||
![The full pipeline][18]
|
||||
|
||||
So, what are your thoughts and learnings with CI/CD pipelines? Is my dream of _one pipeline to rule them all_ a pipe dream?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/7/cicd-pipeline-rule-them-all
|
||||
|
||||
作者:[Willy-Peter Schaub][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/wpschaub/users/bclaster/users/matt-micene/users/barkerd427
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LAW-Internet_construction_9401467_520x292_0512_dc.png?itok=RPkPPtDe (An intersection of pipes.)
|
||||
[2]: https://continuingstudies.sauder.ubc.ca/courses/agile-delivery-methods/ii861
|
||||
[3]: https://opensource.com/sites/default/files/uploads/devops_pipeline_pipe-2.png (Prerequisites for a solid development process)
|
||||
[4]: https://en.wikipedia.org/wiki/Cynefin_framework
|
||||
[5]: https://www.lean.org/lexicon/muda-mura-muri
|
||||
[6]: https://en.wikipedia.org/wiki/Shift_left_testing
|
||||
[7]: https://opensource.com/sites/default/files/uploads/devops_pipeline_pipe-3.png (5% about products, 15% about process, 80% about people)
|
||||
[8]: https://opensource.com/sites/default/files/uploads/devops_pipeline_pipe-4_0.png (Improving quality and visibility of pipelines)
|
||||
[9]: https://opensource.com/sites/default/files/uploads/devops_pipeline_pipe-5_0.png (CI build/CD release pipeline)
|
||||
[10]: https://en.wikipedia.org/wiki/Microsoft_Symbol_Server
|
||||
[11]: https://opensource.com/sites/default/files/uploads/devops_pipeline_pipe-6.png (Breaking down the CI build pipeline)
|
||||
[12]: https://stryker-mutator.io/
|
||||
[13]: https://opensource.com/sites/default/files/uploads/devops_pipeline_pipe-7.png (Breaking down the CD release pipeline)
|
||||
[14]: https://opensource.com/sites/default/files/uploads/devops_pipeline_pipe-8.png (Shift-right the environment-specific configuration)
|
||||
[15]: https://opensource.com/sites/default/files/uploads/devops_pipeline_pipe-9.png (Dev-QA-production pipeline)
|
||||
[16]: https://opensource.com/sites/default/files/uploads/devops_pipeline_pipe-10.png (Move approver management to simple group membership)
|
||||
[17]: https://opensource.com/sites/default/files/uploads/devops_pipeline_pipe-11.png (Pipeline with access to specific delivery stages)
|
||||
[18]: https://opensource.com/sites/default/files/uploads/devops_pipeline_pipe-12.png (The full pipeline)
|
@ -0,0 +1,84 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (What makes a good code review in DevOps?)
|
||||
[#]: via: (https://opensource.com/article/19/7/code-reviews-devops)
|
||||
[#]: author: (Patrick Housley https://opensource.com/users/patrickhousley/users/juliegund/users/ghaff)
|
||||
|
||||
What makes a good code review in DevOps?
|
||||
======
|
||||
Well-run code reviews balance the freedom to innovate rapidly with code
|
||||
quality and security.
|
||||
![Pair programming][1]
|
||||
|
||||
Improving the software development lifecycle, the speed we deliver software to customers, and the quality of that software are all great premises of [DevOps][2]. They are goals that the tools and techniques prescribed by the DevOps movement attempt to achieve. As a developer, I feel freer to make changes rapidly, not just to source code, but also to infrastructure and configuration code. As a DevOps practitioner, my goal is to balance that freedom with quality and security. How? One tool we can use is code reviews.
|
||||
|
||||
Code reviews are not a new concept. They are often used as a manual gate-check for code changes before merging them to the trunk branch. This helps ensure quality and security by preventing developers from working in vacuums. It can also help ensure the entire team is aware of what's going on in their project. Much like anything in technology, there are many different ways to implement code reviews, and there can be some confusion around how to operate code reviews and what the goals of a code review are. Let's start by looking at who on the team should be doing the reviewing in code reviews.
|
||||
|
||||
### Who should be reviewing code?
|
||||
|
||||
It is easy to assume that the more senior developers on the team should be the ones reviewing code before it makes it to the trunk branch. That is only partly true. Everyone on the team should feel empowered and obligated to take time out of their day to review the code going into the repositories they work in most often. Why? It's all about perspective, and the more people we have engaging in code review, the more perspectives we can take advantage of.
|
||||
|
||||
A developer's perspective when reviewing code is derived from a culmination of their years of experience as well as their _unique_ experiences. Unique experiences help diversify the team and can be a source of new, innovative solutions. Having more years of experience does not necessarily equate to having a diverse set of unique experiences. How does this fit into the junior-senior developer dynamic as applied to code reviews? Before we get too deep into the title war, let's first define what we mean by "code review."
|
||||
|
||||
### Code review is a conversation
|
||||
|
||||
Take a moment and think about what a code review means to you. Is it a manual gate to ensure the quality of the code making it to your trunk branch? Is it a chance to have the more senior developers, or maybe the developers more familiar with the area of the code base, review the code? These would all be good answers, but there is a better one.
|
||||
|
||||
_Code reviews are a chance for you, the committer, and your peers to have a conversation about the changes being made before they are merged to the trunk branch._
|
||||
|
||||
Our goal should be simply to talk about the changes being made. It sounds simple, but, like any digital conversation, we simple humans always try to imply tone to the words we read. I have seen junior developers take seemingly innocuous questioning in a code review as a call to action. Instead of engaging in conversation, they immediately change the code. I think we all can say we have seen more senior developers use poor wording that implies improper tone in their code reviews and conversations around code changes. Many open source communities are trying to address this through Code of Conduct declarations. I have been privy to a solution for this issue that I still use today and recommend to all developers of every level: comment tagging.
|
||||
|
||||
#### Comment tagging
|
||||
|
||||
My previous example of a junior developer taking a question as a call to action doesn't come from thin air. I noticed this behavior some years ago when I would make comments or ask questions on pull requests as part of a code review. It really upset me at the time, because I was trying to have an honest conversation, not trying to imply the developer did anything wrong or needed to change the code. Luckily, I had great leadership that was able to help find the problem and come up with a solution. That solution was to start tagging our comments in the pull requests using the tags: _comment_, _question_, _blocker_, and _recommended_. It would look something like:
|
||||
|
||||
> [comment] I think you meant to use the forEach prototype method here instead of map.
|
||||
> [blocker] This constructor is too large and should be broken up into individual, specialized methods.
|
||||
> [question] Is this method needed in this class with the merging of feature X? Feature x makes this a global utility method.
|
||||
> [recommended] You could add a test case here to check for negative outcomes. This would help ensure future code changes do not break our expectations.
|
||||
|
||||
It may seem simple, maybe even extreme, but it really helped spark conversations in our code reviews. Junior developers felt more empowered to have and stick to their opinions in the face of questioning from more senior developers. More importantly, they also felt empowered to question and comment in code reviews for changes made by more senior developers.
|
||||
|
||||
### Leave your title at the door
|
||||
|
||||
Through our discussion of who should be doing the reviewing in code reviews and what a code review is, one thing should be clear: the junior and senior titles mean very little. In fact, they can detract from the overall goal of code reviews, as was the case in the experience I described above. The concept is very simple: _No matter how senior you are, you can still make mistakes, and no matter how junior you are, you can still provide valuable and innovative solutions._
|
||||
|
||||
We will leave the comparison of what makes a junior and senior developer for another article. For now, let's get back to our code review conversation. We have covered the what and why of code reviews, but just as important is the when. When should you be doing code review? How often?
|
||||
|
||||
### Code-review continuously
|
||||
|
||||
I have seen code reviews performed in many ways over the past few years. Not long ago, I was on a team that did weekly, one-hour meetings for code review. Today, my team operates code reviews on an ongoing basis as part of our pull request process. In case you are not familiar with them, pull requests are a process commonly found in [Git][3] tooling like GitHub and GitLab where a developer makes a formal request to have the changes in their branch merged into another branch.
|
||||
|
||||
How you and your team operate may be different, and you should always strive to find what works best for your team and project. My team and those around me use code reviews for two purposes: to formalize the code review process and to block merges to trunk based on automated code-quality checks. While we are having our conversation about the code changes in the pull request, our continuous integration pipeline is operating in the background to perform a sanity build of the project, run tests, linting, and static code analysis. The results are provided back to the pull request and help influence our code review.
|
||||
|
||||
How often do we have these code reviews and pull requests? As often as possible. Complying with lean development practices indicates we make small commits and merges often. If that's the case, multiple pull requests happen daily, and many conversations happen continuously. This can become a little overwhelming but, if the changes being made are small, theoretically the conversations are also small, short, and sweet.
|
||||
|
||||
### Put it all together
|
||||
|
||||
Team dynamics will always play a substantial role in how practices like code reviews are performed. I typically like to start my day off by seeing what pull requests are open and what discussions are happening. It provides a nice, gradual start to my day, and I can catch up on what people are working on. I will typically go back throughout the day, as I take breaks from what I am working on, to check for more pull requests. This works great for me and might work well for you, so I encourage you to give it a try.
|
||||
|
||||
No matter how you decide to conduct your code reviews, I typically discourage the one hour a week meeting. First, it can work counter to the lean development practice of committing small and often. Developers may wait to do any merging or open pull requests until code review. By that time, the code is not fresh in their mind, and things in the project may have changed that affect the changes they are making. Second, if your team is more than two developers, an hour meeting will probably not be long enough to adequately review all the changes from all the team members that need to go in. This could lead to changes being merged without code review, and that could be detrimental to code quality and security.
|
||||
|
||||
Instead of using that one hour to dig through code changes, I find it better to talk higher-level. It's always good for a team to come together and discuss how they are architecting their code, how their features may affect or tie into each other, and what blockers they might be having. All in all, communication is key, and continuous code review should work to drive more communication.
|
||||
|
||||
Is DevOps fundamentally about changing culture in an IT organization? That seemingly simple...
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/7/code-reviews-devops
|
||||
|
||||
作者:[Patrick Housley][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/patrickhousley/users/juliegund/users/ghaff
|
||||
[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]: https://opensource.com/resources/devops
|
||||
[3]: https://opensource.com/resources/what-is-git
|
199
sources/tech/20190703 6 open source web browser alternatives.md
Normal file
199
sources/tech/20190703 6 open source web browser alternatives.md
Normal file
@ -0,0 +1,199 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (6 open source web browser alternatives)
|
||||
[#]: via: (https://opensource.com/article/19/7/open-source-browsers)
|
||||
[#]: author: (Bryant Son https://opensource.com/users/brson/users/lauren-pritchett/users/scottnesbitt)
|
||||
|
||||
6 open source web browser alternatives
|
||||
======
|
||||
Chrome and Firefox are on the list, but you'll find some other
|
||||
interesting options, too.
|
||||
![web development and design, desktop and browser][1]
|
||||
|
||||
Open source web browsers have come a long way since Microsoft dominated the web browser market with its closed source Internet Explorer (IE). For many years, IE was the standard browser for Microsoft's Windows operating system, while Safari (also closed source) was the default browser for MacOS. Then Mozilla's introduction of Firefox, followed by Google's release of Chrome, sparked a revolution in open source internet browsers. Those two are extremely well known but are not the only open source browsers available.
|
||||
|
||||
This article introduces seven open source browsers, summarizes their features, and shares how you can contribute to them.
|
||||
|
||||
Name / Link to Contribute | License | Supported OSes
|
||||
---|---|---
|
||||
[Brave][2] | MPL 2.0 | All
|
||||
[Chrome/Chromium][3] | BSD | All
|
||||
[Firefox][4] | MPL 2.0 | All
|
||||
[Konqueror][5] | GPL | Linux
|
||||
[Lynx][6] | GPL | Linux, Windows, DOS
|
||||
[Midori][7] | LGPL | Linux, Windows
|
||||
|
||||
### Brave
|
||||
|
||||
The [Brave browser][8] was created with the goal of blocking all but user-approved advertisements and website trackers. [Brendan Eich][9], the creator of JavaScript and a co-founder of the Mozilla Foundation, leads the Brave project as the CEO and a co-founder.
|
||||
|
||||
**Pros of Brave:**
|
||||
|
||||
* No ads or web trackers
|
||||
* Speed
|
||||
* Security
|
||||
* Chromium [extension support][10]
|
||||
* Bugs are tracked in [Brave QA central][11]
|
||||
|
||||
|
||||
|
||||
**Cons of Brave:**
|
||||
|
||||
* The opt-in micro-payment system to support content creators has an unclear pathway to get your payments to your intended recipient
|
||||
|
||||
|
||||
|
||||
You can find Brave's source code (available under the Mozilla Public License) in its extensive [GitHub repositories][2] (there are 140 repos as of this writing).
|
||||
|
||||
### Chrome/Chromium
|
||||
|
||||
[Google Chrome][12], inarguably, is the most [widely used][13] internet browser—open source or otherwise. I remember when Google introduced the first version of Chrome. Mozilla Firefox, which came out much earlier, was riding a wave of popularity. The first version of Chrome was so slow, buggy, and disappointing, which led me to think it wouldn't be successful. But, boy, I was wrong. Chrome got better and better, and the browser eventually surpassed Firefox's browser market share. Google Chrome is still known as a "memory hog" due to its heavy random access memory (RAM) utilization. Regardless, Chrome is by far the most popular browser, and it's loved by many due to its simplicity and speed.
|
||||
|
||||
**Pros of Google Chrome/Chromium:**
|
||||
|
||||
* Simplicity
|
||||
* Speed
|
||||
* Many useful built-in features
|
||||
|
||||
|
||||
|
||||
**Cons of Google Chrome/Chromium:**
|
||||
|
||||
* Heavy memory usage
|
||||
* Chrome (not Chromium) has proprietary code
|
||||
|
||||
|
||||
|
||||
Chromium, which is the open source project behind the Chrome browser, is available under the Berkeley Software Distribution (BSD) license. Note that the Chrome browser also has some closed source code. To contribute, visit the [Contributing to Chromium][14] page.
|
||||
|
||||
### Firefox
|
||||
|
||||
Although Chrome is now the most popular browser, [Mozilla Firefox][15] is the one that started the whole open source web browser sensation. Before Mozilla Firefox, Internet Explorer seemed to be undefeatable. But the birth of Firefox shook that belief. One interesting bit of trivia is that its co-founder [Blake Ross][16] was only 19 years old when Firefox was released.
|
||||
|
||||
**Pros of Mozilla Firefox:**
|
||||
|
||||
* Security
|
||||
* Many extensions are available
|
||||
* Uniform user experience across different systems
|
||||
|
||||
|
||||
|
||||
**Cons of Mozilla Firefox:**
|
||||
|
||||
* Heavy memory usage
|
||||
* Some HTML5 compatibility issue
|
||||
|
||||
|
||||
|
||||
Firefox's source code is available under the Mozilla Public License (MPL), and it maintains comprehensive guidelines on [how to contribute][4].
|
||||
|
||||
### Konqueror
|
||||
|
||||
[Konqueror][17] may not be the most well-known internet browser, and that is okay because it is responsible for KHTML, the browser engine forked by Apple and then Google for the Safari and Chrome browsers (and subsequently used by Brave, Vivaldi, and several other browsers). Today, Konqueror can use either its native KHTML engine or the Chromium fork. Konqueror is maintained by the international [KDE][18] free software community, and it's easy to find on most Linux desktops.
|
||||
|
||||
**Pros of Konqueor:**
|
||||
|
||||
* Pre-installed on many Linux desktops
|
||||
* Fast and efficient
|
||||
* Built-in ad-blocker and pop-up blocker
|
||||
* Customizable URL shortcuts
|
||||
* Doubles as a file manager, man page viewer, and much more
|
||||
|
||||
|
||||
|
||||
**Cons of Konqueror:**
|
||||
|
||||
* Primarily runs in Linux
|
||||
* Requires several KDE libraries to be installed
|
||||
|
||||
|
||||
|
||||
Konqueror's source code is available under the GNU Public License (GPL). You can find its detailed [documentation][19] and [source code][5] on the KDE website.
|
||||
|
||||
### Lynx
|
||||
|
||||
Ah, [Lynx][20]. Lynx is a unique browser as it is entirely text-based. It is also the oldest web browser still in use and still under development. You might think, "who would use a text-based browser?" But it works, and there is a big community supporting this special open source browser.
|
||||
|
||||
**Pros of Lynx:**
|
||||
|
||||
* Extremely lightweight
|
||||
* Extremely minimal
|
||||
* Extremely secure
|
||||
* Supports DOS and Windows
|
||||
* Ideal for testing and safe browsing
|
||||
|
||||
|
||||
|
||||
**Cons of Lynx:**
|
||||
|
||||
* Nothing but text
|
||||
|
||||
|
||||
|
||||
Lynx's source code is available under the GNU Public License (GPL) and maintained on [GitHub][6].
|
||||
|
||||
### Midori
|
||||
|
||||
If you hear "Midori," you might think of a green-hued cocktail. But the [Midori browser][21] is an open source, lightweight browser. If you want a simple and lightweight browser, Midori might be an interesting one to look at. But note that there is no stable release for this browser, and it is known to be quite buggy.
|
||||
|
||||
**Pros of Midori:**
|
||||
|
||||
* Simple
|
||||
* Lightweight
|
||||
|
||||
|
||||
|
||||
**Cons of Midori:**
|
||||
|
||||
* Still no stable release
|
||||
* Buggy
|
||||
* Almost no extensions
|
||||
* No process isolation
|
||||
|
||||
|
||||
|
||||
Midori's source code is available under the GNU Lesser General Public License (LGPL) and maintained on [GitHub][7].
|
||||
|
||||
* * *
|
||||
|
||||
Do you know another open source browser that I should have mentioned on this list? Please share it in the comments.
|
||||
|
||||
Web browsers that run in a terminal window are alive and kicking. They're niche, but still get the...
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/7/open-source-browsers
|
||||
|
||||
作者:[Bryant Son][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/brson/users/lauren-pritchett/users/scottnesbitt
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/web_browser_desktop_devlopment_design_system_computer.jpg?itok=pfqRrJgh (web development and design, desktop and browser)
|
||||
[2]: https://github.com/brave
|
||||
[3]: https://www.chromium.org/Home
|
||||
[4]: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Introduction
|
||||
[5]: https://kde.org/applications/internet/org.kde.konqueror/development
|
||||
[6]: https://github.com/kurtchen/Lynx
|
||||
[7]: https://github.com/midori-browser/core
|
||||
[8]: https://brave.com
|
||||
[9]: https://en.wikipedia.org/wiki/Brendan_Eich
|
||||
[10]: https://support.brave.com/hc/en-us/articles/360017909112-How-can-I-add-extensions-to-Brave-
|
||||
[11]: https://community.brave.com/c/legacy/qa
|
||||
[12]: https://www.google.com/chrome/
|
||||
[13]: https://www.statista.com/statistics/544400/market-share-of-internet-browsers-desktop/
|
||||
[14]: https://chromium.googlesource.com/chromium/src/+/master/docs/contributing.md
|
||||
[15]: https://www.mozilla.org/firefox/
|
||||
[16]: https://en.wikipedia.org/wiki/Blake_Ross
|
||||
[17]: https://kde.org/applications/internet/org.kde.konqueror
|
||||
[18]: https://kde.org
|
||||
[19]: https://docs.kde.org/stable5/en/applications/konqueror/index.html
|
||||
[20]: http://lynx.browser.org/
|
||||
[21]: https://www.midori-browser.org/
|
@ -0,0 +1,251 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to Manually Install Security Updates on Debian/Ubuntu?)
|
||||
[#]: via: (https://www.2daygeek.com/manually-install-security-updates-ubuntu-debian/)
|
||||
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||
|
||||
How to Manually Install Security Updates on Debian/Ubuntu?
|
||||
======
|
||||
|
||||
Installing a package in Linux from command line is a simple task.
|
||||
|
||||
In a single command or combining of multiple commands could make you to complete your task easily.
|
||||
|
||||
The same can be done for security updates as well.
|
||||
|
||||
In this tutorial, we will show you how to check available security update and install them on Debian based systems such as Ubuntu, LinuxMint, etc,.
|
||||
|
||||
It can be done using three methods. All these methods are described in this article in details.
|
||||
|
||||
As a Linux administrator, you should keep your system up-to-date, that makes your system more secure. It protects your system against unwanted attack.
|
||||
|
||||
If you are not able to patch entire system with all updates due to some application dependency. At-least, you should install only security patches to make your system 100% compliance.
|
||||
|
||||
### How to Install unattended-upgrades package in Debian/Ubuntu?
|
||||
|
||||
By default `unattended-upgrades` package should be installed on your system. But in case if it’s not installed use the following command to install it.
|
||||
|
||||
Use **[APT-GET Command][1]** or **[APT Command][2]** to install unattended-upgrades package.
|
||||
|
||||
```
|
||||
$ sudo apt-get install unattended-upgrades
|
||||
or
|
||||
$ sudo apt install unattended-upgrades
|
||||
```
|
||||
|
||||
### Method-1: How to Check if any Security Updates are available in Debian/Ubuntu?
|
||||
|
||||
It’s always a good practice to check list of available security updates before performing the patch installation. It will give you the list of packages that are going to be updated in your system.
|
||||
|
||||
**What’s dry run?** Most of the Linux commands have a dry run option, which stimulate the actual output but nothing will be downloaded or installed.
|
||||
|
||||
To do so, you need to add `--dry-run` option with unattended-upgrades command.
|
||||
|
||||
```
|
||||
$ sudo unattended-upgrade --dry-run -d
|
||||
|
||||
Initial blacklisted packages:
|
||||
Initial whitelisted packages:
|
||||
Starting unattended upgrades script
|
||||
Allowed origins are: o=Ubuntu,a=bionic, o=Ubuntu,a=bionic-security, o=UbuntuESM,a=bionic
|
||||
Using (^linux-image-[0-9]+\.[0-9\.]+-.*|^linux-headers-[0-9]+\.[0-9\.]+-.*|^linux-image-extra-[0-9]+\.[0-9\.]+-.*|^linux-modules-[0-9]+\.[0-9\.]+-.*|^linux-modules-extra-[0-9]+\.[0-9\.]+-.*|^linux-signed-image-[0-9]+\.[0-9\.]+-.*|^kfreebsd-image-[0-9]+\.[0-9\.]+-.*|^kfreebsd-headers-[0-9]+\.[0-9\.]+-.*|^gnumach-image-[0-9]+\.[0-9\.]+-.*|^.*-modules-[0-9]+\.[0-9\.]+-.*|^.*-kernel-[0-9]+\.[0-9\.]+-.*|^linux-backports-modules-.*-[0-9]+\.[0-9\.]+-.*|^linux-modules-.*-[0-9]+\.[0-9\.]+-.*|^linux-tools-[0-9]+\.[0-9\.]+-.*|^linux-cloud-tools-[0-9]+\.[0-9\.]+-.*) regexp to find kernel packages
|
||||
Using (^linux-image-4\.15\.0\-51\-generic$|^linux-headers-4\.15\.0\-51\-generic$|^linux-image-extra-4\.15\.0\-51\-generic$|^linux-modules-4\.15\.0\-51\-generic$|^linux-modules-extra-4\.15\.0\-51\-generic$|^linux-signed-image-4\.15\.0\-51\-generic$|^kfreebsd-image-4\.15\.0\-51\-generic$|^kfreebsd-headers-4\.15\.0\-51\-generic$|^gnumach-image-4\.15\.0\-51\-generic$|^.*-modules-4\.15\.0\-51\-generic$|^.*-kernel-4\.15\.0\-51\-generic$|^linux-backports-modules-.*-4\.15\.0\-51\-generic$|^linux-modules-.*-4\.15\.0\-51\-generic$|^linux-tools-4\.15\.0\-51\-generic$|^linux-cloud-tools-4\.15\.0\-51\-generic$) regexp to find running kernel packages
|
||||
Checking: apt ([])
|
||||
adjusting candidate version: apt=1.6.6ubuntu0.1
|
||||
Checking: apt-utils ([])
|
||||
adjusting candidate version: apt-utils=1.6.6ubuntu0.1
|
||||
Checking: bash ([])
|
||||
.
|
||||
.
|
||||
Checking: xxd ([, ])
|
||||
pkgs that look like they should be upgraded: binutils
|
||||
binutils-common
|
||||
binutils-x86-64-linux-gnu
|
||||
cpp
|
||||
cpp-7
|
||||
dbus
|
||||
dbus-user-session
|
||||
dbus-x11
|
||||
firefox
|
||||
firefox-locale-en
|
||||
g++
|
||||
g++-7
|
||||
gcc
|
||||
gcc-7
|
||||
gcc-7-base
|
||||
gcc-8-base
|
||||
libasan4
|
||||
libatomic1
|
||||
libbinutils
|
||||
libcc1-0
|
||||
libcilkrts5
|
||||
libdbus-1-3
|
||||
libdbus-1-dev
|
||||
libgcc-7-dev
|
||||
libgcc1
|
||||
libgfortran4
|
||||
libgomp1
|
||||
libitm1
|
||||
liblsan0
|
||||
libmpx2
|
||||
libquadmath0
|
||||
libstdc++-7-dev
|
||||
libstdc++6
|
||||
libtsan0
|
||||
libubsan0
|
||||
vim-common
|
||||
vim-tiny
|
||||
xxd
|
||||
```
|
||||
|
||||
If the above command output says **“No packages found that can be upgraded unattended and no pending auto-removals”** in the Terminal, this implies your System is up-to-date.
|
||||
|
||||
### How to Install available Security Updates in Debian/Ubuntu?
|
||||
|
||||
If your got any package updates in the above command output. Then run the following command to install them.
|
||||
|
||||
```
|
||||
$ sudo unattended-upgrade -d
|
||||
```
|
||||
|
||||
Alternatively this can be done from apt-get command. It’s bit tricky. However, i would suggest users to go with first option.
|
||||
|
||||
### Method-2: How to Check if any Security Updates are available in Debian/Ubuntu Using apt-get Command?
|
||||
|
||||
Run the following command to check list of available security updates in your Debian/Ubuntu system
|
||||
|
||||
```
|
||||
$ sudo apt-get -s dist-upgrade | grep "^Inst" | grep -i securi
|
||||
|
||||
Inst libquadmath0 [8.2.0-1ubuntu2~18.04] (8.3.0-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) []
|
||||
Inst libitm1 [8.2.0-1ubuntu2~18.04] (8.3.0-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) []
|
||||
Inst gcc-8-base [8.2.0-1ubuntu2~18.04] (8.3.0-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [libmpx2:amd64 libgcc1:amd64 libtsan0:amd64 liblsan0:amd64 libgomp1:amd64 libatomic1:amd64 libcc1-0:amd64 libstdc++6:amd64 ]
|
||||
Inst libgcc1 [1:8.2.0-1ubuntu2~18.04] (1:8.3.0-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [libmpx2:amd64 libtsan0:amd64 liblsan0:amd64 libgomp1:amd64 libatomic1:amd64 libcc1-0:amd64 libstdc++6:amd64 ]
|
||||
Inst libmpx2 [8.2.0-1ubuntu2~18.04] (8.3.0-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [libtsan0:amd64 liblsan0:amd64 libgomp1:amd64 libatomic1:amd64 libcc1-0:amd64 libstdc++6:amd64 ]
|
||||
Inst liblsan0 [8.2.0-1ubuntu2~18.04] (8.3.0-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [libtsan0:amd64 libgomp1:amd64 libatomic1:amd64 libcc1-0:amd64 libstdc++6:amd64 ]
|
||||
Inst libtsan0 [8.2.0-1ubuntu2~18.04] (8.3.0-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [libgomp1:amd64 libatomic1:amd64 libcc1-0:amd64 libstdc++6:amd64 ]
|
||||
Inst libcc1-0 [8.2.0-1ubuntu2~18.04] (8.3.0-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [libgomp1:amd64 libatomic1:amd64 libstdc++6:amd64 ]
|
||||
Inst libatomic1 [8.2.0-1ubuntu2~18.04] (8.3.0-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [libgomp1:amd64 libstdc++6:amd64 ]
|
||||
Inst libgomp1 [8.2.0-1ubuntu2~18.04] (8.3.0-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [libstdc++6:amd64 ]
|
||||
Inst libstdc++6 [8.2.0-1ubuntu2~18.04] (8.3.0-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64])
|
||||
Inst libdbus-1-dev [1.12.2-1ubuntu1] (1.12.2-1ubuntu1.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) []
|
||||
Inst dbus-user-session [1.12.2-1ubuntu1] (1.12.2-1ubuntu1.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) []
|
||||
Inst dbus-x11 [1.12.2-1ubuntu1] (1.12.2-1ubuntu1.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) []
|
||||
Inst dbus [1.12.2-1ubuntu1] (1.12.2-1ubuntu1.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) []
|
||||
Inst libdbus-1-3 [1.12.2-1ubuntu1] (1.12.2-1ubuntu1.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64])
|
||||
Inst xxd [2:8.0.1453-1ubuntu1] (2:8.0.1453-1ubuntu1.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64])
|
||||
Inst vim-tiny [2:8.0.1453-1ubuntu1] (2:8.0.1453-1ubuntu1.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) []
|
||||
Inst vim-common [2:8.0.1453-1ubuntu1] (2:8.0.1453-1ubuntu1.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [all])
|
||||
Inst binutils-x86-64-linux-gnu [2.30-21ubuntu1~18.04] (2.30-21ubuntu1~18.04.2 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [binutils:amd64 ]
|
||||
Inst binutils-common [2.30-21ubuntu1~18.04] (2.30-21ubuntu1~18.04.2 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [binutils:amd64 libbinutils:amd64 ]
|
||||
Inst binutils [2.30-21ubuntu1~18.04] (2.30-21ubuntu1~18.04.2 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [libbinutils:amd64 ]
|
||||
Inst libbinutils [2.30-21ubuntu1~18.04] (2.30-21ubuntu1~18.04.2 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64])
|
||||
Inst libasan4 [7.3.0-27ubuntu1~18.04] (7.4.0-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) []
|
||||
Inst libubsan0 [7.3.0-27ubuntu1~18.04] (7.4.0-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) []
|
||||
Inst libcilkrts5 [7.3.0-27ubuntu1~18.04] (7.4.0-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) []
|
||||
Inst g++-7 [7.3.0-27ubuntu1~18.04] (7.4.0-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) []
|
||||
Inst gcc-7 [7.3.0-27ubuntu1~18.04] (7.4.0-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) []
|
||||
Inst libstdc++-7-dev [7.3.0-27ubuntu1~18.04] (7.4.0-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) []
|
||||
Inst libgcc-7-dev [7.3.0-27ubuntu1~18.04] (7.4.0-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) []
|
||||
Inst libgfortran4 [7.3.0-27ubuntu1~18.04] (7.4.0-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) []
|
||||
Inst cpp-7 [7.3.0-27ubuntu1~18.04] (7.4.0-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) []
|
||||
Inst gcc-7-base [7.3.0-27ubuntu1~18.04] (7.4.0-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64])
|
||||
Inst cpp [4:7.3.0-3ubuntu2.1] (4:7.4.0-1ubuntu2.3 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64])
|
||||
Inst firefox [67.0.1+build1-0ubuntu0.18.04.1] (67.0.2+build2-0ubuntu0.18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64])
|
||||
Inst firefox-locale-en [67.0.1+build1-0ubuntu0.18.04.1] (67.0.2+build2-0ubuntu0.18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64])
|
||||
Inst gcc [4:7.3.0-3ubuntu2.1] (4:7.4.0-1ubuntu2.3 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64])
|
||||
Inst g++ [4:7.3.0-3ubuntu2.1] (4:7.4.0-1ubuntu2.3 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64])
|
||||
```
|
||||
|
||||
### How to Install available Security Updates in Debian/Ubuntu Using apt-get Command?
|
||||
|
||||
If you found any package updates in the above output. Finally run the following command to install them.
|
||||
|
||||
```
|
||||
$ sudo apt-get -s dist-upgrade | grep "^Inst" | grep -i securi | awk -F " " {'print $2'} | xargs apt-get install
|
||||
```
|
||||
|
||||
Alternatively this can be done from apt command. It’s bit tricky. However, i would suggest users to go with first option.
|
||||
|
||||
### Method-3: How to Check if any Security Updates are available in Debian/Ubuntu Using apt Command?
|
||||
|
||||
Run the following command to check list of available security updates in your Debian/Ubuntu system
|
||||
|
||||
```
|
||||
$ sudo apt list --upgradable | grep -e "-security"
|
||||
|
||||
binutils/bionic-updates,bionic-security 2.30-21ubuntu1~18.04.2 amd64 [upgradable from: 2.30-21ubuntu1~18.04]
|
||||
binutils-common/bionic-updates,bionic-security 2.30-21ubuntu1~18.04.2 amd64 [upgradable from: 2.30-21ubuntu1~18.04]
|
||||
binutils-x86-64-linux-gnu/bionic-updates,bionic-security 2.30-21ubuntu1~18.04.2 amd64 [upgradable from: 2.30-21ubuntu1~18.04]
|
||||
cpp/bionic-updates,bionic-security 4:7.4.0-1ubuntu2.3 amd64 [upgradable from: 4:7.3.0-3ubuntu2.1]
|
||||
cpp-7/bionic-updates,bionic-security 7.4.0-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04]
|
||||
dbus/bionic-updates,bionic-security 1.12.2-1ubuntu1.1 amd64 [upgradable from: 1.12.2-1ubuntu1]
|
||||
dbus-user-session/bionic-updates,bionic-security 1.12.2-1ubuntu1.1 amd64 [upgradable from: 1.12.2-1ubuntu1]
|
||||
dbus-x11/bionic-updates,bionic-security 1.12.2-1ubuntu1.1 amd64 [upgradable from: 1.12.2-1ubuntu1]
|
||||
firefox/bionic-updates,bionic-security 67.0.2+build2-0ubuntu0.18.04.1 amd64 [upgradable from: 67.0.1+build1-0ubuntu0.18.04.1]
|
||||
firefox-locale-en/bionic-updates,bionic-security 67.0.2+build2-0ubuntu0.18.04.1 amd64 [upgradable from: 67.0.1+build1-0ubuntu0.18.04.1]
|
||||
g++/bionic-updates,bionic-security 4:7.4.0-1ubuntu2.3 amd64 [upgradable from: 4:7.3.0-3ubuntu2.1]
|
||||
g++-7/bionic-updates,bionic-security 7.4.0-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04]
|
||||
gcc/bionic-updates,bionic-security 4:7.4.0-1ubuntu2.3 amd64 [upgradable from: 4:7.3.0-3ubuntu2.1]
|
||||
gcc-7/bionic-updates,bionic-security 7.4.0-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04]
|
||||
gcc-7-base/bionic-updates,bionic-security 7.4.0-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04]
|
||||
gcc-8-base/bionic-updates,bionic-security 8.3.0-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04]
|
||||
libasan4/bionic-updates,bionic-security 7.4.0-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04]
|
||||
libatomic1/bionic-updates,bionic-security 8.3.0-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04]
|
||||
libbinutils/bionic-updates,bionic-security 2.30-21ubuntu1~18.04.2 amd64 [upgradable from: 2.30-21ubuntu1~18.04]
|
||||
libcc1-0/bionic-updates,bionic-security 8.3.0-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04]
|
||||
libcilkrts5/bionic-updates,bionic-security 7.4.0-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04]
|
||||
libdbus-1-3/bionic-updates,bionic-security 1.12.2-1ubuntu1.1 amd64 [upgradable from: 1.12.2-1ubuntu1]
|
||||
libdbus-1-dev/bionic-updates,bionic-security 1.12.2-1ubuntu1.1 amd64 [upgradable from: 1.12.2-1ubuntu1]
|
||||
libgcc-7-dev/bionic-updates,bionic-security 7.4.0-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04]
|
||||
libgcc1/bionic-updates,bionic-security 1:8.3.0-6ubuntu1~18.04.1 amd64 [upgradable from: 1:8.2.0-1ubuntu2~18.04]
|
||||
libgfortran4/bionic-updates,bionic-security 7.4.0-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04]
|
||||
libgomp1/bionic-updates,bionic-security 8.3.0-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04]
|
||||
libitm1/bionic-updates,bionic-security 8.3.0-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04]
|
||||
liblsan0/bionic-updates,bionic-security 8.3.0-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04]
|
||||
libmpx2/bionic-updates,bionic-security 8.3.0-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04]
|
||||
libquadmath0/bionic-updates,bionic-security 8.3.0-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04]
|
||||
libstdc++-7-dev/bionic-updates,bionic-security 7.4.0-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04]
|
||||
libstdc++6/bionic-updates,bionic-security 8.3.0-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04]
|
||||
libtsan0/bionic-updates,bionic-security 8.3.0-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04]
|
||||
libubsan0/bionic-updates,bionic-security 7.4.0-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04]
|
||||
vim-common/bionic-updates,bionic-updates,bionic-security,bionic-security 2:8.0.1453-1ubuntu1.1 all [upgradable from: 2:8.0.1453-1ubuntu1]
|
||||
vim-tiny/bionic-updates,bionic-security 2:8.0.1453-1ubuntu1.1 amd64 [upgradable from: 2:8.0.1453-1ubuntu1]
|
||||
xxd/bionic-updates,bionic-security 2:8.0.1453-1ubuntu1.1 amd64 [upgradable from: 2:8.0.1453-1ubuntu1]
|
||||
```
|
||||
|
||||
### How to Install available Security Updates in Debian/Ubuntu Using apt Command?
|
||||
|
||||
If you found any package updates in the above output. Finally run the following command to install them.
|
||||
|
||||
```
|
||||
$ sudo apt list --upgradable | grep -e "-security" | awk -F "/" '{print $1}' | xargs apt install
|
||||
```
|
||||
|
||||
Also, the following file will give you the packages update count.
|
||||
|
||||
```
|
||||
$ sudo cat /var/lib/update-notifier/updates-available
|
||||
|
||||
190 packages can be updated.
|
||||
39 updates are security updates.
|
||||
```
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.2daygeek.com/manually-install-security-updates-ubuntu-debian/
|
||||
|
||||
作者:[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/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/
|
||||
[2]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/
|
200
sources/tech/20190703 Parse arguments with Python.md
Normal file
200
sources/tech/20190703 Parse arguments with Python.md
Normal file
@ -0,0 +1,200 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Parse arguments with Python)
|
||||
[#]: via: (https://opensource.com/article/19/7/parse-arguments-python)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth/users/notsag)
|
||||
|
||||
Parse arguments with Python
|
||||
======
|
||||
Parse Python like a pro with the argparse module.
|
||||
![COBOL punch card][1]
|
||||
|
||||
If you're using [Python][2] for any amount of development, you have probably issued a command in a terminal, even if only to launch a Python script or install a Python module with [pip][3]. Commands may be simple and singular:
|
||||
|
||||
|
||||
```
|
||||
`$ ls`
|
||||
```
|
||||
|
||||
Commands also might take an argument:
|
||||
|
||||
|
||||
```
|
||||
`$ ls example`
|
||||
```
|
||||
|
||||
Commands can also have options or flags:
|
||||
|
||||
|
||||
```
|
||||
`$ ls --color example`
|
||||
```
|
||||
|
||||
Sometimes options also have arguments:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo firewall-cmd --list-all --zone home`
|
||||
```
|
||||
|
||||
### Arguments
|
||||
|
||||
The POSIX shell automatically splits whatever you type as a command into an array. For instance, here is a simple command:
|
||||
|
||||
|
||||
```
|
||||
`$ ls example`
|
||||
```
|
||||
|
||||
The command **ls** is position **$0**, and the argument **example** is in position **$1**.
|
||||
|
||||
You _could_ write a loop to iterate over each item; determine whether it is the command, an option, or an argument; and take action accordingly. Luckily, a module called [argparse][4] already exists for that.
|
||||
|
||||
### Argparse
|
||||
|
||||
The argparse module is easy to integrate into your Python programs and has several convenience features. For instance, if your user changes the order of options or uses one option that takes no arguments (called a _Boolean_, meaning the option toggles a setting on or off) and then another that requires an argument (such as **\--color red**, for example), argparse can handle the variety. If your user forgets an option that's required, the argparse module can provide a friendly error message.
|
||||
|
||||
Using argparse in your application starts with defining what options you want to provide your user. There are several different kinds of arguments you can accept, but the syntax is consistent and simple.
|
||||
|
||||
Here's a simple example:
|
||||
|
||||
|
||||
```
|
||||
#!/usr/bin/env python
|
||||
import argparse
|
||||
import sys
|
||||
|
||||
def getOptions(args=sys.argv[1:]):
|
||||
parser = argparse.ArgumentParser(description="Parses command.")
|
||||
parser.add_argument("-i", "--input", help="Your input file.")
|
||||
parser.add_argument("-o", "--output", help="Your destination output file.")
|
||||
parser.add_argument("-n", "--number", type=int, help="A number.")
|
||||
parser.add_argument("-v", "--verbose",dest='verbose',action='store_true', help="Verbose mode.")
|
||||
options = parser.parse_args(args)
|
||||
return options
|
||||
```
|
||||
|
||||
This code sample creates a function called **getOptions** and tells Python to look at each potential argument preceded by some recognizable string (such as **\--input** or **-i**). Any option that Python finds is returned out of the function as an **options** object (**options** is an arbitrary name and has no special meaning; it's just a data object containing a summary of all the arguments that the function has parsed).
|
||||
|
||||
By default, any argument given by the user is seen by Python as a string. If you need to ingest an integer (a number), you must specify that an option expects **type=int**, as in the **\--number** option in the sample code.
|
||||
|
||||
If you have an argument that just turns a feature on or off, then you must use the **boolean** type, as with the **\--verbose** flag in the sample code. This style of option simply stores **True** or **False**, specifying whether or not the user used the flag. If the option is used, then **stored_true** is activated.
|
||||
|
||||
Once the **getOptions** function runs, you can use the contents of the **options** object and have your program make decisions based on how the user invoked the command. You can see the contents of **options** with a test print statement. Add this to the bottom of your example file:
|
||||
|
||||
|
||||
```
|
||||
`print(getOptions())`
|
||||
```
|
||||
|
||||
Then run the code with some arguments:
|
||||
|
||||
|
||||
```
|
||||
$ python3 ./example.py -i foo -n 4
|
||||
Namespace(input='foo', number=4, output=None, verbose=False)
|
||||
```
|
||||
|
||||
### Retrieving values
|
||||
|
||||
The **options** object in the sample code contains any value provided by the user (or a derived Boolean value) in keys named after the long option. In the sample code, for instance, the **\--number** option can be retrieved by looking at **options.number**.
|
||||
|
||||
|
||||
```
|
||||
options = getOptions(sys.argv[1:])
|
||||
|
||||
if options.verbose:
|
||||
print("Verbose mode on")
|
||||
else:
|
||||
print("Verbose mode off")
|
||||
|
||||
print(options.input)
|
||||
print(options.output)
|
||||
print(options.number)
|
||||
|
||||
# Insert Useful Python Code Here...
|
||||
```
|
||||
|
||||
The Boolean option, **\--verbose** in the example, is determined by testing whether **options.verbose** is True (meaning the user did use the **\--verbose** flag) or False (the user did not use the **\--verbose** flag), and taking some action accordingly.
|
||||
|
||||
### Help and feedback
|
||||
|
||||
Argparse also includes a built-in **\--help** (**-h** for short) option that provides a helpful tip on how the command is used. This is derived from your code, so it takes no extra work to generate this help system:
|
||||
|
||||
|
||||
```
|
||||
$ ./example.py --help
|
||||
usage: example.py [-h] [-i INPUT] [-o OUTPUT] [-n NUMBER] [-v]
|
||||
|
||||
Parses command.
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
-i INPUT, --input INPUT
|
||||
Your input file.
|
||||
-o OUTPUT, --output OUTPUT
|
||||
Your destination output file.
|
||||
-n NUMBER, --number NUMBER
|
||||
A number.
|
||||
-v, --verbose Verbose mode.
|
||||
```
|
||||
|
||||
### Python parsing like a pro
|
||||
|
||||
This a simple example that demonstrates how to deal with parsing arguments in a Python application and how to quickly and efficiently document their syntax. The next time you write a quick Python script, give it some options with argparse. You'll thank yourself later, and your command will feel less like a quick hack and more like a "real" Unix command!
|
||||
|
||||
Here's the sample code, which you can use for testing:
|
||||
|
||||
|
||||
```
|
||||
#!/usr/bin/env python3
|
||||
# GNU All-Permissive License
|
||||
# Copying and distribution of this file, with or without modification,
|
||||
# are permitted in any medium without royalty provided the copyright
|
||||
# notice and this notice are preserved. This file is offered as-is,
|
||||
# without any warranty.
|
||||
|
||||
import argparse
|
||||
import sys
|
||||
|
||||
def getOptions(args=sys.argv[1:]):
|
||||
parser = argparse.ArgumentParser(description="Parses command.")
|
||||
parser.add_argument("-i", "--input", help="Your input file.")
|
||||
parser.add_argument("-o", "--output", help="Your destination output file.")
|
||||
parser.add_argument("-n", "--number", type=int, help="A number.")
|
||||
parser.add_argument("-v", "--verbose",dest='verbose',action='store_true', help="Verbose mode.")
|
||||
options = parser.parse_args(args)
|
||||
return options
|
||||
|
||||
options = getOptions(sys.argv[1:])
|
||||
|
||||
if options.verbose:
|
||||
print("Verbose mode on")
|
||||
else:
|
||||
print("Verbose mode off")
|
||||
|
||||
print(options.input)
|
||||
print(options.output)
|
||||
print(options.number)
|
||||
```
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/7/parse-arguments-python
|
||||
|
||||
作者:[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/users/notsag
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cobol-card-punch-programming-code.png?itok=6W6PUqUi (COBOL punch card)
|
||||
[2]: https://www.python.org/
|
||||
[3]: https://pip.pypa.io/en/stable/installing/
|
||||
[4]: https://pypi.org/project/argparse/
|
@ -0,0 +1,82 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to be good at creating and maintaining systems at-large)
|
||||
[#]: via: (https://opensource.com/article/19/7/book-review-building-evolutionary-architectures)
|
||||
[#]: author: (Mike Bursell https://opensource.com/users/mikecamel)
|
||||
|
||||
How to be good at creating and maintaining systems at-large
|
||||
======
|
||||
A book review of "Building Evolutionary Architectures: Support Constant
|
||||
Change" for open source and security folks
|
||||
![An open book][1]
|
||||
|
||||
Initially, this article was simply a review of the book, but as I got into it, I realised that I wanted to talk about how the approach it describes is applicable to a couple of different groups (security folks and open source projects), and so I’ve gone with it.
|
||||
|
||||
How, then, did I come across the book? I was attending a conference a few months ago (DeveloperWeek San Diego), and decided to go to one of the sessions because it looked interesting. The speaker was Dr. Rebecca Parsons, and I liked what she was talking about so much that I ordered this book, whose subject was the topic of her talk, to arrive at home by the time I would return a couple of days later.
|
||||
|
||||
![Building Evolutionary Architectures: Support Constant Change][2]
|
||||
|
||||
[_Building Evolutionary Architectures: Support Constant Change_][3] is not a book about securitym, and I'm a security guy, but it deals with security as one application of its approach, and very convincingly. The central issue that the authors—all employees of ThoughtWorks—identify is, simplified, that although we’re good at creating features for applications, we’re less good at creating, and then maintaining, broader properties of systems. This problem is compounded, they suggest, by the fast and ever-changing nature of modern development practices, where "enterprise architects can no longer rely on static planning".
|
||||
|
||||
The alternative that they propose is to consider "fitness functions", "objectives you want your architecture to exhibit or move towards". Crucially, these are properties of the architecture—or system—rather than features or specific functionality. Tests should be created to monitor the specific functions, but they won’t be your standard unit tests, nor will they necessarily be "point in time" tests. Instead, they will measure a variety of issues, possibly over a period of time, to let you know whether your system is meeting the particular fitness functions you are measuring. There’s a lot of discussion of how to measure these fitness functions, but I would have liked even more. From my point of view, it was one of the most valuable topics covered.
|
||||
|
||||
Frankly, the above might be enough to recommend the book, but there’s more. They advocate strongly for creating incremental change to meet your requirements (gradual, rather than major changes) and "evolvable architectures", encouraging you to realise that:
|
||||
|
||||
1. you may not meet all your fitness functions at the beginning;
|
||||
2. applications which may have met the fitness functions at one point may _cease_ to meet them later on, for various reasons;
|
||||
3. your architecture is likely to change over time;
|
||||
4. your requirements, and therefore the priority that you give to each fitness function, will change over time;
|
||||
5. even if your fitness functions remain the same, the ways in which you need to monitor them may change.
|
||||
|
||||
|
||||
|
||||
All of these are, in my view, extremely useful insights for anybody designing and building a system. Combining them with architectural thinking is even more valuable.
|
||||
|
||||
As is standard for modern O’Reilly books, there are examples throughout, including a worked fake consultancy journey of a particular company with specific needs, leading you through some of the practices in the book. At times, this felt a little contrived, but the mechanism is generally helpful. There were times when the book seemed to stray from its core approach—which is architectural, as per the title—into explanations through pseudo code, but these support one of the useful aspects of the book, which is giving examples of what architectures are more or less suited to the principles expounded in the more theoretical parts. Some readers may feel more at home with the theoretical, others with the more example-based approach (I lean towards the former), but all in all, it seems like an appropriate balance. Relating these to the impact of "architectural coupling" was particularly helpful, in my view.
|
||||
|
||||
There is a useful grounding in some of the advice in Conway’s Law ("Organizations which design systems … are constrained to produce designs which are copies of the communication structures of these organizations.") which led me to wonder how we could model open source projects—and their architectures—based on this perspective. There are also (as is also standard these days) patterns and anti-patterns: I would generally consider these a useful part of any book on design and architecture.
|
||||
|
||||
### Why is this a book for security folks?
|
||||
|
||||
The most important thing about this book, from my point of view as a security systems architect, is that it _isn’t_ about security. Security is mentioned, but is not considered core enough to the book to merit a mention in the appendix. The point, though, is that the security of a system—an embodiment of an architecture—is a perfect example of a fitness function. Taking this as a starting point for a project will help you do two things.
|
||||
|
||||
First, you will avoid focussing on features and functionality, and look at the bigger picture. Second, you will consider what you _really_ need from security in the system, and how that translates into issues such as the security posture to be adopted, and the measurements you will take to validate it through the lifecycle.
|
||||
|
||||
Possibly even more important than those two points is that it will force you to consider the priority of security in relation to other fitness functions (resilience, maybe, or ease of use?) and how the relative priorities will—and should—change over time. A realisation that we don’t live in a bubble, and that our priorities are not always that same as those of other stakeholders in a project, is always useful.
|
||||
|
||||
### Why is this a book for open source folks?
|
||||
|
||||
Very often—and for quite understandable and forgiveable reasons—the architectures of open source projects grow organically at first, needing major overhauls and refactoring at various stages of their lifecycles. This is not to say that this doesn’t happen in proprietary software projects as well, of course, but the sometimes frequent changes in open source projects' emphasis and requirements, the ebb and flow of contributors and contributions and the sometimes, um, reduced levels of documentation aimed at end users can mean that features are significantly prioritised over what we could think of as the core vision of the project. One way to remedy this would be to consider the appropriate fitness functions of the project, to state them upfront, and to have a regular cadence of review by the community, to ensure that they are:
|
||||
|
||||
* still relevant;
|
||||
* correctly prioritised at this stage in the project;
|
||||
* actually being met.
|
||||
|
||||
|
||||
|
||||
If any of the above come into question, it’s a good time to consider a wider review by the community, and maybe a refactoring or partial redesign of the project.
|
||||
|
||||
Open source projects have—quite rightly—various different models of use and intended users. One of the happenstances that can negatively affect a project is when it is identified as a possible fit for a use case for which it was not originally intended. Academic software which is designed for accuracy over performance might not be a good fit for corporate research, for instance, in the same way that a project aimed at home users which prioritises minimal computing resources might not be appropriate for a high-availability enterprise roll-out. One of the ways of making this clear is by being very clear up-front about the fitness functions that you expect your project to meet—and, vice versa, about the fitness functions you are looking to fulfil when you are looking to select a project. It is easy to focus on features and functionality, and to overlook the more non-functional aspects of a system, and fitness functions allow us to make some informed choices about how to balance these decisions.
|
||||
|
||||
_This article was originally posted on [Alice, Eve and Bob - a security blog][4]._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/7/book-review-building-evolutionary-architectures
|
||||
|
||||
作者:[Mike Bursell][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/mikecamel
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/open_book_color.jpg?itok=I-8tNQOP (An open book)
|
||||
[2]: https://opensource.com/sites/default/files/styles/medium/public/uploads/building-evolutionary-architectures.jpg?itok=UlyKLSxV (Building Evolutionary Architectures: Support Constant Change)
|
||||
[3]: https://www.oreilly.com/library/view/building-evolutionary-architectures/9781491986356/
|
||||
[4]: https://aliceevebob.com/2019/06/25/building-evolutionary-architectures-for-security-and-for-open-source/
|
@ -0,0 +1,127 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Bash Script to Monitor Messages Log (Warning, Error and Critical) on Linux)
|
||||
[#]: via: (https://www.2daygeek.com/linux-bash-script-to-monitor-messages-log-warning-error-critical-send-email/)
|
||||
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||
|
||||
Bash Script to Monitor Messages Log (Warning, Error and Critical) on Linux
|
||||
======
|
||||
|
||||
There are many open source monitoring tools are currently available in market to monitor Linux systems performance.
|
||||
|
||||
It will send an email alert when the system reaches the specified threshold limit.
|
||||
|
||||
It monitors everything such as CPU utilization, Memory utilization, swap utilization, disk space utilization and much more.
|
||||
|
||||
If you only have few systems and want to monitor them then writing a small shell script can make your task very easy.
|
||||
|
||||
In this tutorial we have added a shell script to monitor Messages Log on Linux system.
|
||||
|
||||
We had added many useful shell scripts in the past. If you want to check those, navigate to the below link.
|
||||
|
||||
* **[How to automate day to day activities using shell scripts?][1]**
|
||||
|
||||
|
||||
|
||||
This script will check **“warning, error and critical”** in the `/var/log/messages` file and trigger a mail to given email id, if it’s found anything related it.
|
||||
|
||||
We can’t run this script frequently that may fill up your inbox if the server has many matching strings, instead we can run once in a day.
|
||||
|
||||
To overcome this issue, i made the script to trigger an email in a different manner.
|
||||
|
||||
If any given strings are found in the **“/var/log/messages”** file for yesterday’s date then the script will send an email alert to given email id.
|
||||
|
||||
**Note:** You need to change the email id instead of ours. Also, you can change the Memory utilization threshold value as per your requirement.
|
||||
|
||||
```
|
||||
# vi /opt/scripts/os-log-alert.sh
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
#Set the variable which equal to zero
|
||||
|
||||
prev_count=0
|
||||
|
||||
count=$(grep -i "`date --date='yesterday' '+%b %e'`" /var/log/messages | egrep -wi 'warning|error|critical' | wc -l)
|
||||
|
||||
if [ "$prev_count" -lt "$count" ] ; then
|
||||
|
||||
# Send a mail to given email id when errors found in log
|
||||
|
||||
SUBJECT="WARNING: Errors found in log on "`date --date='yesterday' '+%b %e'`""
|
||||
|
||||
# This is a temp file, which is created to store the email message.
|
||||
|
||||
MESSAGE="/tmp/logs.txt"
|
||||
|
||||
TO="[email protected]"
|
||||
|
||||
echo "ATTENTION: Errors are found in /var/log/messages. Please Check with Linux admin." >> $MESSAGE
|
||||
|
||||
echo "Hostname: `hostname`" >> $MESSAGE
|
||||
|
||||
echo -e "\n" >> $MESSAGE
|
||||
|
||||
echo "+------------------------------------------------------------------------------------+" >> $MESSAGE
|
||||
|
||||
echo "Error messages in the log file as below" >> $MESSAGE
|
||||
|
||||
echo "+------------------------------------------------------------------------------------+" >> $MESSAGE
|
||||
|
||||
grep -i "`date --date='yesterday' '+%b %e'`" /var/log/messages | awk '{ $3=""; print}' | egrep -wi 'warning|error|critical' >> $MESSAGE
|
||||
|
||||
mail -s "$SUBJECT" "$TO" < $MESSAGE
|
||||
|
||||
#rm $MESSAGE
|
||||
|
||||
fi
|
||||
```
|
||||
|
||||
Set an executable permission to `os-log-alert.sh` file.
|
||||
|
||||
```
|
||||
$ chmod +x /opt/scripts/os-log-alert.sh
|
||||
```
|
||||
|
||||
Finally add a cronjob to automate this. It will run everyday at 7'o clock.
|
||||
|
||||
```
|
||||
# crontab -e
|
||||
0 7 * * * /bin/bash /opt/scripts/os-log-alert.sh
|
||||
```
|
||||
|
||||
**Note:** You will be getting an email alert everyday at 7 o'clock, which is for yesterday's log.
|
||||
|
||||
**Output:** You will be getting an email alert similar to below.
|
||||
|
||||
```
|
||||
ATTENTION: Errors are found in /var/log/messages. Please Check with Linux admin.
|
||||
|
||||
+-----------------------------------------------------+
|
||||
Error messages in the log file as below
|
||||
+-----------------------------------------------------+
|
||||
Jul 3 02:40:11 ns1 kernel: php-fpm[3175]: segfault at 299 ip 000055dfe7cc7e25 sp 00007ffd799d7d38 error 4 in php-fpm[55dfe7a89000+3a7000]
|
||||
Jul 3 02:50:14 ns1 kernel: lmtp[8249]: segfault at 20 ip 00007f9cc05295e4 sp 00007ffc57bca1a0 error 4 in libdovecot-storage.so.0.0.0[7f9cc04df000+148000]
|
||||
Jul 3 15:36:09 ns1 kernel: php-fpm[17846]: segfault at 299 ip 000055dfe7cc7e25 sp 00007ffd799d7d38 error 4 in php-fpm[55dfe7a89000+3a7000]
|
||||
Jul 3 15:45:54 ns1 pure-ftpd: ([email protected]) [WARNING] Authentication failed for user [daygeek]
|
||||
Jul 3 16:25:36 ns1 pure-ftpd: ([email protected]) [WARNING] Sorry, cleartext sessions and weak ciphers are not accepted on this server.#012Please reconnect using TLS security mechanisms.
|
||||
Jul 3 16:44:20 ns1 kernel: php-fpm[8979]: segfault at 299 ip 000055dfe7cc7e25 sp 00007ffd799d7d38 error 4 in php-fpm[55dfe7a89000+3a7000]
|
||||
```
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.2daygeek.com/linux-bash-script-to-monitor-messages-log-warning-error-critical-send-email/
|
||||
|
||||
作者:[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/category/shell-script/
|
@ -0,0 +1,100 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Enable ‘Tap to click’ on Ubuntu Login Screen [Quick Tip])
|
||||
[#]: via: (https://itsfoss.com/enable-tap-to-click-on-ubuntu-login-screen/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
|
||||
Enable ‘Tap to click’ on Ubuntu Login Screen [Quick Tip]
|
||||
======
|
||||
|
||||
_**Brief: The tap to click option doesn’t work on the login screen in Ubuntu 18.04 GNOME desktop. In this tutorial, you’ll learn to enable the ‘tap to click’ on the Ubuntu login screen.**_
|
||||
|
||||
One of the first few things I do after installing Ubuntu is to make sure that tap to click has been enabled. As a laptop user, I prefer to tap the touchpad for making a left click. This is more convenient than using the left click button on the touchpad all the time.
|
||||
|
||||
This is what happens when I have logged in and using the operating system. But if you are at the login screen, the tap to click doesn’t work and that’s an annoyance.
|
||||
|
||||
On the [GDM login screen][1] in Ubuntu (or other distributions using GNOME desktop), you have to click the username in order to bring the password field. Now if you are habitual of tap to click, it doesn’t work on the login screen even if you have it enabled and use it after logging into the system.
|
||||
|
||||
This is a minor annoyance but an annoyance nonetheless. The good news is that you can fix this annoyance.Let me show you how to do that in this quick tip.
|
||||
|
||||
### Enabling tap to click on Ubuntu login screen
|
||||
|
||||
![][2]
|
||||
|
||||
You’ll have to use the terminal and a few commands here. I hope you are comfortable with it.
|
||||
|
||||
[Open a terminal using Ctrl+Alt+T shortcut in Ubuntu][3]. Since Ubuntu 18.04 is still using X server, you need to enable it to connect to the [x server][4]. For that, you can add gdm to access control list.
|
||||
|
||||
Switch to root user first. It’s required because you have to switch as gdm user later and you cannot do that as a non-root user.
|
||||
|
||||
```
|
||||
sudo -i
|
||||
```
|
||||
|
||||
[There is no password set for root user in Ubuntu][5]. You access it with your admin user account. So when asked for password, use your own password. You won’t see anything being typed on the screen when you type in your password.
|
||||
|
||||
```
|
||||
xhost +SI:localuser:gdm
|
||||
```
|
||||
|
||||
Here’s the output for me:
|
||||
|
||||
```
|
||||
xhost +SI:localuser:gdm
|
||||
localuser:gdm being added to access control list
|
||||
```
|
||||
|
||||
Now run this command so that the the ‘user gdm’ has the correct tap to click setting.
|
||||
|
||||
```
|
||||
gsettings set org.gnome.desktop.peripherals.touchpad tap-to-click true
|
||||
```
|
||||
|
||||
If you see a warning like this: (process:6339): dconf-WARNING **: 19:52:21.217: Unable to open /root/.local/share/flatpak/exports/share/dconf/profile/user: Permission denied . Don’t worry. Just ignore it.
|
||||
|
||||
[][6]
|
||||
|
||||
Suggested read How To Change Hostname on Ubuntu & Other Linux Distributions
|
||||
|
||||
This will enable you to perform a tap to click on the login screen. Why were you not able to use tap to click when you made the changes in the system settings before? It’s because at the login screen, you haven’t selected your username yet. You get to use your account only when you select the user on the screen. This is why you had to use the user gdm and add the correct settings with it.
|
||||
|
||||
Restart Ubuntu and you’ll see that you can now use the tap to select your user account now.
|
||||
|
||||
#### Revert the changes
|
||||
|
||||
If you are not happy with the tap to click on the Ubuntu login screen for some reason, you can revert the changes.
|
||||
|
||||
You’ll have to perform all the steps you did in the previous section: switch to root, connect gdm with x server, switch to gdm user. But instead of the last command, you need to run this command:
|
||||
|
||||
```
|
||||
gsettings set org.gnome.desktop.peripherals.touchpad tap-to-click false
|
||||
```
|
||||
|
||||
That’s it.
|
||||
|
||||
As I said, it’s a tiny thing. I mean you can easily do a left click instead of the tap to click. It’s just a matter of one single click.However, it breaks the ‘continuity’ when you are forced to use the left click after a few taps.
|
||||
|
||||
I hope you liked this quick little tweak. If you know some other cool tweaks, do share it with us.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/enable-tap-to-click-on-ubuntu-login-screen/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://wiki.archlinux.org/index.php/GDM
|
||||
[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/07/tap-to-click-on-ubuntu-login.jpg?ssl=1
|
||||
[3]: https://itsfoss.com/ubuntu-shortcuts/
|
||||
[4]: https://en.wikipedia.org/wiki/X.Org_Server
|
||||
[5]: https://itsfoss.com/change-password-ubuntu/
|
||||
[6]: https://itsfoss.com/change-hostname-ubuntu/
|
@ -0,0 +1,80 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Free and Open Source Trello Alternative OpenProject 9 Released)
|
||||
[#]: via: (https://itsfoss.com/openproject-9-release/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
替代 Trello 的免费开源 OpenProject 9 发布了
|
||||
======
|
||||
|
||||
[OpenProject][1] 是一个开源项目协作管理软件。它是 [Trello][2] 和 [Jira][3] 等专有方案的替代品。
|
||||
|
||||
如果个人使用,你可以免费使用它,并在你自己的服务器上进行设置(并托管它)。这样,你就可以控制数据。
|
||||
|
||||
当然,如果你是[云或企业版用户][4],那么你可以使用高级功能和更优先的帮助。
|
||||
|
||||
OpenProject 9 的重点是新的看板试图,包列表视图和工作模板。
|
||||
|
||||
如果你对此不了解,可以尝试一下。但是,如果你是现有用户 - 在迁移到 OpenProject 9 之前,你应该知道这些新功能。
|
||||
|
||||
### OpenProject 9 有什么新功能?
|
||||
|
||||
以下是最新版 OpenProjec t的一些主要更改。
|
||||
|
||||
#### Scrum 和敏捷看板
|
||||
|
||||
![][5]
|
||||
|
||||
对于云和企业版,有一个新的 [scrum][6] 和[敏捷][7]看板视图。你还可以 [kanban 风格][8]方式展示你的工作,从而更轻松地支持你的敏捷和 scrum 团队。
|
||||
|
||||
新的看板视图使你可以轻松了解为该任务分配的人员并快速更新状态。你还有不同的看板视图选项,如基本看板、状态看板和版本看板。
|
||||
|
||||
#### 工作包模板
|
||||
|
||||
![Work Package Template][9]
|
||||
|
||||
你不必为每个独立的工作包从头开始创建所有内容。而是,你只需保留一个模板,这样你就可以在需要创建新工作包时使用它。这将节省大量时间。
|
||||
|
||||
#### 新的工作包列表视图
|
||||
|
||||
![Work Package View][10]
|
||||
|
||||
在工作包列表中,有一个微小的新增功能,可让你查看特定工作的已分配人员的头像。
|
||||
|
||||
#### “我的”页面的可自定义工作包视图
|
||||
|
||||
“我的”页面显示你正在处理的内容(以及进度),它不应该一直很无聊。因此,现在你可以自定义它,甚至可以添加甘特图来可视化你的工作。
|
||||
|
||||
**总结**
|
||||
|
||||
有关迁移和安装的详细说明,请参阅[官方的公告帖][12],其中包含了必要的细节。
|
||||
|
||||
另外,我们很想知道你使用 OpenProject 9 的经历,请在下面的评论栏告诉我们!如果你使用其他一些项目管理软件,请随时向我们和其他 FOSS 读者推荐。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/openproject-9-release/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.openproject.org/
|
||||
[2]: https://trello.com/
|
||||
[3]: https://www.atlassian.com/software/jira
|
||||
[4]: https://www.openproject.org/pricing/
|
||||
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/open-project-9-scrum-agile.jpeg?fit=800%2C517&ssl=1
|
||||
[6]: https://en.wikipedia.org/wiki/Scrum_(software_development)
|
||||
[7]: https://en.wikipedia.org/wiki/Agile_software_development
|
||||
[8]: https://en.wikipedia.org/wiki/Kanban
|
||||
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/work-package-template.jpg?ssl=1
|
||||
[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/work-package-view.jpg?fit=800%2C454&ssl=1
|
||||
[12]: https://www.openproject.org/openproject-9-new-scrum-agile-board-view/
|
85
translated/talk/20191110 What is DevSecOps.md
Normal file
85
translated/talk/20191110 What is DevSecOps.md
Normal file
@ -0,0 +1,85 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (PandaWizard)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (What is DevSecOps?)
|
||||
[#]: via: (https://opensource.com/article/19/1/what-devsecops)
|
||||
[#]: author: (Brett Hunoldt https://opensource.com/users/bretthunoldtcom)
|
||||
|
||||
什么是 DevSecOps?
|
||||
======
|
||||
DevSecOps 的实践之旅开始于 DevSecOps 授权,启用和培养。下面就介绍如何开始学习使用 DevSecOps。
|
||||
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/devop.png?itok=Yicb2nnZ)
|
||||
|
||||
> Stephen Streichsbier 说过: DevSecOps 使得组织可以用 DevOps 的速度发布内在安全的软件。
|
||||
|
||||
DevSecOps 是一场关于 DevOps 概念实践或艺术形式的变革。为了更好理解 DevSecOps,你应该首先理解 DevOps 的含义。
|
||||
|
||||
DevOps 起源于通过合并开发和运维实践,消除隔离,统一关注点,提升团队和产品的效率和性能。它是一种注重构建容易维持和易于平常自动运营维护产品和服务的新型协作方式。
|
||||
|
||||
安全在很多团队中都是常见的隔离点。安全的核心关注点是保护团队,而有时这也意味着生成延缓新服务或是新产品发布的障碍或是策略,用于保障任何事都能被很好的理解和安全的执行,并且没有给团队带来不必要的风险。
|
||||
|
||||
**[[点击下载 DevSecOps 的引导手册]][1]**
|
||||
|
||||
因为安全方面的明显特征和它可能带来的摩擦,开发和运维有时会避开或是满足客观的安全要求。在一些公司,这种隔离形成了一种产品安全完全是安全团队责任的期望,并取决于安全团队去寻找产品的安全缺陷或是可能带来的问题。
|
||||
|
||||
DevSecOps 看起来是通过给开发或是运维角色加强或是建立安全意识,或是在产品团队中引入一个安全工程师角色,在产品设计中找到安全问题,从而把安全要求汇聚在 Devops 中。
|
||||
|
||||
这样使得公司能更快发布和更新产品,并且充分相信安全已经嵌入产品中。
|
||||
|
||||
### 坚固的软件哪里适用 DevSecOps?
|
||||
|
||||
建造坚固的软件是 DevOps 文化的一个层面而不是一个特别的实践,它完善和增强了 DevSecops 的实践。想想一款坚固的软件就像是某些经历过残酷战斗过程的事物。
|
||||
|
||||
有必要指出坚固的软件并不是 100% 安全可靠的(虽然它可能最终是在某些方面)。然而,它被设计成可以处理大部分被抛过来的问题。
|
||||
|
||||
践行坚固软件最重要的原则是促进竞争,实践,可控的失败与合作。
|
||||
|
||||
### 你如何开始学习 DevSecOps ?
|
||||
|
||||
开始实践 DevSecOps 涉及提升安全需求和在开发过程中最早期可能的阶段实践。它最终在公司文化上提升了安全的重要性,使得安全成为所有人的责任,而并不只是安全团队的责任。
|
||||
|
||||
你可能在团队中听说过“左上升”这个词,如果你把开发周期包括产品变革的的关键时期线放平在一条横线上,从初始化到设计,建造,测试以及最终的运行。安全的目的就是今早的参与进来。这使得风险可以在设计中能更好的评估、交流和减轻。“左提升”的含义是指促使安全能在开发周期线上更往左走。
|
||||
|
||||
这篇入门文章有三个关键要素:
|
||||
|
||||
* 授权
|
||||
* 启用
|
||||
* 培养
|
||||
|
||||
|
||||
|
||||
授权,在我看来,是关于释放控制权以及使得团队做出独立决定而不用害怕失败或影响(理性分析)。这个过程的唯一告诫信息就是要严格的做出明智的决定(不要比这更低要求)。
|
||||
|
||||
为了实现授权,商务和行政支持(通过内部销售,展示来建立,通过建立矩阵来 展示这项投资的回报)是打破历史障碍和分割的团队的关键。合并安全人员到开发和运维团队中,提升交流和透明度透明度有助于 DevSecOps 的开始之旅。
|
||||
|
||||
这次整合和移动使得团队只关注单一的结果:打造一个他们共同负责的产品,让开发和安全人员相互依赖合作。这将引领你们共同走向授权。这是产品研发团队的共同责任,并保证每个可分割的产品都保持其安全性。
|
||||
|
||||
启用涉及正确的使用掌握在团队手中的工具和资源。这是准备建立一种通过论坛、维基、信息聚合的知识分享文化。
|
||||
|
||||
打造一种注重自动化、重复任务应该编码来尽可能减少以后的操作并增强安全性。这种场景不仅仅是提供知识,而是让这种知识能够通过多种渠道和媒介(通过某些工具)可获取,以便它可以被团队或是个人以他喜欢的方式去消化和分享。一种工具可以更好的实现当团队成员正在编码而另一组成员正在来的路上。让工具简单可用和让团队可以使用它们。
|
||||
|
||||
不同的 DevSecOps 团队有不同的喜好,因此允许它们尽可能的保持独立。这是一种微笑平衡的练习,因为你真的很想在经济规模和能力中分享产品。在选择中协作参与并更新工具方法有助于减少使用中的障碍。
|
||||
|
||||
最后,也可能是最重要的, DevSecOps 是有关训练和兴趣打造。聚会、社交或是组织中通常的报告会都是很棒的方式让同事们教学和分享他们的知识。有时,这些高光的被分享的挑战、关注点或是一些其他人没有关注到的风险。分享和教学也是一种高效的学习和指导团队的方法。
|
||||
|
||||
在我个人经验中,每个团队的文化都是独一无二的,因此你不能用“一种尺寸适合所有”的方法。走进你的团队并找到他们想要使用的工具方法。尝试不同的论坛和聚会并找出最适用于你们文化的方式。寻找反馈并询问团队如何工作,他们喜欢什么以及对应的原因。适应和学习,保持乐观,不要停止尝试,你们将会有所收获。
|
||||
|
||||
[下载 DevSecOps 的入门手册][1]
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/1/what-devsecops
|
||||
|
||||
作者:[Brett Hunoldt][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[PandaWizard](https://github.com/PandaWizard)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/bretthunoldtcom
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/downloads/devsecops
|
@ -0,0 +1,195 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How To Find The Port Number Of A Service In Linux)
|
||||
[#]: via: (https://www.ostechnix.com/how-to-find-the-port-number-of-a-service-in-linux/)
|
||||
[#]: author: (sk https://www.ostechnix.com/author/sk/)
|
||||
|
||||
如何在 Linux 中查找服务的端口号
|
||||
======
|
||||
|
||||
![Find The Port Number Of A Service In Linux OS][1]
|
||||
|
||||
由于某些原因,你可能经常需要查找端口名称和端口号。如果是这样,你很幸运。今天,在这个简短的教程中,我们将看到在 Linux 系统中最简单、最快捷的查找服务端口号的方法。可能有很多方法可以做到,但我目前只知道以下三种方法。请继续阅读。
|
||||
|
||||
### 在 Linux 中查找服务的端口号
|
||||
|
||||
**方法1:使用 [grep][2] 命令**
|
||||
|
||||
要使用 grep 命令在 Linux 中查找指定服务的默认端口号,只需运行:
|
||||
|
||||
```
|
||||
$ grep <port> /etc/services
|
||||
```
|
||||
|
||||
例如,要查找 SSH 服务的默认端口,只需运行:
|
||||
|
||||
```
|
||||
$ grep ssh /etc/services
|
||||
```
|
||||
|
||||
就这么简单。此命令应该适用于大多数 Linux 发行版。以下是我的 Arch Linux 测试机中的示例输出:
|
||||
|
||||
```
|
||||
ssh 22/tcp
|
||||
ssh 22/udp
|
||||
ssh 22/sctp
|
||||
sshell 614/tcp
|
||||
sshell 614/udp
|
||||
netconf-ssh 830/tcp
|
||||
netconf-ssh 830/udp
|
||||
sdo-ssh 3897/tcp
|
||||
sdo-ssh 3897/udp
|
||||
netconf-ch-ssh 4334/tcp
|
||||
snmpssh 5161/tcp
|
||||
snmpssh-trap 5162/tcp
|
||||
tl1-ssh 6252/tcp
|
||||
tl1-ssh 6252/udp
|
||||
ssh-mgmt 17235/tcp
|
||||
ssh-mgmt 17235/udp
|
||||
```
|
||||
|
||||
正如你在上面的输出中所看到的,SSH 服务的默认端口号是 22。
|
||||
|
||||
让我们找到 Apache Web 服务器的端口号。为此,命令是:
|
||||
|
||||
```
|
||||
$ grep http /etc/services
|
||||
# http://www.iana.org/assignments/port-numbers
|
||||
http 80/tcp www www-http # WorldWideWeb HTTP
|
||||
http 80/udp www www-http # HyperText Transfer Protocol
|
||||
http 80/sctp # HyperText Transfer Protocol
|
||||
https 443/tcp # http protocol over TLS/SSL
|
||||
https 443/udp # http protocol over TLS/SSL
|
||||
https 443/sctp # http protocol over TLS/SSL
|
||||
gss-http 488/tcp
|
||||
gss-http 488/udp
|
||||
webcache 8080/tcp http-alt # WWW caching service
|
||||
webcache 8080/udp http-alt # WWW caching service
|
||||
[...]
|
||||
```
|
||||
|
||||
FTP 端口号是什么?这很简单!
|
||||
|
||||
```
|
||||
$ grep ftp /etc/services
|
||||
ftp-data 20/tcp
|
||||
ftp-data 20/udp
|
||||
# 21 is registered to ftp, but also used by fsp
|
||||
ftp 21/tcp
|
||||
ftp 21/udp fsp fspd
|
||||
tftp 69/tcp
|
||||
[...]
|
||||
```
|
||||
|
||||
**方法 2:使用 getent 命令**
|
||||
|
||||
如你所见,上面的命令显示指定搜索词 “ssh”、“http” 和 “ftp” 的所有端口名称和数字。这意味着,你将获得与给定搜索词匹配的所有端口名称的相当长的输出。
|
||||
|
||||
但是,你可以使用 “getent” 命令精确输出结果,如下所示:
|
||||
|
||||
```
|
||||
$ getent services ssh
|
||||
ssh 22/tcp
|
||||
|
||||
$ getent services http
|
||||
http 80/tcp www www-http
|
||||
|
||||
$ getent services ftp
|
||||
ftp 21/tcp
|
||||
```
|
||||
|
||||
如果你不知道端口名称,但是知道端口号,那么你只需将端口名称替换为数字:
|
||||
|
||||
```
|
||||
$ getent services 80
|
||||
http 80/tcp
|
||||
```
|
||||
|
||||
要显示所有端口名称和端口号,只需运行:
|
||||
|
||||
```
|
||||
$ getent services
|
||||
```
|
||||
|
||||
**方法 3:使用 Whatportis 程序**
|
||||
|
||||
**Whatportis** 是一个简单的 python 脚本,来用于查找端口名称和端口号。与上述命令不同,此程序以漂亮的表格形式输出。
|
||||
|
||||
确保已安装 PIP 包管理器。如果没有,请参考以下链接。
|
||||
|
||||
* [**如何使用 Pip 管理 Python 包**][6]
|
||||
|
||||
|
||||
|
||||
安装 PIP 后,运行以下命令安装 Whatportis 程序。
|
||||
|
||||
```
|
||||
$ pip install whatportis
|
||||
```
|
||||
|
||||
现在,你可以找到与服务关联的端口,如下所示。
|
||||
|
||||
```
|
||||
$ whatportis ssh
|
||||
|
||||
$ whatportis ftp
|
||||
|
||||
$ whatportis http
|
||||
```
|
||||
|
||||
我的 CentOS 7 服务器的示例输出:
|
||||
|
||||
![][7]
|
||||
|
||||
在 Linux 中查找服务的端口号
|
||||
|
||||
如果你不知道服务的确切名称,请使用 **–like** 标志来显示相关结果。
|
||||
|
||||
```
|
||||
$ whatportis mysql --like
|
||||
```
|
||||
|
||||
上述命令帮助你查找与服务关联的端口。你还可以找到与端口号相关联的服务,如下所示。
|
||||
|
||||
```
|
||||
$ whatportis 993
|
||||
```
|
||||
|
||||
你甚至可以以 **JSON** 格式显示结果。
|
||||
|
||||
```
|
||||
$ whatportis 993 --json
|
||||
```
|
||||
|
||||
![][8]
|
||||
|
||||
有关更多详细信息,请参阅 GitHub 仓库。
|
||||
|
||||
* [**Whatportis GitHub 仓库**][9]
|
||||
|
||||
|
||||
|
||||
就是这些了。你现在知道了如何使用三种简单方法在 Linux 中查找端口名称和端口号。如果你知道任何其他方法/命令,请在下面的评论栏告诉我。我会查看并更相应地更新本指南。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.ostechnix.com/how-to-find-the-port-number-of-a-service-in-linux/
|
||||
|
||||
作者:[sk][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.ostechnix.com/author/sk/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.ostechnix.com/wp-content/uploads/2018/06/Find-The-Port-Number-720x340.png
|
||||
[2]: https://www.ostechnix.com/the-grep-command-tutorial-with-examples-for-beginners/
|
||||
[6]: https://www.ostechnix.com/manage-python-packages-using-pip/
|
||||
[7]: https://www.ostechnix.com/wp-content/uploads/2018/06/whatportis.png
|
||||
[8]: https://www.ostechnix.com/wp-content/uploads/2018/06/whatportis-1.png
|
||||
[9]: https://github.com/ncrocfer/whatportis
|
File diff suppressed because it is too large
Load Diff
@ -1,122 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (4 cool terminal multiplexers)
|
||||
[#]: via: (https://fedoramagazine.org/4-cool-terminal-multiplexers/)
|
||||
[#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/)
|
||||
|
||||
4 款很酷的终端复用器
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
Fedora 系统对很多用户来说都很舒适。它有一个令人惊叹的桌面,可以轻松地完成日常任务。表面之下有 Linux 系统的全部功能,终端是高级用户使用它们的最简单的方法。默认的终端简单且功能有限。但是,_终端复用器_能让你的终端变得非常强大。本文展示了一些流行的终端多路复用器以及如何安装它们。
|
||||
|
||||
|
||||
你为什么要用它?嗯,首先,它可以让你注销你的系统,同时_让你的终端会话不受干扰_。退出你的控制台,加密它,在其他地方旅行时通过远程登录 SSH 继续之前的操作是非常有用的。这里有一些工具可以看下。
|
||||
|
||||
最古老和最知名的终端多路复用器之一是 _screen_。但是,由于代码不再维护,本文将重点介绍最近的应用。 (“最近的”是相对的,其中一些已存在多年!)
|
||||
|
||||
### Tmux
|
||||
|
||||
_tmux_ 是 _screen_ 的最广泛使用的替换之一。它有高度可配置的接口。你可以根据需要对 tmux 进行编程以启动特定类型的会话。在前面发表的这篇文章中你会发现更多关于 tmux 的信息:
|
||||
|
||||
> [使用 tmux 实现更强大的终端][2]
|
||||
|
||||
已经是 tmux 用户?你可能会喜欢[这篇使你的 tmux 会话更有效的文章][3]。
|
||||
|
||||
要安装 tmux,由于你可能已经在终端中,请使用 _dnf_ 并带上 _sudo_:
|
||||
|
||||
```
|
||||
$ sudo dnf install tmux
|
||||
```
|
||||
|
||||
要开始学习,请运行 _tmux_ 命令。单窗格窗口以你的默认 shell 启动。tmux 使用_修饰键_来表示接下来会发出命令。默认情况下,此键为 **Ctrl+B**。如果输入 **Ctrl+B, C**,你将创建一个带有 shell 的新窗口。
|
||||
|
||||
提示:使用 **Ctrl+B, ?** 进入帮助模式,会列出你可以使用的所有键。为了简单起见,你先查看 _bind-key -T prefix_ 开头的行。这些是你可以在修饰键之后立即使用的键,可以用来配置你的 tmux 会话。你可以按 **Ctrl+C** 退出帮助模式回 tmux。
|
||||
|
||||
要完全退出 tmux,请使用标准 _exit_ 命令或 _Ctrl+D_ 退出所有 shell。
|
||||
|
||||
### Dvtm
|
||||
|
||||
你可能最近在 Fedroa Magzine上看到过一篇 [dwm,一个动态窗口管理器][4]的文章。像 dwm 一样,_dvtm_ 用于平铺窗口管理,但是用在终端中。它的设计坚持 UNIX 的“做好一件事”的理念,在这里是管理终端中的窗口。
|
||||
|
||||
安装 dvtm 也很简单。但是,如果你想要前面提到的注销功能,你还需要 _abduco_ 包来处理 dvtm 的会话管理。
|
||||
|
||||
```
|
||||
$ sudo dnf install dvtm abduco
|
||||
```
|
||||
|
||||
dvtm 已经映射了许多管理终端窗口的按键。默认情况下,它使用 **Ctrl+G** 作为其修饰键。这个按键告诉 dvtm 接下来的字符将成为它应该处理的命令。例如, **Ctrl+G, C** 创建一个新窗口,**Ctrl+G, X** 将其关闭。
|
||||
|
||||
有关使用 dvtm 的更多信息,请查看 dvtm 的[主页][5],其中包含大量提示和入门信息。
|
||||
|
||||
### Byobu
|
||||
|
||||
虽然 _byobu_ 本身并不是真正的多路复用器 - 它封装了 _tmux_ 甚至更老的 _screen_ 来添加功能,但它也值得在这里一提。通过帮助菜单和窗口选项卡,以便更加容易地找到功能,Byobu 使终端复用器更适合初学者。
|
||||
|
||||
当然它也可以在 Fedora 仓库中找到。要安装它,请使用以下命令:
|
||||
|
||||
```
|
||||
$ sudo dnf install byobu
|
||||
```
|
||||
|
||||
默认情况下,_byobu_ 会在内部运行 _screen_,因此你可能希望运行 _byobu-tmux_ 来封装 _tmux_。你可以使用 **F9** 键打开帮助菜单以获取更多信息,来帮助你入门。
|
||||
|
||||
### Mtm
|
||||
|
||||
_mtm_ 是你可以找到的最小的复用器之一。事实上,它只有大约 1000 行代码!如果你处于受限的环境(例如旧硬件、最小容器等)中,你可能会发现它很有用。要开始使用,你需要安装一些包。
|
||||
|
||||
```
|
||||
$ sudo dnf install git ncurses-devel make gcc
|
||||
```
|
||||
|
||||
然后克隆 mtm 所在的仓库:
|
||||
|
||||
```
|
||||
$ git clone https://github.com/deadpixi/mtm.git
|
||||
```
|
||||
|
||||
进入 _mtm_ 文件夹并构建程序:
|
||||
|
||||
```
|
||||
$ make
|
||||
```
|
||||
|
||||
你可能会收到一些警告,但完成后,你将会有一个非常小的 _mtm_ 程序。使用以下命令运行它:
|
||||
|
||||
```
|
||||
$ ./mtm
|
||||
```
|
||||
|
||||
你可以在 [GitHub 页面][6]上找到该程序的所有文档。
|
||||
|
||||
这里只是一些终端复用器。你有想推荐的么?请在下面留下你的评论,享受在终端中创建窗口吧!
|
||||
|
||||
* * *
|
||||
|
||||
_由 _[ _Michael_][7]_ 拍摄,发布于 [Unsplash][8]。_
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/4-cool-terminal-multiplexers/
|
||||
|
||||
作者:[Paul W. Frields][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://fedoramagazine.org/author/pfrields/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2018/08/tmuxers-4-816x345.jpg
|
||||
[2]: https://fedoramagazine.org/use-tmux-more-powerful-terminal/
|
||||
[3]: https://fedoramagazine.org/4-tips-better-tmux-sessions/
|
||||
[4]: https://fedoramagazine.org/lets-try-dwm-dynamic-window-manger/
|
||||
[5]: http://www.brain-dump.org/projects/dvtm/#why
|
||||
[6]: https://github.com/deadpixi/mtm
|
||||
[7]: https://unsplash.com/photos/48yI_ZyzuLo?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
|
||||
[8]: https://unsplash.com/search/photos/windows?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
|
216
translated/tech/20190627 How to use Tig to browse Git logs.md
Normal file
216
translated/tech/20190627 How to use Tig to browse Git logs.md
Normal file
@ -0,0 +1,216 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to use Tig to browse Git logs)
|
||||
[#]: via: (https://opensource.com/article/19/6/what-tig)
|
||||
[#]: author: (Olaf Alders https://opensource.com/users/oalders/users/mbbroberg/users/marcobravo)
|
||||
|
||||
如何使用 Tig 浏览 Git 日志
|
||||
======
|
||||
Tig不仅仅是 Git 的文本界面。以下是它如何增强你的日常工作流程。
|
||||
![A person programming][1]
|
||||
|
||||
如果你使用 Git 作为你的版本控制系统,你可能已经让自己接受 Git 是一个复杂的野兽。它是一个很棒的工具,但在 Git 仓库查找可能很麻烦。因此像 [Tig][2] 这样的工具出现了。
|
||||
|
||||
来自 [Tig 手册页][3]:
|
||||
|
||||
> Tig 是 git(1) 的基于 ncurses 的文本界面。它主要用作 Git 仓库浏览器,但也有助于在块级别暂存提交更改,并显示各种 Git 命令的输出。
|
||||
|
||||
这基本上意味着 Tig 提供了一个可以在终端中运行的基于文本的用户界面。Tig 可以让你轻松浏览你的 Git 日志,但它可以做的远不止让你从最后的提交跳到前一个提交。
|
||||
|
||||
![Tig screenshot][4]
|
||||
|
||||
这篇快速入门的 Tig 中的许多例子都是直接从其出色的手册页中拿出来的。我强烈建议你阅读它以了解更多信息。
|
||||
|
||||
### 安装 Tig
|
||||
|
||||
* Fedora 和 RHEL: **sudo dnf install tig**
|
||||
* Ubuntu 和 Debian: **sudo apt install tig**
|
||||
* MacOS:**:brew install tig**
|
||||
|
||||
|
||||
|
||||
有关更多选项,请参阅官方[安装说明][5]。
|
||||
|
||||
### 浏览当前分支中的提交
|
||||
|
||||
如果要浏览分支中的最新提交,请输入:
|
||||
|
||||
|
||||
```
|
||||
`tig`
|
||||
```
|
||||
|
||||
这是这样。这个三字符命令将启动一个浏览器,你可以在其中导航当前分支中的提交。你可以将其视为 **git log** 的封装器。
|
||||
|
||||
要浏览输出,可以使用向上和向下箭头键从一个提交移动到另一个提交。按回车键将会垂直分割窗口,右侧包含所选提交的内容。你可以继续在左侧的提交历史记录中上下浏览,你的更改将显示在右侧。使用 **k** 和 **j** 逐行上下浏览,**-** 和空格键在右侧上下翻页。使用 **q** 退出右侧窗格。
|
||||
|
||||
搜索 **tig** 输出也很简单。使用 **/** 向前搜索,使用 **?** 在左右窗格中向后搜索。
|
||||
|
||||
![Searching Tig][6]
|
||||
|
||||
这足以让你开始浏览你的提交。这里有很多的键绑定,但单击 **h** 将显示“帮助”菜单,你可以在其中发现其导航和命令选项。你还可以使用 **/** 和 **?** 来搜索“帮助”菜单。使用 **q** 退出帮助。
|
||||
|
||||
![Tig Help][7]
|
||||
|
||||
### 浏览单个文件的修改
|
||||
|
||||
由于 Tig 是 **git log** 的封装器,它可以方便地接受可以传递给 **git log** 的相同参数。例如,要浏览单个文件的提交历史记录,请输入:
|
||||
|
||||
|
||||
```
|
||||
`tig README.md`
|
||||
```
|
||||
|
||||
将其与被封装的 Git 命令的输出进行比较,以便更清楚地了解 Tig 如何增强输出。
|
||||
|
||||
|
||||
```
|
||||
`git log README.md`
|
||||
```
|
||||
|
||||
要在原始 Git 输出中包含补丁,你可以添加 **-p** 选项:
|
||||
|
||||
|
||||
```
|
||||
`git log -p README.md`
|
||||
```
|
||||
|
||||
如果要将提交范围缩小到特定日期范围,请尝试以下操作:
|
||||
|
||||
|
||||
```
|
||||
`tig --after="2017-01-01" --before="2018-05-16" -- README.md`
|
||||
```
|
||||
|
||||
再一次,你可以将其与原始的 Git 版本进行比较:
|
||||
|
||||
|
||||
```
|
||||
`git log --after="2017-01-01" --before="2018-05-16" -- README.md`
|
||||
```
|
||||
|
||||
### 浏览谁更改了文件
|
||||
|
||||
有时你想知道谁对文件进行了更改以及原因。命令:
|
||||
|
||||
|
||||
```
|
||||
`tig blame README.md`
|
||||
```
|
||||
|
||||
本质上是 **git blame** 的封装。正如你 所期望的那样,它允许你查看谁是编辑指定行的最后一人,它还允许你查看到引入该行的提交。这有点像 vim 的 **vim-fugitive**插件提供的**:Gblame**命令。
|
||||
|
||||
### 浏览你的暂存
|
||||
|
||||
如果你像我一样,你可能会在你的暂存处有许多编辑。你很容易忘记它们。你可以通过以下方式查看暂存处中的最新项目:
|
||||
|
||||
|
||||
```
|
||||
`git stash show -p stash@{0}`
|
||||
```
|
||||
|
||||
你可以通过以下方式找到第二个最新项目:
|
||||
|
||||
|
||||
```
|
||||
`git stash show -p stash@{1}`
|
||||
```
|
||||
|
||||
以此类推。如果你在需要它们时调用这些命令,那么你会有比我更清晰的内存。
|
||||
|
||||
|
||||
与上面的 Git 命令一样,Tig 可以通过简单的调用轻松增强你的 Git 输出:
|
||||
|
||||
|
||||
```
|
||||
`tig stash`
|
||||
```
|
||||
|
||||
尝试在有暂存的仓库中执行此命令。你将能够浏览_并搜索_你的暂存项,快速浏览你的那些修改。
|
||||
|
||||
### 浏览你的引用
|
||||
|
||||
git ref 是你提交的东西的哈希值。这包括文件和分支。使用 **tig refs** 命令可以浏览所有引用并深入查看特定提交。
|
||||
|
||||
|
||||
```
|
||||
`tig refs`
|
||||
```
|
||||
|
||||
完成后,使用 **q** 回到前面的菜单。
|
||||
|
||||
### 浏览 git 状态
|
||||
|
||||
如果要查看哪些文件已被暂存,哪些文件未被跟踪,请使用 **tig status**,它是 **git status** 的封装。
|
||||
|
||||
![Tig status][8]
|
||||
|
||||
### 浏览 git grep
|
||||
|
||||
你可以使用 **grep** 命令在文本文件中搜索表达式。命令 **tig grep** 允许你导览 **git grep** 的输出。例如:
|
||||
|
||||
|
||||
```
|
||||
`tig grep -i foo lib/Bar`
|
||||
```
|
||||
|
||||
它会导览 **lib/Bar** 目录中以大小写敏感的方式搜索 **foo** 的输出。
|
||||
|
||||
### 通过标准输入管道输出给 Tig
|
||||
|
||||
如果要将提交 ID 列表传递给 Tig,那么必须使用 **\--stdin** 标志,以便 **tig show** 从标准输入读取。否则,**tig show** 会在没有输入的情况下启动(出现空白屏幕)。
|
||||
|
||||
|
||||
```
|
||||
`git rev-list --author=olaf HEAD | tig show --stdin`
|
||||
```
|
||||
|
||||
### 添加自定义绑定
|
||||
|
||||
你可以使用 [rc][9] 文件自定义 Tig。以下是如何根据自己的喜好添加一些有用的自定义键绑定的示例。
|
||||
|
||||
在主目录中创建一个名为 **.tigrc** 的文件。在你喜欢的编辑器中打开 **~/.tigrc** 并添加:
|
||||
|
||||
|
||||
```
|
||||
# Apply the selected stash
|
||||
bind stash a !?git stash apply %(stash)
|
||||
|
||||
# Drop the selected stash item
|
||||
bind stash x !?git stash drop %(stash)
|
||||
```
|
||||
|
||||
如上所述,运行 **tig stash** 以浏览你的暂存。但是,通过这些绑定,你可以按 **a**将暂存中的项目应用到仓库,并按 **x** 从暂存中删除项目。请记住,你要在浏览暂存_列表_时,才能执行这些命令。如果你正在浏览暂存_项_,请输入 **q** 退出该视图,然后按 **a** 或 **x** 以获得所需效果。
|
||||
|
||||
有关更多信息,你可以阅读有关 [Tig 键绑定][10]。
|
||||
|
||||
### 总结
|
||||
|
||||
我希望这有助于演示 Tig 如何增强你的日常工作流程。Tig 可以做更强大的事情(比如暂存代码行),但这超出了这篇介绍性文章的范围。这里有足够的让你危险的信息,但还有更多值得探索的地方。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/6/what-tig
|
||||
|
||||
作者:[Olaf Alders][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/oalders/users/mbbroberg/users/marcobravo
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_keyboard_laptop_development_code_woman.png?itok=vbYz6jjb (A person programming)
|
||||
[2]: https://jonas.github.io/tig/
|
||||
[3]: http://manpages.ubuntu.com/manpages/bionic/man1/tig.1.html
|
||||
[4]: https://opensource.com/sites/default/files/uploads/tig.jpg (Tig screenshot)
|
||||
[5]: https://jonas.github.io/tig/INSTALL.html
|
||||
[6]: https://opensource.com/sites/default/files/uploads/tig-search.png (Searching Tig)
|
||||
[7]: https://opensource.com/sites/default/files/uploads/tig-help.png (Tig Help)
|
||||
[8]: https://opensource.com/sites/default/files/uploads/tig-status.png (Tig status)
|
||||
[9]: https://en.wikipedia.org/wiki/Run_commands
|
||||
[10]: https://github.com/jonas/tig/wiki/Bindings
|
@ -0,0 +1,182 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (chen-ni)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Ubuntu or Fedora: Which One Should You Use and Why)
|
||||
[#]: via: (https://itsfoss.com/ubuntu-vs-fedora/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
|
||||
你应该选择 Ubuntu 还是 Fedora?
|
||||
======
|
||||
|
||||
_**摘要:选择 Ubuntu 还是 Fedora?它们的区别是什么?哪一个更好?你应该使用哪一个?看看这篇对比 Ubuntu 和 Fedora 的文章吧。**_
|
||||
|
||||
Ubuntu 和 Fedora 都是最流行的 Linux 发行版之一,在两者之间做出选择实非易事。在这篇文章里,我会对比一下 Ubuntu 和 Fedora 的不同特点,帮助你进行决策。
|
||||
|
||||
请注意,这篇文章主要是从桌面版的角度进行对比的。Fedora 或者 Ubuntu 针对容器的特殊版本不会被考虑在内。
|
||||
|
||||
### Ubuntu vs Fedora: 哪一个更好?
|
||||
|
||||
![Ubuntu Vs Fedora][3]
|
||||
|
||||
不同 Linux 发行版之间的区别主要体现在以下几个方面:
|
||||
|
||||
* 基础发行版(Debian、红帽、Arch,或者是从头做起)
|
||||
* 安装方式
|
||||
* 支持的桌面环境
|
||||
* 软件包管理、软件支持和更新
|
||||
* 硬件支持
|
||||
* 开发团队(由企业支持,还是由业余爱好者创建)
|
||||
* 发布周期
|
||||
* 社区和线上支持
|
||||
|
||||
下面我们来看一下 Ubuntu 和 Fedora 之间的相似之处和不同之处。掌握了这些信息之后,也许就更容易在两者之间做出选择了。
|
||||
|
||||
#### 安装方式
|
||||
|
||||
Ubuntu 的 Ubiquity 安装器是最好用的安装器之一。我认为这是让 Ubuntu 如此流行的重要原因之一,因为在 2004 年 Ubuntu 刚刚诞生的时候,安装 Linux 还是一个很庞大的工程。
|
||||
|
||||
Ubuntu 安装器可以让你在大约 10 分钟左右完成安装。大多数情况下,它还可以识别出机器里安装的 Windows 系统,并且只需要几下点击就可以实现 Ubuntu 和 Windows 的双系统启动。
|
||||
|
||||
锦上添花的是,在安装 Ubuntu 的过程中你还可以进行系统更新,或者是安装第三方编译码器。
|
||||
|
||||
![Ubuntu Installer][4]
|
||||
|
||||
Fedora 使用的是 Anaconda 安装器,拥有简单易用的界面,同样简化了安装过程。
|
||||
|
||||
![Fedora Installer | Image Credit Fedora Magazine][5]
|
||||
|
||||
Fodora 还提供了一个可以在 Windows 操作系统上下载并创建 Fedora live USB 的写入工具。不过我在大约两年前尝试使用它的时候并不成功,最后使用了一个常规的创建 live USB 的软件。
|
||||
|
||||
根据我的经验,安装 Ubuntu 要比安装 Fedora 容易一些。不过这并不是说安装 Fedora 有多困难,只是 Ubuntu 更简单而已。
|
||||
|
||||
#### 桌面环境
|
||||
|
||||
Ubuntu 和 Fedora 默认都使用 GNOME 桌面环境。
|
||||
|
||||
![GNOME Desktop in Fedora][6]
|
||||
|
||||
Fedora 使用的是 stock GNOME 桌面,而 Ubuntu 则在此基础上做了个性化调整,让它看起来就像 Ubuntu 之前使用的 Unity 桌面环境。
|
||||
|
||||
![GNOME desktop customized by Ubuntu][7]
|
||||
|
||||
除了 GNOME,Ubuntu 和 Fedora 都提供了一些其它桌面环境的版本。
|
||||
|
||||
Ubuntu 有 Kubuntu、Xubuntu、Lubuntu 等版本,分别提供不同的桌面环境。虽然它们都是 Ubuntu 的官方版本,但是却不是由 Canonical 的 Ubuntu 团队直接开发的,而是由另外的团队开发。
|
||||
|
||||
Fedora 通过 [Fedora Spins][8] 的方式提供了一些不同桌面环境的版本。和 Kubuntu、Lubuntu 等版本不同的是,这些版本并非由独立团队开发,而是由 Fedora 核心团队开发的。
|
||||
|
||||
#### 软件包管理和可用软件数量
|
||||
|
||||
Ubuntu 使用 APT 软件包管理器提供软件并进行管理(包括应用程序、库,以及其它所需代码),而 Fedora 使用 DNF 软件包管理器。
|
||||
|
||||
[][9]
|
||||
|
||||
[Ubuntu 拥有庞大的软件仓库][10],能够让你轻松安装数以千计的程序,包括 FOSS(LCTT 译注:Free and Open-Source Software 的缩写,自由开源软件)和非 FOSS 的软件。Fedora 则只专注于提供开源软件。虽然这一点在最近的版本里有所转变,但是 Fedora 的软件仓库在规模上仍然比 Ubuntu 的要逊色一些。
|
||||
|
||||
一些第三方软件开发者为 Linux 提供像 .exe 文件一样可以点击安装的软件包。在 Ubuntu 里这些软件包是 .deb 格式的,在 Fedora 里是 .rpm 格式的。
|
||||
|
||||
大多数软件供应商都为 Linux 用户提供 DEM 和 RPM 文件,但是我也经历过供应商只提供 DEB 文件的情况。比如说 SEO 工具 [Screaming Frog][11] 就只提供 DEB 软件包。反过来,一个软件只有 RPM 格式但是没有 DEB 格式这种情况就极其罕见了。
|
||||
|
||||
#### 硬件支持
|
||||
|
||||
一般来说,Linux 在 WiFi 适配器和显卡的兼容性上容易出现问题,Ubuntu 和 Fedora 都受此影响。以 Nvidia 为例,它的 [开源驱动程序 Nouveau 经常会引发系统启动时假死机之类的问题][12]。
|
||||
|
||||
在 Ubuntu 上你可以轻松安装专有驱动程序作为补充。在很多情况下,这样可以获得对硬件更好的支持。
|
||||
|
||||
![Installing proprietary driver is easier in Ubuntu][13]
|
||||
|
||||
Fedora 则坚持使用开源软件,所以在 Fedora 上安装专有驱动程序就比较困难了。
|
||||
|
||||
#### 线上支持和用户群
|
||||
|
||||
Ubuntu 和 Fedora 都通过社区论坛提供了很好的线上支持。Ubuntu 主要有两个论坛:[UbuntuForums][14] 和 [Ask Ubuntu][15]。Fedora 主要的论坛则是 [Ask Fedora][16]。
|
||||
|
||||
就用户群体而言,Fedora 有着庞大的用户数量。不过 Ubuntu 更为流行,用户数量甚至更为庞大。
|
||||
|
||||
Ubuntu 的流行催生了很多专注于 Ubuntu 的网站和博客。所以相比 Fedora,你可以得到更多关于 Ubuntu 的故障排除指导和学习材料。
|
||||
|
||||
#### 发布周期
|
||||
|
||||
Fedora 每六个月发布一个新版本,每个版本有九个月的支持周期。也就是说,你必须在六个月到九个月之间进行一次系统升级。进行 Fedora 版本升级并不是一件困难的事情,但是需要良好的网络连接。并非所有人都喜欢每九个月进行一次 1.5 GB 的版本升级。
|
||||
|
||||
Ubuntu 有两种版本:常规发布版本和长期支持(LTS)发布版本。常规版本和 Fedora 比较类似,每隔六个月发布一次,有九个月的支持周期。
|
||||
|
||||
而长期支持发布版本则每两年发布一次,有五年的支持周期。常规发布版本探索新功能特性和新的软件版本,而长期支持发布版本则支持旧版本软件。对于不喜欢经常改变、青睐稳定性的人来说,这是一个很好的选择。
|
||||
|
||||
#### 强大的基础发行版
|
||||
|
||||
Ubuntu 是基于 [Debian][17] 发行版的。Debian 是最大的社区项目之一,并且也是 [自由软件][18] 世界里最受尊敬的项目之一。
|
||||
|
||||
Fedora 则是红帽公司的一个社区项目。红帽公司是一个专注于 Linux 发行版的公司。Fedora 充当了一个“试验田”的角色(用技术术语来说叫做“上游”),用来在红帽企业级 Linux 发布新功能之前对这些新功能进行试验。
|
||||
|
||||
#### 在背后支持的企业
|
||||
|
||||
Ubuntu 和 Fedora 都有来自母公司的支持。Ubuntu 源自 [Canonical][21] 公司,而 Fedora 源自 [红帽公司][22](现在是 [IBM 的一部分][23])。背后企业的支持非常重要,因为可以确保 Linux 发行版良好的维护。
|
||||
|
||||
有一些发行版是由一群独立的业余爱好者们共同创建的,但是在工作负荷之下经常会崩溃。你也许见过一些还算比较流行的发行版项目仅仅是因为这个原因而终止了。很多这样的发行版由于开发者没有足够的业余时间可以投入到项目上而不得不终止,比如 [Antergos][24] 和 Korora。
|
||||
|
||||
Ubuntu 和 Fedora 的背后都有基于 Linux 的企业的支持,这让它们比其它独立的发行版更胜一筹。
|
||||
|
||||
#### Ubuntu vs Fedora:服务端
|
||||
|
||||
到目前为止,我们在 Ubuntu 和 Fedora 之间的对比主要都集中在桌面端。不过如果不考虑一下服务端的话,对 Linux 的讨论就不能算是完整的。
|
||||
|
||||
![Ubuntu Server][25]
|
||||
|
||||
Ubuntu 不仅在桌面端很流行,在服务端也有很强的存在感。如果你能够在桌面端熟练使用 Ubuntu,那么也不会对 Ubuntu 服务器版本感到陌生。我就是从使用 Ubuntu 桌面端开始的,现在我的网站都运行在 Ubuntu 服务器上。
|
||||
|
||||
Fedora 同样有服务端版本,并且也有人在使用。但是大多数系统管理者不会喜欢一个每九个月就需要重启升级的服务器。
|
||||
|
||||
学习 Fedora 可以更好地帮助你使用红帽企业级 Linux(RHEL)。RHEL 是一个付费产品,你需要购买订阅才可以使用。如果你希望在服务器上运行一个和 Fedora 或者红帽类似的操作系统,我推荐使用 CentOS。[CentOS][26] 同样是红帽公司附属的一个社区项目,但是专注于服务端。
|
||||
|
||||
#### 结论
|
||||
|
||||
你可以看到,Ubuntu 和 Fedora 有很多相似之处。不过就可用软件数量、驱动安装和线上支持来说,Ubuntu 的确更有优势。**Ubuntu 也因此成为了一个更好的选择,尤其是对于没有经验的 Linux 新手而言。**
|
||||
|
||||
如果你想要熟悉红帽的话,Fedora 是一个很好的开始。如果你对 Linux 有一定经验,或者是只想要使用开源软件,Fedora 就是一个很棒的选择。
|
||||
|
||||
最终还是需要你自己来决定是使用 Fedora 还是 Ubuntu。我会建议为两个发行版分别创建一个 live USB,并且在虚拟机上体验一下。
|
||||
|
||||
你对于 Ubuntu vs Fedora 的看法是什么呢?你更喜欢哪一个发行版,为什么?在评论里分享你的看法吧。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/ubuntu-vs-fedora/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://ubuntu.com/
|
||||
[2]: https://getfedora.org/
|
||||
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/07/ubuntu-vs-fedora.png?resize=800%2C450&ssl=1
|
||||
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/03/install-linux-inside-windows-10.jpg?resize=800%2C479&ssl=1
|
||||
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/07/fedora-installer.png?resize=800%2C598&ssl=1
|
||||
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/07/gnome-desktop-fedora.png?resize=800%2C450&ssl=1
|
||||
[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/applications_menu.jpg?resize=800%2C450&ssl=1
|
||||
[8]: https://spins.fedoraproject.org/
|
||||
[9]: https://itsfoss.com/system-76-galago-pro/
|
||||
[10]: https://itsfoss.com/ubuntu-repositories/
|
||||
[11]: https://www.screamingfrog.co.uk/seo-spider/#download
|
||||
[12]: https://itsfoss.com/fix-ubuntu-freezing/
|
||||
[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/software_updates_additional_drivers_nvidia.png?resize=800%2C523&ssl=1
|
||||
[14]: https://ubuntuforums.org/
|
||||
[15]: https://askubuntu.com/
|
||||
[16]: https://ask.fedoraproject.org/
|
||||
[17]: https://www.debian.org/
|
||||
[18]: https://www.fsf.org/
|
||||
[19]: https://en.wikipedia.org/wiki/Upstream_(software_development)
|
||||
[20]: https://itsfoss.com/manage-startup-applications-ubuntu/
|
||||
[21]: https://canonical.com/
|
||||
[22]: https://www.redhat.com/en
|
||||
[23]: https://itsfoss.com/ibm-red-hat-acquisition/
|
||||
[24]: https://itsfoss.com/antergos-linux-discontinued/
|
||||
[25]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/07/ubuntu-server.png?resize=800%2C232&ssl=1
|
||||
[26]: https://centos.org/
|
244
translated/tech/20190702 Jupyter and data science in Fedora.md
Normal file
244
translated/tech/20190702 Jupyter and data science in Fedora.md
Normal file
@ -0,0 +1,244 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (chen-ni)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Jupyter and data science in Fedora)
|
||||
[#]: via: (https://fedoramagazine.org/jupyter-and-data-science-in-fedora/)
|
||||
[#]: author: (Avi Alkalay https://fedoramagazine.org/author/aviram/)
|
||||
|
||||
在 Fedora 上搭建 Jupyter 和数据科学环境
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
在过去,神谕和魔法师被认为拥有发现奥秘的力量,国王和统治者们会借助他们预测未来,或者至少是听取一些建议。如今我们生活在一个痴迷于将一切事情量化的社会里,这份工作就交给数据科学家了。
|
||||
|
||||
数据科学家通过使用统计模型、数值分析,以及统计学之外的高级算法,结合数据库里已经存在的数据,去发掘、推断和预测尚不存在的数据(有时是关于未来的数据)。这就是为什么我们要做这么多的预测分析和规划分析。
|
||||
|
||||
下面是一些可以借助数据科学家回答的问题:
|
||||
|
||||
1. 哪些学生有旷课倾向?每个人旷课的原因分别是什么?
|
||||
2. 哪栋房子的售价比合理价格要高或者低?一栋房子的合理价格是多少?
|
||||
3. 如何将我们的客户按照潜在的特质进行分组?
|
||||
4. 这个孩子的早熟可能会在未来引发什么问题?
|
||||
5. 我们的呼叫中心在明天早上 11 点 43 分会接收到多少次呼叫?
|
||||
6. 我们的银行是否应该向这位客户发放贷款?
|
||||
|
||||
请注意,这些问题的答案是在任何数据库里都查询不到的,因为它们尚不存在,需要被计算出来才行。这就是我们数据科学家从事的工作。
|
||||
|
||||
在这篇文章中你会学习如何将 Fedora 系统打造成数据科学家的开发环境和生产系统。其中大多数基本软件都有 RPM 软件包,但是最先进的组件目前只能通过 Python 的 **pip** 工具安装。
|
||||
|
||||
### Jupyter IDE
|
||||
|
||||
大多数现代数据科学家使用 Python 工作。他们工作中很重要的一部分是 <ruby>探索性数据分析<rt>Exploratory Data Analysis<rt></ruby>(EDA)。EDA 是一种手动进行的、交互性的过程,包括提取数据、探索数据特征、寻找相关性、通过绘制图形进行数据可视化并理解数据的分布特征,以及实现简易的预测模型。
|
||||
|
||||
Jupyter 是能够完美胜任该工作的一个 web 应用。Jupyter 使用的 Notebook 文件支持丰富的文本,包括渲染精美的数学公式(得益于 [mathjax][2])、代码块和代码输出(包括图形输出)。
|
||||
|
||||
Notebook 文件的后缀是 **.ipynb**,意思是“交互式 Python Notebook”。
|
||||
|
||||
#### 搭建并运行 Jupyter
|
||||
|
||||
首先,[使用 sudo][3] 安装 Jupyter 核心软件包:
|
||||
|
||||
```
|
||||
$ sudo dnf install python3-notebook mathjax sscg
|
||||
```
|
||||
你或许需要安装数据科学家常用的一些附加可选模块:
|
||||
|
||||
```
|
||||
$ sudo dnf install python3-seaborn python3-lxml python3-basemap python3-scikit-image python3-scikit-learn python3-sympy python3-dask+dataframe python3-nltk
|
||||
```
|
||||
|
||||
设置一个用来登陆 Notebook 的 web 界面的密码,从而避免使用冗长的令牌。你可以在终端里任何一个位置运行下面的命令:
|
||||
|
||||
```
|
||||
$ mkdir -p $HOME/.jupyter
|
||||
$ jupyter notebook password
|
||||
```
|
||||
|
||||
然后输入你的密码,这时会自动创建 ** $HOME/.jupyter/jupyter_notebook_config.json ** 这个文件,包含了你的密码的加密后版本。
|
||||
|
||||
接下来,通过使用 SSLby 为 Jupyter 的 web 服务器生成一个自签名的 HTTPS 证书:
|
||||
|
||||
```
|
||||
$ cd $HOME/.jupyter; sscg
|
||||
```
|
||||
|
||||
配置 Jupyter 的最后一步是编辑 **$HOME/.jupyter/jupyter_notebook_config.json** 这个文件。按照下面的模版编辑该文件:
|
||||
|
||||
```
|
||||
{
|
||||
"NotebookApp": {
|
||||
"password": "sha1:abf58...87b",
|
||||
"ip": "*",
|
||||
"allow_origin": "*",
|
||||
"allow_remote_access": true,
|
||||
"open_browser": false,
|
||||
"websocket_compression_options": {},
|
||||
"certfile": "/home/aviram/.jupyter/service.pem",
|
||||
"keyfile": "/home/aviram/.jupyter/service-key.pem",
|
||||
"notebook_dir": "/home/aviram/Notebooks"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
红色的部分应该替换为你的文件夹。蓝色的部分在你创建完密码之后就已经自动生成了。绿色的部分是 **sscg** 生成的和加密相关的文件。
|
||||
|
||||
接下来创建一个用来存放 notebook 文件的文件夹,应该和上面配置里 **notebook_dir** 一致:
|
||||
|
||||
```
|
||||
$ mkdir $HOME/Notebooks
|
||||
```
|
||||
|
||||
你已经完成了配置。现在可以在系统里的任何一个地方通过以下命令启动 Jupyter Notebook:
|
||||
|
||||
```
|
||||
$ jupyter notebook
|
||||
```
|
||||
|
||||
或者是将下面这行代码添加到 **$HOME/.bashrc** 文件,创建一个叫做 **jn** 的快捷命令:
|
||||
|
||||
```
|
||||
alias jn='jupyter notebook'
|
||||
```
|
||||
|
||||
运行 **jn** 命令之后,你可以通过网络内部的任何一个浏览器访问 **<https://your-fedora-host.com:8888>** (LCTT 译注:将域名替换为服务器的域名),就可以看到 Jupyter 的用户界面了,需要使用前面设置的密码登录。你可以尝试键入一些 Python 代码和标记文本,看起来会像下面这样:
|
||||
|
||||
![Jupyter with a simple notebook][4]
|
||||
|
||||
除了 IPython 环境,安装过程还会生成一个由 **terminado** 提供的基于 web 的 Unix 终端。有人觉得这很实用,也有人觉得这样不是很安全。你可以在配置文件里禁用这个功能。
|
||||
|
||||
### JupyterLab — 下一代 Jupyter
|
||||
|
||||
JupyterLab 是下一代的 Jupyter,拥有更好的用户界面和对工作空间更强的操控性。在写这篇文章的时候 JupyterLab 还没有可用的 RPM 软件包,但是你可以使用 **pip** 轻松完成安装:
|
||||
|
||||
```
|
||||
$ pip3 install jupyterlab --user
|
||||
$ jupyter serverextension enable --py jupyterlab
|
||||
```
|
||||
|
||||
然后运行 **jupiter notebook** 命令或者 **jn** 快捷命令。访问 **<http://your-linux-host.com:8888/**lab**>** LCTT 译注:将域名替换为服务器的域名)就可以使用 JupyterLab 了。
|
||||
|
||||
### 数据科学家使用的工具
|
||||
|
||||
在下面这一节里,你将会了解到数据科学家使用的一些工具及其安装方法。除非另作说明,这些工具应该已经有 Fedora 软件包版本,并且已经作为前面组件所需要的软件包而被安装了。
|
||||
|
||||
#### **Numpy**
|
||||
|
||||
**Numpy** 是一个针对 C 语言优化过的高级库,用来处理内存里的大型数据集。它支持高级多维矩阵及其运算,并且包含了 log()、exp()、三角函数等数学函数。
|
||||
|
||||
#### Pandas
|
||||
|
||||
在我看来,正是 Pandas 成就了 Python 作为数据科学首选平台的地位。Pandas 构建在 numpy 之上,可以让数据准备和数据呈现工作变得简单很多。你可以把它想象成一个没有用户界面的电子表格程序,但是能够处理的数据集要大得多。Pandas 支持从 SQL 数据库或者 CSV 等格式的文件中提取数据、按列或者按行进行操作、数据筛选,以及通过 matplotlib 实现数据可视化的一部分功能。
|
||||
|
||||
#### Matplotlib
|
||||
|
||||
Matplotlib 是一个用来绘制 2D 和 3D 数据图像的库,在图象注解、标签和叠加层方面都提供了相当不错的支持。
|
||||
|
||||
![matplotlib pair of graphics showing a cost function searching its optimal value through a gradient descent algorithm][5]
|
||||
|
||||
#### Seaborn
|
||||
|
||||
Seaborn 构建在 matplotlib 之上,它的绘图功能经过了优化,更加适合数据的统计学研究,比如说可以自动显示所绘制数据的近似回归线或者正态分布曲线。
|
||||
|
||||
![Linear regression visualised with SeaBorn][6]
|
||||
|
||||
#### [StatsModels][7]
|
||||
|
||||
StatsModels 为统计学和经济计量学的数据分析问题(例如线形回归和逻辑回归)提供算法支持,同时提供经典的 [时间序列算法][8] 家族:ARIMA。
|
||||
|
||||
![Normalized number of passengers across time \(blue\) and ARIMA-predicted number of passengers \(red\)][9]
|
||||
|
||||
#### Scikit-learn
|
||||
|
||||
作为机器学习生态系统的核心部件,[scikit][10] 为不同类型的问题提供预测算法,包括 [回归问题][11](算法包括 Elasticnet、Gradient Boosting、随机森林等等)、[分类问题][11] 和聚类问题(算法包括 K-means 和 DBSCAN 等等),并且拥有设计精良的 API。Scikit 还定义了一些专门的 Python 类,用来支持数据操作的高级技巧,比如将数据集拆分为训练集和测试集、降维算法、数据准备管道流程等等。
|
||||
|
||||
#### XGBoost
|
||||
|
||||
XGBoost 是目前可以使用的最先进的回归器和分类器。它并不是 scikit-learn 的一部分,但是却遵循了 scikit 的 API。[XGBoost][12] 并没有针对 Fedora 的软件包,但可以使用 pip 安装。[使用英伟达显卡可以提升 XGBoost 算法的性能][13],但是这并不能通过 **pip** 软件包来实现。如果你希望使用这个功能,可以针对 CUDA (LCTT 译注:英伟达开发的并行计算平台)自己进行编译。使用下面这个命令安装 XGBoost:
|
||||
|
||||
```
|
||||
$ pip3 install xgboost --user
|
||||
```
|
||||
|
||||
#### Imbalanced Learn
|
||||
|
||||
[imbalanced-learn][14] 是一个解决数据欠采样和过采样问题的工具。比如在反欺诈问题中,欺诈数据相对于正常数据来说数量非常小,这个时候就需要对欺诈数据进行数据增强,从而让预测器能够更好地适应数据集。使用 **pip** 安装:
|
||||
|
||||
```
|
||||
$ pip3 install imblearn --user
|
||||
```
|
||||
|
||||
#### NLTK
|
||||
|
||||
[Natural Language toolkit][15](简称 NLTK)是一个处理人类语言数据的工具,举例来说,它可以被用来开发一个聊天机器人。
|
||||
|
||||
|
||||
#### SHAP
|
||||
|
||||
机器学习算法拥有强大的预测能力,但并不能够很好地解释为什么做出这样或那样的预测。[SHAP][16] 可以通过分析训练后的模型来解决这个问题。
|
||||
|
||||
![Where SHAP fits into the data analysis process][17]
|
||||
|
||||
使用 **pip** 安装:
|
||||
|
||||
```
|
||||
$ pip3 install shap --user
|
||||
```
|
||||
|
||||
#### [Keras][18]
|
||||
|
||||
Keras 是一个深度学习和神经网络模型的库,使用 **pip** 安装:
|
||||
|
||||
```
|
||||
$ sudo dnf install python3-h5py
|
||||
$ pip3 install keras --user
|
||||
```
|
||||
|
||||
#### [TensorFlow][19]
|
||||
|
||||
TensorFlow 是一个非常流行的神经网络模型搭建工具,使用 **pip** 安装:
|
||||
|
||||
```
|
||||
$ pip3 install tensorflow --user
|
||||
```
|
||||
|
||||
* * *
|
||||
|
||||
_Photo courtesy of [FolsomNatural][20] on [Flickr][21] (CC BY-SA 2.0)._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/jupyter-and-data-science-in-fedora/
|
||||
|
||||
作者:[Avi Alkalay][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[chen-ni](https://github.com/chen-ni)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://fedoramagazine.org/author/aviram/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2019/06/jupyter-816x345.jpg
|
||||
[2]: http://mathjax.org
|
||||
[3]: https://fedoramagazine.org/howto-use-sudo/
|
||||
[4]: https://avi.alkalay.net/articlefiles/2018/07/jupyter-fedora.png
|
||||
[5]: https://fedoramagazine.org/wp-content/uploads/2019/06/gradient-descent-cost-function-optimization.png
|
||||
[6]: https://seaborn.pydata.org/_images/regression_marginals.png
|
||||
[7]: https://www.statsmodels.org/
|
||||
[8]: https://www.statsmodels.org/stable/examples/index.html#stats
|
||||
[9]: https://fedoramagazine.org/wp-content/uploads/2019/06/time-series.png
|
||||
[10]: https://scikit-learn.org/stable/
|
||||
[11]: https://scikit-learn.org/stable/supervised_learning.html#supervised-learning
|
||||
[12]: https://xgboost.ai
|
||||
[13]: https://xgboost.readthedocs.io/en/latest/gpu/index.html
|
||||
[14]: https://imbalanced-learn.readthedocs.io
|
||||
[15]: https://www.nltk.org
|
||||
[16]: https://github.com/slundberg/shap
|
||||
[17]: https://raw.githubusercontent.com/slundberg/shap/master/docs/artwork/shap_diagram.png
|
||||
[18]: https://keras.io
|
||||
[19]: https://www.tensorflow.org
|
||||
[20]: https://www.flickr.com/photos/87249144@N08/
|
||||
[21]: https://www.flickr.com/photos/87249144@N08/45871861611/
|
Loading…
Reference in New Issue
Block a user