mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-13 22:30:37 +08:00
Merge remote-tracking branch 'LCTT/master'
This commit is contained in:
commit
a4689dfa53
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,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/) 荣誉推出
|
||||
|
@ -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,246 +0,0 @@
|
||||
[#]: 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/)
|
||||
|
||||
Jupyter and data science in Fedora
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
In the past, kings and leaders used oracles and magicians to help them predict the future — or at least get some good advice due to their supposed power to perceive hidden information. Nowadays, we live in a society obsessed with quantifying everything. So we have data scientists to do this job.
|
||||
|
||||
Data scientists use statistical models, numerical techniques and advanced algorithms that didn’t come from statistical disciplines, along with the data that exist on databases, to find, to infer, to predict data that doesn’t exist yet. Sometimes this data is about the future. That is why we do a lot of predictive analytics and prescriptive analytics.
|
||||
|
||||
Here are some questions to which data scientists help find answers:
|
||||
|
||||
1. Who are the students with high propensity to abandon the class? For each one, what are the reasons for leaving?
|
||||
2. Which house has a price above or below the fair price? What is the fair price for a certain house?
|
||||
3. What are the hidden groups that my clients classify themselves?
|
||||
4. Which future problems this premature child will develop?
|
||||
5. How many calls will I get in my call center tomorrow 11:43 AM?
|
||||
6. My bank should or should not lend money to this customer?
|
||||
|
||||
|
||||
|
||||
Note how the answer to all these question is not sitting in any database waiting to be queried. These are all data that still doesn’t exist and has to be calculated. That is part of the job we data scientists do.
|
||||
|
||||
Throughout this article you’ll learn how to prepare a Fedora system as a Data Scientist’s development environment and also a production system. Most of the basic software is RPM-packaged, but the most advanced parts can only be installed, nowadays, with Python’s _pip_ tool.
|
||||
|
||||
### Jupyter — the IDE
|
||||
|
||||
Most modern data scientists use Python. And an important part of their work is EDA (exploratory data analysis). EDA is a manual and interactive process that retrieves data, explores its features, searches for correlations, and uses plotted graphics to visualize and understand how data is shaped and prototypes predictive models.
|
||||
|
||||
Jupyter is a web application perfect for this task. Jupyter works with Notebooks, documents that mix rich text including beautifully rendered math formulas (thanks to [mathjax][2]), blocks of code and code output, including graphics.
|
||||
|
||||
Notebook files have extension _.ipynb_, which means Interactive Python Notebook.
|
||||
|
||||
#### Setting up and running Jupyter
|
||||
|
||||
First, install essential packages for Jupyter ([using][3] _[sudo][3]_):
|
||||
|
||||
```
|
||||
$ sudo dnf install python3-notebook mathjax sscg
|
||||
```
|
||||
|
||||
You might want to install additional and optional Python modules commonly used by data scientists:
|
||||
|
||||
```
|
||||
$ sudo dnf install python3-seaborn python3-lxml python3-basemap python3-scikit-image python3-scikit-learn python3-sympy python3-dask+dataframe python3-nltk
|
||||
```
|
||||
|
||||
Set a password to log into Notebook web interface and avoid those long tokens. Run the following command anywhere on your terminal:
|
||||
|
||||
```
|
||||
$ mkdir -p $HOME/.jupyter
|
||||
$ jupyter notebook password
|
||||
```
|
||||
|
||||
Now, type a password for yourself. This will create the file _$HOME/.jupyter/jupyter_notebook_config.json_ with your encrypted password.
|
||||
|
||||
Next, prepare for SSLby generating a self-signed HTTPS certificate for Jupyter’s web server:
|
||||
|
||||
```
|
||||
$ cd $HOME/.jupyter; sscg
|
||||
```
|
||||
|
||||
Finish configuring Jupyter by editing your _$HOME/.jupyter/jupyter_notebook_config.json_ file. Make it look like this:
|
||||
|
||||
```
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The parts in red must be changed to match your folders. Parts in blue were already there after you created your password. Parts in green are the crypto-related files generated by _sscg_.
|
||||
|
||||
Create a folder for your notebook files, as configured in the _notebook_dir_ setting above:
|
||||
|
||||
```
|
||||
$ mkdir $HOME/Notebooks
|
||||
```
|
||||
|
||||
Now you are all set. Just run Jupyter Notebook from anywhere on your system by typing:
|
||||
|
||||
```
|
||||
$ jupyter notebook
|
||||
```
|
||||
|
||||
Or add this line to your _$HOME/.bashrc_ file to create a shortcut command called _jn_:
|
||||
|
||||
```
|
||||
alias jn='jupyter notebook'
|
||||
```
|
||||
|
||||
After running the command _jn_, access _<https://your-fedora-host.com:8888>_ from any browser on the network to see the Jupyter user interface. You’ll need to use the password you set up earlier. Start typing some Python code and markup text. This is how it looks:
|
||||
|
||||
![Jupyter with a simple notebook][4]
|
||||
|
||||
In addition to the IPython environment, you’ll also get a web-based Unix terminal provided by _terminado_. Some people might find this useful, while others find this insecure. You can disable this feature in the config file.
|
||||
|
||||
### JupyterLab — the next generation of Jupyter
|
||||
|
||||
JupyterLab is the next generation of Jupyter, with a better interface and more control over your workspace. It’s currently not RPM-packaged for Fedora at the time of writing, but you can use _pip_ to get it installed easily:
|
||||
|
||||
```
|
||||
$ pip3 install jupyterlab --user
|
||||
$ jupyter serverextension enable --py jupyterlab
|
||||
```
|
||||
|
||||
Then run your regular _jupiter notebook_ command or _jn_ alias. JupyterLab will be accessible from _<http://your-linux-host.com:8888/**lab>_**.
|
||||
|
||||
### Tools used by data scientists
|
||||
|
||||
In this section you can get to know some of these tools, and how to install them. Unless noted otherwise, the module is already packaged for Fedora and was installed as prerequisites for previous components.
|
||||
|
||||
#### **Numpy**
|
||||
|
||||
_Numpy_ is an advanced and C-optimized math library designed to work with large in-memory datasets. It provides advanced multidimensional matrix support and operations, including math functions as log(), exp(), trigonometry etc.
|
||||
|
||||
#### Pandas
|
||||
|
||||
In this author’s opinion, Python is THE platform for data science mostly because of Pandas. Built on top of numpy, Pandas makes easy the work of preparing and displaying data. You can think of it as a no-UI spreadsheet, but ready to work with much larger datasets. Pandas helps with data retrieval from a SQL database, CSV or other types of files, columns and rows manipulation, data filtering and, to some extent, data visualization with matplotlib.
|
||||
|
||||
#### Matplotlib
|
||||
|
||||
Matplotlib is a library to plot 2D and 3D data. It has great support for notations in graphics, labels and overlays
|
||||
|
||||
![matplotlib pair of graphics showing a cost function searching its optimal value through a gradient descent algorithm][5]
|
||||
|
||||
#### Seaborn
|
||||
|
||||
Built on top of matplotlib, Seaborn’s graphics are optimized for a more statistical comprehension of data. It automatically displays regression lines or Gauss curve approximations of plotted data.
|
||||
|
||||
![Linear regression visualised with SeaBorn][6]
|
||||
|
||||
#### [StatsModels][7]
|
||||
|
||||
StatsModels provides algorithms for statistical and econometrics data analysis such as linear and logistic regressions. Statsmodel is also home for the classical family of [time series algorithms][8] known as ARIMA.
|
||||
|
||||
![Normalized number of passengers across time \(blue\) and ARIMA-predicted number of passengers \(red\)][9]
|
||||
|
||||
#### Scikit-learn
|
||||
|
||||
The central piece of the machine-learning ecosystem, [scikit][10] provides predictor algorithms for [regression][11] (Elasticnet, Gradient Boosting, Random Forest etc) and [classification][11] and clustering (K-means, DBSCAN etc). It features a very well designed API. Scikit also has classes for advanced data manipulation, dataset split into train and test parts, dimensionality reduction and data pipeline preparation.
|
||||
|
||||
#### XGBoost
|
||||
|
||||
XGBoost is the most advanced regressor and classifier used nowadays. It’s not part of scikit-learn, but it adheres to scikit’s API. [XGBoost][12] is not packaged for Fedora and should be installed with pip. [XGBoost can be accelerated with your nVidia GPU][13], but not through its _pip_ package. You can get this if you compile it yourself against CUDA. Get it with:
|
||||
|
||||
```
|
||||
$ pip3 install xgboost --user
|
||||
```
|
||||
|
||||
#### Imbalanced Learn
|
||||
|
||||
[imbalanced-learn][14] provides ways for under-sampling and over-sampling data. It is useful in fraud detection scenarios where known fraud data is very small when compared to non-fraud data. In these cases data augmentation is needed for the known fraud data, to make it more relevant to train predictors. Install it with _pip_:
|
||||
|
||||
```
|
||||
$ pip3 install imblearn --user
|
||||
```
|
||||
|
||||
#### NLTK
|
||||
|
||||
The [Natural Language toolkit][15], or NLTK, helps you work with human language data for the purpose of building chatbots (just to cite an example).
|
||||
|
||||
#### SHAP
|
||||
|
||||
Machine learning algorithms are very good on predicting, but aren’t good at explaining why they made a prediction. [SHAP][16] solves that, by analyzing trained models.
|
||||
|
||||
![Where SHAP fits into the data analysis process][17]
|
||||
|
||||
Install it with _pip_:
|
||||
|
||||
```
|
||||
$ pip3 install shap --user
|
||||
```
|
||||
|
||||
#### [Keras][18]
|
||||
|
||||
Keras is a library for deep learning and neural networks. Install it with _pip_:
|
||||
|
||||
```
|
||||
$ sudo dnf install python3-h5py
|
||||
$ pip3 install keras --user
|
||||
```
|
||||
|
||||
#### [TensorFlow][19]
|
||||
|
||||
TensorFlow is a popular neural networks builder. Install it with _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]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://fedoramagazine.org/author/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/
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (chen-ni)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
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/
|
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/
|
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
|
@ -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
|
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